zss
2 天以前 c952123dc401b7d480dddeecc8cdad56ca4cf6c3
src/views/collaborativeApproval/knowledgeBase/index.vue
@@ -296,7 +296,7 @@
              <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
@@ -386,6 +386,10 @@
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 = {
@@ -555,6 +559,7 @@
    label: "创建时间",
    prop: "createTime",
    width: 180,
    dataType:"date"
  },
  {
    dataType: "action",
@@ -1142,11 +1147,24 @@
// ============ 知识库问答相关 ============
// 生成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 = "";
};
@@ -1240,7 +1258,7 @@
    }
  ).then(() => {
    messages.value = [];
    memoryId.value = crypto.randomUUID(); // 重新生成会话ID
    memoryId.value = generateUUID(); // 重新生成会话ID
    ElMessage.success("对话已清空");
  }).catch(() => {
    // 用户取消