Commit 818e50d7a4e9fee2ed31e79f3394f5023f44e082

Authored by 梁保满
1 parent a0d49348

标签删除,修改

public/index.html
@@ -5,6 +5,9 @@ @@ -5,6 +5,9 @@
5 <meta charset="utf-8"> 5 <meta charset="utf-8">
6 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 6 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
7 <meta name="viewport" content="width=device-width,initial-scale=1.0"> 7 <meta name="viewport" content="width=device-width,initial-scale=1.0">
  8 + <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
  9 + <meta http-equiv="Pragma" content="no-cache" />
  10 + <meta http-equiv="Expires" content="0" />
8 <!-- <link rel="icon" href="<%= BASE_URL %>favicon.ico"> --> 11 <!-- <link rel="icon" href="<%= BASE_URL %>favicon.ico"> -->
9 <title> 12 <title>
10 <%= htmlWebpackPlugin.options.title %> 13 <%= htmlWebpackPlugin.options.title %>
@@ -16,8 +19,8 @@ @@ -16,8 +19,8 @@
16 var link = document.querySelector("link[rel*='icon']") || document.createElement('link'); 19 var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
17 link.type = 'image/x-icon'; 20 link.type = 'image/x-icon';
18 link.rel = 'shortcut icon'; 21 link.rel = 'shortcut icon';
19 - var csCode = localStorage.getItem("csCode")||""  
20 - link.href = csCode?"./331icon.ico":"./favicon.ico"; 22 + var csCode = localStorage.getItem("csCode") || ""
  23 + link.href = csCode ? "./331icon.ico" : "./favicon.ico";
21 document.getElementsByTagName('head')[0].appendChild(link); 24 document.getElementsByTagName('head')[0].appendChild(link);
22 </script> 25 </script>
23 <noscript> 26 <noscript>
src/api/apis/answerSheet.js
@@ -59,6 +59,22 @@ export default { @@ -59,6 +59,22 @@ export default {
59 data 59 data
60 }) 60 })
61 }, 61 },
  62 + // 修改答题卡测验类型
  63 + editPaperType(data) {
  64 + return service({
  65 + url: answerSheet.editPaperType,
  66 + method: 'POST',
  67 + data
  68 + })
  69 + },
  70 + // 删除答题卡测验类型
  71 + delPaperType(data) {
  72 + return service({
  73 + url: answerSheet.delPaperType,
  74 + method: 'POST',
  75 + data
  76 + })
  77 + },
62 // 保存答题卡 78 // 保存答题卡
63 addPaper(data) { 79 addPaper(data) {
64 return service({ 80 return service({
src/api/urls/answerSheet.js
@@ -13,6 +13,10 @@ export default { @@ -13,6 +13,10 @@ export default {
13 subjectList: "/api_html/teaching/subjectList", 13 subjectList: "/api_html/teaching/subjectList",
14 // 添加答题卡测验类型 14 // 添加答题卡测验类型
15 addPaperType: "/api_html/teaching/addPaperType", 15 addPaperType: "/api_html/teaching/addPaperType",
  16 + // 修改答题卡测验类型
  17 + editPaperType: "/api_html/teaching/modifyPaperType",
  18 + // 删除答题卡测验类型
  19 + delPaperType: "/api_html/teaching/delPaperType",
16 // 保存答题卡 20 // 保存答题卡
17 addPaper: "/api_html/teaching/addPaper", 21 addPaper: "/api_html/teaching/addPaper",
18 // 删除答题卡 22 // 删除答题卡
src/views/examinationPaper/add.vue
@@ -51,8 +51,8 @@ @@ -51,8 +51,8 @@
51 type="primary" 51 type="primary"
52 round 52 round
53 circle 53 circle
54 - icon="el-icon-plus"  
55 - @click="dialogVisible = true" 54 + icon="el-icon-edit"
  55 + @click="openTagDia"
56 ></el-button> 56 ></el-button>
57 </el-form-item> 57 </el-form-item>
58 <el-form-item label="年级:" prop="gradeName"> 58 <el-form-item label="年级:" prop="gradeName">
@@ -107,24 +107,76 @@ @@ -107,24 +107,76 @@
107 <el-button type="primary" round @click="setStep1">下一步</el-button> 107 <el-button type="primary" round @click="setStep1">下一步</el-button>
108 </div> 108 </div>
109 <el-dialog 109 <el-dialog
110 - title="添加测验类型" 110 + title="设置测验类型"
111 :visible.sync="dialogVisible" 111 :visible.sync="dialogVisible"
112 width="500px" 112 width="500px"
113 > 113 >
114 <div class="dia-content"> 114 <div class="dia-content">
  115 + <p class="add-type" v-for="item in tagList" :key="item.id">
  116 + <el-row :gutter="10">
  117 + <el-col :span="18"
  118 + ><el-input v-model="item.typeName" placeholder=""></el-input
  119 + ></el-col>
  120 + <el-col :span="6">
  121 + <el-tooltip effect="dark" content="修改" placement="top">
  122 + <el-button
  123 + class="js-set"
  124 + type="primary"
  125 + size="small"
  126 + round
  127 + circle
  128 + icon="el-icon-edit"
  129 + @click="editTypeName(item)"
  130 + ></el-button>
  131 + </el-tooltip>
  132 + <el-tooltip effect="dark" content="删除" placement="right">
  133 + <el-popconfirm
  134 + title="确定删除这道大题吗?"
  135 + @confirm="removeTypeName(item)"
  136 + >
  137 + <el-button
  138 + class="js-set"
  139 + type="danger"
  140 + size="small"
  141 + round
  142 + circle
  143 + icon="el-icon-delete"
  144 + slot="reference"
  145 + ></el-button>
  146 + </el-popconfirm>
  147 + </el-tooltip>
  148 + </el-col>
  149 + </el-row>
  150 + </p>
115 <p class="add-type"> 151 <p class="add-type">
116 - <el-input  
117 - type="text"  
118 - placeholder="请输入答题卡类型名称"  
119 - v-model.trim="answerTypeName"  
120 - :maxlength="10"  
121 - >  
122 - </el-input> 152 + <el-row :gutter="10">
  153 + <el-col :span="18">
  154 + <el-input
  155 + type="text"
  156 + placeholder="请输入答题卡类型名称"
  157 + v-model.trim="answerTypeName"
  158 + :maxlength="10"
  159 + >
  160 + </el-input>
  161 + </el-col>
  162 + <el-col :span="6">
  163 + <el-tooltip effect="dark" content="添加" placement="right">
  164 + <el-button
  165 + class="js-set"
  166 + type="primary"
  167 + size="small"
  168 + round
  169 + circle
  170 + icon="el-icon-plus"
  171 + @click="addPaperType"
  172 + ></el-button>
  173 + </el-tooltip>
  174 + </el-col>
  175 + </el-row>
123 </p> 176 </p>
124 </div> 177 </div>
125 <div class="" slot="footer"> 178 <div class="" slot="footer">
126 - <el-button type="primary" @click="addPaperType">确 定</el-button>  
127 - <el-button @click="dialogVisible = false">取 消</el-button> 179 + <el-button @click="dialogVisible = false">关 闭</el-button>
128 </div> 180 </div>
129 </el-dialog> 181 </el-dialog>
130 </div> 182 </div>
@@ -703,6 +755,7 @@ export default { @@ -703,6 +755,7 @@ export default {
703 { required: true, message: "请设置考试时长", trigger: "blur" }, 755 { required: true, message: "请设置考试时长", trigger: "blur" },
704 ], 756 ],
705 }, 757 },
  758 + tagList: [],
706 diaSetAns: false, 759 diaSetAns: false,
707 formAns: { 760 formAns: {
708 listIndex: 0, //大题位置 761 listIndex: 0, //大题位置
@@ -788,7 +841,7 @@ export default { @@ -788,7 +841,7 @@ export default {
788 return !!item.questionType; 841 return !!item.questionType;
789 }); 842 });
790 lengths = subArr.length; 843 lengths = subArr.length;
791 - return lengths 844 + return lengths;
792 }, 845 },
793 setBigNum(num) { 846 setBigNum(num) {
794 let txt = ""; 847 let txt = "";
@@ -1196,6 +1249,47 @@ export default { @@ -1196,6 +1249,47 @@ export default {
1196 sub.correctAnswer = arrs.sort().join(""); 1249 sub.correctAnswer = arrs.sort().join("");
1197 } 1250 }
1198 }, 1251 },
  1252 + openTagDia() {
  1253 + this.tagList = deepClone(this.answerTypeList);
  1254 + this.dialogVisible = true;
  1255 + },
  1256 + async editTypeName(obj) {
  1257 + let isRepeat = false;
  1258 + this.answerTypeList.map((item) => {
  1259 + if (item.typeName == obj.typeName) {
  1260 + isRepeat = true;
  1261 + }
  1262 + });
  1263 + if (isRepeat) {
  1264 + this.$message.error("类型已存在请重新填写!");
  1265 + return;
  1266 + }
  1267 + //修改测验类型
  1268 + const { data, status, info } = await this.$request.editPaperType({
  1269 + tagId: obj.id,
  1270 + tag: obj.typeName,
  1271 + });
  1272 + if (status == 0) {
  1273 + await this._TypeList();
  1274 + this.tagList = deepClone(this.answerTypeList);
  1275 + this.$message.success("修改成功");
  1276 + } else {
  1277 + this.$message.error(info);
  1278 + }
  1279 + },
  1280 + async removeTypeName(obj) {
  1281 + //删除测验类型
  1282 + const { data, status, info } = await this.$request.delPaperType({
  1283 + tagId: obj.id,
  1284 + });
  1285 + if (status == 0) {
  1286 + await this._TypeList();
  1287 + this.tagList = deepClone(this.answerTypeList);
  1288 + this.$message.success("删除成功");
  1289 + } else {
  1290 + this.$message.error(info);
  1291 + }
  1292 + },
1199 async addPaperType() { 1293 async addPaperType() {
1200 //保存测验类型 1294 //保存测验类型
1201 if (!this.answerTypeName) { 1295 if (!this.answerTypeName) {
@@ -1218,8 +1312,8 @@ export default { @@ -1218,8 +1312,8 @@ export default {
1218 }); 1312 });
1219 if (status == 0) { 1313 if (status == 0) {
1220 await this._TypeList(); 1314 await this._TypeList();
  1315 + this.tagList = deepClone(this.answerTypeList);
1221 this.form.tagId = data || ""; 1316 this.form.tagId = data || "";
1222 - this.dialogVisible = false;  
1223 this.answerTypeName = ""; 1317 this.answerTypeName = "";
1224 this.$message.success("添加成功"); 1318 this.$message.success("添加成功");
1225 } else { 1319 } else {
@@ -1405,7 +1499,12 @@ export default { @@ -1405,7 +1499,12 @@ export default {
1405 text-align: center; 1499 text-align: center;
1406 } 1500 }
1407 .add-type { 1501 .add-type {
1408 - display: flex; 1502 + width: 100%;
  1503 + margin-bottom: 10px;
  1504 + .js-set {
  1505 + margin: 2.5px 10px 0 0;
  1506 + font-size: 14px;
  1507 + }
1409 } 1508 }
1410 .add-btn { 1509 .add-btn {
1411 margin-left: 20px; 1510 margin-left: 20px;