浏览代码

国际化翻译

lzw 3 月之前
父节点
当前提交
14e6d26a65

+ 31 - 31
src/components/pages/knowledge/components/testBox.vue

@@ -3,21 +3,21 @@
         <div class="test_right">
             <div class="test_input_box" :class="{focus: isFocused}">
                 <div class="setting">
-                    <el-tooltip content="知识库搜索配置" placement="bottom" effect="dark">
+                    <el-tooltip :content=lang.knowSearchConfig placement="bottom" effect="dark">
                         <!-- content to trigger tooltip here -->
                         <i @click="openSetting"></i>
                         <!-- <span>知识库搜索配置</span> -->
                     </el-tooltip>
                 </div>
-                <el-input class="test_input" type="textarea" :rows="8" v-model="value" placeholder="输入需要测试的文本"
+                <el-input class="test_input" type="textarea" :rows="8" v-model="value" :placeholder=lang.inputTestText
                     resize="none" @focus="isFocused = true" @blur="isFocused = false">
                 </el-input>
                 <el-button class="btn" type="primary" size="mini" @click="testCheck"
-                    v-loading="isLoading">测试</el-button>
+                    v-loading="isLoading">{{lang.test}}</el-button>
             </div>
 
             <div class="test_history" v-loading="isLoading2">
-                <div class="title">测试记录</div>
+                <div class="title">{{lang.testRecord}}</div>
                 <div class="test_history_box" v-for="(item, index) in ragArray" :key="index" @click="checkRag(item)"
                     :class="{ acitve: item.id == ragJson.id }">
                     <div class="typeIcon" :class="{
@@ -35,11 +35,11 @@
         </div>
         <div class="test_left">
             <div class="test_check" v-if="Object.keys(ragJson).length">
-                <div class="title">测试参数</div>
+                <div class="title">{{lang.testParameters}}</div>
                 <div class="can_box">
                     <div class="can_one" v-if="ragJson.setting">
                         <div class="one_box">
-                            <span>搜索方式</span>
+                            <span>{{lang.searchWay}}</span>
                             <span class="typeIcon" :class="{
                                 type1: ragJson.setting.useType == 1,
                                 type2: ragJson.setting.useType == 2,
@@ -47,27 +47,27 @@
                             }">{{ getUseType(ragJson.setting.useType) }}</span>
                         </div>
                         <div class="one_box">
-                            <span>引用上限</span>
+                            <span>{{lang.citations}}</span>
                             <span>{{ ragJson.setting.tokens }}</span>
                         </div>
                         <div class="one_box">
-                            <span>最低相关度</span>
+                            <span>{{lang.minRelevance}}</span>
                             <span>{{ ragJson.setting.temperature }}</span>
                         </div>
                     </div>
                     <div class="can_one" v-if="ragJson.setting" style="margin-top: 10px">
                         <div class="one_box">
-                            <span>测试文本</span>
+                            <span>{{lang.testText}}</span>
                             <span>{{ ragJson.setting.query }}</span>
                         </div>
                     </div>
                 </div>
             </div>
             <div class="test_result" v-if="Object.keys(ragJson).length">
-                <div class="title">测试结果</div>
+                <div class="title">{{lang.testResult}}</div>
                 <div v-if="ragJson.json && ragJson.json.chunkSearchResults" class="result_box">
                     <div v-for="(item, index) in ragJson.json.chunkSearchResults" :key="index" class="result">
-                        <el-tooltip content="通过计算向量之间的距离获取得分,范围为0~1。" placement="bottom" effect="dark">
+                        <el-tooltip :content=lang.distance placement="bottom" effect="dark">
                             <div class="result_score">
                                 {{ getUseType(ragJson.setting.useType) }}
                                 {{ item.score.toFixed(4) }}
@@ -75,7 +75,7 @@
                         </el-tooltip>
 
                         <div class="vditor-reset" style="font-size: 14px;" v-html="MarkdownT(item.text)"></div>
-                        <el-tooltip content="点击查看来源" placement="bottom" effect="dark">
+                        <el-tooltip :content=lang.viewFrom placement="bottom" effect="dark">
                             <div class="result_file" @click="downloadFile(item.documentId, item.metadata.title)">
                                 {{ item.metadata.title }}
                             </div>
@@ -87,25 +87,25 @@
                 <div style="height: 50px; line-height: 50px; width: 47.4px">
                     <img style="width: 100%" src="../../../../assets/flieKong.svg" alt="" />
                 </div>
-                <div style="margin-top: 10px">测试结果将在这里展示</div>
+                <div style="margin-top: 10px">{{lang.teResultArea}}</div>
             </div>
         </div>
         <el-dialog title="新建文件夹" :visible.sync="moveBox" width="650px" style="border-radius: 8px"
             @close="moveBox = false" class="canEditCss">
             <div class="canEditTit" slot="title">
                 <img src="../../../../assets/icon/testC/dialog_setting.svg" alt="" />
-                <span>知识库搜索配置</span>
+                <span>{{lang.knowSearchConfig}}</span>
             </div>
             <div style="width: 100%; padding: 10px 40px; box-sizing: border-box;">
                 <div class="setting_nav">
                     <div class="setting_nav_box searchIcon active">
-                        <span>搜索过滤</span>
+                        <span>{{lang.searchFiltration}}</span>
                     </div>
                 </div>
                 <div class="setting_serach">
                     <div class="setting_serach_box">
-                        <span class="title">引用上限
-                            <el-tooltip content="单次搜索最大的 token 数量,中文约1字=1.7tokens,英文约1字=1token" placement="bottom" effect="dark" popper-class="maxWidth">
+                        <span class="title">{{lang.citations}}
+                            <el-tooltip :content=lang.token placement="bottom" effect="dark" popper-class="maxWidth">
                                     <!-- content to trigger tooltip here -->
                                     <i class="tips"></i>
                                 </el-tooltip>
@@ -116,8 +116,8 @@
                             min="100" max="20000" step="1"></el-input-number>
                     </div>
                     <div class="setting_serach_box">
-                        <span class="title">最低相关度
-                            <el-tooltip content="不同索引模型的相关度有区别,请通过搜索测试来选择合适的数值。使用 结果重排 时,使用重排结果进行过滤。" placement="bottom" effect="dark" popper-class="maxWidth">
+                        <span class="title">{{this.lang.minRelevance}}
+                            <el-tooltip :content=lang.refiltering placement="bottom" effect="dark" popper-class="maxWidth">
                                     <!-- content to trigger tooltip here -->
                                     <i class="tips"></i>
                                 </el-tooltip>
@@ -130,8 +130,8 @@
                 </div>
             </div>
             <span slot="footer">
-                <el-button @click="moveBox = false">取 消</el-button>
-                <el-button type="primary" @click="confirmSetting">确 定</el-button>
+                <el-button @click="moveBox = false">{{lang.cancel}}</el-button>
+                <el-button type="primary" @click="confirmSetting">{{this.lang.confirm}}</el-button>
             </span>
         </el-dialog>
     </div>
@@ -179,11 +179,11 @@ export default {
         getUseType() {
             return function (e) {
                 if (e == 1) {
-                    return "语义检索";
+                    return this.lang.semanticRetrieval;
                 } else if (e == 2) {
-                    return "全文检索";
+                    return this.lang.fullTextSearch;
                 } else if (e == 2) {
-                    return "混合检索";
+                    return this.lang.mixSearch;
                 }
             };
         },
@@ -261,12 +261,12 @@ export default {
                     link.click();
                     link.remove();
                     this.$message({
-                        message: "下载成功",
+                        message: this.lang.downloadSuccess,
                         type: "success",
                     });
                 })
                 .catch((err) => {
-                    this.$message.error("下载失败");
+                    this.$message.error(this.lang.downloadFail);
                     console.error(err);
                 });
         },
@@ -277,9 +277,9 @@ export default {
             this.ragJson = item;
         },
         deleteRag(id) {
-            this.$confirm("确定删除该记录嘛?", "提示", {
-                confirmButtonText: "确定",
-                cancelButtonText: "取消",
+            this.$confirm(this.lang.sureDeRecord, this.lang.prompt, {
+                confirmButtonText: this.lang.confirm,
+                cancelButtonText: this.lang.cancel,
                 type: "warning",
             })
                 .then(() => {
@@ -292,13 +292,13 @@ export default {
                         .post(this.$store.state.fileApi + "delRagData", params)
                         .then((res) => {
                             this.$message({
-                                message: "删除成功",
+                                message: this.lang.deleteSuccess,
                                 type: "success",
                             });
                             this.getRagData();
                         })
                         .catch((err) => {
-                            this.$message.error("删除失败");
+                            this.$message.error(this.lang.deleteFail);
                             console.error(err);
                         });
                 })

+ 47 - 47
src/components/pages/knowledge/fileBox.vue

@@ -21,7 +21,7 @@
           v-if="$parent.barNam == 1"
           v-model="checkFolderid"
           :options="myFolderArray2"
-          :placeholder="'请选择文件夹'"
+          :placeholder=this.lang.selectFolder
           style="width: 250px;"
           @change="serchFile()"
         />
@@ -30,7 +30,7 @@
           style="width: 120px;margin-left: 10px"
           v-loading="!userArray.length"
           v-model="user"
-          placeholder="拥有者"
+          :placeholder=this.lang.owner
           clearable
           filterable
           @change="serchFile2()"
@@ -49,7 +49,7 @@
           <input
             type="text"
             v-model="fileName"
-            placeholder="请输入你需要搜索的文件名字"
+            :placeholder=this.lang.selectFileName
             @input="debouncedSearch"
           />
         </div>
@@ -58,12 +58,12 @@
           style="background-color: rgb(51, 112, 255);"
             >
           <img style="vertical-align: middle;transform: scale(1.1);padding-bottom: 2px;box-sizing: border-box;" src="../../../assets/shuax.svg" alt="">
-            刷新</el-button
+            {{lang.flushed}}</el-button
           >
           <el-button v-if="pid.split('/')[0] == '0'" type="primary" size="small" @click="addImg($event)"
           icon="el-icon-plus"
           style="background-color: rgb(51, 112, 255);"
-            >上传文件
+            >{{lang.uploadFile}}
             <input
               type="file"
               accept="*"
@@ -72,14 +72,14 @@
               @change="beforeUpload($event)"
           /></el-button>
           <el-button style="background: #F56C6C;" type="danger" size="small" v-if="checkArray.length" @click="batchDelete"
-            >删除</el-button
+            >{{lang.delete}}</el-button
           >
-          <span v-if="checkArray.length" style="margin-left: 12px;color: #b0b0b0;font-size: 14px;flex-shrink:0;line-height: 35px;">已选文件{{checkArray.length}}个</span>
+          <span v-if="checkArray.length" style="margin-left: 12px;color: #b0b0b0;font-size: 14px;flex-shrink:0;line-height: 35px;">{{lang.selectedFiles}}{{checkArray.length}}{{lang.piece}}</span>
 
       </div>
       </div>
     </div>
-    <div class="none_box" v-if="fileArray.length == 0">暂无上传文件</div>
+    <div class="none_box" v-if="fileArray.length == 0">{{lang.nouploadFiles}}</div>
     <div
       class="f_box_file_list"
       v-else-if="stype == '2' && fileArray.length"
@@ -103,43 +103,43 @@
           ></el-table-column>
           <el-table-column
             prop="name"
-            label="文件名"
+            :label=lang.fileName
             show-overflow-tooltip
             min-width="15"
           ></el-table-column>
           <el-table-column
             prop="folderName"
-            label="所属文件夹"
+            :label=lang.folderBelongs
             show-overflow-tooltip
             min-width="20"
           ></el-table-column>
           <el-table-column
             prop="username"
-            label="拥有者"
+            :label=lang.owner
             show-overflow-tooltip
             width="120"
           ></el-table-column>
          
-          <el-table-column label="切片分类" width="120px">
+          <el-table-column :label=lang.sliceClassification width="120px">
             <template slot-scope="scope">
               {{ getState(scope.row.ingestionStatus) }}
             </template>
           </el-table-column>
-          <el-table-column label="图谱提取" width="120px">
+          <el-table-column :label=lang.graphExtraction width="120px">
             <template slot-scope="scope">
               {{ getState2(scope.row.extractionStatus) }}
             </template>
           </el-table-column>
           <el-table-column
             prop="documentType"
-            label="文件类型"
+            :label=lang.fileType
             show-overflow-tooltip
             width="120"
           ></el-table-column>
           <!-- <el-table-column label="公开状态" show-overflow-tooltip width="80px"></el-table-column> -->
           <el-table-column
             prop="time"
-            label="上传时间"
+            :label=lang.uploadTime
             show-overflow-tooltip
             min-width="20"
           ></el-table-column>
@@ -172,7 +172,7 @@
                         style="width: 14px;"
                         :src="isHover ? tqList2 : tqList" 
                          alt="">
-                        <span :class="isHover ? 'lookHp2' : 'lookHp1'">提取</span>
+                        <span :class="isHover ? 'lookHp2' : 'lookHp1'">{{lang.extract}}</span>
                       </div>
                       <!-- <el-button
                         type="text"
@@ -190,7 +190,7 @@
                         <img 
                         :src="isHover2 ? look2 : look1" 
                          alt="">
-                        <span :class="isHover2 ? 'lookHp2' : 'lookHp1'">查看</span>
+                        <span :class="isHover2 ? 'lookHp2' : 'lookHp1'">{{lang.view}}</span>
                       </div>
                       <div class="btnBh" 
                       @click="downloadFile(scope.row)"
@@ -200,7 +200,7 @@
                         <img 
                         :src="isHover3 ? download2 : download" 
                          alt="">
-                        <span :class="isHover3 ? 'lookHp2' : 'lookHp1'">下载</span>
+                        <span :class="isHover3 ? 'lookHp2' : 'lookHp1'">{{lang.download}}</span>
                       </div>
                     </div>
                     <div style="background-color: #e7e7e7;width: 100%;height: .5px;margin: 5px 0;"></div>
@@ -216,7 +216,7 @@
                       @click="deleteFile(scope.row.id, scope.row.documentid)"
                       v-if="scope.row.userid == userid">
                         <img src="../../../assets/listdel.svg" alt="">
-                        <span style="color: #DE4C41;">删除</span>
+                        <span style="color: #DE4C41;">{{lang.delete}}</span>
                       </div>
                     </div>
               </div>
@@ -241,7 +241,7 @@
       <div v-if="proVisible" class="mask">
         <div class="progressBox">
           <div class="lbox">
-            小可正在上传中,请稍后<img src="../../../assets/KekeLoading.gif" />
+            {{lang.uploadWait}}<img src="../../../assets/KekeLoading.gif" />
           </div>
           <div class="lbox_count">{{ pcount }} / {{ ptotal }}</div>
         </div>
@@ -370,17 +370,17 @@ export default {
     getState() {
       return function(item) {
         if (item == "success") {
-          return "成功";
+          return this.lang.success;
         } else if (item == "failed") {
-          return "失败";
+          return this.lang.fail;
         } else if (item == "augmenting") {
-          return "切片中";
+          return this.lang.sliced;
         } else if (item == "pending") {
-          return "待处理";
+          return this.lang.pending;
         } else if (item == "enriched") {
           return "enriched";
         } else if (!item) {
-          return "切片中";
+          return this.lang.sliced;
         } else {
           return item;
         }
@@ -389,17 +389,17 @@ export default {
     getState2() {
       return function(item) {
         if (item == "success") {
-          return "成功";
+          return this.lang.success;
         } else if (item == "failed") {
-          return "失败";
+          return this.lang.fail;
         } else if (item == "pending") {
-          return "待处理";
+          return this.lang.pending;
         } else if (item == "processing") {
-          return "处理中";
+          return this.lang.processing;
         } else if (item == "enriched") {
           return "enriched";
         } else if (!item) {
-          return "上传中";
+          return this.lang.uploading;
         } else {
           return item;
         }
@@ -507,7 +507,7 @@ export default {
             .toLowerCase();
 
           if (!allowedExtensions.includes(fileExtension)) {
-            this.$message.error(`不支持的文件格式: ${file.name}`);
+            this.$message.error(`${this.lang.unsupFileformats}: ${file.name}`);
             await new Promise(resolve => setTimeout(resolve, 1000)); // 延迟1秒再跳过
             continue; // 跳过不支持的文件
           }
@@ -535,7 +535,7 @@ export default {
         }
         setTimeout(() => {
           this.proVisible = false;
-          this.$message.success("操作完成");
+          this.$message.success(this,lang.operComplete);
           this.getData(); // 在上传完所有文件后再调用getData
         }, 1000);
       };
@@ -554,7 +554,7 @@ export default {
           console.log(res, formData);
           const message = res.data.results && res.data.results.message;
           const status = message === 'Document created and ingested successfully.' ? 'success' : 'failed';
-          const msg = message === 'Document created and ingested successfully.' ? '切片成功' : '切片失败';
+          const msg = message === 'Document created and ingested successfully.' ? this.lang.sliceSuccess : this.lang.sliceFail;
           this.$message({
             message: msg,
             type: status == 'success' ? status : 'error'
@@ -570,7 +570,7 @@ export default {
             });
           }, 1000);
         }).catch(err => {
-          this.$message.error('上传失败')
+          this.$message.error(this.lang.uploadFail)
           this.fileArray.forEach(e => {
             if (e.documentid === uuid) {
               e.ingestionStatus = 'failed';
@@ -591,7 +591,7 @@ export default {
         ]);        
       } catch (err) {
         console.error(err);
-        this.$message.error("上传失败");
+        this.$message.error(this.lang.uploadFail);
       }
     },
     formatFileSize(bytes) {
@@ -606,9 +606,9 @@ export default {
       }
     },
     deleteFile(fileid, documentid) {
-      this.$confirm("确定删除该文件吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
+      this.$confirm(this.lang.deleteFile, this.lang.prompt, {
+        confirmButtonText: this.lang.confirm,
+        cancelButtonText: this.lang.cancel,
         type: "warning"
       })
         .then(() => {
@@ -622,7 +622,7 @@ export default {
             .post(this.$store.state.fileApi + "deleteFile", params)
             .then(res => {
               this.$message({
-                message: "删除成功",
+                message: this.lang.deleteSuccess,
                 type: "success"
               });
               this.checkArray = [];
@@ -631,7 +631,7 @@ export default {
               this.getData();
             })
             .catch(err => {
-              this.$message.error("删除失败");
+              this.$message.error(this.lang.deleteFail);
               console.error(err);
             });
         })
@@ -639,7 +639,7 @@ export default {
     },
     batchDelete() {
       if (!this.checkArray.length) {
-        this.$message.warning("请选择要删除的文件");
+        this.$message.warning(this.lang.selectDeFile);
         return;
       }
       let array = this.checkArray2.map(item => item.id);
@@ -647,7 +647,7 @@ export default {
       this.deleteFile(array.join(","), array2.join(","));
     },
     checkFile(row) {
-      if (row.ingestionStatus != "success") return this.$message.info('文件未上传成功,点击刷新查看实时状态')
+      if (row.ingestionStatus != "success") return this.$message.info(this.lang.fileUploadFail)
 
       this.$refs.checkDialog.openG(row.documentid);
     },
@@ -666,17 +666,17 @@ export default {
         link.click();
         link.remove();
         this.$message({
-          message: "下载成功",
+          message: this.lang.downloadSuccess,
           type: "success"
         });
       }).catch(err => {
-        this.$message.error("下载失败");
+        this.$message.error(this.lang.downloadFail);
         console.error(err);
       });
     },
 
     extractFile(row) {
-      if (row.ingestionStatus != "success") return this.$message.info('文件未上传成功,点击刷新查看实时状态')
+      if (row.ingestionStatus != "success") return this.$message.info(this.lang.fileUploadFail)
       
       let params = {
         documentid: row.documentid
@@ -703,7 +703,7 @@ export default {
             this.getData();
           }, 1000)
         }).catch(err => {
-          this.$message.error('提取失败')
+          this.$message.error(this.lang.extrFailed)
           this.fileArray.forEach(e => {
             if (e.documentid === row.documentid) {
               e.extractionStatus = 'failed';
@@ -712,7 +712,7 @@ export default {
           console.error(err);
         });
         console.log(res.data);
-        this.$message.success("提取文件中");
+        this.$message.success(this.lang.extractingFile);
         this.getData();
       } catch (err) {
         console.error(err);

+ 50 - 50
src/components/pages/knowledge/folder.vue

@@ -14,7 +14,7 @@
           style="margin-right: 10px; width: 100px;"
           v-loading="tagLoading1"
           v-model="check1"
-          placeholder="学科"
+          :placeholder= lang.subject
           clearable
           filterable
           collapse-tags
@@ -31,7 +31,7 @@
           style="margin-right: 10px; width: 100px;"
           v-loading="tagLoading2"
           v-model="check2"
-          placeholder="年级"
+          :placeholder=lang.grade
           clearable
           filterable
           @change="serchFile()"
@@ -48,7 +48,7 @@
           style="width: 100px;"
           v-loading="tagLoading3"
           v-model="check3"
-          placeholder="自定义"
+          :placeholder=lang.customize
           clearable
           filterable
           @change="serchFile()"
@@ -65,7 +65,7 @@
           style="width: 120px;"
           v-loading="isLoading"
           v-model="user"
-          placeholder="拥有者"
+          :placeholder=lang.owner
           clearable
           filterable
           @change="serchFile()"
@@ -90,7 +90,7 @@
           <input
             type="text"
             v-model="fileName"
-            placeholder="请输入你需要搜索的文件夹名字"
+            :placeholder=lang.search
             @input="debouncedSearch"
           />
         </div>
@@ -98,17 +98,17 @@
           <el-button v-if="pid.split('/')[0] == '0'" type="primary"
           style="background-color: #3370FF;height: 38px;" size="small" @click="openAdd"
           icon="el-icon-plus"
-            >新建文件夹</el-button>
+            >{{lang.newFolder}}</el-button>
           <el-button  style="height: 38px;margin-right: 12px;background: #F56C6C;" type="danger" v-if="checkArray.length && stype2 == 2" size="small" @click="deleteFolder"
-            >删除</el-button
+            >{{lang.delete}}</el-button
           >
-          <span v-if="checkArray.length && stype2 == 2" style="margin-right: 10px;color: #b0b0b0;font-size: 14px;flex-shrink:0;">已选文件夹{{checkArray.length}}个</span>
+          <span v-if="checkArray.length && stype2 == 2" style="margin-right: 10px;color: #b0b0b0;font-size: 14px;flex-shrink:0;">{{lang.selectedFolders}}{{checkArray.length}}{{lang.piece}}</span>
         </div>
       </div>
     </div>
     
     <div class="none_box" v-if="fileArray.length == 0">
-      暂无文件夹
+      {{lang.noFolder}}
     </div>
     <div
       class="f_box_file_list"
@@ -128,7 +128,7 @@
             
           </div>
           <div class="listDetail">
-            <span v-if="!item.detail">暂无描述~</span>
+            <span v-if="!item.detail">{{lang.noDesc}}~</span>
             <div class="listDetail2" v-else>
               {{ item.detail }} 
             </div>
@@ -175,7 +175,7 @@
                           :src="isHover ? look2 : look1" 
                           
                         >
-                        <span :class="isHover ? 'lookHp2' : 'lookHp1'">查看</span>
+                        <span :class="isHover ? 'lookHp2' : 'lookHp1'">{{lang.view}}</span>
                       </div>
                       <!-- </el-button
                     > -->
@@ -193,7 +193,7 @@
                         <img 
                         :src="isHover2 ? copy1 : copy2" 
                          alt="">
-                        <span :class="isHover2 ? 'lookHp2' : 'lookHp1'">复制</span>
+                        <span :class="isHover2 ? 'lookHp2' : 'lookHp1'">{{lang.copy}}</span>
                       </div>
                       <!-- </el-button > -->
                   </div>
@@ -214,7 +214,7 @@
                       @click="deleteFile(item.id, item.folderid,1)"
                        v-if="item.userid == userid && item.isMo == '2'">
                         <img src="../../../assets/listdel.svg" alt="">
-                        <span style="color: #DE4C41;">删除</span>
+                        <span style="color: #DE4C41;">{{lang.delete}}</span>
                       </div>
                        <!-- </el-button
                     > -->
@@ -248,40 +248,40 @@
           ></el-table-column>
           <el-table-column
             prop="name"
-            label="文件夹名字"
+            :label=lang.folderName
             show-overflow-tooltip
             min-width="15"
           ></el-table-column>
           <el-table-column
             prop="detail"
-            label="描述"
+            :label=lang.description
             show-overflow-tooltip
             min-width="20"
           ></el-table-column>
           <el-table-column
             prop="fileCount"
-            label="文件数"
+            :label=lang.fileNumber
             width="120px"
           ></el-table-column>
           <el-table-column
             prop="username"
-            label="拥有者"
+            :label=lang.owner
             show-overflow-tooltip
             width="120"
           ></el-table-column>
-          <el-table-column label="标签"  show-overflow-tooltip min-width="10">
+          <el-table-column :label=lang.tag  show-overflow-tooltip min-width="10">
             <template slot-scope="scope">
               {{ getTag(scope.row) }}
             </template>
           </el-table-column>
-          <el-table-column label="公开权限" width="120px">
+          <el-table-column :label=lang.publicPermissions width="120px">
             <template slot-scope="scope">
               {{ getJuri(scope.row.juri) }}
             </template>
           </el-table-column>
           <el-table-column
             prop="time"
-            label="编辑时间"
+            :label=lang.editTime
             min-width="15"
           ></el-table-column>
           <el-table-column align="center"  width="100px">
@@ -304,7 +304,7 @@
                           :src="isHover ? look2 : look1" 
                           
                         >
-                        <span :class="isHover ? 'lookHp2' : 'lookHp1'">查看</span>
+                        <span :class="isHover ? 'lookHp2' : 'lookHp1'">{{lang.view}}</span>
                       </div>
                       <!-- <el-button
                         @click="editFile(scope.row.id, scope.row.folderid)"
@@ -321,7 +321,7 @@
                         <img 
                         :src="isHover2 ? copy1 : copy2" 
                           alt="">
-                        <span :class="isHover2 ? 'lookHp2' : 'lookHp1'">复制</span>
+                        <span :class="isHover2 ? 'lookHp2' : 'lookHp1'">{{lang.copy}}</span>
                       </div>
                       <!-- <el-button
                         @click="copyFolder(scope.row)"
@@ -342,7 +342,7 @@
                         @click="deleteFile(scope.row.id, scope.row.folderid)"
                         v-if="scope.row.userid == userid && scope.row.isMo == '2'">
                           <img src="../../../assets/listdel.svg" alt="">
-                          <span style="color: #DE4C41;">删除</span>
+                          <span style="color: #DE4C41;">{{lang.delete}}</span>
                         </div>
                       <!-- <el-button
                         @click="deleteFile(scope.row.id, scope.row.folderid)"
@@ -383,7 +383,7 @@
       </el-pagination>
     </div>
     <el-dialog
-      title="新建文件夹"
+      :title=lang.newFolder
       :visible.sync="moveBox"
       width="550px"
       style="border-radius: 8px;"
@@ -392,26 +392,26 @@
     >
     <div class="canEditTit" slot="title">
       <img src="../../../assets/listfolder2.svg" alt="">
-      <span>新建文件夹</span>
+      <span>{{lang.newFolder}}</span>
     </div>
 
       <div>
         <el-input
           v-model="folderName"
-          placeholder="请输入知识库名称"
+          :placeholder="lang.knowledgeName"
         ></el-input>
         <el-input
           v-model="folderDescription"
           type="textarea"
           rows="4"
           resize="none"
-          placeholder="请输入知识库描述"
+          :placeholder=lang.knowledgeDesc
           style="margin-top: 10px;"
         ></el-input>
       </div>
       <span slot="footer">
-        <el-button @click="moveBox = false">取 消</el-button>
-        <el-button type="primary" @click="createFolder(2)">确 定</el-button>
+        <el-button @click="moveBox = false">{{ lang.cancel }}</el-button>
+        <el-button type="primary" @click="createFolder(2)">{{ lang.confirm }}</el-button>
       </span>
     </el-dialog>
   </div>
@@ -576,26 +576,26 @@ export default {
     retrunType() {
       return function(item) {
         if (item.type == 1) {
-          return "OFFICE文件";
+          return this.lang.office;
         } else if (item.type == 2) {
-          return "视频文件";
+          return this.lang.video;
         } else if (item.type == 3) {
-          return "图片";
+          return this.lang.img;
         } else if (item.type == 4) {
-          return "PDF文件";
+          return this.lang.pdf;
         } else if (item.type == 5) {
-          return "其他文件";
+          return this.lang.other;
         }
       };
     },
     getJuri() {
       return function(juri) {
         if (juri == 1) {
-          return "私有";
+          return this.lang.private;
         } else if (juri == 2) {
-          return "组织";
+          return this.lang.organization;
         } else if (juri == 3) {
-          return "公开";
+          return this.lang.public;
         }
       };
     },
@@ -668,8 +668,8 @@ export default {
           if (
             type[0] == "0" && res.data[1].length == 0
           ) {
-            this.folderName = "默认文件夹";
-            this.folderDescription = "该文件夹为系统创设,将自动关联您所有上传的文件";
+            this.folderName = this.lang.defaultFolder;
+            this.folderDescription = this.lang.defaultFolderDesc;
             this.createFolder(1);
           }
           if(res.data[2].length != 0){
@@ -702,9 +702,9 @@ export default {
     },
     deleteFile(id, folderid,val) {
       
-      this.$confirm("确定删除文件夹吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
+      this.$confirm(this.lang.confirmDelete, this.lang.prompt, {
+        confirmButtonText: this.lang.confirm,
+        cancelButtonText: this.lang.cancel,
         type: "warning"
       })
         .then(() => {
@@ -713,7 +713,7 @@ export default {
             .post(this.$store.state.fileApi + "deleteFolder", params)
             .then(res => {
               this.$message({
-                message: "删除成功",
+                message: this.lang.deleteSuccess,
                 type: "success"
               });
               this.checkArray = [];
@@ -724,7 +724,7 @@ export default {
               this.getData();
             })
             .catch(err => {
-              this.$message.error("删除失败");
+              this.$message.error(this.lang.deleteFail);
               console.error(err);
             });
         })
@@ -745,20 +745,20 @@ export default {
         .then(res => {
           this.isLoading = false;
           this.$message({
-            message: "复制成功",
+            message: this.lang.copySuccess,
             type: "success"
           });
           this.getData()
         })
         .catch(err => {
           this.isLoading = false;
-          this.$message.error("复制失败");
+          this.$message.error(this.lang.copyFail);
           console.error(err);
         });
     },
     deleteFolder() {
       if (!this.checkArray.length) {
-        this.$message.warning("请选择要删除的文件夹");
+        this.$message.warning(this.lang.selectDeFolder);
         return;
       }
       let array = this.checkArray2.map(item => item.id);
@@ -775,7 +775,7 @@ export default {
     },
     createFolder(im) {
       if (!this.folderName) {
-        this.$message.error("文件夹名字必填");
+        this.$message.error(this.lang.folderNameMust);
         return;
       }
       let params = [
@@ -790,14 +790,14 @@ export default {
         .post(this.$store.state.fileApi + "addFolder", params)
         .then(res => {
           this.$message({
-            message: "创建成功",
+            message: this.lang.createSuccess,
             type: "success"
           });
           this.moveBox = false;
           this.getData();
         })
         .catch(err => {
-          this.$message.error("删除失败");
+          this.$message.error(this.lang.deleteFail);
           console.error(err);
         });
     },

+ 43 - 43
src/components/pages/knowledge/folderDetail.vue

@@ -31,16 +31,16 @@
         <div class="t_btn" v-if="userid == data.userid && data.isMo == '2'">
            <div v-if="userid == data.userid && data.isMo == '2'" @click="copyFolder">
             <img style="height: 14px; margin-right: 8px;" src="../../../assets/copyFlieG2.svg" alt="">
-            复制
+            {{lang.copy}}
            </div>
            <div v-if="userid == data.userid && data.isMo == '2'"  @click="deleteFile(pid.split('/')[1])">
             <img style="width: 16px;margin-right: 8px;transform: scale(.9);" src="../../../assets/delFlieG.svg" alt="">
-            删除
+            {{lang.delete}}
            </div>
         </div>
         <div class="detail">
           <div class="detail_box">
-            {{ !data.detail ? '暂无描述' : data.detail }}
+            {{ !data.detail ? lang.noDesc : data.detail }}
           </div>
         </div>
 
@@ -52,7 +52,7 @@
         <div 
         style="font-size: 12px;font-family: PingFang;color: #111824;margin-bottom: 12px;font-weight: 600;"
         v-if="check1.length || check2.length || check3.length"
-        >标签</div>
+        >{{ lang.tag }}</div>
         <!-- data.userid == userid &&  -->
         <div class="tag_box" v-if="data.isMo == '2'">
           <div class="tag" v-loading="tagLoading1">
@@ -81,21 +81,21 @@
 
 
         <div style="font-size: 12px;font-family: PingFang;color: #111824;margin-bottom: 12px;font-weight: 600;">
-          权限管理
+          {{lang.permissions}}
         </div>
 
             <div class="flieTag">
               <div v-if="data.juri == 1">
                 <img src="../../../assets/siyou1.svg" alt="">
-                <span>私有</span>
+                <span>{{lang.private}}</span>
               </div>
               <div v-if="data.juri == 2">
                 <img src="../../../assets/siyou3.svg" alt="">
-                <span>组织</span>
+                <span>{{lang.organization}}</span>
               </div>
               <div v-if="data.juri == 3">
                 <img src="../../../assets/siyou2.svg" alt="">
-                <span>公开</span>
+                <span>{{lang.public}}</span>
               </div>
             </div>
         </div>
@@ -103,15 +103,15 @@
         <div class="tag_box" v-else-if="false">
           <div class="tag_check">
             <div class="tag_check_box" v-if="this.check1.length">
-              <span>学科:</span>
+              <span>{{lang.subject}}:</span>
               <span>{{ getTagName(1) }}</span>
             </div>
             <div class="tag_check_box" v-if="this.check2.length">
-              <span>年级:</span>
+              <span>{{lang.grade}}:</span>
               <span>{{ getTagName(2) }}</span>
             </div>
             <div class="tag_check_box" v-if="this.check3.length">
-              <span>自定义:</span>
+              <span>{{lang.customize}}:</span>
               <span>{{ getTagName(3) }}</span>
             </div>
           </div>
@@ -127,47 +127,47 @@
 
           <div class="canEditTit" slot="title">
             <img src="../../../assets/listfolder2.svg" alt="">
-            <span>编辑</span>
+            <span>{{ lang.edit }}</span>
           </div>
 
-          <div class="canEditFileName">文件名</div>
-          <el-input v-model="fileDetail.name" placeholder="输入文件夹名字"></el-input>
+          <div class="canEditFileName">{{lang.fileName}}</div>
+          <el-input v-model="fileDetail.name" :placeholder=lang.inputName></el-input>
 
-          <div class="canEditFileName">描述</div>
+          <div class="canEditFileName">{{lang.description}}</div>
           <el-input
             type="textarea"
             :autosize="{ minRows: 2, maxRows: 4}"
-            placeholder="输入文件夹描述"
+            :placeholder=lang.inputDesc
             v-model="fileDetail.detail">
           </el-input>
 
-          <div class="canEditFileName">学科标签</div>
+          <div class="canEditFileName">{{lang.subjectTag}}</div>
           <selectTag
             v-loading="tagLoading1"
             v-model="fileDetailCheck1"
             :options="tagData1"
-            :placeholder="'请选择学科标签'"
+            :placeholder=lang.seTagType
             style="width: 65%"
           />
           <!-- @change="updateFolder()" -->
           
-          <div class="canEditFileName">年级标签</div>
+          <div class="canEditFileName">{{lang.gradeTag}}</div>
           <selectTag
             v-loading="tagLoading2"
             v-model="fileDetailCheck2"
             :options="tagData2"
-            :placeholder="'请选择年级标签'"
+            :placeholder=lang.seGradeTag
             style="width: 65%; "
             clearable
           />
           <!-- @change="updateFolder()" -->
 
-          <div class="canEditFileName">自定义标签:</div>
+          <div class="canEditFileName">{{lang.customTag}}:</div>
           <selectTag2
             v-loading="tagLoading3"
             v-model="fileDetailCheck3"
             :options="tagData3"
-            :placeholder="'自定义标签'"
+            :placeholder=lang.customTag
             style="width: 65%;"
             allow-create
             filterable
@@ -176,22 +176,22 @@
             @deleteTag="deleteTag"
           />
           <!-- @change="handleTagChange" -->
-          <div class="canEditFileName" style="margin-bottom: 9px;">权限管理</div>
+          <div class="canEditFileName" style="margin-bottom: 9px;">{{ lang.permissions }}</div>
           
           <div class="tag" >
               <div class="tag_check">
                 <el-radio-group  v-model="fileDetail.juri" >
-                  <el-radio label="1">私有</el-radio>
-                  <el-radio label="2">组织</el-radio>
-                  <el-radio label="3">公开</el-radio>
+                  <el-radio label="1">{{lang.private}}</el-radio>
+                  <el-radio label="2">{{lang.organization}}</el-radio>
+                  <el-radio label="3">{{lang.public}}</el-radio>
                 </el-radio-group>
               </div>
           </div>
           <!-- disabled @change="updateFolder()" -->
 
         <span slot="footer" class="dialog-footer">
-          <el-button @click="canEdit = false">取 消</el-button>
-          <el-button type="primary" @click="modifyDetail">确 定</el-button>
+          <el-button @click="canEdit = false">{{lang.cancel}}</el-button>
+          <el-button type="primary" @click="modifyDetail">{{lang.confirm}}</el-button>
         </span>
       </el-dialog>
   </div>
@@ -341,7 +341,7 @@ export default {
     },
     modifyDetail(){
       if (!this.fileDetail.name.trim()) {
-        this.$message.error("文件夹名字不能为空");
+        this.$message.error(this.lang.folderNameMust);
         return;
       }
 
@@ -362,7 +362,7 @@ export default {
       this.ajax
         .post(this.$store.state.fileApi + "updateFolder", [params])
         .then(res => {
-          this.$message.success("修改成功");
+          this.$message.success(this.lang.updateSuccess);
           this.canEdit=false
           this.getData();
         })
@@ -448,9 +448,9 @@ export default {
         });
     },
     deleteFile(id) {
-      this.$confirm("确定删除文件夹吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
+      this.$confirm(this.lang.confirmDelete, this.lang.prompt, {
+        confirmButtonText: this.lang.confirm,
+        cancelButtonText: this.lang.cancel,
         type: "warning"
       })
         .then(() => {
@@ -459,13 +459,13 @@ export default {
             .post(this.$store.state.fileApi + "deleteFolder", params)
             .then(res => {
               this.$message({
-                message: "删除成功",
+                message: this.lang.deleteSuccess,
                 type: "success"
               });
               this.$emit("checkType", this.pid.split("/")[0]);
             })
             .catch(err => {
-              this.$message.error("删除失败");
+              this.$message.error(this.lang.deleteFail);
               console.error(err);
             });
         })
@@ -489,14 +489,14 @@ export default {
         .then(res => {
           this.isLoading = false;
           this.$message({
-            message: "复制成功",
+            message: this.lang.copySuccess,
             type: "success"
           });
           this.$emit("checkType", this.pid.split("/")[0]);
         })
         .catch(err => {
           this.isLoading = false;
-          this.$message.error("复制失败");
+          this.$message.error(this.lang.copyFail);
           console.error(err);
         });
     },
@@ -515,7 +515,7 @@ export default {
     },
     updateFolder() {
       if (!this.data.name.trim()) {
-        this.$message.error("文件夹名字不能为空");
+        this.$message.error(this.lang.folderNameMust);
         this.canEdit = true;
         return;
       }
@@ -536,7 +536,7 @@ export default {
       this.ajax
         .post(this.$store.state.fileApi + "updateFolder", [params])
         .then(res => {
-          this.$message.success("修改成功");
+          this.$message.success(this.lang.updateSuccess);
           this.getData();
         })
         .catch(err => {
@@ -583,9 +583,9 @@ export default {
         });
     },
     deleteTag(id, n) {
-      this.$confirm("确定删除这个标签吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
+      this.$confirm(this.lang.confirmDeTag, this.lang.prompt, {
+        confirmButtonText: this.lang.confirm,
+        cancelButtonText: this.lang.cancel,
         type: "warning"
       })
         .then(() => {
@@ -597,7 +597,7 @@ export default {
           this.ajax
             .post(this.$store.state.api + "deleteTag", [params])
             .then(res => {
-              this.$message.success("删除成功");
+              this.$message.success(this.lang.deleteSuccess);
               this.getTag(3);
             })
             .catch(err => {

+ 57 - 57
src/components/pages/knowledge/folderFileBox.vue

@@ -3,14 +3,14 @@
     <div class="f_box_top">
       <div class="f_box_top_left">
         <el-breadcrumb separator="/">
-          <el-breadcrumb-item style="color: #000;font-weight: 600;"><span @click="goBackPage">根目录</span></el-breadcrumb-item>
+          <el-breadcrumb-item style="color: #000;font-weight: 600;"><span @click="goBackPage">{{lang.rootDirectory}}</span></el-breadcrumb-item>
           <el-breadcrumb-item>{{ data.name }}</el-breadcrumb-item>
         </el-breadcrumb>
       <!-- <div class="f_box_top_title">文件</div> -->
       </div>
       <div class="f_box_top_center">
-        <span :class="{active: fileType == 1}" @click="checkType(1)">文件数据</span>
-        <span :class="{active: fileType == 2}" @click="checkType(2)">召回测试</span>
+        <span :class="{active: fileType == 1}" @click="checkType(1)">{{lang.fileData}}</span>
+        <span :class="{active: fileType == 2}" @click="checkType(2)">{{lang.backTest}}</span>
       </div>
     </div>
     <div class="f_box_top_right" v-if="fileType == 1">
@@ -19,7 +19,7 @@
         <input
           type="text"
           v-model="fileName"
-          placeholder="请输入你需要搜索的文件名字"
+          :placeholder=lang.selectFileName
           @input="debouncedSearch"
         />
         <div class="serch"></div>
@@ -28,10 +28,10 @@
       <el-button type="primary" size="small" @click="serchFile"
         >
         <img style="vertical-align: middle;transform: scale(1.1);padding-bottom: 2px;box-sizing: border-box;" src="../../../assets/shuax.svg" alt="">
-        刷新</el-button
+        {{lang.flushed}}</el-button
       >
       <el-button v-if="userid == data.userid" type="primary" icon="el-icon-plus" size="small" @click="addImg($event)"
-        >上传文件
+        >{{ lang.uploadFile }}
         <input
           type="file"
           accept="*"
@@ -46,20 +46,20 @@
         v-if="userid == data.userid && data.isMo == '2'"
         >
         <img style="vertical-align: middle;" src="../../../assets/ETL.svg" alt="">
-        关联文件</el-button
+        {{lang.associatedFiles}}</el-button
       >
 
       <el-button type="primary"  v-if="checkArray.length && userid == data.userid " size="small" @click="batchRemove"
         >
         <img style="vertical-align: middle;padding-bottom: 3px;" src="../../../assets/yichuBtn.svg" alt="">
-        移除</el-button
+        {{lang.remove}}</el-button
       >
       <el-button type="danger" style="background: #F56C6C;" v-if="checkArray.length && userid == data.userid " size="small" @click="batchDelete"
         >
         <img style="vertical-align: middle;padding-bottom: 3px;" src="../../../assets/delBtn.svg" alt="">
-        删除</el-button
+        {{lang.delete}}</el-button
       >
-      <div v-if="checkArray.length" style="margin-left: 12px;color: #b0b0b0;font-size: 14px;flex-shrink: 0;line-height: 35px;">已选文件{{checkArray.length}}个</div>
+      <div v-if="checkArray.length" style="margin-left: 12px;color: #b0b0b0;font-size: 14px;flex-shrink: 0;line-height: 35px;">{{lang.selectedFiles}}{{checkArray.length}}{{lang.piece}}</div>
 
       <!-- <div class="btn" @click="serchFile">刷新</div>
       <div class="btn" @click="addImg($event)">
@@ -105,7 +105,7 @@
             <div style="height: 50px;line-height: 50px;width: 47.4px;">
               <img style="width: 100%;" src="../../../assets/flieKong.svg" alt="">
             </div>
-            <div style="height: 50px;line-height: 40px;">暂无数据内容...</div>
+            <div style="height: 50px;line-height: 40px;">{{lang.noDataContent}}</div>
           </div>
         </template>
           <el-table-column
@@ -115,35 +115,35 @@
           ></el-table-column>
           <el-table-column
             prop="name"
-            label="文件名"
+            :label=lang.fileName
             show-overflow-tooltip
             min-width="15"
           ></el-table-column>
           <el-table-column
             prop="folderName"
-            label="所属文件夹"
+            :label=lang.folderBelongs
             show-overflow-tooltip
             min-width="20"
           ></el-table-column>
           <el-table-column
             prop="username"
-            label="拥有者"
+            :label=lang.owner
             show-overflow-tooltip
             width="120"
           ></el-table-column>
           
-          <el-table-column label="切片分类" width="120px">
+          <el-table-column :label=lang.sliceClassification width="120px">
             <template slot-scope="scope">
               {{ getState(scope.row.ingestionStatus) }}
             </template>
           </el-table-column>
-          <el-table-column label="图谱提取" width="120px">
+          <el-table-column :label=lang.graphExtraction width="120px">
             <template slot-scope="scope">
               {{ getState2(scope.row.extractionStatus) }}
             </template>
           </el-table-column>
           <el-table-column
-            label="文件类型"
+            :label=lang.fileType
             show-overflow-tooltip
             width="120"
           >
@@ -154,11 +154,11 @@
           <!-- <el-table-column label="公开状态" show-overflow-tooltip width="80px"></el-table-column> -->
           <el-table-column
             prop="time"
-            label="上传时间"
+            :label=lang.uploadTime
             show-overflow-tooltip
             min-width="20"
           ></el-table-column>
-          <el-table-column label="操作" width="100px">
+          <el-table-column :label=lang.operate width="100px">
             <template slot-scope="scope">
               <el-popover
                   placement="bottom-end"
@@ -187,7 +187,7 @@
                         style="width: 14px;"
                         :src="isHover ? tqList2 : tqList" 
                           alt="">
-                        <span :class="isHover ? 'lookHp2' : 'lookHp1'">提取</span>
+                        <span :class="isHover ? 'lookHp2' : 'lookHp1'">{{lang.extract}}</span>
                       </div>
                       <!-- <el-button
                         type="primary"
@@ -204,7 +204,7 @@
                         <img 
                         :src="isHover2 ? look2 : look1" 
                           alt="">
-                        <span :class="isHover2 ? 'lookHp2' : 'lookHp1'">查看</span>
+                        <span :class="isHover2 ? 'lookHp2' : 'lookHp1'">{{lang.view}}</span>
                       </div>
                     </div>
 
@@ -218,7 +218,7 @@
                         style="width: 14px;"
                         :src="isHover3 ? yichu2 : yichu" 
                           alt="">
-                        <span :class="isHover3 ? 'lookHp2' : 'lookHp1'">移除</span>
+                        <span :class="isHover3 ? 'lookHp2' : 'lookHp1'">{{lang.remove}}</span>
                       </div>
                       <div class="btnBh" 
                       @click="downloadFile(scope.row)"
@@ -228,7 +228,7 @@
                         <img 
                         :src="isHover4 ? download2 : download" 
                          alt="">
-                        <span :class="isHover4 ? 'lookHp2' : 'lookHp1'">下载</span>
+                        <span :class="isHover4 ? 'lookHp2' : 'lookHp1'">{{lang.download}}</span>
                       </div>
                     <!-- <el-button
                       type="primary"
@@ -252,7 +252,7 @@
                       @click="deleteFile(scope.row.id, scope.row.documentid)"
                       v-if="scope.row.userid == userid">
                         <img src="../../../assets/listdel.svg" alt="">
-                        <span style="color: #DE4C41;">删除</span>
+                        <span style="color: #DE4C41;">{{lang.delete}}</span>
                       </div>
                     </div>
                   </div>
@@ -276,7 +276,7 @@
       <div v-if="proVisible" class="mask">
         <div class="progressBox">
           <div class="lbox">
-            小可正在上传中,请稍后<img src="../../../assets/KekeLoading.gif" />
+            {{lang.uploadWait}}<img src="../../../assets/KekeLoading.gif" />
           </div>
           <div class="lbox_count">{{ pcount }} / {{ ptotal }}</div>
         </div>
@@ -411,17 +411,17 @@ export default {
     getState() {
       return function(item) {
         if (item == "success") {
-          return "成功";
+          return this.lang.success;
         } else if (item == "failed") {
-          return "失败";
+          return this.lang.fail;
         } else if (item == "augmenting") {
-          return "切片中";
+          return this.lang.sliced;
         } else if (item == "pending") {
-          return "待处理";
+          return this.lang.pending;
         } else if (item == "enriched") {
           return "enriched";
         } else if (!item) {
-          return "切片中";
+          return this.lang.sliced;
         } else {
           return item;
         }
@@ -430,17 +430,17 @@ export default {
     getState2() {
       return function(item) {
         if (item == "success") {
-          return "成功";
+          return this.lang.success;
         } else if (item == "failed") {
-          return "失败";
+          return  this.lang.fail;
         } else if (item == "pending") {
-          return "待处理";
+          return this.lang.pending;
         } else if (item == "processing") {
-          return "处理中";
+          return this.lang.processing;
         } else if (item == "enriched") {
           return "enriched";
         } else if (!item) {
-          return "上传中";
+          return this.lang.uploading;
         } else {
           return item;
         }
@@ -537,7 +537,7 @@ export default {
             .toLowerCase();
 
           if (!allowedExtensions.includes(fileExtension)) {
-            this.$message.error(`不支持的文件格式: ${file.name}`);
+            this.$message.error(`${this.lang.unsupFileformats}: ${file.name}`);
             await new Promise(resolve => setTimeout(resolve, 1000)); // 延迟1秒再跳过
             continue; // 跳过不支持的文件
           }
@@ -571,7 +571,7 @@ export default {
         }
         setTimeout(() => {
           this.proVisible = false;
-          this.$message.success("操作完成");
+          this.$message.success(this.lang.operComplete);
           this.getData(); // 在上传完所有文件后再调用getData
         }, 1000);
       };
@@ -604,7 +604,7 @@ export default {
             });
           }, 1000);
         }).catch(err => {
-          this.$message.error('上传失败')
+          this.$message.error(this.lang.uploadFail)
           this.fileArray.forEach(e => {
             if (e.documentid === uuid) {
               e.ingestionStatus = 'failed';
@@ -628,7 +628,7 @@ export default {
         console.log(res2);
       } catch (err) {
         console.error(err);
-        this.$message.error("上传失败");
+        this.$message.error(this.lang.uploadFail);
       }
     },
     formatFileSize(bytes) {
@@ -643,9 +643,9 @@ export default {
       }
     },
     deleteFile(fileid, documentid) {
-      this.$confirm("确定删除该文件吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
+      this.$confirm(this.lang.deleteFile, this.lang.prompt, {
+        confirmButtonText:this.lang.confirm,
+        cancelButtonText: this.lang.cancel,
         type: "warning"
       })
         .then(() => {
@@ -659,7 +659,7 @@ export default {
             .post(this.$store.state.fileApi + "deleteFile", params)
             .then(res => {
               this.$message({
-                message: "删除成功",
+                message: this.lang.deleteSuccess,
                 type: "success"
               });
               this.checkArray = [];
@@ -668,7 +668,7 @@ export default {
               this.getData();
             })
             .catch(err => {
-              this.$message.error("删除失败");
+              this.$message.error(this.lang.deleteFail);
               console.error(err);
             });
         })
@@ -676,7 +676,7 @@ export default {
     },
     batchDelete() {
       if (!this.checkArray.length) {
-        this.$message.warning("请选择要删除的文件");
+        this.$message.warning(this.lang.selectDeFile);
         return;
       }
       let array = this.checkArray2.map(item => item.id);
@@ -684,9 +684,9 @@ export default {
       this.deleteFile(array.join(","), array2.join(","));
     },
     removeFile(fileid, documentid) {
-      this.$confirm("确定移除该文件吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
+      this.$confirm(this.lang.sureRemove, this.lang.prompt, {
+        confirmButtonText: this.lang.confirm,
+        cancelButtonText: this.lang.cancel,
         type: "warning"
       })
         .then(() => {
@@ -701,7 +701,7 @@ export default {
             .post(this.$store.state.fileApi + "removeFile", params)
             .then(res => {
               this.$message({
-                message: "移除成功",
+                message: this.lang.removeSuccess,
                 type: "success"
               });
               this.checkArray = [];
@@ -710,7 +710,7 @@ export default {
               this.getData();
             })
             .catch(err => {
-              this.$message.error("移除失败");
+              this.$message.error(this.lang.removeFail);
               console.error(err);
             });
         })
@@ -718,7 +718,7 @@ export default {
     },
     batchRemove() {
       if (!this.checkArray.length) {
-        this.$message.warning("请选择要移除的文件");
+        this.$message.warning(this.lang.seReFile);
         return;
       }
       let array = this.checkArray2.map(item => item.id);
@@ -732,7 +732,7 @@ export default {
       this.$refs.relateFiles.openG(this.userid, this.folderid, this.moFolderid);
     },
     checkFile(row) {
-      if (row.ingestionStatus != "success") return this.$message.info('文件未上传成功,点击刷新查看实时状态')
+      if (row.ingestionStatus != "success") return this.$message.info(this.lang.fileUploadFail)
 
       this.$refs.checkDialog.openG(row.documentid);
     },
@@ -751,17 +751,17 @@ export default {
         link.click();
         link.remove();
         this.$message({
-          message: "下载成功",
+          message: this.lang.downloadSuccess,
           type: "success"
         });
       }).catch(err => {
-        this.$message.error("下载失败");
+        this.$message.error(this.lang.downloadFail);
         console.error(err);
       });
     },
 
     extractFile(row) {
-      if (row.ingestionStatus != "success") return this.$message.info('文件未上传成功,点击刷新查看实时状态')
+      if (row.ingestionStatus != "success") return this.$message.info(this.lang.fileUploadFail)
 
       let params = {
         documentid: row.documentid
@@ -788,7 +788,7 @@ export default {
             this.getData();
           }, 1000)
         }).catch(err => {
-          this.$message.error('提取失败')
+          this.$message.error(this.lang.extrFailed)
           this.fileArray.forEach(e => {
             if (e.documentid === row.documentid) {
               e.extractionStatus = 'failed';
@@ -798,7 +798,7 @@ export default {
         });;
 
         console.log(res.data);
-        this.$message.success("提取文件中");
+        this.$message.success(this.lang.extractingFile);
       } catch (err) {
         console.error(err);
       }

+ 5 - 5
src/components/pages/knowledge/index.vue

@@ -3,7 +3,7 @@
     <div class="l_type_box" v-loading="isLoading">
       <div class="header">
         <img style="width: 35px;margin-right: 10px;" src="../../../assets/knowledge.png" alt="">
-        <span class="title">我的知识库</span>
+        <span class="title">{{ lang.myKnowledgeBase }}</span>
       </div>
 
       <div class="nav">
@@ -39,14 +39,14 @@
 
       <div class="BarCss" v-if="pid.split('/').length == 1">
         <div class="BarBlock1" :class="barNam == 0 ? 'BarSpan':'' ">
-          <div class="BarBlock" @click="cutPage(0)" >所有文件夹</div>
+          <div class="BarBlock" @click="cutPage(0)" >{{lang.allFolderS}}</div>
         </div>
 
         <div class="BarBlock1" :class="barNam == 1 ? 'BarSpan':'' ">
-          <div class="BarBlock" @click="cutPage(1)" >所有文件</div>
+          <div class="BarBlock" @click="cutPage(1)" >{{lang.allFiles}}</div>
         </div>
         <div class="BarBlock1" :class="barNam == 2 ? 'BarSpan':'' ">
-          <div class="BarBlock" @click="cutPage(2)" >共享空间</div>
+          <div class="BarBlock" @click="cutPage(2)" >{{lang.sharedSpaces}}</div>
         </div>
       </div>
 
@@ -95,7 +95,7 @@ export default {
       addVisbile2: '',
       isLoading: false,
       typeArray: [
-        { name: '我的文件夹',child: [], id: '0', open:true },
+        { name: this.lang.myFolders,child: [], id: '0', open:true },
         // { name: '共享文件夹',child: [], id: '1' }
       ],
       actionType: '',

+ 125 - 1
src/lang/cn.json

@@ -1,3 +1,127 @@
 {
-  "test":"测试"
+  "test":"测试",
+  "myKnowledgeBase":"我的知识库",
+  "allFolders":"所有文件夹",
+  "allFiles":"所有文件",
+  "sharedSpaces":"共享空间",
+  "myFolders":"我的文件夹",
+  "subject":"学科",
+  "grade":"年级",
+  "customize":"自定义",
+  "owner":"拥有者",
+  "search":"请输入你需要搜索的文件夹名字",
+  "newFolder":"新建文件夹",
+  "delete":"删除",
+  "selectedFolders":"已选文件夹",
+  "piece":"个",
+  "noFolder":"暂无文件夹",
+  "noDesc":"暂无描述",
+  "view":"查看",
+  "copy":"复制",
+  "folderName":"文件夹名字",
+  "description":"描述",
+  "fileNumber":"文件数",
+  "tag":"标签",
+  "publicPermissions":"公开权限",
+  "editTime":"编辑时间",
+  "knowledgeName":"请输入知识库名称",
+  "knowledgeDesc":"请输入知识库描述",
+  "cancel":"取消",
+  "confirm":"确定",
+  "office":"OFFICE文件",
+  "video":"视频文件",
+  "img":"图片",
+  "pdf":"PDF文件",
+  "other":"其他文件",
+  "private":"私有",
+  "organization":"组织",
+  "public":"公开",
+  "defaultFolder":"默认文件夹",
+  "defaultFolderDesc":"该文件夹为系统创设,将自动关联您所有上传的文件",
+  "confirmDelete":"确定删除文件夹吗?",
+  "prompt":"提示",
+  "deleteSuccess":"删除成功",
+  "deleteFail":"删除失败",
+  "copySuccess":"复制成功",
+  "copyFail":"复制失败",
+  "selectDeFolder":"请选择要删除的文件夹",
+  "folderNameMust":"文件夹名字必填",
+  "createSuccess":"创建成功",
+  "selectFolder":"请选择文件夹",
+  "selectFileName":"请输入你需要搜索的文件名字",
+  "flushed":"刷新",
+  "uploadFile":"上传文件",
+  "selectedFiles":"已选文件",
+  "nouploadFiles":"暂无上传文件",
+  "fileName":"文件名",
+  "folderBelongs":"所属文件夹",
+  "sliceClassification":"切片分类",
+  "graphExtraction":"图谱提取",
+  "fileType":"文件类型",
+  "uploadTime":"上传时间",
+  "extract":"提取",
+  "download":"下载",
+  "uploadWait":"小可正在上传中,请稍后",
+  "success":"成功",
+  "fail":"失败",
+  "sliced":"切片中",
+  "pending":"待处理",
+  "processing":"处理中",
+  "uploading":"上传中",
+  "unsupFileformats":"不支持的文件格式",
+  "operComplete":"操作完成",
+  "uploadFail":"上传失败",
+  "deleteFile":"确定删除该文件吗?",
+  "selectDeFile":"请选择要删除的文件",
+  "fileUploadFail":"文件未上传成功,点击刷新查看实时状态",
+  "downloadSuccess":"下载成功",
+  "downloadFail":"下载失败",
+  "extrFailed":"提取失败",
+  "extractingFile":"提取文件中",
+  "sliceSuccess":"切片成功",
+  "sliceFail":"切片失败",
+  "permissions":"权限管理",
+  "edit":"编辑",
+  "inputName":"输入文件夹名字",
+  "inputDesc":"输入文件夹描述",
+  "subjectTag":"学科标签",
+  "seTagType":"请选择学科标签",
+  "gradeTag":"年级标签",
+  "seGradeTag":"请选择年级标签",
+  "customTag":"自定义标签",
+  "folderNameMust":"文件夹名字不能为空",
+  "updateSuccess":"修改成功",
+  "confirmDeTag":"确定删除这个标签吗?",
+  "rootDirectory":"根目录",
+  "fileData":"文件数据",
+  "backTest":"召回测试",
+  "associatedFiles":"关联文件",
+  "remove":"移除",
+  "noDataContent":"暂无数据内容...",
+  "operate":"操作",
+  "success":"成功",
+  "sureRemove":"确定移除该文件吗?",
+  "removeSuccess":"移除成功",
+  "removeFail":"移除失败",
+  "seReFile":"请选择要移除的文件",
+  "knowSearchConfig":"知识库搜索配置",
+  "inputTestText":"输入需要测试的文本",
+  "test":"测试",
+  "testRecord":"测试记录",
+  "testParameters":"测试参数",
+  "searchWay":"搜索方式",
+  "citations":"引用上限",
+  "minRelevance":"最低相关度",
+  "testText":"测试文本",
+  "testResult":"测试结果",
+  "distance":"通过计算向量之间的距离获取得分,范围为0~1。",
+  "viewFrom":"点击查看来源",
+  "teResultArea":"测试结果将在这里展示",
+  "searchFiltration":"搜索过滤",
+  "token":"单次搜索最大的 token 数量,中文约1字=1.7tokens,英文约1字=1token",
+  "refiltering":"不同索引模型的相关度有区别,请通过搜索测试来选择合适的数值。使用 结果重排 时,使用重排结果进行过滤。",
+  "semanticRetrieval":"语义检索",
+  "fullTextSearch":"全文检索",
+  "mixSearch":"混合检索",
+  "sureDeRecord":"确定删除该记录嘛?"
 }

+ 125 - 1
src/lang/en.json

@@ -1,3 +1,127 @@
 {
-  "test":"Test"
+  "test":"Test",
+  "myKnowledgeBase":"My knowledge base",
+  "allFolders":"All folders",
+  "allFiles":"All files",
+  "sharedSpaces":"Shared spaces",
+  "myFolders":"My folders",
+  "subject":"Subject",
+  "grade":"Grade",
+  "customize":"Customize",
+  "owner":"Owner",
+  "search":"Please enter the name of the folder you want to search for",
+  "newFolder":"New folder",
+  "delete":"Delete",
+  "selectedFolders":"Selected folders",
+  "piece":"piece",
+  "noFolder":"No folder",
+  "noDesc":"No description",
+  "view":"View",
+  "copy":"Copy",
+  "folderName":"Folder name",
+  "description":"Description",
+  "fileNumber":"File number",
+  "tag":"Tag",
+  "publicPermissions":"Public permissions",
+  "editTime":"Edit time",
+  "knowledgeName":"Please enter the knowledge base name",
+  "knowledgeDesc":"Please enter the knowledge base description",
+  "cancel":"Cancel",
+  "confirm":"Confirm",
+  "office":"OFFICE file",
+  "video":"Video file",
+  "img":"Image",
+  "pdf":"PDF file",
+  "other":"Other file",
+  "private":"Private",
+  "organization":"Organization",
+  "public":"Public",
+  "defaultFolder":"Default folder",
+  "defaultFolderDesc":"This folder is created by the system and will automatically associate with all your uploaded files",
+  "confirmDelete":"Are you sure you want to delete the folder?",
+  "prompt":"Prompt",
+  "deleteSuccess":"Delete success",
+  "deleteFail":"Delete failed",
+  "copySuccess":"Copy success",
+  "copyFail":"Copy failed",
+  "selectDeFolder":"Please select the folder to delete",
+  "folderNameMust":"Folder name is required",
+  "createSuccess":"Create success",
+  "selectFolder":"Please select a folder",
+  "selectFileName":"Please enter the name of the file you want to search for",
+  "flushed":"Refresh",
+  "uploadFile":"Upload file",
+  "selectedFiles":"Selected files",
+  "nouploadFiles":"No uploaded files",
+  "fileName":"File name",
+  "folderBelongs":"Belongs to folder",
+  "sliceClassification":"Slice classification",
+  "graphExtraction":"Graph extraction",
+  "fileType":"File type",
+  "uploadTime":"Upload time",
+  "extract":"Extract",
+  "download":"Download",
+  "uploadWait":"Little K is uploading, please wait",
+  "sucucess":"Success",
+  "fail":"Failure",
+  "sliced":"Slicing",
+  "pending":"Pending",
+  "processing":"Processing",
+  "uploading":"Uploading",
+  "unsupFileformats":"Unsupported file format",
+  "operComplete":"Operation completed",
+  "uploadFail":"Upload failed",
+  "deleteFile":"Are you sure you want to delete the file?",
+  "selectDeFile":"Please select the file to delete",
+  "fileUploadFail":"The file has not been uploaded successfully, click refresh to view the real-time status",
+  "downloadSuccess":"Download success",
+  "downloadFail":"Download failed",
+  "extrFailed":"Extraction failed",
+  "extractingFile":"Extracting file",
+  "sliceSuccess":"Slice success",
+  "sliceFail":"Slice failed",
+  "permissions":"Permission management",
+  "edit":"Edit",
+  "inputName":"Input folder name",
+  "inputDesc":"Input folder description",
+  "subjectTag":"Subject tag",
+  "seTagType":"Please select subject tag",
+  "gradeTag":"Grade tag",
+  "seGradeTag":"Please select grade tag",
+  "customTag":"Custom tag",
+  "folderNameMust":"Folder name cannot be empty",
+  "updateSuccess":"Update success",
+  "confirmDeTag":"Are you sure you want to delete this tag?",
+  "rootDirectory":"Root directory",
+  "fileData":"File data",
+  "backTest":"Recall test",
+  "associatedFiles":"Associated files",
+  "remove":"Remove",
+  "noDataContent":"No data available...",
+  "operate":"Operate",
+  "success":"Success",
+  "sureRemove":"Are you sure you want to remove this file?",
+  "removeSuccess":"Remove success",
+  "removeFail":"Remove failed",
+  "seReFile":"Please select the file to be removed",
+  "knowSearchConfig":"Knowledge base search configuration",
+  "inputTestText":"Input the text to be tested",
+  "test":"Test",
+  "testRecord":"Test record",
+  "testParameters":"Test parameters",
+  "searchWay":"Search method",
+  "citations":"Citation limit",
+  "minRelevance":"Minimum relevance",
+  "testText":"Test text",
+  "testResult":"Test result",
+  "distance":"Score obtained by calculating the distance between vectors, ranging from 0 to 1.",
+  "viewFrom":"Click to view source",
+  "teResultArea":"Test results will be displayed here",
+  "searchFiltration":"Search filtering",
+  "token":"Maximum number of tokens for a single search, about 1 character = 1.7 tokens in Chinese, about 1 character = 1 token in English",
+  "refiltering":"Re-filtering results based on the search results. The relevance of different index models varies, please choose the appropriate value through search testing. When using result reordering, use the reordered results for filtering.",
+  "semanticRetrieval":"Semantic retrieval",
+  "fullTextSearch":"Full text search",
+  "mixSearch":"Mixed search",
+  "sureDeRecord":"Are you sure you want to delete this record?"
 }

+ 125 - 1
src/lang/hk.json

@@ -1,3 +1,127 @@
 {
-  "test":"测试"
+  "test": "测试",
+  "myKnowledgeBase": "我的知識庫",
+  "allFolders": "所有文件夾",
+  "allFiles": "所有文件",
+  "sharedSpaces": "共享空間",
+  "myFolders": "我的文件夾",
+  "subject": "學科",
+  "grade": "年級",
+  "customize": "自定義",
+  "owner": "擁有者",
+  "search": "請輸入你需要搜索的文件夾名字",
+  "newFolder": "新建文件夾",
+  "delete": "刪除",
+  "selectedFolders": "已選文件夾",
+  "piece": "個",
+  "noFolder": "暫無文件夾",
+  "noDesc": "暫無描述",
+  "view": "查看",
+  "copy": "複製",
+  "folderName": "文件夾名字",
+  "description": "描述",
+  "fileNumber": "文件數",
+  "tag": "標籤",
+  "publicPermissions": "公開權限",
+  "editTime": "編輯時間",
+  "knowledgeName": "請輸入知識庫名稱",
+  "knowledgeDesc": "請輸入知識庫描述",
+  "cancel": "取消",
+  "confirm": "確定",
+  "office": "OFFICE文件",
+  "video": "視頻文件",
+  "img": "圖片",
+  "pdf": "PDF文件",
+  "other": "其他文件",
+  "private": "私有",
+  "organization": "組織",
+  "public": "公開",
+  "defaultFolder": "默認文件夾",
+  "defaultFolderDesc": "該文件夾為系統創設,將自動關聯您所有上傳的文件",
+  "confirmDelete": "確定刪除文件夾嗎?",
+  "prompt": "提示",
+  "deleteSuccess": "刪除成功",
+  "deleteFail": "刪除失敗",
+  "copySuccess": "複製成功",
+  "copyFail": "複製失敗",
+  "selectDeFolder": "請選擇要刪除的文件夾",
+  "folderNameMust": "文件夾名字必填",
+  "createSuccess": "創建成功",
+  "selectFolder": "請選擇文件夾",
+  "selectFileName": "請輸入你需要搜索的文件名字",
+  "flushed": "刷新",
+  "uploadFile": "上傳文件",
+  "selectedFiles": "已選文件",
+  "nouploadFiles": "暫無上傳文件",
+  "fileName": "文件名",
+  "folderBelongs": "所屬文件夾",
+  "sliceClassification": "切片分類",
+  "graphExtraction": "圖譜提取",
+  "fileType": "文件類型",
+  "uploadTime": "上傳時間",
+  "extract": "提取",
+  "download": "下載",
+  "uploadWait": "小可正在上傳中,請稍後",
+  "sucucess": "成功",
+  "fail": "失敗",
+  "sliced": "切片中",
+  "pending": "待處理",
+  "processing": "處理中",
+  "uploading": "上傳中",
+  "unsupFileformats": "不支持的文件格式",
+  "operComplete": "操作完成",
+  "uploadFail": "上傳失敗",
+  "deleteFile": "確定刪除該文件嗎?",
+  "selectDeFile": "請選擇要刪除的文件",
+  "fileUploadFail": "文件未上傳成功,點擊刷新查看實時狀態",
+  "downloadSuccess": "下載成功",
+  "downloadFail": "下載失敗",
+  "extrFailed": "提取失敗",
+  "extractingFile": "提取文件中",
+  "sliceSuccess": "切片成功",
+  "sliceFail": "切片失敗",
+  "permissions": "權限管理",
+  "edit": "編輯",
+  "inputName": "輸入文件夾名字",
+  "inputDesc": "輸入文件夾描述",
+  "subjectTag": "學科標籤",
+  "seTagType": "請選擇學科標籤",
+  "gradeTag": "年級標籤",
+  "seGradeTag": "請選擇年級標籤",
+  "customTag": "自定義標籤",
+  "folderNameMust": "文件夾名字不能為空",
+  "updateSuccess": "修改成功",
+  "confirmDeTag": "確定刪除這個標籤嗎?",
+  "rootDirectory": "根目錄",
+  "fileData": "文件數據",
+  "backTest": "召回測試",
+  "associatedFiles": "關聯文件",
+  "remove": "移除",
+  "noDataContent": "暫無數據內容...",
+  "operate": "操作",
+  "success": "成功",
+  "sureRemove": "確定移除該文件嗎?",
+  "removeSuccess": "移除成功",
+  "removeFail": "移除失敗",
+  "seReFile": "請選擇要移除的文件",
+  "knowSearchConfig": "知識庫搜索配置",
+  "inputTestText": "輸入需要測試的文本",
+  "test": "測試",
+  "testRecord": "測試記錄",
+  "testParameters": "測試參數",
+  "searchWay": "搜索方式",
+  "citations": "引用上限",
+  "minRelevance": "最低相關度",
+  "testText": "測試文本",
+  "testResult": "測試結果",
+  "distance": "通過計算向量之間的距離獲取得分,範圍為0~1。",
+  "viewFrom": "點擊查看來源",
+  "teResultArea": "測試結果將在這裡展示",
+  "searchFiltration": "搜索過濾",
+  "token": "單次搜索最大的 token 數量,中文約1字=1.7tokens,英文約1字=1token",
+  "refiltering": "不同索引模型的相關度有區別,請通過搜索測試來選擇合適的數值。使用 結果重排 時,使用重排結果進行過濾。",
+  "semanticRetrieval":"語義檢索",
+  "fullTextSearch":"全文檢索",
+  "mixSearch":"混合檢索",
+  "sureDeRecord": "確定刪除該記錄嘛?"
 }