EditPaper.vue 65 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076
  1. <template>
  2. <div
  3. id="editPaperApp"
  4. v-loading="loading"
  5. class="paper"
  6. element-loading-text="拼命加载中。。。"
  7. >
  8. <!-- <ckeditor v-model="examRemark"></ckeditor> -->
  9. <div class="edit-paper-top">
  10. <div class="edit-paper-top-inline">
  11. <div class="paper-top-div">
  12. <span class="paper-top-title">课程代码:</span>
  13. <span class="paper-top-value">{{ paper.course.code }}</span>
  14. </div>
  15. <div class="paper-top-div">
  16. <span class="paper-top-title">课程名称:</span>
  17. <span class="paper-top-value">{{ paper.course.name }}</span>
  18. </div>
  19. <div class="paper-top-div">
  20. <span class="paper-top-title">试卷名称:</span>
  21. <el-tooltip class="item" effect="dark" placement="top-start">
  22. <div slot="content">{{ paper.name }}</div>
  23. <input
  24. v-model="paper.name"
  25. class="paperName-input font_length"
  26. placeholder="试卷名称"
  27. />
  28. </el-tooltip>
  29. </div>
  30. <div class="paper-top-div">
  31. <span class="paper-top-title">试卷难度:</span>
  32. <span class="paper-top-value">{{ paper.difficultyDegree }}</span>
  33. </div>
  34. <div>
  35. <el-button type="primary" size="small" @click="savePaper">
  36. 保存
  37. </el-button>
  38. <el-button type="danger" size="small" @click="deletePaper(paper.id)">
  39. <i class="el-icon-delete"></i> 删除
  40. </el-button>
  41. <el-dropdown class="button_left">
  42. <el-button type="primary" size="small">
  43. 更多 <i class="el-icon-arrow-down el-icon--right"></i>
  44. </el-button>
  45. <el-dropdown-menu slot="dropdown">
  46. <el-dropdown-item>
  47. <el-button
  48. v-show="parentView == 'gen_paper'"
  49. type="danger"
  50. size="small"
  51. @click="recoveryPaper(paper.id)"
  52. ><i class="el-icon-delete"></i>回收
  53. </el-button>
  54. </el-dropdown-item>
  55. <el-dropdown-item>
  56. <el-button
  57. type="primary"
  58. :loading="duplicateLoading"
  59. size="small"
  60. @click="getreduplicateQuestions"
  61. ><i class="el-icon-zoom-in"></i>查重
  62. </el-button>
  63. </el-dropdown-item>
  64. <el-dropdown-item>
  65. <el-button
  66. v-show="parentView == 'import_paper'"
  67. type="primary"
  68. size="small"
  69. @click="openDialog"
  70. ><i class="el-icon-upload2"></i>上传音频
  71. </el-button>
  72. </el-dropdown-item>
  73. <el-dropdown-item>
  74. <el-button
  75. size="small"
  76. type="primary"
  77. @click="exportPaperAnswer()"
  78. ><i class="el-icon-download"></i>导出答案</el-button
  79. >
  80. </el-dropdown-item>
  81. <el-dropdown-item>
  82. <el-button
  83. v-show="parentView == 'import_paper'"
  84. type="primary"
  85. size="small"
  86. @click="openAnswerDialog"
  87. ><i class="el-icon-upload2"></i>导入答案
  88. </el-button>
  89. </el-dropdown-item>
  90. </el-dropdown-menu>
  91. </el-dropdown>
  92. <el-button
  93. size="small"
  94. type="primary"
  95. style="margin-left: 10px"
  96. @click="back"
  97. ><i class="el-icon-arrow-left"></i> 返回</el-button
  98. >
  99. </div>
  100. </div>
  101. </div>
  102. <div class="paperName">
  103. <div>
  104. <br />
  105. <h3 class="text-center">{{ paper.course.name }}&nbsp;试卷</h3>
  106. <h5 class="text-center">
  107. <span v-show="paper.hasAudio">(含音频试卷)</span>
  108. </h5>
  109. <br />
  110. <h4 class="text-center">(课程代码&nbsp;{{ paper.course.code }})</h4>
  111. <br />
  112. </div>
  113. <div class="text-left">
  114. <el-table :data="paper.paperDetails" border style="width: 100%">
  115. <el-table-column header-align="center" label="大题名称">
  116. <template slot-scope="scope">
  117. <span>{{ scope.row.name }}</span>
  118. </template>
  119. </el-table-column>
  120. <el-table-column header-align="center" label="大题总分">
  121. <template slot-scope="scope">
  122. <span>{{ scope.row.score }}</span>
  123. </template>
  124. </el-table-column>
  125. <el-table-column header-align="center" label="小题数量">
  126. <template slot-scope="scope">
  127. <span>{{ scope.row.unitCount }}</span>
  128. </template>
  129. </el-table-column>
  130. <el-table-column header-align="center" label="公开数量">
  131. <template slot-scope="scope">
  132. <span>{{ scope.row.pubCount }}</span>
  133. </template>
  134. </el-table-column>
  135. <el-table-column header-align="center" label="非公开数量">
  136. <template slot-scope="scope">
  137. <span>{{ scope.row.noPubCount }}</span>
  138. </template>
  139. </el-table-column>
  140. </el-table>
  141. <div class="mainQues" style="margin-top: 20px; margin-left: 0px">
  142. <div class="mainQuesTitle">
  143. <span>考试说明:</span>
  144. <span>
  145. <el-button size="small" @click="openEditExamPaperRemark"
  146. >编辑</el-button
  147. >
  148. </span>
  149. <div style="width: 550px; margin-left: 20px; margin-top: 20px">
  150. <span v-html="paper.examRemark"></span>
  151. </div>
  152. </div>
  153. </div>
  154. <!-- end by wwh -->
  155. <div>
  156. <h1>本试卷满分{{ paper.totalScore }}分。</h1>
  157. </div>
  158. <br />
  159. </div>
  160. </div>
  161. <div>
  162. <!-- 循环大题 -->
  163. <div
  164. v-for="(paperDetail, detailIndex) in paper.paperDetails"
  165. v-show="paperDetailShow(paperDetail)"
  166. :key="detailIndex"
  167. class="mainQues"
  168. >
  169. <div
  170. class="mainQuesTitle"
  171. @mouseover="quesMouseOver(paperDetail.id)"
  172. @mouseout="quesMouseOut(paperDetail.id)"
  173. >
  174. <span>{{ paperDetail.cnNum }}</span> <span>.</span>
  175. <span>{{ paperDetail.name }}</span>
  176. <span>
  177. ({{ !paperDetail.title ? "本大题" : paperDetail.title + "," }}共{{
  178. paperDetail.unitCount
  179. }}小题,满分{{ paperDetail.score }}分)
  180. </span>
  181. <span :id="paperDetail.id" class="btnDiv">
  182. <el-button
  183. v-show="parentView == 'gen_paper'"
  184. size="small"
  185. @click="selectQues(paperDetail.id)"
  186. >选题
  187. </el-button>
  188. <el-button size="small" @click="openEditPaperDetail(paperDetail)"
  189. >编辑
  190. </el-button>
  191. <el-button
  192. v-if="showUp(paperDetail)"
  193. size="small"
  194. @click="movePaperDetail(paperDetail, 'up')"
  195. >上移
  196. </el-button>
  197. <el-button
  198. v-if="showDown(paperDetail)"
  199. size="small"
  200. @click="movePaperDetail(paperDetail, 'down')"
  201. >下移
  202. </el-button>
  203. <el-button
  204. size="small"
  205. type="danger"
  206. @click="deletePaperDetail(paperDetail.id)"
  207. >删除
  208. </el-button>
  209. <el-button
  210. v-show="showButtons[detailIndex].up"
  211. size="small"
  212. icon="el-icon-arrow-up"
  213. @click.stop="hideContent(detailIndex)"
  214. ></el-button>
  215. <el-button
  216. v-show="!showButtons[detailIndex].up"
  217. size="small"
  218. icon="el-icon-arrow-down"
  219. @click.stop="showContent(detailIndex)"
  220. ></el-button>
  221. </span>
  222. </div>
  223. <!-- 循环小题 -->
  224. <div v-show="showQuestions[detailIndex].is_show">
  225. <div
  226. v-for="(paperDetailUnit, unitIndex) in paperDetail.paperDetailUnits"
  227. v-show="quesShow(paperDetailUnit.id)"
  228. :key="unitIndex"
  229. class="ques"
  230. >
  231. <reduplicate_mark
  232. :id="paperDetailUnit.id"
  233. :show="reduplicateMarkShow(paperDetailUnit.id)"
  234. :fill-color="reduplicateMarkColor(paperDetailUnit.id)"
  235. :checked="reduplicateMarkCheck(paperDetailUnit.id)"
  236. @reduplicate_mark_check="reduplicate_mark_check"
  237. >
  238. </reduplicate_mark>
  239. <div
  240. class="quesSelect"
  241. @mouseover="quesMouseOver(paperDetailUnit.id)"
  242. @mouseout="quesMouseOut(paperDetailUnit.id)"
  243. >
  244. <div :id="paperDetailUnit.id" class="btnDiv">
  245. <el-button
  246. size="small"
  247. @click="editQues(paperDetailUnit, paperDetailUnit.question)"
  248. >编辑
  249. </el-button>
  250. <el-button
  251. type="danger"
  252. size="small"
  253. @click="deleteQues(paperDetailUnit)"
  254. >删除
  255. </el-button>
  256. </div>
  257. <div class="quesBody">
  258. <span class="ques-title">{{ paperDetailUnit.number }}.</span>
  259. <span
  260. v-question-audio
  261. class="ques-body"
  262. :hasAudio="paperDetailUnit.question.hasAudio"
  263. :questionId="paperDetailUnit.question.id"
  264. v-html="paperDetailUnit.question.quesBody"
  265. ></span>
  266. <span class="score-span">
  267. ({{ paperDetailUnit.score }}分)
  268. </span>
  269. </div>
  270. <div
  271. v-for="(quesOption, optionIndex) in paperDetailUnit.question
  272. .quesOptions"
  273. :key="optionIndex"
  274. class="quesOption"
  275. >
  276. <span class="ques-title"
  277. >{{ optionIndex | optionOrderWordFilter }}.
  278. </span>
  279. <span
  280. v-question-audio
  281. class="ques-body"
  282. :hasAudio="paperDetailUnit.question.hasAudio"
  283. :questionId="paperDetailUnit.question.id"
  284. v-html="quesOption.optionBody"
  285. ></span>
  286. </div>
  287. </div>
  288. <br />
  289. <div
  290. v-for="(subQuestion, subIndex) in paperDetailUnit.question
  291. .subQuestions"
  292. v-show="quesShow(subQuestion.id)"
  293. :key="subIndex"
  294. class="subQues"
  295. >
  296. <reduplicate_mark
  297. :show="reduplicateMarkShow(subQuestion.id)"
  298. ></reduplicate_mark>
  299. <div
  300. class="quesSelect"
  301. @mouseover="
  302. quesMouseOver(getSubQuesEditId(paperDetailUnit, subQuestion))
  303. "
  304. @mouseout="
  305. quesMouseOut(getSubQuesEditId(paperDetailUnit, subQuestion))
  306. "
  307. >
  308. <div
  309. :id="getSubQuesEditId(paperDetailUnit, subQuestion)"
  310. class="btnDiv"
  311. >
  312. <el-button
  313. size="small"
  314. @click="editQues(paperDetailUnit, subQuestion)"
  315. >编辑
  316. </el-button>
  317. </div>
  318. <div class="quesBody">
  319. <span class="ques-title"
  320. >{{ subQuestion.quesParams.number }}.
  321. </span>
  322. <span v-html="subQuestion.quesBody"></span>
  323. <span
  324. >({{ paperDetailUnit.subScoreList[subIndex] }}分)</span
  325. >
  326. </div>
  327. <div
  328. v-for="(
  329. subQuesOption, subOptIndex
  330. ) in subQuestion.quesOptions"
  331. :key="subOptIndex"
  332. class="quesOption"
  333. >
  334. <span class="ques-title"
  335. >{{ subOptIndex | optionOrderWordFilter }}.
  336. </span>
  337. <span v-html="subQuesOption.optionBody"></span>
  338. </div>
  339. <br />
  340. </div>
  341. </div>
  342. </div>
  343. <br />
  344. </div>
  345. </div>
  346. </div>
  347. <div class="text-left">
  348. <!-- 编辑大题弹框 -->
  349. <el-dialog
  350. v-loading.body="detailLoading"
  351. width="360px"
  352. title="大题名称编辑"
  353. element-loading-text="保存中。。。"
  354. :visible.sync="paperDatailDialog"
  355. @close="closeQuesDialog"
  356. >
  357. <el-form
  358. :model="editpaperDetail"
  359. label-position="right"
  360. label-width="80px"
  361. >
  362. <el-row :gutter="10">
  363. <el-col :xs="10" :sm="10" :md="10" :lg="10">
  364. <el-form-item label="大题名称" placeholder="大题名称">
  365. <el-input
  366. v-model="editpaperDetail.name"
  367. class="dialog_input_width"
  368. />
  369. </el-form-item>
  370. </el-col>
  371. </el-row>
  372. <el-row>
  373. <el-form-item>
  374. <el-button
  375. type="primary"
  376. @click="savePaperDatail(editpaperDetail)"
  377. >保存</el-button
  378. >
  379. <el-button @click="closePaperDatailDialog()">取消</el-button>
  380. </el-form-item>
  381. </el-row>
  382. </el-form>
  383. </el-dialog>
  384. <!-- 编辑试题弹框 -->
  385. <el-dialog
  386. v-loading.body="dialogLoading"
  387. title="试题编辑"
  388. element-loading-text="保存中。。。"
  389. :visible.sync="quesDialog"
  390. @close="closeQuesDialog"
  391. >
  392. <el-form :model="quesModel" label-position="right" label-width="80px">
  393. <el-row :gutter="10">
  394. <el-col :xs="10" :sm="10" :md="10" :lg="10">
  395. <el-form-item label="题型">
  396. <el-select
  397. v-model="quesModel.questionType"
  398. :disabled="true"
  399. placeholder="请输入题型"
  400. >
  401. <el-option
  402. v-for="item in questionTypes"
  403. :key="item.value"
  404. :label="item.label"
  405. :value="item.value"
  406. >
  407. </el-option>
  408. </el-select>
  409. </el-form-item>
  410. </el-col>
  411. <el-col :xs="10" :sm="10" :md="10" :lg="10">
  412. <el-form-item label="分值">
  413. <el-input
  414. v-model="quesModel.score"
  415. placeholder="分值"
  416. :disabled="quesModel.questionType == 'NESTED_ANSWER_QUESTION'"
  417. ></el-input>
  418. </el-form-item>
  419. </el-col>
  420. </el-row>
  421. <!-- create by weiwenhai 添加难度,公开度,试题属性 -->
  422. <el-row :gutter="10">
  423. <el-col :xs="10" :sm="10" :md="10" :lg="10">
  424. <el-form-item label="难度">
  425. <el-select
  426. v-model="quesModel.difficultyDegree"
  427. placeholder="请输入难度"
  428. :disabled="
  429. quesModel.questionType == 'NESTED_ANSWER_QUESTION'
  430. ? true
  431. : updatePorperty
  432. "
  433. >
  434. <el-option
  435. v-for="item in difficultyDegreeList"
  436. :key="item.value"
  437. :label="item.label"
  438. :value="item.value"
  439. >
  440. </el-option>
  441. </el-select>
  442. </el-form-item>
  443. </el-col>
  444. <el-col :xs="10" :sm="10" :md="10" :lg="10">
  445. <el-form-item label="公开度">
  446. <el-select
  447. v-model="quesModel.publicity"
  448. placeholder="请输入公开度"
  449. :disabled="updatePorperty"
  450. >
  451. <el-option
  452. v-for="item in publicityList"
  453. :key="item.value"
  454. :label="item.label"
  455. :value="item.value"
  456. >
  457. </el-option>
  458. </el-select>
  459. </el-form-item>
  460. </el-col>
  461. <el-col
  462. v-if="quesModel.questionType == 'TEXT_ANSWER_QUESTION'"
  463. :xs="10"
  464. :sm="10"
  465. :md="10"
  466. :lg="10"
  467. >
  468. <el-form-item label="作答类型">
  469. <el-select
  470. v-model="quesModel.answerType"
  471. :disabled="updatePorperty"
  472. >
  473. <el-option
  474. v-for="item in answerTypes"
  475. :key="item.value"
  476. :label="item.label"
  477. :value="item.value"
  478. >
  479. </el-option>
  480. </el-select>
  481. </el-form-item>
  482. </el-col>
  483. </el-row>
  484. <el-row :gutter="10">
  485. <el-col :xs="20" :sm="20" :md="20" :lg="20">
  486. <el-form-item label="属性列表">
  487. <el-tooltip
  488. v-for="(content, propIndex) in quesModel.quesProperties"
  489. :key="propIndex"
  490. placement="top"
  491. >
  492. <div slot="content">
  493. <span v-if="content.firstProperty != null"
  494. >一级属性:{{ content.firstProperty.name }}</span
  495. ><br />
  496. <span v-if="content.secondProperty != null"
  497. >二级属性:{{ content.secondProperty.name }}</span
  498. >
  499. </div>
  500. <span>
  501. <el-tag
  502. :key="content.id"
  503. style="margin-right: 5px"
  504. :closable="!updatePorperty"
  505. type="primary"
  506. @close="handleClose(content)"
  507. >
  508. {{ content.coursePropertyName }}
  509. </el-tag>
  510. </span>
  511. </el-tooltip>
  512. </el-form-item>
  513. </el-col>
  514. </el-row>
  515. <el-row>
  516. <el-col :span="6">
  517. <el-form-item label="属性名" label-width="60px">
  518. <el-select
  519. v-model="coursePropertyName"
  520. placeholder="属性名"
  521. class="property_with"
  522. :disabled="updatePorperty"
  523. @change="searchFirst"
  524. >
  525. <el-option label="请选择" value=""></el-option>
  526. <el-option
  527. v-for="item in coursePropertyList"
  528. :key="item.name"
  529. :label="item.name"
  530. :value="item.name"
  531. >
  532. </el-option>
  533. </el-select>
  534. </el-form-item>
  535. </el-col>
  536. <el-col :span="6">
  537. <el-form-item label="一级" label-width="48px">
  538. <el-select
  539. v-model="firstPropertyId"
  540. placeholder="一级"
  541. class="property_with"
  542. :disabled="updatePorperty"
  543. @change="searchSecond"
  544. >
  545. <el-option label="请选择" value=""></el-option>
  546. <el-option
  547. v-for="item in firstPropertyList"
  548. :key="item.id"
  549. :label="item.name"
  550. :value="item.id"
  551. >
  552. </el-option>
  553. </el-select>
  554. </el-form-item>
  555. </el-col>
  556. <el-col :span="6">
  557. <el-form-item label="二级" label-width="48px">
  558. <el-select
  559. v-model="secondPropertyId"
  560. placeholder="二级"
  561. class="property_with"
  562. :disabled="updatePorperty"
  563. >
  564. <el-option label="请选择" value=""></el-option>
  565. <el-option
  566. v-for="item in secondPropertyList"
  567. :key="item.id"
  568. :label="item.name"
  569. :value="item.id"
  570. >
  571. </el-option>
  572. </el-select>
  573. </el-form-item>
  574. </el-col>
  575. <el-col :span="6">
  576. <el-form-item>
  577. <el-button
  578. type="primary"
  579. style="margin-left: -50px"
  580. :disabled="updatePorperty"
  581. @click="insertProperty"
  582. ><i class="el-icon-plus"></i>新增属性
  583. </el-button>
  584. </el-form-item>
  585. </el-col>
  586. </el-row>
  587. <!-- end by weiwenhai -->
  588. <div>
  589. <el-row>
  590. <el-col>
  591. <el-form-item label="题目">
  592. <ckeditor v-model="quesModel.quesBody"></ckeditor>
  593. </el-form-item>
  594. </el-col>
  595. </el-row>
  596. <el-form-item
  597. v-for="(quesOption, optIndex) in quesModel.quesOptions"
  598. :key="optIndex"
  599. >
  600. <el-col :span="2">
  601. <el-radio
  602. v-if="quesModel.questionType === 'SINGLE_ANSWER_QUESTION'"
  603. v-model="singleRightAnswer"
  604. :label="optIndex | optionOrderWordFilter"
  605. ></el-radio>
  606. <el-checkbox
  607. v-if="quesModel.questionType === 'MULTIPLE_ANSWER_QUESTION'"
  608. v-model="multipleRightAnswer"
  609. :label="optIndex | optionOrderWordFilter"
  610. ></el-checkbox>
  611. </el-col>
  612. <el-col :span="20">
  613. <ckeditor v-model="quesOption.optionBody"></ckeditor>
  614. </el-col>
  615. <el-col :span="2">
  616. <i
  617. class="el-icon-delete"
  618. title="删除"
  619. @click.prevent="removeQuesOption(quesOption)"
  620. ></i>
  621. </el-col>
  622. </el-form-item>
  623. <div
  624. v-if="
  625. quesModel.questionType != 'NESTED_ANSWER_QUESTION' &&
  626. quesModel.questionType != 'SINGLE_ANSWER_QUESTION' &&
  627. quesModel.questionType != 'MULTIPLE_ANSWER_QUESTION' &&
  628. quesModel.questionType != 'BOOL_ANSWER_QUESTION'
  629. "
  630. >
  631. <el-form-item label="答案">
  632. <ckeditor v-model="quesModel.quesAnswer"></ckeditor>
  633. </el-form-item>
  634. </div>
  635. <!-- 单选或多选 -->
  636. <div
  637. v-if="
  638. quesModel.questionType == 'SINGLE_ANSWER_QUESTION' ||
  639. quesModel.questionType == 'MULTIPLE_ANSWER_QUESTION'
  640. "
  641. >
  642. <el-form-item label="答案">
  643. <span v-html="answer"></span>
  644. </el-form-item>
  645. </div>
  646. <div v-if="quesModel.questionType == 'BOOL_ANSWER_QUESTION'">
  647. <el-row>
  648. <el-col>
  649. <el-form-item label="答案" prop="quesAnswer">
  650. <el-select
  651. v-model="quesModel.quesAnswer"
  652. placeholder="请选择"
  653. >
  654. <el-option
  655. v-for="op in options"
  656. :key="op"
  657. :label="op"
  658. :value="op"
  659. >
  660. </el-option>
  661. </el-select>
  662. </el-form-item>
  663. </el-col>
  664. </el-row>
  665. </div>
  666. </div>
  667. <div
  668. :class="{
  669. margin_left_30:
  670. quesModel.questionType == 'SINGLE_ANSWER_QUESTION' ||
  671. quesModel.questionType == 'MULTIPLE_ANSWER_QUESTION',
  672. margin_left_40: !(
  673. quesModel.questionType == 'SINGLE_ANSWER_QUESTION' ||
  674. quesModel.questionType == 'MULTIPLE_ANSWER_QUESTION'
  675. ),
  676. }"
  677. >
  678. <el-button
  679. v-if="
  680. quesModel.questionType == 'SINGLE_ANSWER_QUESTION' ||
  681. quesModel.questionType == 'MULTIPLE_ANSWER_QUESTION'
  682. "
  683. type="primary"
  684. @click="addQuesOption"
  685. ><i class="el-icon-plus"></i> 新增选项
  686. </el-button>
  687. <el-button type="primary" @click="savePaperDetailUnit()"
  688. >保存</el-button
  689. >
  690. <el-button @click="closeQuesDialog">取消</el-button>
  691. </div>
  692. </el-form>
  693. </el-dialog>
  694. <!-- 考试说明弹框 -->
  695. <el-dialog title="考试说明编辑" :visible.sync="paperRemarkDialog">
  696. <el-form label-position="right" label-width="80px">
  697. <el-row :gutter="10">
  698. <el-col :xs="10" :sm="10" :md="10" :lg="10">
  699. <el-form-item label="考试说明">
  700. <div style="width: 550px">
  701. <ckeditor
  702. v-model="examRemark"
  703. :display="display"
  704. :width="wValue"
  705. :height="hValue"
  706. ></ckeditor>
  707. </div>
  708. </el-form-item>
  709. </el-col>
  710. </el-row>
  711. <div style="margin-top: 20px; margin-left: 40%">
  712. <el-button type="primary" @click="savePaperRemark">保存</el-button>
  713. <el-button @click="closPaperRemark">取消</el-button>
  714. </div>
  715. </el-form>
  716. </el-dialog>
  717. <!-- 上传音频弹框 -->
  718. <el-dialog
  719. title="上传音频文件"
  720. :visible.sync="dialogRadioFile"
  721. :before-close="closeAudioDialog"
  722. >
  723. <form
  724. id="radioForm"
  725. method="post"
  726. action=""
  727. enctype="multipart/form-data"
  728. >
  729. <input
  730. id="radioFile"
  731. name="files"
  732. type="file"
  733. value="上传音频文件"
  734. webkitdirectory
  735. />
  736. <el-button type="warning" @click="checkFile">检查文件名</el-button>
  737. <el-button
  738. type="info"
  739. :loading="uploadAudioLoading"
  740. :disabled="isUpload || uploadAudioLoading"
  741. @click="uploadAudioFile"
  742. >
  743. <span v-show="!uploadAudioLoading">开始上传</span>
  744. <span v-show="uploadAudioLoading">正在上传中...</span>
  745. </el-button>
  746. </form>
  747. <div v-if="checkResult" style="margin-top: 20px">
  748. <span>检查结果:</span><br /><br />
  749. <span v-show="message == 'OK!'" style="color: #13ce66">OK!</span>
  750. <span v-show="message != 'OK!'" style="color: #ff4949">{{
  751. message
  752. }}</span>
  753. </div>
  754. </el-dialog>
  755. <el-dialog
  756. title="上传答案文件"
  757. :visible.sync="dialogAnswerFile"
  758. :before-close="closeAnswerDialog"
  759. >
  760. <form
  761. id="answerForm"
  762. method="post"
  763. action=""
  764. enctype="multipart/form-data"
  765. >
  766. <input
  767. id="answerFile"
  768. name="answerFiles"
  769. type="file"
  770. value="上传答案文件"
  771. accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
  772. />
  773. <el-button type="info" @click="downAnswerTemplate">
  774. <span>下载模板</span>
  775. </el-button>
  776. <el-button
  777. type="info"
  778. :loading="uploadAnswerLoading"
  779. :disabled="uploadAnswerLoading"
  780. @click="uploadAnswerFile"
  781. >
  782. <span v-show="!uploadAnswerLoading">开始上传</span>
  783. <span v-show="uploadAnswerLoading">正在上传中...</span>
  784. </el-button>
  785. </form>
  786. <div style="margin-top: 20px">
  787. <span v-show="answerMessage != ''" style="color: #ff4949">{{
  788. answerMessage
  789. }}</span>
  790. </div>
  791. </el-dialog>
  792. </div>
  793. </div>
  794. </template>
  795. <script>
  796. import { QUESTION_API } from "@/constants/constants";
  797. import { isEmptyStr, QUESTION_TYPES } from "../constants/constants";
  798. import { mapState } from "vuex";
  799. import reduplicate_mark from "../component/reduplicate_mark.vue";
  800. import randomColor from "randomcolor";
  801. import ckeditor from "../component/ckeditor.vue";
  802. export default {
  803. name: "EditPaperApp",
  804. components: {
  805. reduplicate_mark,
  806. ckeditor,
  807. },
  808. data() {
  809. return {
  810. hValue: "100px",
  811. wValue: "500px",
  812. display: "block",
  813. uploadAction: "",
  814. fileList: [],
  815. answerFileList: [],
  816. paperId: "",
  817. paperDetailId: "",
  818. editPaperDetailUnit: "",
  819. quesDialog: false,
  820. paperDatailDialog: false,
  821. paperRemarkDialog: false,
  822. parentView: "",
  823. paper: {
  824. course: {
  825. code: "",
  826. name: "",
  827. },
  828. examRemark: "",
  829. },
  830. loading: false,
  831. dialogLoading: false,
  832. detailLoading: false,
  833. uploadAudioLoading: false,
  834. uploadAnswerLoading: false,
  835. questionTypes: QUESTION_TYPES,
  836. questionType: "",
  837. quesModel: { quesProperties: [] },
  838. editpaperDetail: {},
  839. reduplicateQuestions: [],
  840. reduplicateGroup: [],
  841. reduplicateQuesColor: [],
  842. singleRightAnswer: "", //接收单选答案
  843. multipleRightAnswer: [], //接收多选答案
  844. options: ["正确", "错误"],
  845. duplicateLoading: false,
  846. dialogRadioFile: false,
  847. dialogAnswerFile: false,
  848. isUpload: true,
  849. isUploadAnswer: true,
  850. message: "",
  851. answerMessage: "",
  852. checkResult: false,
  853. checkResultAnswer: false,
  854. fileNameList: [],
  855. defaultColor: [
  856. "Red",
  857. "Blue",
  858. "LimeGreen",
  859. "GoldenRod",
  860. "Black",
  861. "BlueViolet",
  862. "Chocolate",
  863. "DarkCyan",
  864. "HotPink",
  865. "Orange",
  866. "IndianRed",
  867. "Indigo",
  868. "Green",
  869. "Aqua",
  870. "CadetBlue",
  871. "SkyBlue",
  872. "SlateBlue",
  873. "SlateGray",
  874. "Tomato",
  875. "VioletRed",
  876. ],
  877. difficultyDegreeList: [
  878. { label: 0.1, value: 0.1 },
  879. { label: 0.2, value: 0.2 },
  880. { label: 0.3, value: 0.3 },
  881. { label: 0.4, value: 0.4 },
  882. { label: 0.5, value: 0.5 },
  883. { label: 0.6, value: 0.6 },
  884. { label: 0.7, value: 0.7 },
  885. { label: 0.8, value: 0.8 },
  886. { label: 0.9, value: 0.9 },
  887. { label: 1.0, value: 1.0 },
  888. ],
  889. publicityList: [
  890. { label: "公开", value: true },
  891. { label: "非公开", value: false },
  892. ],
  893. answerTypes: [
  894. { label: "文本", value: "DIVERSIFIED_TEXT" },
  895. { label: "音频", value: "SINGLE_AUDIO" },
  896. ],
  897. coursePropertyList: [],
  898. coursePropertyName: "", //课程属性名
  899. firstPropertyList: [], //一级属性集合
  900. firstPropertyId: "", //一级属性id
  901. secondPropertyList: [], //二级属性集合
  902. secondPropertyId: "", //二级属性id
  903. examRemark: "",
  904. showQuestions: [],
  905. showButtons: [],
  906. };
  907. },
  908. computed: {
  909. ...mapState({
  910. user: (state) => state.user,
  911. }),
  912. updatePorperty() {
  913. return false;
  914. },
  915. answer() {
  916. if (this.quesModel.questionType == "SINGLE_ANSWER_QUESTION") {
  917. return this.singleRightAnswer;
  918. } else if (this.quesModel.questionType == "MULTIPLE_ANSWER_QUESTION") {
  919. var obj = this.multipleRightAnswer;
  920. return obj.sort().toString();
  921. }
  922. return this.quesModel.quesAnswer;
  923. },
  924. },
  925. created() {
  926. // $("body").attr("style", "");
  927. document.getElementsByTagName("body")[0].style = "";
  928. this.paperId = this.$route.params.id;
  929. this.parentView = this.$route.params.parentView;
  930. this.initPaper();
  931. this.getreduplicateQuestions();
  932. this.uploadAction = QUESTION_API + "/uploadRadio/" + this.paperId;
  933. this.uploadHeaders = {
  934. key: this.user.key,
  935. token: this.user.token,
  936. };
  937. },
  938. methods: {
  939. recoveryPaper(paperid) {
  940. this.$confirm("确认回收试卷吗?", "提示", {
  941. type: "warning",
  942. }).then(() => {
  943. this.loading = true;
  944. this.$http
  945. .put(QUESTION_API + "/paper_storage/recovery/" + paperid)
  946. .then(
  947. () => {
  948. this.loading = false;
  949. this.$notify({
  950. message: "操作成功",
  951. type: "success",
  952. });
  953. this.back();
  954. },
  955. (response) => {
  956. this.loading = false;
  957. this.$notify({
  958. message: response.response.data.desc,
  959. type: "error",
  960. });
  961. }
  962. );
  963. });
  964. },
  965. movePaperDetail(detail, vector) {
  966. let vectorStr = vector == "up" ? "上移" : "下移";
  967. this.$alert("您确定" + vectorStr + "吗?", "提示", {
  968. confirmButtonText: "确定",
  969. callback: (action) => {
  970. if (action == "confirm") {
  971. this.loading = true;
  972. this.$httpWithMsg
  973. .put(
  974. QUESTION_API +
  975. "/paperDetail/" +
  976. this.paperId +
  977. "/" +
  978. detail.id +
  979. "/" +
  980. vector
  981. )
  982. .then(() => {
  983. this.initPaper();
  984. this.loading = true;
  985. this.$notify({
  986. message: vectorStr + "成功",
  987. type: "success",
  988. });
  989. })
  990. .finally(() => (this.loading = false));
  991. }
  992. },
  993. });
  994. },
  995. showUp(detail) {
  996. if (this.paper.paperDetails.length <= 1) {
  997. return false;
  998. }
  999. if (detail.id != this.paper.paperDetails[0].id) {
  1000. return true;
  1001. } else {
  1002. return false;
  1003. }
  1004. },
  1005. showDown(detail) {
  1006. if (this.paper.paperDetails.length <= 1) {
  1007. return false;
  1008. }
  1009. if (
  1010. detail.id !=
  1011. this.paper.paperDetails[this.paper.paperDetails.length - 1].id
  1012. ) {
  1013. return true;
  1014. } else {
  1015. return false;
  1016. }
  1017. },
  1018. downAnswerTemplate() {
  1019. var key = this.user.key;
  1020. var token = this.user.token;
  1021. window.open(
  1022. QUESTION_API + "/paper/answer/template?$key=" + key + "&$token=" + token
  1023. );
  1024. },
  1025. openAnswerDialog() {
  1026. this.checkResultAnswer = false;
  1027. this.isUploadAnswer = true;
  1028. if (document.getElementById("answerFile")) {
  1029. document.getElementById("answerFile").value = "";
  1030. }
  1031. this.dialogAnswerFile = true;
  1032. this.answerFileList = [];
  1033. },
  1034. closeAnswerDialog() {
  1035. this.answerMessage = "";
  1036. this.dialogAnswerFile = this.uploadAnswerLoading;
  1037. },
  1038. uploadAnswerFile() {
  1039. this.answerMessage = "";
  1040. var fileList = document.getElementById("answerFile").files;
  1041. if (fileList.length == 0) {
  1042. this.answerMessage = "请选择文件!";
  1043. return;
  1044. }
  1045. let param = new FormData();
  1046. //循环添加到formData中
  1047. for (var i = 0; i < fileList.length; i++) {
  1048. var file = fileList[i];
  1049. param.append("dataFile", file, file.name);
  1050. }
  1051. let config = {
  1052. headers: { "Content-Type": "multipart/form-data" },
  1053. };
  1054. this.uploadAnswerLoading = true;
  1055. this.$http
  1056. .post(
  1057. QUESTION_API + "/paper/answer/import/" + this.paperId,
  1058. param,
  1059. config
  1060. )
  1061. .then(() => {
  1062. this.dialogAnswerFile = false;
  1063. this.uploadAnswerLoading = false;
  1064. this.checkResultAnswer = false;
  1065. this.isUploadAnswer = true;
  1066. document.getElementById("answerFile").value = "";
  1067. this.initPaper();
  1068. })
  1069. .catch((error) => {
  1070. this.answerMessage = error.response.data.desc;
  1071. document.getElementById("answerFile").value = "";
  1072. this.uploadAnswerLoading = false;
  1073. });
  1074. },
  1075. //隐藏大题下的所有小题
  1076. hideContent(index) {
  1077. console.log("up");
  1078. this.showQuestions[index].is_show = false;
  1079. this.showButtons[index].up = false;
  1080. },
  1081. //展开大题下所有小题
  1082. showContent(index) {
  1083. console.log("down");
  1084. this.showQuestions[index].is_show = true;
  1085. this.showButtons[index].up = true;
  1086. },
  1087. quesMouseOver(index) {
  1088. document.getElementById(index).style.visibility = "visible";
  1089. },
  1090. quesMouseOut(index) {
  1091. document.getElementById(index).style.visibility = "hidden";
  1092. },
  1093. selectQues(id) {
  1094. this.paperDetailId = id;
  1095. var courseCode = this.paper.course.code;
  1096. var courseName = this.paper.course.name;
  1097. this.$router.push({
  1098. path:
  1099. "/select_question/" +
  1100. this.paper.id +
  1101. "/" +
  1102. courseCode +
  1103. "/" +
  1104. encodeURIComponent(courseName) +
  1105. "/" +
  1106. this.paperDetailId +
  1107. "/" +
  1108. this.parentView,
  1109. });
  1110. },
  1111. //打开编辑大题题目弹窗
  1112. openEditPaperDetail(paperDetail) {
  1113. this.paperDatailDialog = true;
  1114. this.editpaperDetail = Object.assign({}, paperDetail); //浅拷贝
  1115. },
  1116. //关闭编辑大题题目弹窗
  1117. closePaperDatailDialog() {
  1118. this.paperDatailDialog = false;
  1119. this.editpaperDetail = {};
  1120. },
  1121. //保存大题题目信息
  1122. savePaperDatail(editpaperDetail) {
  1123. this.detailLoading = true;
  1124. var paperId = this.paper.id;
  1125. this.$http
  1126. .post(QUESTION_API + "/updatePaperDetail/" + paperId, editpaperDetail)
  1127. .then(() => {
  1128. this.$notify({
  1129. message: "保存成功",
  1130. type: "success",
  1131. });
  1132. this.detailLoading = false;
  1133. this.closePaperDatailDialog();
  1134. this.initPaper();
  1135. });
  1136. },
  1137. //初始化试卷
  1138. initPaper() {
  1139. const scrollPosition =
  1140. document.documentElement.scrollTop || document.body.scrollTop;
  1141. this.loading = true;
  1142. this.paper = {
  1143. course: {
  1144. code: "",
  1145. name: "",
  1146. },
  1147. };
  1148. this.$http
  1149. .get(QUESTION_API + "/paper/" + this.paperId)
  1150. .then((response) => {
  1151. this.paper = response.data;
  1152. //查询所有课程属性名
  1153. this.initCourseProperty(this.paper.course.code);
  1154. //将所有小题分为公开和非公开
  1155. if (this.paper.paperDetails && this.paper.paperDetails.length > 0) {
  1156. for (let paperDetil of this.paper.paperDetails) {
  1157. this.showQuestions.push({ is_show: true });
  1158. this.showButtons.push({ up: true });
  1159. paperDetil.pubCount = 0;
  1160. paperDetil.noPubCount = 0;
  1161. if (
  1162. paperDetil.paperDetailUnits &&
  1163. paperDetil.paperDetailUnits.length > 0
  1164. ) {
  1165. for (let paperDetilUt of paperDetil.paperDetailUnits) {
  1166. if (
  1167. paperDetilUt.question.questionType !=
  1168. "NESTED_ANSWER_QUESTION"
  1169. ) {
  1170. //非套题
  1171. if (paperDetilUt.question.publicity) {
  1172. paperDetil.pubCount = paperDetil.pubCount + 1;
  1173. } else {
  1174. paperDetil.noPubCount = paperDetil.noPubCount + 1;
  1175. }
  1176. } else {
  1177. //循环所有子题
  1178. for (let ques of paperDetilUt.question.subQuestions) {
  1179. if (ques.publicity) {
  1180. paperDetil.pubCount = paperDetil.pubCount + 1;
  1181. } else {
  1182. paperDetil.noPubCount = paperDetil.noPubCount + 1;
  1183. }
  1184. }
  1185. }
  1186. }
  1187. }
  1188. }
  1189. }
  1190. setTimeout(() => {
  1191. document.documentElement.scrollTop = document.body.scrollTop =
  1192. scrollPosition;
  1193. console.log(scrollPosition);
  1194. }, 1000);
  1195. this.loading = false;
  1196. });
  1197. },
  1198. //查询所有课程属性名
  1199. initCourseProperty(courseCode) {
  1200. this.$http
  1201. .get(QUESTION_API + "/courseProperty/enable/" + courseCode)
  1202. .then((response) => {
  1203. this.coursePropertyList = response.data;
  1204. });
  1205. },
  1206. //删除大题
  1207. deletePaperDetail(paperDetailsId) {
  1208. //先判断大题下面是否还有小题
  1209. var count = 0;
  1210. for (var i = 0, imax = this.paper.paperDetails.length; i < imax; i++) {
  1211. if (paperDetailsId == this.paper.paperDetails[i].id) {
  1212. if (this.paper.paperDetails[i].paperDetailUnits) {
  1213. count += this.paper.paperDetails[i].paperDetailUnits.length;
  1214. break;
  1215. }
  1216. }
  1217. }
  1218. if (count == 0) {
  1219. this.$alert("您确定删除吗?", "提示", {
  1220. confirmButtonText: "确定",
  1221. callback: (action) => {
  1222. if (action == "confirm") {
  1223. this.loading = true;
  1224. this.$httpWithMsg
  1225. .delete(
  1226. QUESTION_API +
  1227. "/paperDetail/" +
  1228. this.paperId +
  1229. "/" +
  1230. paperDetailsId
  1231. )
  1232. .then(() => {
  1233. this.initPaper();
  1234. this.loading = true;
  1235. this.$notify({
  1236. message: "删除成功",
  1237. type: "success",
  1238. });
  1239. })
  1240. .finally(() => (this.loading = false));
  1241. }
  1242. },
  1243. });
  1244. } else {
  1245. this.$alert("大题下还有小题,不可删除!", "提示", {
  1246. confirmButtonText: "确定",
  1247. callback: () => {},
  1248. });
  1249. }
  1250. },
  1251. quesShow(id) {
  1252. if (this.reduplicateGroup.length < 1) {
  1253. return true;
  1254. }
  1255. for (var i = 0, imax = this.reduplicateGroup.length; i < imax; i++) {
  1256. if (id == this.reduplicateGroup[i]) {
  1257. return true;
  1258. }
  1259. }
  1260. return false;
  1261. },
  1262. reduplicateMarkShow(id) {
  1263. var found = false;
  1264. for (var i = 0, imax = this.reduplicateQuestions.length; i < imax; i++) {
  1265. for (
  1266. var j = 0, jmax = this.reduplicateQuestions[i].length;
  1267. j < jmax;
  1268. j++
  1269. ) {
  1270. if (this.reduplicateQuestions[i][j] == id) {
  1271. found = true;
  1272. break;
  1273. }
  1274. }
  1275. if (found) {
  1276. break;
  1277. }
  1278. }
  1279. return found;
  1280. },
  1281. reduplicateMarkColor(id) {
  1282. for (var i = 0, imax = this.reduplicateQuestions.length; i < imax; i++) {
  1283. for (
  1284. var j = 0, jmax = this.reduplicateQuestions[i].length;
  1285. j < jmax;
  1286. j++
  1287. ) {
  1288. if (this.reduplicateQuestions[i][j] == id) {
  1289. return this.reduplicateQuesColor[i];
  1290. }
  1291. }
  1292. }
  1293. },
  1294. reduplicateMarkCheck(id) {
  1295. for (var i = 0, imax = this.reduplicateGroup.length; i < imax; i++) {
  1296. if (id == this.reduplicateGroup[i]) {
  1297. return true;
  1298. }
  1299. }
  1300. return false;
  1301. },
  1302. reduplicate_mark_check(id, checked) {
  1303. console.log(checked);
  1304. console.log(this.reduplicateQuestions);
  1305. console.log(id);
  1306. if (!checked) {
  1307. for (
  1308. var i = 0, imax = this.reduplicateQuestions.length;
  1309. i < imax;
  1310. i++
  1311. ) {
  1312. for (
  1313. var j = 0, jmax = this.reduplicateQuestions[i].length;
  1314. j < jmax;
  1315. j++
  1316. ) {
  1317. if (this.reduplicateQuestions[i][j] == id) {
  1318. this.reduplicateGroup = [];
  1319. for (
  1320. var k = 0, kmax = this.reduplicateQuestions[i].length;
  1321. k < kmax;
  1322. k++
  1323. ) {
  1324. this.reduplicateGroup.push(this.reduplicateQuestions[i][k]);
  1325. }
  1326. return;
  1327. }
  1328. }
  1329. }
  1330. } else {
  1331. this.reduplicateGroup = [];
  1332. }
  1333. },
  1334. //编辑题目
  1335. editQues(paperDetailUnit, question) {
  1336. console.log("question:", question);
  1337. this.coursePropertyName = "";
  1338. this.firstPropertyId = "";
  1339. this.secondPropertyId = "";
  1340. this.editPaperDetailUnit = paperDetailUnit;
  1341. this.quesModel = JSON.parse(JSON.stringify(question)); //深拷贝
  1342. this.quesModel.score = paperDetailUnit.score;
  1343. //如果是套题下面的小题编辑 ( paperDetailUnit的类型是套题,question的类型不是套题)
  1344. if (
  1345. paperDetailUnit.questionType == "NESTED_ANSWER_QUESTION" &&
  1346. question.questionType != "NESTED_ANSWER_QUESTION"
  1347. ) {
  1348. for (var i = 0; i < paperDetailUnit.question.subQuestions.length; i++) {
  1349. if (
  1350. paperDetailUnit.question.subQuestions[i].id == this.quesModel.id
  1351. ) {
  1352. this.quesModel.score = paperDetailUnit.subScoreList[i];
  1353. break;
  1354. }
  1355. }
  1356. }
  1357. if (isEmptyStr(this.quesModel.answerType)) {
  1358. this.quesModel.answerType = "DIVERSIFIED_TEXT";
  1359. }
  1360. if (this.quesModel.questionType == "FILL_BLANK_QUESTION") {
  1361. this.quesModel.quesBody = this.quesModel.quesBody.replace(
  1362. /______/g,
  1363. "###"
  1364. );
  1365. }
  1366. this.assignAnswers(); //给singleRightAnswer或multipleRightAnswer赋值
  1367. this.openQuesDialog();
  1368. },
  1369. //给singleRightAnswer和multipleRightAnswer赋值
  1370. assignAnswers() {
  1371. if (this.quesModel.quesOptions && this.quesModel.quesOptions.length > 0) {
  1372. this.singleRightAnswer = "";
  1373. this.multipleRightAnswer = [];
  1374. for (let i = 0; i < this.quesModel.quesOptions.length; i++) {
  1375. let option = this.quesModel.quesOptions[i];
  1376. if (
  1377. this.quesModel.questionType == "SINGLE_ANSWER_QUESTION" &&
  1378. option.isCorrect == 1
  1379. ) {
  1380. this.singleRightAnswer = String.fromCharCode(65 + i);
  1381. }
  1382. if (
  1383. this.quesModel.questionType == "MULTIPLE_ANSWER_QUESTION" &&
  1384. option.isCorrect == 1
  1385. ) {
  1386. this.multipleRightAnswer.push(String.fromCharCode(65 + i));
  1387. }
  1388. }
  1389. }
  1390. },
  1391. //打开修改试题编辑框
  1392. openQuesDialog() {
  1393. this.quesDialog = true;
  1394. },
  1395. //关闭试题编辑框
  1396. closeQuesDialog() {
  1397. this.quesDialog = false;
  1398. this.quesModel = {};
  1399. },
  1400. //删除属性
  1401. handleClose(tag) {
  1402. this.quesModel.quesProperties.splice(
  1403. this.quesModel.quesProperties.indexOf(tag),
  1404. 1
  1405. );
  1406. },
  1407. //查询一级属性
  1408. searchFirst() {
  1409. this.firstPropertyId = "";
  1410. this.secondPropertyId = "";
  1411. this.secondPropertyList = [];
  1412. if (this.coursePropertyName) {
  1413. for (let courseProperty of this.coursePropertyList) {
  1414. if (courseProperty.name == this.coursePropertyName) {
  1415. this.$http
  1416. .get(QUESTION_API + "/property/first/" + courseProperty.id)
  1417. .then((response) => {
  1418. this.firstPropertyList = response.data;
  1419. });
  1420. }
  1421. }
  1422. }
  1423. },
  1424. //查询二级属性
  1425. searchSecond() {
  1426. this.secondPropertyId = "";
  1427. if (this.firstPropertyId) {
  1428. this.$http
  1429. .get(QUESTION_API + "/property/second/" + this.firstPropertyId)
  1430. .then((response) => {
  1431. this.secondPropertyList = response.data;
  1432. });
  1433. }
  1434. },
  1435. //新增属性
  1436. insertProperty() {
  1437. if (!this.checkInsertPro()) {
  1438. return false;
  1439. }
  1440. var quesProperty = {
  1441. id: "",
  1442. coursePropertyName: "",
  1443. firstProperty: {},
  1444. secondProperty: {},
  1445. };
  1446. if (
  1447. this.quesModel.quesProperties == null ||
  1448. this.quesModel.quesProperties.length == 0
  1449. ) {
  1450. this.quesModel.quesProperties = [];
  1451. }
  1452. if (this.secondPropertyId) {
  1453. quesProperty.id =
  1454. this.coursePropertyName +
  1455. "-" +
  1456. this.firstPropertyId +
  1457. "-" +
  1458. this.secondPropertyId;
  1459. } else {
  1460. quesProperty.id = this.coursePropertyName + "-" + this.firstPropertyId;
  1461. }
  1462. for (let quesPro of this.quesModel.quesProperties) {
  1463. if (quesPro.id == quesProperty.id) {
  1464. this.$notify({
  1465. message: "该属性已存在,请重新选择",
  1466. type: "error",
  1467. });
  1468. return false;
  1469. }
  1470. }
  1471. quesProperty.coursePropertyName = this.coursePropertyName;
  1472. //取到一级属性对象
  1473. for (let property of this.firstPropertyList) {
  1474. if (property.id == this.firstPropertyId) {
  1475. quesProperty.firstProperty = property;
  1476. }
  1477. }
  1478. //判断是否有二级属性
  1479. if (
  1480. this.secondPropertyList != undefined &&
  1481. this.secondPropertyList.length > 0
  1482. ) {
  1483. if (!this.secondPropertyId) {
  1484. this.$notify({
  1485. message: "请选择二级属性",
  1486. type: "error",
  1487. });
  1488. return false;
  1489. }
  1490. }
  1491. //取到二级属性对象
  1492. for (let property of this.secondPropertyList) {
  1493. if (property.id == this.secondPropertyId) {
  1494. quesProperty.secondProperty = property;
  1495. }
  1496. }
  1497. this.quesModel.quesProperties.push(quesProperty);
  1498. this.quesModel = Object.assign({}, this.quesModel);
  1499. //清空下拉框
  1500. this.coursePropertyName = "";
  1501. this.firstPropertyId = "";
  1502. this.secondPropertyId = "";
  1503. this.firstPropertyList = [];
  1504. this.secondPropertyList = [];
  1505. },
  1506. //新增属性验证
  1507. checkInsertPro() {
  1508. if (!this.coursePropertyName) {
  1509. this.$notify({
  1510. message: "请选择属性",
  1511. type: "error",
  1512. });
  1513. return false;
  1514. }
  1515. if (!this.firstPropertyId) {
  1516. this.$notify({
  1517. message: "请选择一级属性",
  1518. type: "error",
  1519. });
  1520. return false;
  1521. }
  1522. return true;
  1523. },
  1524. //删除选项
  1525. removeQuesOption(option) {
  1526. this.singleRightAnswer = "";
  1527. this.multipleRightAnswer = [];
  1528. let index = this.quesModel.quesOptions.indexOf(option);
  1529. if (index !== -1) {
  1530. this.quesModel.quesOptions.splice(index, 1);
  1531. }
  1532. if (this.quesModel.quesOptions.length > 0) {
  1533. for (var i = 0; i < this.quesModel.quesOptions.length; i++) {
  1534. var quesOption = this.quesModel.quesOptions[i];
  1535. quesOption["number"] = i + 1;
  1536. if (quesOption.isCorrect == 1) {
  1537. var answerOrderNum = String.fromCharCode(65 + i);
  1538. if (this.quesModel.questionType == "SINGLE_ANSWER_QUESTION") {
  1539. this.singleRightAnswer = answerOrderNum;
  1540. }
  1541. if (this.quesModel.questionType == "MULTIPLE_ANSWER_QUESTION") {
  1542. this.multipleRightAnswer.push(answerOrderNum);
  1543. }
  1544. }
  1545. }
  1546. }
  1547. },
  1548. //新增选项
  1549. addQuesOption() {
  1550. this.quesModel.quesOptions.push({
  1551. number: "",
  1552. optionBody: "",
  1553. isCorrect: "",
  1554. });
  1555. for (var i = 0; i < this.quesModel.quesOptions.length; i++) {
  1556. this.quesModel.quesOptions[i]["number"] = i + 1;
  1557. }
  1558. },
  1559. savePaperDetailUnit() {
  1560. //跟新难度值
  1561. if (this.quesModel.difficultyDegree < 0.4) {
  1562. this.quesModel.difficulty = "难";
  1563. } else if (
  1564. this.quesModel.difficultyDegree > 0.3 &&
  1565. this.quesModel.difficultyDegree < 0.8
  1566. ) {
  1567. this.quesModel.difficulty = "中";
  1568. } else {
  1569. this.quesModel.difficulty = "易";
  1570. }
  1571. this.setRightAnswer();
  1572. if (/^\d+(?=\.{0,1}\d+$|$)/.test(this.quesModel.score)) {
  1573. console.log("正确");
  1574. } else {
  1575. this.$notify({
  1576. message: "分数只能为正数",
  1577. type: "error",
  1578. });
  1579. return;
  1580. }
  1581. if (this.paper.paperType == "GENERATE") {
  1582. this.$confirm(
  1583. "试题内容修改,会影响所有关联试卷,是否确定进行?",
  1584. "提示",
  1585. {
  1586. confirmButtonText: "确定",
  1587. cancelButtonText: "取消",
  1588. type: "warning",
  1589. }
  1590. ).then(() => {
  1591. this.submitPaperDetailUnit();
  1592. });
  1593. } else {
  1594. this.submitPaperDetailUnit();
  1595. }
  1596. },
  1597. submitPaperDetailUnit() {
  1598. let paperDetailUnitExp = {
  1599. id: this.editPaperDetailUnit.id,
  1600. question: this.quesModel,
  1601. score: this.quesModel.score,
  1602. };
  1603. if (
  1604. this.quesModel.quesOptions &&
  1605. this.quesModel.quesOptions.length == 0
  1606. ) {
  1607. this.$confirm("无选项将删除该试题, 是否继续?", "提示", {
  1608. confirmButtonText: "确定",
  1609. cancelButtonText: "取消",
  1610. type: "warning",
  1611. }).then(() => {
  1612. this.dialogLoading = true;
  1613. this.$httpWithMsg
  1614. .delete(
  1615. QUESTION_API +
  1616. "/paper/deleteQuestion/" +
  1617. this.editPaperDetailUnit.id +
  1618. "/" +
  1619. this.quesModel.id
  1620. )
  1621. .then((response) => {
  1622. if (response.data.length > 0) {
  1623. var deleteInfo =
  1624. "该试题被试卷:" +
  1625. response.data.join(" , ") +
  1626. "使用,不能删除";
  1627. this.$notify({
  1628. message: deleteInfo,
  1629. type: "error",
  1630. });
  1631. } else {
  1632. this.$notify({
  1633. message: "保存成功",
  1634. type: "success",
  1635. });
  1636. }
  1637. })
  1638. .finally(() => (this.loading = false));
  1639. });
  1640. } else {
  1641. this.dialogLoading = true;
  1642. //校验音频重复
  1643. let audiomap = new Map();
  1644. let regex = new RegExp(
  1645. '<a id="[^<>]+" name="([^<>]+\\.mp3)"></a>',
  1646. "ig"
  1647. );
  1648. let ret = "";
  1649. let quesBodyStr = paperDetailUnitExp.question.quesBody;
  1650. if (quesBodyStr) {
  1651. while ((ret = regex.exec(quesBodyStr))) {
  1652. if (audiomap.get(ret[1])) {
  1653. this.dialogLoading = false;
  1654. this.$notify({
  1655. type: "error",
  1656. message: "题干中存在相同的音频文件",
  1657. });
  1658. return;
  1659. } else {
  1660. audiomap.set(ret[1], ret[1]);
  1661. }
  1662. }
  1663. }
  1664. let quesAnswerStr = paperDetailUnitExp.question.quesAnswer;
  1665. if (quesAnswerStr) {
  1666. while ((ret = regex.exec(quesAnswerStr))) {
  1667. if (audiomap.get(ret[1])) {
  1668. this.dialogLoading = false;
  1669. this.$notify({
  1670. type: "error",
  1671. message: "答案中存在相同的音频文件",
  1672. });
  1673. return;
  1674. } else {
  1675. audiomap.set(ret[1], ret[1]);
  1676. }
  1677. }
  1678. }
  1679. let quesOptions = paperDetailUnitExp.question.quesOptions;
  1680. if (quesOptions) {
  1681. for (let i = 0; i < quesOptions.length; i++) {
  1682. let quesOptionStr = quesOptions[i].optionBody;
  1683. while ((ret = regex.exec(quesOptionStr))) {
  1684. if (audiomap.get(ret[1])) {
  1685. this.dialogLoading = false;
  1686. this.$notify({
  1687. type: "error",
  1688. message: "选项中存在相同的音频文件",
  1689. });
  1690. return;
  1691. } else {
  1692. audiomap.set(ret[1], ret[1]);
  1693. }
  1694. }
  1695. }
  1696. }
  1697. paperDetailUnitExp.question.quesAnswer = this.answer;
  1698. this.$httpWithMsg
  1699. .put(QUESTION_API + "/paperDetailUnit", paperDetailUnitExp)
  1700. .then(() => {
  1701. this.$notify({
  1702. message: "保存成功",
  1703. type: "success",
  1704. });
  1705. this.dialogLoading = false;
  1706. this.closeQuesDialog();
  1707. this.initPaper();
  1708. })
  1709. .finally(() => (this.dialogLoading = false));
  1710. }
  1711. },
  1712. //在正确的option上设置isCorrect=1
  1713. setRightAnswer() {
  1714. if (
  1715. !this.quesModel.quesOptions ||
  1716. this.quesModel.quesOptions.length == 0
  1717. ) {
  1718. return false;
  1719. }
  1720. for (var i = 0; i < this.quesModel.quesOptions.length; i++) {
  1721. var option = this.quesModel.quesOptions[i];
  1722. var answerOrderNum = String.fromCharCode(65 + i);
  1723. if (this.quesModel.questionType == "SINGLE_ANSWER_QUESTION") {
  1724. option["isCorrect"] =
  1725. answerOrderNum == this.singleRightAnswer ? 1 : 0;
  1726. }
  1727. if (this.quesModel.questionType == "MULTIPLE_ANSWER_QUESTION") {
  1728. option["isCorrect"] =
  1729. this.multipleRightAnswer.indexOf(answerOrderNum) > -1 ? 1 : 0;
  1730. }
  1731. }
  1732. },
  1733. //删除试题
  1734. deleteQues(paperDetailUnit) {
  1735. let paperDetailUnitId = paperDetailUnit.id;
  1736. if (this.paper.paperType == "GENERATE") {
  1737. this.deleteQues01(paperDetailUnitId);
  1738. } else {
  1739. let questionId = paperDetailUnit.question.id;
  1740. this.deleteQues02(questionId, paperDetailUnitId);
  1741. }
  1742. },
  1743. deleteQues01(paperDetailUnitId) {
  1744. this.$alert("您确定删除吗?", "提示", {
  1745. confirmButtonText: "确定",
  1746. callback: (action) => {
  1747. if (action == "confirm") {
  1748. this.loading = true;
  1749. this.$httpWithMsg
  1750. .delete(QUESTION_API + "/paperDetailUnit/" + paperDetailUnitId)
  1751. .then(() => {
  1752. this.initPaper();
  1753. this.getreduplicateQuestions();
  1754. this.reduplicateGroup = [];
  1755. this.loading = true;
  1756. this.$notify({
  1757. message: "删除成功",
  1758. type: "success",
  1759. });
  1760. })
  1761. .finally(() => (this.loading = false));
  1762. }
  1763. },
  1764. });
  1765. },
  1766. deleteQues02(questionId, paperDetailUnitId) {
  1767. this.$alert("您确定删除吗?", "提示", {
  1768. confirmButtonText: "确定",
  1769. callback: (action) => {
  1770. if (action == "confirm") {
  1771. this.loading = true;
  1772. this.$http
  1773. .delete(
  1774. QUESTION_API +
  1775. "/paper/deleteQuestion/" +
  1776. paperDetailUnitId +
  1777. "/" +
  1778. questionId
  1779. )
  1780. .then((response) => {
  1781. if (response.data.length > 0) {
  1782. var deleteInfo =
  1783. "该试题被试卷:" +
  1784. response.data.join(" , ") +
  1785. "使用,不能删除";
  1786. this.$notify({
  1787. message: deleteInfo,
  1788. type: "error",
  1789. });
  1790. } else {
  1791. this.initPaper();
  1792. this.getreduplicateQuestions();
  1793. this.reduplicateGroup = [];
  1794. this.loading = true;
  1795. this.$notify({
  1796. message: "保存成功",
  1797. type: "success",
  1798. });
  1799. }
  1800. this.loading = false;
  1801. });
  1802. }
  1803. },
  1804. });
  1805. },
  1806. //获取重复试题
  1807. getreduplicateQuestions() {
  1808. this.duplicateLoading = true;
  1809. this.$http
  1810. .get(QUESTION_API + "/paper/" + this.paperId + "/reduplicate-questions")
  1811. .then((response) => {
  1812. this.reduplicateQuestions = response.data;
  1813. this.duplicateLoading = false;
  1814. this.initReduplicateQuesColor();
  1815. // var ques = document.getElementsByClassName("ques")[0];
  1816. // ques.style.display = "inline";
  1817. });
  1818. },
  1819. exportPaperAnswer() {
  1820. var key = this.user.key;
  1821. var token = this.user.token;
  1822. window.open(
  1823. QUESTION_API +
  1824. "/paper/answer/export/" +
  1825. this.paperId +
  1826. "?$key=" +
  1827. key +
  1828. "&$token=" +
  1829. token
  1830. );
  1831. },
  1832. initReduplicateQuesColor() {
  1833. var colorCount = this.reduplicateQuestions.length;
  1834. if (colorCount > 20) {
  1835. this.reduplicateQuesColor = randomColor({
  1836. luminosity: "bright",
  1837. count: colorCount,
  1838. });
  1839. } else {
  1840. this.reduplicateQuesColor = this.defaultColor;
  1841. }
  1842. },
  1843. getSubQuesEditId(paperDetailUnit, subQuestion) {
  1844. return paperDetailUnit.question.id + "_" + subQuestion.quesParams.number;
  1845. },
  1846. //打开考试说明编辑框
  1847. openEditExamPaperRemark() {
  1848. if (this.paper.examRemark) {
  1849. this.examRemark = this.paper.examRemark;
  1850. } else {
  1851. this.examRemark = "";
  1852. }
  1853. this.paperRemarkDialog = true;
  1854. },
  1855. //保存考试说明
  1856. savePaperRemark() {
  1857. this.paper.examRemark = this.examRemark;
  1858. this.savePaper();
  1859. this.paperRemarkDialog = false;
  1860. },
  1861. //关闭考试说明编辑框
  1862. closPaperRemark() {
  1863. this.examRemark = "";
  1864. this.paperRemarkDialog = false;
  1865. },
  1866. //保存试卷
  1867. savePaper() {
  1868. this.loading = true;
  1869. this.$http
  1870. .put(QUESTION_API + "/paper", this.paper)
  1871. .then(() => {
  1872. this.$notify({
  1873. message: "保存成功",
  1874. type: "success",
  1875. });
  1876. this.loading = false;
  1877. this.initPaper();
  1878. })
  1879. .catch((error) => {
  1880. this.loading = false;
  1881. this.$notify({
  1882. type: "error",
  1883. message: error.response.data.desc,
  1884. });
  1885. });
  1886. },
  1887. //删除试卷
  1888. deletePaper(id) {
  1889. this.$confirm("确认删除试卷吗?", "提示", {
  1890. type: "warning",
  1891. }).then(() => {
  1892. this.loading = true;
  1893. this.$http.delete(QUESTION_API + "/paper/" + id).then(
  1894. () => {
  1895. this.$notify({
  1896. message: "删除成功",
  1897. type: "success",
  1898. });
  1899. this.back();
  1900. },
  1901. (error) => {
  1902. this.$notify({
  1903. message: error.response.data.desc,
  1904. type: "error",
  1905. title: "错误",
  1906. });
  1907. this.loading = false;
  1908. }
  1909. );
  1910. });
  1911. },
  1912. //打开上传音频弹框
  1913. openDialog() {
  1914. this.checkResult = false;
  1915. this.isUpload = true;
  1916. if (document.getElementById("radioFile")) {
  1917. document.getElementById("radioFile").value = "";
  1918. }
  1919. this.dialogRadioFile = true;
  1920. this.fileList = [];
  1921. },
  1922. //关闭音频弹框
  1923. closeAudioDialog() {
  1924. this.dialogRadioFile = this.uploadAudioLoading;
  1925. },
  1926. //返回
  1927. back() {
  1928. if (sessionStorage.getItem("question_back") == "true") {
  1929. this.$router.push({
  1930. path: "/questions/" + this.parentView + "/0",
  1931. });
  1932. } else {
  1933. this.$router.push({
  1934. path: "/questions/" + this.parentView + "/1",
  1935. });
  1936. }
  1937. },
  1938. paperDetailShow(paperDetail) {
  1939. if (this.reduplicateGroup.length == 0) {
  1940. return true;
  1941. }
  1942. let paperDetailUnits = paperDetail.paperDetailUnits;
  1943. for (let i = 0, imax = paperDetailUnits.length; i < imax; i++) {
  1944. for (var j = 0, jmax = this.reduplicateGroup.length; j < jmax; j++) {
  1945. if (paperDetailUnits[i].id == this.reduplicateGroup[j]) {
  1946. return true;
  1947. }
  1948. }
  1949. }
  1950. return false;
  1951. },
  1952. //上传文件检查
  1953. checkFile() {
  1954. this.fileNameList = [];
  1955. //读取选取的文件夹里面的文件
  1956. this.checkResult = true;
  1957. var files = document.getElementById("radioFile").files;
  1958. if (files.length == 0) {
  1959. this.message = "请选择音频文件夹!";
  1960. return;
  1961. }
  1962. var size = 0;
  1963. var isGo = false;
  1964. //取到所有文件的文件名
  1965. for (var i = 0; i < files.length; i++) {
  1966. this.fileNameList.push(files[i].name);
  1967. if (files[i].size > 5 * 1024 * 1024) {
  1968. isGo = true;
  1969. break;
  1970. }
  1971. size = files[i].size + size;
  1972. }
  1973. if (isGo) {
  1974. this.message = "上传单个文件不能超过5M";
  1975. this.isUpload = true;
  1976. }
  1977. if (size > 50 * 1024 * 1024) {
  1978. this.message = "上传文件总和不能超过50M";
  1979. this.isUpload = true;
  1980. return;
  1981. }
  1982. this.$http
  1983. .post(
  1984. QUESTION_API + "/checkRadioFile/" + this.paperId,
  1985. this.fileNameList
  1986. )
  1987. .then((response) => {
  1988. console.log("response:", response);
  1989. this.message = response.data.errorMsg;
  1990. if (this.message == "OK") {
  1991. this.message = "OK!";
  1992. this.isUpload = false;
  1993. } else {
  1994. this.isUpload = true;
  1995. }
  1996. })
  1997. .catch((error) => {
  1998. console.log(error);
  1999. });
  2000. },
  2001. //读取文件
  2002. uploadAudioFile() {
  2003. let param = new FormData();
  2004. var fileList = document.getElementById("radioFile").files;
  2005. //循环添加到formData中
  2006. for (var i = 0; i < fileList.length; i++) {
  2007. var file = fileList[i];
  2008. param.append("files", file, file.name);
  2009. }
  2010. let config = {
  2011. headers: { "Content-Type": "multipart/form-data" },
  2012. };
  2013. this.$http
  2014. .post(QUESTION_API + "/uploadRadio/" + this.paperId, param, config)
  2015. .then(() => {
  2016. this.dialogRadioFile = false;
  2017. this.uploadAudioLoading = false;
  2018. this.checkResult = false;
  2019. this.isUpload = true;
  2020. document.getElementById("radioFile").value = "";
  2021. this.initPaper();
  2022. })
  2023. .catch((error) => {
  2024. this.message = error.response.data.desc;
  2025. this.uploadAudioLoading = false;
  2026. });
  2027. },
  2028. },
  2029. };
  2030. </script>
  2031. <style scoped src="../styles/EditPaper.css">
  2032. .property_with {
  2033. width: 100px;
  2034. }
  2035. .ck-toolbar {
  2036. z-index: 9999;
  2037. }
  2038. #app {
  2039. background-color: white !important;
  2040. }
  2041. </style>
  2042. <style scoped src="../styles/Common.css"></style>