冰雪专题Pc端参数调整
This commit is contained in:
parent
3458857fa7
commit
eda01c8043
@ -47,19 +47,20 @@
|
|||||||
import "vant/es/toast/style";
|
import "vant/es/toast/style";
|
||||||
import "vant/es/popup/style";
|
import "vant/es/popup/style";
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter, useRoute } from "vue-router";
|
||||||
import { showToast } from "vant";
|
import { showToast } from "vant";
|
||||||
import { request } from "../../../shared/utils/request";
|
import { request } from "../../../shared/utils/request";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const active = ref(0);
|
const active = ref(0);
|
||||||
const detailData = ref({});
|
const detailData = ref({});
|
||||||
|
const yhzinfo = ref({});
|
||||||
|
|
||||||
// 获取养护站详情
|
// 获取养护站详情
|
||||||
const getYHZDetail = async () => {
|
const getYHZDetail = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await request({
|
const res = await request({
|
||||||
url: `/snow-ops-platform/yhz/getById?id=${53}`, // 假设获取的是id为53的养护站的详情
|
url: `/snow-ops-platform/yhz/getById?id=${yhzinfo.value.id}`,
|
||||||
method: "GET",
|
method: "GET",
|
||||||
});
|
});
|
||||||
if (res.code && res.code === "00000") {
|
if (res.code && res.code === "00000") {
|
||||||
@ -75,8 +76,38 @@ const getYHZDetail = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
const route = useRoute();
|
||||||
getYHZDetail();
|
const token = route.query.token;
|
||||||
|
|
||||||
|
// 获取当前登录用于就职的养护站信息
|
||||||
|
const getYHZinfo = async () => {
|
||||||
|
try {
|
||||||
|
const res = await request({
|
||||||
|
url: `/snow-ops-platform/yhz/getStationByUser`,
|
||||||
|
method: "GET",
|
||||||
|
});
|
||||||
|
if (res.code === "00000") {
|
||||||
|
yhzinfo.value = res.data;
|
||||||
|
} else {
|
||||||
|
throw new Error(res.message);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
showToast({
|
||||||
|
message: error.message,
|
||||||
|
type: "fail",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
if (token) {
|
||||||
|
localStorage.setItem("token", token);
|
||||||
|
router.replace({ path: route.path }).then(() => {
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
await getYHZinfo();
|
||||||
|
await getYHZDetail();
|
||||||
});
|
});
|
||||||
|
|
||||||
const goToUser = () => {
|
const goToUser = () => {
|
||||||
|
|||||||
@ -165,7 +165,7 @@ const getyhzsbList = async (qxmc, yhzid, filterData) => {
|
|||||||
})
|
})
|
||||||
if (res.code === '00000') {
|
if (res.code === '00000') {
|
||||||
tableData.value = res.data.records;
|
tableData.value = res.data.records;
|
||||||
pagination.total = res.data.total;
|
pagination.total = Number(res.data.total);
|
||||||
} else {
|
} else {
|
||||||
tableData.value = [];
|
tableData.value = [];
|
||||||
pagination.total = 0;
|
pagination.total = 0;
|
||||||
@ -456,9 +456,10 @@ export default () => {
|
|||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getTreeData();
|
await getTreeData();
|
||||||
await getyhzsbList();
|
await getyhzsbList();
|
||||||
const rowData = JSON.parse(decodeURIComponent(route.params.data));
|
const rowData = (decodeURIComponent(route.params.data));
|
||||||
if (rowData) {
|
if (rowData !== 'undefined' && rowData!== 'null' && rowData !== '' ) {
|
||||||
filterText.value = rowData.mc;
|
const JSONData = JSON.parse(rowData);
|
||||||
|
filterText.value = JSONData.mc;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -149,7 +149,7 @@ const getyhzwzList = async (qxmc, yhzid, filterData) => {
|
|||||||
})
|
})
|
||||||
if (res.code === '00000') {
|
if (res.code === '00000') {
|
||||||
tableData.value = res.data.records;
|
tableData.value = res.data.records;
|
||||||
pagination.total = res.data.total;
|
pagination.total = Number(res.data.total);
|
||||||
} else {
|
} else {
|
||||||
tableData.value = [];
|
tableData.value = [];
|
||||||
pagination.total = 0;
|
pagination.total = 0;
|
||||||
@ -440,9 +440,10 @@ export default () => {
|
|||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getTreeData();
|
await getTreeData();
|
||||||
await getyhzwzList();
|
await getyhzwzList();
|
||||||
const rowData = JSON.parse(decodeURIComponent(route.params.data));
|
const rowData = (decodeURIComponent(route.params?.data));
|
||||||
if (rowData) {
|
if (rowData !== 'undefined' && rowData!== 'null' && rowData !== '' ) {
|
||||||
filterText.value = rowData.mc;
|
const JSONData = JSON.parse(rowData);
|
||||||
|
filterText.value = JSONData.mc;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -411,7 +411,7 @@ const getTableData = async () => {
|
|||||||
});
|
});
|
||||||
if (res.code === "00000") {
|
if (res.code === "00000") {
|
||||||
tableData.value = res.data.records;
|
tableData.value = res.data.records;
|
||||||
pagination.total = res.data.total;
|
pagination.total = Number(res.data.total);
|
||||||
} else {
|
} else {
|
||||||
throw new Error(res.message);
|
throw new Error(res.message);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,7 +30,7 @@ const pagination = reactive({
|
|||||||
onChange: (page, pageSize) => {
|
onChange: (page, pageSize) => {
|
||||||
pagination.current = page;
|
pagination.current = page;
|
||||||
pagination.pageSize = pageSize;
|
pagination.pageSize = pageSize;
|
||||||
getyhzwzList(qxmc.value, yhzid.value, filterData);
|
getyhzeventList(qxmc.value, yhzid.value, filterData);
|
||||||
},
|
},
|
||||||
}); // 表格分页
|
}); // 表格分页
|
||||||
const modelVisible = ref(false); // 弹窗显示状态
|
const modelVisible = ref(false); // 弹窗显示状态
|
||||||
@ -154,7 +154,7 @@ const getyhzeventList = async (qxmc, yhzid, filterData) => {
|
|||||||
})
|
})
|
||||||
if (res.code === '00000') {
|
if (res.code === '00000') {
|
||||||
tableData.value = res.data.records;
|
tableData.value = res.data.records;
|
||||||
pagination.total = res.data.total;
|
pagination.total = Number(res.data.total);
|
||||||
} else {
|
} else {
|
||||||
tableData.value = [];
|
tableData.value = [];
|
||||||
pagination.total = 0;
|
pagination.total = 0;
|
||||||
@ -411,9 +411,11 @@ export default () => {
|
|||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getTreeData();
|
await getTreeData();
|
||||||
await getyhzeventList();
|
await getyhzeventList();
|
||||||
const rowData = JSON.parse(decodeURIComponent(route.params.data));
|
const rowData = (decodeURIComponent(route.params.data));
|
||||||
if (rowData) {
|
if (rowData !== 'undefined' && rowData!== 'null' && rowData !== '' ) {
|
||||||
filterText.value = rowData.mc;
|
console.log('rowData@@@',rowData)
|
||||||
|
const JSONData = JSON.parse(rowData);
|
||||||
|
filterText.value = JSONData.mc;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user