租户管理界面调整

This commit is contained in:
lai
2024-06-13 15:33:53 +08:00
parent f699f6f3ba
commit 4e726913f1
3 changed files with 28 additions and 40 deletions

View File

@@ -1767,10 +1767,10 @@ export default {
classId:'Number', classId:'Number',
classSort:'Sorting', classSort:'Sorting',
status:'Status', status:'Status',
type:'Type', type:'Tenancy Type',
createTime:'Creation Time', createTime:'Creation Time',
highClass:'Root Level', highClass:'Root Level',
key:'Key', key:'Tenancy Key',
emailTip:'Please input the correct email address', emailTip:'Please input the correct email address',
phoneTip:'Please enter the correct phone number', phoneTip:'Please enter the correct phone number',
node:'Root Node', node:'Root Node',

View File

@@ -1767,10 +1767,10 @@ export default {
classId:'编号', classId:'编号',
classSort:'排序', classSort:'排序',
status:'状态', status:'状态',
type:'类型', type:'租赁类型',
createTime:'创建时间', createTime:'创建时间',
highClass:'根级', highClass:'根级',
key:'标识', key:'租赁标识',
emailTip:'请输入正确的邮箱地址', emailTip:'请输入正确的邮箱地址',
phoneTip:'请输入正确的手机号码', phoneTip:'请输入正确的手机号码',
node:'根节点', node:'根节点',

View File

@@ -85,28 +85,15 @@ let tableColumns: ColumnsType = [
width: 300, width: 300,
}, },
{ {
title: t('views.system.dept.classId'), title: t('views.system.dept.key'),
dataIndex: 'tenantId', dataIndex: 'tenancyKey',
align: 'left',
width: 150,
},
{
title: t('views.system.dept.classSort'),
dataIndex: 'orderNum',
align: 'left', align: 'left',
width: 200, width: 200,
}, },
{
title: t('views.system.dept.status'),
dataIndex: 'status',
key: 'status',
align: 'center',
width: 150,
},
{ {
title: t('views.system.dept.type'), title: t('views.system.dept.type'),
dataIndex: 'type', dataIndex: 'tenancyType',
key: 'type', key: 'tenancyType',
align: 'center', align: 'center',
width: 150, width: 150,
customRender(opt) { customRender(opt) {
@@ -122,6 +109,14 @@ let tableColumns: ColumnsType = [
} }
}, },
}, },
{
title: t('views.system.dept.status'),
dataIndex: 'status',
key: 'status',
align: 'center',
width: 150,
},
{ {
title: t('views.system.dept.createTime'), title: t('views.system.dept.createTime'),
dataIndex: 'createTime', dataIndex: 'createTime',
@@ -192,12 +187,12 @@ let modalState: ModalStateType = reactive({
email: '', email: '',
leader: '', leader: '',
orderNum: 0, orderNum: 0,
parentId: '100', parentId: '',
ancestors: '', ancestors: '',
parentName: null, parentName: null,
phone: '', phone: '',
key: '', tenancyKey: '',
type: '', tenancyType: '',
status: '0', status: '0',
}, },
confirmLoading: false, confirmLoading: false,
@@ -286,6 +281,7 @@ function fnModalVisibleByEdit(
Promise.all([getDept(tenantId), listDeptExcludeChild(tenantId)]) Promise.all([getDept(tenantId), listDeptExcludeChild(tenantId)])
.then(resArr => { .then(resArr => {
if (resArr[0].code === RESULT_CODE_SUCCESS && resArr[0].data) { if (resArr[0].code === RESULT_CODE_SUCCESS && resArr[0].data) {
console.log(resArr[0].data)
modalState.from = Object.assign(modalState.from, resArr[0].data); modalState.from = Object.assign(modalState.from, resArr[0].data);
if ( if (
resArr[1].code === RESULT_CODE_SUCCESS && resArr[1].code === RESULT_CODE_SUCCESS &&
@@ -300,11 +296,7 @@ function fnModalVisibleByEdit(
}, },
]; ];
} else { } else {
const a = resArr[1].data.map(s=>{ modalState.treeData = parseDataToTree(resArr[1].data, 'tenantId');
delete s.key
return s
})
modalState.treeData = parseDataToTree(a, 'tenantId');
} }
} }
modalState.title = modalState.title =
@@ -410,20 +402,16 @@ function fnGetList() {
tableState.loading = true; tableState.loading = true;
listDept(toRaw(queryParams)).then(res => { listDept(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
var a: any = res.data.map(item => {
delete item.key;
return item;
});
// 转换树状数据 // 转换树状数据
const treeData = parseDataToTree(a, 'tenantId'); const treeData = parseDataToTree(res.data, 'tenantId');
console.log(treeData);
// 初始上级部门和展开编号key // 初始上级部门和展开编号key
if (treeDataAll.length <= 0) { if (treeDataAll.length <= 0) {
// 转换树状数据 // 转换树状数据
treeDataAll = treeData; treeDataAll = treeData;
// 展开编号key // 展开编号key
expandedRowKeys = [...new Set(a.map((item:any) => item.parentId))]; expandedRowKeys = [
...new Set(res.data.map((item: any) => item.parentId)),
];
fnTableExpandedRowsAll(tableState.expandedRowAll); fnTableExpandedRowsAll(tableState.expandedRowAll);
} }
tableState.data = treeData; tableState.data = treeData;
@@ -705,7 +693,7 @@ onMounted(() => {
:label-col="{ span: 3 }" :label-col="{ span: 3 }"
:labelWrap="true" :labelWrap="true"
> >
{{ modalState.from.type }} {{ modalState.from.tenancyType }}
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@@ -807,7 +795,7 @@ onMounted(() => {
:labelWrap="true" :labelWrap="true"
> >
<a-select <a-select
v-model:value="modalState.from.type" v-model:value="modalState.from.tenancyType"
allow-clear allow-clear
:options="modalStateFromOption.tenantType" :options="modalStateFromOption.tenantType"
> >
@@ -821,7 +809,7 @@ onMounted(() => {
:label-col="{ span: 3 }" :label-col="{ span: 3 }"
> >
<a-input <a-input
v-model:value="modalState.from.key" v-model:value="modalState.from.tenancyKey"
allow-clear allow-clear
></a-input> ></a-input>
</a-form-item> </a-form-item>