diff --git a/web/package.json b/web/package.json index 1b879af2..c2a6226b 100644 --- a/web/package.json +++ b/web/package.json @@ -38,6 +38,7 @@ "@rushstack/eslint-patch": "^1.10.2", "@tsconfig/node20": "^20.1.2", "@types/node": "^20.11.19", + "@types/qrcode": "^1.5.5", "@vitejs/plugin-vue": "^5.0.3", "@vitejs/plugin-vue-jsx": "^3.1.0", "@vue/eslint-config-prettier": "^8.0.0", diff --git a/web/src/management/components/LeftMenu.vue b/web/src/management/components/LeftMenu.vue index 4c861ef0..12bb3b52 100644 --- a/web/src/management/components/LeftMenu.vue +++ b/web/src/management/components/LeftMenu.vue @@ -25,7 +25,7 @@ const tabs = [ text: '投放问卷', icon: 'icon-toufang', to: { - name: 'publishResultPage' + name: 'publish' } }, { diff --git a/web/src/management/pages/edit/modules/contentModule/PublishPanel.vue b/web/src/management/pages/edit/modules/contentModule/PublishPanel.vue index 2560b018..b78638c5 100644 --- a/web/src/management/pages/edit/modules/contentModule/PublishPanel.vue +++ b/web/src/management/pages/edit/modules/contentModule/PublishPanel.vue @@ -53,9 +53,7 @@ export default { if (publishRes.code === 200) { ElMessage.success('发布成功') this.$store.dispatch('edit/getSchemaFromRemote') - this.$router.push({ - name: 'publishResultPage' - }) + this.$router.push({ name: 'publish' }) } else { ElMessage.error(`发布失败 ${publishRes.errmsg}`) } diff --git a/web/src/management/pages/list/components/ToolBar.vue b/web/src/management/pages/list/components/ToolBar.vue index 95f4f336..0247c38e 100644 --- a/web/src/management/pages/list/components/ToolBar.vue +++ b/web/src/management/pages/list/components/ToolBar.vue @@ -48,7 +48,7 @@ export default { return case 'release': this.$router.push({ - name: 'publishResultPage', + name: 'publish', params: { id: this.data._id } diff --git a/web/src/management/pages/publishResult/PublishResultPage.vue b/web/src/management/pages/publish/PublishPage.vue similarity index 64% rename from web/src/management/pages/publishResult/PublishResultPage.vue rename to web/src/management/pages/publish/PublishPage.vue index c7e48f5e..4cd31798 100644 --- a/web/src/management/pages/publishResult/PublishResultPage.vue +++ b/web/src/management/pages/publish/PublishPage.vue @@ -3,7 +3,7 @@
- +
- - +const store = useStore() +const metaData = computed(() => _get(store.state, 'edit.schema.metaData')) +const curStatus = computed(() => _get(metaData.value, 'curStatus.status', 'new')) +const mainChannel = computed(() => { + let fullUrl = '' + + if (metaData.value) { + fullUrl = `${location.origin}/render/${metaData.value.surveyPath}` + } + + return { fullUrl } +}) + +const route = useRoute() +const router = useRouter() +onMounted(async () => { + store.commit('edit/setSurveyId', route.params.id) + + try { + await store.dispatch('edit/init') + } catch (err: any) { + ElMessage.error(err.message) + setTimeout(() => { + router.replace({ name: 'survey' }) + }, 1000) + } +}) +