改动变量名

This commit is contained in:
lai
2024-07-05 14:30:28 +08:00
parent 842f09cc90
commit f4771892aa
2 changed files with 48 additions and 48 deletions

View File

@@ -5,7 +5,7 @@ import { request } from '@/plugins/http-fetch';
* @param query 查询参数
* @returns object
*/
export function listDept(query: Record<string, any>) {
export function listTenant(query: Record<string, any>) {
return request({
url: '/system/tenant/list',
method: 'get',
@@ -15,24 +15,24 @@ export function listDept(query: Record<string, any>) {
/**
* 查询部门列表(排除节点)
* @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<string, any>) {
export function addTenant(data: Record<string, any>) {
return request({
url: '/system/tenant',
method: 'post',
@@ -55,7 +55,7 @@ export function addDept(data: Record<string, any>) {
* @param data 部门对象
* @returns object
*/
export function updateDept(data: Record<string, any>) {
export function updateTenant(data: Record<string, any>) {
return request({
url: '/system/tenant',
method: 'put',
@@ -65,12 +65,12 @@ export function updateDept(data: Record<string, any>) {
/**
* 删除部门
* @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',

View File

@@ -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(() => {
</template>
</a-button>
<a-typography-text v-if="state.selectedName">
{{ 'Tenant Name: ' + state.selectedName }}
{{ state.selectedName +'-Tenancy Asset '}}
</a-typography-text>
<a-typography-text type="danger" v-else>
{{ t('views.system.dept.treeSelectTip') }}
{{ t('views.system.tenant.treeSelectTip') }}
</a-typography-text>
</template>
@@ -756,7 +756,7 @@ onMounted(() => {
:labelWrap="true"
>
<a-form-item
:label="t('views.system.dept.className')"
:label="t('views.system.tenant.className')"
name="tenantName"
v-bind="modalStateFrom.validateInfos.tenantName"
:label-col="{ span: 4 }"
@@ -773,7 +773,7 @@ onMounted(() => {
<a-row :gutter="16">
<a-col :span="12">
<a-form-item
:label="t('views.system.dept.type')"
:label="t('views.system.tenant.type')"
name="type"
:labelWrap="true"
v-show="modalState.from.parentId !== '0'"
@@ -789,7 +789,7 @@ onMounted(() => {
<a-col :lg="24" :md="24" :xs="24">
<a-form-item
:label="t('views.system.dept.key')"
:label="t('views.system.tenant.key')"
name="key"
:label-col="{ span: 4 }"
v-show="modalState.from.parentId !== '0'"
@@ -803,7 +803,7 @@ onMounted(() => {
</a-row>
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.system.dept.status')" name="status">
<a-form-item :label="t('views.system.tenant.status')" name="status">
<a-select
v-model:value="modalState.from.status"
default-value="0"
@@ -836,7 +836,7 @@ onMounted(() => {
<a-row :gutter="16">
<a-col :span="12">
<a-form-item
:label="t('views.system.dept.type')"
:label="t('views.system.tenant.type')"
name="type"
:labelWrap="true"
>
@@ -851,7 +851,7 @@ onMounted(() => {
<a-col :lg="24" :md="24" :xs="24">
<a-form-item
:label="t('views.system.dept.key')"
:label="t('views.system.tenant.key')"
name="key"
:label-col="{ span: 4 }"
>
@@ -864,7 +864,7 @@ onMounted(() => {
</a-row>
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.system.dept.status')" name="status">
<a-form-item :label="t('views.system.tenant.status')" name="status">
<a-select
v-model:value="modalState.typeFrom.status"
default-value="0"