index.vue 58 KB

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