通讯链路:excel修改逻辑
This commit is contained in:
parent
578633b1ae
commit
19a8861d3c
@ -72,7 +72,7 @@
|
||||
<el-tree :data="correctionDevice" :props="repalceDeviceTreeKey" node-key="id" draggable :allow-drop="dropJudge">
|
||||
<template #default="{ node, data }">
|
||||
<div class="correctionTreeItem">
|
||||
<span>{{ correctionDevice.findIndex((item: any) => item.id === node.key) + 1 + '、' + data.name }}</span>
|
||||
<span>{{ correctionDevice.findIndex((item) => item === data) + 1 + '、' + data.name }}</span>
|
||||
<div class="rightItem">
|
||||
<el-input v-if="data.isEdit" v-model="data.iotAddr" @keyup.enter="okEdit(data)" @blur="okEdit(data)"></el-input>
|
||||
<el-tag v-else type="info" @click="editAttr(data)">{{ data.iotAddr }}</el-tag>
|
||||
@ -183,6 +183,8 @@ const init = async () => {
|
||||
const sheetData = createSheetData(reqSheetData, 12)
|
||||
const data = createWookbookData(route.query.protocol as any, route.query.id as string, sheetData)
|
||||
initExcel(data)
|
||||
getTreeDataType()
|
||||
getBindDeviceTree()
|
||||
}
|
||||
|
||||
const initExcel = (data = {}) => {
|
||||
@ -330,14 +332,15 @@ const okEdit = (data: any) => {
|
||||
data.isEdit = false
|
||||
}
|
||||
const submitcorrectionDevice = () => {
|
||||
const bindDeviceId = correctionDevice.value.map((item: any) => {
|
||||
const bindDevice = correctionDevice.value.map((item: any, index) => {
|
||||
return {
|
||||
equipmentId: item.id,
|
||||
iotAddr: item.iotAddr,
|
||||
porder: index + 1,
|
||||
}
|
||||
})
|
||||
|
||||
bindDeviceMeasReq({ equipmentId: bindDeviceId, linkId: route.query.id }).then((res) => {
|
||||
bindDeviceMeasReq({ equipmentId: bindDevice, linkId: route.query.id }).then((res) => {
|
||||
ElMessage.success('关联成功!')
|
||||
closecorrectionDevice()
|
||||
})
|
||||
@ -378,6 +381,7 @@ const getBindDeviceTree = () => {
|
||||
id: item.equipmentId,
|
||||
name: item.equipmentName,
|
||||
iotAddr: item.iotAddr,
|
||||
porder: item.porder,
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -472,8 +476,6 @@ const goToNodePage = () => {
|
||||
|
||||
onMounted(() => {
|
||||
init()
|
||||
getTreeDataType()
|
||||
getBindDeviceTree()
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user