diff --git a/apps/web-antd/src/api/property/maintenance/knowledge/index.ts b/apps/web-antd/src/api/property/maintenance/knowledge/index.ts new file mode 100644 index 00000000..a0a5bd82 --- /dev/null +++ b/apps/web-antd/src/api/property/maintenance/knowledge/index.ts @@ -0,0 +1,61 @@ +import type { KnowledgeVO, KnowledgeForm, KnowledgeQuery } 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 knowledgeList(params?: KnowledgeQuery) { + return requestClient.get>('/property/knowledge/list', { params }); +} + +/** + * 导出维保知识管理列表 + * @param params + * @returns 维保知识管理列表 + */ +export function knowledgeExport(params?: KnowledgeQuery) { + return commonExport('/property/knowledge/export', params ?? {}); +} + +/** + * 查询维保知识管理详情 + * @param id id + * @returns 维保知识管理详情 + */ +export function knowledgeInfo(id: ID) { + return requestClient.get(`/property/knowledge/${id}`); +} + +/** + * 新增维保知识管理 + * @param data + * @returns void + */ +export function knowledgeAdd(data: KnowledgeForm) { + return requestClient.postWithMsg('/property/knowledge', data); +} + +/** + * 更新维保知识管理 + * @param data + * @returns void + */ +export function knowledgeUpdate(data: KnowledgeForm) { + return requestClient.putWithMsg('/property/knowledge', data); +} + +/** + * 删除维保知识管理 + * @param id id + * @returns void + */ +export function knowledgeRemove(id: ID | IDS) { + return requestClient.deleteWithMsg(`/property/knowledge/${id}`); +} diff --git a/apps/web-antd/src/api/property/maintenance/knowledge/model.d.ts b/apps/web-antd/src/api/property/maintenance/knowledge/model.d.ts new file mode 100644 index 00000000..8f61d24e --- /dev/null +++ b/apps/web-antd/src/api/property/maintenance/knowledge/model.d.ts @@ -0,0 +1,129 @@ +import type { PageQuery, BaseEntity } from '#/api/common'; + +export interface KnowledgeVO { + /** + * 主键 + */ + id: string | number; + + /** + * 标题 + */ + title: string; + + /** + * 状态(0草稿1状态2已发布) + */ + status: string; + + /** + * 封面 + */ + covers: string; + + /** + * 内容 + */ + content: string; + + /** + * 描述 + */ + depict: string; + + /** + * 发布时间 + */ + releaseTime: string; + + /** + * 位置类型(0操作指引,1处理案例2常见问题) + */ + type: string; + +} + +export interface KnowledgeForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 标题 + */ + title?: string; + + /** + * 状态(0草稿1状态2已发布) + */ + status?: string; + + /** + * 封面 + */ + covers?: string; + + /** + * 内容 + */ + content?: string; + + /** + * 描述 + */ + depict?: string; + + /** + * 发布时间 + */ + releaseTime?: string; + + /** + * 位置类型(0操作指引,1处理案例2常见问题) + */ + type?: string; + +} + +export interface KnowledgeQuery extends PageQuery { + /** + * 标题 + */ + title?: string; + + /** + * 状态(0草稿1状态2已发布) + */ + status?: string; + + /** + * 封面 + */ + covers?: string; + + /** + * 内容 + */ + content?: string; + + /** + * 描述 + */ + depict?: string; + + /** + * 发布时间 + */ + releaseTime?: string; + + /** + * 位置类型(0操作指引,1处理案例2常见问题) + */ + type?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/group-modal.vue b/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/group-modal.vue index 7e0f351c..244df3ae 100644 --- a/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/group-modal.vue +++ b/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/group-modal.vue @@ -93,10 +93,10 @@ const [BasicModal, modalApi] = useVbenModal({ label: item.label, shiftValue: '休息', isRest: 1, - id: null, + shiftId: null, }) }) - settingData.cycleData = [{id: ''}, {id: ''}]; + settingData.cycleData = [{scheduleId: ''}, {scheduleId: ''}]; } await markInitialized(); modalApi.modalLoading(false); @@ -115,7 +115,7 @@ async function handleConfirm() { if (data.attendanceType == 1) { let hasError = false; settingData.cycleData.forEach((item, index) => { - if (!item.id) { + if (!item.scheduleId) { message.warning('请选择周期天数对应班次。'); return; } @@ -189,7 +189,7 @@ function handleShiftInfo(info: ShiftVO) { settingData.shiftId = info.id shiftInfo.value = info; settingData.weekdayData.forEach(item => { - item.id = info.id + item.shiftId = info.id let str = '' if (info.isRest) { str = `${info.name}:${info.startTime}~${info.restStartTime} ${info.restEndTime}~${info.endTime}`; @@ -209,7 +209,7 @@ function handleShiftList(list: any[]) { function addCycleHandle() { if (settingData.cycleData.length < 31) { settingData.cycleData.push({ - id: '', + scheduleId: '', }) } else { message.warning('周期天数最多31天。'); @@ -244,12 +244,12 @@ function changeShiftHandle(type: number, index: number) { function restHandle(index: number) { settingData.weekdayData[index].isRest = 1 settingData.weekdayData[index].shiftValue = '休息' - settingData.weekdayData[index].id = null + settingData.weekdayData[index].shiftId = null } function handleAfterValue(val: ShiftVO) { if (tableIndex.value > -1 && val) { - settingData.weekdayData[tableIndex.value].id = val.id + settingData.weekdayData[tableIndex.value].shiftId = val.id let str = '' if (val.isRest) { str = `${val.name}:${val.startTime}~${val.restStartTime} ${val.restEndTime}~${val.endTime}`; diff --git a/apps/web-antd/src/views/property/maintenance/knowledge/data.ts b/apps/web-antd/src/views/property/maintenance/knowledge/data.ts new file mode 100644 index 00000000..cbe3afcc --- /dev/null +++ b/apps/web-antd/src/views/property/maintenance/knowledge/data.ts @@ -0,0 +1,147 @@ +import type { FormSchemaGetter } from '#/adapter/form'; +import type { VxeGridProps } from '#/adapter/vxe-table'; +import {getDictOptions} from "#/utils/dict"; +import {renderDict} from "#/utils/render"; + + +export const querySchema: FormSchemaGetter = () => [ + { + component: 'Input', + fieldName: 'title', + label: '标题', + }, + { + component: 'Select', + componentProps: { + options:getDictOptions('wy_wbzszt') + }, + fieldName: 'status', + label: '发布状态', + }, + { + component: 'Select', + componentProps: { + options: getDictOptions('wy_wbzslx') + }, + fieldName: 'type', + label: '知识类型', + }, +]; + +// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 +// export const columns: () => VxeGridProps['columns'] = () => [ +export const columns: VxeGridProps['columns'] = [ + { type: 'checkbox', width: 60 }, + { + title: '标题', + field: 'title', + minWidth: 180 + }, + { + title: '发布状态', + field: 'status', + slots:{ + default: ({row})=>{ + return renderDict(row.status,'wy_wbzszt') + } + }, + width:180 + }, + { + title: '发布时间', + field: 'releaseTime', + width:180 + }, + { + title: '知识类型', + field: 'type', + slots:{ + default: ({row})=>{ + return renderDict(row.type,'wy_wbzslx') + } + }, + width:180 + }, + { + field: 'action', + fixed: 'right', + slots: { default: 'action' }, + title: '操作', + width: 180, + }, +]; + +export const modalSchema: FormSchemaGetter = () => [ + { + label: '主键', + fieldName: 'id', + component: 'Input', + dependencies: { + show: () => false, + triggerFields: [''], + }, + }, + { + label: '标题', + fieldName: 'title', + component: 'Input', + rules: 'required', + }, + { + component: 'Select', + componentProps: { + options:getDictOptions('wy_wbzszt') + }, + fieldName: 'status', + label: '发布状态', + rules: 'selectRequired', + formItemClass:'col-span-1' + }, + { + component: 'Select', + componentProps: { + options: getDictOptions('wy_wbzslx') + }, + fieldName: 'type', + label: '知识类型', + rules: 'selectRequired', + formItemClass:'col-span-1' + }, + { + label: '封面', + fieldName: 'covers', + component: 'ImageUpload', + componentProps:{ + maxCount: 1, + }, + // rules: 'required', + formItemClass:'col-span-1' + }, + { + label: '发布时间', + fieldName: 'releaseTime', + component: 'DatePicker', + componentProps: { + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + }, + rules: 'required', + formItemClass:'col-span-1' + }, + { + label: '内容', + fieldName: 'content', + component: 'RichTextarea', + componentProps: { + // disabled: false, // 是否只读 + // height: 400 // 高度 默认400 + }, + rules: 'required', + }, + { + label: '描述', + fieldName: 'depict', + component: 'Textarea', + }, +]; diff --git a/apps/web-antd/src/views/property/maintenance/knowledge/index.vue b/apps/web-antd/src/views/property/maintenance/knowledge/index.vue new file mode 100644 index 00000000..116614dd --- /dev/null +++ b/apps/web-antd/src/views/property/maintenance/knowledge/index.vue @@ -0,0 +1,181 @@ + + + diff --git a/apps/web-antd/src/views/property/maintenance/knowledge/knowledge-detail.vue b/apps/web-antd/src/views/property/maintenance/knowledge/knowledge-detail.vue new file mode 100644 index 00000000..4feb6e43 --- /dev/null +++ b/apps/web-antd/src/views/property/maintenance/knowledge/knowledge-detail.vue @@ -0,0 +1,66 @@ + + + diff --git a/apps/web-antd/src/views/property/maintenance/knowledge/knowledge-modal.vue b/apps/web-antd/src/views/property/maintenance/knowledge/knowledge-modal.vue new file mode 100644 index 00000000..e388c322 --- /dev/null +++ b/apps/web-antd/src/views/property/maintenance/knowledge/knowledge-modal.vue @@ -0,0 +1,101 @@ + + + + diff --git a/apps/web-antd/src/views/property/maintenance/knowledgeBase/index.vue b/apps/web-antd/src/views/property/maintenance/knowledgeBase/index.vue new file mode 100644 index 00000000..7e454509 --- /dev/null +++ b/apps/web-antd/src/views/property/maintenance/knowledgeBase/index.vue @@ -0,0 +1,222 @@ + + + +