少量更改

This commit is contained in:
WUSIJIAN
2025-12-05 12:27:02 +08:00
parent c00342ae09
commit e41884fc60
5 changed files with 104 additions and 16 deletions

View File

@@ -135,7 +135,7 @@ const responseErrorHandler = (error: any) => {
if (error.message === 'Network Error') { if (error.message === 'Network Error') {
ElMessage.error('网络连接错误,请检查网络设置'); ElMessage.error('网络连接错误,请检查网络设置');
} else { } else {
ElMessage.error('网络异常,请检查连接'); // ElMessage.error('网络异常,请检查连接');
} }
return Promise.reject(error); return Promise.reject(error);
} }

View File

@@ -1,13 +1,20 @@
<template> <template>
<el-dialog title="是否导出产品" v-model="isShowDialog" width="400px"> <el-dialog title="导出产品数据" v-model="isShowDialog" width="450px" align-center>
<div style="text-align: center; padding: 20px 0"> <div class="export-content">
<p style="margin-bottom: 20px; font-size: 14px; color: #606266">确定要导出产品数据吗</p> <div class="export-icon">
<el-icon class="icon-download"><Download /></el-icon>
</div>
<p class="export-text">确定要导出产品数据吗</p>
<p class="export-tip">导出的文件将包含所有产品信息</p>
</div> </div>
<template #footer> <template #footer>
<span class="dialog-footer"> <div class="dialog-footer">
<el-button @click="isShowDialog = false">取消</el-button> <el-button @click="isShowDialog = false">取消</el-button>
<el-button type="primary" @click="handleExport" :loading="loading">导出</el-button> <el-button type="primary" @click="handleExport" :loading="loading">
</span> <el-icon><Download /></el-icon>
导出
</el-button>
</div>
</template> </template>
</el-dialog> </el-dialog>
</template> </template>
@@ -15,6 +22,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue'; import { ref } from 'vue';
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { Download } from '@element-plus/icons-vue';
import { exportProduct } from '/@/api/customerService/product'; import { exportProduct } from '/@/api/customerService/product';
const isShowDialog = ref(false); const isShowDialog = ref(false);
@@ -97,3 +105,39 @@ defineExpose({
openDialog, openDialog,
}); });
</script> </script>
<style lang="scss" scoped>
.export-content {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px 0;
.export-icon {
margin-bottom: 16px;
.icon-download {
font-size: 48px;
color: #409eff;
}
}
.export-text {
margin: 0 0 12px 0;
font-size: 16px;
font-weight: 500;
color: #303133;
}
.export-tip {
margin: 0;
font-size: 13px;
color: #909399;
}
}
.dialog-footer {
display: flex;
justify-content: flex-end;
gap: 8px;
}
</style>

View File

@@ -314,7 +314,7 @@ const generateTemplateZip = async (): Promise<Blob> => {
const zip = new JSZip(); const zip = new JSZip();
const templateFolder = zip.folder('产品导入模板'); const templateFolder = zip.folder('产品导入模板');
if (templateFolder) { if (templateFolder) {
templateFolder.file('产品基本信息模板.txt', createTextFile('产品名称:\n产品详情:', '产品基本信息模板.txt')); templateFolder.file('产品名称.txt', createTextFile('产品详情:', '产品名称.txt'));
// templateFolder.file('使用说明.txt', createTextFile('使用说明', '使用说明.txt')); // templateFolder.file('使用说明.txt', createTextFile('使用说明', '使用说明.txt'));
} }
return await zip.generateAsync({ type: 'blob', compression: 'DEFLATE' }); return await zip.generateAsync({ type: 'blob', compression: 'DEFLATE' });

View File

@@ -44,7 +44,7 @@
<el-table-column prop="rag_doc_id" label="已上传知识库" show-overflow-tooltip> <el-table-column prop="rag_doc_id" label="已上传知识库" show-overflow-tooltip>
<template #default="{ row }"> <template #default="{ row }">
<el-tag :type="row.rag_doc_id ? 'success' : 'info'" effect="light"> <el-tag :type="row.rag_doc_id ? 'success' : 'info'" effect="light">
{{ row.rag_doc_id ? '已训练' : '未训练' }} {{ row.rag_doc_id ? '' : '' }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
@@ -64,7 +64,7 @@
<el-table-column label="操作" width="220"> <el-table-column label="操作" width="220">
<template #default="scope"> <template #default="scope">
<el-button style="color: #67c23a" size="small" text type="primary" @click="onTrainProduct(scope.row)"> <el-button style="color: #67c23a" size="small" text type="primary" @click="onTrainProduct(scope.row)">
<el-icon><Mic /></el-icon>训练 <el-icon><Mic /></el-icon>上传
</el-button> </el-button>
<el-button style="color: deepskyblue" size="small" text type="primary" @click="onOpenEditRole(scope.row)"> <el-button style="color: deepskyblue" size="small" text type="primary" @click="onOpenEditRole(scope.row)">
<el-icon><EditPen /></el-icon>修改 <el-icon><EditPen /></el-icon>修改

View File

@@ -1,13 +1,20 @@
<template> <template>
<el-dialog title="是否导出产品" v-model="isShowDialog" width="400px"> <el-dialog title="导出产品数据" v-model="isShowDialog" width="450px" align-center>
<div style="text-align: center; padding: 20px 0"> <div class="export-content">
<p style="margin-bottom: 20px; font-size: 14px; color: #606266">确定要导数据吗</p> <div class="export-icon">
<el-icon class="icon-download"><Download /></el-icon>
</div>
<p class="export-text">确定要导出产品数据吗</p>
<p class="export-tip">导出的文件将包含所有产品信息</p>
</div> </div>
<template #footer> <template #footer>
<span class="dialog-footer"> <div class="dialog-footer">
<el-button @click="isShowDialog = false">取消</el-button> <el-button @click="isShowDialog = false">取消</el-button>
<el-button type="primary" @click="handleExport" :loading="loading">导出</el-button> <el-button type="primary" @click="handleExport" :loading="loading">
</span> <el-icon><Download /></el-icon>
导出
</el-button>
</div>
</template> </template>
</el-dialog> </el-dialog>
</template> </template>
@@ -15,6 +22,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue'; import { ref } from 'vue';
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { Download } from '@element-plus/icons-vue';
import { exportProduct } from '/@/api/customerService/report'; import { exportProduct } from '/@/api/customerService/report';
const isShowDialog = ref(false); const isShowDialog = ref(false);
@@ -97,3 +105,39 @@ defineExpose({
openDialog, openDialog,
}); });
</script> </script>
<style lang="scss" scoped>
.export-content {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px 0;
.export-icon {
margin-bottom: 16px;
.icon-download {
font-size: 48px;
color: #409eff;
}
}
.export-text {
margin: 0 0 12px 0;
font-size: 16px;
font-weight: 500;
color: #303133;
}
.export-tip {
margin: 0;
font-size: 13px;
color: #909399;
}
}
.dialog-footer {
display: flex;
justify-content: flex-end;
gap: 8px;
}
</style>