This commit is contained in:
cclu 2025-01-17 18:27:11 +08:00
parent 75dd0a758e
commit 0e7f73f254
11 changed files with 19619 additions and 8675 deletions

BIN
aiMap.zip

Binary file not shown.

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>地图测试</title> <title>AI全景图</title>
<base href="/"> <!-- 确保这里匹配你的部署路径 --> <base href="/"> <!-- 确保这里匹配你的部署路径 -->
</head> </head>
<body> <body>

View File

@ -20,6 +20,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 2px 0;
.left{ .left{
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -72,7 +72,8 @@ const emit = defineEmits<{
:key="index" :key="index"
> >
<div class="left"> <div class="left">
<div class="indexBox">{{ index + 1 }}</div> <!-- <div class="indexBox"></div> -->
<div style="color: #fff">{{ index + 1 }}</div>
<div class="name">{{ item.SERVERPART_NAME || "-" }}</div> <div class="name">{{ item.SERVERPART_NAME || "-" }}</div>
</div> </div>
<div <div

View File

@ -744,7 +744,7 @@ const handleAnalyzeConfig = async (configDetail: any, answer: any) => {
console.log("newRESPONSE_CONFIG", newRESPONSE_CONFIG); console.log("newRESPONSE_CONFIG", newRESPONSE_CONFIG);
let newResult: any; let newResult: any;
// responseType text json // responseType text json function
if (OUTPUT_FORMAT.responseType === "text") { if (OUTPUT_FORMAT.responseType === "text") {
newResult = newRESPONSE_CONFIG newResult = newRESPONSE_CONFIG
.replace(/"/g, "'") .replace(/"/g, "'")
@ -787,6 +787,13 @@ const handleAnalyzeConfig = async (configDetail: any, answer: any) => {
// } // }
// } // }
// ); // );
} else if (OUTPUT_FORMAT.responseType === "function") {
await handleGetConfigFun(
OUTPUT_FORMAT.responseFunName,
req.ServerpartId,
result
);
return null;
} else { } else {
if (OUTPUT_FORMAT.responseFormat === "object") { if (OUTPUT_FORMAT.responseFormat === "object") {
newResult = result; newResult = result;
@ -1115,7 +1122,7 @@ const handleInspectionDialogueBox = async (detail: any, otherObj?: any) => {
dialogueList[dialogueList.length - 1].isOver = true; dialogueList[dialogueList.length - 1].isOver = true;
}; };
// //
const handleConfigItemTable = async ( const handleConfigItemTable = async (
tableData: any, tableData: any,
configObj: any, configObj: any,
@ -1406,7 +1413,7 @@ const handleAnswerQuestions = async () => {
const tableData = await handleAnalyzeConfig(configDetail, data); const tableData = await handleAnalyzeConfig(configDetail, data);
console.log("tableData2", tableData); console.log("tableData2", tableData);
returnData = tableData; returnData = tableData;
// //
if (tableData) { if (tableData) {
await handleConfigItemTable(tableData, configDetail, data); await handleConfigItemTable(tableData, configDetail, data);
} }
@ -1417,45 +1424,52 @@ const handleAnswerQuestions = async () => {
} }
} }
} else { } else {
// 使id id id // id
if (data?.AnalysisRuleId) { if (data?.AnalysisRuleId) {
// // 使id id id
const allBoxes = document.querySelectorAll(".dialogueTextBox-text"); if (req.Sentence.indexOf("基础信息") !== -1) {
const lastBox: any = allBoxes[allBoxes.length - 1]; //
if (lastBox) { const allBoxes = document.querySelectorAll(".dialogueTextBox-text");
const lastContent = `<span class="style4">为您查找相关数据</span>`; const lastBox: any = allBoxes[allBoxes.length - 1];
isPrinting.value = true; if (lastBox) {
await handlePrintWord(lastBox, lastContent); const lastContent = `<span class="style4">为您查找相关数据</span>`;
} isPrinting.value = true;
// id await handlePrintWord(lastBox, lastContent);
// id id id configDetail
let configDetail: any;
const configList: any = await handleGetANALYSISRULEList({
searchParameter: {
ANALYSISRULE_IDS: data?.AnalysisRuleId,
current: 1,
pageSize: 10,
},
sortstr: "RULE_PRIORITY asc",
PageIndex: 1,
pagesize: 999999,
});
console.log("configList", configList);
//
if (configList && configList.length > 0) {
configDetail = configList[0];
}
console.log("configDetail3232", configDetail);
//
if (configDetail) {
const tableData = await handleAnalyzeConfig(configDetail, data);
console.log("tableData3", tableData);
//
if (tableData) {
await handleConfigItemTable(tableData, configDetail, data);
} }
// id
// id id id configDetail
let configDetail: any;
const configList: any = await handleGetANALYSISRULEList({
searchParameter: {
ANALYSISRULE_IDS: data?.AnalysisRuleId,
current: 1,
pageSize: 10,
},
sortstr: "RULE_PRIORITY asc",
PageIndex: 1,
pagesize: 999999,
});
console.log("configList", configList);
//
if (configList && configList.length > 0) {
configDetail = configList[0];
}
console.log("configDetail3232", configDetail);
//
if (configDetail) {
const tableData = await handleAnalyzeConfig(configDetail, data);
console.log("tableData3", tableData);
//
if (tableData) {
await handleConfigItemTable(tableData, configDetail, data);
}
}
} else if (req.Sentence.indexOf("预警类型") !== -1) {
emit("handleChangeRightFilterInDialogue", "6");
handleSetWarningData(true);
} }
} else { } else {
console.log("noRuleId");
handleLastUpdate("小驿还无法理解,请换个说法,我会不停努力学习的!"); handleLastUpdate("小驿还无法理解,请换个说法,我会不停努力学习的!");
searchRes = "查询失败"; searchRes = "查询失败";
} }
@ -1862,6 +1876,7 @@ const emit = defineEmits<{
(e: "handleAreaInspection", index: number): void; // (e: "handleAreaInspection", index: number): void; //
(e: "handleHiddenSuspended"): void; // (e: "handleHiddenSuspended"): void; //
(e: "handleShowAi", value: boolean): void; // ai (e: "handleShowAi", value: boolean): void; // ai
(e: "handleChangeRightFilterInDialogue", id: any): void; // watch
}>(); }>();
// //
@ -1952,12 +1967,15 @@ const handleGetBusinessTrade = async () => {
}; };
// //
const handleSetWarningData = async () => { const handleSetWarningData = async (noAdd?: boolean) => {
showDialogBox.value = true; showDialogBox.value = true;
emit("handleShowAi", true); emit("handleShowAi", true);
handleAddDialogList( if (noAdd) {
`${props.currentServerPartDetail?.SERVERPART_NAME || ""}预警类型` } else {
); handleAddDialogList(
`${props.currentServerPartDetail?.SERVERPART_NAME || ""}预警类型`
);
}
setTimeout(() => { setTimeout(() => {
nextTick(() => { nextTick(() => {
dialogueList[dialogueList.length - 1].isOver = true; dialogueList[dialogueList.length - 1].isOver = true;
@ -2079,6 +2097,104 @@ const handleSelectWarning = async (value: number) => {
emit("handleWarningMap", warningData); emit("handleWarningMap", warningData);
}; };
// id id warningData
const handleWarningConfig = async (id: any, warningData: any) => {
emit("handleChangeRightFilterInDialogue", "6");
let result: string = "";
let SERVERPART_NAME: string = "";
if (id) {
if (warningData && warningData.length > 0) {
let obj: any = {};
let str: string = "";
let objShopName: any = {};
warningData.forEach((item: any) => {
if (item.SERVERPART_NAME) {
SERVERPART_NAME = item.SERVERPART_NAME;
}
if (obj[item.WARNING_TYPE] && obj[item.WARNING_TYPE].length > 0) {
let old: any = obj[item.WARNING_TYPE];
old.push(item);
obj[item.WARNING_TYPE] = old;
} else {
let res: any = [];
res.push(item);
obj[item.WARNING_TYPE] = res;
}
if (
objShopName[item.WARNING_TYPE] &&
objShopName[item.WARNING_TYPE].length > 0
) {
let old: any = objShopName[item.WARNING_TYPE];
old += `${item.SERVERPARTSHOP_NAME}`;
objShopName[item.WARNING_TYPE] = old;
} else {
let old: any = objShopName[item.WARNING_TYPE];
old = `${item.SERVERPARTSHOP_NAME}`;
objShopName[item.WARNING_TYPE] = old;
}
});
console.log("obj", obj);
console.log("objShopName", objShopName);
if (obj) {
for (let key in obj) {
let itemStr: string = `
${descObjRef.value[key]}${objShopName[key]},共${obj[key].length};`;
str += itemStr;
}
}
result = `${SERVERPART_NAME || "-"}预警类型,存在:${str}
的情况您可以鼠标移动到具体服务区查看情况`;
} else {
result = `${SERVERPART_NAME || "-"}暂无预警数据`;
}
}
console.log("result", result);
if (result) {
isNewDialogLoading.value = false;
let obj: any = JSON.parse(
JSON.stringify(dialogueList[dialogueList.length - 1])
);
dialogueList[dialogueList.length - 1] = {
...obj,
isVHtml: true,
VHtml: result || "",
};
await nextTick();
const allBoxes = document.querySelectorAll(".dialogueTextBox-text");
const lastBox: any = allBoxes[allBoxes.length - 1];
if (lastBox) {
const lastContent = result || "";
isPrinting.value = true;
await handlePrintWord(lastBox, lastContent);
let obj: any = JSON.parse(
JSON.stringify(dialogueList[dialogueList.length - 1])
);
dialogueList[dialogueList.length - 1] = {
...obj,
isOver: true,
};
}
}
emit("handleEnterySearch");
emit("handleWarningMap", warningData);
};
// type id id warningData
const handleGetConfigFun = async (type: string, id: any, warningData: any) => {
//
let configFunObj: any = {
handleWarningConfig: (id: any, warningData: any) =>
handleWarningConfig(id, warningData),
};
if (type && configFunObj[type]) {
await configFunObj[type](id, warningData);
}
};
// //
const servicepartInspection = (index?: number, inInput?: boolean) => { const servicepartInspection = (index?: number, inInput?: boolean) => {
searchText.value = ""; searchText.value = "";

File diff suppressed because it is too large Load Diff

View File

View File

@ -142,6 +142,8 @@ const handleGetBusinessProjectList = async () => {
}); });
} }
console.log("scrollIdStr.value", scrollIdStr.value);
// tab length // tab length
tabs.forEach((item: any) => { tabs.forEach((item: any) => {
if (item.key === 0) { if (item.key === 0) {
@ -158,16 +160,25 @@ const handleGetBusinessProjectList = async () => {
const list = [inCampList, suspend, closeList, historyList]; const list = [inCampList, suspend, closeList, historyList];
console.log("list", list); console.log("list", list);
allProjectList = list; allProjectList.splice(
onlineProjectList = list[defaultTab]; 0,
allProjectList.length,
...[inCampList, suspend, closeList, historyList]
);
onlineProjectList.splice(
0,
onlineProjectList.length,
...[inCampList, suspend, closeList, historyList][defaultTab]
);
console.log("defaultTab", defaultTab); console.log("defaultTab", defaultTab);
nextTick(() => { nextTick(() => {
selectProjectState.value = defaultTab; selectProjectState.value = defaultTab;
console.log("onlineProjectList3232", onlineProjectList); console.log("onlineProjectList3232", onlineProjectList);
const element: any = document.getElementById(scrollIdStr.value!.toString()); const element: any = document.getElementById(scrollIdStr.value!.toString());
element.scrollIntoView({ behavior: "smooth", block: "start" }); if (element) {
element.scrollIntoView({ behavior: "smooth", block: "start" });
}
}); });
}; };
@ -588,10 +599,19 @@ watch(
console.log("newVal", newVal); console.log("newVal", newVal);
console.log("oldVal", oldVal); console.log("oldVal", oldVal);
if (newVal && newVal.SERVERPART_ID) { if (newVal && newVal.SERVERPART_ID) {
selectTab.value = 0
onlineProjectList = [];
tabs = [
{ label: "在营", value: 0, key: 0 },
{ label: "暂停", value: 0, key: 1 },
{ label: "关闭", value: 0, key: 2 },
{ label: "历史", value: 0, key: 3 },
];
handleGetBusinessProjectList(); handleGetBusinessProjectList();
handleServiceDetail(newVal.SERVERPART_ID); handleServiceDetail(newVal.SERVERPART_ID);
} else { } else {
nextTick(() => { nextTick(() => {
selectTab.value = 0
onlineProjectList = []; onlineProjectList = [];
tabs = [ tabs = [
{ label: "在营", value: 0, key: 0 }, { label: "在营", value: 0, key: 0 },

View File

@ -61,6 +61,9 @@ let selectBusinessTradeList = reactive<any>([]);
let selectBusinessTradeIdsObj = ref<any>(); let selectBusinessTradeIdsObj = ref<any>();
// //
const baseInfoObj = ref<any>(); const baseInfoObj = ref<any>();
// watch
let isNoWatch: boolean = false;
let saveData = localStorage.getItem("baseInfoObj"); let saveData = localStorage.getItem("baseInfoObj");
if (saveData) { if (saveData) {
baseInfoObj.value = JSON.parse(saveData); baseInfoObj.value = JSON.parse(saveData);
@ -209,13 +212,24 @@ const handleGetBUSINESS_TRADE = async () => {
}); });
}; };
// watch
const handleChangeFilterNoWatch = (id?: string) => {
console.log("handleChangeFilterNoWatch", id);
isNoWatch = true;
selectFilterList.value = id;
nextTick(() => {
isNoWatch = false;
});
};
onMounted(() => { onMounted(() => {
handleGetBUSINESS_TRADE(); handleGetBUSINESS_TRADE();
}); });
// //
const emit = defineEmits<{ const emit = defineEmits<{
(e: "handleChangeMapShow", nowSelect: any): void; // selectFilterList.value (e: "handleChangeMapShow", nowSelect: any, onlyChange: boolean): void; // selectFilterList.value
(e: "handleDeleteSelect"): void; // (e: "handleDeleteSelect"): void; //
(e: "handleHiddenSuspended"): void; // (e: "handleHiddenSuspended"): void; //
}>(); }>();
@ -228,8 +242,7 @@ const props = defineProps<{
watch( watch(
() => selectFilterList.value, () => selectFilterList.value,
(newVal, oldVal) => { (newVal, oldVal) => {
console.log("newVal", newVal); emit("handleChangeMapShow", newVal, isNoWatch);
emit("handleChangeMapShow", newVal);
}, },
{ deep: true } { deep: true }
); );
@ -239,6 +252,7 @@ defineExpose({
form: form, form: form,
selectBusinessTradeIdsObj: selectBusinessTradeIdsObj, selectBusinessTradeIdsObj: selectBusinessTradeIdsObj,
selectFilterList: selectFilterList, selectFilterList: selectFilterList,
handleChangeFilterNoWatch: handleChangeFilterNoWatch,
}); });
</script> </script>
<template> <template>

View File

@ -17,6 +17,7 @@ import {
handleGetPeriodWarningList, handleGetPeriodWarningList,
handleGetProvinceVehicleTreeList, handleGetProvinceVehicleTreeList,
handleGetServerpartList, handleGetServerpartList,
handleGetTransactionDetailList,
} from "./service"; } from "./service";
import { handlegetServerConnec } from "../newService"; import { handlegetServerConnec } from "../newService";
import { ElLoading, ElMessage } from "element-plus"; import { ElLoading, ElMessage } from "element-plus";
@ -117,6 +118,12 @@ let isShowDetail = ref<boolean>(false);
let isShowRealData = ref<boolean>(false); let isShowRealData = ref<boolean>(false);
// //
let SPREGIONTYPECOLORList = reactive<any>([]); let SPREGIONTYPECOLORList = reactive<any>([]);
//
let realRevenueList = reactive<any>([]);
//
let nowFifthIndex = ref<number>(0);
//
let mapTimer: any;
const route = useRoute(); const route = useRoute();
console.log("route", route); console.log("route", route);
@ -171,6 +178,8 @@ onMounted(async () => {
handleAllServiceMarkedPoint(); handleAllServiceMarkedPoint();
// //
handleGetAnHuiBoundary(); handleGetAnHuiBoundary();
//
// handleGetRealServiceList();
hoverPoint.value = handlePointHover(); hoverPoint.value = handlePointHover();
@ -213,6 +222,7 @@ const handleGetAllService = async () => {
ShowWeather: true, // ShowWeather: true, //
}; };
const data = await handleGetServerpartList(req); const data = await handleGetServerpartList(req);
let str: string = "";
console.log("data312312321321321", data); console.log("data312312321321321", data);
if (data && data.length > 0) { if (data && data.length > 0) {
let res: any = []; let res: any = [];
@ -246,10 +256,15 @@ const handleGetAllService = async () => {
allId.push(item.SERVERPART_ID.toString()); allId.push(item.SERVERPART_ID.toString());
} }
} }
if (str) {
str += `
${item.SERVERPART_NAME} ${item.SERVERPART_ID}`;
} else {
str = `${item.SERVERPART_NAME} ${item.SERVERPART_ID}`;
}
}); });
defaultServerPartList = res; defaultServerPartList = res;
allServerPartIdList = allId; allServerPartIdList = allId;
console.log("SPREGIONTYPECOLORLIST", SPREGIONTYPECOLORLIST);
SPREGIONTYPECOLORList = SPREGIONTYPECOLORLIST; SPREGIONTYPECOLORList = SPREGIONTYPECOLORLIST;
SPREGIONTYPECOLOR.value = SPREGIONTYPETYPEObj; SPREGIONTYPECOLOR.value = SPREGIONTYPETYPEObj;
@ -450,17 +465,19 @@ const handleAllServiceMarkedPoint = async () => {
scene.value.addLayer(pointLayer); scene.value.addLayer(pointLayer);
}; };
// //
const handleClickPointLayer = async (detail: any) => { const handleClickPointLayer = async (detail: any) => {
// //
currentServerPartDetail.value = detail; currentServerPartDetail.value = detail;
// //
handleAddSelect(detail); handleAddSelect(detail);
// //
handleDeleteNoDefault(""); handleDeleteNoDefault(RightSearchBoxRef.value.selectFilterList);
// //
let nowSelect: string = RightSearchBoxRef.value.selectFilterList; let nowSelect: string = RightSearchBoxRef.value.selectFilterList;
await handleChangeMapShow(nowSelect); console.log("nowSelect", nowSelect);
await handleChangeMapShow(nowSelect, false);
// //
showRightDetail.value = true; showRightDetail.value = true;
// //
@ -546,7 +563,7 @@ const handleChangeToDefault = () => {
current.render(); current.render();
}; };
// //
const handlePointHover = () => { const handlePointHover = () => {
const el = document.createElement("div"); const el = document.createElement("div");
el.style.background = "#000"; el.style.background = "#000";
@ -725,6 +742,7 @@ const handleSetCarData = async (
let selectObj: any = {}; let selectObj: any = {};
let selectRoad: any = {}; let selectRoad: any = {};
//
if (roadTestList && roadTestList.length > 0) { if (roadTestList && roadTestList.length > 0) {
roadTestList.forEach((item: any) => { roadTestList.forEach((item: any) => {
if (item.SERVERPART_ID.toString() === id) { if (item.SERVERPART_ID.toString() === id) {
@ -732,28 +750,45 @@ const handleSetCarData = async (
} }
}); });
} }
let roadReq: any = {}; let data: any = {};
let heightWay: any = [ let roadItem: any = {};
366, 803, 381, 756, 708, 646, 805, 710, 476, 694, 714, 490, 658, 819, 659, let roadReq: any = {
811, 716, 499, 941, 652, 943, 513, 510, 600, 707, 592, 706, RoadName: selectObj.EXPRESSWAY_NAME || "",
]; CityName: selectObj.SERVERPART_ADDRESS || "",
};
if (heightWay.indexOf(Number(selectObj.SERVERPART_ID)) === -1) { data = await handleGetBaiDuTrafficInfo(roadReq);
roadReq = { let roadRes: any = JSON.parse(data);
if (roadRes.status == 2) {
let roadReq: any = {
RoadName: selectObj.SERVERPART_NAME || "", RoadName: selectObj.SERVERPART_NAME || "",
CityName: selectObj.SERVERPART_ADDRESS || "", CityName: selectObj.SERVERPART_ADDRESS || "",
}; };
data = await handleGetBaiDuTrafficInfo(roadReq);
roadItem = JSON.parse(data);
} else { } else {
roadReq = { roadItem = roadRes;
RoadName: selectObj.EXPRESSWAY_NAME || "",
CityName: selectObj.SERVERPART_ADDRESS || "",
};
} }
console.log("selectObj", selectObj);
const data = await handleGetBaiDuTrafficInfo(roadReq); // let roadReq: any = {};
let roadItem: any = JSON.parse(data); // let heightWay: any = [
console.log("roadItem", roadItem); // 366, 803, 381, 756, 708, 646, 805, 710, 476, 694, 714, 490, 658, 819, 659,
// 811, 716, 499, 941, 652, 943, 513, 510, 600, 707, 592, 706,
// ];
// if (heightWay.indexOf(Number(selectObj.SERVERPART_ID)) === -1) {
// roadReq = {
// RoadName: selectObj.SERVERPART_NAME || "",
// CityName: selectObj.SERVERPART_ADDRESS || "",
// };
// } else {
// roadReq = {
// RoadName: selectObj.EXPRESSWAY_NAME || "",
// CityName: selectObj.SERVERPART_ADDRESS || "",
// };
// }
// const data = await handleGetBaiDuTrafficInfo(roadReq);
// let roadItem: any = JSON.parse(data);
if (featuresList && featuresList.length > 0) { if (featuresList && featuresList.length > 0) {
featuresList.forEach((item: any) => { featuresList.forEach((item: any) => {
if (item.properties.SERVERPART_ID.toString() === id) { if (item.properties.SERVERPART_ID.toString() === id) {
@ -800,7 +835,10 @@ const handleSetCarData = async (
// //
const hanleGetRealTrafficData = async (id: any) => { const hanleGetRealTrafficData = async (id: any) => {
let roadList: any = JSON.parse(JSON.stringify(detailText.lineData)); let roadList: any = JSON.parse(JSON.stringify(detailText.lineData));
roadList = roadList[baseInfoObj.value.ProvinceCode.toString()];
let roadTestList: any = JSON.parse(JSON.stringify(detailText.roadTest)); let roadTestList: any = JSON.parse(JSON.stringify(detailText.roadTest));
roadTestList = roadTestList[baseInfoObj.value.ProvinceCode.toString()];
let onceRoadList: any = { let onceRoadList: any = {
type: "FeatureCollection", type: "FeatureCollection",
features: [], features: [],
@ -809,6 +847,7 @@ const hanleGetRealTrafficData = async (id: any) => {
let list: any = []; let list: any = [];
for (let i = 0; i < id.length; i++) { for (let i = 0; i < id.length; i++) {
//
if (nowSelectId.value.indexOf("2") === -1) { if (nowSelectId.value.indexOf("2") === -1) {
return; return;
} }
@ -817,6 +856,9 @@ const hanleGetRealTrafficData = async (id: any) => {
roadTestList, roadTestList,
featuresList featuresList
); );
// if (i > 0) {
// return;
// }
list.push(selectRoad); list.push(selectRoad);
onceRoadList.features = list; onceRoadList.features = list;
@ -825,11 +867,9 @@ const hanleGetRealTrafficData = async (id: any) => {
let haveList: any = allLayers.filter( let haveList: any = allLayers.filter(
(item: any) => item.name === "lineLayerOnce" (item: any) => item.name === "lineLayerOnce"
); );
console.log("haveList", haveList);
if (haveList && haveList.length > 0) { if (haveList && haveList.length > 0) {
let obj: any = haveList[0]; let obj: any = haveList[0];
console.log("obj", obj);
nextTick(() => { nextTick(() => {
scene.value.removeLayer(obj); scene.value.removeLayer(obj);
const lineLayer = new LineLayer({ const lineLayer = new LineLayer({
@ -889,14 +929,19 @@ const hanleGetRealTrafficData = async (id: any) => {
// //
const handleGetRealTraffic = async () => { const handleGetRealTraffic = async () => {
let roadList: any = JSON.parse(JSON.stringify(detailText.lineData)); let roadList: any = JSON.parse(JSON.stringify(detailText.lineData));
roadList = roadList[baseInfoObj.value.ProvinceCode.toString()];
let roadTestList: any = JSON.parse(JSON.stringify(detailText.roadTest)); let roadTestList: any = JSON.parse(JSON.stringify(detailText.roadTest));
roadTestList = roadTestList[baseInfoObj.value.ProvinceCode.toString()];
console.log("roadList", roadList);
console.log("roadTestList", roadTestList);
// //
let onceRoadList: any = { let onceRoadList: any = {
type: "FeatureCollection", type: "FeatureCollection",
features: [], features: [],
}; };
let featuresList: any = roadList.features; let featuresList: any = roadList.features;
console.log("roadList", roadList);
console.log("featuresList", featuresList); console.log("featuresList", featuresList);
console.log("currentServerPartDetail.value", currentServerPartDetail.value); console.log("currentServerPartDetail.value", currentServerPartDetail.value);
// //
@ -950,6 +995,7 @@ const handleDeleteNoDefault = (nowSelect: string) => {
} }
if (nowSelect.indexOf("8") === -1) { if (nowSelect.indexOf("8") === -1) {
isShowRealData.value = false; isShowRealData.value = false;
clearInterval(mapTimer);
} }
} else { } else {
console.log("22222", defaultServerPartList); console.log("22222", defaultServerPartList);
@ -968,6 +1014,7 @@ const handleDeleteNoDefault = (nowSelect: string) => {
return colorList1[value]; return colorList1[value];
}); });
current.render(); current.render();
clearInterval(mapTimer);
} }
}; };
@ -1390,13 +1437,34 @@ const handleWarningMap = async (warningData: any) => {
if (obj[item.SERVERPART_ID] && obj[item.SERVERPART_ID].length > 0) { if (obj[item.SERVERPART_ID] && obj[item.SERVERPART_ID].length > 0) {
let str: string = ""; let str: string = "";
const tradeList: any = obj[item.SERVERPART_ID]; const tradeList: any = obj[item.SERVERPART_ID];
tradeList.forEach((key: any) => { // tradeList
if (str) { let resList: any = [];
str += `${key.SERVERPARTSHOP_NAME}; `; let typeList: any = [];
} else { tradeList.forEach((item: any) => {
str = `${waringObj[key.WARNING_TYPE]}${key.SERVERPARTSHOP_NAME} `; if (typeList.indexOf(item.WARNING_TYPE) === -1) {
typeList.push(item.WARNING_TYPE);
} }
}); });
typeList.forEach((item: any) => {
let itemStr: string = "";
tradeList.forEach((subItem: any) => {
if (subItem.WARNING_TYPE === item) {
if (itemStr) {
itemStr += `${subItem.SERVERPARTSHOP_NAME}`;
} else {
itemStr = `${waringObj[subItem.WARNING_TYPE]}${
subItem.SERVERPARTSHOP_NAME
} `;
}
}
});
if (str) {
str += itemStr + ";";
} else {
str = itemStr + ";";
}
});
if ( if (
shopIdObj[item.SERVERPART_ID] && shopIdObj[item.SERVERPART_ID] &&
shopIdObj[item.SERVERPART_ID].length > 0 shopIdObj[item.SERVERPART_ID].length > 0
@ -1409,18 +1477,42 @@ const handleWarningMap = async (warningData: any) => {
handleUpdateMapPoint(); handleUpdateMapPoint();
}); });
console.log("obj33222", obj);
console.log("defaultServerPartList333444", defaultServerPartList);
defaultServerPartList.forEach((item: any) => { defaultServerPartList.forEach((item: any) => {
if (obj[item.SERVERPART_ID] && obj[item.SERVERPART_ID].length > 0) { if (obj[item.SERVERPART_ID] && obj[item.SERVERPART_ID].length > 0) {
const newObj: any = JSON.parse(JSON.stringify(item)); const newObj: any = JSON.parse(JSON.stringify(item));
let str: string = ""; let str: string = "";
const tradeList: any = obj[item.SERVERPART_ID]; const tradeList: any = obj[item.SERVERPART_ID];
tradeList.forEach((key: any) => { // tradeList
if (str) { let resList: any = [];
str += `${key.SERVERPARTSHOP_NAME}; `; let typeList: any = [];
} else { tradeList.forEach((item: any) => {
str = `${waringObj[key.WARNING_TYPE]}${key.SERVERPARTSHOP_NAME} `; if (typeList.indexOf(item.WARNING_TYPE) === -1) {
typeList.push(item.WARNING_TYPE);
} }
}); });
typeList.forEach((item: any) => {
let itemStr: string = "";
tradeList.forEach((subItem: any) => {
if (subItem.WARNING_TYPE === item) {
if (itemStr) {
itemStr += `${subItem.SERVERPARTSHOP_NAME}; `;
} else {
itemStr = `${waringObj[subItem.WARNING_TYPE]}${
subItem.SERVERPARTSHOP_NAME
} `;
}
}
});
if (str) {
str += itemStr;
} else {
str = itemStr;
}
});
if ( if (
shopIdObj[item.SERVERPART_ID] && shopIdObj[item.SERVERPART_ID] &&
shopIdObj[item.SERVERPART_ID].length > 0 shopIdObj[item.SERVERPART_ID].length > 0
@ -1452,12 +1544,16 @@ const handleWarningMap = async (warningData: any) => {
scene.value.addLayer(warningLayer); scene.value.addLayer(warningLayer);
}; };
// // onlyChange true
const handleChangeMapShow = async (nowSelect: string) => { const handleChangeMapShow = async (nowSelect: string, onlyChange: boolean) => {
// //
handleDeleteNoDefault(nowSelect); handleDeleteNoDefault(nowSelect);
console.log("nowSelect", nowSelect); console.log("nowSelect", nowSelect);
nowSelectId.value = nowSelect; nowSelectId.value = nowSelect;
if (onlyChange) {
return;
}
// //
if (nowSelect) { if (nowSelect) {
if (nowSelect.indexOf("1") !== -1) { if (nowSelect.indexOf("1") !== -1) {
@ -1522,6 +1618,8 @@ const handleChangeMapShow = async (nowSelect: string) => {
nextTick(async () => { nextTick(async () => {
// //
handleServiceBusy(); handleServiceBusy();
//
handleGetRealServiceList();
}); });
} }
} }
@ -1581,9 +1679,24 @@ const handleServiceBusy = async () => {
// //
const handleAreaInspection = async (i: number) => { const handleAreaInspection = async (i: number) => {
if (i < defaultServerPartList.length) { let list = [];
if (defaultServerPartList && defaultServerPartList.length > 0) {
let firstObj: any = {};
let otherList: any = [];
defaultServerPartList.forEach((item: any) => {
if (item.SERVERPART_ID === 416) {
firstObj = item;
} else {
otherList.push(item);
}
});
list = otherList;
list.unshift(firstObj);
}
if (i < list.length) {
// i // i
currentServerPartDetail.value = defaultServerPartList[i]; currentServerPartDetail.value = list[i];
// //
handleDeleteNoDefault(""); handleDeleteNoDefault("");
// //
@ -1592,7 +1705,7 @@ const handleAreaInspection = async (i: number) => {
handleAddSelect(currentServerPartDetail.value); handleAddSelect(currentServerPartDetail.value);
console.log(i, currentServerPartDetail.value); console.log(i, currentServerPartDetail.value);
// //
await handleChangeMapShow("1,2,4"); await handleChangeMapShow("1,2,4", false);
// //
let answerData: any = let answerData: any =
await RobotDialogueBoxRef.value.handleInspectionQuestions( await RobotDialogueBoxRef.value.handleInspectionQuestions(
@ -1675,6 +1788,158 @@ const handleShowAi = (value: boolean) => {
const handleShowDetail = (value: boolean) => { const handleShowDetail = (value: boolean) => {
isShowDetail.value = value; isShowDetail.value = value;
}; };
//
const handleChangeRightFilterInDialogue = (id?: string) => {
RightSearchBoxRef.value.handleChangeFilterNoWatch(id);
};
// div
const handleGetRealServiceList = async () => {
const req: any = {
ProvinceCode: baseInfoObj.value.ProvinceCode,
};
const data = await handleGetTransactionDetailList(req);
console.log("handleGetRealServiceList", data);
realRevenueList = data;
let list: any = handleShowRevenuePoint(data);
console.log("listdadasd", list);
let bigIndex: number = list.length;
// div 10
// ID
console.log("bigIndex", bigIndex);
handleShowMapPoint(list[nowFifthIndex.value]);
nowFifthIndex.value++;
mapTimer = setInterval(() => {
if (bigIndex <= nowFifthIndex.value) {
nowFifthIndex.value = 0;
}
scene.value.removeAllMarkers();
handleShowMapPoint(list[nowFifthIndex.value]);
nowFifthIndex.value++;
}, 10000);
};
// div 10
const handleShowMapPoint = async (list: any) => {
console.log("list", list);
console.log("defaultServerPartList", defaultServerPartList);
let detailObj: any = {};
if (list && list.length > 0) {
list.forEach((item: any) => {
detailObj[item.Serverpart_ID] = item;
});
}
console.log("detailObj", detailObj);
defaultServerPartList.forEach((item: any) => {
if (detailObj[item.SERVERPART_ID]) {
let obj = detailObj[item.SERVERPART_ID];
item.realRevenueDetail = obj;
const el = document.createElement("div");
el.style.maxWidth = "20rem";
el.style.boxSizing = "border-box";
el.style.padding = "6px";
el.style.background = "rgba(56, 56, 56, 0.8)";
el.style.borderRadius = "8px";
el.style.color = "#fff";
el.style.fontSize = "1rem";
// innerHTML
let listStr: string = "";
if (obj.TimeList && obj.TimeList.length > 0) {
if (obj.TimeList && obj.TimeList.length > 1) {
obj.TimeList = obj.TimeList.slice(0, 1);
}
obj.TimeList.forEach((subItem: any) => {
let smallStr: string = "";
if (subItem.sellList && subItem.sellList.length > 0) {
subItem.sellList.forEach((thirdItem: any) => {
if (smallStr) {
smallStr += `,${thirdItem.CommodityName}${thirdItem.SellCount}`;
} else {
smallStr = `${thirdItem.CommodityName}${thirdItem.SellCount}`;
}
});
}
let shop: string = `<div style="white-space: wrap;">${subItem.ServerpartShop_Name}${smallStr}</div>`;
listStr += shop;
});
}
el.innerHTML = `<div style="white-space: wrap;">${obj.Serverpart_Name}</div><div style="white-space: wrap;">实时交易金额:${obj.CurRevenueAmount}元</div>${listStr}`;
const marker = new Marker({ element: el }).setLnglat([
item.SERVERPART_X,
item.SERVERPART_Y,
] as any);
scene.value.addMarker(marker);
} else {
item.realRevenueDetail = undefined;
}
});
// return;
// defaultServerPartList.forEach((item: any) => {
// if (item.weatherModel) {
// if (item.weatherModel.DAY_WEATHER_PIC) {
// const el = document.createElement("div");
// el.style.width = "32px";
// el.style.height = "24px";
// el.style.paddingBottom = "4px";
// el.style.textAlign = "center";
// // <img>
// const img = document.createElement("img");
// img.src = item.weatherModel.DAY_WEATHER_PIC;
// img.style.width = "15px";
// img.style.height = "15px";
// img.style.borderRadius = "50%"; //
// // img.title = item.DAY_WEATHER
// el.appendChild(img);
// const marker = new Marker({ element: el }).setLnglat([
// item.SERVERPART_X,
// item.SERVERPART_Y,
// ] as any);
// if (currentServerPartDetail.value) {
// if (
// item.SERVERPART_ID === currentServerPartDetail.value.SERVERPART_ID
// ) {
// scene.value.addMarker(marker);
// }
// } else if (
// searchSelectServerPartId &&
// searchSelectServerPartId.length > 0
// ) {
// if (
// searchSelectServerPartId.indexOf(item.SERVERPART_ID.toString()) !==
// -1
// ) {
// scene.value.addMarker(marker);
// }
// } else {
// scene.value.addMarker(marker);
// }
// }
// }
// });
};
// div
const handleShowRevenuePoint = (list: any) => {
// nowFifthIndex
if (list && list.length > 0) {
let newList: any = JSON.parse(JSON.stringify(list));
console.log("newList", newList);
// 5
let paginated = [];
for (let i = 0; i < newList.length; i += 5) {
paginated.push(newList.slice(i, i + 5));
}
return paginated;
}
};
</script> </script>
<template> <template>
@ -1688,6 +1953,7 @@ const handleShowDetail = (value: boolean) => {
@handleAreaInspection="handleAreaInspection" @handleAreaInspection="handleAreaInspection"
@handleHiddenSuspended="handleHiddenSuspended" @handleHiddenSuspended="handleHiddenSuspended"
@handleShowAi="handleShowAi" @handleShowAi="handleShowAi"
@handleChangeRightFilterInDialogue="handleChangeRightFilterInDialogue"
:currentServerPartDetail="currentServerPartDetail" :currentServerPartDetail="currentServerPartDetail"
:allServerPartIdList="allServerPartIdList" :allServerPartIdList="allServerPartIdList"
/> />

View File

@ -197,4 +197,15 @@ export async function handleGetMapConfigByProvinceCode(params: any) {
return data return data
} }
return data.Result_Data; return data.Result_Data;
}
// 服务区门店的实时数据
export async function handleGetTransactionDetailList(params: any) {
const data: any = await requestCode.get('/Revenue/GetTransactionDetailList', params)
if (data.Result_Code !== 100) {
return data
}
return data.Result_Data.List
} }