update
This commit is contained in:
parent
75dd0a758e
commit
0e7f73f254
@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>地图测试</title>
|
||||
<title>AI全景图</title>
|
||||
<base href="/"> <!-- 确保这里匹配你的部署路径 -->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 2px 0;
|
||||
.left{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@ -72,7 +72,8 @@ const emit = defineEmits<{
|
||||
:key="index"
|
||||
>
|
||||
<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>
|
||||
<div
|
||||
|
||||
@ -744,7 +744,7 @@ const handleAnalyzeConfig = async (configDetail: any, answer: any) => {
|
||||
console.log("newRESPONSE_CONFIG", newRESPONSE_CONFIG);
|
||||
|
||||
let newResult: any;
|
||||
// 判断responseType 格式是否为 text 一般都为json
|
||||
// 判断responseType 格式是否为 text 一般都为json function时 说明调用这个组件的某个方法
|
||||
if (OUTPUT_FORMAT.responseType === "text") {
|
||||
newResult = newRESPONSE_CONFIG
|
||||
.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 {
|
||||
if (OUTPUT_FORMAT.responseFormat === "object") {
|
||||
newResult = result;
|
||||
@ -1115,7 +1122,7 @@ const handleInspectionDialogueBox = async (detail: any, otherObj?: any) => {
|
||||
dialogueList[dialogueList.length - 1].isOver = true;
|
||||
};
|
||||
|
||||
// 配置对话框表格的样式
|
||||
// 配置对话框表格的样式 或 文字样式
|
||||
const handleConfigItemTable = async (
|
||||
tableData: any,
|
||||
configObj: any,
|
||||
@ -1406,7 +1413,7 @@ const handleAnswerQuestions = async () => {
|
||||
const tableData = await handleAnalyzeConfig(configDetail, data);
|
||||
console.log("tableData2", tableData);
|
||||
returnData = tableData;
|
||||
// 如果拿到值了 就去配这个对话框显示表格的样式
|
||||
// 如果拿到值了 就去配这个对话框显示表格的样式 或文字样式
|
||||
if (tableData) {
|
||||
await handleConfigItemTable(tableData, configDetail, data);
|
||||
}
|
||||
@ -1417,8 +1424,10 @@ const handleAnswerQuestions = async () => {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 直接搜基础信息 因为没有服务区的输出 即使有配置id也不会去请求 这里判断一下 如果有配置id 还是按照配置id去调用
|
||||
// 因为现在不止 基础信息 是 没有服务区 但是有配置id的情况 所以要加一下判断
|
||||
if (data?.AnalysisRuleId) {
|
||||
// 直接搜基础信息 因为没有服务区的输出 即使有配置id也不会去请求 这里判断一下 如果有配置id 还是按照配置id去调用
|
||||
if (req.Sentence.indexOf("基础信息") !== -1) {
|
||||
// 文字通过打字机效果实现
|
||||
const allBoxes = document.querySelectorAll(".dialogueTextBox-text");
|
||||
const lastBox: any = allBoxes[allBoxes.length - 1];
|
||||
@ -1455,7 +1464,12 @@ const handleAnswerQuestions = async () => {
|
||||
await handleConfigItemTable(tableData, configDetail, data);
|
||||
}
|
||||
}
|
||||
} else if (req.Sentence.indexOf("预警类型") !== -1) {
|
||||
emit("handleChangeRightFilterInDialogue", "6");
|
||||
handleSetWarningData(true);
|
||||
}
|
||||
} else {
|
||||
console.log("noRuleId");
|
||||
handleLastUpdate("小驿还无法理解,请换个说法,我会不停努力学习的!");
|
||||
searchRes = "查询失败";
|
||||
}
|
||||
@ -1862,6 +1876,7 @@ const emit = defineEmits<{
|
||||
(e: "handleAreaInspection", index: number): void; // 全部服务区圆点置灰
|
||||
(e: "handleHiddenSuspended"): void; // 隐藏掉悬浮框
|
||||
(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;
|
||||
emit("handleShowAi", true);
|
||||
if (noAdd) {
|
||||
} else {
|
||||
handleAddDialogList(
|
||||
`${props.currentServerPartDetail?.SERVERPART_NAME || ""}预警类型`
|
||||
);
|
||||
}
|
||||
setTimeout(() => {
|
||||
nextTick(() => {
|
||||
dialogueList[dialogueList.length - 1].isOver = true;
|
||||
@ -2079,6 +2097,104 @@ const handleSelectWarning = async (value: number) => {
|
||||
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) => {
|
||||
searchText.value = "";
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
0
src/components/map/component/map.js
Normal file
0
src/components/map/component/map.js
Normal file
@ -142,6 +142,8 @@ const handleGetBusinessProjectList = async () => {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("scrollIdStr.value", scrollIdStr.value);
|
||||
|
||||
// 由于tab选项卡也是写死的 吧每一项的length 补充在选项卡的名称后面
|
||||
tabs.forEach((item: any) => {
|
||||
if (item.key === 0) {
|
||||
@ -158,16 +160,25 @@ const handleGetBusinessProjectList = async () => {
|
||||
const list = [inCampList, suspend, closeList, historyList];
|
||||
console.log("list", list);
|
||||
|
||||
allProjectList = list;
|
||||
onlineProjectList = list[defaultTab];
|
||||
allProjectList.splice(
|
||||
0,
|
||||
allProjectList.length,
|
||||
...[inCampList, suspend, closeList, historyList]
|
||||
);
|
||||
onlineProjectList.splice(
|
||||
0,
|
||||
onlineProjectList.length,
|
||||
...[inCampList, suspend, closeList, historyList][defaultTab]
|
||||
);
|
||||
|
||||
console.log("defaultTab", defaultTab);
|
||||
|
||||
nextTick(() => {
|
||||
selectProjectState.value = defaultTab;
|
||||
console.log("onlineProjectList3232", onlineProjectList);
|
||||
const element: any = document.getElementById(scrollIdStr.value!.toString());
|
||||
if (element) {
|
||||
element.scrollIntoView({ behavior: "smooth", block: "start" });
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@ -588,10 +599,19 @@ watch(
|
||||
console.log("newVal", newVal);
|
||||
console.log("oldVal", oldVal);
|
||||
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();
|
||||
handleServiceDetail(newVal.SERVERPART_ID);
|
||||
} else {
|
||||
nextTick(() => {
|
||||
selectTab.value = 0
|
||||
onlineProjectList = [];
|
||||
tabs = [
|
||||
{ label: "在营", value: 0, key: 0 },
|
||||
|
||||
@ -61,6 +61,9 @@ let selectBusinessTradeList = reactive<any>([]);
|
||||
let selectBusinessTradeIdsObj = ref<any>();
|
||||
// 省份信息
|
||||
const baseInfoObj = ref<any>();
|
||||
// 是否屏蔽掉watch
|
||||
let isNoWatch: boolean = false;
|
||||
|
||||
let saveData = localStorage.getItem("baseInfoObj");
|
||||
if (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(() => {
|
||||
handleGetBUSINESS_TRADE();
|
||||
});
|
||||
|
||||
// 传入的方法
|
||||
const emit = defineEmits<{
|
||||
(e: "handleChangeMapShow", nowSelect: any): void; // 根据selectFilterList.value的选中 来对地图进行不同的操作
|
||||
(e: "handleChangeMapShow", nowSelect: any, onlyChange: boolean): void; // 根据selectFilterList.value的选中 来对地图进行不同的操作
|
||||
(e: "handleDeleteSelect"): void; // 清除选中的效果
|
||||
(e: "handleHiddenSuspended"): void; // 悬浮框的清除方法
|
||||
}>();
|
||||
@ -228,8 +242,7 @@ const props = defineProps<{
|
||||
watch(
|
||||
() => selectFilterList.value,
|
||||
(newVal, oldVal) => {
|
||||
console.log("newVal", newVal);
|
||||
emit("handleChangeMapShow", newVal);
|
||||
emit("handleChangeMapShow", newVal, isNoWatch);
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
@ -239,6 +252,7 @@ defineExpose({
|
||||
form: form,
|
||||
selectBusinessTradeIdsObj: selectBusinessTradeIdsObj,
|
||||
selectFilterList: selectFilterList,
|
||||
handleChangeFilterNoWatch: handleChangeFilterNoWatch,
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
|
||||
@ -17,6 +17,7 @@ import {
|
||||
handleGetPeriodWarningList,
|
||||
handleGetProvinceVehicleTreeList,
|
||||
handleGetServerpartList,
|
||||
handleGetTransactionDetailList,
|
||||
} from "./service";
|
||||
import { handlegetServerConnec } from "../newService";
|
||||
import { ElLoading, ElMessage } from "element-plus";
|
||||
@ -117,6 +118,12 @@ let isShowDetail = ref<boolean>(false);
|
||||
let isShowRealData = ref<boolean>(false);
|
||||
// 不同片区的标点颜色数组
|
||||
let SPREGIONTYPECOLORList = reactive<any>([]);
|
||||
// 实时经营数据的列表
|
||||
let realRevenueList = reactive<any>([]);
|
||||
// 当前到了第几批第五个
|
||||
let nowFifthIndex = ref<number>(0);
|
||||
// 地图的实时营收悬浮框
|
||||
let mapTimer: any;
|
||||
|
||||
const route = useRoute();
|
||||
console.log("route", route);
|
||||
@ -171,6 +178,8 @@ onMounted(async () => {
|
||||
handleAllServiceMarkedPoint();
|
||||
// 标出安徽省的边界
|
||||
handleGetAnHuiBoundary();
|
||||
// 服务区实时数据
|
||||
// handleGetRealServiceList();
|
||||
|
||||
hoverPoint.value = handlePointHover();
|
||||
|
||||
@ -213,6 +222,7 @@ const handleGetAllService = async () => {
|
||||
ShowWeather: true, // 显示天气
|
||||
};
|
||||
const data = await handleGetServerpartList(req);
|
||||
let str: string = "";
|
||||
console.log("data312312321321321", data);
|
||||
if (data && data.length > 0) {
|
||||
let res: any = [];
|
||||
@ -246,10 +256,15 @@ const handleGetAllService = async () => {
|
||||
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;
|
||||
allServerPartIdList = allId;
|
||||
console.log("SPREGIONTYPECOLORLIST", SPREGIONTYPECOLORLIST);
|
||||
|
||||
SPREGIONTYPECOLORList = SPREGIONTYPECOLORLIST;
|
||||
SPREGIONTYPECOLOR.value = SPREGIONTYPETYPEObj;
|
||||
@ -450,17 +465,19 @@ const handleAllServiceMarkedPoint = async () => {
|
||||
scene.value.addLayer(pointLayer);
|
||||
};
|
||||
|
||||
// 点击服务区圆点触发的时间
|
||||
// 点击服务区圆点触发的事件
|
||||
const handleClickPointLayer = async (detail: any) => {
|
||||
// 给当前选中的服务区存储值
|
||||
currentServerPartDetail.value = detail;
|
||||
// 地图上出现选中服务区的效果
|
||||
handleAddSelect(detail);
|
||||
// 先清空现有的全部图层
|
||||
handleDeleteNoDefault("");
|
||||
handleDeleteNoDefault(RightSearchBoxRef.value.selectFilterList);
|
||||
// 查看右边选中了哪些 调用在新的上面
|
||||
let nowSelect: string = RightSearchBoxRef.value.selectFilterList;
|
||||
await handleChangeMapShow(nowSelect);
|
||||
console.log("nowSelect", nowSelect);
|
||||
|
||||
await handleChangeMapShow(nowSelect, false);
|
||||
// 右侧的详情抽屉
|
||||
showRightDetail.value = true;
|
||||
// 用户判断实时数据的右侧详情是否显示的判断
|
||||
@ -546,7 +563,7 @@ const handleChangeToDefault = () => {
|
||||
current.render();
|
||||
};
|
||||
|
||||
// 鼠标移入点触发的时间
|
||||
// 鼠标移入点触发的事件
|
||||
const handlePointHover = () => {
|
||||
const el = document.createElement("div");
|
||||
el.style.background = "#000";
|
||||
@ -725,6 +742,7 @@ const handleSetCarData = async (
|
||||
let selectObj: any = {};
|
||||
let selectRoad: any = {};
|
||||
|
||||
// 从服务区的道路名称的那个数组里面 取到现在的这个服务区数据
|
||||
if (roadTestList && roadTestList.length > 0) {
|
||||
roadTestList.forEach((item: any) => {
|
||||
if (item.SERVERPART_ID.toString() === id) {
|
||||
@ -732,28 +750,45 @@ const handleSetCarData = async (
|
||||
}
|
||||
});
|
||||
}
|
||||
let roadReq: any = {};
|
||||
let heightWay: any = [
|
||||
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 = {
|
||||
let data: any = {};
|
||||
let roadItem: any = {};
|
||||
let roadReq: any = {
|
||||
RoadName: selectObj.EXPRESSWAY_NAME || "",
|
||||
CityName: selectObj.SERVERPART_ADDRESS || "",
|
||||
};
|
||||
data = await handleGetBaiDuTrafficInfo(roadReq);
|
||||
let roadRes: any = JSON.parse(data);
|
||||
if (roadRes.status == 2) {
|
||||
let roadReq: any = {
|
||||
RoadName: selectObj.SERVERPART_NAME || "",
|
||||
CityName: selectObj.SERVERPART_ADDRESS || "",
|
||||
};
|
||||
data = await handleGetBaiDuTrafficInfo(roadReq);
|
||||
roadItem = JSON.parse(data);
|
||||
} else {
|
||||
roadItem = roadRes;
|
||||
}
|
||||
console.log("selectObj", selectObj);
|
||||
|
||||
const data = await handleGetBaiDuTrafficInfo(roadReq);
|
||||
let roadItem: any = JSON.parse(data);
|
||||
console.log("roadItem", roadItem);
|
||||
// let roadReq: any = {};
|
||||
// let heightWay: any = [
|
||||
// 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) {
|
||||
featuresList.forEach((item: any) => {
|
||||
if (item.properties.SERVERPART_ID.toString() === id) {
|
||||
@ -800,7 +835,10 @@ const handleSetCarData = async (
|
||||
// 拿到实况车流数据
|
||||
const hanleGetRealTrafficData = async (id: any) => {
|
||||
let roadList: any = JSON.parse(JSON.stringify(detailText.lineData));
|
||||
roadList = roadList[baseInfoObj.value.ProvinceCode.toString()];
|
||||
let roadTestList: any = JSON.parse(JSON.stringify(detailText.roadTest));
|
||||
roadTestList = roadTestList[baseInfoObj.value.ProvinceCode.toString()];
|
||||
|
||||
let onceRoadList: any = {
|
||||
type: "FeatureCollection",
|
||||
features: [],
|
||||
@ -809,6 +847,7 @@ const hanleGetRealTrafficData = async (id: any) => {
|
||||
let list: any = [];
|
||||
|
||||
for (let i = 0; i < id.length; i++) {
|
||||
// 如果现在选择的右边查询内容 没有实时车况的选中 那就不显示
|
||||
if (nowSelectId.value.indexOf("2") === -1) {
|
||||
return;
|
||||
}
|
||||
@ -817,6 +856,9 @@ const hanleGetRealTrafficData = async (id: any) => {
|
||||
roadTestList,
|
||||
featuresList
|
||||
);
|
||||
// if (i > 0) {
|
||||
// return;
|
||||
// }
|
||||
list.push(selectRoad);
|
||||
onceRoadList.features = list;
|
||||
|
||||
@ -825,11 +867,9 @@ const hanleGetRealTrafficData = async (id: any) => {
|
||||
let haveList: any = allLayers.filter(
|
||||
(item: any) => item.name === "lineLayerOnce"
|
||||
);
|
||||
console.log("haveList", haveList);
|
||||
|
||||
if (haveList && haveList.length > 0) {
|
||||
let obj: any = haveList[0];
|
||||
console.log("obj", obj);
|
||||
nextTick(() => {
|
||||
scene.value.removeLayer(obj);
|
||||
const lineLayer = new LineLayer({
|
||||
@ -889,14 +929,19 @@ const hanleGetRealTrafficData = async (id: any) => {
|
||||
// 实况车流
|
||||
const handleGetRealTraffic = async () => {
|
||||
let roadList: any = JSON.parse(JSON.stringify(detailText.lineData));
|
||||
roadList = roadList[baseInfoObj.value.ProvinceCode.toString()];
|
||||
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 = {
|
||||
type: "FeatureCollection",
|
||||
features: [],
|
||||
};
|
||||
let featuresList: any = roadList.features;
|
||||
console.log("roadList", roadList);
|
||||
console.log("featuresList", featuresList);
|
||||
console.log("currentServerPartDetail.value", currentServerPartDetail.value);
|
||||
// 选中
|
||||
@ -950,6 +995,7 @@ const handleDeleteNoDefault = (nowSelect: string) => {
|
||||
}
|
||||
if (nowSelect.indexOf("8") === -1) {
|
||||
isShowRealData.value = false;
|
||||
clearInterval(mapTimer);
|
||||
}
|
||||
} else {
|
||||
console.log("22222", defaultServerPartList);
|
||||
@ -968,6 +1014,7 @@ const handleDeleteNoDefault = (nowSelect: string) => {
|
||||
return colorList1[value];
|
||||
});
|
||||
current.render();
|
||||
clearInterval(mapTimer);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1390,13 +1437,34 @@ const handleWarningMap = async (warningData: any) => {
|
||||
if (obj[item.SERVERPART_ID] && obj[item.SERVERPART_ID].length > 0) {
|
||||
let str: string = "";
|
||||
const tradeList: any = obj[item.SERVERPART_ID];
|
||||
tradeList.forEach((key: any) => {
|
||||
if (str) {
|
||||
str += `、${key.SERVERPARTSHOP_NAME}; `;
|
||||
} else {
|
||||
str = `${waringObj[key.WARNING_TYPE]}:${key.SERVERPARTSHOP_NAME} `;
|
||||
// tradeList 是一个服务区的全部预警数据 可能存在多个类型 文字输出时需要根据类型输出 所以要分类
|
||||
let resList: any = [];
|
||||
let typeList: any = [];
|
||||
tradeList.forEach((item: any) => {
|
||||
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 (
|
||||
shopIdObj[item.SERVERPART_ID] &&
|
||||
shopIdObj[item.SERVERPART_ID].length > 0
|
||||
@ -1409,18 +1477,42 @@ const handleWarningMap = async (warningData: any) => {
|
||||
handleUpdateMapPoint();
|
||||
});
|
||||
|
||||
console.log("obj33222", obj);
|
||||
console.log("defaultServerPartList333444", defaultServerPartList);
|
||||
|
||||
defaultServerPartList.forEach((item: any) => {
|
||||
if (obj[item.SERVERPART_ID] && obj[item.SERVERPART_ID].length > 0) {
|
||||
const newObj: any = JSON.parse(JSON.stringify(item));
|
||||
let str: string = "";
|
||||
const tradeList: any = obj[item.SERVERPART_ID];
|
||||
tradeList.forEach((key: any) => {
|
||||
if (str) {
|
||||
str += `、${key.SERVERPARTSHOP_NAME}; `;
|
||||
} else {
|
||||
str = `${waringObj[key.WARNING_TYPE]}:${key.SERVERPARTSHOP_NAME} `;
|
||||
// tradeList 是一个服务区的全部预警数据 可能存在多个类型 文字输出时需要根据类型输出 所以要分类
|
||||
let resList: any = [];
|
||||
let typeList: any = [];
|
||||
tradeList.forEach((item: any) => {
|
||||
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 (
|
||||
shopIdObj[item.SERVERPART_ID] &&
|
||||
shopIdObj[item.SERVERPART_ID].length > 0
|
||||
@ -1452,12 +1544,16 @@ const handleWarningMap = async (warningData: any) => {
|
||||
scene.value.addLayer(warningLayer);
|
||||
};
|
||||
|
||||
// 根据右侧的选择列表 来对地图进行操作
|
||||
const handleChangeMapShow = async (nowSelect: string) => {
|
||||
// 根据右侧的选择列表 来对地图进行操作 onlyChange 如果true的话 只改变值 不调用方法
|
||||
const handleChangeMapShow = async (nowSelect: string, onlyChange: boolean) => {
|
||||
// 清空没有值的图层
|
||||
handleDeleteNoDefault(nowSelect);
|
||||
console.log("nowSelect", nowSelect);
|
||||
nowSelectId.value = nowSelect;
|
||||
if (onlyChange) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 有值 根据值来判断显示的内容
|
||||
if (nowSelect) {
|
||||
if (nowSelect.indexOf("1") !== -1) {
|
||||
@ -1522,6 +1618,8 @@ const handleChangeMapShow = async (nowSelect: string) => {
|
||||
nextTick(async () => {
|
||||
// 服务区繁忙
|
||||
handleServiceBusy();
|
||||
// 服务区实时营收数据
|
||||
handleGetRealServiceList();
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -1581,9 +1679,24 @@ const handleServiceBusy = async () => {
|
||||
|
||||
// 服务区巡检的实际方法
|
||||
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 为当前执行到第几项的索引
|
||||
currentServerPartDetail.value = defaultServerPartList[i];
|
||||
currentServerPartDetail.value = list[i];
|
||||
// 先给上一次的图层 添加清除
|
||||
handleDeleteNoDefault("");
|
||||
// 每次巡检前 把 悬浮框先给隐藏起来
|
||||
@ -1592,7 +1705,7 @@ const handleAreaInspection = async (i: number) => {
|
||||
handleAddSelect(currentServerPartDetail.value);
|
||||
console.log(i, currentServerPartDetail.value);
|
||||
// 图层样式添加
|
||||
await handleChangeMapShow("1,2,4");
|
||||
await handleChangeMapShow("1,2,4", false);
|
||||
// 拿到 经营数据 在营商家
|
||||
let answerData: any =
|
||||
await RobotDialogueBoxRef.value.handleInspectionQuestions(
|
||||
@ -1675,6 +1788,158 @@ const handleShowAi = (value: boolean) => {
|
||||
const handleShowDetail = (value: boolean) => {
|
||||
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>
|
||||
|
||||
<template>
|
||||
@ -1688,6 +1953,7 @@ const handleShowDetail = (value: boolean) => {
|
||||
@handleAreaInspection="handleAreaInspection"
|
||||
@handleHiddenSuspended="handleHiddenSuspended"
|
||||
@handleShowAi="handleShowAi"
|
||||
@handleChangeRightFilterInDialogue="handleChangeRightFilterInDialogue"
|
||||
:currentServerPartDetail="currentServerPartDetail"
|
||||
:allServerPartIdList="allServerPartIdList"
|
||||
/>
|
||||
|
||||
@ -198,3 +198,14 @@ export async function handleGetMapConfigByProvinceCode(params: any) {
|
||||
}
|
||||
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
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user