From 620bf8dd17629802b4550b5e3e30fe67b5e3401a Mon Sep 17 00:00:00 2001 From: dev_ljl <2590379346@qq.com> Date: Fri, 11 Jul 2025 17:29:59 +0800 Subject: [PATCH 1/4] =?UTF-8?q?1=E3=80=81=E5=B7=A1=E6=A3=80=E8=AE=A1?= =?UTF-8?q?=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspectionPlan/model.d.ts | 52 +++++- .../inspectionPlan/data.ts | 152 +++++++++++------- .../inspectionPlan/index.vue | 49 +++--- .../inspectionPlan/inspectionPlan-modal.vue | 129 +++++++++++++-- .../inspectionPlan/plan-detail.vue | 107 ++++++++++++ 5 files changed, 391 insertions(+), 98 deletions(-) create mode 100644 apps/web-antd/src/views/property/inspectionManagement/inspectionPlan/plan-detail.vue diff --git a/apps/web-antd/src/api/property/inspectionManagement/inspectionPlan/model.d.ts b/apps/web-antd/src/api/property/inspectionManagement/inspectionPlan/model.d.ts index 951a8553..c990b10e 100644 --- a/apps/web-antd/src/api/property/inspectionManagement/inspectionPlan/model.d.ts +++ b/apps/web-antd/src/api/property/inspectionManagement/inspectionPlan/model.d.ts @@ -1,4 +1,4 @@ -import type { PageQuery, BaseEntity } from '#/api/common'; +import type {PageQuery, BaseEntity} from '#/api/common'; export interface InspectionPlanVO { /** @@ -66,6 +66,28 @@ export interface InspectionPlanVO { */ remark: string; + /** + * 计划时间区间 + */ + planDate?: any[]; + + /** + * 巡检月 + */ + inspectionMonth?:string; + /** + * 巡检日 + */ + inspectionDay?:string; + /** + * 巡检周 + */ + inspectionWorkday?:string; + + /** + * 状态 + */ + state?:string } export interface InspectionPlanForm extends BaseEntity { @@ -133,6 +155,18 @@ export interface InspectionPlanForm extends BaseEntity { * 备注 */ remark?: string; + /** + * 巡检月 + */ + inspectionMonth?:string; + /** + * 巡检日 + */ + inspectionDay?:string; + /** + * 巡检周 + */ + inspectionWorkday?:string; } @@ -193,7 +227,19 @@ export interface InspectionPlanQuery extends PageQuery { userId?: string | number; /** - * 日期范围参数 - */ + * 日期范围参数 + */ params?: any; + /** + * 巡检月 + */ + inspectionMonth?:string; + /** + * 巡检日 + */ + inspectionDay?:string; + /** + * 巡检周 + */ + inspectionWorkday?:string; } diff --git a/apps/web-antd/src/views/property/inspectionManagement/inspectionPlan/data.ts b/apps/web-antd/src/views/property/inspectionManagement/inspectionPlan/data.ts index 1fed16ca..98fa9fe7 100644 --- a/apps/web-antd/src/views/property/inspectionManagement/inspectionPlan/data.ts +++ b/apps/web-antd/src/views/property/inspectionManagement/inspectionPlan/data.ts @@ -2,6 +2,7 @@ import type {FormSchemaGetter} from '#/adapter/form'; import type {VxeGridProps} from '#/adapter/vxe-table'; import {getDictOptions} from "#/utils/dict"; import {renderDict} from "#/utils/render"; +import {z} from "#/adapter/form"; export const querySchema: FormSchemaGetter = () => [ @@ -32,71 +33,65 @@ export const querySchema: FormSchemaGetter = () => [ export const columns: VxeGridProps['columns'] = [ {type: 'checkbox', width: 60}, { - title: '主键id', - field: 'id', - }, - { - title: '巡检计划名称', + title: '计划名称', field: 'planName', + minWidth: 180, }, { title: '巡检路线', field: 'inspectionRouteId', + width: 180, }, { title: '巡检周期', field: 'inspectionPlanPeriod', slots: { - default: ({ row }) => { + default: ({row}) => { return renderDict(row.inspectionPlanPeriod, 'wy_xjzq'); }, }, + width: 100, }, { - title: '任务提前分组', + title: '任务提前分钟', field: 'beforeTime', + width: 120, }, { title: '开始日期', field: 'startDate', + width: 120, }, { title: '结束日期', field: 'endDate', - }, - { - title: '开始时间', - field: 'startTime', - }, - { - title: '结束时间', - field: 'endTime', + width: 120, }, { title: '签到方式', field: 'signType', slots: { - default: ({ row }) => { + default: ({row}) => { return renderDict(row.signType, 'wy_xjqdfs'); }, }, + width: 120, }, { title: '是否允许补检', field: 'canReexamine', slots: { - default: ({ row }) => { + default: ({row}) => { return renderDict(row.canReexamine, 'wy_sf'); }, }, + width: 120, }, { - title: '选择员工', - field: 'userId', - }, - { - title: '备注', - field: 'remark', + title: '状态', + field: 'state', + width: 120, + slots:{default: 'state'} }, { field: 'action', @@ -118,7 +113,7 @@ export const modalSchema: FormSchemaGetter = () => [ }, }, { - label: '巡检计划名称', + label: '计划名称', fieldName: 'planName', component: 'Input', rules: 'required', @@ -126,61 +121,80 @@ export const modalSchema: FormSchemaGetter = () => [ { label: '巡检路线', fieldName: 'inspectionRouteId', - component: 'Input', + component: 'ApiSelect', rules: 'required', }, { label: '巡检周期', fieldName: 'inspectionPlanPeriod', - component: 'Input', + component: 'Select', rules: 'required', componentProps: { options: getDictOptions('wy_xjzq'), }, }, { - label: '任务提前分组', + label: '任务提前', fieldName: 'beforeTime', component: 'Input', - rules: 'required', + rules: z.number({ + required_error: "请输入任务提前完成分钟数", + invalid_type_error: "请输入任务提前完成分钟数" + }), + slots: {default: 'beforeTime'}, }, { - label: '开始日期', - fieldName: 'startDate', - component: 'DatePicker', - componentProps: { - showTime: true, - format: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'YYYY-MM-DD HH:mm:ss', + label: '周', + fieldName: 'inspectionWorkday', + component: 'CheckboxGroup', + rules: 'selectRequired', + formItemClass: 'col-span-2', + dependencies: { + show: (formValue) => formValue.inspectionPlanPeriod == '2', + triggerFields: ['inspectionPlanPeriod'], }, - rules: 'required', - }, - { - label: '结束日期', - fieldName: 'endDate', - component: 'DatePicker', componentProps: { - showTime: true, - format: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'YYYY-MM-DD HH:mm:ss', - }, - rules: 'required', + options: getDictOptions('wy_xq') + } }, { - label: '开始时间', - fieldName: 'startTime', - component: 'DatePicker', + label: '月', + fieldName: 'inspectionMonth', + component: 'CheckboxGroup', + rules: 'selectRequired', + formItemClass: 'col-span-2', + dependencies: { + show: (formValue) => formValue.inspectionPlanPeriod == '1', + triggerFields: ['inspectionPlanPeriod'], + }, componentProps: { - showTime: true, - format: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'YYYY-MM-DD HH:mm:ss', - }, - rules: 'required', + options: Array.from({ length: 12 }, (_, i) => ({ + label: `${i + 1}月`, + value: (i + 1).toString(), + })), + } }, { - label: '结束时间', - fieldName: 'endTime', - component: 'DatePicker', + label: '日', + fieldName: 'inspectionDay', + component: 'CheckboxGroup', + rules: 'selectRequired', + formItemClass: 'col-span-2', + dependencies: { + show: (formValue) => formValue.inspectionPlanPeriod == '1', + triggerFields: ['inspectionPlanPeriod'], + }, + componentProps: { + options: Array.from({ length: 31 }, (_, i) => ({ + label: `${i + 1}日`, + value: (i + 1).toString(), + })), + } + }, + { + label: '计划日期', + fieldName: 'planDate', + component: 'RangePicker', componentProps: { showTime: true, format: 'YYYY-MM-DD HH:mm:ss', @@ -200,21 +214,35 @@ export const modalSchema: FormSchemaGetter = () => [ { label: '允许补检', fieldName: 'canReexamine', - component: 'Select', + component: 'RadioGroup', componentProps: { options: getDictOptions('wy_sf'), + buttonStyle: 'solid', }, rules: 'selectRequired', }, { - label: '选择员工', + label: '巡检人员', fieldName: 'userId', - component: 'Input', - rules: 'required', + component: 'ApiSelect', + componentProps:{ + mode: 'multiple', + }, + rules: z.array(z.string()).min(1, { message: '请选择巡检人员' }), + formItemClass: 'col-span-2' }, { label: '备注', fieldName: 'remark', - component: 'Input', + component: 'Textarea', + formItemClass: 'col-span-2' }, ]; + +const weekOptions = (): any[] => { + let arr: any[] = [] + for (let i = 1; i <= 7; i++) { + arr.push({label: '星期' + '', value: i}) + } + return arr; +} diff --git a/apps/web-antd/src/views/property/inspectionManagement/inspectionPlan/index.vue b/apps/web-antd/src/views/property/inspectionManagement/inspectionPlan/index.vue index c8554f64..2881f7dc 100644 --- a/apps/web-antd/src/views/property/inspectionManagement/inspectionPlan/index.vue +++ b/apps/web-antd/src/views/property/inspectionManagement/inspectionPlan/index.vue @@ -1,14 +1,8 @@ + + diff --git a/apps/web-antd/src/views/property/inspectionManagement/inspectionPlan/inspectionPlan-modal.vue b/apps/web-antd/src/views/property/inspectionManagement/inspectionPlan/inspectionPlan-modal.vue index 65fa155f..77604475 100644 --- a/apps/web-antd/src/views/property/inspectionManagement/inspectionPlan/inspectionPlan-modal.vue +++ b/apps/web-antd/src/views/property/inspectionManagement/inspectionPlan/inspectionPlan-modal.vue @@ -1,15 +1,23 @@ + diff --git a/apps/web-antd/src/views/property/inspectionManagement/inspectionPlan/plan-detail.vue b/apps/web-antd/src/views/property/inspectionManagement/inspectionPlan/plan-detail.vue new file mode 100644 index 00000000..0a46807f --- /dev/null +++ b/apps/web-antd/src/views/property/inspectionManagement/inspectionPlan/plan-detail.vue @@ -0,0 +1,107 @@ + + + From bce19bf9f832e4d712130fd91fc9f474d7775a97 Mon Sep 17 00:00:00 2001 From: zcxlsm Date: Fri, 11 Jul 2025 17:59:19 +0800 Subject: [PATCH 2/4] =?UTF-8?q?feat(sis):=20=E6=B7=BB=E5=8A=A0=E9=97=A8?= =?UTF-8?q?=E7=A6=81=E8=AE=BE=E5=A4=87=E5=90=8C=E6=AD=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/sis/accessControl/index.ts | 30 ++++++++++++------- .../views/sis/accessControl/device/index.vue | 7 +++++ 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/apps/web-antd/src/api/sis/accessControl/index.ts b/apps/web-antd/src/api/sis/accessControl/index.ts index f4a2afc4..e6798260 100644 --- a/apps/web-antd/src/api/sis/accessControl/index.ts +++ b/apps/web-antd/src/api/sis/accessControl/index.ts @@ -2,12 +2,12 @@ import type { AccessControlForm, AccessControlQuery, AccessControlVO, -} from './model'; +} from './model' -import type { ID, IDS, PageResult, TreeNode } from '#/api/common'; +import type { ID, IDS, PageResult, TreeNode } from '#/api/common' -import { commonExport } from '#/api/helper'; -import { requestClient } from '#/api/request'; +import { commonExport } from '#/api/helper' +import { requestClient } from '#/api/request' /** * 查询门禁管理列表 @@ -18,7 +18,7 @@ export function accessControlList(params?: AccessControlQuery) { return requestClient.get>( '/sis/accessControl/list', { params }, - ); + ) } /** @@ -27,7 +27,7 @@ export function accessControlList(params?: AccessControlQuery) { * @returns 门禁管理列表 */ export function accessControlExport(params?: AccessControlQuery) { - return commonExport('/sis/accessControl/export', params ?? {}); + return commonExport('/sis/accessControl/export', params ?? {}) } /** @@ -36,7 +36,7 @@ export function accessControlExport(params?: AccessControlQuery) { * @returns 门禁管理详情 */ export function accessControlInfo(id: ID) { - return requestClient.get(`/sis/accessControl/${id}`); + return requestClient.get(`/sis/accessControl/${id}`) } /** @@ -45,7 +45,7 @@ export function accessControlInfo(id: ID) { * @returns void */ export function accessControlAdd(data: AccessControlForm) { - return requestClient.postWithMsg('/sis/accessControl', data); + return requestClient.postWithMsg('/sis/accessControl', data) } /** @@ -54,7 +54,7 @@ export function accessControlAdd(data: AccessControlForm) { * @returns void */ export function accessControlUpdate(data: AccessControlForm) { - return requestClient.putWithMsg('/sis/accessControl', data); + return requestClient.putWithMsg('/sis/accessControl', data) } /** @@ -63,7 +63,7 @@ export function accessControlUpdate(data: AccessControlForm) { * @returns void */ export function accessControlRemove(id: ID | IDS) { - return requestClient.deleteWithMsg(`/sis/accessControl/${id}`); + return requestClient.deleteWithMsg(`/sis/accessControl/${id}`) } /** @@ -71,5 +71,13 @@ export function accessControlRemove(id: ID | IDS) { * @returns void */ export function queryTree() { - return requestClient.get[]>(`/sis/accessControl/tree`); + return requestClient.get[]>(`/sis/accessControl/tree`) +} + +/** + * 同步E8门禁 + * @returns void + */ +export function accessControlSync() { + return requestClient.get(`/sis/accessControl/sync`) } diff --git a/apps/web-antd/src/views/sis/accessControl/device/index.vue b/apps/web-antd/src/views/sis/accessControl/device/index.vue index 8615c0a1..b59796bb 100644 --- a/apps/web-antd/src/views/sis/accessControl/device/index.vue +++ b/apps/web-antd/src/views/sis/accessControl/device/index.vue @@ -14,6 +14,7 @@ import { accessControlExport, accessControlList, accessControlRemove, + accessControlSync } from '#/api/sis/accessControl'; import type { AccessControlForm } from '#/api/sis/accessControl/model'; import { commonDownloadExcel } from '#/utils/file/download'; @@ -98,6 +99,11 @@ async function handleDelete(row: Required) { await tableApi.query(); } +async function handleSyncE8() { + await accessControlSync(); + await tableApi.query(); +} + function handleMultiDelete() { const rows = tableApi.grid.getCheckboxRecords(); const ids = rows.map((row: Required) => row.id); @@ -129,6 +135,7 @@ function handleDownloadExcel() {