|
@@ -20,7 +20,8 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="mini" @click="detailBtn(scope.row)">查看</el-button>
|
|
|
+ <el-button size="mini" @click="editBtn(scope.row)">编辑</el-button>
|
|
|
+ <el-button size="mini" @click="detailBtn(scope.row)">预览</el-button>
|
|
|
<el-button size="mini" @click="deleteBtn(scope.row.id)" type="danger">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -76,19 +77,25 @@
|
|
|
<el-button type="primary" @click="submitFrom">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog title="预览问卷" :visible.sync="dialogVisible">
|
|
|
+ <wenjuandetail :detail="detail"></wenjuandetail>
|
|
|
+ </el-dialog>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import wenjuandetail from '@/views/question/part/wenjuandetail.vue';
|
|
|
import { createNamespacedHelpers, mapState } from 'vuex';
|
|
|
const { mapActions: questionnaire } = createNamespacedHelpers('questionnaire');
|
|
|
const { mapActions: question } = createNamespacedHelpers('question');
|
|
|
export default {
|
|
|
name: 'wenjuan',
|
|
|
props: {},
|
|
|
- components: {},
|
|
|
+ components: {
|
|
|
+ wenjuandetail,
|
|
|
+ },
|
|
|
data: () => ({
|
|
|
list: [], //列表
|
|
|
total: 0, //总数
|
|
@@ -98,7 +105,8 @@ export default {
|
|
|
{ value: '1', label: '发布' },
|
|
|
{ value: '2', label: '停用' },
|
|
|
], //状态选择数组
|
|
|
- dialogFormVisible: false, //控制dialog是否显示
|
|
|
+ dialogFormVisible: false, //控制表单dialog是否显示
|
|
|
+ dialogVisible: false, //控制预览问卷dialog是否显示
|
|
|
form: {},
|
|
|
questions: [], //问题数组
|
|
|
questiontotal: 0, //问题总数
|
|
@@ -118,6 +126,7 @@ export default {
|
|
|
num: { required: true, message: '序号不能为空', trigger: 'blur' },
|
|
|
status: { required: true, message: '状态不能为空', trigger: 'blur' },
|
|
|
}, //表单验证规则
|
|
|
+ detail: {}, //问卷详情
|
|
|
}),
|
|
|
created() {
|
|
|
this.search();
|
|
@@ -150,7 +159,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 查看详情
|
|
|
- async detailBtn(item) {
|
|
|
+ async editBtn(item) {
|
|
|
this.dialogFormVisible = true;
|
|
|
this.form = item;
|
|
|
await this.searchQuestion();
|
|
@@ -168,10 +177,15 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
//删除
|
|
|
- async deleteBtn() {
|
|
|
+ async deleteBtn(id) {
|
|
|
let res = await this.delete(id);
|
|
|
if (res.errcode == 0) this.search();
|
|
|
},
|
|
|
+ //预览问卷
|
|
|
+ detailBtn(item) {
|
|
|
+ this.dialogVisible = true;
|
|
|
+ this.$set(this, `detail`, item);
|
|
|
+ },
|
|
|
//问卷分页
|
|
|
handleCurrentChange(val) {
|
|
|
this.search({ skip: (val - 1) * 10, limit: val * 10 });
|