|
|
@@ -56,6 +56,7 @@ export default {
|
|
|
children: 'children',
|
|
|
label: 'name'
|
|
|
},
|
|
|
+ type: null,
|
|
|
|
|
|
// 表格列配置
|
|
|
columns: [
|
|
|
@@ -65,7 +66,7 @@ export default {
|
|
|
width: 45,
|
|
|
align: 'center',
|
|
|
selectable: (row, index) => {
|
|
|
- return !this.processData.some((it) => it.id == row.id );
|
|
|
+ return !this.processData.some((it) => it.id == row.id || it.categoryId == row.id);
|
|
|
},
|
|
|
reserveSelection: true,
|
|
|
fixed: 'left'
|
|
|
@@ -152,7 +153,8 @@ export default {
|
|
|
return res;
|
|
|
},
|
|
|
|
|
|
- open(item, row) {
|
|
|
+ open(item, row, type) {
|
|
|
+ this.type = type
|
|
|
this.processData = item || []
|
|
|
this.current = row;
|
|
|
this.visible = true
|
|
|
@@ -215,7 +217,18 @@ export default {
|
|
|
this.$message.error('请至少选择一条数据');
|
|
|
return;
|
|
|
}
|
|
|
- this.$emit('chooseModal', this.selection, this.current)
|
|
|
+ if (this.type == 'add') {
|
|
|
+ let _arr = []
|
|
|
+ _arr = this.selection.map(m => {
|
|
|
+ m.categoryId = m.id
|
|
|
+ delete m.id
|
|
|
+ return {
|
|
|
+ ...m
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$emit('chooseModal', _arr, this.current)
|
|
|
this.handleClose()
|
|
|
},
|
|
|
}
|