From 1c354f542e50d257826e1f62097613514959d95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E6=B4=81?= <209192278@qq.com> Date: Wed, 8 Nov 2023 22:36:54 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=93=E6=B4=81=20:=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/styles/index.scss | 4 +++- src/components/Tag.vue | 35 +++++++++++++++++---------------- src/stores/cache.js | 4 ++-- src/views/system/dept/index.vue | 1 + src/views/system/menu/index.vue | 4 ---- src/views/tool/dict/index.vue | 2 +- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index cb6a868..d2e65d2 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -311,7 +311,9 @@ html, body, #app, .el-container, .el-aside, .el-main { .scale { margin-top: 10px; } - +.el-overlay-dialog{ + left: 200px!important; +} .el-overlay-dialog::-webkit-scrollbar, .scrollbar-dict::-webkit-scrollbar { width: 6px; } diff --git a/src/components/Tag.vue b/src/components/Tag.vue index f1f2d5e..cc42886 100644 --- a/src/components/Tag.vue +++ b/src/components/Tag.vue @@ -12,7 +12,8 @@ import {defineProps} from "vue"; const props = defineProps({ dictType: { type: String, - default: "" + default: "", + required:true }, value: { type: Object, @@ -26,30 +27,30 @@ const tag = reactive({ label: "", theme: "" }); -const dictList = cacheStore.getDict(props.dictType); +const dictList=ref() +const getDicList=async ()=>{ + dictList.value =await cacheStore.getDict(props.dictType); +} +onMounted(async ()=>{ + await getDicList() + await dictFormat(); +}) const dictFormat = () => { - if (dictList === undefined) return; + if (dictList.value === undefined) return; let dictValue = '' if (props.value === true || props.value === false) { dictValue = JSON.stringify(props.value) } else { dictValue = props.value } - for (let i = 0; i < dictList.length; i++) { - if (dictList[i].value == dictValue) { - tag.label = dictList[i].label; - tag.listClass = dictList[i].listClass; - tag.isType = dictList[i].isType; - tag.theme = dictList[i].theme; + dictList.value.forEach(item=>{ + if(item.value==dictValue){ + tag.label = item.label; + tag.listClass = item.listClass; + tag.isType = item.isType; + tag.theme = item.theme; } - } - // for (let item of dictList) { - // if (item.value == props.value) { - // tag.label = item.label; - // tag.listClass = item.listClass; - // tag.isType = item.isType; - // } - // } + }) }; dictFormat(); diff --git a/src/stores/cache.js b/src/stores/cache.js index b1a2b7c..ea71442 100644 --- a/src/stores/cache.js +++ b/src/stores/cache.js @@ -18,10 +18,10 @@ export const useCacheStore = defineStore('cache',()=>{ }) } - const getDict = (key) => { + const getDict =async (key) => { let dict if (!cacheKeyType.value.has(key) ) { - setCacheKey([key]) + await setCacheKey([key]) } dict = cacheKeyType.value.get(key) return dict diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 8729c8f..963ac09 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -32,6 +32,7 @@ :lazy="true" v-loading="loading" @expand-change="expandChange" + v-tabh > diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue index 7776395..fdd041e 100644 --- a/src/views/system/menu/index.vue +++ b/src/views/system/menu/index.vue @@ -157,12 +157,10 @@ @@ -188,7 +186,6 @@ const loading = ref(true) const list = ref([]) const tableTree = ref() const isExpand = ref(true) -const deleteVisible = ref(false) const isVisited = ref(false) const title = ref('') const form = ref({ @@ -314,7 +311,6 @@ const handleDel = (menuId) => { if (res.code === 1000) { ElMessage.success(res.msg) getList() - deleteVisible.value = false } else { ElMessage.error(res.msg) } diff --git a/src/views/tool/dict/index.vue b/src/views/tool/dict/index.vue index afd6159..485fb0e 100644 --- a/src/views/tool/dict/index.vue +++ b/src/views/tool/dict/index.vue @@ -55,7 +55,7 @@ :data="list" row-key="dictId" border - height="68vh" + height="60vh" ref="singleTable" v-loading="loading" :header-cell-style="{'background':'#f5f7fa'}"