制度管理模块功能修复
This commit is contained in:
parent
9a4d9232fc
commit
e9d68d7ae3
|
@ -34,6 +34,7 @@ export const regulationApi = {
|
|||
level: string
|
||||
remark?: string
|
||||
createBy?: string
|
||||
createByName?: string
|
||||
}) => {
|
||||
return http.post('/regulation/proposal', data)
|
||||
},
|
||||
|
|
|
@ -45,6 +45,7 @@ export interface CreateProposalRequest {
|
|||
level: RegulationLevel
|
||||
remark?: string
|
||||
createBy?: string
|
||||
createByName?: string
|
||||
}
|
||||
|
||||
// 分页参数接口
|
||||
|
|
|
@ -7,7 +7,66 @@ export {}
|
|||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
Avatar: typeof import('./../components/Avatar/index.vue')['default']
|
||||
Breadcrumb: typeof import('./../components/Breadcrumb/index.vue')['default']
|
||||
CellCopy: typeof import('./../components/CellCopy/index.vue')['default']
|
||||
Chart: typeof import('./../components/Chart/index.vue')['default']
|
||||
ColumnSetting: typeof import('./../components/GiTable/src/components/ColumnSetting.vue')['default']
|
||||
CronForm: typeof import('./../components/GenCron/CronForm/index.vue')['default']
|
||||
CronModal: typeof import('./../components/GenCron/CronModal/index.vue')['default']
|
||||
DateRangePicker: typeof import('./../components/DateRangePicker/index.vue')['default']
|
||||
DayForm: typeof import('./../components/GenCron/CronForm/component/day-form.vue')['default']
|
||||
FilePreview: typeof import('./../components/FilePreview/index.vue')['default']
|
||||
GiCellAvatar: typeof import('./../components/GiCell/GiCellAvatar.vue')['default']
|
||||
GiCellGender: typeof import('./../components/GiCell/GiCellGender.vue')['default']
|
||||
GiCellStatus: typeof import('./../components/GiCell/GiCellStatus.vue')['default']
|
||||
GiCellTag: typeof import('./../components/GiCell/GiCellTag.vue')['default']
|
||||
GiCellTags: typeof import('./../components/GiCell/GiCellTags.vue')['default']
|
||||
GiCodeView: typeof import('./../components/GiCodeView/index.vue')['default']
|
||||
GiDot: typeof import('./../components/GiDot/index.tsx')['default']
|
||||
GiEditTable: typeof import('./../components/GiEditTable/GiEditTable.vue')['default']
|
||||
GiFooter: typeof import('./../components/GiFooter/index.vue')['default']
|
||||
GiForm: typeof import('./../components/GiForm/src/GiForm.vue')['default']
|
||||
GiIconBox: typeof import('./../components/GiIconBox/index.vue')['default']
|
||||
GiIconSelector: typeof import('./../components/GiIconSelector/index.vue')['default']
|
||||
GiIframe: typeof import('./../components/GiIframe/index.vue')['default']
|
||||
GiOption: typeof import('./../components/GiOption/index.vue')['default']
|
||||
GiOptionItem: typeof import('./../components/GiOptionItem/index.vue')['default']
|
||||
GiPageLayout: typeof import('./../components/GiPageLayout/index.vue')['default']
|
||||
GiSpace: typeof import('./../components/GiSpace/index.vue')['default']
|
||||
GiSplitButton: typeof import('./../components/GiSplitButton/index.vue')['default']
|
||||
GiSplitPane: typeof import('./../components/GiSplitPane/index.vue')['default']
|
||||
GiSplitPaneFlexibleBox: typeof import('./../components/GiSplitPane/components/GiSplitPaneFlexibleBox.vue')['default']
|
||||
GiSvgIcon: typeof import('./../components/GiSvgIcon/index.vue')['default']
|
||||
GiTable: typeof import('./../components/GiTable/src/GiTable.vue')['default']
|
||||
GiTag: typeof import('./../components/GiTag/index.tsx')['default']
|
||||
GiThemeBtn: typeof import('./../components/GiThemeBtn/index.vue')['default']
|
||||
HourForm: typeof import('./../components/GenCron/CronForm/component/hour-form.vue')['default']
|
||||
Icon403: typeof import('./../components/icons/Icon403.vue')['default']
|
||||
Icon404: typeof import('./../components/icons/Icon404.vue')['default']
|
||||
Icon500: typeof import('./../components/icons/Icon500.vue')['default']
|
||||
IconBorders: typeof import('./../components/icons/IconBorders.vue')['default']
|
||||
IconTableSize: typeof import('./../components/icons/IconTableSize.vue')['default']
|
||||
IconTreeAdd: typeof import('./../components/icons/IconTreeAdd.vue')['default']
|
||||
IconTreeReduce: typeof import('./../components/icons/IconTreeReduce.vue')['default']
|
||||
ImageImport: typeof import('./../components/ImageImport/index.vue')['default']
|
||||
ImageImportWizard: typeof import('./../components/ImageImportWizard/index.vue')['default']
|
||||
IndustrialImageList: typeof import('./../components/IndustrialImageList/index.vue')['default']
|
||||
JsonPretty: typeof import('./../components/JsonPretty/index.vue')['default']
|
||||
MinuteForm: typeof import('./../components/GenCron/CronForm/component/minute-form.vue')['default']
|
||||
MonthForm: typeof import('./../components/GenCron/CronForm/component/month-form.vue')['default']
|
||||
ParentView: typeof import('./../components/ParentView/index.vue')['default']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
RouterView: typeof import('vue-router')['RouterView']
|
||||
SecondForm: typeof import('./../components/GenCron/CronForm/component/second-form.vue')['default']
|
||||
SplitPanel: typeof import('./../components/SplitPanel/index.vue')['default']
|
||||
TextCopy: typeof import('./../components/TextCopy/index.vue')['default']
|
||||
TurbineGrid: typeof import('./../components/TurbineGrid/index.vue')['default']
|
||||
UserSelect: typeof import('./../components/UserSelect/index.vue')['default']
|
||||
Verify: typeof import('./../components/Verify/index.vue')['default']
|
||||
VerifyPoints: typeof import('./../components/Verify/Verify/VerifyPoints.vue')['default']
|
||||
VerifySlide: typeof import('./../components/Verify/Verify/VerifySlide.vue')['default']
|
||||
WeekForm: typeof import('./../components/GenCron/CronForm/component/week-form.vue')['default']
|
||||
YearForm: typeof import('./../components/GenCron/CronForm/component/year-form.vue')['default']
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,6 +63,10 @@
|
|||
共找到 <strong>{{ pagination.total }}</strong> 条记录
|
||||
</span>
|
||||
</template>
|
||||
<template #regulationType="{ record }">
|
||||
{{ getRegulationTypeName(record.regulationType) }}
|
||||
</template>
|
||||
|
||||
<template #status="{ record }">
|
||||
<a-tag :color="getStatusColor(record.status)">
|
||||
{{ getStatusText(record.status) }}
|
||||
|
@ -105,7 +109,7 @@
|
|||
<h3>{{ currentProposal.title }}</h3>
|
||||
<div class="detail-meta">
|
||||
<span>提案人: {{ currentProposal.createByName }}</span>
|
||||
<span>提案类型: {{ currentProposal.regulationType }}</span>
|
||||
<span>提案类型: {{ getRegulationTypeName(currentProposal.regulationType) }}</span>
|
||||
<span>适用范围: {{ currentProposal.scope }}</span>
|
||||
<span>级别: <a-tag :color="getLevelColor(currentProposal.level)">{{ getLevelText(currentProposal.level) }}</a-tag></span>
|
||||
<span>创建时间: {{ formatDate(currentProposal.createTime) }}</span>
|
||||
|
@ -157,7 +161,7 @@ defineOptions({ name: 'ProcessManagement' })
|
|||
const columns = [
|
||||
{ title: '提案标题', dataIndex: 'title', key: 'title', width: 200 },
|
||||
{ title: '提案人', dataIndex: 'createByName', key: 'createByName', width: 120 },
|
||||
{ title: '提案类型', dataIndex: 'regulationType', key: 'regulationType', width: 120 },
|
||||
{ title: '提案类型', dataIndex: 'regulationType', key: 'regulationType', slotName: 'regulationType', width: 120 },
|
||||
{ title: '状态', dataIndex: 'status', key: 'status', slotName: 'status', width: 100 },
|
||||
{ title: '级别', dataIndex: 'level', key: 'level', slotName: 'level', width: 80 },
|
||||
{ title: '创建时间', dataIndex: 'createTime', key: 'createTime', width: 180 },
|
||||
|
@ -194,6 +198,9 @@ const currentUser = ref('管理者') // 从用户认证系统获取当前用户I
|
|||
// 制度管理store
|
||||
const regulationStore = useRegulationStore()
|
||||
|
||||
// 制度类型列表
|
||||
const regulationTypes = ref<RegulationType[]>([])
|
||||
|
||||
// 获取状态颜色
|
||||
const getStatusColor = (status: RegulationStatus) => {
|
||||
const colors = {
|
||||
|
@ -245,6 +252,24 @@ const getLevelText = (level: RegulationLevel) => {
|
|||
return texts[level] || '中'
|
||||
}
|
||||
|
||||
// 根据制度类型ID获取类型名称
|
||||
const getRegulationTypeName = (typeId: string) => {
|
||||
const type = regulationTypes.value.find(t => t.typeId === typeId)
|
||||
return type ? type.typeName : typeId
|
||||
}
|
||||
|
||||
// 获取制度类型列表
|
||||
const getRegulationTypes = async () => {
|
||||
try {
|
||||
const response = await regulationApi.searchRegulationTypes()
|
||||
if (response.status === 200) {
|
||||
regulationTypes.value = response.data.records || response.data
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取制度类型列表失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 获取表格数据 - 使用后端搜索接口
|
||||
const getTableData = async () => {
|
||||
loading.value = true
|
||||
|
@ -345,6 +370,7 @@ const handlePageSizeChange = (pageSize: number) => {
|
|||
|
||||
onMounted(() => {
|
||||
getTableData()
|
||||
getRegulationTypes()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
<a-option value="">全部</a-option>
|
||||
<a-option value="DRAFT">草稿</a-option>
|
||||
<a-option value="PUBLISHED">已公告</a-option>
|
||||
<a-option value="APPROVED">已公示</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
|
||||
|
@ -78,6 +79,10 @@
|
|||
</a-tag>
|
||||
</template>
|
||||
|
||||
<template #regulationType="{ record }">
|
||||
{{ getRegulationTypeName(record.regulationType) }}
|
||||
</template>
|
||||
|
||||
<template #level="{ record }">
|
||||
<a-tag :color="getLevelColor(record.level)">
|
||||
{{ getLevelText(record.level) }}
|
||||
|
@ -165,7 +170,7 @@
|
|||
<a-option
|
||||
v-for="type in regulationTypes"
|
||||
:key="type.typeId"
|
||||
:value="type.typeName"
|
||||
:value="type.typeId"
|
||||
:disabled="type.isEnabled === '0'"
|
||||
>
|
||||
{{ type.typeName }}
|
||||
|
@ -236,7 +241,7 @@
|
|||
<h3>{{ currentProposal.title }}</h3>
|
||||
<div class="detail-meta">
|
||||
<span>提案人: {{ currentProposal.createByName }}</span>
|
||||
<span>提案类型: {{ currentProposal.regulationType }}</span>
|
||||
<span>提案类型: {{ getRegulationTypeName(currentProposal.regulationType) }}</span>
|
||||
<span>适用范围: {{ currentProposal.scope }}</span>
|
||||
<span>级别: <a-tag :color="getLevelColor(currentProposal.level)">{{ getLevelText(currentProposal.level) }}</a-tag></span>
|
||||
<span>创建时间: {{ formatDate(currentProposal.createTime) }}</span>
|
||||
|
@ -326,7 +331,7 @@ defineOptions({ name: 'RegulationProposal' })
|
|||
const columns = [
|
||||
{ title: '提案标题', dataIndex: 'title', key: 'title', width: 220 },
|
||||
{ title: '提案人', dataIndex: 'createByName', key: 'createByName', width: 130 },
|
||||
{ title: '提案类型', dataIndex: 'regulationType', key: 'regulationType', width: 130 },
|
||||
{ title: '提案类型', dataIndex: 'regulationType', key: 'regulationType', slotName: 'regulationType', width: 130 },
|
||||
{ title: '状态', dataIndex: 'status', key: 'status', slotName: 'status', width: 110 },
|
||||
{ title: '级别', dataIndex: 'level', key: 'level', slotName: 'level', width: 90 },
|
||||
{ title: '创建时间', dataIndex: 'createTime', key: 'createTime', width: 200 },
|
||||
|
@ -447,6 +452,12 @@ const getLevelText = (level: RegulationLevel) => {
|
|||
return texts[level] || '中'
|
||||
}
|
||||
|
||||
// 根据制度类型ID获取类型名称
|
||||
const getRegulationTypeName = (typeId: string) => {
|
||||
const type = regulationTypes.value.find(t => t.typeId === typeId)
|
||||
return type ? type.typeName : typeId
|
||||
}
|
||||
|
||||
// 获取制度类型列表
|
||||
const getRegulationTypes = async () => {
|
||||
try {
|
||||
|
@ -606,6 +617,7 @@ const handleSubmit = async () => {
|
|||
scope: formData.scope,
|
||||
level: formData.level,
|
||||
remark: formData.remark,
|
||||
createBy: currentUser.value,
|
||||
createByName: currentUser.value
|
||||
}
|
||||
console.log('新增提案数据:', createData)
|
||||
|
|
|
@ -63,6 +63,10 @@
|
|||
共找到 <strong>{{ pagination.total }}</strong> 条记录
|
||||
</span>
|
||||
</template>
|
||||
<template #regulationType="{ record }">
|
||||
{{ getRegulationTypeName(record.regulationType) }}
|
||||
</template>
|
||||
|
||||
<template #confirmStatus="{ record }">
|
||||
<a-tag :color="record.confirmStatus === 'CONFIRMED' ? 'green' : 'orange'">
|
||||
{{ record.confirmStatus === 'CONFIRMED' ? '已确认' : '待确认' }}
|
||||
|
@ -170,7 +174,7 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import type { Regulation } from '@/apis/regulation/type'
|
||||
import type { Regulation, RegulationType } from '@/apis/regulation/type'
|
||||
import { Message } from '@arco-design/web-vue'
|
||||
import { IconSearch, IconRefresh } from '@arco-design/web-vue/es/icon'
|
||||
import { useRegulationStore } from '@/stores/modules/regulation'
|
||||
|
@ -182,7 +186,7 @@ defineOptions({ name: 'SystemRegulation' })
|
|||
// 表格列定义
|
||||
const columns = [
|
||||
{ title: '制度名称', dataIndex: 'title', key: 'title' },
|
||||
{ title: '制度类型', dataIndex: 'regulationType', key: 'regulationType' },
|
||||
{ title: '制度类型', dataIndex: 'regulationType', key: 'regulationType', slotName: 'regulationType' },
|
||||
{ title: '公示人', dataIndex: 'createByName', key: 'createByName' },
|
||||
{ title: '公示时间', dataIndex: 'publishTime', key: 'publishTime' },
|
||||
{ title: '生效日期', dataIndex: 'effectiveTime', key: 'effectiveTime' },
|
||||
|
@ -218,6 +222,27 @@ const agreeTerms = ref(false)
|
|||
// 制度管理store
|
||||
const regulationStore = useRegulationStore()
|
||||
|
||||
// 制度类型列表
|
||||
const regulationTypes = ref<RegulationType[]>([])
|
||||
|
||||
// 根据制度类型ID获取类型名称
|
||||
const getRegulationTypeName = (typeId: string) => {
|
||||
const type = regulationTypes.value.find(t => t.typeId === typeId)
|
||||
return type ? type.typeName : typeId
|
||||
}
|
||||
|
||||
// 获取制度类型列表
|
||||
const getRegulationTypes = async () => {
|
||||
try {
|
||||
const response = await regulationApi.searchRegulationTypes()
|
||||
if (response.status === 200) {
|
||||
regulationTypes.value = response.data.records || response.data
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取制度类型列表失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 获取表格数据 - 使用后端搜索接口
|
||||
const getTableData = async () => {
|
||||
loading.value = true
|
||||
|
@ -356,6 +381,7 @@ const submitConfirm = async () => {
|
|||
|
||||
onMounted(() => {
|
||||
getTableData()
|
||||
getRegulationTypes()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue