1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
| <template>
| <div>
| <el-row>
| <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>
| <i title="自定义配置" class="el-icon-setting" @click="setHandler" style="position: absolute;top:60px;right:20px;font-size: 20px;cursor: pointer"></i>
| <el-dialog
| v-dialogDrag
| title="自定义配置"
| :visible.sync="visible"
| append-to-body="true"
| class="avue-dialog"
| :fullscreen="true"
| @close="closeHandler"
| >
| <home-config></home-config>
| </el-dialog>
| </div>
| </template>
|
| <script>
| import {getAllData} from "@/api/homeConfig";
| import homeConfig from './homeConfig.vue';
| import UndoTaskPortlet from './components/UndoTaskPortlet.vue';
| import taskPortlet from './components/taskPortlet.vue';
| import test from './components/test.vue';
| export default {
| name: "workIndex",
| components:{homeConfig,UndoTaskPortlet,taskPortlet,test},
| data(){
| return {
| height:document.body.clientHeight-115,
| homeData:[],
| visible: false,
| }
| },
| created() {
| this.getList();
| },
| methods:{
| 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
| }];
| });
| },
| setHandler(){
| this.visible=true;
| },
| closeHandler(){
| this.getList();
| this.visible=false;
| }
| }
| }
| </script>
|
| <style lang="scss" scoped>
| ::v-deep {
| .iconShow{
| margin-left: 5px;
| position: relative;
| top:4px;
| }
| .el-col {
| margin-bottom: 0px;
| }
| }
| </style>
|
|