zhangqun 11 months ago
commit a754c9b8b1
  1. 287
      common/globalJs/globalJs.js
  2. 8
      manifest.json
  3. 77
      pages/index/detail.vue
  4. 4
      pages/investigation/components/investigation-item.vue
  5. 4
      pages/investigation/components/investigation-item2.vue
  6. 762
      pages/investigation/task.vue

@ -2,9 +2,11 @@
// #ifdef APP-PLUS || MP
// const baseUrl = "http://116.62.210.143:9002";
const baseUrl = "http://118.89.79.160:8800/HiatmpPro";
const chatUrl = "http://118.89.79.160:8800/HiatmpPro";
// #endif
// #ifdef H5
const baseUrl = "/HiatmpPro";
const chatUrl = "/hitapChat";
// #endif
// 图片路径的公用部分
@ -34,15 +36,15 @@ module.exports = {
// 视频name值
fileVideoKey,
baseUrl,
chatUrl,
// ----------------------校验----------------------
// 处理时间两位数
timeDealTwo(value){
timeDealTwo(value) {
let val = Number(value)
return val < 10 ? '0' + val : val
},
// 判断两个对象是否相同
isObjEqual (o1, o2) {
isObjEqual(o1, o2) {
var props1 = Object.getOwnPropertyNames(o1)
var props2 = Object.getOwnPropertyNames(o2)
if (props1.indexOf('__ob__') !== -1) {
@ -66,20 +68,20 @@ module.exports = {
}
return a && b
},
checkHasKey(key,str){
if(str.indexOf(key) != -1){
checkHasKey(key, str) {
if (str.indexOf(key) != -1) {
return true
}
return false
},
// 非空验证(包含数字)
isEmpty(value,isnumber = false){
if(isnumber){
if(value <= 0){
isEmpty(value, isnumber = false) {
if (isnumber) {
if (value <= 0) {
return false
}
}
if(value == '' || value == null || typeof(value) == 'undefined'){
if (value == '' || value == null || typeof(value) == 'undefined') {
return false
}
return true
@ -182,14 +184,14 @@ module.exports = {
};
},
// 处理时间
dealTimeLength(value){
dealTimeLength(value) {
let num = Number(value)
let str = num < 10 ? '0' + num : num
// let str = value.toString()
return str
},
// 是否是正整数
isNum(num){
isNum(num) {
if (!(/(^[1-9]\d*$)/.test(num))) {
return false;
}
@ -198,7 +200,7 @@ module.exports = {
// 是否有小数点
isDot(num) {
var result = (num.toString()).indexOf(".");
if(result != -1) {
if (result != -1) {
return false
alert("含有小数点");
}
@ -206,25 +208,25 @@ module.exports = {
},
// ----------------------原生----------------------
setNavName(value){
setNavName(value) {
uni.setNavigationBarTitle({
title:value
title: value
})
},
// 查看文件
checkFile(url){
checkFile(url) {
uni.showLoading({
mask: true,
});
uni.downloadFile({
url: url, //仅为示例,并非真实的资源
success: function(res){
success: function(res) {
if (res.statusCode === 200) {
uni.hideLoading();
var filePath = res.tempFilePath;
uni.openDocument({
filePath: filePath,
success: function (res) {
success: function(res) {
console.log("打开文档成功");
},
});
@ -233,10 +235,10 @@ module.exports = {
});
},
// 扫一扫
scanCode(callback){
scanCode(callback) {
uni.scanCode({
scanType: ['barCode','qrCode'],
success (res) {
scanType: ['barCode', 'qrCode'],
success(res) {
callback(res)
}
});
@ -344,7 +346,7 @@ module.exports = {
uni.switchTab({
url: '/pages/index/index'
})
}else{
} else {
this.$router.go(-1)
}
return;
@ -390,10 +392,10 @@ module.exports = {
uni.clearStorage();
},
// 设置底部导航
setBar(index,text){
setBar(index, text) {
uni.setTabBarItem({
index:index,
text:text
index: index,
text: text
})
},
// 打开地图选择地址
@ -421,7 +423,7 @@ module.exports = {
})
},
// 复制
copy(text,toasttext = '复制成功') {
copy(text, toasttext = '复制成功') {
// #ifdef APP-PLUS
uni.setClipboardData({
data: text,
@ -463,47 +465,83 @@ module.exports = {
// ----------------------自封方法----------------------
// 获取分发类型
getTypeFenFa(){
return [
{type:1,label:'代表发文'},
{type:2,label:'收文'},
{type:3,label:'呈报事项'},
{type:4,label:'纪检发文'},
{type:5,label:'会议通知'},
{type:6,label:'重大事项通知'},
{type:7,label:'议案分发提议人'},
{type:8,label:'公文流转'},
getTypeFenFa() {
return [{
type: 1,
label: '代表发文'
},
{
type: 2,
label: '收文'
},
{
type: 3,
label: '呈报事项'
},
{
type: 4,
label: '纪检发文'
},
{
type: 5,
label: '会议通知'
},
{
type: 6,
label: '重大事项通知'
},
{
type: 7,
label: '议案分发提议人'
},
{
type: 8,
label: '公文流转'
},
]
},
// 获取员工类型
getPersonType(){
return [
{type:1,label:'集团领导'},
{type:2,label:'中层领导'},
{type:3,label:'普通员工'},
getPersonType() {
return [{
type: 1,
label: '集团领导'
},
{
type: 2,
label: '中层领导'
},
{
type: 3,
label: '普通员工'
},
]
},
// 获取书记类型
getTypeSJ(){
return [
{type:1,label:'党委书记'},
{type:2,label:'党委副书记'}
getTypeSJ() {
return [{
type: 1,
label: '党委书记'
},
{
type: 2,
label: '党委副书记'
}
]
},
// 获取当前时间-年月日
getNowTimeYMD(){
getNowTimeYMD() {
let date = new Date(),
year = date.getFullYear(),
month = (date.getMonth()+1) < 10 ? '0' + (date.getMonth()+1) : date.getMonth()+1,
month = (date.getMonth() + 1) < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1,
day = (date.getDate()) < 10 ? '0' + (date.getDate()) : date.getDate(),
days = year + '-' + month + '-' + day
return days
},
// 获取当前时间-年月日时分
getNowTimeYMDHM(){
getNowTimeYMDHM() {
let date = new Date(),
year = date.getFullYear(),
month = (date.getMonth()+1) < 10 ? '0' + (date.getMonth()+1) : date.getMonth()+1,
month = (date.getMonth() + 1) < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1,
day = (date.getDate()) < 10 ? '0' + (date.getDate()) : date.getDate(),
hour = (date.getHours()) < 10 ? '0' + (date.getHours()) : date.getHours(),
min = (date.getMinutes()) < 10 ? '0' + (date.getMinutes()) : date.getMinutes(),
@ -511,28 +549,28 @@ module.exports = {
return days
},
// 两个数组合并并且去重
mergeArr(arr1,arr2,key){
mergeArr(arr1, arr2, key) {
let arr = arr1.concat(arr2); //两个数组对象合并
let newArr = []; //盛放去重后数据的新数组
for(let a = 0; a < arr.length; a++){ //循环json数组对象的内容
for (let a = 0; a < arr.length; a++) { //循环json数组对象的内容
let flag = true; //建立标记,判断数据是否重复,true为不重复
for(let b = 0; b < newArr.length; b++){ //循环新数组的内容
if(arr[a][key] == newArr[b][key]){ //让json数组对象的内容与新数组的内容作比较,相同的话,改变标记为false
for (let b = 0; b < newArr.length; b++) { //循环新数组的内容
if (arr[a][key] == newArr[b][key]) { //让json数组对象的内容与新数组的内容作比较,相同的话,改变标记为false
flag = false;
}
}
if(flag){ //判断是否重复
if (flag) { //判断是否重复
newArr.push(arr[a]); //不重复的放入新数组。 新数组的内容会继续进行上边的循环。
}
}
return newArr
},
// 去掉数组重复数据
delArrRepeat(arr,key){
delArrRepeat(arr, key) {
var result = [];
var obj = {};
for(var i =0; i<arr.length; i++){
if(!obj[arr[i][key]]){
for (var i = 0; i < arr.length; i++) {
if (!obj[arr[i][key]]) {
result.push(arr[i]);
obj[arr[i][key]] = true;
}
@ -540,8 +578,8 @@ module.exports = {
return result
},
// 检查对象是否有某key
checkObjHasKey(key,obj){
if(key in obj){
checkObjHasKey(key, obj) {
if (key in obj) {
return true
}
return false
@ -550,7 +588,8 @@ module.exports = {
var userAgentInfo = navigator.userAgent;
var Agents = ["Android", "iPhone",
"SymbianOS", "Windows Phone",
"iPad", "iPod"];
"iPad", "iPod"
];
var flag = true;
for (var v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) {
@ -561,65 +600,68 @@ module.exports = {
return flag;
},
// 获取语言列表
getLanguage(){
return [
{id:'cn',name:'CN',type:1},
getLanguage() {
return [{
id: 'cn',
name: 'CN',
type: 1
},
// {id:'en',name:'English',type:2}
]
},
// 检测url是否有某key,并获取值
urlIsHaveKey(key){
urlIsHaveKey(key) {
let urlAll = window.location.href
let urls = urlAll.replace('?','&')
let urls = urlAll.replace('?', '&')
let urlArr = urls.split('&')
// console.log(urlArr)
for(let a = 0; a < urlArr.length;a++){
for (let a = 0; a < urlArr.length; a++) {
let urlA = urlArr[a].split('=')
if(urlA[0] == key){
if (urlA[0] == key) {
return urlA[1]
}
}
return ''
},
// 计算精度
getPoint(num){
getPoint(num) {
let number = 1
for(let a = 0; a < num;a++){
for (let a = 0; a < num; a++) {
number = number + '0'
}
return Number(number)
},
// 获取合约地址
getContract(){
getContract() {
return {
'key':'地址',
'key': '地址',
}
},
// 获取请求域名
getBaseUrl(){
getBaseUrl() {
return baseUrl
},
// 获取图片域名
getBasePageUrl(){
getBasePageUrl() {
return 'https://pool.xinhuoshuju.com'
},
// 判断对象中是否有某key值,如果有该值,直接返回该对象
checkObjKeyIsValue(arrs,key,value){
checkObjKeyIsValue(arrs, key, value) {
let items = ''
arrs.forEach((item,k) => {
if(item[key] == value){
arrs.forEach((item, k) => {
if (item[key] == value) {
items = item
}
})
if(items){
if (items) {
return items
}
return false
},
// 数字转换小数点任意位
changeNumberPoint(number,length = 2){
changeNumberPoint(number, length = 2) {
let nums = '1'
for(let a = 0; a < length; a++){
for (let a = 0; a < length; a++) {
nums = nums + '0'
}
let num = Number(number) / nums // 金额转换小数点后六位
@ -627,14 +669,14 @@ module.exports = {
return result
},
// 检测密码只能是英文大小写加数字
checkPswEN(psw){
checkPswEN(psw) {
let check_big = /[A-Z]/g
// console.log(check_big.test(psw))
let check_small = /[a-z]/g
// console.log(check_small.test(psw))
let check_num = /[0-9]/g
// console.log(check_num.test(psw))
if(check_big.test(psw) && check_small.test(psw) && check_num.test(psw)){
if (check_big.test(psw) && check_small.test(psw) && check_num.test(psw)) {
return true
}
return false
@ -657,30 +699,30 @@ module.exports = {
// ----------------------时间转换----------------------
// 获取当前时间-精确到时分秒
time_StampToHMS(){
time_StampToHMS() {
var now = new Date();
var hour = now.getHours();//得到小时
var minu = now.getMinutes();//得到分钟
var sec = now.getSeconds();//得到秒
if(hour < 10){
var hour = now.getHours(); //得到小时
var minu = now.getMinutes(); //得到分钟
var sec = now.getSeconds(); //得到秒
if (hour < 10) {
hour = '0' + hour
}
if(minu < 10){
if (minu < 10) {
minu = '0' + minu
}
if(sec < 10){
if (sec < 10) {
sec = '0' + sec
}
return hour + ':' + minu + ':' + sec
},
// 时分秒转换成秒数
time_HMSToS(time){
time_HMSToS(time) {
var s = '';
var hour = time.split(':')[0];
var min = time.split(':')[1];
var sec = time.split(':')[2];
s = Number(hour*3600) + Number(min*60) + Number(sec);
s = Number(hour * 3600) + Number(min * 60) + Number(sec);
return s;
},
@ -701,67 +743,68 @@ module.exports = {
},
// 毫秒转换时分秒
time_MsecToHMS(value) {
var theTime = parseInt(value);// 秒
var middle= 0;// 分
var hour= 0;// 小时
var theTime = parseInt(value); // 秒
var middle = 0; // 分
var hour = 0; // 小时
if(theTime > 60) {
middle= parseInt(theTime/60);
theTime = parseInt(theTime%60);
if(middle> 60) {
hour= parseInt(middle/60);
middle= parseInt(middle%60);
if (theTime > 60) {
middle = parseInt(theTime / 60);
theTime = parseInt(theTime % 60);
if (middle > 60) {
hour = parseInt(middle / 60);
middle = parseInt(middle % 60);
}
}
var result = parseInt(theTime);
if(theTime < 10){
result = "0"+theTime;
if (theTime < 10) {
result = "0" + theTime;
}
if(middle > 0) {
if(middle < 10){
result = "0"+parseInt(middle)+":"+result;
}else{
result = parseInt(middle)+":"+result;
if (middle > 0) {
if (middle < 10) {
result = "0" + parseInt(middle) + ":" + result;
} else {
result = parseInt(middle) + ":" + result;
}
}
if(hour> 0) {
if(hour < 10){
result = "0"+parseInt(hour)+":"+result;
}else{
result = parseInt(hour)+":"+result;
if (hour > 0) {
if (hour < 10) {
result = "0" + parseInt(hour) + ":" + result;
} else {
result = parseInt(hour) + ":" + result;
}
}
return result;
},
clearEmpty(value){
return value.replaceAll(' ','')
clearEmpty(value) {
return value.replaceAll(' ', '')
},
// 秒转换成天时分秒
time_MsecToDHMS(time){
time_MsecToDHMS(time) {
time = (time / 1000).toFixed(0)
var days = parseInt(time / (1000 * 60 * 60 * 24));
var hours = parseInt((time % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = parseInt((time % (1000 * 60 * 60)) / (1000 * 60));
var seconds = (time % (1000 * 60)) / 1000;
return (days).toFixed(0) + " 天 " + (hours).toFixed(0) + " 小时 " + (minutes).toFixed(0) + " 分钟 " + (seconds).toFixed(0) + " 秒 ";
return (days).toFixed(0) + " 天 " + (hours).toFixed(0) + " 小时 " + (minutes).toFixed(0) + " 分钟 " + (seconds)
.toFixed(0) + " 秒 ";
},
// 秒数转换成时分秒
time_SToHMS(s){
time_SToHMS(s) {
var t
if(s > -1){
var hour = Math.floor(s/3600)
var min = Math.floor(s/60) % 60
if (s > -1) {
var hour = Math.floor(s / 3600)
var min = Math.floor(s / 60) % 60
var sec = s % 60
if(hour < 10) {
t = '0'+ hour + ":"
if (hour < 10) {
t = '0' + hour + ":"
} else {
t = hour + ":"
}
if(min < 10){
if (min < 10) {
t += "0"
}
t += min + ":"
if(sec < 10){
if (sec < 10) {
t += "0"
}
t += sec.toFixed(2)

@ -141,6 +141,14 @@
"pathRewrite" : {
"^/HiatmpPro" : "/HiatmpPro"
}
},
"/hitapChat" : {
"target" : "http://219.147.31.25:30001/hitap",
"changeOrigin" : true,
"secure" : false,
"pathRewrite" : {
"^/hitapChat" : ""
}
}
}
},

@ -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
@ -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
@ -195,18 +205,24 @@ import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView
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{
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
this.msgList[this.msgList.length - 1].data += res.result.data.content
}else{
} 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',
@ -297,10 +313,10 @@ import zeroMarkdownView from '../../components/zeroMarkdownView/zeroMarkdownView
onKeyInput(event) {
this.inputValue = event.detail.value
},
addQuestion(q,answerId) {
addQuestion(q, answerId) {
const newQuestion = {
answerId,
data:q
data: q
};
this.msgList.push(newQuestion); //
// this.$store.commit('setMSg_List', this.msgList);
@ -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()
} 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;
@ -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;

@ -251,7 +251,9 @@
}
/deep/ .uni-forms-item__label {
font-size: 16px;
font-size: 32rpx;
height:auto;
margin-bottom: 20rpx;
}
}

@ -271,7 +271,8 @@
}
/deep/ .uni-forms-item__label {
font-size: 16px;
font-size: 32rpx;
// height:82rpx
}
}
@ -297,4 +298,5 @@
color: #2663BF;
}
}
</style>

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