diff --git a/src/api/setting.ts b/src/api/setting.ts index ee48058..3f4adc1 100644 --- a/src/api/setting.ts +++ b/src/api/setting.ts @@ -24,6 +24,9 @@ export interface PaginationResult { export type UserStatus = 1 | 2; // 1: 启用, 2: 禁用 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 interface DepartmentFormParams { @@ -187,6 +190,33 @@ export interface projectSettingInfo { createdAt?: string; updatedAt?: string; } +export interface projectTypeInfo { + id: number; + systemTenantId: number; // 租户id + name: string; // 类型名称 + color: string; // 颜色 + type: 1 | 2; // 1系统类型,2租户类型 + createUserId: number; // 创建人id + isCheck: CheckedStatus; // 是否选择:1是,2否 + isDelete?: DeleteStatus; // 是否选择:1是,0否 + createdAt?: string; + updatedAt?: string; +} +export interface ProvinceItem { + id: number; + name: string; // 省份 + code: string; // 编码 + isCheck: 0 | 1; +} +export interface LabelForm { + id?: number; + name: string; + color: string; +} +export interface CheckProjectParam { + id?: number; + is_check: projectTypeChecked; +} // ==================== 响应类型别名 ==================== export type DepartmentFormRes = HttpResponse; @@ -206,6 +236,15 @@ export type SafeInfoRes = HttpResponse<{ safeSetting: SafeInfo }>; export type SettingProjectRes = HttpResponse<{ projectSetting: projectSettingInfo; }>; +export type SettingProjectTypeListRes = HttpResponse<{ + projectTypesList: projectTypeInfo[]; +}>; +export type SettingProjectTypeRes = HttpResponse<{ + projectType: projectTypeInfo; +}>; +export type SettingProjectProvinceRes = HttpResponse<{ + list: ProvinceItem[]; +}>; // ==================== 部门相关 API ==================== export function createDepartment( @@ -334,3 +373,51 @@ export function saveProjectSetting( ): Promise { return axios.post('setting/saveProjectSetting', params); } +// 数据字典-项目管理-全部项目类型列表 +export function getAllProjectTypeList(): Promise { + return axios.get('dictionary/getAllProjectTypeList'); +} +// 数据字典-项目管理-单个项目类型信息 +export function getProjectTypeById(id: number): Promise { + return axios.get(`dictionary/getProjectType?id=${id}`); +} +// 数据字典-项目管理-项目地址列表 +export function getProvinceList(): Promise { + return axios.get(`dictionary/getProvinceList`); +} +// 数据字典-项目管理-创建项目类型 +export function createProjectType(params: LabelForm): Promise { + return axios.post(`dictionary/createProjectType`, params); +} +// 数据字典-项目管理-更新项目类型信息 +export function updateProjectType(params: LabelForm): Promise { + return axios.post(`dictionary/updateProjectType`, params); +} +// 数据字典-项目管理-删除项目类型 +export function delProjectType(id: number): Promise { + return axios.get(`dictionary/delProjectType?id=${id}`); +} +// 数据字典-项目管理-启用/禁用项目类型(单个) +export function checkProjectType( + params: CheckProjectParam +): Promise { + return axios.post(`dictionary/checkProjectType`, params); +} +// 数据字典-项目管理-启用/禁用项目类型(全选) +export function checkAllProjectType( + params: CheckProjectParam +): Promise { + return axios.post(`dictionary/checkAllProjectType`, params); +} +// 数据字典-项目管理-启用/禁用省份(单个) +export function checkProvince( + params: CheckProjectParam +): Promise { + return axios.post(`dictionary/checkProvince`, params); +} +// 数据字典-项目管理-启用/禁用省份(全选) +export function checkAllProvince( + params: CheckProjectParam +): Promise { + return axios.post(`dictionary/checkAllProvince`, params); +} diff --git a/src/views/setting/system/data-dictionary/components/project-card.vue b/src/views/setting/system/data-dictionary/components/project-card.vue new file mode 100644 index 0000000..0449085 --- /dev/null +++ b/src/views/setting/system/data-dictionary/components/project-card.vue @@ -0,0 +1,288 @@ + + + + + diff --git a/src/views/setting/system/data-dictionary/components/project-label-form-modal.vue b/src/views/setting/system/data-dictionary/components/project-label-form-modal.vue new file mode 100644 index 0000000..7c571eb --- /dev/null +++ b/src/views/setting/system/data-dictionary/components/project-label-form-modal.vue @@ -0,0 +1,189 @@ + + + + + diff --git a/src/views/setting/system/data-dictionary/contrant.ts b/src/views/setting/system/data-dictionary/contrant.ts new file mode 100644 index 0000000..cde012f --- /dev/null +++ b/src/views/setting/system/data-dictionary/contrant.ts @@ -0,0 +1,63 @@ +const dataDictionaryTabs = [ + { id: 1, text: '系统' }, + { id: 2, text: '项目管理' }, + { id: 3, text: '空间管理' }, + { id: 4, text: '合同管理' }, + { id: 5, text: '租客管理' }, + { id: 6, text: '财务管理' }, + { id: 7, text: '物业管理' }, +]; +const projectHouse = [ + { + title: '默认单价', + options: [ + { type: 1, label: '元/㎡*月' }, + { type: 2, label: '元/㎡*天' }, + ], + }, + { + title: '面积精度', + options: [ + { type: 1, label: '2位数' }, + { type: 2, label: '1位数' }, + { type: 3, label: '整数' }, + ], + }, + { + title: '房源即将到期设置', + options: [ + { type: 1, label: '30' }, + { type: 2, label: '60' }, + { type: 3, label: '90' }, + ], + }, +]; +// 在租面积 +const inRentedAreaOptions = [ + { value: '1', label: '合同起始日期' }, + { value: '2', label: '合同免租期' }, + { value: '3', label: '合同装修期' }, + { value: '4', label: '房源保留' }, +]; +// 可租面积 +const availableAreaOptions = [ + { value: '1', label: '房源招商' }, + { value: '2', label: '房源保留' }, + { value: '3', label: '房源保留' }, + { value: '4', label: '房源下架' }, +]; +// 天数定义 +const dayeDfinition = [ + { value: 1, label: '按本年累计天数计算(从1月1日至今)' }, + { value: 2, label: '按本年整年天数 计算(本年:365天)' }, + { value: 3, label: '按本月累计天数 计算(从本月1日至今)' }, + { value: 4, label: '按本月整月天数 计算(本月:31天)' }, +]; + +export { + dataDictionaryTabs, + projectHouse, + inRentedAreaOptions, + availableAreaOptions, + dayeDfinition, +}; diff --git a/src/views/setting/system/data-dictionary/index.vue b/src/views/setting/system/data-dictionary/index.vue index c8cb69c..0cecf6b 100644 --- a/src/views/setting/system/data-dictionary/index.vue +++ b/src/views/setting/system/data-dictionary/index.vue @@ -1,3 +1,130 @@ + + + + diff --git a/src/views/setting/system/components/department-form-modal.vue b/src/views/setting/system/organization/components/department-form-modal.vue similarity index 100% rename from src/views/setting/system/components/department-form-modal.vue rename to src/views/setting/system/organization/components/department-form-modal.vue diff --git a/src/views/setting/system/organization/index.vue b/src/views/setting/system/organization/index.vue index 5b4f202..80641c0 100644 --- a/src/views/setting/system/organization/index.vue +++ b/src/views/setting/system/organization/index.vue @@ -111,7 +111,7 @@ } from '@/api/setting'; import { debounce } from '@/utils'; import { Message } from '@arco-design/web-vue'; - import departmentFormModal from '../components/department-form-modal.vue'; + import departmentFormModal from './components/department-form-modal.vue'; const { departmentListData,