index.vue 61 KB

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