index.vue 61 KB

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