EditPaper.vue 86 KB

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