|
@@ -15,8 +15,13 @@
|
|
@emitData="emitData"
|
|
@emitData="emitData"
|
|
>
|
|
>
|
|
<template slot="customize">
|
|
<template slot="customize">
|
|
- <el-button size="medium" @click="dialogDRword = true" type="success"
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ size="medium"
|
|
|
|
+ @click="$refs.wordpop.dialogDRword = true"
|
|
|
|
+ type="success"
|
|
>Word批量导入</el-button
|
|
>Word批量导入</el-button
|
|
|
|
+ ><el-button size="medium" @click="openExcel" type="success"
|
|
|
|
+ >Excel批量导入</el-button
|
|
>
|
|
>
|
|
</template>
|
|
</template>
|
|
<template slot="btn" slot-scope="props">
|
|
<template slot="btn" slot-scope="props">
|
|
@@ -30,7 +35,6 @@
|
|
</table-list>
|
|
</table-list>
|
|
<div class="centerStys">
|
|
<div class="centerStys">
|
|
<el-button size="small" @click="backPage">取消</el-button>
|
|
<el-button size="small" @click="backPage">取消</el-button>
|
|
- <el-button size="small" type="warning" @click="preview">预览</el-button>
|
|
|
|
<el-button
|
|
<el-button
|
|
size="small"
|
|
size="small"
|
|
type="primary"
|
|
type="primary"
|
|
@@ -39,28 +43,6 @@
|
|
>确定</el-button
|
|
>确定</el-button
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
- <el-dialog
|
|
|
|
- :visible.sync="dialogDRword"
|
|
|
|
- :append-to-body="true"
|
|
|
|
- width="780px"
|
|
|
|
- :show-close="false"
|
|
|
|
- :close-on-click-modal="false"
|
|
|
|
- >
|
|
|
|
- <div slot="title" class="hearders">
|
|
|
|
- <div class="leftTitle">批量导入</div>
|
|
|
|
- <div class="rightBoxs">
|
|
|
|
- <img
|
|
|
|
- src="@/assets/images/Close@2x.png"
|
|
|
|
- alt=""
|
|
|
|
- @click="dialogDRword = false"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <word-pop ref="wordpop" />
|
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
|
- <el-button @click="dialogDRword = false">取 消</el-button>
|
|
|
|
- </span>
|
|
|
|
- </el-dialog>
|
|
|
|
<el-dialog
|
|
<el-dialog
|
|
width="1080px"
|
|
width="1080px"
|
|
:visible.sync="innerVisiblePaperTopic"
|
|
:visible.sync="innerVisiblePaperTopic"
|
|
@@ -672,30 +654,9 @@
|
|
>
|
|
>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
- <el-dialog
|
|
|
|
- :visible.sync="dialogDRexcel"
|
|
|
|
- :append-to-body="true"
|
|
|
|
- width="780px"
|
|
|
|
- :show-close="false"
|
|
|
|
- :close-on-click-modal="false"
|
|
|
|
- >
|
|
|
|
- <div slot="title" class="hearders">
|
|
|
|
- <div class="leftTitle">批量导入</div>
|
|
|
|
- <div class="rightBoxs">
|
|
|
|
- <img
|
|
|
|
- src="@/assets/images/Close@2x.png"
|
|
|
|
- alt=""
|
|
|
|
- @click="dialogDRexcel = false"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <excel-pop @backData="backData" />
|
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
|
- <el-button @click="dialogDRexcel = false">取 消</el-button>
|
|
|
|
- </span>
|
|
|
|
- </el-dialog>
|
|
|
|
|
|
+ <word-pop ref="wordpop" @backwordData="backwordData" />
|
|
|
|
+ <excel-pop ref="excelpop" @backExcelData="backExcelData" />
|
|
</div>
|
|
</div>
|
|
- <test-paper-preview ref="testPaperPreview" />
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -705,7 +666,6 @@ import pagination from "@/components/pagination";
|
|
import tableList from "@/components/tableList";
|
|
import tableList from "@/components/tableList";
|
|
import busIns from "@/components/busIns";
|
|
import busIns from "@/components/busIns";
|
|
import questionBank from "@/components/questionBank";
|
|
import questionBank from "@/components/questionBank";
|
|
-import testPaperPreview from "@/components/testPaperPreview";
|
|
|
|
import wordPop from "../../wordPop.vue";
|
|
import wordPop from "../../wordPop.vue";
|
|
import excelPop from "../../excelPop.vue";
|
|
import excelPop from "../../excelPop.vue";
|
|
export default {
|
|
export default {
|
|
@@ -717,7 +677,6 @@ export default {
|
|
busIns,
|
|
busIns,
|
|
questionBank,
|
|
questionBank,
|
|
wordPop,
|
|
wordPop,
|
|
- testPaperPreview,
|
|
|
|
excelPop,
|
|
excelPop,
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
@@ -780,6 +739,7 @@ export default {
|
|
prop: "type",
|
|
prop: "type",
|
|
hidden: true,
|
|
hidden: true,
|
|
scope: "topic",
|
|
scope: "topic",
|
|
|
|
+ width:"140px"
|
|
},
|
|
},
|
|
{
|
|
{
|
|
label: "标题前缀",
|
|
label: "标题前缀",
|
|
@@ -808,6 +768,7 @@ export default {
|
|
prop: "publishStatus",
|
|
prop: "publishStatus",
|
|
hidden: true,
|
|
hidden: true,
|
|
scope: "fabStatus",
|
|
scope: "fabStatus",
|
|
|
|
+ width:"140px"
|
|
},
|
|
},
|
|
],
|
|
],
|
|
tableData: [],
|
|
tableData: [],
|
|
@@ -1058,75 +1019,20 @@ export default {
|
|
this.localStart = false;
|
|
this.localStart = false;
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- preview() {
|
|
|
|
- var num = 0;
|
|
|
|
- this.tableData.forEach((item) => {
|
|
|
|
- num += item.score;
|
|
|
|
- });
|
|
|
|
- var topData = {
|
|
|
|
- getAllpocis: num,
|
|
|
|
- passScore: this.passScore,
|
|
|
|
- doType: this.examsType,
|
|
|
|
- };
|
|
|
|
- if (this.djTimeType === 0) {
|
|
|
|
- topData.answerTime = 0;
|
|
|
|
- } else {
|
|
|
|
- topData.answerTime = this.djTime;
|
|
|
|
- }
|
|
|
|
- if (this.djNumType === 0) {
|
|
|
|
- topData.answerNum = 0;
|
|
|
|
- } else {
|
|
|
|
- topData.answerNum = this.djNum;
|
|
|
|
- }
|
|
|
|
- let data = {
|
|
|
|
- topData: topData,
|
|
|
|
- tableData: this.tableData,
|
|
|
|
- };
|
|
|
|
- this.$refs.testPaperPreview.openBox(2, data);
|
|
|
|
|
|
+ openExcel() {
|
|
|
|
+ this.$refs.excelpop.openBoxs(this.tableData, this.businObj);
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
|
|
+ * 返回word数据
|
|
|
|
+ */
|
|
|
|
+ backwordData(data) {
|
|
|
|
+ this.tableData = this.tableData.concat(data);
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
* 返回数据
|
|
* 返回数据
|
|
*/
|
|
*/
|
|
- backData(arr) {
|
|
|
|
- for (let i = 0; i < arr.length; i++) {
|
|
|
|
- arr[i].partScore = 0;
|
|
|
|
- arr[i].score = "";
|
|
|
|
- arr[i].status = 1;
|
|
|
|
- arr[i].businessList = [this.businObj];
|
|
|
|
- if (arr[i].type === 4) {
|
|
|
|
- arr[i].optionsList = JSON.parse(arr[i].jsonStr);
|
|
|
|
- arr[i].optionsList.forEach((item) => {
|
|
|
|
- if (item.type === 3 || item.type === 5) {
|
|
|
|
- item.optionsList = [];
|
|
|
|
- item.jsonStr = "";
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- } else if (arr[i].type === 5) {
|
|
|
|
- arr[i].jsonStr = "";
|
|
|
|
- arr[i].optionsList = [];
|
|
|
|
- } else {
|
|
|
|
- arr[i].jsonStr = JSON.stringify(arr[i].optionsList);
|
|
|
|
- }
|
|
|
|
- if (this.tableData.length) {
|
|
|
|
- let maxIndex = 0;
|
|
|
|
- let childrenIndex = 0;
|
|
|
|
- this.tableData.forEach((item) => {
|
|
|
|
- if (item.sort > maxIndex) {
|
|
|
|
- maxIndex = item.sort;
|
|
|
|
- }
|
|
|
|
- if (item.index > childrenIndex) {
|
|
|
|
- childrenIndex = item.index;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- arr[i].sort = maxIndex + 1;
|
|
|
|
- arr[i].index = childrenIndex + 1;
|
|
|
|
- } else {
|
|
|
|
- arr[i].sort = 1;
|
|
|
|
- arr[i].index = 0;
|
|
|
|
- }
|
|
|
|
- this.tableData.push(arr[i]);
|
|
|
|
- this.dialogDRexcel = false;
|
|
|
|
- }
|
|
|
|
|
|
+ backExcelData(arr) {
|
|
|
|
+ this.tableData = this.tableData.concat(arr);
|
|
},
|
|
},
|
|
setInterFunc() {
|
|
setInterFunc() {
|
|
var arr = setInterval(() => {
|
|
var arr = setInterval(() => {
|
|
@@ -1668,32 +1574,20 @@ export default {
|
|
data.index = 0;
|
|
data.index = 0;
|
|
}
|
|
}
|
|
this.tableData.push(data);
|
|
this.tableData.push(data);
|
|
- // this.$api.addbankquestion(data).then((res) => {
|
|
|
|
self.$message.success("添加成功");
|
|
self.$message.success("添加成功");
|
|
self.innerVisiblePaperTopic = false;
|
|
self.innerVisiblePaperTopic = false;
|
|
self.showHide = false;
|
|
self.showHide = false;
|
|
- // self.search();
|
|
|
|
- // });
|
|
|
|
}
|
|
}
|
|
if (this.statusPop === 0) {
|
|
if (this.statusPop === 0) {
|
|
- let indexy = this.tableData.findIndex((item) => {
|
|
|
|
- return item.index === this.indexZB;
|
|
|
|
- });
|
|
|
|
- this.tableData.splice(indexy, 1, data);
|
|
|
|
- if (this.uploadStatus) {
|
|
|
|
- this.$refs.testPaperPreview.changeUploadStatus(data);
|
|
|
|
- }
|
|
|
|
- // this.$api.editbankquestion(data).then((res) => {
|
|
|
|
|
|
+ this.tableData.splice(this.indexZB, 1, data);
|
|
self.$message.success("修改成功");
|
|
self.$message.success("修改成功");
|
|
self.innerVisiblePaperTopic = false;
|
|
self.innerVisiblePaperTopic = false;
|
|
self.showHide = false;
|
|
self.showHide = false;
|
|
- // self.search();
|
|
|
|
- // });
|
|
|
|
- /**
|
|
|
|
- * 核心语句👇表格定制化需要使用jsonStr字段,与题目管理同步字段,所以需要实时更新jsonStr
|
|
|
|
- */
|
|
|
|
- data.jsonStr = JSON.stringify(data.optionsList);
|
|
|
|
}
|
|
}
|
|
|
|
+ /**
|
|
|
|
+ * 核心语句👇表格定制化需要使用jsonStr字段,与题目管理同步字段,所以需要实时更新jsonStr
|
|
|
|
+ */
|
|
|
|
+ data.jsonStr = JSON.stringify(data.optionsList);
|
|
} else {
|
|
} else {
|
|
console.log("error submit!!");
|
|
console.log("error submit!!");
|
|
return false;
|
|
return false;
|
|
@@ -1736,7 +1630,7 @@ export default {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
var arrs = [];
|
|
var arrs = [];
|
|
- for (let i = 0; i < this.tableData.length; i++) {
|
|
|
|
|
|
+ for (let i = this.tableData.length-1; i >= 0; i--) {
|
|
if (self.tableData[i].questionId) {
|
|
if (self.tableData[i].questionId) {
|
|
await self.uploadApis(self.tableData[i]);
|
|
await self.uploadApis(self.tableData[i]);
|
|
} else {
|
|
} else {
|