feat: document

This commit is contained in:
wangdan-fit2cloud 2025-06-05 11:28:18 +08:00
parent 491b06a43b
commit 09dfedac9b
6 changed files with 517 additions and 477 deletions

View File

@ -32,8 +32,8 @@ const props = withDefaults(
{
data: () => [],
defaultActive: '',
valueKey: 'id'
}
valueKey: 'id',
},
)
const current = ref<Number | String>(0)
@ -43,7 +43,7 @@ watch(
(val) => {
current.value = val
},
{ immediate: true }
{ immediate: true },
)
const emit = defineEmits(['click', 'mouseenter', 'mouseleave'])
@ -64,7 +64,7 @@ function clearCurrent() {
current.value = 0
}
defineExpose({
clearCurrent
clearCurrent,
})
</script>
<style lang="scss" scoped>
@ -88,6 +88,12 @@ defineExpose({
border-radius: 4px;
background: var(--app-text-color-light-1);
}
&.is-active {
&:hover {
color: var(--el-color-primary);
background: var(--el-color-primary-light-9);
}
}
}
}
</style>

View File

@ -48,6 +48,14 @@ const activeMenu = computed(() => {
.el-menu {
height: 100%;
border: none;
background: none;
.el-menu-item {
&:hover {
background: var(--app-text-color-light-1);
color: var(--el-menu-text-color);
cursor: pointer;
}
}
}
}
</style>

View File

@ -1,25 +1,28 @@
<template>
<div class="document p-16-24">
<h2 class="mb-16">{{ $t('common.fileUpload.document') }}</h2>
<el-card style="--el-card-padding: 0">
<div class="main-calc-height">
<div class="p-24">
<div class="flex-between">
<div>
<el-button
v-if="datasetDetail.type === '0'"
v-if="datasetDetail.type === 0"
type="primary"
@click="router.push({ path: '/dataset/upload', query: { id: id } })"
>{{ $t('views.document.uploadDocument') }}
</el-button>
<el-button v-if="datasetDetail.type === '1'" type="primary" @click="importDoc"
<el-button v-if="datasetDetail.type === 1" type="primary" @click="importDoc"
>{{ $t('views.document.importDocument') }}
</el-button>
<el-button
@click="syncMulDocument"
:disabled="multipleSelection.length === 0"
v-if="datasetDetail.type === '1'"
v-if="datasetDetail.type === 1"
>{{ $t('views.document.syncDocument') }}
</el-button>
<el-button
v-if="datasetDetail.type === '2'"
v-if="datasetDetail.type === 2"
type="primary"
@click="
router.push({
@ -32,7 +35,7 @@
<el-button
@click="syncLarkMulDocument"
:disabled="multipleSelection.length === 0"
v-if="datasetDetail.type === '2'"
v-if="datasetDetail.type === 2"
>{{ $t('views.document.syncDocument') }}
</el-button>
<el-button @click="openDatasetDialog()" :disabled="multipleSelection.length === 0">
@ -66,7 +69,7 @@
class="mt-16"
:data="documentData"
:pagination-config="paginationConfig"
:quick-create="datasetDetail.type === '0'"
:quick-create="datasetDetail.type === 0"
@sizeChange="handleSizeChange"
@changePage="getList"
@cell-mouse-enter="cellMouseEnter"
@ -107,7 +110,11 @@
min-width="90"
sortable
/>
<el-table-column prop="status" :label="$t('views.document.fileStatus.label')" width="130">
<el-table-column
prop="status"
:label="$t('views.document.fileStatus.label')"
width="130"
>
<template #header>
<div>
<span>{{ $t('views.document.fileStatus.label') }}</span>
@ -166,7 +173,9 @@
: ''
"
class="justify-center"
:command="beforeCommand('status', State.STARTED, TaskType.GENERATE_PROBLEM)"
:command="
beforeCommand('status', State.STARTED, TaskType.GENERATE_PROBLEM)
"
>{{ $t('views.document.fileStatus.GENERATE') }}
</el-dropdown-item>
</el-dropdown-menu>
@ -264,10 +273,17 @@
</div>
</template>
<template #default="{ row }">
{{ $t(hitHandlingMethod[row.hit_handling_method as keyof typeof hitHandlingMethod]) }}
{{
$t(hitHandlingMethod[row.hit_handling_method as keyof typeof hitHandlingMethod])
}}
</template>
</el-table-column>
<el-table-column prop="create_time" :label="$t('common.createTime')" width="175" sortable>
<el-table-column
prop="create_time"
:label="$t('common.createTime')"
width="175"
sortable
>
<template #default="{ row }">
{{ datetimeFormat(row.create_time) }}
</template>
@ -284,7 +300,7 @@
</el-table-column>
<el-table-column :label="$t('common.operation')" align="left" width="110" fixed="right">
<template #default="{ row }">
<div v-if="datasetDetail.type === '0'">
<div v-if="datasetDetail.type === 0">
<span class="mr-4">
<el-tooltip
effect="dark"
@ -296,7 +312,11 @@
:content="$t('views.document.setting.cancelVectorization')"
placement="top"
>
<el-button type="primary" text @click.stop="cancelTask(row, TaskType.EMBEDDING)">
<el-button
type="primary"
text
@click.stop="cancelTask(row, TaskType.EMBEDDING)"
>
<AppIcon iconName="app-close" style="font-size: 16px"></AppIcon>
</el-button>
</el-tooltip>
@ -360,7 +380,7 @@
</el-dropdown>
</span>
</div>
<div v-if="datasetDetail.type === '1' || datasetDetail.type === '2'">
<div v-if="datasetDetail.type === 1 || datasetDetail.type === 2">
<span class="mr-4">
<el-tooltip
effect="dark"
@ -383,7 +403,11 @@
:content="$t('views.document.setting.cancelVectorization')"
placement="top"
>
<el-button type="primary" text @click.stop="cancelTask(row, TaskType.EMBEDDING)">
<el-button
type="primary"
text
@click.stop="cancelTask(row, TaskType.EMBEDDING)"
>
<AppIcon iconName="app-close" style="font-size: 16px"></AppIcon>
</el-button>
</el-tooltip>
@ -472,6 +496,8 @@
</el-button>
</div>
<EmbeddingContentDialog ref="embeddingContentDialogRef"></EmbeddingContentDialog>
</el-card>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, onBeforeUnmount, computed } from 'vue'

View File

@ -1,9 +1,9 @@
<template>
<el-avatar v-if="type === '1'" class="avatar-purple" shape="square" :size="32">
<el-avatar v-if="type === 1" class="avatar-purple" shape="square" :size="32">
<img src="@/assets/knowledge/icon_web.svg" style="width: 58%" alt="" />
</el-avatar>
<el-avatar
v-else-if="type === '2'"
v-else-if="type === 2"
class="avatar-purple"
shape="square"
:size="32"

View File

@ -1,6 +1,6 @@
<template>
<div class="resource-authorization p-16-24">
<h4 class="mb-16">{{ $t('views.userManage.title') }}</h4>
<h2 class="mb-16">{{ $t('views.userManage.title') }}</h2>
<el-card style="--el-card-padding: 0">
<div class="flex main-calc-height">
<div class="resource-authorization__left border-r p-8">

View File

@ -1,6 +1,6 @@
<template>
<div class="p-16-24">
<h4 class="mb-16">{{ $t('views.userManage.title') }}</h4>
<h2 class="mb-16">{{ $t('views.userManage.title') }}</h2>
<el-card>
<div class="flex-between mb-16">
<el-button type="primary" @click="createUser">{{