5744c545 by xiaomiao

数据趋势

1 parent 3b09ad45
...@@ -36,6 +36,16 @@ class work { ...@@ -36,6 +36,16 @@ class work {
36 } 36 }
37 }) 37 })
38 } 38 }
39 // 数据趋势
40 async dataTrend (code) {
41 return request({
42 url: SERVER.SERVERAPI + '/rest/reg/work/dataTrend',
43 method: 'get',
44 params: {
45 code: code
46 }
47 })
48 }
39 // 新建国有房屋信息 49 // 新建国有房屋信息
40 async addhousetotal (code) { 50 async addhousetotal (code) {
41 return request({ 51 return request({
......
...@@ -49,10 +49,10 @@ export default { ...@@ -49,10 +49,10 @@ export default {
49 watch: { 49 watch: {
50 cdata: { 50 cdata: {
51 handler (newData) { 51 handler (newData) {
52 this.xAxisData = newData.echartData.map((v) => v.name); 52 this.xAxisData = newData.echartData.map((v) => v.yearMonth);
53 this.yAxisData1 = newData.echartData.map((v) => v.value1); 53 this.yAxisData1 = newData.echartData.map((v) => v.receive);
54 this.yAxisData2 = newData.echartData.map((v) => v.value2); 54 this.yAxisData2 = newData.echartData.map((v) => v.record);
55 this.yAxisData3 = newData.echartData.map((v) => v.value3); 55 this.yAxisData3 = newData.echartData.map((v) => v.report);
56 this.options = { 56 this.options = {
57 color: newData.color, 57 color: newData.color,
58 legend: { 58 legend: {
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
4 4
5 <script> 5 <script>
6 import Chart from './Chart' 6 import Chart from './Chart'
7 import work from "@/api/work";
7 export default { 8 export default {
8 data () { 9 data () {
9 return { 10 return {
...@@ -88,6 +89,7 @@ export default { ...@@ -88,6 +89,7 @@ export default {
88 Chart 89 Chart
89 }, 90 },
90 mounted() { 91 mounted() {
92
91 window.addEventListener("resize", () => { 93 window.addEventListener("resize", () => {
92 this.cdata=[], 94 this.cdata=[],
93 this.cdata= { 95 this.cdata= {
...@@ -97,75 +99,26 @@ export default { ...@@ -97,75 +99,26 @@ export default {
97 "#E873B2", 99 "#E873B2",
98 "#F4AF6F " 100 "#F4AF6F "
99 ], 101 ],
100 echartData: [{ 102 echartData: []
101 name: "2017-11",
102 value1: 1351,
103 value2: 600,
104 value3: 568,
105 },
106 {
107 name: "2017-11",
108 value1: 980,
109 value2: 1245,
110 value3: 1100,
111 },
112 {
113 name: "2017-11",
114 value1: 1127,
115 value2: 398,
116 value3: 568,
117 },
118 {
119 name: "2017-11",
120 value1: 1046,
121 value2: 689,
122 value3: 479
123 },
124 {
125 name: "2018-02",
126 value1: 780,
127 value2: 396,
128 value3: 655
129 },
130 {
131 name: "2018-08",
132 value1: 359,
133 value2: 1220,
134 value3: 540,
135 },
136 {
137 name: "2018-07",
138 value1: 229,
139 value2: 836,
140 value3: 1234,
141 },
142 {
143 name: "2018-09",
144 value1: 1176,
145 value2: 478,
146 value3: 755,
147 },
148 {
149 name: "2018-11",
150 value1: 515,
151 value2: 911,
152 value3: 806,
153 },
154 {
155 name: "2019-01",
156 value1: 658,
157 value2: 979,
158 value3: 813,
159 },
160 {
161 name: "2019-03",
162 value1: 364,
163 value2: 839,
164 value3: 886,
165 },
166 ]
167 } 103 }
168 }); 104 });
105 window.addEventListener("resize", () => {
106 this.dataTrend()
107 });
108 this.dataTrend()
109 },
110 methods: {
111 async dataTrend() {
112 try {
113 let { result: res } = await work.dataTrend();
114 this.cdata.echartData = [];
115 this.cdata.echartData=res,
116 res.map((item) => {
117 });
118 } catch (error) {
119 console.log(error);
120 }
121 },
169 }, 122 },
170 } 123 }
171 </script> 124 </script>
......