|
|
@@ -4,7 +4,8 @@
|
|
|
<!-- <div class="rt-container" v-if="tabs.length > 0"> -->
|
|
|
<div class="rt-container">
|
|
|
<a-tabs :active-key="activeKey" @change="handleTabChange">
|
|
|
- <a-tab-pane key="1" title="数据集">
|
|
|
+ <!-- 数据集 -->
|
|
|
+ <a-tab-pane key="1" :title="$t('knowledgeLib.tab_1')">
|
|
|
<a-scrollbar class="rt-container-main" :style="{ height: documentHeight + 'px' }" style="overflow: auto">
|
|
|
<!-- <a-scrollbar class="rt-container-main" style="overflow: auto"> -->
|
|
|
<a-card
|
|
|
@@ -24,8 +25,9 @@
|
|
|
<a-row :gutter="16">
|
|
|
<a-col :span="24" style="margin-bottom: 10px; display: flex; justify-content: space-between">
|
|
|
<a-popover position="bottom" v-model="checkedArr.length" trigger="click">
|
|
|
- <a-button :disabled="checkedArr.length == 0" border
|
|
|
- >批量
|
|
|
+ <a-button :disabled="checkedArr.length == 0" border>
|
|
|
+ <!-- 批量 -->
|
|
|
+ {{ $t('knowledgeLib.select_all') }}
|
|
|
<icon-down style="margin-left: 4px" />
|
|
|
</a-button>
|
|
|
<template #content>
|
|
|
@@ -34,7 +36,8 @@
|
|
|
<template #icon>
|
|
|
<icon-play-circle />
|
|
|
</template>
|
|
|
- 启用
|
|
|
+ <!-- 启用 -->
|
|
|
+ {{ $t('knowledgeLib.select_enable') }}
|
|
|
</a-button>
|
|
|
</p>
|
|
|
<p>
|
|
|
@@ -42,7 +45,8 @@
|
|
|
<template #icon>
|
|
|
<icon-record color="" />
|
|
|
</template>
|
|
|
- 禁用
|
|
|
+ <!-- 禁用 -->
|
|
|
+ {{ $t('knowledgeLib.select_disable') }}
|
|
|
</a-button>
|
|
|
</p>
|
|
|
<p>
|
|
|
@@ -50,7 +54,8 @@
|
|
|
<template #icon>
|
|
|
<icon-check-circle />
|
|
|
</template>
|
|
|
- 启动
|
|
|
+ <!-- 启动 -->
|
|
|
+ {{ $t('knowledgeLib.select_start') }}
|
|
|
</a-button>
|
|
|
</p>
|
|
|
<p>
|
|
|
@@ -58,7 +63,8 @@
|
|
|
<template #icon>
|
|
|
<icon-close-circle />
|
|
|
</template>
|
|
|
- 取消
|
|
|
+ <!-- 取消 -->
|
|
|
+ {{ $t('knowledgeLib.select_cancel') }}
|
|
|
</a-button>
|
|
|
</p>
|
|
|
<a-divider style="margin: 10px 0" />
|
|
|
@@ -67,14 +73,16 @@
|
|
|
<template #icon>
|
|
|
<icon-delete />
|
|
|
</template>
|
|
|
- 删除
|
|
|
+ <!-- 删除 -->
|
|
|
+ {{ $t('knowledgeLib.select_delete') }}
|
|
|
</a-button>
|
|
|
</p>
|
|
|
</template>
|
|
|
</a-popover>
|
|
|
<span>
|
|
|
+ <!-- 搜索 -->
|
|
|
<a-input-search
|
|
|
- placeholder="搜索"
|
|
|
+ :placeholder="$t('knowledgeLib.search_placeholder')"
|
|
|
style="width: 200px; margin-right: 10px"
|
|
|
v-model="keywords"
|
|
|
@change="search"
|
|
|
@@ -93,13 +101,15 @@
|
|
|
<a-space> </a-space>
|
|
|
</a-col>
|
|
|
<a-col :span="12" style="display: flex; align-items: center; justify-content: end">
|
|
|
- <a-tooltip content="刷新">
|
|
|
+ <!-- 刷新 -->
|
|
|
+ <a-tooltip :content="$t('knowledgeLib.tips_fresh')">
|
|
|
<div class="action-icon">
|
|
|
<icon-refresh size="18" />
|
|
|
</div>
|
|
|
</a-tooltip>
|
|
|
<a-dropdown @select="handleSelectDensity">
|
|
|
- <a-tooltip content="密度">
|
|
|
+ <!-- 密度 -->
|
|
|
+ <a-tooltip :content="$t('knowledgeLib.tips_density')">
|
|
|
<div class="action-icon">
|
|
|
<icon-line-height size="18" />
|
|
|
</div>
|
|
|
@@ -157,53 +167,91 @@
|
|
|
<template #run="{ record }">
|
|
|
<div style="display: flex; align-items: center">
|
|
|
<div style="width: 100px">
|
|
|
- <a-popover title="" v-if="record.run == '4'">
|
|
|
- <a-tag :loading="record.loading" :color="'red'" border>失败</a-tag>
|
|
|
+ <a-popover position="lt" title="" v-if="record.run == '4'">
|
|
|
+ <a-tag :loading="record.loading" :color="'red'" border>
|
|
|
+ <!-- 失败 -->
|
|
|
+ {{ $t('knowledgeLib.status_fail') }}
|
|
|
+ </a-tag>
|
|
|
<template #content>
|
|
|
- <p>流程开始于:{{ record.process_begin_at }}</p>
|
|
|
- <p>过程持续时间:{{ record.process_duation.toFixed(2) }}</p>
|
|
|
+ <!-- 流程开始于: -->
|
|
|
+ <p>{{ $t('knowledgeLib.popover_label_1') }}:{{ record.process_begin_at }}</p>
|
|
|
+ <!-- 过程持续时间 -->
|
|
|
+ <p>{{ $t('knowledgeLib.popover_label_2') }}:{{ record.process_duation.toFixed(2) }}</p>
|
|
|
<div>
|
|
|
- <p>进度消息:<span v-html="record.progress_msg.replace(/\n/g, '<br/>')"></span></p>
|
|
|
+ <!-- 进度消息: -->
|
|
|
+ <p>
|
|
|
+ {{ $t('knowledgeLib.popover_label_3') }}:<span
|
|
|
+ v-html="record.progress_msg.replace(/\n/g, '<br/>')"
|
|
|
+ ></span>
|
|
|
+ </p>
|
|
|
</div>
|
|
|
</template>
|
|
|
</a-popover>
|
|
|
- <a-popover title="" v-if="record.run == '3'">
|
|
|
- <a-tag :loading="record.loading" :color="'blue'" border>完成</a-tag>
|
|
|
+ <a-popover position="lt" title="" v-if="record.run == '3'">
|
|
|
+ <a-tag :loading="record.loading" :color="'blue'" border>
|
|
|
+ <!-- 完成 -->
|
|
|
+ {{ $t('knowledgeLib.table_status_finish') }}
|
|
|
+ </a-tag>
|
|
|
<template #content>
|
|
|
- <p>流程开始于:{{ record.process_begin_at }}</p>
|
|
|
- <p>过程持续时间:{{ record.process_duation.toFixed(2) }}</p>
|
|
|
+ <p>{{ $t('knowledgeLib.popover_label_1') }}:{{ record.process_begin_at }}</p>
|
|
|
+ <p>{{ $t('knowledgeLib.popover_label_2') }}:{{ record.process_duation.toFixed(2) }}</p>
|
|
|
<div>
|
|
|
- <p>进度消息:<span v-html="record.progress_msg.replace(/\n/g, '<br/>')"></span></p>
|
|
|
+ <p>
|
|
|
+ {{ $t('knowledgeLib.popover_label_3') }}:<span
|
|
|
+ v-html="record.progress_msg.replace(/\n/g, '<br/>')"
|
|
|
+ ></span>
|
|
|
+ </p>
|
|
|
</div>
|
|
|
</template>
|
|
|
</a-popover>
|
|
|
- <a-popover title="" v-if="record.run == '1'">
|
|
|
- <a-tag :loading="record.loading" :color="'blue'" border>解析中...</a-tag>
|
|
|
+ <a-popover position="lt" title="" v-if="record.run == '1'">
|
|
|
+ <a-tag :loading="record.loading" :color="'blue'" border>
|
|
|
+ <!-- 解析中... -->
|
|
|
+ {{ $t('knowledgeLib.table_status_running') }}
|
|
|
+ </a-tag>
|
|
|
<template #content>
|
|
|
- <p>流程开始于:{{ record.process_begin_at }}</p>
|
|
|
- <p>过程持续时间:{{ record.process_duation.toFixed(2) }}</p>
|
|
|
+ <p>{{ $t('knowledgeLib.popover_label_1') }}:{{ record.process_begin_at }}</p>
|
|
|
+ <p>{{ $t('knowledgeLib.popover_label_2') }}:{{ record.process_duation.toFixed(2) }}</p>
|
|
|
<div>
|
|
|
- <p>进度消息:<span v-html="record.progress_msg.replace(/\n/g, '<br/>')"></span></p>
|
|
|
+ <p>
|
|
|
+ {{ $t('knowledgeLib.popover_label_3') }}:<span
|
|
|
+ v-html="record.progress_msg.replace(/\n/g, '<br/>')"
|
|
|
+ ></span>
|
|
|
+ </p>
|
|
|
</div>
|
|
|
</template>
|
|
|
</a-popover>
|
|
|
- <a-popover title="" v-if="record.run == '2'">
|
|
|
- <a-tag :loading="record.loading" :color="'gold'" border>取消</a-tag>
|
|
|
+ <a-popover position="lt" title="" v-if="record.run == '2'">
|
|
|
+ <a-tag :loading="record.loading" :color="'gold'" border>
|
|
|
+ <!-- 取消 -->
|
|
|
+ {{ $t('knowledgeLib.table_status_cancel') }}
|
|
|
+ </a-tag>
|
|
|
<template #content>
|
|
|
- <p>流程开始于:{{ record.process_begin_at }}</p>
|
|
|
- <p>过程持续时间:{{ record.process_duation.toFixed(2) }}</p>
|
|
|
+ <p>{{ $t('knowledgeLib.popover_label_1') }}:{{ record.process_begin_at }}</p>
|
|
|
+ <p>{{ $t('knowledgeLib.popover_label_2') }}:{{ record.process_duation.toFixed(2) }}</p>
|
|
|
<div>
|
|
|
- <p>进度消息:<span v-html="record.progress_msg.replace(/\n/g, '<br/>')"></span></p>
|
|
|
+ <p>
|
|
|
+ {{ $t('knowledgeLib.popover_label_3') }}:<span
|
|
|
+ v-html="record.progress_msg.replace(/\n/g, '<br/>')"
|
|
|
+ ></span>
|
|
|
+ </p>
|
|
|
</div>
|
|
|
</template>
|
|
|
</a-popover>
|
|
|
- <a-popover title="" v-if="record.run == '0'">
|
|
|
- <a-tag :loading="record.loading" :color="'green'" border>未启动 </a-tag>
|
|
|
+ <a-popover position="lt" title="" v-if="record.run == '0'">
|
|
|
+ <a-tag :loading="record.loading" :color="'green'" border>
|
|
|
+ <!-- 未启动 -->
|
|
|
+ {{ $t('knowledgeLib.table_status_stop') }}
|
|
|
+ </a-tag>
|
|
|
<template #content>
|
|
|
- <p>流程开始于:{{ record.process_begin_at }}</p>
|
|
|
- <p>过程持续时间:{{ record.process_duation.toFixed(2) }}</p>
|
|
|
+ <p>{{ $t('knowledgeLib.popover_label_1') }}:{{ record.process_begin_at }}</p>
|
|
|
+ <p>{{ $t('knowledgeLib.popover_label_2') }}:{{ record.process_duation.toFixed(2) }}</p>
|
|
|
<div>
|
|
|
- <p>进度消息:<span v-html="record.progress_msg.replace(/\n/g, '<br/>')"></span></p>
|
|
|
+ <p>
|
|
|
+ {{ $t('knowledgeLib.popover_label_3') }}:<span
|
|
|
+ v-html="record.progress_msg.replace(/\n/g, '<br/>')"
|
|
|
+ ></span>
|
|
|
+ </p>
|
|
|
</div>
|
|
|
</template>
|
|
|
</a-popover>
|
|
|
@@ -224,16 +272,19 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #action="{ record }">
|
|
|
- <a-tooltip content="解析方法">
|
|
|
- <a-button type="text" :disabled="record.run == '1'" @click="handleClick(record)" 查 size="small">
|
|
|
+ <!-- 解析方法 -->
|
|
|
+ <a-tooltip :content="$t('knowledgeLib.action_tip_parser')">
|
|
|
+ <a-button type="text" :disabled="record.run == '1'" @click="handleClick(record)" size="small">
|
|
|
<template #icon>
|
|
|
<icon-tool />
|
|
|
</template>
|
|
|
</a-button>
|
|
|
</a-tooltip>
|
|
|
<edit :item="record" @upTabdateItem="upTabdateItem" />
|
|
|
- <a-popconfirm :content="'确定删除吗'" type="warning" @ok="deleteItem(record)">
|
|
|
- <a-tooltip content="删除">
|
|
|
+ <!-- 确定删除吗 -->
|
|
|
+ <a-popconfirm :content="$t('knowledgeLib.delete_confirm')" type="warning" @ok="deleteItem(record)">
|
|
|
+ <!-- 删除 -->
|
|
|
+ <a-tooltip :content="$t('knowledgeLib.action_tip_delete')">
|
|
|
<a-button type="text" size="small" :disabled="record.run == '1'">
|
|
|
<template #icon>
|
|
|
<icon-delete />
|
|
|
@@ -241,7 +292,8 @@
|
|
|
</a-button>
|
|
|
</a-tooltip>
|
|
|
</a-popconfirm>
|
|
|
- <a-tooltip content="下载">
|
|
|
+ <!-- 下载 -->
|
|
|
+ <a-tooltip :content="$t('knowledgeLib.action_tip_download')">
|
|
|
<a-button
|
|
|
type="text"
|
|
|
size="small"
|
|
|
@@ -269,12 +321,14 @@
|
|
|
</a-card>
|
|
|
</a-scrollbar>
|
|
|
</a-tab-pane>
|
|
|
- <a-tab-pane key="2" title="测试">
|
|
|
+ <!-- 测试 -->
|
|
|
+ <a-tab-pane key="2" :title="$t('knowledgeLib.tab_2')">
|
|
|
<a-scrollbar class="rt-container-main" :style="{ height: documentHeight + 'px' }" style="overflow: hidden">
|
|
|
<test ref="testForm"></test>
|
|
|
</a-scrollbar>
|
|
|
</a-tab-pane>
|
|
|
- <a-tab-pane key="3" title="配置">
|
|
|
+ <!-- 配置 -->
|
|
|
+ <a-tab-pane key="3" :title="$t('knowledgeLib.tab_3')">
|
|
|
<a-scrollbar class="rt-container-main" :style="{ height: documentHeight + 'px' }" style="overflow: auto">
|
|
|
<config
|
|
|
ref="configForm"
|
|
|
@@ -320,13 +374,8 @@ import tool from './tool.vue';
|
|
|
// import excel from '@/views/dmx/knowledgeLib/components/excel.vue';
|
|
|
// import txtPdf from '@/views/dmx/knowledgeLib/components/txtPdf.vue';
|
|
|
import { Message, Modal } from '@arco-design/web-vue';
|
|
|
-import { documentHeight, parseTime } from './utils';
|
|
|
-// import { deleteLlm } from '@/api/model';
|
|
|
-// import { userModelState } from '@/store';
|
|
|
-// import { getUserResources } from '@/utils/auth';
|
|
|
+import { documentHeight, parseTime, getTableColumns } from './utils';
|
|
|
|
|
|
-// let modelStore = userModelState();
|
|
|
-// const httpUrl = modelStore.hrefUrl;
|
|
|
const props = defineProps({
|
|
|
kb_id: {
|
|
|
type: String,
|
|
|
@@ -441,50 +490,53 @@ const densityList = computed(() => [
|
|
|
value: 'large'
|
|
|
}
|
|
|
]);
|
|
|
-const columns = computed(() => [
|
|
|
- {
|
|
|
- title: '名称',
|
|
|
- dataIndex: 'name',
|
|
|
- slotName: 'name',
|
|
|
- width: 300
|
|
|
- },
|
|
|
- {
|
|
|
- title: '分快数',
|
|
|
- dataIndex: 'chunk_num',
|
|
|
- width: 90
|
|
|
- },
|
|
|
- {
|
|
|
- title: '上传时间',
|
|
|
- dataIndex: 'create_time',
|
|
|
- slotName: 'create_time',
|
|
|
- width: 200
|
|
|
- },
|
|
|
- {
|
|
|
- title: '解析方法',
|
|
|
- dataIndex: 'parser_id',
|
|
|
- slotName: 'parser_id',
|
|
|
- width: 150
|
|
|
- },
|
|
|
- {
|
|
|
- title: '启用',
|
|
|
- dataIndex: 'status',
|
|
|
- slotName: 'status',
|
|
|
- width: 100
|
|
|
- },
|
|
|
- {
|
|
|
- title: '解析状态',
|
|
|
- dataIndex: 'run',
|
|
|
- slotName: 'run',
|
|
|
- width: 100
|
|
|
- },
|
|
|
- {
|
|
|
- title: '操作',
|
|
|
- dataIndex: 'action',
|
|
|
- slotName: 'action',
|
|
|
- width: 200,
|
|
|
- minWidth: 200
|
|
|
- }
|
|
|
-]);
|
|
|
+// const columns = computed(() => [
|
|
|
+// {
|
|
|
+// title: '名称',
|
|
|
+// dataIndex: 'name',
|
|
|
+// slotName: 'name',
|
|
|
+// width: 300
|
|
|
+// },
|
|
|
+// {
|
|
|
+// title: '分快数',
|
|
|
+// dataIndex: 'chunk_num',
|
|
|
+// width: 90
|
|
|
+// },
|
|
|
+// {
|
|
|
+// title: '上传时间',
|
|
|
+// dataIndex: 'create_time',
|
|
|
+// slotName: 'create_time',
|
|
|
+// width: 200
|
|
|
+// },
|
|
|
+// {
|
|
|
+// title: '解析方法',
|
|
|
+// dataIndex: 'parser_id',
|
|
|
+// slotName: 'parser_id',
|
|
|
+// width: 150
|
|
|
+// },
|
|
|
+// {
|
|
|
+// title: '启用',
|
|
|
+// dataIndex: 'status',
|
|
|
+// slotName: 'status',
|
|
|
+// width: 100
|
|
|
+// },
|
|
|
+// {
|
|
|
+// title: '解析状态',
|
|
|
+// dataIndex: 'run',
|
|
|
+// slotName: 'run',
|
|
|
+// width: 100
|
|
|
+// },
|
|
|
+// {
|
|
|
+// title: '操作',
|
|
|
+// dataIndex: 'action',
|
|
|
+// slotName: 'action',
|
|
|
+// width: 200,
|
|
|
+// minWidth: 200
|
|
|
+// }
|
|
|
+// ]);
|
|
|
+const columns = computed(() => {
|
|
|
+ return getTableColumns(t);
|
|
|
+});
|
|
|
const contentTypeOptions = computed(() => [
|
|
|
{
|
|
|
label: '图文',
|
|
|
@@ -799,29 +851,6 @@ const exchangeArray = (array, beforeIdx, newIdx, isDeep = false) => {
|
|
|
return newArray;
|
|
|
};
|
|
|
|
|
|
-// const popupVisibleChange = (val: boolean) => {
|
|
|
-// if (val) {
|
|
|
-// nextTick(() => {
|
|
|
-// const el = document.getElementById('tableSetting') as HTMLElement;
|
|
|
-// const sortable = new Sortable(el, {
|
|
|
-// onEnd(e: any) {
|
|
|
-// const { oldIndex, newIndex } = e;
|
|
|
-// exchangeArray(cloneColumns.value, oldIndex, newIndex);
|
|
|
-// exchangeArray(showColumns.value, oldIndex, newIndex);
|
|
|
-// }
|
|
|
-// });
|
|
|
-// });
|
|
|
-// }
|
|
|
-// };
|
|
|
-
|
|
|
-// const fileClick = () => {
|
|
|
-// detailsShow.value = true;
|
|
|
-// };
|
|
|
-
|
|
|
-// const goBackClick = () => {
|
|
|
-// detailsShow.value = false;
|
|
|
-// };
|
|
|
-
|
|
|
function upTabdateItem(id, newName) {
|
|
|
// console.log(id, newName);
|
|
|
const itemToUpdate = renderData.value.find((item) => item.id === id);
|