|
|
@@ -149,18 +149,18 @@ async function addShipOwner() {
|
|
|
form.value.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
let { userName, shipname, mmsi, phone } = ruleForm.value;
|
|
|
- let res = await api.addShipOwner({
|
|
|
+ let { data } = await api.addShipOwner({
|
|
|
userName,
|
|
|
shipname,
|
|
|
mmsi,
|
|
|
phone,
|
|
|
});
|
|
|
- console.log(res);
|
|
|
- if (res.data.status == 0) {
|
|
|
+ console.log({ data });
|
|
|
+ if (data.status == 0) {
|
|
|
ElNotification.success({
|
|
|
title: "添加成功",
|
|
|
duration: 0,
|
|
|
- message: `${userName}:${res.data.msg}`,
|
|
|
+ message: `${userName}:${data.msg}`,
|
|
|
type: "success",
|
|
|
});
|
|
|
resetForm();
|
|
|
@@ -169,7 +169,7 @@ async function addShipOwner() {
|
|
|
ElNotification.error({
|
|
|
title: "失败",
|
|
|
duration: 3000,
|
|
|
- message: res.data.msg,
|
|
|
+ message: data.msg,
|
|
|
});
|
|
|
}
|
|
|
} else {
|
|
|
@@ -183,14 +183,14 @@ let tableData = ref([]);
|
|
|
let total = ref(0);
|
|
|
async function getShipOwnerList(page) {
|
|
|
currentPage.value = page || currentPage.value;
|
|
|
- let res = await api.getShipOwnerList({
|
|
|
+ let { data } = await api.getShipOwnerList({
|
|
|
currentPage: currentPage.value,
|
|
|
size: 10,
|
|
|
term: term.value,
|
|
|
});
|
|
|
- if (res.data.status == 0) {
|
|
|
- tableData.value = res.data.result;
|
|
|
- total.value = res.data.total;
|
|
|
+ if (data.status == 0) {
|
|
|
+ tableData.value = data.result;
|
|
|
+ total.value = data.total;
|
|
|
} else {
|
|
|
tableData.value = [];
|
|
|
total.value = 0;
|