From 695e7e79697bf4daca3581d29987f80ba73893a5 Mon Sep 17 00:00:00 2001
From: letsgocoding <sdxt_0802@163.com>
Date: 星期二, 25 二月 2025 10:42:36 +0800
Subject: [PATCH] !93 !92 update sql Merge pull request !93 from letsgocoding/develop1.0
---
zhitan-vue/src/assets/styles/ruoyi.scss | 12
zhitan-vue/src/views/energyconservation/projectmanage/projectmanage/projectManage.vue | 1
zhitan-vue/src/views/modelconfiguration/businessmodel/components/statisticalIndicators/statisticalIndicators.vue | 141 +++++++-------
zhitan-vue/src/assets/styles/page.scss | 2
zhitan-vue/src/views/modelconfiguration/businessmodel/components/statisticalIndicators/StatisticModal.vue | 360 ++++++++++++++++++-----------------
zhitan-vue/.env.development | 2
zhitan-vue/src/views/modelconfiguration/indexwarehouse/indexWarehouse.vue | 5
sql/postgre.sql | 25 --
8 files changed, 266 insertions(+), 282 deletions(-)
diff --git a/sql/postgre.sql b/sql/postgre.sql
index 333387f..81bc1c8 100644
--- a/sql/postgre.sql
+++ b/sql/postgre.sql
@@ -86,7 +86,6 @@
DROP TABLE IF EXISTS "public"."node_energy";
DROP TABLE IF EXISTS "public"."node_index";
DROP TABLE IF EXISTS "public"."node_product";
-DROP TABLE IF EXISTS "public"."pdb_table_index";
DROP TABLE IF EXISTS "public"."plan_energy";
DROP TABLE IF EXISTS "public"."planned_output";
DROP TABLE IF EXISTS "public"."policies_regulations_management";
@@ -1715,25 +1714,6 @@
ALTER TABLE "node_product" OWNER TO "postgres";
COMMENT ON COLUMN "node_product"."node_id" IS '妯″瀷鑺傜偣 ID';
COMMENT ON COLUMN "node_product"."product_id" IS '浜у搧 ID';
-CREATE TABLE "pdb_table_index" (
- "tx_id" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
- "idex_id" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
- "index_code" varchar(255) COLLATE "pg_catalog"."default",
- "index_name" varchar(255) COLLATE "pg_catalog"."default",
- "table_index_name" varchar(255) COLLATE "pg_catalog"."default",
- "table_index_code" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
- "data_info" varchar(255) COLLATE "pg_catalog"."default"
-)
-;
-ALTER TABLE "pdb_table_index" OWNER TO "postgres";
-COMMENT ON COLUMN "pdb_table_index"."tx_id" IS 'uuid鍞竴涓嶅彲閲嶅';
-COMMENT ON COLUMN "pdb_table_index"."idex_id" IS '鎸囨爣瀵瑰簲鐨刬nde_id';
-COMMENT ON COLUMN "pdb_table_index"."index_code" IS '鎸囨爣瀵瑰簲鐨勭紪鐮乮ndex_code';
-COMMENT ON COLUMN "pdb_table_index"."index_name" IS '鎸囨爣鍚嶇Оindex_name';
-COMMENT ON COLUMN "pdb_table_index"."table_index_name" IS '鎶ヨ〃浣跨敤鐨勬寚鏍囧悕绉�';
-COMMENT ON COLUMN "pdb_table_index"."table_index_code" IS '鎶ヨ〃浣跨敤鐨勬寚鏍囩紪鐮�';
-COMMENT ON COLUMN "pdb_table_index"."data_info" IS '鏁版嵁鏉ユ簮鐨勮〃鍚嶇紪鍙凤紙澶囩敤瀛楁锛�';
-COMMENT ON TABLE "pdb_table_index" IS '搴炲反杩」鐩姤琛ㄦ寚鏍囦笌骞冲彴鎸囨爣鐨勫叧鑱旇〃';
CREATE TABLE "plan_energy" (
"product_id" int4 NOT NULL,
"value" varchar(255) COLLATE "pg_catalog"."default",
@@ -3244,10 +3224,6 @@
DELETE FROM "public"."node_product";
COMMIT;
BEGIN;
-LOCK TABLE "public"."pdb_table_index" IN SHARE MODE;
-DELETE FROM "public"."pdb_table_index";
-COMMIT;
-BEGIN;
LOCK TABLE "public"."plan_energy" IN SHARE MODE;
DELETE FROM "public"."plan_energy";
COMMIT;
@@ -3559,7 +3535,6 @@
ALTER TABLE "node_energy" ADD CONSTRAINT "node_device_copy1_pkey" PRIMARY KEY ("node_id", "energy_id");
ALTER TABLE "node_index" ADD CONSTRAINT "node_index_pkey" PRIMARY KEY ("node_id", "index_id");
ALTER TABLE "node_product" ADD CONSTRAINT "node_energy_copy2_pkey" PRIMARY KEY ("node_id", "product_id");
-ALTER TABLE "pdb_table_index" ADD CONSTRAINT "pdb_table_index_pkey" PRIMARY KEY ("tx_id");
ALTER TABLE "plan_energy" ADD CONSTRAINT "plan_energy_pkey" PRIMARY KEY ("product_id", "time_code");
ALTER TABLE "planned_output" ADD CONSTRAINT "planned_output_pkey" PRIMARY KEY ("product_id", "time_code");
ALTER TABLE "policies_regulations_management" ADD CONSTRAINT "policies_regulations_management_pkey" PRIMARY KEY ("id");
diff --git a/zhitan-vue/.env.development b/zhitan-vue/.env.development
index e2c2499..ff211da 100644
--- a/zhitan-vue/.env.development
+++ b/zhitan-vue/.env.development
@@ -6,6 +6,6 @@
# 绯荤粺/寮�鍙戠幆澧�
# test
-VITE_APP_BASE_API = 'http://127.0.0.1:8080'
+VITE_APP_BASE_API = 'http://139.159.201.118:8201'
# hangmingjun
diff --git a/zhitan-vue/src/assets/styles/page.scss b/zhitan-vue/src/assets/styles/page.scss
index 7a600a2..dfbcd09 100644
--- a/zhitan-vue/src/assets/styles/page.scss
+++ b/zhitan-vue/src/assets/styles/page.scss
@@ -49,6 +49,7 @@
.chart-box {
width: 100%;
height: 320px;
+ padding-top: 12px;
div {
width: 100%;
@@ -129,6 +130,7 @@
.chart-box {
width: 100%;
height: 320px;
+ padding-top: 12px;
div {
width: 100%;
diff --git a/zhitan-vue/src/assets/styles/ruoyi.scss b/zhitan-vue/src/assets/styles/ruoyi.scss
index cd8f03c..f446cf6 100644
--- a/zhitan-vue/src/assets/styles/ruoyi.scss
+++ b/zhitan-vue/src/assets/styles/ruoyi.scss
@@ -269,14 +269,11 @@
td {
word-break: break-word;
background-color: #1d3778 !important;
- // color: #515a6e;
+ color: #515a6e;
height: 48px !important;
- // font-size: 13px;
-
border-radius: 0px 0px 0px 0px;
font-family: OPPOSans, OPPOSans;
font-weight: 500;
- // font-size: 16px;
color: #ffffff;
border-bottom: none !important;
}
@@ -833,14 +830,11 @@
background-color: #F7F8FA !important;
// color: #515a6e;
height: 48px !important;
- // font-size: 13px;
-
border-radius: 0px 0px 0px 0px;
font-family: OPPOSans, OPPOSans;
font-weight: 500;
- // font-size: 16px;
color: #222222;
- border-bottom: none !important;
+ // border-bottom: none !important;
}
}
@@ -889,7 +883,7 @@
// 琛ㄦ牸搴曢儴鐧界嚎
.el-table__inner-wrapper::before {
- background-color: transparent;
+ // background-color: transparent;
}
/** 琛ㄥ崟甯冨眬 **/
diff --git a/zhitan-vue/src/views/energyconservation/projectmanage/projectmanage/projectManage.vue b/zhitan-vue/src/views/energyconservation/projectmanage/projectmanage/projectManage.vue
index 72cb99b..5cb9f23 100644
--- a/zhitan-vue/src/views/energyconservation/projectmanage/projectmanage/projectManage.vue
+++ b/zhitan-vue/src/views/energyconservation/projectmanage/projectmanage/projectManage.vue
@@ -40,7 +40,6 @@
<el-table-column prop="completionTime" label="瀹屾垚鏃堕棿" show-overflow-tooltip align="center" />
<el-table-column prop="createTime" label="鍒涘缓鏃堕棿" show-overflow-tooltip align="center" />
<el-table-column prop="remark" label="澶囨敞" show-overflow-tooltip align="center" />
-
<el-table-column label="鎿嶄綔" width="300" align="center">
<template #default="scope">
<!-- <el-button link type="primary" icon="Files" @click=""> 闄勪欢 </el-button> -->
diff --git a/zhitan-vue/src/views/modelconfiguration/businessmodel/components/statisticalIndicators/StatisticModal.vue b/zhitan-vue/src/views/modelconfiguration/businessmodel/components/statisticalIndicators/StatisticModal.vue
index a7c36f8..8432493 100644
--- a/zhitan-vue/src/views/modelconfiguration/businessmodel/components/statisticalIndicators/StatisticModal.vue
+++ b/zhitan-vue/src/views/modelconfiguration/businessmodel/components/statisticalIndicators/StatisticModal.vue
@@ -1,229 +1,241 @@
<template>
- <el-dialog v-model="visible" title="閫夋嫨缁熻鎸囨爣" width="1100" @close="handleClose" destroy-on-close
- :close-on-click-modal="false" :close-on-press-escape="false">
- <el-row :gutter="24">
- <el-col :span="6">
- <el-tree ref="treeRef" :props="defaultProps" :data="treeData" node-key="id" highlight-current
- :default-expanded-keys="treeExpandData" :expand-on-click-node="false" @node-click="changeNode"
- accordion>
- <template #default="{ node, data }">
- <span>
- <el-tooltip v-if="node.label.length > 6" class="item" effect="dark" :content="node.label"
- placement="top-end">
- <span>{{ node.label.slice(0, 6) + "..." }}</span>
- </el-tooltip>
- <span v-else id="b">{{ node.label }}</span>
- </span>
+ <el-dialog
+ v-model="visible"
+ title="閫夋嫨缁熻鎸囨爣"
+ width="1100"
+ @close="handleClose"
+ destroy-on-close
+ :close-on-click-modal="false"
+ :close-on-press-escape="false"
+ >
+ <el-row :gutter="24">
+ <el-col :span="6">
+ <el-tree
+ ref="treeRef"
+ :props="defaultProps"
+ :data="treeData"
+ node-key="id"
+ highlight-current
+ :default-expanded-keys="treeExpandData"
+ :expand-on-click-node="false"
+ @node-click="changeNode"
+ accordion
+ >
+ <template #default="{ node, data }">
+ <span>
+ <el-tooltip
+ v-if="node.label.length > 6"
+ class="item"
+ effect="dark"
+ :content="node.label"
+ placement="top-end"
+ >
+ <span>{{ node.label.slice(0, 6) + "..." }}</span>
+ </el-tooltip>
+ <span v-else id="b">{{ node.label }}</span>
+ </span>
+ </template>
+ </el-tree>
+ </el-col>
+ <el-col :span="18">
+ <el-form :model="queryParams" :inline="true" label-width="120px">
+ <el-form-item label="鎸囨爣鍚嶇О/缂栫爜" prop="name">
+ <el-input v-model="queryParams.name" placeholder="璇疯緭鍏ユ寚鏍囧悕绉�/缂栫爜" />
+ </el-form-item>
+ <el-form-item label="鎸囨爣鍒嗙被" prop="indexCategory">
+ <el-select v-model="queryParams.indexCategory" clearable placeholder="閫夋嫨绉嶇被" style="width: 170px">
+ <el-option v-for="dict in sys_index_category" :key="dict.value" :label="dict.label" :value="dict.value" />
+ </el-select>
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" icon="Search" @click="handleQuery">鎼滅储</el-button>
+ <el-button icon="Refresh" @click="resetQuery">閲嶇疆</el-button>
+ </el-form-item>
+ </el-form>
- </template>
- </el-tree>
- </el-col>
- <el-col :span="18">
- <el-form :model="queryParams" :inline="true" label-width="120px">
- <el-form-item label="鎸囨爣鍚嶇О/缂栫爜" prop="name">
- <el-input v-model="queryParams.name" placeholder="璇疯緭鍏ユ寚鏍囧悕绉�/缂栫爜" />
- </el-form-item>
- <el-form-item label="鎸囨爣鍒嗙被" prop="indexCategory">
- <el-select v-model="queryParams.indexCategory" clearable placeholder="閫夋嫨绉嶇被"
- style="width: 170px;">
- <el-option v-for="dict in sys_index_category" :key="dict.value" :label="dict.label"
- :value="dict.value" />
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" icon="Search" @click="handleQuery">鎼滅储</el-button>
- <el-button icon="Refresh" @click="resetQuery">閲嶇疆</el-button>
- </el-form-item>
- </el-form>
+ <el-table
+ v-loading="loading"
+ :data="tableData"
+ row-key="indexId"
+ @select="handleSelectChange"
+ @select-all="handleSelectionAllChange"
+ height="50vh"
+ ref="energySettingTable"
+ >
+ <el-table-column type="selection" width="55" align="center" row-key="indexId" :reserve-selection="true" />
+ <el-table-column label="鎸囨爣缂栫爜" align="center" prop="code" />
+ <el-table-column label="鎸囨爣鍚嶇О" align="center" prop="name" />
+ <el-table-column
+ label="鍗曚綅"
+ align="center"
+ prop="unitId"
+ :formatter="(row, c) => proxy.selectDictLabel(sys_unit, row.unitId)"
+ />
+ </el-table>
+ <pagination
+ v-show="total > 0"
+ :total="total"
+ v-model:page="queryParams.pageNum"
+ v-model:limit="queryParams.pageSize"
+ @pagination="getList"
+ />
+ </el-col>
+ </el-row>
- <el-table v-loading="loading" :data="tableData" row-key="indexId" @select="handleSelectChange"
- @select-all="handleSelectionAllChange" height="50vh" ref="energySettingTable">
- <el-table-column type="selection" width="55" align="center" row-key="indexId"
- :reserve-selection="true" />
- <el-table-column label="鎸囨爣缂栫爜" align="center" prop="code" />
- <el-table-column label="鎸囨爣鍚嶇О" align="center" prop="name" />
- <el-table-column label="鍗曚綅" align="center" prop="unitId"
- :formatter="(row, c) => proxy.selectDictLabel(sys_unit, row.unitId)" />
- </el-table>
- <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
- v-model:limit="queryParams.pageSize" @pagination="getList" />
- </el-col>
- </el-row>
-
-
-
-
-
- <div slot="footer" class="text-right">
- <el-button type="primary" @click="handleOk">纭畾</el-button>
- <el-button @click="handleClose">鍙栨秷</el-button>
- </div>
-
-
-
- </el-dialog>
+ <div slot="footer" class="text-right">
+ <el-button type="primary" @click="handleOk">纭畾</el-button>
+ <el-button @click="handleClose">鍙栨秷</el-button>
+ </div>
+ </el-dialog>
</template>
<script setup>
let { proxy } = getCurrentInstance()
-let { sys_index_category } = proxy.useDict('sys_index_category')
-let { sys_unit } = proxy.useDict('sys_unit')
-import { listEnergyindex, treeList } from '@/api/modelConfiguration/indexWarehouse'
+let { sys_index_category } = proxy.useDict("sys_index_category")
+let { sys_unit } = proxy.useDict("sys_unit")
+import { listEnergyindex, treeList } from "@/api/modelConfiguration/indexWarehouse"
let treeRef = ref(null)
let treeData = ref([])
let treeExpandData = ref([])
const defaultProps = ref({
- children: 'children',
- label: 'label',
+ children: "children",
+ label: "label",
})
-
+let currentNode = ref(null)
//鏍戠偣鍑�
function changeNode(data, node, ev) {
- getList(data)
- // if (statisticalIndicatorManagementRef.value) {
- // statisticalIndicatorManagementRef.value.getList(data)
- // }
+ currentNode.value = data
+ getList()
}
let isFirstLeafNode = ref(false)
//鑾峰彇鏍戝垪琛�
function getTreeList() {
- treeList({ modelCode: "JCZBK_CODE" }).then(res => {
- let { data } = res
- treeData.value = data;
- let chooseNode = null;
- if (data.length > 0) {
- if (data[0].children && data[0].children.length !== 0 && isFirstLeafNode.value) {
- if (data[0].children[0].children && data[0].children[0].children.length !== 0) {
- chooseNode = data[0].children[0].children[0];
- } else {
- chooseNode = data[0].children[0];
- }
- } else {
- chooseNode = data[0];
- }
- treeExpandData.value.push(chooseNode.id);
- nextTick(() => {
- treeRef.value.setCurrentKey(chooseNode.id);
- getList(chooseNode)
- });
+ treeList({ modelCode: "JCZBK_CODE" }).then((res) => {
+ let { data } = res
+ treeData.value = data
+ let chooseNode = null
+ if (data.length > 0) {
+ if (data[0].children && data[0].children.length !== 0 && isFirstLeafNode.value) {
+ if (data[0].children[0].children && data[0].children[0].children.length !== 0) {
+ chooseNode = data[0].children[0].children[0]
+ } else {
+ chooseNode = data[0].children[0]
}
- })
+ } else {
+ chooseNode = data[0]
+ }
+ treeExpandData.value.push(chooseNode.id)
+ currentNode.value = chooseNode
+ nextTick(() => {
+ treeRef.value.setCurrentKey(chooseNode.id)
+ getList()
+ })
+ }
+ })
}
-
let loading = ref(false)
let visible = ref(false)
let tableData = ref([])
-let total = ref(0);
+let total = ref(0)
let queryParams = ref({
- name: null,
- indexCategory: null,
- pageNum: 1,
- pageSize: 10,
+ name: null,
+ indexCategory: null,
+ pageNum: 1,
+ pageSize: 10,
})
let selectedStatistic = ref([])
function handleOpen(selectRow) {
- getTreeList()
- selectedStatistic.value = JSON.parse(JSON.stringify(selectRow))
- visible.value = true
+ getTreeList()
+ selectedStatistic.value = JSON.parse(JSON.stringify(selectRow))
+ visible.value = true
}
let energySettingTable = ref(null)
-let currentNode = ref(null)
-function getList(modelNode) {
- currentNode.value = modelNode;
- if (modelNode) {
- loading.value = true;
- queryParams.value.nodeId = modelNode.id;
- queryParams.value.indexType = 'STATISTIC';
- listEnergyindex(queryParams.value).then(response => {
- tableData.value = response.rows;
- total.value = response.total;
- loading.value = false;
- nextTick(function () {
- energySettingTable.value.data.forEach(rowData => {
- let exist = selectedStatistic.value.filter(
- f => f.indexId === rowData.indexId).length;
- if (exist > 0) {
- energySettingTable.value.toggleRowSelection(rowData, true);
- }
- });
- });
- });
- } else {
- tableData.value = [];
- }
+function getList() {
+ loading.value = true
+ queryParams.value.nodeId = currentNode.value.id
+ queryParams.value.indexType = "STATISTIC"
+ listEnergyindex(queryParams.value).then((response) => {
+ tableData.value = response.rows
+ total.value = response.total
+ loading.value = false
+ nextTick(function () {
+ energySettingTable.value.data.forEach((rowData) => {
+ let exist = selectedStatistic.value.filter((f) => f.indexId === rowData.indexId).length
+ if (exist > 0) {
+ energySettingTable.value.toggleRowSelection(rowData, true)
+ }
+ })
+ })
+ })
}
function handleQuery() {
- queryParams.value.pageNum = 1;
- getList(currentNode.value)
+ queryParams.value.pageNum = 1
+ getList()
}
function resetQuery() {
- queryParams.value = {
- name: null,
- indexCategory: null,
- pageNum: 1,
- pageSize: 10,
- }
- getList(currentNode.value)
+ queryParams.value = {
+ name: null,
+ indexCategory: null,
+ pageNum: 1,
+ pageSize: 10,
+ }
+ getList()
}
function handleClose() {
- visible.value = false
+ visible.value = false
}
-
-
//鍒ゆ柇涓�涓� 鏄叏閫夎繕鏄叏閫夊彇娑�
function formatterSelect(selection, data) {
- let idMap = {};
- selection.forEach(item => {
- idMap[item.indexId] = true;
- });
- let allIn = data.every(item => idMap.hasOwnProperty(item.indexId));
- return allIn;
+ let idMap = {}
+ selection.forEach((item) => {
+ idMap[item.indexId] = true
+ })
+ let allIn = data.every((item) => idMap.hasOwnProperty(item.indexId))
+ return allIn
}
function handleSelectionAllChange(selection) {
- if (formatterSelect(selection, tableData.value)) {
- selection.forEach(row => {
- let rowStatus = selectedStatistic.value.filter(f => f.indexId == row.indexId).length;
- if (rowStatus === 0) {
- selectedStatistic.value.push({
- "indexId": row.indexId,
- "code": row.code,
- "name": row.name
- });
- }
- });
- } else {
- selectedStatistic.value = selectedStatistic.value.filter(f => {
- return !tableData.value.some(s => s.indexId == f.indexId);
- });
- }
+ if (formatterSelect(selection, tableData.value)) {
+ selection.forEach((row) => {
+ let rowStatus = selectedStatistic.value.filter((f) => f.indexId == row.indexId).length
+ if (rowStatus === 0) {
+ selectedStatistic.value.push({
+ indexId: row.indexId,
+ code: row.code,
+ name: row.name,
+ })
+ }
+ })
+ } else {
+ selectedStatistic.value = selectedStatistic.value.filter((f) => {
+ return !tableData.value.some((s) => s.indexId == f.indexId)
+ })
+ }
}
function handleSelectChange(selection, row) {
- let rowStatus = selection.filter(f => f.indexId === row.indexId).length;
- if (rowStatus > 0) {
- selectedStatistic.value.push({
- "indexId": row.indexId,
- "code": row.code,
- "name": row.name
- });
- } else {
- selectedStatistic.value = selectedStatistic.value.filter(
- f => f.indexId !== row.indexId);
- }
-
+ let rowStatus = selection.filter((f) => f.indexId === row.indexId).length
+ if (rowStatus > 0) {
+ selectedStatistic.value.push({
+ indexId: row.indexId,
+ code: row.code,
+ name: row.name,
+ })
+ } else {
+ selectedStatistic.value = selectedStatistic.value.filter((f) => f.indexId !== row.indexId)
+ }
}
function handleOk() {
- emit('statisticIndexConfirmSelect', selectedStatistic.value)
- visible.value = false
+ emit("statisticIndexConfirmSelect", selectedStatistic.value)
+ visible.value = false
}
-defineExpose({ handleOpen });
-let emit = defineEmits(['statisticIndexConfirmSelect'])
+defineExpose({ handleOpen })
+let emit = defineEmits(["statisticIndexConfirmSelect"])
</script>
<style scoped lang="scss">
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>
diff --git a/zhitan-vue/src/views/modelconfiguration/indexwarehouse/indexWarehouse.vue b/zhitan-vue/src/views/modelconfiguration/indexwarehouse/indexWarehouse.vue
index 39fe733..a39fc47 100644
--- a/zhitan-vue/src/views/modelconfiguration/indexwarehouse/indexWarehouse.vue
+++ b/zhitan-vue/src/views/modelconfiguration/indexwarehouse/indexWarehouse.vue
@@ -65,7 +65,7 @@
<treeNodeModal
ref="treeNodeModalRef"
@getList="getTreeList"
- modelCode="JCZBK_CODE"
+ :modelCode="modelCode"
@addTreeList="addTreeList"
@addTreeSelectList="addTreeSelectList"
/>
@@ -83,6 +83,7 @@
let treeRef = ref()
let tab = ref(1)
let treeData = ref([])
+const modelCode = proxy.$route.query.modelCode || "JCZBK_CODE"
const defaultProps = ref({
children: "children",
@@ -113,7 +114,7 @@
let statisticalIndicatorManagementRef = ref(null)
//鑾峰彇鏍戝垪琛�
function getTreeList() {
- treeList({ modelCode: "JCZBK_CODE" }).then((res) => {
+ treeList({ modelCode: proxy.$route.query.modelCode || "JCZBK_CODE" }).then((res) => {
let { data } = res
treeData.value = data
let chooseNode = null
--
Gitblit v1.9.3