月球大数据地理空间分析展示平台-【中台】
Surpriseplus
2023-06-14 a7ceb07fdcbcac1edcecb8c96bfa7808ea7670c5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
<template>
  <div class="current">
    <div class="rightContainer" v-if="currentDisplay == '大屏' && ChartDisplay">
      <div class="current1 current1-1">
        <div class="aside-title">项目统计</div>
        <project-category></project-category>
      </div>
      <div class="current1 current1-2">
        <div class="aside-title">数据统计</div>
        <visit-count></visit-count>
      </div>
      <div class="current1 current1-3">
        <div class="aside-title">服务访问次数</div>
        <Service-Get></Service-Get>
      </div>
    </div>
    <!-- 全球、全国项目 -->
    <div class="rightContainer" v-if="currentDisplay == '项目'">
      <div class="current1">
        <div class="aside-title"></div>
        <!-- <country-dimension-bar ref="barRef"></country-dimension-bar> -->
        <base-bar-chart
          title="项目个数"
          :project="currentProject"
        ></base-bar-chart>
      </div>
      <div class="current1">
        <div class="aside-title">项目饼状图</div>
        <!-- <base-pie-chart :project="currentProject"></base-pie-chart> -->
        <country-dimension-pie
          v-if="currentProject == '全球项目'"
          ref="pieRef"
        ></country-dimension-pie>
        <province-dimension-pie v-else ref="pieRef"></province-dimension-pie>
      </div>
      <div class="current1">
        <div class="aside-title">数据使用情况</div>
        <dv-capsule-chart
          :config="barConfig"
          style="width: 360px; height: 85%"
        />
      </div>
    </div>
    <!-- 全国、全球管网 -->
    <div class="rightContainer" v-if="currentDisplay == '管网'">
      <div class="current1">
        <div class="aside-title">站场座数</div>
        <!-- <country-dimension-bar ref="barRef"></country-dimension-bar> -->
        <base-bar-chart
          title="站场座数"
          :project="currentProject"
        ></base-bar-chart>
      </div>
      <div class="current1">
        <div class="aside-title">阀室座数</div>
        <dv-active-ring-chart
          :config="pieconfig"
          style="width: 377px; height: 85%"
        />
      </div>
      <div class="current1">
        <div class="aside-title">管道条数</div>
        <dv-conical-column-chart
          :config="config"
          style="width: 377px; height: 85%"
        />
      </div>
    </div>
    <!-- 单个工程 -->
    <div class="rightContainer" v-if="currentDisplay == '工程'">
      <div class="current1">
        <div class="aside-title">数据存储量</div>
        <base-line-chart
          title="数据存储量"
          :project="currentProject"
          :params="params"
        ></base-line-chart>
      </div>
      <div class="current1">
        <div class="aside-title">数据下载次数</div>
        <base-pie-chart
          height="90%"
          :project="currentProject"
          :params="params"
        ></base-pie-chart>
      </div>
      <div class="current1">
        <div class="aside-title">管道条数</div>
        <div class="content" style="height: 30px">
          <div class="header">
            <div>格式</div>
            <div>数量</div>
          </div>
        </div>
        <file-format :params="params"></file-format>
      </div>
    </div>
 
    <div class="rightarrow">
      <img :src="RightImg" @click="ChangeRight" />
    </div>
  </div>
</template>
<script>
import echart11 from "@/components/echart11.vue";
import echart12 from "@/components/echart12.vue";
import echart13 from "@/components/echart13.vue";
import FileFormat from "@/components/chart/FileFormat.vue";
import ProjectCategory from "../chart/ProjectCategory.vue";
import CountryDimensionBar from "../chart/CountryDimensionBar.vue";
import CountryDimensionPie from "../chart/CountryDimensionPie.vue";
import ProvinceDimensionBar from "../chart/CountryProvinceBar.vue";
import ProvinceDimensionPie from "../chart/CountryProvincePie.vue";
import ServiceGet from "../chart/ServiceGet.vue";
import BaseBarChart from "../chart/BaseBarChart.vue";
import BaseLineChart from "../chart/BaseLineChart.vue";
import BasePieChart from "../chart/BasePieChart .vue";
import VisitCount from "../chart/VisitCount.vue";
 
import {
  countCountryDimension,
  countProvinceDimension,
  countZhPipeStations,
  countDownloads,
} from "@/api/screen.js";
 
export default {
  components: {
    echart11,
    echart12,
    echart13,
    FileFormat,
    ProjectCategory,
    CountryDimensionBar,
    CountryDimensionPie,
    ProvinceDimensionBar,
    ProvinceDimensionPie,
    ServiceGet,
    BaseBarChart,
    BaseLineChart,
    BasePieChart,
    VisitCount,
  },
  data() {
    return {
      ChartDisplay: true,
      CourtyDisplay: false,
      PipeDisPlay: false,
      RightImg: require("../../assets/img/Screen/leftArrow.png"),
      leftMessage: "init",
      currentProject: "全球项目",
      currentDisplay: "大屏",
      countryData: [],
      provinceData: [],
      config: {
        data: [
          {
            name: "南阳",
            value: 167,
          },
          {
            name: "周口",
            value: 123,
          },
          {
            name: "漯河",
            value: 98,
          },
          {
            name: "郑州",
            value: 75,
          },
          {
            name: "西峡",
            value: 66,
          },
        ],
        showValue: true,
      },
      pieconfig: {
        data: [
          {
            name: "周口",
            value: 55,
          },
          {
            name: "南阳",
            value: 120,
          },
          {
            name: "西峡",
            value: 78,
          },
          {
            name: "驻马店",
            value: 66,
          },
          {
            name: "新乡",
            value: 80,
          },
        ],
        lineWidth: 10,
      },
      barConfig: {
        data: [
          {
            name: "南阳",
            value: 167,
          },
          {
            name: "周口",
            value: 123,
          },
          {
            name: "漯河",
            value: 98,
          },
          {
            name: "郑州",
            value: 75,
          },
          {
            name: "西峡",
            value: 66,
          },
        ],
        showValue: true,
      },
      params: {},
    };
  },
  created() {
    this.getZhPipeStations();
    this.getCountDownloads();
  },
  mounted() {
    this.OpenLeftInit();
    this.$bus.$on("changeProject", (name) => {
      if (name.includes("全球管网") || name.includes("全国管网")) {
        this.currentDisplay = "管网";
      } else if (name.includes("全球项目") || name.includes("全国项目")) {
        this.currentDisplay = "项目";
      } else {
        this.currentDisplay = "工程";
      }
      this.currentProject = name;
    });
    this.$bus.$on("changeProjectCode", (code) => {
      this.params = {
        projectCode: code,
      };
    });
    this.$bus.$on("closeLeftAndRightMenu", (res) => {
      this.ChartDisplay = res;
      this.ChangeRight();
    });
  },
 
  methods: {
    ChangeRight() {
      if (this.leftMessage == "init") {
        if (this.ChartDisplay) {
          this.RightImg = require("../../assets/img/Screen/rightArrow.png");
        } else {
          this.RightImg = require("../../assets/img/Screen/leftArrow.png");
        }
        this.ChartDisplay = !this.ChartDisplay;
      }
 
      // if (this.leftMessage == "projectree") {
      //   if (this.CourtyDisplay) {
      //     this.RightImg = require("../../assets/img/Screen/leftArrow.png")
      //   } else {
      //     this.RightImg = require("../../assets/img/Screen/rightArrow.png")
      //   }
      //   this.CourtyDisplay = !this.CourtyDisplay
      // }
 
      // this.ChartDisplay = !this.ChartDisplay
      this.$parent.ChangeWidth("right");
    },
    //打开大屏左侧界面
    OpenLeftInit() {
      this.currentDisplay = "大屏";
      this.ChartDisplay = true;
      this.CourtyDisplay = false;
      this.leftMessage = "init";
      // this.OpenLeftInitChart();
      // this.$parent.ChangeWidth("leftTree")
    },
 
    //打开工程树
    // OpenLeftProjectTree() {
    //   this.ChartDisplay = false
    //   this.CourtyDisplay = true
    //   this.leftMessage = "projectree"
    //   this.$parent.ChangeWidth("leftTree")
    // },
    async getZhPipeStations() {
      const res = await countZhPipeStations();
      if (res.code == 200) {
        const data = res.result;
        this.pieconfig.data = res.result.map((item) => {
          return {
            name: item.输送介质,
            value: item.管道数量,
          };
        });
 
        this.pieconfig = {
          ...this.pieconfig,
        };
        this.config.data = res.result.map((item) => {
          return {
            name: item.输送介质,
            value: item.管道数量,
          };
        });
        this.config = {
          ...this.config,
        };
      }
    },
    async getCountDownloads() {
      const res = await countDownloads();
      if (res.code == 200) {
        this.barConfig.data = res.result.map((item) => {
          return {
            name: item.typename,
            value: item.count,
          };
        });
        this.barConfig = {
          ...this.barConfig,
        };
      }
    },
  },
};
</script>
<style lang="less">
.current {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
 
  .rightarrow {
    width: 36px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    img {
      width: 30px;
      height: 120px;
      cursor: pointer;
    }
  }
  .rightContainer {
    height: 100%;
    width: calc(100% - 45px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    .current1 {
      height: 32%;
      width: 100%;
      background: url(../../assets/img/Screen/chartbg.png);
      background-size: 100% 100%;
      background-repeat: no-repeat;
    }
  }
  .rightContainer2 {
    height: 100%;
    width: calc(100% - 45px);
 
    display: flex;
    flex-direction: column;
    align-items: center;
    .current1 {
      margin-top: 10px;
      margin-bottom: 30px;
      height: 30%;
      width: 100%;
      background: url(../../assets/img/Screen/chartbg.png);
      background-size: 100% 100%;
      background-repeat: no-repeat;
    }
 
  }
  .content {
    width: 100%;
    background: url(../../assets/img/Screen/contentBg.png);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    .header {
      margin: 0px auto;
      padding: 10px 0;
      width: 80%;
      display: flex;
      justify-content: space-between;
      color: #fff;
      font-size: 13px;
    }
  }
}
@media (max-width: 1400px) {
  .current .rightContainer .current1-1 {
   height: 42%;
  }
  .current .rightContainer .current1-2 {
     height: 28%;
  }
  .current .rightContainer .current1-3 {
   height: 28%;
  }
}
</style>