|
@@ -45,7 +45,12 @@
|
|
...mapState({
|
|
...mapState({
|
|
checkMap: state => state.creatingSituations.checkMap,
|
|
checkMap: state => state.creatingSituations.checkMap,
|
|
condition: state => state.creatingSituations.condition,
|
|
condition: state => state.creatingSituations.condition,
|
|
- })
|
|
|
|
|
|
+ }),
|
|
|
|
+ isDisabled: function() {
|
|
|
|
+ return function(id) {
|
|
|
|
+ return this.checkMap.list.find((item)=>item.id === id);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
created:function(){
|
|
created:function(){
|
|
if(this.checkMap.deptList.length === 0) {
|
|
if(this.checkMap.deptList.length === 0) {
|
|
@@ -58,6 +63,7 @@
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
changeChecked: function(id) {
|
|
changeChecked: function(id) {
|
|
|
|
+ if(this.isDisabled(id)) return;
|
|
this.checkedIds = arrFilter(id, this.checkedIds);
|
|
this.checkedIds = arrFilter(id, this.checkedIds);
|
|
},
|
|
},
|
|
btnClick: function(id) {
|
|
btnClick: function(id) {
|
|
@@ -66,20 +72,35 @@
|
|
if(data) {
|
|
if(data) {
|
|
const {list, actionItem} = this.checkMap;
|
|
const {list, actionItem} = this.checkMap;
|
|
let arr = [...this.checkMap.list];
|
|
let arr = [...this.checkMap.list];
|
|
- data = data.map((item)=>{
|
|
|
|
- return {
|
|
|
|
- ...item,
|
|
|
|
- status: 'add'
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ let _data = this.checkDep(data);
|
|
let index = list.findIndex(({id})=> id === actionItem.id);
|
|
let index = list.findIndex(({id})=> id === actionItem.id);
|
|
- arr.splice(index + 1, 0, ...data);
|
|
|
|
|
|
+ arr.splice(index + 1, 0, ..._data);
|
|
this.myCommit('list', arr);
|
|
this.myCommit('list', arr);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
this.commit('showCheckMapAdd', false);
|
|
this.commit('showCheckMapAdd', false);
|
|
},
|
|
},
|
|
|
|
+ checkDep: function(list) {
|
|
|
|
+ return list.map((item, i)=>{
|
|
|
|
+ return {
|
|
|
|
+ ...item,
|
|
|
|
+ status: 'add',
|
|
|
|
+ pointList: (item.pointList || []).map((ptem)=>{
|
|
|
|
+ return {
|
|
|
|
+ ...ptem,
|
|
|
|
+ selectFlag: true,
|
|
|
|
+ itemList: (ptem.itemList || []).map((ntem)=>{
|
|
|
|
+ return {
|
|
|
|
+ ...ntem,
|
|
|
|
+ selectFlag: true
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
/**
|
|
/**
|
|
* 更新condition数据
|
|
* 更新condition数据
|
|
* @param {Object} key 要更新的属性
|
|
* @param {Object} key 要更新的属性
|