diff --git a/src/apis/regulation/index.ts b/src/apis/regulation/index.ts index 3812ff9..755c245 100644 --- a/src/apis/regulation/index.ts +++ b/src/apis/regulation/index.ts @@ -54,5 +54,38 @@ export const regulationApi = { // 确认制度知晓 confirmRegulation: (regulationId: string) => { return http.post(`/regulation/${regulationId}/confirm`) + }, + + // 获取制度类型列表 + getRegulationTypes: (params?: { + page?: number + size?: number + typeName?: string + remark?: string + }) => { + return http.get('/regulation/types', params) + }, + + // 创建制度类型 + createRegulationType: (data: { + typeName: string + sortOrder?: number + isEnabled?: string + }) => { + return http.post('/regulation/types', data) + }, + + // 更新制度类型 + updateRegulationType: (typeId: string, data: { + typeName: string + sortOrder?: number + isEnabled?: string + }) => { + return http.put(`/regulation/types/${typeId}`, data) + }, + + // 删除制度类型 + deleteRegulationType: (typeId: string) => { + return http.del(`/regulation/types/${typeId}`) } } \ No newline at end of file diff --git a/src/apis/regulation/type.ts b/src/apis/regulation/type.ts index c708bcb..fde8506 100644 --- a/src/apis/regulation/type.ts +++ b/src/apis/regulation/type.ts @@ -22,8 +22,6 @@ export interface Regulation { content: string regulationType: string status: RegulationStatus - publisherId: string - publisherName: string publishTime: string effectiveTime: string expireTime: string @@ -38,6 +36,7 @@ export interface Regulation { page: number pageSize: number delFlag: string + confirmStatus?: string } // 创建提案请求接口 @@ -54,4 +53,34 @@ export interface CreateProposalRequest { export interface PaginationParams { page: number size: number +} + +// 制度类型接口 +export interface RegulationType { + typeId: string + typeName: string + sortOrder: number + isEnabled: string + remark?: string + createBy: string + createTime: string + updateBy: string + updateTime: string + delFlag: string +} + +// 创建制度类型请求接口 +export interface CreateRegulationTypeRequest { + typeName: string + sortOrder?: number + isEnabled?: string + remark?: string +} + +// 更新制度类型请求接口 +export interface UpdateRegulationTypeRequest { + typeName: string + sortOrder?: number + isEnabled?: string + remark?: string } \ No newline at end of file diff --git a/src/router/route.ts b/src/router/route.ts index fd39ac5..dae3998 100644 --- a/src/router/route.ts +++ b/src/router/route.ts @@ -37,7 +37,13 @@ export const systemRoutes: RouteRecordRaw[] = [ path: '/regulation/system-regulation', name: 'SystemRegulation', component: () => import('@/views/regulation/repository.vue'), - meta: { title: '制度确认', icon: 'file-text', hidden: false }, + meta: { title: '制度公示', icon: 'file-text', hidden: false }, + }, + { + path: '/regulation/type', + name: 'RegulationType', + component: () => import('@/views/regulation/type/index.vue'), + meta: { title: '制度类型', icon: 'tag', hidden: false }, }, { path: '/regulation/process-management', diff --git a/src/views/regulation/confirm.vue b/src/views/regulation/confirm.vue index eabb7ee..a7ea0ba 100644 --- a/src/views/regulation/confirm.vue +++ b/src/views/regulation/confirm.vue @@ -88,12 +88,14 @@ - 人事制度 - 财务制度 - 安全制度 - 设备制度 - 工作流程 - 其他制度 + + {{ type.typeName }} + @@ -149,7 +151,7 @@

{{ currentProposal.title }}

- 提案人: {{ currentProposal.publisherName }} + 提案人: {{ currentProposal.createBy }} 提案类型: {{ currentProposal.regulationType }} 适用范围: {{ currentProposal.scope }} 级别: {{ getLevelText(currentProposal.level) }} @@ -191,7 +193,8 @@ import { regulationApi } from '@/apis/regulation' import { RegulationStatus, RegulationLevel, - type Regulation + type Regulation, + type RegulationType } from '@/apis/regulation/type' defineOptions({ name: 'ProcessManagement' }) @@ -199,7 +202,7 @@ defineOptions({ name: 'ProcessManagement' }) // 表格列定义 const columns = [ { title: '提案标题', dataIndex: 'title', key: 'title' }, - { title: '提案人', dataIndex: 'publisherName', key: 'publisherName' }, + { title: '提案人', dataIndex: 'createBy', key: 'createBy' }, { title: '提案类型', dataIndex: 'regulationType', key: 'regulationType' }, { title: '状态', dataIndex: 'status', key: 'status', slotName: 'status' }, { title: '级别', dataIndex: 'level', key: 'level', slotName: 'level' }, @@ -238,12 +241,15 @@ const currentProposal = ref(null) // 详情相关 const detailModalVisible = ref(false) -// 当前用户 - 应该从用户认证系统获取 -const currentUser = ref('') // TODO: 从用户认证系统获取当前用户ID +// 当前用户 +const currentUser = ref('admin') // 从用户认证系统获取当前用户ID // 制度管理store const regulationStore = useRegulationStore() +// 制度类型列表 +const regulationTypes = ref([]) + // 表单验证规则 const rules = { title: [{ required: true, message: '请输入提案标题' }], @@ -311,6 +317,18 @@ const getLevelText = (level: RegulationLevel) => { return texts[level] || '中' } +// 获取制度类型列表 +const getRegulationTypes = async () => { + try { + const response = await regulationApi.getRegulationTypes() + if (response.status === 200) { + regulationTypes.value = response.data.records || response.data + } + } catch (error) { + console.error('获取制度类型列表失败:', error) + } +} + // 获取表格数据 const getTableData = async () => { loading.value = true @@ -450,6 +468,7 @@ const handlePageSizeChange = (pageSize: number) => { onMounted(() => { getTableData() + getRegulationTypes() }) diff --git a/src/views/regulation/index.vue b/src/views/regulation/index.vue index f4252a4..957c826 100644 --- a/src/views/regulation/index.vue +++ b/src/views/regulation/index.vue @@ -36,17 +36,19 @@ + + \ No newline at end of file