123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494 |
- <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-row>
- <el-form-item
- label="开放微信小程序作答"
- :label-width="style.label_width_tab1"
- >
- <el-switch
- :disabled="!this.rootOrgWenXinAnswerEnabled"
- v-model="form.properties.WEIXIN_ANSWER_ENABLED"
- 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
- label="特殊设置方式"
- :label-width="style.label_width_tab1"
- v-show="form.specialSettingsEnabled"
- >
- <el-radio-group
- v-model="form.specialSettingsType"
- class="input"
- >
- <el-radio label="ORG_BASED">机构特殊设置</el-radio>
- <el-radio label="STUDENT_BASED">学生特殊设置</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-row>
- <el-row>
- <el-form-item
- label="无特殊设置时禁止考试"
- :label-width="style.label_width_tab1"
- v-show="form.specialSettingsEnabled"
- >
- <el-switch
- v-model="form.properties.LIMITED_IF_NO_SPECIAL_SETTINGS"
- 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-row
- v-show="
- 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-show="
- 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
- maxlength="5"
- v-model.trim.number="
- form.properties.OUT_FREEZE_TIME_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.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
- maxlength="5"
- v-model.trim.number="
- form.properties.OUT_FREEZE_TIME_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 { 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 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();
- }
- };
- 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;
- console.log(
- "---isFaceVerify.test---" +
- isFaceVerify +
- "----equals---" +
- (isFaceVerify == "true")
- );
- console.log(
- "---addFaceVerifyOutFreezeTime---" +
- addFaceVerifyOutFreezeTime +
- "----equals---" +
- (addFaceVerifyOutFreezeTime == "true")
- );
- console.log(
- "---faceVerifyScheme---" +
- faceVerifyScheme +
- "----equals---" +
- (faceVerifyScheme == "S2")
- );
- 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"
- },
- activeName: "tab1",
- toActiveName: null,
- examDatetimeRange: [],
- show_ckeditor: false,
- is_face_verify_diabled: true,
- is_face_enable_diabled: true,
- rootOrgWenXinAnswerEnabled: false,
- IDENTIFICATION_OF_LIVING_BODY_SCHEME: "S1",
- 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",
- FACE_VERIFY_START_MINUTE: 5,
- FACE_VERIFY_END_MINUTE: 10,
- PUSH_SCORE: "false",
- CHECK_ENVIRONMENT: "false",
- WEIXIN_ANSWER_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"
- }
- },
- 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"
- }
- ]
- }
- };
- },
- 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";
- 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.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_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";
- 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;
- });
- },
- 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);
- });
- },
- 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();
- },
- computed: {
- ...mapState({ user: state => state.user })
- }
- };
- </script>
- <style scoped>
- .input {
- width: 440px;
- }
- .input >>> .el-input__inner {
- -webkit-appearance: button;
- }
- </style>
|