Browse Source

change linkage methods

organize
刘嘉炜 3 years ago
parent
commit
6e196aeb98
  1. 11
      src/pages/site/manage/manage.vue

11
src/pages/site/manage/manage.vue

@ -383,6 +383,8 @@ export default {
venueList: _venueList, venueList: _venueList,
selectedKey: '_isSelect', selectedKey: '_isSelect',
linkageKey: 'isLinkage', linkageKey: 'isLinkage',
linkageIDArrKey: 'link_venue_ids',
linkageIDKey: 'venue_id',
}) })
this.venueList = _venueList; this.venueList = _venueList;
this.$nextTick(_=>{ this.$nextTick(_=>{
@ -401,13 +403,15 @@ export default {
venueList = [], // venueList = [], //
selectedKey = 'selectedKey', // key selectedKey = 'selectedKey', // key
linkageKey = 'linkageKey', // key linkageKey = 'linkageKey', // key
linkageIDArrKey = 'link_venue_ids',
linkageIDKey = 'venue_id',
curTag curTag
}){ }){
let _curGroupInfo = {...venueList[group]}; let _curGroupInfo = {...venueList[group]};
for(let i=0; i<venueList.length; i++){ for(let i=0; i<venueList.length; i++){
let _link_venue_ids = _curGroupInfo.link_venue_ids || [];
let _link_venue_ids = _curGroupInfo[linkageIDArrKey] || [];
if(_link_venue_ids.includes(venueList[i].venue_id)){
if(_link_venue_ids.includes(venueList[i][linkageIDKey])){
_curGroupInfo.items.forEach(ele=>{ _curGroupInfo.items.forEach(ele=>{
// //
if(venueList[i].link_venue_ids && venueList[i].link_venue_ids.length == 1){ if(venueList[i].link_venue_ids && venueList[i].link_venue_ids.length == 1){
@ -415,14 +419,13 @@ export default {
} }
// //
if(venueList[i].link_venue_ids && venueList[i].link_venue_ids.length > 1){ if(venueList[i].link_venue_ids && venueList[i].link_venue_ids.length > 1){
let _link_venueLs = venueList.filter(item=> venueList[i].link_venue_ids.includes(item.venue_id));
let _link_venueLs = venueList.filter(item=> venueList[i].link_venue_ids.includes(item[linkageIDKey]));
// ex: [ true, false ]; // ex: [ true, false ];
let _link_venueLs_selectedLs = _link_venueLs.map(el=> el['items'][ele._defineIndex] && el['items'][ele._defineIndex][selectedKey]); let _link_venueLs_selectedLs = _link_venueLs.map(el=> el['items'][ele._defineIndex] && el['items'][ele._defineIndex][selectedKey]);
venueList[i].items[ele._defineIndex][linkageKey] = _link_venueLs_selectedLs.includes(true); // venueList[i].items[ele._defineIndex][linkageKey] = _link_venueLs_selectedLs.includes(true); //
} }
}); });
} }
} }
return venueList || []; return venueList || [];
}, },

Loading…
Cancel
Save