新增物资和设备管理 获取列表接口的requestSource区分 在app端查询不到未确认的设备和物资 在web端查询到所有信息
This commit is contained in:
parent
918c6c8341
commit
1124aa8517
@ -516,6 +516,7 @@ const getEquipmentList = async (sbmc) => {
|
|||||||
sbmc: sbmc,
|
sbmc: sbmc,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 9999,
|
pageSize: 9999,
|
||||||
|
requestSource: 'app', // web: Web端请求,app:移动端请求
|
||||||
};
|
};
|
||||||
const res = await request({
|
const res = await request({
|
||||||
url: "/snow-ops-platform/yjsb/list",
|
url: "/snow-ops-platform/yjsb/list",
|
||||||
|
|||||||
@ -298,6 +298,7 @@ const getMaterialList = async (wzmc) => {
|
|||||||
wzmc,
|
wzmc,
|
||||||
paageNum: 1,
|
paageNum: 1,
|
||||||
paageSize: 9999,
|
paageSize: 9999,
|
||||||
|
requestSource: 'app', // web: Web端请求,app:移动端请求
|
||||||
};
|
};
|
||||||
const res = await request({
|
const res = await request({
|
||||||
url: "/snow-ops-platform/yjwz/list",
|
url: "/snow-ops-platform/yjwz/list",
|
||||||
@ -461,37 +462,47 @@ const afterRead = async (file) => {
|
|||||||
|
|
||||||
// 获取经纬度
|
// 获取经纬度
|
||||||
const handleGetLocation = async () => {
|
const handleGetLocation = async () => {
|
||||||
// 确保AMap完成加载
|
const location = await request({
|
||||||
if (!window.AMap) {
|
url: "/v3/ip",
|
||||||
await loadAMap();
|
method: "get",
|
||||||
}
|
params:{
|
||||||
const loadingToast = showLoadingToast({
|
key: 'c30e9ebd414fd6a4dfcc1ba8c2060dbb'
|
||||||
message: "正在获取位置",
|
},
|
||||||
forbidClick: true,
|
isThirdPartyAPI: true // 添加标识
|
||||||
duration: 0, // 设置为0表示不会自动关闭
|
|
||||||
zIndex: 9999,
|
|
||||||
});
|
});
|
||||||
|
console.log("location", toRaw(location));
|
||||||
|
|
||||||
AMap.plugin("AMap.Geolocation", () => {
|
// // 确保AMap完成加载
|
||||||
const geolocation = new AMap.Geolocation({
|
// if (!window.AMap) {
|
||||||
enableHighAccuracy: true,
|
// await loadAMap();
|
||||||
timeout: 5000,
|
// }
|
||||||
showMarker: false,
|
// const loadingToast = showLoadingToast({
|
||||||
zoomToAccuracy: true,
|
// message: "正在获取位置",
|
||||||
});
|
// forbidClick: true,
|
||||||
|
// duration: 0, // 设置为0表示不会自动关闭
|
||||||
|
// zIndex: 9999,
|
||||||
|
// });
|
||||||
|
|
||||||
geolocation.getCurrentPosition((status, result) => {
|
// AMap.plugin("AMap.Geolocation", () => {
|
||||||
if (status === "complete") {
|
// const geolocation = new AMap.Geolocation({
|
||||||
form.material.jd = result.position.lng.toFixed(6);
|
// enableHighAccuracy: true,
|
||||||
form.material.wd = result.position.lat.toFixed(6);
|
// timeout: 5000,
|
||||||
loadingToast.close();
|
// showMarker: false,
|
||||||
} else {
|
// zoomToAccuracy: true,
|
||||||
loadingToast.close();
|
// });
|
||||||
showToast("定位失败 请检查网络情况后重试");
|
|
||||||
console.log("result", result);
|
// geolocation.getCurrentPosition((status, result) => {
|
||||||
}
|
// if (status === "complete") {
|
||||||
});
|
// form.material.jd = result.position.lng.toFixed(6);
|
||||||
});
|
// form.material.wd = result.position.lat.toFixed(6);
|
||||||
|
// loadingToast.close();
|
||||||
|
// } else {
|
||||||
|
// loadingToast.close();
|
||||||
|
// showToast("定位失败 请检查网络情况后重试");
|
||||||
|
// console.log("result", result);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// });
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
|||||||
@ -75,8 +75,13 @@ export default defineConfig(({ command, mode }) => {
|
|||||||
target: 'http://8.137.54.85:8661/',
|
target: 'http://8.137.54.85:8661/',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
|
'/v3':{
|
||||||
|
target: 'https://restapi.amap.com/',
|
||||||
|
changeOrigin: true,
|
||||||
|
rewrite: (path) => path.replace(/^\/v3/, '/v3') // 显式声明路径
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
},
|
||||||
build: {
|
build: {
|
||||||
outDir: 'dist',
|
outDir: 'dist',
|
||||||
assetsDir: 'assets',
|
assetsDir: 'assets',
|
||||||
|
|||||||
@ -185,6 +185,7 @@ const getyhzsbList = async (qxmc, yhzid, filterData) => {
|
|||||||
sbzt: filterData?.sbzt || '',
|
sbzt: filterData?.sbzt || '',
|
||||||
pageNum: pagination.current,
|
pageNum: pagination.current,
|
||||||
pageSize: pagination.pageSize,
|
pageSize: pagination.pageSize,
|
||||||
|
requestSource: 'web', // web: Web端请求,app:移动端请求
|
||||||
}
|
}
|
||||||
const res = await request({
|
const res = await request({
|
||||||
url: '/snow-ops-platform/yjsb/list',
|
url: '/snow-ops-platform/yjsb/list',
|
||||||
@ -247,6 +248,10 @@ const columns = [
|
|||||||
prop: 'qxmc',
|
prop: 'qxmc',
|
||||||
label: '所属区县',
|
label: '所属区县',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
prop: 'yhzmc',
|
||||||
|
label: '所属服务站',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '上传时间',
|
label: '上传时间',
|
||||||
width: 160,
|
width: 160,
|
||||||
|
|||||||
@ -200,6 +200,7 @@ const getyhzwzList = async (qxmc, yhzid, filterData) => {
|
|||||||
wzmc: filterData?.wzmc || '',
|
wzmc: filterData?.wzmc || '',
|
||||||
pageNum: pagination.current,
|
pageNum: pagination.current,
|
||||||
pageSize: pagination.pageSize,
|
pageSize: pagination.pageSize,
|
||||||
|
requestSource: 'web', // web: Web端请求,app:移动端请求
|
||||||
}
|
}
|
||||||
const res = await request({
|
const res = await request({
|
||||||
url: '/snow-ops-platform/yjwz/list',
|
url: '/snow-ops-platform/yjwz/list',
|
||||||
|
|||||||
@ -174,7 +174,7 @@ const formatDate = (date) => {
|
|||||||
const getyhzeventList = async (qxmc, yhzid, filterData) => {
|
const getyhzeventList = async (qxmc, yhzid, filterData) => {
|
||||||
try {
|
try {
|
||||||
const data = {
|
const data = {
|
||||||
qxmc: qxmc,
|
district: qxmc,
|
||||||
serviceStationId: yhzid,
|
serviceStationId: yhzid,
|
||||||
routeNo: filterData?.routeNo || '',
|
routeNo: filterData?.routeNo || '',
|
||||||
stakeNo: filterData?.stakeNo || '',
|
stakeNo: filterData?.stakeNo || '',
|
||||||
|
|||||||
@ -19,8 +19,8 @@ service.interceptors.request.use(config => {
|
|||||||
export async function request(config) {
|
export async function request(config) {
|
||||||
try {
|
try {
|
||||||
const res = await service(config)
|
const res = await service(config)
|
||||||
if (res === null || res === undefined) {
|
if (config.isThirdPartyAPI) { // 添加第三方API标识
|
||||||
return res
|
return res // 直接返回完整响应
|
||||||
}
|
}
|
||||||
if (Object.prototype.hasOwnProperty.call(res, 'data')) {
|
if (Object.prototype.hasOwnProperty.call(res, 'data')) {
|
||||||
return res.data
|
return res.data
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user