From 4e726913f19cc1646258d14098bee64466b15da4 Mon Sep 17 00:00:00 2001 From: lai <371757574@qq.com> Date: Thu, 13 Jun 2024 15:33:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=9F=E6=88=B7=E7=AE=A1=E7=90=86=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/locales/en-US.ts | 4 +-- src/i18n/locales/zh-CN.ts | 4 +-- src/views/system/dept/index.vue | 60 +++++++++++++-------------------- 3 files changed, 28 insertions(+), 40 deletions(-) diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index 14f9d289..ab97d3a1 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -1767,10 +1767,10 @@ export default { classId:'Number', classSort:'Sorting', status:'Status', - type:'Type', + type:'Tenancy Type', createTime:'Creation Time', highClass:'Root Level', - key:'Key', + key:'Tenancy Key', emailTip:'Please input the correct email address', phoneTip:'Please enter the correct phone number', node:'Root Node', diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 98a3c504..87c808d7 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -1767,10 +1767,10 @@ export default { classId:'编号', classSort:'排序', status:'状态', - type:'类型', + type:'租赁类型', createTime:'创建时间', highClass:'根级', - key:'标识', + key:'租赁标识', emailTip:'请输入正确的邮箱地址', phoneTip:'请输入正确的手机号码', node:'根节点', diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 960dc516..b8f0720f 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -85,28 +85,15 @@ let tableColumns: ColumnsType = [ width: 300, }, { - title: t('views.system.dept.classId'), - dataIndex: 'tenantId', - align: 'left', - width: 150, - }, - { - title: t('views.system.dept.classSort'), - dataIndex: 'orderNum', + title: t('views.system.dept.key'), + dataIndex: 'tenancyKey', align: 'left', width: 200, }, - { - title: t('views.system.dept.status'), - dataIndex: 'status', - key: 'status', - align: 'center', - width: 150, - }, { title: t('views.system.dept.type'), - dataIndex: 'type', - key: 'type', + dataIndex: 'tenancyType', + key: 'tenancyType', align: 'center', width: 150, 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'), dataIndex: 'createTime', @@ -192,12 +187,12 @@ let modalState: ModalStateType = reactive({ email: '', leader: '', orderNum: 0, - parentId: '100', + parentId: '', ancestors: '', parentName: null, phone: '', - key: '', - type: '', + tenancyKey: '', + tenancyType: '', status: '0', }, confirmLoading: false, @@ -286,6 +281,7 @@ function fnModalVisibleByEdit( Promise.all([getDept(tenantId), listDeptExcludeChild(tenantId)]) .then(resArr => { if (resArr[0].code === RESULT_CODE_SUCCESS && resArr[0].data) { + console.log(resArr[0].data) modalState.from = Object.assign(modalState.from, resArr[0].data); if ( resArr[1].code === RESULT_CODE_SUCCESS && @@ -300,11 +296,7 @@ function fnModalVisibleByEdit( }, ]; } else { - const a = resArr[1].data.map(s=>{ - delete s.key - return s - }) - modalState.treeData = parseDataToTree(a, 'tenantId'); + modalState.treeData = parseDataToTree(resArr[1].data, 'tenantId'); } } modalState.title = @@ -410,20 +402,16 @@ function fnGetList() { tableState.loading = true; listDept(toRaw(queryParams)).then(res => { 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'); - console.log(treeData); + const treeData = parseDataToTree(res.data, 'tenantId'); // 初始上级部门和展开编号key if (treeDataAll.length <= 0) { // 转换树状数据 treeDataAll = treeData; // 展开编号key - expandedRowKeys = [...new Set(a.map((item:any) => item.parentId))]; + expandedRowKeys = [ + ...new Set(res.data.map((item: any) => item.parentId)), + ]; fnTableExpandedRowsAll(tableState.expandedRowAll); } tableState.data = treeData; @@ -705,7 +693,7 @@ onMounted(() => { :label-col="{ span: 3 }" :labelWrap="true" > - {{ modalState.from.type }} + {{ modalState.from.tenancyType }} @@ -807,7 +795,7 @@ onMounted(() => { :labelWrap="true" > @@ -821,7 +809,7 @@ onMounted(() => { :label-col="{ span: 3 }" >