工作台:待办 已办 数量更改

This commit is contained in:
guoyue 2022-07-01 13:29:38 +08:00
parent ea4736c0b7
commit 930eae441d
4 changed files with 34 additions and 18 deletions

View File

@ -98,7 +98,17 @@ export default {
}, },
], ],
tooltip: { tooltip: {
triagger: 'item' triagger: 'item',
formatter: (params) => {
let str = ''
if (params.name == '线') {
str = ''
} else {
str = `<span style="display:inline-block;margin-right:5px;
border-radius:10px;width:10px;height:10px;background-color:${params.color};"></span>${params.name}: ${params.value}`
}
return str;
}
}, },
"legend": { "legend": {
type: 'scroll', type: 'scroll',
@ -163,18 +173,19 @@ export default {
}, },
data: this.dataListCopy, data: this.dataListCopy,
}, },
{ {
"type": "pie", "type": "pie",
"center": ["50%", "40%"], "center": ["50%", "40%"],
"radius": ["35%", "36%"], "radius": ["38%", "39%"],
"label": { "label": {
"show": false "show": false
}, },
hoverAnimation: false,
showTooltip: false,
color: ['#d8dde8'], color: ['#d8dde8'],
"data": [{ "data": [{
"value": 78, "value": 0,
"name": "实例1", "name": "线",
}] }]
} }
] ]

View File

@ -77,7 +77,8 @@ export default {
.left-box { .left-box {
display: flex; display: flex;
justify-content: center; justify-content: center;
width: 80px; // width: 80px;
width: 100px;
border-radius: 2px; border-radius: 2px;
height: 100%; height: 100%;
} }
@ -100,6 +101,7 @@ export default {
color: #000; color: #000;
margin-top: 25px; margin-top: 25px;
margin-bottom: 18px; margin-bottom: 18px;
text-align: center;
} }
.num { .num {

View File

@ -5,23 +5,23 @@
<div class="no-box"> <div class="no-box">
<div class="no no2"> <div class="no no2">
<div class="name" :style="{ color: colorObj[2] }">{{ no2Obj.name || '--' }}</div> <div class="name" :style="{ color: colorObj[2] }">{{ no2Obj.name || '--' }}</div>
<div class="count">{{ no2Obj.count }}</div> <div class="count">{{ formatCount(no2Obj.count) }}</div>
</div> </div>
<div class="no no1"> <div class="no no1">
<div class="name" :style="{ color: colorObj[1] }">{{ no1Obj.name }}</div> <div class="name" :style="{ color: colorObj[1] }">{{ no1Obj.name || '--' }}</div>
<div class="count">{{ no1Obj.count }}</div> <div class="count">{{ formatCount(no1Obj.count) }}</div>
</div> </div>
<div class="no no3"> <div class="no no3">
<div class="name" :style="{ color: colorObj[3] }">{{ no3Obj.name }}</div> <div class="name" :style="{ color: colorObj[3] }">{{ no3Obj.name || '--' }}</div>
<div class="count">{{ no3Obj.count }}</div> <div class="count">{{ formatCount(no3Obj.count) }}</div>
</div> </div>
</div> </div>
<div class="flex-row-between row-name" v-for="(data, i) in listInfo" :key="i"> <div class="flex-row-between row-name" v-for="(data, i) in listInfo" :key="i">
<div class="left"> <div class="left">
<div class="row-index">{{ i + 3 }}</div> <div class="row-index">{{ i + 3 }}</div>
<div class="name-text">{{ data.name }}</div> <div class="name-text">{{ data.name || '--' }}</div>
</div> </div>
<div class="count-text">{{ data.count }}</div> <div class="count-text">{{ formatCount(data.count) }}</div>
</div> </div>
</div> </div>
<div class="no-data" v-else>暂无数据</div> <div class="no-data" v-else>暂无数据</div>
@ -84,14 +84,17 @@ export default {
this[`no${k}Obj`].count = _arr[i].count this[`no${k}Obj`].count = _arr[i].count
} }
this.listInfo = [] this.listInfo = []
this.listInfo.push(_arr[3]) this.listInfo.push(_arr[3] || {})
this.listInfo.push(_arr[4]) this.listInfo.push(_arr[4] || {})
}, err => { }, err => {
this.loading = false; this.loading = false;
this.$message.error(err); this.$message.error(err);
}); });
}, },
formatCount(count) {
return count || count === 0 ? count : '--'
}
}, },
components: { contentTitle } components: { contentTitle }
} }
@ -188,7 +191,7 @@ export default {
.num-text { .num-text {
font-size: 14px; font-size: 14px;
color: #2b2b2b; color: #2b2b2b;
} }
.no-data { .no-data {

View File

@ -105,7 +105,7 @@ export default {
} }
console.log('res----待办-------->', res.data); console.log('res----待办-------->', res.data);
this.toToData.list = res.data.data.records || [] this.toToData.list = res.data.data.records || []
this.toToData.num = res.data.data.records.length || 0 this.toToData.num = res.data.data.total || 0
}, err => { }, err => {
this.$message.error(err); this.$message.error(err);
this.loadingToDo = false; this.loadingToDo = false;
@ -125,7 +125,7 @@ export default {
} }
console.log('res----已办-------->', res.data); console.log('res----已办-------->', res.data);
this.hasToDodoData.list = res.data.data.records || [] this.hasToDodoData.list = res.data.data.records || []
this.hasToDodoData.num = res.data.data.records.length || 0 this.hasToDodoData.num = res.data.data.total || 0
}, err => { }, err => {
this.$message.error(err) this.$message.error(err)
this.loadingHasToDo = false; this.loadingHasToDo = false;