Commit 2c9fa1df by liimin

fixed bug

1 parent 1e375067
...@@ -6,6 +6,7 @@ $private-left-side-color:#652DED; ...@@ -6,6 +6,7 @@ $private-left-side-color:#652DED;
$private-menu-active-background-color:#521ADA; $private-menu-active-background-color:#521ADA;
$private-item-hover:rgba(#000,.05); $private-item-hover:rgba(#000,.05);
$private-menu-text-color:#C4D0DF; $private-menu-text-color:#C4D0DF;
$active-i-color:rgb(9, 234, 9);
// 主题背景颜色 // 主题背景颜色
...@@ -62,13 +63,13 @@ $theme-aside-item-color: $private-menu-text-color; ...@@ -62,13 +63,13 @@ $theme-aside-item-color: $private-menu-text-color;
$theme-aside-item-background-color: transparent; $theme-aside-item-background-color: transparent;
// 侧边栏上的项目在 hover 时 // 侧边栏上的项目在 hover 时
$theme-aside-item-color-hover: #FFF; $theme-aside-item-color-hover: #FFF;
$theme-aside-item-background-color-hover: $private-item-hover; $theme-aside-item-background-color-hover: rgba($private-menu-active-background-color, .15);
// 侧边栏上的项目在 focus 时 // 侧边栏上的项目在 focus 时
$theme-aside-item-color-focus: #FFF; $theme-aside-item-color-focus: #FFF;
$theme-aside-item-background-color-focus: rgba($private-menu-active-background-color, 1); $theme-aside-item-background-color-focus: rgba($private-menu-active-background-color, .15);
// 侧边栏上的项目在 active 时 // 侧边栏上的项目在 active 时
$theme-aside-item-color-active: #FFF; $theme-aside-item-color-active: #FFF;
$theme-aside-item-background-color-active: rgba($private-menu-active-background-color, 1); $theme-aside-item-background-color-active: rgba($private-menu-active-background-color, .15);
// 侧边栏菜单为空的时候显示的元素 // 侧边栏菜单为空的时候显示的元素
$theme-aside-menu-empty-icon-color: #1F3147; $theme-aside-menu-empty-icon-color: #1F3147;
......
...@@ -4,6 +4,7 @@ $private-left-side-color:#2A58AD; ...@@ -4,6 +4,7 @@ $private-left-side-color:#2A58AD;
$private-menu-active-background-color:#154190; $private-menu-active-background-color:#154190;
$private-item-hover:rgba(#000,.05); $private-item-hover:rgba(#000,.05);
$private-menu-text-color:#C4D0DF; $private-menu-text-color:#C4D0DF;
$active-i-color:rgb(9, 234, 9);
// 主题背景颜色 // 主题背景颜色
$theme-bg-color: $private-left-side-color; $theme-bg-color: $private-left-side-color;
...@@ -62,13 +63,13 @@ $theme-aside-item-color: $private-menu-text-color; ...@@ -62,13 +63,13 @@ $theme-aside-item-color: $private-menu-text-color;
$theme-aside-item-background-color: transparent; $theme-aside-item-background-color: transparent;
// 侧边栏上的项目在 hover 时 // 侧边栏上的项目在 hover 时
$theme-aside-item-color-hover: #FFF; $theme-aside-item-color-hover: #FFF;
$theme-aside-item-background-color-hover: $private-item-hover; $theme-aside-item-background-color-hover: rgba($private-menu-active-background-color, .15);
// 侧边栏上的项目在 focus 时 // 侧边栏上的项目在 focus 时
$theme-aside-item-color-focus: #FFF; $theme-aside-item-color-focus: #FFF;
$theme-aside-item-background-color-focus: rgba($private-menu-active-background-color, 1); $theme-aside-item-background-color-focus: rgba($private-menu-active-background-color, .15);
// 侧边栏上的项目在 active 时 // 侧边栏上的项目在 active 时
$theme-aside-item-color-active: #FFF; $theme-aside-item-color-active: #FFF;
$theme-aside-item-background-color-active: rgba($private-menu-active-background-color, 1); $theme-aside-item-background-color-active: rgba($private-menu-active-background-color, .15);
// 侧边栏菜单为空的时候显示的元素 // 侧边栏菜单为空的时候显示的元素
$theme-aside-menu-empty-icon-color: #1F3147; $theme-aside-menu-empty-icon-color: #1F3147;
......
...@@ -4,6 +4,7 @@ $private-left-side-color:#314256; ...@@ -4,6 +4,7 @@ $private-left-side-color:#314256;
$private-menu-active-background-color:#1F3147; $private-menu-active-background-color:#1F3147;
$private-item-hover:rgba(#000,.05); $private-item-hover:rgba(#000,.05);
$private-menu-text-color:#C4D0DF; $private-menu-text-color:#C4D0DF;
$active-i-color:rgb(9, 234, 9);
// 主题背景颜色 // 主题背景颜色
$theme-bg-color: $private-left-side-color; $theme-bg-color: $private-left-side-color;
...@@ -58,13 +59,13 @@ $theme-aside-item-color: $private-menu-text-color; ...@@ -58,13 +59,13 @@ $theme-aside-item-color: $private-menu-text-color;
$theme-aside-item-background-color: transparent; $theme-aside-item-background-color: transparent;
// 侧边栏上的项目在 hover 时 // 侧边栏上的项目在 hover 时
$theme-aside-item-color-hover: #FFF; $theme-aside-item-color-hover: #FFF;
$theme-aside-item-background-color-hover: $private-item-hover; $theme-aside-item-background-color-hover: rgba($private-menu-active-background-color, .15);
// 侧边栏上的项目在 focus 时 // 侧边栏上的项目在 focus 时
$theme-aside-item-color-focus: #FFF; $theme-aside-item-color-focus: #FFF;
$theme-aside-item-background-color-focus: rgba($private-menu-active-background-color, 1); $theme-aside-item-background-color-focus: rgba($private-menu-active-background-color, .15);
// 侧边栏上的项目在 active 时 // 侧边栏上的项目在 active 时
$theme-aside-item-color-active: #FFF; $theme-aside-item-color-active: #FFF;
$theme-aside-item-background-color-active: rgba($private-menu-active-background-color, 1); $theme-aside-item-background-color-active: rgba($private-menu-active-background-color, .15);
// 侧边栏菜单为空的时候显示的元素 // 侧边栏菜单为空的时候显示的元素
$theme-aside-menu-empty-icon-color: #1F3147; $theme-aside-menu-empty-icon-color: #1F3147;
......
...@@ -6,7 +6,7 @@ $private-left-side-color:transparent; ...@@ -6,7 +6,7 @@ $private-left-side-color:transparent;
$private-menu-active-background-color:#002253; $private-menu-active-background-color:#002253;
$private-item-hover:rgba(#000,.05); $private-item-hover:rgba(#000,.05);
$private-menu-text-color:#C4D0DF; $private-menu-text-color:#C4D0DF;
$active-i-color:rgb(9, 234, 9);
// 主题背景颜色 // 主题背景颜色
$theme-bg-color: $private-left-side-color; $theme-bg-color: $private-left-side-color;
...@@ -61,13 +61,13 @@ $theme-aside-item-color: $private-menu-text-color; ...@@ -61,13 +61,13 @@ $theme-aside-item-color: $private-menu-text-color;
$theme-aside-item-background-color: transparent; $theme-aside-item-background-color: transparent;
// 侧边栏上的项目在 hover 时 // 侧边栏上的项目在 hover 时
$theme-aside-item-color-hover: #FFF; $theme-aside-item-color-hover: #FFF;
$theme-aside-item-background-color-hover: $private-item-hover; $theme-aside-item-background-color-hover: rgba($private-menu-active-background-color, .15);
// 侧边栏上的项目在 focus 时 // 侧边栏上的项目在 focus 时
$theme-aside-item-color-focus: #FFF; $theme-aside-item-color-focus: #FFF;
$theme-aside-item-background-color-focus: rgba($private-menu-active-background-color, 1); $theme-aside-item-background-color-focus: rgba($private-menu-active-background-color, .15);
// 侧边栏上的项目在 active 时 // 侧边栏上的项目在 active 时
$theme-aside-item-color-active: #FFF; $theme-aside-item-color-active: #FFF;
$theme-aside-item-background-color-active: rgba($private-menu-active-background-color, 1); $theme-aside-item-background-color-active: rgba($private-menu-active-background-color, .15);
// 侧边栏菜单为空的时候显示的元素 // 侧边栏菜单为空的时候显示的元素
$theme-aside-menu-empty-icon-color: #1F3147; $theme-aside-menu-empty-icon-color: #1F3147;
......
...@@ -206,9 +206,9 @@ ...@@ -206,9 +206,9 @@
} }
} }
ul.el-menu--inline{ ul.el-menu--inline{
background: rgba(#000, .08); background: rgba(#000, .03);
border-top: 1px solid rgba(#FFF, .08); border-top: 1px solid rgba(#FFF, .03);
border-bottom: 1px solid rgba(#FFF, .08); border-bottom: 1px solid rgba(#FFF, .03);
} }
} }
// 菜单为空的时候显示的信息 // 菜单为空的时候显示的信息
......
...@@ -199,7 +199,7 @@ ...@@ -199,7 +199,7 @@
fill: $theme-aside-item-color-hover; fill: $theme-aside-item-color-hover;
background: $theme-aside-item-background-color-hover; background: $theme-aside-item-background-color-hover;
i { i {
color: $theme-aside-item-color-hover; color: $active-i-color;
} }
} }
&:focus { &:focus {
...@@ -215,16 +215,16 @@ ...@@ -215,16 +215,16 @@
fill: $theme-aside-item-color-active; fill: $theme-aside-item-color-active;
background: $theme-aside-item-background-color-active; background: $theme-aside-item-background-color-active;
i { i {
color: $theme-aside-item-color-active; color: $active-i-color;
}
}
&:nth-child(1).is-active {
color: $theme-aside-item-color-active;
background: $theme-aside-item-background-color;
i {
color: $theme-aside-item-color-active;
} }
} }
// &:nth-child(1).is-active {
// color: $theme-aside-item-color-active;
// background: $theme-aside-item-background-color;
// i {
// color: $active-i-color;
// }
// }
} }
} }
.el-submenu { .el-submenu {
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
color: $theme-aside-item-color-hover; color: $theme-aside-item-color-hover;
background: $theme-aside-item-background-color-hover; background: $theme-aside-item-background-color-hover;
i { i {
color: $theme-aside-item-color-hover; color: $active-i-color;
} }
.el-submenu__icon-arrow { .el-submenu__icon-arrow {
color: $theme-aside-item-color-hover; color: $theme-aside-item-color-hover;
...@@ -278,11 +278,20 @@ ...@@ -278,11 +278,20 @@
display: none; display: none;
} }
} }
} &.is-active {
.el-tabs__item.is-active { color: $theme-multiple-page-control-color-active;
color: $theme-multiple-page-control-color-active; background-color: $theme-multiple-page-control-background-color-active;
background-color: $theme-multiple-page-control-background-color-active; border-bottom-color: $theme-multiple-page-control-border-color-active;
border-bottom-color: $theme-multiple-page-control-border-color-active; i{
color:$active-i-color
}
}
&:hover{
color: $theme-multiple-page-control-color-active;
i{
color:$active-i-color
}
}
} }
} }
%el-tabs__nav { %el-tabs__nav {
......
...@@ -110,25 +110,8 @@ export default { ...@@ -110,25 +110,8 @@ export default {
* @description 登出 * @description 登出
*/ */
async logOut() { async logOut() {
// this.$store.commit('d2admin/gray/set', true)
// MessageBox.confirm('确定要退出当前帐号吗', '退出', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// })
// .then(async() => {
// await this.$store.commit('d2admin/gray/set', false)
// await this.$store.dispatch('d2admin/user/set', {})
await this.logout() await this.logout()
await this.$store.commit('d2admin/page/setCurrent', '') this.$router.replace('/login')
this.$router.push('/login')
// })
// .catch(() => {
// this.$store.commit('d2admin/gray/set', false)
// // Message({
// // message: '取消注销操作'
// // })
// })
}, },
clear() { clear() {
this.$store.commit('d2admin/gray/set', true) this.$store.commit('d2admin/gray/set', true)
...@@ -142,10 +125,22 @@ export default { ...@@ -142,10 +125,22 @@ export default {
} }
) )
.then(async() => { .then(async() => {
await this.$store.commit('d2admin/gray/set', false) const reload = () => {
// await this.$store.commit('d2admin/page/setCurrent', '') localStorage.clear()
localStorage.clear() this.$store.commit('d2admin/gray/set', false)
window.location.reload() window.location.reload()
}
if (this.$router.currentRoute.name === 'index') {
reload()
} else {
this.$router.push({ name: 'index' })
var _t = setInterval(() => {
if (this.$router.currentRoute.name === 'index') {
clearInterval(_t)
reload()
}
}, 0)
}
}) })
.catch(() => { .catch(() => {
this.$store.commit('d2admin/gray/set', false) this.$store.commit('d2admin/gray/set', false)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: limin * @Author: limin
* @Date: 2019-08-27 19:16:26 * @Date: 2019-08-27 19:16:26
* @Last Modified by: limin * @Last Modified by: limin
* @Last Modified time: 2019-09-16 14:13:22 * @Last Modified time: 2019-09-17 17:20:53
*/ */
const permision = {} const permision = {}
/** /**
...@@ -51,35 +51,7 @@ permision.packAsideMenus = function(resources, idsInPermision) { ...@@ -51,35 +51,7 @@ permision.packAsideMenus = function(resources, idsInPermision) {
if (!resources || !idsInPermision || !idsInPermision.length) { if (!resources || !idsInPermision || !idsInPermision.length) {
throw new Error('参数错误') throw new Error('参数错误')
} }
const __aMenusInPermision = [] return _loop(idsInPermision, obj => permision.format2Menu(resources[obj.authId]))
const __aSub = []
/**
* 第一次循环 分出一级菜单与所有子菜单
*/
idsInPermision.forEach(obj => {
const __oMenu = permision.format2Menu(resources[obj.authId])
if (!__oMenu) { // 不存在 可能是 按钮 直接继续循环
return true
}
if ((obj.parentId + '') === '0') { // 取出1级菜单
__aMenusInPermision.push(__oMenu)
} else { // 取出子菜单
__aSub.push(__oMenu)
}
})
/**
* 第二次循环所有子菜单 ,然后挂载到对应的一级菜单
*/
let __parent = null
__aSub.forEach(obj => {
__parent = __aMenusInPermision.find(menu => +menu.authId === +obj.parentId)
if (__parent.children) {
__parent.children.push(obj)
} else {
__parent.children = [obj]
}
})
return __aMenusInPermision
} }
/** /**
...@@ -91,36 +63,42 @@ permision.packMenusBtns = function(resources) { ...@@ -91,36 +63,42 @@ permision.packMenusBtns = function(resources) {
if (!resources) { if (!resources) {
throw new Error('参数错误') throw new Error('参数错误')
} }
const menus = _loop(resources, obj => permision.format2ResourceMenu(obj))
return { menus, all: [] }
}
const _loop = function(res, fnGetMenu) {
const __aParent = [] const __aParent = []
const __aSub = [] const __aSub = []
const __aAll = []
/** /**
* 第一次循环 分出一级菜单与所有子菜单 * 第一次循环 分出一级菜单与所有子菜单
*/ */
resources.forEach(obj => { res.forEach(obj => {
const __oMenu = permision.format2ResourceMenu(obj) const __oMenu = fnGetMenu(obj)
if (!__oMenu) { // 不存在 可能是 按钮 直接继续循环 if (!__oMenu) { // 不存在 可能是 按钮 直接继续循环
return true return true
} }
if (__oMenu.parentId === '0') { // 取出1级菜单 if (+(__oMenu.parentId) === 0) { // 取出1级菜单
__aParent.push(__oMenu) __aParent.push(__oMenu)
} else { // 取出子菜单 } else { // 取出子菜单
__aSub.push(__oMenu) __aSub.push(__oMenu)
} }
}) })
/** /**
* 第二次循环所有子菜单 ,然后挂载到对应的一级菜单 * 第二次循环所有子菜单 ,然后挂载到对应的一级菜单
*/ */
let __parent = null let __parent = null
__aSub.forEach(obj => { __aSub.forEach(obj => {
__parent = __aParent.find(menu => menu.authId === obj.parentId) __parent = __aParent.find(menu => +(menu.authId) === +(obj.parentId))
if (__parent.children) { if (__parent) {
__parent.children.push(obj) if (__parent.children) {
} else { __parent.children.push(obj)
__parent.children = [obj] } else {
__parent.children = [obj]
}
} }
}) })
return { menus: __aParent, all: __aAll } return __aParent
} }
/** /**
......
...@@ -42,6 +42,7 @@ router.beforeEach(async(to, from, next) => { ...@@ -42,6 +42,7 @@ router.beforeEach(async(to, from, next) => {
await store.dispatch('d2admin/size/isLoaded') await store.dispatch('d2admin/size/isLoaded')
// 设置当前页 下次登录 默认打开此页面 // 设置当前页 下次登录 默认打开此页面
await setCurrent(to.fullPath) await setCurrent(to.fullPath)
// console.log(await store.dispatch('d2admin/menu/has', to.fullPath))
// 进度条 // 进度条
NProgress.start() NProgress.start()
// 关闭搜索面板 // 关闭搜索面板
...@@ -75,4 +76,8 @@ router.afterEach(to => { ...@@ -75,4 +76,8 @@ router.afterEach(to => {
store.dispatch('d2admin/auth/setCurrentPageMeta', to.meta) store.dispatch('d2admin/auth/setCurrentPageMeta', to.meta)
}) })
export const ResetRouter = () => new VueRouter({
routes
})
export default router export default router
...@@ -33,6 +33,8 @@ export default { ...@@ -33,6 +33,8 @@ export default {
await dispatch('d2admin/user/set', data, { root: true }) await dispatch('d2admin/user/set', data, { root: true })
// // 强制初始化基础数据 // // 强制初始化基础数据
dispatch('d2admin/base/init', null, { root: true }) dispatch('d2admin/base/init', null, { root: true })
// 初始化权限
await dispatch('d2admin/auth/init', null, { root: true })
// // 用户登录后从持久化数据加载一系列的设置 // // 用户登录后从持久化数据加载一系列的设置
await dispatch('load') await dispatch('load')
// 结束 // 结束
...@@ -58,9 +60,8 @@ export default { ...@@ -58,9 +60,8 @@ export default {
util.cookies.remove('token') util.cookies.remove('token')
util.cookies.remove('uuid') util.cookies.remove('uuid')
await dispatch('d2admin/user/clear', null, { root: true }) await dispatch('d2admin/user/clear', null, { root: true })
// 清空 vuex 用户信息 await commit('d2admin/page/setCurrent', null, { root: true })
// await dispatch('d2admin/user/clear', null, { root: true }) await commit('d2admin/auth/set', null, { root: true })
// 跳转路由
resolve() resolve()
}) })
}, },
......
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,12 @@
* @Author: limin * @Author: limin
* @Date: 2019-08-27 17:25:12 * @Date: 2019-08-27 17:25:12
* @Last Modified by: limin * @Last Modified by: limin
* @Last Modified time: 2019-09-14 17:28:39 * @Last Modified time: 2019-09-17 20:19:57
*/ */
import util from '@/libs/util.js' import util from '@/libs/util.js'
import router from '@/router' import router, { ResetRouter } from '@/router'
import { localRoutes, frameInRoutes, sys } from '@/router/routes' import { localRoutes, frameInRoutes, sys } from '@/router/routes'
export default { export default {
namespaced: true, namespaced: true,
state: { state: {
...@@ -127,6 +128,7 @@ export default { ...@@ -127,6 +128,7 @@ export default {
return new Promise(async resolve => { return new Promise(async resolve => {
try { try {
const { route, btn } = util.permision.packRoutesBtns(localRoutes, source) const { route, btn } = util.permision.packRoutesBtns(localRoutes, source)
router.matcher = ResetRouter().matcher // 重置基础路由 解决切换用户 保留上一个用户路由问题
frameInRoutes[0].children = [...route, ...sys] frameInRoutes[0].children = [...route, ...sys]
router.addRoutes(frameInRoutes) router.addRoutes(frameInRoutes)
state.btns = btn state.btns = btn
......
...@@ -82,6 +82,17 @@ export default { ...@@ -82,6 +82,17 @@ export default {
// end // end
resolve() resolve()
}) })
},
has({ state, dispatch }, path) {
return new Promise(async resolve => {
const _in = state.aside.some(obj => {
if (obj.children) {
return obj.path === path || obj.children.some(child => child.path === path)
}
return obj.path === path
})
resolve(_in)
})
} }
}, },
mutations: { mutations: {
......
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
// 尝试在所有的支持多标签页的页面里找到 name 匹配的页面 // 尝试在所有的支持多标签页的页面里找到 name 匹配的页面
const find = state.pool.find(item => { const find = state.pool.find(item => {
return ( return (
item.name === opened.name && item.path === opened.path &&
__oSource.some(obj => +obj.authId === +item.meta.authId) __oSource.some(obj => +obj.authId === +item.meta.authId)
) )
}) })
...@@ -129,15 +129,15 @@ export default { ...@@ -129,15 +129,15 @@ export default {
*/ */
openedUpdate( openedUpdate(
{ state, commit, dispatch }, { state, commit, dispatch },
{ index, params, query, fullPath } { page, params, query, fullPath }
) { ) {
return new Promise(async resolve => { return new Promise(async resolve => {
// 更新页面列表某一项 // 更新页面列表某一项
const page = state.opened[index] // const page = state.opened[index]
page.params = params || page.params page.params = params || page.params
page.query = query || page.query page.query = query || page.query
page.fullPath = fullPath || page.fullPath page.fullPath = fullPath || page.fullPath
state.opened.splice(index, 1, page) // state.opened.splice(index, 1, page)
// 持久化 // 持久化
await dispatch('opend2db') await dispatch('opend2db')
// end // end
...@@ -181,16 +181,16 @@ export default { ...@@ -181,16 +181,16 @@ export default {
// 已经打开的页面 // 已经打开的页面
const opened = state.opened const opened = state.opened
// 判断此页面是否已经打开 并且记录位置 // 判断此页面是否已经打开 并且记录位置
let pageOpendIndex = 0 // let pageOpendIndex = 0
const pageOpend = opened.find((page, index) => { const page = opened.find((page, index) => {
const same = page.fullPath === fullPath const same = page.fullPath === fullPath
pageOpendIndex = same ? index : pageOpendIndex // pageOpendIndex = same ? index : pageOpendIndex
return same return same
}) })
if (pageOpend) { if (page) {
// 页面以前打开过 // 页面以前打开过
await dispatch('openedUpdate', { await dispatch('openedUpdate', {
index: pageOpendIndex, page,
params, params,
query, query,
fullPath fullPath
...@@ -437,7 +437,10 @@ export default { ...@@ -437,7 +437,10 @@ export default {
}, },
{ root: true } { root: true }
) )
resolve(_current) const _in = await dispatch('d2admin/menu/has', _current, {
root: true
})
resolve(_in ? _current : INDEX_PATH)
}) })
}, },
/** /**
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<el-input <el-input
v-model="editForm.deviceNum" maxlength="16" v-model="editForm.deviceNum" maxlength="16"
:show-word-limit="true" placeholder="请输入物料代码" clearable :show-word-limit="true" placeholder="请输入物料代码" clearable
@change="editForm.deviceNum=editForm.deviceNum.toUpperCase()"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
......
...@@ -219,15 +219,15 @@ export default { ...@@ -219,15 +219,15 @@ export default {
prop: 'subsystemCode' prop: 'subsystemCode'
}, { }, {
label: '子系统类型', label: '子系统类型',
prop: 'subsystemType', prop: 'subsystemType'
formatter: (cellValue) => { // formatter: (cellValue) => {
if (cellValue.subsystemType) { // if (cellValue.subsystemType) {
return { // return {
1: '座椅', // 1: '座椅',
2: '电池' // 2: '电池'
}[cellValue.subsystemType] // }[cellValue.subsystemType]
} // }
} // }
}, { }, {
label: '故障类型', label: '故障类型',
prop: 'downType', prop: 'downType',
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
:show-word-limit="true" :show-word-limit="true"
placeholder="请输入子系统编号" placeholder="请输入子系统编号"
clearable clearable
@change="editForm.subsystemCode=editForm.subsystemCode.toUpperCase()"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
...@@ -95,7 +96,7 @@ export default { ...@@ -95,7 +96,7 @@ export default {
rules: { rules: {
subsystemCode: [ subsystemCode: [
{ required: true, message: '请输入子系统编号', trigger: 'blur' }, { required: true, message: '请输入子系统编号', trigger: 'blur' },
{ required: true, message: '子系统编号需输入14位数字或大写字母', trigger: 'change', validator: this.isNumOrString }, { required: true, message: '子系统编号需输入14位数字或大写字母', trigger: 'blur', validator: this.isNumOrString },
{ required: true, message: '子系统编号已存在', trigger: 'blur', validator: this.isCodeExist } { required: true, message: '子系统编号已存在', trigger: 'blur', validator: this.isCodeExist }
], ],
trafficCode: [ trafficCode: [
...@@ -151,7 +152,6 @@ export default { ...@@ -151,7 +152,6 @@ export default {
}, },
async isTrafficCodeExist(rule, value, callback) { async isTrafficCodeExist(rule, value, callback) {
console.log(value)
if (!this.editForm.id) { if (!this.editForm.id) {
const res = await isTrafficExistApi({ trafficCode: value }) const res = await isTrafficExistApi({ trafficCode: value })
res.trafficCode ? callback() : callback(new Error(rule.message)) res.trafficCode ? callback() : callback(new Error(rule.message))
......
...@@ -6,7 +6,13 @@ ...@@ -6,7 +6,13 @@
</el-button> </el-button>
</div> </div>
</template> </template>
<script>
export default {
mounted() {
this.$store.commit('d2admin/page/setCurrent', '')
}
}
</script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page { .page {
background: #303133; background: #303133;
......
...@@ -148,7 +148,7 @@ export default { ...@@ -148,7 +148,7 @@ export default {
// 注意 这里的演示没有传验证码 // 注意 这里的演示没有传验证码
// 具体需要传递的数据请自行修改代码 // 具体需要传递的数据请自行修改代码
this.login(_p) this.login(_p)
.then(() => this.$store.dispatch('d2admin/auth/init')) // .then(() => this.$store.dispatch('d2admin/auth/init'))
.then(async _ => { .then(async _ => {
const _current = await this.current() const _current = await this.current()
this.$router.replace(this.$route.query.redirect || _current) this.$router.replace(this.$route.query.redirect || _current)
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button> <el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<d2-table-header title="车辆状态列表"><auth-button category="Button"></auth-button></d2-table-header> <d2-table-header title="子系统状态列表"><auth-button category="Button"></auth-button></d2-table-header>
<el-table <el-table
:data="tableData" :data="tableData"
v-loading="$store.state.d2admin.loading.value" v-loading="$store.state.d2admin.loading.value"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!