重点排查样式处理

main
limingtao 11 months ago
parent c579033f6a
commit ac28004c90
  1. 123
      pages/index/detail.vue
  2. 2452
      pages/investigation/task.vue

@ -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">
@ -63,13 +70,14 @@
</template>
<script>
import AbortController from 'abort-controller/dist/abort-controller'
import headerNavBar from '../../components/headerNavBar/headerNavBar.vue'
import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView.vue'
import AbortController from 'abort-controller/dist/abort-controller'
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,
@ -105,16 +116,16 @@ import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView
id: '',
allContent: '',
params: {},
tabkey:0,
tabkey: 0,
}
},
onLoad() {
let params = {
sessionId:'12121212',
id:'12121212',
roadName:'金水路与合川路'
sessionId: '12121212',
id: '12121212',
roadName: '金水路与合川路'
}
this.params = params
this.sessionId = params.sessionId
@ -146,17 +157,17 @@ import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView
this.es.close();
this.es = null;
}
},
// computed: {
// msgListA: {
// get() {
// return this.$store.state.msgList;
// },
// set(value) {
// this.$store.commit('setMSg_List', value);
// }
// }
// },
},
// computed: {
// msgListA: {
// get() {
// return this.$store.state.msgList;
// },
// set(value) {
// this.$store.commit('setMSg_List', value);
// }
// }
// },
methods: {
// SSE
@ -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
@ -191,30 +201,36 @@ import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView
if (res?.code == 200 && res.result) {
console.log(res.result.data.tabkey);
console.log(res.result.data);
this.tabkey = res.result.data.tabkey
if (this.tabkey - 1 != this.active) {
this.active = this.tabkey - 1 > 0 ? this.tabkey - 1 : 0;
}
if(this.msgList.length==0){
this.msgList = [{answerId,data:res.result.data.content}]
} else{
this.tabkey = res.result.data.tabkey
if (this.tabkey - 1 != this.active) {
this.active = this.tabkey - 1 > 0 ? this.tabkey - 1 : 0;
}
if (this.msgList.length == 0) {
this.msgList = [{
answerId,
data: res.result.data.content
}]
} else {
// debugger
//
if(this.msgList[this.msgList.length-1].answerId=='1'){
if (this.msgList[this.msgList.length - 1].answerId == '1') {
//
this.msgList[this.msgList.length-1].data +=res.result.data.content
}else{
//
this.msgList = [...this.msgList,{answerId:'1',data:res.result.data.content}]
this.msgList[this.msgList.length - 1].data += res.result.data.content
} else {
//
this.msgList = [...this.msgList, {
answerId: '1',
data: res.result.data.content
}]
}
}
// debugger
// debugger
this.scrollBottom();
this.scrollBottom();
}
@ -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',
@ -297,11 +313,11 @@ import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView
onKeyInput(event) {
this.inputValue = event.detail.value
},
addQuestion(q,answerId) {
addQuestion(q, answerId) {
const newQuestion = {
answerId,
data:q
};
answerId,
data: q
};
this.msgList.push(newQuestion); //
// this.$store.commit('setMSg_List', this.msgList);
this.scrollBottom();
@ -324,11 +340,11 @@ import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView
}
if (text || this.inputValue) {
if (this.params.id == 12121212) {
this.changeMsgList('0', this.inputValue||text);
this.changeMsgList('0', this.inputValue || text);
this.queryChat(this.inputValue || text);
this.scrollBottom()
this.scrollBottom()
} else {
this.addQuestion(this.inputValue || text,'0')
this.addQuestion(this.inputValue || text, '0')
this.SSE(this.inputValue || text, '0');
}
this.inputValue = '';
@ -336,7 +352,7 @@ import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView
},
//
changeMsgList(answerId, data,answerOptions) {
changeMsgList(answerId, data, answerOptions) {
let id = 1;
if (this.msgList.length > 0) {
id = this.msgList[this.msgList.length - 1].id + 1;
@ -365,7 +381,7 @@ import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView
this.scrollTop = height;
})
if (newdata == data) {
this.msgList[this.msgList.length - 1].options = answerOptions;
this.msgList[this.msgList.length - 1].options = answerOptions;
clearInterval(timer);
}
}, 50)
@ -415,11 +431,11 @@ import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView
str += `![图${i + 1}](${res.tempFilePaths[i]})`;
}
if(this.id == 12121212){
if (this.id == 12121212) {
this.changeMsgList('0', str);
this.queryChat(res.tempFilePaths);
}else{
this.addQuestion(str,'0')
} else {
this.addQuestion(str, '0')
this.SSE(res.tempFilePaths, '0');
}
}
@ -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;

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save