diff --git a/package.json b/package.json index d9f61f7b..a08b8897 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,8 @@ "lint:fix": "eslint --ext .js,.jsx,.ts,.tsx,.vue src --fix" }, "dependencies": { + "@amap/amap-jsapi-loader": "^1.0.1", + "@amap/amap-jsapi-types": "^0.0.8", "@types/color": "^3.0.3", "@types/crypto-js": "^4.1.1", "@types/keymaster": "^1.6.30", diff --git a/src/api/mock/index.ts b/src/api/mock/index.ts index bf9b2f52..eea66104 100644 --- a/src/api/mock/index.ts +++ b/src/api/mock/index.ts @@ -15,6 +15,7 @@ export const radarUrl = '/mock/radarData' export const heatMapUrl = '/mock/heatMapData' export const scatterBasicUrl = '/mock/scatterBasic' export const mapUrl = '/mock/map' +export const capsuleUrl = '/mock/capsule' export const wordCloudUrl = '/mock/wordCloud' export const treemapUrl = '/mock/treemap' export const threeEarth01Url = '/mock/threeEarth01Data' @@ -82,6 +83,11 @@ const mockObject: MockMethod[] = [ method: RequestHttpEnum.GET, response: () => test.fetchMap }, + { + url: capsuleUrl, + method: RequestHttpEnum.GET, + response: () => test.fetchCapsule + }, { url: wordCloudUrl, method: RequestHttpEnum.GET, diff --git a/src/api/mock/map.json b/src/api/mock/map.json index ec95253b..246e68ae 100644 --- a/src/api/mock/map.json +++ b/src/api/mock/map.json @@ -1,79 +1,9 @@ { - "point": [ + "markers|50": [ { - "name": "北京", - "value": [116.405285, 39.904989, 200] - }, - { - "name": "郑州", - "value": [113.665412, 34.757975, 888] - }, - { - "name": "青海", - "value": [101.778916, 36.623178, 666] - }, - { - "name": "宁夏回族自治区", - "value": [106.278179, 38.46637, 66] - }, - { - "name": "哈尔滨市", - "value": [126.642464, 45.756967, 101] + "name": "某某地市", + "value": "@integer(2, 20)", + "position": ["@float(115, 117, 1, 6)", "@float(38, 40, 1, 6)"] } - ], - "map": [ - { - "name": "北京市", - "value": "@integer(0, 1000)" - }, - { - "name": "河北省", - "value": "@integer(0, 1000)" - }, - - { - "name": "江苏省", - "value": "@integer(0, 1000)" - }, - { - "name": "福建省", - "value": "@integer(0, 1000)" - }, - { - "name": "山东省", - "value": "@integer(0, 1000)" - }, - { - "name": "河南省", - "value": "@integer(0, 1000)" - }, - { - "name": "湖北省", - "value": "@integer(0, 1000)" - }, - { - "name": "广西壮族自治区", - "value": "@integer(0, 1000)" - }, - { - "name": "海南省", - "value": "@integer(0, 1000)" - }, - { - "name": "青海省", - "value": "@integer(0, 1000)" - }, - { - "name": "新疆维吾尔自治区", - "value": "@integer(0, 1000)" - } - ], - "pieces": [ - { "gte": 1000, "label": ">1000" }, - { "gte": 600, "lte": 999, "label": "600-999" }, - { "gte": 200, "lte": 599, "label": "200-599" }, - { "gte": 50, "lte": 199, "label": "49-199" }, - { "gte": 10, "lte": 49, "label": "10-49" }, - { "lte": 9, "label": "<9" } ] } diff --git a/src/api/mock/test.mock.ts b/src/api/mock/test.mock.ts index 65afb3d4..a58cac53 100644 --- a/src/api/mock/test.mock.ts +++ b/src/api/mock/test.mock.ts @@ -11,27 +11,7 @@ export default { msg: '请求成功', data: { dimensions: ['product', 'dataOne'], - source: [ - { - product: '@name', - 'dataOne|0-900': 3 - }, - { - product: '@name', - 'dataOne|0-900': 3 - }, - { - product: '@name', - 'dataOne|0-900': 3 - }, - { - product: '@name', - 'dataOne|0-900': 3 - }, - { - product: '@name', - 'dataOne|0-900': 3 - }, + 'source|50': [ { product: '@name', 'dataOne|0-900': 3 @@ -39,6 +19,22 @@ export default { ] } }, + // 胶囊图 + fetchCapsule: { + code: 0, + status: 200, + msg: '请求成功', + data: { + dimensions: ['name', 'value'], + source: [ + { name: '厦门', 'value|0-40': 20 }, + { name: '南阳', 'value|20-60': 40 }, + { name: '北京', 'value|40-80': 60 }, + { name: '上海', 'value|60-100': 80 }, + { name: '新疆', value: 100 } + ] + } + }, // 图表 fetchMockData: { code: 0, @@ -46,32 +42,7 @@ export default { msg: '请求成功', data: { dimensions: ['product', 'dataOne', 'dataTwo'], - source: [ - { - product: '@name', - 'dataOne|100-900': 3, - 'dataTwo|100-900': 3 - }, - { - product: '@name', - 'dataOne|100-900': 3, - 'dataTwo|100-900': 3 - }, - { - product: '@name', - 'dataOne|100-900': 3, - 'dataTwo|100-900': 3 - }, - { - product: '@name', - 'dataOne|100-900': 3, - 'dataTwo|100-900': 3 - }, - { - product: '@name', - 'dataOne|100-900': 3, - 'dataTwo|100-900': 3 - }, + 'source|50': [ { product: '@name', 'dataOne|100-900': 3, @@ -85,21 +56,7 @@ export default { code: 0, status: 200, msg: '请求成功', - data: [ - { name: '@name', 'value|100-900': 5 }, - { name: '@name', 'value|100-900': 5 }, - { name: '@name', 'value|100-900': 5 }, - { name: '@name', 'value|100-900': 5 }, - { name: '@name', 'value|100-900': 5 }, - { name: '@name', 'value|100-900': 5 }, - { name: '@name', 'value|100-900': 5 }, - { name: '@name', 'value|100-900': 5 }, - { name: '@name', 'value|100-900': 5 }, - { name: '@name', 'value|100-900': 5 }, - { name: '@name', 'value|100-900': 5 }, - { name: '@name', 'value|100-900': 5 }, - { name: '@name', 'value|100-900': 5 } - ] + 'data|50': [{ name: '@name', 'value|100-900': 5 }] }, // 轮播表格 fetchScrollBoard: { @@ -262,12 +219,7 @@ export default { data: [ { startArray: { name: '@name', N: '@integer(10, 100)', E: '@integer(10, 100)' }, - endArray: [ - { name: '@name', N: '@integer(10, 100)', E: '@integer(10, 100)' }, - { name: '@name', N: '@integer(10, 100)', E: '@integer(10, 100)' }, - { name: '@name', N: '@integer(10, 100)', E: '@integer(10, 100)' }, - { name: '@name', N: '@integer(10, 100)', E: '@integer(10, 100)' } - ] + 'endArray|10': [{ name: '@name', N: '@integer(10, 100)', E: '@integer(10, 100)' }] } ] } diff --git a/src/assets/images/chart/charts/capsule.png b/src/assets/images/chart/charts/capsule.png new file mode 100644 index 00000000..6dae56b4 Binary files /dev/null and b/src/assets/images/chart/charts/capsule.png differ diff --git a/src/assets/images/chart/charts/map_amap.png b/src/assets/images/chart/charts/map_amap.png new file mode 100644 index 00000000..d9e43813 Binary files /dev/null and b/src/assets/images/chart/charts/map_amap.png differ diff --git a/src/assets/images/chart/informations/iframe.png b/src/assets/images/chart/informations/iframe.png new file mode 100644 index 00000000..72042744 Binary files /dev/null and b/src/assets/images/chart/informations/iframe.png differ diff --git a/src/assets/images/chart/informations/text_barrage.png b/src/assets/images/chart/informations/text_barrage.png new file mode 100644 index 00000000..3b7db8ef Binary files /dev/null and b/src/assets/images/chart/informations/text_barrage.png differ diff --git a/src/components/GoSystemInfo/index.vue b/src/components/GoSystemInfo/index.vue index c0a4f7e8..5073c8b9 100644 --- a/src/components/GoSystemInfo/index.vue +++ b/src/components/GoSystemInfo/index.vue @@ -11,7 +11,7 @@ - + 版权声明: GoView 版权属于 @@ -21,8 +21,7 @@ - - + 协议备注: 请遵守开源 MIT 协议,以上声明 不可删除,否则视作侵权行为,后果自负! @@ -31,8 +30,7 @@ - - + 商业授权: 若不想保留版权声明,请通过仓库/交流群 联系项目作者,进行授权 diff --git a/src/components/Flipper/index.ts b/src/components/Pages/Flipper/index.ts similarity index 98% rename from src/components/Flipper/index.ts rename to src/components/Pages/Flipper/index.ts index fc3da216..dbe9b5cb 100644 --- a/src/components/Flipper/index.ts +++ b/src/components/Pages/Flipper/index.ts @@ -1,4 +1,5 @@ import Flipper from './index.vue' + type FlipType = 'up' | 'down' export { Flipper, FlipType } diff --git a/src/components/Flipper/index.vue b/src/components/Pages/Flipper/index.vue similarity index 96% rename from src/components/Flipper/index.vue rename to src/components/Pages/Flipper/index.vue index 7757d536..9b2c6282 100644 --- a/src/components/Flipper/index.vue +++ b/src/components/Pages/Flipper/index.vue @@ -1,19 +1,13 @@ - - diff --git a/src/packages/components/Charts/Bars/CapsuleChart/data.json b/src/packages/components/Charts/Bars/CapsuleChart/data.json new file mode 100644 index 00000000..a7a26af8 --- /dev/null +++ b/src/packages/components/Charts/Bars/CapsuleChart/data.json @@ -0,0 +1,10 @@ +{ + "dimensions": ["name", "value"], + "source": [ + { "name": "厦门", "value": 20 }, + { "name": "南阳", "value": 40 }, + { "name": "北京", "value": 60 }, + { "name": "上海", "value": 80 }, + { "name": "新疆", "value": 100 } + ] +} diff --git a/src/packages/components/Charts/Bars/CapsuleChart/index.ts b/src/packages/components/Charts/Bars/CapsuleChart/index.ts new file mode 100644 index 00000000..a0fc6291 --- /dev/null +++ b/src/packages/components/Charts/Bars/CapsuleChart/index.ts @@ -0,0 +1,15 @@ +import image from '@/assets/images/chart/charts/capsule.png' +import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' +import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' + +export const CapsuleChartConfig: ConfigType = { + key: 'CapsuleChart', + chartKey: 'VCapsuleChart', + conKey: 'VCCapsuleChart', + title: '胶囊柱图', + category: ChatCategoryEnum.BAR, + categoryName: ChatCategoryEnumName.BAR, + package: PackagesCategoryEnum.CHARTS, + chartFrame: ChartFrameEnum.COMMON, + image +} diff --git a/src/packages/components/Charts/Bars/CapsuleChart/index.vue b/src/packages/components/Charts/Bars/CapsuleChart/index.vue new file mode 100644 index 00000000..4a0ed72f --- /dev/null +++ b/src/packages/components/Charts/Bars/CapsuleChart/index.vue @@ -0,0 +1,228 @@ + + + + + diff --git a/src/packages/components/Charts/Bars/index.ts b/src/packages/components/Charts/Bars/index.ts index 9613b804..a101acbd 100644 --- a/src/packages/components/Charts/Bars/index.ts +++ b/src/packages/components/Charts/Bars/index.ts @@ -1,4 +1,5 @@ import { BarCommonConfig } from './BarCommon/index' import { BarCrossrangeConfig } from './BarCrossrange/index' +import { CapsuleChartConfig } from './CapsuleChart/index' -export default [BarCommonConfig, BarCrossrangeConfig] +export default [BarCommonConfig, BarCrossrangeConfig, CapsuleChartConfig] diff --git a/src/packages/components/Charts/Lines/LineCommon/config.vue b/src/packages/components/Charts/Lines/LineCommon/config.vue index be79a016..0b15d2a4 100644 --- a/src/packages/components/Charts/Lines/LineCommon/config.vue +++ b/src/packages/components/Charts/Lines/LineCommon/config.vue @@ -3,9 +3,6 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ song.label }} + + + + + + + + + + + + + + + + + + + + diff --git a/src/packages/components/Charts/Maps/MapAmap/data.json b/src/packages/components/Charts/Maps/MapAmap/data.json new file mode 100644 index 00000000..97a5d9ea --- /dev/null +++ b/src/packages/components/Charts/Maps/MapAmap/data.json @@ -0,0 +1,19 @@ +{ + "markers": [ + { + "name": "某某地市", + "value": 10, + "position": [116.300467, 39.907761] + }, + { + "name": "某某地市", + "value": 15, + "position": [116.400567, 39.908761] + }, + { + "name": "某某地市", + "value": 20, + "position": [116.200467, 39.937761] + } + ] +} diff --git a/src/packages/components/Charts/Maps/MapAmap/index.ts b/src/packages/components/Charts/Maps/MapAmap/index.ts new file mode 100644 index 00000000..02b3998b --- /dev/null +++ b/src/packages/components/Charts/Maps/MapAmap/index.ts @@ -0,0 +1,15 @@ +import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' +import image from '@/assets/images/chart/charts/map_amap.png' +import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' + +export const MapAmapConfig: ConfigType = { + key: 'MapAmap', + chartKey: 'VMapAmap', + conKey: 'VCMapAmap', + title: '高德地图', + category: ChatCategoryEnum.MAP, + categoryName: ChatCategoryEnumName.MAP, + package: PackagesCategoryEnum.CHARTS, + chartFrame: ChartFrameEnum.COMMON, + image +} diff --git a/src/packages/components/Charts/Maps/MapAmap/index.vue b/src/packages/components/Charts/Maps/MapAmap/index.vue new file mode 100644 index 00000000..741013cb --- /dev/null +++ b/src/packages/components/Charts/Maps/MapAmap/index.vue @@ -0,0 +1,130 @@ + + + diff --git a/src/packages/components/Charts/Maps/index.ts b/src/packages/components/Charts/Maps/index.ts index a5f5362b..6fa94dcc 100644 --- a/src/packages/components/Charts/Maps/index.ts +++ b/src/packages/components/Charts/Maps/index.ts @@ -1,3 +1,4 @@ import { MapBaseConfig } from './MapBase/index' +import { MapAmapConfig } from './MapAmap/index' -export default [ MapBaseConfig ] +export default [MapBaseConfig, MapAmapConfig] diff --git a/src/packages/components/Decorates/Mores/CountDown/config.ts b/src/packages/components/Decorates/Mores/CountDown/config.ts index d9537fe9..dce9473d 100644 --- a/src/packages/components/Decorates/Mores/CountDown/config.ts +++ b/src/packages/components/Decorates/Mores/CountDown/config.ts @@ -3,7 +3,7 @@ import { CreateComponentType } from '@/packages/index.d' import { CountDownConfig } from './index' import cloneDeep from 'lodash/cloneDeep' import { chartInitConfig } from '@/settings/designSetting' -import { FlipType } from '@/components/Flipper' +import { FlipType } from '@/components/Pages/Flipper' type STYLE = '时分秒' | '冒号' diff --git a/src/packages/components/Decorates/Mores/CountDown/index.vue b/src/packages/components/Decorates/Mores/CountDown/index.vue index 97f8e15a..d0400af0 100644 --- a/src/packages/components/Decorates/Mores/CountDown/index.vue +++ b/src/packages/components/Decorates/Mores/CountDown/index.vue @@ -76,7 +76,7 @@ diff --git a/src/packages/components/Informations/Mores/Iframe/index.ts b/src/packages/components/Informations/Mores/Iframe/index.ts new file mode 100644 index 00000000..d87036cb --- /dev/null +++ b/src/packages/components/Informations/Mores/Iframe/index.ts @@ -0,0 +1,15 @@ +import image from '@/assets/images/chart/informations/iframe.png' +import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' +import { ChatCategoryEnum,ChatCategoryEnumName } from '../../index.d' + +export const IframeConfig: ConfigType = { + key: 'Iframe', + chartKey: 'VIframe', + conKey: 'VCIframe', + title: '远程网页', + category: ChatCategoryEnum.MORE, + categoryName: ChatCategoryEnumName.MORE, + package: PackagesCategoryEnum.INFORMATIONS, + chartFrame: ChartFrameEnum.COMMON, + image +} diff --git a/src/packages/components/Informations/Mores/Iframe/index.vue b/src/packages/components/Informations/Mores/Iframe/index.vue new file mode 100644 index 00000000..212f3701 --- /dev/null +++ b/src/packages/components/Informations/Mores/Iframe/index.vue @@ -0,0 +1,49 @@ + + + diff --git a/src/packages/components/Informations/Mores/Image/index.vue b/src/packages/components/Informations/Mores/Image/index.vue index fbea4ae8..fc3b98f4 100644 --- a/src/packages/components/Informations/Mores/Image/index.vue +++ b/src/packages/components/Informations/Mores/Image/index.vue @@ -46,8 +46,7 @@ watch( option.dataset = newData }, { - immediate: true, - deep: false + immediate: true } ) diff --git a/src/packages/components/Informations/Mores/Video/index.ts b/src/packages/components/Informations/Mores/Video/index.ts index ff47d5e8..c10ced02 100644 --- a/src/packages/components/Informations/Mores/Video/index.ts +++ b/src/packages/components/Informations/Mores/Video/index.ts @@ -10,6 +10,6 @@ export const VideoConfig: ConfigType = { category: ChatCategoryEnum.MORE, categoryName: ChatCategoryEnumName.MORE, package: PackagesCategoryEnum.INFORMATIONS, - chartFrame: ChartFrameEnum.ECHARTS, + chartFrame: ChartFrameEnum.COMMON, image } diff --git a/src/packages/components/Informations/Mores/index.ts b/src/packages/components/Informations/Mores/index.ts index deddc1ac..8fadc441 100644 --- a/src/packages/components/Informations/Mores/index.ts +++ b/src/packages/components/Informations/Mores/index.ts @@ -1,5 +1,6 @@ import { ImageConfig } from './Image/index' +import { IframeConfig } from './Iframe/index' import { VideoConfig } from './Video/index' import { WordCloudConfig } from './WordCloud/index' -export default [ImageConfig, VideoConfig, WordCloudConfig] +export default [WordCloudConfig, ImageConfig, VideoConfig, IframeConfig] diff --git a/src/packages/components/Informations/Texts/TextBarrage/config.ts b/src/packages/components/Informations/Texts/TextBarrage/config.ts new file mode 100644 index 00000000..eb04f096 --- /dev/null +++ b/src/packages/components/Informations/Texts/TextBarrage/config.ts @@ -0,0 +1,42 @@ +import { PublicConfigClass } from '@/packages/public' +import { CreateComponentType } from '@/packages/index.d' +import { TextBarrageConfig } from './index' +import { chartInitConfig } from '@/settings/designSetting' +import cloneDeep from 'lodash/cloneDeep' + +export enum FontWeightEnum { + NORMAL = '常规', + BOLD = '加粗', +} + +export const FontWeightObject = { + [FontWeightEnum.NORMAL]: 'normal', + [FontWeightEnum.BOLD]: 'bold', +} + +export const option = { + + dataset: '让数字化看得见', + fontSize: 32, + fontColor: '#ffffff', + fontWeight: 'normal', + // 字间距 + letterSpacing: 5, + //阴影 + showShadow: true, + boxShadow: 'none', + hShadow: 0, + vShadow: 0, + blurShadow: 8, + colorShadow: '#0075ff', + //动画 + animationTime: 0, + animationSpeed: 50, +} + +export default class Config extends PublicConfigClass implements CreateComponentType { + public key = TextBarrageConfig.key + public attr = { ...chartInitConfig, w: 500, h: 70, zIndex: -1 } + public chartConfig = cloneDeep(TextBarrageConfig) + public option = cloneDeep(option) +} diff --git a/src/packages/components/Informations/Texts/TextBarrage/config.vue b/src/packages/components/Informations/Texts/TextBarrage/config.vue new file mode 100644 index 00000000..e2a5ad59 --- /dev/null +++ b/src/packages/components/Informations/Texts/TextBarrage/config.vue @@ -0,0 +1,89 @@ + + + diff --git a/src/packages/components/Informations/Texts/TextBarrage/index.ts b/src/packages/components/Informations/Texts/TextBarrage/index.ts new file mode 100644 index 00000000..a93cf259 --- /dev/null +++ b/src/packages/components/Informations/Texts/TextBarrage/index.ts @@ -0,0 +1,14 @@ +import image from '@/assets/images/chart/informations/text_barrage.png' +import { ConfigType, PackagesCategoryEnum } from '@/packages/index.d' +import { ChatCategoryEnum,ChatCategoryEnumName } from '../../index.d' + +export const TextBarrageConfig: ConfigType = { + key: 'TextBarrage', + chartKey: 'VTextBarrage', + conKey: 'VCTextBarrage', + title: '弹幕文字', + category: ChatCategoryEnum.TEXT, + categoryName: ChatCategoryEnumName.TEXT, + package: PackagesCategoryEnum.INFORMATIONS, + image +} diff --git a/src/packages/components/Informations/Texts/TextBarrage/index.vue b/src/packages/components/Informations/Texts/TextBarrage/index.vue new file mode 100644 index 00000000..54e9df2b --- /dev/null +++ b/src/packages/components/Informations/Texts/TextBarrage/index.vue @@ -0,0 +1,102 @@ + + + + + diff --git a/src/packages/components/Informations/Texts/index.ts b/src/packages/components/Informations/Texts/index.ts index 093a2d52..960dcaef 100644 --- a/src/packages/components/Informations/Texts/index.ts +++ b/src/packages/components/Informations/Texts/index.ts @@ -1,4 +1,5 @@ import { TextCommonConfig } from './TextCommon/index' +import { TextBarrageConfig } from './TextBarrage/index' import { TextGradientConfig } from './TextGradient/index' -export default [TextCommonConfig, TextGradientConfig] +export default [TextCommonConfig, TextGradientConfig, TextBarrageConfig] diff --git a/src/packages/index.d.ts b/src/packages/index.d.ts index 5e800fe9..94e90c91 100644 --- a/src/packages/index.d.ts +++ b/src/packages/index.d.ts @@ -90,6 +90,14 @@ export const BlendModeEnumList = [ { label: '亮度', value: 'luminosity' } ] +// vue3 生命周期事件 +export enum EventLife { + // 渲染之后 + MOUNTED = 'vnodeMounted', + // 渲染之前 + BEFORE_MOUNT = 'vnodeBeforeMount', +} + // 组件实例类 export interface PublicConfigType { id: string @@ -115,12 +123,15 @@ export interface PublicConfigType { } filter?: string status: StatusType + events?: { + [K in EventLife]?: string + } } export interface CreateComponentType extends PublicConfigType, requestConfig { key: string chartConfig: ConfigType - option: GlobalThemeJsonType + option: GlobalThemeJsonType, } // 组件成组实例类 diff --git a/src/packages/public/publicConfig.ts b/src/packages/public/publicConfig.ts index 3924834a..ca20e464 100644 --- a/src/packages/public/publicConfig.ts +++ b/src/packages/public/publicConfig.ts @@ -81,6 +81,8 @@ export class PublicConfigClass implements PublicConfigType { public request = cloneDeep(requestConfig) // 数据过滤 public filter = undefined + // 事件 + public events = undefined } // 多选成组类 diff --git a/src/plugins/icon.ts b/src/plugins/icon.ts index 48d6a0a0..390200de 100644 --- a/src/plugins/icon.ts +++ b/src/plugins/icon.ts @@ -27,6 +27,7 @@ import { LockClosedOutline as LockClosedOutlineIcon, HelpCircleOutline as HelpOutlineIcon, CodeSlash as CodeSlashIcon, + Create as CreateIcon, Rocket as RocketIcon, Duplicate as DuplicateIcon, DuplicateOutline as DuplicateOutlineIcon, @@ -106,6 +107,8 @@ const ionicons5 = { DuplicateOutlineIcon, // 代码 CodeSlashIcon, + // 修改代码 + CreateIcon, // 事件(火箭) RocketIcon, // 退出 diff --git a/src/router/index.ts b/src/router/index.ts index 88e42395..5fd12a68 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -21,7 +21,8 @@ const RootRoute: Array = [ ...HttpErrorPage, modules.projectRoutes, modules.chartRoutes, - modules.previewRoutes + modules.previewRoutes, + modules.editRoutes ] } ] diff --git a/src/router/modules/chart.route.ts b/src/router/modules/chart.route.ts index 7c173b8e..c910767b 100644 --- a/src/router/modules/chart.route.ts +++ b/src/router/modules/chart.route.ts @@ -12,7 +12,8 @@ const chartRoutes: RouteRecordRaw = { component: importPath['ChartEnum.CHART_HOME_NAME'], meta: { title: '工作空间', - isRoot: true + isRoot: true, + noKeepAlive: true, } } diff --git a/src/router/modules/edit.route.ts b/src/router/modules/edit.route.ts new file mode 100644 index 00000000..50b8168b --- /dev/null +++ b/src/router/modules/edit.route.ts @@ -0,0 +1,20 @@ +import { RouteRecordRaw } from 'vue-router' +import { EditEnum } from '@/enums/pageEnum' + +// 引入路径 +const importPath = { + [EditEnum.CHART_EDIT_NAME]: () => import('@/views/edit/index.vue') +} + +const chartRoutes: RouteRecordRaw = { + path: EditEnum.CHART_EDIT, + name: EditEnum.CHART_EDIT_NAME, + component: importPath[EditEnum.CHART_EDIT_NAME], + meta: { + title: '编辑', + isRoot: true + } +} + + +export default chartRoutes \ No newline at end of file diff --git a/src/router/modules/index.ts b/src/router/modules/index.ts index 3be2427b..c134d953 100644 --- a/src/router/modules/index.ts +++ b/src/router/modules/index.ts @@ -1,9 +1,11 @@ import projectRoutes from './project.router' import chartRoutes from './chart.route' import previewRoutes from './preview.route' +import editRoutes from './edit.route' export default { projectRoutes, chartRoutes, - previewRoutes + previewRoutes, + editRoutes } \ No newline at end of file diff --git a/src/router/modules/preview.route.ts b/src/router/modules/preview.route.ts index d6741008..ae3d9191 100644 --- a/src/router/modules/preview.route.ts +++ b/src/router/modules/preview.route.ts @@ -3,7 +3,7 @@ import { PreviewEnum } from '@/enums/pageEnum' // 引入路径 const importPath = { - 'PreviewEnum.CHART_PREVIEW_NAME': () => import('@/views/preview/index.vue') + 'PreviewEnum.CHART_PREVIEW_NAME': () => import('@/views/preview/wrapper.vue') } const chartRoutes: RouteRecordRaw = { diff --git a/src/settings/animations/index.ts b/src/settings/animations/index.ts index 5d588fc6..65106a74 100644 --- a/src/settings/animations/index.ts +++ b/src/settings/animations/index.ts @@ -11,7 +11,6 @@ export const animations = [ { label: '放大晃动缩小', value: 'tada' }, { label: '扇形摇摆', value: 'wobble' }, { label: '左右上下晃动', value: 'jello' }, - { label: 'Y轴旋转', value: 'flip' } ] }, { diff --git a/src/settings/designSetting.ts b/src/settings/designSetting.ts index 42fa7ad5..26590341 100644 --- a/src/settings/designSetting.ts +++ b/src/settings/designSetting.ts @@ -55,6 +55,9 @@ export const backgroundImageSize = 5 // 预览展示方式 export const previewScaleType = PreviewScaleEnum.FIT +// 编辑工作台同步到 JSON 的轮询间隔(5S) +export const editToJsonInterval = 5000 + // 数据请求间隔 export const requestInterval = 30 diff --git a/src/styles/pages/index.scss b/src/styles/pages/index.scss index 3e1b45e5..b8f7272d 100644 --- a/src/styles/pages/index.scss +++ b/src/styles/pages/index.scss @@ -1 +1,9 @@ -// 页面全局样式 \ No newline at end of file +// 页面全局样式 +// 去除高德地图 logo +.amap-logo { + display: none !important; + opacity: 0 !important; +} +.amap-copyright { + opacity: 0 !important; +} diff --git a/src/views/chart/ContentCharts/components/ChartsItemBox/index.vue b/src/views/chart/ContentCharts/components/ChartsItemBox/index.vue index 2a27725c..efaee756 100644 --- a/src/views/chart/ContentCharts/components/ChartsItemBox/index.vue +++ b/src/views/chart/ContentCharts/components/ChartsItemBox/index.vue @@ -116,7 +116,8 @@ $centerHeight: 100px; height: $centerHeight; overflow: hidden; .list-img { - height: 100%; + height: 100px; + width: 140px; border-radius: 6px; @extend .go-transition; } diff --git a/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataRequest/components/RequestHeader/index.vue b/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataRequest/components/RequestHeader/index.vue index 904ceacc..8212c1d6 100644 --- a/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataRequest/components/RequestHeader/index.vue +++ b/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataRequest/components/RequestHeader/index.vue @@ -73,6 +73,7 @@ SQL 类型不支持 Get 请求,请使用其它方式 @@ -27,7 +28,7 @@ import { PropType } from 'vue' import { CreateComponentGroupType } from '@/packages/index.d' import { animationsClass, getFilterStyle, getTransformStyle, getBlendModeStyle } from '@/utils' import { getSizeStyle, getComponentAttrStyle, getStatusStyle } from '../../utils' - +import { useLifeHandler } from '@/hooks' const props = defineProps({ groupData: { type: Object as PropType, diff --git a/src/views/preview/components/PreviewRenderList/index.vue b/src/views/preview/components/PreviewRenderList/index.vue index 4335ab96..af55e9c1 100644 --- a/src/views/preview/components/PreviewRenderList/index.vue +++ b/src/views/preview/components/PreviewRenderList/index.vue @@ -29,6 +29,7 @@ :themeSetting="themeSetting" :themeColor="themeColor" :style="{ ...getSizeStyle(item.attr) }" + v-on="useLifeHandler(item)" > @@ -41,7 +42,7 @@ import { CreateComponentGroupType } from '@/packages/index.d' import { chartColors } from '@/settings/chartThemes/index' import { animationsClass, getFilterStyle, getTransformStyle, getBlendModeStyle } from '@/utils' import { getSizeStyle, getComponentAttrStyle, getStatusStyle } from '../../utils' - +import { useLifeHandler } from '@/hooks' const props = defineProps({ localStorageInfo: { type: Object as PropType, diff --git a/src/views/preview/wrapper.vue b/src/views/preview/wrapper.vue new file mode 100644 index 00000000..242910be --- /dev/null +++ b/src/views/preview/wrapper.vue @@ -0,0 +1,25 @@ + + + diff --git a/vite.config.ts b/vite.config.ts index 0332dbde..79f05a76 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -22,6 +22,10 @@ export default defineConfig({ { find: '@', replacement: pathResolve('src') + }, + { + find: 'vue-i18n', + replacement: 'vue-i18n/dist/vue-i18n.cjs.js', //解决i8n警告 } ], dedupe: ['vue'] @@ -63,7 +67,8 @@ export default defineConfig({ build: { target: 'es2015', outDir: OUTPUT_DIR, - terserOptions: terserOptions, + // minify: 'terser', // 如果需要用terser混淆,可打开这两行 + // terserOptions: terserOptions, rollupOptions: rollupOptions, brotliSize: brotliSize, chunkSizeWarningLimit: chunkSizeWarningLimit