onlineExam.vue 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744
  1. <template>
  2. <div>
  3. <LinkTitlesCustom
  4. :current-paths="['考试管理', '考试信息', '网络考试设置']"
  5. />
  6. <section class="content">
  7. <div class="box box-info">
  8. <!-- 正文信息 -->
  9. <div class="box-body">
  10. <el-form
  11. ref="form"
  12. :inline="true"
  13. :rules="rules"
  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. icon="el-icon-arrow-left"
  26. @click="back"
  27. >返 回</el-button
  28. >
  29. </div>
  30. <el-tabs v-model="activeName" type="border-card">
  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. v-model="form.examType"
  98. class="input"
  99. :disabled="true"
  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. v-model="examDatetimeRange"
  141. class="input"
  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. v-model="form.properties.WEIXIN_ANSWER_ENABLED"
  170. :disabled="!rootOrgWenXinAnswerEnabled"
  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. v-show="form.specialSettingsEnabled"
  191. label="特殊设置方式"
  192. :label-width="style.label_width_tab1"
  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="STAGE_BASED">场次特殊设置</el-radio>
  200. </el-radio-group>
  201. </el-form-item>
  202. </el-row>
  203. <el-row>
  204. <el-form-item
  205. v-show="form.specialSettingsEnabled"
  206. label="无特殊设置时禁止考试"
  207. :label-width="style.label_width_tab1"
  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-row v-if="APP_ENABLED">
  217. <el-form-item
  218. label="开启手机app考试"
  219. :label-width="style.label_width_tab1"
  220. >
  221. <el-switch
  222. v-model="form.properties.APP_EXAM_ENABLED"
  223. on-text="是"
  224. off-text="否"
  225. @change="appExamEnabledChanged"
  226. ></el-switch>
  227. </el-form-item>
  228. <span
  229. style="color: #f56c6c; font-size: 12px; line-height: 44px"
  230. >开启手机app考试,将不能开启人脸身份检测</span
  231. >
  232. </el-row>
  233. <el-row>
  234. <el-form-item
  235. label="开启IP访问设置"
  236. :label-width="style.label_width_tab1"
  237. >
  238. <el-switch
  239. v-model="form.properties.IP_LIMIT"
  240. on-text="是"
  241. off-text="否"
  242. ></el-switch>
  243. </el-form-item>
  244. </el-row>
  245. </el-tab-pane>
  246. <!-- 周期设置 -->
  247. <el-tab-pane label="周期设置" name="tab8">
  248. <el-row>
  249. <el-form-item
  250. label="是否开启周期设置"
  251. :label-width="style.label_width_tab4"
  252. >
  253. <el-radio-group
  254. v-model="form.properties.EXAM_CYCLE_ENABLED"
  255. class="input"
  256. @change="examCycleEnabledChange"
  257. >
  258. <el-radio label="true">开启</el-radio>
  259. <el-radio label="false">不开启</el-radio>
  260. </el-radio-group></el-form-item
  261. >
  262. </el-row>
  263. <el-row v-if="form.properties.EXAM_CYCLE_ENABLED == 'true'">
  264. <el-form-item
  265. label="日期循环设置"
  266. prop="examCycleWeekArr"
  267. :label-width="style.label_width_tab4"
  268. >
  269. <el-checkbox-group
  270. v-model="examCycleWeekArr"
  271. style="width: 680px; display: -webkit-inline-box"
  272. >
  273. <el-checkbox :label="1">星期一</el-checkbox>
  274. <el-checkbox :label="2">星期二</el-checkbox>
  275. <el-checkbox :label="3">星期三</el-checkbox>
  276. <el-checkbox :label="4">星期四</el-checkbox>
  277. <el-checkbox :label="5">星期五</el-checkbox>
  278. <el-checkbox :label="6">星期六</el-checkbox>
  279. <el-checkbox :label="7">星期日</el-checkbox>
  280. </el-checkbox-group></el-form-item
  281. >
  282. </el-row>
  283. <template v-if="form.properties.EXAM_CYCLE_ENABLED == 'true'">
  284. <el-row>
  285. <el-col :span="14">
  286. <el-form-item
  287. label="时间分段设置"
  288. :label-width="style.label_width_tab4"
  289. prop="examCycleTimeRangeArr"
  290. >
  291. </el-form-item>
  292. </el-col>
  293. <el-col :span="10" style="line-height: 48px; height: 40px">
  294. <i
  295. class="el-icon-circle-plus"
  296. style="color: #00a4ff; font-size: 24px"
  297. @click="addCycleTimeRange"
  298. ></i>
  299. </el-col>
  300. </el-row>
  301. <el-row
  302. v-for="(item, index) in examCycleTimeRangeArr"
  303. :key="'tr' + index"
  304. >
  305. <el-col :span="14">
  306. <el-form-item
  307. :label-width="style.label_width_tab4"
  308. :label="index + 1 + '.'"
  309. >
  310. <el-time-picker
  311. v-model="item.timeRange"
  312. class="input"
  313. style="width: 100%"
  314. is-range
  315. start-placeholder="开始时间"
  316. range-separator="至"
  317. end-placeholder="结束时间"
  318. format="HH:mm"
  319. value-format="HH:mm"
  320. :clearable="false"
  321. size="small"
  322. ></el-time-picker>
  323. </el-form-item>
  324. </el-col>
  325. <el-col :span="10" style="line-height: 48px; height: 40px">
  326. <i
  327. class="el-icon-remove"
  328. style="color: #00a4ff; font-size: 24px"
  329. @click="removeExamCycleTimeRange(index)"
  330. ></i>
  331. </el-col>
  332. </el-row>
  333. </template>
  334. </el-tab-pane>
  335. <!-- 控制设置 -->
  336. <el-tab-pane label="控制设置" name="tab2">
  337. <el-row>
  338. <el-form-item
  339. label="考试时长"
  340. prop="duration"
  341. :label-width="style.label_width_tab2"
  342. >
  343. <el-input
  344. v-model.trim.number="form.duration"
  345. maxlength="5"
  346. auto-complete="off"
  347. class="input"
  348. >
  349. <template slot="append">分钟</template>
  350. </el-input>
  351. </el-form-item>
  352. </el-row>
  353. <el-row>
  354. <el-form-item
  355. label="考试次数"
  356. prop="examTimes"
  357. :label-width="style.label_width_tab2"
  358. >
  359. <el-input
  360. v-model.trim.number="form.examTimes"
  361. maxlength="5"
  362. auto-complete="off"
  363. class="input"
  364. >
  365. <template slot="append">次</template>
  366. </el-input>
  367. </el-form-item>
  368. </el-row>
  369. <el-row>
  370. <el-form-item
  371. label="交卷冻结时间"
  372. prop="FREEZE_TIME"
  373. :label-width="style.label_width_tab2"
  374. >
  375. <el-input
  376. v-model.trim.number="form.properties.FREEZE_TIME"
  377. maxlength="5"
  378. auto-complete="off"
  379. class="input"
  380. >
  381. <template slot="append">分钟</template>
  382. </el-input>
  383. </el-form-item>
  384. </el-row>
  385. <el-row>
  386. <el-form-item
  387. label="断点续考时间"
  388. prop="EXAM_RECONNECT_TIME"
  389. :label-width="style.label_width_tab2"
  390. >
  391. <el-input
  392. v-model.trim.number="form.properties.EXAM_RECONNECT_TIME"
  393. maxlength="5"
  394. auto-complete="off"
  395. class="input"
  396. >
  397. <template slot="append">分钟</template>
  398. </el-input>
  399. </el-form-item>
  400. </el-row>
  401. <el-row>
  402. <el-form-item
  403. label="断点续考次数"
  404. prop="MAX_INTERRUPT_NUM"
  405. :label-width="style.label_width_tab2"
  406. >
  407. <el-input
  408. v-model.trim.number="form.properties.MAX_INTERRUPT_NUM"
  409. maxlength="5"
  410. auto-complete="off"
  411. class="input"
  412. >
  413. <template slot="append">次</template>
  414. </el-input>
  415. </el-form-item>
  416. </el-row>
  417. </el-tab-pane>
  418. <el-tab-pane label="显示设置" name="tab3">
  419. <el-row>
  420. <el-form-item
  421. label="考生承诺书"
  422. :label-width="style.label_width_tab3"
  423. >
  424. <el-radio-group
  425. v-model="form.properties.SHOW_UNDERTAKING"
  426. class="input"
  427. >
  428. <el-radio label="true">开启</el-radio>
  429. <el-radio label="false">关闭</el-radio>
  430. </el-radio-group>
  431. </el-form-item>
  432. </el-row>
  433. <el-row v-if="show_ckeditor">
  434. <el-form-item
  435. label="承诺书说明"
  436. :label-width="style.label_width_tab3"
  437. >
  438. <ckeditor
  439. v-model="form.properties.UNDERTAKING"
  440. extrabuttons="Font,FontSize,TextColor"
  441. ></ckeditor>
  442. </el-form-item>
  443. </el-row>
  444. <el-row v-if="show_ckeditor">
  445. <el-form-item
  446. label="考前说明"
  447. :label-width="style.label_width_tab3"
  448. >
  449. <ckeditor
  450. v-model="form.properties.BEFORE_EXAM_REMARK"
  451. extrabuttons="Font,FontSize,TextColor"
  452. ></ckeditor>
  453. </el-form-item>
  454. </el-row>
  455. <el-row v-if="show_ckeditor">
  456. <el-form-item
  457. label="考后说明"
  458. :label-width="style.label_width_tab3"
  459. >
  460. <ckeditor
  461. v-model="form.properties.AFTER_EXAM_REMARK"
  462. extrabuttons="Font,FontSize,TextColor"
  463. ></ckeditor>
  464. </el-form-item>
  465. </el-row>
  466. <el-row>
  467. <el-form-item
  468. label="展示作弊说明"
  469. :label-width="style.label_width_tab3"
  470. >
  471. <el-radio-group
  472. v-model="form.properties.SHOW_CHEATING_REMARK"
  473. class="input"
  474. >
  475. <el-radio label="true">开启</el-radio>
  476. <el-radio label="false">关闭</el-radio>
  477. </el-radio-group>
  478. </el-form-item>
  479. </el-row>
  480. <el-row v-if="show_ckeditor">
  481. <el-form-item
  482. label="作弊说明"
  483. :label-width="style.label_width_tab3"
  484. >
  485. <ckeditor
  486. v-model="form.properties.CHEATING_REMARK"
  487. extrabuttons="Font,FontSize,TextColor"
  488. ></ckeditor>
  489. </el-form-item>
  490. </el-row>
  491. <el-row>
  492. <el-form-item
  493. label="单选题补充说明"
  494. :label-width="style.label_width_tab3"
  495. >
  496. <el-input
  497. v-model="form.properties.SINGLE_ANSWER_REMARK"
  498. maxlength="20"
  499. :disabled="!form.properties.SINGLE_EDIT"
  500. auto-complete="off"
  501. class="input"
  502. ></el-input>
  503. </el-form-item>
  504. <el-form-item label>
  505. <el-switch
  506. v-model="form.properties.SINGLE_EDIT"
  507. on-text="启用"
  508. off-text="禁用"
  509. ></el-switch>
  510. </el-form-item>
  511. </el-row>
  512. <el-row>
  513. <el-form-item
  514. label="多选题补充说明"
  515. :label-width="style.label_width_tab3"
  516. >
  517. <el-input
  518. v-model="form.properties.MUTIPLE_ANSWER_REMARK"
  519. maxlength="20"
  520. :disabled="!form.properties.MUTIPLE_EDIT"
  521. auto-complete="off"
  522. class="input"
  523. ></el-input>
  524. </el-form-item>
  525. <el-form-item label>
  526. <el-switch
  527. v-model="form.properties.MUTIPLE_EDIT"
  528. on-text="启用"
  529. off-text="禁用"
  530. ></el-switch>
  531. </el-form-item>
  532. </el-row>
  533. <el-row>
  534. <el-form-item
  535. label="判断题补充说明"
  536. :label-width="style.label_width_tab3"
  537. >
  538. <el-input
  539. v-model="form.properties.BOOL_ANSWER_REMARK"
  540. maxlength="20"
  541. :disabled="!form.properties.BOOL_EDIT"
  542. class="input"
  543. auto-complete="off"
  544. ></el-input>
  545. </el-form-item>
  546. <el-form-item label>
  547. <el-switch
  548. v-model="form.properties.BOOL_EDIT"
  549. on-text="启用"
  550. off-text="禁用"
  551. ></el-switch>
  552. </el-form-item>
  553. </el-row>
  554. <el-row>
  555. <el-form-item
  556. label="填空题补充说明"
  557. :label-width="style.label_width_tab3"
  558. >
  559. <el-input
  560. v-model="form.properties.FILL_BLANK_REMARK"
  561. maxlength="20"
  562. :disabled="!form.properties.FILL_BLANK_EDIT"
  563. class="input"
  564. auto-complete="off"
  565. ></el-input>
  566. </el-form-item>
  567. <el-form-item label>
  568. <el-switch
  569. v-model="form.properties.FILL_BLANK_EDIT"
  570. on-text="启用"
  571. off-text="禁用"
  572. ></el-switch>
  573. </el-form-item>
  574. </el-row>
  575. <el-row>
  576. <el-form-item
  577. label="客观题成绩显示"
  578. :label-width="style.label_width_tab3"
  579. >
  580. <el-radio-group
  581. v-model="form.properties.IS_OBJ_SCORE_VIEW"
  582. class="input"
  583. >
  584. <el-radio label="true">开启</el-radio>
  585. <el-radio label="false">关闭</el-radio>
  586. </el-radio-group>
  587. </el-form-item>
  588. </el-row>
  589. </el-tab-pane>
  590. <el-tab-pane label="身份检测设置" name="tab4">
  591. <el-row>
  592. <el-form-item
  593. label="开启身份检测"
  594. :label-width="style.label_width_tab4"
  595. >
  596. <el-radio-group
  597. v-model="form.properties.IS_FACE_ENABLE"
  598. :disabled="
  599. is_face_enable_disabled ||
  600. form.properties.APP_EXAM_ENABLED == true
  601. "
  602. class="input"
  603. @change="faceEnableChange"
  604. >
  605. <el-radio label="true">是</el-radio>
  606. <el-radio label="false">否</el-radio>
  607. </el-radio-group>
  608. </el-form-item>
  609. </el-row>
  610. <el-row>
  611. <el-form-item
  612. v-show="form.properties.IS_FACE_ENABLE == 'true'"
  613. label="启用陌生人检测"
  614. prop="IS_STRANGER_ENABLE"
  615. :label-width="style.label_width_tab4"
  616. >
  617. <el-radio-group
  618. v-model="form.properties.IS_STRANGER_ENABLE"
  619. class="input"
  620. >
  621. <el-radio label="true">是</el-radio>
  622. <el-radio label="false">否</el-radio>
  623. </el-radio-group>
  624. </el-form-item>
  625. </el-row>
  626. <el-row v-show="form.properties.IS_FACE_ENABLE == 'true'">
  627. <el-form-item
  628. label="考试强制使用"
  629. :label-width="style.label_width_tab4"
  630. >
  631. <el-radio-group
  632. v-model="form.properties.IS_FACE_CHECK"
  633. class="input"
  634. >
  635. <el-radio label="true">强制</el-radio>
  636. <el-radio label="false">非强制</el-radio>
  637. </el-radio-group>
  638. </el-form-item>
  639. </el-row>
  640. <el-row v-show="form.properties.IS_FACE_ENABLE == 'true'">
  641. <el-form-item
  642. label="虚拟设备审核"
  643. :label-width="style.label_width_tab4"
  644. >
  645. <el-radio-group
  646. v-model="form.properties.VIRTUAL_CAMERA_AUDIT_ENABLED"
  647. class="input"
  648. >
  649. <el-radio label="true">是</el-radio>
  650. <el-radio label="false">否</el-radio>
  651. </el-radio-group>
  652. </el-form-item>
  653. </el-row>
  654. <el-row v-show="form.properties.IS_FACE_ENABLE == 'true'">
  655. <el-form-item
  656. label="抓拍间隔"
  657. prop="SNAPSHOT_INTERVAL"
  658. :label-width="style.label_width_tab4"
  659. >
  660. <el-input
  661. v-model.trim.number="form.properties.SNAPSHOT_INTERVAL"
  662. maxlength="5"
  663. auto-complete="off"
  664. class="input"
  665. >
  666. <template slot="append">分钟</template>
  667. </el-input>
  668. </el-form-item>
  669. </el-row>
  670. <el-row v-show="form.properties.IS_FACE_ENABLE == 'true'">
  671. <el-form-item
  672. label="预警阀值"
  673. prop="WARN_THRESHOLD"
  674. :label-width="style.label_width_tab4"
  675. >
  676. <el-input
  677. v-model="form.properties.WARN_THRESHOLD"
  678. maxlength="5"
  679. auto-complete="off"
  680. class="input"
  681. >
  682. <template slot="append">%</template>
  683. </el-input>
  684. </el-form-item>
  685. </el-row>
  686. <el-row v-show="form.properties.IS_FACE_ENABLE == 'true'">
  687. <el-form-item
  688. label="真实性预警阀值"
  689. prop="LIVING_WARN_THRESHOLD"
  690. :label-width="style.label_width_tab4"
  691. >
  692. <el-input
  693. v-model="form.properties.LIVING_WARN_THRESHOLD"
  694. maxlength="5"
  695. auto-complete="off"
  696. class="input"
  697. >
  698. <template slot="append">%</template>
  699. </el-input>
  700. </el-form-item>
  701. </el-row>
  702. <el-row
  703. v-if="
  704. form.properties.APP_EXAM_ENABLED == false &&
  705. form.properties.IS_FACE_ENABLE == 'true'
  706. "
  707. >
  708. <el-form-item
  709. label="开启人脸活体检测"
  710. :label-width="style.label_width_tab4"
  711. >
  712. <el-radio-group
  713. v-model="form.properties.IS_FACE_VERIFY"
  714. :disabled="is_face_verify_diabled"
  715. class="input"
  716. >
  717. <el-radio label="true">是</el-radio>
  718. <el-radio label="false">否</el-radio>
  719. </el-radio-group>
  720. </el-form-item>
  721. </el-row>
  722. <el-row
  723. v-if="
  724. form.properties.APP_EXAM_ENABLED == false &&
  725. form.properties.IS_FACE_VERIFY == 'true'
  726. "
  727. >
  728. <el-form-item
  729. label="人脸活体检测开始时间"
  730. prop="FACE_VERIFY_START_MINUTE"
  731. :label-width="style.label_width_tab4"
  732. >
  733. <el-input
  734. v-model.trim.number="
  735. form.properties.FACE_VERIFY_START_MINUTE
  736. "
  737. maxlength="5"
  738. auto-complete="off"
  739. class="input"
  740. >
  741. <template slot="append">分钟</template>
  742. </el-input>
  743. </el-form-item>
  744. </el-row>
  745. <el-row
  746. v-if="
  747. form.properties.APP_EXAM_ENABLED == false &&
  748. form.properties.IS_FACE_VERIFY == 'true'
  749. "
  750. >
  751. <el-form-item
  752. label="人脸活体检测结束时间"
  753. prop="FACE_VERIFY_END_MINUTE"
  754. :label-width="style.label_width_tab4"
  755. >
  756. <el-input
  757. v-model.trim.number="
  758. form.properties.FACE_VERIFY_END_MINUTE
  759. "
  760. maxlength="5"
  761. auto-complete="off"
  762. class="input"
  763. >
  764. <template slot="append">分钟</template>
  765. </el-input>
  766. </el-form-item>
  767. </el-row>
  768. <el-row
  769. v-if="
  770. form.properties.APP_EXAM_ENABLED == false &&
  771. form.properties.IS_FACE_ENABLE == 'true' &&
  772. form.IDENTIFICATION_OF_LIVING_BODY_SCHEME == 'S2'
  773. "
  774. >
  775. <el-form-item
  776. label="追加人脸活体检测"
  777. :label-width="style.label_width_tab4"
  778. >
  779. <el-radio-group
  780. v-model="form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME"
  781. :disabled="form.properties.IS_FACE_VERIFY == 'false'"
  782. class="input"
  783. >
  784. <el-radio label="true">是</el-radio>
  785. <el-radio label="false">否</el-radio>
  786. </el-radio-group>
  787. </el-form-item>
  788. </el-row>
  789. <el-row
  790. v-if="
  791. form.properties.APP_EXAM_ENABLED == false &&
  792. form.IDENTIFICATION_OF_LIVING_BODY_SCHEME == 'S2' &&
  793. form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME == 'true'
  794. "
  795. >
  796. <el-form-item
  797. label="追加活检测开始时间"
  798. prop="OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE"
  799. :label-width="style.label_width_tab4"
  800. >
  801. <el-input
  802. v-model.trim.number="
  803. form.properties.OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE
  804. "
  805. maxlength="5"
  806. auto-complete="off"
  807. class="input"
  808. >
  809. <template slot="append">分钟</template>
  810. </el-input>
  811. </el-form-item>
  812. </el-row>
  813. <el-row
  814. v-if="
  815. form.properties.APP_EXAM_ENABLED == false &&
  816. form.IDENTIFICATION_OF_LIVING_BODY_SCHEME == 'S2' &&
  817. form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME == 'true'
  818. "
  819. >
  820. <el-form-item
  821. label="追加活检测结束时间"
  822. prop="OUT_FREEZE_TIME_FACE_VERIFY_END_MINUTE"
  823. :label-width="style.label_width_tab4"
  824. >
  825. <el-input
  826. v-model.trim.number="
  827. form.properties.OUT_FREEZE_TIME_FACE_VERIFY_END_MINUTE
  828. "
  829. maxlength="5"
  830. auto-complete="off"
  831. class="input"
  832. >
  833. <template slot="append">分钟</template>
  834. </el-input>
  835. </el-form-item>
  836. </el-row>
  837. </el-tab-pane>
  838. <el-tab-pane label="阅卷设置" name="tab5">
  839. <el-row>
  840. <el-form-item
  841. label="阅卷方式"
  842. :label-width="style.label_width_tab5"
  843. >
  844. <el-radio-group
  845. v-model="form.properties.MARKING_TYPE"
  846. :disabled="form.started"
  847. class="input"
  848. >
  849. <el-radio label="ALL">全部评阅</el-radio>
  850. <el-radio label="OBJECT_SCORE_MAX">客观分最高</el-radio>
  851. <el-radio label="LAST_SUBMIT">最后一次提交</el-radio>
  852. </el-radio-group>
  853. </el-form-item>
  854. </el-row>
  855. </el-tab-pane>
  856. <el-tab-pane label="其它" name="tab7">
  857. <el-row>
  858. <el-form-item
  859. label="是否推送成绩"
  860. :label-width="style.label_width_tab7"
  861. >
  862. <el-radio-group v-model="form.properties.PUSH_SCORE">
  863. <el-radio label="true">是</el-radio>
  864. <el-radio label="false">否</el-radio>
  865. </el-radio-group>
  866. </el-form-item>
  867. </el-row>
  868. </el-tab-pane>
  869. </el-tabs>
  870. </el-form>
  871. </div>
  872. </div>
  873. </section>
  874. </div>
  875. </template>
  876. <script>
  877. import { mapState } from "vuex";
  878. import { EXAM_TYPE, EXAM_WORK_API, CORE_API } from "@/constants/constants.js";
  879. import moment from "moment";
  880. import ckeditor from "@/components/ckeditor.vue";
  881. import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
  882. let _this = null;
  883. let validateExamCycleTimeRange = (rule, value, callback) => {
  884. if (_this.examCycleTimeRangeArr.length == 0) {
  885. callback(new Error("请至少设置一个时间段"));
  886. } else {
  887. callback();
  888. }
  889. };
  890. let validateExamCycleWeek = (rule, value, callback) => {
  891. if (_this.examCycleWeekArr.length == 0) {
  892. callback(new Error("请至少勾选一个日期"));
  893. } else {
  894. callback();
  895. }
  896. };
  897. let validateCode = (rule, value, callback) => {
  898. if (_this.examId == "add") {
  899. _this.form.code = _this.form.name;
  900. }
  901. let code = _this.form.code;
  902. if (code == "") {
  903. callback(new Error("请输入考试编码"));
  904. if (!_this.toActiveName) {
  905. _this.toActiveName = "tab1";
  906. _this.activeName = "tab1";
  907. }
  908. } else {
  909. callback();
  910. }
  911. };
  912. let validateName = (rule, value, callback) => {
  913. let name = _this.form.name;
  914. if (name == "") {
  915. callback(new Error("请输入考试名称"));
  916. if (!_this.toActiveName) {
  917. _this.toActiveName = "tab1";
  918. _this.activeName = "tab1";
  919. }
  920. } else {
  921. callback();
  922. }
  923. };
  924. let validateExamDatetimeRange = (rule, value, callback) => {
  925. let examDatetimeRange = _this.examDatetimeRange;
  926. if (!examDatetimeRange) {
  927. callback(new Error("请输入考试时间"));
  928. if (!_this.toActiveName) {
  929. _this.toActiveName = "tab1";
  930. _this.activeName = "tab1";
  931. }
  932. } else {
  933. callback();
  934. }
  935. };
  936. let validateDuration = (rule, value, callback) => {
  937. let duration = _this.form.duration;
  938. if (duration === "") {
  939. callback(new Error("请输入考试时长"));
  940. if (!_this.toActiveName) {
  941. _this.toActiveName = "tab2";
  942. _this.activeName = "tab2";
  943. }
  944. } else if (!duration.toString().match(/^[1-9]\d*|0$/)) {
  945. callback(new Error("只能是非负整数"));
  946. if (!_this.toActiveName) {
  947. _this.toActiveName = "tab2";
  948. _this.activeName = "tab2";
  949. }
  950. } else {
  951. callback();
  952. }
  953. };
  954. let validateExamTimes = (rule, value, callback) => {
  955. let examTimes = _this.form.examTimes;
  956. if (examTimes === "") {
  957. callback(new Error("请输入考试次数"));
  958. if (!_this.toActiveName) {
  959. _this.toActiveName = "tab2";
  960. _this.activeName = "tab2";
  961. }
  962. } else if (!examTimes.toString().match(/^[1-9]\d*$/)) {
  963. callback(new Error("只能是正整数"));
  964. if (!_this.toActiveName) {
  965. _this.toActiveName = "tab2";
  966. _this.activeName = "tab2";
  967. }
  968. } else {
  969. callback();
  970. }
  971. };
  972. let validateFreezeTime = (rule, value, callback) => {
  973. let freezeTime = _this.form.properties.FREEZE_TIME;
  974. let duration = _this.form.duration;
  975. if (freezeTime === "") {
  976. callback(new Error("请输入交卷冻结时长"));
  977. if (!_this.toActiveName) {
  978. _this.toActiveName = "tab2";
  979. _this.activeName = "tab2";
  980. }
  981. } else if (!freezeTime.toString().match(/^[1-9]\d*|0$/)) {
  982. callback(new Error("只能是非负整数"));
  983. if (!_this.toActiveName) {
  984. _this.toActiveName = "tab2";
  985. _this.activeName = "tab2";
  986. }
  987. } else if (duration != "" && parseInt(freezeTime) > parseInt(duration)) {
  988. callback(new Error("交卷冻结时长不能大于考试时长"));
  989. if (!_this.toActiveName) {
  990. _this.toActiveName = "tab2";
  991. _this.activeName = "tab2";
  992. }
  993. } else {
  994. callback();
  995. }
  996. };
  997. let validateExamReconnectTime = (rule, value, callback) => {
  998. let examReconnectTime = _this.form.properties.EXAM_RECONNECT_TIME;
  999. if (examReconnectTime === "") {
  1000. callback(new Error("请输入断点续考时间"));
  1001. if (!_this.toActiveName) {
  1002. _this.toActiveName = "tab2";
  1003. _this.activeName = "tab2";
  1004. }
  1005. } else if (!examReconnectTime.toString().match(/^[1-9]\d*$/)) {
  1006. callback(new Error("只能是正整数"));
  1007. if (!_this.toActiveName) {
  1008. _this.toActiveName = "tab2";
  1009. _this.activeName = "tab2";
  1010. }
  1011. } else if (examReconnectTime < 3) {
  1012. callback(new Error("最小设置值为3"));
  1013. if (!_this.toActiveName) {
  1014. _this.toActiveName = "tab2";
  1015. _this.activeName = "tab2";
  1016. }
  1017. } else {
  1018. callback();
  1019. }
  1020. };
  1021. let validateMaxInterruptNum = (rule, value, callback) => {
  1022. let examReconnectTime = _this.form.properties.MAX_INTERRUPT_NUM;
  1023. if (examReconnectTime === "") {
  1024. callback();
  1025. } else if (!examReconnectTime.toString().match(/^[0-9]\d*$/)) {
  1026. callback(new Error("只能是非负整数"));
  1027. if (!_this.toActiveName) {
  1028. _this.toActiveName = "tab2";
  1029. _this.activeName = "tab2";
  1030. }
  1031. } else {
  1032. callback();
  1033. }
  1034. };
  1035. let validateSnapshotInterval = (rule, value, callback) => {
  1036. let isFaceEnable = _this.form.properties.IS_FACE_ENABLE;
  1037. let snapshotnterval = _this.form.properties.SNAPSHOT_INTERVAL;
  1038. let duration = _this.form.duration;
  1039. if (isFaceEnable == "true") {
  1040. if (snapshotnterval === "") {
  1041. callback(new Error("请输入抓拍间隔"));
  1042. if (!_this.toActiveName) {
  1043. _this.toActiveName = "tab4";
  1044. _this.activeName = "tab4";
  1045. }
  1046. } else if (!snapshotnterval.toString().match(/^[1-9]\d*$/)) {
  1047. callback(new Error("只能是正整数"));
  1048. if (!_this.toActiveName) {
  1049. _this.toActiveName = "tab4";
  1050. _this.activeName = "tab4";
  1051. }
  1052. } else if (
  1053. duration != "" &&
  1054. parseInt(snapshotnterval) > parseInt(duration)
  1055. ) {
  1056. callback(new Error("抓拍间隔不能大于考试时长"));
  1057. if (!_this.toActiveName) {
  1058. _this.toActiveName = "tab4";
  1059. _this.activeName = "tab4";
  1060. }
  1061. } else {
  1062. callback();
  1063. }
  1064. } else {
  1065. callback();
  1066. }
  1067. };
  1068. let validateWarnThreshold = (rule, value, callback) => {
  1069. let isFaceEnable = _this.form.properties.IS_FACE_ENABLE;
  1070. let warnThreshold = _this.form.properties.WARN_THRESHOLD;
  1071. if (isFaceEnable == "true") {
  1072. if (warnThreshold === "") {
  1073. callback(new Error("请输入预警阀值"));
  1074. if (!_this.toActiveName) {
  1075. _this.toActiveName = "tab4";
  1076. _this.activeName = "tab4";
  1077. }
  1078. } else if (!warnThreshold.toString().match(/^(0|([1-9]\d?)|100)$/)) {
  1079. callback(new Error("只能是0到100的整数"));
  1080. if (!_this.toActiveName) {
  1081. _this.toActiveName = "tab4";
  1082. _this.activeName = "tab4";
  1083. }
  1084. } else {
  1085. callback();
  1086. }
  1087. } else {
  1088. callback();
  1089. }
  1090. };
  1091. let validateLivingWarnThreshold = (rule, value, callback) => {
  1092. let isFaceEnable = _this.form.properties.IS_FACE_ENABLE;
  1093. let livingWarnThreshold = _this.form.properties.LIVING_WARN_THRESHOLD;
  1094. if (isFaceEnable == "true") {
  1095. if (livingWarnThreshold === "") {
  1096. callback(new Error("请输入真实性预警阀值"));
  1097. if (!_this.toActiveName) {
  1098. _this.toActiveName = "tab4";
  1099. _this.activeName = "tab4";
  1100. }
  1101. } else if (!livingWarnThreshold.toString().match(/^(0|([1-9]\d?)|100)$/)) {
  1102. callback(new Error("只能是0到100的整数"));
  1103. if (!_this.toActiveName) {
  1104. _this.toActiveName = "tab4";
  1105. _this.activeName = "tab4";
  1106. }
  1107. } else {
  1108. callback();
  1109. }
  1110. } else {
  1111. callback();
  1112. }
  1113. };
  1114. let validateFaceVerifyStartMinute = (rule, value, callback) => {
  1115. let isFaceVerify = _this.form.properties.IS_FACE_VERIFY;
  1116. let freezeTime = _this.form.properties.FREEZE_TIME;
  1117. let v = _this.form.properties.FACE_VERIFY_START_MINUTE;
  1118. if (isFaceVerify == "true") {
  1119. if (v === "") {
  1120. callback(new Error("请输入活体检测开始分钟数"));
  1121. if (!_this.toActiveName) {
  1122. _this.toActiveName = "tab4";
  1123. _this.activeName = "tab4";
  1124. }
  1125. } else if (!v.toString().match(/^[1-9]\d*$/)) {
  1126. callback(new Error("只能是正整数"));
  1127. if (!_this.toActiveName) {
  1128. _this.toActiveName = "tab4";
  1129. _this.activeName = "tab4";
  1130. }
  1131. } else if (freezeTime !== "" && parseInt(v) > parseInt(freezeTime)) {
  1132. callback(new Error("活体检测开始分钟数不能大于交卷冻结时长"));
  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. let validateFaceVerifyEndMinute = (rule, value, callback) => {
  1145. let isFaceVerify = _this.form.properties.IS_FACE_VERIFY;
  1146. let freezeTime = _this.form.properties.FREEZE_TIME;
  1147. let start = _this.form.properties.FACE_VERIFY_START_MINUTE;
  1148. let v = _this.form.properties.FACE_VERIFY_END_MINUTE;
  1149. if (isFaceVerify == "true") {
  1150. if (v === "") {
  1151. callback(new Error("请输入活体检测结束分钟数"));
  1152. if (!_this.toActiveName) {
  1153. _this.toActiveName = "tab4";
  1154. _this.activeName = "tab4";
  1155. }
  1156. } else if (!v.toString().match(/^[1-9]\d*$/)) {
  1157. callback(new Error("只能是正整数"));
  1158. if (!_this.toActiveName) {
  1159. _this.toActiveName = "tab4";
  1160. _this.activeName = "tab4";
  1161. }
  1162. } else if (start !== "" && parseInt(v) < parseInt(start)) {
  1163. callback(new Error("活体检测结束分钟数不能小于活体检测开始分钟数"));
  1164. if (!_this.toActiveName) {
  1165. _this.toActiveName = "tab4";
  1166. _this.activeName = "tab4";
  1167. }
  1168. } else if (freezeTime !== "" && parseInt(v) > parseInt(freezeTime)) {
  1169. callback(new Error("活体检测结束分钟数不能大于交卷冻结时长"));
  1170. if (!_this.toActiveName) {
  1171. _this.toActiveName = "tab4";
  1172. _this.activeName = "tab4";
  1173. }
  1174. } else {
  1175. callback();
  1176. }
  1177. } else {
  1178. callback();
  1179. }
  1180. };
  1181. let validateOutFreezeTimeFaceVerifyStartMinute = (rule, value, callback) => {
  1182. let isFaceVerify = _this.form.properties.IS_FACE_VERIFY;
  1183. let faceVerifyScheme = _this.form.IDENTIFICATION_OF_LIVING_BODY_SCHEME;
  1184. let addFaceVerifyOutFreezeTime =
  1185. _this.form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME;
  1186. let v = _this.form.properties.OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE;
  1187. let freezeTime = _this.form.properties.FREEZE_TIME;
  1188. let duration = _this.form.duration;
  1189. if (
  1190. isFaceVerify == "true" &&
  1191. addFaceVerifyOutFreezeTime == "true" &&
  1192. faceVerifyScheme == "S2"
  1193. ) {
  1194. if (v === "") {
  1195. callback(new Error("请输入追加活体检测开始分钟数"));
  1196. if (!_this.toActiveName) {
  1197. _this.toActiveName = "tab4";
  1198. _this.activeName = "tab4";
  1199. }
  1200. } else if (!v.toString().match(/^[1-9]\d*$/)) {
  1201. callback(new Error("追加活体检测开始分钟数只能是正整数"));
  1202. if (!_this.toActiveName) {
  1203. _this.toActiveName = "tab4";
  1204. _this.activeName = "tab4";
  1205. }
  1206. } else if (
  1207. duration != "" &&
  1208. parseInt(v) > parseInt(duration - freezeTime)
  1209. ) {
  1210. callback(
  1211. new Error("追加活体检测开始分钟数不得大于考试时长和冻结时间的差值")
  1212. );
  1213. if (!_this.toActiveName) {
  1214. _this.toActiveName = "tab4";
  1215. _this.activeName = "tab4";
  1216. }
  1217. } else {
  1218. callback();
  1219. }
  1220. } else {
  1221. callback();
  1222. }
  1223. };
  1224. let validateOutFreezeTimeFaceVerifyEndMinute = (rule, value, callback) => {
  1225. let isFaceVerify = _this.form.properties.IS_FACE_VERIFY;
  1226. let faceVerifyScheme = _this.form.IDENTIFICATION_OF_LIVING_BODY_SCHEME;
  1227. let addFaceVerifyOutFreezeTime =
  1228. _this.form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME;
  1229. let start = _this.form.properties.OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE;
  1230. let v = _this.form.properties.OUT_FREEZE_TIME_FACE_VERIFY_END_MINUTE;
  1231. let freezeTime = _this.form.properties.FREEZE_TIME;
  1232. let duration = _this.form.duration;
  1233. if (
  1234. isFaceVerify == "true" &&
  1235. addFaceVerifyOutFreezeTime == "true" &&
  1236. faceVerifyScheme == "S2"
  1237. ) {
  1238. if (v === "") {
  1239. callback(new Error("请输入追加活体检测结束分钟数"));
  1240. if (!_this.toActiveName) {
  1241. _this.toActiveName = "tab4";
  1242. _this.activeName = "tab4";
  1243. }
  1244. } else if (!v.toString().match(/^[1-9]\d*$/)) {
  1245. callback(new Error("追加活体检测结束分钟数只能是正整数"));
  1246. if (!_this.toActiveName) {
  1247. _this.toActiveName = "tab4";
  1248. _this.activeName = "tab4";
  1249. }
  1250. } else if (start !== "" && parseInt(v) < parseInt(start)) {
  1251. callback(
  1252. new Error("追加活体检测结束分钟数不能小于追加活体检测开始分钟数")
  1253. );
  1254. if (!_this.toActiveName) {
  1255. _this.toActiveName = "tab4";
  1256. _this.activeName = "tab4";
  1257. }
  1258. } else if (
  1259. duration != "" &&
  1260. parseInt(v) > parseInt(duration - freezeTime)
  1261. ) {
  1262. callback(
  1263. new Error("追加活体检测结束分钟数不得大于考试时长和冻结时间的差值")
  1264. );
  1265. if (!_this.toActiveName) {
  1266. _this.toActiveName = "tab4";
  1267. _this.activeName = "tab4";
  1268. }
  1269. } else {
  1270. callback();
  1271. }
  1272. } else {
  1273. callback();
  1274. }
  1275. };
  1276. export default {
  1277. components: {
  1278. ckeditor,
  1279. LinkTitlesCustom,
  1280. },
  1281. data() {
  1282. return {
  1283. style: {
  1284. label_width_tab1: "160px",
  1285. label_width_tab2: "110px",
  1286. label_width_tab3: "120px",
  1287. label_width_tab4: "170px",
  1288. label_width_tab5: "80px",
  1289. label_width_tab6: "120px",
  1290. label_width_tab7: "150px",
  1291. },
  1292. examCycleTimeRangeArr: [],
  1293. examCycleWeekArr: [1, 2, 3, 4, 5, 6, 7],
  1294. activeName: "tab1",
  1295. toActiveName: null,
  1296. examDatetimeRange: [],
  1297. show_ckeditor: false,
  1298. is_face_verify_diabled: true,
  1299. is_face_enable_disabled: true,
  1300. rootOrgWenXinAnswerEnabled: false,
  1301. IDENTIFICATION_OF_LIVING_BODY_SCHEME: "S1",
  1302. APP_ENABLED: false,
  1303. form: {
  1304. started: false,
  1305. name: "",
  1306. code: "",
  1307. examType: "ONLINE",
  1308. examTimes: 1,
  1309. beginTime: null,
  1310. endTime: null,
  1311. duration: 120,
  1312. enable: "true",
  1313. examLimit: "false",
  1314. specialSettingsEnabled: false,
  1315. specialSettingsType: "ORG_BASED",
  1316. properties: {
  1317. IS_OBJ_SCORE_VIEW: "true",
  1318. IS_STRANGER_ENABLE: "false",
  1319. MAX_INTERRUPT_NUM: "",
  1320. EXAM_RECONNECT_TIME: 30,
  1321. FREEZE_TIME: 0,
  1322. BEFORE_EXAM_REMARK: "",
  1323. AFTER_EXAM_REMARK: "",
  1324. SHOW_CHEATING_REMARK: "true",
  1325. CHEATING_REMARK: "",
  1326. SINGLE_EDIT: "false",
  1327. MUTIPLE_EDIT: "false",
  1328. BOOL_EDIT: "false",
  1329. FILL_BLANK_EDIT: "false",
  1330. SINGLE_ANSWER_REMARK: "",
  1331. MUTIPLE_ANSWER_REMARK: "",
  1332. FILL_BLANK_REMARK: "",
  1333. BOOL_ANSWER_REMARK: "",
  1334. IS_FACE_ENABLE: "false",
  1335. IS_FACE_CHECK: "false",
  1336. SNAPSHOT_INTERVAL: 30,
  1337. WARN_THRESHOLD: 50,
  1338. MARKING_TYPE: "ALL",
  1339. IP_LIMIT: "false",
  1340. IP_ADDRESSES: null,
  1341. LIVING_WARN_THRESHOLD: 50,
  1342. IS_FACE_VERIFY: "false",
  1343. VIRTUAL_CAMERA_AUDIT_ENABLED: "false",
  1344. FACE_VERIFY_START_MINUTE: 5,
  1345. FACE_VERIFY_END_MINUTE: 10,
  1346. PUSH_SCORE: "false",
  1347. CHECK_ENVIRONMENT: "false",
  1348. WEIXIN_ANSWER_ENABLED: "false",
  1349. APP_EXAM_ENABLED: "false",
  1350. ADD_FACE_VERIFY_OUT_FREEZE_TIME: "false",
  1351. OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE: 10,
  1352. OUT_FREEZE_TIME_FACE_VERIFY_END_MINUTE: 30,
  1353. LIMITED_IF_NO_SPECIAL_SETTINGS: "false",
  1354. EXAM_CYCLE_ENABLED: "false",
  1355. EXAM_CYCLE_WEEK: "",
  1356. EXAM_CYCLE_TIME_RANGE: "",
  1357. SHOW_UNDERTAKING: "false",
  1358. UNDERTAKING: "",
  1359. },
  1360. },
  1361. examTypeList: EXAM_TYPE,
  1362. examId: "",
  1363. rootOrgId: null,
  1364. rules: {
  1365. code: [{ required: true, validator: validateCode, trigger: "blur" }],
  1366. name: [{ required: true, validator: validateName, trigger: "blur" }],
  1367. examDatetimeRange: [
  1368. {
  1369. required: true,
  1370. validator: validateExamDatetimeRange,
  1371. trigger: "blur",
  1372. },
  1373. ],
  1374. duration: [
  1375. { required: true, validator: validateDuration, trigger: "blur" },
  1376. ],
  1377. examTimes: [
  1378. { required: true, validator: validateExamTimes, trigger: "blur" },
  1379. ],
  1380. FREEZE_TIME: [
  1381. { required: true, validator: validateFreezeTime, trigger: "blur" },
  1382. ],
  1383. EXAM_RECONNECT_TIME: [
  1384. {
  1385. required: true,
  1386. validator: validateExamReconnectTime,
  1387. trigger: "blur",
  1388. },
  1389. ],
  1390. MAX_INTERRUPT_NUM: [
  1391. {
  1392. required: false,
  1393. validator: validateMaxInterruptNum,
  1394. trigger: "blur",
  1395. },
  1396. ],
  1397. SNAPSHOT_INTERVAL: [
  1398. {
  1399. required: true,
  1400. validator: validateSnapshotInterval,
  1401. trigger: "blur",
  1402. },
  1403. ],
  1404. WARN_THRESHOLD: [
  1405. {
  1406. required: true,
  1407. validator: validateWarnThreshold,
  1408. trigger: "change",
  1409. },
  1410. ],
  1411. FACE_VERIFY_START_MINUTE: [
  1412. {
  1413. required: true,
  1414. validator: validateFaceVerifyStartMinute,
  1415. trigger: "blur",
  1416. },
  1417. ],
  1418. FACE_VERIFY_END_MINUTE: [
  1419. {
  1420. required: true,
  1421. validator: validateFaceVerifyEndMinute,
  1422. trigger: "blur",
  1423. },
  1424. ],
  1425. OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE: [
  1426. {
  1427. required: true,
  1428. validator: validateOutFreezeTimeFaceVerifyStartMinute,
  1429. trigger: "blur",
  1430. },
  1431. ],
  1432. OUT_FREEZE_TIME_FACE_VERIFY_END_MINUTE: [
  1433. {
  1434. required: true,
  1435. validator: validateOutFreezeTimeFaceVerifyEndMinute,
  1436. trigger: "blur",
  1437. },
  1438. ],
  1439. LIVING_WARN_THRESHOLD: [
  1440. {
  1441. required: true,
  1442. validator: validateLivingWarnThreshold,
  1443. trigger: "change",
  1444. },
  1445. ],
  1446. examCycleWeekArr: [
  1447. {
  1448. required: true,
  1449. validator: validateExamCycleWeek,
  1450. trigger: "change",
  1451. },
  1452. ],
  1453. examCycleTimeRangeArr: [
  1454. {
  1455. required: true,
  1456. validator: validateExamCycleTimeRange,
  1457. trigger: "change",
  1458. },
  1459. ],
  1460. },
  1461. };
  1462. },
  1463. computed: {
  1464. ...mapState({ user: (state) => state.user }),
  1465. },
  1466. created() {
  1467. _this = this;
  1468. this.examId = this.$route.params.id;
  1469. this.init();
  1470. },
  1471. methods: {
  1472. examCycleEnabledChange(val) {
  1473. if (val == "true") {
  1474. this.examCycleWeekArr = [1, 2, 3, 4, 5, 6, 7];
  1475. this.addCycleTimeRange();
  1476. } else {
  1477. this.examCycleTimeRangeArr = [];
  1478. this.examCycleWeekArr = [];
  1479. }
  1480. },
  1481. getEndTimeStr() {
  1482. return "23:59";
  1483. },
  1484. getNowTimeStr() {
  1485. let now = new Date();
  1486. let hour = now.getHours();
  1487. if (hour < 10) {
  1488. hour = "0" + hour;
  1489. }
  1490. let minute = now.getMinutes();
  1491. if (minute < 10) {
  1492. minute = "0" + minute;
  1493. }
  1494. return hour + ":" + minute;
  1495. },
  1496. removeExamCycleTimeRange(index) {
  1497. if (this.examCycleTimeRangeArr.length == 1) {
  1498. this.$notify({
  1499. type: "warning",
  1500. message: "不能删除最后一个分段",
  1501. });
  1502. return;
  1503. }
  1504. this.examCycleTimeRangeArr.splice(index, 1);
  1505. this.$refs.form.validateField("examCycleTimeRangeArr");
  1506. },
  1507. addCycleTimeRange() {
  1508. if (this.examCycleTimeRangeArr.length >= 12) {
  1509. this.$notify({
  1510. type: "warning",
  1511. message: "时间分段不得超过12条",
  1512. });
  1513. return;
  1514. }
  1515. this.examCycleTimeRangeArr.push({
  1516. timeRange: [this.getNowTimeStr(), this.getEndTimeStr()],
  1517. });
  1518. this.$refs.form.validateField("examCycleTimeRangeArr");
  1519. },
  1520. faceEnableChange() {
  1521. if (this.form.properties.IS_FACE_ENABLE == "false") {
  1522. this.form.properties.IS_STRANGER_ENABLE = "false";
  1523. this.form.properties.IS_FACE_CHECK = "false";
  1524. this.form.properties.IS_FACE_VERIFY = "false";
  1525. this.form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME = "false";
  1526. }
  1527. },
  1528. init() {
  1529. if (this.examId != "add") {
  1530. let url = EXAM_WORK_API + "/exam/" + this.examId;
  1531. this.$httpWithMsg.get(url).then((response) => {
  1532. let body = response.data;
  1533. this.rootOrgId = body.rootOrgId;
  1534. body.properties = this.form.properties;
  1535. this.form = Object.assign(this.form, response.data);
  1536. this.form.enable = this.form.enable ? "true" : "false";
  1537. this.form.examLimit = this.form.examLimit ? "true" : "false";
  1538. this.examDatetimeRange = [this.form.beginTime, this.form.endTime];
  1539. console.log("getOnlineExam(); form: ", this.form);
  1540. let url = EXAM_WORK_API + "/exam/allProperties/" + this.examId;
  1541. this.$httpWithMsg.get(url).then((response) => {
  1542. this.form.properties = Object.assign(
  1543. this.form.properties,
  1544. response.data
  1545. );
  1546. this.form.properties.SINGLE_EDIT =
  1547. this.form.properties.SINGLE_EDIT === "true";
  1548. this.form.properties.MUTIPLE_EDIT =
  1549. this.form.properties.MUTIPLE_EDIT === "true";
  1550. this.form.properties.BOOL_EDIT =
  1551. this.form.properties.BOOL_EDIT === "true";
  1552. this.form.properties.FILL_BLANK_EDIT =
  1553. this.form.properties.FILL_BLANK_EDIT === "true";
  1554. this.form.properties.CHECK_ENVIRONMENT =
  1555. this.form.properties.CHECK_ENVIRONMENT === "true";
  1556. this.form.properties.WEIXIN_ANSWER_ENABLED =
  1557. this.form.properties.WEIXIN_ANSWER_ENABLED === "true";
  1558. this.form.properties.LIMITED_IF_NO_SPECIAL_SETTINGS =
  1559. this.form.properties.LIMITED_IF_NO_SPECIAL_SETTINGS === "true";
  1560. this.form.properties.APP_EXAM_ENABLED =
  1561. this.form.properties.APP_EXAM_ENABLED === "true";
  1562. this.form.properties.IP_LIMIT =
  1563. this.form.properties.IP_LIMIT === "true";
  1564. if (this.form.properties.EXAM_CYCLE_TIME_RANGE) {
  1565. this.examCycleTimeRangeArr = JSON.parse(
  1566. this.form.properties.EXAM_CYCLE_TIME_RANGE
  1567. );
  1568. }
  1569. if (this.form.properties.EXAM_CYCLE_WEEK) {
  1570. this.examCycleWeekArr = JSON.parse(
  1571. this.form.properties.EXAM_CYCLE_WEEK
  1572. );
  1573. }
  1574. this.show_ckeditor = true;
  1575. this.checkRootOrgPrivileges();
  1576. });
  1577. });
  1578. } else {
  1579. let now = moment().format("YYYY-MM-DD HH:mm:ss");
  1580. this.examDatetimeRange = [now, now];
  1581. this.show_ckeditor = true;
  1582. this.checkRootOrgPrivileges();
  1583. }
  1584. },
  1585. checkRootOrgPrivileges: function () {
  1586. let url =
  1587. CORE_API +
  1588. "/rolePrivilege/checkRootOrgPrivileges?privilegeCodes=FACE_CHECK,IDENTIFICATION_OF_LIVING_BODY";
  1589. this.$httpWithMsg.post(url).then((response) => {
  1590. let res = response.data;
  1591. if (!res.FACE_CHECK) {
  1592. this.form.properties.IS_FACE_ENABLE = "false";
  1593. this.form.properties.IS_STRANGER_ENABLE = "false";
  1594. this.form.properties.IS_FACE_CHECK = "false";
  1595. this.form.properties.IS_FACE_VERIFY = "false";
  1596. this.form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME = "false";
  1597. this.is_face_enable_disabled = true;
  1598. } else {
  1599. this.is_face_enable_disabled = false;
  1600. }
  1601. if (!res.IDENTIFICATION_OF_LIVING_BODY) {
  1602. this.is_face_verify_diabled = true;
  1603. this.form.properties.IS_FACE_VERIFY = "false";
  1604. this.form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME = "false";
  1605. } else {
  1606. this.is_face_verify_diabled = false;
  1607. }
  1608. });
  1609. let url2 =
  1610. CORE_API +
  1611. "/org/property/" +
  1612. this.user.rootOrgId +
  1613. "/WEIXIN_ANSWER_ENABLED";
  1614. this.$httpWithMsg.get(url2).then((response) => {
  1615. let res = response.data;
  1616. this.rootOrgWenXinAnswerEnabled = res == true;
  1617. if (!this.rootOrgWenXinAnswerEnabled) {
  1618. this.form.properties.WEIXIN_ANSWER_ENABLED = false;
  1619. }
  1620. });
  1621. let that = this;
  1622. this.getOrgProperty(
  1623. "IDENTIFICATION_OF_LIVING_BODY_SCHEME",
  1624. function (res) {
  1625. that.form.IDENTIFICATION_OF_LIVING_BODY_SCHEME = res;
  1626. }
  1627. );
  1628. this.getOrgProperty("APP_ENABLED", function (res) {
  1629. that.APP_ENABLED = res;
  1630. });
  1631. },
  1632. getOrgProperty: function (propkey, callback) {
  1633. let url =
  1634. CORE_API + "/org/property/" + this.user.rootOrgId + "/" + propkey;
  1635. this.$httpWithMsg.get(url).then((response) => {
  1636. let res = response.data;
  1637. callback(res);
  1638. });
  1639. },
  1640. compare: function (x, y) {
  1641. if (x < y) {
  1642. return -1;
  1643. } else if (x > y) {
  1644. return 1;
  1645. } else {
  1646. return 0;
  1647. }
  1648. },
  1649. saveExam: function () {
  1650. this.toActiveName = null;
  1651. this.form.beginTime = this.examDatetimeRange[0];
  1652. this.form.endTime = this.examDatetimeRange[1];
  1653. this.form.properties.EXAM_CYCLE_TIME_RANGE = JSON.stringify(
  1654. this.examCycleTimeRangeArr
  1655. );
  1656. this.examCycleWeekArr.sort(this.compare);
  1657. this.form.properties.EXAM_CYCLE_WEEK = JSON.stringify(
  1658. this.examCycleWeekArr
  1659. );
  1660. console.log(this.form);
  1661. let url = EXAM_WORK_API + "/exam";
  1662. this.$refs.form.validate((valid) => {
  1663. if (valid) {
  1664. if (this.examId != "add") {
  1665. this.$httpWithMsg.put(url, this.form).then((response) => {
  1666. if (200 != response.status) {
  1667. this.$notify({
  1668. type: "error",
  1669. message: response.body.desc,
  1670. });
  1671. return;
  1672. }
  1673. this.$notify({
  1674. type: "success",
  1675. message: "保存成功",
  1676. });
  1677. });
  1678. } else {
  1679. this.form.code = this.form.name;
  1680. this.$httpWithMsg.post(url, this.form).then((response) => {
  1681. console.log(response);
  1682. this.$notify({
  1683. type: "success",
  1684. message: "新增成功",
  1685. });
  1686. this.examId = response.data.id;
  1687. this.form.id = this.examId;
  1688. this.$router.push({
  1689. path: "/examwork/onlineExam/" + response.data.id,
  1690. });
  1691. });
  1692. }
  1693. } else {
  1694. return false;
  1695. }
  1696. });
  1697. },
  1698. back() {
  1699. this.$router.push({ path: "/examwork/examInfo" });
  1700. },
  1701. appExamEnabledChanged(val) {
  1702. if (val == true) {
  1703. this.form.properties.IS_FACE_ENABLE = "false";
  1704. this.faceEnableChange();
  1705. }
  1706. },
  1707. },
  1708. };
  1709. </script>
  1710. <style scoped>
  1711. .input {
  1712. width: 440px;
  1713. }
  1714. .input >>> .el-input__inner {
  1715. -webkit-appearance: button;
  1716. }
  1717. </style>