冰雪专题Pc端参数调整

This commit is contained in:
huangchenhao 2025-11-12 11:39:38 +08:00
parent 3458857fa7
commit eda01c8043
5 changed files with 53 additions and 18 deletions

View File

@ -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}`, // id53 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 = () => {

View File

@ -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 {

View File

@ -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 {

View File

@ -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);
} }

View File

@ -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 {