| | |
| | | const iconCount = iconList.value.length; |
| | | return iconList.value[index % iconCount]; |
| | | }; |
| | | const getMainSectionList = () => { |
| | | const getMainSectionList = (val) => { |
| | | let result = []; |
| | | console.log('🚀 ~ sceneGroupList.value:', sceneGroupList.value); |
| | | sceneGroupList.value.forEach((sectionItem, index) => { |
| | | sectionItem.Icon = getIconByIndex(index); |
| | | if (activeGroupType.value == sectionItem.group_type) { |
| | | if (val == sectionItem.group_type) { |
| | | result.push(sectionItem); |
| | | } |
| | | }); |
| | | state.applicationScenarios = result; |
| | | console.log("🚀 ~ 主场景处理后的数据源:", result) |
| | | sectionAList.value = sceneGroupList.value; |
| | | result?.[0] && changeScenarios(result[0]); |
| | | }; |
| | |
| | | } |
| | | return groups; |
| | | }); |
| | | |
| | | watch( |
| | | () => activeGroupType.value, |
| | | () => { |
| | | getMainSectionList(); |
| | | (val) => { |
| | | getMainSectionList(val); |
| | | }, |
| | | { immediate: true } |
| | | ); |