|
@@ -4,7 +4,7 @@
|
|
|
:show-close="false"
|
|
|
:close-on-click-modal="false"
|
|
|
:visible.sync="isShow"
|
|
|
- :title="this.curObj && this.curObj.id ? '编辑菜单' : '添加菜单'"
|
|
|
+ :title="this.curType === 'edit' ? '编辑菜单' : '添加菜单'"
|
|
|
:fullscreen="false"
|
|
|
width="470px"
|
|
|
custom-class="xl-dialog"
|
|
@@ -21,7 +21,8 @@
|
|
|
export default {
|
|
|
props: {
|
|
|
isShow: Boolean,
|
|
|
- curObj: Object
|
|
|
+ curObj: Object,
|
|
|
+ curType: String,
|
|
|
},
|
|
|
mixins,
|
|
|
data() {
|
|
@@ -34,6 +35,8 @@ export default {
|
|
|
isShow: function(val) {
|
|
|
if (val) {
|
|
|
let params = {...this.curObj}
|
|
|
+ if (this.curType === 'edit') params = {...this.curObj}
|
|
|
+ if (this.curType === 'add') params = {}
|
|
|
this.formData = [
|
|
|
{label: '菜单名称', key: 'name', rules: 1},
|
|
|
{label: '类型', key: 'perm_type', type: 'select', options: this.$dictData.perm_type, rules: 1},
|
|
@@ -52,7 +55,8 @@ export default {
|
|
|
const oldform = this.$refs.ruleForm.baseForm
|
|
|
let params = {...oldform}
|
|
|
let str = 'admpermissionsadd'
|
|
|
- if(this.curObj && this.curObj.id) {
|
|
|
+ params.p_id = this.curObj.p_id
|
|
|
+ if(this.curType === 'edit') {
|
|
|
params.dict_id = this.curObj.id
|
|
|
str = 'admpermissionsedit'
|
|
|
}
|