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/businessmodel/components/statisticalIndicators/statisticalIndicators.vue |  141 +++++++++++++++++++++++-----------------------
 1 files changed, 71 insertions(+), 70 deletions(-)

diff --git a/zhitan-vue/src/views/modelconfiguration/businessmodel/components/statisticalIndicators/statisticalIndicators.vue b/zhitan-vue/src/views/modelconfiguration/businessmodel/components/statisticalIndicators/statisticalIndicators.vue
index 076edcf..c042e37 100644
--- a/zhitan-vue/src/views/modelconfiguration/businessmodel/components/statisticalIndicators/statisticalIndicators.vue
+++ b/zhitan-vue/src/views/modelconfiguration/businessmodel/components/statisticalIndicators/statisticalIndicators.vue
@@ -1,69 +1,68 @@
 <template>
-    <div class="table-box">
-        <el-button class="mb20 " type="primary" icon="Plus" @click="handleAdd">
-            鏂板
-        </el-button>
-        <el-button class="mb20 " icon="Delete" :disabled="multiple" @click="handleDel">
-            鎵归噺鍒犻櫎
-        </el-button>
-        <el-table v-loading="loading" :data="tableData" height="calc(100vh - 370px)"
-            @selection-change="handleSelectionChange">
-            <el-table-column type="selection" width="55" align="center" show-overflow-tooltip />
-            <el-table-column label="鎸囨爣缂栫爜" align="center" prop="code" />
-            <el-table-column label="鎸囨爣鍚嶇О" align="center" prop="name" />
-            <el-table-column label="鎿嶄綔" align="center">
-                <template #default="scope">
-                    <el-button link type="primary" icon="Delete" @click="handleDel(scope.row)">
-                        鍒犻櫎
-                    </el-button>
-                </template>
-            </el-table-column>
-        </el-table>
-        <statisticModal ref="statisticModalRef" @statisticIndexConfirmSelect="statisticIndexConfirmSelect" />
+  <div class="table-box">
+    <div style="width: 100%; text-align: right; padding: 20px 20px 0 0">
+      <el-button class="mb20" type="primary" icon="Plus" @click="handleAdd"> 鏂板 </el-button>
+      <el-button class="mb20" icon="Delete" :disabled="multiple" @click="handleDel"> 鎵归噺鍒犻櫎 </el-button>
     </div>
+    <el-table
+      v-loading="loading"
+      :data="tableData"
+      height="calc(100vh - 370px)"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="55" align="center" show-overflow-tooltip />
+      <el-table-column label="鎸囨爣缂栫爜" align="center" prop="code" />
+      <el-table-column label="鎸囨爣鍚嶇О" align="center" prop="name" />
+      <el-table-column label="鎿嶄綔" align="center">
+        <template #default="scope">
+          <el-button link type="primary" icon="Delete" @click="handleDel(scope.row)"> 鍒犻櫎 </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <statisticModal ref="statisticModalRef" @statisticIndexConfirmSelect="statisticIndexConfirmSelect" />
+  </div>
 </template>
 <script setup>
 let { proxy } = getCurrentInstance()
-import { getSettingIndex, setNodeToIndex, delIndex } from '@/api/modelConfiguration/businessModel'
-import statisticModal from './StatisticModal.vue'
+import { getSettingIndex, setNodeToIndex, delIndex } from "@/api/modelConfiguration/businessModel"
+import statisticModal from "./StatisticModal.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
+  getSettingIndex(modelNode.id).then((response) => {
+    if (response.code === 200) {
+      let result = response.data
+      tableData.value = result.filter((f) => f.indexType === "STATISTIC")
+      loading.value = false
+    } else {
+      proxy.$modal.msgError(response.msg)
     }
-    currentNode.value = modelNode
-    loading.value = true;
-    getSettingIndex(modelNode.id).then((response) => {
-        if (response.code === 200) {
-            let result = response.data;
-            tableData.value = result.filter(f => f.indexType === 'STATISTIC');
-            loading.value = false
-        } else {
-            proxy.$modal.msgError(response.msg);
-        }
-    });
+  })
 }
 
 let statisticModalRef = ref(null)
 function handleAdd() {
-    if (statisticModalRef.value) {
-        statisticModalRef.value.handleOpen(tableData.value)
-    }
+  if (statisticModalRef.value) {
+    statisticModalRef.value.handleOpen(tableData.value)
+  }
 }
 
-
 function statisticIndexConfirmSelect(selectedIndex) {
-    tableData.value = selectedIndex
-    let indexIds = selectedIndex.map(item => item.indexId)
-    setNodeToIndex(currentNode.value.id, indexIds, 'STATISTIC').then((response) => {
-        if (response.code !== 200) {
-            proxy.$modal.msgError(response.msg)
-        }
-    })
+  tableData.value = selectedIndex
+  let indexIds = selectedIndex.map((item) => item.indexId)
+  setNodeToIndex(currentNode.value.id, indexIds, "STATISTIC").then((response) => {
+    if (response.code !== 200) {
+      proxy.$modal.msgError(response.msg)
+    }
+  })
 }
 
 // 閫変腑鏁扮粍
@@ -72,32 +71,34 @@
 // 闈炲涓鐢�
 let multiple = ref(true)
 function handleDel(row) {
-    const indexIds = row && row.indexId ? [row.indexId] : ids.value
-    const indexNames = row.name || names.value
-    proxy.$modal.confirm('鏄惁纭鍒犻櫎鎸囨爣鍚嶄负"' + indexNames + '"鐨勬暟鎹」?', '璀﹀憡').then(function () {
-        return delIndex(currentNode.value.id, indexIds);
-    }).then((response) => {
-        if (response.code === 200) {
-            getList(currentNode.value)
-            // 鍒犻櫎鎴愬姛锛屾洿鏂拌〃鏍兼暟鎹�
-            // tableData.value = tableData.value.filter(f => f.indexId !== row.indexId)
-            proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-        } else {
-            // 鍒犻櫎澶辫触锛屾樉绀洪敊璇秷鎭�
-            proxy.$modal.msgError(response.msg);
-        }
-    }).catch(() => {
-    });
+  const indexIds = row && row.indexId ? [row.indexId] : ids.value
+  const indexNames = row.name || names.value
+  proxy.$modal
+    .confirm('鏄惁纭鍒犻櫎鎸囨爣鍚嶄负"' + indexNames + '"鐨勬暟鎹」?', "璀﹀憡")
+    .then(function () {
+      return delIndex(currentNode.value.id, indexIds)
+    })
+    .then((response) => {
+      if (response.code === 200) {
+        getList(currentNode.value)
+        // 鍒犻櫎鎴愬姛锛屾洿鏂拌〃鏍兼暟鎹�
+        // tableData.value = tableData.value.filter(f => f.indexId !== row.indexId)
+        proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛")
+      } else {
+        // 鍒犻櫎澶辫触锛屾樉绀洪敊璇秷鎭�
+        proxy.$modal.msgError(response.msg)
+      }
+    })
+    .catch(() => {})
 }
 
-
 defineExpose({
-    getList
-});
+  getList,
+})
 function handleSelectionChange(selection) {
-    ids.value = selection.map(item => item.indexId);
-    names.value = selection.map(item => item.name);
-    multiple.value = !selection.length
+  ids.value = selection.map((item) => item.indexId)
+  names.value = selection.map((item) => item.name)
+  multiple.value = !selection.length
 }
 </script>
 

--
Gitblit v1.9.3