!29 修改列表打开对话框和接口请求顺序

Merge pull request !29 from ahaos/tspr
This commit is contained in:
ahaos
2023-07-19 14:48:30 +00:00
committed by 疯狂的狮子Li
parent d69f0992c7
commit ac3ad63894
21 changed files with 193 additions and 296 deletions

View File

@ -192,22 +192,18 @@ const handleSelectionChange = (selection: PostVO[]) => {
}
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = "添加岗位";
nextTick(() => {
reset();
})
}
/** 修改按钮操作 */
const handleUpdate = (row?: PostVO) => {
const handleUpdate = async (row?: PostVO) => {
reset();
const postId = row?.postId || ids.value[0];
const res = await getPost(postId);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = "修改岗位";
nextTick(async () => {
reset();
const postId = row?.postId || ids.value[0];
const res = await getPost(postId);
form.value = res.data;
})
}
/** 提交按钮 */
const submitForm = () => {