Kaynağa Gözat

feat:新增会话,会话记录模块

charles 2 yıl önce
ebeveyn
işleme
a78f6ae9b4

+ 2 - 2
.idea/codeStyles/Project.xml

@@ -3,7 +3,7 @@
     <HTMLCodeStyleSettings>
       <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
     </HTMLCodeStyleSettings>
-    <JSCodeStyleSettings version="0">
+    <JSCodeStyleSettings>
       <option name="FORCE_SEMICOLON_STYLE" value="true" />
       <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
       <option name="FORCE_QUOTE_STYlE" value="true" />
@@ -11,7 +11,7 @@
       <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
       <option name="SPACES_WITHIN_IMPORTS" value="true" />
     </JSCodeStyleSettings>
-    <TypeScriptCodeStyleSettings version="0">
+    <TypeScriptCodeStyleSettings>
       <option name="FORCE_SEMICOLON_STYLE" value="true" />
       <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
       <option name="FORCE_QUOTE_STYlE" value="true" />

+ 197 - 0
npminstall-debug.log

@@ -0,0 +1,197 @@
+{
+  root: 'D:\\mydesktop\\nlg-resource\\flow\\flow_web',
+  registry: 'https://registry.npmmirror.com',
+  pkgs: [],
+  production: false,
+  cacheStrict: false,
+  cacheDir: 'C:\\Users\\charles\\.npminstall_tarball',
+  env: {
+    npm_config_registry: 'https://registry.npmmirror.com',
+    npm_config_argv: '{"remain":[],"cooked":["--fix-bug-versions","--china","--userconfig=C:\\\\Users\\\\charles\\\\.cnpmrc","--disturl=https://cdn.npmmirror.com/binaries/node","--registry=https://registry.npmmirror.com"],"original":["--fix-bug-versions","--china","--userconfig=C:\\\\Users\\\\charles\\\\.cnpmrc","--disturl=https://cdn.npmmirror.com/binaries/node","--registry=https://registry.npmmirror.com"]}',
+    npm_config_user_agent: 'npminstall/7.12.0 npm/? node/v16.19.1 win32 x64',
+    npm_config_cache: 'C:\\Users\\charles\\.npminstall_tarball',
+    NODE: 'C:\\Program Files\\nodejs\\node.exe',
+    npm_node_execpath: 'C:\\Program Files\\nodejs\\node.exe',
+    npm_execpath: 'D:\\install\\nvm\\v16.19.1\\node_modules\\cnpm\\node_modules\\npminstall\\bin\\install.js',
+    npm_config_userconfig: 'C:\\Users\\charles\\.cnpmrc',
+    npm_config_disturl: 'https://cdn.npmmirror.com/binaries/node',
+    npm_config_r: 'https://registry.npmmirror.com',
+    COREPACK_NPM_REGISTRY: 'https://registry.npmmirror.com',
+    EDGEDRIVER_CDNURL: 'https://npmmirror.com/mirrors/edgedriver',
+    NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
+    NVM_NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
+    PHANTOMJS_CDNURL: 'https://cdn.npmmirror.com/binaries/phantomjs',
+    CHROMEDRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/chromedriver',
+    OPERADRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/operadriver',
+    CYPRESS_DOWNLOAD_PATH_TEMPLATE: 'https://cdn.npmmirror.com/binaries/cypress/${version}/${platform}-${arch}/cypress.zip',
+    ELECTRON_MIRROR: 'https://cdn.npmmirror.com/binaries/electron/',
+    ELECTRON_BUILDER_BINARIES_MIRROR: 'https://cdn.npmmirror.com/binaries/electron-builder-binaries/',
+    SASS_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-sass',
+    SWC_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-swc',
+    NWJS_URLBASE: 'https://cdn.npmmirror.com/binaries/nwjs/v',
+    PUPPETEER_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
+    PUPPETEER_DOWNLOAD_BASE_URL: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
+    PLAYWRIGHT_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/playwright',
+    SENTRYCLI_CDNURL: 'https://cdn.npmmirror.com/binaries/sentry-cli',
+    SAUCECTL_INSTALL_BINARY_MIRROR: 'https://cdn.npmmirror.com/binaries/saucectl',
+    RE2_DOWNLOAD_MIRROR: 'https://cdn.npmmirror.com/binaries/node-re2',
+    RE2_DOWNLOAD_SKIP_PATH: 'true',
+    PRISMA_ENGINES_MIRROR: 'https://cdn.npmmirror.com/binaries/prisma',
+    npm_config_better_sqlite3_binary_host: 'https://cdn.npmmirror.com/binaries/better-sqlite3',
+    npm_config_keytar_binary_host: 'https://cdn.npmmirror.com/binaries/keytar',
+    npm_config_sharp_binary_host: 'https://cdn.npmmirror.com/binaries/sharp',
+    npm_config_sharp_libvips_binary_host: 'https://cdn.npmmirror.com/binaries/sharp-libvips',
+    npm_config_robotjs_binary_host: 'https://cdn.npmmirror.com/binaries/robotjs',
+    npm_rootpath: 'D:\\mydesktop\\nlg-resource\\flow\\flow_web',
+    INIT_CWD: 'D:\\mydesktop\\nlg-resource\\flow\\flow_web'
+  },
+  binaryMirrors: {
+    ENVS: {
+      COREPACK_NPM_REGISTRY: 'https://registry.npmmirror.com',
+      EDGEDRIVER_CDNURL: 'https://npmmirror.com/mirrors/edgedriver',
+      NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
+      NVM_NODEJS_ORG_MIRROR: 'https://cdn.npmmirror.com/binaries/node',
+      PHANTOMJS_CDNURL: 'https://cdn.npmmirror.com/binaries/phantomjs',
+      CHROMEDRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/chromedriver',
+      OPERADRIVER_CDNURL: 'https://cdn.npmmirror.com/binaries/operadriver',
+      CYPRESS_DOWNLOAD_PATH_TEMPLATE: 'https://cdn.npmmirror.com/binaries/cypress/${version}/${platform}-${arch}/cypress.zip',
+      ELECTRON_MIRROR: 'https://cdn.npmmirror.com/binaries/electron/',
+      ELECTRON_BUILDER_BINARIES_MIRROR: 'https://cdn.npmmirror.com/binaries/electron-builder-binaries/',
+      SASS_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-sass',
+      SWC_BINARY_SITE: 'https://cdn.npmmirror.com/binaries/node-swc',
+      NWJS_URLBASE: 'https://cdn.npmmirror.com/binaries/nwjs/v',
+      PUPPETEER_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
+      PUPPETEER_DOWNLOAD_BASE_URL: 'https://cdn.npmmirror.com/binaries/chrome-for-testing',
+      PLAYWRIGHT_DOWNLOAD_HOST: 'https://cdn.npmmirror.com/binaries/playwright',
+      SENTRYCLI_CDNURL: 'https://cdn.npmmirror.com/binaries/sentry-cli',
+      SAUCECTL_INSTALL_BINARY_MIRROR: 'https://cdn.npmmirror.com/binaries/saucectl',
+      RE2_DOWNLOAD_MIRROR: 'https://cdn.npmmirror.com/binaries/node-re2',
+      RE2_DOWNLOAD_SKIP_PATH: 'true',
+      PRISMA_ENGINES_MIRROR: 'https://cdn.npmmirror.com/binaries/prisma',
+      npm_config_better_sqlite3_binary_host: 'https://cdn.npmmirror.com/binaries/better-sqlite3',
+      npm_config_keytar_binary_host: 'https://cdn.npmmirror.com/binaries/keytar',
+      npm_config_sharp_binary_host: 'https://cdn.npmmirror.com/binaries/sharp',
+      npm_config_sharp_libvips_binary_host: 'https://cdn.npmmirror.com/binaries/sharp-libvips',
+      npm_config_robotjs_binary_host: 'https://cdn.npmmirror.com/binaries/robotjs'
+    },
+    '@ali/s2': { host: 'https://cdn.npmmirror.com/binaries/looksgood-s2' },
+    sharp: { replaceHostFiles: [Array], replaceHostMap: [Object] },
+    '@tensorflow/tfjs-node': {
+      replaceHostFiles: [Array],
+      replaceHostRegExpMap: [Object],
+      replaceHostMap: [Object]
+    },
+    cypress: {
+      host: 'https://cdn.npmmirror.com/binaries/cypress',
+      newPlatforms: [Object]
+    },
+    'utf-8-validate': {
+      host: 'https://cdn.npmmirror.com/binaries/utf-8-validate/v{version}'
+    },
+    xprofiler: {
+      remote_path: './xprofiler/v{version}/',
+      host: 'https://cdn.npmmirror.com/binaries'
+    },
+    leveldown: { host: 'https://cdn.npmmirror.com/binaries/leveldown/v{version}' },
+    couchbase: { host: 'https://cdn.npmmirror.com/binaries/couchbase/v{version}' },
+    gl: { host: 'https://cdn.npmmirror.com/binaries/gl/v{version}' },
+    sqlite3: {
+      host: 'https://cdn.npmmirror.com/binaries/sqlite3',
+      remote_path: 'v{version}'
+    },
+    '@journeyapps/sqlcipher': { host: 'https://cdn.npmmirror.com/binaries' },
+    grpc: {
+      host: 'https://cdn.npmmirror.com/binaries',
+      remote_path: '{name}/v{version}'
+    },
+    'grpc-tools': { host: 'https://cdn.npmmirror.com/binaries' },
+    wrtc: {
+      host: 'https://cdn.npmmirror.com/binaries',
+      remote_path: '{name}/v{version}'
+    },
+    fsevents: { host: 'https://cdn.npmmirror.com/binaries/fsevents' },
+    nodejieba: { host: 'https://cdn.npmmirror.com/binaries/nodejieba' },
+    canvas: { host: 'https://cdn.npmmirror.com/binaries/canvas' },
+    'skia-canvas': { host: 'https://cdn.npmmirror.com/binaries/skia-canvas' },
+    'flow-bin': {
+      replaceHost: 'https://github.com/facebook/flow/releases/download/v',
+      host: 'https://cdn.npmmirror.com/binaries/flow/v'
+    },
+    'jpegtran-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/jpegtran-bin'
+    },
+    'cwebp-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/cwebp-bin'
+    },
+    'zopflipng-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/zopflipng-bin'
+    },
+    'optipng-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/optipng-bin'
+    },
+    mozjpeg: {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/mozjpeg-bin'
+    },
+    gifsicle: {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/gifsicle-bin'
+    },
+    'pngquant-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/pngquant-bin',
+      replaceHostMap: [Object]
+    },
+    'pngcrush-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/pngcrush-bin'
+    },
+    'jpeg-recompress-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/jpeg-recompress-bin'
+    },
+    'advpng-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/advpng-bin'
+    },
+    'pngout-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/pngout-bin'
+    },
+    'jpegoptim-bin': {
+      replaceHost: [Array],
+      host: 'https://cdn.npmmirror.com/binaries/jpegoptim-bin'
+    },
+    argon2: { host: 'https://cdn.npmmirror.com/binaries/argon2' },
+    'ali-zeromq': { host: 'https://cdn.npmmirror.com/binaries/ali-zeromq' },
+    'ali-usb_ctl': { host: 'https://cdn.npmmirror.com/binaries/ali-usb_ctl' },
+    'gdal-async': { host: 'https://cdn.npmmirror.com/binaries/node-gdal-async' },
+    'libpg-query': { host: 'https://cdn.npmmirror.com/binaries' }
+  },
+  forbiddenLicenses: null,
+  flatten: false,
+  proxy: undefined,
+  prune: false,
+  disableFallbackStore: false,
+  workspacesMap: Map(0) {},
+  enableWorkspace: false,
+  workspaceRoot: 'D:\\mydesktop\\nlg-resource\\flow\\flow_web',
+  isWorkspaceRoot: true,
+  isWorkspacePackage: false,
+  offline: false,
+  strictSSL: true,
+  ignoreScripts: false,
+  foregroundScripts: false,
+  ignoreOptionalDependencies: false,
+  detail: false,
+  forceLinkLatest: false,
+  trace: false,
+  engineStrict: false,
+  registryOnly: false,
+  client: false,
+  autoFixVersion: [Function: autoFixVersion]
+}

+ 10 - 3
package.json

@@ -29,6 +29,11 @@
       "prettier --write"
     ]
   },
+  "pnpm": {
+    "overrides": {
+      "@babel/helper-module-imports": "~7.22.15"
+    }
+  },
   "dependencies": {
     "@arco-design/web-vue": "^2.44.7",
     "@vueuse/core": "^9.3.0",
@@ -36,18 +41,20 @@
     "axios": "^0.24.0",
     "dayjs": "^1.11.5",
     "echarts": "^5.4.0",
+    "js-base64": "^3.7.5",
+    "jsencrypt": "^3.3.2",
     "lodash": "^4.17.21",
     "mitt": "^3.0.0",
+    "moment": "^2.30.1",
     "nprogress": "^0.2.0",
     "pinia": "^2.0.23",
     "query-string": "^8.0.3",
+    "sass": "^1.77.8",
     "sortablejs": "^1.15.0",
     "vue": "^3.2.40",
     "vue-echarts": "^6.2.3",
     "vue-i18n": "^9.2.2",
-    "vue-router": "^4.0.14",
-    "js-base64": "^3.7.5",
-    "jsencrypt": "^3.3.2"
+    "vue-router": "^4.0.14"
   },
   "devDependencies": {
     "@arco-plugins/vite-vue": "^1.4.5",

Dosya farkı çok büyük olduğundan ihmal edildi
+ 223 - 4949
pnpm-lock.yaml


+ 2 - 2
src/api/interceptor.ts

@@ -51,7 +51,7 @@ axios.interceptors.response.use(
     const res = response.data;
 
     // if the custom code is not 20000, it is judged as an error.
-    if ((res.retcode && res.retcode !== 0) || (res.code && res.code !== 20000)) {
+    /*if ((res.retcode && res.retcode !== 0) || (res.code && res.code !== 20000)) {
       Message.error({
         content: res.msg || 'Error',
         duration: 5 * 1000,
@@ -79,7 +79,7 @@ axios.interceptors.response.use(
 
     if(response.config.url === '/v1/user/login'|| response.config.url === '/base/login')  {
       setAuthorization(response.headers.authorization);
-    }
+    }*/
     return res;
   },
   (error) => {

+ 16 - 1
src/api/kbList.ts

@@ -64,10 +64,25 @@ export function querykbupdate(params) {
 
 // 文档上传接口
 
+// export function kbdocumentupload(params) {
+//   return axios.post('/api/v1/document/upload', params);
+// }
+
 export function kbdocumentupload(params) {
-  return axios.post('/api/v1/document/upload', params);
+  const config = {
+    headers: {
+      'Content-Type': 'application/x-www-form-urlencoded',
+      // token: token,
+    },
+  }
+  return axios.post(
+    '/api/v1/document/upload',
+    params,
+    config
+  )
 }
 
+
 // 文档启动/取消解析接口
 
 export function kbdocumentrun(params) {

+ 14 - 4
src/components/menu/index.vue

@@ -2,12 +2,11 @@
   import { defineComponent, ref, h, compile, computed } from 'vue';
   import { useI18n } from 'vue-i18n';
   import { useRoute, useRouter, RouteRecordRaw } from 'vue-router';
-  import type { RouteMeta } from 'vue-router';
+  import type ,{ RouteMeta } from 'vue-router';
   import { useAppStore } from '@/store';
   import { listenerRouteChange } from '@/utils/route-listener';
   import { openWindow, regexUrl } from '@/utils';
   import useMenuTree from './use-menu-tree';
-
   export default defineComponent({
     emit: ['collapse'],
     setup() {
@@ -43,10 +42,21 @@
           selectedKey.value = [item.name as string];
           return;
         }
+        const firstMenuNameArr=['model','knowledge','session','sessionRecords'];
+        const suffix='Manager';
+        if(firstMenuNameArr.indexOf(item.name)!=-1){
+          router.push({
+            name: `${item.name}${suffix}`,
+          });
+        } else{
+          router.push({
+            name: item.name,
+          });
+        }
         // Trigger router change
-        router.push({
+       /* router.push({
           name: item.name,
-        });
+        });*/
       };
       const findMenuOpenKeys = (target: string) => {
         const result: string[] = [];

+ 2 - 0
src/locale/zh-CN.ts

@@ -41,6 +41,8 @@ export default {
   'menu.server.dashboard': '仪表盘-服务端',
   'menu.server.workplace': '工作台-服务端',
   'menu.server.monitor': '实时监控-服务端',
+  'menu.session':'会话',
+  'menu.sessionRecords':'会话记录',
   'menu.list': '列表页',
   'menu.result': '结果页',
   'menu.exception': '异常页',

+ 50 - 106
src/views/dmx/knowledgeLib/add.vue

@@ -9,27 +9,36 @@
   <a-modal v-model:visible="visible" title="上传文件" @before-open="handleOpened" @cancel="handleCancel" @before-ok="handleBeforeOk" title-align="start">
     <a-tabs :default-active-key="activeKey" @change="activeKeyChange">
       <a-tab-pane key="1" title="文件">
-        <div class="aUpload">
-<!--          <a-upload :file-list="uploadList" draggable accept=".word, .pdf, .ppt, .excel, .txt, .zip, .rar, .7z, .doc, .docx, .xls, .xlsx, .pptx, .ppt, .pdf, .mp4, .avi, .mp3,.wav, .wma, .wmv, .rm," :custom-request="customRequest" />-->
-          <a-upload :file-list="uploadList" draggable :accept="acceptNameList" :custom-request="customRequest" />
-        </div>
       </a-tab-pane>
       <a-tab-pane key="2" title="文件夹">
-        <div class="aUpload">
-          <a-upload :file-list="uploadList" draggable accept=".word, .pdf, .ppt, .excel, .txt, .zip, .rar, .7z, .doc, .docx, .xls, .xlsx, .pptx, .ppt,"  directory   :custom-request="customRequest" />
-        </div>
       </a-tab-pane>
     </a-tabs>
+    <div class="aUpload">
+      <!--          <a-upload :file-list="uploadList" draggable accept=".word, .pdf, .ppt, .excel, .txt, .zip, .rar, .7z, .doc, .docx, .xls, .xlsx, .pptx, .ppt, .pdf, .mp4, .avi, .mp3,.wav, .wma, .wmv, .rm," :custom-request="customRequest" />-->
+      <a-upload
+        action="/"
+        :auto-upload="false"
+        ref="uploadRef"
+        :file-list="uploadList"
+        draggable
+        :directory="directory"
+        @change="onChange"
+        multiple
+      />
+    </div>
   </a-modal>
 </template>
 
 <script lang="ts" setup>
 import { onMounted, onBeforeMount, reactive, ref, computed } from "vue";
 import axios from 'axios';
+import { kbdocumentupload } from "@/api/kbList";
+import { Message } from '@arco-design/web-vue';
 let CancelToken = axios.CancelToken
 let source = null
 const visible = ref(false);
 const loading = ref(false);
+const directory = ref(false);
 const activeKey = ref('1');
 const formRef = ref(null);
 const uploadList = ref([]);
@@ -39,130 +48,65 @@ const form = reactive({
   post: '',// 岗位
   txt: '',// 备注
 });
+const props =  defineProps(['kbobj'])
+const emit =  defineEmits(['changeFetchData'])
+const uploadRef = ref();
+const files = ref([]);
+console.log(props.kbobj);
 const acceptNameList = computed(
   ()=>{
     return '.word, .pdf, .ppt, .excel, .txt, .zip, .rar, .7z, .doc, .docx, .xls, .xlsx, .pptx, .ppt, .pdf, .mp4, .avi, .mp3,.wav, .wma, .wmv, .rm,'
   }
 )
-const customRequest = (option) => {
-  const {onProgress, onError, onSuccess, fileItem, name} = option
-  const xhr = new XMLHttpRequest();
-  if (xhr.upload) {
-    xhr.upload.onprogress = function (event) {
-      let percent;
-      if (event.total > 0) {
-        // 0 ~ 1
-        percent = event.loaded / event.total;
-      }
-      onProgress(percent, event);
-    };
-  }
-  xhr.onerror = function error(e) {
-    onError(e);
-  };
-  xhr.onload = function onload() {
-    if (xhr.status < 200 || xhr.status >= 300) {
-      return onError(xhr.responseText);
-    }
-    onSuccess(xhr.response);
-  };
-
-  const formData = new FormData();
-  formData.append(name || 'file', fileItem.file);
-  xhr.open('post', '/v1/user/login', true);
-  xhr.send(formData);
-
-  return {
-    abort() {
-      xhr.abort()
-    }
+// 上传文件
+const submitForm = async()=>{
+  if (files.value && files.value.length > 0) {
+    files.value.map((item) => {
+      const formData = new FormData()
+      formData.append(name || 'file', item.file);
+      formData.append('kb_id', props.kbobj.id);
+      kbdocumentupload(formData).then((res) => {
+        if(res.code == 0){
+          emit('changeFetchData')
+          Message.success('上传成功');
+          visible.value = false;
+        }
+      })
+    })
   }
+}
+
+const handleSubmit = ({values, errors}) => {
+
+}
+
+
+const onChange = (fileList) => {
+  files.value = fileList;
 };
-// 上传文件
-// async submitForm = ()=>{
-//   if (this.fileList && this.fileList.length > 0) {
-//     source = CancelToken.source()
-//     this.fileUploadLoad = true
-//     const formdata = new FormData()
-//     let param = {
-//       userName: this.userInfo.userName,
-//       userId: this.userInfo.userID,
-//       cfeId: this.currow.conferences[0].id,
-//     }
-//     this.fileList.map((item) => {
-//       formdata.append('file', item.raw)
-//     })
-//     uploadCfeFile(
-//       { param, formdata },
-//       (progressEvent) => {
-//         let total = progressEvent.total
-//         let loaded = progressEvent.loaded
-//         this.uploadPercent = parseInt(((loaded / total) * 100).toFixed(0))
-//       },
-//       source
-//     )
-//       .then((res) => {
-//         if (res.data.code === '0') {
-//           //上传成功
-//           this.$successMessage(
-//             this.translateTitle(
-//               'json_fileupload.json_file_tip.json_file_tip08'
-//             )
-//           )
-//           this.fileList = []
-//           this.$refs.upload.clearFiles()
-//           this.queryList()
-//         } else {
-//           this.$errorMessage(res.data.message)
-//         }
-//         this.fileUploadLoad = false
-//         this.uploadPercent = 0
-//       })
-//       .catch((error) => {
-//         this.fileUploadLoad = false
-//         this.uploadPercent = 0
-//         if (axios.isCancel(error)) {
-//           //已终止上传
-//           this.$errorMessage(
-//             this.translateTitle(
-//               'json_fileupload.json_file_tip.json_file_tip09'
-//             )
-//           )
-//         } else {
-//           this.$errorMessage('文件大小超过限制,上传失败')
-//         }
-//       })
-//   } else {
-//     //请选择要上传的文件
-//     this.$warningMessage(
-//       this.translateTitle('json_fileupload.json_file_tip.json_file_tip10')
-//     )
-//   }
-// }
 
 
 
-const handleSubmit = ({values, errors}) => {
-  console.log('values:', values, '\nerrors:', errors)
-}
+
+
 
 const handleClick = () => {
   visible.value = true;
 };
 const handleBeforeOk = (done) => {
-
+  submitForm();
 };
 const handleCancel = () => {
   visible.value = false;
 }
 
 const handleOpened =(el) => {
+  console.log(props.kbobj);
   uploadList.value = [];
-  console.log(uploadList, 'uploadList');
-  console.log(activeKey.value, 'activeKey');
 }
 const activeKeyChange = (value)=>{
   activeKey.value = value;
+  directory.value = value == '2' ? true : false;
 }
 onBeforeMount(()=>{
 

+ 28 - 14
src/views/dmx/knowledgeLib/index.vue

@@ -53,7 +53,7 @@
                             style="width: 200px;margin-right: 10px"
                           />
                           <!--            新建-->
-                          <add />
+                          <add :kbobj="kbobj" @changeFetchData="changeFetchData"/>
                         </a-col>
                       </a-row>
                     </a-form>
@@ -292,7 +292,7 @@ import {
   queryKbDocumentList,
   deleteKnow,
   queryKbdetail,
-  queryKbtenantInfo, kbdocumentrm, kbdocumentchangeparser
+  queryKbtenantInfo, kbdocumentrm, kbdocumentchangeparser, kbdocumentrun
 } from "@/api/kbList";
   import { Pagination } from '@/types/global';
   import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface';
@@ -333,13 +333,15 @@ import { parseTime } from "@/utils";
   let visible = ref(false)
   let detailsShow = ref(false)
   let selectedTab = ref(0)
+  let kbobj = reactive({})
   let tabs = ref([])
 
   const  selectTab = (index,item) => {
     selectedTab.value= index;
     console.log(item.id);
+    kbobj= item
     fetchData({
-      kb_id: item.id,
+      kb_id: kbobj.id,
       page: 1,
       page_size: 20
     })
@@ -505,8 +507,9 @@ import { parseTime } from "@/utils";
       tabs.value = data;
       console.log(tabs.value, 'tabs');
       if(tabs.value.length>0 && tabs.value[0]){
+        kbobj = tabs.value[0]
         fetchData({
-          kb_id: tabs.value[0].id,
+          kb_id: kbobj.id,
           page: 1,
           page_size: 20
         })
@@ -523,10 +526,6 @@ import { parseTime } from "@/utils";
   };
 
   const deleteKnowledge = async (id) => {
-
-
-
-
     let data = await deleteKnow({
       kb_id:id
     })
@@ -615,18 +614,27 @@ const   deleteItem =  async (row)=>{
     let data = await kbdocumentrm({doc_id: row.id})
     if(data.code == 0){
       Message.success('删除成功');
-      knowledgeData()
+      console.log(kbobj, 'kbobj');
+      fetchData({
+        kb_id: kbobj.id,
+        page: 1,
+        page_size: 20
+      })
     }
   }
 
 const   run =  async (row)=>{
   console.log(row);
   row.loading = true;
-  let data = await kbdocumentchangeparser({
-    parser_id: row.parser_id,
-    doc_id: row.id,
-    parser_config: row.parser_config,
+  let data = await kbdocumentrun({
+    doc_ids: [row.id],
+    run: '1'
   })
+  // let data = await kbdocumentchangeparser({
+  //   parser_id: row.parser_id,
+  //   doc_id: row.id,
+  //   parser_config: row.parser_config,
+  // })
   if(data.code == 0){
     Message.success('解析成功');
     row.run = '3';
@@ -637,7 +645,13 @@ const   run =  async (row)=>{
   row.loading = false;
 }
 
-
+const   changeFetchData =  async (row)=>{
+  fetchData({
+    kb_id: kbobj.id,
+    page: 1,
+    page_size: 20
+  })
+}
   watch(
     () => columns.value,
     (val) => {

+ 14 - 7
src/views/session/sessionManager/index.vue

@@ -4,7 +4,7 @@
     import img2 from '@/assets/images/u69.png'
     import img3 from '@/assets/images/u74.png';
     import AddSession from './components/addSession.vue'
-    import { ref, onMounted, computed, reactive, nextTick } from 'vue';
+    import { ref, onMounted, computed, reactive, nextTick,watch } from 'vue';
     import { useUserStore,useAppStore } from '@/store';
     import { sessionListApi, deleteSessionApi,getSessionDetailsApi,chatApi }from '@/api/session';
     import { Message } from '@arco-design/web-vue';
@@ -88,6 +88,8 @@
                 sessionDetailList.value=res.data.message.map((item,index)=>{
                     if(index===res.data.message.length-1){
                         item.role='last';
+                        displayedText.value='';
+                        currIndex.value=0;
                         streamStr.value=item.content;
                         startDisplayStr();
                     }
@@ -103,7 +105,7 @@
     onMounted(()=>{
        initData();
     });
-    //文字一个一个输出
+    //文字动态输出
     const startDisplayStr = () => {
         if (timer) {
             clearTimeout(timer!);
@@ -119,7 +121,13 @@
             timer = null
         }
     }
-
+    watch(() => scrollbar.value, (newScroll, oldScroll) => {
+      if (newScroll) {
+        // 获取a-scroll的高度
+        const height = newScroll.$el.offsetHeight;
+        console.log('a-scroll height changed to:', height);
+      }
+    },{deep:true})
 </script>
 
 <template>
@@ -222,16 +230,15 @@
                                 avatar="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/9eeb1800d9b78349b24682c3518ac4a3.png~tplv-uwbnlip3yd-webp.webp"
                             >
                                 <template #content>
-                                    <a-card class="chat-item-answer"  style="background-color: rgba(63, 64, 79, 1);">
-                                        <div :class="{light:theme==='light'}"> {{displayedText}}</div>
-                                    </a-card>
+                                    <a-textarea readonly auto-size v-model="displayedText" class="chat-item-answer"  style="background-color: rgba(63, 64, 79, 1);">
+                                    </a-textarea>
                                 </template>
                             </a-comment>
                         </div>
                     </a-scrollbar>
                     <div class="bottom">
                         <div class="input">
-                            <a-input v-model="inputMsg">
+                            <a-input v-model="inputMsg" @keydown.enter="sendMessage">
                             <template #suffix>
                                 <icon-send  style="cursor: pointer" @click="sendMessage"/>
                             </template>

+ 1 - 1
src/views/sessionRecords/sessionRecordsManager/index.vue

@@ -42,7 +42,7 @@
                             <a-button type="primary" shape="round" class="card-btn-1" @click="modalObj.add=true">
                                 +新建会话
                             </a-button>
-                            <a-button type="default" shape="circle" class="card-btn-2">
+                            <a-button type="text" shape="circle" class="card-btn-2">
                                 <icon-search />
                             </a-button>
                         </div>

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor