onlineExam.vue 65 KB

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