人员管理新增删除功能 调整登陆获取养护站信息接口

This commit is contained in:
huangchenhao 2025-11-19 17:02:43 +08:00
parent 51ba2008ac
commit fa4eb3f9dc
3 changed files with 46 additions and 2 deletions

View File

@ -87,7 +87,7 @@ const getYHZinfo = async () => {
method: "GET", method: "GET",
}); });
if (res.code === "00000") { if (res.code === "00000") {
yhzinfo.value = res.data; yhzinfo.value = res.data[0];
} else { } else {
throw new Error(res.message); throw new Error(res.message);
} }

View File

@ -440,7 +440,6 @@ const handleGetLocation = () => {
(position) => { (position) => {
form.material.jd = position.coords.longitude.toFixed(6); form.material.jd = position.coords.longitude.toFixed(6);
form.material.wd = position.coords.latitude.toFixed(6); form.material.wd = position.coords.latitude.toFixed(6);
showToast("定位成功");
}, },
(error) => { (error) => {
const errorMessage = const errorMessage =

View File

@ -144,6 +144,51 @@ const columns = () => {
); );
}, },
}, },
{
label: "操作",
fixed: "right",
width: 150,
render: (row) => () =>
h("div", { class: "action-btns" }, [
h(
ElButton,
{
type: "danger",
link: true,
style: "margin-left: 10px;",
onClick: async () => {
try {
await ElMessageBox.confirm(
"确定要删除该人员吗?",
"删除确认",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
);
const res = await request({
url: `/snow-ops-platform/yhzry/delete`,
method: "POST",
data: {
id: row.id,
},
});
if (res.code === "00000") {
ElMessage.success("删除成功");
getPeopleList();
}
} catch (error) {
if (error instanceof Error) {
ElMessage.error(error.message || "删除失败");
}
}
},
},
() => "删除"
),
]),
},
]; ];
case "material": case "material":
return [ return [