From d50cdabe656bd2f1168981349ab181245ea07764 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Fri, 23 May 2025 09:50:42 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/prod' into prod
---
src/router/avue-router.js | 174 +++++++-------
src/permission.js | 56 ++--
src/views/tickets/ticket.vue | 18
src/mac/index.vue | 105 ++++----
src/page/index/tags.vue | 164 ++++++--------
src/page/index/top/top-menu.vue | 32 +-
src/page/index/top/index.vue | 44 ++--
src/store/getters.js | 12
src/store/modules/tags.js | 46 ++--
9 files changed, 313 insertions(+), 338 deletions(-)
diff --git a/src/mac/index.vue b/src/mac/index.vue
index d5fe7ea..421c5fa 100644
--- a/src/mac/index.vue
+++ b/src/mac/index.vue
@@ -44,11 +44,8 @@
<div class="dock">
<template v-for="item in openAppList" :key="item.key">
<div class="item" @click="openApp(item)">
- <i
- :style="{ backgroundColor: item.iconBgColor, color: item.iconColor }"
- class="iconfont"
- :class="item[iconKey]"
- ></i>
+ <i :style="{ backgroundColor: item.iconBgColor, color: item.iconColor }" class="iconfont"
+ :class="item[iconKey]"></i>
<small style="margin-top: 5px; font-size: 10px">{{ item[labelKey] }}</small>
</div>
</template>
@@ -58,93 +55,93 @@
</div>
</template>
<script>
-import { mapGetters } from 'vuex';
-import $Mode from './mode/index';
-import index from '@/mixins/index';
-import topLock from '@/page/index/top/top-lock.vue';
+import { mapGetters } from 'vuex'
+import $Mode from './mode/index'
+import index from '@/mixins/index'
+import topLock from '@/page/index/top/top-lock.vue'
export default {
mixins: [index],
components: {
topLock,
},
- data() {
+ data () {
return {
app: false,
timeString: '',
- };
+ }
},
computed: {
- ...mapGetters(['menu', 'tagList', 'tagWel', 'tag', 'userInfo', 'isMacOs']),
- labelKey() {
- return this.website.menu.label;
+ ...mapGetters(['menu', 'bsTagList', 'tagWel', 'tag', 'userInfo', 'isMacOs']),
+ labelKey () {
+ return this.website.menu.label
},
- pathKey() {
- return this.website.menu.path;
+ pathKey () {
+ return this.website.menu.path
},
- hrefKey() {
- return this.website.menu.href;
+ hrefKey () {
+ return this.website.menu.href
},
- childrenKey() {
- return this.website.menu.children;
+ childrenKey () {
+ return this.website.menu.children
},
- queryKey() {
- return this.website.menu.query;
+ queryKey () {
+ return this.website.menu.query
},
- iconKey() {
- return this.website.menu.icon;
+ iconKey () {
+ return this.website.menu.icon
},
- menuList() {
- let result = [];
+ menuList () {
+ let result = []
const findMenu = list => {
list.forEach(ele => {
if (ele[this.childrenKey] && ele[this.childrenKey].length !== 0) {
- findMenu(ele[this.childrenKey]);
+ findMenu(ele[this.childrenKey])
} else {
- result.push(ele);
+ result.push(ele)
}
- });
- };
- findMenu(this.menu);
- return result;
+ })
+ }
+ findMenu(this.menu)
+ return result
},
- deskTopAppList() {
- return this.menuList;
+ deskTopAppList () {
+ return this.menuList
},
- openAppList() {
- return [];
+ openAppList () {
+ return []
},
},
- created() {
- this.startTimer();
- this.$store.dispatch('GetMenu');
+ created () {
+ this.startTimer()
+ this.$store.dispatch('GetMenu')
},
methods: {
- switchTheme() {
- this.$store.commit('SET_THEME_NAME', '');
- this.$router.push(this.tagWel);
- setTimeout(() => location.reload());
+ switchTheme () {
+ this.$store.commit('SET_THEME_NAME', '')
+ this.$router.push(this.tagWel)
+ setTimeout(() => location.reload())
},
- logout() {
- this.$store.commit('SET_THEME_NAME', '');
+ logout () {
+ this.$store.commit('SET_THEME_NAME', '')
this.$store.dispatch('LogOut').then(() => {
- this.$router.push({ path: '/login' });
- setTimeout(() => location.reload());
- });
+ this.$router.push({ path: '/login' })
+ setTimeout(() => location.reload())
+ })
},
- startTimer() {
+ startTimer () {
setInterval(() => {
- this.timeString = this.$dayjs().format('YYYY年MM月DD日 HH:mm');
- }, 1000);
+ this.timeString = this.$dayjs().format('YYYY年MM月DD日 HH:mm')
+ }, 1000)
},
- openApp(item) {
+ openApp (item) {
$Mode({
title: item[this.labelKey],
path: item[this.hrefKey] ? item[this.hrefKey] : item[this.pathKey],
- });
+ })
},
},
-};
+}
</script>
<style>
.top .el-dropdown {
diff --git a/src/page/index/tags.vue b/src/page/index/tags.vue
index 84361fb..1fa540c 100644
--- a/src/page/index/tags.vue
+++ b/src/page/index/tags.vue
@@ -1,39 +1,21 @@
<template>
<div class="avue-tags" v-if="setting.tag" @click="contextmenuFlag = false">
<!-- tag盒子 -->
- <div
- v-if="contextmenuFlag"
- class="avue-tags__contentmenu"
- :style="{ left: contentmenuX + 'px', top: contentmenuY + 'px' }"
- >
+ <div v-if="contextmenuFlag" class="avue-tags__contentmenu"
+ :style="{ left: contentmenuX + 'px', top: contentmenuY + 'px' }">
<div class="item" @click="closeOthersTags">{{ $t('tagsView.closeOthers') }}</div>
<div class="item" @click="closeAllTags">{{ $t('tagsView.closeAll') }}</div>
<div class="item" @click="clearCacheTags">{{ $t('tagsView.clearCache') }}</div>
</div>
<div class="avue-tags__box">
- <el-tabs
- v-model="active"
- type="card"
- @contextmenu="handleContextmenu"
- :closable="tagLen !== 1"
- @tab-click="openTag"
- @edit="menuTag"
- >
- <el-tab-pane
- v-for="(item, index) in tagList"
- :key="index"
- :label="generateTitle(item)"
- :name="item.fullPath"
- >
+ <el-tabs v-model="active" type="card" @contextmenu="handleContextmenu" :closable="tagLen !== 1"
+ @tab-click="openTag" @edit="menuTag">
+ <el-tab-pane v-for="(item, index) in bsTagList" :key="index" :label="generateTitle(item)" :name="item.fullPath">
<template #label>
<span>
{{ generateTitle(item) }}
- <i
- class="el-icon-refresh"
- :class="{ turn: refresh }"
- @click="handleRefresh"
- v-if="active === item.fullPath"
- ></i>
+ <i class="el-icon-refresh" :class="{ turn: refresh }" @click="handleRefresh"
+ v-if="active === item.fullPath"></i>
</span>
</template>
</el-tab-pane>
@@ -46,12 +28,10 @@
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="openSearch">{{ $t('tagsView.search') }}</el-dropdown-item>
- <el-dropdown-item @click="closeOthersTags"
- >{{ $t('tagsView.closeOthers') }}
+ <el-dropdown-item @click="closeOthersTags">{{ $t('tagsView.closeOthers') }}
</el-dropdown-item>
<el-dropdown-item @click="closeAllTags">{{ $t('tagsView.closeAll') }}</el-dropdown-item>
- <el-dropdown-item @click="clearCacheTags"
- >{{ $t('tagsView.clearCache') }}
+ <el-dropdown-item @click="clearCacheTags">{{ $t('tagsView.clearCache') }}
</el-dropdown-item>
</el-dropdown-menu>
</template>
@@ -60,129 +40,129 @@
</div>
</template>
<script>
-import { mapGetters } from 'vuex';
-import { clearCache } from '@/api/user';
+import { mapGetters } from 'vuex'
+import { clearCache } from '@/api/user'
export default {
name: 'tags',
- data() {
+ data () {
return {
refresh: false,
active: '',
contentmenuX: '',
contentmenuY: '',
contextmenuFlag: false,
- };
+ }
},
watch: {
tag: {
- handler(val) {
- this.active = val.fullPath;
+ handler (val) {
+ this.active = val.fullPath
},
immediate: true,
},
- contextmenuFlag() {
- window.addEventListener('mousedown', this.watchContextmenu);
+ contextmenuFlag () {
+ window.addEventListener('mousedown', this.watchContextmenu)
},
},
computed: {
- ...mapGetters(['tagWel', 'tagList', 'tag', 'setting']),
- tagLen() {
- return this.tagList.length || 0;
+ ...mapGetters(['tagWel', 'bsTagList', 'tag', 'setting']),
+ tagLen () {
+ return this.bsTagList.length || 0
},
},
methods: {
- openSearch() {
- this.$store.commit('SET_IS_SEARCH', true);
+ openSearch () {
+ this.$store.commit('SET_IS_SEARCH', true)
},
- handleRefresh() {
- this.refresh = true;
- this.$store.commit('SET_IS_REFRESH', false);
+ handleRefresh () {
+ this.refresh = true
+ this.$store.commit('SET_IS_REFRESH', false)
setTimeout(() => {
- this.$store.commit('SET_IS_REFRESH', true);
- }, 100);
+ this.$store.commit('SET_IS_REFRESH', true)
+ }, 100)
setTimeout(() => {
- this.refresh = false;
- }, 500);
+ this.refresh = false
+ }, 500)
},
- generateTitle(item) {
+ generateTitle (item) {
return this.$router.$avueRouter.generateTitle({
...item,
...{
label: item.name,
},
- });
+ })
},
- watchContextmenu(event) {
+ watchContextmenu (event) {
if (!this.$el.contains(event.target) || event.button !== 0) {
- this.contextmenuFlag = false;
+ this.contextmenuFlag = false
}
- window.removeEventListener('mousedown', this.watchContextmenu);
+ window.removeEventListener('mousedown', this.watchContextmenu)
},
- handleContextmenu(event) {
- let target = event.target;
- let flag = false;
- if (target.className.indexOf('el-tabs__item') > -1) flag = true;
+ handleContextmenu (event) {
+ let target = event.target
+ let flag = false
+ if (target.className.indexOf('el-tabs__item') > -1) flag = true
else if (target.parentNode.className.indexOf('el-tabs__item') > -1) {
- target = target.parentNode;
- flag = true;
+ target = target.parentNode
+ flag = true
}
if (flag) {
- event.preventDefault();
- event.stopPropagation();
- this.contentmenuX = event.clientX;
- this.contentmenuY = event.clientY;
- this.tagName = target.getAttribute('aria-controls').slice(5);
- this.contextmenuFlag = true;
+ event.preventDefault()
+ event.stopPropagation()
+ this.contentmenuX = event.clientX
+ this.contentmenuY = event.clientY
+ this.tagName = target.getAttribute('aria-controls').slice(5)
+ this.contextmenuFlag = true
}
},
- menuTag(value, action) {
+ menuTag (value, action) {
if (action === 'remove') {
- let { tag, key } = this.findTag(value);
- this.$store.commit('DEL_TAG', tag);
+ let { tag, key } = this.findTag(value)
+ this.$store.commit('DEL_TAG', tag)
if (tag.fullPath === this.tag.fullPath) {
- tag = this.tagList[key - 1];
+ tag = this.bsTagList[key - 1]
this.$router.push({
path: tag.path,
query: tag.query,
- });
+ })
}
}
},
- openTag(item) {
- let value = item.props.name;
- let { tag } = this.findTag(value);
+ openTag (item) {
+ let value = item.props.name
+ let { tag } = this.findTag(value)
this.$router.push({
path: tag.path,
query: tag.query,
- });
+ })
},
- findTag(fullPath) {
- let tag = this.tagList.find(item => item.fullPath === fullPath);
- let key = this.tagList.findIndex(item => item.fullPath === fullPath);
- return { tag, key };
+ findTag (fullPath) {
+ let tag = this.bsTagList.find(item => item.fullPath === fullPath)
+ let key = this.bsTagList.findIndex(item => item.fullPath === fullPath)
+ return { tag, key }
},
- closeOthersTags() {
- this.contextmenuFlag = false;
- this.$store.commit('DEL_TAG_OTHER');
+ closeOthersTags () {
+ this.contextmenuFlag = false
+ this.$store.commit('DEL_TAG_OTHER')
},
- closeAllTags() {
- this.contextmenuFlag = false;
- this.$store.commit('DEL_ALL_TAG');
- this.$router.push(this.tagWel);
+ closeAllTags () {
+ this.contextmenuFlag = false
+ this.$store.commit('DEL_ALL_TAG')
+ this.$router.push(this.tagWel)
},
- clearCacheTags() {
+ clearCacheTags () {
this.$confirm('是否需要清除缓存?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
clearCache().then(() => {
- this.contextmenuFlag = false;
- this.$message.success('清除完毕');
- });
- });
+ this.contextmenuFlag = false
+ this.$message.success('清除完毕')
+ })
+ })
},
},
-};
+}
</script>
diff --git a/src/page/index/top/index.vue b/src/page/index/top/index.vue
index 5f37bac..70679a8 100644
--- a/src/page/index/top/index.vue
+++ b/src/page/index/top/index.vue
@@ -49,17 +49,17 @@
</template>
<script>
-import { mapGetters } from 'vuex';
-import topLock from './top-lock.vue';
-import topMenu from './top-menu.vue';
-import topSearch from './top-search.vue';
-import topTheme from './top-theme.vue';
-import topLogs from './top-logs.vue';
-import topColor from './top-color.vue';
-import topLang from './top-lang.vue';
-import topFull from './top-full.vue';
-import topQna from './top-qna.vue';
-import topSetting from '../setting.vue';
+import { mapGetters } from 'vuex'
+import topLock from './top-lock.vue'
+import topMenu from './top-menu.vue'
+import topSearch from './top-search.vue'
+import topTheme from './top-theme.vue'
+import topLogs from './top-logs.vue'
+import topColor from './top-color.vue'
+import topLang from './top-lang.vue'
+import topFull from './top-full.vue'
+import topQna from './top-qna.vue'
+import topSetting from '../setting.vue'
export default {
components: {
@@ -75,17 +75,17 @@
topSetting,
},
name: 'top',
- data() {
- return {};
+ data () {
+ return {}
},
filters: {},
- created() {},
+ created () { },
computed: {
...mapGetters([
'setting',
'userInfo',
'tagWel',
- 'tagList',
+ 'bsTagList',
'isCollapse',
'tag',
'logsLen',
@@ -94,22 +94,22 @@
]),
},
methods: {
- setCollapse() {
- this.$store.commit('SET_COLLAPSE');
+ setCollapse () {
+ this.$store.commit('SET_COLLAPSE')
},
- logout() {
+ logout () {
this.$confirm(this.$t('logoutTip'), this.$t('tip'), {
confirmButtonText: this.$t('submitText'),
cancelButtonText: this.$t('cancelText'),
type: 'warning',
}).then(() => {
this.$store.dispatch('LogOut').then(() => {
- this.$router.push({ path: '/login' });
- });
- });
+ this.$router.push({ path: '/login' })
+ })
+ })
},
},
-};
+}
</script>
<style lang="scss" scoped>
diff --git a/src/page/index/top/top-menu.vue b/src/page/index/top/top-menu.vue
index bd351a6..708fa00 100644
--- a/src/page/index/top/top-menu.vue
+++ b/src/page/index/top/top-menu.vue
@@ -19,40 +19,40 @@
</template>
<script>
-import { mapGetters } from 'vuex';
+import { mapGetters } from 'vuex'
export default {
name: 'top-menu',
- data() {
+ data () {
return {
itemHome: {
- name: '首页',
- source: 'iconfont iconicon_work',
+ name: '个人工作台',
+ source: 'iconfont iconicon_boss',
},
activeIndex: '0',
items: [],
- };
+ }
},
inject: ['index'],
- created() {
- this.getMenu();
+ created () {
+ this.getMenu()
},
computed: {
...mapGetters(['tagCurrent', 'menu', 'tagWel']),
},
methods: {
- openMenu(item) {
- this.index.openMenu(item);
+ openMenu (item) {
+ this.index.openMenu(item)
},
- openHome(itemHome) {
- this.index.openMenu(itemHome);
- this.$router.push(this.tagWel);
+ openHome (itemHome) {
+ this.index.openMenu(itemHome)
+ this.$router.push(this.tagWel)
},
- getMenu() {
+ getMenu () {
this.$store.dispatch('GetTopMenu').then(res => {
- this.items = res;
- });
+ this.items = res
+ })
},
},
-};
+}
</script>
diff --git a/src/permission.js b/src/permission.js
index 6414b01..821f3dc 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -7,39 +7,39 @@
* @Description:
* Copyright (c) 2024 by GuLiMmo, All Rights Reserved.
*/
-import router from './router/';
-import store from './store';
-import { getToken } from '@/utils/auth';
+import router from './router/'
+import store from './store'
+import { getToken } from '@/utils/auth'
import { getUrlParams } from './utils/validate'
-import NProgress from 'nprogress'; // progress bar
-import 'nprogress/nprogress.css'; // progress bar style
-NProgress.configure({ showSpinner: false });
-const lockPage = '/lock'; //锁屏页
+import NProgress from 'nprogress' // progress bar
+import 'nprogress/nprogress.css' // progress bar style
+NProgress.configure({ showSpinner: false })
+const lockPage = '/lock' //锁屏页
const urlParams = getUrlParams(window.location.href)
router.beforeEach((to, from, next) => {
- const meta = to.meta || {};
- const isMenu = meta.menu === undefined ? to.query.menu : meta.menu;
- store.commit('SET_IS_MENU', isMenu === undefined);
+ const meta = to.meta || {}
+ const isMenu = meta.menu === undefined ? to.query.menu : meta.menu
+ store.commit('SET_IS_MENU', isMenu === undefined)
if (getToken()) {
if (store.getters.isLock && to.path !== lockPage) {
//如果系统激活锁屏,全部跳转到锁屏页
- next({ path: lockPage });
+ next({ path: lockPage })
} else if (to.path === '/login') {
//如果登录成功访问登录页跳转到主页
- next({ path: '/' });
+ next({ path: '/' })
} else {
const systemToken = store.getters.token || urlParams?.token
if (systemToken === 0) {
store.dispatch('FedLogOut').then(() => {
- next({ path: '/login' });
- });
+ next({ path: '/login' })
+ })
} else {
- const meta = to.meta || {};
- const query = to.query || {};
+ const meta = to.meta || {}
+ const query = to.query || {}
if (meta.target) {
- window.open(query.url.replace(/#/g, '&'));
- return;
+ window.open(query.url.replace(/#/g, '&'))
+ return
} else if (meta.isTab !== false) {
store.commit('ADD_TAG', {
name: query.name || to.name,
@@ -48,24 +48,24 @@
params: to.params,
query: to.query,
meta: meta,
- });
+ })
}
- next();
+ next()
}
}
} else {
//判断是否需要认证,没有登录访问去登录页
if (meta.isAuth === false) {
- next();
+ next()
} else {
- next('/login');
+ next('/login')
}
}
-});
+})
router.afterEach(to => {
- NProgress.done();
- let title = router.$avueRouter.generateTitle(to, { label: 'name' });
- router.$avueRouter.setTitle(title);
- store.commit('SET_IS_SEARCH', false);
-});
+ NProgress.done()
+ let title = router.$avueRouter.generateTitle(to, { label: 'name' })
+ router.$avueRouter.setTitle(title)
+ store.commit('SET_IS_SEARCH', false)
+})
diff --git a/src/router/avue-router.js b/src/router/avue-router.js
index 4797812..321dc20 100644
--- a/src/router/avue-router.js
+++ b/src/router/avue-router.js
@@ -1,53 +1,53 @@
-import website from '@/config/website';
+import website from '@/config/website'
-const modules = import.meta.glob('../**/**/*.vue');
+const modules = import.meta.glob('../**/**/*.vue')
-function isURL(s) {
- return /^http[s]?:\/\/.*/.test(s);
+function isURL (s) {
+ return /^http[s]?:\/\/.*/.test(s)
}
let RouterPlugin = function () {
- this.$router = null;
- this.$store = null;
-};
+ this.$router = null
+ this.$store = null
+}
RouterPlugin.install = function (option = {}) {
- this.$router = option.router;
- this.$store = option.store;
- let i18n = option.i18n.global;
+ this.$router = option.router
+ this.$store = option.store
+ let i18n = option.i18n.global
this.$router.$avueRouter = {
safe: this,
// 设置标题
setTitle: title => {
- const defaultTitle = i18n.t('title');
- title = title ? `${title} | ${defaultTitle}` : defaultTitle;
- document.title = title;
+ const defaultTitle = i18n.t('title')
+ title = title ? `${title} | ${defaultTitle}` : defaultTitle
+ document.title = title
},
closeTag: value => {
- let tag = value || this.$store.getters.tag;
+ let tag = value || this.$store.getters.tag
if (typeof value === 'string') {
- tag = this.$store.getters.tagList.find(ele => ele.fullPath === value);
+ tag = this.$store.getters.bsTagList.find(ele => ele.fullPath === value)
}
- this.$store.commit('DEL_TAG', tag);
+ this.$store.commit('DEL_TAG', tag)
},
generateTitle: (item, props = {}) => {
- let query = item[props.query || 'query'] || {};
- let title = query.name || item[props.label || 'label'];
- let meta = item[props.meta || 'meta'] || {};
- let key = meta.i18n;
+ let query = item[props.query || 'query'] || {}
+ let title = query.name || item[props.label || 'label']
+ let meta = item[props.meta || 'meta'] || {}
+ let key = meta.i18n
if (key) {
- const hasKey = i18n.te('route.' + key);
- if (hasKey) return i18n.t('route.' + key);
+ const hasKey = i18n.te('route.' + key)
+ if (hasKey) return i18n.t('route.' + key)
}
- return title ? title.split(',')[0] : title;
+ return title ? title.split(',')[0] : title
},
//动态路由
formatRoutes: function (aMenu = [], first) {
- const aRouter = [];
- const propsDefault = website.menu;
+ const aRouter = []
+ const propsDefault = website.menu
- if (aMenu && aMenu.length === 0) return;
+ if (aMenu && aMenu.length === 0) return
for (let i = 0; i < aMenu.length; i++) {
- const oMenu = aMenu[i];
+ const oMenu = aMenu[i]
let path = oMenu[propsDefault.path],
isComponent = true,
component = oMenu.component,
@@ -55,11 +55,11 @@
icon = oMenu[propsDefault.icon],
children = oMenu[propsDefault.children],
query = oMenu[propsDefault.query],
- meta = oMenu[propsDefault.meta];
+ meta = oMenu[propsDefault.meta]
if (option.keepAlive) {
- meta.keepAlive = option.keepAlive;
+ meta.keepAlive = option.keepAlive
}
- const isChild = !!(children && children.length !== 0);
+ const isChild = !!(children && children.length !== 0)
const oRouter = {
path: path,
component: (() => {
@@ -69,18 +69,18 @@
option.store.getters.isMacOs || !website.setting.menu
? '../page/index/layout.vue'
: '../page/index/index.vue'
- ];
+ ]
// 判断是否为多层路由
} else if (isChild && !first) {
- return modules['../page/index/layout.vue'];
+ return modules['../page/index/layout.vue']
// 判断是否为最终的页面视图
} else {
- let result = modules[`../${component}.vue`];
- if (result) result().then(mod => (mod.default.name = path));
+ let result = modules[`../${component}.vue`]
+ if (result) result().then(mod => (mod.default.name = path))
else {
- isComponent = false;
+ isComponent = false
}
- return result;
+ return result
}
})(),
name,
@@ -88,84 +88,84 @@
meta,
query,
redirect: (() => {
- if (!isChild && first) return `${path}`;
- else return '';
+ if (!isChild && first) return `${path}`
+ else return ''
})(),
// 处理是否为一级路由
children: !isChild
? (() => {
- if (first) {
- oMenu[propsDefault.path] = `${path}`;
- let result = modules[`../${component}.vue`];
- if (result) result().then(mod => (mod.default.name = path));
- else {
- isComponent = false;
- }
- return [
- {
- component: result,
- icon: icon,
- name: name,
- meta: meta,
- query: query,
- path: '',
- },
- ];
+ if (first) {
+ oMenu[propsDefault.path] = `${path}`
+ let result = modules[`../${component}.vue`]
+ if (result) result().then(mod => (mod.default.name = path))
+ else {
+ isComponent = false
}
- return [];
- })()
+ return [
+ {
+ component: result,
+ icon: icon,
+ name: name,
+ meta: meta,
+ query: query,
+ path: '',
+ },
+ ]
+ }
+ return []
+ })()
: (() => {
- return this.formatRoutes(children, false);
- })(),
- };
- if (!isURL(path) && isComponent) aRouter.push(oRouter);
+ return this.formatRoutes(children, false)
+ })(),
+ }
+ if (!isURL(path) && isComponent) aRouter.push(oRouter)
}
if (first) {
- aRouter.forEach(ele => this.safe.$router.addRoute(ele));
+ aRouter.forEach(ele => this.safe.$router.addRoute(ele))
} else {
- return aRouter;
+ return aRouter
}
},
- };
-};
+ }
+}
export const formatPath = (ele, first) => {
- const propsDefault = website.menu;
- const icon = ele[propsDefault.icon];
- ele[propsDefault.icon] = !icon ? propsDefault.iconDefault : icon;
+ const propsDefault = website.menu
+ const icon = ele[propsDefault.icon]
+ ele[propsDefault.icon] = !icon ? propsDefault.iconDefault : icon
ele.meta = {
keepAlive: ele.isOpen === 2,
- };
- const iframeComponent = 'components/iframe/main';
+ }
+ const iframeComponent = 'components/iframe/main'
const iframeSrc = href => {
- return href.replace(/&/g, '#');
- };
- const isChild = !!(ele[propsDefault.children] && ele[propsDefault.children].length !== 0);
+ return href.replace(/&/g, '#')
+ }
+ const isChild = !!(ele[propsDefault.children] && ele[propsDefault.children].length !== 0)
if (!isChild && first) {
- ele.component = 'views' + ele[propsDefault.path];
+ ele.component = 'views' + ele[propsDefault.path]
if (isURL(ele[propsDefault.href])) {
- let href = ele[propsDefault.href];
- ele.component = iframeComponent;
+ let href = ele[propsDefault.href]
+ ele.component = iframeComponent
ele[propsDefault.query] = {
url: iframeSrc(href),
- };
+ }
}
} else {
ele[propsDefault.children] &&
ele[propsDefault.children].forEach(child => {
- child.component = 'views' + child[propsDefault.path];
+ child.component = 'views' + child[propsDefault.path]
child.meta = {
keepAlive: child.isOpen === 2,
- };
+ }
if (isURL(child[propsDefault.href])) {
- let href = child[propsDefault.href];
- child[propsDefault.path] = ele[propsDefault.path] + '/' + child.code;
- child.component = iframeComponent;
+ let href = child[propsDefault.href]
+ child[propsDefault.path] = ele[propsDefault.path] + '/' + child.code
+ child.component = iframeComponent
child[propsDefault.query] = {
url: iframeSrc(href),
- };
+ }
}
- formatPath(child);
- });
+ formatPath(child)
+ })
}
-};
-export default RouterPlugin;
+}
+export default RouterPlugin
diff --git a/src/store/getters.js b/src/store/getters.js
index 4642172..991e813 100644
--- a/src/store/getters.js
+++ b/src/store/getters.js
@@ -24,13 +24,13 @@
isFullScren: state => state.common.isFullScren,
isMenu: state => state.common.isMenu,
lockPasswd: state => state.common.lockPasswd,
- tagList: state => state.tags.tagList,
+ bsTagList: state => state.tags.bsTagList,
tagsKeep: (state, getters) => {
- return getters.tagList
+ return getters.bsTagList
.filter(ele => {
- return (ele.meta || {}).keepAlive;
+ return (ele.meta || {}).keepAlive
})
- .map(ele => ele.fullPath);
+ .map(ele => ele.fullPath)
},
tagWel: state => state.tags.tagWel,
token: state => state.user.token,
@@ -46,5 +46,5 @@
flowRoutes: state => state.dict.flowRoutes,
devicesCmdExecuteInfo: state => state.device.devicesCmdExecuteInfo,
deviceState: state => state.device.deviceState,
-};
-export default getters;
+}
+export default getters
diff --git a/src/store/modules/tags.js b/src/store/modules/tags.js
index 1ec92a0..e606691 100644
--- a/src/store/modules/tags.js
+++ b/src/store/modules/tags.js
@@ -1,38 +1,38 @@
-import { setStore, getStore } from 'utils/store';
-import website from '@/config/website';
+import { setStore, getStore } from 'utils/store'
+import website from '@/config/website'
-const tagWel = website.fistPage;
+const tagWel = website.fistPage
const navs = {
state: {
- tagList: getStore({ name: 'tagList' }) || [],
+ bsTagList: getStore({ name: 'bsTagList' }) || [],
tag: getStore({ name: 'tag' }) || {},
tagWel: tagWel,
},
mutations: {
ADD_TAG: (state, action) => {
- if (typeof action.name == 'function') action.name = action.name(action.query);
- state.tag = action;
- setStore({ name: 'tag', content: state.tag });
- if (state.tagList.some(ele => ele.fullPath == action.fullPath)) return;
- state.tagList.push(action);
- setStore({ name: 'tagList', content: state.tagList });
+ if (typeof action.name == 'function') action.name = action.name(action.query)
+ state.tag = action
+ setStore({ name: 'tag', content: state.tag })
+ if (state.bsTagList.some(ele => ele.fullPath == action.fullPath)) return
+ state.bsTagList.push(action)
+ setStore({ name: 'bsTagList', content: state.bsTagList })
},
DEL_TAG: (state, action) => {
- state.tagList = state.tagList.filter(item => {
- return item.fullPath !== action.fullPath;
- });
- setStore({ name: 'tagList', content: state.tagList });
+ state.bsTagList = state.bsTagList.filter(item => {
+ return item.fullPath !== action.fullPath
+ })
+ setStore({ name: 'bsTagList', content: state.bsTagList })
},
- DEL_ALL_TAG: (state, tagList = []) => {
- state.tagList = tagList;
- setStore({ name: 'tagList', content: state.tagList });
+ DEL_ALL_TAG: (state, bsTagList = []) => {
+ state.bsTagList = bsTagList
+ setStore({ name: 'bsTagList', content: state.bsTagList })
},
DEL_TAG_OTHER: state => {
- state.tagList = state.tagList.filter(item => {
- return [state.tag.fullPath, website.fistPage.path].includes(item.fullPath);
- });
- setStore({ name: 'tagList', content: state.tagList });
+ state.bsTagList = state.bsTagList.filter(item => {
+ return [state.tag.fullPath, website.fistPage.path].includes(item.fullPath)
+ })
+ setStore({ name: 'bsTagList', content: state.bsTagList })
},
},
-};
-export default navs;
+}
+export default navs
diff --git a/src/views/tickets/ticket.vue b/src/views/tickets/ticket.vue
index e3b0b52..d2a0003 100644
--- a/src/views/tickets/ticket.vue
+++ b/src/views/tickets/ticket.vue
@@ -276,7 +276,7 @@
</el-table>
<!-- 事件处理详情 -->
- <div v-if="[3, 4, 5].includes(currentDetail.status)" class="form-section">
+ <div v-if="[3, 4].includes(currentDetail.status)" class="form-section">
<div class="section-title">
<!-- 处理中状态显示必填星号 -->
<template v-if="currentDetail.status === 3">
@@ -409,10 +409,6 @@
<!-- <el-button v-if="hasProcessedAndOverBtnPermission()" type="primary" :loading="finalizeLoading"
@click="finalizeTicket">完结工单</el-button> -->
<el-button @click="detailVisible = false">取消</el-button>
- </template>
- <template v-else-if="currentDetail.status === 5">
- <!-- 已完结 -->
- <el-button @click="detailVisible = false">关闭</el-button>
</template>
</div>
</div>
@@ -696,7 +692,7 @@
handler: [{ required: true, message: '请选择处理人', trigger: 'change' }],
}, // 新增:派发表单验证规则
stepInfos: [], // 新增:存储步骤信息
- fixedStatuses: ['2', '0', '3', '4', '5'], // 固定的五个状态
+ fixedStatuses: ['2', '0', '3', '4'], // 固定的五个状态
userNameToIdMap: {}, // 新增用户名到ID的映射
workType: 0, // 新增:当前工单work_type
selections: [], // 添加选中行数据数组
@@ -937,17 +933,19 @@
// “我发起的工单”tab用默认流程,其它tab用接口返回的stepInfos
if (this.activeTab === 'myTickets') {
if (this.workType === 1) {
- return ['3', '4', '5']
+ return ['3', '4']
}
return this.fixedStatuses
}
+
+
// 其它tab直接用接口返回的stepInfos
return this.stepInfos.map(step => String(step.status))
},
showIsReviewText () {
return row => {
- if (['4', '5'].includes(String(row.status))) return row.isReview === 1 ? '是' : '否'
+ if (['4'].includes(String(row.status))) return row.isReview === 1 ? '是' : '否'
return '/'
}
@@ -1502,7 +1500,7 @@
create_time: step.create_time,
}))
} else {
- const statusArr = this.workType === 1 ? ['3', '4', '5'] : this.fixedStatuses
+ const statusArr = this.workType === 1 ? ['3', '4'] : this.fixedStatuses
this.stepInfos = statusArr.map(status => {
const step = steps.find(s => String(s.status) === String(status))
return {
@@ -1516,7 +1514,7 @@
this.currentDetail.status = row.status
} catch (error) {
if (this.activeTab === 'myTickets') {
- const statusArr = this.workType === 1 ? ['3', '4', '5'] : this.fixedStatuses
+ const statusArr = this.workType === 1 ? ['3', '4'] : this.fixedStatuses
this.stepInfos = statusArr.map(status => ({
status,
name: status === row.status ? row.handler || '未分配' : '未处理',
--
Gitblit v1.9.3