diff --git a/package.json b/package.json index 8f0fa176..66301a2c 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", "@amap/amap-jsapi-types": "^0.0.8", + "@iconify/json": "^2.2.158", "@types/color": "^3.0.3", "@types/crypto-js": "^4.1.1", "@types/keymaster": "^1.6.30", @@ -32,6 +33,7 @@ "gsap": "^3.11.3", "highlight.js": "^11.5.0", "html2canvas": "^1.4.1", + "iconify-icon": "^1.0.8", "keymaster": "^1.6.2", "mitt": "^3.0.0", "monaco-editor": "^0.33.0", @@ -50,8 +52,6 @@ "devDependencies": { "@commitlint/cli": "^17.0.2", "@commitlint/config-conventional": "^17.0.2", - "@iconify/types": "^2.0.0", - "@iconify/vue": "^4.1.1", "@types/node": "^16.11.26", "@types/three": "^0.144.0", "@typescript-eslint/eslint-plugin": "^5.18.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a6be4042..23548aef 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ dependencies: '@amap/amap-jsapi-types': specifier: ^0.0.8 version: 0.0.8 + '@iconify/json': + specifier: ^2.2.158 + version: 2.2.158 '@types/color': specifier: ^3.0.3 version: 3.0.3 @@ -59,6 +62,9 @@ dependencies: html2canvas: specifier: ^1.4.1 version: 1.4.1 + iconify-icon: + specifier: ^1.0.8 + version: 1.0.8 keymaster: specifier: ^1.6.2 version: 1.6.2 @@ -87,7 +93,7 @@ dependencies: specifier: ^0.13.1 version: 0.13.1(vue@3.2.37) vue-i18n: - specifier: ^9.2.2 + specifier: 9.2.2 version: 9.2.2(vue@3.2.37) vue-router: specifier: 4.0.12 @@ -109,12 +115,6 @@ devDependencies: '@commitlint/config-conventional': specifier: ^17.0.2 version: 17.0.2 - '@iconify/types': - specifier: ^2.0.0 - version: 2.0.0 - '@iconify/vue': - specifier: ^4.1.1 - version: 4.1.1(vue@3.2.37) '@types/node': specifier: ^16.11.26 version: 16.11.40 @@ -1122,18 +1122,16 @@ packages: resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} dev: true - /@iconify/types@2.0.0: - resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==} - dev: true - - /@iconify/vue@4.1.1(vue@3.2.37): - resolution: {integrity: sha512-RL85Bm/DAe8y6rT6pux7D2FJSiUEM/TPfyK7GrbAOfTSwrhvwJW+S5yijdGcmtXouA8MtuH9C7l4hiSE4mLMjg==} - peerDependencies: - vue: '>=3' + /@iconify/json@2.2.158: + resolution: {integrity: sha512-6foGYcG97nmYpJ7N0MAbtfH7SKf7RvoOCYYSBi8gs+8qopXzplIP2F4lQiLrjpbPQihAoTercmGYWi4ABxLX1A==} dependencies: '@iconify/types': 2.0.0 - vue: 3.2.37 - dev: true + pathe: 1.1.1 + dev: false + + /@iconify/types@2.0.0: + resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==} + dev: false /@intlify/core-base@9.2.2: resolution: {integrity: sha512-JjUpQtNfn+joMbrXvpR4hTF8iJQ2sEFzzK3KIESOx+f+uwIjgw20igOyaIdhfsVVBCds8ZM64MoeNSx+PHQMkA==} @@ -3669,6 +3667,12 @@ packages: hasBin: true dev: true + /iconify-icon@1.0.8: + resolution: {integrity: sha512-jvbUKHXf8EnGGArmhlP2IG8VqQLFFyTvTqb9LVL2TKTh7/eCCD1o2HHE9thpbJJb6B8hzhcFb6rOKhvo7reNKA==} + dependencies: + '@iconify/types': 2.0.0 + dev: false + /iconv-lite@0.4.24: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} @@ -4742,6 +4746,10 @@ packages: engines: {node: '>=8'} dev: true + /pathe@1.1.1: + resolution: {integrity: sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==} + dev: false + /picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} diff --git a/src/App.vue b/src/App.vue index f623f139..7f6fedb9 100644 --- a/src/App.vue +++ b/src/App.vue @@ -33,5 +33,5 @@ useSystemInit() // 全局语言 const { locale, dateLocale } = useLang() - +//测试提交 diff --git a/src/components/GoIconify/index.ts b/src/components/GoIconify/index.ts new file mode 100644 index 00000000..a333d9a2 --- /dev/null +++ b/src/components/GoIconify/index.ts @@ -0,0 +1,3 @@ +import GoIconify from './index.vue'; + +export { GoIconify }; diff --git a/src/components/GoIconify/index.vue b/src/components/GoIconify/index.vue new file mode 100644 index 00000000..750b8267 --- /dev/null +++ b/src/components/GoIconify/index.vue @@ -0,0 +1,34 @@ + + + diff --git a/src/hooks/useChartDataFetch.hook.ts b/src/hooks/useChartDataFetch.hook.ts index 5fc84554..8eb47d90 100644 --- a/src/hooks/useChartDataFetch.hook.ts +++ b/src/hooks/useChartDataFetch.hook.ts @@ -119,7 +119,10 @@ export const useChartDataFetch = ( if (isPreview()) { targetComponent.request.requestDataType === RequestDataTypeEnum.Pond - ? addGlobalDataInterface(targetComponent, useChartEditStore, updateCallback || echartsUpdateHandle) + ? addGlobalDataInterface(targetComponent, useChartEditStore, (newData: any) => { + echartsUpdateHandle(newData) + if (updateCallback) updateCallback(newData) + }) : requestIntervalFn() } else { requestIntervalFn() diff --git a/src/main.ts b/src/main.ts index 550bc63c..dcd249d4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,59 +1,67 @@ -import { createApp } from 'vue' -import App from './App.vue' -import router, { setupRouter } from '@/router' -import i18n from '@/i18n/index' -import { setupStore } from '@/store' -import { setupNaive, setupDirectives, setupCustomComponents, initFunction } from '@/plugins' -import { GoAppProvider } from '@/components/GoAppProvider/index' -import { setHtmlTheme } from '@/utils' - -// 引入全局样式 -import '@/styles/pages/index.scss' -// 引入动画 -import 'animate.css/animate.min.css' -// 引入标尺 -import 'vue3-sketch-ruler/lib/style.css' - -async function appInit() { - const goAppProvider = createApp(GoAppProvider) - - const app = createApp(App) - - // 注册全局常用的 naive-ui 组件 - setupNaive(app) - - // 注册全局自定义指令 - setupDirectives(app) - - // 注册全局自定义组件 - setupCustomComponents(app) - - // 挂载状态管理 - setupStore(app) - - // 解决路由守卫,Axios中可使用,Dialog,Message 等全局组件 - goAppProvider.mount('#appProvider', true) - - // 挂载路由 - setupRouter(app) - - // 路由准备就绪后挂载APP实例 - await router.isReady() - - // Store 准备就绪后处理主题色 - setHtmlTheme() - - // 语言注册 - app.use(i18n) - - // 挂载到页面 - app.mount('#app', true) - - // 挂载到 window - window['$vue'] = app -} - -appInit().then(() => { - initFunction() -}) - +import { createApp } from 'vue' +import App from './App.vue' +import router, { setupRouter } from '@/router' +import i18n from '@/i18n/index' +import { setupStore } from '@/store' +import { setupNaive, setupDirectives, setupCustomComponents, initFunction } from '@/plugins' +import { GoAppProvider } from '@/components/GoAppProvider/index' +import { setHtmlTheme } from '@/utils' +import { addCollection } from 'iconify-icon' +import uimIcons from '@iconify/json/json/uim.json' +import lineMdIcons from '@iconify/json/json/line-md.json' +import wiIcons from '@iconify/json/json/wi.json' + +// 引入全局样式 +import '@/styles/pages/index.scss' +// 引入动画 +import 'animate.css/animate.min.css' +// 引入标尺 +import 'vue3-sketch-ruler/lib/style.css' +// 注册图标 +addCollection(uimIcons) +addCollection(lineMdIcons) +addCollection(wiIcons) + +async function appInit() { + const goAppProvider = createApp(GoAppProvider) + + const app = createApp(App) + + // 注册全局常用的 naive-ui 组件 + setupNaive(app) + + // 注册全局自定义指令 + setupDirectives(app) + + // 注册全局自定义组件 + setupCustomComponents(app) + + // 挂载状态管理 + setupStore(app) + + // 解决路由守卫,Axios中可使用,Dialog,Message 等全局组件 + goAppProvider.mount('#appProvider', true) + + // 挂载路由 + setupRouter(app) + + // 路由准备就绪后挂载APP实例 + await router.isReady() + + // Store 准备就绪后处理主题色 + setHtmlTheme() + + // 语言注册 + app.use(i18n) + + // 挂载到页面 + app.mount('#app', true) + + // 挂载到 window + window['$vue'] = app +} + +appInit().then(() => { + initFunction() +}) + diff --git a/src/packages/components/Charts/Mores/Funnel/index.vue b/src/packages/components/Charts/Mores/Funnel/index.vue index 35ba86fd..7965a058 100644 --- a/src/packages/components/Charts/Mores/Funnel/index.vue +++ b/src/packages/components/Charts/Mores/Funnel/index.vue @@ -1,44 +1,52 @@ - - - + + + diff --git a/src/packages/components/Charts/Mores/Graph/index.vue b/src/packages/components/Charts/Mores/Graph/index.vue index 378c968e..b0e49837 100644 --- a/src/packages/components/Charts/Mores/Graph/index.vue +++ b/src/packages/components/Charts/Mores/Graph/index.vue @@ -3,7 +3,7 @@ ref="vChartRef" :init-options="initOptions" :theme="themeColor" - :option="option" + :option="(option as EChartsOption)" :manual-update="isPreview()" autoresize > @@ -12,6 +12,7 @@ + + + diff --git a/src/packages/components/Charts/Pies/PieCommon/index.vue b/src/packages/components/Charts/Pies/PieCommon/index.vue index a662df38..ecb4e673 100644 --- a/src/packages/components/Charts/Pies/PieCommon/index.vue +++ b/src/packages/components/Charts/Pies/PieCommon/index.vue @@ -134,7 +134,10 @@ watch( ) const { vChartRef } = useChartDataFetch(props.chartConfig, useChartEditStore, (newData: typeof dataJson) => { - addPieInterval(newData) + clearPieInterval() + if (props.chartConfig.option.isCarousel) { + addPieInterval(newData) + } }) onMounted(() => { diff --git a/src/packages/components/Icons/Default/Icon/index.vue b/src/packages/components/Icons/Default/Icon/index.vue index 2c139a8a..cbfc81ae 100644 --- a/src/packages/components/Icons/Default/Icon/index.vue +++ b/src/packages/components/Icons/Default/Icon/index.vue @@ -1,13 +1,13 @@ diff --git a/types/shims-vue.d.ts b/types/shims-vue.d.ts index fa19c5db..fbfc8922 100644 --- a/types/shims-vue.d.ts +++ b/types/shims-vue.d.ts @@ -5,5 +5,4 @@ declare module '*.vue' { } declare module 'lodash/*' -declare module 'dom-helpers' -declare module '@iconify/vue' \ No newline at end of file +declare module 'dom-helpers' \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index ad47cad4..182a3d6e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -26,7 +26,7 @@ export default ({ mode }) => defineConfig({ }, { find: 'vue-i18n', - replacement: 'vue-i18n/dist/vue-i18n.cjs.js', //解决i8n警告 + replacement: 'vue-i18n/dist/vue-i18n.cjs.js' //解决i8n警告 } ], dedupe: ['vue'] @@ -56,7 +56,14 @@ export default ({ mode }) => defineConfig({ } }, plugins: [ - vue(), + vue({ + template: { + compilerOptions: { + // 排除 iconify 图标影子组件编译报错 + isCustomElement: tag => tag.startsWith('iconify-icon') + } + } + }), monacoEditorPlugin({ languageWorkers: ['editorWorkerService', 'typescript', 'json', 'html'] }),