@ued_fpi/data-visual 1.4.4 → 1.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,15 +19,22 @@ const __default__ = {
19
19
  };
20
20
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
21
21
  ...__default__,
22
+ props: {
23
+ url: {
24
+ type: String,
25
+ default: "/ipes-srip-server/api/v4/hazard-source/evaluate/gis/stat"
26
+ }
27
+ },
22
28
  setup(__props) {
29
+ const props = __props;
23
30
  const countData = vue.ref({
24
- special: 0,
25
- keyPoint: 0,
31
+ control: 0,
32
+ focus: 0,
26
33
  general: 0
27
34
  });
28
35
  const countPercent = vue.ref({
29
- specialPercent: 0,
30
- keyPointPercent: 0,
36
+ controlPercent: 0,
37
+ focusPercent: 0,
31
38
  generalPercent: 0
32
39
  });
33
40
  function getShowData(value) {
@@ -37,14 +44,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
37
44
  try {
38
45
  const res = await request.default({
39
46
  method: "get",
40
- url: "/ipes-company-epcode-server/api/v2/gis/stat/company-rule-color"
47
+ url: props.url
41
48
  });
42
- const { special, keyPoint, general } = res.data;
49
+ const { control, focus, general } = res.data;
43
50
  countData.value = res.data || {};
44
- const total = special + keyPoint + general;
51
+ const total = control + focus + general;
45
52
  countPercent.value = {
46
- specialPercent: total === 0 ? 0 : special / total * 100,
47
- keyPointPercent: total === 0 ? 0 : keyPoint / total * 100,
53
+ controlPercent: total === 0 ? 0 : control / total * 100,
54
+ focusPercent: total === 0 ? 0 : focus / total * 100,
48
55
  generalPercent: total === 0 ? 100 : general / total * 100
49
56
  };
50
57
  } catch (error) {
@@ -59,20 +66,20 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
59
66
  vue.createElementVNode("div", _hoisted_2, [
60
67
  _hoisted_3,
61
68
  vue.createElementVNode("div", _hoisted_4, [
62
- vue.createElementVNode("span", null, vue.toDisplayString(getShowData(countData.value.special)) + "家 ", 1),
69
+ vue.createElementVNode("span", null, vue.toDisplayString(getShowData(countData.value.control)) + "家 ", 1),
63
70
  _hoisted_5,
64
- vue.createElementVNode("span", null, vue.toDisplayString(getShowData(countData.value.keyPoint)) + "家 ", 1),
71
+ vue.createElementVNode("span", null, vue.toDisplayString(getShowData(countData.value.focus)) + "家 ", 1),
65
72
  _hoisted_6,
66
73
  vue.createElementVNode("span", null, vue.toDisplayString(getShowData(countData.value.general)) + "家 ", 1)
67
74
  ])
68
75
  ]),
69
76
  vue.createElementVNode("div", _hoisted_7, [
70
77
  vue.createVNode(BarItem.default, {
71
- percent: countPercent.value.specialPercent,
78
+ percent: countPercent.value.controlPercent,
72
79
  "class-name": "red"
73
80
  }, null, 8, ["percent"]),
74
81
  vue.createVNode(BarItem.default, {
75
- percent: countPercent.value.keyPointPercent,
82
+ percent: countPercent.value.focusPercent,
76
83
  "class-name": "yellow"
77
84
  }, null, 8, ["percent"]),
78
85
  vue.createVNode(BarItem.default, {
@@ -3,6 +3,7 @@
3
3
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
4
 
5
5
  const vue = require('vue');
6
+ const request = require('../../service/request.js');
6
7
 
7
8
  const _hoisted_1 = { class: "dv-ipes-dual-prevention-mechanism" };
8
9
  const _hoisted_2 = { class: "name" };
@@ -13,33 +14,52 @@ const __default__ = {
13
14
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
14
15
  ...__default__,
15
16
  props: {
16
- data: {
17
- type: Object,
18
- default: () => ({
19
- veryGood: null,
20
- good: null,
21
- medium: null,
22
- bad: null,
23
- unconstructed: null
24
- })
17
+ dataList: {
18
+ type: Array,
19
+ default: () => ["excellentCount", "fineCount", "middlingCount", "badCount"]
25
20
  }
26
21
  },
27
22
  setup(__props) {
23
+ const props = __props;
24
+ const data = vue.ref({
25
+ excellentCount: null,
26
+ fineCount: null,
27
+ middlingCount: null,
28
+ badCount: null,
29
+ nodBuildCount: null
30
+ });
28
31
  const levels = vue.ref([
29
- { name: "优", key: "veryGood", color: "--dv-color-success" },
30
- { name: "良", key: "good", color: "--dv-color-warning" },
31
- { name: "中", key: "medium", color: "--dv-color-index" },
32
- { name: "差", key: "bad", color: "--dv-color-danger" },
33
- { name: "未建设", key: "unconstructed", color: "--dv-color-text-primary" }
32
+ { name: "优", key: "excellentCount", color: "--dv-color-success" },
33
+ { name: "良", key: "fineCount", color: "--dv-color-warning" },
34
+ { name: "中", key: "middlingCount", color: "--dv-color-index" },
35
+ { name: "差", key: "badCount", color: "--dv-color-danger" },
36
+ { name: "未建设", key: "nodBuildCount", color: "--dv-color-text-primary" }
34
37
  ]);
38
+ const levelsView = vue.computed(() => {
39
+ return levels.value.filter((item) => {
40
+ return props.dataList.includes(item.key);
41
+ });
42
+ });
35
43
  function getShowData(value) {
36
44
  return value == null || isNaN(+value) ? "--" : value;
37
45
  }
46
+ async function getData() {
47
+ try {
48
+ const res = await request.default({
49
+ method: "get",
50
+ url: "/ipes-srip-server/api/v4/statistics/mechanism-operation"
51
+ });
52
+ data.value = res.data;
53
+ } catch (error) {
54
+ console.log(error);
55
+ }
56
+ }
38
57
  vue.onMounted(() => {
58
+ getData();
39
59
  });
40
60
  return (_ctx, _cache) => {
41
61
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
42
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(levels.value, (item) => {
62
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(levelsView.value, (item) => {
43
63
  return vue.openBlock(), vue.createElementBlock("div", {
44
64
  key: item.key,
45
65
  class: "level-item"
@@ -48,7 +68,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
48
68
  vue.createElementVNode("div", {
49
69
  class: "value",
50
70
  style: vue.normalizeStyle({ color: `var(${item.color})` })
51
- }, vue.toDisplayString(getShowData(__props.data[item.key])), 5)
71
+ }, vue.toDisplayString(getShowData(data.value[item.key])), 5)
52
72
  ]);
53
73
  }), 128))
54
74
  ]);
@@ -27,26 +27,26 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
27
27
  const colors = ["var(--dv-color-danger)", "var(--dv-color-warning)", "var(--dv-color-index)", "var(--dv-color-success)"];
28
28
  const totalCount = vue.ref(0);
29
29
  const legendData = vue.ref([
30
- {
31
- name: "管委会",
32
- key: "managePeopleNum",
33
- count: 0
34
- },
35
- {
36
- name: "企业",
37
- key: "companyPeopleNum",
38
- count: 0
39
- },
40
- {
41
- name: "第三方",
42
- key: "thirdPeopleNum",
43
- count: 0
44
- },
45
- {
46
- name: "访客",
47
- key: "visitorNum",
48
- count: 0
49
- }
30
+ // {
31
+ // name: '管委会',
32
+ // key: 'managePeopleNum',
33
+ // count: 0
34
+ // },
35
+ // {
36
+ // name: '企业',
37
+ // key: 'companyPeopleNum',
38
+ // count: 0
39
+ // },
40
+ // {
41
+ // name: '第三方',
42
+ // key: 'thirdPeopleNum',
43
+ // count: 0
44
+ // },
45
+ // {
46
+ // name: '访客',
47
+ // key: 'visitorNum',
48
+ // count: 0
49
+ // }
50
50
  ]);
51
51
  const personnelChart = vue.ref();
52
52
  function drawChart(data) {
@@ -103,10 +103,20 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
103
103
  url: "/ipes-pcip-server/api/v2/gis/stat-people-online"
104
104
  });
105
105
  const seriesData = [];
106
- legendData.value.forEach((item) => {
107
- item.count = data[item.key] || 0;
108
- seriesData.push([item.name, data[item.key] || 0]);
106
+ const dataList = data?.dataList || [
107
+ // {
108
+ // num: 200,
109
+ // name: '管委会'
110
+ // },
111
+ // {
112
+ // num: 100,
113
+ // name: '1管委会2'
114
+ // }
115
+ ];
116
+ dataList.forEach((item) => {
117
+ seriesData.push([item.name, item.num || 0]);
109
118
  });
119
+ legendData.value = dataList;
110
120
  totalCount.value = data?.total || 0;
111
121
  drawChart(seriesData);
112
122
  } catch (error) {
@@ -144,7 +154,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
144
154
  style: vue.normalizeStyle({ background: colors[index] })
145
155
  }, null, 4),
146
156
  vue.createElementVNode("div", _hoisted_10, vue.toDisplayString(item.name), 1),
147
- vue.createElementVNode("div", _hoisted_11, vue.toDisplayString(item.count || 0), 1)
157
+ vue.createElementVNode("div", _hoisted_11, vue.toDisplayString(item.num || 0), 1)
148
158
  ]);
149
159
  }), 128))
150
160
  ])
@@ -31,7 +31,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
31
31
  method: "get",
32
32
  url: "/ipes-srip-server/api/v1/vehicle-statistical/car-today"
33
33
  });
34
- basicInfoData.value = res;
34
+ basicInfoData.value = res.data;
35
35
  } catch (error) {
36
36
  console.log(error);
37
37
  }
@@ -80,19 +80,19 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
80
80
  // 定位车辆
81
81
  abnormalCar: 0,
82
82
  // 异常车辆
83
- chemicalCar: 0,
84
- // 危险化车
85
- normalCar: 0,
86
- // 普通车
83
+ fixCar: 0,
84
+ // 固定车
85
+ appointCar: 0,
86
+ // 预约车
87
87
  tempCar: 0,
88
88
  // 临时车
89
89
  other: 0
90
90
  // 其他车
91
91
  });
92
92
  const commitmentInfos = vue.ref([
93
- { title: "危化品车", key: "chemicalCar" },
94
- { title: "普通车", key: "normalCar" },
93
+ { title: "固定车", key: "fixCar" },
95
94
  { title: "临时车", key: "tempCar" },
95
+ { title: "预约车", key: "appointCar" },
96
96
  { title: "其他车", key: "other" }
97
97
  ]);
98
98
  async function getData() {