Commit b2ef0e5988e3fd9a97bde918f2746864c6e26809

Authored by fengwotao
1 parent bfde1c1d

perf(src/packages/): 优化图表地图用户体验

... ... @@ -3,6 +3,13 @@ import { onMounted, reactive } from 'vue'
3 3 import { getAreaList } from '@/api/external/common/index'
4 4 import { areaEnum } from '../config'
5 5
  6 +const props = defineProps({
  7 + drillingIn:{
  8 + type:Boolean,
  9 + default:false
  10 + }
  11 +})
  12 +
6 13 const emits = defineEmits(['submit'])
7 14
8 15 const selectOptions = reactive({
... ... @@ -12,7 +19,7 @@ const selectOptions = reactive({
12 19 })
13 20
14 21 const selectValues = reactive({
15   - provinceValue: null,
  22 + provinceValue: 'china',
16 23 cityValue: null,
17 24 countyValue: null
18 25 })
... ... @@ -60,16 +67,19 @@ const onHandleSubmit = () => {
60 67 :options="selectOptions.provinceOptions"
61 68 />
62 69 <n-select
  70 + v-if="!props.drillingIn"
63 71 @change="onHandleSelectCity"
64 72 placeholder="请选择城市"
65 73 v-model:value="selectValues.cityValue"
66 74 :options="selectOptions.cityOptions"
67 75 />
68   - <n-select
  76 + <!-- 保留待用(下钻到区以下) -->
  77 + <!-- <n-select
  78 + v-if="!drillingIn"
69 79 placeholder="请选择区域"
70 80 v-model:value="selectValues.countyValue"
71 81 :options="selectOptions.countryOptions"
72   - />
  82 + /> -->
73 83 <n-button type="primary" @click="onHandleSubmit">确定</n-button>
74 84 </div>
75 85 </template>
... ...
... ... @@ -2,18 +2,17 @@
2 2 <!-- Echarts 全局设置 -->
3 3 <global-setting :optionData="optionData"></global-setting>
4 4 <CollapseItem name="地图" :expanded="true">
5   - <SelectCity @submit="onHandleSelectValues" />
6 5 <SettingItemBox name="开启下钻">
7 6 <SettingItem name="">
8 7 <n-switch v-model:value="optionData.drillingIn" size="small"></n-switch>
9 8 </SettingItem>
10 9 </SettingItemBox>
11   - <SettingItemBox name="显示返回图标">
  10 + <SettingItemBox name="返回图标">
12 11 <SettingItem name="">
13   - <n-switch v-model:value="optionData.showIcon" size="small"></n-switch>
  12 + <n-switch v-model:value="optionData.drillingIn" size="small"></n-switch>
14 13 </SettingItem>
15 14 </SettingItemBox>
16   - <SettingItemBox name="返回图标颜色">
  15 + <SettingItemBox name="图标颜色">
17 16 <SettingItem name="">
18 17 <n-color-picker
19 18 size="small"
... ... @@ -22,7 +21,7 @@
22 21 ></n-color-picker>
23 22 </SettingItem>
24 23 </SettingItemBox>
25   - <SettingItemBox name="返回图标距离">
  24 + <SettingItemBox name="图标距离">
26 25 <SettingItem name="距右">
27 26 <n-input-number
28 27 v-model:value="optionData.iconDistanceRight"
... ... @@ -40,6 +39,7 @@
40 39 ></n-input-number>
41 40 </SettingItem>
42 41 </SettingItemBox>
  42 + <SelectCity :drillingIn="optionData.drillingIn" @submit="onHandleSelectValues" />
43 43 <SettingItemBox name="区域颜色">
44 44 <SettingItem name="0%处颜色">
45 45 <n-color-picker
... ...
... ... @@ -89,8 +89,8 @@ const toolBoxOption = ref({
89 89 watch(
90 90 () => props.chartConfig.option,
91 91 newData => {
92   - const { iconColor, showIcon, iconDistanceRight, iconDistanceTop } = newData
93   - toolBoxOption.value.feature.myFullButton.show = showIcon
  92 + const { iconColor, drillingIn, iconDistanceRight, iconDistanceTop } = newData
  93 + toolBoxOption.value.feature.myFullButton.show = drillingIn
94 94 toolBoxOption.value.feature.myFullButton.iconStyle.color = iconColor
95 95 toolBoxOption.value.right = iconDistanceRight
96 96 toolBoxOption.value.top = iconDistanceTop
... ...