|
@@ -1,14 +1,19 @@
|
|
|
<template>
|
|
|
<div class="edit_box">
|
|
|
<div class="e_add">
|
|
|
- <div class="title">题目添加</div>
|
|
|
+ <div class="title" style="margin-bottom: 20px;">题目添加</div>
|
|
|
<div class="e_add_box">
|
|
|
- <div class="title">添加题型</div>
|
|
|
+ <div class="title">基础题型</div>
|
|
|
<div class="e_add_ci">
|
|
|
- <div class="title">基础题型</div>
|
|
|
+ <!-- <div class="title">基础题型</div> -->
|
|
|
<div class="box">
|
|
|
- <div class="btn" v-for="item in options" :key="item.label" @click="addCheck(item.value)"><el-button type="primary"
|
|
|
- size="mini">{{ item.label }}</el-button></div>
|
|
|
+ <div class="btn" v-for="item in options" :key="item.label" @click="addCheck(item.value)">
|
|
|
+ <!-- <el-button type="primary"
|
|
|
+ size="mini">{{ item.label }}</el-button> -->
|
|
|
+ <button class="pub_test_btn"
|
|
|
+ :class="{ pub_test_btn_text: item.value == 3, pub_test_btn_choose: item.value == 1, pub_test_btn_file: item.value == 5 }">{{
|
|
|
+ item.label }}</button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -16,22 +21,29 @@
|
|
|
<div class="title">添加组件</div>
|
|
|
<div class="e_add_ci">
|
|
|
<div class="box">
|
|
|
- <div class="btn" v-for="item in buttonOptions" :key="item.name" @click="addQtype(item.type)"><el-button type="primary"
|
|
|
- size="mini">{{ item.name }}</el-button></div>
|
|
|
+ <div class="btn" v-for="item in buttonOptions" :key="item.name" @click="addQtype(item.type)">
|
|
|
+ <!-- <el-button type="primary"
|
|
|
+ size="mini">{{ item.name }}</el-button> -->
|
|
|
+ <button class="pub_test_btn"
|
|
|
+ :class="{ pub_test_btn_group: item.type == 1, pub_test_btn_page: item.type == 2 }">{{ item.name
|
|
|
+ }}</button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="e_content">
|
|
|
- <div class="title">{{title}}</div>
|
|
|
+ <div class="title">{{ title }}</div>
|
|
|
<div class="e_order_box">
|
|
|
- <checkOrder :checkC.sync="checkC" :checkJson="manualJson" @changeJson="changeJson" etype="edit"></checkOrder>
|
|
|
+ <checkOrder :checkC.sync="checkC" :checkJson="manualJson" @changeJson="changeJson" etype="edit" :cJson.sync="cJson">
|
|
|
+ </checkOrder>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="e_order">
|
|
|
<div class="title">题目排序 <span style="font-size: 14px;color: #373737;">总分:{{ score }}分</span></div>
|
|
|
<div class="e_order_box" style="margin-top: 20px;">
|
|
|
- <checkOrder :checkC.sync="checkC" :checkJson="manualJson" @changeJson="changeJson" etype="order"></checkOrder>
|
|
|
+ <checkOrder :checkC.sync="checkC" :checkJson="manualJson" @changeJson="changeJson" etype="order" :cJson.sync="cJson">
|
|
|
+ </checkOrder>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -49,19 +61,20 @@ export default {
|
|
|
checkJson: {
|
|
|
type: Array,
|
|
|
},
|
|
|
- title:{
|
|
|
- type:String
|
|
|
+ title: {
|
|
|
+ type: String
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
manualJson: [],
|
|
|
checkC: "",
|
|
|
+ cJson:{}
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
- checkJson:{
|
|
|
- handler(newVal){
|
|
|
+ checkJson: {
|
|
|
+ handler(newVal) {
|
|
|
this.manualJson = this.depthCopy(newVal);
|
|
|
},
|
|
|
deep: true
|
|
@@ -73,21 +86,21 @@ export default {
|
|
|
this.manualJson.forEach(el => {
|
|
|
if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
|
|
|
el.array.forEach(item => {
|
|
|
- if(item.ttype == 2 && item.array.length > 0){
|
|
|
- item.array.forEach(item2 => {
|
|
|
- if(item2.ttype == 1 && item2.json){
|
|
|
- score += item2.json.score ? parseFloat(item2.json.score) : 0
|
|
|
- }
|
|
|
- })
|
|
|
- } else if(item.ttype == 1 && item.json){
|
|
|
- score += item.json.score ? parseFloat(item.json.score) : 0
|
|
|
- }
|
|
|
+ if (item.ttype == 2 && item.array.length > 0) {
|
|
|
+ item.array.forEach(item2 => {
|
|
|
+ if (item2.ttype == 1 && item2.json) {
|
|
|
+ score += item2.json.score ? parseFloat(item2.json.score) : 0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (item.ttype == 1 && item.json) {
|
|
|
+ score += item.json.score ? parseFloat(item.json.score) : 0
|
|
|
+ }
|
|
|
})
|
|
|
- } else if(el.ttype == 1 && el.json){
|
|
|
+ } else if (el.ttype == 1 && el.json) {
|
|
|
score += el.json.score ? parseFloat(el.json.score) : 0
|
|
|
}
|
|
|
})
|
|
|
- return score > 0 ? score : '未设置分数'
|
|
|
+ return score > 0 ? score : '未设置分数'
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -116,33 +129,33 @@ export default {
|
|
|
if (_json.array) {
|
|
|
if (type == 3 && _check.length == 2) {
|
|
|
if (this.manualJson[_check[0]].array[_check[1]].array) {
|
|
|
- this.manualJson[_check[0]].array[_check[1]].array.push(json)
|
|
|
+ this.manualJson[_check[0]].array[_check[1]].array.push(json)
|
|
|
} else {
|
|
|
- this.manualJson[_check[0]].array.splice(parseInt(_check[1]) + 1, 0, json)
|
|
|
+ this.manualJson[_check[0]].array.splice(parseInt(_check[1]) + 1, 0, json)
|
|
|
}
|
|
|
|
|
|
} else if (type == 3 && _check.length == 3) {
|
|
|
- this.manualJson[_check[0]].array[_check[1]].array.splice(parseInt(_check[2]) + 1, 0, json)
|
|
|
+ this.manualJson[_check[0]].array[_check[1]].array.splice(parseInt(_check[2]) + 1, 0, json)
|
|
|
} else if (type == 2 && _check.length == 2) {
|
|
|
- this.manualJson[_check[0]].array.splice(parseInt(_check[1]) + 1, 0, json)
|
|
|
+ this.manualJson[_check[0]].array.splice(parseInt(_check[1]) + 1, 0, json)
|
|
|
} else if (type == 2 && _check.length == 1) {
|
|
|
- this.manualJson[_check[0]].array.push(json)
|
|
|
+ this.manualJson[_check[0]].array.push(json)
|
|
|
} else if (type == 3 && _check.length == 1) {
|
|
|
- if(this.manualJson[_check[0]].array[0] && this.manualJson[_check[0]].array[0].array){
|
|
|
- this.manualJson[_check[0]].array[0].array.push(json)
|
|
|
- }else{
|
|
|
- this.manualJson[_check[0]].array.push(json)
|
|
|
+ if (this.manualJson[_check[0]].array[0] && this.manualJson[_check[0]].array[0].array) {
|
|
|
+ this.manualJson[_check[0]].array[0].array.push(json)
|
|
|
+ } else {
|
|
|
+ this.manualJson[_check[0]].array.push(json)
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- this.manualJson.splice(parseInt(_check[0]) + 1, 0, json);
|
|
|
+ this.manualJson.splice(parseInt(_check[0]) + 1, 0, json);
|
|
|
}
|
|
|
} else {
|
|
|
if (type == 1) {
|
|
|
- this.manualJson.push({
|
|
|
- ttype: 1,
|
|
|
- type: topicType
|
|
|
- });
|
|
|
+ this.manualJson.push({
|
|
|
+ ttype: 1,
|
|
|
+ type: topicType
|
|
|
+ });
|
|
|
} else if (type == 3 || type == 2) {
|
|
|
this.$message.error("请选中分页或者分组添加题目");
|
|
|
return;
|
|
@@ -257,7 +270,7 @@ export default {
|
|
|
overflow: hidden;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
- padding: 10px 0 0;
|
|
|
+ padding: 0 0 0;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
|
|
@@ -268,18 +281,19 @@ export default {
|
|
|
overflow: auto;
|
|
|
padding: 20px 10px;
|
|
|
box-sizing: border-box;
|
|
|
+ border-right: 1px solid #E5E5E5;
|
|
|
}
|
|
|
|
|
|
.e_content {
|
|
|
height: 100%;
|
|
|
- width: calc(100% - 620px);
|
|
|
+ width: calc(100% - 600px);
|
|
|
background: #fff;
|
|
|
overflow: auto;
|
|
|
- padding: 20px 10px;
|
|
|
+ padding: 20px 0;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
|
|
|
-.e_content > .title{
|
|
|
+.e_content>.title {
|
|
|
font-size: 24px;
|
|
|
font-weight: bold;
|
|
|
text-align: center;
|
|
@@ -305,17 +319,30 @@ export default {
|
|
|
|
|
|
.e_add_box {
|
|
|
width: 100%;
|
|
|
- border: 1px solid #dcdcdc;
|
|
|
- margin-top: 20px;
|
|
|
+ /* border: 1px solid #dcdcdc; */
|
|
|
+ margin-top: 10px;
|
|
|
border-radius: 3px;
|
|
|
- background: #f4f4f4;
|
|
|
+ /* background: #f4f4f4; */
|
|
|
box-sizing: border-box;
|
|
|
- padding: 10px 20px;
|
|
|
+ padding: 0 20px 0;
|
|
|
}
|
|
|
|
|
|
.e_add_box>.title {
|
|
|
- text-align: center;
|
|
|
- font-weight: bold;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ font-size: 15px;
|
|
|
+ font-weight: 700;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.e_add_box>.title::before{
|
|
|
+ content: '';
|
|
|
+ width: 10px;
|
|
|
+ height: 10px;
|
|
|
+ border-radius: 50%;
|
|
|
+ background: rgb(54, 129, 252);
|
|
|
+ margin-right: 10px;
|
|
|
+ display: block;
|
|
|
}
|
|
|
|
|
|
.e_add_box>.e_add_ci {
|