提交 872cb861 作者: 郁骅焌

打包优化

上级 151729f6
...@@ -50,8 +50,6 @@ declare module 'vue' { ...@@ -50,8 +50,6 @@ declare module 'vue' {
ElAvatar: typeof import('element-plus/es')['ElAvatar'] ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElBacktop: typeof import('element-plus/es')['ElBacktop'] ElBacktop: typeof import('element-plus/es')['ElBacktop']
ElBadge: typeof import('element-plus/es')['ElBadge'] ElBadge: typeof import('element-plus/es')['ElBadge']
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton'] ElButton: typeof import('element-plus/es')['ElButton']
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
ElCalendar: typeof import('element-plus/es')['ElCalendar'] ElCalendar: typeof import('element-plus/es')['ElCalendar']
...@@ -107,7 +105,6 @@ declare module 'vue' { ...@@ -107,7 +105,6 @@ declare module 'vue' {
ElStatistic: typeof import('element-plus/es')['ElStatistic'] ElStatistic: typeof import('element-plus/es')['ElStatistic']
ElStep: typeof import('element-plus/es')['ElStep'] ElStep: typeof import('element-plus/es')['ElStep']
ElSteps: typeof import('element-plus/es')['ElSteps'] ElSteps: typeof import('element-plus/es')['ElSteps']
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable'] ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
...@@ -115,7 +112,6 @@ declare module 'vue' { ...@@ -115,7 +112,6 @@ declare module 'vue' {
ElTabPane: typeof import('element-plus/es')['ElTabPane'] ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs'] ElTabs: typeof import('element-plus/es')['ElTabs']
ElTag: typeof import('element-plus/es')['ElTag'] ElTag: typeof import('element-plus/es')['ElTag']
ElText: typeof import('element-plus/es')['ElText']
ElTimeline: typeof import('element-plus/es')['ElTimeline'] ElTimeline: typeof import('element-plus/es')['ElTimeline']
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem'] ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
ElTimePicker: typeof import('element-plus/es')['ElTimePicker'] ElTimePicker: typeof import('element-plus/es')['ElTimePicker']
......
...@@ -18,11 +18,11 @@ export const useTabsStore = defineStore('tabs', { ...@@ -18,11 +18,11 @@ export const useTabsStore = defineStore('tabs', {
* @returns * @returns
*/ */
addVisitedRoute(route: any) { addVisitedRoute(route: any) {
const target = this.visitedRoutes.find((item) => item.path === route.path) const target = this.visitedRoutes.find((item: any) => item.path === route.path)
if (target && !route.meta.dynamicNewTab) Object.assign(target, route) if (target && !route.meta.dynamicNewTab) Object.assign(target, route)
else if (!target) this.visitedRoutes.push(Object.assign({}, route)) else if (!target) this.visitedRoutes.push(Object.assign({}, route))
//应对极特殊情况:没有配置noClosable的情况,默认使当前tab不可关闭 //应对极特殊情况:没有配置noClosable的情况,默认使当前tab不可关闭
if (!this.visitedRoutes.find((route) => route.meta.noClosable)) this.visitedRoutes[0].meta.noClosable = true if (!this.visitedRoutes.find((route: any) => route.meta.noClosable)) this.visitedRoutes[0].meta.noClosable = true
}, },
/** /**
* @description 删除当前标签页 * @description 删除当前标签页
...@@ -30,7 +30,7 @@ export const useTabsStore = defineStore('tabs', { ...@@ -30,7 +30,7 @@ export const useTabsStore = defineStore('tabs', {
* @returns * @returns
*/ */
delVisitedRoute(path: string) { delVisitedRoute(path: string) {
this.visitedRoutes = this.visitedRoutes.filter((route) => route.path !== path) this.visitedRoutes = this.visitedRoutes.filter((route: any) => route.path !== path)
}, },
/** /**
* @description 删除当前标签页以外其它全部标签页 * @description 删除当前标签页以外其它全部标签页
...@@ -38,7 +38,7 @@ export const useTabsStore = defineStore('tabs', { ...@@ -38,7 +38,7 @@ export const useTabsStore = defineStore('tabs', {
* @returns * @returns
*/ */
delOthersVisitedRoutes(path: string) { delOthersVisitedRoutes(path: string) {
this.visitedRoutes = this.visitedRoutes.filter((route) => route.meta.noClosable || route.path === path) this.visitedRoutes = this.visitedRoutes.filter((route: any) => route.meta.noClosable || route.path === path)
}, },
/** /**
* @description 删除当前标签页左边全部标签页 * @description 删除当前标签页左边全部标签页
...@@ -47,7 +47,7 @@ export const useTabsStore = defineStore('tabs', { ...@@ -47,7 +47,7 @@ export const useTabsStore = defineStore('tabs', {
*/ */
delLeftVisitedRoutes(path: string) { delLeftVisitedRoutes(path: string) {
let found = false let found = false
this.visitedRoutes = this.visitedRoutes.filter((route) => { this.visitedRoutes = this.visitedRoutes.filter((route: any) => {
if (route.path === path) found = true if (route.path === path) found = true
return route.meta.noClosable || found return route.meta.noClosable || found
}) })
...@@ -59,7 +59,7 @@ export const useTabsStore = defineStore('tabs', { ...@@ -59,7 +59,7 @@ export const useTabsStore = defineStore('tabs', {
*/ */
delRightVisitedRoutes(path: string) { delRightVisitedRoutes(path: string) {
let found = false let found = false
this.visitedRoutes = this.visitedRoutes.filter((route) => { this.visitedRoutes = this.visitedRoutes.filter((route: any) => {
const close = found const close = found
if (route.path === path) found = true if (route.path === path) found = true
return route.meta.noClosable || !close return route.meta.noClosable || !close
...@@ -70,7 +70,7 @@ export const useTabsStore = defineStore('tabs', { ...@@ -70,7 +70,7 @@ export const useTabsStore = defineStore('tabs', {
* @returns * @returns
*/ */
delAllVisitedRoutes() { delAllVisitedRoutes() {
this.visitedRoutes = this.visitedRoutes.filter((route) => route.meta.noClosable) this.visitedRoutes = this.visitedRoutes.filter((route: any) => route.meta.noClosable)
localStorage.setItem('caughtRoutes', JSON.stringify(this.visitedRoutes)) localStorage.setItem('caughtRoutes', JSON.stringify(this.visitedRoutes))
}, },
/** /**
......
interface CodeMessage {
[key: number]: string
default: string
}
export default { export default {
200: '服务器成功返回请求数据', 200: '服务器成功返回请求数据',
201: '新建或修改数据成功', 201: '新建或修改数据成功',
...@@ -16,4 +21,4 @@ export default { ...@@ -16,4 +21,4 @@ export default {
503: '服务不可用,服务器暂时过载或维护', 503: '服务不可用,服务器暂时过载或维护',
504: '网关超时', 504: '网关超时',
default: '系统未知错误,请反馈给管理员', default: '系统未知错误,请反馈给管理员',
} } as CodeMessage
...@@ -14,7 +14,7 @@ export function useDict(...args: string[]) { ...@@ -14,7 +14,7 @@ export function useDict(...args: string[]) {
res.value[dictType] = dicts res.value[dictType] = dicts
} else { } else {
getDicts(dictType).then((resp) => { getDicts(dictType).then((resp) => {
res.value[dictType] = resp.data.map((p) => ({ res.value[dictType] = resp.data.map((p: any) => ({
label: p.dictLabel, label: p.dictLabel,
value: p.dictValue, value: p.dictValue,
elTagType: p.listClass, elTagType: p.listClass,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论