Merge branch 'main' of github.com:maxkb-dev/maxkb

This commit is contained in:
shaohuzhang1 2024-01-10 15:26:48 +08:00
commit 7349f00c54
5 changed files with 52 additions and 36 deletions

View File

@ -90,7 +90,7 @@ const postWebDateset: (data: any, loading?: Ref<boolean>) => Promise<Result<any>
data,
loading
) => {
return post(`${prefix}`, data, undefined, loading)
return post(`${prefix}/web`, data, undefined, loading)
}
/**

View File

@ -8,7 +8,7 @@
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
</AppAvatar>
</slot>
<h4 class="ellipsis-1" style="width: 80%">{{ title }}</h4>
<h4 class="ellipsis-1" style="width: 65%">{{ title }}</h4>
</div>
</slot>
</div>

View File

@ -22,9 +22,6 @@
</template> -->
<div class="create-dataset__main flex" v-loading="loading">
<div class="create-dataset__component main-calc-height">
<!-- <template v-if="steps[active]?.component">
<component :is="steps[active].component" :ref="steps[active]?.ref" />
</template> -->
<template v-if="active === 0">
<StepFirst ref="StepFirstRef" />
</template>
@ -39,9 +36,9 @@
<div class="create-dataset__footer text-right border-t" v-if="active !== 2">
<el-button @click="router.go(-1)" :disabled="loading"> </el-button>
<el-button @click="prev" v-if="active === 1" :disabled="loading">上一步</el-button>
<el-button @click="next" type="primary" v-if="active === 0" :disabled="loading"
>创建并导入</el-button
>
<el-button @click="next" type="primary" v-if="active === 0" :disabled="loading">
创建并导入
</el-button>
<el-button @click="submit" type="primary" v-if="active === 1" :disabled="loading">
开始导入
</el-button>
@ -70,18 +67,18 @@ const {
params: { id, type }
} = route
const isCreate = type === 'create'
const steps = [
{
ref: 'StepFirstRef',
name: '上传文档',
component: StepFirst
},
{
ref: 'StepSecondRef',
name: '设置分段规则',
component: StepSecond
}
]
// const steps = [
// {
// ref: 'StepFirstRef',
// name: '',
// component: StepFirst
// },
// {
// ref: 'StepSecondRef',
// name: '',
// component: StepSecond
// }
// ]
const StepFirstRef = ref()
const StepSecondRef = ref()

View File

@ -31,22 +31,41 @@
class="cursor"
@click="router.push({ path: `/dataset/${item.id}/document` })"
>
<template #mouseEnter>
<el-tooltip effect="dark" content="删除" placement="top">
<el-button text @click.stop="deleteDateset(item)" class="delete-button">
<el-icon><Delete /></el-icon>
</el-button>
</el-tooltip>
</template>
<div class="delete-button">
<el-tag v-if="item.type === '0'">通用型</el-tag>
<el-tag v-else-if="item.type === '1'" type="warning">Web 站点</el-tag>
</div>
<template #footer>
<div class="footer-content">
<span class="bold">{{ item?.document_count || 0 }}</span>
文档<el-divider direction="vertical" />
<span class="bold">{{ numberFormat(item?.char_length) || 0 }}</span>
字符<el-divider direction="vertical" />
<span class="bold">{{ item?.application_mapping_count || 0 }}</span>
关联应用
<div class="footer-content flex-between">
<div>
<span class="bold">{{ item?.document_count || 0 }}</span>
文档<el-divider direction="vertical" />
<span class="bold">{{ numberFormat(item?.char_length) || 0 }}</span>
字符<el-divider direction="vertical" />
<span class="bold">{{ item?.application_mapping_count || 0 }}</span>
关联应用
</div>
<div @click.stop>
<el-dropdown trigger="click">
<span class="el-dropdown-link cursor">
<el-icon><MoreFilled /></el-icon>
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item icon="Refresh" v-if="item.type === '1'">同步</el-dropdown-item>
<el-dropdown-item
icon="Setting"
@click.stop="router.push({ path: `/dataset/${item.id}/setting` })"
>设置</el-dropdown-item
>
<el-dropdown-item icon="Delete" @click.stop="deleteDateset(item)"
>删除</el-dropdown-item
>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</div>
</template>
</CardBox>

View File

@ -46,14 +46,14 @@
<el-input
v-model="form.url"
placeholder="请输入 Web 根地址"
@blur="form.name = form.url.trim()"
@blur="form.url = form.url.trim()"
/>
</el-form-item>
<el-form-item label="选择器" v-if="form.type === '1'">
<el-input
v-model="form.selector"
placeholder="请输入选择器"
@blur="form.name = form.selector.trim()"
@blur="form.selector = form.selector.trim()"
/>
</el-form-item>
</el-form>