Compare commits

...

12 Commits

Author SHA1 Message Date
lwj
dda692a542 fix:在线课程管理列表中添加审核人审核时间 2025-12-12 15:07:35 +08:00
dong.ai
7a1f9e6815 style(AICall.vue): 调整对话框内容展示宽度 2025-12-11 18:49:56 +08:00
dong.ai
2a6707517b style(AICall): 全屏时中内容展示宽度调整 2025-12-11 18:44:44 +08:00
dong.ai
7c37a766f1 fix(messages): 赞/踩逻辑保存展示 2025-12-11 18:44:37 +08:00
hz
cb555a91f7 fix(lan): 修复局域网服务检测逻辑与显示控制
- 将 `v-if` 替换为 `v-show` 以避免组件重复创建
- 使用 `.sync` 修饰符替代 `value` 事件进行双向绑定
- 调整检测超时逻辑,超时后设置为检测成功
- 网络响应失败时正确同步状态值
- 移除模板中冗余的条件渲染包装元素
2025-12-11 18:44:30 +08:00
joshen
c5c49222e8 fix: 安全检测修改 2025-12-11 18:44:25 +08:00
hz
bef42d5c24 feat(portal): 添加局域网服务检测功能
- 在 AICall.vue 中引入并使用 LanServiceChecker 组件
- 新增 LanServiceChecker.vue 组件,用于检测用户是否处于局域网环境
- 实现通过 fetch 发送 HEAD 请求以验证网络环境是否符合要求
- 添加重新检测按钮与加载状态提示
- 支持自定义错误信息展示
- 使用 AbortController 控制请求超时,提升用户体验
2025-12-11 18:44:16 +08:00
dong.ai
bd0f372dc6 feat(aiChat): AI消息点赞与反馈,AI弹窗最大化 2025-12-11 18:44:12 +08:00
joshen
5670120cae Merge remote-tracking branch 'aliyun/bugfix-1324' 2025-12-10 14:50:04 +08:00
670788339
8bed676851 外部讲师的默认头像(合并冲突过多重新提) 2025-12-09 18:15:01 +08:00
670788339
9dbb5e2d89 Merge branch 'PingCode-20251117' into 104-master
# Conflicts:
#	src/views/study/coursenew.vue
2025-12-09 18:11:11 +08:00
670788339
6ad28a4940 外部讲师的默认头像 2025-11-20 11:00:22 +08:00
11 changed files with 431 additions and 58 deletions

View File

@@ -28,3 +28,9 @@ export function getChatMessages(conversationId) {
export function showCaseAiEntrance() {
return ajax.get('/xboe/m/boe/case/ai/show-entrance')
}
export function likeMsg(data) {
return ajax.postJson('/xboe/m/boe/case/ai/likeMsg',data)
}
export function msgFeedback(data) {
return ajax.postJson('/xboe/m/boe/case/ai/msgFeedback',data)
}

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1765161872024" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2317" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M256 504.021333c0 39.765333-32.213333 71.978667-72.021333 71.978667H136.021333A71.936 71.936 0 0 1 64 503.978667V136.021333c0-39.808 32.213333-72.021333 72.021333-72.021333h47.957334C223.786667 64 256 96.213333 256 136.021333v367.957334z m701.184 45.866667c-6.698667 26.112-21.077333 46.592-46.976 55.722667a131.925333 131.925333 0 0 1-41.813333 6.570666c-75.306667 0.597333-150.613333 0.213333-225.877334 0.213334-9.728 0-10.026667 0.597333-8.533333 9.898666 4.693333 27.52 8.618667 55.125333 14.037333 82.389334 7.253333 37.034667 8.192 73.813333-4.138666 109.696-11.093333 32.341333-23.68 64.213333-35.797334 96.213333-6.784 18.090667-18.176 31.317333-36.48 38.912-34.517333 14.506667-68.608 14.208-101.717333-2.986667-21.077333-11.093333-33.493333-28.714667-32.768-53.802666 0.981333-35.413333 1.194667-70.826667 2.688-106.24a58.026667 58.026667 0 0 0-7.808-32.554667c-27.306667-46.933333-47.104-83.413333-75.605333-129.621333-5.290667-8.533333-21.376-24.789333-28.288-32.085334-20.394667-21.504-30.890667-35.498667-31.018667-59.093333-0.085333-85.930667-0.298667-275.029333-0.682667-396.8a71.936 71.936 0 0 1 72.106667-72.234667c105.173333 0.128 296.277333 0.298667 389.973333 0.298667 22.4 0 44.416 1.408 66.005334 8.405333 42.794667 13.994667 69.717333 47.189333 73.088 91.989334 1.322667 17.024 0.512 33.92-5.546667 50.346666-0.938667 2.261333 0.554667 6.272 2.261333 8.576 16.896 22.613333 27.008 47.616 25.173334 76.117334-0.554667 9.813333-3.669333 19.584-6.656 29.098666-1.621333 5.12-1.621333 8.490667 1.877333 12.8 16.128 20.181333 25.898667 43.178667 25.130667 69.162667-0.426667 12.330667-4.906667 24.405333-7.253334 36.608-0.554667 2.901333-0.981333 7.210667 0.64 9.002667 13.781333 15.402667 21.504 33.621333 25.514667 53.717333a5.546667 5.546667 0 0 0 1.365333 2.005333v28.288a258.005333 258.005333 0 0 0-2.901333 9.386667z" fill="#000000" opacity=".65" p-id="2318"></path></svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1765161849864" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5624" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M960 543.573333v-43.946666l-3.882667-5.12a138.24 138.24 0 0 0-19.712-44.586667c2.816-9.6 4.394667-19.541333 4.906667-29.610667 0.768-26.794667-6.912-52.48-23.125333-76.629333 2.304-7.893333 3.84-16.085333 4.394666-24.32 1.834667-28.672-5.802667-56.576-22.698666-83.072 3.2-15.104 4.010667-30.592 2.602666-45.909333-4.181333-55.466667-38.784-99.2-92.373333-116.778667-25.728-8.405333-50.773333-9.813333-72.021333-9.813333h-93.866667c-33.237333 0-66.944 0.213333-100.693333 0.213333-53.034667 0-106.325333-0.213333-159.232-0.213333h-1.109334 0.128-247.296c-39.808 0-72.021333 32.213333-72.021333 72.021333v368c0 39.808 32.213333 71.978667 72.021333 71.978667H249.173333s55.893333 6.4 82.346667 48.512c18.346667 29.312 36.053333 60.202667 53.12 90.026666l22.016 38.058667c1.792 2.986667 2.602667 6.4 2.218667 9.898667-0.896 20.736-1.28 41.6-1.706667 61.696-0.213333 11.946667-0.512 24.234667-0.810667 36.224-0.981333 36.181333 16.810667 65.706667 49.92 83.114666a140.8 140.8 0 0 0 65.792 16.469334c19.498667 0 39.253333-4.096 58.88-12.288 25.514667-10.666667 43.52-29.781333 53.717334-56.789334l8.96-23.594666c8.234667-21.333333 16.64-43.434667 24.234666-65.621334 12.288-35.712 13.909333-74.88 5.12-119.808-2.602667-13.397333-4.906667-26.794667-7.125333-40.789333h21.589333l64.128 0.085333c29.184 0 58.666667 0 87.893334-0.170666h0.810666c16.768 0 33.493333-2.730667 49.493334-8.106667 23.594667-8.405333 54.272-28.416 66.56-76.714667l1.237333-4.010666 0.853333-2.986667 1.536-5.376z m-712.021333-39.594666H136.021333V135.978667h112.042667v368z m640 28.8c0 1.536-0.981333 3.541333-1.578667 5.632-4.608 18.090667-12.501333 23.466667-20.394667 26.368-8.405333 2.816-17.066667 4.224-25.898666 4.224h-0.426667l-0.469333-0.085334-0.512-0.128c-31.018667 0.213333-61.482667 0.298667-87.296 0.298667h-32.298667l-31.786667-0.085333h-106.24l13.653334 83.626666c2.56 15.872 4.864 29.354667 7.552 43.093334 6.314667 32.170667 5.546667 59.093333-2.474667 82.474666-6.997333 20.181333-14.421333 39.808-23.424 63.317334-3.072 7.978667-6.101333 16.085333-9.088 23.978666-3.584 9.6-8.106667 13.098667-14.08 15.701334-10.709333 4.522667-21.12 6.698667-31.146667 6.698666-11.093333 0-21.674667-2.688-32.384-8.277333a24.661333 24.661333 0 0 1-9.386666-7.68c-0.512-0.853333-2.133333-3.413333-1.92-9.642667 0.341333-11.52 0.64-22.997333 0.853333-36.778666v-1.706667c0.384-18.773333 0.768-38.314667 1.450667-57.173333a86.954667 86.954667 0 0 0-11.904-50.346667c-2.56-4.394667-5.077333-8.874667-7.68-13.269333-4.608-8.021333-9.386667-16.213333-13.909334-24.234667l-0.085333-0.085333-0.085333-0.085334-0.725334-1.109333c-17.194667-29.994667-34.986667-61.013333-53.674666-91.008l-0.128-0.213333-0.085334-0.170667c-16.64-26.325333-41.088-47.701333-71.509333-62.421333l-0.597333-387.712h63.914666c55.68 0 111.872 0.341333 159.402667 0.341333 16.981333 0 33.962667-0.128 50.773333-0.128 16.725333 0 33.28-0.213333 49.92-0.213333h93.866667c16.213333 0 33.536 0.938667 49.706667 6.229333 13.013333 4.181333 23.296 11.306667 30.634666 20.48 7.168 9.130667 11.264 20.224 12.288 33.28v0.64l0.085334 0.597333c0.810667 8.192 0.298667 16.298667-1.408 24.32l-0.768 3.413334h-8.704 8.704l-5.333334 25.173333 15.786667 25.002667c8.533333 13.397333 12.330667 26.282667 11.648 39.381333-0.213333 2.986667-0.853333 5.973333-1.621333 8.917333l-9.514667 32.298667 18.816 27.989333c7.594667 11.306667 11.093333 22.016 10.922667 33.493334-0.298667 4.266667-1.024 8.618667-2.218667 12.714666l-9.301333 32.426667 18.901333 27.861333c4.394667 6.4 7.509333 13.482667 9.301333 21.12l1.877334 7.765334v13.696z" fill="#000000" opacity=".65" p-id="5625"></path></svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1765161882076" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2499" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M184.021333 448H136.021333c-39.808 0-72.021333 32.213333-72.021333 72.021333v367.957334c0 39.808 32.213333 72.021333 72.021333 72.021333h47.957334C223.786667 960 256 927.786667 256 887.978667v-368c0-39.765333-32.213333-71.978667-72.021333-71.978667z m773.162667 26.112c-6.698667-26.112-21.077333-46.592-46.976-55.722667a131.925333 131.925333 0 0 0-41.813333-6.570666c-75.306667-0.597333-150.613333-0.213333-225.877334-0.213334-9.728 0-10.026667-0.597333-8.533333-9.898666 4.693333-27.52 8.618667-55.125333 14.037333-82.389334 7.253333-37.034667 8.192-73.813333-4.138666-109.738666-11.093333-32.298667-23.68-64.170667-35.797334-96.170667-6.784-18.090667-18.176-31.317333-36.48-38.912-34.517333-14.506667-68.608-14.208-101.717333 2.986667-21.077333 11.093333-33.493333 28.714667-32.768 53.802666 0.981333 35.413333 1.194667 70.826667 2.688 106.24a58.026667 58.026667 0 0 1-7.808 32.554667c-27.306667 46.933333-47.104 83.413333-75.605333 129.621333-5.290667 8.533333-21.376 24.789333-28.288 32.085334-20.394667 21.504-30.890667 35.498667-31.018667 59.093333-0.085333 85.930667-0.298667 275.029333-0.682667 396.8a71.936 71.936 0 0 0 72.106667 72.234667c105.173333-0.128 296.277333-0.298667 389.973333-0.298667 22.4 0 44.416-1.408 66.005334-8.405333 42.794667-13.994667 69.717333-47.232 73.088-92.032 1.322667-16.981333 0.512-33.877333-5.546667-50.261334-0.938667-2.304 0.554667-6.314667 2.261333-8.618666 16.896-22.613333 27.008-47.616 25.173334-76.117334-0.554667-9.813333-3.669333-19.584-6.656-29.098666-1.621333-5.12-1.621333-8.490667 1.877333-12.8 16.128-20.181333 25.898667-43.178667 25.130667-69.162667-0.426667-12.330667-4.906667-24.405333-7.253334-36.608-0.554667-2.901333-0.981333-7.210667 0.64-9.002667 13.781333-15.402667 21.504-33.621333 25.514667-53.717333a5.546667 5.546667 0 0 1 1.365333-2.005333v-28.288c-0.981333-3.114667-2.005333-6.186667-2.901333-9.386667z" fill="#000000" opacity=".65" p-id="2500"></path></svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1765161839692" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5444" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M958.378667 475.093333l-0.853334-2.986666c-0.512-1.621333-1.024-2.986667-1.237333-4.010667-12.288-48.384-43.008-68.394667-66.56-76.714667a154.666667 154.666667 0 0 0-49.493333-8.106666h-0.853334c-29.184-0.170667-58.581333-0.170667-87.893333-0.170667l-64.085333 0.085333h-21.589334c2.304-13.994667 4.48-27.392 7.082667-40.789333 8.789333-44.885333 7.210667-84.096-5.12-119.808-7.594667-22.186667-16.085333-44.288-24.192-65.578667l-8.96-23.594666c-10.112-27.008-28.245333-46.08-53.76-56.832a141.056 141.056 0 0 0-124.586667 3.882666c-33.066667 17.322667-50.858667 46.848-49.877333 83.114667 0.298667 12.032 0.597333 24.32 0.810667 36.224 0.426667 20.181333 0.768 41.088 1.706666 61.696a16.426667 16.426667 0 0 1-2.218666 9.898667c-7.296 12.714667-14.805333 25.514667-22.016 38.101333-17.066667 29.781333-34.773333 60.714667-53.077334 90.026667C305.066667 441.6 249.173333 448 249.173333 448H135.978667c-39.765333 0-71.978667 32.213333-71.978667 72.021333v367.957334c0 39.808 32.213333 72.021333 71.978667 72.021333h247.338666-0.128 1.109334c52.821333 0 106.24-0.213333 159.189333-0.213333 33.792 0 67.498667 0.213333 100.693333 0.213333H738.133333c21.205333 0 46.293333-1.408 72.021334-9.813333 53.589333-17.493333 88.192-61.184 92.373333-116.778667a157.269333 157.269333 0 0 0-2.56-45.909333c16.896-26.410667 24.490667-54.314667 22.656-83.114667a118.101333 118.101333 0 0 0-4.394667-24.32c16.128-23.978667 23.808-49.664 23.125334-76.544a135.594667 135.594667 0 0 0-4.906667-29.610667c9.216-13.610667 15.914667-28.586667 19.712-44.629333l3.882667-5.12v-43.946667l-1.621334-5.12z m-710.4 412.928H136.021333v-368h112.042667v367.957334z m640-383.232l-1.877334 7.808a64.426667 64.426667 0 0 1-9.301333 21.12l-18.901333 27.861334 9.301333 32.426666c1.194667 4.096 1.92 8.405333 2.218667 12.714667 0.170667 11.52-3.328 22.186667-10.922667 33.493333l-18.773333 27.989334 9.472 32.298666a38.698667 38.698667 0 0 1 1.621333 8.917334c0.682667 13.184-2.986667 26.069333-11.605333 39.381333l-15.786667 25.002667 5.290667 25.173333h-8.704 8.704l0.768 3.413333c1.706667 8.021333 2.218667 16.213333 1.408 24.32l-0.085334 0.597334v0.597333c-1.024 13.013333-5.12 24.192-12.288 33.28a63.018667 63.018667 0 0 1-30.634666 20.48c-16.085333 5.333333-33.365333 6.229333-49.664 6.229333H644.266667c-16.512 0-33.109333-0.213333-49.92-0.213333l-50.773334-0.085333c-47.616 0-103.68 0.298667-159.402666 0.298666H320.298667l0.810666-387.712c30.378667-14.762667 54.869333-36.096 71.509334-62.378666l0.085333-0.213334 0.085333-0.170666c18.730667-30.037333 36.522667-61.013333 53.717334-91.008l0.682666-1.109334 0.128-0.085333 0.085334-0.128c4.48-7.893333 9.301333-16.213333 13.909333-24.192 2.56-4.48 5.205333-8.917333 7.68-13.312 9.002667-15.274667 13.098667-32.682667 11.946667-50.304-0.853333-18.901333-1.237333-38.4-1.536-57.173333v-1.706667c-0.298667-13.696-0.512-25.301333-0.810667-36.821333-0.213333-6.058667 1.408-8.661333 1.92-9.6a23.253333 23.253333 0 0 1 9.386667-7.68c10.666667-5.589333 21.333333-8.32 32.426666-8.32 9.856 0 20.394667 2.304 31.061334 6.741333 5.973333 2.474667 10.496 5.973333 14.08 15.658667 3.029333 7.936 6.144 16 9.130666 24.021333 9.002667 23.466667 16.384 43.093333 23.424 63.317333 7.978667 23.381333 8.874667 50.346667 2.474667 82.474667a1376.853333 1376.853333 0 0 0-7.594667 43.093333l-13.781333 83.712h106.197333c10.496 0 21.077333 0 31.786667-0.085333h32.298667c25.813333 0 56.32 0 87.296 0.298667l0.512-0.128 0.469333-0.085334h0.426667c8.789333 0 17.493333 1.493333 25.898666 4.181334 7.893333 2.901333 15.786667 8.32 20.394667 26.453333 0.512 2.048 1.621333 3.968 1.621333 5.546667v13.653333z" fill="#000000" opacity=".65" p-id="5445"></path></svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -0,0 +1,94 @@
<script>
export default {
name: 'LanServiceChecker',
props: {
errorMsg: {
type: String,
default: '十分抱歉,您当前的网络环境不符合观看要求。为了保障课程信息的安全,您需要接入公司内网才能观看。'
},
// 控制是否显示
value: {type: Boolean, default: false}
},
created() {
this.lanServiceCheck()
},
data() {
return {
loading: false,
}
},
methods: {
syncValue(val) {
this.loading = false
this.$emit('update:value', val)
},
/**局域网检测*/
lanServiceCheck() {
this.loading = true
// 使用 AbortController 来控制超时
const controller = new AbortController();
const timeoutId = setTimeout(() => {
controller.abort();
this.syncValue(true);
}, 1000);
// 拼接随机参数(时间戳+随机数确保URL唯一防止缓存
const url = `${window.location.protocol}//uapi.boe.com.cn/500.html?t=${Date.now()}${Math.random()}`;
// 使用 fetch 发送 HEAD 请求
fetch(url, {
method: 'HEAD',
signal: controller.signal
})
.then(response => {
clearTimeout(timeoutId);
this.syncValue(!response.ok)
})
.catch(error => {
clearTimeout(timeoutId);
if (error.name !== 'AbortError') {
this.syncValue(true)
}
});
},
}
}
</script>
<template>
<div class="lan-checker-container">
<div>
<span>{{ errorMsg }}</span>
</div>
<div class="check-btn" @click="lanServiceCheck">
<el-button v-loading="loading" type="primary">重新检测</el-button>
</div>
</div>
</template>
<style lang="scss" scoped>
.lan-checker-container {
height: 100%;
& > div {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.error-msg {
margin-top: 40px;
font-weight: 700;
font-size: 22px;
color: #ccc;
}
.check-btn {
margin-top: 20px;
text-align: center;
}
}
</style>

View File

@@ -133,6 +133,8 @@
{{ scope.row.isTop == true ? '置顶' : '未置顶' }}
</template>
</el-table-column>
<el-table-column label="审核人" prop="auditUser"></el-table-column>
<el-table-column label="审核时间" prop="auditTime" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="180px" fixed="right">
<template slot-scope="scope" class="btn-gl">
<!-- 20240621 修改scope.row.isPermission = fasle 时不展示操作按钮-->

View File

@@ -9,7 +9,7 @@
@close="onClose"
class="case-expert-dialog"
:modal="false"
:fullscreen="false"
:fullscreen="dialogFullscreen"
top="0"
v-resizeable
v-draggable
@@ -17,18 +17,31 @@
<!-- 标题 -->
<div slot="title" class="dialog-title">
<span>案例专家</span>
<el-button
style="color:#96999f"
<div class="window-control-btn">
<el-button
style="color:#96999f;margin-right: 6px;"
type="text"
class="window-control-btn"
@click="minimizeWindow"
>
<i class="el-icon-minus"></i>
</el-button>
<el-button
type="text"
style="color:#96999f;"
>
<img v-if="!dialogFullscreen" @click="onbigWindowClick" :src="openImg" alt="" style="width: 17px">
<i v-else @click="onRestoreWindowClick" class="el-icon-copy-document"></i>
</el-button>
</div>
</div>
<div class="content-wrapper" v-show="isLan">
<lan-service-checker :value.sync="isLan"/>
</div>
<!-- 内容区域 -->
<div class="content-wrapper">
<div class="content-wrapper" v-show="!isLan" >
<div
class="welcome-message"
ref="messageContainer"
@@ -36,7 +49,7 @@
@wheel="handleWheel"
>
<div class="message-text" v-for="(item, index) in messageList" :key="index">
<messages :messageData="item" :suggestions="suggestions" @getMinWindow="minimizeWindow"></messages>
<messages :messageData="item" @update:messageData="val=> $set(messageList, index, val)" :suggestions="suggestions" @getMinWindow="minimizeWindow" :isFirstMessage="item.isFirstMessage"></messages>
</div>
<div class="message-suggestions" v-if="messageList.length > 0 && messageList[messageList.length-1].textCompleted">
<div class="suggestion-item" v-for="(item, index) in suggestions" :key="index">
@@ -112,6 +125,7 @@ import { mapState } from 'vuex'
import messages from './components/messages.vue'
import sendMessage from './components/sendMessage.vue'
import openImg from './components/open.png'
import LanServiceChecker from "@/components/LanServiceChecker.vue";
export default {
name: 'CaseExpertDialog',
props: {
@@ -121,6 +135,7 @@ export default {
}
},
components: {
LanServiceChecker,
messages,
sendMessage
},
@@ -153,13 +168,19 @@ export default {
let startY = 0;
let startLeft = 0;
let startTop = 0;
const startDrag = (event) => {
// 只有在标题栏上按下鼠标才开始拖动
if (event.target.closest('.resize-handle')) {
return; // 如果点击的是resize-handle则不触发拖动
}
if (event.target.closest('.window-control-btn')) {
return; // 如果点击的是控制按钮,则不触发拖动
}
// 全屏状态下拖动为正常弹窗大小
if (vnode.context.dialogFullscreen) {
vnode.context.onRestoreWindowClick();
return;
}
isDragging = true;
startX = event.clientX;
startY = event.clientY;
@@ -186,14 +207,12 @@ export default {
const stopDrag = () => {
isDragging = false;
// 保存当前位置到 sessionStorage
const currentPosition = {
left: parseInt(dialogEl.style.left),
top: parseInt(dialogEl.style.top)
};
// sessionStorage.setItem('aiCallDialogPosition', JSON.stringify(currentPosition));
// 移除全局事件监听
document.removeEventListener('mousemove', handleMouseMove);
document.removeEventListener('mouseup', stopDrag);
@@ -468,6 +487,8 @@ export default {
},
data() {
return {
dialogFullscreen:false,
isLan: true,
openImg,
AIContent: '',
isLoading: false,
@@ -475,6 +496,7 @@ export default {
messageList: [
{
typing:true,
isFirstMessage: true, // 添加 isFirstMessage 属性不展示赞 踩
isBot: true, // 是否为机器人
text: `<p><b>您好!我是京东方案例智能问答助手,随时为您服务。</b></p>
<p>我可以帮您快速查找和解读平台内的各类案例内容。只需输入您想了解的问题或关键词,我会从案例库中精准匹配相关信息,并提供清晰的解答。每条回答都会附上来源链接,方便您随时查阅原始案例全文。</p>
@@ -554,6 +576,90 @@ export default {
}
},
methods: {
onbigWindowClick() {
console.log('放大');
// 保存当前非全屏状态的尺寸和位置(仅当当前不是全屏状态时)
if (!this.dialogFullscreen) {
const dialogEl = document.querySelector('.case-expert-dialog .el-dialog');
if (dialogEl) {
const normalSize = {
width: parseInt(dialogEl.style.width) || dialogEl.offsetWidth,
height: parseInt(dialogEl.style.height) || dialogEl.offsetHeight,
left: parseInt(dialogEl.style.left) || dialogEl.offsetLeft,
top: parseInt(dialogEl.style.top) || dialogEl.offsetTop
};
sessionStorage.setItem('aiCallDialogNormalSize', JSON.stringify(normalSize));
}
}
// 设置全屏状态
this.dialogFullscreen = true;
// 设置全屏尺寸和位置
this.$nextTick(() => {
const dialogEl = document.querySelector('.case-expert-dialog .el-dialog');
if (dialogEl) {
dialogEl.style.width = '100vw';
dialogEl.style.height = '100vh';
dialogEl.style.left = '0px';
dialogEl.style.top = '0px';
// 更新消息容器高度
const messageContainer = document.querySelector('.welcome-message');
const inputArea = document.querySelector('.input-area-wrapper');
if (messageContainer && inputArea) {
messageContainer.style.height = `calc(100vh - ${inputArea.offsetHeight}px - 120px)`;
}
}
});
},
onRestoreWindowClick(){
console.log('缩小');
this.dialogFullscreen = false;
this.$nextTick(() => {
const dialogEl = document.querySelector('.case-expert-dialog .el-dialog');
if (dialogEl) {
// 从 sessionStorage 中获取保存的正常窗口尺寸和位置
const savedNormalSize = sessionStorage.getItem('aiCallDialogNormalSize');
const savedSize = sessionStorage.getItem('aiCallDialogSize');
const savedPosition = sessionStorage.getItem('aiCallDialogPosition');
if (savedNormalSize) {
// 使用之前保存的正常尺寸
const { width, height, left, top } = JSON.parse(savedNormalSize);
dialogEl.style.width = width + 'px';
dialogEl.style.height = height + 'px';
dialogEl.style.left = left + 'px';
dialogEl.style.top = top + 'px';
} else if (savedSize) {
// 回退到通用保存的尺寸
const { width, height, left, top } = JSON.parse(savedSize);
dialogEl.style.width = width + 'px';
dialogEl.style.height = height + 'px';
dialogEl.style.left = left + 'px';
dialogEl.style.top = top + 'px';
} else {
// 如果没有保存的尺寸,则使用默认值
dialogEl.style.width = '800px';
dialogEl.style.height = '600px';
dialogEl.style.left = (window.innerWidth - 800) / 2 + 'px';
dialogEl.style.top = '100px';
}
// 应用相应的消息容器高度
this.$nextTick(() => {
const messageContainer = document.querySelector('.welcome-message');
const inputArea = document.querySelector('.input-area-wrapper');
if (messageContainer && inputArea) {
const dialogHeight = dialogEl.style.height || '600px';
messageContainer.style.height = `calc(${dialogHeight} - ${inputArea.offsetHeight}px - 120px)`;
}
});
}
});
},
// / 关闭最小化窗口
closeMinimizedWindow() {
this.$store.commit('app/SET_SHOW_AI_CALL_MINIMIZED', false);
@@ -570,10 +676,13 @@ closeMinimizedWindow() {
sessionStorage.removeItem('aiCallDialogSize');
// sessionStorage.removeItem('aiCallDialogPosition');
this.$emit('close')
this.dialogFullscreen=false
// 可以在这里执行其他逻辑
},
minimizeWindow() {
console.log(131);
this.windowState = 'minimized';
this.$store.commit('app/SET_SHOW_AI_CALL_MINIMIZED', true);
},
@@ -625,6 +734,7 @@ closeMinimizedWindow() {
this.messageList = [
{
isBot: true,
isFirstMessage: true,
text: `<p><b>您好!我是京东方案例智能问答助手,随时为您服务。</b></p>
<p>我可以帮您快速查找和解读平台内的各类案例内容。只需输入您想了解的问题或关键词,我会从案例库中精准匹配相关信息,并提供清晰的解答。每条回答都会附上来源链接,方便您随时查阅原始案例全文。</p>
<p>我还会根据您的提问,智能推荐相关延伸问题,助您更高效地探索知识、解决问题。</p>
@@ -743,6 +853,7 @@ closeMinimizedWindow() {
font-size: 18px;
padding: 5px 10px;
color: #333; /* 黑色图标 */
margin-top: -13px;
}
}
@@ -770,6 +881,8 @@ closeMinimizedWindow() {
//margin-bottom: 20px;
display: flex;
flex-direction: column;
max-width: 800px;
margin: 0 auto;
.welcome-message {
display: flex;
@@ -903,4 +1016,13 @@ closeMinimizedWindow() {
align-items: center;
}
}
.case-expert-dialog {
::v-deep .el-dialog.fullscreen {
border-radius: 0;
.el-dialog__body {
height: calc(100vh - 120px); // 减去标题栏高度
}
}
}
</style>

View File

@@ -6,15 +6,13 @@
<div v-if="messageData.thinkText" class="bot-think" v-katex:auto v-html="md.render(messageData.thinkText)"></div>
<!-- 主要回复内容 -->
<div
ref="contentContainer"
class="message-content"
v-katex:auto
v-html="md.render(displayText)"
></div>
<div ref="contentContainer" class="message-content" v-katex:auto v-html="md.render(displayText)">
</div>
<!-- 引用案例 -->
<div v-if="messageData.caseRefers && messageData.caseRefers.length > 0 && messageData.textCompleted" class="case-refers">
<div v-if="messageData.caseRefers && messageData.caseRefers.length > 0 && messageData.textCompleted"
class="case-refers">
<div class="case-refers-title">
<span><i class="iconfont icon-think"></i> 引用案例</span>
<span v-if="shouldShowMoreButton" class="more" @click="toggleShowAllCaseRefers">
@@ -22,11 +20,7 @@
</span>
</div>
<div class="case-refers-list">
<div
v-for="item in displayedCaseRefers"
:key="item.caseId"
class="case-refers-item"
>
<div v-for="item in displayedCaseRefers" :key="item.caseId" class="case-refers-item">
<div class="case-refers-item-title">
<a @click="toUrl(item)" class="title">{{ item.title }}</a>
<span class="case-refers-item-timer">{{ item.uploadTime }}</span>
@@ -43,27 +37,54 @@
</div>
</div>
</div>
<!-- /踩图标区域 - 仅在文本加载完成后显示 -->
<div v-if="showFeedbackIcons && !isFirstMessage" style="margin-top: 8px;">
<el-tooltip class="item" effect="dark" content="点赞" placement="bottom">
<!-- 修改为根据 isLike 值判断状态使用 == 而不是 === -->
<img :src="messageData.isLike == 1 ? require('@/assets/images/case/zan-yes.svg') : require('@/assets/images/case/zan.svg')"
@click="toggleStar(1)" alt="zan" class="zan_img">
</el-tooltip>
<el-popover placement="bottom" trigger="manual" v-model="caiDialogShow">
<div class="feedback-class">
<span>反馈</span>
<i class="el-icon-close" @click="caiDialogShow = false"></i>
</div>
<div style="margin-top: 15px;">
<span class="tag-class" v-for="(item, index) in tagList" :key="index" @click="handleTag(item)">{{
item.name}}</span>
</div>
<el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="feedbackText" style="margin-top: 10px;">
</el-input>
<div style="text-align: right; margin: 0">
<el-button style="margin-top: 10px;" type="primary" size="mini" @click="handleSure">确定</el-button>
</div>
<!-- 修改为根据 isLike 值判断状态使用 == 而不是 === -->
<img slot="reference"
:src="messageData.isLike == -1 ? require('@/assets/images/case/cai-yes.svg') : require('@/assets/images/case/cai.svg')"
@click="toggleStar(-1)" alt="cai" class="zan_img" style="margin-left:10px">
</el-popover>
</div>
</div>
<!-- 用户消息 -->
<div v-else class="user-message">
<div class="message-text" v-html="messageData.text"></div>
</div>
<!-- 推荐问题 -->
<!-- <div v-if="suggestions && suggestions.length > 0" class="suggestions">-->
<!-- <div class="suggestions-title">💡 推荐问题</div>-->
<!-- <div class="suggestions-list">-->
<!-- <button-->
<!-- v-for="(item, index) in suggestions"-->
<!-- :key="index"-->
<!-- class="suggestions-item"-->
<!-- @click="$emit('suggestion-click', item)"-->
<!-- >-->
<!-- {{ item }}-->
<!-- </button>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div v-if="suggestions && suggestions.length > 0" class="suggestions">-->
<!-- <div class="suggestions-title">💡 推荐问题</div>-->
<!-- <div class="suggestions-list">-->
<!-- <button-->
<!-- v-for="(item, index) in suggestions"-->
<!-- :key="index"-->
<!-- class="suggestions-item"-->
<!-- @click="$emit('suggestion-click', item)"-->
<!-- >-->
<!-- {{ item }}-->
<!-- </button>-->
<!-- </div>-->
<!-- </div>-->
</div>
</template>
@@ -73,6 +94,7 @@ import highlight from 'markdown-it-highlightjs';
import 'highlight.js/styles/a11y-dark.css';
import markdownItMermaid from 'markdown-it-mermaid';
import mermaid from 'mermaid';
import { likeMsg, msgFeedback } from '@/api/boe/aiChat.js'
// 初始化 Mermaid
mermaid.initialize({ startOnLoad: false });
@@ -97,6 +119,11 @@ export default {
type: Array,
default: () => [],
},
// 添加 isFirstMessage 属性来标识是否为第一条消息
isFirstMessage: {
type: Boolean,
default: false
}
},
data() {
return {
@@ -105,6 +132,16 @@ export default {
typingTimer: null,
typingSpeed: 30, // 毫秒/字符
showAllCaseRefers: false,
caiDialogShow: false,
tagList: [
{ name: '回答不准确' },
{ name: '逻辑不清晰' },
{ name: '内容不完整' },
{ name: '其他' },
],
feedbackText: '',
showFeedbackIcons: false // 新增:控制赞/踩图标显示
};
},
computed: {
@@ -123,6 +160,7 @@ export default {
handler(newVal) {
if (!newVal) {
this.displayText = '';
this.showFeedbackIcons = false; // 隐藏图标
return;
}
@@ -130,15 +168,72 @@ export default {
// this.startTyping(newVal); // 启动打字机效果/**/
this.displayText = newVal || ''
// 文本加载完成后显示图标
this.$nextTick(() => {
this.showFeedbackIcons = true;
});
} else {
this.displayText = this.md.render(newVal);
this.$nextTick(this.renderMermaid); // 直接渲染 Mermaid
this.$nextTick(() => {
this.showFeedbackIcons = true; // 显示图标
this.renderMermaid();
});
}
},
immediate: true,
},
},
methods: {
toggleStar(type) {
// type: 1 表示赞,-1 表示踩0 表示取消
let newIsLike = 0;
if (type === 1 && this.messageData.isLike == 1) {
newIsLike = 0;
} else if (type === -1 && this.messageData.isLike == -1) {
newIsLike = 0;
this.caiDialogShow = false;
} else {
newIsLike = type;
if (type === -1) {
this.caiDialogShow = true;
} else {
this.caiDialogShow = false;
}
}
let params = {
docId: this.messageData.docId,
likeStatus: newIsLike === 0 ? '0' : newIsLike.toString(),
}
likeMsg(params).then(res => {
if(res.status ==200){
// 更新状态
this.$set(this.messageData, 'isLike', newIsLike)
this.$emit('update:messageData', this.messageData)
}
})
},
// 标签选择
handleTag(item) {
this.feedbackText = item.name
},
// 确定
handleSure() {
let params = {
docId: this.messageData.docId,
feedback: this.feedbackText
}
msgFeedback(params).then(res => {
console.log(res);
if(res.status ==200){
this.$message.success('反馈成功')
this.caiDialogShow = false
}
})
},
toUrl(item) {
this.$router.push({
path: '/case/detail',
@@ -166,6 +261,7 @@ export default {
} else {
clearInterval(this.typingTimer);
this.typingTimer = null;
this.showFeedbackIcons = true; // 打字完成后显示图标
this.$nextTick(this.renderMermaid); // 渲染 Mermaid 图表
}
}, this.typingSpeed);
@@ -207,14 +303,16 @@ export default {
</script>
<style scoped lang="scss">
::v-deep .mermaid{
::v-deep .mermaid {
width: 100%;
height: auto;
}
::v-deep svg[id^="mermaid-"]{
::v-deep svg[id^="mermaid-"] {
width: 100%;
height: 100%;
}
.messages {
width: 100%;
word-wrap: break-word;
@@ -378,7 +476,7 @@ export default {
color: #577ee1;
}
span + span {
span+span {
margin-left: 8px;
}
}
@@ -420,4 +518,32 @@ export default {
}
}
}
</style>
.zan_img {
width: 15px;
}
.feedback-class {
font-weight: 600;
display: flex;
justify-content: space-between;
i {
cursor: pointer;
}
}
.tag-class {
background: #f2f2f2;
border-radius: 5px;
padding: 3px 6px;
color: #555;
margin-left: 13px;
font-size: 13px !important;
cursor: pointer;
}
.tag-class:first-child {
margin-left: 0;
}
</style>

View File

@@ -1,15 +1,8 @@
<template>
<div class="input-area">
<el-input
v-model="inputContent"
type="textarea"
class="input-placeholder"
placeholder="有问题,尽管问"
@keyup.enter.native.prevent="handleSend"
:disabled="disabled"
:autosize="{ minRows: 2, maxRows: 4}"
resize="none"
></el-input>
<el-input v-model="inputContent" type="textarea" class="input-placeholder" placeholder="有问题,尽管问"
@keyup.enter.native.prevent="handleSend" :disabled="disabled" :autosize="{ minRows: 2, maxRows: 4 }"
resize="none"></el-input>
<div class="action-buttons">
<el-button type="primary" size="small" class="start-btn" @click="handleNewConversation">
+ 开启新对话
@@ -87,9 +80,10 @@ export default {
callAIChat(question) {
// 创建新的AI消息对象
const aiMessage = {
docId: '',
isBot: true,
text: '',
status:null,
status: null,
thinkText: '',
caseRefers: [], // 添加caseRefers字段
textCompleted: false // 添加文字处理完成状态默认为false
@@ -102,14 +96,14 @@ export default {
query: question
};
// 创建POST请求
fetch('/systemapi/xboe/m/boe/case/ai/chat',{
fetch('/systemapi/xboe/m/boe/case/ai/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
"accept": "text/event-stream",
},
body: JSON.stringify(requestData)
}).then(r=>{
}).then(r => {
return r
}).then(response => {
// 处理流式响应
@@ -267,8 +261,8 @@ export default {
// 累积内容并使用打字机效果更新显示
accumulatedContent += content;
// 如果thinkText已经显示完整则继续使用打字机效果显示内容
if( aiMessage.hasThink){
if(aiMessage.thinkText.length >=accumulatedThinkContent.length){
if (aiMessage.hasThink) {
if (aiMessage.thinkText.length >= accumulatedThinkContent.length) {
typeText(aiMessage, accumulatedContent);
}
} else {
@@ -303,6 +297,23 @@ export default {
this.$emit('update-message', aiMessage);
}
break;
case 9:
if (jsonData.docId) {
aiMessage.docId = jsonData.docId
this.$emit('update-message', aiMessage);
}
console.log(jsonData)
break
default:
if (jsonData.docId) {
aiMessage.docId = jsonData.docId
this.$emit('update-message', aiMessage);
}
break
}
} catch (error) {
console.error('解析SSE数据错误:', error);

View File

@@ -732,21 +732,29 @@
title="点击进入他的主页"
>
<!-- <div class="teacher-text" v-if="item.authorInfo.avatar == ''">{{userAvatarText(item.teacherName)}}</div> -->
<div v-if="item.authorInfo.avatar !== ''">
<div v-if="item.authorInfo && item.authorInfo.avatar">
<el-avatar
:src="fileBaseUrl + item.authorInfo.avatar"
shape="circle"
:size="50"
></el-avatar>
</div>
<div v-else class="teacher-text">
<!-- <div v-else class="teacher-text">
<div v-if="item.authorInfo.sex === 1">
<img src="../../../public/images/Avatarman.png" alt="" />
</div>
<div v-else>
<img src="../../../public/images/Avatarwoman.png" alt="" />
</div>
</div>-->
<div v-else-if="item.photo">
<el-avatar :src="item.photo" shape="circle" :size="50"></el-avatar>
</div>
<div v-else class="teacher-text">
<div v-if="item.authorInfo && item.authorInfo.sex === 1"><img src="../../../public/images/Avatarwoman.png" alt=""></div>
<div v-else><img src="../../../public/images/Avatarman.png" alt=""></div>
</div>
</div>
<div class="teacher-info">
<div class="teacher-name">