|
|
|
|
@ -2,9 +2,13 @@ |
|
|
|
|
<basic-container> |
|
|
|
|
<!-- 记录仪管理 --> |
|
|
|
|
<el-tabs v-model="tabPosition" class="demo-tabs" @tab-change="tabPositionChange"> |
|
|
|
|
<el-tab-pane label="记录仪" name="recorder"> |
|
|
|
|
<el-tab-pane label="记录仪" name="recorder"> </el-tab-pane> |
|
|
|
|
<el-tab-pane label="记录仪曲线配置" name="recorderLineSetting"> </el-tab-pane> |
|
|
|
|
<el-tab-pane label="记录仪历史曲线" name="recorderHistoryLine"> </el-tab-pane> |
|
|
|
|
</el-tabs> |
|
|
|
|
|
|
|
|
|
<avue-crud |
|
|
|
|
:height="460" |
|
|
|
|
v-if="tabPosition == 'recorder'" |
|
|
|
|
:option="option" |
|
|
|
|
:table-loading="loading" |
|
|
|
|
:data="data" |
|
|
|
|
@ -21,7 +25,6 @@ |
|
|
|
|
@current-change="currentChange" |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@refresh-change="refreshChange" |
|
|
|
|
|
|
|
|
|
> |
|
|
|
|
<template #menu="{ row, index, size }"> |
|
|
|
|
<el-button type="text" @click="showDetail(row)" v-if="tabPosition == 'recorder'" |
|
|
|
|
@ -56,10 +59,9 @@ |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
</el-tab-pane> |
|
|
|
|
<el-tab-pane label="记录仪曲线配置" name="recorderLineSetting"> |
|
|
|
|
|
|
|
|
|
<avue-crud |
|
|
|
|
:height="460" |
|
|
|
|
v-if="tabPosition == 'recorderLineSetting'" |
|
|
|
|
:option="option" |
|
|
|
|
:table-loading="loading" |
|
|
|
|
:data="data" |
|
|
|
|
@ -86,10 +88,7 @@ |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
<template #menu-left> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
@click="handleAdd" |
|
|
|
|
v-if="tabPosition == 'recorderLineSetting'" |
|
|
|
|
<el-button type="primary" @click="handleAdd" v-if="tabPosition == 'recorderLineSetting'" |
|
|
|
|
>新增</el-button |
|
|
|
|
> |
|
|
|
|
<el-button |
|
|
|
|
@ -108,8 +107,8 @@ |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
</el-tab-pane> |
|
|
|
|
<el-tab-pane label="记录仪历史曲线" name="recorderHistoryLine"> |
|
|
|
|
|
|
|
|
|
<div v-if="tabPosition == 'recorderHistoryLine'"> |
|
|
|
|
<el-form |
|
|
|
|
:inline="true" |
|
|
|
|
:model="searchForm" |
|
|
|
|
@ -140,8 +139,8 @@ |
|
|
|
|
<div style="width: 100%; height: 70vh"> |
|
|
|
|
<div style="width: 100%; height: 100%" ref="historyCurve"></div> |
|
|
|
|
</div> |
|
|
|
|
</el-tab-pane> |
|
|
|
|
</el-tabs> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-dialog append-to-body title="详情" width="80%" v-model="detailDialog"> |
|
|
|
|
<avue-crud |
|
|
|
|
class="detail-crud-option" |
|
|
|
|
@ -216,14 +215,9 @@ |
|
|
|
|
<el-button type="primary" @click="insertEvent()">插入一行</el-button> |
|
|
|
|
<el-button plain type="danger" @click="remove">删除选择行</el-button> |
|
|
|
|
</div> |
|
|
|
|
<el-form |
|
|
|
|
ref="tableForm" |
|
|
|
|
:model="lineForm" |
|
|
|
|
:rules="formRules" |
|
|
|
|
label-width="0px" |
|
|
|
|
> |
|
|
|
|
<el-form ref="tableForm" :model="lineForm" :rules="formRules" label-width="0px"> |
|
|
|
|
<!-- 全局错误提示 --> |
|
|
|
|
<div v-if="formError" class="error-message" style="color: #f56c6c; margin-bottom: 10px;"> |
|
|
|
|
<div v-if="formError" class="error-message" style="color: #f56c6c; margin-bottom: 10px"> |
|
|
|
|
{{ formError }} |
|
|
|
|
</div> |
|
|
|
|
<el-table :data="lineForm.settingData" @select="selectChange"> |
|
|
|
|
@ -234,23 +228,29 @@ |
|
|
|
|
</template> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-form-item :prop="`settingData[${scope.$index}].name`" :rules="formRules.name"> |
|
|
|
|
<el-input style="margin-top:10px;" v-model="scope.row.name"></el-input> |
|
|
|
|
<el-input style="margin-top: 10px" v-model="scope.row.name"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="参数显示名称" prop="showName" align="center"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-form-item :prop="`settingData[${scope.$index}].showName`" :rules="formRules.showName"> |
|
|
|
|
<el-input style="margin-top:10px;" v-model="scope.row.showName"></el-input> |
|
|
|
|
<el-form-item |
|
|
|
|
:prop="`settingData[${scope.$index}].showName`" |
|
|
|
|
:rules="formRules.showName" |
|
|
|
|
> |
|
|
|
|
<el-input style="margin-top: 10px" v-model="scope.row.showName"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="是否显示曲线图" prop="showGraph" align="center"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-form-item :prop="`settingData[${scope.$index}].showGraph`" :rules="formRules.showGraph"> |
|
|
|
|
<div style="width:100%;display:flex;justify-content: center;"> |
|
|
|
|
<el-form-item |
|
|
|
|
:prop="`settingData[${scope.$index}].showGraph`" |
|
|
|
|
:rules="formRules.showGraph" |
|
|
|
|
> |
|
|
|
|
<div style="width: 100%; display: flex; justify-content: center"> |
|
|
|
|
<el-switch |
|
|
|
|
style="margin-top:10px;" |
|
|
|
|
style="margin-top: 10px" |
|
|
|
|
v-model="scope.row.showGraph" |
|
|
|
|
active-color="#13ce66" |
|
|
|
|
inactive-color="#ff4949" |
|
|
|
|
@ -265,7 +265,7 @@ |
|
|
|
|
<!-- <el-input v-model="scope.row.crcX"></el-input> --> |
|
|
|
|
<el-form-item :prop="`settingData[${scope.$index}].crcX`" :rules="formRules.crcX"> |
|
|
|
|
<el-input |
|
|
|
|
style="margin-top:10px;" |
|
|
|
|
style="margin-top: 10px" |
|
|
|
|
v-model.number="scope.row.crcX" |
|
|
|
|
oninput="scope.row.crcX=scope.row.crcX.replace(/[^\d]/g,'')" |
|
|
|
|
></el-input> |
|
|
|
|
@ -286,9 +286,23 @@ |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import recorderColumnData from './js/recorderColumnData'; |
|
|
|
|
import { getRecorderList,addRecorder,updateRecorder,deleteRecorder,getRecorderDetail,addpackCycle, |
|
|
|
|
getpackCycleList,updatepackCycle,getRecorderLineSetting,addRecorderLineSetting,getRecorderLineSettingDetail, |
|
|
|
|
updateRecorderLineSetting,deleteRecorderLineSetting,getRecorderHistoryLine,getRecorderHistoryDetail } from '@/api/equiptManagement/recorderList'; |
|
|
|
|
import { |
|
|
|
|
getRecorderList, |
|
|
|
|
addRecorder, |
|
|
|
|
updateRecorder, |
|
|
|
|
deleteRecorder, |
|
|
|
|
getRecorderDetail, |
|
|
|
|
addpackCycle, |
|
|
|
|
getpackCycleList, |
|
|
|
|
updatepackCycle, |
|
|
|
|
getRecorderLineSetting, |
|
|
|
|
addRecorderLineSetting, |
|
|
|
|
getRecorderLineSettingDetail, |
|
|
|
|
updateRecorderLineSetting, |
|
|
|
|
deleteRecorderLineSetting, |
|
|
|
|
getRecorderHistoryLine, |
|
|
|
|
getRecorderHistoryDetail, |
|
|
|
|
} from '@/api/equiptManagement/recorderList'; |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
@ -306,7 +320,7 @@ export default { |
|
|
|
|
data: [], |
|
|
|
|
form: {}, |
|
|
|
|
lineForm: { |
|
|
|
|
settingData:[] |
|
|
|
|
settingData: [], |
|
|
|
|
}, |
|
|
|
|
detailDialog: false, |
|
|
|
|
detailData: [], |
|
|
|
|
@ -458,7 +472,7 @@ export default { |
|
|
|
|
required: true, |
|
|
|
|
message: '请至少添加一行数据', |
|
|
|
|
trigger: 'submit', |
|
|
|
|
type: 'array' // 明确类型为数组 |
|
|
|
|
type: 'array', // 明确类型为数组 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
validator: (rule, value, callback) => { |
|
|
|
|
@ -468,15 +482,13 @@ export default { |
|
|
|
|
callback(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
trigger: 'submit' |
|
|
|
|
} |
|
|
|
|
trigger: 'submit', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
// 数组中每一项的 name 字段校验 |
|
|
|
|
name: [ |
|
|
|
|
{ required: true, message: '请输入参数名称', trigger: ['change', 'submit'] } |
|
|
|
|
], |
|
|
|
|
} |
|
|
|
|
name: [{ required: true, message: '请输入参数名称', trigger: ['change', 'submit'] }], |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
@ -491,19 +503,19 @@ export default { |
|
|
|
|
let params = { |
|
|
|
|
code: this.searchForm.code, |
|
|
|
|
startDate: this.searchForm.queryDate[0], |
|
|
|
|
endDate: this.searchForm.queryDate[1] |
|
|
|
|
} |
|
|
|
|
endDate: this.searchForm.queryDate[1], |
|
|
|
|
}; |
|
|
|
|
getRecorderHistoryLine(params).then(res => { |
|
|
|
|
console.log('res-----------',res) |
|
|
|
|
console.log('res-----------', res); |
|
|
|
|
let chartData = { |
|
|
|
|
yArray: res.data.data.yarray, |
|
|
|
|
crcX: res.data.data.x, |
|
|
|
|
xData:res.data.data.xdata |
|
|
|
|
} |
|
|
|
|
xData: res.data.data.xdata, |
|
|
|
|
}; |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.setEchart(chartData); |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
// let chartData = { |
|
|
|
|
// yArray: [ |
|
|
|
|
// { |
|
|
|
|
@ -778,69 +790,67 @@ export default { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
searchChange(params, done) { |
|
|
|
|
if (this.tabPosition == "recorder") { |
|
|
|
|
if (this.tabPosition == 'recorder') { |
|
|
|
|
this.query = params; |
|
|
|
|
this.query.crtCode = this.query.recorder |
|
|
|
|
this.query.crtCode = this.query.recorder; |
|
|
|
|
this.recorderPage.currentPage = 1; |
|
|
|
|
this.getRecorder() |
|
|
|
|
done() |
|
|
|
|
this.getRecorder(); |
|
|
|
|
done(); |
|
|
|
|
} else if (this.tabPosition == 'recorderLineSetting') { |
|
|
|
|
this.lineQuery = params; |
|
|
|
|
this.recorderLinePage.currentPage = 1 |
|
|
|
|
this.getRecorderLine() |
|
|
|
|
done() |
|
|
|
|
this.recorderLinePage.currentPage = 1; |
|
|
|
|
this.getRecorderLine(); |
|
|
|
|
done(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
remoteMethod(query) { |
|
|
|
|
if (query) { |
|
|
|
|
this.selectLoading = true |
|
|
|
|
this.selectLoading = true; |
|
|
|
|
getRecorderList({ crtCode: query }).then(res => { |
|
|
|
|
this.codeArr = res.data.data.records |
|
|
|
|
this.selectLoading = false |
|
|
|
|
}) |
|
|
|
|
this.codeArr = res.data.data.records; |
|
|
|
|
this.selectLoading = false; |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
getRecorderList({ crtCode: '' }).then(res => { |
|
|
|
|
this.codeArr = res.data.data.records |
|
|
|
|
this.selectLoading = false |
|
|
|
|
}) |
|
|
|
|
this.codeArr = res.data.data.records; |
|
|
|
|
this.selectLoading = false; |
|
|
|
|
}); |
|
|
|
|
// this.codeArr = [] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
searchReset() { |
|
|
|
|
if (this.tabPosition == "recorder") { |
|
|
|
|
this.query = {} |
|
|
|
|
this.getRecorder() |
|
|
|
|
}else if(this.tabPosition == "recorderLineSetting"){ |
|
|
|
|
this.lineQuery = {} |
|
|
|
|
this.getRecorderLine() |
|
|
|
|
if (this.tabPosition == 'recorder') { |
|
|
|
|
this.query = {}; |
|
|
|
|
this.getRecorder(); |
|
|
|
|
} else if (this.tabPosition == 'recorderLineSetting') { |
|
|
|
|
this.lineQuery = {}; |
|
|
|
|
this.getRecorderLine(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
handleDelete() { |
|
|
|
|
if (this.selectionList.length == 0) { |
|
|
|
|
this.$message.error('请至少选择一条数据') |
|
|
|
|
return |
|
|
|
|
this.$message.error('请至少选择一条数据'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", { |
|
|
|
|
confirmButtonText: "确认", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning", |
|
|
|
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { |
|
|
|
|
confirmButtonText: '确认', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(() => { |
|
|
|
|
if(this.tabPosition == "recorderLineSetting"){ |
|
|
|
|
if (this.tabPosition == 'recorderLineSetting') { |
|
|
|
|
deleteRecorderLineSetting({ |
|
|
|
|
ids:this.selectionList.map(item => item.id).join(',') |
|
|
|
|
ids: this.selectionList.map(item => item.id).join(','), |
|
|
|
|
}).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('删除成功') |
|
|
|
|
this.getRecorderLine() |
|
|
|
|
this.$message.success('删除成功'); |
|
|
|
|
this.getRecorderLine(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
selectionChange(list) { |
|
|
|
|
this.selectionList = list |
|
|
|
|
this.selectionList = list; |
|
|
|
|
}, |
|
|
|
|
getRecorder() { |
|
|
|
|
getRecorderList({ |
|
|
|
|
@ -856,11 +866,11 @@ export default { |
|
|
|
|
getRecorderLineSetting({ |
|
|
|
|
current: this.recorderLinePage.currentPage, |
|
|
|
|
size: this.recorderLinePage.pageSize, |
|
|
|
|
...this.lineQuery |
|
|
|
|
...this.lineQuery, |
|
|
|
|
}).then(res => { |
|
|
|
|
this.data = res.data.data.records |
|
|
|
|
this.recorderLinePage.total = res.data.data.total |
|
|
|
|
}) |
|
|
|
|
this.data = res.data.data.records; |
|
|
|
|
this.recorderLinePage.total = res.data.data.total; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// tab切换 |
|
|
|
|
tabPositionChange(val) { |
|
|
|
|
@ -869,14 +879,14 @@ export default { |
|
|
|
|
this.option.column = recorderColumnData[val]; |
|
|
|
|
if (this.tabPosition == 'recorderLineSetting') { |
|
|
|
|
this.option.addBtn = false; |
|
|
|
|
this.option.menuAlign = "center" |
|
|
|
|
this.option.menuWidth = 70 |
|
|
|
|
this.option.selection = true |
|
|
|
|
this.getRecorderLine() |
|
|
|
|
this.option.menuAlign = 'center'; |
|
|
|
|
this.option.menuWidth = 70; |
|
|
|
|
this.option.selection = true; |
|
|
|
|
this.getRecorderLine(); |
|
|
|
|
} else if (this.tabPosition == 'recorder') { |
|
|
|
|
this.option.addBtn = true |
|
|
|
|
this.option.menuWidth = 150 |
|
|
|
|
this.option.selection = false |
|
|
|
|
this.option.addBtn = true; |
|
|
|
|
this.option.menuWidth = 150; |
|
|
|
|
this.option.selection = false; |
|
|
|
|
this.getRecorder(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
@ -888,47 +898,49 @@ export default { |
|
|
|
|
row._select = !row._select; |
|
|
|
|
}, |
|
|
|
|
rowSave(row, done, loading) { |
|
|
|
|
if(this.tabPosition == "recorder"){ |
|
|
|
|
if (this.tabPosition == 'recorder') { |
|
|
|
|
let params = { |
|
|
|
|
crtCode: row.crtCode, |
|
|
|
|
memo:row.memo |
|
|
|
|
} |
|
|
|
|
addRecorder(params).then(res =>{ |
|
|
|
|
memo: row.memo, |
|
|
|
|
}; |
|
|
|
|
addRecorder(params) |
|
|
|
|
.then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('新增成功') |
|
|
|
|
done() |
|
|
|
|
this.getRecorder() |
|
|
|
|
this.$message.success('新增成功'); |
|
|
|
|
done(); |
|
|
|
|
this.getRecorder(); |
|
|
|
|
} |
|
|
|
|
}).catch(err =>{ |
|
|
|
|
done() |
|
|
|
|
}) |
|
|
|
|
.catch(err => { |
|
|
|
|
done(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
rowUpdate(row, index, done, loading) { |
|
|
|
|
if(this.tabPosition == "recorder"){ |
|
|
|
|
if (this.tabPosition == 'recorder') { |
|
|
|
|
let params = { |
|
|
|
|
id: row.id, |
|
|
|
|
crtCode: row.crtCode, |
|
|
|
|
memo:row.memo |
|
|
|
|
} |
|
|
|
|
memo: row.memo, |
|
|
|
|
}; |
|
|
|
|
updateRecorder(params).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('修改成功') |
|
|
|
|
done() |
|
|
|
|
this.getRecorder() |
|
|
|
|
this.$message.success('修改成功'); |
|
|
|
|
done(); |
|
|
|
|
this.getRecorder(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
beforeOpen(done, type) { |
|
|
|
|
console.log('type=============',type) |
|
|
|
|
console.log('type=============', type); |
|
|
|
|
if (['edit', 'view'].includes(type)) { |
|
|
|
|
getRecorderDetail({ id: this.form.id }).then(res => { |
|
|
|
|
this.form = res.data.data; |
|
|
|
|
done() |
|
|
|
|
done(); |
|
|
|
|
}); |
|
|
|
|
} else if (['add'].includes(type)) { |
|
|
|
|
done() |
|
|
|
|
done(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
remove() { |
|
|
|
|
@ -951,16 +963,16 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
closeDialog() { |
|
|
|
|
this.formError = '' |
|
|
|
|
this.formError = ''; |
|
|
|
|
this.$refs.tableForm?.resetFields(); |
|
|
|
|
this.lineForm.settingData = [] |
|
|
|
|
this.addDialog = false |
|
|
|
|
this.lineForm.settingData = []; |
|
|
|
|
this.addDialog = false; |
|
|
|
|
}, |
|
|
|
|
handleSave() { |
|
|
|
|
this.formError = ''; |
|
|
|
|
if (this.deviceCode == '' && this.addType == 'add') { |
|
|
|
|
this.$message.error('设备编码不能为空') |
|
|
|
|
return |
|
|
|
|
this.$message.error('设备编码不能为空'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 调用单个 Form 的校验方法 |
|
|
|
|
@ -979,49 +991,49 @@ export default { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.lineForm.settingData.map(item => { |
|
|
|
|
item.code = this.addType == 'add' ? this.deviceCode : item.code |
|
|
|
|
item.showGraph = item.showGraph == true ? 1 : 0 |
|
|
|
|
}) |
|
|
|
|
item.code = this.addType == 'add' ? this.deviceCode : item.code; |
|
|
|
|
item.showGraph = item.showGraph == true ? 1 : 0; |
|
|
|
|
}); |
|
|
|
|
if (this.addType == 'add') { |
|
|
|
|
addRecorderLineSetting({ |
|
|
|
|
code: this.deviceCode, |
|
|
|
|
recorderCompareEntities:this.lineForm.settingData |
|
|
|
|
recorderCompareEntities: this.lineForm.settingData, |
|
|
|
|
}).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('新增成功') |
|
|
|
|
this.getRecorderLine() |
|
|
|
|
this.$message.success('新增成功'); |
|
|
|
|
this.getRecorderLine(); |
|
|
|
|
this.addDialog = false; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
updateRecorderLineSetting({ ...this.lineForm.settingData[0] }).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('修改成功') |
|
|
|
|
this.getRecorderLine() |
|
|
|
|
this.$message.success('修改成功'); |
|
|
|
|
this.getRecorderLine(); |
|
|
|
|
this.addDialog = false; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// this.addDialog = false; |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
rowEdit(row, index) { |
|
|
|
|
if (this.tabPosition == 'recorder') { |
|
|
|
|
this.$refs.crud.rowEdit(row, index); |
|
|
|
|
} else if (this.tabPosition == 'recorderLineSetting') { |
|
|
|
|
this.lineForm.settingData = [] |
|
|
|
|
this.lineForm.settingData = []; |
|
|
|
|
this.addType = 'edit'; |
|
|
|
|
getRecorderLineSettingDetail({ |
|
|
|
|
id:row.id |
|
|
|
|
id: row.id, |
|
|
|
|
}).then(res => { |
|
|
|
|
console.log('res00000000000000000',res) |
|
|
|
|
res.data.data.showGraph = res.data.data.showGraph == 1 ? true : false |
|
|
|
|
this.lineForm.settingData[0] = res.data.data |
|
|
|
|
console.log('res00000000000000000', res); |
|
|
|
|
res.data.data.showGraph = res.data.data.showGraph == 1 ? true : false; |
|
|
|
|
this.lineForm.settingData[0] = res.data.data; |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.addDialog = true; |
|
|
|
|
},100) |
|
|
|
|
}) |
|
|
|
|
}, 100); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
showDetail(row) { |
|
|
|
|
@ -1035,11 +1047,11 @@ export default { |
|
|
|
|
setCycle() { |
|
|
|
|
getpackCycleList({ |
|
|
|
|
current: 1, |
|
|
|
|
size:10 |
|
|
|
|
size: 10, |
|
|
|
|
}).then(res => { |
|
|
|
|
this.setForm = res.data.data.records.length > 0 ? res.data.data.records[0] : {} |
|
|
|
|
this.setForm = res.data.data.records.length > 0 ? res.data.data.records[0] : {}; |
|
|
|
|
this.settingDialog = true; |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleAdd() { |
|
|
|
|
this.addType = 'add'; |
|
|
|
|
@ -1054,8 +1066,8 @@ export default { |
|
|
|
|
if (this.tabPosition == 'recorder') { |
|
|
|
|
deleteRecorder({ ids: row.id }).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('删除成功') |
|
|
|
|
this.getRecorder() |
|
|
|
|
this.$message.success('删除成功'); |
|
|
|
|
this.getRecorder(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
@ -1067,19 +1079,18 @@ export default { |
|
|
|
|
if (!this.setForm.id) { |
|
|
|
|
addpackCycle(this.setForm).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('保存成功') |
|
|
|
|
this.$message.success('保存成功'); |
|
|
|
|
this.settingDialog = false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
updatepackCycle(this.setForm).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('保存成功') |
|
|
|
|
this.$message.success('保存成功'); |
|
|
|
|
this.settingDialog = false; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
@ -1088,21 +1099,21 @@ export default { |
|
|
|
|
// id:this.detailId, |
|
|
|
|
recorder: this.detailId, |
|
|
|
|
current: this.detailPage.currentPage, |
|
|
|
|
size:this.detailPage.pageSize |
|
|
|
|
size: this.detailPage.pageSize, |
|
|
|
|
}).then(res => { |
|
|
|
|
console.log('res',res) |
|
|
|
|
this.detailData = res.data.data.records |
|
|
|
|
this.detailPage.total = res.data.data.total |
|
|
|
|
console.log('res', res); |
|
|
|
|
this.detailData = res.data.data.records; |
|
|
|
|
this.detailPage.total = res.data.data.total; |
|
|
|
|
this.detailDialog = true; |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
detailCurrentChange(currentPage) { |
|
|
|
|
this.detailPage.currentPage = currentPage |
|
|
|
|
this.loadData() |
|
|
|
|
this.detailPage.currentPage = currentPage; |
|
|
|
|
this.loadData(); |
|
|
|
|
}, |
|
|
|
|
detailSizeChange(pageSize) { |
|
|
|
|
this.detailPage.pageSize = pageSize |
|
|
|
|
this.loadData() |
|
|
|
|
this.detailPage.pageSize = pageSize; |
|
|
|
|
this.loadData(); |
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
|
this.data = [ |
|
|
|
|
|