onlineExam.vue 60 KB

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