🐛 修复 post 和 dept 在 IDEA 报错的问题

This commit is contained in:
YunaiV 2023-12-02 10:20:09 +08:00
parent d6ff66dc1d
commit a77173f2ae
7 changed files with 18 additions and 18 deletions

View File

@ -14,7 +14,7 @@ export interface DeptVO {
// 查询部门(精简)列表 // 查询部门(精简)列表
export const getSimpleDeptList = async (): Promise<DeptVO[]> => { export const getSimpleDeptList = async (): Promise<DeptVO[]> => {
return await request.get({ url: '/system/dept/list-all-simple' }) return await request.get({ url: '/system/dept/simple-list' })
} }
// 查询部门列表 // 查询部门列表

View File

@ -17,7 +17,7 @@ export const getPostPage = async (params: PageParam) => {
// 获取岗位精简信息列表 // 获取岗位精简信息列表
export const getSimplePostList = async (): Promise<PostVO[]> => { export const getSimplePostList = async (): Promise<PostVO[]> => {
return await request.get({ url: '/system/post/list-all-simple' }) return await request.get({ url: '/system/post/simple-list' })
} }
// 查询岗位详情 // 查询岗位详情

View File

@ -200,9 +200,9 @@ export function formatPast2(ms) {
* @param cellValue * @param cellValue
*/ */
// @ts-ignore // @ts-ignore
export const dateFormatter = (row, column, cellValue) => { export const dateFormatter = (row, column, cellValue): string => {
if (!cellValue) { if (!cellValue) {
return return ''
} }
return formatDate(cellValue) return formatDate(cellValue)
} }

View File

@ -44,7 +44,7 @@
<el-select v-model="formData.status" clearable placeholder="请选择状态"> <el-select v-model="formData.status" clearable placeholder="请选择状态">
<el-option <el-option
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)" v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key="dict.value" :key="dict.value as number"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
/> />
@ -63,6 +63,7 @@ import { defaultProps, handleTree } from '@/utils/tree'
import * as DeptApi from '@/api/system/dept' import * as DeptApi from '@/api/system/dept'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import { CommonStatusEnum } from '@/utils/constants' import { CommonStatusEnum } from '@/utils/constants'
import { FormRules } from 'element-plus'
defineOptions({ name: 'SystemDeptForm' }) defineOptions({ name: 'SystemDeptForm' })
@ -84,7 +85,7 @@ const formData = ref({
email: undefined, email: undefined,
status: CommonStatusEnum.ENABLE status: CommonStatusEnum.ENABLE
}) })
const formRules = reactive({ const formRules = reactive<FormRules>({
parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }], parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }],
name: [{ required: true, message: '部门名称不能为空', trigger: 'blur' }], name: [{ required: true, message: '部门名称不能为空', trigger: 'blur' }],
sort: [{ required: true, message: '显示排序不能为空', trigger: 'blur' }], sort: [{ required: true, message: '显示排序不能为空', trigger: 'blur' }],

View File

@ -25,7 +25,7 @@
> >
<el-option <el-option
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)" v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key="dict.value" :key="dict.value as number"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
/> />
@ -58,14 +58,14 @@
:default-expand-all="isExpandAll" :default-expand-all="isExpandAll"
v-if="refreshTable" v-if="refreshTable"
> >
<el-table-column prop="name" label="部门名称" width="260" /> <el-table-column prop="name" label="部门名称" />
<el-table-column prop="leader" label="负责人" width="120"> <el-table-column prop="leader" label="负责人">
<template #default="scope"> <template #default="scope">
{{ userList.find((user) => user.id === scope.row.leaderUserId)?.nickname }} {{ userList.find((user) => user.id === scope.row.leaderUserId)?.nickname }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="sort" label="排序" width="200" /> <el-table-column prop="sort" label="排序" />
<el-table-column prop="status" label="状态" width="100"> <el-table-column prop="status" label="状态">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" /> <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
</template> </template>
@ -77,7 +77,7 @@
width="180" width="180"
:formatter="dateFormatter" :formatter="dateFormatter"
/> />
<el-table-column label="操作" align="center" class-name="fixed-width"> <el-table-column label="操作" align="center">
<template #default="scope"> <template #default="scope">
<el-button <el-button
link link
@ -119,11 +119,10 @@ const { t } = useI18n() // 国际化
const loading = ref(true) // const loading = ref(true) //
const list = ref() // const list = ref() //
const queryParams = reactive({ const queryParams = reactive({
title: '',
name: undefined,
status: undefined,
pageNo: 1, pageNo: 1,
pageSize: 100 pageSize: 100,
name: undefined,
status: undefined
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
const isExpandAll = ref(true) // const isExpandAll = ref(true) //

View File

@ -20,7 +20,7 @@
<el-select v-model="formData.status" clearable placeholder="请选择状态"> <el-select v-model="formData.status" clearable placeholder="请选择状态">
<el-option <el-option
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)" v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key="dict.value" :key="dict.value as number"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
/> />

View File

@ -28,7 +28,7 @@
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable> <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
<el-option <el-option
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)" v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key="dict.value" :key="dict.value as number"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
/> />