diff --git a/src/App.vue b/src/App.vue index 617a10e..f6a3658 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,6 @@ @@ -17,4 +17,33 @@ onMounted(() => { handleThemeStyle(useSettingsStore().theme); }); }); + +const scale = ref(1); +// 设计稿宽度(你是多少就写多少,一般 1920) +const DESIGN_WIDTH = 1920; + +// 计算缩放 +const setScale = () => { + const clientWidth = document.documentElement.clientWidth; + let ratio = clientWidth / DESIGN_WIDTH; + // 最小缩到 0.7(防止太小看不清) + if (ratio < 0.7) ratio = 0.7; + // 最大不超过 1 + if (ratio > 1) ratio = 1; + scale.value = ratio; +}; + +// 监听窗口变化 +const resizeListener = () => { + setScale(); +}; + +onMounted(() => { + setScale(); + window.addEventListener('resize', resizeListener); +}); + +onUnmounted(() => { + window.removeEventListener('resize', resizeListener); +}); diff --git a/src/api/system/InspectionPlan/index.ts b/src/api/system/InspectionPlan/index.ts new file mode 100644 index 0000000..847d85d --- /dev/null +++ b/src/api/system/InspectionPlan/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { PlanVO, PlanForm, PlanQuery } from '@/api/system/InspectionPlan/type'; + +/** + * 查询巡检计划列表 + * @param query + * @returns {*} + */ + +export const listPlan = (query?: PlanQuery): AxiosPromise => { + return request({ + url: '/inspection/plan/list', + method: 'get', + params: query + }); +}; + +/** + * 查询巡检计划详细 + * @param id + */ +export const getPlan = (id: string | number): AxiosPromise => { + return request({ + url: '/inspection/plan/' + id, + method: 'get' + }); +}; + +/** + * 新增巡检计划 + * @param data + */ +export const addPlan = (data: PlanForm) => { + return request({ + url: '/inspection/plan', + method: 'post', + data: data + }); +}; + +/** + * 修改巡检计划 + * @param data + */ +export const updatePlan = (data: PlanForm) => { + return request({ + url: '/inspection/plan', + method: 'put', + data: data + }); +}; + +/** + * 删除巡检计划 + * @param id + */ +export const delPlan = (id: string | number | Array) => { + return request({ + url: '/inspection/plan/' + id, + method: 'delete' + }); +}; diff --git a/src/api/system/InspectionPlan/type.ts b/src/api/system/InspectionPlan/type.ts new file mode 100644 index 0000000..a0c20f1 --- /dev/null +++ b/src/api/system/InspectionPlan/type.ts @@ -0,0 +1,165 @@ +export interface PlanVO { + /** + * 主键ID + */ + id: string | number; + + /** + * 巡检计划名称 + */ + planName: string; + + /** + * 巡检人员ID,多个用逗号分隔 + */ + inspectorIds: string | number; + + /** + * 执行周期,如:开始日期-结束日期 + */ + executeCycle: string; + + /** + * 任务时间 + */ + taskTime: string; + + /** + * 提醒时间 + */ + remindTime: string; + + /** + * 巡检设置:0-必须拍照,1-可以跳检 + */ + inspectSetting: number; + + /** + * 计划路线,多个用逗号分隔 + */ + routeIds: string | number; + + /** + * 状态:0-关闭,1-开启 + */ + status: number; + + /** + * 备注 + */ + remark: string; + + /** + * 执行周期具体日期 + */ + executeDay: string; +} + +export interface PlanForm extends BaseEntity { + /** + * 主键ID + */ + id?: string | number; + + /** + * 巡检计划名称 + */ + planName?: string; + + /** + * 巡检人员ID,多个用逗号分隔 + */ + inspectorIds?: string | number; + + /** + * 执行周期,如:开始日期-结束日期 + */ + executeCycle?: string; + + /** + * 任务时间 + */ + taskTime?: string; + + /** + * 提醒时间 + */ + remindTime?: string; + + /** + * 巡检设置:0-必须拍照,1-可以跳检 + */ + inspectSetting?: number; + + /** + * 计划路线,多个用逗号分隔 + */ + routeIds?: string | number; + + /** + * 状态:0-关闭,1-开启 + */ + status?: number; + + /** + * 备注 + */ + remark?: string; + + /** + * 执行周期具体日期 + */ + executeDay?: string; +} + +export interface PlanQuery extends PageQuery { + /** + * 巡检计划名称 + */ + planName?: string; + + /** + * 巡检人员ID,多个用逗号分隔 + */ + inspectorIds?: string | number; + + /** + * 执行周期,如:开始日期-结束日期 + */ + executeCycle?: string; + + /** + * 任务时间 + */ + taskTime?: string; + + /** + * 提醒时间 + */ + remindTime?: string; + + /** + * 巡检设置:0-必须拍照,1-可以跳检 + */ + inspectSetting?: number; + + /** + * 计划路线,多个用逗号分隔 + */ + routeIds?: string | number; + + /** + * 状态:0-关闭,1-开启 + */ + status?: number; + + /** + * 执行周期具体日期 + */ + executeDay?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/src/api/system/InspectionRecord/index.ts b/src/api/system/InspectionRecord/index.ts new file mode 100644 index 0000000..7a36c53 --- /dev/null +++ b/src/api/system/InspectionRecord/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { RecordVO, RecordForm, RecordQuery } from '@/api/system/InspectionRecord/type'; + +/** + * 查询巡检记录主列表 + * @param query + * @returns {*} + */ + +export const listRecord = (query?: RecordQuery): AxiosPromise => { + return request({ + url: '/inspection/record/list', + method: 'get', + params: query + }); +}; + +/** + * 查询巡检记录主详细 + * @param id + */ +export const getRecord = (id: string | number): AxiosPromise => { + return request({ + url: '/inspection/record/' + id, + method: 'get' + }); +}; + +/** + * 新增巡检记录主 + * @param data + */ +export const addRecord = (data: RecordForm) => { + return request({ + url: '/inspection/record', + method: 'post', + data: data + }); +}; + +/** + * 修改巡检记录主 + * @param data + */ +export const updateRecord = (data: RecordForm) => { + return request({ + url: '/inspection/record', + method: 'put', + data: data + }); +}; + +/** + * 删除巡检记录主 + * @param id + */ +export const delRecord = (id: string | number | Array) => { + return request({ + url: '/inspection/record/' + id, + method: 'delete' + }); +}; diff --git a/src/api/system/InspectionRecord/type.ts b/src/api/system/InspectionRecord/type.ts new file mode 100644 index 0000000..c36412f --- /dev/null +++ b/src/api/system/InspectionRecord/type.ts @@ -0,0 +1,109 @@ +export interface RecordVO { + actualEndTime?: null; + actualStartTime?: null; + createByName?: null; + createTime?: string; + details?: null; + id?: string; + inspectorId?: number; + inspectorName?: string; + planId?: string; + planName?: string; + remark?: null; + routeId?: string; + routeName?: string; + status?: number; + statusLabel?: null; + taskName?: string; + taskTime?: string; + updateTime?: string; +} + +export interface RecordForm extends BaseEntity { + /** + * 主键ID + */ + id?: string | number; + + /** + * 关联巡检任务ID + */ + taskId?: string | number; + + /** + * 关联巡检计划ID + */ + planId?: string | number; + + /** + * 巡检人员ID + */ + inspectorId?: string | number; + + /** + * 巡检路线ID + */ + routeId?: string | number; + + /** + * 任务开始时间 + */ + startTime?: string; + + /** + * 任务结束时间 + */ + endTime?: string; + + /** + * 执行状态(字典:inspection_exec_status 0-按时完成 1-超时完成 2-未完成) + */ + execStatus?: number; + + /** + * 备注 + */ + remark?: string; +} + +export interface RecordQuery extends PageQuery { + /** + * 关联巡检任务ID + */ + taskId?: string | number; + + /** + * 关联巡检计划ID + */ + planId?: string | number; + + /** + * 巡检人员ID + */ + inspectorId?: string | number; + + /** + * 巡检路线ID + */ + routeId?: string | number; + + /** + * 任务开始时间 + */ + startTime?: string; + + /** + * 任务结束时间 + */ + endTime?: string; + + /** + * 执行状态(字典:inspection_exec_status 0-按时完成 1-超时完成 2-未完成) + */ + execStatus?: number; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/src/api/system/community/type.ts b/src/api/system/community/type.ts index 212c583..59e358f 100644 --- a/src/api/system/community/type.ts +++ b/src/api/system/community/type.ts @@ -8,7 +8,7 @@ export interface communitylist_rows_type { remark: string; parkingSpaceCount: number; villageImageUrl: string; - city: string | string[]; + city: string; status: '0' | '1'; manageName: string; managePhone: string; diff --git a/src/api/system/houseRental/index.ts b/src/api/system/houseRental/index.ts index ad182f7..0964e3d 100644 --- a/src/api/system/houseRental/index.ts +++ b/src/api/system/houseRental/index.ts @@ -1,6 +1,6 @@ import request from '@/utils/request'; import { AxiosPromise } from 'axios'; -import { HouseRentalVO, HouseRentalForm, HouseRentalQuery } from '@/api/system/type'; +import { HouseRentalVO, HouseRentalForm, HouseRentalQuery } from '@/api/system/houseRental/type'; /** * 查询房屋租赁管理列表 diff --git a/src/api/system/houseRental/type.ts b/src/api/system/houseRental/type.ts index 48f2ccc..fbc8630 100644 --- a/src/api/system/houseRental/type.ts +++ b/src/api/system/houseRental/type.ts @@ -17,7 +17,7 @@ export interface HouseRentalVO { /** * 0 整租 1 合租 */ - rentalType: number; + rentalType: string; /** * 房屋朝向 @@ -76,11 +76,18 @@ export interface HouseRentalVO { /** * 房屋用途 */ - houseUse?: number; + houseUse: string; /** * 租赁状态 */ - rentalStatus?: number; + rentalStatus: number; + + house: string; + name: string; + pubBy: string; + pubTime: string; + houseImageUrls: string[]; + facilitieslist: string[]; } export interface HouseRentalForm extends BaseEntity { diff --git a/src/api/system/resident/type.ts b/src/api/system/resident/type.ts index c88ce21..e4632fe 100644 --- a/src/api/system/resident/type.ts +++ b/src/api/system/resident/type.ts @@ -155,15 +155,15 @@ export interface ResidentQuery extends PageQuery { * 住户类型 * 0业主 1租户 */ - type: string; + type?: string; /** * 住户状态 * 0审核中 1 已认证 */ - status: string; + status?: string; - houseId: number; - villageId: number; - buildingId: number; - unitNo: number; + houseId?: number; + villageId?: number; + buildingId?: number; + unitNo?: number; } diff --git a/src/assets/icons/svg/zhuangxiu.svg b/src/assets/icons/svg/zhuangxiu.svg index 20fe029..8a15fa6 100644 --- a/src/assets/icons/svg/zhuangxiu.svg +++ b/src/assets/icons/svg/zhuangxiu.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/images/index/1.png b/src/assets/images/index/1.png new file mode 100644 index 0000000..9528844 Binary files /dev/null and b/src/assets/images/index/1.png differ diff --git a/src/assets/images/index/2.png b/src/assets/images/index/2.png new file mode 100644 index 0000000..550cb62 Binary files /dev/null and b/src/assets/images/index/2.png differ diff --git a/src/assets/images/index/3.png b/src/assets/images/index/3.png new file mode 100644 index 0000000..e43c196 Binary files /dev/null and b/src/assets/images/index/3.png differ diff --git a/src/assets/images/index/5.png b/src/assets/images/index/5.png new file mode 100644 index 0000000..1587a84 Binary files /dev/null and b/src/assets/images/index/5.png differ diff --git a/src/assets/images/index/6.png b/src/assets/images/index/6.png new file mode 100644 index 0000000..a9db9c3 Binary files /dev/null and b/src/assets/images/index/6.png differ diff --git a/src/components/Echarts/index.vue b/src/components/Echarts/index.vue index 0bb406a..05bda03 100644 --- a/src/components/Echarts/index.vue +++ b/src/components/Echarts/index.vue @@ -7,9 +7,6 @@ import { ref, onMounted, onBeforeUnmount, watch, nextTick } from 'vue'; import * as echarts from 'echarts'; import type { EChartsOption, ECharts } from 'echarts'; -// ============================================== -// ✅ 【核心修复】正确的 Vue3 + TS Props 写法 -// ============================================== interface Props { width?: string; height?: string; @@ -36,6 +33,7 @@ const emit = defineEmits<{ const chartRef = ref(); let chartInstance: ECharts | null = null; +let resizeObserver: ResizeObserver | null = null; const initChart = () => { if (!chartRef.value) return; @@ -66,8 +64,10 @@ const updateChart = () => { } }; +// ✅ 核心修复:支持 scale 缩放后重绘 const resizeChart = () => { - chartInstance?.resize(); + if (!chartInstance) return; + chartInstance.resize(); }; const getInstance = () => chartInstance; @@ -88,17 +88,19 @@ onMounted(() => { nextTick(() => initChart()); if (props.autoResize && chartRef.value) { - const resizeObserver = new ResizeObserver(resizeChart); + resizeObserver = new ResizeObserver(resizeChart); resizeObserver.observe(chartRef.value); - - onBeforeUnmount(() => { - resizeObserver.disconnect(); - }); } }); +// ✅ 关键:监听 window.resize(scale 缩放会触发 window.resize) +onMounted(() => { + window.addEventListener('resize', resizeChart); +}); + onBeforeUnmount(() => { window.removeEventListener('resize', resizeChart); + resizeObserver?.disconnect(); chartInstance?.dispose(); chartInstance = null; }); @@ -114,5 +116,7 @@ defineExpose({ diff --git a/src/components/Holder/index.vue b/src/components/Holder/index.vue index 692d5cf..f97a145 100644 --- a/src/components/Holder/index.vue +++ b/src/components/Holder/index.vue @@ -78,10 +78,17 @@ import { ResidentVO } from '@/api/system/resident/type'; import { getHousePathById } from '@/utils/house'; import { ref, watch, nextTick, getCurrentInstance, ComponentInternalInstance, toRefs } from 'vue'; import { useHouseStore } from '@/store/modules/house'; -import { storeToRefs } from 'pinia'; const houseStore = useHouseStore(); -const { treedata } = storeToRefs(houseStore); + +const treedata = ref([]); +function init() { + houseStore.getCurrentVilageTreeHouse().then((res) => { + console.log(res); + treedata.value = res; + }); +} +init(); const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { com_resident_type } = toRefs(proxy?.useDict('com_resident_type')); diff --git a/src/layout/index.vue b/src/layout/index.vue index ba01dbc..42efb87 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -1,16 +1,60 @@ + + diff --git a/src/views/system/ComplaintType/index.vue b/src/views/system/ComplaintType/index.vue index 6b515c5..5584c4b 100644 --- a/src/views/system/ComplaintType/index.vue +++ b/src/views/system/ComplaintType/index.vue @@ -99,7 +99,6 @@ const data = reactive>({ queryParams: { pageNum: 1, pageSize: 10, - villageId: Number(localStorage.getItem('villageid')), name: undefined, status: undefined, createNam: undefined, @@ -145,14 +144,14 @@ const router = useRouter(); /** 新增按钮操作 */ const handleAdd = () => { router.push({ - path: '/repair/addComplantType' + path: '/system/addComplantType' }); }; /** 修改按钮操作 */ const handleUpdate = async (row?: ComplaintTypeVO) => { router.push({ - path: '/repair/addComplantType', + path: '/system/addComplantType', query: { id: row.id } diff --git a/src/views/system/Decoration/addDecoration.vue b/src/views/system/Decoration/addDecoration.vue index 2fd08ba..79c9296 100644 --- a/src/views/system/Decoration/addDecoration.vue +++ b/src/views/system/Decoration/addDecoration.vue @@ -58,10 +58,10 @@ import PageHeader from '@/components/Pageheader/index.vue'; import { addDecoration, getDecoration, updateDecoration } from '@/api/system/Decoration'; import { useHouseStore } from '@/store/modules/house'; import { CascaderValue } from 'element-plus'; +import { getHousePathById } from '@/utils/house'; const houseStore = useHouseStore(); -const { treedata } = storeToRefs(houseStore); -const { proxy } = getCurrentInstance() as ComponentInternalInstance; +const treedata = ref([]); const route = useRoute(); const router = useRouter(); @@ -69,7 +69,6 @@ const formRef = ref(); const form = ref({ 'id': null, 'houseId': null, - villageId: Number(localStorage.getItem('villageid')), 'applyName': '', 'decorationCompany': '', 'decorationContent': '', @@ -83,21 +82,6 @@ const rules = { }; const userid = ref(); -// ! 投诉 ==================================================================================================== -function init() { - getDecoration(userid.value).then((res) => { - form.value = { - ...form.value, - ...res.data - }; - }); -} - -if (route.query.id) { - userid.value = route.query.id; - init(); -} - // 获取房屋 const userHousepath = ref([]); function handleChange(val: (string | number)[]) { @@ -107,11 +91,34 @@ function handleChange(val: (string | number)[]) { form.value.houseId = null; } } + +// ! 投诉 ==================================================================================================== +function getTree() { + houseStore.getCurrentVilageTreeHouse().then((res) => { + treedata.value = res; + if (route.query.id) { + userid.value = route.query.id; + init(); + } + }); +} +getTree(); +function init() { + getDecoration(userid.value).then((res) => { + form.value = { + ...form.value, + ...res.data + }; + const arr = getHousePathById(treedata.value, form.value.houseId); + console.log(arr); + userHousepath.value = arr; + }); +} + // 提交 const submitForm = () => { formRef.value?.validate(async (valid: boolean) => { if (valid) { - form.value.villageId = Number(localStorage.getItem('villageid')); if (userid.value) { updateDecoration(form.value).then(() => { ElMessage.success('编辑成功'); diff --git a/src/views/system/Decoration/index.vue b/src/views/system/Decoration/index.vue index 368ff04..3bc1ebc 100644 --- a/src/views/system/Decoration/index.vue +++ b/src/views/system/Decoration/index.vue @@ -1,5 +1,5 @@