Pre Merge pull request !37 from dodu/dev

This commit is contained in:
dodu 2022-09-05 09:48:51 +00:00 committed by Gitee
commit 3b8f13e3fc
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 25748 additions and 7 deletions

View File

@ -6,7 +6,9 @@
"build": "vue-tsc --noEmit && vite build", "build": "vue-tsc --noEmit && vite build",
"preview": "vite preview", "preview": "vite preview",
"new": "plop --plopfile ./plop/plopfile.js", "new": "plop --plopfile ./plop/plopfile.js",
"postinstall": "husky install" "postinstall": "husky install",
"lint": "eslint --ext .vue,.js,.jsx,.ts,.tsx ./ --max-warnings 0",
"lint:fix": "eslint --ext .vue,.js,jsx,.ts,.tsx ./ --fix"
}, },
"dependencies": { "dependencies": {
"@types/color": "^3.0.3", "@types/color": "^3.0.3",
@ -69,4 +71,4 @@
"vue-echarts": "^6.0.2", "vue-echarts": "^6.0.2",
"vue-tsc": "^0.28.10" "vue-tsc": "^0.28.10"
} }
} }

View File

@ -36,7 +36,7 @@ export const option = {
{ {
name: '地图', name: '地图',
type: 'map', type: 'map',
map: 'china', map: 'chinaWithoutHainanIsLands',
zoom: 1, //缩放 zoom: 1, //缩放
itemStyle: { itemStyle: {
// 背景色 // 背景色
@ -49,7 +49,8 @@ export const option = {
}, },
color: '#ffffff', color: '#ffffff',
borderColor: '#75ecaa', borderColor: '#75ecaa',
borderWidth: 1 borderWidth: 1,
showHainanIsLands: true // 是否显示海南群岛
}, },
label: { label: {
show: true, show: true,

View File

@ -43,6 +43,11 @@
></n-input-number> ></n-input-number>
</SettingItem> </SettingItem>
</SettingItemBox> </SettingItemBox>
<SettingItemBox name="其他">
<SettingItem>
<n-checkbox v-model:checked="seriesList[1].itemStyle.showHainanIsLands" size="small">显示海南群岛</n-checkbox>
</SettingItem>
</SettingItemBox>
</CollapseItem> </CollapseItem>
<CollapseItem name="标记" :expanded="true"> <CollapseItem name="标记" :expanded="true">
<SettingItemBox name="样式"> <SettingItemBox name="样式">

View File

@ -14,8 +14,8 @@ import { useChartDataFetch } from '@/hooks'
import { mergeTheme } from '@/packages/public/chart' import { mergeTheme } from '@/packages/public/chart'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import { isPreview } from '@/utils' import { isPreview } from '@/utils'
import dataJson from './data.json'
import mapJson from './map.json' import mapJson from './map.json'
import mapJsonWithoutHainanIsLands from './mapWithoutHainanIsLands.json'
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent, GeoComponent } from 'echarts/components' import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent, GeoComponent } from 'echarts/components'
const props = defineProps({ const props = defineProps({
@ -45,6 +45,7 @@ use([
]) ])
registerMap('china', { geoJSON: mapJson as any, specialAreas: {} }) registerMap('china', { geoJSON: mapJson as any, specialAreas: {} })
registerMap('chinaWithoutHainanIsLands', { geoJSON: mapJsonWithoutHainanIsLands as any, specialAreas: {} })
const option = reactive({ const option = reactive({
value: mergeTheme(props.chartConfig.option, props.themeSetting, includes) value: mergeTheme(props.chartConfig.option, props.themeSetting, includes)
@ -58,6 +59,27 @@ const dataSetHandle = (dataset: any) => {
}) })
} }
const mapTypeHandle = (config: boolean) => {
// props.chartConfig.option.series.forEach((item: any) => {
// if (item.type === 'effectScatter' && dataset.point) item.data = dataset.point
// else if (item.type === 'map' && dataset.point) item.data = dataset.map
// option.value = props.chartConfig.option
// })
props.chartConfig.option.series[1].map = config ? 'china' : 'chinaWithoutHainanIsLands'
option.value = props.chartConfig.option
}
watch(
() => props.chartConfig.option.series[1].itemStyle.showHainanIsLands,
newData => {
mapTypeHandle(newData)
},
{
deep: true,
immediate: true
}
)
watch( watch(
() => props.chartConfig.option.dataset, () => props.chartConfig.option.dataset,
newData => { newData => {

File diff suppressed because it is too large Load Diff

View File

@ -600,7 +600,7 @@ export const useChartEditStore = defineStore({
ids.push(item.id) ids.push(item.id)
}) })
} else { } else {
;(historyData[0] as CreateComponentGroupType).groupList.forEach(item => { (historyData[0] as CreateComponentGroupType).groupList.forEach(item => {
ids.push(item.id) ids.push(item.id)
}) })
} }

View File

@ -35,7 +35,7 @@ export const useSync = () => {
} }
if (e.isGroup) { if (e.isGroup) {
;(e as CreateComponentGroupType).groupList.forEach(groupItem => { (e as CreateComponentGroupType).groupList.forEach(groupItem => {
intComponent(groupItem) intComponent(groupItem)
}) })
} else { } else {