-
+
@@ -32,6 +34,7 @@
import { computed } from 'vue'
import layoutHeader from './components/header/index.vue'
import layoutAside from './components/aside/index.vue'
+import layoutTab from './components/tabs.vue'
import useAppStore from '@/stores/modules/app'
import useTabbarStore from '@/stores/modules/tabbar'
import useSystemStore from '@/stores/modules/system'
diff --git a/admin/src/router/index.ts b/admin/src/router/index.ts
index c19c1bbc7..a067fa49c 100644
--- a/admin/src/router/index.ts
+++ b/admin/src/router/index.ts
@@ -79,8 +79,12 @@ router.beforeEach(async (to: any, from, next) => {
// 设置首页路由
let firstRoute: symbol | string | undefined = findFirstValidRoute(userStore.routers)
- if (systemStore.apps[0]) {
- firstRoute = userStore.addonIndexRoute[ systemStore.apps[0].key ]
+ for (let i = 0; i < systemStore.apps.length; i++) {
+ const item = systemStore.apps[i]
+ if (userStore.addonIndexRoute[item.key]) {
+ firstRoute = userStore.addonIndexRoute[item.key]
+ break
+ }
}
ROOT_ROUTER.redirect = { name: firstRoute }
diff --git a/admin/src/stores/modules/system.ts b/admin/src/stores/modules/system.ts
index 9bb691ffb..21fe54f91 100644
--- a/admin/src/stores/modules/system.ts
+++ b/admin/src/stores/modules/system.ts
@@ -1,17 +1,20 @@
import { defineStore } from 'pinia'
import storage from '@/utils/storage'
import { useCssVar } from '@vueuse/core'
-import { useCssVar } from '@vueuse/core'
import { getInstalledAddonList } from '@/app/api/addon'
-
interface System {
menuIsCollapse: boolean,
+ menuDrawer: boolean,
dark: boolean,
theme: string,
lang: string,
apps: Record[],
addons: Record[]
+ sidebar: string,
+ sidebarStyle: string,
+ currHeadMenuName: any,
+ tab: Boolean
}
const theme = storage.get('theme') ?? {}
@@ -20,14 +23,22 @@ const useSystemStore = defineStore('system', {
state: (): System => {
return {
menuIsCollapse: false,
+ menuDrawer: false,
dark: theme.dark ?? false,
theme: theme.theme ?? '#273de3',
+ sidebar: theme.sidebar ?? 'oneType',
lang: storage.get('lang') ?? 'zh-cn',
apps: [],
- addons: []
+ addons: [],
+ sidebarStyle: theme.sidebarStyle ?? 'threeType',
+ currHeadMenuName: '',
+ tab: storage.get('tab') ?? false
}
},
actions: {
+ setHeadMenu(value: any) {
+ this.currHeadMenuName = value
+ },
setTheme(state: string, value: any) {
this[state] = value
theme[state] = value
diff --git a/admin/src/stores/modules/tabbar.ts b/admin/src/stores/modules/tabbar.ts
index 3397b7d6c..f299a8b24 100644
--- a/admin/src/stores/modules/tabbar.ts
+++ b/admin/src/stores/modules/tabbar.ts
@@ -1,10 +1,11 @@
import { defineStore } from 'pinia'
-import type { RouteLocationNormalizedLoaded } from 'vue-router'
+import type { RouteLocationNormalizedLoaded, RouteRecordName } from 'vue-router'
+import useSystemStore from '@/stores/modules/system'
interface Tabbar {
curr: string,
tabs: {
- [key: string]: any
+ [key: RouteRecordName]: any
}
}
@@ -16,17 +17,18 @@ const useTabbarStore = defineStore('tabbar', {
}
},
actions: {
- addTab(roter: RouteLocationNormalizedLoaded) {
- if (roter.meta && roter.meta.type != 1) return
- if (this.tabs[roter.path]) {
- this.tabs[roter.path].query = roter.query || {}
+ addTab(router: RouteLocationNormalizedLoaded) {
+ if (router.meta && router.meta.type != 1) return
+ if (this.tabs[router.name]) {
+ this.tabs[router.name].query = router.query || {}
return
}
- this.tabs[roter.path] = {
- path: roter.path,
- title: roter.meta ? roter.meta.title : '',
- name: roter.name,
- query: roter.query || {}
+ this.tabs[router.name] = {
+ path: router.path,
+ title: router.meta ? router.meta.title : '',
+ name: router.name,
+ query: router.query || {},
+ componentName: router.matched.at(-1)?.components.default.__name
}
},
removeTab(path: string) {
@@ -40,12 +42,13 @@ const useTabbarStore = defineStore('tabbar', {
tabLength: (state) => Object.keys(state.tabs).length,
tabNames: (state) => {
const name: any[] = []
+ if (!useSystemStore().tab) return name
Object.keys(state.tabs).forEach(key => {
- name.push(state.tabs[key].name)
+ name.push(state.tabs[key].componentName)
})
return name
}
}
})
-export default useTabbarStore
\ No newline at end of file
+export default useTabbarStore
diff --git a/admin/src/stores/modules/user.ts b/admin/src/stores/modules/user.ts
index b92a835aa..a5378c616 100644
--- a/admin/src/stores/modules/user.ts
+++ b/admin/src/stores/modules/user.ts
@@ -53,7 +53,9 @@ const useUserStore = defineStore('user', {
logout()
// 清除tabbar
useTabbarStore().clearTab()
- router.push('/login')
+ const login = '/login'
+ // router.push(login)
+ location.href = `${location.origin}${login}`
},
getAuthMenusFn() {
return new Promise((resolve, reject) => {
diff --git a/admin/src/styles/font/price.ttf b/admin/src/styles/font/price.ttf
deleted file mode 100644
index 6483758ed..000000000
Binary files a/admin/src/styles/font/price.ttf and /dev/null differ
diff --git a/admin/src/styles/icon/addon-iconfont.css b/admin/src/styles/icon/addon-iconfont.css
index b630d0ece..4401b31bd 100644
--- a/admin/src/styles/icon/addon-iconfont.css
+++ b/admin/src/styles/icon/addon-iconfont.css
@@ -1 +1,2 @@
-/* addon-iconfont.css */
+@import "addon/o2o/iconfont.css";
+@import "addon/tourism/iconfont.css";
diff --git a/admin/src/styles/icon/addon/o2o/iconfont.css b/admin/src/styles/icon/addon/o2o/iconfont.css
new file mode 100644
index 000000000..17076410c
--- /dev/null
+++ b/admin/src/styles/icon/addon/o2o/iconfont.css
@@ -0,0 +1,38 @@
+@font-face {
+ font-family: "o2o"; /* Project id 4412516 */
+ src: url('//at.alicdn.com/t/c/font_4412516_cacqsbew46.woff2?t=1705720131974') format('woff2'),
+ url('//at.alicdn.com/t/c/font_4412516_cacqsbew46.woff?t=1705720131974') format('woff'),
+ url('//at.alicdn.com/t/c/font_4412516_cacqsbew46.ttf?t=1705720131974') format('truetype');
+}
+
+.o2o {
+ font-family: "o2o" !important;
+ font-size: 16px;
+ font-style: normal;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.o2o-icon-danhanghuadong:before {
+ content: "\e66f";
+}
+
+.o2o-icon-yuanjiao:before {
+ content: "\e6c0";
+}
+
+.o2o-icon-gl-square:before {
+ content: "\ea92";
+}
+
+.o2o-icon-sousuo12:before {
+ content: "\e699";
+}
+
+.o2o-icon-sousuo11:before {
+ content: "\e6d4";
+}
+
+.o2o-icon-jishi:before {
+ content: "\e600";
+}
diff --git a/admin/src/styles/icon/addon/o2o/iconfont.json b/admin/src/styles/icon/addon/o2o/iconfont.json
new file mode 100644
index 000000000..4ae38c0c4
--- /dev/null
+++ b/admin/src/styles/icon/addon/o2o/iconfont.json
@@ -0,0 +1,51 @@
+{
+ "id": "4412516",
+ "name": "上门服务",
+ "font_family": "o2o",
+ "css_prefix_text": "o2o-icon-",
+ "description": "",
+ "glyphs": [
+ {
+ "icon_id": "30621139",
+ "name": "单行滑动",
+ "font_class": "danhanghuadong",
+ "unicode": "e66f",
+ "unicode_decimal": 58991
+ },
+ {
+ "icon_id": "7149037",
+ "name": "圆角",
+ "font_class": "yuanjiao",
+ "unicode": "e6c0",
+ "unicode_decimal": 59072
+ },
+ {
+ "icon_id": "7594344",
+ "name": "20gl-square",
+ "font_class": "gl-square",
+ "unicode": "ea92",
+ "unicode_decimal": 60050
+ },
+ {
+ "icon_id": "10133070",
+ "name": "搜索",
+ "font_class": "sousuo12",
+ "unicode": "e699",
+ "unicode_decimal": 59033
+ },
+ {
+ "icon_id": "14652583",
+ "name": "搜索",
+ "font_class": "sousuo11",
+ "unicode": "e6d4",
+ "unicode_decimal": 59092
+ },
+ {
+ "icon_id": "6818781",
+ "name": "技师",
+ "font_class": "jishi",
+ "unicode": "e600",
+ "unicode_decimal": 58880
+ }
+ ]
+}
diff --git a/admin/src/styles/icon/addon/tourism/iconfont.css b/admin/src/styles/icon/addon/tourism/iconfont.css
new file mode 100644
index 000000000..4e28126c0
--- /dev/null
+++ b/admin/src/styles/icon/addon/tourism/iconfont.css
@@ -0,0 +1,58 @@
+@font-face {
+ font-family: "tourism"; /* Project id 4137250 */
+ src: url('//at.alicdn.com/t/c/font_4137250_st1ha9l0k1e.woff2?t=1687685028672') format('woff2'),
+ url('//at.alicdn.com/t/c/font_4137250_st1ha9l0k1e.woff?t=1687685028672') format('woff'),
+ url('//at.alicdn.com/t/c/font_4137250_st1ha9l0k1e.ttf?t=1687685028672') format('truetype');
+}
+
+.tourism {
+ font-family: "tourism" !important;
+ font-size: 16px;
+ font-style: normal;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.tourism-icon-feiji:before {
+ content: "\e600";
+}
+
+.tourism-icon-lvyou:before {
+ content: "\e6a9";
+}
+
+.tourism-icon-lvyouchanpin:before {
+ content: "\e63b";
+}
+
+.tourism-icon-lvyou1:before {
+ content: "\e623";
+}
+
+.tourism-icon-lvyou2:before {
+ content: "\e601";
+}
+
+.tourism-icon-lvyou3:before {
+ content: "\e60c";
+}
+
+.tourism-icon-lvyoubaochedingdan:before {
+ content: "\e612";
+}
+
+.tourism-icon-lvyou4:before {
+ content: "\e653";
+}
+
+.tourism-icon-lvyou5:before {
+ content: "\e610";
+}
+
+.tourism-icon-lvyouguanguang:before {
+ content: "\e87e";
+}
+
+.tourism-icon-lvyou6:before {
+ content: "\e642";
+}
diff --git a/admin/src/styles/icon/addon/tourism/iconfont.json b/admin/src/styles/icon/addon/tourism/iconfont.json
new file mode 100644
index 000000000..f9bc2b78e
--- /dev/null
+++ b/admin/src/styles/icon/addon/tourism/iconfont.json
@@ -0,0 +1,86 @@
+{
+ "id": "4137250",
+ "name": "旅游业",
+ "font_family": "tourism",
+ "css_prefix_text": "tourism-icon-",
+ "description": "",
+ "glyphs": [
+ {
+ "icon_id": "1443",
+ "name": "飞机",
+ "font_class": "feiji",
+ "unicode": "e600",
+ "unicode_decimal": 58880
+ },
+ {
+ "icon_id": "446824",
+ "name": "旅游",
+ "font_class": "lvyou",
+ "unicode": "e6a9",
+ "unicode_decimal": 59049
+ },
+ {
+ "icon_id": "1167173",
+ "name": "旅游产品",
+ "font_class": "lvyouchanpin",
+ "unicode": "e63b",
+ "unicode_decimal": 58939
+ },
+ {
+ "icon_id": "1354920",
+ "name": "旅游",
+ "font_class": "lvyou1",
+ "unicode": "e623",
+ "unicode_decimal": 58915
+ },
+ {
+ "icon_id": "1505555",
+ "name": "旅游",
+ "font_class": "lvyou2",
+ "unicode": "e601",
+ "unicode_decimal": 58881
+ },
+ {
+ "icon_id": "2121726",
+ "name": "旅游",
+ "font_class": "lvyou3",
+ "unicode": "e60c",
+ "unicode_decimal": 58892
+ },
+ {
+ "icon_id": "2357494",
+ "name": "旅游包车订单",
+ "font_class": "lvyoubaochedingdan",
+ "unicode": "e612",
+ "unicode_decimal": 58898
+ },
+ {
+ "icon_id": "3944019",
+ "name": "旅游",
+ "font_class": "lvyou4",
+ "unicode": "e653",
+ "unicode_decimal": 58963
+ },
+ {
+ "icon_id": "4838220",
+ "name": "旅游",
+ "font_class": "lvyou5",
+ "unicode": "e610",
+ "unicode_decimal": 58896
+ },
+ {
+ "icon_id": "7444178",
+ "name": "旅游观光",
+ "font_class": "lvyouguanguang",
+ "unicode": "e87e",
+ "unicode_decimal": 59518
+ },
+ {
+ "icon_id": "9748082",
+ "name": "旅游",
+ "font_class": "lvyou6",
+ "unicode": "e642",
+ "unicode_decimal": 58946
+ }
+ ]
+}
diff --git a/admin/src/styles/icon/iconfont.css b/admin/src/styles/icon/iconfont.css
index f718a72c0..826e60c78 100644
--- a/admin/src/styles/icon/iconfont.css
+++ b/admin/src/styles/icon/iconfont.css
@@ -1,9 +1,8 @@
@font-face {
- font-family: "iconfont";
- /* Project id 3883393 */
- src: url('//at.alicdn.com/t/c/font_3883393_0604cbkh5j03.woff2?t=1762651161569') format('woff2'),
- url('//at.alicdn.com/t/c/font_3883393_0604cbkh5j03.woff?t=1762651161569') format('woff'),
- url('//at.alicdn.com/t/c/font_3883393_0604cbkh5j03.ttf?t=1762651161569') format('truetype');
+ font-family: "iconfont"; /* Project id 3883393 */
+ src: url('//at.alicdn.com/t/c/font_3883393_jquqyagjvf.woff2?t=1773643077865') format('woff2'),
+ url('//at.alicdn.com/t/c/font_3883393_jquqyagjvf.woff?t=1773643077865') format('woff'),
+ url('//at.alicdn.com/t/c/font_3883393_jquqyagjvf.ttf?t=1773643077865') format('truetype');
}
.iconfont {
@@ -14,6 +13,18 @@
-moz-osx-font-smoothing: grayscale;
}
+.iconjiang-right:before {
+ content: "\e921";
+}
+
+.iconpeisongshezhi:before {
+ content: "\e920";
+}
+
+.iconai:before {
+ content: "\e91f";
+}
+
.icona-zhulixiangqingpc30:before {
content: "\e914";
}
@@ -3276,4 +3287,4 @@
.iconquanping:before {
content: "\eb11";
-}
\ No newline at end of file
+}
diff --git a/admin/src/styles/icon/official-iconfont.css b/admin/src/styles/icon/official-iconfont.css
index 894813d90..ebfa08010 100644
--- a/admin/src/styles/icon/official-iconfont.css
+++ b/admin/src/styles/icon/official-iconfont.css
@@ -1,8 +1,8 @@
@font-face {
font-family: "nc-iconfont"; /* Project id 4567203 */
- src: url('//at.alicdn.com/t/c/font_4567203_9qmfc2elgrt.woff2?t=1741345195504') format('woff2'),
- url('//at.alicdn.com/t/c/font_4567203_9qmfc2elgrt.woff?t=1741345195504') format('woff'),
- url('//at.alicdn.com/t/c/font_4567203_9qmfc2elgrt.ttf?t=1741345195504') format('truetype');
+ src: url('//at.alicdn.com/t/c/font_4567203_mq3zv60st5a.woff2?t=1767940264104') format('woff2'),
+ url('//at.alicdn.com/t/c/font_4567203_mq3zv60st5a.woff?t=1767940264104') format('woff'),
+ url('//at.alicdn.com/t/c/font_4567203_mq3zv60st5a.ttf?t=1767940264104') format('truetype');
}
.nc-iconfont {
@@ -13,6 +13,578 @@
-moz-osx-font-smoothing: grayscale;
}
+.nc-icon-huiyuangaikuang:before {
+ content: "\e91b";
+}
+
+.nc-icon-jiaoyigaikuang:before {
+ content: "\e91a";
+}
+
+.nc-icon-zhanghuruzhushenqing:before {
+ content: "\e919";
+}
+
+.nc-icon-jiesuanzhanghu1:before {
+ content: "\e918";
+}
+
+.nc-icon-zhanghuguanli:before {
+ content: "\e917";
+}
+
+.nc-icon-banbenhao:before {
+ content: "\e8ff";
+}
+
+.nc-icon-shangjiashoujiduan:before {
+ content: "\e8fd";
+}
+
+.nc-icon-xinxi:before {
+ content: "\e900";
+}
+
+.nc-icon-a-gongyingshangzhangdanpc30:before {
+ content: "\e771";
+}
+
+.nc-icon-a-jifenshangchengzhangdanpc30:before {
+ content: "\e772";
+}
+
+.nc-icon-a-shangchengzhangdanpc30:before {
+ content: "\e773";
+}
+
+.nc-icon-a-chongzhizhangdanpc30:before {
+ content: "\e774";
+}
+
+.nc-icon-gongzuotai:before {
+ content: "\e8ec";
+}
+
+.nc-icon-shoujiV6xx1:before {
+ content: "\e8ed";
+}
+
+.nc-icon-shoujiV6xxmm:before {
+ content: "\e8fe";
+}
+
+.nc-icon-xuanfuanniu:before {
+ content: "\e8e5";
+}
+
+.nc-icon-pintuanguanli:before {
+ content: "\e8e0";
+}
+
+.nc-icon-huodongliebiao1:before {
+ content: "\e8e1";
+}
+
+.nc-icon-pintuanliebiao:before {
+ content: "\e8e2";
+}
+
+.nc-icon-pintuandingdan:before {
+ content: "\e8e3";
+}
+
+.nc-icon-pintuanpeizhi:before {
+ content: "\e8e4";
+}
+
+.nc-icon-xia:before {
+ content: "\e8de";
+}
+
+.nc-icon-shang:before {
+ content: "\e8df";
+}
+
+.nc-icon-shoujiV6xx:before {
+ content: "\e7a1";
+}
+
+.nc-icon-ditumichi:before {
+ content: "\e8ca";
+}
+
+.nc-icon-qiehuanV6xx:before {
+ content: "\e8eb";
+}
+
+.nc-icon-dingdanbianhaoV6xx:before {
+ content: "\e8ea";
+}
+
+.nc-icon-dingdanbianhaoV6mm:before {
+ content: "\e8e9";
+}
+
+.nc-icon-dianpuzhandianV6xx2:before {
+ content: "\e8e6";
+}
+
+.nc-icon-huocheV6mm:before {
+ content: "\e8e7";
+}
+
+.nc-icon-huocheV6xx:before {
+ content: "\e8e8";
+}
+
+.nc-icon-wannengbiaodanV6xx:before {
+ content: "\e8d9";
+}
+
+.nc-icon-shujudaochuV6xx:before {
+ content: "\e8da";
+}
+
+.nc-icon-shujudaochuV6xx-1:before {
+ content: "\e8db";
+}
+
+.nc-icon-dayinjiV6xx:before {
+ content: "\e8dc";
+}
+
+.nc-icon-dayinV6xx:before {
+ content: "\e8dd";
+}
+
+.nc-icon-fenzuguanliV6xx:before {
+ content: "\e8d6";
+}
+
+.nc-icon-shangpinliebiaoV6xx:before {
+ content: "\e8d7";
+}
+
+.nc-icon-dingdanliebiaoV6xx:before {
+ content: "\e8d4";
+}
+
+.nc-icon-tuikuanV6xx2:before {
+ content: "\e8d8";
+}
+
+.nc-icon-jifenshangchengV6xx:before {
+ content: "\e8d5";
+}
+
+.nc-icon-chakandituV6xx:before {
+ content: "\e8d2";
+}
+
+.nc-icon-a-peisongguanliPC30:before {
+ content: "\e6ed";
+}
+
+.nc-icon-a-tongchengpeisongPC30:before {
+ content: "\e6ec";
+}
+
+.nc-icon-a-wuliupeisongPC30:before {
+ content: "\e6ee";
+}
+
+.nc-icon-a-shangjiapeisongPC30:before {
+ content: "\e6f2";
+}
+
+.nc-icon-xianshiV6mm:before {
+ content: "\e8ac";
+}
+
+.nc-icon-a-dianneifenrun34:before {
+ content: "\e811";
+}
+
+.nc-icon-xiaochengxu:before {
+ content: "\e8a8";
+}
+
+.nc-icon-qianV6xx:before {
+ content: "\e784";
+}
+
+.nc-icon-mimaV6xx:before {
+ content: "\e8a6";
+}
+
+.nc-icon-yanzhengmaV6xx:before {
+ content: "\e8a7";
+}
+
+.nc-icon-bianjiV6xx2:before {
+ content: "\e8a4";
+}
+
+.nc-icon-fenxiangV6mm-1:before {
+ content: "\e89c";
+}
+
+.nc-icon-a-Group1036V6xx:before {
+ content: "\e77b";
+}
+
+.nc-icon-shanchu-yuangaiV6xx:before {
+ content: "\e6eb";
+}
+
+.nc-icon-hezuogonghuoshangV6xx:before {
+ content: "\e88b";
+}
+
+.nc-icon-hezuodianpu:before {
+ content: "\e85b";
+}
+
+.nc-icon-gongyingshangxitong:before {
+ content: "\e852";
+}
+
+.nc-icon-shangchengxitong:before {
+ content: "\e858";
+}
+
+.nc-icon-fenzhangshezhi:before {
+ content: "\e843";
+}
+
+.nc-icon-xuanpinpingtai:before {
+ content: "\e845";
+}
+
+.nc-icon-a-Maskgroup:before {
+ content: "\e840";
+}
+
+.nc-icon-fenzhangguanli:before {
+ content: "\e84b";
+}
+
+.nc-icon-gongyingshangdingdan:before {
+ content: "\e84d";
+}
+
+.nc-icon-gongyingshangshangpin:before {
+ content: "\e84e";
+}
+
+.nc-icon-shuaxinV6mm2:before {
+ content: "\e889";
+}
+
+.nc-icon-yitiaohuo:before {
+ content: "\e888";
+}
+
+.nc-icon-shangchengdingdan:before {
+ content: "\e837";
+}
+
+.nc-icon-shangchengshangpin:before {
+ content: "\e83f";
+}
+
+.nc-icon-gouwudaiV6xx1:before {
+ content: "\e886";
+}
+
+.nc-icon-dianpuV6xx1:before {
+ content: "\e880";
+}
+
+.nc-icon-youhuiquanV6xx2:before {
+ content: "\e87a";
+}
+
+.nc-icon-yinhangka2:before {
+ content: "\e83e";
+}
+
+.nc-icon-huiyuantixian:before {
+ content: "\e839";
+}
+
+.nc-icon-a-Financing-tworongzi2:before {
+ content: "\e825";
+}
+
+.nc-icon-a-Weixin-marketweixindianshang:before {
+ content: "\e821";
+}
+
+.nc-icon-a-Repairbianji:before {
+ content: "\e818";
+}
+
+.nc-icon-a-Diskcipan:before {
+ content: "\e81c";
+}
+
+.nc-icon-a-Historylishijilu:before {
+ content: "\e81b";
+}
+
+.nc-icon-a-Deliveryjiaohuo:before {
+ content: "\e81a";
+}
+
+.nc-icon-dianpuV6xx:before {
+ content: "\e871";
+}
+
+.nc-icon-Frame:before {
+ content: "\e816";
+}
+
+.nc-icon-zhifujianshu1:before {
+ content: "\e815";
+}
+
+.nc-icon-jiagoushuliang:before {
+ content: "\e814";
+}
+
+.nc-icon-xiadanshu:before {
+ content: "\e813";
+}
+
+.nc-icon-shangpinliulanliang:before {
+ content: "\e812";
+}
+
+.nc-icon-fenxiaodengji:before {
+ content: "\e807";
+}
+
+.nc-icon-fenxiaoguanli:before {
+ content: "\e809";
+}
+
+.nc-icon-dianzimiandan:before {
+ content: "\e806";
+}
+
+.nc-icon-fenxiaodingdan:before {
+ content: "\e804";
+}
+
+.nc-icon-fenxiaoshang:before {
+ content: "\e808";
+}
+
+.nc-icon-hexiaoyuan:before {
+ content: "\e805";
+}
+
+.nc-icon-shangpintongji:before {
+ content: "\e80a";
+}
+
+.nc-icon-fenxiaogaikuang:before {
+ content: "\e802";
+}
+
+.nc-icon-fenxiaoshangpin:before {
+ content: "\e801";
+}
+
+.nc-icon-yingyongliebiao:before {
+ content: "\e80b";
+}
+
+.nc-icon-huodongliebiao:before {
+ content: "\e80c";
+}
+
+.nc-icon-hexiaojilu:before {
+ content: "\e80d";
+}
+
+.nc-icon-piliangfahuo:before {
+ content: "\e80e";
+}
+
+.nc-icon-fenxiaoshezhi:before {
+ content: "\e80f";
+}
+
+.nc-icon-dianpu:before {
+ content: "\e800";
+}
+
+.nc-icon-caozuorizhi1:before {
+ content: "\e7ef";
+}
+
+.nc-icon-dingdanliebiao:before {
+ content: "\e7f0";
+}
+
+.nc-icon-hexiaoguanli:before {
+ content: "\e7ee";
+}
+
+.nc-icon-fapiaoguanli:before {
+ content: "\e7ed";
+}
+
+.nc-icon-dingdanshezhi:before {
+ content: "\e7ea";
+}
+
+.nc-icon-huiyuanbiaoqian:before {
+ content: "\e7eb";
+}
+
+.nc-icon-huishouzhan:before {
+ content: "\e7db";
+}
+
+.nc-icon-jiesuanzhanghu:before {
+ content: "\e7f1";
+}
+
+.nc-icon-guanliyuan1:before {
+ content: "\e7e6";
+}
+
+.nc-icon-huiyuanliebiao:before {
+ content: "\e7da";
+}
+
+.nc-icon-shangpinfenlei:before {
+ content: "\e7dd";
+}
+
+.nc-icon-jiaoseguanli:before {
+ content: "\e7e3";
+}
+
+.nc-icon-shangpinliebiao:before {
+ content: "\e7e8";
+}
+
+.nc-icon-shangpinpingjia:before {
+ content: "\e7e9";
+}
+
+.nc-icon-dianpushezhi:before {
+ content: "\e7e7";
+}
+
+.nc-icon-sucaiguanli1:before {
+ content: "\e7f2";
+}
+
+.nc-icon-tixianjilu:before {
+ content: "\e7e4";
+}
+
+.nc-icon-xiaopiaodayin:before {
+ content: "\e7f3";
+}
+
+.nc-icon-shangjiadizhiku:before {
+ content: "\e7e1";
+}
+
+.nc-icon-shujudaochu:before {
+ content: "\e7de";
+}
+
+.nc-icon-shangpincanshu:before {
+ content: "\e7e0";
+}
+
+.nc-icon-tuikuanweiquan:before {
+ content: "\e7f4";
+}
+
+.nc-icon-weiyemian:before {
+ content: "\e7f5";
+}
+
+.nc-icon-shouyezhuangxiu:before {
+ content: "\e7d9";
+}
+
+.nc-icon-xianshizhekou:before {
+ content: "\e7d8";
+}
+
+.nc-icon-youhuiquan:before {
+ content: "\e7d7";
+}
+
+.nc-icon-zichangaikuang:before {
+ content: "\e7d6";
+}
+
+.nc-icon-yunfeimoban:before {
+ content: "\e7f6";
+}
+
+.nc-icon-daifukuandingdan:before {
+ content: "\e7fa";
+}
+
+.nc-icon-cangkushangpinshuliang:before {
+ content: "\e7f9";
+}
+
+.nc-icon-daishouhuodingdan:before {
+ content: "\e7f8";
+}
+
+.nc-icon-tuikuan:before {
+ content: "\e7f7";
+}
+
+.nc-icon-tuikuandingdan:before {
+ content: "\e7fb";
+}
+
+.nc-icon-chushoushangpinshuliang:before {
+ content: "\e7fc";
+}
+
+.nc-icon-daifahuodingdan:before {
+ content: "\e7fd";
+}
+
+.nc-icon-dingdanliang:before {
+ content: "\e7fe";
+}
+
+.nc-icon-xiaoshoue:before {
+ content: "\e7ff";
+}
+
+.nc-icon-paihangbangV6xx1:before {
+ content: "\e7e2";
+}
+
+.nc-icon-bangdanguanliV6xx:before {
+ content: "\e86d";
+}
+
+.nc-icon-bangdanshezhiV6xx:before {
+ content: "\e86e";
+}
+
+.nc-icon-zhuanzhangV6xx-1:before {
+ content: "\e86a";
+}
+
.nc-icon-qingliV6xx:before {
content: "\e865";
}
diff --git a/admin/src/utils/common.ts b/admin/src/utils/common.ts
index 42c66c060..5302c2076 100644
--- a/admin/src/utils/common.ts
+++ b/admin/src/utils/common.ts
@@ -127,13 +127,14 @@ export function isUrl(str: string): boolean {
* @returns
*/
export function img(path: string): string {
+ if (!path) return ''
+
let imgDomain = import.meta.env.VITE_IMG_DOMAIN || location.origin
- if (typeof path == 'string' && path.startsWith('/')) path = path.replace(/^\//, '')
- if (typeof imgDomain == 'string' && imgDomain.endsWith('/')) imgDomain = imgDomain.slice(0, -1)
- if(path){
- return isUrl(path) ? path : `${imgDomain}/${path}`
- }
+ if (path.startsWith('/')) path = path.replace(/^\//, '')
+ if (imgDomain.endsWith('/')) imgDomain = imgDomain.slice(0, -1)
+
+ return isUrl(path) ? path : `${imgDomain}/${path}`
}
/**
@@ -401,3 +402,37 @@ export function getTablePageStorage(where: any = {}) {
}
return data;
}
+
+
+// 距离显示
+
+export function distance(distance: string | number): string {
+ const dist = typeof distance === 'string' ? parseFloat(distance) : distance;
+ if (isNaN(dist)) return distance.toString();
+ return dist < 1 ? parseInt((dist * 1000).toString()) + 'm' : dist.toFixed(1) + 'km'
+}
+
+// 获取图片尺寸的函数
+export function getImageDimensions (url: string) {
+
+ return new Promise((resolve) => {
+ const imgObj = new Image()
+ imgObj.onload = () => {
+ // 成功加载
+ const size = {
+ width: imgObj.naturalWidth,
+ height: imgObj.naturalHeight
+ }
+ resolve(size)
+ }
+
+ imgObj.onerror = (err) => {
+ // 加载失败
+ resolve(null)
+ }
+
+ // 设置图片源,开始加载
+ // 注意:如果图片跨域且服务器未设置CORS,可能会触发onerror
+ imgObj.src = img(url)
+ })
+}
\ No newline at end of file
diff --git a/admin/src/utils/qqmap.ts b/admin/src/utils/qqmap.ts
index 225719e40..e1c89ac16 100644
--- a/admin/src/utils/qqmap.ts
+++ b/admin/src/utils/qqmap.ts
@@ -134,6 +134,9 @@ export const createPolygon = (map: any, geometriesData: any) => {
* @param key
*/
export const deleteGeometry = (key: string) => {
+ if (!geometry[key]) {
+ return
+ }
geometry[key].graphical.remove(key)
geometry[key].editor.delete()
}
@@ -143,6 +146,9 @@ export const deleteGeometry = (key: string) => {
* @param key
*/
export const selectGeometry = (key: string) => {
+ if (!geometry[key] || !geometry[key].editor) {
+ return
+ }
geometry[key].editor.select([key])
}
diff --git a/admin/src/utils/request.ts b/admin/src/utils/request.ts
index 751b62dee..910378d2a 100644
--- a/admin/src/utils/request.ts
+++ b/admin/src/utils/request.ts
@@ -82,8 +82,9 @@ class Request {
}
/**
- * 发送get请求
+ * 发送post请求
* @param url
+ * @param data
* @param config
* @returns
*/
@@ -92,8 +93,9 @@ class Request {
}
/**
- * 发送get请求
+ * 发送put请求
* @param url
+ * @param data
* @param config
* @returns
*/
@@ -102,7 +104,7 @@ class Request {
}
/**
- * 发送get请求
+ * 发送delete请求
* @param url
* @param config
* @returns
@@ -180,15 +182,27 @@ class Request {
}
private messageCache = new Map();
+ private readonly CACHE_EXPIRY = 5000; // 5秒内重复内容不再弹出,可自定义过期时间
+ private readonly MAX_CACHE_SIZE = 100;
private showElMessage(options: MessageParams) {
const cacheKey = options.message
+ const now = Date.now()
const cachedMessage = this.messageCache.get(cacheKey);
- if (!cachedMessage || Date.now() - cachedMessage.timestamp > 5000) { // 5秒内重复内容不再弹出,可自定义过期时间
- this.messageCache.set(cacheKey, { timestamp: Date.now() });
+ if (!cachedMessage || now - cachedMessage.timestamp > this.CACHE_EXPIRY) {
+ this.messageCache.set(cacheKey, { timestamp: now });
ElMessage(options)
}
+
+ // 定期清理过期缓存,防止内存泄漏
+ if (this.messageCache.size > this.MAX_CACHE_SIZE) {
+ for (const [key, value] of this.messageCache.entries()) {
+ if (now - value.timestamp > this.CACHE_EXPIRY) {
+ this.messageCache.delete(key)
+ }
+ }
+ }
}
}
diff --git a/admin/src/utils/storage.ts b/admin/src/utils/storage.ts
index 999e02918..75cf755c2 100644
--- a/admin/src/utils/storage.ts
+++ b/admin/src/utils/storage.ts
@@ -34,10 +34,12 @@ class Storage {
*/
public get(key: string) {
try {
- const json: any = window.localStorage.getItem(`${this.prefix}.${key}`)
- return JSON.parse(json)
+ const value = window.localStorage.getItem(`${this.prefix}.${key}`)
+ if (value === null) return null
+ return JSON.parse(value)
} catch (error) {
- return window.localStorage.getItem(`${this.prefix}.${key}`)
+ const value = window.localStorage.getItem(`${this.prefix}.${key}`)
+ return value !== null ? value : null
}
}