|
@@ -1019,7 +1019,7 @@
|
|
|
<vuefindex v-if="activeName=='Role'" ref="vuefval" :Xfiol="dialog.Xfiol" :jboptimizer="dialog.jboptimizer" :optimizer="dialog.optimizer" @optimizerfalse="optimizerfalse($event)" ></vuefindex>
|
|
|
<div class="maxh221">
|
|
|
<!-- 中间部分 -->
|
|
|
- <div class="conter_mian classtable " v-if="activeName=='Three'&&tabactive=='列表监控'">
|
|
|
+ <div class="conter_mian classtable " v-if="activeName=='Three'&&tabactive=='列表监控'||activeName=='Three'&&tabactive=='开始'">
|
|
|
<!-- <el-table :data="tableDatalieb" border style="display: flex; flex: 1; overflow: auto;" max-height="600">
|
|
|
<el-table-column type="index" width="30" />
|
|
|
<el-table-column prop="x1" label="x1" />
|
|
@@ -1039,7 +1039,8 @@
|
|
|
<el-table-column prop="x15" label="x15" />
|
|
|
<el-table-column prop="cd" label="cd/cl" />
|
|
|
</el-table> -->
|
|
|
- <el-table :data="tableDatalieb">
|
|
|
+ <el-table :data="tableDatalieb" border style="display: flex; flex: 1; overflow: auto;" height="500">
|
|
|
+ <el-table-column type="index" width="50"></el-table-column>
|
|
|
<el-table-column
|
|
|
v-for="(header, index) in tableHeaders"
|
|
|
:key="index"
|
|
@@ -1047,22 +1048,22 @@
|
|
|
:label="header.label">
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <div @click="tablefun()">点击</div>
|
|
|
+ <!-- <div @click="tablefun()">点击</div> -->
|
|
|
</div>
|
|
|
<!-- 曲线监控 -->
|
|
|
<div class="conter_mian classtable " v-if="activeName=='Three'&&tabactive=='曲线监控'">
|
|
|
- <el-form-item label="" >
|
|
|
+ <!-- <el-form-item label="" >
|
|
|
<el-select v-model="quval" :suffix-icon="CaretBottom" placeholder="请选择">
|
|
|
<el-option v-for="item in quxian" :key="item.value" :label="item.label" :value="item.value">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- </el-form-item>
|
|
|
- <optmonitor :selval="quval"/>
|
|
|
+ </el-form-item> -->
|
|
|
+ <optmonitor ref="optmonitor1" :selval="quval" :curvedata="curvedata"/>
|
|
|
</div>
|
|
|
<!-- 过程监控 -->
|
|
|
<div class="conter_mian classtable conter_flex" v-if="activeName=='Three'&&tabactive=='过程监控'">
|
|
|
- <div class="echart_left ech">left</div>
|
|
|
- <div class="echart_right ech">right</div>
|
|
|
+ <!-- <div class="echart_left ech">left</div>
|
|
|
+ <div class="echart_right ech">right</div> -->
|
|
|
</div>
|
|
|
<!-- 右侧边栏开始 -->
|
|
|
<!-- 结束 -->
|
|
@@ -1354,15 +1355,20 @@
|
|
|
operator:'倒位变异',
|
|
|
gpu:'YES'
|
|
|
})
|
|
|
+ let optmonitor1=ref();
|
|
|
let tableHeaders=ref([
|
|
|
// { label: '日期', prop: 'date' },
|
|
|
// { label: '姓名', prop: 'name' },
|
|
|
// 可以根据需要动态添加或删除表头信息
|
|
|
])
|
|
|
+ let varsobj=ref({});
|
|
|
+ let valsobj=ref({});
|
|
|
+ let tabarr=ref([]);
|
|
|
let arrobj=ref([]);
|
|
|
let tableDatalieb=ref([
|
|
|
// { date: '2016-05-02', name: '王小虎' },
|
|
|
])
|
|
|
+ let curvedata=ref('');
|
|
|
let websock=ref(null);
|
|
|
let times=ref({
|
|
|
lockReconnect: false, //是否真正建立连接
|
|
@@ -1397,7 +1403,7 @@
|
|
|
{ label: '约束条件', value: '约束条件' },
|
|
|
{ label: '目标函数', value: '目标函数' },
|
|
|
])
|
|
|
-let quval = ref("设计变量")
|
|
|
+let quval = ref("")
|
|
|
const activeIndex = ref(0);
|
|
|
const activeIndex2 = ref(0);
|
|
|
const activeIndex3 = ref(0);
|
|
@@ -1712,6 +1718,7 @@ let options3=ref([
|
|
|
setTimeout(function() {
|
|
|
init();
|
|
|
initWebSocket();
|
|
|
+ logsget();
|
|
|
}, 1500);
|
|
|
// childfun();
|
|
|
|
|
@@ -1741,6 +1748,9 @@ console.log(route.query.pid);
|
|
|
tabactive.value=tab.props.name;
|
|
|
if(tabactive.value=='User'){
|
|
|
router.replace({ path: '/' })
|
|
|
+ }else if(tabactive.value=='Three'){
|
|
|
+ // logsget();
|
|
|
+
|
|
|
}
|
|
|
dialogcolse()
|
|
|
}
|
|
@@ -1846,6 +1856,9 @@ console.log(route.query.pid);
|
|
|
break;
|
|
|
case "开始":
|
|
|
runok();
|
|
|
+ break;
|
|
|
+ case "曲线监控":
|
|
|
+ curveLine();
|
|
|
|
|
|
default:
|
|
|
}
|
|
@@ -1859,6 +1872,10 @@ console.log(route.query.pid);
|
|
|
}
|
|
|
request(params)
|
|
|
.then((res) => {
|
|
|
+ arrobj.value=[];
|
|
|
+ tabarr.value=[];
|
|
|
+ tableDatalieb.value=[];
|
|
|
+ tableHeaders.value=[];
|
|
|
ElMessage({
|
|
|
message: "开始运行",
|
|
|
type: 'success',
|
|
@@ -1867,6 +1884,28 @@ console.log(route.query.pid);
|
|
|
.catch((err) => {
|
|
|
ElMessage.error(err.returnMsg)
|
|
|
})
|
|
|
+ }
|
|
|
+ //曲线监控
|
|
|
+ const curveLine= ()=>{
|
|
|
+ const params = {
|
|
|
+ transCode: 'MDO0021',
|
|
|
+ pid:pid.value,
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ request(params)
|
|
|
+ .then((res) => {
|
|
|
+ curvedata.value=JSON.stringify(res.rows);
|
|
|
+ //optmonitor1.value.linechart();
|
|
|
+ optmonitor1.value.linechart( curvedata.value);
|
|
|
+ // ElMessage({
|
|
|
+ // message: "",
|
|
|
+ // type: 'success',
|
|
|
+ // })
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ ElMessage.error(err.returnMsg)
|
|
|
+ })
|
|
|
}
|
|
|
//进化优化器
|
|
|
const getoptimize = () => {
|
|
@@ -2367,25 +2406,50 @@ const params = {
|
|
|
}
|
|
|
}
|
|
|
// 表格
|
|
|
-function tablefun(){
|
|
|
- let varsobj={}
|
|
|
+function tablefun(vals){
|
|
|
+ let arrtable=vals;
|
|
|
+ console.log(arrtable);
|
|
|
+ let obj2={}
|
|
|
let heaarr= arrobj.value[0].vars.split(",");
|
|
|
+ //let heaarr=['x1', 'x2', 'x3', 'x4', 'x5', 'f1']
|
|
|
tableHeaders.value=[];
|
|
|
-heaarr.forEach(function(item) {
|
|
|
- let obj = { label: item ,prop:item}; // 创建新对象
|
|
|
- tableHeaders.value.push(obj);
|
|
|
-
|
|
|
-});
|
|
|
+ heaarr.forEach(function(item) {
|
|
|
+ let obj = {label: item ,prop:item}; // 创建新对象
|
|
|
+ tableHeaders.value.push(obj);
|
|
|
+ });
|
|
|
+ let result = heaarr.map((key, index) => {
|
|
|
+ return { [key]: arrtable[index] };
|
|
|
+ });
|
|
|
+ const mergedObject = result.reduce((accumulator, currentValue) => {
|
|
|
+ return { ...accumulator, ...currentValue };
|
|
|
+}, {});
|
|
|
+ tableDatalieb.value.push(mergedObject);
|
|
|
|
|
|
|
|
|
}
|
|
|
+//获取日志
|
|
|
+const logsget= ()=>{
|
|
|
+ const params = {
|
|
|
+ transCode: 'MDO0025',
|
|
|
+ pid:pid.value,
|
|
|
+ }
|
|
|
+ request(params)
|
|
|
+ .then((res) => {
|
|
|
+ //console.log(res.logs)
|
|
|
+ //let data=JSON.parse(res.logs);
|
|
|
+
|
|
|
+ logs.value=res.logs;
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ ElMessage.error(err.returnMsg)
|
|
|
+ })
|
|
|
+ }
|
|
|
//websockct的连接
|
|
|
function initWebSocket() {
|
|
|
|
|
|
//初始化weosocket
|
|
|
- arrobj.value=[];
|
|
|
// const wsuri = "ws://192.168.0.43:8087//websocket?projectId="+this.pid; ws://192.168.0.131/diswebsocket?projectId=5
|
|
|
- const wsurl = "ws://192.168.104:8188//websocket?projectId="+pid.value;
|
|
|
+ const wsurl = "ws://192.168.106:8188//websocket?projectId="+pid.value;
|
|
|
// const wsurl =
|
|
|
// "ws://" +
|
|
|
// process.env.VUE_APP_BASE_websokt +
|
|
@@ -2405,45 +2469,19 @@ function initWebSocket() {
|
|
|
};
|
|
|
// Websoket接收消息事件
|
|
|
const websocketonmessage = (res) => {
|
|
|
-
|
|
|
if(res.data.indexOf('{') !== -1){
|
|
|
arrobj.value.push(JSON.parse(res.data));
|
|
|
- let vals=(JSON.parse(res.data).vals).split(",");
|
|
|
- let varsobj={};
|
|
|
- let valsobj={};
|
|
|
- let heaarr= arrobj.value[0].vars.split(",");
|
|
|
- tableHeaders.value=[];
|
|
|
- // heaarr.forEach(function(item) {
|
|
|
- for(i=0;i<heaarr.length;i++){
|
|
|
- let obj = { label: item ,prop:item}; // 创建新对象
|
|
|
- tableHeaders.value.push(obj);
|
|
|
- vals.forEach((vals)=> {
|
|
|
- valsobj.heaarr[i]=vals;
|
|
|
- tableDatalieb.value.push(valsobj);
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- // });
|
|
|
-// heaarr.forEach(function(item) {
|
|
|
-
|
|
|
-// });
|
|
|
-// vals.forEach((item)=> {
|
|
|
-// valsobj.
|
|
|
-
|
|
|
-// })
|
|
|
- valsobj={ label: item ,prop:item};
|
|
|
- tablefun();
|
|
|
- //console.log( arrobj.value);
|
|
|
- // let header=(arrobj.vars).split(',');
|
|
|
-
|
|
|
+ let vals=(JSON.parse(res.data).vals).split(" ");
|
|
|
+ tablefun(vals);
|
|
|
}else{
|
|
|
+ if( res.data.indexOf('msg=heartChec') == -1){
|
|
|
logs.value=logs.value+'"\n"'+res.data;
|
|
|
let textarea = document.getElementById("textarea_id");
|
|
|
textarea.scrollTop = textarea.scrollHeight;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
-
|
|
|
reset();
|
|
|
};
|
|
|
|