BUG修改

This commit is contained in:
a0049873 2022-07-28 17:12:30 +08:00
parent e47d7cf470
commit fc524a6b43
2 changed files with 46 additions and 25 deletions

View File

@ -5,10 +5,9 @@ import { isURL } from '@/utils/validate'
import store from '@/store' import store from '@/store'
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题 // 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = Router.prototype.push const originalPush = Router.prototype.push
Router.prototype.push = function push(location) { Router.prototype.push = function push (location) {
return originalPush.call(this, location).catch(err => err) return originalPush.call(this, location).catch(err => err)
} }
@ -42,7 +41,8 @@ export const moduleRoutes = {
meta: { title: '主入口布局' }, meta: { title: '主入口布局' },
children: [ children: [
// todos 临时调整,后期去掉 // todos 临时调整,后期去掉
{ path: '/home', redirect: '/bscatalogue-bscatalogue', component: () => import('@/views/modules/home'), name: 'home', meta: { title: '首页', isTab: true } }, // { path: '/home', redirect: '/bscatalogue-bscatalogue', component: () => import('@/views/modules/home'), name: 'home', meta: { title: '首页', isTab: true } },
{ path: '/home', redirect: '/workBench-workBench', component: () => import('@/views/modules/home'), name: 'home', meta: { title: '首页', isTab: true } },
{ path: '/iframe', component: null, name: 'iframe', meta: { title: 'iframe', isTab: true } } { path: '/iframe', component: null, name: 'iframe', meta: { title: 'iframe', isTab: true } }
] ]
} }

View File

@ -56,6 +56,7 @@ import { isEmail, isMobile } from '@/utils/validate'
export default { export default {
data () { data () {
return { return {
submitFlag: true,
visible: false, visible: false,
roleList: [], roleList: [],
roleIdListDefault: [], roleIdListDefault: [],
@ -170,6 +171,22 @@ export default {
]).then(() => { ]).then(() => {
if (this.dataForm.id) { if (this.dataForm.id) {
this.getInfo() this.getInfo()
} else {
this.dataForm = {
id: '',
username: '',
deptId: '',
deptName: '',
password: '',
confirmPassword: '',
realName: '',
gender: 0,
email: '',
mobile: '',
roleIdList: [],
postIdList: [],
status: 1
}
} }
}) })
}) })
@ -219,6 +236,8 @@ export default {
if (!valid) { if (!valid) {
return false return false
} }
if (this.submitFlag) {
this.submitFlag = false
this.dataForm.password = Encrypt(this.dataForm.password) this.dataForm.password = Encrypt(this.dataForm.password)
if (this.dataForm.id) { if (this.dataForm.id) {
delete this.dataForm.password delete this.dataForm.password
@ -242,7 +261,9 @@ export default {
this.$emit('refreshDataList') this.$emit('refreshDataList')
} }
}) })
this.submitFlag = true
}).catch(() => {}) }).catch(() => {})
}
}) })
}, 1000, { leading: true, trailing: false }) }, 1000, { leading: true, trailing: false })
} }