Commit 5f92671a authored by smallwei's avatar smallwei

角色页面转化crud

parent fe96effb
......@@ -2,7 +2,8 @@
const env = process.env
let baseUrl = '';
let iconfontVersion = ['667895_5lt01cjobo7']
// 图表库为avue和pig2套地址
let iconfontVersion = ['667895_5lt01cjobo7', '567566_qo5lxgtishg']
let iconfontUrl = `//at.alicdn.com/t/font_$key.css`;
let codeUrl = `/code`
let actUrl = `${window.origin}/act/modeler.html?modelId=`;
......@@ -20,4 +21,4 @@ export {
iconfontVersion,
codeUrl,
env
}
}
\ No newline at end of file
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
export const tableOption = {
border: true,
index: true,
indexLabel: '序号',
stripe: true,
menuAlign: 'center',
editBtn: false,
delBtn: false,
align: 'center',
addBtn: false,
column: [{
fixed: true,
label: 'id',
prop: 'roleId',
span: 24,
editDisabled: true,
addVisdiplay: false,
}, {
fixed: true,
label: '角色名称',
prop: 'roleName',
search: true,
span: 24,
rules: [{
required: true,
message: '角色名称不能为空',
trigger: 'blur'
},
{
min: 3,
max: 20,
message: '长度在 3 到 20 个字符',
trigger: 'blur'
}
]
}, {
label: '角色标识',
prop: 'roleCode',
search: true,
span: 24,
rules: [{
required: true,
message: '角色标识不能为空',
trigger: 'blur'
},
{
min: 3,
max: 20,
message: '长度在 3 到 20 个字符',
trigger: 'blur'
}
]
}, {
label: '所属部门',
prop: 'roleDeptId',
formsolt: true,
search: true,
solt: true,
span: 24,
rules: [{
required: true,
message: '所属部门不能为空',
trigger: 'blur'
},
{
min: 3,
max: 20,
message: '长度在 3 到 20 个字符',
trigger: 'blur'
}
]
}, {
width: 180,
label: '角色描述',
prop: 'roleDesc',
overHidden: true,
type: 'textarea',
minRows: 6,
span: 24,
}, {
width: 180,
label: '创建时间',
prop: 'createTime',
search: true,
more: true,
type: 'datetime',
format: 'yyyy-MM-dd HH:mm',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
editDisabled: true,
addVisdiplay: false,
span: 24,
}]
}
\ No newline at end of file
......@@ -38,30 +38,72 @@ export const tableOption = {
solt: true,
search: true,
span: 24,
rules: [{
required: true,
message: "请输入账户",
trigger: "blur"
},
{
min: 3,
max: 20,
message: "长度在 3 到 20 个字符",
trigger: "blur"
}
]
}, {
label: '密码',
prop: 'password',
type: 'password',
hide: true,
span: 24,
rules: [{
required: true,
message: "请输入密码",
trigger: "blur"
},
{
min: 6,
max: 20,
message: "长度在 6 到 20 个字符",
trigger: "blur"
}
]
}, {
label: '所属部门',
prop: 'deptId',
search: true,
formsolt: true,
solt: true,
span: 24,
rules: [{
required: true,
message: "请选择部门",
trigger: "blur"
}]
}, {
label: '角色',
prop: 'role',
formsolt: true,
solt: true,
search: true,
span: 24,
rules: [{
required: true,
message: "请选择角色",
trigger: "blur"
}],
}, {
label: '状态',
prop: 'delFlag',
type: "select",
solt: true,
search: true,
span: 24,
rules: [{
required: true,
message: "请选择状态",
trigger: "blur"
}],
dicData: [{
label: '有效',
value: '0'
......@@ -79,6 +121,8 @@ export const tableOption = {
type: 'datetime',
format: 'yyyy-MM-dd HH:mm',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
search: true,
more: true,
editDisabled: true,
addVisdiplay: false,
span: 24,
......
This diff is collapsed.
......@@ -67,18 +67,19 @@
<el-button v-if="sys_user_edit"
size="small"
type="success"
@click="handleUpdate(scope.row,scope.id)">编辑
@click="handleUpdate(scope.row,scope.index)">编辑
</el-button>
<el-button v-if="sys_user_del"
size="small"
type="danger"
@click="deletes(scope.row,scope.id)">删除
@click="deletes(scope.row,scope.index)">删除
</el-button>
</template>
<template slot="deptIdForm"
slot-scope="scope">
<avue-crud-input v-model="form.deptId"
type="tree"
placeholder="请选择所属部门"
:node-click="getNodeData"
:dic="treeDeptData"
:props="defaultProps"></avue-crud-input>
......@@ -87,6 +88,7 @@
slot-scope="scope">
<avue-crud-select v-model="role"
multiple
placeholder="请选择角色,要先选择部门"
:dic="rolesOptions"
:props="roleProps"></avue-crud-select>
</template>
......@@ -180,7 +182,7 @@ export default {
});
},
handleFilter (param) {
this.listQuery.username = param.username;
this.listQuery = Object.assign(this.listQuery, param)
this.listQuery.page = 1;
this.getList();
},
......@@ -228,10 +230,7 @@ export default {
});
}).catch(() => {
loading();
});;
},
cancel (formName) {
this.$refs[formName].resetFields();
});
},
update (row, index, done, loading) {
putObj(this.form).then(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment