From dd7539e288c02ff69af187fa0a90e5b033bc4fad Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Tue, 03 Feb 2026 17:58:18 +0800
Subject: [PATCH] feat(ai): 新增AI产品提示词管理功能
---
src/main/resources/templates/febs/views/modules/ai/fileUpload/index.html | 55 ++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 36 insertions(+), 19 deletions(-)
diff --git a/src/main/resources/templates/febs/views/modules/ai/fileUpload/index.html b/src/main/resources/templates/febs/views/modules/ai/fileUpload/index.html
index 07d6317..8c8ed82 100644
--- a/src/main/resources/templates/febs/views/modules/ai/fileUpload/index.html
+++ b/src/main/resources/templates/febs/views/modules/ai/fileUpload/index.html
@@ -5,13 +5,14 @@
<form class="layui-form" action="" lay-filter="aiCompany-info-form">
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
<ul class="layui-tab-title">
- <li class="layui-this">基础信息</li>
+ <li class="layui-this">知识点视频上传</li>
</ul>
<div class="layui-tab-content">
<div class="upload-container">
<div class="upload-header">
- <h2>大文件上传系统</h2>
+ <h2>知识点视频上传</h2>
<p>支持分片上传,最大支持10GB文件</p>
+ <p>产品知识点中的视频选择器中选择,小程序中可以通过学习模块中,观看视频</p>
</div>
<!-- 上传区域 -->
@@ -19,7 +20,7 @@
<i class="layui-icon layui-icon-upload-drag upload-icon"></i>
<div class="upload-text">
<p>点击或拖拽文件到此处上传</p>
- <small>支持视频文件上传</small>
+ <small>仅视频上传</small>
</div>
</div>
@@ -310,7 +311,6 @@
var isUploading = false;
var startTime = 0;
var uploadedSize = 0;
- var companyId = 'default'; // 默认公司ID,实际应用中应从session或URL参数获取
// 初始化
init();
@@ -484,7 +484,6 @@
formData.append('chunk', currentChunk);
formData.append('chunks', chunks);
formData.append('fileMd5', fileMd5);
- formData.append('companyId', companyId);
$.ajax({
url: '/fileUpload/uploadChunk',
@@ -537,20 +536,16 @@
data: {
fileName: file.name,
fileMd5: fileMd5,
- chunks: chunks,
- companyId: companyId
+ chunks: chunks
},
success: function(response) {
if (response.code === 200 || response.success) {
- layer.msg('文件上传成功,页面将刷新', {icon: 1, time: 1000});
+ layer.msg('文件上传成功', {icon: 1});
$('#uploadStatus').text('上传成功');
$('#uploadProgress').text('100%');
$('#progressFill').css('width', '100%').text('100%');
-
- // 刷新页面
- setTimeout(function() {
- location.reload();
- }, 1000);
+ $('#playContainer').show();
+ refreshFileList();
} else {
layer.msg('文件合并失败: ' + response.message, {icon: 2});
$('#uploadStatus').text('上传失败');
@@ -592,7 +587,7 @@
function refreshFileList() {
layer.msg('正在获取文件列表...', {icon: 16, time: 0});
$.ajax({
- url: '/fileUpload/list/' + companyId,
+ url: '/fileUpload/list',
type: 'GET',
success: function(response) {
layer.closeAll();
@@ -635,7 +630,32 @@
var videoPlayer = document.getElementById('videoPlayer');
var videoSource = document.getElementById('videoSource');
- videoSource.src = '/fileUpload/play/' + companyId + '/' + encodeURIComponent(fileName);
+ // 根据文件扩展名设置正确的MIME类型
+ var extension = fileName.split('.').pop().toLowerCase();
+ var mimeType = 'video/mp4';
+ switch(extension) {
+ case 'avi':
+ mimeType = 'video/x-msvideo';
+ break;
+ case 'mov':
+ mimeType = 'video/quicktime';
+ break;
+ case 'wmv':
+ mimeType = 'video/x-ms-wmv';
+ break;
+ case 'flv':
+ mimeType = 'video/x-flv';
+ break;
+ case 'webm':
+ mimeType = 'video/webm';
+ break;
+ case 'mkv':
+ mimeType = 'video/x-matroska';
+ break;
+ }
+
+ videoSource.src = '/fileUpload/play/' + encodeURIComponent(fileName);
+ videoSource.type = mimeType;
videoPlayer.load();
videoPlayer.play();
});
@@ -649,10 +669,7 @@
$.ajax({
url: '/fileUpload/delete',
type: 'POST',
- data: {
- fileName: fileName,
- companyId: companyId
- },
+ data: {fileName: fileName},
success: function(response) {
if (response.code === 200 || response.success) {
layer.msg('删除成功', {icon: 1});
--
Gitblit v1.9.1