From fde8e3bedaf5f883f38c3a0ec33d3c6a8748d1c9 Mon Sep 17 00:00:00 2001 From: suerprisePlus <15810472099@163.com> Date: 星期五, 21 六月 2024 18:02:44 +0800 Subject: [PATCH] wfs 范围查询 --- src/views/chartView/index.vue | 87 +++++++++++++++++++++++++++++++++++-------- 1 files changed, 70 insertions(+), 17 deletions(-) diff --git a/src/views/chartView/index.vue b/src/views/chartView/index.vue index 49426a3..5ccfc60 100644 --- a/src/views/chartView/index.vue +++ b/src/views/chartView/index.vue @@ -1,12 +1,7 @@ <template> <div class="chartBox"> <div class="ChartBox"> - <JwChat-index - :taleList="list" - @enter="bindEnter" - v-model="inputMsg" - :toolConfig="tool" - > + <JwChat-index :taleList="list" @enter="bindEnter" v-model="inputMsg" :toolConfig="tool"> </JwChat-index> </div> </div> @@ -17,8 +12,9 @@ import msgData from "../../assets/js/msg/msgData"; import store from "../../store"; import bus from "./../../assets/js/bus.js"; -import { getAIMessage } from "../../api/api.js"; +import { getAIMessage, getV1Fastgpt } from "../../api/api.js"; import mapInfo from "../../assets/js/map/mapInfo.js"; +import axios from "axios"; export default { name: "jwChat", @@ -70,13 +66,24 @@ } // this.setLoading(); setTimeout(() => { - // this.setMsgStart("鎮ㄥソ"); + this.setMsgStart("鎮ㄥソ"); }, config.loadTime); bus.$on("mapInfo", (res) => { if (res) { this.setMapInfo(res); } }); + bus.$on("setInsertMarkDown", (res) => { + if (res) { + this.setMarkDownInfo(res); + } + }); + // axios.get("http://192.168.11.89:12315/Markdown.md").then((response) => { + // if (response.status == 200) { + // console.log(response); + // this.setMarkDownInfo(response.data); + // } + // }); }, methods: { bindEnter() { @@ -89,16 +96,61 @@ }, 200); }, async setMsgStart(res) { - const data = await getAIMessage(res); - const message = data.order; - if (data.order.args && data.order.args.place) { - message = data.order.args.place; + + if (res == "涓夌淮瀹炴櫙") { + this.setV1Fastgpt(res) + } else { + const data = await getAIMessage(res); + if (data.status == 200) { + if (data.content) { + this.getMsg("ai", data.content); + } else { + this.getMsg("ai", ""); + } + if (data.name) { + this.$store.state.setScreenFlag = true; + this.$nextTick(() => { + setTimeout(() => { + mapInfo.init(data.name); + }, 1000); + }); + } + } } - this.getMsg("ai", message); - if (data.order.name) { - mapInfo.init(data.order.name); - } - + }, + async setV1Fastgpt(res) { + const data = await getV1Fastgpt(res); + const obj = data.split(/[\n]/) + const list_a = []; + obj.filter(item => { + if (item.indexOf("data: ") > -1) { + if (item.indexOf('nodeId') > -1) { + } else if(item.indexOf("content")>-1){ + const a = JSON.parse(item.split('data: ')) + console.log(a); + // if (a.choices[0].content) { + // console.log(a.choices[0].content); + // } + + + + } + + } + }) + // console.log(list_a) + // const a = val_data[0].split('data: '); + // const b = JSON.parse(a[1]); + // console.log(b) + // const c = b[1].historyPreview.length - 1; + // const d = b[1].historyPreview[c].value + // this.getMsg("ai", d); + }, + setMarkDownInfo(res) { + + var roleMsg = msgData.getRole("markDown", res); + this.list.push(roleMsg.msg); + // }, setMapInfo(res) { var msg = ""; @@ -210,6 +262,7 @@ line-height: 30px; border-bottom: 1px solid #c1c1c1; } + @keyframes siz { from { width: 0; -- Gitblit v1.9.3