|
|
@ -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); // 多场联动,只要有一个被选中就禁止 |
|
|
|