fix 修复 !pr107 遗留问题
update 优化 岗位下拉框样式问题
This commit is contained in:
parent
7ed5f33e7b
commit
e2254651ca
@ -20,11 +20,14 @@ export function getPost(postId: string | number): AxiosPromise<PostVO> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取岗位选择框列表
|
// 获取岗位选择框列表
|
||||||
export function optionselect(query: PostQuery): AxiosPromise<PostVO[]> {
|
export function optionselect(deptId?: number | string, postIds?: (number | string)[]): AxiosPromise<PostVO[]> {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/post/optionselect',
|
url: '/system/post/optionselect',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: {
|
||||||
|
postIds: postIds,
|
||||||
|
deptId: deptId
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,8 @@
|
|||||||
:props="{ value: 'id', label: 'label', children: 'children' }"
|
:props="{ value: 'id', label: 'label', children: 'children' }"
|
||||||
value-key="id"
|
value-key="id"
|
||||||
placeholder="请选择部门"
|
placeholder="请选择部门"
|
||||||
check-strictly/>
|
check-strictly
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="status">
|
<el-form-item label="状态" prop="status">
|
||||||
<el-select v-model="queryParams.status" placeholder="岗位状态" clearable>
|
<el-select v-model="queryParams.status" placeholder="岗位状态" clearable>
|
||||||
@ -114,18 +115,16 @@
|
|||||||
<el-form-item label="岗位名称" prop="postName">
|
<el-form-item label="岗位名称" prop="postName">
|
||||||
<el-input v-model="form.postName" placeholder="请输入岗位名称" />
|
<el-input v-model="form.postName" placeholder="请输入岗位名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-col>
|
<el-form-item label="部门" prop="deptId">
|
||||||
<el-form-item label="部门" prop="deptId">
|
<el-tree-select
|
||||||
<el-tree-select
|
v-model="form.deptId"
|
||||||
v-model="form.deptId"
|
:data="deptOptions"
|
||||||
:data="deptOptions"
|
:props="{ value: 'id', label: 'label', children: 'children' }"
|
||||||
:props="{ value: 'id', label: 'label', children: 'children' }"
|
value-key="id"
|
||||||
value-key="id"
|
placeholder="请选择部门"
|
||||||
placeholder="请选择部门"
|
check-strictly
|
||||||
check-strictly
|
/>
|
||||||
/>
|
</el-form-item>
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-form-item label="岗位编码" prop="postCode">
|
<el-form-item label="岗位编码" prop="postCode">
|
||||||
<el-input v-model="form.postCode" placeholder="请输入编码名称" />
|
<el-input v-model="form.postCode" placeholder="请输入编码名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -287,10 +287,11 @@ import api from '@/api/system/user';
|
|||||||
import { UserForm, UserQuery, UserVO } from '@/api/system/user/types';
|
import { UserForm, UserQuery, UserVO } from '@/api/system/user/types';
|
||||||
import { DeptVO } from '@/api/system/dept/types';
|
import { DeptVO } from '@/api/system/dept/types';
|
||||||
import { RoleVO } from '@/api/system/role/types';
|
import { RoleVO } from '@/api/system/role/types';
|
||||||
import { PostVO } from '@/api/system/post/types';
|
import {PostQuery, PostVO} from '@/api/system/post/types';
|
||||||
import { treeselect } from '@/api/system/dept';
|
import { treeselect } from '@/api/system/dept';
|
||||||
import { globalHeaders } from '@/utils/request';
|
import { globalHeaders } from '@/utils/request';
|
||||||
import { to } from 'await-to-js';
|
import { to } from 'await-to-js';
|
||||||
|
import {optionselect} from "@/api/system/post";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
@ -645,6 +646,15 @@ onMounted(() => {
|
|||||||
initPassword.value = response.data;
|
initPassword.value = response.data;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 监测部门变化加载岗位
|
||||||
|
watch(
|
||||||
|
() => form.value.deptId,
|
||||||
|
async () => {
|
||||||
|
const response = await optionselect(form.value.deptId);
|
||||||
|
postOptions.value = response.data;
|
||||||
|
}
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user