| | |
| | | }; |
| | | const getSelectListSample = async (res1, res2) => { |
| | | try { |
| | | const samples = res1?.samples ?? []; |
| | | const templateSamples = (res2?.templates ?? []).map((item) => ({ |
| | | const samples = res1?.value?.samples ?? []; |
| | | const templateSamples = (res2?.value?.templates ?? []).map((item) => ({ |
| | | group_id: item.template_group, |
| | | sample_id: item.template_id, |
| | | sample_title: item.template_title, |
| | |
| | | * 获取全局所有数据 |
| | | */ |
| | | export const getAllData = async () => { |
| | | Promise.all([getSectionList(), getSelectSample({}), getUserTemplateList()]) |
| | | Promise.allSettled([getSectionList(), getSelectSample({}), getUserTemplateList()]) |
| | | .then((res) => { |
| | | let [sectionList, selectSample, userTemplateList] = res; |
| | | sceneGroupList.value = sectionList?.groups ?? []; |
| | | sceneGroupList.value = sectionList?.value?.groups ?? []; |
| | | getSelectListSample(selectSample, userTemplateList); |
| | | }) |
| | | .catch((err) => {}); |