index.vue 63 KB

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