diff --git a/apps/web-antd/src/api/property/accessControl/index.ts b/apps/web-antd/src/api/sis/accessControl/index.ts similarity index 69% rename from apps/web-antd/src/api/property/accessControl/index.ts rename to apps/web-antd/src/api/sis/accessControl/index.ts index b8d621c3..d6702ed3 100644 --- a/apps/web-antd/src/api/property/accessControl/index.ts +++ b/apps/web-antd/src/api/sis/accessControl/index.ts @@ -12,7 +12,7 @@ import { requestClient } from '#/api/request'; * @returns 门禁管理列表 */ export function accessControlList(params?: AccessControlQuery) { - return requestClient.get>('/property/accessControl/list', { params }); + return requestClient.get>('/sis/accessControl/list', { params }); } /** @@ -21,7 +21,7 @@ export function accessControlList(params?: AccessControlQuery) { * @returns 门禁管理列表 */ export function accessControlExport(params?: AccessControlQuery) { - return commonExport('/property/accessControl/export', params ?? {}); + return commonExport('/sis/accessControl/export', params ?? {}); } /** @@ -30,7 +30,7 @@ export function accessControlExport(params?: AccessControlQuery) { * @returns 门禁管理详情 */ export function accessControlInfo(id: ID) { - return requestClient.get(`/property/accessControl/${id}`); + return requestClient.get(`/sis/accessControl/${id}`); } /** @@ -39,7 +39,7 @@ export function accessControlInfo(id: ID) { * @returns void */ export function accessControlAdd(data: AccessControlForm) { - return requestClient.postWithMsg('/property/accessControl', data); + return requestClient.postWithMsg('/sis/accessControl', data); } /** @@ -48,7 +48,7 @@ export function accessControlAdd(data: AccessControlForm) { * @returns void */ export function accessControlUpdate(data: AccessControlForm) { - return requestClient.putWithMsg('/property/accessControl', data); + return requestClient.putWithMsg('/sis/accessControl', data); } /** @@ -57,5 +57,5 @@ export function accessControlUpdate(data: AccessControlForm) { * @returns void */ export function accessControlRemove(id: ID | IDS) { - return requestClient.deleteWithMsg(`/property/accessControl/${id}`); + return requestClient.deleteWithMsg(`/sis/accessControl/${id}`); } diff --git a/apps/web-antd/src/api/property/accessControl/model.d.ts b/apps/web-antd/src/api/sis/accessControl/model.d.ts similarity index 100% rename from apps/web-antd/src/api/property/accessControl/model.d.ts rename to apps/web-antd/src/api/sis/accessControl/model.d.ts diff --git a/apps/web-antd/src/api/property/accessControl/types.ts b/apps/web-antd/src/api/sis/accessControl/types.ts similarity index 100% rename from apps/web-antd/src/api/property/accessControl/types.ts rename to apps/web-antd/src/api/sis/accessControl/types.ts diff --git a/apps/web-antd/src/api/sis/authRecord/index.ts b/apps/web-antd/src/api/sis/authRecord/index.ts new file mode 100644 index 00000000..0c53942f --- /dev/null +++ b/apps/web-antd/src/api/sis/authRecord/index.ts @@ -0,0 +1,61 @@ +import type { AuthRecordVO, AuthRecordForm, AuthRecordQuery } from './model'; + +import type { ID, IDS } from '#/api/common'; +import type { PageResult } from '#/api/common'; + +import { commonExport } from '#/api/helper'; +import { requestClient } from '#/api/request'; + +/** +* 查询授权记录列表 +* @param params +* @returns 授权记录列表 +*/ +export function authRecordList(params?: AuthRecordQuery) { + return requestClient.get>('/sis/authRecord/list', { params }); +} + +/** + * 导出授权记录列表 + * @param params + * @returns 授权记录列表 + */ +export function authRecordExport(params?: AuthRecordQuery) { + return commonExport('/sis/authRecord/export', params ?? {}); +} + +/** + * 查询授权记录详情 + * @param id id + * @returns 授权记录详情 + */ +export function authRecordInfo(id: ID) { + return requestClient.get(`/sis/authRecord/${id}`); +} + +/** + * 新增授权记录 + * @param data + * @returns void + */ +export function authRecordAdd(data: AuthRecordForm) { + return requestClient.postWithMsg('/sis/authRecord', data); +} + +/** + * 更新授权记录 + * @param data + * @returns void + */ +export function authRecordUpdate(data: AuthRecordForm) { + return requestClient.putWithMsg('/sis/authRecord', data); +} + +/** + * 删除授权记录 + * @param id id + * @returns void + */ +export function authRecordRemove(id: ID | IDS) { + return requestClient.deleteWithMsg(`/sis/authRecord/${id}`); +} diff --git a/apps/web-antd/src/api/sis/authRecord/model.d.ts b/apps/web-antd/src/api/sis/authRecord/model.d.ts new file mode 100644 index 00000000..92bd8d19 --- /dev/null +++ b/apps/web-antd/src/api/sis/authRecord/model.d.ts @@ -0,0 +1,54 @@ +import type { PageQuery, BaseEntity } from '#/api/common'; + +export interface AuthRecordVO { + /** + * 主键id + */ + id: string | number; + + /** + * 人像id + */ + imgId: string | number; + + /** + * 门禁id + */ + acdId: string | number; + +} + +export interface AuthRecordForm extends BaseEntity { + /** + * 主键id + */ + id?: string | number; + + /** + * 人像id + */ + imgId?: string | number; + + /** + * 门禁id + */ + acdId?: string | number; + +} + +export interface AuthRecordQuery extends PageQuery { + /** + * 人像id + */ + imgId?: string | number; + + /** + * 门禁id + */ + acdId?: string | number; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/apps/web-antd/src/api/sis/deviceManage/index.ts b/apps/web-antd/src/api/sis/deviceManage/index.ts new file mode 100644 index 00000000..1ad62e17 --- /dev/null +++ b/apps/web-antd/src/api/sis/deviceManage/index.ts @@ -0,0 +1,61 @@ +import type { DeviceManageVO, DeviceManageForm, DeviceManageQuery } from './model'; + +import type { ID, IDS } from '#/api/common'; +import type { PageResult } from '#/api/common'; + +import { commonExport } from '#/api/helper'; +import { requestClient } from '#/api/request'; + +/** +* 查询设备管理列表 +* @param params +* @returns 设备管理列表 +*/ +export function deviceManageList(params?: DeviceManageQuery) { + return requestClient.get>('/sis/deviceManage/list', { params }); +} + +/** + * 导出设备管理列表 + * @param params + * @returns 设备管理列表 + */ +export function deviceManageExport(params?: DeviceManageQuery) { + return commonExport('/sis/deviceManage/export', params ?? {}); +} + +/** + * 查询设备管理详情 + * @param id id + * @returns 设备管理详情 + */ +export function deviceManageInfo(id: ID) { + return requestClient.get(`/sis/deviceManage/${id}`); +} + +/** + * 新增设备管理 + * @param data + * @returns void + */ +export function deviceManageAdd(data: DeviceManageForm) { + return requestClient.postWithMsg('/sis/deviceManage', data); +} + +/** + * 更新设备管理 + * @param data + * @returns void + */ +export function deviceManageUpdate(data: DeviceManageForm) { + return requestClient.putWithMsg('/sis/deviceManage', data); +} + +/** + * 删除设备管理 + * @param id id + * @returns void + */ +export function deviceManageRemove(id: ID | IDS) { + return requestClient.deleteWithMsg(`/sis/deviceManage/${id}`); +} diff --git a/apps/web-antd/src/api/sis/deviceManage/model.d.ts b/apps/web-antd/src/api/sis/deviceManage/model.d.ts new file mode 100644 index 00000000..46d73770 --- /dev/null +++ b/apps/web-antd/src/api/sis/deviceManage/model.d.ts @@ -0,0 +1,249 @@ +import type { PageQuery, BaseEntity } from '#/api/common'; + +export interface DeviceManageVO { + /** + * 主键id + */ + id: string | number; + + /** + * 设备编码 + */ + deviceNo: string; + + /** + * 设备名称 + */ + deviceName: string; + + /** + * 设备ip + */ + deviceIp: string; + + /** + * 设备端口 + */ + devicePort: number; + + /** + * 设备账号 + */ + deviceAccount: string; + + /** + * 设备密码 + */ + devicePwd: string; + + /** + * 设备 + */ + deviceMac: string; + + /** + * 设备在线状态 0:离线 1:在线 2:未知 + */ + deviceStatus: number; + + /** + * 父级设备id + */ + parentId: string | number; + + /** + * 设备通道编号 + */ + channelNo: string; + + /** + * 录像机ip + */ + vcrIp: string; + + /** + * 录像机端口 + */ + vcrPort: number; + + /** + * 录像机账号 + */ + vcrAccount: string; + + /** + * 录像机密码 + */ + vcrPwd: string; + + /** + * 门禁id + */ + accessControlId: string | number; + +} + +export interface DeviceManageForm extends BaseEntity { + /** + * 主键id + */ + id?: string | number; + + /** + * 设备编码 + */ + deviceNo?: string; + + /** + * 设备名称 + */ + deviceName?: string; + + /** + * 设备ip + */ + deviceIp?: string; + + /** + * 设备端口 + */ + devicePort?: number; + + /** + * 设备账号 + */ + deviceAccount?: string; + + /** + * 设备密码 + */ + devicePwd?: string; + + /** + * 设备 + */ + deviceMac?: string; + + /** + * 设备在线状态 0:离线 1:在线 2:未知 + */ + deviceStatus?: number; + + /** + * 父级设备id + */ + parentId?: string | number; + + /** + * 设备通道编号 + */ + channelNo?: string; + + /** + * 录像机ip + */ + vcrIp?: string; + + /** + * 录像机端口 + */ + vcrPort?: number; + + /** + * 录像机账号 + */ + vcrAccount?: string; + + /** + * 录像机密码 + */ + vcrPwd?: string; + + /** + * 门禁id + */ + accessControlId?: string | number; + +} + +export interface DeviceManageQuery extends PageQuery { + /** + * 设备编码 + */ + deviceNo?: string; + + /** + * 设备名称 + */ + deviceName?: string; + + /** + * 设备ip + */ + deviceIp?: string; + + /** + * 设备端口 + */ + devicePort?: number; + + /** + * 设备账号 + */ + deviceAccount?: string; + + /** + * 设备密码 + */ + devicePwd?: string; + + /** + * 设备 + */ + deviceMac?: string; + + /** + * 设备在线状态 0:离线 1:在线 2:未知 + */ + deviceStatus?: number; + + /** + * 父级设备id + */ + parentId?: string | number; + + /** + * 设备通道编号 + */ + channelNo?: string; + + /** + * 录像机ip + */ + vcrIp?: string; + + /** + * 录像机端口 + */ + vcrPort?: number; + + /** + * 录像机账号 + */ + vcrAccount?: string; + + /** + * 录像机密码 + */ + vcrPwd?: string; + + /** + * 门禁id + */ + accessControlId?: string | number; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/apps/web-antd/src/api/sis/personLibImg/index.ts b/apps/web-antd/src/api/sis/personLibImg/index.ts index 351ba3fa..ab297c5b 100644 --- a/apps/web-antd/src/api/sis/personLibImg/index.ts +++ b/apps/web-antd/src/api/sis/personLibImg/index.ts @@ -39,7 +39,7 @@ export function personLibImgInfo(id: ID) { * @returns void */ export function personLibImgAdd(data: PersonLibImgForm) { - return requestClient.postWithMsg('/sis/personLibImg', data); + return requestClient.postWithMsg('/sis/personLibImg/add', data); } /** diff --git a/apps/web-antd/src/views/sis/accessControl/device/accessControlModal.vue b/apps/web-antd/src/views/sis/accessControl/device/accessControlModal.vue new file mode 100644 index 00000000..5b616bef --- /dev/null +++ b/apps/web-antd/src/views/sis/accessControl/device/accessControlModal.vue @@ -0,0 +1,140 @@ + + + diff --git a/apps/web-antd/src/views/property/accessControl/device/data.ts b/apps/web-antd/src/views/sis/accessControl/device/data.ts similarity index 55% rename from apps/web-antd/src/views/property/accessControl/device/data.ts rename to apps/web-antd/src/views/sis/accessControl/device/data.ts index aec4898c..c6daba27 100644 --- a/apps/web-antd/src/views/property/accessControl/device/data.ts +++ b/apps/web-antd/src/views/sis/accessControl/device/data.ts @@ -1,14 +1,34 @@ -import type {FormSchemaGetter} from '#/adapter/form'; -import type {VxeGridProps} from '#/adapter/vxe-table'; +import type { FormSchemaGetter } from '#/adapter/form'; +import type { VxeGridProps } from '#/adapter/vxe-table'; -import {getDictOptions} from '#/utils/dict'; -import {renderDict} from '#/utils/render'; +import { getDictOptions } from '#/utils/dict'; +import { renderDict } from '#/utils/render'; +import { communityTree } from '#/api/property/community'; +import { addFullName } from '@vben/utils'; export const querySchema: FormSchemaGetter = () => [ { - component: 'Input', - fieldName: 'accessCode', - label: '设备编码', + label: '社区', + fieldName: 'searchValue', + component: 'ApiTreeSelect', + componentProps: { + allowClear: true, + placeholder: '请选择社区/楼栋/单元/楼层', + treeDefaultExpandAll: true, + treeNodeLabelProp: 'fullName', + fieldNames: { + key: 'code', + label: 'label', + value: 'code', + children: 'children', + }, + api: async () => { + const areaList = await communityTree(4); + addFullName(areaList, 'label', '/'); + console.log(areaList); + return areaList; + }, + }, }, { component: 'Input', @@ -28,32 +48,11 @@ export const querySchema: FormSchemaGetter = () => [ // 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 // export const columns: () => VxeGridProps['columns'] = () => [ export const columns: VxeGridProps['columns'] = [ - {type: 'checkbox', width: 60}, - { - title: '序号', - field: 'id', - slots: { - default: ({rowIndex}) => { - return rowIndex + 1; - }, - }, - }, - { - title: '设备编码', - field: 'accessCode', - }, + { type: 'checkbox', width: 60 }, { title: '设备名称', field: 'accessName', }, - { - title: '园区编码', - field: 'communityCode', - }, - { - title: '建筑编码', - field: 'buildingCode', - }, { title: '设备IP', field: 'accessIp', @@ -74,27 +73,19 @@ export const columns: VxeGridProps['columns'] = [ title: '控制卡类型', field: 'controlType', slots: { - default: ({row}) => { + default: ({ row }) => { return renderDict(row.controlType, 'wy_kzklx'); }, }, }, - { - title: '控制卡类型编码', - field: 'controlCode', - }, { title: '外部编码', field: 'outCode', }, - { - title: '组织编码', - field: 'orgCode', - }, { field: 'action', fixed: 'right', - slots: {default: 'action'}, + slots: { default: 'action' }, title: '操作', width: 180, }, @@ -110,12 +101,6 @@ export const modalSchema: FormSchemaGetter = () => [ triggerFields: [''], }, }, - { - label: '设备编码', - fieldName: 'accessCode', - component: 'Input', - rules: 'required', - }, { label: '设备名称', fieldName: 'accessName', @@ -123,16 +108,11 @@ export const modalSchema: FormSchemaGetter = () => [ rules: 'required', }, { - label: '园区编码', - fieldName: 'communityCode', - component: 'Input', - rules: 'required', - }, - { - label: '建筑编码', - fieldName: 'buildingCode', - component: 'Input', - rules: 'required', + component: 'TreeSelect', + fieldName: 'floorId', + defaultValue: undefined, + label: '楼层', + rules: 'selectRequired', }, { label: '设备IP', @@ -148,13 +128,6 @@ export const modalSchema: FormSchemaGetter = () => [ label: '设备类型', fieldName: 'accessType', component: 'Input', - rules: 'required', - }, - { - label: '工厂编码', - fieldName: 'factoryCode', - component: 'Input', - rules: 'required', }, { label: '控制卡类型', @@ -166,20 +139,4 @@ export const modalSchema: FormSchemaGetter = () => [ }, rules: 'selectRequired', }, - { - label: '控制卡类型编码', - fieldName: 'controlCode', - component: 'Input', - }, - { - label: '外部编码', - fieldName: 'outCode', - component: 'Input', - }, - { - label: '组织编码', - fieldName: 'orgCode', - component: 'Input', - rules: 'required', - }, ]; diff --git a/apps/web-antd/src/views/property/accessControl/device/index.vue b/apps/web-antd/src/views/sis/accessControl/device/index.vue similarity index 90% rename from apps/web-antd/src/views/property/accessControl/device/index.vue rename to apps/web-antd/src/views/sis/accessControl/device/index.vue index 585d04cd..8615c0a1 100644 --- a/apps/web-antd/src/views/property/accessControl/device/index.vue +++ b/apps/web-antd/src/views/sis/accessControl/device/index.vue @@ -1,26 +1,21 @@ @@ -140,7 +140,8 @@ function handleDownloadExcel() { danger type="primary" v-access:code="['property:accessControl:remove']" - @click="handleMultiDelete"> + @click="handleMultiDelete" + > {{ $t('pages.common.delete') }} [ + { + component: 'Input', + fieldName: 'deviceName', + label: '设备名称', + }, + { + component: 'Input', + fieldName: 'deviceIp', + label: '设备ip', + }, + { + fieldName: 'deviceStatus', + label: '在线状态', + component: 'Select', + componentProps: { + getPopupContainer, + options: getDictOptions(DictEnum.sis_device_status), + }, + }, +]; + +// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 +// export const columns: () => VxeGridProps['columns'] = () => [ +export const columns: VxeGridProps['columns'] = [ + { type: 'checkbox', width: 60 }, + { + title: '设备名称', + field: 'deviceName', + }, + { + title: '设备ip', + field: 'deviceIp', + }, + { + title: '设备端口', + field: 'devicePort', + }, + { + title: '设备', + field: 'deviceMac', + }, + { + title: '在线状态', + field: 'deviceStatus', + }, + + { + title: '通道编号', + field: 'channelNo', + }, + { + title: '录像机ip', + field: 'vcrIp', + }, + { + title: '录像机端口', + field: 'vcrPort', + }, + { + title: '门禁id', + field: 'accessControlId', + }, + { + field: 'action', + fixed: 'right', + slots: { default: 'action' }, + title: '操作', + width: 180, + }, +]; + +export const modalSchema: FormSchemaGetter = () => [ + { + label: '主键id', + fieldName: 'id', + component: 'Input', + dependencies: { + show: () => false, + triggerFields: [''], + }, + }, + { + label: '设备名称', + fieldName: 'deviceName', + component: 'Input', + rules: 'required', + }, + { + label: '设备ip', + fieldName: 'deviceIp', + component: 'Input', + rules: 'required', + }, + { + label: '设备端口', + fieldName: 'devicePort', + component: 'Input', + rules: 'required', + }, + { + label: '设备账号', + fieldName: 'deviceAccount', + component: 'Input', + rules: 'required', + }, + { + label: '设备密码', + fieldName: 'devicePwd', + component: 'Input', + rules: 'required', + }, + { + label: '设备Mac', + fieldName: 'deviceMac', + component: 'Input', + }, + { + label: '通道编号', + fieldName: 'channelNo', + component: 'Input', + }, + { + label: '录像机ip', + fieldName: 'vcrIp', + component: 'Input', + }, + { + label: '录像机端口', + fieldName: 'vcrPort', + component: 'Input', + }, + { + label: '录像机账号', + fieldName: 'vcrAccount', + component: 'Input', + }, + { + label: '录像机密码', + fieldName: 'vcrPwd', + component: 'Input', + }, + { + label: '绑定门禁', + fieldName: 'accessControlId', + component: 'ApiSelect', + componentProps: { + // mode: 'multiple', // 关键属性,启用多选模式 + resultField: 'list', // 根据API返回结构调整 + labelField: 'accessName', + valueField: 'accessCode', + api: async () => { + const params: AccessControlQuery = { + pageNum: 1, + pageSize: 500, + }; + const res = await accessControlList(params); + return res.rows; + }, + }, + }, +]; diff --git a/apps/web-antd/src/views/property/accessControl/device/accessControlModal.vue b/apps/web-antd/src/views/sis/deviceManage/deviceManage-modal.vue similarity index 88% rename from apps/web-antd/src/views/property/accessControl/device/accessControlModal.vue rename to apps/web-antd/src/views/sis/deviceManage/deviceManage-modal.vue index 6a57c482..8a1fcca6 100644 --- a/apps/web-antd/src/views/property/accessControl/device/accessControlModal.vue +++ b/apps/web-antd/src/views/sis/deviceManage/deviceManage-modal.vue @@ -6,7 +6,7 @@ import { $t } from '@vben/locales'; import { cloneDeep } from '@vben/utils'; import { useVbenForm } from '#/adapter/form'; -import { accessControlAdd, accessControlInfo, accessControlUpdate } from '#/api/property/accessControl'; +import { deviceManageAdd, deviceManageInfo, deviceManageUpdate } from '#/api/sis/deviceManage'; import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup'; import { modalSchema } from './data'; @@ -21,7 +21,7 @@ const title = computed(() => { const [BasicForm, formApi] = useVbenForm({ commonConfig: { // 默认占满两列 - formItemClass: 'col-span-2', + formItemClass: 'col-span-1', // 默认label宽度 px labelWidth: 80, // 通用配置项 会影响到所有表单项 @@ -43,7 +43,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff( const [BasicModal, modalApi] = useVbenModal({ // 在这里更改宽度 - class: 'w-[550px]', + class: 'w-[60%]', fullscreenButton: false, onBeforeClose, onClosed: handleClosed, @@ -58,7 +58,7 @@ const [BasicModal, modalApi] = useVbenModal({ isUpdate.value = !!id; if (isUpdate.value && id) { - const record = await accessControlInfo(id); + const record = await deviceManageInfo(id); await formApi.setValues(record); } await markInitialized(); @@ -76,7 +76,7 @@ async function handleConfirm() { } // getValues获取为一个readonly的对象 需要修改必须先深拷贝一次 const data = cloneDeep(await formApi.getValues()); - await (isUpdate.value ? accessControlUpdate(data) : accessControlAdd(data)); + await (isUpdate.value ? deviceManageUpdate(data) : deviceManageAdd(data)); resetInitialized(); emit('reload'); modalApi.close(); diff --git a/apps/web-antd/src/views/sis/deviceManage/index.vue b/apps/web-antd/src/views/sis/deviceManage/index.vue new file mode 100644 index 00000000..1e953cf3 --- /dev/null +++ b/apps/web-antd/src/views/sis/deviceManage/index.vue @@ -0,0 +1,182 @@ + + + diff --git a/apps/web-antd/src/views/sis/personLibImg/index.vue b/apps/web-antd/src/views/sis/personLibImg/index.vue index ccd2ad00..45445201 100644 --- a/apps/web-antd/src/views/sis/personLibImg/index.vue +++ b/apps/web-antd/src/views/sis/personLibImg/index.vue @@ -1,15 +1,13 @@