Commit c2460294f6fc394feeea49b3dd459a71ab07e1ef

Authored by 梁保满
1 parent 21dfdeae

平台管理员接口联调

src/api/apis/apis.js
... ... @@ -1162,4 +1162,44 @@ export default {
1162 1162 data
1163 1163 });
1164 1164 },
  1165 + //基站统计数据
  1166 + pStationReport(data) {
  1167 + return service({
  1168 + url: setUpUrls.pStationReport,
  1169 + method: "POST",
  1170 + data
  1171 + });
  1172 + },
  1173 + //答题器统计数据
  1174 + pKeyboardReport(data) {
  1175 + return service({
  1176 + url: setUpUrls.pKeyboardReport,
  1177 + method: "POST",
  1178 + data
  1179 + });
  1180 + },
  1181 + //查询设备列表
  1182 + pDeviceList(data) {
  1183 + return service({
  1184 + url: setUpUrls.pDeviceList,
  1185 + method: "POST",
  1186 + data
  1187 + });
  1188 + },
  1189 + //查询设备详情
  1190 + pDeviceDetail(data) {
  1191 + return service({
  1192 + url: setUpUrls.pDeviceDetail,
  1193 + method: "POST",
  1194 + data
  1195 + });
  1196 + },
  1197 + //查询设备日志列表
  1198 + pDeviceLogList(data) {
  1199 + return service({
  1200 + url: setUpUrls.pDeviceLogList,
  1201 + method: "POST",
  1202 + data
  1203 + });
  1204 + },
1165 1205 };
... ...
src/api/urls/apis.js
... ... @@ -296,6 +296,18 @@ export default {
296 296 versionPage:"/api_html/system/versionPage",
297 297 // 新增授课端版本
298 298 addVersion:"/api_html/system/addVersion",
  299 + // 基站统计数据
  300 + pStationReport:"/api_html/system/stationReport",
  301 + // 答题器统计数据
  302 + pKeyboardReport:"/api_html/system/keyboardReport",
  303 + // 查询设备列表
  304 + pDeviceList:"/api_html/system/deviceList",
  305 + // 查询设备详情
  306 + pDeviceDetail:"/api_html/system/deviceDetail",
  307 + // 查询设备日志列表
  308 + pDeviceLogList:"/api_html/system/deviceLogList",
299 309 // 文件上传
300 310 uploadApp:"/file/uploadApp",
  311 + // 文件上传
  312 + uploadImg:"/file/uploadImg",
301 313 }
... ...
src/router/permission.js
... ... @@ -18,28 +18,7 @@ router.beforeEach((to, from, next) => {
18 18 return item.roleName == userInfo.showRoleName;
19 19 });
20 20 console.log([...authorityRouterObj[0]?.authorityRouter])
21   - // store.commit("setRouters", [...authorityRouterObj[0]?.authorityRouter]);
22   -
23   - //start 开发用,测试删除
24   - store.commit("setRouters", [
25   - "setUpStudent",
26   - "examinationPaper",
27   - "examinationPaperAdd",
28   - "examinationPaperEdit",
29   - "examinationPaperRecycle",
30   - "ask",
31   - "askAnalysis",
32   - "test",
33   - "testAnalysis",
34   - "portrait",
35   - "dataSync",
36   - "down",
37   - "account",
38   - "device",
39   - "clientVersion"
40   - ]);
41   - //end
42   -
  21 + store.commit("setRouters", [...authorityRouterObj[0]?.authorityRouter]);
43 22 store.commit("setInfo", { ...userInfo });
44 23 store.getters.addRouters.forEach((res) => {
45 24 router.addRoute(res);
... ...
src/store/index.js
... ... @@ -81,34 +81,11 @@ const store = new Vuex.Store({
81 81 if (userInfo.permissions && userInfo.permissions.length) {
82 82 userInfo.showRoleName = response.data.permissions[0]?.roleName;
83 83 userInfo.showRole = response.data.permissions[0]?.role;
84   - // 开发用,测试删除
85   - // userInfo.showRole = "ROLE_PERSONAL";
86 84 commit("setToken", "isLogin");
87 85 commit("setInfo", { ...userInfo });
88 86 commit("setRouters", [
89 87 ...userInfo.permissions[0]?.authorityRouter,
90 88 ]);
91   - //start 开发用,测试删除
92   - // commit("setRouters", [
93   - // "setUpStudent",
94   - // "examinationPaper",
95   - // "examinationPaperAdd",
96   - // "examinationPaperEdit",
97   - // "examinationPaperRecycle",
98   - // "ask",
99   - // "askAnalysis",
100   - // "test",
101   - // "testAnalysis",
102   - // "portrait",
103   - // "dataSync",
104   - // "down",
105   -
106   - // "account",
107   - // "device",
108   - // "clientVersion"
109   - // ]);
110   - //end
111   -
112 89 state.addRouters.forEach((res) => {
113 90 router.addRoute(res);
114 91 });
... ...
src/views/admin/account/index.vue
... ... @@ -129,7 +129,7 @@
129 129 <el-dropdown-item :command="1">{{
130 130 `${scoped.row.available == 0 ? "禁用" : "启用"}`
131 131 }}</el-dropdown-item>
132   - <el-dropdown-item :command="2">删除</el-dropdown-item>
  132 + <!-- <el-dropdown-item :command="2">删除</el-dropdown-item> -->
133 133 </el-dropdown-menu>
134 134 </el-dropdown>
135 135 </template>
... ... @@ -165,7 +165,7 @@
165 165 </el-input>
166 166 </el-col>
167 167 </el-form-item>
168   - <el-form-item label="密码:" prop="password">
  168 + <!-- <el-form-item label="密码:" prop="password">
169 169 <el-col :span="12">
170 170 <el-input
171 171 placeholder="请输入密码"
... ... @@ -174,7 +174,7 @@
174 174 >
175 175 </el-input>
176 176 </el-col>
177   - </el-form-item>
  177 + </el-form-item> -->
178 178 <el-form-item label="联系人姓名:" prop="contactPerson">
179 179 <el-col :span="12">
180 180 <el-input
... ... @@ -295,7 +295,7 @@ export default {
295 295 diaCount: false,
296 296 props: { multiple: true, checkStrictly: true },
297 297 query: {
298   - type: "",
  298 + versionType: "",
299 299 available: "",
300 300 loginName: "",
301 301 },
... ... @@ -304,15 +304,15 @@ export default {
304 304 page: 1,
305 305 size: 20,
306 306 formCount: {
  307 + userId: "",
307 308 loginName: "",
308   - type: "",
309 309 tenantName: "",
310 310 contactPerson: "",
311 311 contactPhone: "",
312 312 },
313 313 ruleCount: {
314 314 loginName: [{ required: true, message: "请输入账号", trigger: "blur" }],
315   - password: [{ required: true, message: "请输入密码", trigger: "blur" }],
  315 + // password: [{ required: true, message: "请输入密码", trigger: "blur" }],
316 316 contactPhone: [
317 317 { required: true, message: "请输入联系电话", trigger: "blur" },
318 318 ],
... ... @@ -342,7 +342,7 @@ export default {
342 342 };
343 343 },
344 344 created() {
345   - // _QueryData();
  345 + this._QueryData();
346 346 },
347 347 methods: {
348 348 openAddDia() {
... ... @@ -359,7 +359,7 @@ export default {
359 359 this.$refs.formAddCount.validate(async (valid) => {
360 360 if (valid) {
361 361 let params = { ...this.formAddCount };
362   - const { data, status, info } = await this.$request.addUser({
  362 + const { data, status, info } = await this.$request.addTenant({
363 363 ...params,
364 364 });
365 365 if (status === 0) {
... ... @@ -377,7 +377,11 @@ export default {
377 377 },
378 378 setCount(obj) {
379 379 //修改账号
380   - this.formCount = { ...obj };
  380 + this.formCount.userId = obj.id;
  381 + this.formCount.loginName = obj.loginName;
  382 + this.formCount.tenantName = obj.tenantName;
  383 + this.formCount.contactPerson = obj.realName;
  384 + this.formCount.contactPhone = obj.phone;
381 385 this.diaCount = true;
382 386 },
383 387 handleDropdownClick(value, item) {
... ... @@ -405,8 +409,8 @@ export default {
405 409 this.$refs.formCount.validate(async (valid) => {
406 410 if (valid) {
407 411 let params = { ...this.formCount };
408   - params.password = encryptLoginPassword(params.password);
409   - const { data, status, info } = await this.$request.tenantUpdateUser({
  412 + // params.password = encryptLoginPassword(params.password);
  413 + const { data, status, info } = await this.$request.updateTenant({
410 414 type: 3,
411 415 ...params,
412 416 });
... ... @@ -429,7 +433,7 @@ export default {
429 433 if (type == 1) {
430 434 query.available = obj.available == 0 ? 1 : 0;
431 435 }
432   - const { data, status, info } = await this.$request.tenantUpdateUser({
  436 + const { data, status, info } = await this.$request.updateTenant({
433 437 userId: obj.id,
434 438 type: type,
435 439 ...query,
... ... @@ -444,7 +448,7 @@ export default {
444 448 async _QueryData() {
445 449 let query = { ...this.query };
446 450 if (query.loginName) {
447   - delete query.type;
  451 + delete query.versionType;
448 452 delete query.available;
449 453 }
450 454 this.loading = true;
... ...
src/views/admin/clientVersion/index.vue
... ... @@ -150,11 +150,7 @@ export default {
150 150 url: "/file/uploadApp",
151 151 loading: false,
152 152 diaAdd: false,
153   - tableData: [
154   - {
155   - schoolName: "111",
156   - },
157   - ],
  153 + tableData: [],
158 154 formAdd: {
159 155 versionName: "",
160 156 versionNumber: "",
... ... @@ -186,7 +182,7 @@ export default {
186 182 };
187 183 },
188 184 created() {
189   - // this._QueryData();
  185 + this._QueryData();
190 186 },
191 187 methods: {
192 188 openAddDia() {
... ...
src/views/admin/device/index.vue
... ... @@ -20,29 +20,24 @@
20 20 <p class="p2">基站数量</p>
21 21 </div>
22 22 <div class="chart">
23   - <pie-chart
24   - id="pieChart"
25   - :params="chartData"
26   - ></pie-chart>
  23 + <pie-chart id="pieChart" :params="chartData"></pie-chart>
27 24 </div>
28 25 </div>
29 26 <div class="table-box">
30 27 <div class="answer-header">
31 28 <div class="sel-box">
32   - <el-select
33   - class="sel"
34   - v-model="query.school"
35   - placeholder="选择学校"
36   - @change="_QueryData(true)"
  29 + <el-input
  30 + placeholder="请输入租户"
  31 + v-model="query.schoolName"
  32 + class="input-with-select"
  33 + @keyup.enter.native="_QueryData(true)"
37 34 >
38   - <el-option
39   - v-for="item in schoolList"
40   - :key="item.value"
41   - :label="item.label"
42   - :value="item.value"
43   - >
44   - </el-option>
45   - </el-select>
  35 + <el-button
  36 + slot="append"
  37 + icon="el-icon-search"
  38 + @click="_QueryData(true)"
  39 + ></el-button>
  40 + </el-input>
46 41 <el-input
47 42 placeholder="请输入租户"
48 43 v-model="query.sn"
... ... @@ -140,7 +135,7 @@
140 135 <div class="table-box">
141 136 <div class="answer-header">
142 137 <div class="sel-box">
143   - <el-select
  138 + <el-select
144 139 class="sel"
145 140 v-model="query.school"
146 141 placeholder="选择学校"
... ... @@ -243,8 +238,6 @@
243 238 </div>
244 239 </div>
245 240 </div>
246   -
247   -
248 241 </div>
249 242 </template>
250 243  
... ... @@ -262,10 +255,9 @@ export default {
262 255 this.page = 1;
263 256 this.total = 0;
264 257 this.count = 0;
265   - this.query.classId = [];
266 258 this.query.onlineStatus = "";
267   - this.query.sn = "";
268   - this.query.type = "";
  259 + this.query.schoolName = "";
  260 + this.query.loginName = "";
269 261 if (val == 1) {
270 262 this.stationReport();
271 263 } else if (val == 2) {
... ... @@ -281,8 +273,9 @@ export default {
281 273 schoolList: [],
282 274 type: 1,
283 275 query: {
284   - school: [],
285   - zuhu: "",
  276 + schoolName: "",
  277 + loginName: "",
  278 + onlineStatus: "",
286 279 },
287 280 tableData: [],
288 281 total: 0,
... ... @@ -295,8 +288,8 @@ export default {
295 288 },
296 289 created() {
297 290 this.code = localStorage.getItem("csCode") || "";
298   - // this.stationReport();
299   - // this._QueryData();
  291 + this.stationReport();
  292 + this._QueryData();
300 293 },
301 294 activated() {
302 295 const that = this;
... ... @@ -305,10 +298,10 @@ export default {
305 298 that.page = 1;
306 299 that.total = 0;
307 300 that.count = 0;
308   - that.query.school = "";
309   - that.query.zuhu = "";
310   - // that.stationReport();
311   - // that._QueryData();
  301 + that.query.schoolName = "";
  302 + that.query.loginName = "";
  303 + that.stationReport();
  304 + that._QueryData();
312 305 });
313 306 },
314 307 methods: {
... ... @@ -327,7 +320,7 @@ export default {
327 320 },
328 321 // 基站统计数据
329 322 async stationReport() {
330   - const { data, status, info } = await this.$request.stationReport();
  323 + const { data, status, info } = await this.$request.pStationReport();
331 324 if (status === 0) {
332 325 this.chartData =
333 326 data.list?.map((item) => {
... ... @@ -349,7 +342,7 @@ export default {
349 342 },
350 343 // 答题器统计数据
351 344 async keyboardReport() {
352   - const { data, status, info } = await this.$request.keyboardReport();
  345 + const { data, status, info } = await this.$request.pKeyboardReport();
353 346 if (status === 0) {
354 347 this.chartData2 =
355 348 data.list?.map((item) => {
... ... @@ -375,71 +368,21 @@ export default {
375 368 this.$message.error(info);
376 369 }
377 370 },
378   - setQuery() {
379   - //整理传参
380   - let query = {};
381   - if (this.query.sn) {
382   - query.sn = this.query.sn;
383   - } else {
384   - if (this.type == 1) {
385   - this.query.onlineStatus !== ""
386   - ? (query.onlineStatus = this.query.onlineStatus)
387   - : "";
388   - } else if (this.type == 2) {
389   - this.query.type !== "" ? (query.type = this.query.type) : "";
390   - }
391   - query.regionIds = [];
392   - query.schoolIds = [];
393   - query.gradeNames = [];
394   - query.classIds = [];
395   - this.query.classId?.map((item) => {
396   - if (item.length == 1) {
397   - if (!query.regionIds.includes(item[0])) {
398   - query.regionIds.push(item[0]);
399   - }
400   - } else if (item.length == 2) {
401   - if (!query.schoolIds.includes(item[1])) {
402   - query.schoolIds.push(item[1]);
403   - }
404   - query.regionIds.includes(item[0])
405   - ? query.regionIds.remove(item[0])
406   - : "";
407   - } else if (item.length == 3) {
408   - if (!query.schoolIds.includes(item[1])) {
409   - query.schoolIds.push(item[1]);
410   - }
411   - if (!query.gradeNames.includes(item[2])) {
412   - query.gradeNames.push(item[2]);
413   - }
414   - query.regionIds.includes(item[0])
415   - ? query.regionIds.remove(item[0])
416   - : "";
417   - } else if (item.length == 4) {
418   - if (!query.classIds.includes(item[3])) {
419   - query.classIds.push(item[3]);
420   - }
421   - query.regionIds.includes(item[0])
422   - ? query.regionIds.remove(item[0])
423   - : "";
424   - query.schoolIds.includes(item[1])
425   - ? query.schoolIds.remove(item[1])
426   - : "";
427   - query.gradeNames.includes(item[2])
428   - ? query.gradeNames.remove(item[2])
429   - : "";
430   - }
431   - });
432   -
433   - delete query.classId;
434   - }
435   - return query;
436   - },
437 371 // 设备列表信息
438 372 async _QueryData(isRef) {
439 373 this.loading = true;
440   - let query = {...this.query};
441   - if(query.zuhu){
442   - delete query.school
  374 + let query = {};
  375 + for (let key in this.query) {
  376 + if (this.query[key]) {
  377 + query[key] = this.query[key];
  378 + }
  379 + }
  380 + if (query.loginName) {
  381 + delete query.schoolName;
  382 + delete query.onlineStatus;
  383 + } else if (query.schoolName) {
  384 + delete query.loginName;
  385 + delete query.onlineStatus;
443 386 }
444 387 if (isRef) {
445 388 this.page = 1;
... ... @@ -465,12 +408,6 @@ export default {
465 408 this.total = data.count;
466 409 this.$nextTick(function () {
467 410 this.$refs.main.scrollTop = 0;
468   - if (this.query.classId.length) {
469   - this.selectionTabIds = this.tableData.map((item) => {
470   - this.$refs.multipleTable.toggleRowSelection(item);
471   - return item.id;
472   - });
473   - }
474 411 });
475 412 } else {
476 413 this.$message.error(info);
... ...
src/views/layout/header/header.vue
... ... @@ -39,7 +39,6 @@
39 39 <img :src="avatar" />
40 40 <div class="txt">
41 41 <p>{{ `${this.$store.getters.info.name}` }}</p>
42   - <p>管理员</p>
43 42 </div>
44 43 </div>
45 44 </li>
... ... @@ -130,6 +129,11 @@ export default {
130 129 2000,
131 130 { leading: true, trailing: false }
132 131 ),
  132 + linkToUserInfo() {
  133 + this.$router.push({
  134 + path:'/userInfo'
  135 + })
  136 + },
133 137 collapse() {
134 138 this.isCollapse = !this.isCollapse;
135 139 this.$store.dispatch("collapse");
... ...
src/views/personal/examinationPaper/add.vue
... ... @@ -865,7 +865,7 @@
865 865 </el-select>
866 866 </el-form-item>
867 867 <el-form-item label="知识点:">
868   - <el-select v-model="stem.tag" placeholder="选择知识点">
  868 + <el-select v-model="stem.tag" multiple placeholder="选择知识点">
869 869 <el-option label="生字积累" :value="0"></el-option>
870 870 <el-option label="字词运用" :value="1"></el-option>
871 871 <el-option label="阅读理解" :value="2"></el-option>
... ... @@ -929,7 +929,7 @@ export default {
929 929 stem: {
930 930 src: "", //题干图片地址
931 931 type: 0, //题目难度
932   - tag: 0, //知识点
  932 + tag: [], //知识点
933 933 },
934 934 type: 1, //1-创建,2-复制答题卡
935 935 dialogVisible: false, //测验类型设置弹窗
... ...
src/views/personal/examinationPaper/edit.vue
... ... @@ -144,7 +144,7 @@
144 144 circle
145 145 size="small"
146 146 icon="el-icon-tickets"
147   - @click="openStem(subQuestions,1)"
  147 + @click="openStem(subQuestions, 1)"
148 148 ></el-button>
149 149 </el-tooltip>
150 150 <el-tooltip effect="dark" content="题目打标" placement="top">
... ... @@ -153,7 +153,7 @@
153 153 circle
154 154 size="small"
155 155 icon="el-icon-price-tag"
156   - @click="openTag(subQuestions)"
  156 + @click="openTag(subQuestions)"
157 157 ></el-button>
158 158 </el-tooltip>
159 159 <el-tooltip
... ... @@ -166,7 +166,7 @@
166 166 circle
167 167 size="small"
168 168 icon="el-icon-upload"
169   - @click="openStem(subQuestions,2)"
  169 + @click="openStem(subQuestions, 2)"
170 170 ></el-button>
171 171 </el-tooltip>
172 172 </div>
... ... @@ -270,6 +270,35 @@
270 270 </template>
271 271 </p>
272 272 </div>
  273 + <div class="qs-set">
  274 + <el-tooltip effect="dark" content="上传提干" placement="top">
  275 + <el-button
  276 + type="primary"
  277 + circle
  278 + size="small"
  279 + icon="el-icon-tickets"
  280 + @click="openStem(subQuestions, 1)"
  281 + ></el-button>
  282 + </el-tooltip>
  283 + <el-tooltip effect="dark" content="题目打标" placement="top">
  284 + <el-button
  285 + type="primary"
  286 + circle
  287 + size="small"
  288 + icon="el-icon-price-tag"
  289 + @click="openTag(subQuestions)"
  290 + ></el-button>
  291 + </el-tooltip>
  292 + <el-tooltip effect="dark" content="上传题目解析" placement="top">
  293 + <el-button
  294 + type="primary"
  295 + circle
  296 + size="small"
  297 + icon="el-icon-upload"
  298 + @click="openStem(subQuestions, 2)"
  299 + ></el-button>
  300 + </el-tooltip>
  301 + </div>
273 302 </div>
274 303 </li>
275 304 </ul>
... ... @@ -336,7 +365,7 @@
336 365 >,</span
337 366 >
338 367 </template>
339   - <template v-if="formAns.qusType == 2" class="answer-box">
  368 + <template v-if="formAns.qusType == 2">
340 369 <span
341 370 class="answer-s active"
342 371 v-for="option in formAns.answerOptions.split(',')"
... ... @@ -362,19 +391,25 @@
362 391 <el-button @click="diaSetAns = false">取 消</el-button>
363 392 </div>
364 393 </el-dialog>
365   - <el-dialog :title="upLoadType==1?'上传题干':'上传题目解析'" :visible.sync="dialogStem" width="500">
  394 + <el-dialog
  395 + :title="upLoadType == 1 ? '上传题干' : '上传题目解析'"
  396 + :visible.sync="dialogStem"
  397 + width="500"
  398 + >
366 399 <div>
367 400 <img class="stem-pic" :src="stem.src" alt="" />
368 401 <el-upload
369 402 class="upload-demo"
370   - action="https://jsonplaceholder.typicode.com/posts/"
  403 + action="/file/uploadImg"
371 404 :limit="1"
372 405 :with-credentials="true"
373 406 :on-success="upSuccess"
374 407 :on-error="upError"
375 408 accept="image/*"
376 409 >
377   - <el-button size="small" type="primary">{{stem.src?"重新上传":"选择照片"}}</el-button>
  410 + <el-button size="small" type="primary">{{
  411 + stem.src ? "重新上传" : "选择照片"
  412 + }}</el-button>
378 413 </el-upload>
379 414 </div>
380 415 <div slot="footer">
... ... @@ -383,29 +418,27 @@
383 418 </el-dialog>
384 419 <el-dialog title="题目打标" :visible.sync="dialogTag" width="500">
385 420 <div>
386   - <el-form ref="form" :model="stem" label-width="160px">
387   - <el-form-item label="题目难度:">
388   - <el-select v-model="stem.type" placeholder="选择题目难度">
389   - <el-option label="简单" :value="0"></el-option>
390   - <el-option label="正常" :value="1"></el-option>
391   - <el-option label="困难" :value="2"></el-option>
392   - </el-select>
393   - </el-form-item>
394   - <el-form-item label="知识点:">
395   - <el-select v-model="stem.tag" placeholder="选择知识点">
396   - <el-option label="生字积累" :value="0"></el-option>
397   - <el-option label="字词运用" :value="1"></el-option>
398   - <el-option label="阅读理解" :value="2"></el-option>
399   - <el-option label="作文" :value="2"></el-option>
400   - </el-select>
401   - </el-form-item>
  421 + <el-form ref="form" :model="stem" label-width="160px">
  422 + <el-form-item label="题目难度:">
  423 + <el-select v-model="stem.type" placeholder="选择题目难度">
  424 + <el-option label="简单" :value="0"></el-option>
  425 + <el-option label="正常" :value="1"></el-option>
  426 + <el-option label="困难" :value="2"></el-option>
  427 + </el-select>
  428 + </el-form-item>
  429 + <el-form-item label="知识点:">
  430 + <el-select v-model="stem.tag" multiple placeholder="选择知识点">
  431 + <el-option label="生字积累" :value="0"></el-option>
  432 + <el-option label="字词运用" :value="1"></el-option>
  433 + <el-option label="阅读理解" :value="2"></el-option>
  434 + <el-option label="作文" :value="2"></el-option>
  435 + </el-select>
  436 + </el-form-item>
402 437 </el-form>
403 438 </div>
404 439 <div slot="footer">
405 440 <el-button @click="dialogTag = false">取 消</el-button>
406   - <el-button type="primary" @click="dialogTag = false"
407   - >确 定</el-button
408   - >
  441 + <el-button type="primary" @click="dialogTag = false">确 定</el-button>
409 442 </div>
410 443 </el-dialog>
411 444 </div>
... ... @@ -419,11 +452,11 @@ export default {
419 452 return {
420 453 dialogStem: false,
421 454 dialogTag: false,
422   - upLoadType:1,
  455 + upLoadType: 1,
423 456 stem: {
424 457 src: "", //题干图片地址
425 458 type: 0, //题目难度
426   - tag: 0, //知识点
  459 + tag: [], //知识点
427 460 },
428 461 title: "",
429 462 type: 1,
... ... @@ -475,8 +508,8 @@ export default {
475 508 this._QueryDetail();
476 509 },
477 510 methods: {
478   - openStem(obj,type) {
479   - this.upLoadType = type
  511 + openStem(obj, type) {
  512 + this.upLoadType = type;
480 513 this.stem = { ...this.stem, obj };
481 514 this.dialogStem = true;
482 515 },
... ... @@ -1081,7 +1114,7 @@ export default {
1081 1114 }
1082 1115 }
1083 1116 }
1084   -.upload-demo{
  1117 +.upload-demo {
1085 1118 text-align: center;
1086 1119 }
1087 1120 .stem-pic {
... ...
src/views/personal/setUp/student.vue
... ... @@ -83,7 +83,6 @@
83 83 <el-dialog title="添加学生" :visible.sync="diaStu" width="400">
84 84 <el-form
85 85 ref="formBox"
86   - class="form-box"
87 86 :model="formStu"
88 87 :rules="rulesStu"
89 88 label-width="160px"
... ... @@ -148,15 +147,32 @@
148 147 <el-input maxlength="30" v-model.trim="formClass.className" />
149 148 </el-col>
150 149 </el-form-item>
151   - <el-form-item label="入学年份:" prop="intoSchoolYear">
152   - <el-col :span="10">
153   - <el-date-picker
154   - v-model="formClass.intoSchoolYear"
155   - type="year"
156   - value-format="yyyy"
157   - placeholder="选择年"
  150 + <el-form-item label="科目:" prop="subjectNames">
  151 + <div class="subject-box" :class="showAll ? 'active' : ''">
  152 + <span class="showAll" @click="showAll = !showAll">{{
  153 + showAll ? "收起" : "更多..."
  154 + }}</span>
  155 + <el-checkbox-group v-model="formClass.subjectNames">
  156 + <el-checkbox
  157 + v-for="item in subjectList"
  158 + :label="item"
  159 + :key="item"
  160 + >{{ item }}</el-checkbox
  161 + >
  162 + </el-checkbox-group>
  163 + </div>
  164 + <el-col :span="8">
  165 + <el-input
  166 + placeholder="添加科目"
  167 + v-model.trim="subjectName"
  168 + maxlength="30"
158 169 >
159   - </el-date-picker>
  170 + <i
  171 + slot="suffix"
  172 + class="el-input__icon el-icon-plus"
  173 + @click="addSubjectName"
  174 + ></i>
  175 + </el-input>
160 176 </el-col>
161 177 </el-form-item>
162 178 </el-form>
... ... @@ -192,15 +208,16 @@ import { downloadFile, getBlob } from &quot;@/utils&quot;;
192 208 export default {
193 209 data() {
194 210 return {
195   - diaUp: false,
196   - url: "/api_html/school/manager/importStudentClicker",
197   - diaStu: false,
198   - diaClass: false,
199 211 loading: false,
  212 + diaUp: false,//导入弹窗
  213 + url: "/api_html/school/manager/importStudentClicker",
  214 + diaStu: false,//添加学生
  215 + diaClass: false,//添加-修改班级
  216 + showAll: false, //修改年级科目显示
200 217 query: {
201 218 classId: "",
202 219 },
203   - formStu: {
  220 + formStu: {//添加学生信息
204 221 className: "",
205 222 studentName: "",
206 223 studentCode: "",
... ... @@ -216,29 +233,32 @@ export default {
216 233 { required: true, message: "请输入学生长学号", trigger: "blur" },
217 234 ],
218 235 },
219   - formClass: {
  236 + formClass: {//添加班级信息
220 237 classId: "",
221 238 className: "",
222   - intoSchoolYear: "",
  239 + subjectNames: [],
223 240 },
224 241 rulesClass: {
225 242 className: [
226 243 { required: true, message: "请输入班级名称", trigger: "blur" },
227 244 ],
228 245 },
229   - classList: [],
230   - studentList: [],
  246 + classList: [],//班级列表
  247 + studentList: [],//学生列表
  248 + subjectList: [],//科目列表
  249 + subjectName: "",//添加科目名称
231 250 };
232 251 },
233 252 async created() {
234 253 // await this._QueryClass();
  254 + // this._QuerySubject();
235 255 // this._QueryData();
236 256 },
237 257 methods: {
238 258 addClass() {
239 259 this.formClass.classId = "";
240 260 this.formClass.className = "";
241   - this.formClass.intoSchoolYear = "";
  261 + this.formClass.subjectNames = [];
242 262 this.diaClass = true;
243 263 },
244 264 openAddDia() {
... ... @@ -257,16 +277,28 @@ export default {
257 277 setClass(obj) {
258 278 this.formClass.classId = obj.id;
259 279 this.formClass.className = obj.className;
260   - this.formClass.intoSchoolYear = obj.intoSchoolYear + "";
  280 + this.formClass.subjectNames = obj.subjectNames;
261 281 this.diaClass = true;
262 282 },
  283 + addSubjectName() {
  284 + if (!this.subjectName) {
  285 + this.$message.warning("请填写科目名称");
  286 + return;
  287 + } else if (this.subjectList.includes(this.subjectName)) {
  288 + this.$message.warning("科目已存在,请重新填写~");
  289 + return;
  290 + }
  291 + this.subjectList.push(this.subjectName);
  292 + this.formClass.subjectNames.push(this.subjectName);
  293 + this.subjectName = "";
  294 + },
263 295 saveClass() {
264 296 this.$refs.formClass.validate(async (valid) => {
265 297 if (valid) {
266 298 const { data, status, info } = await this.$request.updateClass({
267 299 classId: this.formClass.classId,
268 300 className: this.formClass.className,
269   - intoSchoolYear: this.formClass.intoSchoolYear,
  301 + subjectNames: this.formClass.subjectNames,
270 302 });
271 303 if (status === 0) {
272 304 this.$message.success("修改成功");
... ... @@ -315,6 +347,14 @@ export default {
315 347 this.diaUp = false;
316 348 this._QueryData();
317 349 },
  350 + async _QuerySubject() {
  351 + const { data, status, info } = await this.$request.pSubjectList();
  352 + if (status === 0) {
  353 + this.subjectList = [...data.subjectNames] || [];
  354 + } else {
  355 + this.$message.error(info);
  356 + }
  357 + },
318 358 async downExcel() {
319 359 this.loadingDown = true;
320 360 let { data, info, status } =
... ... @@ -523,4 +563,34 @@ export default {
523 563 }
524 564 }
525 565 }
  566 +.form-box {
  567 + .subject-box {
  568 + padding-right:50px;
  569 + max-height: 90px;
  570 + overflow: hidden;
  571 + position: relative;
  572 + &.active {
  573 + max-height: auto;
  574 + overflow: auto;
  575 + }
  576 + .showAll {
  577 + position: absolute;
  578 + bottom: 0;
  579 + right: 10px;
  580 + font-size: 12px;
  581 + color: #7f7f7f;
  582 + cursor: pointer;
  583 + padding: 2px;
  584 + &:hover {
  585 + color: #667ffd;
  586 + }
  587 + }
  588 + }
  589 + .el-icon-plus {
  590 + cursor: pointer;
  591 + &:hover {
  592 + color: #667ffd;
  593 + }
  594 + }
  595 +}
526 596 </style>
527 597 \ No newline at end of file
... ...
src/views/standard/setUp/school.vue
... ... @@ -230,7 +230,7 @@ export default {
230 230 },
231 231 data() {
232 232 return {
233   - code: "",
  233 + code: "",//长水跳转标志
234 234 loading: false,
235 235 url: "xxx",
236 236 diaUp: false,
... ... @@ -246,7 +246,7 @@ export default {
246 246 tenantName: "",
247 247 },
248 248 tableData: [],
249   - formSchool: {
  249 + formSchool: {//修改学校
250 250 sections: "",
251 251 managePwd: "",
252 252 contactPerson: "",
... ... @@ -264,7 +264,7 @@ export default {
264 264 },
265 265 ],
266 266 },
267   - formGrade: {
  267 + formGrade: {//修改年级
268 268 gradeName: "",
269 269 subjectNames: [],
270 270 classList: [],
... ... @@ -297,14 +297,14 @@ export default {
297 297 this._QueryDataSchool();
298 298 this._QueryDataGrade();
299 299 },
300   - setGrade(obj) {
  300 + setGrade(obj) {//打开年级设置
301 301 this.formGrade.subjectNames = obj.subjectNames;
302 302 this.formGrade.classList = obj.classList;
303 303 this.formGrade.gradeName = obj.gradeName;
304 304 this.showAll = false;
305 305 this.diaGrade = true;
306 306 },
307   - addSubjectName() {
  307 + addSubjectName() {//添加科目
308 308 if (!this.subjectName) {
309 309 this.$message.warning("请填写科目名称");
310 310 return;
... ... @@ -316,7 +316,7 @@ export default {
316 316 this.formGrade.subjectNames.push(this.subjectName);
317 317 this.subjectName = "";
318 318 },
319   - editSchool() {
  319 + editSchool() {//保存修改学校信息
320 320 if (!this.formSchool.sections.length) {
321 321 this.$message.error("请选择学段!");
322 322 return;
... ... @@ -349,7 +349,7 @@ export default {
349 349 }
350 350 });
351 351 },
352   - async editGrade() {
  352 + async editGrade() {//保存修改年级信息
353 353 if (!this.formGrade.subjectNames.length) {
354 354 this.$message.error("请选择科目!");
355 355 return;
... ... @@ -371,7 +371,7 @@ export default {
371 371 this.$message.error(info);
372 372 }
373 373 },
374   - async _QueryDataSchool() {
  374 + async _QueryDataSchool() {//学校详情
375 375 this.loading = true;
376 376 const { data, status, info } = await this.$request.schoolDetail();
377 377 this.loading = false;
... ...
src/views/standard/test/analysis.vue
... ... @@ -513,19 +513,6 @@ export default {
513 513 this.page = page;
514 514 this.examQuestionReport();
515 515 },
516   - async downExcel() {
517   - let data = await this.$request.subjectiveScoreTemplate({
518   - examId: this.id,
519   - });
520   - if (data && !data.code) {
521   - let blob = new Blob([data], {
522   - type: "application/vnd.ms-excel;charset=utf-8",
523   - });
524   - downloadFile(`主观题模版.xlsx`, blob);
525   - } else {
526   - this.$message.error(data.info);
527   - }
528   - },
529 516 async _QueryData() {
530 517 this.examDetail();
531 518 this.examStudentReport();
... ... @@ -679,6 +666,19 @@ export default {
679 666 this.$message.error("下载失败");
680 667 }
681 668 },
  669 + async downExcel() {
  670 + let data = await this.$request.subjectiveScoreTemplate({
  671 + examId: this.id,
  672 + });
  673 + if (data && !data.code) {
  674 + let blob = new Blob([data], {
  675 + type: "application/vnd.ms-excel;charset=utf-8",
  676 + });
  677 + downloadFile(`主观题模版.xlsx`, blob);
  678 + } else {
  679 + this.$message.error(data.info);
  680 + }
  681 + },
682 682 },
683 683 };
684 684 </script>
... ...
src/views/standard/test/editAnswer.vue
... ... @@ -285,7 +285,7 @@
285 285 >,</span
286 286 >
287 287 </template>
288   - <template v-if="formAns.qusType == 2" class="answer-box">
  288 + <template v-if="formAns.qusType == 2">
289 289 <span
290 290 class="answer-s active"
291 291 v-for="option in formAns.answerOptions.split(',')"
... ... @@ -373,7 +373,7 @@ export default {
373 373 }
374 374 return tit;
375 375 },
376   - setBigNum(num) {
  376 + setBigNum(num) {//转题号格式
377 377 let txt = "";
378 378 let bigNum = [
379 379 "一",
... ... @@ -401,28 +401,6 @@ export default {
401 401  
402 402 return txt;
403 403 },
404   - // keydownAnswer(event) {
405   - // //快速答案设置禁止输入
406   - // if (
407   - // event.key == "Meta" ||
408   - // event.key == "CapsLock" ||
409   - // event.key == "Shift" ||
410   - // event.key == "Enter" ||
411   - // event.key == "Alt" ||
412   - // event.key == "Backspace" ||
413   - // event.key == "Delete" ||
414   - // event.key == "ArrowUp" ||
415   - // event.key == "ArrowDown" ||
416   - // event.key == "ArrowLeft" ||
417   - // event.key == "v" ||
418   - // event.key == "V" ||
419   - // event.key == "ArrowRight"
420   - // ) {
421   - // return;
422   - // } else {
423   - // event.returnValue = "";
424   - // }
425   - // },
426 404 keydownAnswer(event, type) {
427 405 let answerA = "ABCDEFG";
428 406 let answer_a = "abcdefg";
... ... @@ -450,7 +428,7 @@ export default {
450 428 event.returnValue = "";
451 429 }
452 430 },
453   - setAllAnswer(event, type) {
  431 + setAllAnswer(event, type) {//批量设置答案输入格式化答案
454 432 let str = this.formAns.answerList;
455 433 let str2 = checkAnswer(
456 434 str,
... ... @@ -460,7 +438,7 @@ export default {
460 438 );
461 439 this.formAns.answerList = str2;
462 440 },
463   - setAnswer(type, ans) {
  441 + setAnswer(type, ans) {//答案显示格式
464 442 let txt = "";
465 443 if (type == 2) {
466 444 txt = ans;
... ... @@ -471,7 +449,7 @@ export default {
471 449 }
472 450 return txt;
473 451 },
474   - insertTxtAndSetcursor(answerList, str) {
  452 + insertTxtAndSetcursor(answerList, str) {//调整重新设置答案后的光标位置
475 453 let element = this.$refs.formAnsIpt.$el.children[0]; // 获取到指定标签
476 454 let startPos = element.selectionStart; // 获取光标开始的位置
477 455 if (startPos === undefined) {
... ... @@ -487,8 +465,7 @@ export default {
487 465 };
488 466 }
489 467 },
490   - setMultiple(obj, answer) {
491   - //多选答案设置
  468 + setMultiple(obj, answer) { //多选答案设置
492 469 let resault = this.insertTxtAndSetcursor(obj.answerList || "", answer);
493 470 obj.answerList = resault.text;
494 471 let str = obj.answerList;
... ... @@ -502,8 +479,7 @@ export default {
502 479 this.$refs.formAnsIpt.$el.children[0].focus();
503 480 this.$refs.formAnsIpt.$el.children[0].selectionStart = resault.startPos;
504 481 },
505   - changAnswer(sub, option) {
506   - //设置多选答案
  482 + changAnswer(sub, option) {//设置多选答案
507 483 let str = new RegExp(option, "g");
508 484 if (sub.correctAnswer?.includes(option)) {
509 485 sub.correctAnswer = sub.correctAnswer.replace(str, "");
... ... @@ -513,12 +489,11 @@ export default {
513 489 sub.correctAnswer = arrs.sort().join("");
514 490 }
515 491 },
516   - setFormAns(indexs, index) {
517   - //初始化要修改的答案
  492 + setFormAns(indexs, index) {//初始化要修改的答案
518 493 if (this.questionList[0].subQuestions) {
519 494 this.formAns = { ...this.questionList[index].subQuestions[indexs] };
520 495 this.formAns.listIndex = index;
521   - let startIndex = (this.formAns.index+1) - this.formAns.subNum;//批量设置大难开始位置
  496 + let startIndex = (this.formAns.index+1) - this.formAns.subNum;//批量设置答案开始位置
522 497 let answerList = "";
523 498 this.questionList[index].subQuestions.map((item, subIdx) => {
524 499 if (subIdx >= startIndex) {
... ...
src/views/standard/test/index.vue
... ... @@ -530,7 +530,7 @@ export default {
530 530 });
531 531 },
532 532 methods: {
533   - changeSub(val) {
  533 + changeSub(val) {//科目改变触发事件
534 534 let sub;
535 535 if (val && val.length) {
536 536 let leng = val.length - 1;
... ... @@ -552,14 +552,14 @@ export default {
552 552 },
553 553 });
554 554 },
555   - uploadSJ(obj) {
  555 + uploadSJ(obj) {//导入开关
556 556 this.examId = obj.id;
557 557 this.diaUp = true;
558 558 },
559 559 cancel() {
560 560 this.dialogVisible = false;
561 561 },
562   - saveSuccess() {
  562 + saveSuccess() {//修改答案回调
563 563 this.dialogVisible = false;
564 564 this._QueryData();
565 565 },
... ... @@ -657,21 +657,6 @@ export default {
657 657 this.page = 1;
658 658 this._QueryData();
659 659 },
660   - async downExcel() {
661   - this.loadingDown = true;
662   - let data = await this.$request.subjectiveScoreTemplate({
663   - examId: this.examId,
664   - });
665   - this.loadingDown = false;
666   - if (data && !data.code) {
667   - let blob = new Blob([data], {
668   - type: "application/vnd.ms-excel;charset=utf-8",
669   - });
670   - downloadFile(`主观题模版.xlsx`, blob);
671   - } else {
672   - this.$message.error(data.info);
673   - }
674   - },
675 660 async changClazz() {
676 661 this.page = 1;
677 662 await this._QuerySubjectList();
... ... @@ -863,7 +848,7 @@ export default {
863 848 this.$message.error(info);
864 849 }
865 850 },
866   - async downExl() {
  851 + async downExl() {//报表到处
867 852 if (this.exportLoading == true) return;
868 853 let query = {};
869 854 for (let key in this.query) {
... ... @@ -907,6 +892,21 @@ export default {
907 892 this.$message.error("下载失败");
908 893 }
909 894 },
  895 + async downExcel() {//模板下载
  896 + this.loadingDown = true;
  897 + let data = await this.$request.subjectiveScoreTemplate({
  898 + examId: this.examId,
  899 + });
  900 + this.loadingDown = false;
  901 + if (data && !data.code) {
  902 + let blob = new Blob([data], {
  903 + type: "application/vnd.ms-excel;charset=utf-8",
  904 + });
  905 + downloadFile(`主观题模版.xlsx`, blob);
  906 + } else {
  907 + this.$message.error(data.info);
  908 + }
  909 + },
910 910 },
911 911 };
912 912 </script>
... ...
vue.config.js
... ... @@ -22,7 +22,8 @@ module.exports = {
22 22 },
23 23 proxy: {
24 24 "/": {
25   - target:"http://47.104.214.8",
  25 + // target:"http://47.104.214.8",
  26 + target:"http://121.40.127.171",
26 27 changeOrigin: true,
27 28 ws:true,
28 29 },
... ...