From 3a31c13a89b3958f6fc929477de5e2652bfcf3e4 Mon Sep 17 00:00:00 2001 From: yuxc <yuxc@vci-tech.com> Date: 星期三, 25 十二月 2024 16:52:49 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/plt-web/plt-web-ui/src/views/wel/workIndex.vue | 70 +++++++++++++++++++++++++---------- 1 files changed, 50 insertions(+), 20 deletions(-) diff --git a/Source/plt-web/plt-web-ui/src/views/wel/workIndex.vue b/Source/plt-web/plt-web-ui/src/views/wel/workIndex.vue index 8718080..380242b 100644 --- a/Source/plt-web/plt-web-ui/src/views/wel/workIndex.vue +++ b/Source/plt-web/plt-web-ui/src/views/wel/workIndex.vue @@ -1,14 +1,23 @@ <template> <div> <el-row> - <el-col v-for="item in homeData" :span="item.span" :xs="24"> - <component :height="height*item.height" :is="item.component" :key="item.component" :title="item.title" :icon="item.icon"></component> + <el-col v-for="item in homeData" :span="item.num" :xs="24"> + <div class="basic-container"> + <el-card class="basic-container__card" :body-style="{height:+(height*item.ratio-(item.title?78:38))+'px'}"> + <div slot="header" class="clearfix" v-if="item.title || item.icon"> + <span>{{item.title}}</span> + <icon-show :name="item.icon" style="display: inline-block"></icon-show> + </div> + <component :height="height*item.ratio" :is="item.module" :key="item.module" :title="item.title" :icon="item.icon"></component> + </el-card> + </div> </el-col> </el-row> </div> </template> <script> +import {getAllData} from "@/api/homeConfig"; import UndoTaskPortlet from './components/UndoTaskPortlet.vue'; import taskPortlet from './components/taskPortlet.vue'; import test from './components/test.vue'; @@ -18,31 +27,52 @@ data(){ return { height:document.body.clientHeight-115, - homeData:[{ - component:'UndoTaskPortlet', - height:0.4, - span:16 - },{ - component:'taskPortlet', - height:0.3, - span:5 - },{ - component:'test', - height:0.6, - span:12 - }] + homeData:[] } }, created() { - this.initData(); + this.getList(); }, methods:{ - initData() { - }, + getList() { + getAllData().then(res => { + const data = res.data.data; + if(data.length>0){ + this.homeData = data; + }else { + this.homeData = [{ + orderNum:1, + module: "UndoTaskPortlet", + title: "寰呭姙娴佺▼浠诲姟", + num:24, + icon: "", + ratio:1.00 + }]; + } + }).catch(error=>{ + this.homeData = [{ + orderNum:1, + module: "UndoTaskPortlet", + title: "寰呭姙娴佺▼浠诲姟", + num:24, + icon: "", + ratio:1.00 + }]; + }); + } } } </script> -<style scoped> - +<style lang="scss" scoped> +::v-deep { + .iconShow{ + margin-left: 5px; + position: relative; + top:4px; + } + .el-col { + margin-bottom: 0px; + } +} </style> -- Gitblit v1.9.3