|
@@ -178,12 +178,21 @@ export default {
|
|
|
var myChart = window.echarts.init(dom);
|
|
|
// Mock数据
|
|
|
const mockData = {
|
|
|
+ xdata: store.state.cockpit_tdgy.gy_jg.xdata,
|
|
|
+ result: store.state.cockpit_tdgy.gy_jg.result
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log('mockData: ', mockData);
|
|
|
+
|
|
|
+
|
|
|
+ const mockData1 = {
|
|
|
xdata: ['居民用地', '公共管理用地', '商业商服用地', '工矿用地', '工矿用地仓储用地', "交通运输用地"],
|
|
|
result: [
|
|
|
{ name: '计划收储', data: [...new Array(33)].map((item, i) => +(Math.random(0, 10) * 1000).toFixed(0)) },
|
|
|
{ name: '完成收储', data: [...new Array(33)].map((item, i) => +(Math.random(0, 0.5) * 1000).toFixed(0)) },
|
|
|
]
|
|
|
}
|
|
|
+ console.log('mockData1: ', mockData1);
|
|
|
|
|
|
const color = [
|
|
|
[{ offset: 0, color: 'rgba(183, 117, 12, 0.8)' }, { offset: 0.5, color: 'rgba(183, 117, 12, 0.8)' }, { offset: 0.5, color: 'rgba(249, 180, 71, 0.8)' }, { offset: 1, color: 'rgba(249, 180, 71, 0.8)' }],
|
|
@@ -249,9 +258,11 @@ export default {
|
|
|
axisTick: { show: false },
|
|
|
}]
|
|
|
const diamondData = mockData.result.reduce((pre, cur, index) => {
|
|
|
+ console.log('pre, cur, index: ', pre, cur, index);
|
|
|
pre[index] = cur.data.map((el, id) => el + (pre[index - 1] ? pre[index - 1][id] : 0))
|
|
|
return pre
|
|
|
}, [])
|
|
|
+ console.log('diamondData: ', diamondData);
|
|
|
|
|
|
let series = mockData.result.reduce((p, c, i, array) => {
|
|
|
p.push({
|
|
@@ -318,14 +329,7 @@ export default {
|
|
|
}, changeChartsRight() {
|
|
|
|
|
|
},
|
|
|
- async getInfo() {
|
|
|
- let res = await QueryList({
|
|
|
- val0: '区',
|
|
|
- jscType: "jsc_tdgy_jt_xx",
|
|
|
- id: 4602,
|
|
|
- });
|
|
|
- this.jiDataInfo = res.data
|
|
|
- },
|
|
|
+
|
|
|
init_echart() {
|
|
|
|
|
|
var dom = document.getElementById("dial_watch");
|
|
@@ -716,14 +720,46 @@ export default {
|
|
|
myChart.setOption(option);
|
|
|
|
|
|
},
|
|
|
+ async init_tdgy_gy_jd(params) {
|
|
|
+ const that = this;
|
|
|
+ let obj = {
|
|
|
+ jscType: 'jsc_tdgy_gy_yelx',
|
|
|
+ id: params ? params.id : '4602'
|
|
|
+ };
|
|
|
+ let data = await QueryList(obj);
|
|
|
+ let xdata = [];
|
|
|
+ let result = [
|
|
|
+ {
|
|
|
+ name: "计划收储",
|
|
|
+ data: []
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "完成收储",
|
|
|
+ data: []
|
|
|
+ }
|
|
|
+ ];
|
|
|
+
|
|
|
+ data.data.forEach((res) => {
|
|
|
+ xdata.push(res.tdyt);
|
|
|
+ result[0].data.push(res.jh_crmj);
|
|
|
+ result[1].data.push(res.sj_crmj);
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ store.state.cockpit_tdgy.gy_jg.xdata = xdata
|
|
|
+ store.state.cockpit_tdgy.gy_jg.result = result
|
|
|
+ that.init_gy_jg_echart();
|
|
|
+
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
const that = this;
|
|
|
this.$nextTick(() => {
|
|
|
- that.getInfo();
|
|
|
+
|
|
|
+
|
|
|
+ this.init_tdgy_gy_jd();
|
|
|
that.init_echart();
|
|
|
that.init_dial_watch_scjg();
|
|
|
- that.init_gy_jg_echart();
|
|
|
|
|
|
this.$refs.tdgy_echart_gyjd.setOptions([
|
|
|
{ name: "未供应", value: 12 },
|