Browse Source

fix checkLinkageVenue

organize
刘嘉炜 3 years ago
parent
commit
3ce2b0ec28
  1. 44
      src/pages/site/manage/manage.vue

44
src/pages/site/manage/manage.vue

@ -398,19 +398,52 @@ export default {
},
// &
// checkLinkageVenue({
// group = 0, //
// venueList = [], //
// selectedKey = 'selectedKey', // key
// linkageKey = 'linkageKey', // key
// linkageIDArrKey = 'link_venue_ids',
// linkageIDKey = 'venue_id',
// curTag
// }){
// let _curGroupInfo = {...venueList[group]};
// for(let i=0; i<venueList.length; i++){
// let _link_venue_ids = _curGroupInfo[linkageIDArrKey] || [];
// if(_link_venue_ids.includes(venueList[i][linkageIDKey])){
// _curGroupInfo.items.forEach(ele=>{
// //
// if(venueList[i].link_venue_ids && venueList[i].link_venue_ids.length == 1){
// venueList[i].items[ele._defineIndex][linkageKey] = !!_curGroupInfo.items[ele._defineIndex][selectedKey];
// }
// //
// 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[linkageIDKey]));
// // ex: [ true, false ];
// 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); //
// }
// });
// }
// }
// return venueList || [];
// },
// &
checkLinkageVenue({
group = 0, //
venueList = [], //
selectedKey = 'selectedKey', // key
linkageKey = 'linkageKey', // key
linkageIDArrKey = 'link_venue_ids',
linkageIDKey = 'venue_id',
linkageIDArrKey = 'link_venue_ids', //
linkageIDKey = 'venue_id', // id
curTag
}){
let _curGroupInfo = {...venueList[group]};
for(let i=0; i<venueList.length; i++){
let _link_venue_ids = _curGroupInfo[linkageIDArrKey] || [];
// id
_link_venue_ids = _link_venue_ids.filter(ele=>_curGroupInfo[linkageIDKey] !=ele);
if(_link_venue_ids.includes(venueList[i][linkageIDKey])){
_curGroupInfo.items.forEach(ele=>{
//
@ -419,7 +452,10 @@ export default {
}
//
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[linkageIDKey]));
// id bug
let _linkVenueIds = venueList[i].link_venue_ids.filter(e=>e !=venueList[i][linkageIDKey]);
//
let _link_venueLs = venueList.filter(item=> _linkVenueIds.includes(item[linkageIDKey]));
// ex: [ true, false ];
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); //

Loading…
Cancel
Save