角色列表字段修改

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() { handleCancel() {
this.close() this.close()
}, },
/**
* 邮编校验
* @param rules
* @param value
* @param callback
*/
checkPostcode(rules, value, callback) {
if (postcode(value)) {
callback()
} else {
callback('请输入正确格式的邮编')
}
}
} }
} }
</script> </script>
+20 -13
View File
@@ -22,7 +22,7 @@
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator" style="margin: 5px 0 10px 2px"> <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="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> <a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button>
</div> </div>
<div style="margin-top: 15px"> <div style="margin-top: 15px">
@@ -57,10 +57,10 @@
</a-card> </a-card>
</template> </template>
<script> <script>
import { JeroListMixin } from "@/mixins/JeroListMixin"; import {JeroListMixin} from "@/mixins/JeroListMixin";
import {postAction, getAction } from "@/api/manage"; import {postAction, getAction} from "@/api/manage";
import RoleModal from "./modules/RoleModal"; import RoleModal from "./modules/RoleModal";
import { filterObj } from "@/utils/util"; import {filterObj} from "@/utils/util";
import UserRoleModal from "./modules/UserRoleModal"; import UserRoleModal from "./modules/UserRoleModal";
import JEllipsis from "@comp/jero/JEllipsis"; import JEllipsis from "@comp/jero/JEllipsis";
import moment from "moment"; import moment from "moment";
@@ -81,14 +81,14 @@ export default {
model2: {}, model2: {},
currentRoleId: "", currentRoleId: "",
selectedRowKeys: [], selectedRowKeys: [],
expandedRowKeys:[], expandedRowKeys: [],
columns: columns:
[ [
{ {
title: "角色编码", title: "角色编码",
align: "center", align: "center",
dataIndex: "roleCode", dataIndex: "roleCode",
width:160, width: 160,
scopedSlots: {customRender: 'text'} scopedSlots: {customRender: 'text'}
}, },
{ {
@@ -100,7 +100,14 @@ export default {
{ {
title: "上级角色", title: "上级角色",
align: "center", align: "center",
dataIndex: "", dataIndex: "parentName",
customRender(text) {
if (text) {
return text
}else {
return '无'
}
}
}, },
{ {
title: "创建时间", title: "创建时间",
@@ -116,7 +123,7 @@ export default {
title: "操作", title: "操作",
dataIndex: "action", dataIndex: "action",
align: "center", align: "center",
scopedSlots: { customRender: "action" } scopedSlots: {customRender: "action"}
} }
], ],
url: { url: {
@@ -133,7 +140,7 @@ export default {
}; };
}, },
computed: { computed: {
importExcelUrl: function() { importExcelUrl: function () {
return `${window._CONFIG["domianURL"]}/${this.url.importExcelUrl}`; return `${window._CONFIG["domianURL"]}/${this.url.importExcelUrl}`;
} }
}, },
@@ -158,18 +165,18 @@ export default {
/* /*
* 添加下级 * 添加下级
* */ * */
handleAddLowerLevel(){ handleAddLowerLevel() {
if(this.selectedRowKeys.length === 0){ if (this.selectedRowKeys.length === 0) {
this.$message.warning('请选择一条记录') this.$message.warning('请选择一条记录')
return return
} }
if(this.selectedRowKeys.length > 1){ if (this.selectedRowKeys.length > 1) {
this.$message.warning('只能选择一条记录') this.$message.warning('只能选择一条记录')
return return
} }
// 将这行的角色id作为新建角色的的父级id // 将这行的角色id作为新建角色的的父级id
this.$refs.modalForm.addLowerRole(this.selectedRowKeys[0]); this.$refs.modalForm.addLowerRole(this.selectedRowKeys[0]);
this.$refs.modalForm.title='添加下级' this.$refs.modalForm.title = '添加下级'
}, },
handleAddUserRole() { handleAddUserRole() {
if (this.currentRoleId == "") { if (this.currentRoleId == "") {