|
|
@@ -18,8 +18,8 @@
|
|
|
</div>
|
|
|
<div class="menu-btn" v-for="(item, index) in menuData" :key="index" :class="[activeIndex == index ? 'active' : '']" @click="menuClickFn(item, index)">
|
|
|
<!-- <div class="iconfont-blo">
|
|
|
- <i class="iconfont iconcaidanlan"></i>
|
|
|
- </div>
|
|
|
+ <i class="iconfont iconcaidanlan"></i>
|
|
|
+ </div>
|
|
|
<span>{{ item.name }}</span>-->
|
|
|
|
|
|
<operate-line-module :show="operateShow[index]" :data="item" @click="operateClickFn" @add="operateAddFn(index)" @del="operateDelFn" />
|
|
|
@@ -147,28 +147,17 @@
|
|
|
this.operateShow[index] = true;
|
|
|
this.operateData = item.children || [];
|
|
|
// 修改
|
|
|
- this.dialogData = item;
|
|
|
+ // this.dialogData = item;
|
|
|
this.form.name = JSON.parse(JSON.stringify(item.name));
|
|
|
|
|
|
this.addDialog = true;
|
|
|
},
|
|
|
// operate
|
|
|
- closeOptionFn() {
|
|
|
- this.closeOperate()
|
|
|
- this.resetForm()
|
|
|
- },
|
|
|
- closeOperate() {
|
|
|
- this.activeIndex = null;
|
|
|
- this.operateShow = this.operateShow.map(e => (e = false));
|
|
|
- // if (this.addDialog) {
|
|
|
- // this.resetForm();
|
|
|
- // }
|
|
|
- },
|
|
|
operateClickFn(item) {
|
|
|
this.isModifyParents = false;
|
|
|
this.isAdd = false;
|
|
|
console.log('item', item);
|
|
|
- this.dialogData = item;
|
|
|
+ // this.dialogData = item;
|
|
|
item.targetId = item.targetId ? parseInt(item.targetId) : 0;
|
|
|
|
|
|
Object.keys(this.form).forEach(i => {
|
|
|
@@ -193,14 +182,26 @@
|
|
|
this.$set(this.operateShow, this.activeIndex, true);
|
|
|
});
|
|
|
},
|
|
|
+ closeOperate() {
|
|
|
+ this.activeIndex = null;
|
|
|
+ this.operateShow = this.operateShow.map(e => (e = false));
|
|
|
+ // if (this.addDialog) {
|
|
|
+ // this.resetForm();
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ closeOptionFn() {
|
|
|
+ this.closeOperate()
|
|
|
+ this.resetForm()
|
|
|
+ },
|
|
|
// modal
|
|
|
confirmForm() {
|
|
|
let form = JSON.parse(JSON.stringify(this.form));
|
|
|
|
|
|
if (this.isModifyParents) {
|
|
|
- console.log('this.menuData[this.activeIndex]', this.menuData[this.activeIndex])
|
|
|
+ // 如果是父菜单操作时
|
|
|
this.menuData[this.activeIndex].name = form.name
|
|
|
} else {
|
|
|
+ // 如果是子菜单操作时
|
|
|
if (this.isAdd) {
|
|
|
this.operateData.push(form);
|
|
|
} else {
|