From 75f043dfa6660716364e66ee0b3cf99f44255686 Mon Sep 17 00:00:00 2001
From: DYL0109 <dn18191638832@163.com>
Date: 星期三, 16 四月 2025 19:20:36 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/develop1.0' into dyl_dev

---
 zhitan-vue/src/views/modelconfiguration/indexwarehouse/components/deviceConfig/DeviceConfig.vue |  124 +++++++++++++++++++++-------------------
 1 files changed, 65 insertions(+), 59 deletions(-)

diff --git a/zhitan-vue/src/views/modelconfiguration/indexwarehouse/components/deviceConfig/DeviceConfig.vue b/zhitan-vue/src/views/modelconfiguration/indexwarehouse/components/deviceConfig/DeviceConfig.vue
index 0e81e80..3928eb6 100644
--- a/zhitan-vue/src/views/modelconfiguration/indexwarehouse/components/deviceConfig/DeviceConfig.vue
+++ b/zhitan-vue/src/views/modelconfiguration/indexwarehouse/components/deviceConfig/DeviceConfig.vue
@@ -1,81 +1,87 @@
 <template>
-
-    <div class="table-box">
-        <el-button class="mb20 " type="primary" icon="Plus" @click="handleAdd">
-            鏂板
-        </el-button>
-        <el-table v-loading="loading" :data="tableData" height="calc(100vh - 370px)">
-            <el-table-column label="鍣ㄥ叿缂栫爜" prop="code" show-overflow-tooltip align="center" />
-            <el-table-column label="鍣ㄥ叿鍚嶇О" prop="meterName" show-overflow-tooltip align="center" />
-            <el-table-column label="閰嶇數瀹�" prop="installactionLocation" show-overflow-tooltip align="center" />
-            <el-table-column label="鎿嶄綔" class-name="small-padding fixed-width" align="center">
-                <template #default="scope">
-                    <el-button link type="primary" icon="Delete" @click="handleDel(scope.row)">
-                        鍒犻櫎
-                    </el-button>
-                </template>
-            </el-table-column>
-        </el-table>
-        <deviceModal ref="deviceModalRef" @deviceConfirmSelect='deviceConfirmSelect' />
-    </div>
+  <div class="table-box">
+    <el-button
+      class="mb20"
+      type="primary"
+      icon="Plus"
+      @click="handleAdd"
+      style="float: right; margin-top: 16px; margin-right: 16px"
+    >
+      鏂板
+    </el-button>
+    <el-table v-loading="loading" :data="tableData" height="calc(100vh - 370px)">
+      <el-table-column label="鍣ㄥ叿缂栫爜" prop="code" show-overflow-tooltip align="center" />
+      <el-table-column label="鍣ㄥ叿鍚嶇О" prop="meterName" show-overflow-tooltip align="center" />
+      <el-table-column label="閰嶇數瀹�" prop="installactionLocation" show-overflow-tooltip align="center" />
+      <el-table-column label="鎿嶄綔" class-name="small-padding fixed-width" align="center">
+        <template #default="scope">
+          <el-button link type="primary" icon="Delete" @click="handleDel(scope.row)"> 鍒犻櫎 </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <deviceModal ref="deviceModalRef" @deviceConfirmSelect="deviceConfirmSelect" />
+  </div>
 </template>
 <script setup>
 let { proxy } = getCurrentInstance()
-import { getSettingDevice, setDevice, delDevice } from '@/api/modelConfiguration/businessModel'
-import deviceModal from './DeviceModal.vue'
+import { getSettingDevice, setDevice, delDevice } from "@/api/modelConfiguration/businessModel"
+import deviceModal from "./DeviceModal.vue"
 let tableData = ref([])
 let loading = ref(false)
 let currentNode = ref(null)
 function getList(modelNode) {
-    if (!modelNode) {
-        tableData.value = []
-        return
+  if (!modelNode) {
+    tableData.value = []
+    return
+  }
+  currentNode.value = modelNode
+  loading.value = true
+  getSettingDevice(modelNode.id).then((response) => {
+    if (response.code === 200) {
+      tableData.value = response.data
+      loading.value = false
+    } else {
+      proxy.$modal.msgError(response.msg)
     }
-    currentNode.value = modelNode
-    loading.value = true;
-    getSettingDevice(modelNode.id).then((response) => {
-        if (response.code === 200) {
-            tableData.value = response.data;
-            loading.value = false;
-        } else {
-            proxy.$modal.msgError(response.msg);
-        }
-    });
+  })
 }
 
 function handleDel(row) {
-    proxy.$modal.confirm('鏄惁纭鍒犻櫎鏁版嵁椤�?').then(function () {
-        return delDevice(currentNode.value.id, row.id); // 鐩存帴璋冪敤delDevice锛岃�屼笉鏄痟andleDelDevice
-    }).then((response) => {
-        if (response.code === 200) {
-            // 鍒犻櫎鎴愬姛锛屾洿鏂拌〃鏍兼暟鎹�
-            tableData.value = tableData.value.filter(f => f.id !== row.id);
-            proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-        } else {
-            // 鍒犻櫎澶辫触锛屾樉绀洪敊璇秷鎭�
-            proxy.$modal.msgError(response.msg);
-        }
-    }).catch(() => {
-    });
+  proxy.$modal
+    .confirm("鏄惁纭鍒犻櫎鏁版嵁椤�?")
+    .then(function () {
+      return delDevice(currentNode.value.id, row.id) // 鐩存帴璋冪敤delDevice锛岃�屼笉鏄痟andleDelDevice
+    })
+    .then((response) => {
+      if (response.code === 200) {
+        // 鍒犻櫎鎴愬姛锛屾洿鏂拌〃鏍兼暟鎹�
+        tableData.value = tableData.value.filter((f) => f.id !== row.id)
+        proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛")
+      } else {
+        // 鍒犻櫎澶辫触锛屾樉绀洪敊璇秷鎭�
+        proxy.$modal.msgError(response.msg)
+      }
+    })
+    .catch(() => {})
 }
 let deviceModalRef = ref(null)
 function handleAdd() {
-    if (deviceModalRef.value) {
-        deviceModalRef.value.handleOpen(tableData.value)
-    }
+  if (deviceModalRef.value) {
+    deviceModalRef.value.handleOpen(tableData.value)
+  }
 }
 function deviceConfirmSelect(selectedDevice) {
-    tableData.value = selectedDevice;
-    let deviceIds = selectedDevice.map(item => item.id);
-    setDevice(currentNode.value.id, deviceIds).then((response) => {
-        if (response.code !== 200) {
-            proxy.$modal.msgError(response.msg)
-        }
-    });
+  tableData.value = selectedDevice
+  let deviceIds = selectedDevice.map((item) => item.id)
+  setDevice(currentNode.value.id, deviceIds).then((response) => {
+    if (response.code !== 200) {
+      proxy.$modal.msgError(response.msg)
+    }
+  })
 }
 defineExpose({
-    getList
-});
+  getList,
+})
 </script>
 
 <style scoped lang="scss">

--
Gitblit v1.9.3