This commit is contained in:
liuye
2024-08-07 08:49:21 +08:00
parent c87d720c7f
commit cc34079add

View File

@@ -22,14 +22,14 @@
</div> </div>
<div class="title">事件办结率</div> <div class="title">事件办结率</div>
<div class="info-content"> <div class="info-content">
<canvas canvas-id="finish" id="finish" class="echart-content e-canvas" type="2d" v-if="showFinish"/> <canvas canvas-id="finish" id="finish" class="echart-content e-canvas" v-if="showFinish"/>
<AiEmpty v-else></AiEmpty> <AiEmpty v-else></AiEmpty>
</div> </div>
<div class="title">上报趋势图</div> <div class="title">上报趋势图</div>
<div class="info-content"> <div class="info-content">
<AiEmpty v-if="!trendData.length"></AiEmpty> <AiEmpty v-if="!trendData.length"></AiEmpty>
<canvas canvas-id="trend" id="trend" class="echart-content" type="2d" v-else/> <canvas canvas-id="trend" id="trend" class="echart-content" v-else/>
</div> </div>
<div class="title">事件分类 <div class="title">事件分类
<!-- <div class="type-select" :style="statusInfo.name ? '' : 'color:#999;'" @click="show=true">{{statusInfo.name || '请选择'}}<u-icon name="arrow-right"></u-icon></div> --> <!-- <div class="type-select" :style="statusInfo.name ? '' : 'color:#999;'" @click="show=true">{{statusInfo.name || '请选择'}}<u-icon name="arrow-right"></u-icon></div> -->
@@ -38,7 +38,7 @@
</div> </div>
<div class="info-content"> <div class="info-content">
<AiEmpty v-if="!typeData.length"></AiEmpty> <AiEmpty v-if="!typeData.length"></AiEmpty>
<canvas canvas-id="type" id="type" class="echart-content" type="2d" v-else/> <canvas canvas-id="type" id="type" class="echart-content" v-else/>
</div> </div>
<div class="pad-b120"></div> <div class="pad-b120"></div>
</div> </div>
@@ -153,62 +153,7 @@ export default {
}, },
finishChartInit(id) { finishChartInit(id) {
// console.log(this.finishData) // console.log(this.finishData)
// var ctx = uni.createCanvasContext(id, this); var ctx = uni.createCanvasContext(id, this);
// uChartsInstance[id] = new uCharts({
// type: "ring",
// width: 350,
// height: 250,
// context: ctx,
// series: [
// {
// data: this.finishData
// }
// ],
// animation: true,
// rotate: false,
// rotateLock: false,
// background: "#FFFFFF",
// color: ['#7E94F6', '#85E3D5', '#2891FF'],
// padding: [5,5,5,5],
// dataLabel: true,
// enableScroll: false,
// legend: {
// show: true,
// position: "bottom",
// lineHeight: 25
// },
// title: {
// name: "办结率",
// fontSize: 12,
// color: "#222"
// },
// subtitle: {
// name: this.finshNum+'%',
// fontSize: 20,
// color: "#5C8FFA"
// },
// extra: {
// ring: {
// ringWidth: 40,
// activeOpacity: 0.5,
// activeRadius: 10,
// offsetAngle: 0,
// labelWidth: 5,
// border: false,
// borderWidth: 2,
// borderColor: "#FFFFFF"
// }
// }
// })
const query = uni.createSelectorQuery().in(this);
query.select('#' + id).fields({ node: true, size: true }).exec(res => {
console.log(res)
if (res[0]) {
const canvas = res[0].node;
const ctx = canvas.getContext('2d');
canvas.width = 350
canvas.height = 250
uChartsInstance[id] = new uCharts({ uChartsInstance[id] = new uCharts({
type: "ring", type: "ring",
width: 350, width: 350,
@@ -254,22 +199,69 @@ export default {
borderColor: "#FFFFFF" borderColor: "#FFFFFF"
} }
} }
}); })
}else{
console.error("[uCharts]: 未获取到 context"); // const query = uni.createSelectorQuery().in(this);
} // query.select('#' + id).fields({ node: true, size: true }).exec(res => {
}); // console.log(res)
// if (res[0]) {
// const canvas = res[0].node;
// const ctx = canvas.getContext('2d');
// canvas.width = 350
// canvas.height = 250
// uChartsInstance[id] = new uCharts({
// type: "ring",
// width: 350,
// height: 250,
// context: ctx,
// series: [
// {
// data: this.finishData
// }
// ],
// animation: true,
// rotate: false,
// rotateLock: false,
// background: "#FFFFFF",
// color: ['#7E94F6', '#85E3D5', '#2891FF'],
// padding: [5,5,5,5],
// dataLabel: true,
// enableScroll: false,
// legend: {
// show: true,
// position: "bottom",
// lineHeight: 25
// },
// title: {
// name: "办结率",
// fontSize: 12,
// color: "#222"
// },
// subtitle: {
// name: this.finshNum+'%',
// fontSize: 20,
// color: "#5C8FFA"
// },
// extra: {
// ring: {
// ringWidth: 40,
// activeOpacity: 0.5,
// activeRadius: 10,
// offsetAngle: 0,
// labelWidth: 5,
// border: false,
// borderWidth: 2,
// borderColor: "#FFFFFF"
// }
// }
// });
// }else{
// console.error("[uCharts]: 未获取到 context");
// }
// });
}, },
trendChartInit(id) { trendChartInit(id) {
// const ctx = uni.createCanvasContext(id, this); const ctx = uni.createCanvasContext(id, this);
const query = uni.createSelectorQuery().in(this);
query.select('#' + id).fields({ node: true, size: true }).exec(res => {
console.log(res)
if (res[0]) {
const canvas = res[0].node;
const ctx = canvas.getContext('2d');
canvas.width = 350
canvas.height = 250
uChartsInstance[id] = new uCharts({ uChartsInstance[id] = new uCharts({
type: "line", type: "line",
context: ctx, context: ctx,
@@ -308,22 +300,10 @@ export default {
activeType: "hollow", activeType: "hollow",
}, },
} }
}); })
}else{
console.error("[uCharts]: 未获取到 context");
}
});
}, },
typeChartInit(id) { typeChartInit(id) {
// var ctx = uni.createCanvasContext(id, this); var ctx = uni.createCanvasContext(id, this);
const query = uni.createSelectorQuery().in(this);
query.select('#' + id).fields({ node: true, size: true }).exec(res => {
console.log(res)
if (res[0]) {
const canvas = res[0].node;
const ctx = canvas.getContext('2d');
canvas.width = 350
canvas.height = 250
uChartsInstance[id] = new uCharts({ uChartsInstance[id] = new uCharts({
type: "ring", type: "ring",
width: 350, width: 350,
@@ -360,10 +340,6 @@ export default {
} }
} }
}) })
}else{
console.error("[uCharts]: 未获取到 context");
}
});
}, },
selectStatus(e) { selectStatus(e) {
this.statusInfo.name = e[0].label this.statusInfo.name = e[0].label