|
|
|
@ -42,10 +42,10 @@ |
|
|
|
|
<el-table :data="controlLogList" height="305px"> |
|
|
|
|
<el-table-column label="序号" type="index" :index="indexMethod1" width="60"></el-table-column> |
|
|
|
|
<el-table-column label="设备名称" align="center" prop="deviceName"/> |
|
|
|
|
<el-table-column label="操作内容" align="center" prop="controlValue" width="700"/> |
|
|
|
|
<el-table-column label="操作内容" align="center" prop="controlValue" width="700" :formatter="formatControlKeyValue"/> |
|
|
|
|
<el-table-column label="操作时间" align="center" prop="createTime"/> |
|
|
|
|
<el-table-column label="操作人员" align="center" prop="createBy"/> |
|
|
|
|
<el-table-column label="操作结果" align="center" prop="controlResult"></el-table-column> |
|
|
|
|
<el-table-column label="操作结果" align="center" prop="controlContext" :formatter="formatControlResult"></el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<el-pagination |
|
|
|
|
v-model:current-page="currentPage" |
|
|
|
@ -160,6 +160,25 @@ function getControlLogListFun(){ |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//拼接操作内容 |
|
|
|
|
function formatControlKeyValue(row){ |
|
|
|
|
// console.log(row) |
|
|
|
|
if(!isNaN(row.controlValue)){ |
|
|
|
|
row.controlValue = row.controlValue + '℃' |
|
|
|
|
} |
|
|
|
|
return row.controlKey + ':' + row.controlValue |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//操作结果样式 |
|
|
|
|
// function formatControlResult(row){ |
|
|
|
|
// if(row.controlResult == '控制成功'){ |
|
|
|
|
// return '<span style="color: #14FF00">控制成功</span>'; |
|
|
|
|
// } |
|
|
|
|
// if(row.controlResult == '控制失败'){ |
|
|
|
|
// return '<span style="color: red">控制失败</span>'; |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
//翻页时不刷新序号 |
|
|
|
|
function indexMethod1(index){ |
|
|
|
|
return index+(currentPage.value-1)*pageSize.value+1 |
|
|
|
@ -203,7 +222,7 @@ function selectCeLue(item){ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//最终要传参的格式 |
|
|
|
|
console.log(JSON.stringify(dataArr, null, 4)); |
|
|
|
|
// console.log(JSON.stringify(dataArr, null, 4)); |
|
|
|
|
SenceControlArr.value = JSON.stringify(dataArr, null, 4) |
|
|
|
|
} |
|
|
|
|
//执行 |
|
|
|
@ -211,7 +230,9 @@ function confirmClick() { |
|
|
|
|
ElMessageBox.confirm(`确定执行 ${radio.value} ?`).then(() => { |
|
|
|
|
drawerIshow.value = false; |
|
|
|
|
getSenceControl(SenceControlArr.value).then((res)=>{ |
|
|
|
|
console.log(res) |
|
|
|
|
if(res.code == 200){ |
|
|
|
|
ElMessage.success('策略导入成功') |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|