Skip to content

Commit a77173f

Browse files
committed
🐛 修复 post 和 dept 在 IDEA 报错的问题
1 parent d6ff66d commit a77173f

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

src/api/system/dept/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface DeptVO {
1414

1515
// 查询部门(精简)列表
1616
export const getSimpleDeptList = async (): Promise<DeptVO[]> => {
17-
return await request.get({ url: '/system/dept/list-all-simple' })
17+
return await request.get({ url: '/system/dept/simple-list' })
1818
}
1919

2020
// 查询部门列表

src/api/system/post/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const getPostPage = async (params: PageParam) => {
1717

1818
// 获取岗位精简信息列表
1919
export const getSimplePostList = async (): Promise<PostVO[]> => {
20-
return await request.get({ url: '/system/post/list-all-simple' })
20+
return await request.get({ url: '/system/post/simple-list' })
2121
}
2222

2323
// 查询岗位详情

src/utils/formatTime.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ export function formatPast2(ms) {
200200
* @param cellValue 字段值
201201
*/
202202
// @ts-ignore
203-
export const dateFormatter = (row, column, cellValue) => {
203+
export const dateFormatter = (row, column, cellValue): string => {
204204
if (!cellValue) {
205-
return
205+
return ''
206206
}
207207
return formatDate(cellValue)
208208
}

src/views/system/dept/DeptForm.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<el-select v-model="formData.status" clearable placeholder="请选择状态">
4545
<el-option
4646
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
47-
:key="dict.value"
47+
:key="dict.value as number"
4848
:label="dict.label"
4949
:value="dict.value"
5050
/>
@@ -63,6 +63,7 @@ import { defaultProps, handleTree } from '@/utils/tree'
6363
import * as DeptApi from '@/api/system/dept'
6464
import * as UserApi from '@/api/system/user'
6565
import { CommonStatusEnum } from '@/utils/constants'
66+
import { FormRules } from 'element-plus'
6667
6768
defineOptions({ name: 'SystemDeptForm' })
6869
@@ -84,7 +85,7 @@ const formData = ref({
8485
email: undefined,
8586
status: CommonStatusEnum.ENABLE
8687
})
87-
const formRules = reactive({
88+
const formRules = reactive<FormRules>({
8889
parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }],
8990
name: [{ required: true, message: '部门名称不能为空', trigger: 'blur' }],
9091
sort: [{ required: true, message: '显示排序不能为空', trigger: 'blur' }],

src/views/system/dept/index.vue

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
>
2626
<el-option
2727
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
28-
:key="dict.value"
28+
:key="dict.value as number"
2929
:label="dict.label"
3030
:value="dict.value"
3131
/>
@@ -58,14 +58,14 @@
5858
:default-expand-all="isExpandAll"
5959
v-if="refreshTable"
6060
>
61-
<el-table-column prop="name" label="部门名称" width="260" />
62-
<el-table-column prop="leader" label="负责人" width="120">
61+
<el-table-column prop="name" label="部门名称" />
62+
<el-table-column prop="leader" label="负责人">
6363
<template #default="scope">
6464
{{ userList.find((user) => user.id === scope.row.leaderUserId)?.nickname }}
6565
</template>
6666
</el-table-column>
67-
<el-table-column prop="sort" label="排序" width="200" />
68-
<el-table-column prop="status" label="状态" width="100">
67+
<el-table-column prop="sort" label="排序" />
68+
<el-table-column prop="status" label="状态">
6969
<template #default="scope">
7070
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
7171
</template>
@@ -77,7 +77,7 @@
7777
width="180"
7878
:formatter="dateFormatter"
7979
/>
80-
<el-table-column label="操作" align="center" class-name="fixed-width">
80+
<el-table-column label="操作" align="center">
8181
<template #default="scope">
8282
<el-button
8383
link
@@ -119,11 +119,10 @@ const { t } = useI18n() // 国际化
119119
const loading = ref(true) // 列表的加载中
120120
const list = ref() // 列表的数据
121121
const queryParams = reactive({
122-
title: '',
123-
name: undefined,
124-
status: undefined,
125122
pageNo: 1,
126-
pageSize: 100
123+
pageSize: 100,
124+
name: undefined,
125+
status: undefined
127126
})
128127
const queryFormRef = ref() // 搜索的表单
129128
const isExpandAll = ref(true) // 是否展开,默认全部展开

src/views/system/post/PostForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<el-select v-model="formData.status" clearable placeholder="请选择状态">
2121
<el-option
2222
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
23-
:key="dict.value"
23+
:key="dict.value as number"
2424
:label="dict.label"
2525
:value="dict.value"
2626
/>

src/views/system/post/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
2929
<el-option
3030
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
31-
:key="dict.value"
31+
:key="dict.value as number"
3232
:label="dict.label"
3333
:value="dict.value"
3434
/>

0 commit comments

Comments
 (0)