|
|
|
@ -1,10 +1,17 @@ |
|
|
|
|
<template> |
|
|
|
|
<view class="detail"> |
|
|
|
|
<headerNavBar title="智能排查" :isBack="true"> |
|
|
|
|
<view class="Content BorderBox Width100"> |
|
|
|
|
<top-title :is-show-left="true" :title="'智能排查'" :rightWidth="40" class="custom_bg"> |
|
|
|
|
<template slot="right"> |
|
|
|
|
<image :src="$.imgurl + '/knowledge.png'" mode="" class="knowledge" @click="goToKnowledge"></image> |
|
|
|
|
</template> |
|
|
|
|
</top-title> |
|
|
|
|
</view> |
|
|
|
|
<!-- <headerNavBar title="智能排查" :isBack="true"> |
|
|
|
|
<template v-slot:right> |
|
|
|
|
<image :src="$.imgurl + '/knowledge.png'" mode="" class="knowledge" @click="goToKnowledge"></image> |
|
|
|
|
</template> |
|
|
|
|
</headerNavBar> |
|
|
|
|
</headerNavBar> --> |
|
|
|
|
<view class="stepBox"> |
|
|
|
|
<view class="step" v-for="(item, index) in tablist" :key="index"> |
|
|
|
|
<view class="stepItem"> |
|
|
|
@ -64,12 +71,13 @@ |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import AbortController from 'abort-controller/dist/abort-controller' |
|
|
|
|
|
|
|
|
|
import headerNavBar from '../../components/headerNavBar/headerNavBar.vue' |
|
|
|
|
import TopTitle from "../../components/top-title.vue"; |
|
|
|
|
// import headerNavBar from '../../components/headerNavBar/headerNavBar.vue' |
|
|
|
|
import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView.vue' |
|
|
|
|
// import { |
|
|
|
|
// EventSourcePolyfill |
|
|
|
|
// } from 'event-source-polyfill'; |
|
|
|
|
import $ from '../../common/globalJs/globalJs.js' |
|
|
|
|
import { |
|
|
|
|
fetchEventSource |
|
|
|
|
} from '@microsoft/fetch-event-source' |
|
|
|
@ -78,7 +86,10 @@ import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView |
|
|
|
|
// } from '../../utils/config.js'; |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
components: { headerNavBar,zeroMarkdownView }, |
|
|
|
|
components: { |
|
|
|
|
TopTitle, |
|
|
|
|
zeroMarkdownView |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
active: 0, |
|
|
|
@ -182,8 +193,7 @@ import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView |
|
|
|
|
}), |
|
|
|
|
signal: ctrl.signal, |
|
|
|
|
openWhenHidden: true, |
|
|
|
|
onopen:()=> { |
|
|
|
|
}, |
|
|
|
|
onopen: () => {}, |
|
|
|
|
onmessage: (ev) => { |
|
|
|
|
console.log(ev) |
|
|
|
|
this.loading = true |
|
|
|
@ -196,7 +206,10 @@ import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView |
|
|
|
|
this.active = this.tabkey - 1 > 0 ? this.tabkey - 1 : 0; |
|
|
|
|
} |
|
|
|
|
if (this.msgList.length == 0) { |
|
|
|
|
this.msgList = [{answerId,data:res.result.data.content}] |
|
|
|
|
this.msgList = [{ |
|
|
|
|
answerId, |
|
|
|
|
data: res.result.data.content |
|
|
|
|
}] |
|
|
|
|
} else { |
|
|
|
|
// debugger |
|
|
|
|
//回答 |
|
|
|
@ -206,7 +219,10 @@ import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
//最后一个是问题 |
|
|
|
|
this.msgList = [...this.msgList,{answerId:'1',data:res.result.data.content}] |
|
|
|
|
this.msgList = [...this.msgList, { |
|
|
|
|
answerId: '1', |
|
|
|
|
data: res.result.data.content |
|
|
|
|
}] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -239,7 +255,7 @@ import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView |
|
|
|
|
this.loading = true; |
|
|
|
|
const [err, res] = await uni.request({ |
|
|
|
|
// url: 'http://10.16.3.159:8777/api/local_doc_qa/local_doc_chat', |
|
|
|
|
url: 'http://219.147.31.25:30001/hitap/chat', |
|
|
|
|
url: $.chatUrl+'/chat', |
|
|
|
|
dataType: 'json', |
|
|
|
|
method: 'POST', |
|
|
|
|
// responseType: 'arraybuffer', |
|
|
|
@ -444,7 +460,8 @@ import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView |
|
|
|
|
|
|
|
|
|
.stepBox { |
|
|
|
|
width: 100%; |
|
|
|
|
height: 150rpx; |
|
|
|
|
// height: 150rpx; |
|
|
|
|
padding-top: 110rpx ; |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: center; |
|
|
|
|
align-items: center; |
|
|
|
|