| ¶Ô±ÈÐÂÎļþ | 
|  |  |  | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <GlobalWindow | 
|---|
|  |  |  | :title="title" | 
|---|
|  |  |  | :visible.sync="visible" | 
|---|
|  |  |  | :confirm-working="isWorking.create" | 
|---|
|  |  |  | @confirm="confirm" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-form :model="form" ref="form" :rules="rules"> | 
|---|
|  |  |  | <el-form-item label="æ°æ®è¯´æ" prop="label" required> | 
|---|
|  |  |  | <el-input v-model="form.remark" placeholder="请è¾å
¥æ°æ®è¯´æ" v-trim/> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="æ°æ®æ ç¾" prop="label" required> | 
|---|
|  |  |  | <el-input v-model="form.label" placeholder="请è¾å
¥æ°æ®æ ç¾" v-trim/> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="æ¯å¦å¯ææ¬" prop="istext" > | 
|---|
|  |  |  | <el-switch v-model="form.istext" :active-value="true" :inactive-value="false"/> | 
|---|
|  |  |  | <span class="status-text">{{form.istext | disabledText1}}</span> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="æ°æ®å¼" prop="code" required> | 
|---|
|  |  |  | <el-input v-if="!form.istext" v-model="form.code" placeholder="请è¾å
¥æ°æ®å¼" v-trim/> | 
|---|
|  |  |  | <RichEditor v-else  :richData="form.code" :styleEditor="styleEditor" @getWangedditor="getWangedditor" :readonly="false"/> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="ç¶æ" prop="disabled" required class="form-item-status"> | 
|---|
|  |  |  | <el-switch v-model="form.disabled" :active-value="false" :inactive-value="true"/> | 
|---|
|  |  |  | <span class="status-text">{{form.disabled | disabledText}}</span> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | </el-form> | 
|---|
|  |  |  | </GlobalWindow> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | import BaseOpera from '@/components/base/BaseOpera' | 
|---|
|  |  |  | import GlobalWindow from '@/components/common/GlobalWindow' | 
|---|
|  |  |  | import RichEditor from '@/components/common/RichEditor' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: 'OperaDictDataWindow', | 
|---|
|  |  |  | extends: BaseOpera, | 
|---|
|  |  |  | components: { GlobalWindow,RichEditor }, | 
|---|
|  |  |  | data () { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | // è¡¨åæ°æ® | 
|---|
|  |  |  | styleEditor:'border: 1px solid #ccc;display: inline-block;', | 
|---|
|  |  |  | form: { | 
|---|
|  |  |  | id: null, | 
|---|
|  |  |  | dictId: null, | 
|---|
|  |  |  | code: '', | 
|---|
|  |  |  | label: '', | 
|---|
|  |  |  | disabled: false, | 
|---|
|  |  |  | istext: false, | 
|---|
|  |  |  | remark:'' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // éªè¯è§å | 
|---|
|  |  |  | rules: { | 
|---|
|  |  |  | label: [ | 
|---|
|  |  |  | { required: true, message: '请è¾å
¥æ°æ®æ ç¾' } | 
|---|
|  |  |  | ], | 
|---|
|  |  |  | code: [ | 
|---|
|  |  |  | { required: true, message: '请è¾å
¥æ°æ®å¼' } | 
|---|
|  |  |  | ] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | getWangedditor(val){ | 
|---|
|  |  |  | this.form.code =val | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @title çªå£æ é¢ | 
|---|
|  |  |  | * @dict æå±åå
¸ID | 
|---|
|  |  |  | * @target ç¼è¾çåå
¸æ°æ®å¯¹è±¡ | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | open (title, dictId, target) { | 
|---|
|  |  |  | this.title = title | 
|---|
|  |  |  | this.visible = true | 
|---|
|  |  |  | // æ°å»º | 
|---|
|  |  |  | if (target == null) { | 
|---|
|  |  |  | this.$nextTick(() => { | 
|---|
|  |  |  | this.$refs.form.resetFields() | 
|---|
|  |  |  | this.form.id = null | 
|---|
|  |  |  | this.form.dictId = dictId | 
|---|
|  |  |  | this.form.istext=false | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // ç¼è¾ | 
|---|
|  |  |  | this.$nextTick(() => { | 
|---|
|  |  |  | for (const key in this.form) { | 
|---|
|  |  |  | this.form[key] = target[key] | 
|---|
|  |  |  | this.form.dictId = dictId | 
|---|
|  |  |  | this.form.istext=false | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | created () { | 
|---|
|  |  |  | this.config({ | 
|---|
|  |  |  | api: '/system/dictData' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <style scoped lang="scss"> | 
|---|
|  |  |  | .form-item-status { | 
|---|
|  |  |  | .status-text { | 
|---|
|  |  |  | color: #999; | 
|---|
|  |  |  | margin-left: 6px; | 
|---|
|  |  |  | font-size: 13px; | 
|---|
|  |  |  | vertical-align: middle; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </style> | 
|---|