From 38274ab612d421d1afde2ca8861dea2af1eb2082 Mon Sep 17 00:00:00 2001 From: Zy <1448159279@qq.com> Date: Thu, 21 May 2026 14:13:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E8=AF=A6=E6=83=85=EF=BC=8C?= =?UTF-8?q?=E5=8D=95=E5=85=83=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.production | 17 +- .gitignore | 19 ++ bin/build.bat | 12 - bin/package.bat | 12 - bin/run-web.bat | 12 - package.json | 1 + postcss.config.js | 2 +- src/api/system/Decoration/type.ts | 4 +- src/api/system/Notification/index.ts | 17 ++ src/api/system/SdbBill/index.ts | 12 +- src/api/system/house/index.ts | 30 +- src/api/system/house/type.ts | 8 +- src/api/system/houseUnit/index.ts | 76 +++++ src/api/system/houseUnit/type.ts | 65 +++++ src/api/system/houseUse/index.ts | 63 ++++ src/api/system/houseUse/type.ts | 35 +++ src/api/system/parking/index.ts | 10 +- src/api/system/storeroom/index.ts | 6 +- src/api/system/storeroom/types.ts | 10 +- src/api/workflow/index.ts | 37 +++ src/components/Holder/house.vue | 127 +++++--- src/components/Holder/user.vue | 48 ++-- src/components/Pagination/index.vue | 2 +- src/components/Process/submitVerify.vue | 2 +- src/store/modules/house.ts | 91 +++--- src/utils/house.ts | 4 +- src/views/community/AddCommunity.vue | 4 +- src/views/system/Activity/index.vue | 1 - src/views/system/Banner/add.vue | 1 - src/views/system/Decoration/index.vue | 43 ++- .../HouseFacilities/addHouseFacilities.vue | 4 +- src/views/system/MonthCard/addMonthCard.vue | 4 +- src/views/system/Notification/index.vue | 64 +++-- .../system/ParkingCost/addParkingCost.vue | 4 +- src/views/system/Repair/addRepair.vue | 4 +- src/views/system/Repair/addRepairlist.vue | 4 +- src/views/system/Sdb/SdbBill/add.vue | 143 ++++----- src/views/system/Sdb/SdbBill/index.vue | 2 +- src/views/system/Sdb/SdbCashier/index.vue | 1 - .../system/Sdb/SdbElectricityDevice/index.vue | 4 +- src/views/system/Sdb/SdbTopupRecord/index.vue | 18 +- src/views/system/Sdb/SdbWaterDevice/index.vue | 87 +++++- src/views/system/carArea/addCarArea.vue | 4 +- src/views/system/cars/addCars.vue | 4 +- src/views/system/house/AddBuilding.vue | 20 +- src/views/system/house/AddHouse.vue | 106 ++++--- src/views/system/house/HouseDetails.vue | 92 +++--- .../house/components/components/houseItem.vue | 7 +- .../house/components/components/table.vue | 65 +++-- src/views/system/house/components/unit.vue | 142 ++++++++- src/views/system/house/index.vue | 26 +- .../system/houseRental/addhouseResident.vue | 4 +- src/views/system/houseUnit/index.vue | 253 ++++++++++++++++ src/views/system/houseUse/index.vue | 214 ++++++++++++++ .../inspection/Item/addInspectionItem.vue | 4 +- .../inspection/Plan/addInspectionPlan.vue | 54 +++- .../inspection/Point/addInspectionPoint.vue | 4 +- .../system/inspection/Record/RecordMain.vue | 4 +- .../inspection/Route/addInspectionRoute.vue | 4 +- src/views/system/resident/ResidentMain.vue | 1 - src/views/system/resident/addResident.vue | 4 +- src/views/system/storeroom/addStoreRoom.vue | 22 +- src/views/system/warehouse/IssueOut/index.vue | 1 - .../warehouse/Warehouse/addWarehouse.vue | 4 +- src/views/workbench/index2.vue | 272 +++++++++++++++--- vite.config.ts | 2 +- vite/plugins/index.ts | 2 + vite/plugins/zip.ts | 10 + 68 files changed, 1867 insertions(+), 568 deletions(-) delete mode 100644 bin/build.bat delete mode 100644 bin/package.bat delete mode 100644 bin/run-web.bat create mode 100644 src/api/system/Notification/index.ts create mode 100644 src/api/system/houseUnit/index.ts create mode 100644 src/api/system/houseUnit/type.ts create mode 100644 src/api/system/houseUse/index.ts create mode 100644 src/api/system/houseUse/type.ts create mode 100644 src/views/system/houseUnit/index.vue create mode 100644 src/views/system/houseUse/index.vue create mode 100644 vite/plugins/zip.ts diff --git a/.env.production b/.env.production index f938400..7a619be 100644 --- a/.env.production +++ b/.env.production @@ -18,10 +18,25 @@ VITE_APP_SNAILJOB_ADMIN = '/snail-job' VITE_APP_BASE_API = 'https://wuyeapi.bugtc.com' # VITE_APP_BASE_API = 'http://192.168.0.222:8080' +# 登录成功跳转地址 +VITE_LOGIN_BACK_URL = '/equipment/WaterDevice' +# 是否展示工作台 +VITE_APP_SHOW_WORK_PLATFORM = false + + +# 地图类型 天地图 or 高德地图 天地图 WGS84 高德地图 GCJ02, 高德地图 需要在高德地图官网申请key +# 高德地图 GCJ02 +# 天地图 WGS84 +VITE_APP_MAP_TYPE = 'GCJ02' + +# 高德地图key 建议放入环境变量中,避免泄露 +VITE_GCJ02_KEY_GD = '8e302fe1be5f4db62bc734db23dca149' +VITE_GCJ02_JS_CODE_GD = '09534b3534d8da53968529a9ce164118' + # 是否在打包时开启压缩,支持 gzip 和 brotli -VITE_BUILD_COMPRESS = gzip +# VITE_BUILD_COMPRESS = gzip VITE_APP_PORT = 80 diff --git a/.gitignore b/.gitignore index 1fd56f0..7dab95c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,23 @@ .history node_modules/ dist/ +.env +.git +.idea +.vscode +.gitignore +.npmrc +.yarn +.yarnrc +.pnp.js +.pnp.lock.json +.pnp +.yarn.lock +.bat +dist.zip +.zip + + npm-debug.log* yarn-debug.log* yarn-error.log* @@ -27,3 +44,5 @@ pnpm-lock.yaml # 编译生成的文件 auto-imports.d.ts components.d.ts + + diff --git a/bin/build.bat b/bin/build.bat deleted file mode 100644 index ecbb454..0000000 --- a/bin/build.bat +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -echo. -echo [Ϣ] Weḅdistļ -echo. - -%~d0 -cd %~dp0 - -cd .. -yarn build:prod - -pause \ No newline at end of file diff --git a/bin/package.bat b/bin/package.bat deleted file mode 100644 index f5b24e0..0000000 --- a/bin/package.bat +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -echo. -echo [Ϣ] װWeḅnode_modulesļ -echo. - -%~d0 -cd %~dp0 - -cd .. -yarn --registry=https://registry.npmmirror.com - -pause \ No newline at end of file diff --git a/bin/run-web.bat b/bin/run-web.bat deleted file mode 100644 index d2fe397..0000000 --- a/bin/run-web.bat +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -echo. -echo [Ϣ] ʹ Vite Web ̡ -echo. - -%~d0 -cd %~dp0 - -cd .. -yarn dev - -pause \ No newline at end of file diff --git a/package.json b/package.json index edcfc80..840b1ef 100644 --- a/package.json +++ b/package.json @@ -86,6 +86,7 @@ "vite": "7.3.1", "vite-plugin-svg-icons-ng": "^1.5.2", "vite-plugin-vue-devtools": "8.0.7", + "vite-plugin-zip-pack": "^1.2.4", "vitest": "4.0.18", "vue-tsc": "^3.2.5" }, diff --git a/postcss.config.js b/postcss.config.js index 6eaa9f0..15bde36 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,6 +1,6 @@ export default { plugins: { - autoprefixer: {}, + // autoprefixer: {}, 'postcss-pxtorem': { rootValue: 16, // 基准根节点字体大小 propList: ['*'], // 所有属性都转换 diff --git a/src/api/system/Decoration/type.ts b/src/api/system/Decoration/type.ts index 2544e24..d4a1a32 100644 --- a/src/api/system/Decoration/type.ts +++ b/src/api/system/Decoration/type.ts @@ -60,12 +60,12 @@ export interface DecorationForm extends BaseEntity { * 所属小区id */ villageId?: string; - + villageName?: string; /** * 所属房屋id */ houseId?: string | number; - + houseName?: string; /** * 申请人姓名 */ diff --git a/src/api/system/Notification/index.ts b/src/api/system/Notification/index.ts new file mode 100644 index 0000000..104fe55 --- /dev/null +++ b/src/api/system/Notification/index.ts @@ -0,0 +1,17 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { NoticeVO, NoticeForm, NoticeQuery } from '@/api/system/NoticePc/type'; + +/** + * 查询消息通知列表 + * @param query + * @returns {*} + */ + +export const getNotificationList = (query?: NoticeQuery): AxiosPromise => { + return request({ + url: '/notification/list', + method: 'get', + params: query + }); +}; diff --git a/src/api/system/SdbBill/index.ts b/src/api/system/SdbBill/index.ts index 62a8325..907a64f 100644 --- a/src/api/system/SdbBill/index.ts +++ b/src/api/system/SdbBill/index.ts @@ -85,13 +85,21 @@ export const listBillHouse = (query: { pageNum: number; pageSize: number }): Axi }; // ! =--------------- +export type BillUserlist = { + 'gender': string; + 'phone': string; + 'house_name': string; + 'residentName': string; + 'houseNo': string; + 'residentId': string; + 'buildingId': string; +}; /** * 查询业主列表 * @param data * @returns {*} */ - -export const queryResidentList_holder = (query: { pageNum: number; pageSize: number }) => { +export const queryResidentList_holder = (query: { pageNum: number; pageSize: number }): AxiosPromise => { return request({ url: '/bill/getResidentList', method: 'GET', diff --git a/src/api/system/house/index.ts b/src/api/system/house/index.ts index a0a3746..c79b81f 100644 --- a/src/api/system/house/index.ts +++ b/src/api/system/house/index.ts @@ -5,13 +5,11 @@ import { addBuildingType, addHouseType, BuildingUnit, BuildingVo } from './type' // 楼栋--------------------------------------------------------------------------------------- /** 根据 小区id 和 类型 查询楼栋信息 */ -export function getBuildinglistAPI(buildingUse: string): AxiosPromise { +export function getBuildinglistAPI(): AxiosPromise { return request({ url: '/building/byVillage', method: 'get', - params: { - buildingUse: buildingUse - } + params: {} }); } /** 获取所有楼栋 */ @@ -55,9 +53,9 @@ export function deleteBuildingApi(id: string) { // 房屋---------------------------------------------------------------------------------------------- /** 根据 楼栋id 查询房屋信息 */ -export function getHouselistAPI(buildingId: string, houseName: string = ''): AxiosPromise { +export function getHouselistAPI(buildingId: string, houseName: string = '', houseUseTypeId: string = ''): AxiosPromise { return request({ - url: `/house/groupByUnitTree/${buildingId}?houseName=${houseName}`, + url: `/house/groupByUnitTree/${buildingId}?houseName=${houseName}&houseUseTypeId=${houseUseTypeId}`, method: 'get' }); } @@ -119,7 +117,7 @@ export interface Data { billResidentList: BillResidentList[]; chargeItemList: string[]; house: House; - parking: null; + parking: Parking; residentList: ResidentList[]; storeroom: Storeroom; } @@ -143,7 +141,7 @@ export interface House { houseType: string; internalArea: string; shareArea: string; - unitNo: number; + unitNoName: string; villageName: string; } @@ -166,3 +164,19 @@ export interface Storeroom { storeroomNo: string; unitNo: number; } + +export interface Parking { + 'parkingArea': number; + 'areaName': string; + 'createTime': string; + 'parkingId': string; + 'parkingStatus': string; + 'remark': string; + 'parkingFloor': string; + 'type': string; + 'villageId': number; + 'parkingCode': string; + 'residentName': string; + 'residentId': string; + 'createName': string; +} diff --git a/src/api/system/house/type.ts b/src/api/system/house/type.ts index 51e1ff1..7f2e2d7 100644 --- a/src/api/system/house/type.ts +++ b/src/api/system/house/type.ts @@ -47,14 +47,15 @@ export interface BuildingUnit { buildingId: number; buildingName: string; floorCount: number; - unitCount: number; units: BuildingUnitlist[]; } // 单元 export interface BuildingUnitlist { floors: FloorsType[]; - unitNo: number; + unitNoName: string; + unitNoId: string; } + // 楼层 export interface FloorsType { floorNo: string; @@ -80,7 +81,8 @@ export interface addHouseType { 'houseId'?: string; 'buildingId'?: string; 'villageId'?: string; - 'unitNo': string; + 'houseUseTypeId': string; + 'unitNoId': string; 'floorNo': string; 'houseNo': string; 'houseArea': string; diff --git a/src/api/system/houseUnit/index.ts b/src/api/system/houseUnit/index.ts new file mode 100644 index 0000000..b5f6ab7 --- /dev/null +++ b/src/api/system/houseUnit/index.ts @@ -0,0 +1,76 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { UnitNoVO, UnitNoForm, UnitNoQuery } from './type'; + +/** + * 查询单元列表 + * @param query + * @returns {*} + */ + +export const listUnitNo = (query?: UnitNoQuery): AxiosPromise => { + return request({ + url: '/unitNo/list', + method: 'get', + params: query + }); +}; + +/** + * 查询单元详细 + * @param id + */ +export const getUnitNo = (id: string | number): AxiosPromise => { + return request({ + url: '/unitNo/' + id, + method: 'get' + }); +}; + +/** + * 新增单元 + * @param data + */ +export const addUnitNo = (data: UnitNoForm) => { + return request({ + url: '/unitNo', + method: 'post', + data: data + }); +}; + +/** + * 修改单元 + * @param data + */ +export const updateUnitNo = (data: UnitNoForm) => { + return request({ + url: '/unitNo', + method: 'put', + data: data + }); +}; + +/** + * 删除单元 + * @param id + */ +export const delUnitNo = (id: string | number | Array) => { + return request({ + url: '/unitNo/' + id, + method: 'delete' + }); +}; +/** + * 根据 楼栋id 获取单元 + * @param id + */ +export const getByBUildingidtoUnitNo = (id: string) => { + return request({ + url: '/unitNo/byBuildingList', + method: 'GET', + params: { + buildingId: id + } + }); +}; diff --git a/src/api/system/houseUnit/type.ts b/src/api/system/houseUnit/type.ts new file mode 100644 index 0000000..f587367 --- /dev/null +++ b/src/api/system/houseUnit/type.ts @@ -0,0 +1,65 @@ +export interface UnitNoVO { + /** + * 单元表id + */ + id: string | number; + + /** + * 单元名称 + */ + name: string; + + /** + * 小区id + */ + villageId: string | number; + + /** + * 楼栋id + */ + buildingId: string | number; +} + +export interface UnitNoForm extends BaseEntity { + /** + * 单元表id + */ + id?: string | number; + + /** + * 单元名称 + */ + name?: string; + + /** + * 小区id + */ + villageId?: string | number; + + /** + * 楼栋id + */ + buildingId?: string | number; +} + +export interface UnitNoQuery extends PageQuery { + /** + * 单元名称 + */ + name?: string; + + /** + * 小区id + */ + villageId?: string | number; + + /** + * 楼栋id + */ + buildingId?: string | number; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/src/api/system/houseUse/index.ts b/src/api/system/houseUse/index.ts new file mode 100644 index 0000000..7378458 --- /dev/null +++ b/src/api/system/houseUse/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { HouseUseTypeVO, HouseUseTypeForm, HouseUseTypeQuery } from './type'; + +/** + * 查询房屋类型列表 + * @param query + * @returns {*} + */ + +export const listHouseUseType = (query?: HouseUseTypeQuery): AxiosPromise => { + return request({ + url: '/houseUseType/list', + method: 'get', + params: query + }); +}; + +/** + * 查询房屋类型详细 + * @param id + */ +export const getHouseUseType = (id: string | number): AxiosPromise => { + return request({ + url: '/houseUseType/' + id, + method: 'get' + }); +}; + +/** + * 新增房屋类型 + * @param data + */ +export const addHouseUseType = (data: HouseUseTypeForm) => { + return request({ + url: '/houseUseType', + method: 'post', + data: data + }); +}; + +/** + * 修改房屋类型 + * @param data + */ +export const updateHouseUseType = (data: HouseUseTypeForm) => { + return request({ + url: '/houseUseType', + method: 'put', + data: data + }); +}; + +/** + * 删除房屋类型 + * @param id + */ +export const delHouseUseType = (id: string | number | Array) => { + return request({ + url: '/houseUseType/' + id, + method: 'delete' + }); +}; diff --git a/src/api/system/houseUse/type.ts b/src/api/system/houseUse/type.ts new file mode 100644 index 0000000..ec0a057 --- /dev/null +++ b/src/api/system/houseUse/type.ts @@ -0,0 +1,35 @@ +export interface HouseUseTypeVO { + /** + * 房屋类型id + */ + id: string | number; + + /** + * 用途名称 + */ + name: string; +} + +export interface HouseUseTypeForm extends BaseEntity { + /** + * 房屋类型id + */ + id?: string | number; + + /** + * 用途名称 + */ + name?: string; +} + +export interface HouseUseTypeQuery extends PageQuery { + /** + * 用途名称 + */ + name?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/src/api/system/parking/index.ts b/src/api/system/parking/index.ts index 5cc0911..9268f6d 100644 --- a/src/api/system/parking/index.ts +++ b/src/api/system/parking/index.ts @@ -91,9 +91,13 @@ export const getParkingReviewInfo = (id: string) => { * @returns {*} */ -export const GetVillageListParking = (villageid?: string): AxiosPromise => { +export const GetVillageListParking = (villageid: string, houseId: string = undefined): AxiosPromise => { return request({ - url: `/parking/getList/${villageid}`, - method: 'GET' + url: `/parking/getList`, + method: 'POST', + data: { + villageId: villageid, + houseId: houseId + } }); }; diff --git a/src/api/system/storeroom/index.ts b/src/api/system/storeroom/index.ts index 27aada8..2cd0a4d 100644 --- a/src/api/system/storeroom/index.ts +++ b/src/api/system/storeroom/index.ts @@ -68,9 +68,10 @@ export const delStoreroom = (id: string | number | Array) => { */ export const GetVillagelistStoreroom = ( - data: { villageid: string; unitNo: string; buildingId: string } = { + data: { villageid: string; unitNo: string; houseId?: string; buildingId: string } = { villageid: null, buildingId: null, + houseId: null, unitNo: null } ): AxiosPromise => { @@ -80,7 +81,8 @@ export const GetVillagelistStoreroom = ( data: { villageId: data.villageid, buildingId: data.buildingId, - unitNo: data.unitNo + unitNo: data.unitNo, + houseId: data.houseId } }); }; diff --git a/src/api/system/storeroom/types.ts b/src/api/system/storeroom/types.ts index b874109..7045796 100644 --- a/src/api/system/storeroom/types.ts +++ b/src/api/system/storeroom/types.ts @@ -2,12 +2,12 @@ export interface StoreroomVO { /** * 储藏室ID */ - id: string | number; + id: string; /** * 所属楼栋ID */ - buildingId: string | number; + buildingId: string; /** * 单元号 @@ -54,12 +54,12 @@ export interface StoreroomForm extends BaseEntity { /** * 储藏室ID */ - id?: string | number; + id?: string; /** * 所属楼栋ID */ - buildingId?: string | number; + buildingId?: string; /** * 单元号 @@ -106,7 +106,7 @@ export interface StoreroomQuery extends PageQuery { /** * 所属楼栋ID */ - buildingId?: string | number; + buildingId?: string; /** * 单元号 diff --git a/src/api/workflow/index.ts b/src/api/workflow/index.ts index bfbfa7f..97c7095 100644 --- a/src/api/workflow/index.ts +++ b/src/api/workflow/index.ts @@ -284,3 +284,40 @@ type LifeIndexKeys = type LifeIndices = { [K in LifeIndexKeys]: LifeIndexItem; }; + +/** + * 查询 快捷入口 + * @param query + * @returns {*} + */ +export const getQuicklyshortcut = () => { + return request({ + url: '/workSpace/shortcut/list', + method: 'GET' + }); +}; + +/** + * 添加 快捷入口 + * @param query + * @returns {*} + */ +export const addQuicklyshortcut = (data) => { + return request({ + url: '/workSpace/shortcut/add', + method: 'POST', + data + }); +}; + +/** + * 删除 快捷入口 + * @param query + * @returns {*} + */ +export const delQuicklyshortcut = (id) => { + return request({ + url: '/workSpace/shortcut/remove/' + id, + method: 'DELETE' + }); +}; diff --git a/src/components/Holder/house.vue b/src/components/Holder/house.vue index 4ba34d8..0fec511 100644 --- a/src/components/Holder/house.vue +++ b/src/components/Holder/house.vue @@ -1,46 +1,67 @@ diff --git a/src/views/system/Activity/index.vue b/src/views/system/Activity/index.vue index 62c46d2..083e865 100644 --- a/src/views/system/Activity/index.vue +++ b/src/views/system/Activity/index.vue @@ -59,7 +59,6 @@ @@ -48,6 +79,9 @@ import { deleteHouseApi } from '@/api/system/house'; import TableUnit from './components/table.vue'; import { useHouseStore } from '@/store/modules/house'; +import { listHouseUseType } from '@/api/system/houseUse'; +import { addUnitNo, delUnitNo, getUnitNo, updateUnitNo } from '@/api/system/houseUnit'; +import { UnitNoVO } from '@/api/system/houseUnit/type'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; @@ -55,20 +89,117 @@ const houseStore = useHouseStore(); const router = useRouter(); const housename = ref(''); +const houseUse = ref(''); +const houseUseTypeList = ref([]); + +/** + * 获取房屋 类型 + */ +function init() { + listHouseUseType({ + pageNum: 1, + pageSize: 99999 + }).then((res) => { + houseUseTypeList.value = res.rows; + }); +} +init(); + +const dialog = reactive({ + visible: false, + title: '' +}); + +const unitNoFormRef = ref(); +const buttonLoading = ref(false); +const form = ref({ + id: undefined, + name: undefined, + buildingId: undefined, + villageId: undefined +}); + +const rules = { + name: [{ required: true, message: '单元名称不能为空', trigger: 'blur' }], + buildingId: [{ required: true, message: '所属楼栋不能为空', trigger: 'blur' }] +}; +/** 新增按钮操作 */ +const handleAddUnit = () => { + resetForm(); + dialog.visible = true; + dialog.title = '添加单元'; +}; +/** 修改按钮操作 */ +const handleEditUnit = async (id: string) => { + resetForm(); + const res = await getUnitNo(id); + Object.assign(form.value, res.data); + dialog.visible = true; + dialog.title = '修改单元'; +}; +/** 删除按钮操作 */ +const handleDelete = async (id: string) => { + await proxy?.$modal.confirm('是否确认删除该单元?'); + await delUnitNo(id); + proxy?.$modal.msgSuccess('删除成功'); + // await getList(); + houseStore.updateCureentBuilding(); +}; + +/** 提交按钮 */ +const submitForm = () => { + unitNoFormRef.value?.validate(async (valid: boolean) => { + if (valid) { + buttonLoading.value = true; + if (form.value.id) { + await updateUnitNo(form.value).finally(() => (buttonLoading.value = false)); + } else { + await addUnitNo(form.value).finally(() => (buttonLoading.value = false)); + } + proxy?.$modal.msgSuccess('操作成功'); + dialog.visible = false; + houseStore.updateCureentBuilding(); + } + }); +}; +/** 取消按钮 */ +const cancel = () => { + resetForm(); + dialog.visible = false; +}; +/** 表单重置 */ +const resetForm = () => { + form.value = { id: undefined, name: undefined, buildingId: undefined, villageId: undefined }; + unitNoFormRef.value?.resetFields(); +}; +/** + * 改变房屋类型 + * @param id + */ +function handleChangeUse(id?: string) { + houseUse.value = id; +} +function handleClearUse() { + houseUse.value = ''; + handleSearchHouse(); +} /** 添加房屋 */ function handleAddHouse() { router.push({ path: '/house/addHouse' }); } + +/** + * 搜索 房屋 + */ function handleSearchHouse() { - if (housename.value && housename.value.trim()) { - houseStore.getHouseBybuildingNo(housename.value); - } + houseStore.getHouseBybuildingNo(housename.value, houseUse.value); } function reset() { housename.value = ''; - houseStore.getHouseBybuildingNo(housename.value); + houseUse.value = ''; + houseStore.getHouseBybuildingNo(housename.value, houseUse.value); } async function deleteAllhouse() { @@ -109,7 +240,6 @@ $primary_color: #1978fe; } .searchbox { - margin-left: 30px; .searchinput { width: 250px; @media (max-width: 1200px) { diff --git a/src/views/system/house/index.vue b/src/views/system/house/index.vue index 40f3737..2869bcd 100644 --- a/src/views/system/house/index.vue +++ b/src/views/system/house/index.vue @@ -6,19 +6,6 @@ 当前小区:{{ currentVilageInfo && currentVilageInfo.villageName }} 小区地址:{{ currentVilageInfo && currentVilageInfo.city }} {{ currentVilageInfo && currentVilageInfo.address }} -
-
- {{ house.label }} -
-
@@ -27,8 +14,7 @@
- @@ -56,10 +43,9 @@ houseStore.initHouse(houseStore.buildingtype); } .houseAdressBox { margin-top: 25px; - height: 20px; - line-height: 20px; color: rgba(102, 102, 102, 1); font-size: 14px; + padding-bottom: 20px; } .houseTypeBox { margin-top: 20px; diff --git a/src/views/system/houseRental/addhouseResident.vue b/src/views/system/houseRental/addhouseResident.vue index b7e212d..91a8779 100644 --- a/src/views/system/houseRental/addhouseResident.vue +++ b/src/views/system/houseRental/addhouseResident.vue @@ -373,9 +373,7 @@ const sendForm = (val: string) => { // 推出 const cancelForm = () => { - router.push({ - path: '/house/houseRental' - }); + router.back(); }; diff --git a/src/views/system/houseUnit/index.vue b/src/views/system/houseUnit/index.vue new file mode 100644 index 0000000..090d5af --- /dev/null +++ b/src/views/system/houseUnit/index.vue @@ -0,0 +1,253 @@ + + + + + diff --git a/src/views/system/houseUse/index.vue b/src/views/system/houseUse/index.vue new file mode 100644 index 0000000..5377f85 --- /dev/null +++ b/src/views/system/houseUse/index.vue @@ -0,0 +1,214 @@ + + + + diff --git a/src/views/system/inspection/Item/addInspectionItem.vue b/src/views/system/inspection/Item/addInspectionItem.vue index 14cfc12..f2db317 100644 --- a/src/views/system/inspection/Item/addInspectionItem.vue +++ b/src/views/system/inspection/Item/addInspectionItem.vue @@ -75,9 +75,7 @@ const submitForm = () => { }; // 推出 const cancelForm = () => { - router.push({ - path: '/Inspection/item' - }); + router.back(); }; diff --git a/src/views/system/inspection/Plan/addInspectionPlan.vue b/src/views/system/inspection/Plan/addInspectionPlan.vue index c0bb705..84f6fe2 100644 --- a/src/views/system/inspection/Plan/addInspectionPlan.vue +++ b/src/views/system/inspection/Plan/addInspectionPlan.vue @@ -29,10 +29,22 @@ - - + + +
+ + + +
@@ -75,7 +87,6 @@ import { getVillageByIdAPI } from '@/api/system/community'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { com_inspection_remind_tiime } = toRefs(proxy?.useDict('com_inspection_remind_tiime')); -com_inspection_remind_tiime; const route = useRoute(); const router = useRouter(); @@ -94,6 +105,18 @@ const rules = ref({ inspectorIds: [{ required: true, message: '请选择巡检人员', trigger: 'blur' }], routeIds: [{ required: true, message: '请选择路线', trigger: 'blur' }] }); +// 初始化 taskTime,确保至少有一个时间段 +const taskTime = ref<[string, string][]>([['', '']]); + +// 新增时间段 +function addTaskTime() { + taskTime.value.push(['', '']); +} + +// 删除时间段 +function removeTaskTime(index: number) { + taskTime.value.splice(index, 1); +} // 选择周几 const checkoutWeek = ref([]); @@ -142,6 +165,23 @@ async function init() { .map((item) => Number(item)) .filter((item) => item); + // 2. 处理任务时间段的回显 + if (res.data.taskTime) { + // 假设后端返回格式为 "09:00-11:00; 13:00-15:00" + // 先按分号分割,再按横杠分割开始和结束时间 + taskTime.value = res.data.taskTime.split(';').map((timeRange: string) => { + const times = timeRange.trim().split('-'); + // 确保返回的是 [start, end] 格式,如果解析失败则返回空字符串 + return times.length === 2 ? [times[0], times[1]] : ['', '']; + }); + // 如果解析后为空,至少保留一个空项以便用户添加 + if (taskTime.value.length === 0) { + taskTime.value = [['', '']]; + } + } else { + taskTime.value = [['', '']]; + } + handlChangeMap(res.data.routeIds); }); } @@ -224,6 +264,12 @@ onMounted(async () => { }); const formRef = ref(); function submit() { + // 将二维数组转换为字符串,例如 "09:00-11:00; 13:00-15:00" + form.value.taskTime = taskTime.value + .filter((t) => t[0] && t[1]) // 过滤掉未填写的 + .map((t) => `${t[0]}-${t[1]}`) + .join('; '); + formRef.value?.validate(async (valid: boolean) => { if (valid) { if (editid.value) { diff --git a/src/views/system/inspection/Point/addInspectionPoint.vue b/src/views/system/inspection/Point/addInspectionPoint.vue index 3eac615..6f577be 100644 --- a/src/views/system/inspection/Point/addInspectionPoint.vue +++ b/src/views/system/inspection/Point/addInspectionPoint.vue @@ -149,9 +149,7 @@ const submitForm = () => { }; // 返回 const cancelForm = () => { - router.push({ - path: '/Inspection/point' - }); + router.back(); }; // ! map diff --git a/src/views/system/inspection/Record/RecordMain.vue b/src/views/system/inspection/Record/RecordMain.vue index 2cfda0e..9dcd1c5 100644 --- a/src/views/system/inspection/Record/RecordMain.vue +++ b/src/views/system/inspection/Record/RecordMain.vue @@ -121,9 +121,7 @@ const tableData = [ // 推出 const cancelForm = () => { - router.push({ - path: '/Inspection/Record' - }); + router.back(); }; diff --git a/src/views/system/inspection/Route/addInspectionRoute.vue b/src/views/system/inspection/Route/addInspectionRoute.vue index ad469ff..1d0d53b 100644 --- a/src/views/system/inspection/Route/addInspectionRoute.vue +++ b/src/views/system/inspection/Route/addInspectionRoute.vue @@ -396,9 +396,7 @@ const submitForm = () => { }; // 返回 const cancelForm = () => { - router.push({ - path: '/Inspection/route' - }); + router.back(); }; onUnmounted(() => { diff --git a/src/views/system/resident/ResidentMain.vue b/src/views/system/resident/ResidentMain.vue index c2675f0..971ba60 100644 --- a/src/views/system/resident/ResidentMain.vue +++ b/src/views/system/resident/ResidentMain.vue @@ -229,7 +229,6 @@ function handleActivestaus(rews) { } } } -// TODO 住户审核 const activeStop = computed(() => { let status = 0; switch (active.value) { diff --git a/src/views/system/resident/addResident.vue b/src/views/system/resident/addResident.vue index c6cbecb..020055d 100644 --- a/src/views/system/resident/addResident.vue +++ b/src/views/system/resident/addResident.vue @@ -254,9 +254,7 @@ const submitForm = () => { }; // 推出 const cancelForm = () => { - router.push({ - path: '/house/resident' - }); + router.back(); }; diff --git a/src/views/system/storeroom/addStoreRoom.vue b/src/views/system/storeroom/addStoreRoom.vue index 2cee5ad..f2f8cb5 100644 --- a/src/views/system/storeroom/addStoreRoom.vue +++ b/src/views/system/storeroom/addStoreRoom.vue @@ -101,6 +101,11 @@ function getStoreRoominfo(id: string) { ...form.value, ...res.data }; + if (form.value.buildingId) { + handleChangeBuild(form.value.buildingId, () => { + form.value.unitNo = res.data.unitNo; + }); + } }); } // 根据小区id获取楼栋单元 @@ -110,12 +115,14 @@ function init() { }); } init(); -if (route.query.id) { - storeRoomid.value = route.query.id; - getStoreRoominfo(storeRoomid.value); -} +onMounted(() => { + if (route.query.id) { + storeRoomid.value = route.query.id; + getStoreRoominfo(storeRoomid.value); + } +}); // 根据楼栋id获取单元 -function handleChangeBuild(val: string) { +function handleChangeBuild(val: string, callback?: () => void) { getBuildingOnly(val).then((res) => { units.value = Array.from({ length: res.data.unitCount }).map((_, index) => { return { @@ -123,6 +130,7 @@ function handleChangeBuild(val: string) { name: index + 1 + '单元' }; }); + callback && callback(); }); } const submitForm = () => { @@ -146,9 +154,7 @@ const submitForm = () => { }); }; const cancelForm = () => { - router.push({ - path: '/house/storeroom' - }); + router.back(); }; diff --git a/src/views/system/warehouse/IssueOut/index.vue b/src/views/system/warehouse/IssueOut/index.vue index d881fcd..f197f20 100644 --- a/src/views/system/warehouse/IssueOut/index.vue +++ b/src/views/system/warehouse/IssueOut/index.vue @@ -39,7 +39,6 @@ > - diff --git a/src/views/system/warehouse/Warehouse/addWarehouse.vue b/src/views/system/warehouse/Warehouse/addWarehouse.vue index a82a5ec..886f50e 100644 --- a/src/views/system/warehouse/Warehouse/addWarehouse.vue +++ b/src/views/system/warehouse/Warehouse/addWarehouse.vue @@ -118,9 +118,7 @@ const submitForm = () => { }; // 推出 const cancelForm = () => { - router.push({ - path: '/warehouse/warehouse' - }); + router.back(); }; diff --git a/src/views/workbench/index2.vue b/src/views/workbench/index2.vue index a3f2794..e7041cd 100644 --- a/src/views/workbench/index2.vue +++ b/src/views/workbench/index2.vue @@ -61,13 +61,19 @@
-
-
-
- {{ getWeatherIcon(weather_icon.iconvalue) }} +
+
+
+
+ {{ getWeatherIcon(weather_icon.iconvalue) }} +
+
+
+ {{ `${weather_icon.title} ${weather_icon.wind_direction} ${weather_icon.wind_power}风` }} + 温度{{ weather_icon.temperature }}°C
-
+
{{ villageinfo.villageName }}
{{ new Date().toLocaleDateString().replaceAll('/', '-') }} @@ -109,14 +115,23 @@
-
- +
+
-
- +
{{ item.menuName }}
+ +
+
- -
{{ item.name }}
@@ -242,14 +257,17 @@ @change="handleCascader" clearable :props="{ value: 'path', label: 'name', children: 'children' }" - v-model="form.path" + v-model="path" :options="quicklylist" /> + + + @@ -288,7 +306,14 @@ import { UploadUserFile } from 'element-plus'; import { getVillageByIdAPI } from '@/api/system/community'; import { getLast7Days, numToWeek2 } from '@/utils/time'; import { EChartsOption } from 'echarts'; -import { workSpaceIncomeTrendListApi, workSpaceTotalListApi, workSpaceWeatherApi } from '@/api/workflow'; +import { + addQuicklyshortcut, + delQuicklyshortcut, + getQuicklyshortcut, + workSpaceIncomeTrendListApi, + workSpaceTotalListApi, + workSpaceWeatherApi +} from '@/api/workflow'; import { getWeatherIcon } from '@/utils/weather'; import { MenuTreeOption } from '@/api/system/menu/types'; @@ -495,10 +520,12 @@ function handleSelect(val: number) { // ! 快捷入口 const quickBox = ref< { - name: string; - url: string; - img: string; - svg?: string; + 'id': string; + 'menuId': null; + 'menuName': string; + 'menuPath': string; + 'menuIcon': string; + 'sortOrder': number; }[] >([ { @@ -543,28 +570,35 @@ const dialog = reactive({ visible: false, title: '添加快捷入口' }); -const menuOptions = ref([]); const form = ref({ - name: '', - path: '', - icon: '' + menuName: '', + menuPath: '', + menuIcon: '', + sortOrder: 1 }); +const path = ref([]); const rules = { - name: [{ required: true, trigger: 'blur', message: '请输入快捷入口名称' }], - path: [{ required: true, trigger: 'blur', message: '请选择快捷入口页面' }] + menuPath: [{ required: true, trigger: 'blur', message: '请选择快捷入口页面' }] }; const quicklylist = ref([]); function addQuieckDialog() { form.value = { - name: '', - path: '', - icon: '' + menuName: '', + menuPath: '', + menuIcon: '', + sortOrder: 1 }; const permissionStore = usePermissionStore(); const routes = permissionStore.getDefaultRoutes(); handleroutestoshowlist(routes); dialog.visible = true; } +function getquicklist() { + getQuicklyshortcut().then((res) => { + quickBox.value = res.data; + }); +} +getquicklist(); function handleroutestoshowlist(rotues) { // 1. 输入校验:确保 routes 是数组 if (!Array.isArray(rotues)) { @@ -623,16 +657,27 @@ function handleCascader(val) { if (find) { const find2 = find.children.find((item) => item.path === childrenpath); if (find2) { - console.log('>>> find2 <<<', find2); - quickBox.value.push({ - name: find2.name, - img: null, - svg: find2.icon, - url: find2.path - }); + form.value = { + ...form.value, + menuIcon: find2.icon, + menuName: find2.name, + menuPath: find2.path + }; } } } +function submitQuick() { + addQuicklyshortcut(form.value).then((res) => { + ElMessage.success(res.msg); + dialog.visible = false; + getquicklist(); + }); +} +function delteRoute(id: string) { + delQuicklyshortcut(id).then(() => { + getquicklist(); + }); +} // ! 快捷入口 // ! 创建办事记录 @@ -879,22 +924,35 @@ async function deleteFun(row) { margin-left: 20px; display: flex; align-items: center; - padding: 0 2rem; + justify-content: space-evenly; background: #036aff; + padding: 0 2rem; border-radius: 16px 16px 16px 16px; margin-bottom: 20px; position: relative; overflow: hidden; + + gap: 30px; + .tips { + font-size: small; + color: #ffffff77; + margin-top: 10px; + font-size: 0.8rem; + text-align: center; + @media (max-width: 1400px) { + font-size: 0.9rem; + } + } .iconbox { width: 70px; height: 70px; text-align: center; margin-right: 20px; font-size: 60px; - line-height: 70px; position: relative; z-index: 2; cursor: default; + margin: 0 auto; } .villageinfo { margin-left: 20px; @@ -909,7 +967,7 @@ async function deleteFun(row) { margin-top: 5px; height: 23px; font-weight: 400; - font-size: 1.1rem; + font-size: 1rem; color: #ffffff; line-height: 23px; display: flex; @@ -1011,8 +1069,12 @@ async function deleteFun(row) { padding-top: 20px; display: grid; grid-template-columns: repeat(3, 1fr); - @media (max-width: 1750px) { + @media (max-width: 1950px) { grid-template-columns: repeat(2, 1fr); + max-height: 410px; + } + @media (max-width: 1750px) { + max-height: 550px; } @media (max-width: 1600px) { max-height: 550px; @@ -1035,19 +1097,149 @@ async function deleteFun(row) { justify-content: center; cursor: pointer; + position: relative; + overflow: hidden; + + font-size: 0.685rem; + @media (max-width: 2000px) { + font-size: 0.65rem; + } + @media (max-width: 1500px) { + height: 46px; + font-size: 0.75rem; + } + @media (max-width: 1250px) { + height: 36px; + font-size: 0.75rem; + } + &:hover { background-color: #0084ff09; } .quickly_item_icon { - width: 25px; - height: 25px; margin-right: 8px; + vertical-align: middle; } .quickly_item_content { font-weight: 500; color: #222222; } + // &:hover { + // .actionsbox { + // opacity: 1; + // .routeactions { + // transform: rotateY(0deg); + // } + // .deleteaction { + // transform: rotateY(0deg); + // } + // } + // } + &:hover { + .deleteaction { + opacity: 1; + } + } + + .deleteaction { + position: absolute; + transition: all 0.3s; + opacity: 0; + right: 0; + top: 0; + z-index: 1; + background-color: #bbbbbb42; + border: 1px solid #bbbbbb42; + text-align: center; + width: 1.2rem; + height: 1.2rem; + border-radius: 0 0 0 0.5rem; + line-height: 1.2rem; + font-size: 15px; + @media (max-width: 2000px) { + width: 1.4rem; + height: 1.4rem; + border-radius: 0 0 0 0.5rem; + line-height: 1.4rem; + font-size: 15px; + } + @media (max-width: 1700px) { + width: 1.7rem; + height: 1.7rem; + border-radius: 0 0 0 0.5rem; + line-height: 1.7rem; + font-size: 1.2rem; + } + @media (max-width: 1500px) { + width: 1.7rem; + height: 1.7rem; + border-radius: 0 0 0 0.5rem; + line-height: 1.7rem; + font-size: 1.2rem; + } + @media (max-width: 1250px) { + width: 1.6rem; + height: 1.6rem; + border-radius: 0 0 0 0.8rem; + line-height: 1.6rem; + font-size: 1rem; + } + + &:hover { + color: red; + i.icons { + transform: rotateZ(360deg); + } + } + i.icons { + transition: all 0.3s; + } + } + + .actionsbox { + opacity: 1; + transition: all 0.3s; + position: absolute; + z-index: 1; + left: 0; + top: 0; + inset: 0; + display: flex; + align-items: center; + justify-content: center; + .routeactions, + .deleteaction { + font-size: 15px; + color: #fff; + flex: 0.5; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + transition: all 0.3s; + + @media (max-width: 1500px) { + font-size: 13px; + } + @media (max-width: 1250px) { + font-size: 11px; + } + } + .routeactions { + background-color: #0083ff; + transform-origin: left center; + transform: rotateY(90deg); + } + .deleteaction { + display: flex; + align-items: center; + background-color: red; + transform-origin: right center; + transform: rotateY(-90deg); + } + } + &.add { text-align: center; color: #036aff; diff --git a/vite.config.ts b/vite.config.ts index a5ffa22..0fa2b0c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -10,7 +10,7 @@ export default defineConfig(({ mode, command }) => { // 部署生产环境和开发环境下的URL。 // 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上 // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 - base: env.VITE_APP_CONTEXT_PATH, + base: env.VITE_APP_CONTEXT_PATH || '/', resolve: { alias: { '@': path.resolve(__dirname, './src'), diff --git a/vite/plugins/index.ts b/vite/plugins/index.ts index 9ef8faf..926e845 100644 --- a/vite/plugins/index.ts +++ b/vite/plugins/index.ts @@ -8,6 +8,7 @@ import createIcons from './icons'; import createSvgIconsPlugin from './svg-icon'; import createCompression from './compression'; import createSetupExtend from './setup-extend'; +import zip from './zip'; import path from 'path'; export default (viteEnv: any, isBuild = false): [] => { @@ -21,5 +22,6 @@ export default (viteEnv: any, isBuild = false): [] => { vitePlugins.push(createIcons()); vitePlugins.push(createSvgIconsPlugin(path)); vitePlugins.push(createSetupExtend()); + vitePlugins.push(zip(path)); return vitePlugins; }; diff --git a/vite/plugins/zip.ts b/vite/plugins/zip.ts new file mode 100644 index 0000000..27ce3a1 --- /dev/null +++ b/vite/plugins/zip.ts @@ -0,0 +1,10 @@ +import zipPack from 'vite-plugin-zip-pack'; + +export default (path) => { + return zipPack({ + inDir: path.resolve(__dirname, '../../dist'), // 要打包的文件夹 + outDir: path.resolve(__dirname, '../../'), // 压缩包输出到根目录 + outFileName: 'dist.zip', // 压缩包名字 + pathPrefix: 'dist' // 不加前缀 + }); +};