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",
"preview": "vite preview",
"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": {
"@types/color": "^3.0.3",

View File

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

View File

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

View File

@ -14,8 +14,8 @@ import { useChartDataFetch } from '@/hooks'
import { mergeTheme } from '@/packages/public/chart'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import { isPreview } from '@/utils'
import dataJson from './data.json'
import mapJson from './map.json'
import mapJsonWithoutHainanIsLands from './mapWithoutHainanIsLands.json'
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent, GeoComponent } from 'echarts/components'
const props = defineProps({
@ -45,6 +45,7 @@ use([
])
registerMap('china', { geoJSON: mapJson as any, specialAreas: {} })
registerMap('chinaWithoutHainanIsLands', { geoJSON: mapJsonWithoutHainanIsLands as any, specialAreas: {} })
const option = reactive({
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(
() => props.chartConfig.option.dataset,
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)
})
} else {
;(historyData[0] as CreateComponentGroupType).groupList.forEach(item => {
(historyData[0] as CreateComponentGroupType).groupList.forEach(item => {
ids.push(item.id)
})
}

View File

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