index.vue 58 KB

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