| | |
| | | <span v-else style="color: #909399">-</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="createTime" label="上传时间" width="180" /> |
| | | <el-table-column prop="createTime" label="上传时间" width="120" :formatter="formatDate" /> |
| | | <el-table-column label="操作" width="150" align="center"> |
| | | <template #default="{ row }"> |
| | | <el-button |
| | |
| | | import useUserStore from '@/store/modules/user'; |
| | | import { userListNoPageByTenantId } from '@/api/system/user.js'; |
| | | import { getToken } from "@/utils/auth"; |
| | | import { parseDate } from "@/utils/ruoyi"; |
| | | |
| | | // 日期回显格式化(YYYY-MM-DD) |
| | | const formatDate = (row, column, cellValue) => parseDate(cellValue) || '-'; |
| | | |
| | | // 表单验证规则 |
| | | const rules = { |
| | |
| | | label: "创建时间", |
| | | prop: "createTime", |
| | | width: 180, |
| | | dataType:"date" |
| | | }, |
| | | { |
| | | dataType: "action", |
| | |
| | | |
| | | // ============ 知识库问答相关 ============ |
| | | |
| | | // 生成UUID的fallback方案 |
| | | const generateUUID = () => { |
| | | if (typeof crypto !== 'undefined' && crypto.randomUUID) { |
| | | return crypto.randomUUID(); |
| | | } |
| | | // fallback: 兼容不支持 crypto.randomUUID 的环境 |
| | | return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { |
| | | const r = Math.random() * 16 | 0; |
| | | const v = c === 'x' ? r : (r & 0x3 | 0x8); |
| | | return v.toString(16); |
| | | }); |
| | | }; |
| | | |
| | | // 打开问答弹窗 |
| | | const openChatDialog = (row) => { |
| | | currentKnowledgeBase.value = row; |
| | | chatDialogVisible.value = true; |
| | | memoryId.value = crypto.randomUUID(); |
| | | memoryId.value = generateUUID(); |
| | | messages.value = []; |
| | | inputQuestion.value = ""; |
| | | }; |
| | |
| | | } |
| | | ).then(() => { |
| | | messages.value = []; |
| | | memoryId.value = crypto.randomUUID(); // 重新生成会话ID |
| | | memoryId.value = generateUUID(); // 重新生成会话ID |
| | | ElMessage.success("对话已清空"); |
| | | }).catch(() => { |
| | | // 用户取消 |