EditPaper.vue 86 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762
  1. <template>
  2. <div
  3. v-loading="loading"
  4. class="edit-paper"
  5. element-loading-text="拼命加载中。。。"
  6. >
  7. <div class="edit-header">
  8. <div class="edit-header-top box-justify">
  9. <div class="header-info">
  10. <div class="header-info-item">
  11. <span>课程代码:</span>
  12. <span>{{ paper.course.code }}</span>
  13. </div>
  14. <div class="header-info-item">
  15. <span>课程名称:</span>
  16. <span>{{ paper.course.name }}</span>
  17. </div>
  18. <div class="header-info-item">
  19. <span>试卷名称:</span>
  20. <span>
  21. <el-tooltip class="item" effect="dark" placement="top-start">
  22. <div slot="content">{{ paper.name }}</div>
  23. <el-input
  24. v-model="paper.name"
  25. size="mini"
  26. class="header-info-input"
  27. placeholder="试卷名称"
  28. ></el-input>
  29. </el-tooltip>
  30. </span>
  31. </div>
  32. <div class="header-info-item">
  33. <span>试卷标题:</span>
  34. <span>
  35. <el-tooltip class="item" effect="dark" placement="top-start">
  36. <div slot="content">{{ paper.title }}</div>
  37. <el-input
  38. v-model="paper.title"
  39. size="mini"
  40. class="header-info-input"
  41. placeholder="试卷标题"
  42. ></el-input>
  43. </el-tooltip>
  44. </span>
  45. </div>
  46. <div class="header-info-item">
  47. <span>试卷总分:</span>
  48. <span>{{ paper.totalScore }}</span>
  49. </div>
  50. </div>
  51. <div class="header-btns">
  52. <el-button type="primary" size="small" @click="savePaper">
  53. 保存
  54. </el-button>
  55. <el-button
  56. type="danger"
  57. plain
  58. size="small"
  59. @click="deletePaper(paper.id)"
  60. >
  61. 删除
  62. </el-button>
  63. <el-button
  64. v-if="showCheckDuplicateBtn"
  65. type="primary"
  66. size="small"
  67. plain
  68. @click="checkDuplicate"
  69. >
  70. 进入查重
  71. </el-button>
  72. <el-dropdown>
  73. <el-button type="primary" size="small" plain>
  74. 更多<i class="el-icon-more el-icon--right"></i>
  75. </el-button>
  76. <el-dropdown-menu slot="dropdown" class="action-dropdown">
  77. <el-dropdown-item>
  78. <el-button type="primary" plain size="small" @click="openDialog"
  79. >上传音频
  80. </el-button>
  81. </el-dropdown-item>
  82. <el-dropdown-item>
  83. <el-button
  84. size="small"
  85. type="primary"
  86. plain
  87. @click="exportPaperAnswer()"
  88. >导出答案</el-button
  89. >
  90. </el-dropdown-item>
  91. <el-dropdown-item>
  92. <el-button
  93. type="primary"
  94. size="small"
  95. plain
  96. @click="openAnswerDialog"
  97. >导入答案
  98. </el-button>
  99. </el-dropdown-item>
  100. </el-dropdown-menu>
  101. </el-dropdown>
  102. <el-button
  103. size="small"
  104. type="danger"
  105. plain
  106. icon="icon icon-back"
  107. @click="back"
  108. >返回</el-button
  109. >
  110. </div>
  111. </div>
  112. <div class="edit-header-bottom box-justify">
  113. <div>
  114. <el-button type="info" size="small" @click="showBasicDialog">
  115. 基础构成
  116. </el-button>
  117. <el-button type="info" size="small" @click="showTypeDialog">
  118. 题型分布
  119. </el-button>
  120. <el-button type="info" size="small" @click="showBlueDialog">
  121. 蓝图分布
  122. </el-button>
  123. <el-button type="info" size="small" @click="showAuditDialog">
  124. 审核记录
  125. </el-button>
  126. <el-button
  127. v-if="enableCardEdit"
  128. type="info"
  129. size="small"
  130. @click="toEditCard"
  131. >
  132. 编辑题卡
  133. </el-button>
  134. </div>
  135. <div>
  136. <el-button type="primary" size="small" plain @click="quesTagShowHide">
  137. {{ quesTagShow ? "隐藏" : "显示" }}属性
  138. </el-button>
  139. <el-button
  140. type="primary"
  141. size="small"
  142. plain
  143. @click="quesAnswerShowHide"
  144. >
  145. {{ quesAnswerShow ? "隐藏" : "显示" }}答案
  146. </el-button>
  147. </div>
  148. </div>
  149. </div>
  150. <div class="edit-body">
  151. <div class="edit-part-list">
  152. <div class="edit-part">
  153. <div class="edit-cont">
  154. <div class="edit-cont-title">
  155. <h3>考试说明</h3>
  156. </div>
  157. <div class="edit-cont-action">
  158. <el-button
  159. type="primary"
  160. plain
  161. size="small"
  162. @click="openEditExamPaperRemark"
  163. >编辑</el-button
  164. >
  165. </div>
  166. <div class="edit-cont-body">
  167. <rich-text :text-json="paper.examRemark"></rich-text>
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. <!-- 循环大题 -->
  173. <div
  174. v-for="(paperDetail, detailIndex) in paper.paperDetails"
  175. v-show="paperDetailShow(paperDetail)"
  176. :key="detailIndex"
  177. class="edit-part-list"
  178. >
  179. <div class="edit-part">
  180. <div
  181. class="edit-cont"
  182. @mouseover="quesMouseOver(paperDetail.id)"
  183. @mouseout="quesMouseOut(paperDetail.id)"
  184. >
  185. <div class="edit-cont-title">
  186. <h3>
  187. <span>{{ paperDetail.cnNum }}</span> <span>.</span>
  188. <span>{{ paperDetail.name }}</span>
  189. <span>
  190. ({{
  191. !paperDetail.title ? "本大题" : paperDetail.title + ","
  192. }}共{{ paperDetail.unitCount }}小题,满分{{
  193. paperDetail.score
  194. }}分)
  195. </span>
  196. </h3>
  197. </div>
  198. <rich-text
  199. class="edit-cont-body"
  200. :text-json="paperDetail.description"
  201. ></rich-text>
  202. <div
  203. :id="paperDetail.id"
  204. class="edit-cont-action"
  205. style="visibility: hidden"
  206. >
  207. <el-button
  208. v-show="parentView == 'gen_paper'"
  209. size="small"
  210. type="primary"
  211. plain
  212. @click="selectQues(paperDetail.id)"
  213. >选题
  214. </el-button>
  215. <el-button
  216. size="small"
  217. type="primary"
  218. plain
  219. @click="openEditPaperDetail(paperDetail)"
  220. >编辑
  221. </el-button>
  222. <el-button
  223. v-if="showUp(paperDetail)"
  224. size="small"
  225. type="primary"
  226. plain
  227. @click="movePaperDetail(paperDetail, 'up')"
  228. >上移
  229. </el-button>
  230. <el-button
  231. v-if="showDown(paperDetail)"
  232. size="small"
  233. type="primary"
  234. plain
  235. @click="movePaperDetail(paperDetail, 'down')"
  236. >下移
  237. </el-button>
  238. <el-button
  239. size="small"
  240. type="danger"
  241. @click="deletePaperDetail(paperDetail.id)"
  242. >删除
  243. </el-button>
  244. <el-button
  245. v-show="showButtons[detailIndex].up"
  246. size="small"
  247. type="primary"
  248. plain
  249. icon="el-icon-arrow-up"
  250. @click.stop="hideContent(detailIndex)"
  251. ></el-button>
  252. <el-button
  253. v-show="!showButtons[detailIndex].up"
  254. size="small"
  255. icon="el-icon-arrow-down"
  256. type="primary"
  257. plain
  258. @click.stop="showContent(detailIndex)"
  259. ></el-button>
  260. </div>
  261. </div>
  262. <div v-show="quesTagShow" class="edit-property">
  263. <div class="edit-property-box">
  264. <div
  265. v-for="(paperDetailTag, tagIndex) in paperDetail.tags"
  266. :key="tagIndex"
  267. class="edit-property-item"
  268. >
  269. <div class="edit-property-body edit-property-danger">
  270. <div class="edit-property-title">
  271. {{ paperDetailTag.tag }}
  272. </div>
  273. <div class="edit-property-content">
  274. {{ paperDetailTag.content }}
  275. </div>
  276. </div>
  277. </div>
  278. </div>
  279. </div>
  280. </div>
  281. <!-- 循环小题 -->
  282. <div
  283. v-show="showQuestions[detailIndex].is_show"
  284. class="edit-paper-questions"
  285. >
  286. <template
  287. v-for="(paperDetailUnit, unitIndex) in paperDetail.paperDetailUnits"
  288. >
  289. <div
  290. v-show="quesShow(paperDetailUnit.id)"
  291. :key="`question-${unitIndex}`"
  292. :class="[
  293. 'edit-part',
  294. {
  295. 'question-duplicate':
  296. paperDetailUnit.question.checkDuplicateStatus ==
  297. 'TO_BE_DISPOSE',
  298. },
  299. ]"
  300. >
  301. <div
  302. class="edit-cont"
  303. @mouseover="quesMouseOver(paperDetailUnit.id)"
  304. @mouseout="quesMouseOut(paperDetailUnit.id)"
  305. >
  306. <div class="edit-cont-title">
  307. <span>{{ paperDetailUnit.number }}.</span>
  308. <rich-text
  309. :text-json="paperDetailUnit.question.quesBody"
  310. ></rich-text>
  311. <span> ({{ paperDetailUnit.score }}分) </span>
  312. </div>
  313. <div class="edit-cont-body">
  314. <div
  315. v-for="(quesOption, optionIndex) in paperDetailUnit.question
  316. .quesOptions"
  317. :key="optionIndex"
  318. class="paper-option"
  319. >
  320. <span>{{ optionIndex | optionOrderWordFilter }}. </span>
  321. <rich-text :text-json="quesOption.optionBody"></rich-text>
  322. </div>
  323. <div v-if="!isNested(paperDetailUnit.questionType)">
  324. <div v-show="quesAnswerShow" class="paper-answer">
  325. <span>答案:</span>
  326. <question-answer
  327. :data="paperDetailUnit.question"
  328. ></question-answer>
  329. </div>
  330. </div>
  331. </div>
  332. <div
  333. :id="paperDetailUnit.id"
  334. class="edit-cont-action"
  335. style="visibility: hidden"
  336. >
  337. <span class="tips-info">
  338. {{ paperDetailUnit.question.bodyLengthText }}
  339. </span>
  340. <el-button
  341. v-if="
  342. paperDetailUnit.question.checkDuplicateStatus ==
  343. 'TO_BE_DISPOSE'
  344. "
  345. size="small"
  346. type="primary"
  347. plain
  348. @click="checkDuplicateQuestion(paperDetailUnit.question.id)"
  349. >进入查重
  350. </el-button>
  351. <el-button
  352. size="small"
  353. type="primary"
  354. plain
  355. @click="editQues(paperDetailUnit, paperDetailUnit.question)"
  356. >编辑
  357. </el-button>
  358. <el-button
  359. v-if="showUnitUp(paperDetail, paperDetailUnit.id)"
  360. size="small"
  361. type="primary"
  362. plain
  363. @click="
  364. movePaperDetailUnit(
  365. paperDetail.id,
  366. paperDetailUnit.id,
  367. 'up'
  368. )
  369. "
  370. >上移
  371. </el-button>
  372. <el-button
  373. v-if="showUnitDown(paperDetail, paperDetailUnit.id)"
  374. size="small"
  375. type="primary"
  376. plain
  377. @click="
  378. movePaperDetailUnit(
  379. paperDetail.id,
  380. paperDetailUnit.id,
  381. 'down'
  382. )
  383. "
  384. >下移
  385. </el-button>
  386. <el-button
  387. type="danger"
  388. size="small"
  389. @click="deleteQues(paperDetailUnit)"
  390. >删除
  391. </el-button>
  392. <el-button
  393. v-show="
  394. isNested(paperDetailUnit.questionType) &&
  395. showSubButtons[detailIndex + '-' + unitIndex]
  396. "
  397. size="small"
  398. icon="el-icon-arrow-up"
  399. @click.stop="hideSubContent(detailIndex + '-' + unitIndex)"
  400. ></el-button>
  401. <el-button
  402. v-show="
  403. isNested(paperDetailUnit.questionType) &&
  404. !showSubButtons[detailIndex + '-' + unitIndex]
  405. "
  406. size="small"
  407. type="primary"
  408. plain
  409. icon="el-icon-arrow-down"
  410. @click.stop="showSubContent(detailIndex + '-' + unitIndex)"
  411. ></el-button>
  412. </div>
  413. </div>
  414. <div v-show="quesTagShow" class="edit-property">
  415. <div class="edit-property-box">
  416. <div
  417. v-for="(questionTag, tagIndex) in paperDetailUnit.question
  418. .tags"
  419. :key="tagIndex"
  420. class="edit-property-item"
  421. >
  422. <div class="edit-property-body">
  423. <div class="edit-property-title">
  424. {{ questionTag.tag }}
  425. </div>
  426. <div class="edit-property-content">
  427. {{ questionTag.content }}
  428. </div>
  429. </div>
  430. </div>
  431. </div>
  432. </div>
  433. </div>
  434. <div
  435. v-show="showSubQuestions[detailIndex + '-' + unitIndex]"
  436. :key="`question-sub-${unitIndex}`"
  437. class="edit-paper-question-subs"
  438. >
  439. <div
  440. v-for="(subQuestion, subIndex) in paperDetailUnit.question
  441. .subQuestions"
  442. v-show="quesShow(subQuestion.id)"
  443. :key="subIndex"
  444. class="edit-part"
  445. >
  446. <div
  447. class="edit-cont"
  448. @mouseover="
  449. quesMouseOver(
  450. getSubQuesEditId(paperDetailUnit, subQuestion)
  451. )
  452. "
  453. @mouseout="
  454. quesMouseOut(getSubQuesEditId(paperDetailUnit, subQuestion))
  455. "
  456. >
  457. <div class="edit-cont-title">
  458. <span>{{ subQuestion.subNumber }}. </span>
  459. <rich-text :text-json="subQuestion.quesBody"></rich-text>
  460. <span
  461. >({{ paperDetailUnit.subScoreList[subIndex] }}分)</span
  462. >
  463. </div>
  464. <div
  465. v-if="!isMatchingQuestion(paperDetailUnit.questionType)"
  466. class="edit-cont-body"
  467. >
  468. <div
  469. v-for="(
  470. subQuesOption, subOptIndex
  471. ) in subQuestion.quesOptions"
  472. :key="subOptIndex"
  473. class="paper-option"
  474. >
  475. <span>{{ subOptIndex | optionOrderWordFilter }}. </span>
  476. <rich-text
  477. :text-json="subQuesOption.optionBody"
  478. ></rich-text>
  479. </div>
  480. </div>
  481. <div v-show="quesAnswerShow" class="paper-answer">
  482. <span>答案:</span>
  483. <question-answer :data="subQuestion"></question-answer>
  484. <!-- <rich-text :text-json="subQuestion.quesAnswer"></rich-text> -->
  485. </div>
  486. <div
  487. :id="getSubQuesEditId(paperDetailUnit, subQuestion)"
  488. class="edit-cont-action"
  489. style="visibility: hidden"
  490. >
  491. <el-button
  492. size="small"
  493. type="primary"
  494. plain
  495. @click="editQues(paperDetailUnit, subQuestion)"
  496. >编辑
  497. </el-button>
  498. <el-button
  499. v-if="showUnitSubUp(paperDetailUnit, subQuestion.id)"
  500. size="small"
  501. type="primary"
  502. plain
  503. @click="
  504. movePaperDetailUnitSub(
  505. paperDetailUnit.id,
  506. subQuestion.id,
  507. 'up'
  508. )
  509. "
  510. >上移
  511. </el-button>
  512. <el-button
  513. v-if="showUnitSubDown(paperDetailUnit, subQuestion.id)"
  514. size="small"
  515. type="primary"
  516. plain
  517. @click="
  518. movePaperDetailUnitSub(
  519. paperDetailUnit.id,
  520. subQuestion.id,
  521. 'down'
  522. )
  523. "
  524. >下移
  525. </el-button>
  526. </div>
  527. </div>
  528. <div v-show="quesTagShow" class="edit-property">
  529. <div class="edit-property-box">
  530. <div
  531. v-for="(subQuestionTag, tagIndex) in subQuestion.tags"
  532. :key="tagIndex"
  533. class="edit-property-item"
  534. >
  535. <div class="edit-property-body">
  536. <div class="edit-property-title">
  537. {{ subQuestionTag.tag }}
  538. </div>
  539. <div class="edit-property-content">
  540. {{ subQuestionTag.content }}
  541. </div>
  542. </div>
  543. </div>
  544. </div>
  545. </div>
  546. </div>
  547. </div>
  548. </template>
  549. </div>
  550. </div>
  551. </div>
  552. <!-- 编辑大题弹框 -->
  553. <el-dialog
  554. v-loading.body="detailLoading"
  555. width="600px"
  556. title="大题名称编辑"
  557. element-loading-text="保存中。。。"
  558. :visible.sync="paperDatailDialog"
  559. :modal="false"
  560. append-to-body
  561. custom-class="side-dialog"
  562. @close="closeQuesDialog"
  563. >
  564. <el-form :model="editpaperDetail" label-width="80px">
  565. <el-form-item label="大题名称">
  566. <el-input
  567. v-model="editpaperDetail.name"
  568. placeholder="请输入大题名称"
  569. ></el-input>
  570. </el-form-item>
  571. <el-form-item label="大题描述">
  572. <v-editor
  573. v-model="editpaperDetail.description"
  574. :enable-formula="false"
  575. ></v-editor>
  576. </el-form-item>
  577. </el-form>
  578. <div slot="footer">
  579. <el-button type="primary" @click="savePaperDatail(editpaperDetail)"
  580. >保存</el-button
  581. >
  582. <el-button type="danger" plain @click="closePaperDatailDialog()"
  583. >取消</el-button
  584. >
  585. </div>
  586. </el-dialog>
  587. <!-- 编辑试题弹框 -->
  588. <el-dialog
  589. v-loading.body="dialogLoading"
  590. title="试题编辑"
  591. width="900px"
  592. element-loading-text="保存中。。。"
  593. :visible.sync="quesDialog"
  594. :modal="false"
  595. append-to-body
  596. custom-class="side-dialog"
  597. @close="closeQuesDialog"
  598. >
  599. <el-form :model="quesModel" label-position="right" label-width="80px">
  600. <el-row :gutter="10">
  601. <el-col :span="12">
  602. <el-form-item label="题型">
  603. <el-select
  604. v-model="quesModel.questionType"
  605. :disabled="true"
  606. placeholder="请输入题型"
  607. >
  608. <el-option
  609. v-for="item in questionTypes"
  610. :key="item.value"
  611. :label="item.label"
  612. :value="item.value"
  613. >
  614. </el-option>
  615. </el-select>
  616. </el-form-item>
  617. </el-col>
  618. <el-col :span="12">
  619. <el-form-item label="分值">
  620. <el-input-number
  621. v-model="quesModel.score"
  622. placeholder="分值"
  623. :precision="1"
  624. :min="0"
  625. :disabled="isNested(quesModel.questionType)"
  626. ></el-input-number>
  627. </el-form-item>
  628. </el-col>
  629. <el-col :span="12">
  630. <el-form-item label="难度">
  631. <el-select
  632. v-model="quesModel.difficulty"
  633. placeholder="请输入难度"
  634. :disabled="
  635. isNested(quesModel.questionType) ? true : updatePorperty
  636. "
  637. >
  638. <el-option
  639. v-for="item in difficultyList"
  640. :key="item.value"
  641. :label="item.label"
  642. :value="item.value"
  643. >
  644. </el-option>
  645. </el-select>
  646. </el-form-item>
  647. </el-col>
  648. <el-col :span="12">
  649. <el-form-item label="公开度">
  650. <el-select
  651. v-model="quesModel.publicity"
  652. placeholder="请输入公开度"
  653. :disabled="updatePorperty"
  654. >
  655. <el-option
  656. v-for="item in publicityList"
  657. :key="item.value"
  658. :label="item.label"
  659. :value="item.value"
  660. >
  661. </el-option>
  662. </el-select>
  663. </el-form-item>
  664. </el-col>
  665. <el-col
  666. v-if="quesModel.questionType == 'TEXT_ANSWER_QUESTION'"
  667. :span="12"
  668. >
  669. <el-form-item label="作答类型">
  670. <el-select
  671. v-model="quesModel.answerType"
  672. :disabled="updatePorperty"
  673. >
  674. <el-option
  675. v-for="item in answerTypes"
  676. :key="item.value"
  677. :label="item.label"
  678. :value="item.value"
  679. >
  680. </el-option>
  681. </el-select>
  682. </el-form-item>
  683. </el-col>
  684. <el-col
  685. v-if="quesModel.questionType && !isNested(quesModel.questionType)"
  686. :span="12"
  687. >
  688. <el-form-item label="时长">
  689. <el-input-number
  690. v-model="quesModel.control.maxAnswerTime"
  691. :precision="0"
  692. :min="1"
  693. :disabled="updatePorperty"
  694. ></el-input-number>
  695. </el-form-item>
  696. </el-col>
  697. <el-col v-if="isMatchingQuestion(quesModel.questionType)" :span="12">
  698. <el-form-item label="答题模式">
  699. <el-select
  700. v-model="quesModel.quesParam.matchingMode"
  701. :disabled="updatePorperty"
  702. >
  703. <el-option
  704. v-for="item in matchingModes"
  705. :key="item.value"
  706. :label="item.label"
  707. :value="item.value"
  708. >
  709. </el-option>
  710. </el-select>
  711. </el-form-item>
  712. </el-col>
  713. </el-row>
  714. <el-form-item label="属性列表">
  715. <el-tooltip
  716. v-for="(content, propIndex) in quesModel.quesProperties"
  717. :key="propIndex"
  718. placement="top"
  719. >
  720. <div slot="content">
  721. <span v-if="content.firstProperty != null"
  722. >一级属性:{{ content.firstProperty.name }}({{
  723. content.firstProperty.code
  724. }})</span
  725. ><br />
  726. <span v-if="content.secondProperty != null"
  727. >二级属性:{{ content.secondProperty.name }}({{
  728. content.secondProperty.code
  729. }})</span
  730. >
  731. </div>
  732. <span>
  733. <el-tag
  734. :key="content.id"
  735. style="margin-right: 5px"
  736. :closable="
  737. isNested(quesModel.questionType) ? false : !updatePorperty
  738. "
  739. type="primary"
  740. effect="dark"
  741. @close="handleClose(content)"
  742. >
  743. {{ content.courseProperty.name }}
  744. </el-tag>
  745. </span>
  746. </el-tooltip>
  747. </el-form-item>
  748. <el-row v-if="!isNested(quesModel.questionType)" :gutter="10">
  749. <el-col :span="8">
  750. <el-form-item label="属性名" label-width="80px">
  751. <el-select
  752. v-model="coursePropertyId"
  753. :remote-method="getCoursesProperty"
  754. :loading="coursePropertyLoading"
  755. remote
  756. filterable
  757. clearable
  758. placeholder="属性名"
  759. class="property_with"
  760. :disabled="updatePorperty"
  761. @change="searchFirst"
  762. >
  763. <el-option label="请选择" value=""></el-option>
  764. <el-option
  765. v-for="item in coursePropertyList"
  766. :key="item.id"
  767. :label="item.name"
  768. :value="item.id"
  769. >
  770. </el-option>
  771. </el-select>
  772. </el-form-item>
  773. </el-col>
  774. <el-col :span="6">
  775. <el-form-item label="一级" label-width="48px">
  776. <el-select
  777. v-model="firstPropertyId"
  778. placeholder="一级"
  779. class="property_with"
  780. :disabled="updatePorperty"
  781. @change="searchSecond"
  782. >
  783. <el-option label="请选择" value=""></el-option>
  784. <el-option
  785. v-for="item in firstPropertyList"
  786. :key="item.id"
  787. :label="item.name + '(' + item.code + ')'"
  788. :value="item.id"
  789. >
  790. </el-option>
  791. </el-select>
  792. </el-form-item>
  793. </el-col>
  794. <el-col :span="6">
  795. <el-form-item label="二级" label-width="48px">
  796. <el-select
  797. v-model="secondPropertyId"
  798. placeholder="二级"
  799. class="property_with"
  800. :disabled="updatePorperty"
  801. >
  802. <el-option label="请选择" value=""></el-option>
  803. <el-option
  804. v-for="item in secondPropertyList"
  805. :key="item.id"
  806. :label="item.name + '(' + item.code + ')'"
  807. :value="item.id"
  808. >
  809. </el-option>
  810. </el-select>
  811. </el-form-item>
  812. </el-col>
  813. <el-col :span="4">
  814. <el-form-item label-width="0px">
  815. <el-button
  816. type="primary"
  817. :disabled="updatePorperty"
  818. @click="insertProperty"
  819. ><i class="el-icon-plus"></i>新增属性
  820. </el-button>
  821. </el-form-item>
  822. </el-col>
  823. </el-row>
  824. <!-- end by weiwenhai -->
  825. <el-form-item label="题目">
  826. <v-editor
  827. v-model="quesModel.quesBody"
  828. :enable-answer-point="enableAnswerPoint"
  829. @change="quesBodyChange"
  830. ></v-editor>
  831. </el-form-item>
  832. <el-form-item
  833. v-for="(quesOption, optIndex) in quesModel.quesOptions"
  834. :key="optIndex"
  835. >
  836. <div class="question-edit-option">
  837. <div class="option-check">
  838. <div
  839. v-if="
  840. !quesModel.parentType ||
  841. !isMatchingQuestion(quesModel.parentType) ||
  842. !isInOtherSelect(optIndex, quesModel)
  843. "
  844. >
  845. <el-radio
  846. v-if="quesModel.questionType === 'SINGLE_ANSWER_QUESTION'"
  847. v-model="singleRightAnswer"
  848. :label="optIndex | optionOrderWordFilter"
  849. ></el-radio>
  850. <el-checkbox
  851. v-if="quesModel.questionType === 'MULTIPLE_ANSWER_QUESTION'"
  852. v-model="multipleRightAnswer"
  853. :label="optIndex | optionOrderWordFilter"
  854. ></el-checkbox>
  855. <span v-if="isMatchingQuestion(quesModel.questionType)">{{
  856. optIndex | optionOrderWordFilter
  857. }}</span>
  858. </div>
  859. <div
  860. v-if="
  861. quesModel.parentType &&
  862. isMatchingQuestion(quesModel.parentType) &&
  863. isInOtherSelect(optIndex, quesModel)
  864. "
  865. >
  866. <el-tooltip
  867. class="item"
  868. effect="dark"
  869. :content="otherSelect(optIndex, quesModel)"
  870. placement="top-start"
  871. >
  872. <el-radio
  873. v-if="quesModel.questionType === 'SINGLE_ANSWER_QUESTION'"
  874. v-model="singleRightAnswer"
  875. :disabled="true"
  876. :label="optIndex | optionOrderWordFilter"
  877. ></el-radio>
  878. <el-checkbox
  879. v-if="quesModel.questionType === 'MULTIPLE_ANSWER_QUESTION'"
  880. v-model="multipleRightAnswer"
  881. :disabled="true"
  882. :label="optIndex | optionOrderWordFilter"
  883. ></el-checkbox>
  884. <span v-if="isMatchingQuestion(quesModel.questionType)">{{
  885. optIndex | optionOrderWordFilter
  886. }}</span>
  887. </el-tooltip>
  888. </div>
  889. </div>
  890. <div
  891. v-if="
  892. !quesModel.parentType ||
  893. !isMatchingQuestion(quesModel.parentType)
  894. "
  895. class="option-body"
  896. >
  897. <v-editor v-model="quesOption.optionBody"></v-editor>
  898. </div>
  899. <div
  900. v-if="
  901. quesModel.parentType && isMatchingQuestion(quesModel.parentType)
  902. "
  903. class="option-body"
  904. >
  905. <rich-text :text-json="quesOption.optionBody"></rich-text>
  906. </div>
  907. <div
  908. v-if="
  909. !quesModel.parentType ||
  910. !isMatchingQuestion(quesModel.parentType)
  911. "
  912. class="option-delete"
  913. >
  914. <el-button
  915. size="mini"
  916. circle
  917. type="danger"
  918. icon="el-icon-delete"
  919. title="删除"
  920. @click.prevent="removeQuesOption(quesOption)"
  921. ></el-button>
  922. </div>
  923. </div>
  924. </el-form-item>
  925. <el-form-item>
  926. <el-button
  927. v-if="
  928. (quesModel.questionType == 'SINGLE_ANSWER_QUESTION' ||
  929. quesModel.questionType == 'MULTIPLE_ANSWER_QUESTION' ||
  930. isMatchingQuestion(quesModel.questionType)) &&
  931. !isMatchingQuestion(quesModel.parentType)
  932. "
  933. type="primary"
  934. @click="addQuesOption"
  935. ><i class="el-icon-plus"></i> 新增选项
  936. </el-button>
  937. </el-form-item>
  938. <!-- 答案 -->
  939. <!-- 填空, -->
  940. <div v-if="quesModel.questionType == 'FILL_BLANK_QUESTION'">
  941. <el-form-item label="答案" prop="quesAnswer">
  942. <div v-if="quesAnswer" class="option-list">
  943. <div
  944. v-for="(opt, index) of quesAnswer"
  945. :key="index"
  946. class="option-item"
  947. >
  948. <div class="option-item-info">
  949. <span>({{ index + 1 }})</span>
  950. </div>
  951. <v-editor
  952. :value="opt"
  953. class="option-item-body"
  954. @change="(val) => updateAnswerPoint(index, val)"
  955. />
  956. </div>
  957. </div>
  958. </el-form-item>
  959. </div>
  960. <!-- 简答 -->
  961. <div v-if="quesModel.questionType === 'TEXT_ANSWER_QUESTION'">
  962. <el-form-item label="答案" prop="quesAnswer">
  963. <v-editor
  964. v-model="quesAnswer"
  965. @change="textAnswerChange"
  966. ></v-editor>
  967. </el-form-item>
  968. </div>
  969. <!-- 单选或多选 -->
  970. <div
  971. v-if="
  972. quesModel.questionType == 'SINGLE_ANSWER_QUESTION' ||
  973. quesModel.questionType == 'MULTIPLE_ANSWER_QUESTION'
  974. "
  975. >
  976. <el-form-item label="答案">
  977. <span v-html="answer"></span>
  978. </el-form-item>
  979. </div>
  980. <!-- 判断 -->
  981. <div v-if="quesModel.questionType == 'BOOL_ANSWER_QUESTION'">
  982. <el-row>
  983. <el-col>
  984. <el-form-item label="答案">
  985. <el-select
  986. v-model="quesAnswer"
  987. placeholder="请选择"
  988. @change="boolAnswerChange"
  989. >
  990. <el-option
  991. v-for="op in options"
  992. :key="op.value"
  993. :label="op.label"
  994. :value="op.value"
  995. >
  996. </el-option>
  997. </el-select>
  998. </el-form-item>
  999. </el-col>
  1000. </el-row>
  1001. </div>
  1002. </el-form>
  1003. <div slot="footer">
  1004. <el-button type="primary" @click="savePaperDetailUnit()"
  1005. >保存</el-button
  1006. >
  1007. <el-button type="danger" plain @click="closeQuesDialog">取消</el-button>
  1008. </div>
  1009. </el-dialog>
  1010. <!-- 考试说明弹框 -->
  1011. <el-dialog
  1012. title="考试说明编辑"
  1013. :visible.sync="paperRemarkDialog"
  1014. width="600px"
  1015. :modal="false"
  1016. append-to-body
  1017. custom-class="side-dialog"
  1018. >
  1019. <el-form label-position="top">
  1020. <el-form-item label="考试说明:">
  1021. <v-editor v-model="examRemark" :enable-formula="false"></v-editor>
  1022. </el-form-item>
  1023. </el-form>
  1024. <div slot="footer">
  1025. <el-button type="primary" @click="savePaperRemark">保存</el-button>
  1026. <el-button type="danger" plain @click="closPaperRemark">取消</el-button>
  1027. </div>
  1028. </el-dialog>
  1029. <!-- 上传音频弹框 -->
  1030. <el-dialog
  1031. title="上传音频文件"
  1032. :visible.sync="dialogRadioFile"
  1033. :before-close="closeAudioDialog"
  1034. :modal="false"
  1035. width="520px"
  1036. append-to-body
  1037. custom-class="side-dialog"
  1038. >
  1039. <div>
  1040. <div tabindex="0" class="el-upload el-upload--text">
  1041. <el-button
  1042. type="primary"
  1043. icon="icon icon-search-white"
  1044. @click="selectAudioFile"
  1045. >选择文件</el-button
  1046. >
  1047. <input
  1048. id="radioFile"
  1049. class="el-upload__input"
  1050. name="files"
  1051. type="file"
  1052. value="上传音频文件"
  1053. webkitdirectory
  1054. @change="audioFileChange"
  1055. />
  1056. </div>
  1057. <el-button type="warning" @click="checkFile">检查文件名</el-button>
  1058. <el-button
  1059. type="info"
  1060. :loading="uploadAudioLoading"
  1061. :disabled="isUpload || uploadAudioLoading"
  1062. @click="uploadAudioFile"
  1063. >
  1064. <span v-show="!uploadAudioLoading">开始上传</span>
  1065. <span v-show="uploadAudioLoading">正在上传中...</span>
  1066. </el-button>
  1067. </div>
  1068. <p class="tips-info"><i class="el-icon-info"></i>只能上传MP3文件</p>
  1069. <p v-if="audioFileName" class="tips-info">文件: {{ audioFileName }}</p>
  1070. <div v-if="checkResult" style="margin-top: 20px">
  1071. <span>检查结果:</span><br /><br />
  1072. <span v-show="message == 'OK!'" style="color: #13ce66">OK!</span>
  1073. <span v-show="message != 'OK!'" style="color: #ff4949">{{
  1074. message
  1075. }}</span>
  1076. </div>
  1077. </el-dialog>
  1078. <!-- 上传答案文件 -->
  1079. <el-dialog
  1080. title="上传答案文件"
  1081. :visible.sync="dialogAnswerFile"
  1082. :before-close="closeAnswerDialog"
  1083. :modal="false"
  1084. width="520px"
  1085. append-to-body
  1086. custom-class="side-dialog"
  1087. >
  1088. <div>
  1089. <div tabindex="0" class="el-upload el-upload--text">
  1090. <el-button
  1091. type="primary"
  1092. icon="icon icon-search-white"
  1093. @click="selectAnswerFile"
  1094. >选择文件</el-button
  1095. >
  1096. <input
  1097. id="answerFile"
  1098. class="el-upload__input"
  1099. name="answerFiles"
  1100. type="file"
  1101. value="上传答案文件"
  1102. accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
  1103. @change="answerFileChange"
  1104. />
  1105. </div>
  1106. <el-button type="primary" @click="downAnswerTemplate">
  1107. <span>下载模板</span>
  1108. </el-button>
  1109. <el-button
  1110. type="primary"
  1111. :loading="uploadAnswerLoading"
  1112. :disabled="uploadAnswerLoading"
  1113. @click="uploadAnswerFile"
  1114. >
  1115. <span v-show="!uploadAnswerLoading">开始上传</span>
  1116. <span v-show="uploadAnswerLoading">正在上传中...</span>
  1117. </el-button>
  1118. </div>
  1119. <p v-if="answerFileName" class="tips-info">文件: {{ answerFileName }}</p>
  1120. <div style="margin-top: 20px">
  1121. <span v-show="answerMessage != ''" style="color: #ff4949">{{
  1122. answerMessage
  1123. }}</span>
  1124. </div>
  1125. </el-dialog>
  1126. <!-- 基础构成 -->
  1127. <el-dialog
  1128. title="基础构成"
  1129. width="100%"
  1130. :visible.sync="basicDialog"
  1131. :modal="false"
  1132. append-to-body
  1133. custom-class="side-dialog"
  1134. >
  1135. <PaperBasicComposition
  1136. v-if="basicDialog"
  1137. :paper-id="paperId"
  1138. ></PaperBasicComposition>
  1139. </el-dialog>
  1140. <!-- 题型分布 -->
  1141. <el-dialog
  1142. title="题型分布"
  1143. width="100%"
  1144. :visible.sync="typeDialog"
  1145. :modal="false"
  1146. append-to-body
  1147. custom-class="side-dialog"
  1148. >
  1149. <PaperQuestionType
  1150. v-if="typeDialog"
  1151. :paper-id="paperId"
  1152. ></PaperQuestionType>
  1153. </el-dialog>
  1154. <!-- 蓝图分布 -->
  1155. <el-dialog
  1156. title="蓝图分布"
  1157. width="100%"
  1158. :visible.sync="blueDialog"
  1159. :modal="false"
  1160. append-to-body
  1161. custom-class="side-dialog"
  1162. >
  1163. <PaperBlue
  1164. v-if="blueDialog"
  1165. :paper-id="paperId"
  1166. :course-id="paper.course.id"
  1167. ></PaperBlue>
  1168. </el-dialog>
  1169. <!-- 审核记录 -->
  1170. <el-dialog
  1171. title="审核记录"
  1172. width="700px"
  1173. :visible.sync="auditInfoDialog"
  1174. :modal="false"
  1175. append-to-body
  1176. custom-class="side-dialog"
  1177. >
  1178. <AuditInfo v-if="auditInfoDialog" :paper-id="paperId"></AuditInfo>
  1179. </el-dialog>
  1180. </div>
  1181. </template>
  1182. <script>
  1183. import { QUESTION_API } from "@/constants/constants";
  1184. import { isEmptyStr, QUESTION_TYPES } from "../constants/constants";
  1185. import { mapState } from "vuex";
  1186. import PaperBasicComposition from "./PaperBasicComposition.vue";
  1187. import PaperQuestionType from "./PaperQuestionType.vue";
  1188. import PaperBlue from "./PaperBlue.vue";
  1189. import AuditInfo from "./AuditInfo.vue";
  1190. import QuestionAnswer from "../../question/components/QuestionAnswer.vue";
  1191. import { checkRichTextContentIsEmpty } from "@/plugins/utils";
  1192. export default {
  1193. name: "EditPaperApp",
  1194. components: {
  1195. PaperBasicComposition,
  1196. PaperQuestionType,
  1197. PaperBlue,
  1198. AuditInfo,
  1199. QuestionAnswer,
  1200. },
  1201. data() {
  1202. return {
  1203. coursePropertyLoading: false,
  1204. showCheckDuplicateBtn: false,
  1205. auditInfoDialog: false,
  1206. blueDialog: false,
  1207. typeDialog: false,
  1208. basicDialog: false,
  1209. quesAnswerShow: true,
  1210. quesTagShow: true,
  1211. hValue: "100px",
  1212. wValue: "560px",
  1213. display: "block",
  1214. uploadAction: "",
  1215. fileList: [],
  1216. answerFileList: [],
  1217. paperId: null,
  1218. paperDetailId: "",
  1219. editPaperDetailUnit: "",
  1220. quesDialog: false,
  1221. paperDatailDialog: false,
  1222. paperRemarkDialog: false,
  1223. parentView: "",
  1224. paper: {
  1225. course: {
  1226. code: "",
  1227. name: "",
  1228. },
  1229. examRemark: "",
  1230. },
  1231. loading: false,
  1232. dialogLoading: false,
  1233. detailLoading: false,
  1234. uploadAudioLoading: false,
  1235. uploadAnswerLoading: false,
  1236. questionTypes: QUESTION_TYPES,
  1237. questionType: "",
  1238. quesModel: { quesProperties: [] },
  1239. quesAnswer: null,
  1240. prevAnswerPointCount: 0,
  1241. editpaperDetail: {},
  1242. reduplicateQuestions: [],
  1243. reduplicateGroup: [],
  1244. reduplicateQuesColor: [],
  1245. singleRightAnswer: "", //接收单选答案
  1246. multipleRightAnswer: [], //接收多选答案
  1247. options: [
  1248. {
  1249. value: 0,
  1250. label: "错误",
  1251. },
  1252. {
  1253. value: 1,
  1254. label: "正确",
  1255. },
  1256. ],
  1257. duplicateLoading: false,
  1258. dialogRadioFile: false,
  1259. dialogAnswerFile: false,
  1260. isUpload: true,
  1261. isUploadAnswer: true,
  1262. message: "",
  1263. answerMessage: "",
  1264. answerFileName: "",
  1265. audioFileName: "",
  1266. checkResult: false,
  1267. checkResultAnswer: false,
  1268. fileNameList: [],
  1269. defaultColor: [
  1270. "Red",
  1271. "Blue",
  1272. "LimeGreen",
  1273. "GoldenRod",
  1274. "Black",
  1275. "BlueViolet",
  1276. "Chocolate",
  1277. "DarkCyan",
  1278. "HotPink",
  1279. "Orange",
  1280. "IndianRed",
  1281. "Indigo",
  1282. "Green",
  1283. "Aqua",
  1284. "CadetBlue",
  1285. "SkyBlue",
  1286. "SlateBlue",
  1287. "SlateGray",
  1288. "Tomato",
  1289. "VioletRed",
  1290. ],
  1291. difficultyList: [
  1292. { label: "难", value: "难" },
  1293. { label: "中", value: "中" },
  1294. { label: "易", value: "易" },
  1295. ],
  1296. publicityList: [
  1297. { label: "公开", value: true },
  1298. { label: "非公开", value: false },
  1299. ],
  1300. answerTypes: [
  1301. { label: "文本", value: "DIVERSIFIED_TEXT" },
  1302. { label: "音频", value: "SINGLE_AUDIO" },
  1303. ],
  1304. matchingTypes: [
  1305. { label: "填词", value: 1 },
  1306. { label: "段落", value: 2 },
  1307. ],
  1308. matchingModes: [
  1309. { label: "单用", value: 1 },
  1310. { label: "复用", value: 2 },
  1311. ],
  1312. coursePropertyList: [],
  1313. coursePropertyId: "", //课程属性名
  1314. firstPropertyList: [], //一级属性集合
  1315. firstPropertyId: "", //一级属性id
  1316. secondPropertyList: [], //二级属性集合
  1317. secondPropertyId: "", //二级属性id
  1318. examRemark: "",
  1319. showQuestions: [],
  1320. showButtons: [],
  1321. showSubQuestions: {},
  1322. showSubButtons: {},
  1323. };
  1324. },
  1325. computed: {
  1326. ...mapState({
  1327. user: (state) => state.user,
  1328. }),
  1329. updatePorperty() {
  1330. return false;
  1331. },
  1332. answer() {
  1333. if (this.quesModel.questionType == "SINGLE_ANSWER_QUESTION") {
  1334. return this.singleRightAnswer;
  1335. } else if (this.quesModel.questionType == "MULTIPLE_ANSWER_QUESTION") {
  1336. var obj = this.multipleRightAnswer;
  1337. return obj.sort().toString();
  1338. }
  1339. return this.quesModel.quesAnswer;
  1340. },
  1341. enableAnswerPoint() {
  1342. return (
  1343. this.quesModel.questionType == "FILL_BLANK_QUESTION" ||
  1344. this.quesModel.questionType == "CLOZE" ||
  1345. this.quesModel.questionType == "BANKED_CLOZE"
  1346. );
  1347. },
  1348. enableCardEdit() {
  1349. return (
  1350. this.paper.auditStatus === "PASS" && this.paper.paperType === "GENERATE"
  1351. );
  1352. },
  1353. },
  1354. created() {
  1355. let qt = sessionStorage.getItem("quesTagShow");
  1356. if (qt) {
  1357. this.quesTagShow = qt == "true";
  1358. }
  1359. let qa = sessionStorage.getItem("quesAnswerShow");
  1360. if (qa) {
  1361. this.quesAnswerShow = qa == "true";
  1362. }
  1363. document.getElementsByTagName("body")[0].style = "";
  1364. this.paperId = Number(this.$route.params.id);
  1365. this.parentView = this.$route.params.parentView;
  1366. this.initPaper();
  1367. this.uploadAction = QUESTION_API + "/uploadRadio/" + this.paperId;
  1368. this.uploadHeaders = {
  1369. key: this.user.key,
  1370. token: this.user.token,
  1371. };
  1372. },
  1373. methods: {
  1374. getQuesPropertyKey(quesProp) {
  1375. if (!quesProp) {
  1376. return "";
  1377. } else if (quesProp.secondProperty.id) {
  1378. return (
  1379. quesProp.courseProperty.id +
  1380. "-" +
  1381. quesProp.firstProperty.id +
  1382. "-" +
  1383. quesProp.secondProperty.id
  1384. );
  1385. } else {
  1386. return quesProp.courseProperty.id + "-" + quesProp.firstProperty.id;
  1387. }
  1388. },
  1389. getCoursesProperty(name) {
  1390. this.coursePropertyLoading = true;
  1391. this.$httpWithMsg
  1392. .get(
  1393. QUESTION_API +
  1394. "/courseProperty/enable?courseId=" +
  1395. this.paper.course.id +
  1396. "&name=" +
  1397. name
  1398. )
  1399. .then((response) => {
  1400. this.coursePropertyList = response.data;
  1401. this.coursePropertyLoading = false;
  1402. });
  1403. },
  1404. showCheckDuplicate() {
  1405. if (this.paper.checkDuplicateStatus == "DISPOSED") {
  1406. this.showCheckDuplicateBtn = false;
  1407. } else if (this.paper.paperDetails) {
  1408. for (let paperDetilData of this.paper.paperDetails) {
  1409. if (paperDetilData.paperDetailUnits) {
  1410. for (let unit of paperDetilData.paperDetailUnits) {
  1411. if (unit.question.checkDuplicateStatus == "TO_BE_DISPOSE") {
  1412. this.showCheckDuplicateBtn = true;
  1413. return;
  1414. }
  1415. }
  1416. }
  1417. }
  1418. this.showCheckDuplicateBtn = false;
  1419. }
  1420. },
  1421. checkDuplicate() {
  1422. this.$router.push({
  1423. name: "check_duplicate_info",
  1424. query: {
  1425. basePaperId: this.paper.id,
  1426. from: "paper",
  1427. },
  1428. });
  1429. },
  1430. checkDuplicateQuestion(questionId) {
  1431. this.$router.push({
  1432. name: "check_duplicate_info",
  1433. query: {
  1434. quesId: questionId,
  1435. basePaperId: this.paper.id,
  1436. from: "paper",
  1437. },
  1438. });
  1439. },
  1440. toEditCard() {
  1441. this.$router.push({
  1442. name: "CardEdit",
  1443. params: {
  1444. idType: "paper",
  1445. paperOrCardId: this.paperId,
  1446. },
  1447. });
  1448. },
  1449. showAuditDialog() {
  1450. this.auditInfoDialog = true;
  1451. },
  1452. showBlueDialog() {
  1453. this.blueDialog = true;
  1454. },
  1455. showTypeDialog() {
  1456. this.typeDialog = true;
  1457. },
  1458. showBasicDialog() {
  1459. this.basicDialog = true;
  1460. },
  1461. quesAnswerShowHide() {
  1462. this.quesAnswerShow = !this.quesAnswerShow;
  1463. sessionStorage.setItem("quesAnswerShow", this.quesAnswerShow);
  1464. },
  1465. quesTagShowHide() {
  1466. this.quesTagShow = !this.quesTagShow;
  1467. sessionStorage.setItem("quesTagShow", this.quesTagShow);
  1468. },
  1469. isMatchingQuestion(questionType) {
  1470. if (
  1471. questionType == "PARAGRAPH_MATCHING" ||
  1472. questionType == "BANKED_CLOZE"
  1473. ) {
  1474. return true;
  1475. } else {
  1476. return false;
  1477. }
  1478. },
  1479. isNested(questionType) {
  1480. if (
  1481. questionType == "PARAGRAPH_MATCHING" ||
  1482. questionType == "BANKED_CLOZE" ||
  1483. questionType == "CLOZE" ||
  1484. questionType == "READING_COMPREHENSION" ||
  1485. questionType == "LISTENING_QUESTION"
  1486. ) {
  1487. return true;
  1488. } else {
  1489. return false;
  1490. }
  1491. },
  1492. otherSelect(optIndex, quesModel) {
  1493. return "该选项被第" + quesModel.optionsSelected[optIndex + 1] + "题选用";
  1494. },
  1495. isInOtherSelect(optIndex, quesModel) {
  1496. if (quesModel.parentQuesParam.matchingMode != 1) {
  1497. return false;
  1498. }
  1499. if (!quesModel.optionsSelected) {
  1500. return false;
  1501. }
  1502. if (!quesModel.optionsSelected[optIndex + 1]) {
  1503. return false;
  1504. }
  1505. if (
  1506. quesModel.optionsSelected[optIndex + 1].includes(quesModel.subNumber)
  1507. ) {
  1508. return false;
  1509. }
  1510. return true;
  1511. },
  1512. movePaperDetailUnitSub(unitid, subid, vector) {
  1513. let vectorStr = vector == "up" ? "上移" : "下移";
  1514. this.$alert("您确定" + vectorStr + "吗?", "提示", {
  1515. confirmButtonText: "确定",
  1516. callback: (action) => {
  1517. if (action == "confirm") {
  1518. this.loading = true;
  1519. this.$httpWithMsg
  1520. .put(
  1521. QUESTION_API +
  1522. "/paperDetailUnit/sub/" +
  1523. unitid +
  1524. "/" +
  1525. subid +
  1526. "/" +
  1527. vector
  1528. )
  1529. .then(() => {
  1530. this.initPaper();
  1531. this.loading = true;
  1532. this.$notify({
  1533. message: vectorStr + "成功",
  1534. type: "success",
  1535. });
  1536. })
  1537. .finally(() => {
  1538. this.loading = false;
  1539. });
  1540. }
  1541. },
  1542. });
  1543. },
  1544. showUnitSubDown(unit, subid) {
  1545. if (unit.question.subQuestions.length <= 1) {
  1546. return false;
  1547. }
  1548. if (
  1549. subid !=
  1550. unit.question.subQuestions[unit.question.subQuestions.length - 1].id
  1551. ) {
  1552. return true;
  1553. } else {
  1554. return false;
  1555. }
  1556. },
  1557. showUnitSubUp(unit, subid) {
  1558. if (unit.question.subQuestions.length <= 1) {
  1559. return false;
  1560. }
  1561. if (subid != unit.question.subQuestions[0].id) {
  1562. return true;
  1563. } else {
  1564. return false;
  1565. }
  1566. },
  1567. movePaperDetailUnit(detailId, unitid, vector) {
  1568. let vectorStr = vector == "up" ? "上移" : "下移";
  1569. this.$alert("您确定" + vectorStr + "吗?", "提示", {
  1570. confirmButtonText: "确定",
  1571. callback: (action) => {
  1572. if (action == "confirm") {
  1573. this.loading = true;
  1574. this.$httpWithMsg
  1575. .put(
  1576. QUESTION_API +
  1577. "/paperDetailUnit/" +
  1578. detailId +
  1579. "/" +
  1580. unitid +
  1581. "/" +
  1582. vector
  1583. )
  1584. .then(() => {
  1585. this.initPaper();
  1586. this.loading = true;
  1587. this.$notify({
  1588. message: vectorStr + "成功",
  1589. type: "success",
  1590. });
  1591. })
  1592. .finally(() => {
  1593. this.loading = false;
  1594. });
  1595. }
  1596. },
  1597. });
  1598. },
  1599. showUnitDown(detail, unitid) {
  1600. if (detail.paperDetailUnits.length <= 1) {
  1601. return false;
  1602. }
  1603. if (
  1604. unitid != detail.paperDetailUnits[detail.paperDetailUnits.length - 1].id
  1605. ) {
  1606. return true;
  1607. } else {
  1608. return false;
  1609. }
  1610. },
  1611. showUnitUp(detail, unitid) {
  1612. if (detail.paperDetailUnits.length <= 1) {
  1613. return false;
  1614. }
  1615. if (unitid != detail.paperDetailUnits[0].id) {
  1616. return true;
  1617. } else {
  1618. return false;
  1619. }
  1620. },
  1621. movePaperDetail(detail, vector) {
  1622. let vectorStr = vector == "up" ? "上移" : "下移";
  1623. this.$alert("您确定" + vectorStr + "吗?", "提示", {
  1624. confirmButtonText: "确定",
  1625. callback: (action) => {
  1626. if (action == "confirm") {
  1627. this.loading = true;
  1628. this.$httpWithMsg
  1629. .put(
  1630. QUESTION_API +
  1631. "/paperDetail/" +
  1632. this.paperId +
  1633. "/" +
  1634. detail.id +
  1635. "/" +
  1636. vector
  1637. )
  1638. .then(() => {
  1639. this.initPaper();
  1640. this.loading = true;
  1641. this.$notify({
  1642. message: vectorStr + "成功",
  1643. type: "success",
  1644. });
  1645. })
  1646. .finally(() => {
  1647. this.loading = false;
  1648. });
  1649. }
  1650. },
  1651. });
  1652. },
  1653. showUp(detail) {
  1654. if (this.paper.paperDetails.length <= 1) {
  1655. return false;
  1656. }
  1657. if (detail.id != this.paper.paperDetails[0].id) {
  1658. return true;
  1659. } else {
  1660. return false;
  1661. }
  1662. },
  1663. showDown(detail) {
  1664. if (this.paper.paperDetails.length <= 1) {
  1665. return false;
  1666. }
  1667. if (
  1668. detail.id !=
  1669. this.paper.paperDetails[this.paper.paperDetails.length - 1].id
  1670. ) {
  1671. return true;
  1672. } else {
  1673. return false;
  1674. }
  1675. },
  1676. downAnswerTemplate() {
  1677. var key = this.user.key;
  1678. var token = this.user.token;
  1679. window.open(
  1680. QUESTION_API + "/paper/answer/template?$key=" + key + "&$token=" + token
  1681. );
  1682. },
  1683. openAnswerDialog() {
  1684. this.checkResultAnswer = false;
  1685. this.isUploadAnswer = true;
  1686. if (document.getElementById("answerFile")) {
  1687. document.getElementById("answerFile").value = "";
  1688. }
  1689. this.answerFileName = "";
  1690. this.dialogAnswerFile = true;
  1691. this.answerFileList = [];
  1692. },
  1693. closeAnswerDialog() {
  1694. this.answerMessage = "";
  1695. this.dialogAnswerFile = this.uploadAnswerLoading;
  1696. },
  1697. selectAnswerFile() {
  1698. document.getElementById("answerFile").click();
  1699. },
  1700. answerFileChange() {
  1701. let fileList = document.getElementById("answerFile").files;
  1702. if (fileList.length == 0) {
  1703. this.answerFileName = "";
  1704. } else {
  1705. this.answerFileName = fileList[0].name;
  1706. }
  1707. },
  1708. uploadAnswerFile() {
  1709. this.answerMessage = "";
  1710. var fileList = document.getElementById("answerFile").files;
  1711. if (fileList.length == 0) {
  1712. this.answerMessage = "请选择文件!";
  1713. return;
  1714. }
  1715. let param = new FormData();
  1716. //循环添加到formData中
  1717. for (var i = 0; i < fileList.length; i++) {
  1718. var file = fileList[i];
  1719. param.append("dataFile", file, file.name);
  1720. }
  1721. let config = {
  1722. headers: { "Content-Type": "multipart/form-data" },
  1723. };
  1724. this.uploadAnswerLoading = true;
  1725. this.$http
  1726. .post(
  1727. QUESTION_API + "/paper/answer/import/" + this.paperId,
  1728. param,
  1729. config
  1730. )
  1731. .then(() => {
  1732. this.dialogAnswerFile = false;
  1733. this.uploadAnswerLoading = false;
  1734. this.checkResultAnswer = false;
  1735. this.isUploadAnswer = true;
  1736. document.getElementById("answerFile").value = "";
  1737. this.initPaper();
  1738. })
  1739. .catch((error) => {
  1740. this.answerMessage = error.response.data.desc;
  1741. document.getElementById("answerFile").value = "";
  1742. this.uploadAnswerLoading = false;
  1743. });
  1744. },
  1745. //隐藏大题下的所有小题
  1746. hideContent(index) {
  1747. this.showQuestions[index].is_show = false;
  1748. this.showButtons[index].up = false;
  1749. },
  1750. //展开大题下所有小题
  1751. showContent(index) {
  1752. this.showQuestions[index].is_show = true;
  1753. this.showButtons[index].up = true;
  1754. },
  1755. //隐藏大题下的所有小题
  1756. hideSubContent(index) {
  1757. this.showSubQuestions[index] = false;
  1758. this.showSubButtons[index] = false;
  1759. this.$forceUpdate();
  1760. },
  1761. //展开大题下所有小题
  1762. showSubContent(index) {
  1763. this.showSubQuestions[index] = true;
  1764. this.showSubButtons[index] = true;
  1765. this.$forceUpdate();
  1766. },
  1767. quesMouseOver(index) {
  1768. document.getElementById(index).style.visibility = "visible";
  1769. },
  1770. quesMouseOut(index) {
  1771. document.getElementById(index).style.visibility = "hidden";
  1772. },
  1773. selectQues(id) {
  1774. this.paperDetailId = id;
  1775. var courseId = this.paper.course.id;
  1776. this.$router.push({
  1777. path:
  1778. "/select_question/" +
  1779. this.paper.id +
  1780. "/" +
  1781. courseId +
  1782. "/" +
  1783. this.paperDetailId +
  1784. "/" +
  1785. this.parentView,
  1786. });
  1787. },
  1788. //打开编辑大题题目弹窗
  1789. openEditPaperDetail(paperDetail) {
  1790. this.paperDatailDialog = true;
  1791. this.editpaperDetail = Object.assign({}, paperDetail); //浅拷贝
  1792. },
  1793. //关闭编辑大题题目弹窗
  1794. closePaperDatailDialog() {
  1795. this.paperDatailDialog = false;
  1796. this.editpaperDetail = {};
  1797. },
  1798. //保存大题题目信息
  1799. savePaperDatail(editpaperDetail) {
  1800. this.detailLoading = true;
  1801. var paperId = this.paper.id;
  1802. this.$http
  1803. .post(QUESTION_API + "/updatePaperDetail/" + paperId, editpaperDetail)
  1804. .then(() => {
  1805. this.$notify({
  1806. message: "保存成功",
  1807. type: "success",
  1808. });
  1809. this.detailLoading = false;
  1810. this.closePaperDatailDialog();
  1811. this.initPaper();
  1812. });
  1813. },
  1814. //初始化试卷
  1815. initPaper() {
  1816. const scrollPosition =
  1817. document.documentElement.scrollTop || document.body.scrollTop;
  1818. this.loading = true;
  1819. this.paper = {
  1820. course: {
  1821. code: "",
  1822. name: "",
  1823. },
  1824. };
  1825. this.$http
  1826. .get(QUESTION_API + "/paper/" + this.paperId)
  1827. .then((response) => {
  1828. this.paper = response.data;
  1829. //查询所有课程属性名
  1830. this.getCoursesProperty("");
  1831. //将所有小题分为公开和非公开
  1832. if (this.paper.paperDetails && this.paper.paperDetails.length > 0) {
  1833. let dindx = 0;
  1834. for (let paperDetil of this.paper.paperDetails) {
  1835. this.showQuestions.push({ is_show: true });
  1836. this.showButtons.push({ up: true });
  1837. paperDetil.pubCount = 0;
  1838. paperDetil.noPubCount = 0;
  1839. if (
  1840. paperDetil.paperDetailUnits &&
  1841. paperDetil.paperDetailUnits.length > 0
  1842. ) {
  1843. let uindx = 0;
  1844. for (let paperDetilUt of paperDetil.paperDetailUnits) {
  1845. this.showSubQuestions[dindx + "-" + uindx] = true;
  1846. this.showSubButtons[dindx + "-" + uindx] = true;
  1847. if (!this.isNested(paperDetilUt.question.questionType)) {
  1848. //非套题
  1849. if (paperDetilUt.question.publicity) {
  1850. paperDetil.pubCount = paperDetil.pubCount + 1;
  1851. } else {
  1852. paperDetil.noPubCount = paperDetil.noPubCount + 1;
  1853. }
  1854. } else {
  1855. //循环所有子题
  1856. for (let ques of paperDetilUt.question.subQuestions) {
  1857. if (ques.publicity) {
  1858. paperDetil.pubCount = paperDetil.pubCount + 1;
  1859. } else {
  1860. paperDetil.noPubCount = paperDetil.noPubCount + 1;
  1861. }
  1862. }
  1863. }
  1864. uindx++;
  1865. }
  1866. }
  1867. dindx++;
  1868. }
  1869. }
  1870. this.showCheckDuplicate();
  1871. setTimeout(() => {
  1872. document.documentElement.scrollTop = document.body.scrollTop =
  1873. scrollPosition;
  1874. console.log(scrollPosition);
  1875. }, 1000);
  1876. this.loading = false;
  1877. })
  1878. .catch(() => {
  1879. this.loading = false;
  1880. });
  1881. },
  1882. //删除大题
  1883. deletePaperDetail(paperDetailsId) {
  1884. //先判断大题下面是否还有小题
  1885. var count = 0;
  1886. for (var i = 0, imax = this.paper.paperDetails.length; i < imax; i++) {
  1887. if (paperDetailsId == this.paper.paperDetails[i].id) {
  1888. if (this.paper.paperDetails[i].paperDetailUnits) {
  1889. count += this.paper.paperDetails[i].paperDetailUnits.length;
  1890. break;
  1891. }
  1892. }
  1893. }
  1894. if (count == 0) {
  1895. this.$alert("您确定删除吗?", "提示", {
  1896. confirmButtonText: "确定",
  1897. callback: (action) => {
  1898. if (action == "confirm") {
  1899. this.loading = true;
  1900. this.$http
  1901. .delete(
  1902. QUESTION_API +
  1903. "/paperDetail/" +
  1904. this.paperId +
  1905. "/" +
  1906. paperDetailsId
  1907. )
  1908. .then(() => {
  1909. this.initPaper();
  1910. this.loading = true;
  1911. this.$notify({
  1912. message: "删除成功",
  1913. type: "success",
  1914. });
  1915. this.loading = false;
  1916. })
  1917. .catch(() => {
  1918. this.loading = false;
  1919. });
  1920. }
  1921. },
  1922. });
  1923. } else {
  1924. this.$alert("大题下还有小题,不可删除!", "提示", {
  1925. confirmButtonText: "确定",
  1926. callback: () => {},
  1927. });
  1928. }
  1929. },
  1930. quesShow(id) {
  1931. if (this.reduplicateGroup.length < 1) {
  1932. return true;
  1933. }
  1934. for (var i = 0, imax = this.reduplicateGroup.length; i < imax; i++) {
  1935. if (id == this.reduplicateGroup[i]) {
  1936. return true;
  1937. }
  1938. }
  1939. return false;
  1940. },
  1941. //编辑题目
  1942. editQues(paperDetailUnit, question) {
  1943. console.log("question:", question);
  1944. this.coursePropertyId = "";
  1945. this.firstPropertyId = "";
  1946. this.secondPropertyId = "";
  1947. this.editPaperDetailUnit = paperDetailUnit;
  1948. this.quesModel = JSON.parse(JSON.stringify(question)); //深拷贝
  1949. if (!this.quesModel.control) {
  1950. this.quesModel.control = {};
  1951. }
  1952. this.quesModel.score = paperDetailUnit.score;
  1953. //如果是套题下面的小题编辑 ( paperDetailUnit的类型是套题,question的类型不是套题)
  1954. if (
  1955. this.isNested(paperDetailUnit.questionType) &&
  1956. question.questionType != paperDetailUnit.questionType
  1957. ) {
  1958. for (var i = 0; i < paperDetailUnit.question.subQuestions.length; i++) {
  1959. if (
  1960. paperDetailUnit.question.subQuestions[i].id == this.quesModel.id
  1961. ) {
  1962. this.quesModel.score = paperDetailUnit.subScoreList[i];
  1963. this.quesModel.parentType = paperDetailUnit.questionType;
  1964. this.quesModel.optionsSelected = paperDetailUnit.optionsSelected;
  1965. this.quesModel.parentQuesParam = paperDetailUnit.question.quesParam;
  1966. break;
  1967. }
  1968. }
  1969. }
  1970. if (isEmptyStr(this.quesModel.answerType)) {
  1971. this.quesModel.answerType = "DIVERSIFIED_TEXT";
  1972. }
  1973. if (this.quesModel.questionType === "BOOL_ANSWER_QUESTION") {
  1974. this.quesAnswer = this.quesModel.quesAnswer === "true" ? 1 : 0;
  1975. } else if (this.quesModel.questionType === "TEXT_ANSWER_QUESTION") {
  1976. const answer = JSON.parse(this.quesModel.quesAnswer);
  1977. this.quesAnswer = answer[0];
  1978. } else if (this.quesModel.questionType == "FILL_BLANK_QUESTION") {
  1979. const answer = JSON.parse(this.quesModel.quesAnswer);
  1980. this.quesAnswer = answer;
  1981. } else {
  1982. this.quesAnswer = null;
  1983. }
  1984. this.prevAnswerPointCount = this.getAnswerPointCount(
  1985. this.quesModel.quesBody
  1986. );
  1987. this.assignAnswers(); //给singleRightAnswer或multipleRightAnswer赋值
  1988. this.openQuesDialog();
  1989. console.log(this.quesModel);
  1990. },
  1991. //给singleRightAnswer和multipleRightAnswer赋值
  1992. assignAnswers() {
  1993. if (this.quesModel.quesOptions && this.quesModel.quesOptions.length > 0) {
  1994. this.singleRightAnswer = "";
  1995. this.multipleRightAnswer = [];
  1996. for (let i = 0; i < this.quesModel.quesOptions.length; i++) {
  1997. let option = this.quesModel.quesOptions[i];
  1998. if (
  1999. this.quesModel.questionType == "SINGLE_ANSWER_QUESTION" &&
  2000. option.isCorrect == 1
  2001. ) {
  2002. this.singleRightAnswer = String.fromCharCode(65 + i);
  2003. }
  2004. if (
  2005. this.quesModel.questionType == "MULTIPLE_ANSWER_QUESTION" &&
  2006. option.isCorrect == 1
  2007. ) {
  2008. this.multipleRightAnswer.push(String.fromCharCode(65 + i));
  2009. }
  2010. }
  2011. }
  2012. },
  2013. boolAnswerChange(val) {
  2014. this.quesModel.quesAnswer = val ? "true" : "false";
  2015. },
  2016. textAnswerChange(val) {
  2017. this.quesModel.quesAnswer = JSON.stringify([val]);
  2018. },
  2019. resetNumberAndSaveAnswerPoints(answer) {
  2020. this.quesAnswer = answer.map((element, index) => {
  2021. element.index = index + 1;
  2022. return element;
  2023. });
  2024. this.quesModel.quesAnswer = JSON.stringify(this.quesAnswer);
  2025. },
  2026. updateAnswerPoint(index, value) {
  2027. // console.log(index, this.question.answer[index]);
  2028. this.quesAnswer[index] = { ...value };
  2029. this.resetNumberAndSaveAnswerPoints(this.quesAnswer);
  2030. },
  2031. getAnswerPointCount(bodyJson) {
  2032. let count = 0;
  2033. bodyJson.sections.forEach((section) => {
  2034. section.blocks.forEach((block) => {
  2035. if (block.type === "cloze") count++;
  2036. });
  2037. });
  2038. return count;
  2039. },
  2040. quesBodyChange(quesBodyJson) {
  2041. console.log(quesBodyJson);
  2042. this.quesModel.quesBody = quesBodyJson;
  2043. if (this.quesModel.questionType == "FILL_BLANK_QUESTION") {
  2044. let curPonitCount = this.getAnswerPointCount(quesBodyJson);
  2045. if (curPonitCount === this.prevAnswerPointCount) return;
  2046. this.prevAnswerPointCount = curPonitCount;
  2047. let newAnswer = [];
  2048. for (let i = 0; i < curPonitCount; i++) {
  2049. newAnswer.push(
  2050. (this.quesAnswer && this.quesAnswer[i]) || { sections: [] }
  2051. );
  2052. }
  2053. this.resetNumberAndSaveAnswerPoints(newAnswer);
  2054. }
  2055. },
  2056. //打开修改试题编辑框
  2057. openQuesDialog() {
  2058. this.quesDialog = true;
  2059. },
  2060. //关闭试题编辑框
  2061. closeQuesDialog() {
  2062. this.quesDialog = false;
  2063. this.quesModel = {};
  2064. },
  2065. //删除属性
  2066. handleClose(tag) {
  2067. this.quesModel.quesProperties.splice(
  2068. this.quesModel.quesProperties.indexOf(tag),
  2069. 1
  2070. );
  2071. },
  2072. //查询一级属性
  2073. searchFirst() {
  2074. this.firstPropertyId = "";
  2075. this.secondPropertyId = "";
  2076. this.secondPropertyList = [];
  2077. if (this.coursePropertyId) {
  2078. for (let courseProperty of this.coursePropertyList) {
  2079. if (courseProperty.id == this.coursePropertyId) {
  2080. this.$http
  2081. .get(QUESTION_API + "/property/first/" + courseProperty.id)
  2082. .then((response) => {
  2083. this.firstPropertyList = response.data;
  2084. });
  2085. }
  2086. }
  2087. }
  2088. },
  2089. //查询二级属性
  2090. searchSecond() {
  2091. this.secondPropertyId = "";
  2092. if (this.firstPropertyId) {
  2093. this.$http
  2094. .get(QUESTION_API + "/property/second/" + this.firstPropertyId)
  2095. .then((response) => {
  2096. this.secondPropertyList = response.data;
  2097. });
  2098. }
  2099. },
  2100. //新增属性
  2101. insertProperty() {
  2102. if (!this.checkInsertPro()) {
  2103. return false;
  2104. }
  2105. var quesProperty = {
  2106. key: "",
  2107. courseProperty: {},
  2108. firstProperty: {},
  2109. secondProperty: {},
  2110. };
  2111. if (
  2112. this.quesModel.quesProperties == null ||
  2113. this.quesModel.quesProperties.length == 0
  2114. ) {
  2115. this.quesModel.quesProperties = [];
  2116. }
  2117. let quesPropertyKey =
  2118. this.coursePropertyId +
  2119. "-" +
  2120. this.firstPropertyId +
  2121. "-" +
  2122. this.secondPropertyId;
  2123. for (let quesPro of this.quesModel.quesProperties) {
  2124. if (quesPro.key == quesPropertyKey) {
  2125. this.$notify({
  2126. message: "该属性已存在,请重新选择",
  2127. type: "error",
  2128. });
  2129. return false;
  2130. }
  2131. }
  2132. for (let property of this.coursePropertyList) {
  2133. if (property.id == this.coursePropertyId) {
  2134. quesProperty.courseProperty = property;
  2135. }
  2136. }
  2137. //取到一级属性对象
  2138. for (let property of this.firstPropertyList) {
  2139. if (property.id == this.firstPropertyId) {
  2140. quesProperty.firstProperty = property;
  2141. }
  2142. }
  2143. //判断是否有二级属性
  2144. if (
  2145. this.secondPropertyList != undefined &&
  2146. this.secondPropertyList.length > 0
  2147. ) {
  2148. if (!this.secondPropertyId) {
  2149. this.$notify({
  2150. message: "请选择二级属性",
  2151. type: "error",
  2152. });
  2153. return false;
  2154. }
  2155. }
  2156. //取到二级属性对象
  2157. for (let property of this.secondPropertyList) {
  2158. if (property.id == this.secondPropertyId) {
  2159. quesProperty.secondProperty = property;
  2160. }
  2161. }
  2162. quesProperty.key = this.getQuesPropertyKey(quesProperty);
  2163. this.quesModel.quesProperties.push(quesProperty);
  2164. this.quesModel = Object.assign({}, this.quesModel);
  2165. //清空下拉框
  2166. this.coursePropertyId = "";
  2167. this.firstPropertyId = "";
  2168. this.secondPropertyId = "";
  2169. this.firstPropertyList = [];
  2170. this.secondPropertyList = [];
  2171. },
  2172. //新增属性验证
  2173. checkInsertPro() {
  2174. if (!this.coursePropertyId) {
  2175. this.$notify({
  2176. message: "请选择属性",
  2177. type: "error",
  2178. });
  2179. return false;
  2180. }
  2181. if (!this.firstPropertyId) {
  2182. this.$notify({
  2183. message: "请选择一级属性",
  2184. type: "error",
  2185. });
  2186. return false;
  2187. }
  2188. return true;
  2189. },
  2190. //删除选项
  2191. removeQuesOption(option) {
  2192. if (this.quesModel.quesOptions.length == 1) {
  2193. this.$notify({
  2194. message: "不能删除最后一个选项",
  2195. type: "error",
  2196. });
  2197. return;
  2198. }
  2199. this.singleRightAnswer = "";
  2200. this.multipleRightAnswer = [];
  2201. let index = this.quesModel.quesOptions.indexOf(option);
  2202. if (index !== -1) {
  2203. this.quesModel.quesOptions.splice(index, 1);
  2204. }
  2205. if (this.quesModel.quesOptions.length > 0) {
  2206. for (var i = 0; i < this.quesModel.quesOptions.length; i++) {
  2207. var quesOption = this.quesModel.quesOptions[i];
  2208. quesOption["number"] = i + 1;
  2209. if (quesOption.isCorrect == 1) {
  2210. var answerOrderNum = String.fromCharCode(65 + i);
  2211. if (this.quesModel.questionType == "SINGLE_ANSWER_QUESTION") {
  2212. this.singleRightAnswer = answerOrderNum;
  2213. }
  2214. if (this.quesModel.questionType == "MULTIPLE_ANSWER_QUESTION") {
  2215. this.multipleRightAnswer.push(answerOrderNum);
  2216. }
  2217. }
  2218. }
  2219. }
  2220. },
  2221. //新增选项
  2222. addQuesOption() {
  2223. if (this.quesModel.quesOptions.length >= 20) {
  2224. this.$notify({
  2225. message: "选项最多20个",
  2226. type: "error",
  2227. });
  2228. return;
  2229. }
  2230. this.quesModel.quesOptions.push({
  2231. number: "",
  2232. optionBody: "",
  2233. isCorrect: "",
  2234. });
  2235. for (var i = 0; i < this.quesModel.quesOptions.length; i++) {
  2236. this.quesModel.quesOptions[i]["number"] = i + 1;
  2237. }
  2238. },
  2239. savePaperDetailUnit() {
  2240. this.setRightAnswer();
  2241. if (/^\d+(?=\.{0,1}\d+$|$)/.test(this.quesModel.score)) {
  2242. console.log("正确");
  2243. } else {
  2244. this.$notify({
  2245. message: "分数只能为正数",
  2246. type: "error",
  2247. });
  2248. return;
  2249. }
  2250. if (this.enableAnswerPoint) {
  2251. const pointCount = this.getAnswerPointCount(this.quesModel.quesBody);
  2252. if (!pointCount) {
  2253. this.$notify({
  2254. message: "请插入答题点",
  2255. type: "error",
  2256. });
  2257. return;
  2258. }
  2259. }
  2260. if (this.quesModel.quesOptions) {
  2261. if (this.quesModel.quesOptions.length > 20) {
  2262. this.$notify({
  2263. message: "选项最多20个",
  2264. type: "error",
  2265. });
  2266. return;
  2267. }
  2268. if (
  2269. this.quesModel.quesOptions.length &&
  2270. this.quesModel.quesOptions.some((item) =>
  2271. checkRichTextContentIsEmpty(item.optionBody)
  2272. )
  2273. ) {
  2274. this.$notify({
  2275. message: "有选项内容为空",
  2276. type: "error",
  2277. });
  2278. return;
  2279. }
  2280. }
  2281. if (this.paper.paperType == "GENERATE") {
  2282. this.$confirm(
  2283. "试题内容修改,会影响所有关联试卷,是否确定进行?",
  2284. "提示",
  2285. {
  2286. confirmButtonText: "确定",
  2287. cancelButtonText: "取消",
  2288. type: "warning",
  2289. }
  2290. ).then(() => {
  2291. this.submitPaperDetailUnit();
  2292. });
  2293. } else {
  2294. this.submitPaperDetailUnit();
  2295. }
  2296. },
  2297. submitPaperDetailUnit() {
  2298. let paperDetailUnitExp = {
  2299. id: this.editPaperDetailUnit.id,
  2300. question: this.quesModel,
  2301. score: this.quesModel.score,
  2302. };
  2303. if (
  2304. (this.quesModel.questionType == "SINGLE_ANSWER_QUESTION" ||
  2305. this.quesModel.questionType == "MULTIPLE_ANSWER_QUESTION") &&
  2306. this.quesModel.quesOptions.length == 0
  2307. ) {
  2308. this.$confirm("无选项将删除该试题, 是否继续?", "提示", {
  2309. confirmButtonText: "确定",
  2310. cancelButtonText: "取消",
  2311. type: "warning",
  2312. }).then(() => {
  2313. this.dialogLoading = true;
  2314. this.$http
  2315. .delete(
  2316. QUESTION_API +
  2317. "/paper/deleteQuestion/" +
  2318. this.editPaperDetailUnit.id +
  2319. "/" +
  2320. this.quesModel.id
  2321. )
  2322. .then((response) => {
  2323. if (response.data.length > 0) {
  2324. var deleteInfo =
  2325. "该试题被试卷:" +
  2326. response.data.join(" , ") +
  2327. "使用,不能删除";
  2328. this.$notify({
  2329. message: deleteInfo,
  2330. type: "error",
  2331. });
  2332. } else {
  2333. this.$notify({
  2334. message: "保存成功",
  2335. type: "success",
  2336. });
  2337. }
  2338. this.dialogLoading = false;
  2339. });
  2340. });
  2341. } else {
  2342. this.dialogLoading = true;
  2343. //校验音频重复
  2344. let audiomap = new Map();
  2345. let regex = new RegExp(
  2346. '<a id="[^<>]+" name="([^<>]+\\.mp3)"></a>',
  2347. "ig"
  2348. );
  2349. let ret = "";
  2350. let quesBodyStr = paperDetailUnitExp.question.quesBody;
  2351. if (quesBodyStr) {
  2352. while ((ret = regex.exec(quesBodyStr))) {
  2353. if (audiomap.get(ret[1])) {
  2354. this.dialogLoading = false;
  2355. this.$notify({
  2356. type: "error",
  2357. message: "题干中存在相同的音频文件",
  2358. });
  2359. return;
  2360. } else {
  2361. audiomap.set(ret[1], ret[1]);
  2362. }
  2363. }
  2364. }
  2365. let quesAnswerStr = paperDetailUnitExp.question.quesAnswer;
  2366. if (quesAnswerStr) {
  2367. while ((ret = regex.exec(quesAnswerStr))) {
  2368. if (audiomap.get(ret[1])) {
  2369. this.dialogLoading = false;
  2370. this.$notify({
  2371. type: "error",
  2372. message: "答案中存在相同的音频文件",
  2373. });
  2374. return;
  2375. } else {
  2376. audiomap.set(ret[1], ret[1]);
  2377. }
  2378. }
  2379. }
  2380. let quesOptions = paperDetailUnitExp.question.quesOptions;
  2381. if (quesOptions) {
  2382. for (let i = 0; i < quesOptions.length; i++) {
  2383. let quesOptionStr = quesOptions[i].optionBody;
  2384. while ((ret = regex.exec(quesOptionStr))) {
  2385. if (audiomap.get(ret[1])) {
  2386. this.dialogLoading = false;
  2387. this.$notify({
  2388. type: "error",
  2389. message: "选项中存在相同的音频文件",
  2390. });
  2391. return;
  2392. } else {
  2393. audiomap.set(ret[1], ret[1]);
  2394. }
  2395. }
  2396. }
  2397. }
  2398. // paperDetailUnitExp.question.quesAnswer = this.answer;
  2399. this.$http
  2400. .put(QUESTION_API + "/paperDetailUnit", paperDetailUnitExp)
  2401. .then(() => {
  2402. this.$notify({
  2403. message: "保存成功",
  2404. type: "success",
  2405. });
  2406. this.dialogLoading = false;
  2407. this.closeQuesDialog();
  2408. this.initPaper();
  2409. })
  2410. .catch((err) => {
  2411. this.dialogLoading = false;
  2412. this.$notify({
  2413. type: "error",
  2414. message: err.response.data.desc,
  2415. });
  2416. });
  2417. }
  2418. },
  2419. //在正确的option上设置isCorrect=1
  2420. setRightAnswer() {
  2421. if (
  2422. !this.quesModel.quesOptions ||
  2423. this.quesModel.quesOptions.length == 0
  2424. ) {
  2425. return false;
  2426. }
  2427. let quesAnswer = [];
  2428. for (var i = 0; i < this.quesModel.quesOptions.length; i++) {
  2429. var option = this.quesModel.quesOptions[i];
  2430. var answerOrderNum = String.fromCharCode(65 + i);
  2431. if (this.quesModel.questionType == "SINGLE_ANSWER_QUESTION") {
  2432. option["isCorrect"] =
  2433. answerOrderNum == this.singleRightAnswer ? 1 : 0;
  2434. }
  2435. if (this.quesModel.questionType == "MULTIPLE_ANSWER_QUESTION") {
  2436. option["isCorrect"] =
  2437. this.multipleRightAnswer.indexOf(answerOrderNum) > -1 ? 1 : 0;
  2438. }
  2439. if (option["isCorrect"]) quesAnswer.push(i + 1);
  2440. }
  2441. this.quesModel.quesAnswer = JSON.stringify(quesAnswer);
  2442. },
  2443. //删除试题
  2444. deleteQues(paperDetailUnit) {
  2445. let paperDetailUnitId = paperDetailUnit.id;
  2446. if (this.paper.paperType == "GENERATE") {
  2447. this.deleteQues01(paperDetailUnitId);
  2448. } else {
  2449. let questionId = paperDetailUnit.question.id;
  2450. this.deleteQues02(questionId, paperDetailUnitId);
  2451. }
  2452. },
  2453. deleteQues01(paperDetailUnitId) {
  2454. this.$alert("您确定删除吗?", "提示", {
  2455. confirmButtonText: "确定",
  2456. callback: (action) => {
  2457. if (action == "confirm") {
  2458. this.loading = true;
  2459. this.$http
  2460. .delete(QUESTION_API + "/paperDetailUnit/" + paperDetailUnitId)
  2461. .then(() => {
  2462. this.initPaper();
  2463. this.reduplicateGroup = [];
  2464. this.loading = true;
  2465. this.$notify({
  2466. message: "删除成功",
  2467. type: "success",
  2468. });
  2469. this.loading = false;
  2470. })
  2471. .catch(() => {
  2472. this.loading = false;
  2473. });
  2474. }
  2475. },
  2476. });
  2477. },
  2478. deleteQues02(questionId, paperDetailUnitId) {
  2479. this.$alert("您确定删除吗?", "提示", {
  2480. confirmButtonText: "确定",
  2481. callback: (action) => {
  2482. if (action == "confirm") {
  2483. this.loading = true;
  2484. this.$http
  2485. .delete(
  2486. QUESTION_API +
  2487. "/paper/deleteQuestion/" +
  2488. paperDetailUnitId +
  2489. "/" +
  2490. questionId
  2491. )
  2492. .then((response) => {
  2493. if (response.data.length > 0) {
  2494. var deleteInfo =
  2495. "该试题被试卷:" +
  2496. response.data.join(" , ") +
  2497. "使用,不能删除";
  2498. this.$notify({
  2499. message: deleteInfo,
  2500. type: "error",
  2501. });
  2502. } else {
  2503. this.initPaper();
  2504. this.reduplicateGroup = [];
  2505. this.loading = true;
  2506. this.$notify({
  2507. message: "保存成功",
  2508. type: "success",
  2509. });
  2510. }
  2511. this.loading = false;
  2512. })
  2513. .catch(() => {
  2514. this.loading = false;
  2515. });
  2516. }
  2517. },
  2518. });
  2519. },
  2520. exportPaperAnswer() {
  2521. var key = this.user.key;
  2522. var token = this.user.token;
  2523. window.open(
  2524. QUESTION_API +
  2525. "/paper/answer/export/" +
  2526. this.paperId +
  2527. "?$key=" +
  2528. key +
  2529. "&$token=" +
  2530. token
  2531. );
  2532. },
  2533. getSubQuesEditId(paperDetailUnit, subQuestion) {
  2534. return paperDetailUnit.question.id + "_" + subQuestion.subNumber;
  2535. },
  2536. //打开考试说明编辑框
  2537. openEditExamPaperRemark() {
  2538. if (this.paper.examRemark) {
  2539. this.examRemark = this.paper.examRemark;
  2540. } else {
  2541. this.examRemark = "";
  2542. }
  2543. this.paperRemarkDialog = true;
  2544. },
  2545. //保存考试说明
  2546. savePaperRemark() {
  2547. this.paper.examRemark = this.examRemark;
  2548. this.savePaper();
  2549. this.paperRemarkDialog = false;
  2550. },
  2551. //关闭考试说明编辑框
  2552. closPaperRemark() {
  2553. this.examRemark = "";
  2554. this.paperRemarkDialog = false;
  2555. },
  2556. //保存试卷
  2557. savePaper() {
  2558. this.loading = true;
  2559. this.$http
  2560. .put(QUESTION_API + "/paper", this.paper)
  2561. .then(() => {
  2562. this.$notify({
  2563. message: "保存成功",
  2564. type: "success",
  2565. });
  2566. this.loading = false;
  2567. this.initPaper();
  2568. })
  2569. .catch((error) => {
  2570. this.loading = false;
  2571. this.$notify({
  2572. type: "error",
  2573. message: error.response.data.desc,
  2574. });
  2575. });
  2576. },
  2577. //删除试卷
  2578. deletePaper(id) {
  2579. this.$confirm("确认删除试卷吗?", "提示", {
  2580. type: "warning",
  2581. }).then(() => {
  2582. this.loading = true;
  2583. this.$http.delete(QUESTION_API + "/paper/" + id).then(
  2584. () => {
  2585. this.$notify({
  2586. message: "删除成功",
  2587. type: "success",
  2588. });
  2589. this.back();
  2590. },
  2591. (error) => {
  2592. this.$notify({
  2593. message: error.response.data.desc,
  2594. type: "error",
  2595. title: "错误",
  2596. });
  2597. this.loading = false;
  2598. }
  2599. );
  2600. });
  2601. },
  2602. //打开上传音频弹框
  2603. openDialog() {
  2604. this.checkResult = false;
  2605. this.isUpload = true;
  2606. if (document.getElementById("radioFile")) {
  2607. document.getElementById("radioFile").value = "";
  2608. }
  2609. this.audioFileName = "";
  2610. this.dialogRadioFile = true;
  2611. this.fileList = [];
  2612. },
  2613. //关闭音频弹框
  2614. closeAudioDialog() {
  2615. this.dialogRadioFile = this.uploadAudioLoading;
  2616. },
  2617. //返回
  2618. back() {
  2619. if (sessionStorage.getItem("question_back") == "true") {
  2620. this.$router.push({
  2621. path: "/questions/" + this.parentView + "/0",
  2622. });
  2623. } else {
  2624. this.$router.push({
  2625. path: "/questions/" + this.parentView + "/1",
  2626. });
  2627. }
  2628. },
  2629. paperDetailShow(paperDetail) {
  2630. if (this.reduplicateGroup.length == 0) {
  2631. return true;
  2632. }
  2633. let paperDetailUnits = paperDetail.paperDetailUnits;
  2634. for (let i = 0, imax = paperDetailUnits.length; i < imax; i++) {
  2635. for (var j = 0, jmax = this.reduplicateGroup.length; j < jmax; j++) {
  2636. if (paperDetailUnits[i].id == this.reduplicateGroup[j]) {
  2637. return true;
  2638. }
  2639. }
  2640. }
  2641. return false;
  2642. },
  2643. //上传文件检查
  2644. checkFile() {
  2645. this.fileNameList = [];
  2646. //读取选取的文件夹里面的文件
  2647. this.checkResult = true;
  2648. var files = document.getElementById("radioFile").files;
  2649. if (files.length == 0) {
  2650. this.message = "请选择音频文件夹!";
  2651. return;
  2652. }
  2653. var size = 0;
  2654. var isGo = false;
  2655. //取到所有文件的文件名
  2656. for (var i = 0; i < files.length; i++) {
  2657. if (this.checkAudioFormat(files[i].name)) {
  2658. this.fileNameList.push(files[i].name);
  2659. if (files[i].size > 5 * 1024 * 1024) {
  2660. isGo = true;
  2661. break;
  2662. }
  2663. size = files[i].size + size;
  2664. }
  2665. }
  2666. if (isGo) {
  2667. this.message = "上传单个文件不能超过5M";
  2668. this.isUpload = true;
  2669. }
  2670. if (size > 50 * 1024 * 1024) {
  2671. this.message = "上传文件总和不能超过50M";
  2672. this.isUpload = true;
  2673. return;
  2674. }
  2675. this.$http
  2676. .post(
  2677. QUESTION_API + "/checkRadioFile/" + this.paperId,
  2678. this.fileNameList
  2679. )
  2680. .then((response) => {
  2681. console.log("response:", response);
  2682. this.message = response.data.errorMsg;
  2683. if (this.message == "OK") {
  2684. this.message = "OK!";
  2685. this.isUpload = false;
  2686. } else {
  2687. this.isUpload = true;
  2688. }
  2689. })
  2690. .catch((error) => {
  2691. console.log(error);
  2692. });
  2693. },
  2694. checkAudioFormat(name) {
  2695. return name.endsWith(".mp3");
  2696. },
  2697. // 音频文件
  2698. selectAudioFile() {
  2699. document.getElementById("radioFile").click();
  2700. },
  2701. audioFileChange() {
  2702. let fileList = document.getElementById("radioFile").files;
  2703. if (fileList.length == 0) {
  2704. this.audioFileName = "";
  2705. } else {
  2706. let names = [];
  2707. for (var i = 0; i < fileList.length; i++) {
  2708. var file = fileList[i];
  2709. if (this.checkAudioFormat(file.name)) names.push(file.name);
  2710. }
  2711. this.audioFileName = names.join();
  2712. }
  2713. },
  2714. uploadAudioFile() {
  2715. let param = new FormData();
  2716. var fileList = document.getElementById("radioFile").files;
  2717. //循环添加到formData中
  2718. for (var i = 0; i < fileList.length; i++) {
  2719. var file = fileList[i];
  2720. if (this.checkAudioFormat(file.name))
  2721. param.append("files", file, file.name);
  2722. }
  2723. let config = {
  2724. headers: { "Content-Type": "multipart/form-data" },
  2725. };
  2726. this.$http
  2727. .post(QUESTION_API + "/uploadRadio/" + this.paperId, param, config)
  2728. .then(() => {
  2729. this.dialogRadioFile = false;
  2730. this.uploadAudioLoading = false;
  2731. this.checkResult = false;
  2732. this.isUpload = true;
  2733. document.getElementById("radioFile").value = "";
  2734. this.initPaper();
  2735. })
  2736. .catch((error) => {
  2737. this.message = error.response.data.desc;
  2738. this.uploadAudioLoading = false;
  2739. });
  2740. },
  2741. },
  2742. };
  2743. </script>