From 0c35e05ca9c90883e5073ea35232ea100f866a8f Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Thu, 19 Aug 2021 15:08:50 +0800
Subject: [PATCH] 保安公司管理
---
src/views/exam/addsubject.vue | 689 +++++++++++++++++++++++++++++---------------------------
1 files changed, 354 insertions(+), 335 deletions(-)
diff --git a/src/views/exam/addsubject.vue b/src/views/exam/addsubject.vue
index 8cb7065..6077940 100644
--- a/src/views/exam/addsubject.vue
+++ b/src/views/exam/addsubject.vue
@@ -1,27 +1,51 @@
<template>
- <el-dialog
- :title="this.id?'修改':'新增'"
- width="60%"
- modal-append-to-body='false'
- append-to-body='true'
- :close-on-click-model="true"
- :visible.sync="visible"
- @close='closeDialog'
+ <el-dialog
+ :title="this.id ? '修改' : '新增'"
+ width="60%"
+ modal-append-to-body="false"
+ append-to-body="true"
+ :close-on-click-model="true"
+ :visible.sync="visible"
+ @close="closeDialog"
+ >
+ <el-row style="margin-left: 60px; margin-bottom: 40px">
+ <el-radio-group v-model="choicesType">
+ <el-radio label="0">单选题</el-radio>
+ <el-radio label="1">多选题</el-radio>
+ <el-radio label="2">判断题</el-radio>
+ <el-radio label="3">实操题</el-radio>
+ </el-radio-group>
+ </el-row>
+ <avue-form
+ ref="form"
+ :option="option"
+ v-model="form"
+ @submit="submit"
+ v-if="choicesType == '0'"
+ ></avue-form>
+ <avue-form
+ ref="formCheckbox"
+ :option="optionCheckbox"
+ v-model="formCheckbox"
+ @submit="submitCheckbox"
+ v-if="choicesType == '1'"
+ ></avue-form>
+ <avue-form
+ ref="formJudge"
+ :option="optionJudge"
+ v-model="formJudge"
+ @submit="submitJudge"
+ v-if="choicesType == '2'"
+ ></avue-form>
+ <avue-form
+ ref="formFill"
+ :option="optionFill"
+ v-model="formFill"
+ @submit="submitFill"
+ v-if="choicesType == '3'"
>
- <el-row style="margin-left:60px;margin-bottom:40px">
- <el-radio-group v-model="choicesType">
- <el-radio label="0">单选题</el-radio>
- <el-radio label="1">多选题</el-radio>
- <el-radio label="2">判断题</el-radio>
- <el-radio label="3">实操题</el-radio>
- </el-radio-group>
- </el-row>
- <avue-form ref="form" :option="option" v-model="form" @submit="submit" v-if="choicesType=='0'"></avue-form>
- <avue-form ref="formCheckbox" :option="optionCheckbox" v-model="formCheckbox" @submit="submitCheckbox" v-if="choicesType=='1'"></avue-form>
- <avue-form ref="formJudge" :option="optionJudge" v-model="formJudge" @submit="submitJudge" v-if="choicesType=='2'"></avue-form>
- <avue-form ref="formFill" :option="optionFill" v-model="formFill" @submit="submitFill" v-if="choicesType=='3'">
- <template slot="optionContent">
- <!-- <el-button type="success" icon="el-icon-plus" circle style="margin-bottom:20px" @click="addRows"></el-button>
+ <template slot="optionContent">
+ <!-- <el-button type="success" icon="el-icon-plus" circle style="margin-bottom:20px" @click="addRows"></el-button>
<div v-for="(item,index) in list" :key="index">
<div class="optionContent-suffix">
<span>{{index+1}}: </span>
@@ -32,45 +56,45 @@
<el-button type="danger" class="optionContent-botton" icon="el-icon-delete" circle @click="deleteRows(index)"></el-button>
</div>
</div> -->
- </template>
- </avue-form>
- </el-dialog>
+ </template>
+ </avue-form>
+ </el-dialog>
</template>
<script>
-import { mapState } from 'vuex'
-import {saveSubjectChoicesAndOption} from "@/api/examapi/examSubjects";
-import {getSubjectAnswer} from "@/api/exam/subject";
+import { mapState } from "vuex";
+import { saveSubjectChoicesAndOption } from "@/api/examapi/examSubjects";
+import { getSubjectAnswer } from "@/api/exam/subject";
export default {
name: "add",
data() {
return {
- inputs:{
+ inputs: {
input1: 1,
},
- optionContentAId:null,
- optionContentBId:null,
- optionContentCId:null,
- optionContentDId:null,
- arrContent:["1"],
- list:[
+ optionContentAId: null,
+ optionContentBId: null,
+ optionContentCId: null,
+ optionContentDId: null,
+ arrContent: ["1"],
+ list: [
{
- data:1
+ data: 1,
},
{
- data:1
+ data: 1,
},
{
- data:1
+ data: 1,
},
],
// index:1,
- visible:false,
- choicesType:"0",
+ visible: false,
+ choicesType: "0",
loading: true,
- form:{
- score:1
+ form: {
+ score: 1,
},
option: {
height: "auto",
@@ -78,7 +102,7 @@
tip: false,
searchShow: true,
searchMenuSpan: 6,
- border: false,
+ border: true, //liu
stripe: true,
align: "center",
index: true,
@@ -91,7 +115,7 @@
label: "题目名称",
prop: "subjectName",
search: true,
- type:"textarea",
+ type: "textarea",
rules: [
{
required: true,
@@ -99,7 +123,7 @@
trigger: "blur",
},
],
- span:24
+ span: 24,
},
{
label: "类型",
@@ -108,17 +132,17 @@
type: "checkbox",
dicData: [
{
- label: '简易题库',
- value: 'A'
- },
+ label: "简易题库",
+ value: "A",
+ },
{
- label: '复杂题库',
- value: 'B'
- },
+ label: "复杂题库",
+ value: "B",
+ },
{
- label: '模拟题库',
- value: 'C'
- }
+ label: "模拟题库",
+ value: "C",
+ },
],
rules: [
{
@@ -127,19 +151,19 @@
trigger: "blur",
},
],
- span:24
+ span: 24,
},
{
label: "选项",
prop: "",
- type:"text",
- span:24
+ type: "text",
+ span: 24,
},
{
label: "A",
prop: "optionContentA",
- span:24,
- placeholder:"请输入内容",
+ span: 24,
+ placeholder: "请输入内容",
rules: [
{
required: true,
@@ -151,8 +175,8 @@
{
label: "B",
prop: "optionContentB",
- span:24,
- placeholder:"请输入内容",
+ span: 24,
+ placeholder: "请输入内容",
rules: [
{
required: true,
@@ -164,8 +188,8 @@
{
label: "C",
prop: "optionContentC",
- span:24,
- placeholder:"请输入内容",
+ span: 24,
+ placeholder: "请输入内容",
rules: [
{
required: true,
@@ -177,8 +201,8 @@
{
label: "D",
prop: "optionContentD",
- span:24,
- placeholder:"请输入内容",
+ span: 24,
+ placeholder: "请输入内容",
rules: [
{
required: true,
@@ -195,21 +219,21 @@
type: "radio",
dicData: [
{
- label: 'A',
- value: 'A'
- },
+ label: "A",
+ value: "A",
+ },
{
- label: 'B',
- value: 'B'
- },
+ label: "B",
+ value: "B",
+ },
{
- label: 'C',
- value: 'C'
- },
+ label: "C",
+ value: "C",
+ },
{
- label: 'D',
- value: 'D'
- }
+ label: "D",
+ value: "D",
+ },
],
rules: [
{
@@ -218,17 +242,17 @@
trigger: "blur",
},
],
- },
+ },
{
label: "解析",
prop: "analysis",
- span:24,
- type:"textarea"
+ span: 24,
+ type: "textarea",
},
{
label: "分值",
prop: "score",
- span:24,
+ span: 24,
rules: [
{
required: true,
@@ -237,12 +261,10 @@
},
],
},
-
],
-
},
- formCheckbox:{
- score:1
+ formCheckbox: {
+ score: 1,
},
optionCheckbox: {
height: "auto",
@@ -250,7 +272,7 @@
tip: false,
searchShow: true,
searchMenuSpan: 6,
- border: false,
+ border: true, //liu
stripe: true,
align: "center",
index: true,
@@ -259,11 +281,11 @@
defaultExpandAll: true,
dialogClickModal: false,
column: [
- {
+ {
label: "题目名称",
prop: "subjectName",
search: true,
- type:"textarea",
+ type: "textarea",
rules: [
{
required: true,
@@ -271,7 +293,7 @@
trigger: "blur",
},
],
- span:24
+ span: 24,
},
{
label: "类型",
@@ -280,17 +302,17 @@
type: "checkbox",
dicData: [
{
- label: '简易题库',
- value: 'A'
- },
+ label: "简易题库",
+ value: "A",
+ },
{
- label: '复杂题库',
- value: 'B'
- },
+ label: "复杂题库",
+ value: "B",
+ },
{
- label: '模拟题库',
- value: 'C'
- }
+ label: "模拟题库",
+ value: "C",
+ },
],
rules: [
{
@@ -299,19 +321,19 @@
trigger: "blur",
},
],
- span:24
+ span: 24,
},
{
label: "选项",
prop: "",
- type:"text",
- span:24
+ type: "text",
+ span: 24,
},
{
label: "A",
prop: "optionContentA",
- span:24,
- placeholder:"请输入内容",
+ span: 24,
+ placeholder: "请输入内容",
rules: [
{
required: true,
@@ -323,8 +345,8 @@
{
label: "B",
prop: "optionContentB",
- span:24,
- placeholder:"请输入内容",
+ span: 24,
+ placeholder: "请输入内容",
rules: [
{
required: true,
@@ -336,8 +358,8 @@
{
label: "C",
prop: "optionContentC",
- span:24,
- placeholder:"请输入内容",
+ span: 24,
+ placeholder: "请输入内容",
rules: [
{
required: true,
@@ -349,8 +371,8 @@
{
label: "D",
prop: "optionContentD",
- span:24,
- placeholder:"请输入内容",
+ span: 24,
+ placeholder: "请输入内容",
rules: [
{
required: true,
@@ -367,21 +389,21 @@
// type: "radio",
dicData: [
{
- label: 'A',
- value: 'A'
- },
+ label: "A",
+ value: "A",
+ },
{
- label: 'B',
- value: 'B'
- },
+ label: "B",
+ value: "B",
+ },
{
- label: 'C',
- value: 'C'
- },
+ label: "C",
+ value: "C",
+ },
{
- label: 'D',
- value: 'D'
- }
+ label: "D",
+ value: "D",
+ },
],
rules: [
{
@@ -390,17 +412,17 @@
trigger: "blur",
},
],
- },
+ },
{
label: "解析",
prop: "analysis",
- span:24,
- type:"textarea"
+ span: 24,
+ type: "textarea",
},
{
label: "分值",
prop: "score",
- span:24,
+ span: 24,
rules: [
{
required: true,
@@ -409,12 +431,10 @@
},
],
},
-
],
-
},
- formJudge:{
- score:1
+ formJudge: {
+ score: 1,
},
optionJudge: {
height: "auto",
@@ -422,7 +442,7 @@
tip: false,
searchShow: true,
searchMenuSpan: 6,
- border: false,
+ border: true, //liu
stripe: true,
align: "center",
index: true,
@@ -435,7 +455,7 @@
label: "题目名称",
prop: "subjectName",
search: true,
- type:"textarea",
+ type: "textarea",
rules: [
{
required: true,
@@ -443,7 +463,7 @@
trigger: "blur",
},
],
- span:24
+ span: 24,
},
{
label: "类型",
@@ -452,17 +472,17 @@
type: "checkbox",
dicData: [
{
- label: '简易题库',
- value: 'A'
- },
+ label: "简易题库",
+ value: "A",
+ },
{
- label: '复杂题库',
- value: 'B'
- },
+ label: "复杂题库",
+ value: "B",
+ },
{
- label: '模拟题库',
- value: 'C'
- }
+ label: "模拟题库",
+ value: "C",
+ },
],
rules: [
{
@@ -471,7 +491,7 @@
trigger: "blur",
},
],
- span:24
+ span: 24,
},
// {
// label: "选项",
@@ -496,16 +516,16 @@
type: "radio",
dicData: [
{
- label: '正确',
- value: '正确'
- },
+ label: "正确",
+ value: "正确",
+ },
{
- label: '错误',
- value: '错误'
- }
+ label: "错误",
+ value: "错误",
+ },
],
- mock:{
- type:'dic',
+ mock: {
+ type: "dic",
},
rules: [
{
@@ -514,18 +534,18 @@
trigger: "blur",
},
],
- },
+ },
{
label: "解析",
prop: "analysis",
- span:24,
- type:"textarea"
+ span: 24,
+ type: "textarea",
},
{
label: "分值",
prop: "score",
- defaultValue:2,
- span:24,
+ defaultValue: 2,
+ span: 24,
rules: [
{
required: true,
@@ -534,12 +554,10 @@
},
],
},
-
],
-
},
- formFill:{
- score:1
+ formFill: {
+ score: 1,
},
optionFill: {
height: "auto",
@@ -547,7 +565,7 @@
tip: false,
searchShow: true,
searchMenuSpan: 6,
- border: false,
+ border: true, //liu
stripe: true,
align: "center",
index: true,
@@ -559,7 +577,7 @@
{
label: "题目名称",
prop: "subjectName",
- type:"textarea",
+ type: "textarea",
search: true,
rules: [
{
@@ -568,7 +586,7 @@
trigger: "blur",
},
],
- span:24
+ span: 24,
},
{
label: "类型",
@@ -577,17 +595,17 @@
type: "checkbox",
dicData: [
{
- label: '简易题库',
- value: 'A'
- },
+ label: "简易题库",
+ value: "A",
+ },
{
- label: '复杂题库',
- value: 'B'
- },
+ label: "复杂题库",
+ value: "B",
+ },
{
- label: '模拟题库',
- value: 'C'
- }
+ label: "模拟题库",
+ value: "C",
+ },
],
rules: [
{
@@ -596,19 +614,19 @@
trigger: "blur",
},
],
- span:24
+ span: 24,
},
{
label: "选项",
prop: "",
- type:"text",
- span:24
+ type: "text",
+ span: 24,
},
{
label: "1",
prop: "optionContent1",
- span:24,
- placeholder:"请输入内容",
+ span: 24,
+ placeholder: "请输入内容",
rules: [
{
required: true,
@@ -620,8 +638,8 @@
{
label: "2",
prop: "optionContent2",
- span:24,
- placeholder:"请输入内容",
+ span: 24,
+ placeholder: "请输入内容",
rules: [
{
required: true,
@@ -633,20 +651,20 @@
{
label: "3",
prop: "optionContent3",
- span:24,
- placeholder:"请输入内容"
+ span: 24,
+ placeholder: "请输入内容",
},
{
label: "4",
prop: "optionContent4",
- span:24,
- placeholder:"请输入内容"
+ span: 24,
+ placeholder: "请输入内容",
},
{
label: "5",
prop: "optionContent5",
- span:24,
- placeholder:"请输入内容"
+ span: 24,
+ placeholder: "请输入内容",
},
{
label: "答案",
@@ -659,17 +677,17 @@
trigger: "blur",
},
],
- },
+ },
{
label: "解析",
prop: "analysis",
- span:24,
- type:"textarea"
+ span: 24,
+ type: "textarea",
},
{
label: "分值",
prop: "score",
- span:24,
+ span: 24,
rules: [
{
required: true,
@@ -677,138 +695,143 @@
trigger: "blur",
},
],
- }
-
+ },
],
-
},
data: [],
- }
+ };
},
computed: {
...mapState({
- userInfo: state => state.user.userInfo
- })
+ userInfo: (state) => state.user.userInfo,
+ }),
},
- mounted() {
-
- },
+ mounted() {},
methods: {
//初始化
inits(id) {
this.id = id || 0;
this.visible = true;
- this.list = [{data:1}]
- if(this.id){
+ this.list = [{ data: 1 }];
+ if (this.id) {
//查询题目信息
this.getSubjectInfo(id);
}
},
//查询题目信息
- getSubjectInfo(id){
+ getSubjectInfo(id) {
var that = this;
var param = {
- id:id
- }
- getSubjectAnswer((param)).then(res => {
+ id: id,
+ };
+ getSubjectAnswer(param).then((res) => {
var data = res.data.data;
that.choicesType = data.choicesType.toString();
//单选题
- if(data.choicesType==0){
- that.form = data;
- that.optionContentAId = data.examSubjectOptions[0].id;
- that.optionContentBId = data.examSubjectOptions[1].id;
- that.optionContentCId = data.examSubjectOptions[2].id;
- that.optionContentDId = data.examSubjectOptions[3].id;
- that.form.optionContentA = data.examSubjectOptions[0].optionContent;
- that.form.optionContentB = data.examSubjectOptions[1].optionContent;
- that.form.optionContentC = data.examSubjectOptions[2].optionContent;
- that.form.optionContentD = data.examSubjectOptions[3].optionContent;
+ if (data.choicesType == 0) {
+ that.form = data;
+ that.optionContentAId = data.examSubjectOptions[0].id;
+ that.optionContentBId = data.examSubjectOptions[1].id;
+ that.optionContentCId = data.examSubjectOptions[2].id;
+ that.optionContentDId = data.examSubjectOptions[3].id;
+ that.form.optionContentA = data.examSubjectOptions[0].optionContent;
+ that.form.optionContentB = data.examSubjectOptions[1].optionContent;
+ that.form.optionContentC = data.examSubjectOptions[2].optionContent;
+ that.form.optionContentD = data.examSubjectOptions[3].optionContent;
}
//多选题
- if(data.choicesType==1){
- that.formCheckbox = data;
- that.optionContentAId = data.examSubjectOptions[0].id;
- that.optionContentBId = data.examSubjectOptions[1].id;
- that.optionContentCId = data.examSubjectOptions[2].id;
- that.optionContentDId = data.examSubjectOptions[3].id;
- that.formCheckbox.optionContentA = data.examSubjectOptions[0].optionContent;
- that.formCheckbox.optionContentB = data.examSubjectOptions[1].optionContent;
- that.formCheckbox.optionContentC = data.examSubjectOptions[2].optionContent;
- that.formCheckbox.optionContentD = data.examSubjectOptions[3].optionContent;
+ if (data.choicesType == 1) {
+ that.formCheckbox = data;
+ that.optionContentAId = data.examSubjectOptions[0].id;
+ that.optionContentBId = data.examSubjectOptions[1].id;
+ that.optionContentCId = data.examSubjectOptions[2].id;
+ that.optionContentDId = data.examSubjectOptions[3].id;
+ that.formCheckbox.optionContentA =
+ data.examSubjectOptions[0].optionContent;
+ that.formCheckbox.optionContentB =
+ data.examSubjectOptions[1].optionContent;
+ that.formCheckbox.optionContentC =
+ data.examSubjectOptions[2].optionContent;
+ that.formCheckbox.optionContentD =
+ data.examSubjectOptions[3].optionContent;
}
//判断题
- if(data.choicesType==2){
- that.formJudge = data;
+ if (data.choicesType == 2) {
+ that.formJudge = data;
}
//实操题
- if(data.choicesType==3){
- that.formFill = data;
- that.formFill.optionContent1 = data.examSubjectOptions[0].optionContent;
- that.formFill.optionContent2 = data.examSubjectOptions[1].optionContent;
- that.formFill.optionContent3 = data.examSubjectOptions[2].optionContent;
- that.formFill.optionContent4 = data.examSubjectOptions[3].optionContent;
- that.formFill.optionContent5 = data.examSubjectOptions[4].optionContent;
+ if (data.choicesType == 3) {
+ that.formFill = data;
+ that.formFill.optionContent1 =
+ data.examSubjectOptions[0].optionContent;
+ that.formFill.optionContent2 =
+ data.examSubjectOptions[1].optionContent;
+ that.formFill.optionContent3 =
+ data.examSubjectOptions[2].optionContent;
+ that.formFill.optionContent4 =
+ data.examSubjectOptions[3].optionContent;
+ that.formFill.optionContent5 =
+ data.examSubjectOptions[4].optionContent;
}
});
},
//加一行
- addRows(){
+ addRows() {
//获取已有行的数据
// debugger;
- if(this.index==6){
+ if (this.index == 6) {
return;
}
this.index++;
this.list.push({
- data:this.index
- })
- this.inputs[`input${this.index+1}`] = '';
- console.log(this.inputs)
- console.log(this.list,111);
+ data: this.index,
+ });
+ this.inputs[`input${this.index + 1}`] = "";
+ console.log(this.inputs);
+ console.log(this.list, 111);
},
//减一行
- deleteRows(index){
- if(this.index==1){
+ deleteRows(index) {
+ if (this.index == 1) {
return;
}
this.index--;
- this.list.splice(index,1);
+ this.list.splice(index, 1);
},
//单选题提交(新增)数据
submit(row, done, loading) {
var that = this;
- row['choicesType'] = this.choicesType;
- row['creator'] = this.userInfo.user_name;
+ row["choicesType"] = this.choicesType;
+ row["creator"] = this.userInfo.user_name;
row.tktype = row.tktype.join(",");
//选项信息
const examSubjectOptions = [
{
- id:that.optionContentAId,
- optionName:"A",
- optionContent:row.optionContentA,
- creator:this.userInfo.user_name,
+ id: that.optionContentAId,
+ optionName: "A",
+ optionContent: row.optionContentA,
+ creator: this.userInfo.user_name,
},
{
- id:that.optionContentBId,
- optionName:"B",
- optionContent:row.optionContentB,
- creator:this.userInfo.user_name,
+ id: that.optionContentBId,
+ optionName: "B",
+ optionContent: row.optionContentB,
+ creator: this.userInfo.user_name,
},
{
- id:that.optionContentCId,
- optionName:"C",
- optionContent:row.optionContentC,
- creator:this.userInfo.user_name,
+ id: that.optionContentCId,
+ optionName: "C",
+ optionContent: row.optionContentC,
+ creator: this.userInfo.user_name,
},
{
- id:that.optionContentDId,
- optionName:"D",
- optionContent:row.optionContentD,
- creator:this.userInfo.user_name,
- }
- ]
- row['examSubjectOptions'] = examSubjectOptions;
+ id: that.optionContentDId,
+ optionName: "D",
+ optionContent: row.optionContentD,
+ creator: this.userInfo.user_name,
+ },
+ ];
+ row["examSubjectOptions"] = examSubjectOptions;
saveSubjectChoicesAndOption(row).then(
() => {
this.$message({
@@ -828,38 +851,38 @@
//多选题提交(新增)数据
submitCheckbox(row, done, loading) {
var that = this;
- row['choicesType'] = this.choicesType;
- row['creator'] = this.userInfo.user_name;
+ row["choicesType"] = this.choicesType;
+ row["creator"] = this.userInfo.user_name;
row.tktype = row.tktype.join(",");
row.answer = row.answer.join(",");
//选项信息
const examSubjectOptions = [
{
- id:that.optionContentAId,
- optionName:"A",
- optionContent:row.optionContentA,
- creator:this.userInfo.user_name,
+ id: that.optionContentAId,
+ optionName: "A",
+ optionContent: row.optionContentA,
+ creator: this.userInfo.user_name,
},
{
- id:that.optionContentBId,
- optionName:"B",
- optionContent:row.optionContentB,
- creator:this.userInfo.user_name,
+ id: that.optionContentBId,
+ optionName: "B",
+ optionContent: row.optionContentB,
+ creator: this.userInfo.user_name,
},
{
- id:that.optionContentCId,
- optionName:"C",
- optionContent:row.optionContentC,
- creator:this.userInfo.user_name,
+ id: that.optionContentCId,
+ optionName: "C",
+ optionContent: row.optionContentC,
+ creator: this.userInfo.user_name,
},
{
- id:that.optionContentDId,
- optionName:"D",
- optionContent:row.optionContentD,
- creator:this.userInfo.user_name,
- }
- ]
- row['examSubjectOptions'] = examSubjectOptions;
+ id: that.optionContentDId,
+ optionName: "D",
+ optionContent: row.optionContentD,
+ creator: this.userInfo.user_name,
+ },
+ ];
+ row["examSubjectOptions"] = examSubjectOptions;
saveSubjectChoicesAndOption(row).then(
() => {
this.$message({
@@ -879,8 +902,8 @@
//判断题提交(新增)数据
submitJudge(row, done, loading) {
var that = this;
- row['choicesType'] = this.choicesType;
- row['creator'] = this.userInfo.user_name;
+ row["choicesType"] = this.choicesType;
+ row["creator"] = this.userInfo.user_name;
row.tktype = row.tktype.join(",");
saveSubjectChoicesAndOption(row).then(
() => {
@@ -901,47 +924,47 @@
//填空排序题提交(新增)数据
submitFill(row, done, loading) {
var that = this;
- row['choicesType'] = this.choicesType;
- row['creator'] = this.userInfo.user_name;
+ row["choicesType"] = this.choicesType;
+ row["creator"] = this.userInfo.user_name;
row.tktype = row.tktype.join(",");
//选项信息
var examSubjectOptions = [];
- if(row.optionContent1){
- examSubjectOptions.push({
- optionName:"1",
- optionContent:row.optionContent1,
- creator:this.userInfo.user_name,
- })
+ if (row.optionContent1) {
+ examSubjectOptions.push({
+ optionName: "1",
+ optionContent: row.optionContent1,
+ creator: this.userInfo.user_name,
+ });
}
- if(row.optionContent2){
- examSubjectOptions.push({
- optionName:"2",
- optionContent:row.optionContent2,
- creator:this.userInfo.user_name,
- })
+ if (row.optionContent2) {
+ examSubjectOptions.push({
+ optionName: "2",
+ optionContent: row.optionContent2,
+ creator: this.userInfo.user_name,
+ });
}
- if(row.optionContent3){
- examSubjectOptions.push({
- optionName:"3",
- optionContent:row.optionContent3,
- creator:this.userInfo.user_name,
- })
+ if (row.optionContent3) {
+ examSubjectOptions.push({
+ optionName: "3",
+ optionContent: row.optionContent3,
+ creator: this.userInfo.user_name,
+ });
}
- if(row.optionContent4){
- examSubjectOptions.push({
- optionName:"4",
- optionContent:row.optionContent4,
- creator:this.userInfo.user_name,
- })
+ if (row.optionContent4) {
+ examSubjectOptions.push({
+ optionName: "4",
+ optionContent: row.optionContent4,
+ creator: this.userInfo.user_name,
+ });
}
- if(row.optionContent5){
- examSubjectOptions.push({
- optionName:"5",
- optionContent:row.optionContent5,
- creator:this.userInfo.user_name,
- })
+ if (row.optionContent5) {
+ examSubjectOptions.push({
+ optionName: "5",
+ optionContent: row.optionContent5,
+ creator: this.userInfo.user_name,
+ });
}
- row['examSubjectOptions'] = examSubjectOptions;
+ row["examSubjectOptions"] = examSubjectOptions;
saveSubjectChoicesAndOption(row).then(
() => {
this.$message({
@@ -959,45 +982,41 @@
);
},
//关闭窗口清除数据
- closeDialog(){
- if(this.choicesType==0){
- this.$refs.form.resetFields();
+ closeDialog() {
+ if (this.choicesType == 0) {
+ this.$refs.form.resetFields();
}
-
- if(this.choicesType==1){
+
+ if (this.choicesType == 1) {
this.$refs.formCheckbox.resetFields();
}
- if(this.choicesType==2){
+ if (this.choicesType == 2) {
this.$refs.formJudge.resetFields();
}
- if(this.choicesType==3){
+ if (this.choicesType == 3) {
this.$refs.formFill.resetFields();
}
- }
+ },
},
};
</script>
<style scoped>
-
-.optionContent-suffix{
+.optionContent-suffix {
margin-top: 5px;
}
-.optionContent-suffix span{
+.optionContent-suffix span {
margin-left: -20px;
}
-
-.optionContent-suffix .optionContent-input{
+.optionContent-suffix .optionContent-input {
width: 90%;
margin-left: 10px;
}
-
-.optionContent-suffix .optionContent-botton{
+.optionContent-suffix .optionContent-botton {
margin-left: 10px;
}
-
</style>
\ No newline at end of file
--
Gitblit v1.9.3