This commit is contained in:
ylj20011123 2025-06-20 19:29:11 +08:00
parent a895d39596
commit f5ed0a509a

View File

@ -145,7 +145,7 @@ let routerRole = ref<any>({
onMounted(async () => {
let param1: string = ""
if (/Mobi|Android/i.test(navigator.userAgent)) {
console.log("是手机");
isPhone.value = true;
@ -162,7 +162,7 @@ onMounted(async () => {
}
} else {
const urlParams = new URLSearchParams(window.location.search);
const param1 = urlParams.get('comeForm');
param1 = urlParams.get('comeForm') || "";
console.log("comeForm", param1);
if (param1 === 'YNMap') {
pageType.value = 1
@ -215,6 +215,11 @@ onMounted(async () => {
});
}
//
if (param1 === 'YNMap') {
routerRole.value.content = ""
}
console.log("YSRole", YSRole);
console.log("routerRole", routerRole);
});
@ -510,6 +515,11 @@ const handleAskDirectlyDeepseek = async () => {
}
};
//
const containsDaping = (input: string) => {
return /大屏/.test(input);
}
//
const handleSendRequest = async (bigObj?: any) => {
// bigObj
@ -518,16 +528,16 @@ const handleSendRequest = async (bigObj?: any) => {
return;
}
//
let thisQuestion: string = "";
let mapQuestion: string = "";
thisQuestion = JSON.parse(JSON.stringify(userInput.value));
userInput.value = "";
console.log('modalTypeDataList', modalTypeDataList);
//
modalTypeDataList.forEach((item: any) => {
if (bigObj.value) {
if (item.value !== bigObj.value) {
return;
}
}
if (item.isShow) {
let list: any = item.messageList;
list.push({
@ -536,6 +546,8 @@ const handleSendRequest = async (bigObj?: any) => {
index: list && list.length > 0 ? list.length : 0,
});
item.messageList = list;
console.log('listlistlistlist', JSON.parse(JSON.stringify(list)))
handleScrollToBottomID("gjldBox" + item.value);
}
});
@ -546,6 +558,80 @@ const handleSendRequest = async (bigObj?: any) => {
return;
}
//
if (pageType.value === 1 && containsDaping(thisQuestion)) {
//
//
modalTypeDataList.forEach((item: any) => {
if (bigObj.value) {
if (item.value !== bigObj.value) {
return;
}
}
if (item.isShow) {
let list: any = item.messageList;
console.log("list", list);
list.push({
role: "default",
content: "",
index: list && list.length > 0 ? list.length : 0,
noHiden: omitProcess.value ? 0 : 1,
});
item.messageList = list;
}
});
console.log('newRuleTextnewRuleTextnewRuleText', newRuleText.value);
console.log('routerRolerouterRolerouterRolerouterRole', routerRole.value);
console.log('thisQuestionthisQuestionthisQuestionthisQuestion', thisQuestion);
let YNMapData: any = await handleGetYNMapData()
//
mapQuestion = `#云南大屏直接进行路由角色说明解析#<Br/>
#路由角色解析#<Br/>
${routerRole.value.content}<Br/>
#用户提问#<Br/>
${thisQuestion || ""}<Br/>
#接口数据说明#<Br/>
${YNMapData}
`;
console.log('mapQuestionmapQuestionmapQuestion', mapQuestion);
for (let i = 0; i < modalTypeDataList.length; i++) {
if (modalTypeDataList[i].isShow) {
let list: any = modalTypeDataList[i].messageList;
console.log('listlistlistlist', JSON.parse(JSON.stringify(list)));
list[list.length - 1] = {
...list[list.length - 1],
content: mapQuestion,
loading: false,
};
modalTypeDataList[i].messageList = list;
}
}
console.log('modalTypeDataListmodalTypeDataListmodalTypeDataList', JSON.parse(JSON.stringify(modalTypeDataList)));
// let nowShowIdList: any = [];
// for (let i = 0; i < modalTypeDataList.length; i++) {
// if (modalTypeDataList[i].isShow) {
// nowShowIdList.push(modalTypeDataList[i].value)
// }
// }
// handleOnceMoreModal(nowShowIdList);
return
}
if (useMapData) {
modalTypeDataList.forEach((item: any) => {
if (bigObj.value) {
@ -585,12 +671,13 @@ const handleSendRequest = async (bigObj?: any) => {
console.log("modalTypeDataList[i].isShow", modalTypeDataList[i].isShow);
if (modalTypeDataList[i].isShow) {
//
const mapData: any = await RobotDialogueBoxRef.value.handleSubmit(
thisQuestion,
modalTypeDataList[i].value
);
console.log("mapData5555", mapData);
console.log("modalTypeDataList", modalTypeDataList);
console.log('atatatat', mapData);
//
let userSemanticsIsSuccess: boolean = true;
@ -632,8 +719,6 @@ const handleSendRequest = async (bigObj?: any) => {
tabHeader += `<Br/>`;
dataStr += `${tabHeader}`;
}
console.log("tabHeader", tabHeader);
console.log("item.RESPONSE_FIELD", obj);
} else if (item.columns && item.columns.length > 0) {
item.columns.forEach((subItem: any) => {
if (subItem.prop) {
@ -654,18 +739,14 @@ const handleSendRequest = async (bigObj?: any) => {
}
dataStr += str;
}
console.log("showColumnsList", showColumnsList);
dataStr += `<Br/>`;
}
console.log("columnsTypeListfdsfasdfsa", columnsTypeList);
console.log("columnsObjcolumnsObjcolumnsObj", columnsObj);
if (item.tableData && item.tableData.length > 0) {
item.tableData.forEach((subItem: any) => {
let str: string = "";
let obj: any = JSON.parse(JSON.stringify(subItem));
obj = handleChangObjType(obj);
console.log("handleChangObjType", obj);
if (obj) {
let text: string = handleTableDataToStr(
@ -695,8 +776,6 @@ const handleSendRequest = async (bigObj?: any) => {
// 驿 id id
let newContent: string = "";
console.log("allStr", allStr);
if (
mapData &&
mapData.length === 1 &&
@ -726,7 +805,8 @@ const handleSendRequest = async (bigObj?: any) => {
userSemanticsIsSuccess = false;
}
console.log("mapQuestion", mapQuestion);
console.log('mapQuestionmapQuestionmapQuestion', mapQuestion);
if (
bigObj.value
@ -764,10 +844,6 @@ const handleSendRequest = async (bigObj?: any) => {
}
}
console.log("modalTypeSelect", modalTypeSelect.value);
console.log("modalTypeDataList", modalTypeDataList);
console.log("bigObj", bigObj);
let nowShowIdList: any = [];
// modalTypeDataList isShowtrue
@ -808,30 +884,9 @@ const handleSendRequest = async (bigObj?: any) => {
// handleOnceMoreModal([item.value]);
}
});
// modalTypeDataList.forEach((item: any) => {
// if (item.isShow) {
// item.messageList.push({
// role: "user",
// content: thisQuestion,
// mapContent: mapQuestion,
// });
// handleScrollToBottomID("gjldBox" + item.value);
// handleOnceMoreModal([item.value]);
// }
// });
}
// messageList.push({ role: "user", content: thisQuestion });
// // aliyunMessageList.push({ role: "user", content: thisQuestion });
// deepseekMessageList.push({ role: "user", content: thisQuestion });
// handleScrollToBottom();
// // handleAliyunScrollToBottom();
// handleDeepseekScrollToBottom();
// handleGetDeepseek(thisQuestion);
// handleAnswerText(thisQuestion);
// // aLiYunGetDeepSeek(thisQuestion);
console.log('nowShowIdListnowShowIdListnowShowIdList', nowShowIdList);
// ai
if (omitProcess.value) {
@ -928,6 +983,15 @@ const handleTableDataToStr = (
//
const handleUseRoleQuestion = async (bigObj: any, obj: any) => {
if (pageType.value === 1) {
handleOnceMoreModal(modalTypeSelect.value);
}
console.log('bigObj3232', bigObj);
//
let mapQuestion: string = "";
let thisQuestion: string = "";
@ -1302,7 +1366,7 @@ const handleOnceMoreModal = async (typeList: number[]) => {
const handleGetAnswerID = async (obj: any) => {
//
// let responseText: string = "";
console.log("obj", obj);
console.log("obj2222", obj);
let oldMessage: any = [];
// 3 user
@ -1904,6 +1968,34 @@ const handleStreamChunkID = async (chunk: any, obj: any) => {
});
};
//
const handleGetYNMapData = async () => {
let obj: any = {
"服务区况述": sessionStorage.getItem("OverviewOfServiceAreaAI") || "",
"服务区承载": sessionStorage.getItem("OverviewOfServiceAreaBusinessAI") || "",
"特情事件": sessionStorage.getItem("TradingAlertAI") || "",
"实时营收": sessionStorage.getItem("CoreBusinessDataAI") || "",
"断面流量": sessionStorage.getItem("TrendOfTrafficFlowYesAI") || "",
"入区车流": sessionStorage.getItem("VehiclesEnteringAI") || "",
"对客营收": sessionStorage.getItem("VehiclesEntering2") || "",
"经营效益": sessionStorage.getItem("VehicleModelStayAI") || "",
"年龄": sessionStorage.getItem("CustomerAgeGroupAI") || "",
"性别": sessionStorage.getItem("GenderCustomerGroupAI") || "",
"偏好类型": sessionStorage.getItem("PreferenceTypeAI") || "",
"客群特征分析": sessionStorage.getItem("CustomerGroupAI") || "",
"客群消费偏好": sessionStorage.getItem("CustomerConsumptionPreferencesAI") || "",
"消费转化对比图": sessionStorage.getItem("ConsumptionConversionAI") || "",
"消费水平": sessionStorage.getItem("ConsumptionLevelAI") || "",
"消费时段分析": sessionStorage.getItem("ConsumptionPeriodAI") || "",
"品牌消费水平": sessionStorage.getItem("BrandConsumptionLevelAI") || "",
"营收特征分析": sessionStorage.getItem("BusinessCaseAI") || "",
"区域营收占比": sessionStorage.getItem("RegionalRevenueAI") || "",
"业态结构占比": sessionStorage.getItem("BusinessStructureAI") || "",
"节假日营收分析": sessionStorage.getItem("FestivalRevenueSumInfoAI") || "",
}
return JSON.stringify(obj)
}
//
const handleStreamChunk = async (chunk: any) => {
const lines = chunk.split("\n").filter((line: any) => line.trim() !== "");
@ -2841,7 +2933,8 @@ const handleChangeProcess = (e: any) => {
</div>
</div>
<div class="modalSelectBox" :style="{ width: pageType === 1 ? hideLeft ? '250px' : '57px' : hideLeft ? '10vw' : '57px' }">
<div class="modalSelectBox"
:style="{ width: pageType === 1 ? hideLeft ? '250px' : '57px' : hideLeft ? '10vw' : '57px' }">
<div class="showBox">
<el-checkbox-group v-if="hideLeft" v-model="modalTypeSelect" @change="handleChangeModalType">
<el-checkbox class="selectBox" v-for="(item, index) in modalTypeDataList" :key="index" :label="item.label"