冰雪专题Pc端参数调整
This commit is contained in:
parent
3458857fa7
commit
eda01c8043
@ -47,19 +47,20 @@
|
||||
import "vant/es/toast/style";
|
||||
import "vant/es/popup/style";
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { showToast } from "vant";
|
||||
import { request } from "../../../shared/utils/request";
|
||||
|
||||
const router = useRouter();
|
||||
const active = ref(0);
|
||||
const detailData = ref({});
|
||||
const yhzinfo = ref({});
|
||||
|
||||
// 获取养护站详情
|
||||
const getYHZDetail = async () => {
|
||||
try {
|
||||
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",
|
||||
});
|
||||
if (res.code && res.code === "00000") {
|
||||
@ -75,8 +76,38 @@ const getYHZDetail = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getYHZDetail();
|
||||
const route = useRoute();
|
||||
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 = () => {
|
||||
|
||||
@ -165,7 +165,7 @@ const getyhzsbList = async (qxmc, yhzid, filterData) => {
|
||||
})
|
||||
if (res.code === '00000') {
|
||||
tableData.value = res.data.records;
|
||||
pagination.total = res.data.total;
|
||||
pagination.total = Number(res.data.total);
|
||||
} else {
|
||||
tableData.value = [];
|
||||
pagination.total = 0;
|
||||
@ -456,9 +456,10 @@ export default () => {
|
||||
onMounted(async () => {
|
||||
await getTreeData();
|
||||
await getyhzsbList();
|
||||
const rowData = JSON.parse(decodeURIComponent(route.params.data));
|
||||
if (rowData) {
|
||||
filterText.value = rowData.mc;
|
||||
const rowData = (decodeURIComponent(route.params.data));
|
||||
if (rowData !== 'undefined' && rowData!== 'null' && rowData !== '' ) {
|
||||
const JSONData = JSON.parse(rowData);
|
||||
filterText.value = JSONData.mc;
|
||||
};
|
||||
});
|
||||
return {
|
||||
|
||||
@ -149,7 +149,7 @@ const getyhzwzList = async (qxmc, yhzid, filterData) => {
|
||||
})
|
||||
if (res.code === '00000') {
|
||||
tableData.value = res.data.records;
|
||||
pagination.total = res.data.total;
|
||||
pagination.total = Number(res.data.total);
|
||||
} else {
|
||||
tableData.value = [];
|
||||
pagination.total = 0;
|
||||
@ -440,9 +440,10 @@ export default () => {
|
||||
onMounted(async () => {
|
||||
await getTreeData();
|
||||
await getyhzwzList();
|
||||
const rowData = JSON.parse(decodeURIComponent(route.params.data));
|
||||
if (rowData) {
|
||||
filterText.value = rowData.mc;
|
||||
const rowData = (decodeURIComponent(route.params?.data));
|
||||
if (rowData !== 'undefined' && rowData!== 'null' && rowData !== '' ) {
|
||||
const JSONData = JSON.parse(rowData);
|
||||
filterText.value = JSONData.mc;
|
||||
};
|
||||
});
|
||||
return {
|
||||
|
||||
@ -411,7 +411,7 @@ const getTableData = async () => {
|
||||
});
|
||||
if (res.code === "00000") {
|
||||
tableData.value = res.data.records;
|
||||
pagination.total = res.data.total;
|
||||
pagination.total = Number(res.data.total);
|
||||
} else {
|
||||
throw new Error(res.message);
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ const pagination = reactive({
|
||||
onChange: (page, pageSize) => {
|
||||
pagination.current = page;
|
||||
pagination.pageSize = pageSize;
|
||||
getyhzwzList(qxmc.value, yhzid.value, filterData);
|
||||
getyhzeventList(qxmc.value, yhzid.value, filterData);
|
||||
},
|
||||
}); // 表格分页
|
||||
const modelVisible = ref(false); // 弹窗显示状态
|
||||
@ -154,7 +154,7 @@ const getyhzeventList = async (qxmc, yhzid, filterData) => {
|
||||
})
|
||||
if (res.code === '00000') {
|
||||
tableData.value = res.data.records;
|
||||
pagination.total = res.data.total;
|
||||
pagination.total = Number(res.data.total);
|
||||
} else {
|
||||
tableData.value = [];
|
||||
pagination.total = 0;
|
||||
@ -411,9 +411,11 @@ export default () => {
|
||||
onMounted(async () => {
|
||||
await getTreeData();
|
||||
await getyhzeventList();
|
||||
const rowData = JSON.parse(decodeURIComponent(route.params.data));
|
||||
if (rowData) {
|
||||
filterText.value = rowData.mc;
|
||||
const rowData = (decodeURIComponent(route.params.data));
|
||||
if (rowData !== 'undefined' && rowData!== 'null' && rowData !== '' ) {
|
||||
console.log('rowData@@@',rowData)
|
||||
const JSONData = JSON.parse(rowData);
|
||||
filterText.value = JSONData.mc;
|
||||
};
|
||||
});
|
||||
return {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user