From f4771892aafbef1119a6fa0f9f251c6ffef58634 Mon Sep 17 00:00:00 2001 From: lai <371757574@qq.com> Date: Fri, 5 Jul 2024 14:30:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=8A=A8=E5=8F=98=E9=87=8F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/tenant.ts | 28 ++++++------- src/views/system/tenant/index.vue | 68 +++++++++++++++---------------- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/api/system/tenant.ts b/src/api/system/tenant.ts index 7869e23d..1aa4ea71 100644 --- a/src/api/system/tenant.ts +++ b/src/api/system/tenant.ts @@ -5,7 +5,7 @@ import { request } from '@/plugins/http-fetch'; * @param query 查询参数 * @returns object */ -export function listDept(query: Record) { +export function listTenant(query: Record) { return request({ url: '/system/tenant/list', method: 'get', @@ -15,24 +15,24 @@ export function listDept(query: Record) { /** * 查询部门列表(排除节点) - * @param deptId 部门ID + * @param tenantId 部门ID * @returns object */ -export function listDeptExcludeChild(deptId: string | number) { +export function listTenantExcludeChild(tenantId: string | number) { return request({ - url: `/system/tenant/list/exclude/${deptId}`, + url: `/system/tenant/list/exclude/${tenantId}`, method: 'get', }); } /** * 查询部门详细 - * @param deptId 部门ID + * @param tenantId 部门ID * @returns object */ -export function getDept(deptId: string | number) { +export function getTenant(tenantId: string | number) { return request({ - url: `/system/tenant/${deptId}`, + url: `/system/tenant/${tenantId}`, method: 'get', }); } @@ -42,7 +42,7 @@ export function getDept(deptId: string | number) { * @param data 部门对象 * @returns object */ -export function addDept(data: Record) { +export function addTenant(data: Record) { return request({ url: '/system/tenant', method: 'post', @@ -55,7 +55,7 @@ export function addDept(data: Record) { * @param data 部门对象 * @returns object */ -export function updateDept(data: Record) { +export function updateTenant(data: Record) { return request({ url: '/system/tenant', method: 'put', @@ -65,12 +65,12 @@ export function updateDept(data: Record) { /** * 删除部门 - * @param deptId 部门ID + * @param TenantId 部门ID * @returns object */ -export function delDept(deptId: string | number) { +export function delTenant(TenantId: string | number) { return request({ - url: `/system/tenant/${deptId}`, + url: `/system/tenant/${TenantId}`, method: 'delete', }); } @@ -79,7 +79,7 @@ export function delDept(deptId: string | number) { * 查询部门下拉树结构 * @returns object */ -export function deptTreeSelect() { +export function tenantTreeSelect() { return request({ url: '/system/tenant/treeSelect', method: 'get', @@ -91,7 +91,7 @@ export function deptTreeSelect() { * @param roleId 角色ID * @returns object */ -export function roleDeptTreeSelect(roleId: string | number) { +export function roleTenantTreeSelect(roleId: string | number) { return request({ url: `/system/tenant/roleDeptTreeSelect/${roleId}`, method: 'get', diff --git a/src/views/system/tenant/index.vue b/src/views/system/tenant/index.vue index 3ec39607..d802e2dc 100644 --- a/src/views/system/tenant/index.vue +++ b/src/views/system/tenant/index.vue @@ -7,11 +7,11 @@ import useI18n from '@/hooks/useI18n'; import { SizeType } from 'ant-design-vue/lib/config-provider'; import { ColumnsType } from 'ant-design-vue/lib/table'; import { - listDept, - getDept, - delDept, - addDept, - updateDept, + listTenant, + getTenant, + delTenant, + addTenant, + updateTenant, } from '@/api/system/tenant'; import useDictStore from '@/store/modules/dict'; import { parseDateToStr } from '@/utils/date-utils'; @@ -191,7 +191,7 @@ const modalStateFrom = Form.useForm( required: true, min: 1, max: 50, - message: t('views.system.dept.className') + t('common.unableNull'), + message: t('views.system.tenant.className') + t('common.unableNull'), }, ], }) @@ -206,7 +206,7 @@ const modalStateTypeFrom = Form.useForm( required: true, min: 1, max: 50, - message: t('views.system.dept.type') + t('common.unableNull'), + message: t('views.system.tenant.type') + t('common.unableNull'), }, ], tenancyKey: [ @@ -214,7 +214,7 @@ const modalStateTypeFrom = Form.useForm( required: true, min: 1, max: 50, - message: t('views.system.dept.key') + t('common.unableNull'), + message: t('views.system.tenant.key') + t('common.unableNull'), }, ], }) @@ -266,7 +266,7 @@ function fnSelectNode(_: any, info: any) { /**获取数据 */ function fnGetList(parentId?: any, tableFlag?: any) { - listDept({ parentId }).then(res => { + listTenant({ parentId }).then(res => { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (tableFlag === 'tree') { // 渲染左侧树列表 @@ -314,19 +314,19 @@ function fnModalVisibleByEdit( if (parentId) { modalState.from.parentId = parentId; } - modalState.title = t('common.addText') + t('views.system.dept.classInfo'); + modalState.title = t('common.addText') + t('views.system.tenant.classInfo'); modalState.visibleByEdit = true; } else { //修改 if (modalState.confirmLoading) return; const hide = message.loading(t('common.loading'), 0); modalState.confirmLoading = true; - getDept(tenantId) + getTenant(tenantId) .then(res => { if (res.code === RESULT_CODE_SUCCESS && res.data) { modalState.from = Object.assign(modalState.from, res.data); modalState.title = - t('common.editText') + t('views.system.dept.classInfo'); + t('common.editText') + t('views.system.tenant.classInfo'); modalState.visibleByEdit = true; } else { message.error(t('common.getInfoFail'), 2); @@ -336,7 +336,7 @@ function fnModalVisibleByEdit( modalState.confirmLoading = false; hide(); }); - modalState.title = t('common.editText') + t('views.system.dept.classInfo'); + modalState.title = t('common.editText') + t('views.system.tenant.classInfo'); modalState.visibleByEdit = true; // 获取部门信息同时查询部门列表(排除节点) } @@ -353,9 +353,9 @@ function fnModalOk() { modalState.confirmLoading = true; const from = toRaw(modalState.from); - const dept = from.tenantId ? updateDept(from) : addDept(from); + const tenant = from.tenantId ? updateTenant(from) : addTenant(from); const hide = message.loading(t('common.loading'), 0); - dept + tenant .then(res => { if (res.code === RESULT_CODE_SUCCESS) { message.success({ @@ -391,10 +391,10 @@ function fnModalOk() { function fnRecordDelete(tenantId: string | number) { Modal.confirm({ title: t('common.tipTitle'), - content: t('views.system.dept.delSure', { deptId: tenantId }), + content: t('views.system.tenant.delSure', { tenantId}), onOk() { const hide = message.loading(t('common.loading'), 0); - delDept(tenantId).then(res => { + delTenant(tenantId).then(res => { hide(); if (res.code === RESULT_CODE_SUCCESS) { message.success({ @@ -430,19 +430,19 @@ function fnModalVisibleByType( if (parentId) { modalState.typeFrom.parentId = parentId; } - modalState.typeTitle = t('common.addText') + t('views.system.dept.type'); + modalState.typeTitle = t('common.addText') + t('views.system.tenant.type'); modalState.visibleByType = true; } else { //修改 if (modalState.confirmLoading) return; const hide = message.loading(t('common.loading'), 0); modalState.confirmLoading = true; - getDept(tenantId) + getTenant(tenantId) .then(res => { if (res.code === RESULT_CODE_SUCCESS && res.data) { modalState.typeFrom = Object.assign(modalState.typeFrom, res.data); modalState.typeTitle = - t('common.editText') + t('views.system.dept.type'); + t('common.editText') + t('views.system.tenant.type'); modalState.visibleByType = true; } else { message.error(t('common.getInfoFail'), 2); @@ -452,7 +452,7 @@ function fnModalVisibleByType( modalState.confirmLoading = false; hide(); }); - modalState.title = t('common.editText') + t('views.system.dept.classInfo'); + modalState.title = t('common.editText') + t('views.system.tenant.classInfo'); modalState.visibleByType = true; // 获取部门信息同时查询部门列表(排除节点) } @@ -469,9 +469,9 @@ function fnModalTypeOk() { modalState.confirmLoading = true; const from = toRaw(modalState.typeFrom); from.parentId = state.selectedNode; - const dept = from.tenantId ? updateDept(from) : addDept(from); + const tenant = from.tenantId ? updateTenant(from) : addTenant(from); const hide = message.loading(t('common.loading'), 0); - dept + tenant .then(res => { if (res.code === RESULT_CODE_SUCCESS) { message.success({ @@ -509,10 +509,10 @@ function fnTypeRecordDelete( ) { Modal.confirm({ title: t('common.tipTitle'), - content: t('views.system.dept.delSure', { deptId: tenantId }), + content: t('views.system.tenant.delSure', { tenantId }), onOk() { const hide = message.loading(t('common.loading'), 0); - delDept(tenantId).then(res => { + delTenant(tenantId).then(res => { hide(); if (res.code === RESULT_CODE_SUCCESS) { message.success({ @@ -634,10 +634,10 @@ onMounted(() => { - {{ 'Tenant Name: ' + state.selectedName }} + {{ state.selectedName +'-Tenancy Asset '}} - {{ t('views.system.dept.treeSelectTip') }} + {{ t('views.system.tenant.treeSelectTip') }} @@ -756,7 +756,7 @@ onMounted(() => { :labelWrap="true" > { { { - + { @@ -851,7 +851,7 @@ onMounted(() => { @@ -864,7 +864,7 @@ onMounted(() => { - +