12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193 |
- <template>
- <div>
- <LinkTitlesCustom
- :currentPaths="['考试管理', '考试信息', '网络考试设置']"
- />
- <section class="content">
- <div class="box box-info">
- <!-- 正文信息 -->
- <div class="box-body">
- <el-form
- :inline="true"
- :rules="rules"
- ref="form"
- :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"
- @click="back"
- icon="el-icon-arrow-left"
- >返 回</el-button
- >
- </div>
- <el-tabs type="border-card" v-model="activeName">
- <!-- 基础信息 -->
- <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
- class="input"
- :disabled="true"
- v-model="form.examType"
- 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
- class="input"
- v-model="examDatetimeRange"
- 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-tab-pane>
- <!-- 控制设置 -->
- <el-tab-pane label="控制设置" name="tab2">
- <el-row>
- <el-form-item
- label="考试时长"
- prop="duration"
- :label-width="style.label_width_tab2"
- >
- <el-input
- maxlength="5"
- v-model.trim.number="form.duration"
- 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
- maxlength="5"
- v-model.trim.number="form.examTimes"
- 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
- maxlength="5"
- v-model.trim.number="form.properties.FREEZE_TIME"
- 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
- maxlength="5"
- v-model.trim.number="form.properties.EXAM_RECONNECT_TIME"
- 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
- maxlength="5"
- v-model.trim.number="form.properties.MAX_INTERRUPT_NUM"
- 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"
- ></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"
- ></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"
- ></ckeditor>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- label="单选题补充说明"
- :label-width="style.label_width_tab3"
- >
- <el-input
- maxlength="20"
- :disabled="!form.properties.SINGLE_EDIT"
- v-model="form.properties.SINGLE_ANSWER_REMARK"
- 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
- maxlength="20"
- :disabled="!form.properties.MUTIPLE_EDIT"
- v-model="form.properties.MUTIPLE_ANSWER_REMARK"
- 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
- maxlength="20"
- :disabled="!form.properties.BOOL_EDIT"
- v-model="form.properties.BOOL_ANSWER_REMARK"
- 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
- maxlength="20"
- :disabled="!form.properties.FILL_BLANK_EDIT"
- v-model="form.properties.FILL_BLANK_REMARK"
- 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
- @change="faceEnableChange"
- v-model="form.properties.IS_FACE_ENABLE"
- :disabled="this.is_face_enable_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>
- <el-form-item
- label="启用陌生人检测"
- prop="IS_STRANGER_ENABLE"
- :label-width="style.label_width_tab4"
- v-show="form.properties.IS_FACE_ENABLE == 'true'"
- >
- <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="抓拍间隔"
- prop="SNAPSHOT_INTERVAL"
- :label-width="style.label_width_tab4"
- >
- <el-input
- maxlength="5"
- v-model.trim.number="form.properties.SNAPSHOT_INTERVAL"
- 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
- maxlength="5"
- v-model="form.properties.WARN_THRESHOLD"
- 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
- maxlength="5"
- v-model="form.properties.LIVING_WARN_THRESHOLD"
- 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="开启人脸活体检测"
- :label-width="style.label_width_tab4"
- >
- <el-radio-group
- v-model="form.properties.IS_FACE_VERIFY"
- :disabled="this.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-show="form.properties.IS_FACE_VERIFY == 'true'">
- <el-form-item
- label="人脸活体检测开始时间"
- prop="FACE_VERIFY_START_MINUTE"
- :label-width="style.label_width_tab4"
- >
- <el-input
- maxlength="5"
- v-model.trim.number="
- form.properties.FACE_VERIFY_START_MINUTE
- "
- auto-complete="off"
- class="input"
- >
- <template slot="append"
- >分钟</template
- >
- </el-input>
- </el-form-item>
- </el-row>
- <el-row v-show="form.properties.IS_FACE_VERIFY == 'true'">
- <el-form-item
- label="人脸活体检测结束时间"
- prop="FACE_VERIFY_END_MINUTE"
- :label-width="style.label_width_tab4"
- >
- <el-input
- maxlength="5"
- v-model.trim.number="
- form.properties.FACE_VERIFY_END_MINUTE
- "
- 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
- :disabled="form.started"
- v-model="form.properties.MARKING_TYPE"
- 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
- maxlength="2000"
- v-model="form.properties.IP_ADDRESSES"
- 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 { 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 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 {
- 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();
- }
- };
- export default {
- components: {
- ckeditor,
- LinkTitlesCustom
- },
- data() {
- return {
- style: {
- label_width_tab1: "100px",
- label_width_tab2: "110px",
- label_width_tab3: "120px",
- label_width_tab4: "170px",
- label_width_tab5: "80px",
- label_width_tab6: "120px",
- label_width_tab7: "150px"
- },
- activeName: "tab1",
- toActiveName: null,
- examDatetimeRange: [],
- show_ckeditor: false,
- is_face_verify_diabled: true,
- is_face_enable_diabled: true,
- form: {
- started: false,
- name: "",
- code: "",
- examType: "ONLINE",
- examTimes: 1,
- beginTime: null,
- endTime: null,
- duration: 120,
- enable: "true",
- examLimit: "false",
- 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",
- FACE_VERIFY_START_MINUTE: 5,
- FACE_VERIFY_END_MINUTE: 10,
- PUSH_SCORE: "false",
- CHECK_ENVIRONMENT: "false"
- }
- },
- examTypeList: EXAM_TYPE,
- examId: "",
- 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"
- }
- ],
- LIVING_WARN_THRESHOLD: [
- {
- required: true,
- validator: validateLivingWarnThreshold,
- trigger: "change"
- }
- ]
- }
- };
- },
- methods: {
- 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";
- }
- },
- init() {
- if (this.examId != "add") {
- let url = EXAM_WORK_API + "/exam/" + this.examId;
- this.$httpWithMsg.get(url).then(response => {
- let body = response.data;
- 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.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.is_face_enable_diabled = true;
- } else {
- this.is_face_enable_diabled = false;
- }
- if (!res.IDENTIFICATION_OF_LIVING_BODY) {
- this.is_face_verify_diabled = true;
- this.form.properties.IS_FACE_VERIFY = "false";
- } else {
- this.is_face_verify_diabled = false;
- }
- });
- },
- saveExam: function() {
- this.toActiveName = null;
- this.form.beginTime = this.examDatetimeRange[0];
- this.form.endTime = this.examDatetimeRange[1];
- 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" });
- }
- },
- created() {
- _this = this;
- this.examId = this.$route.params.id;
- this.init();
- }
- };
- </script>
- <style scoped>
- .input {
- width: 440px;
- }
- .input >>> .el-input__inner {
- -webkit-appearance: button;
- }
- </style>
|