角色列表字段修改

This commit is contained in:
fengachen
2021-08-30 17:59:13 +08:00
parent e19b92a51e
commit eec31f453b
2 changed files with 66 additions and 72 deletions
@@ -187,19 +187,6 @@ export default {
handleCancel() {
this.close()
},
/**
* 邮编校验
* @param rules
* @param value
* @param callback
*/
checkPostcode(rules, value, callback) {
if (postcode(value)) {
callback()
} else {
callback('请输入正确格式的邮编')
}
}
}
}
</script>
+66 -59
View File
@@ -22,25 +22,25 @@
<!-- 操作按钮区域 -->
<div class="table-operator" style="margin: 5px 0 10px 2px">
<a-button @click="handleAdd" type="primary" icon="plus" v-has="'sys:role:add'">添加角色</a-button>
<a-button @click="handleAddLowerLevel" type="primary" icon="plus" >添加下级</a-button>
<a-button @click="handleAddLowerLevel" type="primary" icon="plus">添加下级</a-button>
<a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button>
</div>
<div style="margin-top: 15px">
<a-table
style="height:500px"
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
:expandedRowKeys="expandedRowKeys"
@expandedRowsChange="handleExpandedRowsChange"
@change="handleTableChange">
<span slot="action" class="action-span-cell" slot-scope="text, record">
style="height:500px"
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
:expandedRowKeys="expandedRowKeys"
@expandedRowsChange="handleExpandedRowsChange"
@change="handleTableChange">
<span slot="action" class="action-span-cell" slot-scope="text, record">
<a @click="handlePerssion(record.id)">授权</a>
<a @click="handleEdit(record)" v-has="'sys:role:edit'">编辑</a>
<a @click="handleDelete(record.id)" v-has="'sys:role:del'">删除</a>
@@ -57,10 +57,10 @@
</a-card>
</template>
<script>
import { JeroListMixin } from "@/mixins/JeroListMixin";
import {postAction, getAction } from "@/api/manage";
import {JeroListMixin} from "@/mixins/JeroListMixin";
import {postAction, getAction} from "@/api/manage";
import RoleModal from "./modules/RoleModal";
import { filterObj } from "@/utils/util";
import {filterObj} from "@/utils/util";
import UserRoleModal from "./modules/UserRoleModal";
import JEllipsis from "@comp/jero/JEllipsis";
import moment from "moment";
@@ -81,44 +81,51 @@ export default {
model2: {},
currentRoleId: "",
selectedRowKeys: [],
expandedRowKeys:[],
expandedRowKeys: [],
columns:
[
{
title: "角色编码",
align: "center",
dataIndex: "roleCode",
width:160,
scopedSlots: {customRender: 'text'}
},
{
title: "角色名称",
align: "center",
dataIndex: "roleName",
scopedSlots: {customRender: 'text'}
},
{
title: "上级角色",
align: "center",
dataIndex: "",
},
{
title: "创建时间",
dataIndex: "createTime",
align: "center",
sorter: true,
scopedSlots: {customRender: 'text'},
customRender: (text) => {
return moment(text).format("YYYY-MM-DD HH:mm:ss");
[
{
title: "角色编码",
align: "center",
dataIndex: "roleCode",
width: 160,
scopedSlots: {customRender: 'text'}
},
{
title: "角色名称",
align: "center",
dataIndex: "roleName",
scopedSlots: {customRender: 'text'}
},
{
title: "上级角色",
align: "center",
dataIndex: "parentName",
customRender(text) {
if (text) {
return text
}else {
return '无'
}
}
},
{
title: "创建时间",
dataIndex: "createTime",
align: "center",
sorter: true,
scopedSlots: {customRender: 'text'},
customRender: (text) => {
return moment(text).format("YYYY-MM-DD HH:mm:ss");
}
},
{
title: "操作",
dataIndex: "action",
align: "center",
scopedSlots: {customRender: "action"}
}
},
{
title: "操作",
dataIndex: "action",
align: "center",
scopedSlots: { customRender: "action" }
}
],
],
url: {
list: "/sys/role/treeListPage",
delete: "/sys/role/delete",
@@ -133,7 +140,7 @@ export default {
};
},
computed: {
importExcelUrl: function() {
importExcelUrl: function () {
return `${window._CONFIG["domianURL"]}/${this.url.importExcelUrl}`;
}
},
@@ -158,18 +165,18 @@ export default {
/*
* 添加下级
* */
handleAddLowerLevel(){
if(this.selectedRowKeys.length === 0){
handleAddLowerLevel() {
if (this.selectedRowKeys.length === 0) {
this.$message.warning('请选择一条记录')
return
}
if(this.selectedRowKeys.length > 1){
if (this.selectedRowKeys.length > 1) {
this.$message.warning('只能选择一条记录')
return
}
// 将这行的角色id作为新建角色的的父级id
this.$refs.modalForm.addLowerRole(this.selectedRowKeys[0]);
this.$refs.modalForm.title='添加下级'
this.$refs.modalForm.title = '添加下级'
},
handleAddUserRole() {
if (this.currentRoleId == "") {