eslint; 收入合同
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="菜单路径">
|
||||
<a-input @change="event => event.target.value = event.target.value.trim()" :maxLength="60" placeholder="请输入菜单路径" v-decorator="[ 'url',validatorRules.url]" :readOnly="disableSubmit"/>
|
||||
<a-input @change="event => event.target.value = event.target.value.trim()" :maxLength="100" placeholder="请输入菜单路径" v-decorator="[ 'url',validatorRules.url]" :readOnly="disableSubmit"/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item
|
||||
@@ -59,7 +59,7 @@
|
||||
:labelCol="labelCol"
|
||||
:wrapperCol="wrapperCol"
|
||||
label="前端组件">
|
||||
<a-input placeholder="请输入前端组件" @change="event => event.target.value = event.target.value.trim()" :maxLength="60" v-decorator="[ 'component',validatorRules.component]" :readOnly="disableSubmit"/>
|
||||
<a-input placeholder="请输入前端组件" @change="event => event.target.value = event.target.value.trim()" :maxLength="120" v-decorator="[ 'component',validatorRules.component]" :readOnly="disableSubmit"/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item
|
||||
@@ -180,14 +180,14 @@
|
||||
import pick from 'lodash.pick'
|
||||
|
||||
export default {
|
||||
name: "PermissionModal",
|
||||
name: 'PermissionModal',
|
||||
components: {Icons},
|
||||
data () {
|
||||
return {
|
||||
drawerWidth:700,
|
||||
treeData:[],
|
||||
treeValue: '0-0-4',
|
||||
title:"操作",
|
||||
title:'操作',
|
||||
visible: false,
|
||||
disableSubmit:false,
|
||||
model: {},
|
||||
@@ -215,7 +215,7 @@
|
||||
form: this.$form.createForm(this),
|
||||
|
||||
iconChooseVisible: false,
|
||||
validateStatus:""
|
||||
validateStatus:''
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
@@ -230,118 +230,118 @@
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.initDictConfig();
|
||||
this.initDictConfig()
|
||||
},
|
||||
methods: {
|
||||
loadTree(){
|
||||
var that = this;
|
||||
var that = this
|
||||
queryTreeList().then((res)=>{
|
||||
if(res.success){
|
||||
that.treeData = [];
|
||||
that.treeData = []
|
||||
let treeList = res.result.treeList
|
||||
for(let a=0;a<treeList.length;a++){
|
||||
let temp = treeList[a];
|
||||
temp.isLeaf = temp.leaf;
|
||||
that.treeData.push(temp);
|
||||
let temp = treeList[a]
|
||||
temp.isLeaf = temp.leaf
|
||||
that.treeData.push(temp)
|
||||
}
|
||||
console.log(this.treeData)
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
add () {
|
||||
// 默认值
|
||||
this.edit({status:'1',permsType:'1',route:true});
|
||||
this.edit({status:'1',permsType:'1',route:true})
|
||||
},
|
||||
edit (record) {
|
||||
this.resetScreenSize(); // 调用此方法,根据屏幕宽度自适应调整抽屉的宽度
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.resetScreenSize() // 调用此方法,根据屏幕宽度自适应调整抽屉的宽度
|
||||
this.form.resetFields()
|
||||
this.model = Object.assign({}, record)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
//根据菜单类型,动态展示页面字段
|
||||
this.alwaysShow = !record.alwaysShow?false:true;
|
||||
this.menuHidden = !record.hidden?false:true;
|
||||
this.alwaysShow = !record.alwaysShow?false:true
|
||||
this.menuHidden = !record.hidden?false:true
|
||||
|
||||
if(record.route!=null){
|
||||
this.routeSwitch = record.route?true:false;
|
||||
this.routeSwitch = record.route?true:false
|
||||
}
|
||||
|
||||
if(record.keepAlive!=null){
|
||||
this.isKeepalive = record.keepAlive?true:false;
|
||||
this.isKeepalive = record.keepAlive?true:false
|
||||
}else{
|
||||
this.isKeepalive = false; // 升级兼容 如果没有(后台没有传过来、或者是新建)默认为false
|
||||
this.isKeepalive = false // 升级兼容 如果没有(后台没有传过来、或者是新建)默认为false
|
||||
}
|
||||
|
||||
/*update_begin author:wuxianquan date:20190908 for:编辑初始化数据*/
|
||||
if(record.internalOrExternal!=null){
|
||||
this.internalOrExternal = record.internalOrExternal?true:false;
|
||||
this.internalOrExternal = record.internalOrExternal?true:false
|
||||
}else{
|
||||
this.internalOrExternal = false;
|
||||
this.internalOrExternal = false
|
||||
}
|
||||
/*update_end author:wuxianquan date:20190908 for:编辑初始化数据*/
|
||||
|
||||
|
||||
this.show = record.menuType==2?false:true;
|
||||
this.menuLabel = record.menuType==2?'按钮/权限':'菜单名称';
|
||||
this.show = record.menuType==2?false:true
|
||||
this.menuLabel = record.menuType==2?'按钮/权限':'菜单名称'
|
||||
|
||||
if(this.model.parentId){
|
||||
this.localMenuType = 1;
|
||||
this.localMenuType = 1
|
||||
}else{
|
||||
this.localMenuType = 0;
|
||||
this.localMenuType = 0
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------
|
||||
|
||||
this.visible = true;
|
||||
this.loadTree();
|
||||
let fieldsVal = pick(this.model,'name','perms','permsType','component','redirect','url','sortNo','menuType','status');
|
||||
this.visible = true
|
||||
this.loadTree()
|
||||
let fieldsVal = pick(this.model,'name','perms','permsType','component','redirect','url','sortNo','menuType','status')
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(fieldsVal)
|
||||
});
|
||||
})
|
||||
},
|
||||
close () {
|
||||
this.$emit('close');
|
||||
this.disableSubmit = false;
|
||||
this.visible = false;
|
||||
this.$emit('close')
|
||||
this.disableSubmit = false
|
||||
this.visible = false
|
||||
},
|
||||
handleOk () {
|
||||
const that = this;
|
||||
const that = this
|
||||
this.confirmLoading = true
|
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
this.model.alwaysShow = this.alwaysShow;
|
||||
this.model.hidden = this.menuHidden;
|
||||
this.model.route = this.routeSwitch;
|
||||
this.model.keepAlive = this.isKeepalive;
|
||||
this.model.alwaysShow = this.alwaysShow
|
||||
this.model.hidden = this.menuHidden
|
||||
this.model.route = this.routeSwitch
|
||||
this.model.keepAlive = this.isKeepalive
|
||||
/*update_begin author:wuxianquan date:20190908 for:获取值*/
|
||||
this.model.internalOrExternal = this.internalOrExternal;
|
||||
this.model.internalOrExternal = this.internalOrExternal
|
||||
/*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) {
|
||||
that.validateStatus = 'error';
|
||||
that.$message.warn("请检查你填的类型以及信息是否正确!");
|
||||
that.confirmLoading = false;
|
||||
return;
|
||||
that.validateStatus = 'error'
|
||||
that.$message.warn('请检查你填的类型以及信息是否正确!')
|
||||
that.confirmLoading = false
|
||||
return
|
||||
} else {
|
||||
that.validateStatus = 'success';
|
||||
that.validateStatus = 'success'
|
||||
}
|
||||
let obj;
|
||||
let obj
|
||||
if (!this.model.id) {
|
||||
obj = addPermission(formData);
|
||||
obj = addPermission(formData)
|
||||
} else {
|
||||
obj = editPermission(formData);
|
||||
obj = editPermission(formData)
|
||||
}
|
||||
obj.then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message);
|
||||
that.$emit('ok');
|
||||
that.close();
|
||||
that.$message.success(res.message)
|
||||
that.$emit('ok')
|
||||
that.close()
|
||||
} else {
|
||||
that.$message.warning(res.message);
|
||||
that.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
});
|
||||
that.confirmLoading = false
|
||||
})
|
||||
}else {
|
||||
this.confirmLoading = false
|
||||
}
|
||||
@@ -352,9 +352,9 @@
|
||||
},
|
||||
validateNumber(rule, value, callback){
|
||||
if(!value || new RegExp(/^[0-9]*[1-9][0-9]*$/).test(value)){
|
||||
callback();
|
||||
callback()
|
||||
}else{
|
||||
callback("请输入正整数!");
|
||||
callback('请输入正整数!')
|
||||
}
|
||||
},
|
||||
validatePerms(rule, value, callback){
|
||||
@@ -365,12 +365,12 @@
|
||||
fieldName: 'perms',
|
||||
fieldVal: value,
|
||||
dataId: this.model.id
|
||||
};
|
||||
}
|
||||
duplicateCheck(params).then((res) => {
|
||||
if (res.success) {
|
||||
callback()
|
||||
} else {
|
||||
callback("授权标识已存在!")
|
||||
callback('授权标识已存在!')
|
||||
}
|
||||
})
|
||||
}else{
|
||||
@@ -381,15 +381,15 @@
|
||||
this.form.resetFields()
|
||||
this.localMenuType=e.target.value
|
||||
if(e.target.value == 2){
|
||||
this.show = false;
|
||||
this.menuLabel = '按钮/权限';
|
||||
this.show = false
|
||||
this.menuLabel = '按钮/权限'
|
||||
}else{
|
||||
this.show = true;
|
||||
this.menuLabel = '菜单名称';
|
||||
this.show = true
|
||||
this.menuLabel = '菜单名称'
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.form.validateFields(['url','component'], { force: true });
|
||||
});
|
||||
this.form.validateFields(['url','component'], { force: true })
|
||||
})
|
||||
},
|
||||
selectIcons(){
|
||||
this.iconChooseVisible = true
|
||||
@@ -404,20 +404,20 @@
|
||||
},
|
||||
// 根据屏幕变化,设置抽屉尺寸
|
||||
resetScreenSize(){
|
||||
let screenWidth = document.body.clientWidth;
|
||||
let screenWidth = document.body.clientWidth
|
||||
if(screenWidth < 500){
|
||||
this.drawerWidth = screenWidth;
|
||||
this.drawerWidth = screenWidth
|
||||
}else{
|
||||
this.drawerWidth = 700;
|
||||
this.drawerWidth = 700
|
||||
}
|
||||
},
|
||||
initDictConfig() {
|
||||
},
|
||||
handleParentIdChange(value){
|
||||
if(!value){
|
||||
this.validateStatus="error"
|
||||
this.validateStatus='error'
|
||||
}else{
|
||||
this.validateStatus="success"
|
||||
this.validateStatus='success'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user