index.vue 63 KB

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