diff --git a/.env.development b/.env.development index 41011c0..422fbfa 100644 --- a/.env.development +++ b/.env.development @@ -4,8 +4,8 @@ VITE_API_PREFIX = '/dev-api' # 接口地址 # VITE_API_BASE_URL = 'http://pms.dtyx.net:9158/' -VITE_API_BASE_URL = 'http://localhost:8888/' -# VITE_API_BASE_URL = 'http://10.18.34.213:8888/' +# VITE_API_BASE_URL = 'http://localhost:8888/' +VITE_API_BASE_URL = 'http://10.18.34.213:8888/' # 接口地址 (WebSocket) VITE_API_WS_URL = 'ws://localhost:8000' diff --git a/src/apis/regulation/index.ts b/src/apis/regulation/index.ts index 47c8a45..3812ff9 100644 --- a/src/apis/regulation/index.ts +++ b/src/apis/regulation/index.ts @@ -37,53 +37,22 @@ export const regulationApi = { return http.del(`/regulation/proposal/${regulationId}`) }, - // 提交投票 - submitVote: (regulationId: string, data: { - voteType: 'FOR' | 'AGAINST' | 'ABSTAIN' - reason?: string - }) => { - return http.post(`/regulation/${regulationId}/vote`, data) - }, - - // 获取投票结果 - getVoteResult: (regulationId: string) => { - return http.get(`/regulation/${regulationId}/vote-result`) - }, - // 发布制度 publishRegulation: (regulationId: string) => { return http.post(`/regulation/${regulationId}/publish`) }, - // 获取讨论列表 - getDiscussionList: (regulationId: string) => { - return http.get(`/regulation/${regulationId}/discussions`) - }, - - // 发表评论 - addComment: (regulationId: string, data: { - content: string - }) => { - return http.post(`/regulation/${regulationId}/discussions`, data) - }, - // 获取已发布制度列表 getPublishedRegulationList: (params: { page: number size: number + status: string }) => { - return http.get('/regulation/published', params) + return http.get('/regulation', params) }, // 确认制度知晓 - confirmRegulation: (regulationId: string, data: { - agreeTerms: boolean - }) => { - return http.post(`/regulation/${regulationId}/confirm`, data) - }, - - // 批量确认制度 - confirmAllRegulations: () => { - return http.post('/regulation/confirm-all') + confirmRegulation: (regulationId: string) => { + return http.post(`/regulation/${regulationId}/confirm`) } } \ No newline at end of file diff --git a/src/apis/regulation/type.ts b/src/apis/regulation/type.ts index 057ca4d..c708bcb 100644 --- a/src/apis/regulation/type.ts +++ b/src/apis/regulation/type.ts @@ -15,13 +15,6 @@ export enum RegulationLevel { HIGH = 'HIGH' // 高 } -// 投票类型枚举 -export enum VoteType { - FOR = 'FOR', // 赞成 - AGAINST = 'AGAINST', // 反对 - ABSTAIN = 'ABSTAIN' // 弃权 -} - // 制度信息接口 export interface Regulation { regulationId: string @@ -45,21 +38,6 @@ export interface Regulation { page: number pageSize: number delFlag: string - requirements?: string - notes?: string - confirmStatus?: 'pending' | 'confirmed' -} - -// 制度列表响应接口 -export interface RegulationListResponse { - status: number - data: { - records: Regulation[] - total: number - size: number - current: number - pages: number - } } // 创建提案请求接口 @@ -72,32 +50,6 @@ export interface CreateProposalRequest { remark?: string } -// 投票请求接口 -export interface VoteRequest { - voteType: VoteType - reason?: string -} - -// 投票结果接口 -export interface VoteResult { - regulationId: string - voteFor: number - voteAgainst: number - voteAbstain: number - totalVotes: number - approvalRate: number -} - -// 讨论评论接口 -export interface Discussion { - id: string - regulationId: string - authorId: string - authorName: string - content: string - createTime: string -} - // 分页参数接口 export interface PaginationParams { page: number diff --git a/src/mock/regulation.ts b/src/mock/regulation.ts deleted file mode 100644 index 7f4dd25..0000000 --- a/src/mock/regulation.ts +++ /dev/null @@ -1,131 +0,0 @@ -import { RegulationStatus, RegulationLevel } from '@/apis/regulation/type' - -// Mock数据 -export const mockRegulations = [ - { - regulationId: 'reg001', - title: '员工考勤管理制度优化提案', - content: '建议优化考勤管理制度,增加弹性工作时间,提高员工工作积极性。具体包括:1. 允许员工在合理范围内调整上下班时间;2. 建立完善的请假制度;3. 优化加班管理流程。', - regulationType: '人事制度', - status: RegulationStatus.VOTING, - publisherId: '1', - publisherName: '张三', - publishTime: '2024-01-01T12:00:00', - effectiveTime: '2024-01-01T12:00:00', - expireTime: '2024-01-08T12:00:00', - scope: '全体员工', - level: RegulationLevel.MEDIUM, - version: '1.0', - remark: '需要与人事部门协调实施', - createBy: 'admin', - updateBy: 'admin', - createTime: '2024-01-01 10:00:00', - updateTime: '2024-01-01 10:00:00', - page: 1, - pageSize: 10, - delFlag: '0', - voteFor: 15, - voteAgainst: 3, - voteAbstain: 2 - }, - { - regulationId: 'reg002', - title: '财务报销流程简化提案', - content: '建议简化财务报销流程,提高工作效率。具体包括:1. 优化审批流程,减少不必要的审批环节;2. 简化单据要求,使用电子化单据;3. 建立快速报销通道。', - regulationType: '财务制度', - status: RegulationStatus.PUBLISHED, - publisherId: '2', - publisherName: '李四', - publishTime: '2024-01-15T14:30:00', - effectiveTime: '2024-01-15T14:30:00', - expireTime: '2024-01-22T14:30:00', - scope: '财务部门及相关员工', - level: RegulationLevel.HIGH, - version: '1.0', - remark: '已获得财务部门支持', - createBy: 'admin', - updateBy: 'admin', - createTime: '2024-01-15 14:30:00', - updateTime: '2024-01-15 14:30:00', - page: 1, - pageSize: 10, - delFlag: '0', - voteFor: 20, - voteAgainst: 1, - voteAbstain: 0 - }, - { - regulationId: 'reg003', - title: '安全生产管理制度', - content: '建立完善的安全生产管理制度,确保员工人身安全和设备安全。具体包括:1. 制定详细的安全操作规程;2. 建立安全培训制度;3. 完善安全检查机制。', - regulationType: '安全制度', - status: RegulationStatus.DRAFT, - publisherId: '3', - publisherName: '王五', - publishTime: '2024-01-20T09:15:00', - effectiveTime: '2024-01-20T09:15:00', - expireTime: '2024-12-31T23:59:59', - scope: '所有工作场所和员工', - level: RegulationLevel.HIGH, - version: '1.0', - remark: '需要安全部门配合', - createBy: 'admin', - updateBy: 'admin', - createTime: '2024-01-20 09:15:00', - updateTime: '2024-01-20 09:15:00', - page: 1, - pageSize: 10, - delFlag: '0' - }, - { - regulationId: 'reg004', - title: '设备维护制度', - content: '为保障设备正常运行,延长设备使用寿命,特制定本制度。具体包括:1. 建立设备维护计划;2. 制定维护标准;3. 建立维护记录制度。', - regulationType: '设备制度', - status: RegulationStatus.ARCHIVED, - publisherId: '1', - publisherName: '管理员', - publishTime: '2024-01-01T12:00:00', - effectiveTime: '2024-01-01T12:00:00', - expireTime: '2024-12-31T23:59:59', - scope: '设备部门', - level: RegulationLevel.MEDIUM, - version: '1.0', - remark: '已归档', - createBy: 'admin', - updateBy: 'admin', - createTime: '2024-01-01 12:00:00', - updateTime: '2024-01-01 12:00:00', - page: 1, - pageSize: 10, - delFlag: '0' - } -] - -// Mock讨论数据 -export const mockDiscussions = [ - { - id: '1', - regulationId: 'reg001', - authorId: '2', - authorName: '李四', - content: '这个提案很有建设性,建议增加一些具体的实施细则。', - createTime: '2024-01-01 11:00:00' - }, - { - id: '2', - regulationId: 'reg001', - authorId: '3', - authorName: '王五', - content: '同意这个提案,但需要考虑实施成本。', - createTime: '2024-01-01 14:30:00' - }, - { - id: '3', - regulationId: 'reg002', - authorId: '1', - authorName: '张三', - content: '简化流程确实能提高效率,支持这个提案。', - createTime: '2024-01-15 16:00:00' - } -] \ No newline at end of file diff --git a/src/types/auto-imports.d.ts b/src/types/auto-imports.d.ts index eab6be6..369aad4 100644 --- a/src/types/auto-imports.d.ts +++ b/src/types/auto-imports.d.ts @@ -70,6 +70,6 @@ declare global { // for type re-export declare global { // @ts-ignore - export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue' + export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue' import('vue') } diff --git a/src/views/regulation/confirm.vue b/src/views/regulation/confirm.vue index 430b195..eabb7ee 100644 --- a/src/views/regulation/confirm.vue +++ b/src/views/regulation/confirm.vue @@ -35,17 +35,6 @@ 查看详情 - - 讨论 - - - 投票 - - - -
-
-

{{ currentProposal.title }}

-

{{ currentProposal.content }}

-
- - - -
-
-
- {{ comment.authorName }} - {{ formatDate(comment.createTime) }} -
-
{{ comment.content }}
-
-
- -
- - - 发表评论 - -
-
-
- - -
-

{{ currentProposal.title }}

-

{{ currentProposal.content }}

- - - -

请选择您的投票

- - 赞成 - 反对 - 弃权 - - - -
-
+ + -
-

投票结果

-
-
- 赞成: - {{ currentProposal.voteFor || 0 }} -
-
- 反对: - {{ currentProposal.voteAgainst || 0 }} -
-
- 弃权: - {{ currentProposal.voteAbstain || 0 }} -
-
-
-