diff --git a/pages/index.vue b/pages/index.vue index 911ddcf..0b444ed 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -76,6 +76,7 @@ type="ring" :opts="opts" :chartData="chartData" + :canvas2d="true" style="height: 144px" > @@ -294,28 +295,24 @@ export default { return res }) this.detail.legendData = data - this.setPieData(data) + this.setPieData(data, this.detail.taskCompletionRate) this.getList() }, async getList() { const res = await HomeApi.getListData(this.queryParams) this.list = res.data }, - setPieData(data) { - const isMax = data.reduce( - (pre, cur) => pre + Number(cur.pieValue), - 0 - ) + setPieData(data, max) { const pieData = data.map(i => { return { name: i.name, value: Number(i.pieValue) } }) - if (isMax < 100) { + if (Number(max) < 100) { pieData.push({ name: '', - value: 100 - isMax, + value: 100 - Number(max), color: '#fff' }) } @@ -330,7 +327,7 @@ export default { dataLabel: false, enableScroll: false, title: { - name: `${isMax}%`, + name: `${max}%`, fontSize: 24, color: '#071437', fontWeight: 'bold' diff --git a/sub/task/locate.vue b/sub/task/locate.vue index 4d83e59..a9ae260 100644 --- a/sub/task/locate.vue +++ b/sub/task/locate.vue @@ -74,7 +74,7 @@ - +