index.vue 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846
  1. <template>
  2. <div id="topicEditPaper">
  3. <div>
  4. <table-list
  5. :tableSets="tableSet"
  6. :tableData="tableData"
  7. :navText="navText"
  8. @addClick="openActiveBox"
  9. :loading="loading"
  10. @editInfo="editInfo"
  11. @emitData="emitData"
  12. >
  13. <template slot="btn" slot-scope="props">
  14. <el-button
  15. type="text"
  16. @click="addClick(props.scope.row, 0, props.scope.$index)"
  17. >编辑</el-button
  18. >
  19. <el-button
  20. type="text"
  21. @click="del(props.scope.row, props.scope.$index)"
  22. >删除</el-button
  23. >
  24. </template>
  25. </table-list>
  26. <div class="centerStys">
  27. <el-button size="small" @click="backPage">取消</el-button>
  28. <el-button
  29. size="small"
  30. type="primary"
  31. @click="submitTableAllInfos"
  32. :disabled="!noStudent"
  33. >确定</el-button
  34. >
  35. </div>
  36. <el-dialog
  37. width="1080px"
  38. :visible.sync="innerVisiblePaperTopic"
  39. append-to-body
  40. :show-close="false"
  41. :fullscreen="fullscreenChildPaperTopic"
  42. :close-on-click-modal="false"
  43. >
  44. <div slot="title" class="hearders">
  45. <div class="leftTitle">
  46. {{ statusPop === 1 ? "添加" : statusPop === 0 ? "修改" : "详情" }}
  47. </div>
  48. <div class="rightBoxs">
  49. <img
  50. src="@/assets/images/Max@2x.png"
  51. alt=""
  52. @click="fullscreenChildPaperTopic = !fullscreenChildPaperTopic"
  53. />
  54. <img
  55. src="@/assets/images/Close@2x.png"
  56. alt=""
  57. @click="closeBefore"
  58. />
  59. </div>
  60. </div>
  61. <!-- <busIns
  62. @amdis="changeAmdis"
  63. ref="sujects"
  64. :typeBus="typeBus"
  65. :sujectApisTable="sujectApisTable"
  66. :newSujectApisTable="newSujectApisTable"
  67. /> -->
  68. <div v-if="showHide">
  69. <el-form
  70. label-position="right"
  71. label-width="110px"
  72. :model="listData"
  73. ref="listData"
  74. :rules="rulesTest"
  75. >
  76. <el-form-item
  77. v-for="(items, indexs) in listitem"
  78. :key="indexs"
  79. :label="items.label"
  80. :prop="items.prop"
  81. >
  82. <div v-if="items.scope === 'bussing'">
  83. <div v-if="!activeExam.length">请在下面输入框添加知识点</div>
  84. <ul v-else class="BusBoxs">
  85. <li
  86. class="fot_Le"
  87. v-for="(item, index) in activeExam"
  88. :key="index"
  89. >
  90. {{ item.knowledgeName }}
  91. <i
  92. class="el-icon-error icon_clear"
  93. @click="clearBusName(index)"
  94. ></i>
  95. </li>
  96. <div style="clear: both"></div>
  97. </ul>
  98. <el-select
  99. v-model="value"
  100. placeholder="请选择知识点"
  101. @change="changeKnow"
  102. >
  103. <el-option
  104. v-for="item in options"
  105. :key="item.knowledgeId"
  106. :label="item.knowledgeName"
  107. :value="item.knowledgeId"
  108. :disabled="comLs(item)"
  109. >
  110. </el-option>
  111. </el-select>
  112. <el-button @click="addExam">自定义添加</el-button>
  113. </div>
  114. <el-radio-group
  115. v-else-if="items.scope === 'radio'"
  116. v-model="listData[items.prop]"
  117. >
  118. <el-radio :label="1">发布</el-radio>
  119. <el-radio :label="0">未发布</el-radio>
  120. </el-radio-group>
  121. <el-input
  122. v-model="listData[items.prop]"
  123. v-else
  124. ></el-input> </el-form-item
  125. ></el-form>
  126. <questionBank :dingFormInfo="listNums" :nums="1" ref="child" />
  127. </div>
  128. <span slot="footer" class="dialog-footer">
  129. <el-button @click="closeBefore">关 闭</el-button>
  130. <el-button
  131. @click="submitForm('listData')"
  132. v-if="statusPop === 1 || statusPop === 0"
  133. >完成</el-button
  134. >
  135. </span>
  136. </el-dialog>
  137. <el-dialog
  138. :visible.sync="dialogVisible"
  139. :append-to-body="true"
  140. width="780px"
  141. :show-close="false"
  142. :close-on-click-modal="false"
  143. >
  144. <div slot="title" class="hearders">
  145. <div class="leftTitle">添加</div>
  146. <div class="rightBoxs">
  147. <img src="@/assets/images/Close@2x.png" alt="" @click="closeBoxs" />
  148. </div>
  149. </div>
  150. <div>
  151. <el-form label-position="right" label-width="110px">
  152. <el-form-item label="知识点">
  153. <div>
  154. <div v-if="!BusNameList.length">请在下面输入框添加知识点</div>
  155. <ul v-else class="BusBoxs">
  156. <li
  157. class="fot_Le"
  158. v-for="(item, index) in BusNameList"
  159. :key="index"
  160. >
  161. {{ item }}
  162. <i
  163. class="el-icon-error icon_clear"
  164. @click="clearBus(index)"
  165. ></i>
  166. </li>
  167. <div style="clear: both"></div>
  168. </ul>
  169. <el-input
  170. style="width: 40%; margin-right: 10px"
  171. v-model="BusName"
  172. ></el-input
  173. ><el-button @click="addBusName">添加</el-button>
  174. </div></el-form-item
  175. ></el-form
  176. >
  177. </div>
  178. <span slot="footer" class="dialog-footer">
  179. <el-button @click="closeBoxs">取 消</el-button>
  180. <el-button type="primary" @click="submit">确 定</el-button>
  181. </span>
  182. </el-dialog>
  183. <el-dialog
  184. :visible.sync="dialogVisibleActive"
  185. width="420px"
  186. :show-close="false"
  187. :close-on-click-modal="false"
  188. >
  189. <div slot="title" class="hearders">
  190. <div class="leftTitle">操作类型</div>
  191. <div class="rightBoxs">
  192. <img
  193. src="@/assets/images/Close@2x.png"
  194. alt=""
  195. @click="closeBoxsActive"
  196. />
  197. </div>
  198. </div>
  199. <div>
  200. <el-radio-group v-model="radioActive">
  201. <el-radio :label="1">自定义</el-radio>
  202. <el-radio :label="2">已有数据池</el-radio>
  203. </el-radio-group>
  204. </div>
  205. <span slot="footer" class="dialog-footer">
  206. <el-button @click="closeBoxsActive">取 消</el-button>
  207. <el-button type="primary" @click="submitActive">确 定</el-button>
  208. </span>
  209. </el-dialog>
  210. <el-dialog
  211. :visible.sync="dialogVisibleTable"
  212. width="960px"
  213. :show-close="false"
  214. :close-on-click-modal="false"
  215. >
  216. <div slot="title" class="hearders">
  217. <div class="leftTitle">题库数据池</div>
  218. <div class="rightBoxs">
  219. <img
  220. src="@/assets/images/Close@2x.png"
  221. alt=""
  222. @click="closeBoxsTable"
  223. />
  224. </div>
  225. </div>
  226. <div>
  227. <search-box-new
  228. ref="searchBox"
  229. :formData="formData"
  230. :formList="formList"
  231. @search="getDIO(1)"
  232. @init="inits"
  233. />
  234. <el-table
  235. ref="multipleTable"
  236. :data="boxtableData"
  237. border
  238. @select-all="selectAll"
  239. @select="select"
  240. :row-key="getRowKeys"
  241. :header-cell-style="{
  242. 'background-color': '#eee',
  243. padding: '8px',
  244. color: '#333',
  245. }"
  246. >
  247. <el-table-column
  248. align="center"
  249. type="selection"
  250. width="55"
  251. header-align="center"
  252. :selectable="checkboxT"
  253. :reserve-selection="true"
  254. >
  255. </el-table-column>
  256. <template v-for="(item, index) in tableSetTables">
  257. <el-table-column
  258. v-if="item.scope !== 'inputs'"
  259. :width="item.width"
  260. :key="index"
  261. :label="item.label"
  262. align="center"
  263. :show-overflow-tooltip="true"
  264. header-align="center"
  265. >
  266. <template slot-scope="scope">
  267. <span v-if="item.scope === 'Status'">
  268. {{
  269. scope.row[item.prop] === 1
  270. ? "发布"
  271. : scope.row[item.prop] === 0
  272. ? "未发布"
  273. : "未知"
  274. }}
  275. </span>
  276. <span v-else-if="item.scope === 'topic'">{{
  277. scope.row[item.prop] === 1
  278. ? "单选题"
  279. : scope.row[item.prop] === 2
  280. ? "多选题"
  281. : scope.row[item.prop] === 3
  282. ? "判断题"
  283. : scope.row[item.prop] === 4
  284. ? "案例题"
  285. : scope.row[item.prop] === 5
  286. ? "简答题"
  287. : "未知"
  288. }}</span>
  289. <div
  290. class="editInfoSty"
  291. v-else-if="item.scope === 'editInfoHTML'"
  292. >
  293. {{ getSimpleText(scope.row[item.prop]) }}
  294. </div>
  295. <div v-else-if="item.scope === 'knowledge'">
  296. <el-button
  297. type="success"
  298. size="small"
  299. v-for="(items, ks) in scope.row[item.prop]"
  300. :key="ks"
  301. >
  302. {{ items.knowledgeName }}
  303. </el-button>
  304. </div>
  305. <span v-else>{{ scope.row[item.prop] }}</span></template
  306. >
  307. </el-table-column></template
  308. >
  309. </el-table>
  310. <pagination
  311. :total="totals"
  312. :pageSize="formData.pageSize"
  313. :currentPage="formData.pageNum"
  314. @handleSizeChange="handleSizeChange"
  315. @handleCurrentChange="handleCurrentChange"
  316. />
  317. </div>
  318. <span slot="footer" class="dialog-footer">
  319. <el-button @click="closeBoxsTable">取 消</el-button>
  320. <el-button type="primary" @click="submitTable">确 定</el-button>
  321. </span>
  322. </el-dialog>
  323. <el-dialog
  324. :visible.sync="diansBoxStatus"
  325. width="960px"
  326. :show-close="false"
  327. :close-on-click-modal="false"
  328. >
  329. <div slot="title" class="hearders">
  330. <div class="leftTitle">分值设置</div>
  331. <div class="rightBoxs">
  332. <img
  333. src="@/assets/images/Close@2x.png"
  334. alt=""
  335. @click="closePagsInfos"
  336. />
  337. </div>
  338. </div>
  339. <div>
  340. <div class="dis_fos">
  341. <div>
  342. <div class="margin_bs">当前总分:{{ getAllpocis }}</div>
  343. <div class="margin_bs">
  344. 及格分数:<el-input-number
  345. style="margin: 0px 6px; width: 100px !important"
  346. v-model="passScore"
  347. controls-position="right"
  348. :min="0"
  349. size="mini"
  350. ></el-input-number>
  351. </div>
  352. <div class="margin_bs" v-if="examsType === 2">
  353. 答卷时长:
  354. <el-radio-group v-model="djTimeType">
  355. <el-radio :label="0">无限时长</el-radio>
  356. <el-radio :label="1">有限时长</el-radio>
  357. </el-radio-group>
  358. <el-input-number
  359. v-if="djTimeType === 1"
  360. style="margin: 0px 6px; width: 100px !important"
  361. v-model="djTime"
  362. controls-position="right"
  363. :min="1"
  364. size="mini"
  365. ></el-input-number
  366. ><span v-if="djTimeType === 1">分钟</span>
  367. </div>
  368. <div class="margin_bs">
  369. 答卷次数:
  370. <el-radio-group v-model="djNumType">
  371. <el-radio :label="0">无限次</el-radio>
  372. <el-radio :label="1">有限次</el-radio>
  373. </el-radio-group>
  374. <el-input-number
  375. v-if="djNumType === 1"
  376. style="margin: 0px 6px; width: 100px !important"
  377. v-model="djNum"
  378. controls-position="right"
  379. :min="1"
  380. size="mini"
  381. ></el-input-number>
  382. </div>
  383. <div class="margin_bs">
  384. 做题类型:
  385. <el-radio-group v-model="examsType">
  386. <el-radio :label="1">练习</el-radio>
  387. <el-radio :label="2">考试</el-radio>
  388. </el-radio-group>
  389. </div>
  390. </div>
  391. <div class="margin_bs">
  392. <el-button size="mini" @click="activeOpens"
  393. >按选中设置分数</el-button
  394. ><el-button size="mini" @click="activePicis"
  395. >按题型设置分数</el-button
  396. >
  397. </div>
  398. </div>
  399. <el-table
  400. ref="multipleTables"
  401. :data="boxtableDataPags"
  402. border
  403. @select-all="selectAllPags"
  404. @select="selectPags"
  405. :row-key="getRowKeysPags"
  406. :header-cell-style="{
  407. 'background-color': '#eee',
  408. padding: '8px',
  409. color: '#333',
  410. }"
  411. >
  412. <el-table-column
  413. align="center"
  414. type="selection"
  415. width="55"
  416. header-align="center"
  417. :reserve-selection="true"
  418. >
  419. </el-table-column>
  420. <el-table-column
  421. label="序号"
  422. align="center"
  423. type="index"
  424. width="80"
  425. >
  426. </el-table-column>
  427. <template v-for="(item, index) in tableSetTablesPags">
  428. <el-table-column
  429. v-if="item.scope !== 'inputs'"
  430. :width="item.width"
  431. :key="index"
  432. :label="item.label"
  433. :align="item.scope === 'inputS' ? 'left' : 'center'"
  434. :show-overflow-tooltip="true"
  435. header-align="center"
  436. >
  437. <template slot-scope="scope">
  438. <span v-if="item.scope === 'Status'">
  439. {{
  440. scope.row[item.prop] === 1
  441. ? "发布"
  442. : scope.row[item.prop] === 0
  443. ? "未发布"
  444. : "未知"
  445. }}
  446. </span>
  447. <span v-else-if="item.scope === 'topic'">{{
  448. scope.row[item.prop] === 1
  449. ? "单选题"
  450. : scope.row[item.prop] === 2
  451. ? "多选题"
  452. : scope.row[item.prop] === 3
  453. ? "判断题"
  454. : scope.row[item.prop] === 4
  455. ? "案例题"
  456. : scope.row[item.prop] === 5
  457. ? "简答题"
  458. : "未知"
  459. }}</span>
  460. <div
  461. class="editInfoSty"
  462. v-else-if="item.scope === 'editInfoHTML'"
  463. >
  464. {{ getSimpleText(scope.row[item.prop]) }}
  465. </div>
  466. <div v-else-if="item.scope === 'inputS'">
  467. <el-input-number
  468. style="width: 100px !important"
  469. v-model="scope.row[item.prop]"
  470. controls-position="right"
  471. :min="0"
  472. ></el-input-number>
  473. <el-tooltip
  474. class="item"
  475. effect="dark"
  476. content="右侧输入框为多选题漏选给分"
  477. placement="top-start"
  478. >
  479. <i
  480. v-if="scope.row['type'] === 2"
  481. class="el-icon-question"
  482. ></i>
  483. </el-tooltip>
  484. <el-input-number
  485. v-if="scope.row['type'] === 2"
  486. style="width: 100px !important"
  487. v-model="scope.row['partScore']"
  488. controls-position="right"
  489. :min="0"
  490. ></el-input-number>
  491. </div>
  492. <div v-else-if="item.scope === 'knowledge'">
  493. <el-button
  494. type="success"
  495. size="small"
  496. v-for="(items, ks) in scope.row[item.prop]"
  497. :key="ks"
  498. >
  499. {{ items.knowledgeName }}
  500. </el-button>
  501. </div>
  502. <span v-else>{{ scope.row[item.prop] }}</span></template
  503. >
  504. </el-table-column></template
  505. >
  506. </el-table>
  507. </div>
  508. <span slot="footer" class="dialog-footer">
  509. <el-button @click="closePagsInfos">取 消</el-button>
  510. <el-button type="primary" @click="submitPagsInfos">确 定</el-button>
  511. </span>
  512. </el-dialog>
  513. <el-dialog
  514. :visible.sync="dialogVisibleActivePocis"
  515. width="420px"
  516. append-to-body
  517. :show-close="false"
  518. :close-on-click-modal="false"
  519. >
  520. <div slot="title" class="hearders">
  521. <div class="leftTitle">分值设置</div>
  522. <div class="rightBoxs">
  523. <img
  524. src="@/assets/images/Close@2x.png"
  525. alt=""
  526. @click="closeBoxsActivePocis"
  527. />
  528. </div>
  529. </div>
  530. <div>
  531. 一共选择了{{ activeListsPags.length }}道题目,一键设置
  532. <el-input-number
  533. style="width: 100px !important"
  534. v-model="Pocis"
  535. controls-position="right"
  536. :min="0"
  537. ></el-input-number>
  538. </div>
  539. <span slot="footer" class="dialog-footer">
  540. <el-button @click="closeBoxsActivePocis">取 消</el-button>
  541. <el-button type="primary" @click="submitActivePocis">确 定</el-button>
  542. </span>
  543. </el-dialog>
  544. <el-dialog
  545. :visible.sync="dialogVisibleActivePLPoics"
  546. width="580px"
  547. append-to-body
  548. :show-close="false"
  549. :close-on-click-modal="false"
  550. >
  551. <div slot="title" class="hearders">
  552. <div class="leftTitle">分值设置</div>
  553. <div class="rightBoxs">
  554. <img
  555. src="@/assets/images/Close@2x.png"
  556. alt=""
  557. @click="closeBoxsActivePLPoics"
  558. />
  559. </div>
  560. </div>
  561. <div>
  562. <div class="margin_bs" v-if="pocisArray.danx">
  563. 单选题:共{{ pocisArray.danx }}道,共
  564. {{ pocisArray.danx * Pocis1 }} 分数,每题分数<el-input-number
  565. style="margin: 0px 6px; width: 100px !important"
  566. v-model="Pocis1"
  567. controls-position="right"
  568. :min="0"
  569. size="mini"
  570. ></el-input-number
  571. >分
  572. </div>
  573. <div class="margin_bs" v-if="pocisArray.duox">
  574. 多选题:共{{ pocisArray.duox }}道,共
  575. {{ pocisArray.duox * Pocis2 }} 分数,每题分数<el-input-number
  576. style="margin: 0px 6px; width: 100px !important"
  577. v-model="Pocis2"
  578. controls-position="right"
  579. :min="0"
  580. size="mini"
  581. ></el-input-number
  582. >分
  583. <el-tooltip
  584. class="item"
  585. effect="dark"
  586. content="右侧输入框为多选题漏选给分"
  587. placement="top-start"
  588. >
  589. <i class="el-icon-question"></i>
  590. </el-tooltip>
  591. <el-input-number
  592. style="margin: 0px 6px; width: 100px !important"
  593. v-model="Pocis2s"
  594. controls-position="right"
  595. :min="0"
  596. size="mini"
  597. ></el-input-number>
  598. </div>
  599. <div class="margin_bs" v-if="pocisArray.pand">
  600. 判断题:共{{ pocisArray.pand }}道,共
  601. {{ pocisArray.pand * Pocis3 }} 分数,每题分数<el-input-number
  602. style="margin: 0px 6px; width: 100px !important"
  603. v-model="Pocis3"
  604. controls-position="right"
  605. :min="0"
  606. size="mini"
  607. ></el-input-number
  608. >分
  609. </div>
  610. <div class="margin_bs" v-if="pocisArray.anli">
  611. 案例题:共{{ pocisArray.anli }}道,共
  612. {{ pocisArray.anli * Pocis4 }} 分数,每题分数<el-input-number
  613. style="margin: 0px 6px; width: 100px !important"
  614. v-model="Pocis4"
  615. controls-position="right"
  616. :min="0"
  617. size="mini"
  618. ></el-input-number
  619. >分
  620. </div>
  621. <div class="margin_bs" v-if="pocisArray.jiand">
  622. 简答题:共{{ pocisArray.jiand }}道,共
  623. {{ pocisArray.jiand * Pocis5 }} 分数,每题分数<el-input-number
  624. style="margin: 0px 6px; width: 100px !important"
  625. v-model="Pocis5"
  626. controls-position="right"
  627. :min="0"
  628. size="mini"
  629. ></el-input-number
  630. >分
  631. </div>
  632. </div>
  633. <span slot="footer" class="dialog-footer">
  634. <el-button @click="closeBoxsActivePLPoics" size="small"
  635. >取 消</el-button
  636. >
  637. <el-button type="primary" size="small" @click="submitActivePLPoics"
  638. >确 定</el-button
  639. >
  640. </span>
  641. </el-dialog>
  642. </div>
  643. </div>
  644. </template>
  645. <script>
  646. import searchBoxNew from "@/components/searchBoxNew";
  647. import pagination from "@/components/pagination";
  648. import tableList from "@/components/tableList";
  649. import busIns from "@/components/busIns";
  650. import questionBank from "@/components/questionBank";
  651. export default {
  652. components: { searchBoxNew, pagination, tableList, busIns, questionBank },
  653. data() {
  654. return {
  655. showHide: false,
  656. formList: [
  657. // {
  658. // prop: "educationTypeId",
  659. // placeholder: "教育类型",
  660. // scope: "educationType",
  661. // },
  662. // {
  663. // prop: "businessId",
  664. // placeholder: "业务层次",
  665. // scope: "businessLevel",
  666. // edu: "educationTypeId",
  667. // },
  668. // {
  669. // prop: "subjectId",
  670. // placeholder: "科目",
  671. // scope: "sujectType",
  672. // edu: "educationTypeId",
  673. // },
  674. {
  675. prop: "type",
  676. placeholder: "题目类型",
  677. scope: "selectBank",
  678. },
  679. {
  680. prop: "key",
  681. placeholder: "请输入题目标题/题目编码/知识点/标题前缀",
  682. },
  683. ],
  684. formData: {
  685. publishStatus: 1,
  686. status: 1,
  687. pageSize: 10,
  688. pageNum: 1,
  689. },
  690. totals: 0,
  691. tableSet: [
  692. {
  693. label: "排序",
  694. prop: "sort",
  695. scope: "inputs",
  696. width: "100px",
  697. hidden: true,
  698. },
  699. {
  700. label: "题目编码",
  701. prop: "code",
  702. hidden: true,
  703. },
  704. {
  705. label: "题型",
  706. prop: "type",
  707. hidden: true,
  708. scope: "topic",
  709. },
  710. {
  711. label: "标题前缀",
  712. prop: "prefixName",
  713. hidden: true,
  714. },
  715. {
  716. label: "知识点",
  717. prop: "knowledgeList",
  718. hidden: true,
  719. scope: "knowledge",
  720. width: "200px",
  721. showTooltip: true,
  722. },
  723. {
  724. label: "题目内容",
  725. prop: "content",
  726. hidden: true,
  727. scope: "editInfoHTML",
  728. },
  729. {
  730. label: "发布状态",
  731. prop: "publishStatus",
  732. hidden: true,
  733. scope: "fabStatus",
  734. },
  735. ],
  736. tableData: [],
  737. loading: false, //当前表单加载是否加载动画
  738. navText: {
  739. title: "题目管理",
  740. index: 0,
  741. ch: "条",
  742. num: false,
  743. border: true,
  744. choice: false,
  745. addHide: false,
  746. backFatherBtn: {
  747. status: true,
  748. title: "分值设置",
  749. },
  750. },
  751. rulesTest: {
  752. // prefixName: [
  753. // { required: true, message: "请输入标签前缀", trigger: "blur" },
  754. // ],
  755. },
  756. dialogVisible: false,
  757. innerVisiblePaperTopic: false,
  758. fullscreenChildPaperTopic: false,
  759. statusPop: 1,
  760. dingForm: {},
  761. questionId: "",
  762. queryData: {},
  763. allOptions: [], //知识点列表
  764. options: [], //当前知识点列表
  765. activeExam: [], // 已选知识点列表
  766. value: "",
  767. BusName: "", //弹窗新增知识点输入框
  768. BusNameList: [],
  769. listNums: {},
  770. typeBus: 1,
  771. indexZB: "",
  772. listData: {
  773. publishStatus: "",
  774. prefixName: "",
  775. },
  776. int: "",
  777. listitem: [
  778. {
  779. label: "标题前缀",
  780. prop: "prefixName",
  781. },
  782. {
  783. label: "知识点",
  784. scope: "bussing",
  785. },
  786. {
  787. label: "发布状态",
  788. prop: "publishStatus",
  789. scope: "radio",
  790. },
  791. ],
  792. radioActive: "",
  793. dialogVisibleActive: false,
  794. dialogVisibleTable: false,
  795. boxtableData: [],
  796. tableSetTables: [
  797. {
  798. label: "题目类型",
  799. prop: "type",
  800. hidden: true,
  801. scope: "topic",
  802. },
  803. {
  804. label: "题目编码",
  805. prop: "code",
  806. hidden: true,
  807. },
  808. {
  809. label: "标题前缀",
  810. prop: "prefixName",
  811. hidden: true,
  812. },
  813. {
  814. label: "知识点",
  815. prop: "knowledgeList",
  816. hidden: true,
  817. scope: "knowledge",
  818. width: "180px",
  819. },
  820. {
  821. label: "题目标题",
  822. prop: "content",
  823. hidden: true,
  824. scope: "editInfoHTML",
  825. },
  826. {
  827. label: "发布状态",
  828. prop: "publishStatus",
  829. hidden: true,
  830. scope: "Status",
  831. },
  832. ],
  833. activeLists: [],
  834. disCheckList: [],
  835. sujectApisTable: [],
  836. newSujectApisTable: [],
  837. // -------------------------------------
  838. diansBoxStatus: false,
  839. boxtableDataPags: [],
  840. tableSetTablesPags: [
  841. {
  842. label: "排序",
  843. prop: "sort",
  844. hidden: true,
  845. },
  846. {
  847. label: "题型",
  848. prop: "type",
  849. hidden: true,
  850. scope: "topic",
  851. },
  852. {
  853. label: "标题前缀",
  854. prop: "prefixName",
  855. hidden: true,
  856. },
  857. {
  858. label: "题目标题",
  859. prop: "content",
  860. hidden: true,
  861. scope: "editInfoHTML",
  862. },
  863. {
  864. label: "发布状态",
  865. prop: "publishStatus",
  866. hidden: true,
  867. scope: "Status",
  868. },
  869. {
  870. label: "分值",
  871. prop: "score",
  872. hidden: true,
  873. scope: "inputS",
  874. width: "250px",
  875. },
  876. ],
  877. activeListsPags: [],
  878. dialogVisibleActivePocis: false,
  879. Pocis: "",
  880. dialogVisibleActivePLPoics: false,
  881. Pocis1: "",
  882. Pocis2: "",
  883. Pocis2s: "",
  884. Pocis3: "",
  885. Pocis4: "",
  886. Pocis5: "",
  887. pocisArray: {
  888. danx: 0,
  889. duox: 0,
  890. pand: 0,
  891. anli: 0,
  892. jiand: 0,
  893. },
  894. passScore: "", //及格分数
  895. djTimeType: 0, //0无限1有限
  896. djTime: 0, //答卷时长
  897. djNumType: 0, //0无限1有限
  898. djNum: 0, //答卷次数
  899. examsType: 1,
  900. businObj: {}, //当前业务层次
  901. noStudent: true,
  902. };
  903. },
  904. computed: {
  905. getAllpocis() {
  906. var num = 0;
  907. this.boxtableDataPags.map((item) => {
  908. num += item.score;
  909. });
  910. return num;
  911. },
  912. },
  913. watch: {
  914. djTime: {
  915. handler(newVal, oldVal) {
  916. if (newVal === 0) {
  917. this.djTimeType = 0;
  918. } else {
  919. this.djTimeType = 1;
  920. }
  921. },
  922. // 立即处理 进入页面就触发
  923. immediate: true,
  924. },
  925. djNum: {
  926. handler(newVal, oldVal) {
  927. if (newVal === 0) {
  928. this.djNumType = 0;
  929. } else {
  930. this.djNumType = 1;
  931. }
  932. },
  933. // 立即处理 进入页面就触发
  934. immediate: true,
  935. },
  936. tableData: {
  937. handler(newVal, oldVal) {
  938. this.navText.index = newVal.length;
  939. },
  940. // 立即处理 进入页面就触发
  941. immediate: true,
  942. },
  943. },
  944. async mounted() {
  945. this.$api
  946. .gradecheckGoodsChange({ examId: this.$route.query.id })
  947. .then((res) => {
  948. console.log(res.data);
  949. if (res.data > 0) {
  950. this.noStudent = false;
  951. }
  952. });
  953. this.getInfos();
  954. await this.getFns();
  955. this.changeAmdis();
  956. this.search();
  957. },
  958. methods: {
  959. getInfos() {
  960. this.$api.obtainbankexam(this.$route.query.id).then((res) => {
  961. this.businObj = {
  962. businessId: res.data.businessId,
  963. businessName: res.data.businessName,
  964. educationName: res.data.educationName,
  965. educationTypeId: res.data.educationTypeId,
  966. projectName: res.data.projectName,
  967. projectId: res.data.projectId,
  968. subjectName: res.data.subjectName,
  969. subjectId: res.data.subjectId,
  970. };
  971. this.djTime = res.data.answerTime;
  972. this.djNum = res.data.answerNum;
  973. this.examsType = res.data.doType;
  974. this.passScore = res.data.passScore;
  975. });
  976. },
  977. // --------------------------分割线---------------------------
  978. editInfo(v) {
  979. this.addClick(v, 0);
  980. },
  981. search(v) {
  982. this.loading = true;
  983. this.$api
  984. .inquirebankexamquestionList({ examId: this.$route.query.id })
  985. .then((res) => {
  986. res.data.map((item) => {
  987. item.optionsList = JSON.parse(item.jsonStr);
  988. });
  989. this.tableData = res.data;
  990. // this.total = res.total;
  991. this.navText.index = res.total;
  992. })
  993. .finally(() => {
  994. this.loading = false;
  995. });
  996. },
  997. init() {
  998. this.search();
  999. },
  1000. del(v, index) {
  1001. this.$alert(
  1002. "确定删除此内容?<br />内容删除后将无法恢复,请慎重考虑",
  1003. "提示",
  1004. {
  1005. dangerouslyUseHTMLString: true,
  1006. }
  1007. )
  1008. .then(() => {
  1009. this.tableData.splice(index, 1);
  1010. })
  1011. .catch(() => {
  1012. this.$message({
  1013. type: "info",
  1014. message: "已取消删除",
  1015. });
  1016. });
  1017. },
  1018. openActiveBox() {
  1019. this.radioActive = "";
  1020. this.dialogVisibleActive = true;
  1021. },
  1022. submitActive() {
  1023. if (!this.radioActive) {
  1024. this.$message.warning("请选择操作类型");
  1025. return;
  1026. }
  1027. this.dialogVisibleActive = false;
  1028. if (this.radioActive === 1) {
  1029. this.addClick();
  1030. } else {
  1031. var self = this;
  1032. this.formData = {
  1033. status: 1,
  1034. pageSize: 10,
  1035. pageNum: 1,
  1036. publishStatus: 1,
  1037. };
  1038. var data = JSON.parse(JSON.stringify(this.formData));
  1039. data.businessId = this.businObj.businessId;
  1040. data.subjectId = this.businObj.subjectId;
  1041. this.$api.inquirebankquestionList(data).then((res) => {
  1042. var aList = [];
  1043. this.tableData.map((item) => {
  1044. if (item.questionId) {
  1045. aList.push(item.questionId);
  1046. }
  1047. });
  1048. this.disCheckList = aList;
  1049. this.boxtableData = res.rows;
  1050. this.totals = res.total;
  1051. this.dialogVisibleTable = true;
  1052. this.$nextTick(function () {
  1053. self.$refs.multipleTable.clearSelection();
  1054. });
  1055. });
  1056. }
  1057. },
  1058. getDIO(int) {
  1059. if (int === 1) {
  1060. this.formData.pageNum = 1;
  1061. }
  1062. if (int === 2) {
  1063. this.formData = {
  1064. status: 1,
  1065. pageSize: 10,
  1066. pageNum: 1,
  1067. publishStatus: 1,
  1068. };
  1069. }
  1070. var data = JSON.parse(JSON.stringify(this.formData));
  1071. data.businessId = this.businObj.businessId;
  1072. data.subjectId = this.businObj.subjectId;
  1073. this.$api.inquirebankquestionList(data).then((res) => {
  1074. this.boxtableData = res.rows;
  1075. this.totals = res.total;
  1076. });
  1077. },
  1078. closeBoxsActive() {
  1079. this.dialogVisibleActive = false;
  1080. },
  1081. submitTable() {
  1082. if (this.activeLists.length === 0) {
  1083. this.dialogVisibleTable = false;
  1084. return;
  1085. }
  1086. if (this.tableData.length) {
  1087. let maxIndex = 0;
  1088. this.tableData.forEach((item) => {
  1089. if (item.sort > maxIndex) {
  1090. maxIndex = item.sort;
  1091. }
  1092. });
  1093. this.activeLists.forEach((item, index) => {
  1094. item.sort = maxIndex + index + 1;
  1095. item.optionsList = JSON.parse(item.jsonStr);
  1096. item.partScore = 0;
  1097. item.score = "";
  1098. item.diff = false;
  1099. });
  1100. } else {
  1101. this.activeLists.forEach((item, index) => {
  1102. item.sort = index + 1;
  1103. item.optionsList = JSON.parse(item.jsonStr);
  1104. item.partScore = 0;
  1105. item.score = "";
  1106. item.diff = false;
  1107. });
  1108. }
  1109. this.activeLists.forEach((item) => {
  1110. this.tableData.unshift(item);
  1111. });
  1112. this.dialogVisibleTable = false;
  1113. this.$message.success("添加成功");
  1114. this.activeLists = [];
  1115. },
  1116. closeBoxsTable() {
  1117. this.dialogVisibleTable = false;
  1118. },
  1119. selectAll(value) {
  1120. this.activeLists = value;
  1121. },
  1122. select(value) {
  1123. this.activeLists = value;
  1124. },
  1125. checkboxT(row, index) {
  1126. if (this.disCheckList.indexOf(row.questionId) !== -1) {
  1127. return false;
  1128. } else {
  1129. return true;
  1130. }
  1131. },
  1132. getRowKeys(row) {
  1133. return row.questionId;
  1134. },
  1135. addClick(v, int, indexZB) {
  1136. var self = this;
  1137. if (v === undefined) {
  1138. self.statusPop = 1;
  1139. self.innerVisiblePaperTopic = true;
  1140. self.showHide = true;
  1141. self.$nextTick(() => {
  1142. (self.listNums = {
  1143. type: 1,
  1144. optionsList: [],
  1145. answerQuestionList: [],
  1146. content: "",
  1147. status: "",
  1148. analysisContent: "",
  1149. answerQuestion: "",
  1150. }),
  1151. // (self.$refs.sujects.eduType = "");
  1152. // self.$refs.sujects.courType = "";
  1153. // self.$refs.sujects.sujectApis = [];
  1154. // self.$refs.sujects.newSujectApis = [];
  1155. (self.listData = {
  1156. publishStatus: 1,
  1157. });
  1158. self.activeExam = [];
  1159. });
  1160. } else {
  1161. self.tableData[indexZB].diff = true;
  1162. self.innerVisiblePaperTopic = true;
  1163. self.showHide = true;
  1164. self.statusPop = int;
  1165. var vres = JSON.parse(JSON.stringify(v));
  1166. self.indexZB = indexZB;
  1167. if (vres.knowledgeIds) {
  1168. var a = [];
  1169. vres.knowledgeIds
  1170. .split(",")
  1171. .map(Number)
  1172. .map((items) => {
  1173. self.allOptions.map((item) => {
  1174. if (item.knowledgeId === items) {
  1175. a.push(item);
  1176. }
  1177. });
  1178. });
  1179. self.activeExam = a;
  1180. } else {
  1181. self.activeExam = [];
  1182. }
  1183. if (vres.type === 2) {
  1184. if (vres.answerQuestion) {
  1185. vres.answerQuestionList = vres.answerQuestion
  1186. .split(",")
  1187. .map(Number);
  1188. }
  1189. } else if (vres.type === 4) {
  1190. vres.optionsList.map((item) => {
  1191. if (item.type === 2) {
  1192. if (item.answerQuestion) {
  1193. item.answerQuestionList = item.answerQuestion
  1194. .split(",")
  1195. .map(Number);
  1196. }
  1197. } else {
  1198. item.answerQuestionList = [];
  1199. }
  1200. });
  1201. } else {
  1202. vres.answerQuestionList = [];
  1203. }
  1204. self.listData.prefixName = vres.prefixName;
  1205. self.listData.publishStatus = vres.publishStatus;
  1206. self.listNums = vres;
  1207. console.log(vres, 5515);
  1208. // var arrays = [];
  1209. // vres.businessList.map((item) => {
  1210. // arrays.push(item.businessId + "-" + item.subjectId);
  1211. // });
  1212. // self.sujectApisTable = arrays;
  1213. // self.newSujectApisTable = vres.businessList;
  1214. }
  1215. },
  1216. //-----------------------------------------------
  1217. comLs(item) {
  1218. var os = this.activeExam.some((items) => {
  1219. return items.knowledgeId === item.knowledgeId;
  1220. });
  1221. if (os) {
  1222. return true;
  1223. } else {
  1224. return false;
  1225. }
  1226. },
  1227. getFns() {
  1228. return new Promise((resolve, reject) => {
  1229. this.$api.inquireKnowledgeExamListS({ status: 1 }).then((res) => {
  1230. this.allOptions = res.rows;
  1231. resolve();
  1232. });
  1233. });
  1234. },
  1235. getSimpleText(html) {
  1236. var re1 = new RegExp("<.+?>", "g"); //匹配html标签的正则表达式,"g"是搜索匹配多个符合的内容
  1237. var msg = html.replace(re1, ""); //执行替换成空字符
  1238. return msg;
  1239. },
  1240. addBusName() {
  1241. if (this.BusName.trim()) {
  1242. var as = this.allOptions.some((item) => {
  1243. return item.knowledgeName == this.BusName;
  1244. });
  1245. if (as) {
  1246. this.$message.warning("当前知识点名称已存在");
  1247. return;
  1248. }
  1249. this.BusNameList.push(this.BusName);
  1250. this.BusName = "";
  1251. } else {
  1252. this.$message({
  1253. message: "请输入知识点内容",
  1254. type: "warning",
  1255. duration: 1200,
  1256. });
  1257. this.BusName = "";
  1258. }
  1259. },
  1260. submit() {
  1261. var data = {
  1262. examKnowledgeBusinessAddBoList: [this.businObj],
  1263. knowledgeName: this.BusNameList,
  1264. status: 1,
  1265. };
  1266. this.$api.addKnowledgeExam(data).then(async (res) => {
  1267. this.$message.success("添加成功");
  1268. this.dialogVisible = false;
  1269. await this.getFns();
  1270. this.changeAmdis();
  1271. });
  1272. },
  1273. closeBoxs() {
  1274. this.dialogVisible = false;
  1275. },
  1276. addExam() {
  1277. // if (!this.$refs.sujects.courType) {
  1278. // this.$message.warning("请选择业务层级");
  1279. // return;
  1280. // }
  1281. // console.log(this.$refs.sujects)
  1282. this.BusNameList = [];
  1283. this.BusName = "";
  1284. this.dialogVisible = true;
  1285. },
  1286. clearBus() {
  1287. this.BusNameList.splice(index, 1);
  1288. },
  1289. //子组件回调 业务层及变换-知识点重新筛选
  1290. changeAmdis() {
  1291. var int = this.businObj.businessId;
  1292. var ao = [];
  1293. this.allOptions.map((item, index) => {
  1294. let acts = item.courseBusinessList.some((items) => {
  1295. return items.businessId === int;
  1296. });
  1297. if (acts) {
  1298. ao.push(item);
  1299. }
  1300. });
  1301. this.options = ao;
  1302. },
  1303. clearBusName(index) {
  1304. this.activeExam.splice(index, 1);
  1305. },
  1306. changeKnow(item) {
  1307. this.allOptions.map((items) => {
  1308. if (items.knowledgeId === item) {
  1309. this.activeExam.push(items);
  1310. }
  1311. });
  1312. this.value = "";
  1313. },
  1314. addListNums() {
  1315. this.listNums.push({
  1316. type: 1,
  1317. optionsList: [],
  1318. answerQuestionList: [],
  1319. content: "",
  1320. status: "",
  1321. analysisContent: "",
  1322. answerQuestion: "",
  1323. });
  1324. },
  1325. closeBefore() {
  1326. this.innerVisiblePaperTopic = false;
  1327. this.showHide = false;
  1328. },
  1329. async submitForm(formName, int) {
  1330. this.$refs[formName].validate((valid) => {
  1331. if (valid) {
  1332. var self = this;
  1333. // if (!this.$refs.sujects.newSujectApis.length) {
  1334. // this.$message.error("请选择科目");
  1335. // return;
  1336. // }
  1337. var data = this.$refs.child.getInfosPage();
  1338. if (!data.content || data.content == "<p><br></p>") {
  1339. self.$message.error("请填写题目内容");
  1340. return;
  1341. }
  1342. if (data.type != 3 && data.type != 5 && !data.optionsList.length) {
  1343. self.$message.error("请添加选项");
  1344. return;
  1345. }
  1346. if (data.type != 3 && data.type != 4 && data.optionsList.length) {
  1347. var ast = data.optionsList.some((item) => {
  1348. return !item.content && !item.imgUrl;
  1349. });
  1350. if (ast) {
  1351. self.$message.error("请完善选项内容");
  1352. return;
  1353. }
  1354. }
  1355. if (data.type != 5 && data.type != 4) {
  1356. if (data.type === 2 && !data.answerQuestionList.length) {
  1357. self.$message.error("请选择正确答案");
  1358. return;
  1359. }
  1360. if (data.type !== 2 && !data.answerQuestion) {
  1361. self.$message.error("请选择正确答案");
  1362. return;
  1363. }
  1364. }
  1365. if (data.type == 4 && data.optionsList.length) {
  1366. for (let i = 0; i < data.optionsList.length; i++) {
  1367. if (
  1368. !data.optionsList[i].content ||
  1369. data.optionsList[i].content == "<p><br></p>"
  1370. ) {
  1371. self.$message.error("请填写题目内容");
  1372. return;
  1373. }
  1374. if (
  1375. data.optionsList[i].type != 3 &&
  1376. data.optionsList[i].type != 5 &&
  1377. !data.optionsList[i].optionsList.length
  1378. ) {
  1379. self.$message.error("请添加选项");
  1380. return;
  1381. }
  1382. if (
  1383. data.optionsList[i].type != 3 &&
  1384. data.optionsList[i].optionsList.length
  1385. ) {
  1386. var ast = data.optionsList[i].optionsList.some((item) => {
  1387. return !item.content && !item.imgUrl;
  1388. });
  1389. if (ast) {
  1390. self.$message.error("请完善选项内容");
  1391. return;
  1392. }
  1393. }
  1394. if (data.optionsList[i].type != 5) {
  1395. if (
  1396. data.optionsList[i].type === 2 &&
  1397. !data.optionsList[i].answerQuestionList.length
  1398. ) {
  1399. self.$message.error("请选择正确答案");
  1400. return;
  1401. }
  1402. if (
  1403. data.optionsList[i].type !== 2 &&
  1404. !data.optionsList[i].answerQuestion
  1405. ) {
  1406. self.$message.error("请选择正确答案");
  1407. return;
  1408. }
  1409. }
  1410. }
  1411. }
  1412. var numList = [];
  1413. this.activeExam.map((item) => {
  1414. numList.push(item.knowledgeId);
  1415. });
  1416. data.knowledgeList = this.activeExam;
  1417. data.prefixName = this.listData.prefixName;
  1418. data.knowledgeIds = numList.toString();
  1419. data.publishStatus = this.listData.publishStatus;
  1420. if (data.type === 2) {
  1421. if (data.answerQuestionList.length) {
  1422. data.answerQuestion = data.answerQuestionList.toString();
  1423. }
  1424. }
  1425. if (data.type === 4) {
  1426. data.optionsList.map((item) => {
  1427. if (item.type === 2) {
  1428. if (item.answerQuestionList.length) {
  1429. item.answerQuestion = item.answerQuestionList.toString();
  1430. }
  1431. }
  1432. });
  1433. }
  1434. if (this.statusPop === 1) {
  1435. data.partScore = 0;
  1436. data.score = "";
  1437. data.status = 1;
  1438. data.businessList = [this.businObj];
  1439. if (this.tableData.length) {
  1440. let maxIndex = 0;
  1441. this.tableData.forEach((item) => {
  1442. if (item.sort > maxIndex) {
  1443. maxIndex = item.sort;
  1444. }
  1445. });
  1446. data.sort = maxIndex + 1;
  1447. } else {
  1448. data.sort = 1;
  1449. }
  1450. this.tableData.unshift(data);
  1451. // this.$api.addbankquestion(data).then((res) => {
  1452. self.$message.success("添加成功");
  1453. self.innerVisiblePaperTopic = false;
  1454. self.showHide = false;
  1455. // self.search();
  1456. // });
  1457. }
  1458. if (this.statusPop === 0) {
  1459. this.tableData.splice(this.indexZB, 1, data);
  1460. // this.$api.editbankquestion(data).then((res) => {
  1461. self.$message.success("修改成功");
  1462. self.innerVisiblePaperTopic = false;
  1463. self.showHide = false;
  1464. // self.search();
  1465. // });
  1466. }
  1467. } else {
  1468. console.log("error submit!!");
  1469. return false;
  1470. }
  1471. });
  1472. },
  1473. uploadApis(item) {
  1474. return new Promise((resolve, reject) => {
  1475. this.$api.editbankquestion(item).then((res) => {
  1476. resolve();
  1477. });
  1478. });
  1479. },
  1480. addbankquestion(item) {
  1481. return new Promise((resolve, reject) => {
  1482. this.$api.addbankquestion(item).then((res) => {
  1483. resolve(res.data);
  1484. });
  1485. });
  1486. },
  1487. async submitTableAllInfos() {
  1488. var self = this;
  1489. if (Number(this.passScore) > Number(this.getAllpocis)) {
  1490. this.$message.warning("及格分数不得大于当前总分,请重新设置分值");
  1491. return;
  1492. }
  1493. for (let i = 0; i < this.tableData.length; i++) {
  1494. if (!this.tableData[i].sort && this.tableData[i].sort !== 0) {
  1495. this.$message.warning(`题目管理第${i + 1}条请输入排序`);
  1496. return;
  1497. }
  1498. }
  1499. let arr = this.tableData.map((items) => {
  1500. return items.sort;
  1501. });
  1502. if (new Set(arr).size != arr.length) {
  1503. this.$message.warning("排序不允许重复");
  1504. return;
  1505. }
  1506. var arrs = [];
  1507. for (let i = 0; i < this.tableData.length; i++) {
  1508. if (self.tableData[i].questionId && self.tableData[i].diff) {
  1509. await self.uploadApis(self.tableData[i]);
  1510. }
  1511. if (!self.tableData[i].questionId) {
  1512. var ids = await self.addbankquestion(self.tableData[i]);
  1513. self.tableData[i].questionId = ids;
  1514. }
  1515. arrs.push({
  1516. questionId: self.tableData[i].questionId,
  1517. sort: self.tableData[i].sort,
  1518. score: self.tableData[i].score,
  1519. partScore: self.tableData[i].partScore,
  1520. });
  1521. }
  1522. var data = {
  1523. examId: this.$route.query.id,
  1524. questionList: arrs,
  1525. status: 1,
  1526. passScore: this.passScore,
  1527. doType: this.examsType,
  1528. };
  1529. if (this.djTimeType === 0) {
  1530. data.answerTime = 0;
  1531. } else {
  1532. data.answerTime = this.djTime;
  1533. }
  1534. if (this.djNumType === 0) {
  1535. data.answerNum = 0;
  1536. } else {
  1537. data.answerNum = this.djNum;
  1538. }
  1539. this.$api.editbankexam(data).then((res) => {
  1540. this.$message.success("修改成功");
  1541. setTimeout(() => {
  1542. this.$store.dispatch("tagsView/exitView", this.$route).then((res) => {
  1543. this.$router.push({
  1544. path: "testPaperManagement",
  1545. });
  1546. });
  1547. }, 500);
  1548. });
  1549. },
  1550. backPage() {
  1551. this.$store.dispatch("tagsView/delView", this.$route).then((res) => {
  1552. this.$router.push({
  1553. path: "testPaperManagement",
  1554. });
  1555. });
  1556. },
  1557. emitData() {
  1558. if (!this.tableData.length) {
  1559. this.$message.warning("请添加题目");
  1560. return;
  1561. }
  1562. this.boxtableDataPags = JSON.parse(JSON.stringify(this.tableData));
  1563. this.diansBoxStatus = true;
  1564. },
  1565. closePagsInfos() {
  1566. this.diansBoxStatus = false;
  1567. },
  1568. submitPagsInfos() {
  1569. if (this.examsType === 2) {
  1570. var ast = this.boxtableDataPags.every((item) => {
  1571. if (item.type === 2) {
  1572. return item.partScore >= 0 && item.score >= 0;
  1573. } else {
  1574. return item.score >= 0;
  1575. }
  1576. });
  1577. if (!ast) {
  1578. this.$message.warning("请设置每道题目的分值");
  1579. return;
  1580. }
  1581. }
  1582. if (Number(this.passScore) > Number(this.getAllpocis)) {
  1583. this.$message.warning("及格分数不得大于当前总分");
  1584. return;
  1585. }
  1586. this.tableData = this.boxtableDataPags;
  1587. this.diansBoxStatus = false;
  1588. },
  1589. selectAllPags(value) {
  1590. this.activeListsPags = value;
  1591. },
  1592. selectPags(value) {
  1593. this.activeListsPags = value;
  1594. },
  1595. getRowKeysPags(row) {
  1596. return row.questionId;
  1597. },
  1598. activeOpens() {
  1599. if (!this.activeListsPags.length) {
  1600. this.$message.warning("请选择需要设置分值的题目");
  1601. return;
  1602. }
  1603. this.Pocis = "";
  1604. this.dialogVisibleActivePocis = true;
  1605. },
  1606. closeBoxsActivePocis() {
  1607. this.dialogVisibleActivePocis = false;
  1608. },
  1609. submitActivePocis() {
  1610. this.activeListsPags.map((item) => {
  1611. item.score = this.Pocis;
  1612. });
  1613. this.dialogVisibleActivePocis = false;
  1614. this.activeListsPags = [];
  1615. this.$refs.multipleTables.clearSelection();
  1616. },
  1617. activePicis() {
  1618. if (!this.activeListsPags.length) {
  1619. this.$message.warning("请选择需要设置分值的题目");
  1620. return;
  1621. }
  1622. this.pocisArray = {
  1623. danx: 0,
  1624. duox: 0,
  1625. pand: 0,
  1626. anli: 0,
  1627. jiand: 0,
  1628. };
  1629. for (let i = 0; i < this.activeListsPags.length; i++) {
  1630. if (this.activeListsPags[i].type === 1) {
  1631. this.pocisArray.danx++;
  1632. }
  1633. if (this.activeListsPags[i].type === 2) {
  1634. this.pocisArray.duox++;
  1635. }
  1636. if (this.activeListsPags[i].type === 3) {
  1637. this.pocisArray.pand++;
  1638. }
  1639. if (this.activeListsPags[i].type === 4) {
  1640. this.pocisArray.anli++;
  1641. }
  1642. if (this.activeListsPags[i].type === 5) {
  1643. this.pocisArray.jiand++;
  1644. }
  1645. }
  1646. this.Pocis1 = "";
  1647. this.Pocis2 = "";
  1648. this.Pocis2s = "";
  1649. this.Pocis3 = "";
  1650. this.Pocis4 = "";
  1651. this.Pocis5 = "";
  1652. this.dialogVisibleActivePLPoics = true;
  1653. },
  1654. closeBoxsActivePLPoics() {
  1655. this.dialogVisibleActivePLPoics = false;
  1656. },
  1657. submitActivePLPoics() {
  1658. this.activeListsPags.map((item) => {
  1659. if (item.type === 1) {
  1660. item.score = this.Pocis1;
  1661. }
  1662. if (item.type === 2) {
  1663. item.score = this.Pocis2;
  1664. item.partScore = this.Pocis2s;
  1665. }
  1666. if (item.type === 3) {
  1667. item.score = this.Pocis3;
  1668. }
  1669. if (item.type === 4) {
  1670. item.score = this.Pocis4;
  1671. }
  1672. if (item.type === 5) {
  1673. item.score = this.Pocis5;
  1674. }
  1675. });
  1676. this.dialogVisibleActivePLPoics = false;
  1677. this.activeListsPags = [];
  1678. this.$refs.multipleTables.clearSelection();
  1679. },
  1680. inits() {
  1681. this.getDIO(2);
  1682. },
  1683. handleSizeChange(v) {
  1684. this.formData.pageSize = v;
  1685. this.formData.pageNum = 1;
  1686. this.getDIO();
  1687. },
  1688. handleCurrentChange(v) {
  1689. this.formData.pageNum = v;
  1690. this.getDIO();
  1691. },
  1692. },
  1693. };
  1694. </script>
  1695. <style lang="less" scoped>
  1696. .boxWidth {
  1697. width: 700px;
  1698. }
  1699. .numInputs {
  1700. width: 150px;
  1701. }
  1702. .checkboxSty {
  1703. max-height: 210px;
  1704. overflow: auto;
  1705. display: flex;
  1706. flex-direction: column;
  1707. }
  1708. .listBoxStys {
  1709. flex-shrink: 0;
  1710. padding: 0px 10px;
  1711. border-radius: 8px;
  1712. border: 1px solid #eee;
  1713. margin-right: 10px;
  1714. margin-bottom: 6px;
  1715. }
  1716. .closeIcons {
  1717. color: red;
  1718. cursor: pointer;
  1719. margin-left: 6px;
  1720. }
  1721. .ach {
  1722. display: flex;
  1723. align-items: center;
  1724. overflow: hidden;
  1725. }
  1726. .clh {
  1727. display: flex;
  1728. align-items: center;
  1729. flex-wrap: wrap;
  1730. }
  1731. .imgBoxins {
  1732. width: 375px;
  1733. height: 220px;
  1734. text-align: center;
  1735. img {
  1736. height: 100%;
  1737. }
  1738. }
  1739. .iconStsz {
  1740. font-size: 40px;
  1741. color: #67c23a;
  1742. cursor: pointer;
  1743. }
  1744. .BusBoxs {
  1745. min-height: 100px;
  1746. border: 1px solid #a4a4a4;
  1747. margin-bottom: 10px;
  1748. border-radius: 8px;
  1749. max-height: 280px;
  1750. padding: 10px;
  1751. overflow-y: auto;
  1752. .fot_Le {
  1753. border-radius: 12px;
  1754. border: 1px solid yellowgreen;
  1755. padding: 0px 10px;
  1756. height: 30px;
  1757. line-height: 30px;
  1758. text-align: center;
  1759. float: left;
  1760. margin-right: 6px;
  1761. margin-bottom: 6px;
  1762. .icon_clear {
  1763. margin-left: 2px;
  1764. font-size: 15px;
  1765. color: #f56c6c;
  1766. cursor: pointer;
  1767. }
  1768. }
  1769. }
  1770. .marg_play {
  1771. display: flex;
  1772. margin-bottom: 15px;
  1773. .spans {
  1774. text-align: right;
  1775. width: 80px;
  1776. }
  1777. }
  1778. /deep/.el-button {
  1779. border-radius: 8px;
  1780. }
  1781. /deep/.el-dialog {
  1782. border-radius: 8px;
  1783. .el-dialog__header {
  1784. padding: 0;
  1785. .hearders {
  1786. height: 40px;
  1787. display: flex;
  1788. align-items: center;
  1789. justify-content: space-between;
  1790. padding: 0px 18px 0px 20px;
  1791. border-bottom: 1px solid #e2e2e2;
  1792. .leftTitle {
  1793. font-size: 14px;
  1794. font-weight: bold;
  1795. color: #2f4378;
  1796. }
  1797. .rightBoxs {
  1798. display: flex;
  1799. align-items: center;
  1800. img {
  1801. width: 14px;
  1802. height: 14px;
  1803. margin-left: 13px;
  1804. cursor: pointer;
  1805. }
  1806. }
  1807. }
  1808. }
  1809. .el-dialog__footer {
  1810. padding: 0;
  1811. .dialog-footer {
  1812. padding: 0px 40px;
  1813. height: 70px;
  1814. border-top: 1px solid #e2e2e2;
  1815. display: flex;
  1816. align-items: center;
  1817. justify-content: center;
  1818. }
  1819. }
  1820. }
  1821. .centerStys {
  1822. display: flex;
  1823. align-items: center;
  1824. justify-content: center;
  1825. margin-top: 18px;
  1826. }
  1827. .dis_fos {
  1828. align-items: flex-end;
  1829. display: flex;
  1830. justify-content: space-between;
  1831. }
  1832. .margin_bs {
  1833. margin-bottom: 6px;
  1834. }
  1835. </style>