main
zhangqun 11 months ago
parent 20f08606a5
commit 82c1507012
  1. 14
      pages.json
  2. 429
      pages/index/detail.vue
  3. 38
      pages/index/index.vue
  4. 8
      pages/investigation/index.vue
  5. 6
      pages/knowledge/index.vue
  6. 88
      pages/map/index.vue

@ -31,8 +31,8 @@
"style": { "style": {
"navigationBarTitleText": "排查选择", "navigationBarTitleText": "排查选择",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#FFFFFF", "navigationBarBackgroundColor": "#3567c1",
"navigationBarTextStyle": "black", "navigationBarTextStyle": "white",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
@ -40,9 +40,9 @@
"path": "pages/index/detail", "path": "pages/index/detail",
"style": { "style": {
"navigationBarTitleText": "智慧排查", "navigationBarTitleText": "智慧排查",
"navigationStyle": "custom", "navigationStyle": "default",
"navigationBarBackgroundColor": "#FFFFFF", "navigationBarBackgroundColor": "#3567c1",
"navigationBarTextStyle": "black", "navigationBarTextStyle": "white",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
@ -127,8 +127,8 @@
"style": { "style": {
"navigationBarTitleText": "知识库", "navigationBarTitleText": "知识库",
"navigationStyle": "default", "navigationStyle": "default",
"navigationBarBackgroundColor": "#F6F8FA", "navigationBarBackgroundColor": "#3567c1",
"navigationBarTextStyle": "black" "navigationBarTextStyle": "white"
} }
}, },
{ {

@ -1,12 +1,22 @@
<template> <template>
<view class="detail"> <view class="detail">
<view class="Content BorderBox Width100"> <!-- <view class="Content BorderBox Width100">
<top-title :is-show-left="true" :title="'智能排查'" :rightWidth="40" class="custom_bg"> <top-title
:is-show-left="true"
:title="'智能排查'"
:rightWidth="40"
class="custom_bg"
>
<template slot="right"> <template slot="right">
<image :src="$.imgurl + '/knowledge.png'" mode="" class="knowledge" @click="goToKnowledge"></image> <image
:src="$.imgurl + '/knowledge.png'"
mode=""
class="knowledge"
@click="goToKnowledge"
></image>
</template> </template>
</top-title> </top-title>
</view> </view> -->
<!-- <headerNavBar title="智能排查" :isBack="true"> <!-- <headerNavBar title="智能排查" :isBack="true">
<template v-slot:right> <template v-slot:right>
<image :src="$.imgurl + '/knowledge.png'" mode="" class="knowledge" @click="goToKnowledge"></image> <image :src="$.imgurl + '/knowledge.png'" mode="" class="knowledge" @click="goToKnowledge"></image>
@ -15,29 +25,60 @@
<view class="stepBox"> <view class="stepBox">
<view class="step" v-for="(item, index) in tablist" :key="index"> <view class="step" v-for="(item, index) in tablist" :key="index">
<view class="stepItem"> <view class="stepItem">
<view :class="{'stepCircleActive': index <= active, 'stepCircle': index > active}">{{ index + 1 }} <view
:class="{
stepCircleActive: index <= active,
stepCircle: index > active,
}"
>{{ index + 1 }}
</view> </view>
<view class="stepText" :style="{'color': index <= active ? '#000000' : '#bcc3cd'}">{{ item.title }} <view
class="stepText"
:style="{ color: index <= active ? '#000000' : '#bcc3cd' }"
>{{ item.title }}
</view> </view>
</view> </view>
<view v-if="index !== 3" class="circles"> <view v-if="index !== 3" class="circles">
<view :class="{'circleActive': index < active, 'circle': index >= active}" v-for="i in 8" :key="i"> <view
:class="{ circleActive: index < active, circle: index >= active }"
v-for="i in 8"
:key="i"
>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<scroll-view scroll-y="true" :scroll-top="scrollTop" <scroll-view
:style="{height: isExpanded ? 'calc(100% - 440rpx)' : 'calc(100% - 340rpx)'}" class="chatlist" scroll-y="true"
ref="scrollView" @click="clickContent"> :scroll-top="scrollTop"
:style="{
<view :class="['bar', item.answerId == '0' ? 'currAnswer' : '']" v-for="(item,index) in msgList" height: isExpanded ? 'calc(100% - 350rpx)' : 'calc(100% - 250rpx)',
:key="item.id"> }"
<image :src="item.answerId == '0' ? '/static/self.png' : '/static/left_user.png'" class="img" /> class="chatlist"
ref="scrollView"
@click="clickContent"
>
<view
:class="['bar', item.answerId == '0' ? 'currAnswer' : '']"
v-for="(item, index) in msgList"
:key="item.id"
>
<image
:src="
item.answerId == '0' ? '/static/self.png' : '/static/left_user.png'
"
class="img"
/>
<view class="content"> <view class="content">
<zeroMarkdownView :markdown="item.data" /> <zeroMarkdownView :markdown="item.data" />
<!-- <ua-markdown :source="mdvalue" /> --> <!-- <ua-markdown :source="mdvalue" /> -->
<view class="btnBox"> <view class="btnBox">
<view class="btn" @click="handleBtn(text)" v-for="(text,index) in item.options">{{text}}</view> <view
class="btn"
@click="handleBtn(text)"
v-for="(text, index) in item.options"
>{{ text }}</view
>
</view> </view>
</view> </view>
</view> </view>
@ -47,102 +88,105 @@
<view class="bounce-dot"></view> <view class="bounce-dot"></view>
</view> </view>
</scroll-view> </scroll-view>
<view class="input-wrapper" :class="{ 'input-wrapper-expanded': isExpanded }"> <view
class="input-wrapper"
:class="{ 'input-wrapper-expanded': isExpanded }"
>
<view class="topContent"> <view class="topContent">
<input class="uni-input" placeholder="请输入内容" :value="inputValue" @confirm="handleSend" <input
@input="onKeyInput" /> class="uni-input"
placeholder="请输入内容"
<uni-icons class="uni-icon" type="plus" size="30" @click="handlePlus"></uni-icons> :value="inputValue"
@confirm="handleSend"
@input="onKeyInput"
/>
<uni-icons
class="uni-icon"
type="plus"
size="30"
@click="handlePlus"
></uni-icons>
</view> </view>
<view v-if="isExpanded" class="expanded"> <view v-if="isExpanded" class="expanded">
<view @click="chooseImage" class="expandedItem"> <view @click="chooseImage" class="expandedItem">
<uni-icons class="camera-icon" type="image" size="28"></uni-icons> <uni-icons class="camera-icon" type="image" size="28"></uni-icons>
<view>照片</view> <view>照片</view>
</view> </view>
<view class="expandedItem" style="margin-top: 6px;"> <view class="expandedItem" style="margin-top: 6px">
<image src="../../static/video.png" class="video"></image> <image src="../../static/video.png" class="video"></image>
<view>视频</view> <view>视频</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import AbortController from 'abort-controller/dist/abort-controller' import AbortController from "abort-controller/dist/abort-controller";
import TopTitle from "../../components/top-title.vue"; import TopTitle from "../../components/top-title.vue";
// import headerNavBar from '../../components/headerNavBar/headerNavBar.vue' // import headerNavBar from '../../components/headerNavBar/headerNavBar.vue'
import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView.vue' import zeroMarkdownView from "../../components/zeroMarkdownView/zeroMarkdownView.vue";
// import { // import {
// EventSourcePolyfill // EventSourcePolyfill
// } from 'event-source-polyfill'; // } from 'event-source-polyfill';
import $ from '../../common/globalJs/globalJs.js' import $ from "../../common/globalJs/globalJs.js";
import { import { fetchEventSource } from "@microsoft/fetch-event-source";
fetchEventSource // import {
} from '@microsoft/fetch-event-source' // baseUrl
// import { // } from '../../utils/config.js';
// baseUrl
// } from '../../utils/config.js'; export default {
export default {
components: { components: {
TopTitle, TopTitle,
zeroMarkdownView zeroMarkdownView,
}, },
data() { data() {
return { return {
active: 0, active: 0,
tablist: [{ tablist: [
title: '信息确认' {
title: "信息确认",
}, },
{ {
title: '排查指引' title: "排查指引",
}, { },
title: '隐患补充' {
}, { title: "隐患补充",
title: '工单生成' },
} {
title: "工单生成",
},
], ],
inputValue: '', inputValue: "",
es: null, es: null,
msgList: [], msgList: [],
loading: true, loading: true,
streamLoading: true, streamLoading: true,
scrollTop: 0, scrollTop: 0,
title: '', title: "",
isExpanded: false, isExpanded: false,
sessionId: '', allContent: "",
id: '',
allContent: '',
params: {}, params: {},
tabkey: 0, tabkey: 0,
};
}
}, },
onLoad() { onLoad(options) {
let params = { let params = options;
sessionId: '12121212', this.params = params;
id: '12121212', let str = "";
roadName: '金水路与合川路'
}
this.params = params
this.sessionId = params.sessionId
this.id = params.id
let str = '';
if (params.roadName) { if (params.roadName) {
str += '路段名:' + params.roadName; str += "路段名:" + params.roadName;
this.title = params.roadName + '智能排查'; this.title = params.roadName + "智能排查";
} }
if (params.id) { if (params.id) {
str += ',id:' + params.id; //params.id str += ",id:" + params.id; //params.id
} }
console.log(params) console.log(params);
if (params.id == 12121212) { if (params.id == 12121212) {
this.queryChat("开始隐患排查," + str, ); this.queryChat("开始隐患排查," + str);
} else { } else {
this.SSE("开始隐患排查," + str, '1') this.SSE("开始隐患排查," + str, "1");
// if(this.msgListA.length==0){ // if(this.msgListA.length==0){
// this.SSE("," + str, '1') // this.SSE("," + str, '1')
// }else{ // }else{
@ -150,7 +194,6 @@
// this.scrollBottom(); // this.scrollBottom();
// } // }
} }
}, },
onUnload() { onUnload() {
if (this.es) { if (this.es) {
@ -169,74 +212,77 @@
// } // }
// }, // },
methods: { methods: {
// SSE // SSE
SSE(voiceText, answerId) { SSE(voiceText, answerId) {
const ctrl = new AbortController() const ctrl = new AbortController();
console.log(ctrl.signal) console.log(ctrl.signal);
fetchEventSource('http://219.147.31.25:30001/hitap/chat', { fetchEventSource($.chatUrl + "/chat", {
method: 'POST', method: "POST",
headers: { headers: {
'Content-Type': 'application/json', "Content-Type": "application/json",
Accept: ['text/event-stream', 'application/json'], Accept: ["text/event-stream", "application/json"],
}, },
body: JSON.stringify({ body: JSON.stringify({
voiceText, voiceText,
"sceneFlag": "", sceneFlag: "",
"sessionId": this.sessionId, sessionId: "",
"id": this.id, multiType: "",
"multiType": "", userId: this.params.userId,
"userId": "admin1", deptId: this.params.deptId,
"deptId": "3702000000", stream: true,
"type": 1, type: 1,
"stream": true, id: this.params.id,
taskId: this.params.taskId,
sectionId: this.params.sectionId,
sectionType: this.params.sectionType,
}), }),
signal: ctrl.signal, signal: ctrl.signal,
openWhenHidden: true, openWhenHidden: true,
onopen: () => {}, onopen: () => {},
onmessage: (ev) => { onmessage: (ev) => {
console.log(ev) console.log(ev);
this.loading = true this.loading = true;
const res = JSON.parse(ev.data); const res = JSON.parse(ev.data);
if (res?.code == 200 && res.result) { if (res?.code == 200 && res.result) {
console.log(res.result.data.tabkey); console.log(res.result.data.tabkey);
console.log(res.result.data); console.log(res.result.data);
this.tabkey = res.result.data.tabkey this.tabkey = res.result.data.tabkey;
if (this.tabkey - 1 != this.active) { if (this.tabkey - 1 != this.active) {
this.active = this.tabkey - 1 > 0 ? this.tabkey - 1 : 0; this.active = this.tabkey - 1 > 0 ? this.tabkey - 1 : 0;
} }
if (this.msgList.length == 0) { if (this.msgList.length == 0) {
this.msgList = [{ this.msgList = [
{
answerId, answerId,
data: res.result.data.content data: res.result.data.content,
}] },
];
} else { } else {
// debugger // 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 this.msgList[this.msgList.length - 1].data +=
res.result.data.content;
} else { } else {
// //
this.msgList = [...this.msgList, { this.msgList = [
answerId: '1', ...this.msgList,
data: res.result.data.content {
}] answerId: "1",
data: res.result.data.content,
},
];
} }
} }
// debugger // debugger
this.scrollBottom(); this.scrollBottom();
} }
}, },
onclose: () => { onclose: () => {
console.log(1111) console.log(1111);
this.loading = false; this.loading = false;
if (this.isExpanded) { if (this.isExpanded) {
@ -247,7 +293,7 @@
console.log("error", error); console.log("error", error);
throw error; throw error;
}, },
}) });
}, },
async queryChat(voiceText) { async queryChat(voiceText) {
@ -255,44 +301,44 @@
this.loading = true; this.loading = true;
const [err, res] = await uni.request({ const [err, res] = await uni.request({
// url: 'http://10.16.3.159:8777/api/local_doc_qa/local_doc_chat', // url: 'http://10.16.3.159:8777/api/local_doc_qa/local_doc_chat',
url: $.chatUrl+'/chat', url: $.chatUrl + "/chat",
dataType: 'json', dataType: "json",
method: 'POST', method: "POST",
// responseType: 'arraybuffer', // responseType: 'arraybuffer',
headers: { headers: {
// 'Accept': 'text/event-stream', // 'Accept': 'text/event-stream',
'content-type': 'application/json' "content-type": "application/json",
}, },
data: { data: {
voiceText, voiceText,
"sceneFlag": "", sceneFlag: "",
"sessionId": this.sessionId, sessionId: this.sessionId,
"id": this.id, id: this.id,
"multiType": "", multiType: "",
"userId": "admin1", userId: "admin1",
"deptId": "3702000000", deptId: "3702000000",
"type": 1, type: 1,
"stream": false, stream: false,
// "user_id": "zzp", // "user_id": "zzp",
// "kb_ids": ["KBa80ea15e786241eca70a20f136f4e34c"], // "kb_ids": ["KBa80ea15e786241eca70a20f136f4e34c"],
// "question": "", // "question": "",
// "streaming": true, // "streaming": true,
// "history": [] // "history": []
} },
}); });
if (res && res.data && res.data.code == 200) { if (res && res.data && res.data.code == 200) {
// console.log('request success', res.data) // console.log('request success', res.data)
const { const { result = {} } = res.data;
result = {} const { data = {} } = result;
} = res.data;
const {
data = {}
} = result;
if (data.tabkey - 1 != this.active) { if (data.tabkey - 1 != this.active) {
this.active = data.tabkey - 1 > 0 ? data.tabkey - 1 : 0; this.active = data.tabkey - 1 > 0 ? data.tabkey - 1 : 0;
} }
if (data.content) { if (data.content) {
this.changeMsgList(data.answerId || '1', data.content, data.answerOptions); this.changeMsgList(
data.answerId || "1",
data.content,
data.answerOptions
);
} }
this.loading = false; this.loading = false;
if (this.isExpanded) { if (this.isExpanded) {
@ -300,23 +346,23 @@
} }
} else { } else {
if (err) { if (err) {
console.log('request fail', err.errMsg); console.log("request fail", err.errMsg);
} }
uni.showToast({ uni.showToast({
title: "查询失败", title: "查询失败",
icon: "error", icon: "error",
duration: 2000 duration: 2000,
}) });
} }
}, },
// //
onKeyInput(event) { onKeyInput(event) {
this.inputValue = event.detail.value this.inputValue = event.detail.value;
}, },
addQuestion(q, answerId) { addQuestion(q, answerId) {
const newQuestion = { const newQuestion = {
answerId, answerId,
data: q data: q,
}; };
this.msgList.push(newQuestion); // this.msgList.push(newQuestion); //
// this.$store.commit('setMSg_List', this.msgList); // this.$store.commit('setMSg_List', this.msgList);
@ -324,10 +370,14 @@
}, },
scrollBottom() { scrollBottom() {
this.$nextTick(() => { this.$nextTick(() => {
const height = this.$refs.scrollView && this.$refs.scrollView.$refs && this.$refs const height =
.scrollView.$refs.content ? this.$refs.scrollView.$refs.content.scrollHeight : 0; this.$refs.scrollView &&
this.$refs.scrollView.$refs &&
this.$refs.scrollView.$refs.content
? this.$refs.scrollView.$refs.content.scrollHeight
: 0;
this.scrollTop = height; this.scrollTop = height;
}) });
}, },
// //
handleSend(text) { handleSend(text) {
@ -335,21 +385,20 @@
uni.showToast({ uni.showToast({
title: "请输入内容", title: "请输入内容",
icon: "closeempty", icon: "closeempty",
duration: 2000 duration: 2000,
}) });
} }
if (text || this.inputValue) { if (text || this.inputValue) {
if (this.params.id == 12121212) { if (this.params.id == 12121212) {
this.changeMsgList('0', this.inputValue || text); this.changeMsgList("0", this.inputValue || text);
this.queryChat(this.inputValue || text); this.queryChat(this.inputValue || text);
this.scrollBottom() this.scrollBottom();
} else { } else {
this.addQuestion(this.inputValue || text, '0') this.addQuestion(this.inputValue || text, "0");
this.SSE(this.inputValue || text, '0'); this.SSE(this.inputValue || text, "0");
} }
this.inputValue = ''; this.inputValue = "";
} }
}, },
// //
changeMsgList(answerId, data, answerOptions) { changeMsgList(answerId, data, answerOptions) {
@ -357,45 +406,59 @@
if (this.msgList.length > 0) { if (this.msgList.length > 0) {
id = this.msgList[this.msgList.length - 1].id + 1; id = this.msgList[this.msgList.length - 1].id + 1;
} }
if (answerId == '1') { // if (answerId == "1") {
let newdata = ''; //
let newdata = "";
let index = 0; let index = 0;
const timer = setInterval(() => { const timer = setInterval(() => {
console.log(this.msgList); console.log(this.msgList);
newdata = newdata += data[index] newdata = newdata += data[index];
if (this.msgList?.filter(item => (item.id == id)).length == 0) { if (this.msgList?.filter((item) => item.id == id).length == 0) {
this.msgList = [...this.msgList, { this.msgList = [
...this.msgList,
{
id, id,
answerId, answerId,
data: newdata, data: newdata,
// options: answerOptions // ['西','','','西'] answerOptions // options: answerOptions // ['西','','','西'] answerOptions
}]; },
];
} else { } else {
this.msgList[this.msgList.length - 1].data = newdata; this.msgList[this.msgList.length - 1].data = newdata;
} }
index += 1; index += 1;
this.$nextTick(() => { this.$nextTick(() => {
const height = this.$refs.scrollView && this.$refs.scrollView.$refs && this const height =
.$refs.scrollView.$refs.content ? this.$refs.scrollView.$refs.content this.$refs.scrollView &&
.scrollHeight : 0; this.$refs.scrollView.$refs &&
this.$refs.scrollView.$refs.content
? this.$refs.scrollView.$refs.content.scrollHeight
: 0;
this.scrollTop = height; this.scrollTop = height;
}) });
if (newdata == data) { if (newdata == data) {
this.msgList[this.msgList.length - 1].options = answerOptions; this.msgList[this.msgList.length - 1].options = answerOptions;
clearInterval(timer); clearInterval(timer);
} }
}, 50) }, 50);
} else { } else {
this.msgList = [...this.msgList, { this.msgList = [
...this.msgList,
{
id, id,
answerId, answerId,
data, data,
}]; },
];
this.$nextTick(() => { this.$nextTick(() => {
const height = this.$refs.scrollView && this.$refs.scrollView.$refs && this.$refs const height =
.scrollView.$refs.content ? this.$refs.scrollView.$refs.content.scrollHeight : 0; this.$refs.scrollView &&
this.$refs.scrollView.$refs &&
this.$refs.scrollView.$refs.content
? this.$refs.scrollView.$refs.content.scrollHeight
: 0;
this.scrollTop = height; this.scrollTop = height;
}) });
} }
}, },
@ -404,8 +467,7 @@
}, },
// //
handleBtn(text) { handleBtn(text) {
this.handleSend(text);
this.handleSend(text)
}, },
clickContent() { clickContent() {
if (this.isExpanded) { if (this.isExpanded) {
@ -414,40 +476,40 @@
}, },
goToKnowledge() { goToKnowledge() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/home/knowledge' url: "/pages/home/knowledge",
// url: `/pages/home/knowledge?params=${encodeURIComponent(JSON.stringify(this.$route.query.params))}` // url: `/pages/home/knowledge?params=${encodeURIComponent(JSON.stringify(this.$route.query.params))}`
}) });
}, },
// //
chooseImage() { chooseImage() {
uni.chooseImage({ uni.chooseImage({
count: 6, //9 count: 6, //9
sizeType: ['original', 'compressed'], // sizeType: ["original", "compressed"], //
sourceType: ['album'], // sourceType: ["album"], //
success: (res) => { success: (res) => {
if (res.tempFilePaths && res.tempFilePaths.length) { if (res.tempFilePaths && res.tempFilePaths.length) {
let str = ''; let str = "";
for (let i = 0; i < res.tempFilePaths.length; i++) { for (let i = 0; i < res.tempFilePaths.length; i++) {
str += `![图${i + 1}](${res.tempFilePaths[i]})`; str += `![图${i + 1}](${res.tempFilePaths[i]})`;
} }
if (this.id == 12121212) { if (this.id == 12121212) {
this.changeMsgList('0', str); this.changeMsgList("0", str);
this.queryChat(res.tempFilePaths); this.queryChat(res.tempFilePaths);
} else { } else {
this.addQuestion(str, '0') this.addQuestion(str, "0");
this.SSE(res.tempFilePaths, '0'); this.SSE(res.tempFilePaths, "0");
}
} }
} }
},
}); });
} },
} },
} };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.detail { .detail {
width: 100%; width: 100%;
margin: auto; margin: auto;
height: 100vh; height: 100vh;
@ -461,7 +523,7 @@
.stepBox { .stepBox {
width: 100%; width: 100%;
// height: 150rpx; // height: 150rpx;
padding-top: 110rpx ; margin-top: 10rpx;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -526,13 +588,12 @@
color: #bcc3cd; color: #bcc3cd;
} }
} }
} }
.chatlist { .chatlist {
width: 96%; width: 96%;
margin: auto; margin: auto;
height: calc(100% - 340rpx); // height: calc(100% - 340rpx);
background-color: #f0f2f7; background-color: #f0f2f7;
.bar { .bar {
@ -573,7 +634,7 @@
background-color: #ffffff; background-color: #ffffff;
._img { ._img {
max-width: 80% max-width: 80%;
} }
} }
@ -584,7 +645,6 @@
background-color: #cce0ff; background-color: #cce0ff;
} }
} }
} }
} }
@ -594,7 +654,7 @@
margin: 20rpx auto 0 auto; margin: 20rpx auto 0 auto;
height: 80rpx; height: 80rpx;
flex-direction: column; flex-direction: column;
background-color: #FFFFFF; background-color: #ffffff;
box-sizing: border-box; box-sizing: border-box;
border-top: 1px solid #e2e4e9; border-top: 1px solid #e2e4e9;
bottom: 1px solid #e2e4e9; bottom: 1px solid #e2e4e9;
@ -618,20 +678,18 @@
justify-content: space-between; justify-content: space-between;
.camera-icon { .camera-icon {
margin-top: 5px margin-top: 5px;
} }
} }
.video { .video {
width: 60rpx; width: 60rpx;
height: 60rpx; height: 60rpx;
} }
} }
} }
.input-wrapper-expanded { .input-wrapper-expanded {
height: 200rpx; height: 200rpx;
} }
@ -678,10 +736,9 @@
} }
} }
} }
} }
@keyframes bounce {
@keyframes bounce {
0%, 0%,
80%, 80%,
100% { 100% {
@ -691,5 +748,5 @@
40% { 40% {
transform: scale(1); transform: scale(1);
} }
} }
</style> </style>

@ -1,12 +1,16 @@
<template> <template>
<view id="page"> <view id="page">
<view style="
position: sticky;
top: 0;
z-index: 999;">
<view class="header Box"> <view class="header Box">
<view class="title">道路交通安全隐患</view> <view class="title">道路交通安全隐患</view>
<view class="title">排查助手</view> <view class="title">排查助手</view>
<view class="desc">洞察隐患 智能守护 科技之眼照亮安全之路</view> <view class="desc">洞察隐患 智能守护 科技之眼照亮安全之路</view>
<view class="total Flex Flex_C_S-B PositionR"> <view class="total Flex Flex_C_S-B PositionR">
<view class="left Flex"> <view class="left Flex">
<view class="info" @click="jump"> <view class="info" @click="jump(1)">
<view class="name">待办</view> <view class="name">待办</view>
<view class="number">{{ totalData.UnderInvestigation }}</view> <view class="number">{{ totalData.UnderInvestigation }}</view>
</view> </view>
@ -29,7 +33,7 @@
<text class="name">本月上报</text> <text class="name">本月上报</text>
<text class="number">{{ totalData.MonthReport }}</text> <text class="number">{{ totalData.MonthReport }}</text>
</view> </view>
<view class="finish Flex Flex_C_S-B blur"> <view class="finish Flex Flex_C_S-B blur" @click="jump(2)">
<image style="width: 80rpx" mode="widthFix" :src="$.imgSrc + '/finish.png'" class="video"> <image style="width: 80rpx" mode="widthFix" :src="$.imgSrc + '/finish.png'" class="video">
</image> </image>
<text class="name">已完成</text> <text class="name">已完成</text>
@ -48,6 +52,7 @@
</view> </view>
</view> </view>
</view> </view>
</view>
<view class="Width100 Box BorderBox"> <view class="Width100 Box BorderBox">
<view class="list_title">待办任务</view> <view class="list_title">待办任务</view>
<view class="Content MarginAuto BorderBox"> <view class="Content MarginAuto BorderBox">
@ -107,7 +112,13 @@
}, },
// //
onLoad(e) { onLoad(e) {
// this.getData()
// this.getList()
},
onShow(e) {
this.getData() this.getData()
this.list = []
this.page = 1
this.getList() this.getList()
}, },
// //
@ -157,7 +168,7 @@
}, },
handleClick(row) { handleClick(row) {
console.log(row) console.log(row)
this.$.open('/pages/map/index?businessId=' + row.businessId) this.$.open('/pages/map/index?businessId=' + row.businessId + '&sectionId='+row.sectionCode + '&deptId=' +row.deptId + '&taskName=' + row.name)
}, },
konw() { konw() {
this.$.open('/pages/knowledge/index') this.$.open('/pages/knowledge/index')
@ -166,8 +177,14 @@
skipPage(even) { skipPage(even) {
// this.$.open(even) // this.$.open(even)
}, },
jump() { jump(v) {
this.$.setData('pageStatus','1') if(v == 1) {
this.$.setData('pageStatus',1)
}
if(v == 2) {
this.$.setData('pageStatus',3)
}
this.$.openTab('/pages/investigation/index') this.$.openTab('/pages/investigation/index')
} }
}, },
@ -206,7 +223,6 @@
height: 500rpx; height: 500rpx;
color: #FFFFFF; color: #FFFFFF;
padding: calc(var(--status-bar-height) + 40rpx) 20rpx 20rpx; padding: calc(var(--status-bar-height) + 40rpx) 20rpx 20rpx;
.title { .title {
font-family: Tensentype MeiHeiJ, Tensentype MeiHeiJ; font-family: Tensentype MeiHeiJ, Tensentype MeiHeiJ;
font-weight: bold; font-weight: bold;
@ -346,10 +362,14 @@
.list_title { .list_title {
font-size: 20px; font-size: 20px;
background: linear-gradient(180deg, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%); // background: linear-gradient(180deg, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%);
border-radius: 24px 24px 0px 0px; background: #f8fafb;
// border-radius: 24px 24px 0px 0px;
padding: 20rpx 30rpx 0; padding: 20rpx 30rpx 0;
font-family: Source Han Sans CN, Source Han Sans CN; font-family: Source Han Sans CN, Source Han Sans CN;
position: sticky;
top: 418px;
z-index: 99;
} }
.Box { .Box {
@ -411,7 +431,7 @@
background-size: 100% 100%; background-size: 100% 100%;
display: flex; display: flex;
align-items: center; align-items: center;
background: #f8fafb;
.bg { .bg {
position: absolute; position: absolute;
top: 0; top: 0;

@ -89,12 +89,18 @@
this.getList() this.getList()
}, },
onShow: function() { onShow() {
this.getData() this.getData()
let pageStatus = this.$.getData('pageStatus') let pageStatus = this.$.getData('pageStatus')
console.log(pageStatus)
if(pageStatus == 1){ if(pageStatus == 1){
this.handleTabClick(1) this.handleTabClick(1)
this.$.setData('pageStatus','0') this.$.setData('pageStatus','0')
} else if(pageStatus == 3) {
this.handleTabClick(3)
this.$.setData('pageStatus','0')
} else {
this.handleTabClick(1)
} }
}, },
// //

@ -105,8 +105,8 @@ import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView
// params = JSON.parse(decodeURIComponent(this.$route.query.params)) // params = JSON.parse(decodeURIComponent(this.$route.query.params))
// this.sessionId = params.sessionId // this.sessionId = params.sessionId
// this.id = '37020017407' // this.id = '37020017407'
this.sessionId = '12121212' this.sessionId = '37020000000'
this.id = '12121212' this.id = '37020017407'
// console.log(params.roadName,"5555"); // console.log(params.roadName,"5555");
let str = ''; let str = '';
if (params.roadName) { if (params.roadName) {
@ -129,7 +129,7 @@ import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView
this.loading = true; this.loading = true;
const [err, res] = await uni.request({ const [err, res] = await uni.request({
// url: 'http://10.16.3.159:8777/api/local_doc_qa/local_doc_chat', // url: 'http://10.16.3.159:8777/api/local_doc_qa/local_doc_chat',
url: 'http://219.147.31.25:30001/hitap/chat', url: this.$.chatUrl+'/chat',
dataType: 'json', dataType: 'json',
method: 'POST', method: 'POST',
// responseType: 'arraybuffer', // responseType: 'arraybuffer',

@ -20,7 +20,12 @@
<view class="status" v-if="pageType1Result.deadlineType == 2">延期</view> <view class="status" v-if="pageType1Result.deadlineType == 2">延期</view>
<!-- <view class="status" v-if="pageType1Result.deadlineType == 3">正常</view> --> <!-- <view class="status" v-if="pageType1Result.deadlineType == 3">正常</view> -->
<view class="top"> <view class="top">
<image src="/static/logo.png" mode="" style="width: 120px;height: 90px;" class="mimg"></image> <image
src="/static/logo.png"
mode=""
style="width: 120px; height: 90px"
class="mimg"
></image>
<view class="font"> <view class="font">
<view class="tit">{{ pageType1Result.name }}</view> <view class="tit">{{ pageType1Result.name }}</view>
<view class="desc"> <view class="desc">
@ -104,7 +109,7 @@
/> />
</view> </view>
</view> </view>
<view class="form-item" v-if="ftype==1"> <view class="form-item" v-if="ftype == 1">
<view class="form-label">起始路口</view> <view class="form-label">起始路口</view>
<view class="form-tent"> <view class="form-tent">
<input <input
@ -115,7 +120,7 @@
/> />
</view> </view>
</view> </view>
<view class="form-item" v-if="ftype==1"> <view class="form-item" v-if="ftype == 1">
<view class="form-label">终止路口</view> <view class="form-label">终止路口</view>
<view class="form-tent"> <view class="form-tent">
<input <input
@ -126,7 +131,7 @@
/> />
</view> </view>
</view> </view>
<view class="form-item" v-if="ftype==2"> <view class="form-item" v-if="ftype == 2">
<view class="form-label">路口名称</view> <view class="form-label">路口名称</view>
<view class="form-tent"> <view class="form-tent">
<input <input
@ -137,19 +142,30 @@
/> />
</view> </view>
</view> </view>
<view class="btn-box" :style="ftype == 1 ? 'margin-top: 18px' : 'margin-top: 80px'"> <view
class="btn-box"
:style="ftype == 1 ? 'margin-top: 18px' : 'margin-top: 80px'"
>
<view @click="onJump(3)" class="btn btn6"> 取消 </view> <view @click="onJump(3)" class="btn btn6"> 取消 </view>
<view @click="handleSubmit" class="btn btn7"> 确定 </view> <view @click="handleSubmit" class="btn btn7"> 确定 </view>
</view> </view>
</view> </view>
<u-modal :show="show" content="新增成功" confirm-text="人工排查" cancel-text="智能排查" :showConfirmButton='true' <u-modal
:showCancelButton='true' @confirm="handleCheck(2)" @cancel="handleCheck(1)" :show="show"
:closeOnClickOverlay="false"></u-modal> content="新增成功"
confirm-text="人工排查"
cancel-text="智能排查"
:showConfirmButton="true"
:showCancelButton="true"
@confirm="handleCheck(2)"
@cancel="handleCheck(1)"
:closeOnClickOverlay="false"
></u-modal>
</view> </view>
</template> </template>
<script> <script>
import TopTitle from "../../components/top-title.vue"; import TopTitle from "../../components/top-title.vue";
import {wgs84LL2gcjLL2} from './c.js'; import { wgs84LL2gcjLL2 } from "./c.js";
export default { export default {
components: { TopTitle }, components: { TopTitle },
data() { data() {
@ -166,11 +182,14 @@ export default {
max: 0, max: 0,
polyline: [], polyline: [],
pageType: 1, pageType: 1,
ftype: '1', ftype: "1",
faddress: "", faddress: "",
fcoordinate: "", fcoordinate: "",
businessId: "", businessId: "",
pageType1Result: null, pageType1Result: {
deadlineType: 3,
},
pageType2Result: null,
rname: "", rname: "",
search: "", search: "",
name1: "", name1: "",
@ -321,6 +340,7 @@ export default {
console.log(res); console.log(res);
if (res.code === 200) { if (res.code === 200) {
this.data = res.result; this.data = res.result;
this.pageType2Result = this.data[0]
this.rname = this.data[0].name; this.rname = this.data[0].name;
this.polyline = [ this.polyline = [
{ {
@ -352,14 +372,43 @@ export default {
// this.data = this.data.concat(data); // this.data = this.data.concat(data);
}, },
handleCheck(v) { handleCheck(v) {
this.show = false this.show = false;
let url = v == 1 ? "/pages/index/detail" : "/pages/investigation/task"; if (v == 1) {
this.$.open(url + "?id=" + this.businessId); let json = this.pageType == 1 ? this.pageType1Result : this.pageType2Result;
// let json = {
// name: "023",
// operator: "admin1",
// deptId: "3702000000",
// sectionCode: "37020017609",
// businessId: "000001",
// pointType: '1'
// };
this.$.open(
"/pages/index/detail?taskId=" +
json.businessId +
"&id=" +
json.sectionCode +
"&sectionId=" +
json.sectionCode +
"&roadName=" +
json.name +
"&userId=" +
json.operator +
"&deptId=" +
json.deptId +
"&sectionType=" +
json.pointType
);
}
if (v == 2) {
this.$.open("/pages/investigation/task" + "?id=" + this.businessId);
}
// this.$.open(url + "?id=" + 'RX202310210236'); // this.$.open(url + "?id=" + 'RX202310210236');
}, },
handleSubmit() { handleSubmit() {
let address = '' let address = "";
if(this.ftype == 1) { if (this.ftype == 1) {
address = `${this.name1}${this.name2}-${this.name3}`; address = `${this.name1}${this.name2}-${this.name3}`;
} else { } else {
address = `${this.name1}${this.name4}`; address = `${this.name1}${this.name4}`;
@ -401,6 +450,7 @@ export default {
onList(e, i) { onList(e, i) {
this.pageType = 2; this.pageType = 2;
this.idx = i; this.idx = i;
this.pageType2Result = e
if (e && e.name && e.position) { if (e && e.name && e.position) {
this.rname = e.name; this.rname = e.name;
this.polyline = [ this.polyline = [
@ -432,13 +482,13 @@ export default {
}, },
// //
getLocationInfo() { getLocationInfo() {
console.log('getLocationInfo') console.log("getLocationInfo");
uni.getLocation({ uni.getLocation({
type: "wgs84", type: "wgs84",
success: (res) => { success: (res) => {
console.log(res); console.log(res);
const coord = wgs84LL2gcjLL2(res.longitude, res.latitude) const coord = wgs84LL2gcjLL2(res.longitude, res.latitude);
console.log(coord) console.log(coord);
this.longitude = coord[0]; //118.787575; this.longitude = coord[0]; //118.787575;
this.latitude = coord[1]; //32.05024; this.latitude = coord[1]; //32.05024;
// this.longitude = 120.38771; // this.longitude = 120.38771;

Loading…
Cancel
Save