onlineExam.vue 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494
  1. <template>
  2. <div>
  3. <LinkTitlesCustom
  4. :currentPaths="['考试管理', '考试信息', '网络考试设置']"
  5. />
  6. <section class="content">
  7. <div class="box box-info">
  8. <!-- 正文信息 -->
  9. <div class="box-body">
  10. <el-form
  11. :inline="true"
  12. :rules="rules"
  13. ref="form"
  14. :model="form"
  15. inline-message
  16. label-position="right"
  17. >
  18. <div style="margin-bottom: 10px;">
  19. <el-button type="primary" size="small" @click="saveExam"
  20. >保 存</el-button
  21. >
  22. <el-button
  23. type="primary"
  24. size="small"
  25. @click="back"
  26. icon="el-icon-arrow-left"
  27. >返 回</el-button
  28. >
  29. </div>
  30. <el-tabs type="border-card" v-model="activeName">
  31. <!-- 基础信息 -->
  32. <el-tab-pane label="基础信息" name="tab1">
  33. <el-row v-if="examId != 'add'">
  34. <el-form-item
  35. label="ID"
  36. prop="id"
  37. :label-width="style.label_width_tab1"
  38. >
  39. <el-input
  40. v-model="form.id"
  41. class="input"
  42. :disabled="true"
  43. maxlength="20"
  44. ></el-input>
  45. </el-form-item>
  46. </el-row>
  47. <el-row v-if="examId != 'add'">
  48. <el-form-item
  49. label="考试编码"
  50. placeholder="请输入考试编码"
  51. prop="code"
  52. :label-width="style.label_width_tab1"
  53. >
  54. <el-input
  55. v-model="form.code"
  56. class="input"
  57. :disabled="true"
  58. maxlength="20"
  59. ></el-input>
  60. </el-form-item>
  61. </el-row>
  62. <el-row v-else>
  63. <el-form-item
  64. label="考试编码"
  65. placeholder="请输入考试编码"
  66. prop="code"
  67. :label-width="style.label_width_tab1"
  68. >
  69. <el-input
  70. v-model="form.name"
  71. class="input"
  72. :disabled="true"
  73. maxlength="20"
  74. ></el-input>
  75. </el-form-item>
  76. </el-row>
  77. <el-row>
  78. <el-form-item
  79. label="考试名称"
  80. placeholder="请输入考试名称"
  81. prop="name"
  82. :label-width="style.label_width_tab1"
  83. >
  84. <el-input
  85. v-model="form.name"
  86. class="input"
  87. maxlength="20"
  88. ></el-input>
  89. </el-form-item>
  90. </el-row>
  91. <el-row>
  92. <el-form-item
  93. label="考试类型"
  94. :label-width="style.label_width_tab1"
  95. >
  96. <el-select
  97. class="input"
  98. :disabled="true"
  99. v-model="form.examType"
  100. placeholder="请选择"
  101. >
  102. <el-option
  103. v-for="item in examTypeList"
  104. :key="item.value"
  105. :label="item.label"
  106. :value="item.value"
  107. ></el-option>
  108. </el-select>
  109. </el-form-item>
  110. </el-row>
  111. <el-row>
  112. <el-form-item
  113. label="状态"
  114. :label-width="style.label_width_tab1"
  115. >
  116. <el-radio-group v-model="form.enable" class="input">
  117. <el-radio label="true">启用</el-radio>
  118. <el-radio label="false">禁用</el-radio>
  119. </el-radio-group>
  120. </el-form-item>
  121. </el-row>
  122. <el-row v-if="1 == 2">
  123. <el-form-item
  124. label="是否可以考试"
  125. :label-width="style.label_width_tab1"
  126. >
  127. <el-radio-group v-model="form.examLimit" class="input">
  128. <el-radio label="true">否</el-radio>
  129. <el-radio label="false">是</el-radio>
  130. </el-radio-group>
  131. </el-form-item>
  132. </el-row>
  133. <el-row>
  134. <el-form-item
  135. label="考试时间"
  136. prop="examDatetimeRange"
  137. :label-width="style.label_width_tab1"
  138. >
  139. <el-date-picker
  140. class="input"
  141. v-model="examDatetimeRange"
  142. type="datetimerange"
  143. range-separator="至"
  144. start-placeholder="开始日期"
  145. end-placeholder="结束日期"
  146. value-format="yyyy-MM-dd HH:mm:ss"
  147. :clearable="false"
  148. ></el-date-picker>
  149. </el-form-item>
  150. </el-row>
  151. <el-row>
  152. <el-form-item
  153. label="开启环境检测"
  154. :label-width="style.label_width_tab1"
  155. >
  156. <el-switch
  157. v-model="form.properties.CHECK_ENVIRONMENT"
  158. on-text="是"
  159. off-text="否"
  160. ></el-switch>
  161. </el-form-item>
  162. </el-row>
  163. <el-row>
  164. <el-form-item
  165. label="开放微信小程序作答"
  166. :label-width="style.label_width_tab1"
  167. >
  168. <el-switch
  169. :disabled="!this.rootOrgWenXinAnswerEnabled"
  170. v-model="form.properties.WEIXIN_ANSWER_ENABLED"
  171. on-text="是"
  172. off-text="否"
  173. ></el-switch>
  174. </el-form-item>
  175. </el-row>
  176. <el-row>
  177. <el-form-item
  178. label="开启特殊设置"
  179. :label-width="style.label_width_tab1"
  180. >
  181. <el-switch
  182. v-model="form.specialSettingsEnabled"
  183. on-text="是"
  184. off-text="否"
  185. ></el-switch>
  186. </el-form-item>
  187. </el-row>
  188. <el-row>
  189. <el-form-item
  190. label="特殊设置方式"
  191. :label-width="style.label_width_tab1"
  192. v-show="form.specialSettingsEnabled"
  193. >
  194. <el-radio-group
  195. v-model="form.specialSettingsType"
  196. class="input"
  197. >
  198. <el-radio label="ORG_BASED">机构特殊设置</el-radio>
  199. <el-radio label="STUDENT_BASED">学生特殊设置</el-radio>
  200. </el-radio-group>
  201. </el-form-item>
  202. </el-row>
  203. <el-row>
  204. <el-form-item
  205. label="无特殊设置时禁止考试"
  206. :label-width="style.label_width_tab1"
  207. v-show="form.specialSettingsEnabled"
  208. >
  209. <el-switch
  210. v-model="form.properties.LIMITED_IF_NO_SPECIAL_SETTINGS"
  211. on-text="是"
  212. off-text="否"
  213. ></el-switch>
  214. </el-form-item>
  215. </el-row>
  216. </el-tab-pane>
  217. <!-- 控制设置 -->
  218. <el-tab-pane label="控制设置" name="tab2">
  219. <el-row>
  220. <el-form-item
  221. label="考试时长"
  222. prop="duration"
  223. :label-width="style.label_width_tab2"
  224. >
  225. <el-input
  226. maxlength="5"
  227. v-model.trim.number="form.duration"
  228. auto-complete="off"
  229. class="input"
  230. >
  231. <template slot="append"
  232. >分钟</template
  233. >
  234. </el-input>
  235. </el-form-item>
  236. </el-row>
  237. <el-row>
  238. <el-form-item
  239. label="考试次数"
  240. prop="examTimes"
  241. :label-width="style.label_width_tab2"
  242. >
  243. <el-input
  244. maxlength="5"
  245. v-model.trim.number="form.examTimes"
  246. auto-complete="off"
  247. class="input"
  248. >
  249. <template slot="append"
  250. >次</template
  251. >
  252. </el-input>
  253. </el-form-item>
  254. </el-row>
  255. <el-row>
  256. <el-form-item
  257. label="交卷冻结时间"
  258. prop="FREEZE_TIME"
  259. :label-width="style.label_width_tab2"
  260. >
  261. <el-input
  262. maxlength="5"
  263. v-model.trim.number="form.properties.FREEZE_TIME"
  264. auto-complete="off"
  265. class="input"
  266. >
  267. <template slot="append"
  268. >分钟</template
  269. >
  270. </el-input>
  271. </el-form-item>
  272. </el-row>
  273. <el-row>
  274. <el-form-item
  275. label="断点续考时间"
  276. prop="EXAM_RECONNECT_TIME"
  277. :label-width="style.label_width_tab2"
  278. >
  279. <el-input
  280. maxlength="5"
  281. v-model.trim.number="form.properties.EXAM_RECONNECT_TIME"
  282. auto-complete="off"
  283. class="input"
  284. >
  285. <template slot="append"
  286. >分钟</template
  287. >
  288. </el-input>
  289. </el-form-item>
  290. </el-row>
  291. <el-row>
  292. <el-form-item
  293. label="断点续考次数"
  294. prop="MAX_INTERRUPT_NUM"
  295. :label-width="style.label_width_tab2"
  296. >
  297. <el-input
  298. maxlength="5"
  299. v-model.trim.number="form.properties.MAX_INTERRUPT_NUM"
  300. auto-complete="off"
  301. class="input"
  302. >
  303. <template slot="append"
  304. >次</template
  305. >
  306. </el-input>
  307. </el-form-item>
  308. </el-row>
  309. </el-tab-pane>
  310. <el-tab-pane label="显示设置" name="tab3">
  311. <el-row v-if="show_ckeditor">
  312. <el-form-item
  313. label="考前说明"
  314. :label-width="style.label_width_tab3"
  315. >
  316. <ckeditor
  317. v-model="form.properties.BEFORE_EXAM_REMARK"
  318. ></ckeditor>
  319. </el-form-item>
  320. </el-row>
  321. <el-row v-if="show_ckeditor">
  322. <el-form-item
  323. label="考后说明"
  324. :label-width="style.label_width_tab3"
  325. >
  326. <ckeditor
  327. v-model="form.properties.AFTER_EXAM_REMARK"
  328. ></ckeditor>
  329. </el-form-item>
  330. </el-row>
  331. <el-row>
  332. <el-form-item
  333. label="展示作弊说明"
  334. :label-width="style.label_width_tab3"
  335. >
  336. <el-radio-group
  337. v-model="form.properties.SHOW_CHEATING_REMARK"
  338. class="input"
  339. >
  340. <el-radio label="true">开启</el-radio>
  341. <el-radio label="false">关闭</el-radio>
  342. </el-radio-group>
  343. </el-form-item>
  344. </el-row>
  345. <el-row v-if="show_ckeditor">
  346. <el-form-item
  347. label="作弊说明"
  348. :label-width="style.label_width_tab3"
  349. >
  350. <ckeditor
  351. v-model="form.properties.CHEATING_REMARK"
  352. ></ckeditor>
  353. </el-form-item>
  354. </el-row>
  355. <el-row>
  356. <el-form-item
  357. label="单选题补充说明"
  358. :label-width="style.label_width_tab3"
  359. >
  360. <el-input
  361. maxlength="20"
  362. :disabled="!form.properties.SINGLE_EDIT"
  363. v-model="form.properties.SINGLE_ANSWER_REMARK"
  364. auto-complete="off"
  365. class="input"
  366. ></el-input>
  367. </el-form-item>
  368. <el-form-item label>
  369. <el-switch
  370. v-model="form.properties.SINGLE_EDIT"
  371. on-text="启用"
  372. off-text="禁用"
  373. ></el-switch>
  374. </el-form-item>
  375. </el-row>
  376. <el-row>
  377. <el-form-item
  378. label="多选题补充说明"
  379. :label-width="style.label_width_tab3"
  380. >
  381. <el-input
  382. maxlength="20"
  383. :disabled="!form.properties.MUTIPLE_EDIT"
  384. v-model="form.properties.MUTIPLE_ANSWER_REMARK"
  385. auto-complete="off"
  386. class="input"
  387. ></el-input>
  388. </el-form-item>
  389. <el-form-item label>
  390. <el-switch
  391. v-model="form.properties.MUTIPLE_EDIT"
  392. on-text="启用"
  393. off-text="禁用"
  394. ></el-switch>
  395. </el-form-item>
  396. </el-row>
  397. <el-row>
  398. <el-form-item
  399. label="判断题补充说明"
  400. :label-width="style.label_width_tab3"
  401. >
  402. <el-input
  403. maxlength="20"
  404. :disabled="!form.properties.BOOL_EDIT"
  405. v-model="form.properties.BOOL_ANSWER_REMARK"
  406. class="input"
  407. auto-complete="off"
  408. ></el-input>
  409. </el-form-item>
  410. <el-form-item label>
  411. <el-switch
  412. v-model="form.properties.BOOL_EDIT"
  413. on-text="启用"
  414. off-text="禁用"
  415. ></el-switch>
  416. </el-form-item>
  417. </el-row>
  418. <el-row>
  419. <el-form-item
  420. label="填空题补充说明"
  421. :label-width="style.label_width_tab3"
  422. >
  423. <el-input
  424. maxlength="20"
  425. :disabled="!form.properties.FILL_BLANK_EDIT"
  426. v-model="form.properties.FILL_BLANK_REMARK"
  427. class="input"
  428. auto-complete="off"
  429. ></el-input>
  430. </el-form-item>
  431. <el-form-item label>
  432. <el-switch
  433. v-model="form.properties.FILL_BLANK_EDIT"
  434. on-text="启用"
  435. off-text="禁用"
  436. ></el-switch>
  437. </el-form-item>
  438. </el-row>
  439. <el-row>
  440. <el-form-item
  441. label="客观题成绩显示"
  442. :label-width="style.label_width_tab3"
  443. >
  444. <el-radio-group
  445. v-model="form.properties.IS_OBJ_SCORE_VIEW"
  446. class="input"
  447. >
  448. <el-radio label="true">开启</el-radio>
  449. <el-radio label="false">关闭</el-radio>
  450. </el-radio-group>
  451. </el-form-item>
  452. </el-row>
  453. </el-tab-pane>
  454. <el-tab-pane label="身份检测设置" name="tab4">
  455. <el-row>
  456. <el-form-item
  457. label="开启身份检测"
  458. :label-width="style.label_width_tab4"
  459. >
  460. <el-radio-group
  461. @change="faceEnableChange"
  462. v-model="form.properties.IS_FACE_ENABLE"
  463. :disabled="this.is_face_enable_diabled"
  464. class="input"
  465. >
  466. <el-radio label="true">是</el-radio>
  467. <el-radio label="false">否</el-radio>
  468. </el-radio-group>
  469. </el-form-item>
  470. </el-row>
  471. <el-row>
  472. <el-form-item
  473. label="启用陌生人检测"
  474. prop="IS_STRANGER_ENABLE"
  475. :label-width="style.label_width_tab4"
  476. v-show="form.properties.IS_FACE_ENABLE == 'true'"
  477. >
  478. <el-radio-group
  479. v-model="form.properties.IS_STRANGER_ENABLE"
  480. class="input"
  481. >
  482. <el-radio label="true">是</el-radio>
  483. <el-radio label="false">否</el-radio>
  484. </el-radio-group>
  485. </el-form-item>
  486. </el-row>
  487. <el-row v-show="form.properties.IS_FACE_ENABLE == 'true'">
  488. <el-form-item
  489. label="考试强制使用"
  490. :label-width="style.label_width_tab4"
  491. >
  492. <el-radio-group
  493. v-model="form.properties.IS_FACE_CHECK"
  494. class="input"
  495. >
  496. <el-radio label="true">强制</el-radio>
  497. <el-radio label="false">非强制</el-radio>
  498. </el-radio-group>
  499. </el-form-item>
  500. </el-row>
  501. <el-row v-show="form.properties.IS_FACE_ENABLE == 'true'">
  502. <el-form-item
  503. label="抓拍间隔"
  504. prop="SNAPSHOT_INTERVAL"
  505. :label-width="style.label_width_tab4"
  506. >
  507. <el-input
  508. maxlength="5"
  509. v-model.trim.number="form.properties.SNAPSHOT_INTERVAL"
  510. auto-complete="off"
  511. class="input"
  512. >
  513. <template slot="append"
  514. >分钟</template
  515. >
  516. </el-input>
  517. </el-form-item>
  518. </el-row>
  519. <el-row v-show="form.properties.IS_FACE_ENABLE == 'true'">
  520. <el-form-item
  521. label="预警阀值"
  522. prop="WARN_THRESHOLD"
  523. :label-width="style.label_width_tab4"
  524. >
  525. <el-input
  526. maxlength="5"
  527. v-model="form.properties.WARN_THRESHOLD"
  528. auto-complete="off"
  529. class="input"
  530. >
  531. <template slot="append"
  532. >%</template
  533. >
  534. </el-input>
  535. </el-form-item>
  536. </el-row>
  537. <el-row v-show="form.properties.IS_FACE_ENABLE == 'true'">
  538. <el-form-item
  539. label="真实性预警阀值"
  540. prop="LIVING_WARN_THRESHOLD"
  541. :label-width="style.label_width_tab4"
  542. >
  543. <el-input
  544. maxlength="5"
  545. v-model="form.properties.LIVING_WARN_THRESHOLD"
  546. auto-complete="off"
  547. class="input"
  548. >
  549. <template slot="append"
  550. >%</template
  551. >
  552. </el-input>
  553. </el-form-item>
  554. </el-row>
  555. <el-row v-show="form.properties.IS_FACE_ENABLE == 'true'">
  556. <el-form-item
  557. label="开启人脸活体检测"
  558. :label-width="style.label_width_tab4"
  559. >
  560. <el-radio-group
  561. v-model="form.properties.IS_FACE_VERIFY"
  562. :disabled="this.is_face_verify_diabled"
  563. class="input"
  564. >
  565. <el-radio label="true">是</el-radio>
  566. <el-radio label="false">否</el-radio>
  567. </el-radio-group>
  568. </el-form-item>
  569. </el-row>
  570. <el-row v-show="form.properties.IS_FACE_VERIFY == 'true'">
  571. <el-form-item
  572. label="人脸活体检测开始时间"
  573. prop="FACE_VERIFY_START_MINUTE"
  574. :label-width="style.label_width_tab4"
  575. >
  576. <el-input
  577. maxlength="5"
  578. v-model.trim.number="
  579. form.properties.FACE_VERIFY_START_MINUTE
  580. "
  581. auto-complete="off"
  582. class="input"
  583. >
  584. <template slot="append"
  585. >分钟</template
  586. >
  587. </el-input>
  588. </el-form-item>
  589. </el-row>
  590. <el-row v-show="form.properties.IS_FACE_VERIFY == 'true'">
  591. <el-form-item
  592. label="人脸活体检测结束时间"
  593. prop="FACE_VERIFY_END_MINUTE"
  594. :label-width="style.label_width_tab4"
  595. >
  596. <el-input
  597. maxlength="5"
  598. v-model.trim.number="
  599. form.properties.FACE_VERIFY_END_MINUTE
  600. "
  601. auto-complete="off"
  602. class="input"
  603. >
  604. <template slot="append"
  605. >分钟</template
  606. >
  607. </el-input>
  608. </el-form-item>
  609. </el-row>
  610. <el-row
  611. v-show="
  612. form.properties.IS_FACE_ENABLE == 'true' &&
  613. form.IDENTIFICATION_OF_LIVING_BODY_SCHEME == 'S2'
  614. "
  615. >
  616. <el-form-item
  617. label="追加人脸活体检测"
  618. :label-width="style.label_width_tab4"
  619. >
  620. <el-radio-group
  621. v-model="form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME"
  622. :disabled="form.properties.IS_FACE_VERIFY == 'false'"
  623. class="input"
  624. >
  625. <el-radio label="true">是</el-radio>
  626. <el-radio label="false">否</el-radio>
  627. </el-radio-group>
  628. </el-form-item>
  629. </el-row>
  630. <el-row
  631. v-show="
  632. form.IDENTIFICATION_OF_LIVING_BODY_SCHEME == 'S2' &&
  633. form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME == 'true'
  634. "
  635. >
  636. <el-form-item
  637. label="追加活检测开始时间"
  638. prop="OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE"
  639. :label-width="style.label_width_tab4"
  640. >
  641. <el-input
  642. maxlength="5"
  643. v-model.trim.number="
  644. form.properties.OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE
  645. "
  646. auto-complete="off"
  647. class="input"
  648. >
  649. <template slot="append"
  650. >分钟</template
  651. >
  652. </el-input>
  653. </el-form-item>
  654. </el-row>
  655. <el-row
  656. v-show="
  657. form.IDENTIFICATION_OF_LIVING_BODY_SCHEME == 'S2' &&
  658. form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME == 'true'
  659. "
  660. >
  661. <el-form-item
  662. label="追加活检测结束时间"
  663. prop="OUT_FREEZE_TIME_FACE_VERIFY_END_MINUTE"
  664. :label-width="style.label_width_tab4"
  665. >
  666. <el-input
  667. maxlength="5"
  668. v-model.trim.number="
  669. form.properties.OUT_FREEZE_TIME_FACE_VERIFY_END_MINUTE
  670. "
  671. auto-complete="off"
  672. class="input"
  673. >
  674. <template slot="append"
  675. >分钟</template
  676. >
  677. </el-input>
  678. </el-form-item>
  679. </el-row>
  680. </el-tab-pane>
  681. <el-tab-pane label="阅卷设置" name="tab5">
  682. <el-row>
  683. <el-form-item
  684. label="阅卷方式"
  685. :label-width="style.label_width_tab5"
  686. >
  687. <el-radio-group
  688. :disabled="form.started"
  689. v-model="form.properties.MARKING_TYPE"
  690. class="input"
  691. >
  692. <el-radio label="ALL">全部评阅</el-radio>
  693. <el-radio label="OBJECT_SCORE_MAX">客观分最高</el-radio>
  694. <el-radio label="LAST_SUBMIT">最后一次提交</el-radio>
  695. </el-radio-group>
  696. </el-form-item>
  697. </el-row>
  698. </el-tab-pane>
  699. <el-tab-pane label="网络设置" name="tab6">
  700. <el-row>
  701. <el-form-item
  702. label="IP限制"
  703. :label-width="style.label_width_tab6"
  704. >
  705. <el-radio-group v-model="form.properties.IP_LIMIT">
  706. <el-radio label="true">开启</el-radio>
  707. <el-radio label="false">关闭</el-radio>
  708. </el-radio-group>
  709. </el-form-item>
  710. </el-row>
  711. <el-row>
  712. <el-form-item
  713. label="IP段( *表示任意 )"
  714. :label-width="style.label_width_tab6"
  715. >
  716. <el-input
  717. maxlength="2000"
  718. v-model="form.properties.IP_ADDRESSES"
  719. class="input"
  720. type="textarea"
  721. rows="6"
  722. ></el-input>
  723. </el-form-item>
  724. </el-row>
  725. </el-tab-pane>
  726. <el-tab-pane label="其它" name="tab7">
  727. <el-row>
  728. <el-form-item
  729. label="是否推送成绩"
  730. :label-width="style.label_width_tab7"
  731. >
  732. <el-radio-group v-model="form.properties.PUSH_SCORE">
  733. <el-radio label="true">是</el-radio>
  734. <el-radio label="false">否</el-radio>
  735. </el-radio-group>
  736. </el-form-item>
  737. </el-row>
  738. </el-tab-pane>
  739. </el-tabs>
  740. </el-form>
  741. </div>
  742. </div>
  743. </section>
  744. </div>
  745. </template>
  746. <script>
  747. import { mapState } from "vuex";
  748. import { EXAM_TYPE, EXAM_WORK_API, CORE_API } from "@/constants/constants.js";
  749. import moment from "moment";
  750. import ckeditor from "@/components/ckeditor.vue";
  751. import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
  752. let _this = null;
  753. let validateCode = (rule, value, callback) => {
  754. if (_this.examId == "add") {
  755. _this.form.code = _this.form.name;
  756. }
  757. let code = _this.form.code;
  758. if (code == "") {
  759. callback(new Error("请输入考试编码"));
  760. if (!_this.toActiveName) {
  761. _this.toActiveName = "tab1";
  762. _this.activeName = "tab1";
  763. }
  764. } else {
  765. callback();
  766. }
  767. };
  768. let validateName = (rule, value, callback) => {
  769. let name = _this.form.name;
  770. if (name == "") {
  771. callback(new Error("请输入考试名称"));
  772. if (!_this.toActiveName) {
  773. _this.toActiveName = "tab1";
  774. _this.activeName = "tab1";
  775. }
  776. } else {
  777. callback();
  778. }
  779. };
  780. let validateExamDatetimeRange = (rule, value, callback) => {
  781. let examDatetimeRange = _this.examDatetimeRange;
  782. if (!examDatetimeRange) {
  783. callback(new Error("请输入考试时间"));
  784. if (!_this.toActiveName) {
  785. _this.toActiveName = "tab1";
  786. _this.activeName = "tab1";
  787. }
  788. } else {
  789. callback();
  790. }
  791. };
  792. let validateDuration = (rule, value, callback) => {
  793. let duration = _this.form.duration;
  794. if (duration === "") {
  795. callback(new Error("请输入考试时长"));
  796. if (!_this.toActiveName) {
  797. _this.toActiveName = "tab2";
  798. _this.activeName = "tab2";
  799. }
  800. } else if (!duration.toString().match(/^[1-9]\d*|0$/)) {
  801. callback(new Error("只能是非负整数"));
  802. if (!_this.toActiveName) {
  803. _this.toActiveName = "tab2";
  804. _this.activeName = "tab2";
  805. }
  806. } else {
  807. callback();
  808. }
  809. };
  810. let validateExamTimes = (rule, value, callback) => {
  811. let examTimes = _this.form.examTimes;
  812. if (examTimes === "") {
  813. callback(new Error("请输入考试次数"));
  814. if (!_this.toActiveName) {
  815. _this.toActiveName = "tab2";
  816. _this.activeName = "tab2";
  817. }
  818. } else if (!examTimes.toString().match(/^[1-9]\d*$/)) {
  819. callback(new Error("只能是正整数"));
  820. if (!_this.toActiveName) {
  821. _this.toActiveName = "tab2";
  822. _this.activeName = "tab2";
  823. }
  824. } else {
  825. callback();
  826. }
  827. };
  828. let validateFreezeTime = (rule, value, callback) => {
  829. let freezeTime = _this.form.properties.FREEZE_TIME;
  830. let duration = _this.form.duration;
  831. if (freezeTime === "") {
  832. callback(new Error("请输入交卷冻结时长"));
  833. if (!_this.toActiveName) {
  834. _this.toActiveName = "tab2";
  835. _this.activeName = "tab2";
  836. }
  837. } else if (!freezeTime.toString().match(/^[1-9]\d*|0$/)) {
  838. callback(new Error("只能是非负整数"));
  839. if (!_this.toActiveName) {
  840. _this.toActiveName = "tab2";
  841. _this.activeName = "tab2";
  842. }
  843. } else if (duration != "" && parseInt(freezeTime) > parseInt(duration)) {
  844. callback(new Error("交卷冻结时长不能大于考试时长"));
  845. if (!_this.toActiveName) {
  846. _this.toActiveName = "tab2";
  847. _this.activeName = "tab2";
  848. }
  849. } else {
  850. callback();
  851. }
  852. };
  853. let validateExamReconnectTime = (rule, value, callback) => {
  854. let examReconnectTime = _this.form.properties.EXAM_RECONNECT_TIME;
  855. if (examReconnectTime === "") {
  856. callback(new Error("请输入断点续考时间"));
  857. if (!_this.toActiveName) {
  858. _this.toActiveName = "tab2";
  859. _this.activeName = "tab2";
  860. }
  861. } else if (!examReconnectTime.toString().match(/^[1-9]\d*$/)) {
  862. callback(new Error("只能是正整数"));
  863. if (!_this.toActiveName) {
  864. _this.toActiveName = "tab2";
  865. _this.activeName = "tab2";
  866. }
  867. } else {
  868. callback();
  869. }
  870. };
  871. let validateMaxInterruptNum = (rule, value, callback) => {
  872. let examReconnectTime = _this.form.properties.MAX_INTERRUPT_NUM;
  873. if (examReconnectTime === "") {
  874. callback();
  875. } else if (!examReconnectTime.toString().match(/^[0-9]\d*$/)) {
  876. callback(new Error("只能是非负整数"));
  877. if (!_this.toActiveName) {
  878. _this.toActiveName = "tab2";
  879. _this.activeName = "tab2";
  880. }
  881. } else {
  882. callback();
  883. }
  884. };
  885. let validateSnapshotInterval = (rule, value, callback) => {
  886. let isFaceEnable = _this.form.properties.IS_FACE_ENABLE;
  887. let snapshotnterval = _this.form.properties.SNAPSHOT_INTERVAL;
  888. let duration = _this.form.duration;
  889. if (isFaceEnable == "true") {
  890. if (snapshotnterval === "") {
  891. callback(new Error("请输入抓拍间隔"));
  892. if (!_this.toActiveName) {
  893. _this.toActiveName = "tab4";
  894. _this.activeName = "tab4";
  895. }
  896. } else if (!snapshotnterval.toString().match(/^[1-9]\d*$/)) {
  897. callback(new Error("只能是正整数"));
  898. if (!_this.toActiveName) {
  899. _this.toActiveName = "tab4";
  900. _this.activeName = "tab4";
  901. }
  902. } else if (
  903. duration != "" &&
  904. parseInt(snapshotnterval) > parseInt(duration)
  905. ) {
  906. callback(new Error("抓拍间隔不能大于考试时长"));
  907. if (!_this.toActiveName) {
  908. _this.toActiveName = "tab4";
  909. _this.activeName = "tab4";
  910. }
  911. } else {
  912. callback();
  913. }
  914. } else {
  915. callback();
  916. }
  917. };
  918. let validateWarnThreshold = (rule, value, callback) => {
  919. let isFaceEnable = _this.form.properties.IS_FACE_ENABLE;
  920. let warnThreshold = _this.form.properties.WARN_THRESHOLD;
  921. if (isFaceEnable == "true") {
  922. if (warnThreshold === "") {
  923. callback(new Error("请输入预警阀值"));
  924. if (!_this.toActiveName) {
  925. _this.toActiveName = "tab4";
  926. _this.activeName = "tab4";
  927. }
  928. } else if (!warnThreshold.toString().match(/^(0|([1-9]\d?)|100)$/)) {
  929. callback(new Error("只能是0到100的整数"));
  930. if (!_this.toActiveName) {
  931. _this.toActiveName = "tab4";
  932. _this.activeName = "tab4";
  933. }
  934. } else {
  935. callback();
  936. }
  937. } else {
  938. callback();
  939. }
  940. };
  941. let validateLivingWarnThreshold = (rule, value, callback) => {
  942. let isFaceEnable = _this.form.properties.IS_FACE_ENABLE;
  943. let livingWarnThreshold = _this.form.properties.LIVING_WARN_THRESHOLD;
  944. if (isFaceEnable == "true") {
  945. if (livingWarnThreshold === "") {
  946. callback(new Error("请输入真实性预警阀值"));
  947. if (!_this.toActiveName) {
  948. _this.toActiveName = "tab4";
  949. _this.activeName = "tab4";
  950. }
  951. } else if (!livingWarnThreshold.toString().match(/^(0|([1-9]\d?)|100)$/)) {
  952. callback(new Error("只能是0到100的整数"));
  953. if (!_this.toActiveName) {
  954. _this.toActiveName = "tab4";
  955. _this.activeName = "tab4";
  956. }
  957. } else {
  958. callback();
  959. }
  960. } else {
  961. callback();
  962. }
  963. };
  964. let validateFaceVerifyStartMinute = (rule, value, callback) => {
  965. let isFaceVerify = _this.form.properties.IS_FACE_VERIFY;
  966. let freezeTime = _this.form.properties.FREEZE_TIME;
  967. let v = _this.form.properties.FACE_VERIFY_START_MINUTE;
  968. if (isFaceVerify == "true") {
  969. if (v === "") {
  970. callback(new Error("请输入活体检测开始分钟数"));
  971. if (!_this.toActiveName) {
  972. _this.toActiveName = "tab4";
  973. _this.activeName = "tab4";
  974. }
  975. } else if (!v.toString().match(/^[1-9]\d*$/)) {
  976. callback(new Error("只能是正整数"));
  977. if (!_this.toActiveName) {
  978. _this.toActiveName = "tab4";
  979. _this.activeName = "tab4";
  980. }
  981. } else if (freezeTime !== "" && parseInt(v) > parseInt(freezeTime)) {
  982. callback(new Error("活体检测开始分钟数不能大于交卷冻结时长"));
  983. if (!_this.toActiveName) {
  984. _this.toActiveName = "tab4";
  985. _this.activeName = "tab4";
  986. }
  987. } else {
  988. callback();
  989. }
  990. } else {
  991. callback();
  992. }
  993. };
  994. let validateFaceVerifyEndMinute = (rule, value, callback) => {
  995. let isFaceVerify = _this.form.properties.IS_FACE_VERIFY;
  996. let freezeTime = _this.form.properties.FREEZE_TIME;
  997. let start = _this.form.properties.FACE_VERIFY_START_MINUTE;
  998. let v = _this.form.properties.FACE_VERIFY_END_MINUTE;
  999. if (isFaceVerify == "true") {
  1000. if (v === "") {
  1001. callback(new Error("请输入活体检测结束分钟数"));
  1002. if (!_this.toActiveName) {
  1003. _this.toActiveName = "tab4";
  1004. _this.activeName = "tab4";
  1005. }
  1006. } else if (!v.toString().match(/^[1-9]\d*$/)) {
  1007. callback(new Error("只能是正整数"));
  1008. if (!_this.toActiveName) {
  1009. _this.toActiveName = "tab4";
  1010. _this.activeName = "tab4";
  1011. }
  1012. } else if (start !== "" && parseInt(v) < parseInt(start)) {
  1013. callback(new Error("活体检测结束分钟数不能小于活体检测开始分钟数"));
  1014. if (!_this.toActiveName) {
  1015. _this.toActiveName = "tab4";
  1016. _this.activeName = "tab4";
  1017. }
  1018. } else if (freezeTime !== "" && parseInt(v) > parseInt(freezeTime)) {
  1019. callback(new Error("活体检测结束分钟数不能大于交卷冻结时长"));
  1020. if (!_this.toActiveName) {
  1021. _this.toActiveName = "tab4";
  1022. _this.activeName = "tab4";
  1023. }
  1024. } else {
  1025. callback();
  1026. }
  1027. } else {
  1028. callback();
  1029. }
  1030. };
  1031. let validateOutFreezeTimeFaceVerifyStartMinute = (rule, value, callback) => {
  1032. let isFaceVerify = _this.form.properties.IS_FACE_VERIFY;
  1033. let faceVerifyScheme = _this.form.IDENTIFICATION_OF_LIVING_BODY_SCHEME;
  1034. let addFaceVerifyOutFreezeTime =
  1035. _this.form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME;
  1036. let v = _this.form.properties.OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE;
  1037. let freezeTime = _this.form.properties.FREEZE_TIME;
  1038. let duration = _this.form.duration;
  1039. console.log(
  1040. "---isFaceVerify.test---" +
  1041. isFaceVerify +
  1042. "----equals---" +
  1043. (isFaceVerify == "true")
  1044. );
  1045. console.log(
  1046. "---addFaceVerifyOutFreezeTime---" +
  1047. addFaceVerifyOutFreezeTime +
  1048. "----equals---" +
  1049. (addFaceVerifyOutFreezeTime == "true")
  1050. );
  1051. console.log(
  1052. "---faceVerifyScheme---" +
  1053. faceVerifyScheme +
  1054. "----equals---" +
  1055. (faceVerifyScheme == "S2")
  1056. );
  1057. if (
  1058. isFaceVerify == "true" &&
  1059. addFaceVerifyOutFreezeTime == "true" &&
  1060. faceVerifyScheme == "S2"
  1061. ) {
  1062. if (v === "") {
  1063. callback(new Error("请输入追加活体检测开始分钟数"));
  1064. if (!_this.toActiveName) {
  1065. _this.toActiveName = "tab4";
  1066. _this.activeName = "tab4";
  1067. }
  1068. } else if (!v.toString().match(/^[1-9]\d*$/)) {
  1069. callback(new Error("追加活体检测开始分钟数只能是正整数"));
  1070. if (!_this.toActiveName) {
  1071. _this.toActiveName = "tab4";
  1072. _this.activeName = "tab4";
  1073. }
  1074. } else if (
  1075. duration != "" &&
  1076. parseInt(v) > parseInt(duration - freezeTime)
  1077. ) {
  1078. callback(
  1079. new Error("追加活体检测开始分钟数不得大于考试时长和冻结时间的差值")
  1080. );
  1081. if (!_this.toActiveName) {
  1082. _this.toActiveName = "tab4";
  1083. _this.activeName = "tab4";
  1084. }
  1085. } else {
  1086. callback();
  1087. }
  1088. } else {
  1089. callback();
  1090. }
  1091. };
  1092. let validateOutFreezeTimeFaceVerifyEndMinute = (rule, value, callback) => {
  1093. let isFaceVerify = _this.form.properties.IS_FACE_VERIFY;
  1094. let faceVerifyScheme = _this.form.IDENTIFICATION_OF_LIVING_BODY_SCHEME;
  1095. let addFaceVerifyOutFreezeTime =
  1096. _this.form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME;
  1097. let start = _this.form.properties.OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE;
  1098. let v = _this.form.properties.OUT_FREEZE_TIME_FACE_VERIFY_END_MINUTE;
  1099. let freezeTime = _this.form.properties.FREEZE_TIME;
  1100. let duration = _this.form.duration;
  1101. if (
  1102. isFaceVerify == "true" &&
  1103. addFaceVerifyOutFreezeTime == "true" &&
  1104. faceVerifyScheme == "S2"
  1105. ) {
  1106. if (v === "") {
  1107. callback(new Error("请输入追加活体检测结束分钟数"));
  1108. if (!_this.toActiveName) {
  1109. _this.toActiveName = "tab4";
  1110. _this.activeName = "tab4";
  1111. }
  1112. } else if (!v.toString().match(/^[1-9]\d*$/)) {
  1113. callback(new Error("追加活体检测结束分钟数只能是正整数"));
  1114. if (!_this.toActiveName) {
  1115. _this.toActiveName = "tab4";
  1116. _this.activeName = "tab4";
  1117. }
  1118. } else if (start !== "" && parseInt(v) < parseInt(start)) {
  1119. callback(
  1120. new Error("追加活体检测结束分钟数不能小于追加活体检测开始分钟数")
  1121. );
  1122. if (!_this.toActiveName) {
  1123. _this.toActiveName = "tab4";
  1124. _this.activeName = "tab4";
  1125. }
  1126. } else if (
  1127. duration != "" &&
  1128. parseInt(v) > parseInt(duration - freezeTime)
  1129. ) {
  1130. callback(
  1131. new Error("追加活体检测结束分钟数不得大于考试时长和冻结时间的差值")
  1132. );
  1133. if (!_this.toActiveName) {
  1134. _this.toActiveName = "tab4";
  1135. _this.activeName = "tab4";
  1136. }
  1137. } else {
  1138. callback();
  1139. }
  1140. } else {
  1141. callback();
  1142. }
  1143. };
  1144. export default {
  1145. components: {
  1146. ckeditor,
  1147. LinkTitlesCustom
  1148. },
  1149. data() {
  1150. return {
  1151. style: {
  1152. label_width_tab1: "160px",
  1153. label_width_tab2: "110px",
  1154. label_width_tab3: "120px",
  1155. label_width_tab4: "170px",
  1156. label_width_tab5: "80px",
  1157. label_width_tab6: "120px",
  1158. label_width_tab7: "150px"
  1159. },
  1160. activeName: "tab1",
  1161. toActiveName: null,
  1162. examDatetimeRange: [],
  1163. show_ckeditor: false,
  1164. is_face_verify_diabled: true,
  1165. is_face_enable_diabled: true,
  1166. rootOrgWenXinAnswerEnabled: false,
  1167. IDENTIFICATION_OF_LIVING_BODY_SCHEME: "S1",
  1168. form: {
  1169. started: false,
  1170. name: "",
  1171. code: "",
  1172. examType: "ONLINE",
  1173. examTimes: 1,
  1174. beginTime: null,
  1175. endTime: null,
  1176. duration: 120,
  1177. enable: "true",
  1178. examLimit: "false",
  1179. specialSettingsEnabled: false,
  1180. specialSettingsType: "ORG_BASED",
  1181. properties: {
  1182. IS_OBJ_SCORE_VIEW: "true",
  1183. IS_STRANGER_ENABLE: "false",
  1184. MAX_INTERRUPT_NUM: "",
  1185. EXAM_RECONNECT_TIME: 30,
  1186. FREEZE_TIME: 0,
  1187. BEFORE_EXAM_REMARK: "",
  1188. AFTER_EXAM_REMARK: "",
  1189. SHOW_CHEATING_REMARK: "true",
  1190. CHEATING_REMARK: "",
  1191. SINGLE_EDIT: "false",
  1192. MUTIPLE_EDIT: "false",
  1193. BOOL_EDIT: "false",
  1194. FILL_BLANK_EDIT: "false",
  1195. SINGLE_ANSWER_REMARK: "",
  1196. MUTIPLE_ANSWER_REMARK: "",
  1197. FILL_BLANK_REMARK: "",
  1198. BOOL_ANSWER_REMARK: "",
  1199. IS_FACE_ENABLE: "false",
  1200. IS_FACE_CHECK: "false",
  1201. SNAPSHOT_INTERVAL: 30,
  1202. WARN_THRESHOLD: 50,
  1203. MARKING_TYPE: "ALL",
  1204. IP_LIMIT: "false",
  1205. IP_ADDRESSES: null,
  1206. LIVING_WARN_THRESHOLD: 50,
  1207. IS_FACE_VERIFY: "false",
  1208. FACE_VERIFY_START_MINUTE: 5,
  1209. FACE_VERIFY_END_MINUTE: 10,
  1210. PUSH_SCORE: "false",
  1211. CHECK_ENVIRONMENT: "false",
  1212. WEIXIN_ANSWER_ENABLED: "false",
  1213. ADD_FACE_VERIFY_OUT_FREEZE_TIME: "false",
  1214. OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE: 10,
  1215. OUT_FREEZE_TIME_FACE_VERIFY_END_MINUTE: 30,
  1216. LIMITED_IF_NO_SPECIAL_SETTINGS: "false"
  1217. }
  1218. },
  1219. examTypeList: EXAM_TYPE,
  1220. examId: "",
  1221. rootOrgId: null,
  1222. rules: {
  1223. code: [{ required: true, validator: validateCode, trigger: "blur" }],
  1224. name: [{ required: true, validator: validateName, trigger: "blur" }],
  1225. examDatetimeRange: [
  1226. {
  1227. required: true,
  1228. validator: validateExamDatetimeRange,
  1229. trigger: "blur"
  1230. }
  1231. ],
  1232. duration: [
  1233. { required: true, validator: validateDuration, trigger: "blur" }
  1234. ],
  1235. examTimes: [
  1236. { required: true, validator: validateExamTimes, trigger: "blur" }
  1237. ],
  1238. FREEZE_TIME: [
  1239. { required: true, validator: validateFreezeTime, trigger: "blur" }
  1240. ],
  1241. EXAM_RECONNECT_TIME: [
  1242. {
  1243. required: true,
  1244. validator: validateExamReconnectTime,
  1245. trigger: "blur"
  1246. }
  1247. ],
  1248. MAX_INTERRUPT_NUM: [
  1249. {
  1250. required: false,
  1251. validator: validateMaxInterruptNum,
  1252. trigger: "blur"
  1253. }
  1254. ],
  1255. SNAPSHOT_INTERVAL: [
  1256. {
  1257. required: true,
  1258. validator: validateSnapshotInterval,
  1259. trigger: "blur"
  1260. }
  1261. ],
  1262. WARN_THRESHOLD: [
  1263. {
  1264. required: true,
  1265. validator: validateWarnThreshold,
  1266. trigger: "change"
  1267. }
  1268. ],
  1269. FACE_VERIFY_START_MINUTE: [
  1270. {
  1271. required: true,
  1272. validator: validateFaceVerifyStartMinute,
  1273. trigger: "blur"
  1274. }
  1275. ],
  1276. FACE_VERIFY_END_MINUTE: [
  1277. {
  1278. required: true,
  1279. validator: validateFaceVerifyEndMinute,
  1280. trigger: "blur"
  1281. }
  1282. ],
  1283. OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE: [
  1284. {
  1285. required: true,
  1286. validator: validateOutFreezeTimeFaceVerifyStartMinute,
  1287. trigger: "blur"
  1288. }
  1289. ],
  1290. OUT_FREEZE_TIME_FACE_VERIFY_END_MINUTE: [
  1291. {
  1292. required: true,
  1293. validator: validateOutFreezeTimeFaceVerifyEndMinute,
  1294. trigger: "blur"
  1295. }
  1296. ],
  1297. LIVING_WARN_THRESHOLD: [
  1298. {
  1299. required: true,
  1300. validator: validateLivingWarnThreshold,
  1301. trigger: "change"
  1302. }
  1303. ]
  1304. }
  1305. };
  1306. },
  1307. methods: {
  1308. faceEnableChange() {
  1309. if (this.form.properties.IS_FACE_ENABLE == "false") {
  1310. this.form.properties.IS_STRANGER_ENABLE = "false";
  1311. this.form.properties.IS_FACE_CHECK = "false";
  1312. this.form.properties.IS_FACE_VERIFY = "false";
  1313. this.form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME = "false";
  1314. }
  1315. },
  1316. init() {
  1317. if (this.examId != "add") {
  1318. let url = EXAM_WORK_API + "/exam/" + this.examId;
  1319. this.$httpWithMsg.get(url).then(response => {
  1320. let body = response.data;
  1321. this.rootOrgId = body.rootOrgId;
  1322. body.properties = this.form.properties;
  1323. this.form = Object.assign(this.form, response.data);
  1324. this.form.enable = this.form.enable ? "true" : "false";
  1325. this.form.examLimit = this.form.examLimit ? "true" : "false";
  1326. this.examDatetimeRange = [this.form.beginTime, this.form.endTime];
  1327. console.log("getOnlineExam(); form: ", this.form);
  1328. let url = EXAM_WORK_API + "/exam/allProperties/" + this.examId;
  1329. this.$httpWithMsg.get(url).then(response => {
  1330. this.form.properties = Object.assign(
  1331. this.form.properties,
  1332. response.data
  1333. );
  1334. this.form.properties.SINGLE_EDIT =
  1335. this.form.properties.SINGLE_EDIT === "true";
  1336. this.form.properties.MUTIPLE_EDIT =
  1337. this.form.properties.MUTIPLE_EDIT === "true";
  1338. this.form.properties.BOOL_EDIT =
  1339. this.form.properties.BOOL_EDIT === "true";
  1340. this.form.properties.FILL_BLANK_EDIT =
  1341. this.form.properties.FILL_BLANK_EDIT === "true";
  1342. this.form.properties.CHECK_ENVIRONMENT =
  1343. this.form.properties.CHECK_ENVIRONMENT === "true";
  1344. this.form.properties.WEIXIN_ANSWER_ENABLED =
  1345. this.form.properties.WEIXIN_ANSWER_ENABLED === "true";
  1346. this.form.properties.LIMITED_IF_NO_SPECIAL_SETTINGS =
  1347. this.form.properties.LIMITED_IF_NO_SPECIAL_SETTINGS === "true";
  1348. this.show_ckeditor = true;
  1349. this.checkRootOrgPrivileges();
  1350. });
  1351. });
  1352. } else {
  1353. let now = moment().format("YYYY-MM-DD HH:mm:ss");
  1354. this.examDatetimeRange = [now, now];
  1355. this.show_ckeditor = true;
  1356. this.checkRootOrgPrivileges();
  1357. }
  1358. },
  1359. checkRootOrgPrivileges: function() {
  1360. let url =
  1361. CORE_API +
  1362. "/rolePrivilege/checkRootOrgPrivileges?privilegeCodes=FACE_CHECK,IDENTIFICATION_OF_LIVING_BODY";
  1363. this.$httpWithMsg.post(url).then(response => {
  1364. let res = response.data;
  1365. if (!res.FACE_CHECK) {
  1366. this.form.properties.IS_FACE_ENABLE = "false";
  1367. this.form.properties.IS_STRANGER_ENABLE = "false";
  1368. this.form.properties.IS_FACE_CHECK = "false";
  1369. this.form.properties.IS_FACE_VERIFY = "false";
  1370. this.form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME = "false";
  1371. this.is_face_enable_diabled = true;
  1372. } else {
  1373. this.is_face_enable_diabled = false;
  1374. }
  1375. if (!res.IDENTIFICATION_OF_LIVING_BODY) {
  1376. this.is_face_verify_diabled = true;
  1377. this.form.properties.IS_FACE_VERIFY = "false";
  1378. this.form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME = "false";
  1379. } else {
  1380. this.is_face_verify_diabled = false;
  1381. }
  1382. });
  1383. let url2 =
  1384. CORE_API +
  1385. "/org/property/" +
  1386. this.user.rootOrgId +
  1387. "/WEIXIN_ANSWER_ENABLED";
  1388. this.$httpWithMsg.get(url2).then(response => {
  1389. let res = response.data;
  1390. this.rootOrgWenXinAnswerEnabled = res == true;
  1391. if (!this.rootOrgWenXinAnswerEnabled) {
  1392. this.form.properties.WEIXIN_ANSWER_ENABLED = false;
  1393. }
  1394. });
  1395. let that = this;
  1396. this.getOrgProperty("IDENTIFICATION_OF_LIVING_BODY_SCHEME", function(
  1397. res
  1398. ) {
  1399. that.form.IDENTIFICATION_OF_LIVING_BODY_SCHEME = res;
  1400. });
  1401. },
  1402. getOrgProperty: function(propkey, callback) {
  1403. let url =
  1404. CORE_API + "/org/property/" + this.user.rootOrgId + "/" + propkey;
  1405. this.$httpWithMsg.get(url).then(response => {
  1406. let res = response.data;
  1407. callback(res);
  1408. });
  1409. },
  1410. saveExam: function() {
  1411. this.toActiveName = null;
  1412. this.form.beginTime = this.examDatetimeRange[0];
  1413. this.form.endTime = this.examDatetimeRange[1];
  1414. console.log(this.form);
  1415. let url = EXAM_WORK_API + "/exam";
  1416. this.$refs.form.validate(valid => {
  1417. if (valid) {
  1418. if (this.examId != "add") {
  1419. this.$httpWithMsg.put(url, this.form).then(response => {
  1420. if (200 != response.status) {
  1421. this.$notify({
  1422. type: "error",
  1423. message: response.body.desc
  1424. });
  1425. return;
  1426. }
  1427. this.$notify({
  1428. type: "success",
  1429. message: "保存成功"
  1430. });
  1431. });
  1432. } else {
  1433. this.form.code = this.form.name;
  1434. this.$httpWithMsg.post(url, this.form).then(response => {
  1435. console.log(response);
  1436. this.$notify({
  1437. type: "success",
  1438. message: "新增成功"
  1439. });
  1440. this.examId = response.data.id;
  1441. this.form.id = this.examId;
  1442. this.$router.push({
  1443. path: "/examwork/onlineExam/" + response.data.id
  1444. });
  1445. });
  1446. }
  1447. } else {
  1448. return false;
  1449. }
  1450. });
  1451. },
  1452. back() {
  1453. this.$router.push({ path: "/examwork/examInfo" });
  1454. }
  1455. },
  1456. created() {
  1457. _this = this;
  1458. this.examId = this.$route.params.id;
  1459. this.init();
  1460. },
  1461. computed: {
  1462. ...mapState({ user: state => state.user })
  1463. }
  1464. };
  1465. </script>
  1466. <style scoped>
  1467. .input {
  1468. width: 440px;
  1469. }
  1470. .input >>> .el-input__inner {
  1471. -webkit-appearance: button;
  1472. }
  1473. </style>