diff --git a/index.html b/index.html index 4b78c65..8e467d3 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ - + ")}catch(t){console&&console.log(t)}}e=function(){var t,l=document.createElement("div");l.innerHTML=c._iconfont_svg_string_4985351,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(t=document.body).firstChild?h(l,t.firstChild):t.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(e,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),e()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(o=e,a=c.document,n=!1,d(),a.onreadystatechange=function(){"complete"==a.readyState&&(a.onreadystatechange=null,s())})}function s(){n||(n=!0,o())}function d(){try{a.documentElement.doScroll("left")}catch(t){return void setTimeout(d,50)}s()}})(window); \ No newline at end of file diff --git a/public/iconfont/ali/iconfont.json b/public/iconfont/ali/iconfont.json new file mode 100644 index 0000000..1b974be --- /dev/null +++ b/public/iconfont/ali/iconfont.json @@ -0,0 +1,107 @@ +{ + "id": "4985351", + "name": "回收监管", + "font_family": "iconfont", + "css_prefix_text": "icon-", + "description": "", + "glyphs": [ + { + "icon_id": "1174312", + "name": "menu", + "font_class": "menu", + "unicode": "e667", + "unicode_decimal": 58983 + }, + { + "icon_id": "12891317", + "name": "menu_3rolepermiss", + "font_class": "menu_rolepermiss", + "unicode": "e689", + "unicode_decimal": 59017 + }, + { + "icon_id": "1261484", + "name": "cog", + "font_class": "cog", + "unicode": "e65b", + "unicode_decimal": 58971 + }, + { + "icon_id": "10793071", + "name": "user", + "font_class": "user", + "unicode": "e627", + "unicode_decimal": 58919 + }, + { + "icon_id": "32804214", + "name": "bar-chart", + "font_class": "bar-chart", + "unicode": "e670", + "unicode_decimal": 58992 + }, + { + "icon_id": "1898529", + "name": "arrow-up", + "font_class": "arrow-up", + "unicode": "e615", + "unicode_decimal": 58901 + }, + { + "icon_id": "6151171", + "name": "exclamation circle-f", + "font_class": "exclamationcircle-f", + "unicode": "e7de", + "unicode_decimal": 59358 + }, + { + "icon_id": "6151177", + "name": "check-circle-fill", + "font_class": "check-circle-fill", + "unicode": "e7e2", + "unicode_decimal": 59362 + }, + { + "icon_id": "11399087", + "name": "map-pin", + "font_class": "map-pin", + "unicode": "e600", + "unicode_decimal": 58880 + }, + { + "icon_id": "11121385", + "name": "文本框", + "font_class": "wenbenkuang", + "unicode": "e629", + "unicode_decimal": 58921 + }, + { + "icon_id": "10352352", + "name": "组件", + "font_class": "zujian", + "unicode": "e61e", + "unicode_decimal": 58910 + }, + { + "icon_id": "17716099", + "name": "删除", + "font_class": "shanchu", + "unicode": "e601", + "unicode_decimal": 58881 + }, + { + "icon_id": "837051", + "name": "map-marker", + "font_class": "mapmarker", + "unicode": "e777", + "unicode_decimal": 59255 + }, + { + "icon_id": "31499371", + "name": "循环", + "font_class": "xunhuan", + "unicode": "e60a", + "unicode_decimal": 58890 + } + ] +} diff --git a/public/iconfont/ali/iconfont.ttf b/public/iconfont/ali/iconfont.ttf new file mode 100644 index 0000000..7d36220 Binary files /dev/null and b/public/iconfont/ali/iconfont.ttf differ diff --git a/public/iconfont/ali/iconfont.woff b/public/iconfont/ali/iconfont.woff new file mode 100644 index 0000000..966d4fa Binary files /dev/null and b/public/iconfont/ali/iconfont.woff differ diff --git a/public/iconfont/ali/iconfont.woff2 b/public/iconfont/ali/iconfont.woff2 new file mode 100644 index 0000000..ee0a1cf Binary files /dev/null and b/public/iconfont/ali/iconfont.woff2 differ diff --git a/public/iconfont/iconfont.css b/public/iconfont/iconfont.css deleted file mode 100644 index 5010b27..0000000 --- a/public/iconfont/iconfont.css +++ /dev/null @@ -1,27 +0,0 @@ -@font-face { - font-family: "iconfont"; /* Project id 4902724 */ - src: url('iconfont.woff2?t=1745541124485') format('woff2'), - url('iconfont.woff?t=1745541124485') format('woff'), - url('iconfont.ttf?t=1745541124485') format('truetype'); -} - -.iconfont { - font-family: "iconfont" !important; - font-size: 16px; - font-style: normal; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -.icon-shanchu:before { - content: "\e601"; -} - -.icon-zujian:before { - content: "\e61e"; -} - -.icon-wenbenkuang:before { - content: "\e629"; -} - diff --git a/public/iconfont/iconfont.js b/public/iconfont/iconfont.js deleted file mode 100644 index e8484d2..0000000 --- a/public/iconfont/iconfont.js +++ /dev/null @@ -1 +0,0 @@ -window._iconfont_svg_string_4902724='',(n=>{var t=(e=(e=document.getElementsByTagName("script"))[e.length-1]).getAttribute("data-injectcss"),e=e.getAttribute("data-disable-injectsvg");if(!e){var i,a,o,d,l,c=function(t,e){e.parentNode.insertBefore(t,e)};if(t&&!n.__iconfont__svg__cssinject__){n.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(t){console&&console.log(t)}}i=function(){var t,e=document.createElement("div");e.innerHTML=n._iconfont_svg_string_4902724,(e=e.getElementsByTagName("svg")[0])&&(e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.width=0,e.style.height=0,e.style.overflow="hidden",e=e,(t=document.body).firstChild?c(e,t.firstChild):t.appendChild(e))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(i,0):(a=function(){document.removeEventListener("DOMContentLoaded",a,!1),i()},document.addEventListener("DOMContentLoaded",a,!1)):document.attachEvent&&(o=i,d=n.document,l=!1,h(),d.onreadystatechange=function(){"complete"==d.readyState&&(d.onreadystatechange=null,s())})}function s(){l||(l=!0,o())}function h(){try{d.documentElement.doScroll("left")}catch(t){return void setTimeout(h,50)}s()}})(window); \ No newline at end of file diff --git a/public/iconfont/iconfont.json b/public/iconfont/iconfont.json deleted file mode 100644 index 06b8f32..0000000 --- a/public/iconfont/iconfont.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "id": "4902724", - "name": "wh", - "font_family": "iconfont", - "css_prefix_text": "icon-", - "description": "", - "glyphs": [ - { - "icon_id": "17716099", - "name": "删除", - "font_class": "shanchu", - "unicode": "e601", - "unicode_decimal": 58881 - }, - { - "icon_id": "10352352", - "name": "组件", - "font_class": "zujian", - "unicode": "e61e", - "unicode_decimal": 58910 - }, - { - "icon_id": "11121385", - "name": "文本框", - "font_class": "wenbenkuang", - "unicode": "e629", - "unicode_decimal": 58921 - } - ] -} diff --git a/public/iconfont/iconfont.ttf b/public/iconfont/iconfont.ttf deleted file mode 100644 index ff1026f..0000000 Binary files a/public/iconfont/iconfont.ttf and /dev/null differ diff --git a/public/iconfont/iconfont.woff b/public/iconfont/iconfont.woff deleted file mode 100644 index 2ef8f25..0000000 Binary files a/public/iconfont/iconfont.woff and /dev/null differ diff --git a/public/iconfont/iconfont.woff2 b/public/iconfont/iconfont.woff2 deleted file mode 100644 index 1cd6000..0000000 Binary files a/public/iconfont/iconfont.woff2 and /dev/null differ diff --git a/src/components/echarts/Charts.vue b/src/components/echarts/Charts.vue new file mode 100644 index 0000000..a192c4f --- /dev/null +++ b/src/components/echarts/Charts.vue @@ -0,0 +1,43 @@ + + + + diff --git a/src/components/echarts/echarts.d.ts b/src/components/echarts/echarts.d.ts new file mode 100644 index 0000000..d4d71c7 --- /dev/null +++ b/src/components/echarts/echarts.d.ts @@ -0,0 +1,39 @@ +export {} + +declare global { + namespace Echarts { + + import type { + // 系列类型的定义后缀都为 SeriesOption + BarSeriesOption, + LineSeriesOption + } from 'echarts/charts' + import type { + // 组件类型的定义后缀都为 ComponentOption + TitleComponentOption, + TooltipComponentOption, + GridComponentOption, + DatasetComponentOption, + LegendComponentOption, + AriaComponentOption + } from 'echarts/components' + import type { + ComposeOption, + } from 'echarts/core' + + + // 通过 ComposeOption 来组合出一个只有必须组件和图表的 Option 类型 + type Option = ComposeOption< + | BarSeriesOption + | LineSeriesOption + | TitleComponentOption + | TooltipComponentOption + | GridComponentOption + | DatasetComponentOption + | LegendComponentOption + | AriaComponentOption + >; + + } +} + diff --git a/src/components/echarts/index.ts b/src/components/echarts/index.ts new file mode 100644 index 0000000..c081887 --- /dev/null +++ b/src/components/echarts/index.ts @@ -0,0 +1,32 @@ +import * as echarts from 'echarts/core' +import { BarChart, } from 'echarts/charts' +import { + AriaComponent, + GridComponent, + LegendComponent, + TooltipComponent +} from 'echarts/components' +import { SVGRenderer } from 'echarts/renderers' + +import type { App } from 'vue' + +const install = (_: App): void => { + echarts.use([ + TooltipComponent, + GridComponent, + BarChart, + SVGRenderer, + LegendComponent, + AriaComponent + ]) +} +export default {install} + +export function useEcharts(el: HTMLElement | string) { + if (typeof el === 'string') { + el = document.getElementById(el) as HTMLElement + } + return echarts.init(el) +} + + diff --git a/src/components/iconfont/Iconfont.vue b/src/components/iconfont/Iconfont.vue new file mode 100644 index 0000000..888a4bf --- /dev/null +++ b/src/components/iconfont/Iconfont.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/src/components/iconfont/iconfont.d.ts b/src/components/iconfont/iconfont.d.ts new file mode 100644 index 0000000..ab9a195 --- /dev/null +++ b/src/components/iconfont/iconfont.d.ts @@ -0,0 +1,20 @@ +export {} + +declare global { + namespace IconfontTypes { + type name = 'menu' + | 'menu_rolepermiss' + | 'cog' + | 'user' + | 'bar-chart' + | 'arrow-up' + | 'exclamationcircle-f' + | 'check-circle-fill' + | 'map-pin' + | 'wenbenkuang' + | 'zujian' + | 'shanchu' + | 'mapmarker' + | 'xunhuan' + } +} diff --git a/src/dts/components.d.ts b/src/dts/components.d.ts index be0752f..49590c5 100644 --- a/src/dts/components.d.ts +++ b/src/dts/components.d.ts @@ -7,9 +7,11 @@ export {} declare module 'vue' { export interface GlobalComponents { + Charts: typeof import('./../components/echarts/Charts.vue')['default'] Dialog: typeof import('./../components/dialog/Dialog.vue')['default'] District: typeof import('./../components/district/District.vue')['default'] Funbar: typeof import('./../components/fun-bar/Funbar.vue')['default'] + Iconfont: typeof import('./../components/iconfont/Iconfont.vue')['default'] IxAvatar: typeof import('@idux/components/avatar')['IxAvatar'] IxBreadcrumb: typeof import('@idux/components/breadcrumb')['IxBreadcrumb'] IxBreadcrumbItem: typeof import('@idux/components/breadcrumb')['IxBreadcrumbItem'] @@ -21,6 +23,7 @@ declare module 'vue' { IxCol: typeof import('@idux/components/grid')['IxCol'] IxCollapse: typeof import('@idux/components/collapse')['IxCollapse'] IxCollapsePanel: typeof import('@idux/components/collapse')['IxCollapsePanel'] + IxDatePicker: typeof import('@idux/components/date-picker')['IxDatePicker'] IxDivider: typeof import('@idux/components/divider')['IxDivider'] IxDrawer: typeof import('@idux/components/drawer')['IxDrawer'] IxDropdown: typeof import('@idux/components/dropdown')['IxDropdown'] @@ -49,6 +52,7 @@ declare module 'vue' { IxSpace: typeof import('@idux/components/space')['IxSpace'] IxTable: typeof import('@idux/components/table')['IxTable'] IxTabs: typeof import('@idux/components/tabs')['IxTabs'] + IxTag: typeof import('@idux/components/tag')['IxTag'] IxTextarea: typeof import('@idux/components/textarea')['IxTextarea'] IxTooltip: typeof import('@idux/components/tooltip')['IxTooltip'] IxTreeSelect: typeof import('@idux/components/tree-select')['IxTreeSelect'] diff --git a/src/main.ts b/src/main.ts index 8373f93..17ef6cf 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,6 +3,7 @@ import '@/assets/styles/css/normalize.css' import idux from '@/common/idux' import '@/assets/styles/css/index.css' import router from '@/common/router/index.ts' +import echarts from '@/components/echarts/index.ts' import { Settings } from 'luxon' import { createPinia } from 'pinia' @@ -16,6 +17,7 @@ createApp(App) }) .use(createPinia().use(piniaPluginPersistedstate)) .use(router) + .use(echarts) .use(idux) .mount('#app') diff --git a/src/pages/dispose-recode/DisposeRecode.vue b/src/pages/dispose-recode/DisposeRecode.vue index e130bc4..894a38d 100644 --- a/src/pages/dispose-recode/DisposeRecode.vue +++ b/src/pages/dispose-recode/DisposeRecode.vue @@ -1,13 +1,292 @@ + + - - diff --git a/src/pages/frame/ZsyFrame.vue b/src/pages/frame/ZsyFrame.vue index 6734e14..b97bda6 100644 --- a/src/pages/frame/ZsyFrame.vue +++ b/src/pages/frame/ZsyFrame.vue @@ -9,6 +9,9 @@ :type="type" class="zsy-frame" > + @@ -45,6 +48,7 @@ import { MenuCategory } from '@/common/app/contants.ts' import Nav from '@/common/router/nav.ts' +import Iconfont from '@/components/iconfont/Iconfont.vue' const appSettingStore = useAppSettingStore() const logoImage = computed(() => { @@ -70,7 +74,11 @@ const menuTree = computed(() => { pid: it.pid, key: it.routeName, label: it.title, - type: it.menuCategory === MenuCategory.Page ? 'item' : 'sub', + // icon: it.icon, + icon: h(Iconfont, {className: 'ix-icon ixicon', name: it.icon as IconfontTypes.name}), + type: it.menuCategory === MenuCategory.Page ? 'item' + : it.menuCategory === MenuCategory.Group ? 'itemGroup' + : 'sub', }))) as MenuData[] }) const wholeTheme = ref('light') @@ -83,6 +91,7 @@ const mergedTheme = computed(() => { }) function openPageHandler(options: MenuClickOptions) { + if (options.type !== 'item') return Nav.open({ insId: options.key as string, routeName: options.key as string @@ -92,11 +101,17 @@ function openPageHandler(options: MenuClickOptions) { diff --git a/src/pages/tsp/Tsp.vue b/src/pages/tsp/Tsp.vue index 48b483e..0742a6c 100644 --- a/src/pages/tsp/Tsp.vue +++ b/src/pages/tsp/Tsp.vue @@ -1,59 +1,151 @@ diff --git a/vite.config.ts b/vite.config.ts index 2febfb3..bb4c870 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -15,6 +15,8 @@ import VueDevTools from 'vite-plugin-vue-devtools' import processHtml from './plugin/html-process' import zipDist from './plugin/zip-dist' import { viteStaticCopy } from 'vite-plugin-static-copy' +import { fileWatcher } from './plugin/file-watcher' +import iconfontDts from './plugin/iconfont-dts' let viteConfig: UserConfigFnObject = configEnv => { const env = loadEnv(configEnv.mode, process.cwd(), '') @@ -47,6 +49,10 @@ let viteConfig: UserConfigFnObject = configEnv => { processHtml(env.VITE_APP_NAME), zipDist(), Icons(), + fileWatcher({ + file: './public/iconfont/ali/iconfont.json', + fn: iconfontDts('./src/components/iconfont/iconfont.d.ts'), + }), viteStaticCopy({ targets: [ {