From 751fd8d3b43e78edaf3d93bb62de08b0568cf314 Mon Sep 17 00:00:00 2001 From: ylj20011123 Date: Tue, 23 Dec 2025 18:42:59 +0800 Subject: [PATCH] update --- .../deepseek/components/RobotDialogueBox.vue | 595 +++++------------- src/components/deepseek/index.vue | 395 ++++++------ vite.config.ts | 6 + 3 files changed, 362 insertions(+), 634 deletions(-) diff --git a/src/components/deepseek/components/RobotDialogueBox.vue b/src/components/deepseek/components/RobotDialogueBox.vue index b777266..03bb0af 100644 --- a/src/components/deepseek/components/RobotDialogueBox.vue +++ b/src/components/deepseek/components/RobotDialogueBox.vue @@ -190,10 +190,8 @@ const handleGetShowDailogBox = async () => { emit("handleShowAi", true); }); inputRef.value?.focus(); - console.log("dialogueList", dialogueList); // 给每个带有isVHtml 的对话框 赋值上对应的VHtml const allBoxes = document.querySelectorAll(".dialogueTextBox-text"); - console.log("allBoxes", allBoxes); dialogueList.forEach((item: any, index: number) => { if (item.isVHtml) { @@ -217,7 +215,6 @@ const handleGetShowDailogBox = async () => { isNewDialogLoading.value = false; nextTick(() => { // 聚焦 - console.log("inputRef.value", inputRef.value); inputRef.value?.focus(); }); }, 1000); @@ -225,8 +222,6 @@ const handleGetShowDailogBox = async () => { }; // 关闭对话框 const handleCloseDialogbox = async () => { - console.log("dialogueList", dialogueList); - const allBoxes = document.querySelectorAll(".dialogueTextBox-text"); // 等待 nextTick 确保 DOM 更新 @@ -242,7 +237,6 @@ const handleCloseDialogbox = async () => { // 确保 obj.VHtml 存在并赋值 if (obj.VHtml) { lastBox.innerHTML = obj.VHtml; - console.log("lastBox", lastBox); } else { console.warn("VHtml is empty or undefined", obj); } @@ -303,8 +297,6 @@ const handleLastUpdate = (str: any) => { // 给多层级树状表格结构加上rowKey const handleSetRowKeyTable = (list: any) => { - console.log("list", list); - if (list && list.length > 0) { let res: any = JSON.parse(JSON.stringify(list)); res.forEach((item: any, index: number) => { @@ -314,21 +306,18 @@ const handleSetRowKeyTable = (list: any) => { subItem.rowKey = `${index + 1}-${subIndex + 1}`; if (subItem.children && subItem.children.length > 0) { subItem.children.forEach((thirdItem: any, thirdIndex: number) => { - thirdItem.rowKey = `${index + 1}-${subIndex + 1}-${ - thirdIndex + 1 - }`; + thirdItem.rowKey = `${index + 1}-${subIndex + 1}-${thirdIndex + 1 + }`; if (thirdItem.children && thirdItem.children.length > 0) { thirdItem.children.forEach( (fourthItem: any, fourthIndex: number) => { - fourthItem.rowKey = `${index + 1}-${subIndex + 1}-${ - thirdIndex + 1 - }-${fourthIndex + 1}`; + fourthItem.rowKey = `${index + 1}-${subIndex + 1}-${thirdIndex + 1 + }-${fourthIndex + 1}`; if (fourthItem.children && fourthItem.children.length > 0) { fourthItem.children.forEach( (fifthItem: any, fifthIndex: number) => { - fourthItem.rowKey = `${index + 1}-${subIndex + 1}-${ - thirdIndex + 1 - }-${fourthIndex + 1}-${fifthIndex + 1}`; + fourthItem.rowKey = `${index + 1}-${subIndex + 1}-${thirdIndex + 1 + }-${fourthIndex + 1}-${fifthIndex + 1}`; } ); } @@ -356,8 +345,6 @@ const handleConfigRequest = async ( ) => { // url 请求地址 params 参数 detail 配置项详情 config 配置输出结果的格式 answer 拿到回答问题的数据 let data: any; - console.log("handleConfigRequest"); - // if (config.acceptVerbs === "get") { // data = await request.get(url, params); // } else { @@ -368,6 +355,17 @@ const handleConfigRequest = async ( if (config.acceptVerbs === "get") { // 尝试发起 GET 请求 data = await request.get(url, params); + } else if (config.acceptVerbs === "customizeGet") { + const query = new URLSearchParams(params).toString(); + // 自定义get的路径 + data = await fetch(`${url}?${query}`, { + method: "GET", + headers: { + "Content-Type": "application/json", + } + }); + data = await data.json() + console.log('djksdjaskdjas', data) } else { // 尝试发起 POST 请求 data = await request.post(url, params); @@ -378,9 +376,6 @@ const handleConfigRequest = async ( data = false; // 或者根据需要返回其他值 } - console.log("dssadasconfig", config); - console.log("detail", detail); - console.log("data22321", data); if ( data === false || (data.Result_Code !== 100 && data.Result_Code !== 200) @@ -471,7 +466,6 @@ const handleConfigRequest = async ( // 先判断是单个服务区 还是多个服务区 if (answer?.ServerpartId && answer?.ServerpartId.indexOf(",") === -1) { - console.log("config3232", config); // 单个服务区 那么要去掉合计和片区层 只展示服务区层即以下 if (config?.serverpart) { if (data && data.length > 0) { @@ -520,11 +514,7 @@ const handleConfigRequest = async ( // 多个服务区就不做处理了 newRes = data; } - console.log("newRes", newRes); - // 判断一下showLevel 只显示哪一层 - console.log("dasdas", config); - let finalRes: any = []; if (config.showLevel) { @@ -654,7 +644,6 @@ const handleGetListSumObj = (list: any, str: any) => { } } } - console.log("sumObj", sumObj); // 给输出的全部数据都格式化一下 // for (let key in sumObj) { // if (typeof sumObj[key] === "number") { @@ -690,8 +679,6 @@ const handleGetReq = (configDetail: any, answer?: any) => { ? JSON.parse(configDetail?.PARSING_RULES) : ""; // 对应的规则 - console.log("newReq", newReq); - console.log("newPARSING_RULES", newPARSING_RULES); if (newReq) { for (let key in newReq) { @@ -715,20 +702,20 @@ const handleGetReq = (configDetail: any, answer?: any) => { req[key] = answer[realKey.fieldName] ? moment(answer[realKey.fieldName]).format("YYYY") : realKey.haveDefault - ? moment().format("YYYY") - : ""; + ? moment().format("YYYY") + : ""; } else if (realKey.formatType === 4) { req[key] = answer[realKey.fieldName] ? moment(answer[realKey.fieldName]).format("YYYYMM") : realKey.haveDefault - ? moment().format("YYYYMM") - : ""; + ? moment().format("YYYYMM") + : ""; } else if (realKey.formatType === 5) { req[key] = answer[realKey.fieldName] ? moment(answer[realKey.fieldName]).format("YYYY-MM-DD") : realKey.haveDefault - ? moment().format("YYYY-MM-DD") - : ""; + ? moment().format("YYYY-MM-DD") + : ""; } else if (realKey.formatType === 6) { req[key] = moment().format("YYYY"); } else if (realKey.formatType === 7) { @@ -736,10 +723,10 @@ const handleGetReq = (configDetail: any, answer?: any) => { realKey.value === 1 ? moment().subtract(1, "year").format("YYYY") : realKey.value === 2 - ? moment().subtract(1, "m").format("YYYYMM") - : realKey.value === 3 - ? moment().subtract(1, "d").format("YYYY-MM-DD") - : ""; + ? moment().subtract(1, "m").format("YYYYMM") + : realKey.value === 3 + ? moment().subtract(1, "d").format("YYYY-MM-DD") + : ""; } else if (realKey.formatType === 8) { req[key] = moment().format("MM"); } else if (realKey.formatType === 9) { @@ -796,7 +783,6 @@ const handleGetReq = (configDetail: any, answer?: any) => { // 去解析配置项 输出结果 const handleAnalyzeConfig = async (configDetail: any, answer: any) => { // configDetail 配置内容 answer 回答问题接口返回的内容 - console.log("configDetail321321", configDetail); let newReq: any = configDetail?.PARAM_TEMPLATE ? JSON.parse(configDetail?.PARAM_TEMPLATE) @@ -808,22 +794,15 @@ const handleAnalyzeConfig = async (configDetail: any, answer: any) => { OUTPUT_FORMAT?.responseType === "text" ? configDetail?.RESPONSE_CONFIG : configDetail?.RESPONSE_CONFIG - ? JSON.parse(configDetail?.RESPONSE_CONFIG) - : ""; // 出参 + ? JSON.parse(configDetail?.RESPONSE_CONFIG) + : ""; // 出参 let newPARSING_RULES: any = configDetail?.PARSING_RULES ? JSON.parse(configDetail?.PARSING_RULES) : ""; // 对应的规则 - console.log("newReq", newReq); - console.log("newRESPONSE_CONFIG", newRESPONSE_CONFIG); - console.log("newPARSING_RULES", newPARSING_RULES); - console.log("OUTPUT_FORMAT", OUTPUT_FORMAT); - console.log("configDetail", configDetail); - // 配置请求的参数 let req: any = handleGetReq(configDetail, answer); console.log("req2", req); - // 给post的请求 的参数 需要包一层的包一层 if (OUTPUT_FORMAT) { if (OUTPUT_FORMAT.paramsFormat === "searchModel") { @@ -836,6 +815,7 @@ const handleAnalyzeConfig = async (configDetail: any, answer: any) => { } } + console.log("OUTPUT_FORMATOUTPUT_FORMAT", OUTPUT_FORMAT); // 判断是不是有了全部数据 如果有参数是未填写的且可以取默认数据 // 判断req里面全空值 let haveALLNull: boolean = true; @@ -845,11 +825,11 @@ const handleAnalyzeConfig = async (configDetail: any, answer: any) => { } } - console.log("reqreqreqreqreq", req); - if (!req.ServerpartId) { + if (!req.ServerpartId && !req.SERVERPART_ID) { req.ServerpartId = allID.value; } + console.log("haveALLNullhaveALLNull", haveALLNull); // 配置请求 // 接口返回的结果 let result: any; @@ -867,21 +847,9 @@ const handleAnalyzeConfig = async (configDetail: any, answer: any) => { } } - // if (!result) { - // return { - // api: configDetail?.API_ENDPOINT, - // nowReq: req, - // needReq: JSON.parse(configDetail?.PARAM_TEMPLATE), - // dataType: 'noData' - // }; - // } + console.log('dsjkdhasjlkdhasl', JSON.parse(JSON.stringify(result))) // 根据输出结果的配置 去修改实际值 - console.log("dsadsadasf", result); - console.log("OUTPUT_FORMAT", OUTPUT_FORMAT); - console.log("answer", answer); - console.log("newRESPONSE_CONFIG", newRESPONSE_CONFIG); - let newResult: any; // 判断responseType 格式是否为 text 一般都为json function时 说明调用这个组件的某个方法 if (OUTPUT_FORMAT.responseType === "text") { @@ -897,35 +865,6 @@ const handleAnalyzeConfig = async (configDetail: any, answer: any) => { return ""; // 出现错误时返回空字符串 } }); - - // newResult = newRESPONSE_CONFIG.replace( - // /\{\{(.*?)\}\}/g, - // (_: any, expression: any) => { - // try { - // // 创建一个安全的执行上下文 - // const func = new Function( - // ...Object.keys({ - // moment: window.moment, - // answer, - // result, - // formatNumber, - // }), - // `return (${expression});` - // ); - // return func( - // ...Object.values({ - // moment: window.moment, - // answer, - // result, - // formatNumber, - // }) - // ); - // } catch (e) { - // console.error("模板解析错误:", expression, e); - // return ""; - // } - // } - // ); } else if (OUTPUT_FORMAT.responseType === "function") { await handleGetConfigFun( OUTPUT_FORMAT.responseFunName, @@ -935,14 +874,8 @@ const handleAnalyzeConfig = async (configDetail: any, answer: any) => { return null; } else { newResult = result; - // if (OUTPUT_FORMAT.responseFormat === "object") { - // newResult = result; - // } else { - // newResult = handleChangeTableList(result, newRESPONSE_CONFIG); - // } } - console.log("newResult", newResult); return newResult; }; // 去循环处理一个数组里面的数据 是否符合配置项的要求 @@ -996,8 +929,8 @@ const handleChangeObj = (obj: any, config: any) => { typeof newObj[key] === "number" ? newObj[key] / 10000 : formatNumber( - parseThousandSeparatedNumber(newObj[key]) / 10000 - ); + parseThousandSeparatedNumber(newObj[key]) / 10000 + ); } // 判断是不是要加上百分比 if (configObj["isRate"] && samllKey === "isRate") { @@ -1052,7 +985,6 @@ const disasseListObj = (obj: any) => { old[key] = obj[key]; } } - console.log("old", old); return old; }; @@ -1068,9 +1000,7 @@ const disassembleObjects = (obj: any, parentKey: any) => { }; } if (obj["children"]) { - console.log("children", obj["children"]); let list: any = handleChangeShow(obj["children"], addKey); - console.log("fdjksfjsd", list); if (list && list.length > 0) { list.forEach((item: any) => { res.push(item); @@ -1128,9 +1058,8 @@ const renderCell = (row: any, column: any) => { return `${formatNumber(value)}`; } if (column.isRate) { - return `${value}%`; + return `${value}%`; } return `${value}`; @@ -1138,6 +1067,8 @@ const renderCell = (row: any, column: any) => { // 如果请求接口的结果是对象中的某个参数 且这个对象可能是多级的 最后输出最终字段 只能取一个字段 const handleGetResFieldRes = (obj: any, config: any) => { + console.log("obj", obj); + console.log("config", config); let str: string = ""; for (let key in config) { if (config[key] && obj[key]) { @@ -1156,85 +1087,66 @@ const handleGetResFieldRes = (obj: any, config: any) => { // 给巡检添加自定义文字输出的方法 const handleInspectionDialogueBox = async (detail: any, otherObj?: any) => { // 要输出的文字内容 - let str: string = `${ - props.currentServerPartDetail.SERVERPART_NAME - }:天气情况:${ - props.currentServerPartDetail.weatherModel - ? `${"今天"}(${moment().format("YYYY-MM-DD")})${ - detail.weatherModel.DAY_WEATHER - }转${detail.weatherModel.NIGHT_WEATHER},气温${ - detail.weatherModel.NIGHT_AIR_TEMPERATURE - }℃~${ - detail.weatherModel.DAY_AIR_TEMPERATURE - }℃${"明天"}(${moment() - .add(1, "d") - .format("YYYY-MM-DD")})${detail.tmwWeatherModel.DAY_WEATHER}转${ - detail.tmwWeatherModel.NIGHT_WEATHER - },气温${detail.tmwWeatherModel.NIGHT_AIR_TEMPERATURE}℃~${ - detail.tmwWeatherModel.DAY_AIR_TEMPERATURE - }℃` + let str: string = `${props.currentServerPartDetail.SERVERPART_NAME + }:天气情况:${props.currentServerPartDetail.weatherModel + ? `${"今天"}(${moment().format("YYYY-MM-DD")})${detail.weatherModel.DAY_WEATHER + }转${detail.weatherModel.NIGHT_WEATHER},气温${detail.weatherModel.NIGHT_AIR_TEMPERATURE + }℃~${detail.weatherModel.DAY_AIR_TEMPERATURE + }℃${"明天"}(${moment() + .add(1, "d") + .format("YYYY-MM-DD")})${detail.tmwWeatherModel.DAY_WEATHER}转${detail.tmwWeatherModel.NIGHT_WEATHER + },气温${detail.tmwWeatherModel.NIGHT_AIR_TEMPERATURE}℃~${detail.tmwWeatherModel.DAY_AIR_TEMPERATURE + }℃` : "暂无天气数据" - }实时路况:${ - detail?.roadConditions - ? `${ - detail?.roadConditions?.EXPRESSWAY_NAME - ? detail?.roadConditions?.EXPRESSWAY_NAME + ":" - : "" - }${ - detail?.roadConditions?.evaluation.status_desc || "" - }(${moment().format("MM月DD日 HH时mm分")})` + }实时路况:${detail?.roadConditions + ? `${detail?.roadConditions?.EXPRESSWAY_NAME + ? detail?.roadConditions?.EXPRESSWAY_NAME + ":" + : "" + }${detail?.roadConditions?.evaluation.status_desc || "" + }(${moment().format("MM月DD日 HH时mm分")})` : "暂无实况车流数据" - } 车辆归属:${ - detail?.provinceListTooltip && detail?.provinceListTooltip.length > 0 + } 车辆归属:${detail?.provinceListTooltip && detail?.provinceListTooltip.length > 0 ? `${detail?.provinceListTooltip - .map((item: any) => { - return `${moment( - moment().startOf("year") - ).format("YYYY年MM月")}至${moment().format("YYYY年MM月")}${ - detail?.SERVERPART_NAME || "" - }总入区车流:${formatNumber(item.TotalCount || 0)}${ - item.children && item.children.length > 0 - ? item.children - .map((subItem: any) => { - return `${ - subItem.ProvinceOrCityName - }:占比:${formatNumber( - (subItem.TotalCount / item.TotalCount) * 100 - )}%,Top3:${ - subItem.children && subItem.children.length > 0 - ? subItem.children - .map((thirdItem: any, thirdIndex: number) => { - return thirdItem.ProvinceOrCityName !== "其他" - ? `${thirdItem.ProvinceOrCityName}${ - thirdIndex + 1 !== subItem.children.length - ? "、" - : "" - }` - : ""; - }) - .join("") - : "" - }`; - }) - .join("") - : "" + .map((item: any) => { + return `${moment( + moment().startOf("year") + ).format("YYYY年MM月")}至${moment().format("YYYY年MM月")}${detail?.SERVERPART_NAME || "" + }总入区车流:${formatNumber(item.TotalCount || 0)}${item.children && item.children.length > 0 + ? item.children + .map((subItem: any) => { + return `${subItem.ProvinceOrCityName + }:占比:${formatNumber( + (subItem.TotalCount / item.TotalCount) * 100 + )}%,Top3:${subItem.children && subItem.children.length > 0 + ? subItem.children + .map((thirdItem: any, thirdIndex: number) => { + return thirdItem.ProvinceOrCityName !== "其他" + ? `${thirdItem.ProvinceOrCityName}${thirdIndex + 1 !== subItem.children.length + ? "、" + : "" + }` + : ""; + }) + .join("") + : "" + }`; + }) + .join("") + : "" }`; - }) - .join("")}` + }) + .join("")}` : "暂无车辆归属地数据" - }${ - otherObj - ? `${ - otherObj?.businessText - ? `经营数据:${otherObj?.businessText}` - : "" - }${ - otherObj?.merchantText - ? `在营商家:${otherObj?.merchantText}` - : "" - }` + }${otherObj + ? `${otherObj?.businessText + ? `经营数据:${otherObj?.businessText}` + : "" + }${otherObj?.merchantText + ? `在营商家:${otherObj?.merchantText}` + : "" + }` : "" - }`; + }`; // 解除对话框的加载效果 isNewDialogLoading.value = false; // 拿到最后一个对话框的数据 @@ -1310,6 +1222,8 @@ const handleConfigItemTable = async ( await handlePrintWord(lastBox, lastContent); } + console.log('configObjconfigObj', configObj) + // 判断是否需要出现表格 if (configObj.ENABLE_TABLE === 1) { // 如果有表格的话 配置列表的显示列 @@ -1318,18 +1232,15 @@ const handleConfigItemTable = async ( let columns: any = []; if (resObj) { columns = handleChangeShow(resObj); - console.log("columns", columns); } let obj: any = JSON.parse( JSON.stringify(dialogueList[dialogueList.length - 1]) ); - console.log("configObjconfigObjconfigObjconfigObj", configObj); // 显示的时间设置 let timeStr: string = ""; let OUTPUT_FORMAT: any; if (configObj.OUTPUT_FORMAT) { OUTPUT_FORMAT = JSON.parse(configObj.OUTPUT_FORMAT); - console.log("OUTPUT_FORMAT", OUTPUT_FORMAT); if ( (OUTPUT_FORMAT.DateFormat || OUTPUT_FORMAT.DateFormat === 0) && (OUTPUT_FORMAT.DateType || OUTPUT_FORMAT.DateType === 0) @@ -1372,18 +1283,11 @@ const handleConfigItemTable = async ( } timeStr = time; } else { - timeStr = `${answer?.StartDate ? answer?.StartDate : ""}${ - answer?.EndDate ? "-" + answer?.EndDate : "" - }`; + timeStr = `${answer?.StartDate ? answer?.StartDate : ""}${answer?.EndDate ? "-" + answer?.EndDate : "" + }`; } } - // let newText: string = await handleUseDeepseekTableSummarize( - // tableData, - // columns - // ); - // console.log("newText", newText); - dialogueList[dialogueList.length - 1] = { ...obj, haveTable: true, @@ -1416,21 +1320,6 @@ const handleConfigItemTable = async ( }; isNewDialogLoading.value = false; } - - // 是否出现 图表输出 导出为PDF “查看更多”功能 - - // else { - // // 不需要出现表格时 直接给最新对话框的text赋值就好 - // let obj: any = JSON.parse( - // JSON.stringify(dialogueList[dialogueList.length - 1]) - // ); - // dialogueList[dialogueList.length - 1] = { - // ...obj, - // text: `${tableData}`, - // }; - // isNewDialogLoading.value = false; - // } - handleScrollToBottom(); }; @@ -1470,11 +1359,9 @@ const handleInspectionQuestions = async (text: string) => { if (configList && configList.length > 0) { configDetail = configList[0]; } - console.log("configDetail", configDetail); // 如果拿到值就根据配置去调用接口 拿到数据 输出数据 if (configDetail) { const tableData = await handleAnalyzeConfig(configDetail, data); - console.log("tableData3", tableData); res = tableData; } return res; @@ -1487,7 +1374,6 @@ const handleDelteModalCode = (bigObjValue?: number) => { } nextTick(() => { dialogueIdObj[bigObjValue] = null; - console.log("dialogueIdObj", dialogueIdObj); }); }; @@ -1495,7 +1381,6 @@ const handleDelteModalCode = (bigObjValue?: number) => { const handleAnswerQuestions = async (bigObjValue?: number) => { // 给deepseek那边写的数据格式 let deepseekDataList: any = []; - console.log("dialogueIdObj", dialogueIdObj); const req: any = { Sentence: searchText.value, @@ -1509,12 +1394,10 @@ const handleAnswerQuestions = async (bigObjValue?: number) => { // 需要在对话框中的效果就是 输入问题之后 出现问问题和回答的对话框之后 就删除对话框内容 但是接口搜索还是需要显示内容 searchText.value = ""; const data = await handleTranslateSentence(req); - console.log("data", data); // deepseek的判断的语义id // 太慢了 先注释 // const deepseekIds = await handleUseDeepseekSemantics(req.Sentence); - // console.log("datadeepseek的判断的语义id", deepseekIds); let searchRes: string = ""; let returnData: any; @@ -1570,7 +1453,7 @@ const handleAnswerQuestions = async (bigObjValue?: number) => { await handlePrintWord(lastBox, lastContent); } - const configList: any = await handleGetANALYSISRULEList({ + let configList: any = await handleGetANALYSISRULEList({ searchParameter: { ANALYSISRULE_IDS: data?.AnalysisRuleId, current: 1, @@ -1580,12 +1463,15 @@ const handleAnswerQuestions = async (bigObjValue?: number) => { PageIndex: 1, pagesize: 999999, }); - console.log("configList", configList); if (configList && configList.length > 0) { + configList = [configList[0]] + console.log("configList", configList); for (let i = 0; i < configList.length; i++) { configDetail = configList[i]; + console.log("configDetail", configDetail); if (configDetail) { const tableData = await handleAnalyzeConfig(configDetail, data); + console.log("tableData1", tableData); if (tableData) { await handleConfigItemTable(tableData, configDetail, data); } @@ -1594,24 +1480,22 @@ const handleAnswerQuestions = async (bigObjValue?: number) => { ); res.ruleDetail = configDetail; res.RevenueAnalysis = data.RevenueAnalysis; + console.log("res", res); deepseekDataList.push(res); } } } - console.log("deepseekDataList", deepseekDataList); // 2025-2-12 下面这个是按照优先级去调用的 先注释 要改成多个都可以调用 // 请求列表的时候 已经根据优先级排序 第一个就是优先级最高的 直接取值就可以 // if (configList && configList.length > 0) { // configDetail = configList[0]; // } - // console.log("configDetail", configDetail); // // 如果拿到值就根据配置去调用接口 拿到数据 输出数据 // if (configDetail) { // const tableData = await handleAnalyzeConfig(configDetail, data); // returnData = tableData; - // console.log("tableData", tableData); // // 如果拿到值了 就去配这个对话框显示表格的样式 或文字样式 // if (tableData) { @@ -1657,16 +1541,13 @@ const handleAnswerQuestions = async (bigObjValue?: number) => { 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); @@ -1677,19 +1558,17 @@ const handleAnswerQuestions = async (bigObjValue?: number) => { handleSetWarningData(true); } } else { - console.log("noRuleId"); handleLastUpdate("小驿还无法理解,请换个说法,我会不停努力学习的!"); searchRes = "查询失败"; } } - console.log('3333'); - + // 问完去调日志接口记录 且在没有对话框id的时候 存一个对话框id const logData: any = await handleSynchroSENTENCE({ // DIALOG_CODE: thisQuestionId.value, DIALOG_CODE: bigObjValue && dialogueIdObj && dialogueIdObj[bigObjValue] - ? dialogueIdObj[bigObjValue] - : "", + ? dialogueIdObj[bigObjValue] + : "", SENTENCE_CONTENT: req.Sentence, SENTENCE_RESULT: data?.RevenueAnalysis || "查询失败", SENTENCE_TYPE: data?.SentenceType, @@ -1708,12 +1587,6 @@ const handleAnswerQuestions = async (bigObjValue?: number) => { dialogueIdObj[bigObjValue] = logData?.DIALOG_CODE; } } - console.log('4444'); - - console.log("dialogueList", dialogueList); - console.log("searchRes", searchRes); - console.log("data?.RevenueAnalysis", data?.RevenueAnalysis); - // return searchRes === "查询失败" || data?.RevenueAnalysis === "无法识别。" // ? false // : { @@ -1727,13 +1600,12 @@ const handleAnswerQuestions = async (bigObjValue?: number) => { // 提问的方法 const handleSubmit = async (text: string, bigObjValue: number) => { - console.log("bigObjValue", bigObjValue); - searchText.value = text || ""; // 先添加对话内容 handleAddDialogList(text); // 调用回答问题的接口 const data = await handleAnswerQuestions(bigObjValue); + return data; // inputRef.value?.focus(); @@ -1775,8 +1647,6 @@ const handleClickTab = async (value: number) => { } if (value === 0) return; - console.log("handleClickTab", props.currentServerPartDetail); - let searchObj: any = { 1: `${props.currentServerPartDetail?.SERVERPART_NAME || ""}基础信息`, 2: `${props.currentServerPartDetail?.SERVERPART_NAME || ""}经营数据`, @@ -1810,7 +1680,6 @@ const handleGetConfigList = async (str: string) => { pagesize: 999999, PageIndex: 1, }); - console.log("data", data); let detailObj: number = 0; if (data && data.length > 0) { data.forEach((item: any) => { @@ -1820,7 +1689,6 @@ const handleGetConfigList = async (str: string) => { }); } - console.log("detailObj", detailObj); return detailObj; }; @@ -1838,10 +1706,8 @@ const handleHaveNullValue = (obj: any) => { // 输出服务区基础数据的方法 const handleServerpartBasicInfo = async (config: any) => { - console.log("config", config); // 取入参 const req: any = handleGetReq(config, null); - console.log("req", req); // 判断入参里面是否有空值 如果有空值 就直接输出安徽驿达的基础信息 let haveNull: boolean = handleHaveNullValue(req); @@ -1870,7 +1736,6 @@ const handleServerpartBasicInfo = async (config: any) => { }; } - console.log("data213", data); if (data) { isNewDialogLoading.value = false; let obj: any = JSON.parse( @@ -2026,13 +1891,13 @@ const handleStopPrint = () => { }; // 显示数据图表 -const handleShowDataPie = () => {}; +const handleShowDataPie = () => { }; // 跳转查看更多 const handleGoSearchMore = () => { window.open("http://saas.eshangtech.com/cloud/"); }; // 导出为pdf -const handleExportPDF = () => {}; +const handleExportPDF = () => { }; // 传入的数据 const props = defineProps<{ @@ -2058,8 +1923,6 @@ watch( if (newVal) { // 不在巡检状态 if (selectTab.value !== 0 && !duringInspection.value) { - console.log("new", newVal); - console.log("old", oldVal); handleClickTab(selectTab.value); } } @@ -2102,7 +1965,6 @@ const handleGetFieldEnum = async () => { descObjRef.value = obj; descListRef.value = list; - console.log("descObjRef.value", descObjRef.value); } // 经营业态 @@ -2120,7 +1982,6 @@ const handleGetFieldEnum = async () => { }); } }); - console.log("BusinessTradeIdsObj", BusinessTradeIdsObj); tradeObjRef.value = BusinessTradeIdsObj; } @@ -2162,12 +2023,9 @@ const handleSetWarningData = async (noAdd?: boolean) => { // 选择的具体预警类型 const handleSelectWarning = async (value: number) => { handleAddDialogList( - `${props.currentServerPartDetail?.SERVERPART_NAME || ""}${ - descObjRef.value[Number(value)] || "预警类型" + `${props.currentServerPartDetail?.SERVERPART_NAME || ""}${descObjRef.value[Number(value)] || "预警类型" }` ); - console.log("value", value); - console.log("props?.currentServerPartDetail", props?.currentServerPartDetail); const req: any = { WarningType: value, ShowNormal: true, @@ -2176,7 +2034,6 @@ const handleSelectWarning = async (value: number) => { : props?.allServerPartIdList.toString(), }; const warningData = await handleGetMonthINCAnalysis(req); - console.log("warningData", warningData); let result: string = ""; if (props?.currentServerPartDetail) { if (warningData && warningData.length > 0) { @@ -2207,8 +2064,6 @@ const handleSelectWarning = async (value: number) => { objShopName[item.WARNING_TYPE] = old; } }); - console.log("obj", obj); - console.log("objShopName", objShopName); if (obj) { for (let key in obj) { let itemStr: string = ` @@ -2230,13 +2085,10 @@ const handleSelectWarning = async (value: number) => { } }); } - result = `${descObjRef.value[Number(value)]},共有${ - serverpartId.length || 0 - } 对服务区,存在${warningData.length || 0}条${ - descObjRef.value[Number(value)] - } 的情况,您可以鼠标移动到具体服务区查看情况。`; + result = `${descObjRef.value[Number(value)]},共有${serverpartId.length || 0 + } 对服务区,存在${warningData.length || 0}条${descObjRef.value[Number(value)] + } 的情况,您可以鼠标移动到具体服务区查看情况。`; } - console.log("result", result); if (result) { isNewDialogLoading.value = false; let obj: any = JSON.parse( @@ -2307,8 +2159,6 @@ const handleWarningConfig = async (id: any, warningData: any) => { objShopName[item.WARNING_TYPE] = old; } }); - console.log("obj", obj); - console.log("objShopName", objShopName); if (obj) { for (let key in obj) { let itemStr: string = ` @@ -2322,7 +2172,6 @@ const handleWarningConfig = async (id: any, warningData: any) => { result = `${SERVERPART_NAME || "-"}暂无预警数据`; } } - console.log("result", result); if (result) { isNewDialogLoading.value = false; let obj: any = JSON.parse( @@ -2432,7 +2281,6 @@ const handleGetAnswerID = async ( PageIndex: 1, pagesize: 999999, }); - console.log("configList", configList); // 请求列表的时候 已经根据优先级排序 第一个就是优先级最高的 直接取值就可以 if (configList && configList.length > 0) { // configDetail = configList[0]; @@ -2455,11 +2303,9 @@ const handleGetAnswerID = async ( // let stop: boolean = false; // if (configDetail) { // const tableData = await handleAnalyzeConfig(configDetail, data); - // console.log("tableData2", tableData); // // 如果拿到值了 就去配这个对话框显示表格的样式 或文字样式 // if (tableData) { // await handleConfigItemTable(tableData, configDetail, data); - // console.log("handleConfigItemTable"); // } else { // stop = true; // } @@ -2470,14 +2316,12 @@ const handleGetAnswerID = async ( // return false; // } - // console.log("handleGetAnswerID", dialogueList); - // console.log("data", data); const logData: any = await handleSynchroSENTENCE({ // DIALOG_CODE: thisQuestionId.value, DIALOG_CODE: bigObjValue && dialogueIdObj && dialogueIdObj[bigObjValue] - ? dialogueIdObj[bigObjValue] - : "", + ? dialogueIdObj[bigObjValue] + : "", SENTENCE_CONTENT: req.Sentence, SENTENCE_RESULT: data?.RevenueAnalysis || "查询失败", SENTENCE_TYPE: data?.SentenceType, @@ -2531,7 +2375,6 @@ const handleUseDeepseekTableSummarize = async ( } let questionText: string = `表格数据的JSON格式内容为${tableJSON},表格重点显示的字段JSON为${columnJSON},根据重点显示的字段分析表格数据,并给出总结性的语言给客户展示讲解`; - console.log("questionText", questionText); try { const timeoutPromise = new Promise((resolve) => { @@ -2547,7 +2390,6 @@ const handleUseDeepseekTableSummarize = async ( resText.data && resText.data.choices && resText.data.choices.length > 0 ? resText.data.choices[0].message.content : ""; - console.log("resText", resText); return res; } catch (error) { console.error("请求出错:", error); @@ -2563,7 +2405,6 @@ const handleUseDeepseekOptimize = async (text: string) => { } let questionText: string = `根据自然语言语义完善修改这段话,要求:返回结果只有修改后的语句,没有其他的思考过程、分析过程 ,语句内容:${text}`; - console.log("questionText", questionText); try { const timeoutPromise = new Promise((resolve) => { setTimeout(() => resolve("为您查找相关数据"), 30000); @@ -2578,7 +2419,6 @@ const handleUseDeepseekOptimize = async (text: string) => { resText.data && resText.data.choices && resText.data.choices.length > 0 ? resText.data.choices[0].message.content : "为您查找相关数据"; - console.log("resText", resText); return res; } catch (error) { console.error("请求出错:", error); @@ -2644,14 +2484,12 @@ const handleGetDeepseek = async (questionText: any) => { }; const data = await axios(config); - console.log("dhsajkhdlsajkhdaksjd", data); return data; }; // 用deepseek来识别语义 拿到规则id const handleUseDeepseekSemantics = async (searchText: string) => { let questionText: string = `${deepseekDesc.value}${searchText}`; - console.log("questionText", questionText); try { const timeoutPromise = new Promise((resolve) => { @@ -2667,7 +2505,6 @@ const handleUseDeepseekSemantics = async (searchText: string) => { resText.data && resText.data.choices && resText.data.choices.length > 0 ? resText.data.choices[0].message.content : []; - console.log("resText", resText); return res; } catch (error) { console.error("请求出错:", error); @@ -2675,15 +2512,12 @@ const handleUseDeepseekSemantics = async (searchText: string) => { } // const ids = await handleGetDeepseek(questionText); - // console.log("dsakjdhasidha", ids); }; // 监听对话框记录 watch( () => dialogueList, (newVal, oldVal) => { - console.log("new", newVal); - console.log("old", oldVal); // 当只有在巡检中 且检测到对话框列表发生变化时 进入 if (newVal && newVal.length > 0 && duringInspection.value) { let lastObj: any = dialogueList[dialogueList.length - 1]; @@ -2728,29 +2562,17 @@ defineExpose({
- + 商业智能助理小驿,为您服务:
-
- + }"> +
{{ item.text || "" }} @@ -2760,43 +2582,20 @@ defineExpose({ v-if="item.deepseekContent" v-html="item.deepseekContent" >
--> -
+
-
-
+
+
{{ item.label || "" }}
-
+
{{ inspectionIndex > 0 ? "继续巡检" : "服务区巡检" }}
-
+
{{ "暂停巡检" }}
@@ -2850,8 +2631,8 @@ defineExpose({ column.DicObj === "waringObj" ? descObjRef[Number(scope.row[column.prop])] : column.DicObj === "tradeObjRef" - ? tradeObjRef[Number(scope.row[column.prop])] - : "" + ? tradeObjRef[Number(scope.row[column.prop])] + : "" }}