From 1775a808d595786d8c001f1fa7bbf04edb8d4107 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 19 Dec 2022 15:41:09 +0800 Subject: [PATCH] =?UTF-8?q?perf(=E5=9C=B0=E5=9B=BE):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E9=80=89=E6=8B=A9=E5=99=A8=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deIconPicker/deIconGroupPicker/index.vue | 570 ++++++++++++++++++ .../src/components/deIconPicker/iconList.js | 13 + .../svg/{ai37.svg => 1-trend-01-topright.svg} | 0 ...-copy-2.svg => 1-trend-02-bottomright.svg} | 0 ...y-copy-copy.svg => 1-trend-03-topleft.svg} | 0 ...opy-copy.svg => 1-trend-04-bottomleft.svg} | 0 .../{xiangshang.svg => 1-trend-05-top.svg} | 0 .../{xiangyou.svg => 1-trend-06-right.svg} | 0 .../svg/{xiangzuo.svg => 1-trend-07-left.svg} | 0 .../svg/{paixu.svg => 1-trend-08-bottom.svg} | 0 .../{shangjiantou.svg => 1-trend-09-top1.svg} | 0 ...{xiajiantou.svg => 1-trend-10-bottom1.svg} | 0 .../{zuojiantou.svg => 1-trend-11-left1.svg} | 0 .../{youjiantou.svg => 1-trend-12-right1.svg} | 0 .../{lingxing.svg => 2-state-01-diamond.svg} | 0 ...g-triangle.svg => 2-state-02-triangle.svg} | 0 .../svg/{circle.svg => 2-state-03-circle.svg} | 0 ...{five-star.svg => 2-state-04-pentagon.svg} | 0 .../svg/{rect.svg => 2-state-05-square.svg} | 0 .../svg/{qizi.svg => 2-state-06-flag.svg} | 0 ...iao-yuankuang.svg => 2-state-07-error.svg} | 0 ...nhao-yuankuang.svg => 2-state-08-warn.svg} | 0 ...-yuankuang.svg => 2-state-09-question.svg} | 0 ...ncheng-yuankuang.svg => 2-state-10-ok.svg} | 0 .../svg/{ai65.svg => 3-rank-01-half.svg} | 0 .../{wujiaoxing.svg => 3-rank-02-full.svg} | 0 .../svg/{manyi.svg => 3-rank-03-nice.svg} | 0 .../svg/{yiban.svg => 3-rank-04-commonly.svg} | 0 .../svg/{bumanyi.svg => 3-rank-05-bad.svg} | 0 ...haoping.svg => 3-rank-06-goodevaluate.svg} | 0 ...{chaping.svg => 3-rank-07-badevaluate.svg} | 0 ...ng.svg => 3-rank-08-badevaluatecircle.svg} | 0 ...g.svg => 3-rank-08-goodevaluatecircle.svg} | 0 .../{weizhi.svg => 4-location-01-mark.svg} | 0 .../src/deicons/svg/4-location-02-mark1.svg | 1 + .../src/deicons/svg/4-location-03-mark2.svg | 1 + .../deicons/svg/4-location-04-location.svg | 1 + .../deicons/svg/4-location-05-location1.svg | 1 + .../deicons/svg/4-location-06-location2.svg | 1 + .../src/deicons/svg/4-location-07-map.svg | 1 + .../src/deicons/svg/4-location-08-map1.svg | 1 + .../src/deicons/svg/5-weather-01-bigsnow.svg | 1 + .../deicons/svg/5-weather-02-littlesnow.svg | 1 + .../src/deicons/svg/5-weather-03-bigrain.svg | 1 + .../deicons/svg/5-weather-04-littlerain.svg | 1 + .../src/deicons/svg/5-weather-05-icerain.svg | 1 + .../src/deicons/svg/5-weather-06-snowrain.svg | 1 + .../src/deicons/svg/5-weather-07-sunny.svg | 1 + .../src/deicons/svg/5-weather-08-cloudy.svg | 1 + .../src/deicons/svg/5-weather-09-smog.svg | 1 + .../src/deicons/svg/5-weather-10-typhoon.svg | 1 + .../src/deicons/svg/5-weather-11-wind.svg | 1 + .../src/deicons/svg/5-weather-12-thunder.svg | 1 + frontend/src/lang/en.js | 5 + frontend/src/lang/tw.js | 5 + frontend/src/lang/zh.js | 5 + frontend/src/views/chart/chart/map/map.js | 117 ++-- .../functionStyle/MapMarkSelector.vue | 19 +- frontend/src/views/chart/view/ChartStyle.vue | 105 ++-- 59 files changed, 758 insertions(+), 100 deletions(-) create mode 100644 frontend/src/components/deIconPicker/deIconGroupPicker/index.vue rename frontend/src/deicons/svg/{ai37.svg => 1-trend-01-topright.svg} (100%) rename frontend/src/deicons/svg/{jiantou-copy-copy-2.svg => 1-trend-02-bottomright.svg} (100%) rename frontend/src/deicons/svg/{jiantou-copy-copy-copy.svg => 1-trend-03-topleft.svg} (100%) rename frontend/src/deicons/svg/{jiantou-copy-copy.svg => 1-trend-04-bottomleft.svg} (100%) rename frontend/src/deicons/svg/{xiangshang.svg => 1-trend-05-top.svg} (100%) rename frontend/src/deicons/svg/{xiangyou.svg => 1-trend-06-right.svg} (100%) rename frontend/src/deicons/svg/{xiangzuo.svg => 1-trend-07-left.svg} (100%) rename frontend/src/deicons/svg/{paixu.svg => 1-trend-08-bottom.svg} (100%) rename frontend/src/deicons/svg/{shangjiantou.svg => 1-trend-09-top1.svg} (100%) rename frontend/src/deicons/svg/{xiajiantou.svg => 1-trend-10-bottom1.svg} (100%) rename frontend/src/deicons/svg/{zuojiantou.svg => 1-trend-11-left1.svg} (100%) rename frontend/src/deicons/svg/{youjiantou.svg => 1-trend-12-right1.svg} (100%) rename frontend/src/deicons/svg/{lingxing.svg => 2-state-01-diamond.svg} (100%) rename frontend/src/deicons/svg/{zheng-triangle.svg => 2-state-02-triangle.svg} (100%) rename frontend/src/deicons/svg/{circle.svg => 2-state-03-circle.svg} (100%) rename frontend/src/deicons/svg/{five-star.svg => 2-state-04-pentagon.svg} (100%) rename frontend/src/deicons/svg/{rect.svg => 2-state-05-square.svg} (100%) rename frontend/src/deicons/svg/{qizi.svg => 2-state-06-flag.svg} (100%) rename frontend/src/deicons/svg/{cuowuguanbiquxiao-yuankuang.svg => 2-state-07-error.svg} (100%) rename frontend/src/deicons/svg/{gantanhao-yuankuang.svg => 2-state-08-warn.svg} (100%) rename frontend/src/deicons/svg/{wenhao-yuankuang.svg => 2-state-09-question.svg} (100%) rename frontend/src/deicons/svg/{zhengquewancheng-yuankuang.svg => 2-state-10-ok.svg} (100%) rename frontend/src/deicons/svg/{ai65.svg => 3-rank-01-half.svg} (100%) rename frontend/src/deicons/svg/{wujiaoxing.svg => 3-rank-02-full.svg} (100%) rename frontend/src/deicons/svg/{manyi.svg => 3-rank-03-nice.svg} (100%) rename frontend/src/deicons/svg/{yiban.svg => 3-rank-04-commonly.svg} (100%) rename frontend/src/deicons/svg/{bumanyi.svg => 3-rank-05-bad.svg} (100%) rename frontend/src/deicons/svg/{haoping.svg => 3-rank-06-goodevaluate.svg} (100%) rename frontend/src/deicons/svg/{chaping.svg => 3-rank-07-badevaluate.svg} (100%) rename frontend/src/deicons/svg/{chaping-yuankuang.svg => 3-rank-08-badevaluatecircle.svg} (100%) rename frontend/src/deicons/svg/{haoping-yuankuang.svg => 3-rank-08-goodevaluatecircle.svg} (100%) rename frontend/src/deicons/svg/{weizhi.svg => 4-location-01-mark.svg} (100%) create mode 100644 frontend/src/deicons/svg/4-location-02-mark1.svg create mode 100644 frontend/src/deicons/svg/4-location-03-mark2.svg create mode 100644 frontend/src/deicons/svg/4-location-04-location.svg create mode 100644 frontend/src/deicons/svg/4-location-05-location1.svg create mode 100644 frontend/src/deicons/svg/4-location-06-location2.svg create mode 100644 frontend/src/deicons/svg/4-location-07-map.svg create mode 100644 frontend/src/deicons/svg/4-location-08-map1.svg create mode 100644 frontend/src/deicons/svg/5-weather-01-bigsnow.svg create mode 100644 frontend/src/deicons/svg/5-weather-02-littlesnow.svg create mode 100644 frontend/src/deicons/svg/5-weather-03-bigrain.svg create mode 100644 frontend/src/deicons/svg/5-weather-04-littlerain.svg create mode 100644 frontend/src/deicons/svg/5-weather-05-icerain.svg create mode 100644 frontend/src/deicons/svg/5-weather-06-snowrain.svg create mode 100644 frontend/src/deicons/svg/5-weather-07-sunny.svg create mode 100644 frontend/src/deicons/svg/5-weather-08-cloudy.svg create mode 100644 frontend/src/deicons/svg/5-weather-09-smog.svg create mode 100644 frontend/src/deicons/svg/5-weather-10-typhoon.svg create mode 100644 frontend/src/deicons/svg/5-weather-11-wind.svg create mode 100644 frontend/src/deicons/svg/5-weather-12-thunder.svg diff --git a/frontend/src/components/deIconPicker/deIconGroupPicker/index.vue b/frontend/src/components/deIconPicker/deIconGroupPicker/index.vue new file mode 100644 index 0000000000..0de188ea20 --- /dev/null +++ b/frontend/src/components/deIconPicker/deIconGroupPicker/index.vue @@ -0,0 +1,570 @@ + + + + + diff --git a/frontend/src/components/deIconPicker/iconList.js b/frontend/src/components/deIconPicker/iconList.js index aadb561162..8bd7fbf8a3 100644 --- a/frontend/src/components/deIconPicker/iconList.js +++ b/frontend/src/components/deIconPicker/iconList.js @@ -34,10 +34,23 @@ const remove = function(list, item) { const iconList = { list: [], + group: {}, addIcon: function(item) { this.list = add(this.list, item) }, + addGroup: function(item) { + const { value, type } = item + this.group[type] = this.group[type] ? this.group[type] : [] + if (TypeUtil.isArray(value)) { + this.group[type] = this.group[type].concat(value) + } else { + this.group[type].push(value) + } + }, + initGroup: function(data) { + this.group = JSON.parse(JSON.stringify(data)) + }, removeIcon: function(item) { this.list = remove(this.list, item) diff --git a/frontend/src/deicons/svg/ai37.svg b/frontend/src/deicons/svg/1-trend-01-topright.svg similarity index 100% rename from frontend/src/deicons/svg/ai37.svg rename to frontend/src/deicons/svg/1-trend-01-topright.svg diff --git a/frontend/src/deicons/svg/jiantou-copy-copy-2.svg b/frontend/src/deicons/svg/1-trend-02-bottomright.svg similarity index 100% rename from frontend/src/deicons/svg/jiantou-copy-copy-2.svg rename to frontend/src/deicons/svg/1-trend-02-bottomright.svg diff --git a/frontend/src/deicons/svg/jiantou-copy-copy-copy.svg b/frontend/src/deicons/svg/1-trend-03-topleft.svg similarity index 100% rename from frontend/src/deicons/svg/jiantou-copy-copy-copy.svg rename to frontend/src/deicons/svg/1-trend-03-topleft.svg diff --git a/frontend/src/deicons/svg/jiantou-copy-copy.svg b/frontend/src/deicons/svg/1-trend-04-bottomleft.svg similarity index 100% rename from frontend/src/deicons/svg/jiantou-copy-copy.svg rename to frontend/src/deicons/svg/1-trend-04-bottomleft.svg diff --git a/frontend/src/deicons/svg/xiangshang.svg b/frontend/src/deicons/svg/1-trend-05-top.svg similarity index 100% rename from frontend/src/deicons/svg/xiangshang.svg rename to frontend/src/deicons/svg/1-trend-05-top.svg diff --git a/frontend/src/deicons/svg/xiangyou.svg b/frontend/src/deicons/svg/1-trend-06-right.svg similarity index 100% rename from frontend/src/deicons/svg/xiangyou.svg rename to frontend/src/deicons/svg/1-trend-06-right.svg diff --git a/frontend/src/deicons/svg/xiangzuo.svg b/frontend/src/deicons/svg/1-trend-07-left.svg similarity index 100% rename from frontend/src/deicons/svg/xiangzuo.svg rename to frontend/src/deicons/svg/1-trend-07-left.svg diff --git a/frontend/src/deicons/svg/paixu.svg b/frontend/src/deicons/svg/1-trend-08-bottom.svg similarity index 100% rename from frontend/src/deicons/svg/paixu.svg rename to frontend/src/deicons/svg/1-trend-08-bottom.svg diff --git a/frontend/src/deicons/svg/shangjiantou.svg b/frontend/src/deicons/svg/1-trend-09-top1.svg similarity index 100% rename from frontend/src/deicons/svg/shangjiantou.svg rename to frontend/src/deicons/svg/1-trend-09-top1.svg diff --git a/frontend/src/deicons/svg/xiajiantou.svg b/frontend/src/deicons/svg/1-trend-10-bottom1.svg similarity index 100% rename from frontend/src/deicons/svg/xiajiantou.svg rename to frontend/src/deicons/svg/1-trend-10-bottom1.svg diff --git a/frontend/src/deicons/svg/zuojiantou.svg b/frontend/src/deicons/svg/1-trend-11-left1.svg similarity index 100% rename from frontend/src/deicons/svg/zuojiantou.svg rename to frontend/src/deicons/svg/1-trend-11-left1.svg diff --git a/frontend/src/deicons/svg/youjiantou.svg b/frontend/src/deicons/svg/1-trend-12-right1.svg similarity index 100% rename from frontend/src/deicons/svg/youjiantou.svg rename to frontend/src/deicons/svg/1-trend-12-right1.svg diff --git a/frontend/src/deicons/svg/lingxing.svg b/frontend/src/deicons/svg/2-state-01-diamond.svg similarity index 100% rename from frontend/src/deicons/svg/lingxing.svg rename to frontend/src/deicons/svg/2-state-01-diamond.svg diff --git a/frontend/src/deicons/svg/zheng-triangle.svg b/frontend/src/deicons/svg/2-state-02-triangle.svg similarity index 100% rename from frontend/src/deicons/svg/zheng-triangle.svg rename to frontend/src/deicons/svg/2-state-02-triangle.svg diff --git a/frontend/src/deicons/svg/circle.svg b/frontend/src/deicons/svg/2-state-03-circle.svg similarity index 100% rename from frontend/src/deicons/svg/circle.svg rename to frontend/src/deicons/svg/2-state-03-circle.svg diff --git a/frontend/src/deicons/svg/five-star.svg b/frontend/src/deicons/svg/2-state-04-pentagon.svg similarity index 100% rename from frontend/src/deicons/svg/five-star.svg rename to frontend/src/deicons/svg/2-state-04-pentagon.svg diff --git a/frontend/src/deicons/svg/rect.svg b/frontend/src/deicons/svg/2-state-05-square.svg similarity index 100% rename from frontend/src/deicons/svg/rect.svg rename to frontend/src/deicons/svg/2-state-05-square.svg diff --git a/frontend/src/deicons/svg/qizi.svg b/frontend/src/deicons/svg/2-state-06-flag.svg similarity index 100% rename from frontend/src/deicons/svg/qizi.svg rename to frontend/src/deicons/svg/2-state-06-flag.svg diff --git a/frontend/src/deicons/svg/cuowuguanbiquxiao-yuankuang.svg b/frontend/src/deicons/svg/2-state-07-error.svg similarity index 100% rename from frontend/src/deicons/svg/cuowuguanbiquxiao-yuankuang.svg rename to frontend/src/deicons/svg/2-state-07-error.svg diff --git a/frontend/src/deicons/svg/gantanhao-yuankuang.svg b/frontend/src/deicons/svg/2-state-08-warn.svg similarity index 100% rename from frontend/src/deicons/svg/gantanhao-yuankuang.svg rename to frontend/src/deicons/svg/2-state-08-warn.svg diff --git a/frontend/src/deicons/svg/wenhao-yuankuang.svg b/frontend/src/deicons/svg/2-state-09-question.svg similarity index 100% rename from frontend/src/deicons/svg/wenhao-yuankuang.svg rename to frontend/src/deicons/svg/2-state-09-question.svg diff --git a/frontend/src/deicons/svg/zhengquewancheng-yuankuang.svg b/frontend/src/deicons/svg/2-state-10-ok.svg similarity index 100% rename from frontend/src/deicons/svg/zhengquewancheng-yuankuang.svg rename to frontend/src/deicons/svg/2-state-10-ok.svg diff --git a/frontend/src/deicons/svg/ai65.svg b/frontend/src/deicons/svg/3-rank-01-half.svg similarity index 100% rename from frontend/src/deicons/svg/ai65.svg rename to frontend/src/deicons/svg/3-rank-01-half.svg diff --git a/frontend/src/deicons/svg/wujiaoxing.svg b/frontend/src/deicons/svg/3-rank-02-full.svg similarity index 100% rename from frontend/src/deicons/svg/wujiaoxing.svg rename to frontend/src/deicons/svg/3-rank-02-full.svg diff --git a/frontend/src/deicons/svg/manyi.svg b/frontend/src/deicons/svg/3-rank-03-nice.svg similarity index 100% rename from frontend/src/deicons/svg/manyi.svg rename to frontend/src/deicons/svg/3-rank-03-nice.svg diff --git a/frontend/src/deicons/svg/yiban.svg b/frontend/src/deicons/svg/3-rank-04-commonly.svg similarity index 100% rename from frontend/src/deicons/svg/yiban.svg rename to frontend/src/deicons/svg/3-rank-04-commonly.svg diff --git a/frontend/src/deicons/svg/bumanyi.svg b/frontend/src/deicons/svg/3-rank-05-bad.svg similarity index 100% rename from frontend/src/deicons/svg/bumanyi.svg rename to frontend/src/deicons/svg/3-rank-05-bad.svg diff --git a/frontend/src/deicons/svg/haoping.svg b/frontend/src/deicons/svg/3-rank-06-goodevaluate.svg similarity index 100% rename from frontend/src/deicons/svg/haoping.svg rename to frontend/src/deicons/svg/3-rank-06-goodevaluate.svg diff --git a/frontend/src/deicons/svg/chaping.svg b/frontend/src/deicons/svg/3-rank-07-badevaluate.svg similarity index 100% rename from frontend/src/deicons/svg/chaping.svg rename to frontend/src/deicons/svg/3-rank-07-badevaluate.svg diff --git a/frontend/src/deicons/svg/chaping-yuankuang.svg b/frontend/src/deicons/svg/3-rank-08-badevaluatecircle.svg similarity index 100% rename from frontend/src/deicons/svg/chaping-yuankuang.svg rename to frontend/src/deicons/svg/3-rank-08-badevaluatecircle.svg diff --git a/frontend/src/deicons/svg/haoping-yuankuang.svg b/frontend/src/deicons/svg/3-rank-08-goodevaluatecircle.svg similarity index 100% rename from frontend/src/deicons/svg/haoping-yuankuang.svg rename to frontend/src/deicons/svg/3-rank-08-goodevaluatecircle.svg diff --git a/frontend/src/deicons/svg/weizhi.svg b/frontend/src/deicons/svg/4-location-01-mark.svg similarity index 100% rename from frontend/src/deicons/svg/weizhi.svg rename to frontend/src/deicons/svg/4-location-01-mark.svg diff --git a/frontend/src/deicons/svg/4-location-02-mark1.svg b/frontend/src/deicons/svg/4-location-02-mark1.svg new file mode 100644 index 0000000000..1c4398c270 --- /dev/null +++ b/frontend/src/deicons/svg/4-location-02-mark1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/deicons/svg/4-location-03-mark2.svg b/frontend/src/deicons/svg/4-location-03-mark2.svg new file mode 100644 index 0000000000..e4a866f47a --- /dev/null +++ b/frontend/src/deicons/svg/4-location-03-mark2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/deicons/svg/4-location-04-location.svg b/frontend/src/deicons/svg/4-location-04-location.svg new file mode 100644 index 0000000000..aacdc591ba --- /dev/null +++ b/frontend/src/deicons/svg/4-location-04-location.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/deicons/svg/4-location-05-location1.svg b/frontend/src/deicons/svg/4-location-05-location1.svg new file mode 100644 index 0000000000..4e896ecc43 --- /dev/null +++ b/frontend/src/deicons/svg/4-location-05-location1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/deicons/svg/4-location-06-location2.svg b/frontend/src/deicons/svg/4-location-06-location2.svg new file mode 100644 index 0000000000..81fa53d188 --- /dev/null +++ b/frontend/src/deicons/svg/4-location-06-location2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/deicons/svg/4-location-07-map.svg b/frontend/src/deicons/svg/4-location-07-map.svg new file mode 100644 index 0000000000..da38e94039 --- /dev/null +++ b/frontend/src/deicons/svg/4-location-07-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/deicons/svg/4-location-08-map1.svg b/frontend/src/deicons/svg/4-location-08-map1.svg new file mode 100644 index 0000000000..1785ee84f8 --- /dev/null +++ b/frontend/src/deicons/svg/4-location-08-map1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/deicons/svg/5-weather-01-bigsnow.svg b/frontend/src/deicons/svg/5-weather-01-bigsnow.svg new file mode 100644 index 0000000000..f4ee1c4971 --- /dev/null +++ b/frontend/src/deicons/svg/5-weather-01-bigsnow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/deicons/svg/5-weather-02-littlesnow.svg b/frontend/src/deicons/svg/5-weather-02-littlesnow.svg new file mode 100644 index 0000000000..fae5c94cd4 --- /dev/null +++ b/frontend/src/deicons/svg/5-weather-02-littlesnow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/deicons/svg/5-weather-03-bigrain.svg b/frontend/src/deicons/svg/5-weather-03-bigrain.svg new file mode 100644 index 0000000000..c57fd98927 --- /dev/null +++ b/frontend/src/deicons/svg/5-weather-03-bigrain.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/deicons/svg/5-weather-04-littlerain.svg b/frontend/src/deicons/svg/5-weather-04-littlerain.svg new file mode 100644 index 0000000000..80fd211ba1 --- /dev/null +++ b/frontend/src/deicons/svg/5-weather-04-littlerain.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/deicons/svg/5-weather-05-icerain.svg b/frontend/src/deicons/svg/5-weather-05-icerain.svg new file mode 100644 index 0000000000..55ad187bde --- /dev/null +++ b/frontend/src/deicons/svg/5-weather-05-icerain.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/deicons/svg/5-weather-06-snowrain.svg b/frontend/src/deicons/svg/5-weather-06-snowrain.svg new file mode 100644 index 0000000000..ad623306d0 --- /dev/null +++ b/frontend/src/deicons/svg/5-weather-06-snowrain.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/deicons/svg/5-weather-07-sunny.svg b/frontend/src/deicons/svg/5-weather-07-sunny.svg new file mode 100644 index 0000000000..e4eb5a02dc --- /dev/null +++ b/frontend/src/deicons/svg/5-weather-07-sunny.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/deicons/svg/5-weather-08-cloudy.svg b/frontend/src/deicons/svg/5-weather-08-cloudy.svg new file mode 100644 index 0000000000..87ebf17cc4 --- /dev/null +++ b/frontend/src/deicons/svg/5-weather-08-cloudy.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/deicons/svg/5-weather-09-smog.svg b/frontend/src/deicons/svg/5-weather-09-smog.svg new file mode 100644 index 0000000000..3675f04c21 --- /dev/null +++ b/frontend/src/deicons/svg/5-weather-09-smog.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/deicons/svg/5-weather-10-typhoon.svg b/frontend/src/deicons/svg/5-weather-10-typhoon.svg new file mode 100644 index 0000000000..90fe750325 --- /dev/null +++ b/frontend/src/deicons/svg/5-weather-10-typhoon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/deicons/svg/5-weather-11-wind.svg b/frontend/src/deicons/svg/5-weather-11-wind.svg new file mode 100644 index 0000000000..3701473974 --- /dev/null +++ b/frontend/src/deicons/svg/5-weather-11-wind.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/deicons/svg/5-weather-12-thunder.svg b/frontend/src/deicons/svg/5-weather-12-thunder.svg new file mode 100644 index 0000000000..6f0c237111 --- /dev/null +++ b/frontend/src/deicons/svg/5-weather-12-thunder.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 27708a6d37..6822dcbe3a 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -931,6 +931,11 @@ export default { password_input_error: 'Original password input error' }, chart: { + '1-trend': 'trend', + '2-state': 'State', + '3-rank': 'Rank', + '4-location': 'Location', + '5-weather': 'Weather', chinese: 'Chinese', mark_field: 'Field', mark_value: 'Value', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index cc4a6bda24..e306347505 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -930,6 +930,11 @@ export default { password_input_error: '原始密碼輸入錯誤' }, chart: { + '1-trend': '趨勢', + '2-state': '狀態', + '3-rank': '排名', + '4-location': '位置', + '5-weather': '天氣', chinese: '中文', mark_field: '字段', mark_value: '值', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index d4de2d534d..733d69d3af 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -929,6 +929,11 @@ export default { password_input_error: '原始密码输入错误' }, chart: { + '1-trend': '趋势', + '2-state': '状态', + '3-rank': '排名', + '4-location': '位置', + '5-weather': '天气', chinese: '中文', mark_field: '字段', mark_value: '值', diff --git a/frontend/src/views/chart/chart/map/map.js b/frontend/src/views/chart/chart/map/map.js index 0068d79fef..109b6feb33 100644 --- a/frontend/src/views/chart/chart/map/map.js +++ b/frontend/src/views/chart/chart/map/map.js @@ -164,74 +164,81 @@ export function baseMapOption(chart_option, chart, themeStyle, curAreaCode, seri if (chart.data?.detailFields?.length > 1) { const deNameArray = ['x', 'y'] + let hasx = false + let hasy = false chart.data.detailFields.forEach(item => { if (item?.busiType === 'locationXaxis') { + hasx = true deNameArray[0] = item } else if (item?.busiType === 'locationYaxis') { + hasy = true deNameArray[1] = item } else { deNameArray.push(item) } }) let markData = [] - chart.data.tableRow.forEach(row => { - if (row?.details) { - markData = markData.concat(row.details.map(detail => { - const temp = deNameArray.map(key => detail[key.dataeaseName]) - temp.push(1) - return temp - })) - } - }) - - if (markData.length) { - let valueIndex = -1 - const markCondition = customAttr.mark - if (markCondition?.fieldId && markCondition.conditions?.length) { - for (let i = 0; i < deNameArray.length; i++) { - if (deNameArray[i].id === markCondition.fieldId) { - valueIndex = i - break - } + if (hasx && hasy) { + chart.data.tableRow.forEach(row => { + if (row?.details) { + markData = markData.concat(row.details.map(detail => { + const temp = deNameArray.map(key => detail[key.dataeaseName]) + temp.push(1) + return temp + })) } - } - const markSeries = { - type: 'scatter', - coordinateSystem: 'geo', - geoIndex: 0, - symbolSize: function(params) { - return 20 - }, - symbol: (values, param) => { - if (valueIndex < 0) { - return svgPathData() - } - const val = values[valueIndex] - const field = deNameArray[valueIndex] - const con = getSvgCondition(val, field, markCondition.conditions) - let svgName = null - if (con) { - svgName = con.icon - if (svgName && svgName.startsWith('#')) { - svgName = svgName.substr(1) + }) + + if (markData.length) { + let valueIndex = -1 + const markCondition = customAttr.mark + if (markCondition?.fieldId && markCondition.conditions?.length) { + for (let i = 0; i < deNameArray.length; i++) { + if (deNameArray[i].id === markCondition.fieldId) { + valueIndex = i + break } } - return svgPathData(svgName) - }, - itemStyle: { - color: params => { - const { value } = params - const val = value[valueIndex] - const con = getSvgCondition(val, null, markCondition.conditions) - return con?.color || '#b02a02' - } - }, - encode: { - tooltip: 2 - }, - data: markData + } + const markSeries = { + type: 'scatter', + coordinateSystem: 'geo', + geoIndex: 0, + symbolSize: function(params) { + return 20 + }, + symbol: (values, param) => { + if (valueIndex < 0) { + return svgPathData() + } + const val = values[valueIndex] + const field = deNameArray[valueIndex] + const con = getSvgCondition(val, field, markCondition.conditions) + let svgName = null + if (con) { + svgName = con.icon + if (svgName && svgName.startsWith('#')) { + svgName = svgName.substr(1) + } + } + return svgPathData(svgName) + }, + itemStyle: { + color: params => { + const { value } = params + const val = value[valueIndex] + const con = getSvgCondition(val, null, markCondition.conditions) + return con?.color || '#b02a02' + } + }, + encode: { + tooltip: 2 + }, + silent: true, + data: markData + } + chart_option.series.push(markSeries) } - chart_option.series.push(markSeries) } } } @@ -309,7 +316,7 @@ const loadXML = xmlString => { } const svgPathData = iconName => { - iconName = iconName || 'weizhi' + iconName = iconName || '4-location-01-mark' const defaultNode = require(`@/deicons/svg/${iconName}.svg`).default if (!defaultNode?.content) return null const content = defaultNode.content diff --git a/frontend/src/views/chart/components/functionStyle/MapMarkSelector.vue b/frontend/src/views/chart/components/functionStyle/MapMarkSelector.vue index d3a885b885..5b06b3e706 100644 --- a/frontend/src/views/chart/components/functionStyle/MapMarkSelector.vue +++ b/frontend/src/views/chart/components/functionStyle/MapMarkSelector.vue @@ -96,7 +96,7 @@ class="col-center" :span="6" > - import { DEFAULT_MARK } from '../../chart/chart' -import DeIconPicker from '@/components/deIconPicker' +import DeIconGroupPicker from '@/components/deIconPicker/deIconGroupPicker' import deSvgIcons from '@/deicons' export default { name: 'MapMarkSelector', - components: { DeIconPicker }, + components: { DeIconGroupPicker }, props: { param: { type: Object, @@ -285,7 +285,18 @@ export default { this.changeMarkAttr('conditions') }, loadSvg() { - this.iconOptions.addIconList = [...this.iconOptions.addIconList, ...deSvgIcons] + const svgList = deSvgIcons + const groupMap = {} + svgList.forEach(svg => { + const arr = svg.split('-') + if (arr?.length > 3) { + const groupName = arr[0] + '-' + arr[1] + const svgName = svg + groupMap[groupName] = groupMap[groupName] || [] + groupMap[groupName].push(svgName) + } + }) + this.iconOptions.addIconGroup = groupMap }, initData() { const chart = JSON.parse(JSON.stringify(this.chart)) diff --git a/frontend/src/views/chart/view/ChartStyle.vue b/frontend/src/views/chart/view/ChartStyle.vue index e206fe567f..589a3c90e7 100644 --- a/frontend/src/views/chart/view/ChartStyle.vue +++ b/frontend/src/views/chart/view/ChartStyle.vue @@ -1,7 +1,7 @@