|  |  |  | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <div class="box"> | 
|---|
|  |  |  | <el-form :model="form" ref="form" label-width="140px"> | 
|---|
|  |  |  | <div><span style="font-size: 15px;font-weight: bold">人员授权配置:</span></div> | 
|---|
|  |  |  | <el-form-item label="" prop="frezzDays" label-width="50px"> | 
|---|
|  |  |  | 人员门禁授权冻结:连续 | 
|---|
|  |  |  | <el-input style="width: 50px;" type="text" v-model="form.frezzDays" placeholder="" v-trim/> | 
|---|
|  |  |  | 天,无门禁/车辆闸机事件 | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <div><span style="font-size: 15px;font-weight: bold">访客配置:</span></div> | 
|---|
|  |  |  | <el-form-item label="来访预约方式:" prop="reservationWay"> | 
|---|
|  |  |  | <el-radio-group v-model="form.reservationWay"> | 
|---|
|  |  |  | <el-radio :label="0">预约免登记</el-radio> | 
|---|
|  |  |  | 
|---|
|  |  |  | <el-radio :label="1">是</el-radio> | 
|---|
|  |  |  | </el-radio-group> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="允许自选门禁组:" prop="doorsVisitRequired"> | 
|---|
|  |  |  | <el-switch | 
|---|
|  |  |  | v-model="form.doorsVisitRequired" | 
|---|
|  |  |  | active-color="#13ce66" | 
|---|
|  |  |  | inactive-color="#ff4949" | 
|---|
|  |  |  | :active-value="1" | 
|---|
|  |  |  | :inactive-value="0"> | 
|---|
|  |  |  | </el-switch> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="访客是否答题:" prop="isAnswer"> | 
|---|
|  |  |  | <el-switch | 
|---|
|  |  |  | v-model="form.isAnswer" | 
|---|
|  |  |  | 
|---|
|  |  |  | </el-switch> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="访客答题主题:" prop="theme"> | 
|---|
|  |  |  | <el-input style="width: 50%;" v-model="form.theme" placeholder="请输入答题标题" v-trim/> | 
|---|
|  |  |  | <el-input style="width: 50%;" type="textarea" v-model="form.theme" placeholder="请输入答题标题" v-trim/> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="访客答题说明:" prop="description"> | 
|---|
|  |  |  | <el-input style="width: 50%;" type="textarea" v-model="form.description" placeholder="请输入" v-trim/> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="入厂须知:" prop="visitNotice"> | 
|---|
|  |  |  | <el-tiptap style="width: 50%;" v-model="form.visitNotice" :extensions="extensions" /> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="访客预约指南:" prop="visitNotice"> | 
|---|
|  |  |  | <el-tiptap style="width: 50%;" v-model="form.visitTips" :extensions="extensions" /> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="访客入园导览图:" prop="visitNotice"> | 
|---|
|  |  |  | <el-tiptap style="width: 50%;" v-model="form.visitMap" :extensions="extensions" /> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item> | 
|---|
|  |  |  | <el-button type="primary" @click="submit">保存配置项</el-button> | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | import { getVisitConfigDTO, updateVisitConfig } from '@/api/system/common' | 
|---|
|  |  |  | import { | 
|---|
|  |  |  | // necessary extensions | 
|---|
|  |  |  | Doc, | 
|---|
|  |  |  | Text, | 
|---|
|  |  |  | Paragraph, | 
|---|
|  |  |  | Heading, | 
|---|
|  |  |  | Bold, | 
|---|
|  |  |  | Underline, | 
|---|
|  |  |  | Italic, | 
|---|
|  |  |  | Strike, | 
|---|
|  |  |  | ListItem, | 
|---|
|  |  |  | BulletList, | 
|---|
|  |  |  | OrderedList, | 
|---|
|  |  |  | Image, | 
|---|
|  |  |  | Blockquote, | 
|---|
|  |  |  | TextAlign, | 
|---|
|  |  |  | Indent, | 
|---|
|  |  |  | Table, | 
|---|
|  |  |  | TableHeader, | 
|---|
|  |  |  | TableCell, | 
|---|
|  |  |  | TableRow, | 
|---|
|  |  |  | TextColor, | 
|---|
|  |  |  | HorizontalRule | 
|---|
|  |  |  | } from 'element-tiptap' | 
|---|
|  |  |  | import { upload } from '@/api/system/common' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: 'visitorSources', | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | reservationWay: 0, | 
|---|
|  |  |  | healthCard: 0, | 
|---|
|  |  |  | isAnswer: 0, | 
|---|
|  |  |  | doorsVisitRequired: '', | 
|---|
|  |  |  | theme: '', | 
|---|
|  |  |  | description: '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | description: '', | 
|---|
|  |  |  | visitNotice: '', | 
|---|
|  |  |  | visitMap: '', | 
|---|
|  |  |  | visitTips: '', | 
|---|
|  |  |  | frezzDays: null | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | extensions: [ | 
|---|
|  |  |  | new Doc(), | 
|---|
|  |  |  | new Text(), | 
|---|
|  |  |  | new Paragraph(), | 
|---|
|  |  |  | new Heading({ level: 5 }), | 
|---|
|  |  |  | new Bold({ bubble: true }), | 
|---|
|  |  |  | new Underline({ bubble: true, menubar: false }), | 
|---|
|  |  |  | new Italic(), | 
|---|
|  |  |  | new Strike(), | 
|---|
|  |  |  | new ListItem(), | 
|---|
|  |  |  | new BulletList(), | 
|---|
|  |  |  | new OrderedList(), | 
|---|
|  |  |  | new Image({ | 
|---|
|  |  |  | uploadRequest (file) { | 
|---|
|  |  |  | const fd = new FormData() | 
|---|
|  |  |  | fd.append('folder', 'visit/') | 
|---|
|  |  |  | fd.append('file', file) | 
|---|
|  |  |  | return upload(fd).then(res => { | 
|---|
|  |  |  | return res.url | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }), | 
|---|
|  |  |  | new Blockquote(), | 
|---|
|  |  |  | new TextAlign(), | 
|---|
|  |  |  | new Indent(), | 
|---|
|  |  |  | new Table(), | 
|---|
|  |  |  | new TableHeader(), | 
|---|
|  |  |  | new TableCell(), | 
|---|
|  |  |  | new TableRow(), | 
|---|
|  |  |  | new HorizontalRule(), | 
|---|
|  |  |  | new TextColor() | 
|---|
|  |  |  | ] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | getData () { | 
|---|
|  |  |  | getVisitConfigDTO({}) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | this.form.id = res.id | 
|---|
|  |  |  | this.form.checkVisit = res.VisitConfigParam.checkVisit | 
|---|
|  |  |  | this.form.checkVisit = res.checkVisit | 
|---|
|  |  |  | this.form.description = res.description | 
|---|
|  |  |  | this.form.healthCard = res.VisitConfigParam.healthCard | 
|---|
|  |  |  | this.form.isAnswer = res.VisitConfigParam.isAnswer | 
|---|
|  |  |  | this.form.reservationWay = res.VisitConfigParam.reservationWay | 
|---|
|  |  |  | this.form.healthCard = res.healthCard | 
|---|
|  |  |  | this.form.isAnswer = res.isAnswer | 
|---|
|  |  |  | this.form.reservationWay = res.reservationWay | 
|---|
|  |  |  | this.form.theme = res.theme | 
|---|
|  |  |  | this.form.doorsVisitRequired = res.doorsVisitRequired | 
|---|
|  |  |  | this.form.visitNotice = res.visitNotice | 
|---|
|  |  |  | this.form.visitTips = res.visitTips | 
|---|
|  |  |  | this.form.visitMap = res.visitMap | 
|---|
|  |  |  | this.form.frezzDays = res.frezzDays | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | submit () { | 
|---|
|  |  |  | updateVisitConfig({ | 
|---|
|  |  |  | VisitConfigParam: { | 
|---|
|  |  |  | isAnswer: this.form.isAnswer, | 
|---|
|  |  |  | healthCard: this.form.healthCard, | 
|---|
|  |  |  | checkVisit: this.form.checkVisit, | 
|---|
|  |  |  | reservationWay: this.form.reservationWay | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | isAnswer: this.form.isAnswer, | 
|---|
|  |  |  | healthCard: this.form.healthCard, | 
|---|
|  |  |  | checkVisit: this.form.checkVisit, | 
|---|
|  |  |  | reservationWay: this.form.reservationWay, | 
|---|
|  |  |  | description: this.form.description, | 
|---|
|  |  |  | theme: this.form.theme | 
|---|
|  |  |  | theme: this.form.theme, | 
|---|
|  |  |  | visitNotice: this.form.visitNotice, | 
|---|
|  |  |  | visitTips: this.form.visitTips, | 
|---|
|  |  |  | frezzDays: this.form.frezzDays, | 
|---|
|  |  |  | visitMap: this.form.visitMap, | 
|---|
|  |  |  | doorsVisitRequired: this.form.doorsVisitRequired | 
|---|
|  |  |  | }).then(res => { | 
|---|
|  |  |  | this.$message.success('保存成功') | 
|---|
|  |  |  | this.getData() | 
|---|
|  |  |  | 
|---|
|  |  |  | <style lang="scss" scoped> | 
|---|
|  |  |  | .box { | 
|---|
|  |  |  | width: 100%; | 
|---|
|  |  |  | height: 100%; | 
|---|
|  |  |  | padding: 30px; | 
|---|
|  |  |  | box-sizing: border-box; | 
|---|
|  |  |  | background: #ffffff; | 
|---|