Merge branch 'pr@main@fix_bugs' of github.com:1Panel-dev/MaxKB into pr@main@fix_bugs
This commit is contained in:
commit
3d82e0551f
@ -11,6 +11,7 @@
|
|||||||
autofocus
|
autofocus
|
||||||
:maxlength="quickCreateMaxlength"
|
:maxlength="quickCreateMaxlength"
|
||||||
:show-word-limit="quickCreateMaxlength ? true : false"
|
:show-word-limit="quickCreateMaxlength ? true : false"
|
||||||
|
@keydown.enter="submitHandle"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<el-button type="primary" @click="submitHandle" :disabled="loading">创建</el-button>
|
<el-button type="primary" @click="submitHandle" :disabled="loading">创建</el-button>
|
||||||
|
|||||||
@ -18,18 +18,13 @@
|
|||||||
<el-form-item label="关联分段">
|
<el-form-item label="关联分段">
|
||||||
<template v-for="(item, index) in paragraphList" :key="index">
|
<template v-for="(item, index) in paragraphList" :key="index">
|
||||||
<CardBox
|
<CardBox
|
||||||
shadow="never"
|
|
||||||
:title="item.title || '-'"
|
:title="item.title || '-'"
|
||||||
class="paragraph-source-card cursor mb-8"
|
class="paragraph-source-card cursor mb-8"
|
||||||
:showIcon="false"
|
:showIcon="false"
|
||||||
|
@click.stop="editParagraph(item)"
|
||||||
>
|
>
|
||||||
<div class="active-button">
|
<div class="active-button">
|
||||||
<span class="mr-4">
|
<span class="mr-4">
|
||||||
<el-tooltip effect="dark" content="编辑" placement="top">
|
|
||||||
<el-button type="primary" text @click.stop="editParagraph(item)">
|
|
||||||
<el-icon><EditPen /></el-icon>
|
|
||||||
</el-button>
|
|
||||||
</el-tooltip>
|
|
||||||
<el-tooltip effect="dark" content="取消关联" placement="top">
|
<el-tooltip effect="dark" content="取消关联" placement="top">
|
||||||
<el-button type="primary" text @click.stop="disassociation(item)">
|
<el-button type="primary" text @click.stop="disassociation(item)">
|
||||||
<AppIcon iconName="app-quxiaoguanlian"></AppIcon>
|
<AppIcon iconName="app-quxiaoguanlian"></AppIcon>
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
<el-scrollbar height="500" wrap-class="paragraph-scrollbar">
|
<el-scrollbar height="500" wrap-class="paragraph-scrollbar">
|
||||||
<div class="bold title align-center p-24 pb-0">选择文档</div>
|
<div class="bold title align-center p-24 pb-0">选择文档</div>
|
||||||
<div class="p-8" style="padding-bottom: 8px">
|
<div class="p-8" style="padding-bottom: 8px">
|
||||||
|
<el-input v-model="filterDoc" placeholder="按 文档名称 搜索" prefix-icon="Search" />
|
||||||
<common-list
|
<common-list
|
||||||
:data="documentList"
|
:data="documentList"
|
||||||
class="mt-8"
|
class="mt-8"
|
||||||
@ -107,6 +108,7 @@ const dialogVisible = ref<boolean>(false)
|
|||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const documentList = ref<any[]>([])
|
const documentList = ref<any[]>([])
|
||||||
|
const cloneDocumentList = ref<any[]>([])
|
||||||
const paragraphList = ref<any[]>([])
|
const paragraphList = ref<any[]>([])
|
||||||
const currentProblemId = ref<String>('')
|
const currentProblemId = ref<String>('')
|
||||||
|
|
||||||
@ -116,6 +118,7 @@ const associationParagraph = ref<any[]>([])
|
|||||||
const currentDocument = ref<String>('')
|
const currentDocument = ref<String>('')
|
||||||
const search = ref('')
|
const search = ref('')
|
||||||
const searchType = ref('title')
|
const searchType = ref('title')
|
||||||
|
const filterDoc = ref('')
|
||||||
|
|
||||||
const paginationConfig = reactive({
|
const paginationConfig = reactive({
|
||||||
current_page: 1,
|
current_page: 1,
|
||||||
@ -166,8 +169,9 @@ function clickDocumentHandle(item: any) {
|
|||||||
|
|
||||||
function getDocument() {
|
function getDocument() {
|
||||||
document.asyncGetAllDocument(id, loading).then((res: any) => {
|
document.asyncGetAllDocument(id, loading).then((res: any) => {
|
||||||
|
cloneDocumentList.value = res.data
|
||||||
documentList.value = res.data
|
documentList.value = res.data
|
||||||
currentDocument.value = documentList.value?.length > 0 ? documentList.value[0].id : ''
|
currentDocument.value = cloneDocumentList.value?.length > 0 ? cloneDocumentList.value[0].id : ''
|
||||||
getParagraphList(currentDocument.value)
|
getParagraphList(currentDocument.value)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -204,6 +208,7 @@ function isAssociation(paragraphId: String) {
|
|||||||
watch(dialogVisible, (bool) => {
|
watch(dialogVisible, (bool) => {
|
||||||
if (!bool) {
|
if (!bool) {
|
||||||
documentList.value = []
|
documentList.value = []
|
||||||
|
cloneDocumentList.value = []
|
||||||
paragraphList.value = []
|
paragraphList.value = []
|
||||||
associationParagraph.value = []
|
associationParagraph.value = []
|
||||||
|
|
||||||
@ -214,6 +219,14 @@ watch(dialogVisible, (bool) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
watch(filterDoc, (val) => {
|
||||||
|
paragraphList.value = []
|
||||||
|
documentList.value = val
|
||||||
|
? cloneDocumentList.value.filter((item) => item.name.includes(val))
|
||||||
|
: cloneDocumentList.value
|
||||||
|
currentDocument.value = documentList.value?.length > 0 ? documentList.value[0].id : ''
|
||||||
|
})
|
||||||
|
|
||||||
const open = (problemId: string) => {
|
const open = (problemId: string) => {
|
||||||
currentProblemId.value = problemId
|
currentProblemId.value = problemId
|
||||||
getDocument()
|
getDocument()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user