community-survey-sys项目
ShareQuestionnaireModal.vue:
async queryShareScope () { let releaseSet = getReleaseSet({ wjId: this.wjId }) let dictList = queryWjDictList({ type: 'PLATFORM' }) // let appId = getAppid({code: 'share'}) await Promise.all([releaseSet, dictList]).then(([releaseRes, dictListRes]) => { let platformList = [] let dictList = [] if (releaseRes.data.code === '0') { platformList = releaseRes.data.data.platformList // platformList = [ // { // createTime: 1952001, // id: 2, // platformCode: 'scpg', // status: 1, // updateTime: 1952001, // wjId: 132006 // }] console.log('platformList', platformList) } else { this.showToast(releaseRes.data.message) return } if (dictListRes.data.code === '0') { dictList = dictListRes.data.data.dictList } else { this.showToast(dictListRes.data.message) return } this.shareList = platformList.map(item => { let name = '' // dictList = [{code: 1, name: '印力', value: 'scpg'}] dictList.forEach(subitem => { if (subitem.value === item.platformCode) { name = subitem.name } }) return {appName: name, platformCode: item.platformCode} }) this.shareList.map((item, index) => { if (item.appName === '印力') { this.shareList.splice(index, 1) } }) // if (appIdRes.data.code === '0') { // this.appId = appIdRes.data.data.list // } else { // // this.showToast(appIdRes.data.message) // 这里总是-1,影响界面,先关掉提示 // } // this.appId.map((item, index) => { // this.shareList.push({appName: item.val, platformCode: 'scpg', appId: item.appId}) // }) console.log('dictList', dictList) console.log('shareList', this.shareList) // this.toggleTab(0) }) getAppid({code: 'share'}).then(appIdRes => { if (appIdRes.data.code === '0') { this.appId = appIdRes.data.data.list } else { // this.showToast(appIdRes.data.message) // 这里总是-1,影响界面,先关掉提示 } this.appId.map((item, index) => { this.shareList.push({appName: item.val, platformCode: 'scpg', appId: item.appId}) }) }).catch(err => { console.log('err:', err) }) this.toggleTab(0) },