From 503b5968ff2becbe26610ea743ca9c08e42f7c31 Mon Sep 17 00:00:00 2001 From: Zzz1zz Date: Tue, 22 Jul 2025 23:22:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AE=BE=E7=BD=AE->=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=AD=97=E5=85=B8->=E7=A7=9F=E5=AE=A2=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- src/api/setting.ts | 113 ++++- ...el-form-modal.vue => label-form-modal.vue} | 48 ++- .../components/project-card.vue | 61 +-- .../data-dictionary/components/room-card.vue | 196 +++++++++ .../components/tenant-card.vue | 407 ++++++++++++++++++ .../setting/system/data-dictionary/index.vue | 7 +- 7 files changed, 778 insertions(+), 56 deletions(-) rename src/views/setting/system/data-dictionary/components/{project-label-form-modal.vue => label-form-modal.vue} (78%) create mode 100644 src/views/setting/system/data-dictionary/components/room-card.vue create mode 100644 src/views/setting/system/data-dictionary/components/tenant-card.vue diff --git a/.eslintrc.js b/.eslintrc.js index 3b1a166..ceb29c9 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -51,7 +51,7 @@ module.exports = { '@typescript-eslint/ban-ts-comment': 0, '@typescript-eslint/no-unused-vars': 1, '@typescript-eslint/no-empty-function': 1, - '@typescript-eslint/no-explicit-any': 1, // 改为警告 + '@typescript-eslint/no-explicit-any': 0, // 改为警告 'no-console': process.env.NODE_ENV === 'production' ? 2 : 1, // 生产环境禁用console 'import/extensions': [ 2, diff --git a/src/api/setting.ts b/src/api/setting.ts index 3f4adc1..dfb7a84 100644 --- a/src/api/setting.ts +++ b/src/api/setting.ts @@ -26,7 +26,8 @@ export type ManagerStatus = 1 | 2; // 1: 是主管, 2: 否 export type DataType = 1 | 2 | 3; // 1: 全部数据权限, 2: 自定义数据权限, 3: 仅本人数据 export type CheckedStatus = 1 | 2; // 是否选择:1是,2否 export type DeleteStatus = 0 | 1; // 是否选择:1是 0否 -export type projectTypeChecked = 0 | 1; // 是否选择:1是 0否 +export type ProjectTypeChecked = 0 | 1; // 是否选择:1是 0否 +export type TenantDictionaryType = 1 | 2 | 3 | 4; // 类型:1租客类型,2租客来源,3租客行业分类,4租客企业规模 // ==================== 部门相关类型 ==================== export interface DepartmentFormParams { @@ -208,14 +209,22 @@ export interface ProvinceItem { code: string; // 编码 isCheck: 0 | 1; } -export interface LabelForm { +export interface DictionaryForm { id?: number; name: string; - color: string; + color?: string; + type?: TenantDictionaryType | null; } export interface CheckProjectParam { id?: number; - is_check: projectTypeChecked; + is_check: ProjectTypeChecked; + type?: TenantDictionaryType; +} +export interface SettingTenantDictionaryObj { + TenantTypeList: projectTypeInfo[]; + TenantSourceList: projectTypeInfo[]; + TenantIndustryList: projectTypeInfo[]; + TenantEnterpriseList: projectTypeInfo[]; } // ==================== 响应类型别名 ==================== @@ -245,7 +254,15 @@ export type SettingProjectTypeRes = HttpResponse<{ export type SettingProjectProvinceRes = HttpResponse<{ list: ProvinceItem[]; }>; - +export type SettingRoomTagsRes = HttpResponse<{ + roomTagsList: projectTypeInfo[]; +}>; +export type SettingRoomTagRes = HttpResponse<{ + roomTag: projectTypeInfo; +}>; +export type SettingTenantDictionaryRes = HttpResponse<{ + allList: SettingTenantDictionaryObj; +}>; // ==================== 部门相关 API ==================== export function createDepartment( params: DepartmentFormParams @@ -386,11 +403,15 @@ export function getProvinceList(): Promise { return axios.get(`dictionary/getProvinceList`); } // 数据字典-项目管理-创建项目类型 -export function createProjectType(params: LabelForm): Promise { +export function createProjectType( + params: DictionaryForm +): Promise { return axios.post(`dictionary/createProjectType`, params); } // 数据字典-项目管理-更新项目类型信息 -export function updateProjectType(params: LabelForm): Promise { +export function updateProjectType( + params: DictionaryForm +): Promise { return axios.post(`dictionary/updateProjectType`, params); } // 数据字典-项目管理-删除项目类型 @@ -421,3 +442,81 @@ export function checkAllProvince( ): Promise { return axios.post(`dictionary/checkAllProvince`, params); } +// 数据字典-空间管理-全部房源标签列表 +export function getRoomTagList(): Promise { + return axios.get(`dictionary/getRoomTagList`); +} +// 数据字典-项目管理-单个房源标签信息 +export function getRoomTagById(id: number): Promise { + return axios.get(`dictionary/getRoomTag?id=${id}`); +} +// 数据字典-空间管理-创建房源标签 +export function createRoomTag(params: DictionaryForm): Promise { + return axios.post(`dictionary/createRoomTag`, params); +} +// 数据字典-空间管理-更新房源标签 +export function updateRoomTag(params: DictionaryForm): Promise { + return axios.post(`dictionary/updateRoomTag`, params); +} +// 数据字典-空间管理-删除房源标签 +export function delRoomTag(id: number): Promise { + return axios.get(`dictionary/delRoomTag?id=${id}`); +} +// 数据字典-空间管理-禁用/启用 房源标签(单个) +export function checkRoomTag(params: CheckProjectParam): Promise { + return axios.post(`dictionary/checkRoomTag`, params); +} +// 数据字典-空间管理-禁用/启用 房源标签(全选) +export function checkAllRoomTag( + params: CheckProjectParam +): Promise { + return axios.post(`dictionary/checkAllRoomTag`, params); +} +// 数据字典-租客管理-全部租客标签列表(包含所有类型标签) +export function getAllTenantDictionaryList(): Promise { + return axios.get(`dictionary/getAllTenantDictionaryList`); +} +// 数据字典-租客管理-单个租客标签信息 +export function getTenantDictionary( + id: number, + type: TenantDictionaryType +): Promise { + return axios.get(`dictionary/getTenantDictionary?id=${id}&type=${type}`); +} +// 数据字典-租客管理-创建租客标签 +export function createTenantDictionary( + params: DictionaryForm +): Promise { + return axios.post(`dictionary/createTenantDictionary`, params); +} +// 数据字典-租客管理-更新租客标签 +export function updateTenantDictionary( + params: DictionaryForm +): Promise { + return axios.post(`dictionary/updateTenantDictionary`, params); +} +// 数据字典-租客管理-删除租客标签 +export function delTenantDictionary( + id: number, + type: TenantDictionaryType +): Promise { + return axios.get(`dictionary/delTenantDictionary?id=${id}&type=${type}`); +} +// 数据字典-租客管理-禁用/启用 租客标签(单个) +export function checkTenantDictionary( + params: CheckProjectParam +): Promise { + return axios.post(`dictionary/checkTenantDictionary`, params); +} +// 数据字典-租客管理-禁用/启用 租客标签(全选) +export function checkAllTenantDictionary( + params: CheckProjectParam +): Promise { + return axios.post(`dictionary/checkAllTenantDictionary`, params); +} +// 数据字典-租客管理--已启用列表(type:1租客类型,2租客来源,3租客行业分类,4租客企业规模) +export function getTenantDictionaryListByType( + type: TenantDictionaryType +): Promise { + return axios.get(`dictionary/getTenantDictionaryList?type=${type}`); +} diff --git a/src/views/setting/system/data-dictionary/components/project-label-form-modal.vue b/src/views/setting/system/data-dictionary/components/label-form-modal.vue similarity index 78% rename from src/views/setting/system/data-dictionary/components/project-label-form-modal.vue rename to src/views/setting/system/data-dictionary/components/label-form-modal.vue index 7c571eb..9a536c0 100644 --- a/src/views/setting/system/data-dictionary/components/project-label-form-modal.vue +++ b/src/views/setting/system/data-dictionary/components/label-form-modal.vue @@ -1,8 +1,9 @@