commit
This commit is contained in:
@@ -1,251 +0,0 @@
|
||||
const basicForm = {
|
||||
template: /*language=HTML*/ `
|
||||
<el-dialog :visible.sync="dialogVisible" title="基础设置">
|
||||
<div style="overflow-y: auto">
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="150px">
|
||||
<el-form-item label="类型" prop="category">
|
||||
<el-radio-group v-model="formData.category" size="small">
|
||||
<el-radio v-for="item in dict.type.ACTIVITY_QSV_CATEGORY" :label="item.code"
|
||||
:key="item.code"
|
||||
border>
|
||||
{{item.label}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="formData.title" placeholder="请输入标题" maxlength="50"
|
||||
show-word-limit></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="说明" prop="description">
|
||||
<text-editor v-model="formData.description" :height="150"></text-editor>
|
||||
</el-form-item>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker v-model="formData.startTime" type="datetime" placeholder="选择日期时间"
|
||||
style="width: 100%"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-date-picker v-model="formData.endTime" type="datetime" placeholder="选择日期时间"
|
||||
style="width: 100%"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="参加人员范围" prop="groupId">
|
||||
<div style="display: flex;column-gap: 10px">
|
||||
<el-select clearable filterable
|
||||
placeholder="参加人员范围"
|
||||
prop="groupId"
|
||||
style="width: 99%;"
|
||||
v-model="formData.groupId">
|
||||
<el-option :key="item.groupId"
|
||||
:label="item.groupName"
|
||||
:value="item.groupId"
|
||||
v-for="item in activityGroupOptions"></el-option>
|
||||
</el-select>
|
||||
<el-button
|
||||
@click="$refs.drawerUserScope.userScopeDialog = true"
|
||||
type="primary">设置
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<template v-if="formData.category==='QUIZ'">
|
||||
<el-form-item label="出题模式" prop="mode">
|
||||
<span slot="label">
|
||||
出题模式
|
||||
<el-popover placement="bottom" trigger="hover">
|
||||
<div>
|
||||
<p>定时定题:例如一周答题,每天显示不同的题目,需要在题目设置显示日期。</p>
|
||||
<p>常规模式:无</p>
|
||||
</div>
|
||||
<i class="el-icon-question" slot="reference"></i>
|
||||
</el-popover>
|
||||
</span>
|
||||
<el-radio-group v-model="formData.mode" size="small">
|
||||
<el-radio v-for="item in dict.type.ACTIVITY_QSV_MODE" :label="item.code"
|
||||
:key="item.code"
|
||||
border>
|
||||
{{item.label}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="题目顺序打乱" prop="shuffleSubject">
|
||||
<span slot="label">
|
||||
题目顺序打乱
|
||||
<el-popover placement="bottom" trigger="hover">
|
||||
<div>
|
||||
题目都是相同的,只是顺序不一致。
|
||||
</div>
|
||||
<i class="el-icon-question" slot="reference"></i>
|
||||
</el-popover>
|
||||
</span>
|
||||
<el-switch v-model="formData.shuffleSubject"></el-switch>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="题目显示模式" prop="displayMode" v-if="formData.category==='QUIZ' && formData.mode==='REGULAR'">
|
||||
<span slot="label">
|
||||
题目显示模式
|
||||
<el-popover placement="bottom" trigger="hover">
|
||||
<div>
|
||||
注:定时定题模式无需配置。
|
||||
<p>
|
||||
常规模式下配置例如:题库50题,只需抽取其中20题答题则需配置为随机抽取模式。
|
||||
</p>
|
||||
</div>
|
||||
<i class="el-icon-question" slot="reference"></i>
|
||||
</el-popover>
|
||||
</span>
|
||||
<el-radio-group v-model="formData.displayMode" size="small">
|
||||
<el-radio label="ALL" border>全部</el-radio>
|
||||
<el-radio label="RANDOM" border>随机抽取</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单次随机抽取题数" prop="randomCount"
|
||||
v-if="formData.category==='QUIZ' && formData.mode==='REGULAR' && formData.displayMode==='RANDOM'">
|
||||
<el-input-number v-model="formData.randomCount" :min="1" :max="100"></el-input-number>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="总随机抽取次数" prop="totalRandom"
|
||||
v-if="formData.category==='QUIZ' && formData.mode==='REGULAR' && formData.displayMode==='RANDOM'">
|
||||
<el-input-number v-model="formData.totalRandom" :min="1" :max="100"></el-input-number>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="是否可重复答题" prop="repeatable" v-if="formData.mode==='SCHEDULED' || (formData.mode==='REGULAR' && formData.displayMode==='ALL')">
|
||||
<el-switch v-model="formData.repeatable"></el-switch>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="重复答题模式" prop="repeatMode" v-if="formData.repeatable">-->
|
||||
<!-- <span slot="label">-->
|
||||
<!-- 重复答题模式(作废)-->
|
||||
<!-- <el-popover placement="bottom" trigger="hover">-->
|
||||
<!-- <div>-->
|
||||
<!-- 定时定题模式下每天即用户每天可答题多次-->
|
||||
<!-- </div>-->
|
||||
<!-- <i class="el-icon-question" slot="reference"></i>-->
|
||||
<!-- </el-popover>-->
|
||||
<!-- </span>-->
|
||||
<!-- <el-radio-group v-model="formData.repeatMode" size="small">-->
|
||||
<!-- <el-radio v-for="item in dict.type.ACTIVITY_QSV_REPEAT_MODE" :label="item.code"-->
|
||||
<!-- :key="item.code" border>-->
|
||||
<!-- {{item.label}}-->
|
||||
<!-- </el-radio>-->
|
||||
<!-- </el-radio-group>-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<el-form-item label="最大答题次数" prop="maxAttempts" v-if="formData.repeatable && (formData.mode==='SCHEDULED' || (formData.mode==='REGULAR' && formData.displayMode==='ALL'))">
|
||||
<el-input-number v-model="formData.maxAttempts" :min="1" :max="100"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="时间限制(min)" prop="timeLimit">
|
||||
<span slot="label">
|
||||
时间限制(min)
|
||||
<el-popover placement="bottom" trigger="hover">
|
||||
<div>
|
||||
无需限制请设置为0
|
||||
</div>
|
||||
<i class="el-icon-question" slot="reference"></i>
|
||||
</el-popover>
|
||||
</span>
|
||||
|
||||
<el-input-number v-model="formData.timeLimit" :min="0" :max="100"
|
||||
placeholder="无需限制请设置为0"></el-input-number>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="得分统计模式" prop="scoreMode" v-if="formData.category==='QUIZ'">
|
||||
<el-radio-group v-model="formData.scoreMode" size="small">
|
||||
<el-radio v-for="item in dict.type.ACTIVITY_QSV_SCORE_MODE" :label="item.code"
|
||||
:key="item.code" border>
|
||||
{{item.label}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="封面" prop="cover">
|
||||
<file-upload
|
||||
:upload_number="1"
|
||||
:value.sync="formData.cover"
|
||||
accept=".jpg,.jpeg,.png"
|
||||
complete_result
|
||||
upload_mode="image"
|
||||
upload_result_category="interval"
|
||||
></file-upload>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-form>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="onSubmit">确 定</el-button>
|
||||
</div>
|
||||
<drawer-user-scope
|
||||
@group_change="getActivityGroup"
|
||||
ref="drawerUserScope"
|
||||
:group_id.sync="formData.groupId"
|
||||
></drawer-user-scope>
|
||||
</el-dialog>
|
||||
`,
|
||||
dicts: ["ACTIVITY_QSV_CATEGORY", "ACTIVITY_QSV_MODE", "ACTIVITY_QSV_REPEAT_MODE", "ACTIVITY_QSV_SCORE_MODE"],
|
||||
components: {
|
||||
"drawer-user-scope": httpVueLoader("/components/module/activity/DrawerUserScope.vue")
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formData: {},
|
||||
formRules: {
|
||||
category: [{ required: true, message: "请选择类型", trigger: "change" }],
|
||||
title: [{ required: true, message: "请输入标题", trigger: "change" }],
|
||||
startTime: [{ required: true, message: "请选择开始时间", trigger: "change" }],
|
||||
endTime: [{ required: true, message: "请选择结束时间", trigger: "change" }],
|
||||
mode: [{ required: true, message: "请选择出题模式", trigger: "change" }],
|
||||
scoreMode: [{ required: true, message: "请选择得分统计模式", trigger: "change" }]
|
||||
},
|
||||
activityGroupOptions: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(id) {
|
||||
this.dialogVisible = true
|
||||
this.getActivityGroup()
|
||||
if (id) {
|
||||
this.$axios.post("/platform/qsv/activity/findOne", { id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.formData = res.data
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.formData = {}
|
||||
}
|
||||
},
|
||||
onSubmit() {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$axios.post("/platform/qsv/activity/save", this.formData).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.dialogVisible = false
|
||||
this.$emit("refresh", null)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getActivityGroup() {
|
||||
this.$axios.post("/platform/activity/basic/scope/getActivityUserScopeGroup").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.activityGroupOptions = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app">
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker placeholder="年度" type="year" v-model="pageForm.year" value-format="yyyy"></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="标题">
|
||||
<el-input placeholder="标题" v-model="pageForm.title" clearable></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-button @click="$refs.basicFormRef.onOpen()" size="small" type="primary" class="mr5">新增</el-button>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" ref="tableRef" @sort-change="pageOrder">
|
||||
<el-table-column label="序号" width="50" type="index" :index="indexMethod"></el-table-column>
|
||||
<el-table-column label="标题" prop="title" sortable></el-table-column>
|
||||
<el-table-column label="类型" prop="category" sortable width="200">
|
||||
<template scope="{row}">
|
||||
<dict-tag :options="dict.type.ACTIVITY_QSV_CATEGORY" :value="row.category"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间" prop="startTime" sortable></el-table-column>
|
||||
<el-table-column label="结束时间" prop="endTime" sortable></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="300px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="openEdit(row)">编辑</el-button>
|
||||
<el-button size="mini" type="primary" @click="openSubject(row.id)">题目设置</el-button>
|
||||
<el-button size="mini" type="danger" @click="onDelete(row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #edit>
|
||||
<subject-form ref="subjectFormRef" @refresh="pageData"></subject-form>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<basic-form ref="basicFormRef" @refresh="pageData"></basic-form>
|
||||
<!-- <subject-form ref="subjectFormRef" @refresh="pageData"></subject-form>-->
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('basicForm.js'){}#-->
|
||||
<!--#include('subjectForm.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
dicts: ["ACTIVITY_QSV_CATEGORY"],
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"basic-form": basicForm,
|
||||
"subject-form": subjectForm
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
methods: {
|
||||
openEdit(row) {
|
||||
this.$refs.basicFormRef.onOpen(row.id)
|
||||
},
|
||||
openSubject(id) {
|
||||
this.$refs.guava.edit()
|
||||
this.$nextTick(() => {
|
||||
this.$refs.subjectFormRef.onOpen(id)
|
||||
})
|
||||
// this.$refs.subjectFormRef.onOpen(id)
|
||||
},
|
||||
onDelete(id) {
|
||||
this.$confirm("您确认删除吗, 是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/qsv/activity/delete", { id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("删除成功")
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -1,83 +0,0 @@
|
||||
const optionImg = {
|
||||
template: /*language=HTML*/ `
|
||||
<el-dialog :visible="visible" title="设置图片" append-to-body width="700px">
|
||||
<div style="background: #f7f8f9;text-align: center;border: solid 1px #d7d8d9;border-radius: 4px;">
|
||||
<el-upload
|
||||
action="/platform/sys/file/uploadDynamicReturnUrl"
|
||||
:show-file-list="false"
|
||||
:on-success="handleSuccess"
|
||||
:before-upload="beforeUpload">
|
||||
<img v-if="img" :src="img" class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
</div>
|
||||
<div style="padding: 10px 0">
|
||||
请上传图片
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="onConfirm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
img: null,
|
||||
ext: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(img = null, ext) {
|
||||
this.img = img
|
||||
this.ext = ext
|
||||
this.visible = true
|
||||
},
|
||||
handleSuccess(response, file, fileList) {
|
||||
console.log(response)
|
||||
console.log(file)
|
||||
console.log(fileList)
|
||||
if (response.code === 0) {
|
||||
this.img = response.data
|
||||
// this.img = "/platform/sys/file/download?id=t38dmq4beuhrupqb54prl52t4u"
|
||||
this.$message.success("图片上传成功")
|
||||
}
|
||||
},
|
||||
beforeUpload(file) {},
|
||||
onConfirm() {
|
||||
this.$emit("confirm", {
|
||||
img: this.img,
|
||||
ext: this.ext
|
||||
})
|
||||
this.visible = false
|
||||
}
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
.avatar-uploader .el-upload {
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: #409EFF;
|
||||
}
|
||||
|
||||
.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
line-height: 178px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
display: block;
|
||||
}
|
||||
`
|
||||
}
|
||||
@@ -1,494 +0,0 @@
|
||||
<!--#include('optionImg.js'){}#-->
|
||||
|
||||
const subjectForm = {
|
||||
template: /*language=HTML*/ `
|
||||
<div class="subject-form-dialog">
|
||||
<el-form ref="form" :model="formData" :rules="formRules" label-width="120px">
|
||||
<div style="min-height:50vh;overflow-y: auto">
|
||||
<draggable v-model="subjects" handle=".drag-handler">
|
||||
<transition-group>
|
||||
<div v-for="(subject, subjectIndex) in subjects" :key="subject.id" class="subject-item">
|
||||
<div class="subject-header">
|
||||
<div style="display: flex; align-items: center;">
|
||||
<i class="el-icon-rank drag-handler"></i>
|
||||
<span style="font-weight: bold; margin-right: 10px;">第 {{subjectIndex + 1}} 题</span>
|
||||
<el-input
|
||||
v-model="subject.title"
|
||||
placeholder="请输入题目"
|
||||
style="flex: 1">
|
||||
</el-input>
|
||||
</div>
|
||||
|
||||
<div class="subject-meta">
|
||||
<div>
|
||||
题目类型:
|
||||
<el-select
|
||||
v-model="subject.type"
|
||||
@change="subjectTypeChange(subject, subjectIndex)"
|
||||
placeholder="请选择题目类型"
|
||||
style="width: 200px;">
|
||||
<el-option label="单选题" value="radio">
|
||||
<i class="el-icon-circle-check subject-type-icon"></i>单选题
|
||||
</el-option>
|
||||
<el-option label="多选题" value="checkbox">
|
||||
<i class="el-icon-check subject-type-icon"></i>多选题
|
||||
</el-option>
|
||||
<el-option label="填空题" value="text" v-if="activity.category!=='QUIZ'">
|
||||
<i class="el-icon-edit subject-type-icon"></i>填空题
|
||||
</el-option>
|
||||
<!-- <el-option label="判断题" value="judge">-->
|
||||
<!-- <i class="el-icon-right subject-type-icon"></i>判断题-->
|
||||
<!-- </el-option>-->
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="subject.hint"-->
|
||||
<!-- placeholder="题目提示信息"-->
|
||||
<!-- style="width: 200px;">-->
|
||||
<!-- <template slot="prepend">提示</template>-->
|
||||
<!-- </el-input>-->
|
||||
|
||||
<div v-if="activity.category==='QUIZ'">
|
||||
题目分数:
|
||||
<el-input-number
|
||||
v-model="subject.score"
|
||||
:min="0"
|
||||
:max="100"
|
||||
placeholder="分数">
|
||||
<template slot="prepend">分数</template>
|
||||
</el-input-number>
|
||||
</div>
|
||||
|
||||
<div v-if="activity.category==='QUIZ' && activity.mode==='SCHEDULED'">
|
||||
显示日期:
|
||||
<el-date-picker
|
||||
v-model="subject.displayDate"
|
||||
type="date"
|
||||
placeholder="显示日期"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template>
|
||||
<draggable v-model="subject.options" handle=".option-drag-handle"
|
||||
v-if="subject.type !== 'text'">
|
||||
<transition-group>
|
||||
<div v-for="(option, optionIndex) in subject.options"
|
||||
:key="option.id"
|
||||
class="option-item">
|
||||
<i class="el-icon-rank option-drag-handle"></i>
|
||||
<div class="option-content">
|
||||
<el-input
|
||||
v-model="option.text"
|
||||
:placeholder="'选项'+optionIndex + 1">
|
||||
<template slot="prepend">选项{{optionIndex + 1}}</template>
|
||||
</el-input>
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="option.hint"-->
|
||||
<!-- placeholder="选项提示"-->
|
||||
<!-- style="margin-top: 5px;">-->
|
||||
<!-- </el-input>-->
|
||||
<div v-if="option.imageUrl" style="margin-top: 10px;">
|
||||
<img :src="option.imageUrl" class="image-preview" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="option-tools">
|
||||
<template v-if="activity.category!=='QUIZ'">
|
||||
<div class="option-img-box" v-if="option.imgUrl">
|
||||
<i class="el-icon-remove"
|
||||
@click="removeOptionImg(subjectIndex,optionIndex)"></i>
|
||||
<img :src="option.imgUrl" alt=""
|
||||
@click="openOptionImg(subjectIndex,optionIndex,option)">
|
||||
</div>
|
||||
<i v-if="!option.imgUrl" class="el-icon-picture-outline"
|
||||
style="font-size: 40px;cursor: pointer;" title="上传图片"
|
||||
@click="openOptionImg(subjectIndex,optionIndex,option)"></i>
|
||||
</template>
|
||||
|
||||
<el-switch
|
||||
v-if="activity.category==='QUIZ'"
|
||||
v-model="option.isCorrect"
|
||||
active-text="正确答案">
|
||||
</el-switch>
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
@click="removeOption(subject, optionIndex)">
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</transition-group>
|
||||
</draggable>
|
||||
<div class="subject-toolbar">
|
||||
<div>
|
||||
<el-button
|
||||
v-if="subject.type !== 'text'"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="small"
|
||||
@click="addOption(subject)">
|
||||
添加选项
|
||||
</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="small"
|
||||
@click="removeSubject(subjectIndex)">
|
||||
删除题目
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<!-- <div>-->
|
||||
<!-- <el-switch-->
|
||||
<!-- v-model="subject.required"-->
|
||||
<!-- active-text="必答题">-->
|
||||
<!-- </el-switch>-->
|
||||
<!-- <el-switch-->
|
||||
<!-- v-model="subject.showDate"-->
|
||||
<!-- class="date-visible"-->
|
||||
<!-- active-text="显示日期">-->
|
||||
<!-- </el-switch>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="meta-info">
|
||||
<!-- 创建时间:{{ formatDate(subject.createTime) }}-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- style="float: right;"-->
|
||||
<!-- @click="removeSubject(index)">-->
|
||||
<!-- 删除题目-->
|
||||
<!-- </el-button>-->
|
||||
</div>
|
||||
</div>
|
||||
</transition-group>
|
||||
</draggable>
|
||||
<el-empty description="描述文字" v-if="subjects.length===0"></el-empty>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<div style="border-top: 1px solid var(--border-color-lighter);padding: 12px;text-align: right;">
|
||||
<!-- <el-button @click="visible = false">取消</el-button>-->
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addSubject">
|
||||
添加题目
|
||||
</el-button>
|
||||
<el-button type="primary" icon="el-icon-check" @click="saveQuestionnaire">
|
||||
保存题目
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<option-img ref="optionImgRef" @confirm="onOptionImgConfirm"></option-img>
|
||||
</div>
|
||||
`,
|
||||
components: {
|
||||
'option-img': optionImg,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
id: null,
|
||||
visible: false,
|
||||
formData: {},
|
||||
subjects: [],
|
||||
previewDialogVisible: false,
|
||||
activity: {},
|
||||
formRules: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(id) {
|
||||
this.visible = true
|
||||
if (id) {
|
||||
this.id = id
|
||||
this.$axios.post("/platform/qsv/activity/findOne", {id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.activity = res.data
|
||||
}
|
||||
})
|
||||
this.$axios.post("/platform/qsv/activity/listSubjects", {activityId: id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.subjects = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
//生成随机id
|
||||
generateId() {
|
||||
return Date.now() + Math.random().toString(36).substr(2, 9)
|
||||
},
|
||||
|
||||
//添加题目
|
||||
addSubject() {
|
||||
this.subjects.push({
|
||||
id: this.generateId(),
|
||||
title: "",
|
||||
hint: "",
|
||||
type: "radio",
|
||||
score: 0,
|
||||
displayDate: "",
|
||||
options: [
|
||||
{
|
||||
id: this.generateId(),
|
||||
text: "选项1",
|
||||
hint: "",
|
||||
imgUrl: null,
|
||||
isCorrect: false
|
||||
},
|
||||
{
|
||||
id: this.generateId(),
|
||||
text: "选项2",
|
||||
hint: "",
|
||||
imgUrl: null,
|
||||
isCorrect: false
|
||||
}
|
||||
],
|
||||
})
|
||||
},
|
||||
|
||||
//题目类型切换
|
||||
subjectTypeChange(subject, subjectIndex){
|
||||
if(subject.type==='text'){
|
||||
subject.options = []
|
||||
}
|
||||
},
|
||||
|
||||
//删除题目
|
||||
removeSubject(index) {
|
||||
this.$confirm("确认删除该题目?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
this.subjects.splice(index, 1)
|
||||
this.$message.success("删除成功")
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
},
|
||||
|
||||
//添加选项
|
||||
addOption(subject) {
|
||||
subject.options.push({
|
||||
id: this.generateId(),
|
||||
text: "选项" + subject.options.length + 1,
|
||||
hint: "",
|
||||
imgUrl: null,
|
||||
isCorrect: false
|
||||
})
|
||||
},
|
||||
|
||||
//删除选项
|
||||
removeOption(subject, optionIndex) {
|
||||
subject.options.splice(optionIndex, 1)
|
||||
},
|
||||
|
||||
//打开选项上传图片
|
||||
openOptionImg(subjectIndex, optionIndex, option) {
|
||||
this.$refs.optionImgRef.onOpen(option.imgUrl, {
|
||||
subjectIndex,
|
||||
optionIndex
|
||||
})
|
||||
},
|
||||
|
||||
//选项图片上传成功回调
|
||||
onOptionImgConfirm({img, ext}) {
|
||||
this.$set(this.subjects[ext.subjectIndex].options[ext.optionIndex], "imgUrl", img)
|
||||
},
|
||||
|
||||
//删除选项图片
|
||||
removeOptionImg(subjectIndex, optionIndex){
|
||||
this.$set(this.subjects[subjectIndex].options[optionIndex], "imgUrl", null)
|
||||
console.log(this.subjects[subjectIndex])
|
||||
},
|
||||
|
||||
//保存
|
||||
saveQuestionnaire() {
|
||||
this.$axios
|
||||
.post("/platform/qsv/activity/saveSubjects", {
|
||||
activityId: this.id,
|
||||
subjects: JSON.stringify(this.subjects)
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.visible = false
|
||||
this.$message.success(res.msg)
|
||||
this.$emit("refresh", null)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
/*.subject-form-dialog,.subject-form-dialog .el-dialog__body {*/
|
||||
/* background: rgb(248, 249, 250);*/
|
||||
/*}*/
|
||||
|
||||
.questionnaire-editor {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.editor-header {
|
||||
background: white;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.subject-item {
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
padding: 25px;
|
||||
margin-bottom: 20px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
|
||||
transition: all 0.3s ease;
|
||||
border: 1px dashed #d9d9d9;
|
||||
}
|
||||
|
||||
.subject-item:hover {
|
||||
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.1);
|
||||
/*transform: translateY(-1px);*/
|
||||
}
|
||||
|
||||
.subject-header {
|
||||
border-bottom: 1px solid #eee;
|
||||
padding-bottom: 15px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.subject-toolbar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 15px;
|
||||
padding-top: 15px;
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
background: white;
|
||||
padding: 15px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.toolbar-btn {
|
||||
margin: 5px 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.option-item {
|
||||
background: #f8f9fa;
|
||||
border-radius: 4px;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.option-drag-handle {
|
||||
cursor: move;
|
||||
margin-right: 10px;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.option-content {
|
||||
flex-grow: 1;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.option-tools {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.preview-dialog {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.date-visible {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.subject-meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 15px;
|
||||
margin-top: 15px;
|
||||
background: #f8f9fa;
|
||||
padding: 10px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.image-preview {
|
||||
max-width: 200px;
|
||||
max-height: 200px;
|
||||
margin-top: 10px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.drag-handler {
|
||||
cursor: move;
|
||||
color: #909399;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.meta-info {
|
||||
color: #909399;
|
||||
font-size: 12px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.subject-type-icon {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
|
||||
.option-img-box{
|
||||
position: relative;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
cursor: pointer;
|
||||
flex-shrink: 0
|
||||
}
|
||||
|
||||
.option-img-box:hover .el-icon-remove {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.option-img-box img{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.option-img-box .el-icon-remove{
|
||||
position: absolute;
|
||||
top: -7px;
|
||||
right: -7px;
|
||||
color: red;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.option-img-box .el-icon-remove:hover{
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
`
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
:clearable="false"
|
||||
@change="listActivity"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="问卷">
|
||||
<el-select filterable placeholder="所属问卷" style="width: 100%" @change="doSearch" v-model="pageForm.activityId">
|
||||
<el-option :label="item.title" :value="item.id" :key="item.id" v-for="item in activityOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="姓名/工号">
|
||||
<el-input v-model="pageForm.searchKeyword" placeholder="姓名/工号" clearable></el-input>
|
||||
</search-item>
|
||||
<search-item label="所属工会">
|
||||
<el-select placeholder="所属工会" v-model="pageForm.unionId" clearable filterable>
|
||||
<el-option v-for="item in unionOptions" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属单位">
|
||||
<el-select placeholder="所属单位" v-model="pageForm.unitId" clearable filterable>
|
||||
<el-option v-for="item in unitOptions" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="答题日期">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.attemptDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择答题日期"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-button @click="exportXlsx" icon="el-icon-download" size="small" type="primary" class="mr5">导出xlsx</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" ref="tableRef" @sort-change="pageOrder">
|
||||
<el-table-column label="序号" width="50" type="index" :index="indexMethod"></el-table-column>
|
||||
<el-table-column label="姓名" prop="userName" sortable></el-table-column>
|
||||
<el-table-column label="工号" prop="loginName" sortable></el-table-column>
|
||||
<el-table-column label="性别" prop="sex" sortable></el-table-column>
|
||||
<el-table-column label="单位" prop="unitName" sortable></el-table-column>
|
||||
<el-table-column label="分工会" prop="unionName" sortable></el-table-column>
|
||||
<el-table-column label="联系方式" prop="mobile" sortable></el-table-column>
|
||||
<el-table-column label="答题日期" prop="attemptDate" sortable></el-table-column>
|
||||
<el-table-column label="得分" prop="totalScore" sortable></el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
activityOptions: [],
|
||||
unionOptions: [],
|
||||
unitOptions: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
listActivity() {
|
||||
this.$axios.post("/platform/qsv/quizRank/listQuiz", { year: this.pageForm.year }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.activityOptions = res.data
|
||||
if (this.activityOptions.length > 0) {
|
||||
this.pageForm.activityId = this.activityOptions[0].id
|
||||
this.pageData()
|
||||
} else {
|
||||
this.pageForm.activityId = null
|
||||
this.tableData = []
|
||||
this.pageForm.totalCount = 0
|
||||
this.pageForm.pageNumber = 1
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
exportXlsx() {
|
||||
this.$downLoad("/platform/qsv/quizRank/exportXlsx", this.pageForm)
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.unionOptions = await this.$businessTool.listUnion()
|
||||
this.unitOptions = await this.$businessTool.listUnit()
|
||||
this.listActivity()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -1,62 +0,0 @@
|
||||
const answer = {
|
||||
/*language=HTML*/
|
||||
template: `
|
||||
<el-dialog title="查看答卷" :visible.sync="dialogVisible" width="50%">
|
||||
<el-row type="flex" justify="end" class="mb10">
|
||||
<el-button type="primary" size="small" icon="el-icon-download" @click="exportUserAnswerXlsx">导出xlsx</el-button>
|
||||
</el-row>
|
||||
<el-table :data="tableData">
|
||||
<el-table-column label="序号" type="index" width="70"></el-table-column>
|
||||
<el-table-column v-for="item in tableColumns" :key="item.prop" :label="item.label" :prop="item.prop"></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="danger" size="mini" icon="el-icon-delete" @click="onDelete(scope.row.id)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
tableColumns: [],
|
||||
tableData: [],
|
||||
activityId: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(activityId) {
|
||||
this.activityId = activityId
|
||||
this.dialogVisible = true
|
||||
this.list()
|
||||
},
|
||||
|
||||
list() {
|
||||
this.$axios.post("/platform/qsv/survey/userAnswer", { activityId: this.activityId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.tableColumns = res.data.tableColumns
|
||||
this.tableData = res.data.tableData
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
onDelete(id) {
|
||||
this.$confirm("确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/qsv/survey/deleteUserAnswer", { id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.list()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
exportUserAnswerXlsx() {
|
||||
this.$downLoad("/platform/qsv/survey/exportUserAnswerXlsx", { activityId: this.activityId })
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
:clearable="false"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<!-- <el-button @click="exportXlsx" icon="el-icon-download" size="small" type="primary" class="mr5">导出xlsx</el-button>-->
|
||||
</table-tool>
|
||||
<el-table :data="tableData" ref="tableRef" @sort-change="pageOrder">
|
||||
<el-table-column label="序号" width="50" type="index" :index="indexMethod"></el-table-column>
|
||||
<el-table-column label="标题" prop="title" width="120" sortable></el-table-column>
|
||||
<el-table-column label="类型" prop="category" sortable>
|
||||
<template scope="{row}">
|
||||
<dict-tag :options="dict.type.ACTIVITY_QSV_CATEGORY" :value="row.category"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间" prop="startTime" sortable></el-table-column>
|
||||
<el-table-column label="结束时间" prop="endTime" sortable></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="200px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="$refs.reportRef.onOpen(row.id)">查看分析</el-button>
|
||||
<el-button size="mini" type="primary" @click="$refs.answerRef.onOpen(row.id)">查看答卷</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
<report ref="reportRef"></report>
|
||||
<answer ref="answerRef"></answer>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('report.js'){}#-->
|
||||
<!--#include('answer.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
dicts: ["ACTIVITY_QSV_CATEGORY"],
|
||||
components: { report, answer },
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
methods: {
|
||||
exportXlsx() {
|
||||
this.$axios.post("/platform/qsv/survey/exportXlsx", this.pageForm)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -1,101 +0,0 @@
|
||||
const report = {
|
||||
/*language=HTML*/
|
||||
template: `
|
||||
<el-dialog title="分析报告" :visible.sync="dialogVisible" width="50%">
|
||||
<div v-for="(subject,subjectIndex) in subjects" class="subject">
|
||||
<div>
|
||||
<div class="title">
|
||||
第{{subjectIndex+1}}题: {{subject.title}}
|
||||
<span class="type" v-if="subject.type==='text'">[填空题]</span>
|
||||
<span class="type" v-else-if="subject.type==='radio'">[单选题]</span>
|
||||
<span class="type" v-else-if="subject.type==='text'">[多选题]</span>
|
||||
</div>
|
||||
|
||||
<div v-if="subject.type==='text'">
|
||||
{{subject.texts.join('、')}}
|
||||
</div>
|
||||
|
||||
<div v-else-if="subject.type==='radio' || subject.type==='checkbox'">
|
||||
<el-table :data="subject.options" size="small">
|
||||
<el-table-column label="选项" prop="text"></el-table-column>
|
||||
<el-table-column label="小计" prop="selectCount" width="100"></el-table-column>
|
||||
<el-table-column label="比例" width="500">
|
||||
<template slot-scope="scope">
|
||||
<el-progress
|
||||
:percentage="Math.round(scope.row.selectCount / subject.selectTotal * 100)"></el-progress>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="详情" width="100px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button type="text" @click="openDetail(subject.id,row.id)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog title="选择详情" :visible.sync="optionVisible" width="50%" append-to-body>
|
||||
<el-table :data="optionUsers" size="small">
|
||||
<el-table-column label="姓名" prop="userName"></el-table-column>
|
||||
<el-table-column label="工号" prop="loginName"></el-table-column>
|
||||
<el-table-column label="单位" prop="unitName"></el-table-column>
|
||||
<el-table-column label="分工会" prop="unionName"></el-table-column>
|
||||
<el-table-column label="选择时间" prop="attemptDate"></el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
</el-dialog>
|
||||
`,
|
||||
dicts: ["ACTIVITY_QSV_CATEGORY"],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
activityId: null,
|
||||
report: null,
|
||||
subjects: [],
|
||||
optionVisible: false,
|
||||
optionUsers: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen(activityId) {
|
||||
this.dialogVisible = true
|
||||
this.activityId = activityId
|
||||
this.$axios.post("/platform/qsv/survey/report", { activityId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.subjects = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
openDetail(subjectId, optionId) {
|
||||
console.log(subjectId)
|
||||
console.log(optionId)
|
||||
this.$axios
|
||||
.post("/platform/qsv/survey/selectOptionUsers", {
|
||||
activityId: this.activityId,
|
||||
subjectId,
|
||||
optionId
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.optionVisible = true
|
||||
this.optionUsers = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
.subject{
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.subject .title{
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.subject .type{
|
||||
color: #a6a6a6;
|
||||
margin-left: 10px;
|
||||
}
|
||||
`
|
||||
}
|
||||
Reference in New Issue
Block a user