mirror of
http://183.237.82.114:10086/kilo/leaser_front.git
synced 2026-10-23 20:36:02 +00:00
fix: 修复大包文件引入报错
This commit is contained in:
parent
ff528ae7ef
commit
40a28f38cb
17 changed files with 351 additions and 229 deletions
|
|
@ -1,4 +1,12 @@
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import {
|
||||||
|
AllProjectListRes,
|
||||||
|
ProjectListRes,
|
||||||
|
CreateProjectParam,
|
||||||
|
ProjectDetailRes,
|
||||||
|
} from '@/types/business';
|
||||||
|
import { PaginationParams } from '@/types/comm';
|
||||||
|
import { HttpResponse } from './interceptor';
|
||||||
// import type { RouteRecordNormalized } from 'vue-router';
|
// import type { RouteRecordNormalized } from 'vue-router';
|
||||||
// import { UserState } from '@/store/modules/user/types';
|
// import { UserState } from '@/store/modules/user/types';
|
||||||
|
|
||||||
|
|
@ -8,21 +16,29 @@ export interface ProjectRecord {
|
||||||
type: string;
|
type: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ProjectParams extends Partial<ProjectRecord> {
|
// 全部项目列表(包含楼栋)
|
||||||
current: number;
|
export function getAllProjectList(): Promise<AllProjectListRes> {
|
||||||
pageSize: number;
|
return axios.get(`project/getProjectBuildingList`);
|
||||||
}
|
|
||||||
|
|
||||||
// 全部项目列表
|
|
||||||
export function getAllProjectList() {
|
|
||||||
return axios.get<any>('/project/getAllProjectList');
|
|
||||||
}
|
|
||||||
|
|
||||||
// 项目信息
|
|
||||||
export function getProjectDetail(id: string) {
|
|
||||||
return axios.get<any>(`/project/getProject?id=${id}`);
|
|
||||||
}
|
}
|
||||||
// 项目列表(分页)
|
// 项目列表(分页)
|
||||||
export function queryPolicyList(params: ProjectParams) {
|
export function getProjectList(
|
||||||
return axios.post<any>('/project/getProjectList', { params });
|
params: PaginationParams
|
||||||
|
): Promise<ProjectListRes> {
|
||||||
|
return axios.post('project/getProjectList', params);
|
||||||
|
}
|
||||||
|
// 创建项目
|
||||||
|
export function createProject(
|
||||||
|
params: CreateProjectParam
|
||||||
|
): Promise<HttpResponse> {
|
||||||
|
return axios.post('project/createProject', params);
|
||||||
|
}
|
||||||
|
// 项目信息
|
||||||
|
export function getProjectDetail(id: number): Promise<ProjectDetailRes> {
|
||||||
|
return axios.get(`project/getProject?id=${id}`);
|
||||||
|
}
|
||||||
|
// 更新项目
|
||||||
|
export function updateProject(
|
||||||
|
params: CreateProjectParam
|
||||||
|
): Promise<HttpResponse> {
|
||||||
|
return axios.post('project/updateProject', params);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import {
|
||||||
DepartmentFormRes,
|
DepartmentFormRes,
|
||||||
DepartmentListRes,
|
DepartmentListRes,
|
||||||
DepartmentDetailRes,
|
DepartmentDetailRes,
|
||||||
PaginationParams,
|
|
||||||
AllUserListRes,
|
AllUserListRes,
|
||||||
FormUserItem,
|
FormUserItem,
|
||||||
UserInfoRes,
|
UserInfoRes,
|
||||||
|
|
@ -27,7 +26,6 @@ import {
|
||||||
SettingRoomTagsRes,
|
SettingRoomTagsRes,
|
||||||
SettingRoomTagRes,
|
SettingRoomTagRes,
|
||||||
SettingTenantDictionaryRes,
|
SettingTenantDictionaryRes,
|
||||||
TenantDictionaryType,
|
|
||||||
SettingContractNumbeRes,
|
SettingContractNumbeRes,
|
||||||
CreateCodeSettingParam,
|
CreateCodeSettingParam,
|
||||||
FeeManagementListRes,
|
FeeManagementListRes,
|
||||||
|
|
@ -38,6 +36,7 @@ import {
|
||||||
SettingContractTermListRes,
|
SettingContractTermListRes,
|
||||||
SettingContractTermInfo,
|
SettingContractTermInfo,
|
||||||
} from '@/types/setting';
|
} from '@/types/setting';
|
||||||
|
import { PaginationParams, TenantDictionaryType } from '@/types/comm';
|
||||||
import { HttpResponse } from './interceptor';
|
import { HttpResponse } from './interceptor';
|
||||||
|
|
||||||
// ==================== 部门相关 API ====================
|
// ==================== 部门相关 API ====================
|
||||||
|
|
|
||||||
|
|
@ -1,75 +1,96 @@
|
||||||
// 项目类型常量定义
|
import { HttpResponse } from '@/api/interceptor';
|
||||||
export const PROJECT_TYPE = {
|
import {
|
||||||
COMMERCIAL_COMPLEX: '1',
|
PaginationParams,
|
||||||
OFFICE_BUILDING: '2',
|
PaginationResult,
|
||||||
INDUSTRIAL_PARK: '3',
|
BaseEntity,
|
||||||
} as const;
|
DeleteStatus,
|
||||||
|
UserStatus,
|
||||||
|
ProjectType,
|
||||||
|
} from './comm';
|
||||||
|
|
||||||
// 租户状态常量
|
export interface BuildingItem {
|
||||||
export const TENANT_STATUS = {
|
id?: string; // 楼栋id
|
||||||
ACTIVE: 'active',
|
name: string; // 楼栋名称
|
||||||
EXPIRED: 'expired',
|
up_floor?: number; // 地上层数
|
||||||
PENDING: 'pending',
|
down_floor?: number; // 地下层数
|
||||||
} as const;
|
}
|
||||||
|
export interface AllProjectsItem {
|
||||||
// 合同状态常量
|
id: number; // 项目id
|
||||||
export const CONTRACT_STATUS = {
|
name: string; // 项目名称
|
||||||
DRAFT: 'draft',
|
buildings: BuildingItem[];
|
||||||
ACTIVE: 'active',
|
}
|
||||||
EXPIRED: 'expired',
|
export interface ProjectItem extends BaseEntity {
|
||||||
TERMINATED: 'terminated',
|
systemTenantId?: number;
|
||||||
} as const;
|
name: string; // 项目名称
|
||||||
|
type: number;
|
||||||
// 类型定义
|
provinceId: number;
|
||||||
export type ProjectType = (typeof PROJECT_TYPE)[keyof typeof PROJECT_TYPE];
|
cityId: number;
|
||||||
export type TenantStatus = (typeof TENANT_STATUS)[keyof typeof TENANT_STATUS];
|
districtId: number;
|
||||||
export type ContractStatus =
|
address: string;
|
||||||
(typeof CONTRACT_STATUS)[keyof typeof CONTRACT_STATUS];
|
images: string[];
|
||||||
|
createUserId: number;
|
||||||
// 项目相关类型定义
|
isDelete: DeleteStatus;
|
||||||
export interface ProjectRecord {
|
status: UserStatus;
|
||||||
id?: string;
|
imageUrls: string[];
|
||||||
name: string;
|
typeName: string; // 类型名称
|
||||||
type: ProjectType;
|
district: string;
|
||||||
size: string;
|
province: string;
|
||||||
kezu: string;
|
city: string;
|
||||||
rate: number;
|
roomNum: number;
|
||||||
count: string;
|
roomArea: number;
|
||||||
create_time: string;
|
rentArea: number;
|
||||||
|
useArea: number;
|
||||||
|
rentRate: number;
|
||||||
|
RoomAreaStr: string; // 列表显示的计租面积
|
||||||
|
RentAreaStr: string; // 列表显示的招商面积
|
||||||
|
RentRateStr: string; // 列表显示的出租率
|
||||||
}
|
}
|
||||||
|
|
||||||
export const PROJECT_TYPE_COLORS: Record<ProjectType, string> = {
|
export type AllProjectListRes = HttpResponse<{
|
||||||
[PROJECT_TYPE.COMMERCIAL_COMPLEX]: 'orangered',
|
projectsList: AllProjectsItem[];
|
||||||
[PROJECT_TYPE.OFFICE_BUILDING]: 'green',
|
}>;
|
||||||
[PROJECT_TYPE.INDUSTRIAL_PARK]: 'gold',
|
export type ProjectListRes = HttpResponse<{
|
||||||
};
|
page: PaginationParams & PaginationResult;
|
||||||
|
projectsList?: ProjectItem[];
|
||||||
export const PROJECT_TYPE_LABELS: Record<ProjectType, string> = {
|
}>;
|
||||||
[PROJECT_TYPE.COMMERCIAL_COMPLEX]: '商业综合体',
|
export interface CreateProjectParam {
|
||||||
[PROJECT_TYPE.OFFICE_BUILDING]: '写字楼',
|
id?: number;
|
||||||
[PROJECT_TYPE.INDUSTRIAL_PARK]: '园区',
|
type: ProjectType; // 项目类型:1写字楼,2商业综合体,3园区
|
||||||
};
|
name: string; // 楼栋名称
|
||||||
|
province_id: number; // 省份id
|
||||||
// 租户相关类型
|
city_id: number; // 城市id
|
||||||
export interface TenantRecord {
|
district_id: number; // 区域id
|
||||||
id: string;
|
address: string; // 详细地址
|
||||||
name: string;
|
images: string[]; // 图片数组
|
||||||
phone: string;
|
buildings: BuildingItem[]; // 楼栋数据
|
||||||
email?: string;
|
}
|
||||||
contractStartDate: string;
|
export interface BuildingInfo extends BaseEntity {
|
||||||
contractEndDate: string;
|
projectId: number; // 项目id
|
||||||
projectId: string;
|
name: string; // 楼栋名称
|
||||||
status: TenantStatus;
|
upfloor: number; // 地上层数
|
||||||
|
downFloor: number; // 地下层数
|
||||||
|
createUserId: number;
|
||||||
|
isDelete: DeleteStatus;
|
||||||
|
status: UserStatus; // 状态:1启用,2禁用
|
||||||
|
}
|
||||||
|
export interface ProjectInfo extends BaseEntity {
|
||||||
|
systemTenantId: 17; // 租户id
|
||||||
|
name: string; // 项目名称
|
||||||
|
type: ProjectType; // 类型:1写字楼,2商业综合体,3园区
|
||||||
|
provinceId: number; // 省份id
|
||||||
|
cityId: number; // 城市id
|
||||||
|
districtId: number; // 区id
|
||||||
|
address: string; // 详细地址
|
||||||
|
images: string[];
|
||||||
|
createUserId: number; // 创建人id
|
||||||
|
isDelete: DeleteStatus;
|
||||||
|
status: UserStatus; // 状态:1 启用,2 禁用
|
||||||
|
imagesUrl: string[]; // 图片数组
|
||||||
|
typeName: string; // 类型名称
|
||||||
|
province: string; // 省份
|
||||||
|
city: string; // 城市
|
||||||
|
district: string; // 区
|
||||||
|
buildings: BuildingInfo[]; // 楼栋数组
|
||||||
}
|
}
|
||||||
|
|
||||||
// 合同相关类型
|
export type ProjectDetailRes = ProjectInfo;
|
||||||
export interface ContractRecord {
|
|
||||||
id: string;
|
|
||||||
contractNo: string;
|
|
||||||
tenantId: string;
|
|
||||||
projectId: string;
|
|
||||||
startDate: string;
|
|
||||||
endDate: string;
|
|
||||||
rentAmount: number;
|
|
||||||
status: ContractStatus;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
32
src/types/comm.ts
Normal file
32
src/types/comm.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
// ==================== 通用类型定义 ====================
|
||||||
|
export interface BaseEntity {
|
||||||
|
id: number;
|
||||||
|
createdAt: string;
|
||||||
|
updatedAt: string;
|
||||||
|
}
|
||||||
|
export interface PaginationParams {
|
||||||
|
keyword?: string;
|
||||||
|
role_id?: number | null;
|
||||||
|
page?: number;
|
||||||
|
page_size?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PaginationResult {
|
||||||
|
total?: number;
|
||||||
|
total_pages?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UserStatus = 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 ManagerStatus = 1 | 2; // 1: 是主管, 2: 否
|
||||||
|
export type ProjectTypeChecked = 0 | 1; // 是否选择:1是 0否
|
||||||
|
export type TenantDictionaryType = 1 | 2 | 3 | 4; // 类型:1租客类型,2租客来源,3租客行业分类,4租客企业规模
|
||||||
|
export type ContractSettingStatus = 0 | 1; // 0不回收,1回收
|
||||||
|
export type delCodeRecycling = 0 | 1; // 删除合同编号回收:0不回收,1回收
|
||||||
|
export type cancelCodeRecycling = 0 | 1; // 作废合同编号回收:0不回收,1回收
|
||||||
|
export type CommStatus = 1 | 2; // 1:是 2否
|
||||||
|
export type FeeManagementType = 1 | 2; // 费项属性:1收入费项,2支出费项
|
||||||
|
export type FeeType = 1 | 2 | 3 | 4; // 费项类型:1租赁类,2物业类,3特殊类,4其他类
|
||||||
|
export type ProjectType = 1 | 2 | 3; // 项目类型:1写字楼,2商业综合体,3园区
|
||||||
|
|
@ -1,37 +1,22 @@
|
||||||
import type { UserPermission } from '@/types/api';
|
import type { UserPermission } from '@/types/api';
|
||||||
import { HttpResponse } from '@/api/interceptor';
|
import { HttpResponse } from '@/api/interceptor';
|
||||||
// ==================== 通用类型定义 ====================
|
import {
|
||||||
export interface BaseEntity {
|
BaseEntity,
|
||||||
id: number;
|
PaginationParams,
|
||||||
createdAt: string;
|
PaginationResult,
|
||||||
updatedAt: string;
|
UserStatus,
|
||||||
}
|
DataType,
|
||||||
|
CheckedStatus,
|
||||||
export interface PaginationParams {
|
DeleteStatus,
|
||||||
keyword?: string;
|
ContractSettingStatus,
|
||||||
role_id?: number | null;
|
delCodeRecycling,
|
||||||
page?: number;
|
CommStatus,
|
||||||
page_size?: number;
|
FeeManagementType,
|
||||||
}
|
FeeType,
|
||||||
|
ManagerStatus,
|
||||||
export interface PaginationResult {
|
ProjectTypeChecked,
|
||||||
total?: number;
|
TenantDictionaryType,
|
||||||
total_pages?: number;
|
} from './comm';
|
||||||
}
|
|
||||||
|
|
||||||
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 type TenantDictionaryType = 1 | 2 | 3 | 4; // 类型:1租客类型,2租客来源,3租客行业分类,4租客企业规模
|
|
||||||
export type ContractSettingStatus = 0 | 1; // 0不回收,1回收
|
|
||||||
export type delCodeRecycling = 0 | 1; // 删除合同编号回收:0不回收,1回收
|
|
||||||
export type cancelCodeRecycling = 0 | 1; // 作废合同编号回收:0不回收,1回收
|
|
||||||
export type CommStatus = 1 | 2; // 1:是 2否
|
|
||||||
export type FeeManagementType = 1 | 2; // 费项属性:1收入费项,2支出费项
|
|
||||||
export type FeeType = 1 | 2 | 3 | 4; // 费项类型:1租赁类,2物业类,3特殊类,4其他类
|
|
||||||
|
|
||||||
// ==================== 部门相关类型 ====================
|
// ==================== 部门相关类型 ====================
|
||||||
export interface DepartmentFormParams {
|
export interface DepartmentFormParams {
|
||||||
|
|
|
||||||
|
|
@ -8,4 +8,11 @@ export const financeFeeFeriodicityList = [
|
||||||
{ value: 1, label: '周期性付款' },
|
{ value: 1, label: '周期性付款' },
|
||||||
{ value: 2, label: '一次性付款' },
|
{ value: 2, label: '一次性付款' },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const projectTypeList = [
|
||||||
|
{ value: 1, label: '写字楼' },
|
||||||
|
{ value: 2, label: '商业综合体' },
|
||||||
|
{ value: 3, label: '园区' },
|
||||||
|
];
|
||||||
|
|
||||||
export default {};
|
export default {};
|
||||||
|
|
|
||||||
122
src/views/business/project/drawer/project-form-drawer.vue
Normal file
122
src/views/business/project/drawer/project-form-drawer.vue
Normal file
|
|
@ -0,0 +1,122 @@
|
||||||
|
<template>
|
||||||
|
<a-drawer
|
||||||
|
:width="670"
|
||||||
|
:visible="visible"
|
||||||
|
:title="isEdit ? '编辑条款设置' : '编辑条款设置'"
|
||||||
|
unmount-on-close
|
||||||
|
@ok="handleOk"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
>
|
||||||
|
<a-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
auto-label-width
|
||||||
|
layout="vertical"
|
||||||
|
>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="12">
|
||||||
|
<!-- 项目名称 -->
|
||||||
|
<a-form-item label="条款名称" field="name" required>
|
||||||
|
<a-input
|
||||||
|
v-model="form.name"
|
||||||
|
:placeholder="$t('please.enter', { placeholder: '项目名称' })"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<!-- 项目类型 -->
|
||||||
|
<a-form-item label="项目类型" field="name" required>
|
||||||
|
<a-select v-model="form.type" placeholder="请选择项目类型">
|
||||||
|
<a-option
|
||||||
|
v-for="item in projectTypeList"
|
||||||
|
:key="item.value"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
{{ item.label }}
|
||||||
|
</a-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<!-- 项目地址 -->
|
||||||
|
<a-form-item label="项目地址" field="type" required>
|
||||||
|
<!-- <a-space>
|
||||||
|
<a-select v-model="form.finance_fee_id" :style="{ width: '200px' }" placeholder="请选择省份...">
|
||||||
|
<a-option v-for="item in financeFeeList" :key="item.id" :value="item.id">
|
||||||
|
{{ item.name }}
|
||||||
|
</a-option>
|
||||||
|
</a-select>
|
||||||
|
<a-select v-model="form.finance_fee_periodicity" :style="{ width: '200px' }"
|
||||||
|
:options="financeFeeFeriodicityList" placeholder="请选择..." />
|
||||||
|
</a-space> -->
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</a-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, watch, reactive, onMounted } from 'vue';
|
||||||
|
import type { FormInstance } from '@arco-design/web-vue';
|
||||||
|
// import { Message } from '@arco-design/web-vue';
|
||||||
|
import { projectTypeList } from '@/utils/constant';
|
||||||
|
// import { CreateTermSettingParam, FeeManagement } from '@/types/setting';
|
||||||
|
// import { FeeManagementType } from '@/types/comm';
|
||||||
|
const props = defineProps<{
|
||||||
|
visible: boolean;
|
||||||
|
isEdit: boolean;
|
||||||
|
record?: any | null;
|
||||||
|
}>();
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'update:visible', val: boolean): void;
|
||||||
|
(e: 'submitted'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 表单数据
|
||||||
|
const formRef = ref<FormInstance>();
|
||||||
|
const defaultForm: any = {
|
||||||
|
name: '', // 名称
|
||||||
|
type: 1, // 条款类型:1租赁类,2物业类,3特殊类,4其他类
|
||||||
|
is_fee: 1, // 是否勾选费项:1是,2否
|
||||||
|
finance_fee_id: null, // 财务费项id(除保证金外
|
||||||
|
finance_fee_periodicity: 1, // 周期性:1周期性付款,2一次性付款
|
||||||
|
is_bond: 2, // 是否勾选保证金:1是,2否
|
||||||
|
finance_bond_fee_id: null, // 财务保证金费项id
|
||||||
|
is_incremental: 2, // 是否勾选递增项:1是,2否
|
||||||
|
is_discount: 2, // 是否勾选优惠项:1是,2否
|
||||||
|
is_late_fee: 2, // 是否勾选滞纳金:1是,2否
|
||||||
|
};
|
||||||
|
const form = reactive<any>({ ...defaultForm });
|
||||||
|
// 校验规则
|
||||||
|
const rules = reactive({
|
||||||
|
name: [{ required: true, message: '请输入条款名称' }],
|
||||||
|
type: [{ required: true, message: '请选择条款类别' }],
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(val) => {
|
||||||
|
if (val) {
|
||||||
|
if (props.isEdit && props.record) {
|
||||||
|
Object.assign(form, props.record);
|
||||||
|
} else {
|
||||||
|
Object.assign(form, defaultForm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
|
||||||
|
const handleOk = async () => {};
|
||||||
|
|
||||||
|
const handleCancel = () => {
|
||||||
|
emit('update:visible', false);
|
||||||
|
};
|
||||||
|
onMounted(() => {});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
:deep(label.arco-form-item-label) {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="business_project_wrap">
|
<div class="business_project_wrap">
|
||||||
<Breadcrumb :items="['menu.business', 'menu.business.project']" />
|
<Breadcrumb :items="['menu.business', 'menu.business.project']" />
|
||||||
<a-card class="general-card">
|
<a-card class="general-card full_height">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="card-title_between">
|
<div class="card-title_between">
|
||||||
<p class="title">{{ t('menu.business.project') }}</p>
|
<p class="title">{{ t('menu.business.project') }}</p>
|
||||||
|
|
@ -33,7 +33,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- 使用新的 DataTable 组件 -->
|
<!-- 使用新的 DataTable 组件 -->
|
||||||
<DataTable
|
<DataTable
|
||||||
:data="renderData"
|
:data="renderData"
|
||||||
|
|
@ -45,18 +44,14 @@
|
||||||
@page-change="onPageChange"
|
@page-change="onPageChange"
|
||||||
@page-size-change="onPageSizeChange"
|
@page-size-change="onPageSizeChange"
|
||||||
>
|
>
|
||||||
<template #type="{ record }">
|
<!-- <template #type="{ record }">
|
||||||
<a-tag checkable :color="getTypeColor(record.type)">{{
|
<a-tag checkable :color="getTypeColor(record.type)">{{
|
||||||
getTypeText(record.type)
|
getTypeText(record.type)
|
||||||
}}</a-tag>
|
}}</a-tag>
|
||||||
</template>
|
</template>
|
||||||
<template #rate="{ record }">
|
<template #rate="{ record }">
|
||||||
<a-progress
|
<a-progress :percent="record.rate" color="green" :style="{ width: '100px' }" />
|
||||||
:percent="record.rate"
|
</template> -->
|
||||||
color="green"
|
|
||||||
:style="{ width: '100px' }"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template #operate>
|
<template #operate>
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-button>查看</a-button>
|
<a-button>查看</a-button>
|
||||||
|
|
@ -70,25 +65,19 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import type { TableColumnData } from '@arco-design/web-vue';
|
import type { TableColumnData } from '@arco-design/web-vue';
|
||||||
import {
|
|
||||||
ProjectRecord,
|
|
||||||
ProjectType,
|
|
||||||
PROJECT_TYPE,
|
|
||||||
PROJECT_TYPE_COLORS,
|
|
||||||
PROJECT_TYPE_LABELS,
|
|
||||||
} from '@/types/business';
|
|
||||||
// import { getAllProjectList } from '@/api/business';
|
|
||||||
import useDataTable from '@/composables/useDataTable';
|
import useDataTable from '@/composables/useDataTable';
|
||||||
|
import { ProjectItem } from '@/types/business';
|
||||||
|
import { getProjectList } from '@/api/business';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { loading } = useLoading(false);
|
const { loading } = useLoading(false);
|
||||||
// setLoading
|
|
||||||
|
|
||||||
// 使用 DataTable composable
|
const projectList = ref<ProjectItem[]>([]);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: renderData,
|
data: renderData,
|
||||||
columns: projectColumn,
|
columns: projectColumn,
|
||||||
|
|
@ -100,46 +89,13 @@
|
||||||
setTotal,
|
setTotal,
|
||||||
setCurrent,
|
setCurrent,
|
||||||
setPageSize,
|
setPageSize,
|
||||||
|
setLoading,
|
||||||
} = useDataTable({
|
} = useDataTable({
|
||||||
initialPage: 1,
|
initialPage: 1,
|
||||||
initialPageSize: 10,
|
initialPageSize: 10,
|
||||||
pageSizeOptions: [10, 20, 50, 100],
|
pageSizeOptions: [10, 20, 50, 100],
|
||||||
});
|
});
|
||||||
|
|
||||||
// 模拟数据
|
|
||||||
const mockData: ProjectRecord[] = [
|
|
||||||
{
|
|
||||||
id: '1',
|
|
||||||
name: '星河商务中心',
|
|
||||||
type: PROJECT_TYPE.COMMERCIAL_COMPLEX,
|
|
||||||
size: '1200m²',
|
|
||||||
kezu: '1000m²',
|
|
||||||
rate: 0.2,
|
|
||||||
count: '90',
|
|
||||||
create_time: '2025-06-24 00:51',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '2',
|
|
||||||
name: '南山科学科学院',
|
|
||||||
type: PROJECT_TYPE.OFFICE_BUILDING,
|
|
||||||
size: '120m²',
|
|
||||||
kezu: '100m²',
|
|
||||||
rate: 0.6,
|
|
||||||
count: '10',
|
|
||||||
create_time: '2025-06-24 00:58',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '3',
|
|
||||||
name: '前海科学科学院',
|
|
||||||
type: PROJECT_TYPE.INDUSTRIAL_PARK,
|
|
||||||
size: '1520m²',
|
|
||||||
kezu: '1500m²',
|
|
||||||
rate: 0.91,
|
|
||||||
count: '120',
|
|
||||||
create_time: '2025-06-24 01:16',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
// 列配置
|
// 列配置
|
||||||
const columns: TableColumnData[] = [
|
const columns: TableColumnData[] = [
|
||||||
{ title: '项目信息', dataIndex: 'name', key: 'name' },
|
{ title: '项目信息', dataIndex: 'name', key: 'name' },
|
||||||
|
|
@ -152,42 +108,32 @@
|
||||||
{ title: '操作', key: 'operate', slotName: 'operate', width: 200 },
|
{ title: '操作', key: 'operate', slotName: 'operate', width: 200 },
|
||||||
];
|
];
|
||||||
|
|
||||||
// 初始化数据
|
const getProjectListData = async () => {
|
||||||
onMounted(() => {
|
const params = {
|
||||||
setColumns(columns);
|
page: current.value,
|
||||||
setData(mockData);
|
page_size: pageSize.value,
|
||||||
setTotal(mockData.length);
|
|
||||||
});
|
|
||||||
|
|
||||||
const getTypeColor = (type: ProjectType): string => {
|
|
||||||
return PROJECT_TYPE_COLORS[type] || 'default';
|
|
||||||
};
|
};
|
||||||
|
setLoading(true);
|
||||||
const getTypeText = (type: ProjectType): string => {
|
const { code, data } = await getProjectList(params);
|
||||||
return PROJECT_TYPE_LABELS[type] || '未知';
|
if (code === 200 && data) {
|
||||||
|
const { projectsList, page } = data;
|
||||||
|
projectList.value = Array.isArray(projectsList) ? projectsList : [];
|
||||||
|
setTotal(page?.total ? page.total : 0);
|
||||||
|
}
|
||||||
|
setLoading(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 分页事件处理
|
// 分页事件处理
|
||||||
const onPageChange = (page: number) => {
|
const onPageChange = (page: number) => {
|
||||||
setCurrent(page);
|
setCurrent(page);
|
||||||
// TODO: 这里应该调用API获取对应页码的数据
|
current.value = page;
|
||||||
};
|
};
|
||||||
|
const onPageSizeChange = (size: number) => {
|
||||||
const onPageSizeChange = (newPageSize: number) => {
|
setPageSize(size);
|
||||||
setPageSize(newPageSize);
|
pageSize.value = size;
|
||||||
// TODO: 这里应该调用API获取对应页码的数据
|
|
||||||
};
|
};
|
||||||
|
onMounted(() => {
|
||||||
// const getAllProjectListData = async () => {
|
setColumns(columns);
|
||||||
// setLoading(true);
|
getProjectListData();
|
||||||
// try {
|
});
|
||||||
// await getAllProjectList();
|
|
||||||
// // 处理数据
|
|
||||||
// } catch (err) {
|
|
||||||
// // you can report use errorHandler or other
|
|
||||||
// } finally {
|
|
||||||
// setLoading(false);
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
// getAllProjectListData()
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,8 @@
|
||||||
disableCodeSetting,
|
disableCodeSetting,
|
||||||
delCodeSetting,
|
delCodeSetting,
|
||||||
} from '@/api/setting';
|
} from '@/api/setting';
|
||||||
import { ContractTermInfo, UserStatus } from '@/types/setting';
|
import { ContractTermInfo } from '@/types/setting';
|
||||||
|
import { UserStatus } from '@/types/comm';
|
||||||
import { camelToSnake } from '@/utils/caseConvert';
|
import { camelToSnake } from '@/utils/caseConvert';
|
||||||
import contractNumberFormDrawer from './drawer/contract-number-form-drawer.vue';
|
import contractNumberFormDrawer from './drawer/contract-number-form-drawer.vue';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,8 @@
|
||||||
disableTermsSetting,
|
disableTermsSetting,
|
||||||
delTermsSetting,
|
delTermsSetting,
|
||||||
} from '@/api/setting';
|
} from '@/api/setting';
|
||||||
import { TermSettingItem, UserStatus } from '@/types/setting';
|
import { TermSettingItem } from '@/types/setting';
|
||||||
|
import { UserStatus } from '@/types/comm';
|
||||||
import contractNumberFormDrawer from './drawer/contract-terms-form-drawer.vue';
|
import contractNumberFormDrawer from './drawer/contract-terms-form-drawer.vue';
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|
|
||||||
|
|
@ -108,11 +108,8 @@
|
||||||
getUseFeeList,
|
getUseFeeList,
|
||||||
} from '@/api/setting';
|
} from '@/api/setting';
|
||||||
import { feeTypeList, financeFeeFeriodicityList } from '@/utils/constant';
|
import { feeTypeList, financeFeeFeriodicityList } from '@/utils/constant';
|
||||||
import {
|
import { CreateTermSettingParam, FeeManagement } from '@/types/setting';
|
||||||
FeeManagementType,
|
import { FeeManagementType } from '@/types/comm';
|
||||||
CreateTermSettingParam,
|
|
||||||
FeeManagement,
|
|
||||||
} from '@/types/setting';
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, watch } from 'vue';
|
import { ref, reactive, watch } from 'vue';
|
||||||
import type { FormInstance } from '@arco-design/web-vue';
|
import type { FormInstance } from '@arco-design/web-vue';
|
||||||
import { DictionaryForm, TenantDictionaryType } from '@/types/setting';
|
import { DictionaryForm } from '@/types/setting';
|
||||||
|
import { TenantDictionaryType } from '@/types/comm';
|
||||||
import { HttpResponse } from '@/api/interceptor';
|
import { HttpResponse } from '@/api/interceptor';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,11 +105,8 @@
|
||||||
updateProjectType,
|
updateProjectType,
|
||||||
delProjectType,
|
delProjectType,
|
||||||
} from '@/api/setting';
|
} from '@/api/setting';
|
||||||
import {
|
import { projectTypeInfo, ProvinceItem } from '@/types/setting';
|
||||||
projectTypeInfo,
|
import { ProjectTypeChecked } from '@/types/comm';
|
||||||
ProvinceItem,
|
|
||||||
ProjectTypeChecked,
|
|
||||||
} from '@/types/setting';
|
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import labelFormModal from './label-form-modal.vue';
|
import labelFormModal from './label-form-modal.vue';
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,8 @@
|
||||||
updateRoomTag,
|
updateRoomTag,
|
||||||
delRoomTag,
|
delRoomTag,
|
||||||
} from '@/api/setting';
|
} from '@/api/setting';
|
||||||
import { projectTypeInfo, ProjectTypeChecked } from '@/types/setting';
|
import { projectTypeInfo } from '@/types/setting';
|
||||||
|
import { ProjectTypeChecked } from '@/types/comm';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import labelFormModal from './label-form-modal.vue';
|
import labelFormModal from './label-form-modal.vue';
|
||||||
|
|
|
||||||
|
|
@ -197,15 +197,14 @@
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
import {
|
import {
|
||||||
getAllTenantDictionaryList,
|
getAllTenantDictionaryList,
|
||||||
projectTypeInfo,
|
|
||||||
checkTenantDictionary,
|
checkTenantDictionary,
|
||||||
checkAllTenantDictionary,
|
checkAllTenantDictionary,
|
||||||
ProjectTypeChecked,
|
|
||||||
TenantDictionaryType,
|
|
||||||
createTenantDictionary,
|
createTenantDictionary,
|
||||||
updateTenantDictionary,
|
updateTenantDictionary,
|
||||||
delTenantDictionary,
|
delTenantDictionary,
|
||||||
} from '@/api/setting';
|
} from '@/api/setting';
|
||||||
|
import { ProjectTypeChecked, TenantDictionaryType } from '@/types/comm';
|
||||||
|
import { projectTypeInfo } from '@/types/setting';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import labelFormModal from './label-form-modal.vue';
|
import labelFormModal from './label-form-modal.vue';
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,8 @@
|
||||||
import useDataTable from '@/composables/useDataTable';
|
import useDataTable from '@/composables/useDataTable';
|
||||||
import type { TableColumnData } from '@arco-design/web-vue';
|
import type { TableColumnData } from '@arco-design/web-vue';
|
||||||
import { getFeeList, disableFee, delFee } from '@/api/setting';
|
import { getFeeList, disableFee, delFee } from '@/api/setting';
|
||||||
import { FeeType, FeeManagement, UserStatus } from '@/types/setting';
|
import { FeeManagement } from '@/types/setting';
|
||||||
|
import { FeeType, UserStatus } from '@/types/comm';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
|
|
||||||
|
|
@ -126,12 +126,8 @@
|
||||||
disableUser,
|
disableUser,
|
||||||
delUser,
|
delUser,
|
||||||
} from '@/api/setting';
|
} from '@/api/setting';
|
||||||
import {
|
import { UserList, RoleItem, FormUserItem } from '@/types/setting';
|
||||||
UserList,
|
import { UserStatus } from '@/types/comm';
|
||||||
RoleItem,
|
|
||||||
FormUserItem,
|
|
||||||
UserStatus,
|
|
||||||
} from '@/types/setting';
|
|
||||||
import useDepartmentList from '@/composables/useDepartmentList';
|
import useDepartmentList from '@/composables/useDepartmentList';
|
||||||
import useDataTable from '@/composables/useDataTable';
|
import useDataTable from '@/composables/useDataTable';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue