1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729 |
- <template>
- <div>
- <LinkTitlesCustom
- :current-paths="['考试管理', '考试信息', '网络考试设置']"
- />
- <section class="content">
- <div class="box box-info">
- <!-- 正文信息 -->
- <div class="box-body">
- <el-form
- ref="form"
- :inline="true"
- :rules="rules"
- :model="form"
- inline-message
- label-position="right"
- >
- <div style="margin-bottom: 10px">
- <el-button type="primary" size="small" @click="saveExam"
- >保 存</el-button
- >
- <el-button
- type="primary"
- size="small"
- icon="el-icon-arrow-left"
- @click="back"
- >返 回</el-button
- >
- </div>
- <el-tabs v-model="activeName" type="border-card">
- <!-- 基础信息 -->
- <el-tab-pane label="基础信息" name="tab1">
- <el-row v-if="examId != 'add'">
- <el-form-item
- label="ID"
- prop="id"
- :label-width="style.label_width_tab1"
- >
- <el-input
- v-model="form.id"
- class="input"
- :disabled="true"
- maxlength="20"
- ></el-input>
- </el-form-item>
- </el-row>
- <el-row v-if="examId != 'add'">
- <el-form-item
- label="考试编码"
- placeholder="请输入考试编码"
- prop="code"
- :label-width="style.label_width_tab1"
- >
- <el-input
- v-model="form.code"
- class="input"
- :disabled="true"
- maxlength="20"
- ></el-input>
- </el-form-item>
- </el-row>
- <el-row v-else>
- <el-form-item
- label="考试编码"
- placeholder="请输入考试编码"
- prop="code"
- :label-width="style.label_width_tab1"
- >
- <el-input
- v-model="form.name"
- class="input"
- :disabled="true"
- maxlength="20"
- ></el-input>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- label="考试名称"
- placeholder="请输入考试名称"
- prop="name"
- :label-width="style.label_width_tab1"
- >
- <el-input
- v-model="form.name"
- class="input"
- maxlength="20"
- ></el-input>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- label="考试类型"
- :label-width="style.label_width_tab1"
- >
- <el-select
- v-model="form.examType"
- class="input"
- :disabled="true"
- placeholder="请选择"
- >
- <el-option
- v-for="item in examTypeList"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- label="状态"
- :label-width="style.label_width_tab1"
- >
- <el-radio-group v-model="form.enable" class="input">
- <el-radio label="true">启用</el-radio>
- <el-radio label="false">禁用</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-row>
- <el-row v-if="1 == 2">
- <el-form-item
- label="是否可以考试"
- :label-width="style.label_width_tab1"
- >
- <el-radio-group v-model="form.examLimit" class="input">
- <el-radio label="true">否</el-radio>
- <el-radio label="false">是</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- label="考试时间"
- prop="examDatetimeRange"
- :label-width="style.label_width_tab1"
- >
- <el-date-picker
- v-model="examDatetimeRange"
- class="input"
- type="datetimerange"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- value-format="yyyy-MM-dd HH:mm:ss"
- :clearable="false"
- ></el-date-picker>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- label="开启环境检测"
- :label-width="style.label_width_tab1"
- >
- <el-switch
- v-model="form.properties.CHECK_ENVIRONMENT"
- on-text="是"
- off-text="否"
- ></el-switch>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- label="开放微信小程序作答"
- :label-width="style.label_width_tab1"
- >
- <el-switch
- v-model="form.properties.WEIXIN_ANSWER_ENABLED"
- :disabled="!rootOrgWenXinAnswerEnabled"
- on-text="是"
- off-text="否"
- ></el-switch>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- label="开启特殊设置"
- :label-width="style.label_width_tab1"
- >
- <el-switch
- v-model="form.specialSettingsEnabled"
- on-text="是"
- off-text="否"
- ></el-switch>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- v-show="form.specialSettingsEnabled"
- label="特殊设置方式"
- :label-width="style.label_width_tab1"
- >
- <el-radio-group
- v-model="form.specialSettingsType"
- class="input"
- >
- <el-radio label="ORG_BASED">机构特殊设置</el-radio>
- <el-radio label="STAGE_BASED">场次特殊设置</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- v-show="form.specialSettingsEnabled"
- label="无特殊设置时禁止考试"
- :label-width="style.label_width_tab1"
- >
- <el-switch
- v-model="form.properties.LIMITED_IF_NO_SPECIAL_SETTINGS"
- on-text="是"
- off-text="否"
- ></el-switch>
- </el-form-item>
- </el-row>
- <el-row v-if="APP_ENABLED">
- <el-form-item
- label="开启手机app考试"
- :label-width="style.label_width_tab1"
- >
- <el-switch
- v-model="form.properties.APP_EXAM_ENABLED"
- on-text="是"
- off-text="否"
- @change="appExamEnabledChanged"
- ></el-switch>
- </el-form-item>
- <span
- style="color: #f56c6c; font-size: 12px; line-height: 44px"
- >开启手机app考试,将不能开启人脸身份检测</span
- >
- </el-row>
- </el-tab-pane>
- <!-- 周期设置 -->
- <el-tab-pane label="周期设置" name="tab8">
- <el-row>
- <el-form-item
- label="是否开启周期设置"
- :label-width="style.label_width_tab4"
- >
- <el-radio-group
- v-model="form.properties.EXAM_CYCLE_ENABLED"
- class="input"
- @change="examCycleEnabledChange"
- >
- <el-radio label="true">开启</el-radio>
- <el-radio label="false">不开启</el-radio>
- </el-radio-group></el-form-item
- >
- </el-row>
- <el-row v-if="form.properties.EXAM_CYCLE_ENABLED == 'true'">
- <el-form-item
- label="日期循环设置"
- prop="examCycleWeekArr"
- :label-width="style.label_width_tab4"
- >
- <el-checkbox-group
- v-model="examCycleWeekArr"
- style="width: 680px; display: -webkit-inline-box"
- >
- <el-checkbox :label="1">星期一</el-checkbox>
- <el-checkbox :label="2">星期二</el-checkbox>
- <el-checkbox :label="3">星期三</el-checkbox>
- <el-checkbox :label="4">星期四</el-checkbox>
- <el-checkbox :label="5">星期五</el-checkbox>
- <el-checkbox :label="6">星期六</el-checkbox>
- <el-checkbox :label="7">星期日</el-checkbox>
- </el-checkbox-group></el-form-item
- >
- </el-row>
- <template v-if="form.properties.EXAM_CYCLE_ENABLED == 'true'">
- <el-row>
- <el-col :span="14">
- <el-form-item
- label="时间分段设置"
- :label-width="style.label_width_tab4"
- prop="examCycleTimeRangeArr"
- >
- </el-form-item>
- </el-col>
- <el-col :span="10" style="line-height: 48px; height: 40px">
- <i
- class="el-icon-circle-plus"
- style="color: #00a4ff; font-size: 24px"
- @click="addCycleTimeRange"
- ></i>
- </el-col>
- </el-row>
- <el-row
- v-for="(item, index) in examCycleTimeRangeArr"
- :key="'tr' + index"
- >
- <el-col :span="14">
- <el-form-item
- :label-width="style.label_width_tab4"
- :label="index + 1 + '.'"
- >
- <el-time-picker
- v-model="item.timeRange"
- class="input"
- style="width: 100%"
- is-range
- start-placeholder="开始时间"
- range-separator="至"
- end-placeholder="结束时间"
- format="HH:mm"
- value-format="HH:mm"
- :clearable="false"
- size="small"
- ></el-time-picker>
- </el-form-item>
- </el-col>
- <el-col :span="10" style="line-height: 48px; height: 40px">
- <i
- class="el-icon-remove"
- style="color: #00a4ff; font-size: 24px"
- @click="removeExamCycleTimeRange(index)"
- ></i>
- </el-col>
- </el-row>
- </template>
- </el-tab-pane>
- <!-- 控制设置 -->
- <el-tab-pane label="控制设置" name="tab2">
- <el-row>
- <el-form-item
- label="考试时长"
- prop="duration"
- :label-width="style.label_width_tab2"
- >
- <el-input
- v-model.trim.number="form.duration"
- maxlength="5"
- auto-complete="off"
- class="input"
- >
- <template slot="append">分钟</template>
- </el-input>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- label="考试次数"
- prop="examTimes"
- :label-width="style.label_width_tab2"
- >
- <el-input
- v-model.trim.number="form.examTimes"
- maxlength="5"
- auto-complete="off"
- class="input"
- >
- <template slot="append">次</template>
- </el-input>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- label="交卷冻结时间"
- prop="FREEZE_TIME"
- :label-width="style.label_width_tab2"
- >
- <el-input
- v-model.trim.number="form.properties.FREEZE_TIME"
- maxlength="5"
- auto-complete="off"
- class="input"
- >
- <template slot="append">分钟</template>
- </el-input>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- label="断点续考时间"
- prop="EXAM_RECONNECT_TIME"
- :label-width="style.label_width_tab2"
- >
- <el-input
- v-model.trim.number="form.properties.EXAM_RECONNECT_TIME"
- maxlength="5"
- auto-complete="off"
- class="input"
- >
- <template slot="append">分钟</template>
- </el-input>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- label="断点续考次数"
- prop="MAX_INTERRUPT_NUM"
- :label-width="style.label_width_tab2"
- >
- <el-input
- v-model.trim.number="form.properties.MAX_INTERRUPT_NUM"
- maxlength="5"
- auto-complete="off"
- class="input"
- >
- <template slot="append">次</template>
- </el-input>
- </el-form-item>
- </el-row>
- </el-tab-pane>
- <el-tab-pane label="显示设置" name="tab3">
- <el-row v-if="show_ckeditor">
- <el-form-item
- label="考前说明"
- :label-width="style.label_width_tab3"
- >
- <ckeditor
- v-model="form.properties.BEFORE_EXAM_REMARK"
- extrabuttons="Font,FontSize,TextColor"
- ></ckeditor>
- </el-form-item>
- </el-row>
- <el-row v-if="show_ckeditor">
- <el-form-item
- label="考后说明"
- :label-width="style.label_width_tab3"
- >
- <ckeditor
- v-model="form.properties.AFTER_EXAM_REMARK"
- extrabuttons="Font,FontSize,TextColor"
- ></ckeditor>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- label="展示作弊说明"
- :label-width="style.label_width_tab3"
- >
- <el-radio-group
- v-model="form.properties.SHOW_CHEATING_REMARK"
- class="input"
- >
- <el-radio label="true">开启</el-radio>
- <el-radio label="false">关闭</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-row>
- <el-row v-if="show_ckeditor">
- <el-form-item
- label="作弊说明"
- :label-width="style.label_width_tab3"
- >
- <ckeditor
- v-model="form.properties.CHEATING_REMARK"
- extrabuttons="Font,FontSize,TextColor"
- ></ckeditor>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- label="单选题补充说明"
- :label-width="style.label_width_tab3"
- >
- <el-input
- v-model="form.properties.SINGLE_ANSWER_REMARK"
- maxlength="20"
- :disabled="!form.properties.SINGLE_EDIT"
- auto-complete="off"
- class="input"
- ></el-input>
- </el-form-item>
- <el-form-item label>
- <el-switch
- v-model="form.properties.SINGLE_EDIT"
- on-text="启用"
- off-text="禁用"
- ></el-switch>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- label="多选题补充说明"
- :label-width="style.label_width_tab3"
- >
- <el-input
- v-model="form.properties.MUTIPLE_ANSWER_REMARK"
- maxlength="20"
- :disabled="!form.properties.MUTIPLE_EDIT"
- auto-complete="off"
- class="input"
- ></el-input>
- </el-form-item>
- <el-form-item label>
- <el-switch
- v-model="form.properties.MUTIPLE_EDIT"
- on-text="启用"
- off-text="禁用"
- ></el-switch>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- label="判断题补充说明"
- :label-width="style.label_width_tab3"
- >
- <el-input
- v-model="form.properties.BOOL_ANSWER_REMARK"
- maxlength="20"
- :disabled="!form.properties.BOOL_EDIT"
- class="input"
- auto-complete="off"
- ></el-input>
- </el-form-item>
- <el-form-item label>
- <el-switch
- v-model="form.properties.BOOL_EDIT"
- on-text="启用"
- off-text="禁用"
- ></el-switch>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- label="填空题补充说明"
- :label-width="style.label_width_tab3"
- >
- <el-input
- v-model="form.properties.FILL_BLANK_REMARK"
- maxlength="20"
- :disabled="!form.properties.FILL_BLANK_EDIT"
- class="input"
- auto-complete="off"
- ></el-input>
- </el-form-item>
- <el-form-item label>
- <el-switch
- v-model="form.properties.FILL_BLANK_EDIT"
- on-text="启用"
- off-text="禁用"
- ></el-switch>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- label="客观题成绩显示"
- :label-width="style.label_width_tab3"
- >
- <el-radio-group
- v-model="form.properties.IS_OBJ_SCORE_VIEW"
- class="input"
- >
- <el-radio label="true">开启</el-radio>
- <el-radio label="false">关闭</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-row>
- </el-tab-pane>
- <el-tab-pane label="身份检测设置" name="tab4">
- <el-row>
- <el-form-item
- label="开启身份检测"
- :label-width="style.label_width_tab4"
- >
- <el-radio-group
- v-model="form.properties.IS_FACE_ENABLE"
- :disabled="
- is_face_enable_disabled ||
- form.properties.APP_EXAM_ENABLED == true
- "
- class="input"
- @change="faceEnableChange"
- >
- <el-radio label="true">是</el-radio>
- <el-radio label="false">否</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- v-show="form.properties.IS_FACE_ENABLE == 'true'"
- label="启用陌生人检测"
- prop="IS_STRANGER_ENABLE"
- :label-width="style.label_width_tab4"
- >
- <el-radio-group
- v-model="form.properties.IS_STRANGER_ENABLE"
- class="input"
- >
- <el-radio label="true">是</el-radio>
- <el-radio label="false">否</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-row>
- <el-row v-show="form.properties.IS_FACE_ENABLE == 'true'">
- <el-form-item
- label="考试强制使用"
- :label-width="style.label_width_tab4"
- >
- <el-radio-group
- v-model="form.properties.IS_FACE_CHECK"
- class="input"
- >
- <el-radio label="true">强制</el-radio>
- <el-radio label="false">非强制</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-row>
- <el-row v-show="form.properties.IS_FACE_ENABLE == 'true'">
- <el-form-item
- label="虚拟设备审核"
- :label-width="style.label_width_tab4"
- >
- <el-radio-group
- v-model="form.properties.VIRTUAL_CAMERA_AUDIT_ENABLED"
- class="input"
- >
- <el-radio label="true">是</el-radio>
- <el-radio label="false">否</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-row>
- <el-row v-show="form.properties.IS_FACE_ENABLE == 'true'">
- <el-form-item
- label="抓拍间隔"
- prop="SNAPSHOT_INTERVAL"
- :label-width="style.label_width_tab4"
- >
- <el-input
- v-model.trim.number="form.properties.SNAPSHOT_INTERVAL"
- maxlength="5"
- auto-complete="off"
- class="input"
- >
- <template slot="append">分钟</template>
- </el-input>
- </el-form-item>
- </el-row>
- <el-row v-show="form.properties.IS_FACE_ENABLE == 'true'">
- <el-form-item
- label="预警阀值"
- prop="WARN_THRESHOLD"
- :label-width="style.label_width_tab4"
- >
- <el-input
- v-model="form.properties.WARN_THRESHOLD"
- maxlength="5"
- auto-complete="off"
- class="input"
- >
- <template slot="append">%</template>
- </el-input>
- </el-form-item>
- </el-row>
- <el-row v-show="form.properties.IS_FACE_ENABLE == 'true'">
- <el-form-item
- label="真实性预警阀值"
- prop="LIVING_WARN_THRESHOLD"
- :label-width="style.label_width_tab4"
- >
- <el-input
- v-model="form.properties.LIVING_WARN_THRESHOLD"
- maxlength="5"
- auto-complete="off"
- class="input"
- >
- <template slot="append">%</template>
- </el-input>
- </el-form-item>
- </el-row>
- <el-row
- v-if="
- form.properties.APP_EXAM_ENABLED == false &&
- form.properties.IS_FACE_ENABLE == 'true'
- "
- >
- <el-form-item
- label="开启人脸活体检测"
- :label-width="style.label_width_tab4"
- >
- <el-radio-group
- v-model="form.properties.IS_FACE_VERIFY"
- :disabled="is_face_verify_diabled"
- class="input"
- >
- <el-radio label="true">是</el-radio>
- <el-radio label="false">否</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-row>
- <el-row
- v-if="
- form.properties.APP_EXAM_ENABLED == false &&
- form.properties.IS_FACE_VERIFY == 'true'
- "
- >
- <el-form-item
- label="人脸活体检测开始时间"
- prop="FACE_VERIFY_START_MINUTE"
- :label-width="style.label_width_tab4"
- >
- <el-input
- v-model.trim.number="
- form.properties.FACE_VERIFY_START_MINUTE
- "
- maxlength="5"
- auto-complete="off"
- class="input"
- >
- <template slot="append">分钟</template>
- </el-input>
- </el-form-item>
- </el-row>
- <el-row
- v-if="
- form.properties.APP_EXAM_ENABLED == false &&
- form.properties.IS_FACE_VERIFY == 'true'
- "
- >
- <el-form-item
- label="人脸活体检测结束时间"
- prop="FACE_VERIFY_END_MINUTE"
- :label-width="style.label_width_tab4"
- >
- <el-input
- v-model.trim.number="
- form.properties.FACE_VERIFY_END_MINUTE
- "
- maxlength="5"
- auto-complete="off"
- class="input"
- >
- <template slot="append">分钟</template>
- </el-input>
- </el-form-item>
- </el-row>
- <el-row
- v-if="
- form.properties.APP_EXAM_ENABLED == false &&
- form.properties.IS_FACE_ENABLE == 'true' &&
- form.IDENTIFICATION_OF_LIVING_BODY_SCHEME == 'S2'
- "
- >
- <el-form-item
- label="追加人脸活体检测"
- :label-width="style.label_width_tab4"
- >
- <el-radio-group
- v-model="form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME"
- :disabled="form.properties.IS_FACE_VERIFY == 'false'"
- class="input"
- >
- <el-radio label="true">是</el-radio>
- <el-radio label="false">否</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-row>
- <el-row
- v-if="
- form.properties.APP_EXAM_ENABLED == false &&
- form.IDENTIFICATION_OF_LIVING_BODY_SCHEME == 'S2' &&
- form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME == 'true'
- "
- >
- <el-form-item
- label="追加活检测开始时间"
- prop="OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE"
- :label-width="style.label_width_tab4"
- >
- <el-input
- v-model.trim.number="
- form.properties.OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE
- "
- maxlength="5"
- auto-complete="off"
- class="input"
- >
- <template slot="append">分钟</template>
- </el-input>
- </el-form-item>
- </el-row>
- <el-row
- v-if="
- form.properties.APP_EXAM_ENABLED == false &&
- form.IDENTIFICATION_OF_LIVING_BODY_SCHEME == 'S2' &&
- form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME == 'true'
- "
- >
- <el-form-item
- label="追加活检测结束时间"
- prop="OUT_FREEZE_TIME_FACE_VERIFY_END_MINUTE"
- :label-width="style.label_width_tab4"
- >
- <el-input
- v-model.trim.number="
- form.properties.OUT_FREEZE_TIME_FACE_VERIFY_END_MINUTE
- "
- maxlength="5"
- auto-complete="off"
- class="input"
- >
- <template slot="append">分钟</template>
- </el-input>
- </el-form-item>
- </el-row>
- </el-tab-pane>
- <el-tab-pane label="阅卷设置" name="tab5">
- <el-row>
- <el-form-item
- label="阅卷方式"
- :label-width="style.label_width_tab5"
- >
- <el-radio-group
- v-model="form.properties.MARKING_TYPE"
- :disabled="form.started"
- class="input"
- >
- <el-radio label="ALL">全部评阅</el-radio>
- <el-radio label="OBJECT_SCORE_MAX">客观分最高</el-radio>
- <el-radio label="LAST_SUBMIT">最后一次提交</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-row>
- </el-tab-pane>
- <el-tab-pane label="网络设置" name="tab6">
- <el-row>
- <el-form-item
- label="IP限制"
- :label-width="style.label_width_tab6"
- >
- <el-radio-group v-model="form.properties.IP_LIMIT">
- <el-radio label="true">开启</el-radio>
- <el-radio label="false">关闭</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- label="IP段( *表示任意 )"
- :label-width="style.label_width_tab6"
- >
- <el-input
- v-model="form.properties.IP_ADDRESSES"
- maxlength="2000"
- class="input"
- type="textarea"
- rows="6"
- ></el-input>
- </el-form-item>
- </el-row>
- </el-tab-pane>
- <el-tab-pane label="其它" name="tab7">
- <el-row>
- <el-form-item
- label="是否推送成绩"
- :label-width="style.label_width_tab7"
- >
- <el-radio-group v-model="form.properties.PUSH_SCORE">
- <el-radio label="true">是</el-radio>
- <el-radio label="false">否</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-row>
- </el-tab-pane>
- </el-tabs>
- </el-form>
- </div>
- </div>
- </section>
- </div>
- </template>
- <script>
- import { mapState } from "vuex";
- import { EXAM_TYPE, EXAM_WORK_API, CORE_API } from "@/constants/constants.js";
- import moment from "moment";
- import ckeditor from "@/components/ckeditor.vue";
- import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
- let _this = null;
- let validateExamCycleTimeRange = (rule, value, callback) => {
- if (_this.examCycleTimeRangeArr.length == 0) {
- callback(new Error("请至少设置一个时间段"));
- } else {
- callback();
- }
- };
- let validateExamCycleWeek = (rule, value, callback) => {
- if (_this.examCycleWeekArr.length == 0) {
- callback(new Error("请至少勾选一个日期"));
- } else {
- callback();
- }
- };
- let validateCode = (rule, value, callback) => {
- if (_this.examId == "add") {
- _this.form.code = _this.form.name;
- }
- let code = _this.form.code;
- if (code == "") {
- callback(new Error("请输入考试编码"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab1";
- _this.activeName = "tab1";
- }
- } else {
- callback();
- }
- };
- let validateName = (rule, value, callback) => {
- let name = _this.form.name;
- if (name == "") {
- callback(new Error("请输入考试名称"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab1";
- _this.activeName = "tab1";
- }
- } else {
- callback();
- }
- };
- let validateExamDatetimeRange = (rule, value, callback) => {
- let examDatetimeRange = _this.examDatetimeRange;
- if (!examDatetimeRange) {
- callback(new Error("请输入考试时间"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab1";
- _this.activeName = "tab1";
- }
- } else {
- callback();
- }
- };
- let validateDuration = (rule, value, callback) => {
- let duration = _this.form.duration;
- if (duration === "") {
- callback(new Error("请输入考试时长"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab2";
- _this.activeName = "tab2";
- }
- } else if (!duration.toString().match(/^[1-9]\d*|0$/)) {
- callback(new Error("只能是非负整数"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab2";
- _this.activeName = "tab2";
- }
- } else {
- callback();
- }
- };
- let validateExamTimes = (rule, value, callback) => {
- let examTimes = _this.form.examTimes;
- if (examTimes === "") {
- callback(new Error("请输入考试次数"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab2";
- _this.activeName = "tab2";
- }
- } else if (!examTimes.toString().match(/^[1-9]\d*$/)) {
- callback(new Error("只能是正整数"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab2";
- _this.activeName = "tab2";
- }
- } else {
- callback();
- }
- };
- let validateFreezeTime = (rule, value, callback) => {
- let freezeTime = _this.form.properties.FREEZE_TIME;
- let duration = _this.form.duration;
- if (freezeTime === "") {
- callback(new Error("请输入交卷冻结时长"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab2";
- _this.activeName = "tab2";
- }
- } else if (!freezeTime.toString().match(/^[1-9]\d*|0$/)) {
- callback(new Error("只能是非负整数"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab2";
- _this.activeName = "tab2";
- }
- } else if (duration != "" && parseInt(freezeTime) > parseInt(duration)) {
- callback(new Error("交卷冻结时长不能大于考试时长"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab2";
- _this.activeName = "tab2";
- }
- } else {
- callback();
- }
- };
- let validateExamReconnectTime = (rule, value, callback) => {
- let examReconnectTime = _this.form.properties.EXAM_RECONNECT_TIME;
- if (examReconnectTime === "") {
- callback(new Error("请输入断点续考时间"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab2";
- _this.activeName = "tab2";
- }
- } else if (!examReconnectTime.toString().match(/^[1-9]\d*$/)) {
- callback(new Error("只能是正整数"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab2";
- _this.activeName = "tab2";
- }
- } else if (examReconnectTime < 3) {
- callback(new Error("最小设置值为3"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab2";
- _this.activeName = "tab2";
- }
- } else {
- callback();
- }
- };
- let validateMaxInterruptNum = (rule, value, callback) => {
- let examReconnectTime = _this.form.properties.MAX_INTERRUPT_NUM;
- if (examReconnectTime === "") {
- callback();
- } else if (!examReconnectTime.toString().match(/^[0-9]\d*$/)) {
- callback(new Error("只能是非负整数"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab2";
- _this.activeName = "tab2";
- }
- } else {
- callback();
- }
- };
- let validateSnapshotInterval = (rule, value, callback) => {
- let isFaceEnable = _this.form.properties.IS_FACE_ENABLE;
- let snapshotnterval = _this.form.properties.SNAPSHOT_INTERVAL;
- let duration = _this.form.duration;
- if (isFaceEnable == "true") {
- if (snapshotnterval === "") {
- callback(new Error("请输入抓拍间隔"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else if (!snapshotnterval.toString().match(/^[1-9]\d*$/)) {
- callback(new Error("只能是正整数"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else if (
- duration != "" &&
- parseInt(snapshotnterval) > parseInt(duration)
- ) {
- callback(new Error("抓拍间隔不能大于考试时长"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else {
- callback();
- }
- } else {
- callback();
- }
- };
- let validateWarnThreshold = (rule, value, callback) => {
- let isFaceEnable = _this.form.properties.IS_FACE_ENABLE;
- let warnThreshold = _this.form.properties.WARN_THRESHOLD;
- if (isFaceEnable == "true") {
- if (warnThreshold === "") {
- callback(new Error("请输入预警阀值"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else if (!warnThreshold.toString().match(/^(0|([1-9]\d?)|100)$/)) {
- callback(new Error("只能是0到100的整数"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else {
- callback();
- }
- } else {
- callback();
- }
- };
- let validateLivingWarnThreshold = (rule, value, callback) => {
- let isFaceEnable = _this.form.properties.IS_FACE_ENABLE;
- let livingWarnThreshold = _this.form.properties.LIVING_WARN_THRESHOLD;
- if (isFaceEnable == "true") {
- if (livingWarnThreshold === "") {
- callback(new Error("请输入真实性预警阀值"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else if (!livingWarnThreshold.toString().match(/^(0|([1-9]\d?)|100)$/)) {
- callback(new Error("只能是0到100的整数"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else {
- callback();
- }
- } else {
- callback();
- }
- };
- let validateFaceVerifyStartMinute = (rule, value, callback) => {
- let isFaceVerify = _this.form.properties.IS_FACE_VERIFY;
- let freezeTime = _this.form.properties.FREEZE_TIME;
- let v = _this.form.properties.FACE_VERIFY_START_MINUTE;
- if (isFaceVerify == "true") {
- if (v === "") {
- callback(new Error("请输入活体检测开始分钟数"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else if (!v.toString().match(/^[1-9]\d*$/)) {
- callback(new Error("只能是正整数"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else if (freezeTime !== "" && parseInt(v) > parseInt(freezeTime)) {
- callback(new Error("活体检测开始分钟数不能大于交卷冻结时长"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else {
- callback();
- }
- } else {
- callback();
- }
- };
- let validateFaceVerifyEndMinute = (rule, value, callback) => {
- let isFaceVerify = _this.form.properties.IS_FACE_VERIFY;
- let freezeTime = _this.form.properties.FREEZE_TIME;
- let start = _this.form.properties.FACE_VERIFY_START_MINUTE;
- let v = _this.form.properties.FACE_VERIFY_END_MINUTE;
- if (isFaceVerify == "true") {
- if (v === "") {
- callback(new Error("请输入活体检测结束分钟数"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else if (!v.toString().match(/^[1-9]\d*$/)) {
- callback(new Error("只能是正整数"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else if (start !== "" && parseInt(v) < parseInt(start)) {
- callback(new Error("活体检测结束分钟数不能小于活体检测开始分钟数"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else if (freezeTime !== "" && parseInt(v) > parseInt(freezeTime)) {
- callback(new Error("活体检测结束分钟数不能大于交卷冻结时长"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else {
- callback();
- }
- } else {
- callback();
- }
- };
- let validateOutFreezeTimeFaceVerifyStartMinute = (rule, value, callback) => {
- let isFaceVerify = _this.form.properties.IS_FACE_VERIFY;
- let faceVerifyScheme = _this.form.IDENTIFICATION_OF_LIVING_BODY_SCHEME;
- let addFaceVerifyOutFreezeTime =
- _this.form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME;
- let v = _this.form.properties.OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE;
- let freezeTime = _this.form.properties.FREEZE_TIME;
- let duration = _this.form.duration;
- if (
- isFaceVerify == "true" &&
- addFaceVerifyOutFreezeTime == "true" &&
- faceVerifyScheme == "S2"
- ) {
- if (v === "") {
- callback(new Error("请输入追加活体检测开始分钟数"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else if (!v.toString().match(/^[1-9]\d*$/)) {
- callback(new Error("追加活体检测开始分钟数只能是正整数"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else if (
- duration != "" &&
- parseInt(v) > parseInt(duration - freezeTime)
- ) {
- callback(
- new Error("追加活体检测开始分钟数不得大于考试时长和冻结时间的差值")
- );
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else {
- callback();
- }
- } else {
- callback();
- }
- };
- let validateOutFreezeTimeFaceVerifyEndMinute = (rule, value, callback) => {
- let isFaceVerify = _this.form.properties.IS_FACE_VERIFY;
- let faceVerifyScheme = _this.form.IDENTIFICATION_OF_LIVING_BODY_SCHEME;
- let addFaceVerifyOutFreezeTime =
- _this.form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME;
- let start = _this.form.properties.OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE;
- let v = _this.form.properties.OUT_FREEZE_TIME_FACE_VERIFY_END_MINUTE;
- let freezeTime = _this.form.properties.FREEZE_TIME;
- let duration = _this.form.duration;
- if (
- isFaceVerify == "true" &&
- addFaceVerifyOutFreezeTime == "true" &&
- faceVerifyScheme == "S2"
- ) {
- if (v === "") {
- callback(new Error("请输入追加活体检测结束分钟数"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else if (!v.toString().match(/^[1-9]\d*$/)) {
- callback(new Error("追加活体检测结束分钟数只能是正整数"));
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else if (start !== "" && parseInt(v) < parseInt(start)) {
- callback(
- new Error("追加活体检测结束分钟数不能小于追加活体检测开始分钟数")
- );
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else if (
- duration != "" &&
- parseInt(v) > parseInt(duration - freezeTime)
- ) {
- callback(
- new Error("追加活体检测结束分钟数不得大于考试时长和冻结时间的差值")
- );
- if (!_this.toActiveName) {
- _this.toActiveName = "tab4";
- _this.activeName = "tab4";
- }
- } else {
- callback();
- }
- } else {
- callback();
- }
- };
- export default {
- components: {
- ckeditor,
- LinkTitlesCustom,
- },
- data() {
- return {
- style: {
- label_width_tab1: "160px",
- label_width_tab2: "110px",
- label_width_tab3: "120px",
- label_width_tab4: "170px",
- label_width_tab5: "80px",
- label_width_tab6: "120px",
- label_width_tab7: "150px",
- },
- examCycleTimeRangeArr: [],
- examCycleWeekArr: [1, 2, 3, 4, 5, 6, 7],
- activeName: "tab1",
- toActiveName: null,
- examDatetimeRange: [],
- show_ckeditor: false,
- is_face_verify_diabled: true,
- is_face_enable_disabled: true,
- rootOrgWenXinAnswerEnabled: false,
- IDENTIFICATION_OF_LIVING_BODY_SCHEME: "S1",
- APP_ENABLED: false,
- form: {
- started: false,
- name: "",
- code: "",
- examType: "ONLINE",
- examTimes: 1,
- beginTime: null,
- endTime: null,
- duration: 120,
- enable: "true",
- examLimit: "false",
- specialSettingsEnabled: false,
- specialSettingsType: "ORG_BASED",
- properties: {
- IS_OBJ_SCORE_VIEW: "true",
- IS_STRANGER_ENABLE: "false",
- MAX_INTERRUPT_NUM: "",
- EXAM_RECONNECT_TIME: 30,
- FREEZE_TIME: 0,
- BEFORE_EXAM_REMARK: "",
- AFTER_EXAM_REMARK: "",
- SHOW_CHEATING_REMARK: "true",
- CHEATING_REMARK: "",
- SINGLE_EDIT: "false",
- MUTIPLE_EDIT: "false",
- BOOL_EDIT: "false",
- FILL_BLANK_EDIT: "false",
- SINGLE_ANSWER_REMARK: "",
- MUTIPLE_ANSWER_REMARK: "",
- FILL_BLANK_REMARK: "",
- BOOL_ANSWER_REMARK: "",
- IS_FACE_ENABLE: "false",
- IS_FACE_CHECK: "false",
- SNAPSHOT_INTERVAL: 30,
- WARN_THRESHOLD: 50,
- MARKING_TYPE: "ALL",
- IP_LIMIT: "false",
- IP_ADDRESSES: null,
- LIVING_WARN_THRESHOLD: 50,
- IS_FACE_VERIFY: "false",
- VIRTUAL_CAMERA_AUDIT_ENABLED: "false",
- FACE_VERIFY_START_MINUTE: 5,
- FACE_VERIFY_END_MINUTE: 10,
- PUSH_SCORE: "false",
- CHECK_ENVIRONMENT: "false",
- WEIXIN_ANSWER_ENABLED: "false",
- APP_EXAM_ENABLED: "false",
- ADD_FACE_VERIFY_OUT_FREEZE_TIME: "false",
- OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE: 10,
- OUT_FREEZE_TIME_FACE_VERIFY_END_MINUTE: 30,
- LIMITED_IF_NO_SPECIAL_SETTINGS: "false",
- EXAM_CYCLE_ENABLED: "false",
- EXAM_CYCLE_WEEK: "",
- EXAM_CYCLE_TIME_RANGE: "",
- },
- },
- examTypeList: EXAM_TYPE,
- examId: "",
- rootOrgId: null,
- rules: {
- code: [{ required: true, validator: validateCode, trigger: "blur" }],
- name: [{ required: true, validator: validateName, trigger: "blur" }],
- examDatetimeRange: [
- {
- required: true,
- validator: validateExamDatetimeRange,
- trigger: "blur",
- },
- ],
- duration: [
- { required: true, validator: validateDuration, trigger: "blur" },
- ],
- examTimes: [
- { required: true, validator: validateExamTimes, trigger: "blur" },
- ],
- FREEZE_TIME: [
- { required: true, validator: validateFreezeTime, trigger: "blur" },
- ],
- EXAM_RECONNECT_TIME: [
- {
- required: true,
- validator: validateExamReconnectTime,
- trigger: "blur",
- },
- ],
- MAX_INTERRUPT_NUM: [
- {
- required: false,
- validator: validateMaxInterruptNum,
- trigger: "blur",
- },
- ],
- SNAPSHOT_INTERVAL: [
- {
- required: true,
- validator: validateSnapshotInterval,
- trigger: "blur",
- },
- ],
- WARN_THRESHOLD: [
- {
- required: true,
- validator: validateWarnThreshold,
- trigger: "change",
- },
- ],
- FACE_VERIFY_START_MINUTE: [
- {
- required: true,
- validator: validateFaceVerifyStartMinute,
- trigger: "blur",
- },
- ],
- FACE_VERIFY_END_MINUTE: [
- {
- required: true,
- validator: validateFaceVerifyEndMinute,
- trigger: "blur",
- },
- ],
- OUT_FREEZE_TIME_FACE_VERIFY_START_MINUTE: [
- {
- required: true,
- validator: validateOutFreezeTimeFaceVerifyStartMinute,
- trigger: "blur",
- },
- ],
- OUT_FREEZE_TIME_FACE_VERIFY_END_MINUTE: [
- {
- required: true,
- validator: validateOutFreezeTimeFaceVerifyEndMinute,
- trigger: "blur",
- },
- ],
- LIVING_WARN_THRESHOLD: [
- {
- required: true,
- validator: validateLivingWarnThreshold,
- trigger: "change",
- },
- ],
- examCycleWeekArr: [
- {
- required: true,
- validator: validateExamCycleWeek,
- trigger: "change",
- },
- ],
- examCycleTimeRangeArr: [
- {
- required: true,
- validator: validateExamCycleTimeRange,
- trigger: "change",
- },
- ],
- },
- };
- },
- computed: {
- ...mapState({ user: (state) => state.user }),
- },
- created() {
- _this = this;
- this.examId = this.$route.params.id;
- this.init();
- },
- methods: {
- examCycleEnabledChange(val) {
- if (val == "true") {
- this.examCycleWeekArr = [1, 2, 3, 4, 5, 6, 7];
- this.addCycleTimeRange();
- } else {
- this.examCycleTimeRangeArr = [];
- this.examCycleWeekArr = [];
- }
- },
- getEndTimeStr() {
- return "23:59";
- },
- getNowTimeStr() {
- let now = new Date();
- let hour = now.getHours();
- if (hour.length < 10) {
- hour = "0" + hour;
- }
- let minute = now.getMinutes();
- if (minute < 10) {
- minute = "0" + minute;
- }
- return hour + ":" + minute;
- },
- removeExamCycleTimeRange(index) {
- if (this.examCycleTimeRangeArr.length == 1) {
- this.$notify({
- type: "warning",
- message: "不能删除最后一个分段",
- });
- return;
- }
- this.examCycleTimeRangeArr.splice(index, 1);
- this.$refs.form.validateField("examCycleTimeRangeArr");
- },
- addCycleTimeRange() {
- if (this.examCycleTimeRangeArr.length >= 12) {
- this.$notify({
- type: "warning",
- message: "时间分段不得超过12条",
- });
- return;
- }
- this.examCycleTimeRangeArr.push({
- timeRange: [this.getNowTimeStr(), this.getEndTimeStr()],
- });
- this.$refs.form.validateField("examCycleTimeRangeArr");
- },
- faceEnableChange() {
- if (this.form.properties.IS_FACE_ENABLE == "false") {
- this.form.properties.IS_STRANGER_ENABLE = "false";
- this.form.properties.IS_FACE_CHECK = "false";
- this.form.properties.IS_FACE_VERIFY = "false";
- this.form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME = "false";
- }
- },
- init() {
- if (this.examId != "add") {
- let url = EXAM_WORK_API + "/exam/" + this.examId;
- this.$httpWithMsg.get(url).then((response) => {
- let body = response.data;
- this.rootOrgId = body.rootOrgId;
- body.properties = this.form.properties;
- this.form = Object.assign(this.form, response.data);
- this.form.enable = this.form.enable ? "true" : "false";
- this.form.examLimit = this.form.examLimit ? "true" : "false";
- this.examDatetimeRange = [this.form.beginTime, this.form.endTime];
- console.log("getOnlineExam(); form: ", this.form);
- let url = EXAM_WORK_API + "/exam/allProperties/" + this.examId;
- this.$httpWithMsg.get(url).then((response) => {
- this.form.properties = Object.assign(
- this.form.properties,
- response.data
- );
- this.form.properties.SINGLE_EDIT =
- this.form.properties.SINGLE_EDIT === "true";
- this.form.properties.MUTIPLE_EDIT =
- this.form.properties.MUTIPLE_EDIT === "true";
- this.form.properties.BOOL_EDIT =
- this.form.properties.BOOL_EDIT === "true";
- this.form.properties.FILL_BLANK_EDIT =
- this.form.properties.FILL_BLANK_EDIT === "true";
- this.form.properties.CHECK_ENVIRONMENT =
- this.form.properties.CHECK_ENVIRONMENT === "true";
- this.form.properties.WEIXIN_ANSWER_ENABLED =
- this.form.properties.WEIXIN_ANSWER_ENABLED === "true";
- this.form.properties.LIMITED_IF_NO_SPECIAL_SETTINGS =
- this.form.properties.LIMITED_IF_NO_SPECIAL_SETTINGS === "true";
- this.form.properties.APP_EXAM_ENABLED =
- this.form.properties.APP_EXAM_ENABLED === "true";
- if (this.form.properties.EXAM_CYCLE_TIME_RANGE) {
- this.examCycleTimeRangeArr = JSON.parse(
- this.form.properties.EXAM_CYCLE_TIME_RANGE
- );
- }
- if (this.form.properties.EXAM_CYCLE_WEEK) {
- this.examCycleWeekArr = JSON.parse(
- this.form.properties.EXAM_CYCLE_WEEK
- );
- }
- this.show_ckeditor = true;
- this.checkRootOrgPrivileges();
- });
- });
- } else {
- let now = moment().format("YYYY-MM-DD HH:mm:ss");
- this.examDatetimeRange = [now, now];
- this.show_ckeditor = true;
- this.checkRootOrgPrivileges();
- }
- },
- checkRootOrgPrivileges: function () {
- let url =
- CORE_API +
- "/rolePrivilege/checkRootOrgPrivileges?privilegeCodes=FACE_CHECK,IDENTIFICATION_OF_LIVING_BODY";
- this.$httpWithMsg.post(url).then((response) => {
- let res = response.data;
- if (!res.FACE_CHECK) {
- this.form.properties.IS_FACE_ENABLE = "false";
- this.form.properties.IS_STRANGER_ENABLE = "false";
- this.form.properties.IS_FACE_CHECK = "false";
- this.form.properties.IS_FACE_VERIFY = "false";
- this.form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME = "false";
- this.is_face_enable_disabled = true;
- } else {
- this.is_face_enable_disabled = false;
- }
- if (!res.IDENTIFICATION_OF_LIVING_BODY) {
- this.is_face_verify_diabled = true;
- this.form.properties.IS_FACE_VERIFY = "false";
- this.form.properties.ADD_FACE_VERIFY_OUT_FREEZE_TIME = "false";
- } else {
- this.is_face_verify_diabled = false;
- }
- });
- let url2 =
- CORE_API +
- "/org/property/" +
- this.user.rootOrgId +
- "/WEIXIN_ANSWER_ENABLED";
- this.$httpWithMsg.get(url2).then((response) => {
- let res = response.data;
- this.rootOrgWenXinAnswerEnabled = res == true;
- if (!this.rootOrgWenXinAnswerEnabled) {
- this.form.properties.WEIXIN_ANSWER_ENABLED = false;
- }
- });
- let that = this;
- this.getOrgProperty(
- "IDENTIFICATION_OF_LIVING_BODY_SCHEME",
- function (res) {
- that.form.IDENTIFICATION_OF_LIVING_BODY_SCHEME = res;
- }
- );
- this.getOrgProperty("APP_ENABLED", function (res) {
- that.APP_ENABLED = res;
- });
- },
- getOrgProperty: function (propkey, callback) {
- let url =
- CORE_API + "/org/property/" + this.user.rootOrgId + "/" + propkey;
- this.$httpWithMsg.get(url).then((response) => {
- let res = response.data;
- callback(res);
- });
- },
- compare: function (x, y) {
- if (x < y) {
- return -1;
- } else if (x > y) {
- return 1;
- } else {
- return 0;
- }
- },
- saveExam: function () {
- this.toActiveName = null;
- this.form.beginTime = this.examDatetimeRange[0];
- this.form.endTime = this.examDatetimeRange[1];
- this.form.properties.EXAM_CYCLE_TIME_RANGE = JSON.stringify(
- this.examCycleTimeRangeArr
- );
- this.examCycleWeekArr.sort(this.compare);
- this.form.properties.EXAM_CYCLE_WEEK = JSON.stringify(
- this.examCycleWeekArr
- );
- console.log(this.form);
- let url = EXAM_WORK_API + "/exam";
- this.$refs.form.validate((valid) => {
- if (valid) {
- if (this.examId != "add") {
- this.$httpWithMsg.put(url, this.form).then((response) => {
- if (200 != response.status) {
- this.$notify({
- type: "error",
- message: response.body.desc,
- });
- return;
- }
- this.$notify({
- type: "success",
- message: "保存成功",
- });
- });
- } else {
- this.form.code = this.form.name;
- this.$httpWithMsg.post(url, this.form).then((response) => {
- console.log(response);
- this.$notify({
- type: "success",
- message: "新增成功",
- });
- this.examId = response.data.id;
- this.form.id = this.examId;
- this.$router.push({
- path: "/examwork/onlineExam/" + response.data.id,
- });
- });
- }
- } else {
- return false;
- }
- });
- },
- back() {
- this.$router.push({ path: "/examwork/examInfo" });
- },
- appExamEnabledChanged(val) {
- if (val == true) {
- this.form.properties.IS_FACE_ENABLE = "false";
- this.faceEnableChange();
- }
- },
- },
- };
- </script>
- <style scoped>
- .input {
- width: 440px;
- }
- .input >>> .el-input__inner {
- -webkit-appearance: button;
- }
- </style>
|