diff --git a/src/api/customerService/product/index.ts b/src/api/customerService/product/index.ts
index cdfa43d..5d1fe00 100644
--- a/src/api/customerService/product/index.ts
+++ b/src/api/customerService/product/index.ts
@@ -47,11 +47,14 @@ export function exportProduct(data: object) {
}
//导入产品
-export function importProduct(data: object) {
+export function importProduct(data: FormData) {
return newService({
url: '/customerService/product/import',
- responseType: 'blob',
method: 'post',
data: data,
+ headers: {
+ 'Content-Type': 'multipart/form-data', // 文件上传需要使用form-data
+ },
+ timeout: 60000, // 文件上传可能较慢
});
}
diff --git a/src/api/customerService/report/index.ts b/src/api/customerService/report/index.ts
index 43ce7ad..f36f9cf 100644
--- a/src/api/customerService/report/index.ts
+++ b/src/api/customerService/report/index.ts
@@ -8,3 +8,13 @@ export function getDataList(data: object) {
params: data,
});
}
+
+// 导出数据
+export function exportProduct(data: object) {
+ return newService({
+ url: '/customerService/data/statistics/export',
+ responseType: 'blob',
+ method: 'get',
+ params: data,
+ });
+}
diff --git a/src/views/customerService/product/component/importDialog.vue b/src/views/customerService/product/component/importDialog.vue
index c3ae637..0c1acd4 100644
--- a/src/views/customerService/product/component/importDialog.vue
+++ b/src/views/customerService/product/component/importDialog.vue
@@ -1,7 +1,12 @@
-
+
+
+
+
+
+
+ :file-list="fileList"
>
-
-
-
-
-
将ZIP文件拖到此处,或点击上传
-
上传ZIP文件批量导入产品(TXT格式)
-
+
+
+
+ 将ZIP文件拖到此处,或点击上传
+
+ 支持 .zip 格式,文件大小不超过 {{ fileSizeLimit }}MB
+
+
+
+
+ 文件已选择: {{ currentFile.name }} ({{ formatFileSize(currentFile.size) }})
+
+
+
-
+
-
-
- - 1. 请上传包含TXT格式产品数据的ZIP压缩包
- - 2. 文件编码请使用UTF-8
- - 3. 文件大小不能超过 {{ fileSizeLimit }}MB
- - 4. 导入前请确保数据格式正确
+
+
+ - 1. 请先下载导入模板,查看数据格式
+ - 2. 按照模板格式准备您的产品数据
+ - 3. 将TXT文件打包成ZIP格式上传
+ - 4. 文件编码请使用UTF-8
+ - 5. 文件大小不能超过 {{ fileSizeLimit }}MB
-
+
-
-
-
-
-
- 成功导入 {{ importResult.data.failCount === 0 ? '所有' : '部分' }} 产品数据
-
- 失败 {{ importResult.data.failCount }} 条记录
-
-
-
-
-
- {{ reason }}
-
-
-
-
-
-
- {{ importResult.message }}
-
-
-
@@ -89,22 +84,30 @@
\ No newline at end of file
+
+
+
diff --git a/src/views/customerService/product/index.vue b/src/views/customerService/product/index.vue
index 2b9db0b..35e375c 100644
--- a/src/views/customerService/product/index.vue
+++ b/src/views/customerService/product/index.vue
@@ -10,26 +10,26 @@
-
+
查询
-
+
新增产品
-
+
导入
-
+
导出
@@ -41,6 +41,13 @@
+
+
+
+ {{ row.rag_doc_id ? '已训练' : '未训练' }}
+
+
+
@@ -50,16 +57,20 @@
- {{ formatTime(row.createdAt) }}
+ {{ formatTime(row.updatedAt) }}
+
+
+ 训练
+
- 修改
+ 修改
- 删除
+ 删除
@@ -85,12 +96,13 @@
@@ -333,7 +326,6 @@ onMounted(() => {
width: 240px;
}
-// 表格操作按钮样式
:deep(.el-table) {
.el-button {
margin: 0 2px;
@@ -344,7 +336,6 @@ onMounted(() => {
}
}
-// 分页样式
:deep(.pagination-container) {
margin-top: 15px;
padding: 10px 0;
diff --git a/src/views/customerService/report/component/exportDialog.vue b/src/views/customerService/report/component/exportDialog.vue
new file mode 100644
index 0000000..28947ae
--- /dev/null
+++ b/src/views/customerService/report/component/exportDialog.vue
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/customerService/report/index.vue b/src/views/customerService/report/index.vue
index 17a4881..7d40143 100644
--- a/src/views/customerService/report/index.vue
+++ b/src/views/customerService/report/index.vue
@@ -73,6 +73,7 @@
@pagination="dataList"
/>
+
@@ -80,6 +81,7 @@
import { ref, reactive, onMounted, nextTick } from 'vue';
import { ElMessageBox, ElMessage, FormInstance } from 'element-plus';
import { getDataList } from '/@/api/customerService/report';
+import expotDialog from '/@/views/customerService/report/component/exportDialog.vue';
// 定义接口
interface TableDataRow {
@@ -227,10 +229,11 @@ const resetQuery = (formEl: FormInstance | undefined) => {
dataList();
});
};
-
+const expotDialogRef = ref();
// 导出数据
const handleExport = () => {
- ElMessage.info('导出功能开发中');
+ // ElMessage.info('导出功能开发中');
+ expotDialogRef.value?.openDialog(tableData.param);
};
// 初始化表格数据
diff --git a/src/views/customerService/script/index.vue b/src/views/customerService/script/index.vue
index e33ff41..cfbb26f 100644
--- a/src/views/customerService/script/index.vue
+++ b/src/views/customerService/script/index.vue
@@ -4,7 +4,22 @@
+
+
+
+
+
+
+
+ 查询
+
+
+
+
+
+ 重置
+
新增话术
@@ -78,6 +93,7 @@ interface ScriptItem {
interface TableParams {
pageNum: number;
pageSize: number;
+ tag: '';
}
interface TableState {
@@ -96,9 +112,27 @@ const tableData = reactive({
param: {
pageNum: 1,
pageSize: 10,
+ tag: '',
},
});
+/**
+ * 处理搜索
+ */
+const handleSearch = () => {
+ tableData.param.pageNum = 1; // 搜索时重置到第一页
+ loadTableData();
+};
+
+/**
+ * 重置查询条件
+ */
+const handleReset = () => {
+ // 重新获取数据
+ tableData.param = { pageNum: 1, pageSize: 10, tag: '' };
+ loadTableData();
+};
+
// ==================== 时间处理函数 ====================
/**