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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="resource-authorization p-16-24"> <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"> <el-card style="--el-card-padding: 0">
<div class="flex main-calc-height"> <div class="flex main-calc-height">
<div class="resource-authorization__left border-r p-8"> <div class="resource-authorization__left border-r p-8">

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="p-16-24"> <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> <el-card>
<div class="flex-between mb-16"> <div class="flex-between mb-16">
<el-button type="primary" @click="createUser">{{ <el-button type="primary" @click="createUser">{{