98 lines
2.2 KiB
TypeScript
98 lines
2.2 KiB
TypeScript
import http from '@/utils/http'
|
|
|
|
// 制度管理API接口
|
|
export const regulationApi = {
|
|
// 获取制度列表
|
|
getRegulationList: (params: {
|
|
page: number
|
|
size: number
|
|
}) => {
|
|
return http.get('/regulation', params)
|
|
},
|
|
|
|
// 获取制度详情
|
|
getRegulationDetail: (regulationId: string) => {
|
|
return http.get(`/regulation/${regulationId}`)
|
|
},
|
|
|
|
// 创建制度提案
|
|
createProposal: (data: {
|
|
title: string
|
|
content: string
|
|
regulationType: string
|
|
scope: string
|
|
level: string
|
|
remark?: string
|
|
createBy?: string
|
|
}) => {
|
|
return http.post('/regulation/proposal', data)
|
|
},
|
|
|
|
// 更新制度提案
|
|
updateProposal: (regulationId: string, data: any) => {
|
|
return http.put(`/regulation/proposal/${regulationId}`, data)
|
|
},
|
|
|
|
// 公示提案
|
|
publishProposal: (regulationId: string) => {
|
|
return http.post(`/regulation/proposal/${regulationId}/publish`)
|
|
},
|
|
|
|
// 删除制度提案
|
|
deleteProposal: (regulationId: string) => {
|
|
return http.del(`/regulation/proposal/${regulationId}`)
|
|
},
|
|
|
|
// 公示制度
|
|
publishRegulation: (regulationId: string) => {
|
|
return http.post(`/regulation/${regulationId}/approve`)
|
|
},
|
|
|
|
// 获取已公示制度列表
|
|
getPublishedRegulationList: (params: {
|
|
page: number
|
|
size: number
|
|
status: string
|
|
}) => {
|
|
return http.get('/regulation', params)
|
|
},
|
|
|
|
// 确认制度知晓
|
|
confirmRegulation: (regulationId: string) => {
|
|
return http.post(`/regulation/${regulationId}/confirm`)
|
|
},
|
|
|
|
// 获取制度类型列表
|
|
getRegulationTypes: (params?: {
|
|
page?: number
|
|
size?: number
|
|
typeName?: string
|
|
isEnabled?: 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}`)
|
|
}
|
|
}
|