From 22708ed023c611c50e71aed06b416d322d33be5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=86=99=E6=9C=9D?= <13694051+wangxizhao123@user.noreply.gitee.com> Date: Sat, 27 Apr 2024 20:31:59 +0800 Subject: [PATCH] =?UTF-8?q?feat()=E5=AD=97=E5=85=B8=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/dicts.js | 14 ++++ .../table/dashboard/OverallAssetStructure.vue | 76 ++++++++++++------- .../table/dashboard/OverallSpecificAssets.vue | 21 +++-- src/views/assets/table/index.vue | 1 - 4 files changed, 78 insertions(+), 34 deletions(-) diff --git a/src/api/system/dicts.js b/src/api/system/dicts.js index 8622dc2..c4d6909 100644 --- a/src/api/system/dicts.js +++ b/src/api/system/dicts.js @@ -66,3 +66,17 @@ export function selectDictData(data) { data }) } +// 删除 +export function deleteDictType(dictType) { + return request({ + url: '/system/dicts/deleteDictType?dictType=' + dictType, + method: 'post' + }) +} +//详情 +export function selectDictType(dictType) { + return request({ + url: '/system/dicts/selectDictType?dictType=' + dictType, + method: 'post' + }) +} diff --git a/src/views/assets/table/dashboard/OverallAssetStructure.vue b/src/views/assets/table/dashboard/OverallAssetStructure.vue index 7bafbab..f8da0a4 100644 --- a/src/views/assets/table/dashboard/OverallAssetStructure.vue +++ b/src/views/assets/table/dashboard/OverallAssetStructure.vue @@ -36,10 +36,15 @@ placement="left" width="200" trigger="hover"> - - - - + + + + + + + + + {{scope.row.dictionary}} @@ -125,18 +130,22 @@ - + - - - - - - - - + + + +
+ + + + +
+
+
+
@@ -153,12 +162,12 @@ import { selNameListStructure, updateListStructure } from '@/api/system/accredit' -import data from "@/views/system/dict/data.vue" +import { listDictType, selectDictType } from "@/api/system/dicts"; export default { props: { title: { - type: Object + type: String }, }, name: 'OverallAssetStructure', @@ -180,20 +189,30 @@ export default { dictionary: '' }, formStatus: false, + tableName: '', dictMap:{ - "性别(system_sex)": [ - { label: '男', val: '1', isEdit: false }, - { label: '女', val: '2', isEdit: false }, - { label: '未知', val: '0', isEdit: false }, - ], - "开关(system_y_n)": [ - { label: '是', val: '1', isEdit: false }, - { label: '否', val: '0', isEdit: false } - ], - } + dictType: '', + dictDataList: [] + }, + dictMap2:{ + dictType: '', + dictDataList: [] + }, + dictOut: [], } }, methods: { + selData(thanName){ + selectDictType(thanName).then(res => { + this.dictMap = res.data + + }) + }, + selData2(thanName){ + selectDictType(thanName).then(res => { + this.dictMap2 = res.data + }) + }, update(row) { console.log(row) this.form = row; @@ -208,7 +227,7 @@ export default { }, init() { console.log(this.title) - if (this.title === null){ + if (this.title === undefined){ listListstructure().then(res => { this.childrenList = res.data }) @@ -217,7 +236,10 @@ export default { this.childrenList = res.data }) } - + listDictType().then(res => { + this.dictOut = res.data + console.log(this.dictOut) + }) } }, // 生命周期 - 创建完成(可以访问当前this实例)", diff --git a/src/views/assets/table/dashboard/OverallSpecificAssets.vue b/src/views/assets/table/dashboard/OverallSpecificAssets.vue index 24472b0..6006223 100644 --- a/src/views/assets/table/dashboard/OverallSpecificAssets.vue +++ b/src/views/assets/table/dashboard/OverallSpecificAssets.vue @@ -63,8 +63,10 @@ {{val.dictType}} 新增 + 删除字典 @@ -126,7 +128,7 @@