index.vue 61 KB

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