Commit 0d2c2d2b by 胡悦

修复bug

1 parent a843814a
......@@ -185,8 +185,8 @@ export default {
{ label: '字典标签:', prop: 'dictLabel', type: 'input', maxlength: 20 },
{ label: '字典键值:', prop: 'dictValue', type: 'input', maxlength: 50 },
{ label: '字典排序:', prop: 'dictSort', type: 'input', maxlength: 5 },
{ label: '状态', prop: 'enableStatus', type: 'switch' },
{ label: '备注', prop: 'remark', type: 'input', inputText: 'textarea', maxlength: 200, showWordLimit: true }
{ label: '状态:', prop: 'enableStatus', type: 'switch' },
{ label: '备注:', prop: 'remark', type: 'input', inputText: 'textarea', maxlength: 200, showWordLimit: true }
],
dictDataRules: {
dictType: [{ required: true }],
......@@ -199,32 +199,32 @@ export default {
}
},
mounted() {
let params = this.$route.params;
if((JSON.stringify(params) === '{}' || !params)) {
params = this.getInitStorage();
this.storageParams = params;
let params = this.$route.params
if ((JSON.stringify(params) === '{}' || !params)) {
params = this.getInitStorage()
this.storageParams = params
}
if(params) {
if (params) {
this.searchForm.name = params.row.dictName
this.dictDataForm.dictType = params.row.dictType
this.dictDataForm.enableStatus = params.row.enableStatus
// this.dictDataForm.dictType = params.row.dictType
// this.dictDataForm.enableStatus = params.row.enableStatus == 1
}
},
methods: {
getInitStorage() {
const getStorageParams = localStorage.getItem('dictionaryParams');
if(getStorageParams) {
return JSON.parse(getStorageParams);
const getStorageParams = localStorage.getItem('dictionaryParams')
if (getStorageParams) {
return JSON.parse(getStorageParams)
} else {
return '';
return ''
}
},
// 重置搜索条件
refresh() {
let name = '';
if(this.$route.params.row) {
if (this.$route.params.row) {
name = this.$route.params.row.dictName;
} else if(this.storageParams.row) {
} else if (this.storageParams.row) {
name = this.storageParams.row.dictName;
}
this.searchForm = {
......@@ -233,11 +233,11 @@ export default {
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
let getDictType = '';
let getDictType = '';
setTimeout(() => {
if(this.$route.params.row) {
if (this.$route.params.row) {
getDictType = this.$route.params.row.dictType;
} else if(this.storageParams.row) {
} else if (this.storageParams.row) {
getDictType = this.storageParams.row.dictType;
}
......@@ -299,6 +299,11 @@ export default {
switch (pType) {
case 'create':
this.dictDataDialogTitle = '新增字典'
const params = this.getInitStorage()
this.dictDataForm = {
dictType: params.row.dictType,
enableStatus: params.row.enableStatus == 1
}
this.handleClose()
break
case 'edit':
......
......@@ -181,9 +181,9 @@ export default {
},
dictionaryData: [
{ label: '字典名称:', prop: 'dictName', type: 'input', maxlength: 20 },
{ label: '字典类型', prop: 'dictType', type: 'input', maxlength: 50, readonly: false },
{ label: '状态', prop: 'enableStatus', type: 'switch' },
{ label: '备注', prop: 'remark', type: 'input', inputText: 'textarea', maxlength: 200, showWordLimit: true }
{ label: '字典类型:', prop: 'dictType', type: 'input', maxlength: 50, readonly: false },
{ label: '状态:', prop: 'enableStatus', type: 'switch' },
{ label: '备注:', prop: 'remark', type: 'input', inputText: 'textarea', maxlength: 200, showWordLimit: true }
],
dictionaryRules: {
dictName: [{ required: true, message: '请输入字典名称', trigger: blur }],
......
......@@ -219,14 +219,14 @@ export default {
enableStatus: true
},
menuData: [
{ label: '菜单类型', prop: 'type', type: 'radio', children: this.$Constants.MENU_TYPE, disabled: false },
{ label: '上级菜单', prop: 'parentName', type: 'input', readonly: true, clickFunc: this.selectSuperior, hidden: true },
{ label: '菜单名称', prop: 'menuName', type: 'input', maxlength: 20 },
{ label: '权限标识', prop: 'permissionTag', type: 'input' },
{ label: '前端路由', prop: 'frontRoute', type: 'input' },
{ label: '显示排序', prop: 'orderNum', type: 'input', maxlength: 5 },
{ label: '显示状态', prop: 'enableStatus', type: 'switch' },
{ label: '图标', prop: 'icon', type: 'input', hidden: false }
{ label: '菜单类型:', prop: 'type', type: 'radio', children: this.$Constants.MENU_TYPE, disabled: false },
{ label: '上级菜单:', prop: 'parentName', type: 'input', readonly: true, clickFunc: this.selectSuperior, hidden: true },
{ label: '菜单名称:', prop: 'menuName', type: 'input', maxlength: 20 },
{ label: '权限标识:', prop: 'permissionTag', type: 'input' },
{ label: '前端路由:', prop: 'frontRoute', type: 'input' },
{ label: '显示排序:', prop: 'orderNum', type: 'input', maxlength: 5 },
{ label: '显示状态:', prop: 'enableStatus', type: 'switch' },
{ label: '图标:', prop: 'icon', type: 'input', hidden: false }
],
menuRules: {
type: [{ required: true, message: '请选择菜单类型', trigger: 'blur' }],
......
......@@ -183,10 +183,10 @@ export default {
enableStatus: true
},
orginizaData: [
{ label: '上级组织', prop: 'superiorName', type: 'input', hidden: false, readonly: true },
{ label: '组织名称', prop: 'departmentName', type: 'input', maxlength: 20 },
{ label: '显示排序', prop: 'orderNum', type: 'input', maxlength: 5 },
{ label: '组织状态', prop: 'enableStatus', type: 'switch' }
{ label: '上级组织:', prop: 'superiorName', type: 'input', hidden: false, readonly: true },
{ label: '组织名称:', prop: 'departmentName', type: 'input', maxlength: 20 },
{ label: '显示排序:', prop: 'orderNum', type: 'input', maxlength: 5 },
{ label: '组织状态:', prop: 'enableStatus', type: 'switch' }
],
orginizaRules: {
departmentName: [{ required: true, message: '请输入组织名称', trigger: 'blur' }],
......@@ -196,7 +196,6 @@ export default {
},
// 部门弹窗
isRoot: false
}
},
watch: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!