修改路由的授权标识

This commit is contained in:
qq787203167
2022-04-15 14:03:34 +08:00
parent 1ce2e8e0f1
commit ea000f123a
@@ -7,170 +7,179 @@
:confirmLoading="confirmLoading"> :confirmLoading="confirmLoading">
<div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}"> <div :style="{width: '100%',border: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',}">
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<a-form :form="form"> <a-form :form="form">
<a-form-item :label="$t('MenuType')" :labelCol="labelCol" :wrapperCol="wrapperCol" > <a-form-item :label="$t('MenuType')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group @change="onChangeMenuType" v-decorator="['menuType',{'initialValue':localMenuType}]"> <a-radio-group @change="onChangeMenuType" v-decorator="['menuType',{'initialValue':localMenuType}]">
<a-radio :value="0">{{$t('FirstLevelMenu')}}</a-radio> <a-radio :value="0">{{$t('FirstLevelMenu')}}</a-radio>
<a-radio :value="1">{{$t('Submenu')}}</a-radio> <a-radio :value="1">{{$t('Submenu')}}</a-radio>
<a-radio :value="2">{{$t('ButtonsPermissions')}}</a-radio> <a-radio :value="2">{{$t('ButtonsPermissions')}}</a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="menuLabel" :label="menuLabel"
hasFeedback > hasFeedback>
<a-input :placeholder="$t('enterMenuName')" v-decorator="[ 'name', validatorRules.name]" :readOnly="disableSubmit"/> <a-input :placeholder="$t('enterMenuName')" v-decorator="[ 'name', validatorRules.name]"
</a-form-item> :readOnly="disableSubmit"/>
</a-form-item>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('MenuEnName')" :label="$t('MenuEnName')"
hasFeedback > hasFeedback>
<a-input :placeholder="$t('enterMenuEnName')" v-decorator="[ 'menuEn', validatorRules.menuEn]" :readOnly="disableSubmit"/> <a-input :placeholder="$t('enterMenuEnName')" v-decorator="[ 'menuEn', validatorRules.menuEn]"
</a-form-item> :readOnly="disableSubmit"/>
</a-form-item>
<a-form-item <a-form-item
v-show="localMenuType!=0" v-show="localMenuType!=0"
:label="$t('SuperiorMenu')" :label="$t('SuperiorMenu')"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:validate-status="validateStatus" :validate-status="validateStatus"
:hasFeedback="true" :hasFeedback="true"
:required="true"> :required="true">
<span slot="help">{{ validateStatus=='error'? $t('selectSuperiorMenu'):'&nbsp;&nbsp;' }}</span> <span slot="help">{{ validateStatus=='error'? $t('selectSuperiorMenu'):'&nbsp;&nbsp;' }}</span>
<a-tree-select <a-tree-select
style="width:100%" style="width:100%"
:dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }" :dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }"
:treeData="treeData" :treeData="treeData"
v-model="model.parentId" v-model="model.parentId"
:placeholder="$t('selectParentMenu')" :placeholder="$t('selectParentMenu')"
:disabled="disableSubmit" :disabled="disableSubmit"
@change="handleParentIdChange"> @change="handleParentIdChange">
</a-tree-select> </a-tree-select>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('MenuPath')"> :label="$t('MenuPath')">
<a-input :placeholder="$t('enterMenuPath')" v-decorator="[ 'url',validatorRules.url]" :readOnly="disableSubmit"/> <a-input :placeholder="$t('enterMenuPath')" v-decorator="[ 'url',validatorRules.url]"
</a-form-item> :readOnly="disableSubmit"/>
</a-form-item>
<a-form-item <a-form-item
v-show="show" v-show="show"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('FrontAssembly')"> :label="$t('FrontAssembly')">
<a-input :placeholder="$t('enterFrontComponents')" v-decorator="[ 'component',validatorRules.component]" :readOnly="disableSubmit"/> <a-input :placeholder="$t('enterFrontComponents')" v-decorator="[ 'component',validatorRules.component]"
</a-form-item> :readOnly="disableSubmit"/>
</a-form-item>
<a-form-item <a-form-item
v-show="localMenuType==0" v-show="localMenuType==0"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('DefaultJumpAddress')"> :label="$t('DefaultJumpAddress')">
<a-input :placeholder="$t('enterRoutingParameters')+' redirect'" v-decorator="[ 'redirect',{}]" :readOnly="disableSubmit"/> <a-input :placeholder="$t('enterRoutingParameters')+' redirect'" v-decorator="[ 'redirect',{}]"
</a-form-item> :readOnly="disableSubmit"/>
</a-form-item>
<!-- v-show="!show"-->
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
:label="$t('AuthorizationID')">
<a-input :placeholder="$t('enterAuthorizationID')+' user:list'"
v-decorator="[ 'perms', {rules:[{ required: false, message: $t('PleaseEnterAuthorizationID') },{validator: this.validatePerms }]}]"
:readOnly="disableSubmit"/>
</a-form-item>
<a-form-item <a-form-item
v-show="!show" v-show="!show"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('AuthorizationID')"> :label="$t('AuthorizationPolicy')">
<a-input :placeholder="$t('enterAuthorizationID')+' user:list'" v-decorator="[ 'perms', {rules:[{ required: false, message: $t('PleaseEnterAuthorizationID') },{validator: this.validatePerms }]}]" :readOnly="disableSubmit"/> <j-dict-select-tag v-decorator="['permsType', {}]" :placeholder="$t('selectAuthorizationPolicy')"
</a-form-item> :type="'radio'" :triggerChange="true" dictCode="global_perms_type"/>
<a-form-item
v-show="!show"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
:label="$t('AuthorizationPolicy')">
<j-dict-select-tag v-decorator="['permsType', {}]" :placeholder="$t('selectAuthorizationPolicy')" :type="'radio'" :triggerChange="true" dictCode="global_perms_type"/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
v-show="!show" v-show="!show"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('status')"> :label="$t('status')">
<j-dict-select-tag v-decorator="['status', {}]" :placeholder="$t('selectStatus')" :type="'radio'" :triggerChange="true" dictCode="valid_status"/> <j-dict-select-tag v-decorator="['status', {}]" :placeholder="$t('selectStatus')" :type="'radio'"
:triggerChange="true" dictCode="valid_status"/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
v-show="show" v-show="show"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('MenuIcon')"> :label="$t('MenuIcon')">
<a-input :placeholder="$t('ClickSelectIcon')" v-model="model.icon" :readOnly="disableSubmit"> <a-input :placeholder="$t('ClickSelectIcon')" v-model="model.icon" :readOnly="disableSubmit">
<a-icon slot="addonAfter" type="setting" @click="selectIcons" /> <a-icon slot="addonAfter" type="setting" @click="selectIcons"/>
</a-input> </a-input>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
v-show="show" v-show="show"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('sort')"> :label="$t('sort')">
<a-input-number :placeholder="$t('enterMenuSort')" style="width: 200px" v-decorator="[ 'sortNo',validatorRules.sortNo]" :readOnly="disableSubmit"/> <a-input-number :placeholder="$t('enterMenuSort')" style="width: 200px"
</a-form-item> v-decorator="[ 'sortNo',validatorRules.sortNo]" :readOnly="disableSubmit"/>
</a-form-item>
<a-form-item <a-form-item
v-show="show" v-show="show"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('RouteMenu')"> :label="$t('RouteMenu')">
<a-switch :checkedChildren="$t('yes')" :unCheckedChildren="$t('not')" v-model="routeSwitch"/> <a-switch :checkedChildren="$t('yes')" :unCheckedChildren="$t('not')" v-model="routeSwitch"/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
v-show="show" v-show="show"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('HideRoute')"> :label="$t('HideRoute')">
<a-switch :checkedChildren="$t('yes')" :unCheckedChildren="$t('not')" v-model="menuHidden"/> <a-switch :checkedChildren="$t('yes')" :unCheckedChildren="$t('not')" v-model="menuHidden"/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
v-show="show" v-show="show"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('CacheRoute')"> :label="$t('CacheRoute')">
<a-switch :checkedChildren="$t('yes')" :unCheckedChildren="$t('not')" v-model="isKeepalive"/> <a-switch :checkedChildren="$t('yes')" :unCheckedChildren="$t('not')" v-model="isKeepalive"/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
v-show="show" v-show="show"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('AggregateRouting')"> :label="$t('AggregateRouting')">
<a-switch :checkedChildren="$t('yes')" :unCheckedChildren="$t('not')" v-model="alwaysShow"/> <a-switch :checkedChildren="$t('yes')" :unCheckedChildren="$t('not')" v-model="alwaysShow"/>
</a-form-item> </a-form-item>
<!--update_begin author:wuxianquan date:20190908 for:增加组件外链打开方式可选 --> <!--update_begin author:wuxianquan date:20190908 for:增加组件外链打开方式可选 -->
<a-form-item <a-form-item
v-show="show" v-show="show"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('OpenMode')"> :label="$t('OpenMode')">
<a-switch :checkedChildren="$t('external')" :unCheckedChildren="$t('inside')" v-model="internalOrExternal"/> <a-switch :checkedChildren="$t('external')" :unCheckedChildren="$t('inside')" v-model="internalOrExternal"/>
</a-form-item> </a-form-item>
<!--update_end author:wuxianquan date:20190908 for:增加组件外链打开方式可选 --> <!--update_end author:wuxianquan date:20190908 for:增加组件外链打开方式可选 -->
</a-form> </a-form>
<!-- 选择图标 --> <!-- 选择图标 -->
<icons @choose="handleIconChoose" @close="handleIconCancel" :iconChooseVisible="iconChooseVisible"></icons> <icons @choose="handleIconChoose" @close="handleIconCancel" :iconChooseVisible="iconChooseVisible"></icons>
</a-spin> </a-spin>
<a-row :style="{textAlign:'right'}"> <a-row :style="{textAlign:'right'}">
<a-button :style="{marginRight: '8px'}" @click="handleCancel"> <a-button :style="{marginRight: '8px'}" @click="handleCancel">
{{$t('close')}} {{$t('close')}}
@@ -182,194 +191,194 @@
</template> </template>
<script> <script>
import {addPermission,editPermission,queryTreeList, duplicateCheck} from '@/api/api' import { addPermission, editPermission, queryTreeList, duplicateCheck } from '@/api/api'
import Icons from './icon/Icons' import Icons from './icon/Icons'
import pick from 'lodash.pick' import pick from 'lodash.pick'
export default { export default {
name: "PermissionModal", name: 'PermissionModal',
components: {Icons}, components: { Icons },
data () { data() {
return { return {
drawerWidth:700, drawerWidth: 700,
treeData:[], treeData: [],
treeValue: '0-0-4', treeValue: '0-0-4',
title:this.$t('operation'), title: this.$t('operation'),
visible: false, visible: false,
disableSubmit:false, disableSubmit: false,
model: {}, model: {},
localMenuType:0, localMenuType: 0,
alwaysShow:false,//表单元素-聚合路由 alwaysShow: false,//表单元素-聚合路由
menuHidden:false,//表单元素-隐藏路由 menuHidden: false,//表单元素-隐藏路由
routeSwitch:true, //是否路由菜单 routeSwitch: true, //是否路由菜单
/*update_begin author:wuxianquan date:20190908 for:定义变量,初始值代表内部打开*/ /*update_begin author:wuxianquan date:20190908 for:定义变量,初始值代表内部打开*/
internalOrExternal:false,//菜单打开方式 internalOrExternal: false,//菜单打开方式
/*update_end author:wuxianquan date:20190908 for:定义变量,初始值代表内部打开*/ /*update_end author:wuxianquan date:20190908 for:定义变量,初始值代表内部打开*/
isKeepalive:true, //是否缓存路由 isKeepalive: true, //是否缓存路由
show:true,//根据菜单类型,动态显示隐藏表单元素 show: true,//根据菜单类型,动态显示隐藏表单元素
menuLabel:this.$t('MenuName'), menuLabel: this.$t('MenuName'),
isRequrie:true, // 是否需要验证 isRequrie: true, // 是否需要验证
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 5 }, sm: { span: 5 }
}, },
wrapperCol: { wrapperCol: {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 16 }, sm: { span: 16 }
}, },
confirmLoading: false, confirmLoading: false,
form: this.$form.createForm(this), form: this.$form.createForm(this),
iconChooseVisible: false, iconChooseVisible: false,
validateStatus:"" validateStatus: ''
} }
}, },
computed:{ computed: {
validatorRules:function() { validatorRules: function() {
return { return {
name:{rules: [{ required: true, message: this.$t('enterMenuTitle') }]}, name: { rules: [{ required: true, message: this.$t('enterMenuTitle') }] },
menuEn:{rules: [{ required: true, message: this.$t('enterMenuEnName') }]}, menuEn: { rules: [{ required: true, message: this.$t('enterMenuEnName') }] },
component:{rules: [{ required: this.show, message: this.$t('enterFrontComponents') }]}, component: { rules: [{ required: this.show, message: this.$t('enterFrontComponents') }] },
url:{rules: [{ required: this.show, message: this.$t('enterMenuPath') }]}, url: { rules: [{ required: this.show, message: this.$t('enterMenuPath') }] },
permsType:{rules: [{ required: true, message: this.$t('enterAuthorizationPolicy') }]}, permsType: { rules: [{ required: true, message: this.$t('enterAuthorizationPolicy') }] },
sortNo:{initialValue:1.0}, sortNo: { initialValue: 1.0 }
} }
} }
}, },
created () { created() {
this.initDictConfig(); this.initDictConfig()
}, },
methods: { methods: {
loadTree(){ loadTree() {
var that = this; var that = this
queryTreeList().then((res)=>{ queryTreeList().then((res) => {
if(res.success){ if (res.success) {
that.treeData = []; that.treeData = []
let treeList = res.result.treeList let treeList = res.result.treeList
for(let a=0;a<treeList.length;a++){ for (let a = 0; a < treeList.length; a++) {
let temp = treeList[a]; let temp = treeList[a]
temp.isLeaf = temp.leaf; temp.isLeaf = temp.leaf
that.treeData.push(temp); that.treeData.push(temp)
} }
} }
}); })
}, },
add () { add() {
// 默认值 // 默认值
this.edit({status:'1',permsType:'1',route:true}); this.edit({ status: '1', permsType: '1', route: true })
}, },
edit (record) { edit(record) {
this.resetScreenSize(); // 调用此方法,根据屏幕宽度自适应调整抽屉的宽度 this.resetScreenSize() // 调用此方法,根据屏幕宽度自适应调整抽屉的宽度
this.form.resetFields(); this.form.resetFields()
this.model = Object.assign({}, record); this.model = Object.assign({}, record)
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
//根据菜单类型,动态展示页面字段 //根据菜单类型,动态展示页面字段
this.alwaysShow = !record.alwaysShow?false:true; this.alwaysShow = !record.alwaysShow ? false : true
this.menuHidden = !record.hidden?false:true; this.menuHidden = !record.hidden ? false : true
if(record.route!=null){ if (record.route != null) {
this.routeSwitch = record.route?true:false; this.routeSwitch = record.route ? true : false
} }
if(record.keepAlive!=null){ if (record.keepAlive != null) {
this.isKeepalive = record.keepAlive?true:false; this.isKeepalive = record.keepAlive ? true : false
}else{ } else {
this.isKeepalive = false; // 升级兼容 如果没有(后台没有传过来、或者是新建)默认为false this.isKeepalive = false // 升级兼容 如果没有(后台没有传过来、或者是新建)默认为false
} }
/*update_begin author:wuxianquan date:20190908 for:编辑初始化数据*/ /*update_begin author:wuxianquan date:20190908 for:编辑初始化数据*/
if(record.internalOrExternal!=null){ if (record.internalOrExternal != null) {
this.internalOrExternal = record.internalOrExternal?true:false; this.internalOrExternal = record.internalOrExternal ? true : false
}else{ } else {
this.internalOrExternal = false; this.internalOrExternal = false
} }
/*update_end author:wuxianquan date:20190908 for:编辑初始化数据*/ /*update_end author:wuxianquan date:20190908 for:编辑初始化数据*/
this.show = record.menuType==2?false:true; this.show = record.menuType == 2 ? false : true
this.menuLabel = record.menuType==2?this.$t('ButtonsPermissions'):this.$t('MenuName'); this.menuLabel = record.menuType == 2 ? this.$t('ButtonsPermissions') : this.$t('MenuName')
if(this.model.parentId){ if (this.model.parentId) {
this.localMenuType = 1; this.localMenuType = 1
}else{ } else {
this.localMenuType = 0; this.localMenuType = 0
} }
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
this.visible = true; this.visible = true
this.loadTree(); this.loadTree()
let fieldsVal = pick(this.model,'name','menuEn','perms','permsType','component','redirect','url','sortNo','menuType','status'); let fieldsVal = pick(this.model, 'name', 'menuEn', 'perms', 'permsType', 'component', 'redirect', 'url', 'sortNo', 'menuType', 'status')
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue(fieldsVal) this.form.setFieldsValue(fieldsVal)
}); })
}, },
close () { close() {
this.$emit('close'); this.$emit('close')
this.disableSubmit = false; this.disableSubmit = false
this.visible = false; this.visible = false
}, },
handleOk () { handleOk() {
const that = this; const that = this
// 触发表单验证 // 触发表单验证
this.form.validateFields((err, values) => { this.form.validateFields((err, values) => {
if (!err) { if (!err) {
this.model.alwaysShow = this.alwaysShow; this.model.alwaysShow = this.alwaysShow
this.model.hidden = this.menuHidden; this.model.hidden = this.menuHidden
this.model.route = this.routeSwitch; this.model.route = this.routeSwitch
this.model.keepAlive = this.isKeepalive; this.model.keepAlive = this.isKeepalive
/*update_begin author:wuxianquan date:20190908 for:获取值*/ /*update_begin author:wuxianquan date:20190908 for:获取值*/
this.model.internalOrExternal = this.internalOrExternal; this.model.internalOrExternal = this.internalOrExternal
/*update_end author:wuxianquan date:20190908 for:获取值*/ /*update_end author:wuxianquan date:20190908 for:获取值*/
let formData = Object.assign(this.model, values); let formData = Object.assign(this.model, values)
if ((formData.menuType == 1 || formData.menuType == 2) && !formData.parentId) { if ((formData.menuType == 1 || formData.menuType == 2) && !formData.parentId) {
that.validateStatus = 'error'; that.validateStatus = 'error'
that.$message.error("请检查你填的类型以及信息是否正确"); that.$message.error('请检查你填的类型以及信息是否正确')
return; return
} else { } else {
that.validateStatus = 'success'; that.validateStatus = 'success'
} }
that.confirmLoading = true; that.confirmLoading = true
let obj; let obj
if (!this.model.id) { if (!this.model.id) {
obj = addPermission(formData); obj = addPermission(formData)
} else { } else {
obj = editPermission(formData); obj = editPermission(formData)
} }
obj.then((res) => { obj.then((res) => {
if (res.success) { if (res.success) {
that.$message.success(res.message); that.$message.success(res.message)
that.$emit('ok'); that.$emit('ok')
} else { } else {
that.$message.warning(res.message); that.$message.warning(res.message)
} }
}).finally(() => { }).finally(() => {
that.confirmLoading = false; that.confirmLoading = false
that.close(); that.close()
}); })
} }
}) })
}, },
handleCancel () { handleCancel() {
this.close() this.close()
}, },
validateNumber(rule, value, callback){ validateNumber(rule, value, callback) {
if(!value || new RegExp(/^[0-9]*[1-9][0-9]*$/).test(value)){ if (!value || new RegExp(/^[0-9]*[1-9][0-9]*$/).test(value)) {
callback(); callback()
}else{ } else {
callback(this.$t('enterPositiveInteger')); callback(this.$t('enterPositiveInteger'))
} }
}, },
validatePerms(rule, value, callback){ validatePerms(rule, value, callback) {
if(value && value.length>0){ if (value && value.length > 0) {
//校验授权标识是否存在 //校验授权标识是否存在
var params = { var params = {
tableName: 'sys_permission', tableName: 'sys_permission',
fieldName: 'perms', fieldName: 'perms',
fieldVal: value, fieldVal: value,
dataId: this.model.id dataId: this.model.id
}; }
duplicateCheck(params).then((res) => { duplicateCheck(params).then((res) => {
if (res.success) { if (res.success) {
callback() callback()
@@ -377,50 +386,50 @@
callback(this.$t('AuthorizationIDExists')) callback(this.$t('AuthorizationIDExists'))
} }
}) })
}else{ } else {
callback() callback()
} }
}, },
onChangeMenuType(e) { onChangeMenuType(e) {
this.localMenuType=e.target.value this.localMenuType = e.target.value
if(e.target.value == 2){ if (e.target.value == 2) {
this.show = false; this.show = false
this.menuLabel = this.$t('ButtonsPermissions'); this.menuLabel = this.$t('ButtonsPermissions')
}else{ } else {
this.show = true; this.show = true
this.menuLabel = this.$t('MenuName'); this.menuLabel = this.$t('MenuName')
} }
this.$nextTick(() => { this.$nextTick(() => {
this.form.validateFields(['url','component'], { force: true }); this.form.validateFields(['url', 'component'], { force: true })
}); })
}, },
selectIcons(){ selectIcons() {
this.iconChooseVisible = true this.iconChooseVisible = true
}, },
handleIconCancel () { handleIconCancel() {
this.iconChooseVisible = false this.iconChooseVisible = false
}, },
handleIconChoose (value) { handleIconChoose(value) {
this.model.icon = value this.model.icon = value
this.form.icon = value this.form.icon = value
this.iconChooseVisible = false this.iconChooseVisible = false
}, },
// 根据屏幕变化,设置抽屉尺寸 // 根据屏幕变化,设置抽屉尺寸
resetScreenSize(){ resetScreenSize() {
let screenWidth = document.body.clientWidth; let screenWidth = document.body.clientWidth
if(screenWidth < 500){ if (screenWidth < 500) {
this.drawerWidth = screenWidth; this.drawerWidth = screenWidth
}else{ } else {
this.drawerWidth = 700; this.drawerWidth = 700
} }
}, },
initDictConfig() { initDictConfig() {
}, },
handleParentIdChange(value){ handleParentIdChange(value) {
if(!value){ if (!value) {
this.validateStatus="error" this.validateStatus = 'error'
}else{ } else {
this.validateStatus="success" this.validateStatus = 'success'
} }
} }
} }