From eef1ef0be935d4a3d8fc691b2666f41796b2d4a5 Mon Sep 17 00:00:00 2001 From: gaoshp <291585735@qq.com> Date: 星期一, 04 十一月 2024 19:57:08 +0800 Subject: [PATCH] 增加列表显示 --- src/views/mdc/configComp/Board.vue | 25 ++++++++++++++----------- 1 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/views/mdc/configComp/Board.vue b/src/views/mdc/configComp/Board.vue index 90c49ba..33f4e6e 100644 --- a/src/views/mdc/configComp/Board.vue +++ b/src/views/mdc/configComp/Board.vue @@ -1,8 +1,8 @@ <!-- * @Date: 2024-04-15 23:58:36 - * @LastEditors: Sneed - * @LastEditTime: 2024-04-17 00:38:24 - * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/configComp/Board.vue + * @LastEditors: gaoshp + * @LastEditTime: 2024-10-08 20:27:04 + * @FilePath: /cps-web/src/views/mdc/configComp/Board.vue --> <template> <el-main> @@ -37,18 +37,18 @@ <el-col :span="24" class="label-title"> {{ item.dictValue }} </el-col> - <el-col :span="6" v-for="(v, i) in item.children" :key="v.id" :offset="i > 0 ? 2 : 0"> + <el-col :span="6" v-for="(v, i) in item.children" :key="v.id"> <el-card class="my-card" @click="radio = true"> <template #header> <div class="card-header"> <div class="card-line"><el-checkbox :disabled="v.isDefault" @change="submit1" - v-model="v.isSelect" /><span>鍗冩枃绉戞妧</span> + v-model="v.isSelect" /><span>{{ v.groupName }}</span> <el-button v-if="v.isDefault" style="margin-left: auto">榛樿</el-button> <el-button @click="setDefault(v)" v-else style="margin-left: auto">璁句负榛樿</el-button> </div> </div> </template> - <p>鎵�鏈夌殑 > 鍗冩枃绉戞妧</p> + <p>{{ v.path }}</p> </el-card> </el-col> @@ -90,6 +90,7 @@ export default { computed: { dictsNew() { + console.log(this.dicts.filter(v => v?.children?.length > 0), '>>>>>>>>?') return this.dicts.filter(v => v?.children?.length > 0) } }, @@ -111,22 +112,21 @@ }, methods: { init() { - console.log('>>>>>>normalId') this.$HTTP.get('/api/blade-system/param-biz/detail?paramKey=mdc_chosen_groups').then(re => { - this.id = re.data.id + this.id = re?.data?.id let chosen = [] let normalId = '' try { chosen = JSON.parse(re.data.paramValue).map(v => v.groupId) normalId = JSON.parse(re.data.paramValue).find(v => v.isDefault).groupId - console.log('>>>>>>normalId', normalId) } catch (error) { } Promise.all([ this.$HTTP.get('/api/blade-system/dict/dictionary?code=group_tag').then(res => { + this.dicts = [] this.dicts.push(...res.data.map(({ dictKey, dictValue }) => ({ - dictKey, dictValue + dictKey, dictValue, }))) }), this.$HTTP.get('/api/blade-system/dict/dictionary?code=beltline_type').then(res => { @@ -135,10 +135,11 @@ }))) }) ]).then(res => { - this.$HTTP.get('/api/blade-cps/apply-settings/list-workstation-group?groupCategory=&groupTag=&groupType=group_workstation').then(res => { + this.$HTTP.get('/api/smis/apply-settings/list-workstation-group?groupCategory=&groupTag=&groupType=group_workstation').then(res => { this.dicts.forEach(v => { v.children = res.data.filter(item => item.groupTag == v.dictKey).map(item => { return { + path: item.path, groupId: item.id, groupName: item.name, groupCode: item.code, @@ -203,6 +204,7 @@ item?.children.forEach(v => { if (groupId == v.groupId) { v.isDefault = true + v.isSelect = true } else { v.isDefault = 0 } @@ -228,6 +230,7 @@ .my-card { max-width: 480px; cursor: pointer; + margin-right: 10px; } .title { -- Gitblit v1.9.3