feat: bugs

This commit is contained in:
wangdan-fit2cloud 2025-06-25 18:57:06 +08:00
parent 67bb79079f
commit f6c5d6d9b7
23 changed files with 294 additions and 184 deletions

View File

@ -12,9 +12,9 @@
</div>
<div style="width: 90%">
<slot name="title">
<div>
<span class="ellipsis-1 mb-4" :title="title" style="width: 80%">
{{ title }}
</div>
</span>
</slot>
<slot name="subTitle"> </slot>
</div>

View File

@ -13,6 +13,7 @@
:model="folderForm"
label-position="top"
require-asterisk-position="right"
@submit.prevent
>
<el-form-item :label="$t('common.name')" prop="name">
<el-input

View File

@ -10,71 +10,75 @@
<div
@click="handleSharedNodeClick"
v-if="showShared && hasPermission(EditionConst.IS_EE, 'OR')"
class="shared-knowledge"
class="shared-button flex cursor"
:class="currentNodeKey === 'share' && 'active'"
>
<AppIcon :iconName="iconName" style="font-size: 18px"></AppIcon>
<AppIcon iconName="app-folder-share-active" style="font-size: 18px"></AppIcon>
<span class="ml-8 lighter">{{ shareTitle }}</span>
</div>
<el-tree
ref="treeRef"
:data="data"
:props="defaultProps"
@node-click="handleNodeClick"
:filter-node-method="filterNode"
:default-expanded-keys="[currentNodeKey]"
:current-node-key="currentNodeKey"
highlight-current
class="overflow-inherit_node__children"
node-key="id"
v-loading="loading"
>
<template #default="{ node, data }">
<div class="flex-between w-full" @mouseenter.stop="handleMouseEnter(data)">
<div class="flex align-center">
<AppIcon iconName="app-folder" style="font-size: 16px"></AppIcon>
<span class="ml-8 ellipsis" style="max-width: 110px" :label="node.label">{{
node.label
}}</span>
</div>
<div class="tree-height border-t" :style="treeStyle">
<el-scrollbar>
<el-tree
ref="treeRef"
:data="data"
:props="defaultProps"
@node-click="handleNodeClick"
:filter-node-method="filterNode"
:default-expanded-keys="[currentNodeKey]"
:current-node-key="currentNodeKey"
highlight-current
class="overflow-inherit_node__children"
node-key="id"
v-loading="loading"
>
<template #default="{ node, data }">
<div class="flex-between w-full" @mouseenter.stop="handleMouseEnter(data)">
<div class="flex align-center">
<AppIcon iconName="app-folder" style="font-size: 16px"></AppIcon>
<span class="ml-8 ellipsis" style="max-width: 110px" :title="node.label">{{
node.label
}}</span>
</div>
<div
v-if="canOperation && node.level !== 3"
@click.stop
v-show="hoverNodeId === data.id"
@mouseenter.stop="handleMouseEnter(data)"
@mouseleave.stop="handleMouseleave"
class="mr-16"
>
<el-dropdown trigger="click" :teleported="false">
<el-button text class="w-full">
<el-icon class="rotate-90"><MoreFilled /></el-icon>
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click.stop="openCreateFolder(data)">
<AppIcon iconName="app-add-folder"></AppIcon>
{{ '添加子文件夹' }}
</el-dropdown-item>
<el-dropdown-item @click.stop="openEditFolder(data)">
<el-icon><EditPen /></el-icon>
{{ $t('common.edit') }}
</el-dropdown-item>
<el-dropdown-item
divided
@click.stop="deleteFolder(data)"
:disabled="!data.parent_id"
>
<el-icon><Delete /></el-icon>
{{ $t('common.delete') }}
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</div>
</template>
</el-tree>
<div
v-if="canOperation && node.level !== 3"
@click.stop
v-show="hoverNodeId === data.id"
@mouseenter.stop="handleMouseEnter(data)"
@mouseleave.stop="handleMouseleave"
class="mr-16"
>
<el-dropdown trigger="click" :teleported="false">
<el-button text class="w-full">
<el-icon class="rotate-90"><MoreFilled /></el-icon>
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click.stop="openCreateFolder(data)">
<AppIcon iconName="app-add-folder"></AppIcon>
{{ $t('components.folder.addChildFolder') }}
</el-dropdown-item>
<el-dropdown-item @click.stop="openEditFolder(data)">
<el-icon><EditPen /></el-icon>
{{ $t('common.edit') }}
</el-dropdown-item>
<el-dropdown-item
divided
@click.stop="deleteFolder(data)"
:disabled="!data.parent_id"
>
<el-icon><Delete /></el-icon>
{{ $t('common.delete') }}
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</div>
</template>
</el-tree>
</el-scrollbar>
</div>
<CreateFolderDialog ref="CreateFolderDialogRef" @refresh="refreshFolder" :title="title" />
</div>
</template>
@ -108,10 +112,6 @@ const props = defineProps({
type: Boolean,
default: false,
},
iconName: {
type: String,
default: 'app-folder-share-active',
},
shareTitle: {
type: String,
default: '',
@ -120,6 +120,10 @@ const props = defineProps({
type: Boolean,
default: true,
},
treeStyle: {
type: Object,
default: () => ({}),
},
})
const { folder } = useStore()
@ -184,11 +188,11 @@ function deleteFolder(row: Tree) {
const CreateFolderDialogRef = ref()
function openCreateFolder(row: Tree) {
title.value = '添加子文件夹'
title.value = t('components.folder.addChildFolder')
CreateFolderDialogRef.value.open(props.source, row.id)
}
function openEditFolder(row: Tree) {
title.value = '编辑文件夹'
title.value = t('components.folder.editFolder')
CreateFolderDialogRef.value.open(props.source, row.id, row)
}
@ -197,39 +201,35 @@ function refreshFolder() {
}
</script>
<style lang="scss" scoped>
.shared-knowledge {
padding-left: 8px;
display: flex;
align-items: center;
height: 40px;
position: relative;
margin-bottom: 8px;
border-radius: 4px;
cursor: pointer;
&:hover {
background: var(--app-text-color-light-1);
color: var(--el-menu-text-color);
.folder-tree {
.shared-button {
padding: 10px 8px;
font-weight: 400;
font-size: 14px;
margin-bottom: 4px;
&.active {
background: var(--el-color-primary-light-9);
border-radius: 4px;
color: var(--el-color-primary);
font-weight: 500;
&:hover {
background: var(--el-color-primary-light-9);
}
}
&:hover {
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);
}
}
}
&.active {
color: var(--el-color-primary);
background: var(--el-color-primary-light-9);
}
&::after {
content: '';
position: absolute;
bottom: -4px;
background-color: #1f232926;
left: 0;
width: 100%;
height: 1px;
}
}
:deep(.overflow-inherit_node__children) {
.el-tree-node__children {
overflow: inherit !important;
.tree-height {
padding-top: 4px;
height: calc(100vh - 210px);
}
}
</style>

View File

@ -0,0 +1,93 @@
<template>
<div class="loading-container loader">
<div class="download-loading">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
</template>
<script setup lang="ts"></script>
<style lang="scss" scoped>
.loading-container {
display: -webkit-flex; /*safari弹性布局*/
justify-content: center;
display: flex;
align-items: center;
}
@-webkit-keyframes loader {
0% {
opacity: 0.3;
}
80% {
opacity: 1;
}
100% {
opacity: 1;
}
}
.download-loading {
position: relative;
}
.download-loading div {
width: 5px;
height: 12px;
background: var(--el-color-info);
position: absolute;
border-radius: 2px;
margin: 0 auto;
}
.download-loading div:nth-child(1) {
top: -20px;
left: 0;
-webkit-animation: loader 1s -0.8s infinite ease-in-out;
}
.download-loading div:nth-child(2) {
top: -13px;
left: 13px;
-webkit-transform: rotate(45deg);
-webkit-animation: loader 1s -0.6s infinite ease-in-out;
}
.download-loading div:nth-child(3) {
top: 0px;
left: 20px;
-webkit-transform: rotate(90deg);
-webkit-animation: loader 1s -0.5s infinite ease-in-out;
}
.download-loading div:nth-child(4) {
top: 13px;
left: 13px;
-webkit-transform: rotate(-45deg);
-webkit-animation: loader 1s -0.4s infinite ease-in-out;
}
.download-loading div:nth-child(5) {
top: 20px;
left: 0px;
-webkit-transform: rotate(0deg);
-webkit-animation: loader 1s -0.3s infinite ease-in-out;
}
.download-loading div:nth-child(6) {
top: 13px;
left: -13px;
-webkit-transform: rotate(45deg);
-webkit-animation: loader 1s -0.2s infinite ease-in-out;
}
.download-loading div:nth-child(7) {
top: 0px;
left: -20px;
-webkit-transform: rotate(90deg);
-webkit-animation: loader 1s -0.1s infinite ease-in-out;
}
.download-loading div:nth-child(8) {
top: -13px;
left: -13px;
-webkit-transform: rotate(-45deg);
-webkit-animation: loader 1s 0s infinite ease-in-out;
}
</style>

View File

@ -7,12 +7,14 @@ export default {
selectParagraph: {
title: 'Select Segments',
error: 'Process only the failed segments',
all: 'All Segments'
all: 'All Segments',
},
folder: {
addFolder: 'Add Folder',
addChildFolder: 'Add Child Folder',
editFolder: 'Edit Folder',
folderNamePlaceholder: 'Please enter a name',
description: 'Description',
descriptionPlaceholder: 'Please enter a description',
}
},
}

View File

@ -11,6 +11,8 @@ export default {
},
folder: {
addFolder: '添加文件夹',
addChildFolder: '添加子文件夹',
editFolder: '编辑文件夹',
folderNamePlaceholder: '请输入名称',
description: '描述',
descriptionPlaceholder: '请输入描述',

View File

@ -11,6 +11,8 @@ export default {
},
folder: {
addFolder: '添加文件夾',
addChildFolder: '添加子文件夾',
editFolder: '編輯文件夾',
folderNamePlaceholder: '請輸入名稱',
description: '描述',
descriptionPlaceholder: '請輸入描述',

View File

@ -179,3 +179,26 @@
display: block !important;
}
}
// 下载中
.dotting {
display: inline-block;
width: 10px;
min-height: 2px;
padding-right: 2px;
margin-left: 2px;
padding-left: 2px;
border-left: 2px solid currentColor;
border-right: 2px solid currentColor;
background-color: currentColor;
background-clip: content-box;
box-sizing: border-box;
-webkit-animation: dot 0.8s infinite step-start both;
animation: dot 0.8s infinite step-start both;
&:before {
content: '...';
}
&::before {
content: '';
}
}

View File

@ -203,6 +203,9 @@
.el-dialog {
--el-dialog-padding-primary: 24px;
--el-dialog-border-radius: 8px;
.el-dialog__body {
color: var(--el-text-color-primary);
}
}
.el-dialog__headerbtn {
top: 8px;

View File

@ -23,7 +23,7 @@
<img :src="detail?.icon" alt="" />
</el-avatar>
<LogoIcon v-else height="28px" style="width: 28px; height: 28px; display: block" />
<LogoIcon v-else height="32px" />
<el-avatar
v-if="showEditIcon"
shape="square"

View File

@ -41,11 +41,7 @@
>
<img :src="detail?.icon" alt="" />
</el-avatar>
<LogoIcon
v-else
height="28px"
style="width: 28px; height: 28px; display: block"
/>
<LogoIcon v-else height="32px" />
</div>
<h4 class="ellipsis">

View File

@ -92,7 +92,7 @@
>
<img :src="detail?.icon" alt="" />
</el-avatar>
<LogoIcon v-else height="28px" style="width: 28px; height: 28px; display: block" />
<LogoIcon v-else height="32px" />
</div>
<h4>

View File

@ -45,29 +45,33 @@
v-loading="folderLoading"
:canOperation="false"
showShared
:shareTitle="$t('views.system.shared.shared_knowledge')"
:treeStyle="{ height: 'calc(100vh - 320px)' }"
/>
</template>
<el-scrollbar>
<div class="max-height layout-bg p-16-24">
<el-row :gutter="12" v-loading="loading">
<el-col
:span="12"
v-for="(item, index) in filterData.filter((v: any) => v.resource_type !== 'folder')"
:key="index"
class="mb-16"
>
<CardCheckbox
value-field="id"
:data="item"
v-model="checkList"
@change="changeHandle"
<div class="layout-bg h-full">
<el-scrollbar>
<div class="p-16-24">
<el-row :gutter="12" v-loading="loading">
<el-col
:span="12"
v-for="(item, index) in filterData.filter((v: any) => v.resource_type !== 'folder')"
:key="index"
class="mb-16"
>
<span class="ellipsis cursor ml-12" :title="item.name"> {{ item.name }}</span>
</CardCheckbox>
</el-col>
</el-row>
</div>
</el-scrollbar>
<CardCheckbox
value-field="id"
:data="item"
v-model="checkList"
@change="changeHandle"
>
<span class="ellipsis cursor ml-12" :title="item.name"> {{ item.name }}</span>
</CardCheckbox>
</el-col>
</el-row>
</div>
</el-scrollbar>
</div>
</LayoutContainer>
<template #footer>
@ -216,9 +220,5 @@ defineExpose({ open })
top: 6px;
right: 6px;
}
.max-height {
max-height: calc(100vh - 260px);
min-height: 500px;
}
}
</style>

View File

@ -28,7 +28,7 @@
<el-input
v-if="search_type === 'name'"
v-model="search_form.name"
@change="getList"
@change="searchHandel"
:placeholder="$t('common.searchBar.placeholder')"
style="width: 220px"
clearable
@ -36,7 +36,7 @@
<el-select
v-else-if="search_type === 'create_user'"
v-model="search_form.create_user"
@change="getList"
@change="searchHandel"
clearable
style="width: 220px"
>
@ -177,7 +177,7 @@
@click="router.push({ path: `/application/${item.id}/${item.type}/overview` })"
>
<template #icon>
<LogoIcon height="28px" style="width: 28px; height: 28px; display: block" />
<LogoIcon height="32px" />
</template>
<template #subTitle>
<el-text class="color-secondary" size="small">
@ -507,6 +507,13 @@ function refreshFolder() {
applicationList.value = []
getFolder()
}
function searchHandel() {
paginationConfig.current_page = 1
applicationList.value = []
getList()
}
onMounted(() => {
getFolder(true)
})

View File

@ -19,7 +19,7 @@
>
<img :src="applicationDetail?.icon" alt="" />
</el-avatar>
<LogoIcon v-else height="28px" style="width: 28px; height: 28px; display: block" />
<LogoIcon v-else height="32px" />
</div>
<h4>{{ applicationDetail?.name }}</h4>

View File

@ -18,7 +18,7 @@
>
<img :src="applicationDetail?.icon" alt="" />
</el-avatar>
<LogoIcon v-else height="28px" style="width: 28px; height: 28px; display: block" />
<LogoIcon v-else height="32px" />
</div>
<h4>{{ applicationDetail?.name }}</h4>

View File

@ -22,7 +22,7 @@
>
<img :src="applicationDetail?.icon" alt="" />
</el-avatar>
<LogoIcon v-else height="28px" style="width: 28px; height: 28px; display: block" />
<LogoIcon v-else height="32px" />
</div>
<h4 v-show="!isPcCollapse">{{ applicationDetail?.name }}</h4>
</div>
@ -143,7 +143,7 @@
<!-- TODO -->
<span v-show="!isPcCollapse" class="ml-8 color-text-primary">{{ 222 }}</span>
</div>
<template #dropdown>
<el-dropdown-menu class="avatar-dropdown">
<div class="flex align-center" style="padding: 12px;">
@ -724,4 +724,4 @@ onMounted(() => {
.avatar-dropdown {
min-width: 240px;
}
</style>
</style>

View File

@ -128,17 +128,4 @@ const submitHandle = () => {
defineExpose({ open })
</script>
<style lang="scss">
// .select-knowledge-dialog {
// padding: 0;
// .el-dialog__header {
// padding: 24px 24px 0 24px;
// }
// .el-dialog__body {
// padding: 8px !important;
// }
// .el-dialog__footer {
// padding: 0 24px 24px;
// }
// }
</style>
<style lang="scss"></style>

View File

@ -19,7 +19,7 @@
<el-input
v-if="search_type === 'name'"
v-model="search_form.name"
@change="getList"
@change="searchHandel"
:placeholder="$t('common.searchBar.placeholder')"
style="width: 220px"
clearable
@ -27,7 +27,7 @@
<el-select
v-else-if="search_type === 'create_user'"
v-model="search_form.create_user"
@change="getList"
@change="searchHandel"
clearable
style="width: 220px"
>
@ -364,7 +364,6 @@ const paginationConfig = reactive({
total: 0,
})
const knowledgeList = ref<any[]>([])
const CreateKnowledgeDialogRef = ref()
const currentCreateDialog = shallowRef<any>(null)
@ -487,7 +486,7 @@ function getList() {
.getKnowledgeListPage(paginationConfig, params, loading)
.then((res: any) => {
paginationConfig.total = res.data?.total
knowledge.setKnowledgeList([...knowledgeList.value, ...res.data.records])
knowledge.setKnowledgeList([...knowledge.knowledgeList, ...res.data.records])
})
}
@ -495,6 +494,12 @@ function clickFolder(item: any) {
folder.setCurrentFolder(item)
}
function searchHandel() {
paginationConfig.current_page = 1
knowledge.setKnowledgeList([])
getList()
}
onMounted(() => {
if (apiType.value !== 'workspace') {
folder.setCurrentFolder({

View File

@ -52,15 +52,11 @@
</ul>
<!-- progress -->
<div class="progress-mask" v-if="currentModel.status === 'DOWNLOAD'">
<!-- <DownloadLoading class="percentage" /> -->
<DownloadLoading class="percentage" />
<div class="percentage-label flex-center">
{{ $t('views.model.download.downloading') }} <span class="dotting"></span>
<el-button
link
type="primary"
class="ml-16"
@click.stop="cancelDownload"
<el-button link type="primary" class="ml-16" @click.stop="cancelDownload"
>{{ $t('views.model.download.cancelDownload') }}
</el-button>
</div>
@ -128,7 +124,7 @@
import type { Provider, Model } from '@/api/type/model'
import { computed, ref, onMounted, onBeforeUnmount } from 'vue'
import EditModel from '@/views/model/component/EditModel.vue'
// import DownloadLoading from '@/components/loading/DownloadLoading.vue'
import DownloadLoading from '@/components/loading/DownloadLoading.vue'
import { MsgConfirm } from '@/utils/message'
import { modelType } from '@/enums/model'
import ParamSettingDialog from './ParamSettingDialog.vue'
@ -146,14 +142,12 @@ const props = defineProps<{
apiType: 'systemShare' | 'workspace' | 'systemManage'
}>()
const permissionPrecise = computed(() => {
return permissionMap['model'][props.apiType]
})
const downModel = ref<Model>()
const currentModel = computed(() => {
if (downModel.value) {
return downModel.value
@ -287,12 +281,6 @@ onBeforeUnmount(() => {
margin-bottom: 16px;
}
// .percentage-value {
// display: flex;
// font-size: 13px;
// align-items: center;
// color: var(--app-text-color-secondary);
// }
.percentage-label {
margin-top: 50px;
margin-left: 10px;

View File

@ -55,12 +55,7 @@
alt=""
/>
</el-avatar>
<LogoIcon
v-else-if="isApplication"
height="28px"
style="width: 28px; height: 28px; display: block"
class="mr-12"
/>
<LogoIcon v-else-if="isApplication" height="32px" class="mr-12" />
<KnowledgeIcon class="mr-12" :size="20" v-else-if="isKnowledge" :type="row.icon" />

View File

@ -19,7 +19,7 @@
<el-input
v-if="search_type === 'name'"
v-model="search_form.name"
@change="getList"
@change="searchHandel"
:placeholder="$t('common.searchBar.placeholder')"
style="width: 220px"
clearable
@ -27,7 +27,7 @@
<el-select
v-else-if="search_type === 'create_user'"
v-model="search_form.create_user"
@change="getList"
@change="searchHandel"
clearable
style="width: 220px"
>
@ -573,7 +573,7 @@ function getList() {
const params = {
[search_type.value]: search_form.value[search_type.value],
folder_id: folder.currentFolder?.id || user.getWorkspaceId(),
scope: systemType === 'systemShare' ? 'SHARED' : 'WORKSPACE',
scope: apiType.value === 'systemShare' ? 'SHARED' : 'WORKSPACE',
}
loadSharedApi({ type: 'tool', isShared: isShared.value, systemType: apiType.value })
.getToolListPage(paginationConfig, params, loading)
@ -587,6 +587,12 @@ function clickFolder(item: any) {
folder.setCurrentFolder(item)
}
function searchHandel() {
paginationConfig.current_page = 1
tool.setToolList([])
getList()
}
onMounted(() => {
if (apiType.value !== 'workspace') {
getList()

View File

@ -8,7 +8,7 @@
>
<img :src="item?.icon" alt="" />
</el-avatar>
<LogoIcon v-else height="28px" style="width: 28px; height: 28px; display: block" />
<LogoIcon v-else height="32px" />
</template>
<script setup lang="ts">
import { isAppIcon } from '@/utils/common'