feat(pageIndex): 优化事故列表时间显示、附件预览功能及AI问答页面,更新API接口地址

master
Tuzki 2 months ago
parent 5c835806f6
commit fb05f7cd1d
  1. 4
      components/verifition/verifyPoint/verifyPoint.vue
  2. 4
      components/verifition/verifySlider/verifySlider.vue
  3. 7
      config.js
  4. 63
      pageIndex/accident/accident.vue
  5. 13
      pageIndex/aiAsk/aiAsk.vue
  6. 2
      utils/request.js

@ -142,7 +142,7 @@
}
myRequest({
// url: `/captcha/check`,
url: '/admin-api/system/captcha/check', // 使 /admin-api/
url: '/prod-api/admin-api/system/captcha/check', // 使 /admin-api/
data,
method:"POST",
}).then(result => {
@ -213,7 +213,7 @@
}
myRequest({
// url: "/captcha/get", //
url: '/admin-api/system/captcha/get', // 使 /admin-api/
url: '/prod-api/admin-api/system/captcha/get', // 使 /admin-api/
data,
method:"POST",
}).then((result) => {

@ -231,7 +231,7 @@
}
myRequest({
// url: `/captcha/check`,
url: '/admin-api/system/captcha/check', // 使 /admin-api/
url: '/prod-api/admin-api/system/captcha/check', // 使 /admin-api/
data,
method: "POST",
}).then((result) => {
@ -319,7 +319,7 @@
}
myRequest({
// url: '/captcha/get', //
url: '/admin-api/system/captcha/get', // 使 /admin-api/
url: '/prod-api/admin-api/system/captcha/get', // 使 /admin-api/
data,
method: "POST",
}).then((result) => {

@ -1,10 +1,9 @@
// 应用全局配置
module.exports = {
// baseUrl: 'http://api-dashboard.yudao.iocoder.cn',
// baseUrl: 'https://cjy.aitto.net:48081',
baseUrl: 'http://192.168.130.155:8048',
// baseApi: '/prod-api/admin-api',
baseApi: '',
baseUrl: 'https://e629859.r39.cpolar.top',
// baseUrl: 'http://192.168.130.155:8048',
baseApi: '/prod-api',
// 应用信息
appInfo: {
// 应用名称

@ -60,11 +60,11 @@
</view>
<view class="list-item-body-desc">
<text class="list-item-body-desc-label">事故时间</text>
<text class="list-item-body-desc-value">{{ item.createTime }}</text>
<text class="list-item-body-desc-value">{{ parseTime(item.createTime) }}</text>
</view>
</view>
<view class="list-item-feet border-top" v-if="0 == 1">
<view class="list-item-feet-btn" @click="goFilePage">
<view class="list-item-feet border-top" v-if="item.filePath">
<view class="list-item-feet-btn" @click="goFilePage(item.filePath)">
<!-- <image src="https://mp-df79fe8b-b924-41b0-bcb1-960be6b4a619.cdn.bspapp.com/images/common/fujian@2x.png"></image> -->
<image src="https://i.postimg.cc/cH6cSgmq/fujian-2x.png"></image>
<text class="list-item-feet-btn-label">查看附件</text>
@ -172,16 +172,63 @@ export default {
console.log(err)
})
},
getLabelByValue(){
getLabelByValue() {
return getLabelByValue.apply(this, arguments)
},
openPop() {
this.$refs.popup.open()
},
goFilePage() {
uni.navigateTo({
url: '/pageIndex/filePage/filePage'
})
goFilePage(url) {
//
const fileExtension = url.split(".").pop()?.toLowerCase();
if (!fileExtension) {
uni.showToast({ title: "无法识别文件类型", icon: "none" });
return;
}
//
if (["jpg", "jpeg", "png", "gif"].includes(fileExtension)) {
//
uni.previewImage({
urls: [url],
});
} else {
//
uni.downloadFile({
url: url,
// filePath: filePath,
success: (res) => {
if (res.statusCode === 200) {
uni.openDocument({
filePath: res.tempFilePath,
success: () => console.log("文档预览成功 路径: ", res.tempFilePath),
fail: (err) => {
console.error("文档预览失败", err);
uni.showToast({
title: "预览失败",
icon: "error",
});
},
});
} else {
uni.showToast({
title: "文件下载失败",
icon: "error",
});
}
},
fail: (err) => {
console.error("文件下载失败", err);
uni.showToast({
title: "文件下载失败",
icon: "error",
});
},
});
}
},
parseTime(time) {
return parseTime(time)

@ -21,7 +21,8 @@
<view :class="['msg', msg.role]" v-if="msg.role === 'user'">{{ msg.content }}</view>
<view :class="['msg', msg.role]" v-else v-html="parseMarkdown(msg.content)"></view>
<!-- 添加按钮仅对 AI 回答显示 -->
<view v-if="msg.role === 'assistant'&&userType == 1||msg.role === 'assistant'&&userType == 2" class="add-btn-box">
<view v-if="msg.role === 'assistant' && userType == 1 || msg.role === 'assistant' && userType == 2"
class="add-btn-box">
<button v-if="!streaming" class="add-btn" @click="toggleAnswer(msg.content, idx)"
:class="{ 'added': selectedAnswerIds.has(idx) }">
<!-- <span class="iconfont" :class="selectedAnswerIds.has(index) ? 'icon-jian' : 'icon-jia'"></span> -->
@ -123,12 +124,10 @@ export default {
//
getNoticeList() {
Api.getNoticeList().then(res => {
const arr = res.data.map(item => {
return item.status == 0
}).splice(0, 5)
console.log(res);
const arr = res.data.filter(item => item.status === true).slice(0, 5);
console.log(res, arr);
if (arr.length > 0) {
this.guessList = arr
this.guessList = arr;
}
}).catch(err => {
console.log(err);
@ -253,7 +252,7 @@ export default {
//
this.sseBuffer = "";
const url = 'http://192.168.130.155:5679/api/v3/user_share_chat_completions'
const url = 'https://e629859.r39.cpolar.top/agent-api/api/v3/user_share_chat_completions'
+ '?api_key=cjy-778af2cdb2f645ff99493cee58919e9d'
+ '&app_code=c8360e1c-6d21-11f0-8f29-00e04f309c26'
+ '&random=' + this.random + '&user_input=' + encodeURIComponent(question);

@ -33,7 +33,7 @@ const request = (config) => {
uni.request({
method: config.method || 'get',
timeout: config.timeout || timeout,
url: config.baseUrl || baseUrl + config.url,
url: baseUrl + config.url||config.baseUrl,
data: config.data,
header: config.header,
dataType: 'json'

Loading…
Cancel
Save