feat(frontend): 完善评估报告与情况登记功能,优化权限配置
This commit is contained in:
parent
2cee84c00d
commit
59f2fbbfae
@ -55,7 +55,15 @@ const whiteList = [
|
|||||||
'/register',
|
'/register',
|
||||||
'/oauthLogin/gitee',
|
'/oauthLogin/gitee',
|
||||||
'/prisoner/prisoner/dashboard', // Dashboard 页面
|
'/prisoner/prisoner/dashboard', // Dashboard 页面
|
||||||
'/ai-dash-entry' // DashEntry 页面
|
'/ai-dash-entry', // DashEntry 页面
|
||||||
|
// 监狱模块路由(解决SPA路由重定向问题)
|
||||||
|
'/prison/template', // 问卷模版管理
|
||||||
|
'/prison/questionnaire', // 问卷任务管理
|
||||||
|
'/prison/guard', // 狱警管理
|
||||||
|
// AI指导建议路由(evaluation-mgmt)
|
||||||
|
'/prison/evaluation-mgmt/template', // 评估模板管理
|
||||||
|
'/prison/evaluation-mgmt/dimension', // 评估维度管理
|
||||||
|
'/prison/evaluation-mgmt/report', // 评估报告管理
|
||||||
]
|
]
|
||||||
|
|
||||||
// 路由加载前
|
// 路由加载前
|
||||||
|
|||||||
@ -77,12 +77,14 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
import { EvaluationTemplateApi } from '@/api/prison/evaluation'
|
import { EvaluationTemplateApi } from '@/api/prison/evaluation'
|
||||||
import { ElMessage } from 'element-plus'
|
import { useMessage } from '@/hooks/web/useMessage'
|
||||||
|
|
||||||
defineOptions({ name: 'EvaluationTemplateForm' })
|
defineOptions({ name: 'EvaluationTemplateForm' })
|
||||||
|
|
||||||
const emit = defineEmits(['success'])
|
const emit = defineEmits(['success'])
|
||||||
|
|
||||||
|
const message = useMessage()
|
||||||
|
|
||||||
// 保存当前编辑的模板ID,用于刷新数据
|
// 保存当前编辑的模板ID,用于刷新数据
|
||||||
const currentTemplateId = ref<number | undefined>(undefined)
|
const currentTemplateId = ref<number | undefined>(undefined)
|
||||||
|
|
||||||
|
|||||||
@ -163,12 +163,13 @@ const open = async (type: string, templateId: number, id?: number) => {
|
|||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
dialogTitle.value = t('action.' + type)
|
dialogTitle.value = t('action.' + type)
|
||||||
formType.value = type
|
formType.value = type
|
||||||
formData.value.templateId = templateId
|
|
||||||
resetForm()
|
resetForm()
|
||||||
|
formData.value.templateId = templateId
|
||||||
if (id) {
|
if (id) {
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
formData.value = await DimensionApi.getDimension(id)
|
const existingDimension = await DimensionApi.getDimension(id)
|
||||||
|
formData.value = { ...existingDimension, templateId }
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -90,7 +90,7 @@
|
|||||||
<!-- 维度配置 Tab -->
|
<!-- 维度配置 Tab -->
|
||||||
<el-tab-pane label="维度配置" name="dimension">
|
<el-tab-pane label="维度配置" name="dimension">
|
||||||
<div class="dimension-header mb-15px">
|
<div class="dimension-header mb-15px">
|
||||||
<el-button type="primary" @click="openDimensionForm(selectedTemplate.id!)" v-hasPermi="['prison:evaluation-report:dimension:create']">
|
<el-button type="primary" @click="openDimensionForm(selectedTemplate.id!)" v-hasPermi="['prison:evaluation-report:template:update']">
|
||||||
<Icon icon="ep:plus" class="mr-5px" /> 新增维度
|
<Icon icon="ep:plus" class="mr-5px" /> 新增维度
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -111,7 +111,7 @@
|
|||||||
<el-button type="primary" link size="small" @click="openDimensionForm(selectedTemplate.id!, dimension.id)">
|
<el-button type="primary" link size="small" @click="openDimensionForm(selectedTemplate.id!, dimension.id)">
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="danger" link size="small" @click="handleDeleteDimension(dimension.id!)" v-hasPermi="['prison:evaluation-report:dimension:delete']">
|
<el-button type="danger" link size="small" @click="handleDeleteDimension(dimension.id!)" v-hasPermi="['prison:evaluation-report:template:update']">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -290,9 +290,21 @@ const submitForm = async () => {
|
|||||||
// 提交请求
|
// 提交请求
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
|
// 格式化时间,保持中国时区
|
||||||
|
const formatDateTime = (timestamp: number) => {
|
||||||
|
if (!timestamp) return undefined
|
||||||
|
const date = new Date(timestamp)
|
||||||
|
const year = date.getFullYear()
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||||
|
const day = String(date.getDate()).padStart(2, '0')
|
||||||
|
const hours = String(date.getHours()).padStart(2, '0')
|
||||||
|
const minutes = String(date.getMinutes()).padStart(2, '0')
|
||||||
|
const seconds = String(date.getSeconds()).padStart(2, '0')
|
||||||
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
|
||||||
|
}
|
||||||
const data = {
|
const data = {
|
||||||
...formData.value,
|
...formData.value,
|
||||||
occurTime: formData.value.occurTime ? new Date(formData.value.occurTime).toISOString() : undefined
|
occurTime: formatDateTime(formData.value.occurTime)
|
||||||
} as unknown as SituationSaveReqVO
|
} as unknown as SituationSaveReqVO
|
||||||
if (formType.value === 'create') {
|
if (formType.value === 'create') {
|
||||||
await SituationApi.createSituation(data)
|
await SituationApi.createSituation(data)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user