|
@@ -14,6 +14,9 @@ import {
|
|
|
updateOption
|
|
|
} from '@/api/survey/option'
|
|
|
import {
|
|
|
+ getDetail as getSurveyDetail
|
|
|
+} from '@/api/survey/survey'
|
|
|
+import {
|
|
|
QUESTION_TYPE_OPTIONS,
|
|
|
QUESTION_REQUIRED_OPTIONS,
|
|
|
QUESTION_TYPE,
|
|
@@ -63,6 +66,11 @@ export default {
|
|
|
|
|
|
data() {
|
|
|
return {
|
|
|
+ // 问卷信息
|
|
|
+ surveyInfo: {
|
|
|
+ surveyCode: '',
|
|
|
+ title: ''
|
|
|
+ },
|
|
|
/**
|
|
|
* 题目列表
|
|
|
* @type {Array<QuestionItem>}
|
|
@@ -255,6 +263,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
mounted() {
|
|
|
+ this.loadSurveyInfo()
|
|
|
this.loadQuestionList()
|
|
|
},
|
|
|
|
|
@@ -490,6 +499,30 @@ export default {
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
+ * 加载问卷信息
|
|
|
+ */
|
|
|
+ async loadSurveyInfo() {
|
|
|
+ try {
|
|
|
+ this.loading = true
|
|
|
+ const response = await getSurveyDetail(this.surveyId)
|
|
|
+ if (response.data.success) {
|
|
|
+ const surveyData = response.data.data
|
|
|
+ this.surveyInfo = {
|
|
|
+ surveyCode: surveyData.surveyCode || '',
|
|
|
+ title: surveyData.title || ''
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$message.error(response.data.msg || '获取问卷信息失败')
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('加载问卷信息失败:', error)
|
|
|
+ this.$message.error('获取问卷信息失败')
|
|
|
+ } finally {
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
* 重置题目表单
|
|
|
* @returns {void}
|
|
|
*/
|