index.vue 60 KB

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