feat: 数字民警问题修改

ocr_2.1
xiangcongshuai 3 months ago
parent ace6fb3c81
commit a45adcefc4

@ -0,0 +1,40 @@
<template>
<img :src="imageUrl" @click="$emit('click')">
</template>
<script>
import request from '@/utils/request'
export default {
name: 'BCTokenImage',
props: {
src: String
},
data() {
return {
imageUrl: '' //
}
},
watch: {
src: {
handler(value) {
this.loadImage(value)
},
immediate: true
}
},
methods: {
loadImage(url) {
request({
method: 'get',
responseType: 'blob', // blob
url
}).then(response => {
// URL使
this.imageUrl = URL.createObjectURL(new Blob([response]))
}).catch(error => {
console.error(`BCTokenImage error: ${url}加载失败!`, error)
})
}
}
}
</script>

@ -5,7 +5,7 @@ const network = {
// 默认的接口地址 如果是开发环境和生产环境走vab-mock-server当然你也可以选择自己配置成需要的接口地址
baseURL:
process.env.NODE_ENV === 'development'
? 'http://192.168.10.142:8097/fu-hsi-server'
? 'http://192.168.10.138:8097/fu-hsi-server'
: '/fuHsiApi',
// 配后端数据的接收方式application/json;charset=UTF-8或者application/x-www-form-urlencoded;charset=UTF-8
contentType: 'application/json;charset=UTF-8',

@ -2,13 +2,14 @@ import Vue from 'vue'
import App from './App'
import store from './store'
import router from './router'
import BCTokenImage from '@/components/BCTokenImage'
import './plugins'
import '@/layouts/export'
// // 解决滚动背景的问题
// import 'default-passive-events'
import appInit from './data/appInit'
Vue.config.productionTip = false
Vue.component('BCTokenImage', BCTokenImage) // 全局注册
new Vue({
el: '#app',
router,

@ -12,6 +12,7 @@
* @param cFormat
* @returns {string|null}
*/
import request from '@/utils/request'
export function parseTime(time, cFormat) {
if (!time) return '-'
if (arguments.length === 0) {
@ -249,3 +250,17 @@ export function zeroFill(num, length) {
}
return num
}
// 预览图片加token
export function getPreviewWithToken(url) {
request({
method: 'get',
responseType: 'blob', // 重要设置响应类型为blob
url
}).then(response => {
// 创建一个URL浏览器可以使用它来加载图片
return URL.createObjectURL(new Blob([response]))
}).catch(error => {
console.error(`BCTokenImage error: ${url}加载失败!`, error)
})
}

@ -32,7 +32,7 @@
</div>
<div v-if="delFlag" class="del-footer">
<el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" @change="handleCheckAllChange"></el-checkbox>
<span class="del-item" @click="delAll">
<span class="del-item" @click="delAll">
<i class="el-icon-delete file-delete" />
<span>删除</span>
</span>
@ -231,7 +231,7 @@ export default {
.case-list {
display: flex;
flex-direction: column;
height: calc(100vh - 430px);
height: calc(100vh - 408px);
overflow: auto;
.case-item {
height: 34px;font-size: 16px;
@ -266,6 +266,7 @@ export default {
font-size: 16px;
color: #333333;
border-radius: 8px 8px 8px 8px;
font-weight: 600;
.date {
color: #333333;
}
@ -331,6 +332,7 @@ export default {
font-size: 16px;
color: #FF3429;
cursor: pointer;
margin-left: 148px;
i {
margin-right: 10px;
}

@ -118,7 +118,7 @@
<span class="robot-message-item">
{{ message.answer }}
</span>
<div v-if="message.askFlag && message.intentType" class="btns">
<div v-if="message.askFlag && message.intentType && message.intentType!=='0'" class="btns">
<div class="btn-item" @click="selectAskItem(message,'是')"></div>
<div class="btn-item" @click="selectAskItem(message,'否')"></div>
</div>
@ -131,15 +131,15 @@
<div v-if="message.segmentList && message.segmentList.length > 0 && message.showFlag" class="collapse-content">
<div class="title">涉及文件</div>
<div v-for="(item, index) in message.segmentList" :key="index" class="record-item">
<span style="color: #333333;" class="file-name ">{{ item.name }}</span>
<span style="color: #333333;cursor: unset;" class="file-name ">{{ item.name }}</span>
<span v-html="item.snippet" />
</div>
</div>
</div>
<!-- 指标询问选项 -->
<div v-if="message.adviceList && message.askFlag " class="option-list">
<span v-for="(item, index) in message.adviceList" :key="index" class="option-item" @click="selectAskIndex(message,item)">
<span class="name">{{ item }}</span>
<span v-for="(item, index) in message.adviceList" :key="index" class="option-item" @click="selectAskIndex(message,item.indexName)">
<span class="name">{{ `${item.indexType} ${item.indexType?'|':''} ${item.indexName}` }}</span>
<i class="el-icon-arrow-right" />
</span>
</div>
@ -175,6 +175,7 @@
</div>
<el-input
ref="myInput"
v-model="searchName"
maxlength="50"
class="top-input"
@ -267,6 +268,10 @@ export default {
this.indexFlag = true
this.activedIndex = '1'
this.getIndexData('1')
this.$nextTick(() => {
const inputElement = this.$refs.myInput.$el.querySelector('input')
inputElement.focus()
})
} else {
this.indexFlag = false
}
@ -384,7 +389,7 @@ export default {
//
selectAskIndex(item, name) {
this.$set(item, 'askFlag', false)
this.selectIndex(name)
this.selectIndex(name, name === '以上都不是' ? 'none' : '', item.dialogueCount)
},
//
selectAskItem(item, val) {
@ -407,7 +412,7 @@ export default {
})
},
//
selectIndex(name) {
selectIndex(name, val, dialogueCount) {
if (this.loading) return
this.indexFlag = false
this.searchName = ''
@ -419,9 +424,10 @@ export default {
this.chat({
caseId: this.caseId,
query: name,
dialogueCount,
conversationId: this.conversationId,
type: '1',
intentType: '0'
type: val === 'none' ? '0' : '1',
intentType: val === 'none' ? '' : '0'
})
},
chat(obj) {
@ -506,14 +512,10 @@ export default {
})
}
}
this.$nextTick(() => {
setTimeout(() => {
this.loading = false
}, 2000)
setTimeout(() => {
this.loading = false
this.scrollToBottom()
})
}, 2000)
},
//
getIndexType(val) {
@ -536,8 +538,10 @@ export default {
// if (scrollbar) {
// scrollbar.wrap.scrollTo(0, scrollbar.wrap.scrollHeight)
// }
const div = this.$refs.scrollbar
div.scrollTop = div.scrollHeight
this.$nextTick(() => {
const div = this.$refs.scrollbar
div.scrollTop = div.scrollHeight
})
},
//
handleScroll(event) {
@ -546,7 +550,7 @@ export default {
const scrollHeight = this.$refs.scrollbar.scrollHeight //
//
this.distanceToBottom = scrollHeight - (scrollTop + clientHeight)
if (this.distanceToBottom > 0) {
if (this.distanceToBottom > 2) {
this.isShowDownIcon = true
} else {
this.isShowDownIcon = false
@ -572,8 +576,9 @@ export default {
caseId: this.caseId,
query: this.sendText,
conversationId: this.conversationId,
dialogueCount: this.conversationList.length > 2 ? this.conversationList[this.conversationList.length - 2].dialogueCount : '',
type: '0',
intentType: ''
intentType: this.conversationList.length > 2 ? this.conversationList[this.conversationList.length - 2].intentType : ''
})
this.sendText = ''
}
@ -585,13 +590,14 @@ export default {
background: #FFFFFF;
height: 100%;
position: relative;
padding-top: 24px;
// padding-top: 24px;
display: flex;
.PoliceAi-main {
display: flex;
flex-direction: column;
align-items: center;
flex: 1;
padding-top: 24px;
.case-title {
width: 632px;
height: 98px;
@ -680,7 +686,7 @@ export default {
line-height: 28px;font-size: 16px;
color: #333333;
padding: 16px;
width: 90%;
// width: 90%;
margin-bottom: 16px;
display: flex;
flex-direction: column;
@ -759,7 +765,7 @@ export default {
padding: 16px;
background: #F6F7F9;
border-radius: 6px 6px 6px 6px;
width: 90%;
// width: 90%;
.title {
font-size: 16px;
color: #333333;
@ -927,6 +933,7 @@ export default {
padding-left: 24px;
height: 260px;
.index-list-item {
padding-left: 8px;
font-weight: 400;
font-size: 16px;
color: #333333;

@ -185,7 +185,7 @@ export default {
for (const item of this.fileList) {
if (item.name === file.name) {
if (!item.fileId) return
this.downloadFile(`${baseURL}${commonDownloadFile}${item.fileId}`, item.name)
this.downloadFile(`${baseURL}${commonDownloadFile}${item.fileId}&printWaterMarket=true&download=true`, item.name)
}
}
},

@ -253,7 +253,7 @@ export default {
for (const item of this.fileList) {
if (item.name === file.name) {
if (!item.id) return
this.downloadFile(`${baseURL}${commonDownloadFile}${item.id}`, item.name)
this.downloadFile(`${baseURL}${commonDownloadFile}${item.id}&printWaterMarket=true&download=true`, item.name)
}
}
},

Loading…
Cancel
Save