改动变量名

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 查询参数 * @param query 查询参数
* @returns object * @returns object
*/ */
export function listDept(query: Record<string, any>) { export function listTenant(query: Record<string, any>) {
return request({ return request({
url: '/system/tenant/list', url: '/system/tenant/list',
method: 'get', method: 'get',
@@ -15,24 +15,24 @@ export function listDept(query: Record<string, any>) {
/** /**
* 查询部门列表(排除节点) * 查询部门列表(排除节点)
* @param deptId 部门ID * @param tenantId 部门ID
* @returns object * @returns object
*/ */
export function listDeptExcludeChild(deptId: string | number) { export function listTenantExcludeChild(tenantId: string | number) {
return request({ return request({
url: `/system/tenant/list/exclude/${deptId}`, url: `/system/tenant/list/exclude/${tenantId}`,
method: 'get', method: 'get',
}); });
} }
/** /**
* 查询部门详细 * 查询部门详细
* @param deptId 部门ID * @param tenantId 部门ID
* @returns object * @returns object
*/ */
export function getDept(deptId: string | number) { export function getTenant(tenantId: string | number) {
return request({ return request({
url: `/system/tenant/${deptId}`, url: `/system/tenant/${tenantId}`,
method: 'get', method: 'get',
}); });
} }
@@ -42,7 +42,7 @@ export function getDept(deptId: string | number) {
* @param data 部门对象 * @param data 部门对象
* @returns object * @returns object
*/ */
export function addDept(data: Record<string, any>) { export function addTenant(data: Record<string, any>) {
return request({ return request({
url: '/system/tenant', url: '/system/tenant',
method: 'post', method: 'post',
@@ -55,7 +55,7 @@ export function addDept(data: Record<string, any>) {
* @param data 部门对象 * @param data 部门对象
* @returns object * @returns object
*/ */
export function updateDept(data: Record<string, any>) { export function updateTenant(data: Record<string, any>) {
return request({ return request({
url: '/system/tenant', url: '/system/tenant',
method: 'put', method: 'put',
@@ -65,12 +65,12 @@ export function updateDept(data: Record<string, any>) {
/** /**
* 删除部门 * 删除部门
* @param deptId 部门ID * @param TenantId 部门ID
* @returns object * @returns object
*/ */
export function delDept(deptId: string | number) { export function delTenant(TenantId: string | number) {
return request({ return request({
url: `/system/tenant/${deptId}`, url: `/system/tenant/${TenantId}`,
method: 'delete', method: 'delete',
}); });
} }
@@ -79,7 +79,7 @@ export function delDept(deptId: string | number) {
* 查询部门下拉树结构 * 查询部门下拉树结构
* @returns object * @returns object
*/ */
export function deptTreeSelect() { export function tenantTreeSelect() {
return request({ return request({
url: '/system/tenant/treeSelect', url: '/system/tenant/treeSelect',
method: 'get', method: 'get',
@@ -91,7 +91,7 @@ export function deptTreeSelect() {
* @param roleId 角色ID * @param roleId 角色ID
* @returns object * @returns object
*/ */
export function roleDeptTreeSelect(roleId: string | number) { export function roleTenantTreeSelect(roleId: string | number) {
return request({ return request({
url: `/system/tenant/roleDeptTreeSelect/${roleId}`, url: `/system/tenant/roleDeptTreeSelect/${roleId}`,
method: 'get', method: 'get',

View File

@@ -7,11 +7,11 @@ import useI18n from '@/hooks/useI18n';
import { SizeType } from 'ant-design-vue/lib/config-provider'; import { SizeType } from 'ant-design-vue/lib/config-provider';
import { ColumnsType } from 'ant-design-vue/lib/table'; import { ColumnsType } from 'ant-design-vue/lib/table';
import { import {
listDept, listTenant,
getDept, getTenant,
delDept, delTenant,
addDept, addTenant,
updateDept, updateTenant,
} from '@/api/system/tenant'; } from '@/api/system/tenant';
import useDictStore from '@/store/modules/dict'; import useDictStore from '@/store/modules/dict';
import { parseDateToStr } from '@/utils/date-utils'; import { parseDateToStr } from '@/utils/date-utils';
@@ -191,7 +191,7 @@ const modalStateFrom = Form.useForm(
required: true, required: true,
min: 1, min: 1,
max: 50, 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, required: true,
min: 1, min: 1,
max: 50, max: 50,
message: t('views.system.dept.type') + t('common.unableNull'), message: t('views.system.tenant.type') + t('common.unableNull'),
}, },
], ],
tenancyKey: [ tenancyKey: [
@@ -214,7 +214,7 @@ const modalStateTypeFrom = Form.useForm(
required: true, required: true,
min: 1, min: 1,
max: 50, 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) { 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 (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
if (tableFlag === 'tree') { if (tableFlag === 'tree') {
// 渲染左侧树列表 // 渲染左侧树列表
@@ -314,19 +314,19 @@ function fnModalVisibleByEdit(
if (parentId) { if (parentId) {
modalState.from.parentId = 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; modalState.visibleByEdit = true;
} else { } else {
//修改 //修改
if (modalState.confirmLoading) return; if (modalState.confirmLoading) return;
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true; modalState.confirmLoading = true;
getDept(tenantId) getTenant(tenantId)
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && res.data) { if (res.code === RESULT_CODE_SUCCESS && res.data) {
modalState.from = Object.assign(modalState.from, res.data); modalState.from = Object.assign(modalState.from, res.data);
modalState.title = modalState.title =
t('common.editText') + t('views.system.dept.classInfo'); t('common.editText') + t('views.system.tenant.classInfo');
modalState.visibleByEdit = true; modalState.visibleByEdit = true;
} else { } else {
message.error(t('common.getInfoFail'), 2); message.error(t('common.getInfoFail'), 2);
@@ -336,7 +336,7 @@ function fnModalVisibleByEdit(
modalState.confirmLoading = false; modalState.confirmLoading = false;
hide(); hide();
}); });
modalState.title = t('common.editText') + t('views.system.dept.classInfo'); modalState.title = t('common.editText') + t('views.system.tenant.classInfo');
modalState.visibleByEdit = true; modalState.visibleByEdit = true;
// 获取部门信息同时查询部门列表(排除节点) // 获取部门信息同时查询部门列表(排除节点)
} }
@@ -353,9 +353,9 @@ function fnModalOk() {
modalState.confirmLoading = true; modalState.confirmLoading = true;
const from = toRaw(modalState.from); 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); const hide = message.loading(t('common.loading'), 0);
dept tenant
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
message.success({ message.success({
@@ -391,10 +391,10 @@ function fnModalOk() {
function fnRecordDelete(tenantId: string | number) { function fnRecordDelete(tenantId: string | number) {
Modal.confirm({ Modal.confirm({
title: t('common.tipTitle'), title: t('common.tipTitle'),
content: t('views.system.dept.delSure', { deptId: tenantId }), content: t('views.system.tenant.delSure', { tenantId}),
onOk() { onOk() {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
delDept(tenantId).then(res => { delTenant(tenantId).then(res => {
hide(); hide();
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
message.success({ message.success({
@@ -430,19 +430,19 @@ function fnModalVisibleByType(
if (parentId) { if (parentId) {
modalState.typeFrom.parentId = 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; modalState.visibleByType = true;
} else { } else {
//修改 //修改
if (modalState.confirmLoading) return; if (modalState.confirmLoading) return;
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true; modalState.confirmLoading = true;
getDept(tenantId) getTenant(tenantId)
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS && res.data) { if (res.code === RESULT_CODE_SUCCESS && res.data) {
modalState.typeFrom = Object.assign(modalState.typeFrom, res.data); modalState.typeFrom = Object.assign(modalState.typeFrom, res.data);
modalState.typeTitle = modalState.typeTitle =
t('common.editText') + t('views.system.dept.type'); t('common.editText') + t('views.system.tenant.type');
modalState.visibleByType = true; modalState.visibleByType = true;
} else { } else {
message.error(t('common.getInfoFail'), 2); message.error(t('common.getInfoFail'), 2);
@@ -452,7 +452,7 @@ function fnModalVisibleByType(
modalState.confirmLoading = false; modalState.confirmLoading = false;
hide(); hide();
}); });
modalState.title = t('common.editText') + t('views.system.dept.classInfo'); modalState.title = t('common.editText') + t('views.system.tenant.classInfo');
modalState.visibleByType = true; modalState.visibleByType = true;
// 获取部门信息同时查询部门列表(排除节点) // 获取部门信息同时查询部门列表(排除节点)
} }
@@ -469,9 +469,9 @@ function fnModalTypeOk() {
modalState.confirmLoading = true; modalState.confirmLoading = true;
const from = toRaw(modalState.typeFrom); const from = toRaw(modalState.typeFrom);
from.parentId = state.selectedNode; 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); const hide = message.loading(t('common.loading'), 0);
dept tenant
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
message.success({ message.success({
@@ -509,10 +509,10 @@ function fnTypeRecordDelete(
) { ) {
Modal.confirm({ Modal.confirm({
title: t('common.tipTitle'), title: t('common.tipTitle'),
content: t('views.system.dept.delSure', { deptId: tenantId }), content: t('views.system.tenant.delSure', { tenantId }),
onOk() { onOk() {
const hide = message.loading(t('common.loading'), 0); const hide = message.loading(t('common.loading'), 0);
delDept(tenantId).then(res => { delTenant(tenantId).then(res => {
hide(); hide();
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
message.success({ message.success({
@@ -634,10 +634,10 @@ onMounted(() => {
</template> </template>
</a-button> </a-button>
<a-typography-text v-if="state.selectedName"> <a-typography-text v-if="state.selectedName">
{{ 'Tenant Name: ' + state.selectedName }} {{ state.selectedName +'-Tenancy Asset '}}
</a-typography-text> </a-typography-text>
<a-typography-text type="danger" v-else> <a-typography-text type="danger" v-else>
{{ t('views.system.dept.treeSelectTip') }} {{ t('views.system.tenant.treeSelectTip') }}
</a-typography-text> </a-typography-text>
</template> </template>
@@ -756,7 +756,7 @@ onMounted(() => {
:labelWrap="true" :labelWrap="true"
> >
<a-form-item <a-form-item
:label="t('views.system.dept.className')" :label="t('views.system.tenant.className')"
name="tenantName" name="tenantName"
v-bind="modalStateFrom.validateInfos.tenantName" v-bind="modalStateFrom.validateInfos.tenantName"
:label-col="{ span: 4 }" :label-col="{ span: 4 }"
@@ -773,7 +773,7 @@ onMounted(() => {
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="12"> <a-col :span="12">
<a-form-item <a-form-item
:label="t('views.system.dept.type')" :label="t('views.system.tenant.type')"
name="type" name="type"
:labelWrap="true" :labelWrap="true"
v-show="modalState.from.parentId !== '0'" v-show="modalState.from.parentId !== '0'"
@@ -789,7 +789,7 @@ onMounted(() => {
<a-col :lg="24" :md="24" :xs="24"> <a-col :lg="24" :md="24" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.dept.key')" :label="t('views.system.tenant.key')"
name="key" name="key"
:label-col="{ span: 4 }" :label-col="{ span: 4 }"
v-show="modalState.from.parentId !== '0'" v-show="modalState.from.parentId !== '0'"
@@ -803,7 +803,7 @@ onMounted(() => {
</a-row> </a-row>
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24"> <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 <a-select
v-model:value="modalState.from.status" v-model:value="modalState.from.status"
default-value="0" default-value="0"
@@ -836,7 +836,7 @@ onMounted(() => {
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="12"> <a-col :span="12">
<a-form-item <a-form-item
:label="t('views.system.dept.type')" :label="t('views.system.tenant.type')"
name="type" name="type"
:labelWrap="true" :labelWrap="true"
> >
@@ -851,7 +851,7 @@ onMounted(() => {
<a-col :lg="24" :md="24" :xs="24"> <a-col :lg="24" :md="24" :xs="24">
<a-form-item <a-form-item
:label="t('views.system.dept.key')" :label="t('views.system.tenant.key')"
name="key" name="key"
:label-col="{ span: 4 }" :label-col="{ span: 4 }"
> >
@@ -864,7 +864,7 @@ onMounted(() => {
</a-row> </a-row>
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24"> <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 <a-select
v-model:value="modalState.typeFrom.status" v-model:value="modalState.typeFrom.status"
default-value="0" default-value="0"