|
@@ -144,7 +144,10 @@
|
|
|
</div>
|
|
|
</li>
|
|
|
</ul>
|
|
|
- <el-empty :image-size="200" v-if="dataList.length === 0"></el-empty>
|
|
|
+ <el-empty
|
|
|
+ :image-size="200"
|
|
|
+ v-if="dataList.length === 0"
|
|
|
+ ></el-empty>
|
|
|
<div class="my-paging" v-if="dataList.length">
|
|
|
<Paging
|
|
|
v-if="paging.total"
|
|
@@ -155,7 +158,7 @@
|
|
|
</div>
|
|
|
<!-- 问卷调查 -->
|
|
|
<div class="satisfaction" v-show="activityType === 'satisfaction'">
|
|
|
- <div class="s-title">{{entity.name}}</div>
|
|
|
+ <div class="s-title">{{ entity.name }}</div>
|
|
|
<div class="s-des">
|
|
|
为了更好地发挥大理市博物馆在宣传展示和社会服务方面的作用,我们希望能够通过您对这些问题的回答,提高我们的工作质量,我们会认真考虑您的意见和建议。非常感谢您对我们工作的配合和支持!
|
|
|
</div>
|
|
@@ -174,9 +177,11 @@
|
|
|
<ul class="q-answer">
|
|
|
<!-- 单选 -->
|
|
|
<div class="single" v-if="item.type === 'radio'">
|
|
|
- <li v-for="(choose, optionIndex) in item.answer"
|
|
|
- :key="optionIndex">
|
|
|
- <!-- :id="`${question.id}`" -->
|
|
|
+ <li
|
|
|
+ v-for="(choose, optionIndex) in item.answer"
|
|
|
+ :key="optionIndex"
|
|
|
+ >
|
|
|
+ <!-- :id="`${question.id}`" -->
|
|
|
<a>
|
|
|
<input
|
|
|
type="radio"
|
|
@@ -193,7 +198,7 @@
|
|
|
v-for="(choose, optionIndex) in item.answer"
|
|
|
:key="optionIndex"
|
|
|
>
|
|
|
- <!-- :id="`${question.id}`" -->
|
|
|
+ <!-- :id="`${question.id}`" -->
|
|
|
<a>
|
|
|
<input
|
|
|
type="checkbox"
|
|
@@ -247,7 +252,7 @@ export default {
|
|
|
typeChange: {
|
|
|
onLine: "online",
|
|
|
volunteer: "volunteer",
|
|
|
- satisfaction:'satisfaction'
|
|
|
+ satisfaction: "satisfaction",
|
|
|
},
|
|
|
questionnaireList: [
|
|
|
{
|
|
@@ -366,8 +371,8 @@ export default {
|
|
|
name: "",
|
|
|
phone: "",
|
|
|
questionComplete: false,
|
|
|
- entity:{},
|
|
|
- question:[]
|
|
|
+ entity: {},
|
|
|
+ question: [],
|
|
|
};
|
|
|
},
|
|
|
//监听属性 类似于data概念
|
|
@@ -389,19 +394,23 @@ export default {
|
|
|
});
|
|
|
this.dataList = result.data.list;
|
|
|
this.paging.total = result.data.total;
|
|
|
- console.log('this.dataList',this.dataList)
|
|
|
+ console.log("this.dataList", this.dataList);
|
|
|
},
|
|
|
async getQuestion() {
|
|
|
let result = await this.$http({
|
|
|
method: "get",
|
|
|
- url: "/api/web/questionGroup/getIndex"
|
|
|
+ url: "/api/web/questionGroup/getIndex",
|
|
|
+ });
|
|
|
+ console.log("result", result);
|
|
|
+ this.entity = result && result["data"] && result["data"]["entity"];
|
|
|
+ this.question = result && result["data"] && result["data"]["question"];
|
|
|
+ this.question = this.question.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ answer: JSON.parse(item.answer),
|
|
|
+ Answer: item.type === "multiple" ? [] : "",
|
|
|
+ };
|
|
|
});
|
|
|
- console.log('result',result)
|
|
|
- this.entity = result && result['data'] && result['data']['entity'];
|
|
|
- this.question = result && result['data'] && result['data']['question'];
|
|
|
- this.question = this.question.map(item=>{
|
|
|
- return {...item,answer:JSON.parse(item.answer),Answer:item.type === 'multiple'? []:''}
|
|
|
- })
|
|
|
},
|
|
|
switchType(type) {
|
|
|
this.activityType = type;
|
|
@@ -411,7 +420,7 @@ export default {
|
|
|
if (type != "satisfaction") {
|
|
|
this.getList();
|
|
|
} else {
|
|
|
- this.getQuestion()
|
|
|
+ this.getQuestion();
|
|
|
}
|
|
|
},
|
|
|
back() {
|
|
@@ -443,15 +452,16 @@ export default {
|
|
|
});
|
|
|
if (this.questionComplete === true) return;
|
|
|
if (!this.name) {
|
|
|
- window.alert("请输入姓名");
|
|
|
+ this.$message.warning("请输入姓名");
|
|
|
return;
|
|
|
}
|
|
|
if (!this.phone) {
|
|
|
- window.alert("请输入手机号码");
|
|
|
+ this.$message.warning("请输入手机号码");
|
|
|
return;
|
|
|
}
|
|
|
if (!checkPhone(this.phone)) {
|
|
|
- window.alert("请输入正确的手机号码");
|
|
|
+ this.$message.warning("请输入正确的手机号码");
|
|
|
+
|
|
|
return;
|
|
|
}
|
|
|
},
|
|
@@ -461,10 +471,10 @@ export default {
|
|
|
this.activityType =
|
|
|
(this.$route.query && this.$route.query["type"]) || "onLine";
|
|
|
this.params["type"] = this.typeChange[this.activityType];
|
|
|
- if (this.params["type"] === 'satisfaction') {
|
|
|
- this.getQuestion()
|
|
|
+ if (this.params["type"] === "satisfaction") {
|
|
|
+ this.getQuestion();
|
|
|
return;
|
|
|
- }
|
|
|
+ }
|
|
|
this.getList();
|
|
|
},
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|