feat: 知识库管理样式

This commit is contained in:
wangdan-fit2cloud 2024-02-23 16:17:16 +08:00
parent 09b39f174f
commit 73a73bd18c
10 changed files with 67 additions and 50 deletions

View File

@ -14,7 +14,7 @@
}, },
"dependencies": { "dependencies": {
"axios": "^0.27.2", "axios": "^0.27.2",
"element-plus": "^2.5.3", "element-plus": "^2.5.6",
"install": "^0.13.0", "install": "^0.13.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"markdown-it": "^13.0.2", "markdown-it": "^13.0.2",

View File

@ -15,7 +15,7 @@
<el-button @click="showInput = false" :disabled="loading">取消</el-button> <el-button @click="showInput = false" :disabled="loading">取消</el-button>
</div> </div>
<div v-else @click="quickCreateHandel" class="w-full"> <div v-else @click="quickCreateHandel" class="w-full">
<el-button type="primary" link> <el-button type="primary" link class="quich-button">
<el-icon><Plus /></el-icon> <el-icon><Plus /></el-icon>
<span class="ml-4">快速创建空白文档</span> <span class="ml-4">快速创建空白文档</span>
</el-button> </el-button>
@ -111,5 +111,10 @@ onMounted(() => {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
} }
.quich-button {
&:hover {
color: var(--el-button-text-color);
}
}
} }
</style> </style>

View File

@ -1,12 +1,12 @@
<template> <template>
<el-dialog v-model="resetPasswordDialog" title="修改密码"> <el-dialog v-model="resetPasswordDialog" title="修改密码">
<el-form <el-form
class="reset-password-form" class="reset-password-form mb-24"
ref="resetPasswordFormRef" ref="resetPasswordFormRef"
:model="resetPasswordForm" :model="resetPasswordForm"
:rules="rules" :rules="rules"
> >
<p class="mb-8 lighter">新密码</p> <p class="mt-16 mb-8 lighter">新密码</p>
<el-form-item prop="password" style="margin-bottom: 8px"> <el-form-item prop="password" style="margin-bottom: 8px">
<el-input <el-input
type="password" type="password"
@ -48,10 +48,10 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <div class="dialog-footer">
<el-button @click="resetPasswordDialog = false"> 取消 </el-button> <el-button @click="resetPasswordDialog = false"> 取消 </el-button>
<el-button type="primary" @click="resetPassword"> 保存 </el-button> <el-button type="primary" @click="resetPassword"> 保存 </el-button>
</span> </div>
</template> </template>
</el-dialog> </el-dialog>
</template> </template>

View File

@ -64,7 +64,6 @@
margin: 5px 0; margin: 5px 0;
} }
.el-dialog__body { .el-dialog__body {
padding: 16px var(--el-dialog-padding-primary) 8px !important;
color: var(--app-text-color); color: var(--app-text-color);
} }
} }

View File

@ -34,7 +34,7 @@
</div> </div>
</div> </div>
<div class="create-dataset__footer text-right border-t" v-if="active !== 2"> <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="router.go(-1)" :disabled="loading"></el-button>
<el-button @click="prev" v-if="active === 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 @click="next" type="primary" v-if="active === 0" :disabled="loading">
创建并导入 创建并导入

View File

@ -25,7 +25,7 @@
<div> <div>
<!-- 编辑分段按钮 --> <!-- 编辑分段按钮 -->
<el-button link @click="editHandle(child, index, cIndex)"> <el-button link @click="editHandle(child, index, cIndex)">
<el-icon><Edit /></el-icon> <el-icon><EditPen /></el-icon>
</el-button> </el-button>
<!-- 删除分段按钮 --> <!-- 删除分段按钮 -->
<el-button link @click="deleteHandle(child, index, cIndex)"> <el-button link @click="deleteHandle(child, index, cIndex)">
@ -138,6 +138,6 @@ onMounted(() => {})
} }
} }
.paragraph-list { .paragraph-list {
height: calc(var(--create-dataset-height) - 95px); height: calc(var(--create-dataset-height) - 131px);
} }
</style> </style>

View File

@ -201,6 +201,9 @@ defineExpose({
position: absolute; position: absolute;
top: 16px; top: 16px;
} }
:deep(.el-radio__input.is-checked + .el-radio__label) {
color: var(--app-text-color);
}
.active { .active {
border: 1px solid var(--el-color-primary); border: 1px solid var(--el-color-primary);
} }

View File

@ -8,8 +8,8 @@
> >
<el-row v-loading="loading"> <el-row v-loading="loading">
<el-col :span="16"> <el-col :span="16">
<el-scrollbar> <el-scrollbar height="370" wrap-class="paragraph-scrollbar">
<div class="p-24" style="height: 350px"> <div class="p-24" style="padding-bottom: 8px;">
<div class="flex-between mb-16"> <div class="flex-between mb-16">
<div class="bold title align-center">分段内容</div> <div class="bold title align-center">分段内容</div>
<el-button text @click="isEdit = true" v-if="problemId && !isEdit"> <el-button text @click="isEdit = true" v-if="problemId && !isEdit">
@ -19,14 +19,13 @@
<ParagraphForm ref="paragraphFormRef" :data="detail" :isEdit="isEdit" /> <ParagraphForm ref="paragraphFormRef" :data="detail" :isEdit="isEdit" />
</div> </div>
<div class="text-right p-24 pt-0" v-if="problemId && isEdit">
<el-button @click.prevent="isEdit = false"> 取消 </el-button>
<el-button type="primary" :disabled="loading" @click="submitHandle"> 保存 </el-button>
</div>
</el-scrollbar> </el-scrollbar>
<div class="text-right p-24 pt-0" v-if="problemId && isEdit">
<el-button @click.prevent="isEdit = false"> 取消 </el-button>
<el-button type="primary" :disabled="loading" @click="submitHandle"> 保存 </el-button>
</div>
</el-col> </el-col>
<el-col :span="8" class="border-l p-24"> <el-col :span="8" class="border-l">
<!-- 关联问题 --> <!-- 关联问题 -->
<ProblemComponent <ProblemComponent
:problemId="problemId" :problemId="problemId"
@ -134,17 +133,23 @@ defineExpose({ open })
</script> </script>
<style lang="scss" scope> <style lang="scss" scope>
.paragraph-dialog { .paragraph-dialog {
padding: 0 !important;
.el-scrollbar {
height: auto !important;
}
.el-dialog__header { .el-dialog__header {
padding-bottom: 16px; padding: 16px 24px;
} }
.el-dialog__body { .el-dialog__body {
border-top: 1px solid var(--el-border-color); border-top: 1px solid var(--el-border-color);
padding: 0 !important;
} }
.el-dialog__footer { .el-dialog__footer {
padding-top: 16px; padding-top: 16px;
border-top: 1px solid var(--el-border-color); border-top: 1px solid var(--el-border-color);
} }
.el-dialog__headerbtn {
top: 6px;
}
.title { .title {
color: var(--app-text-color); color: var(--app-text-color);
} }

View File

@ -1,33 +1,38 @@
<template> <template>
<p class="bold title mb-16"> <p class="bold title p-24" style="padding-bottom: 0">
关联问题 <el-divider direction="vertical" /> <span class="flex align-center">
<el-button text @click="addProblem"> <span>关联问题</span>
<el-icon><Plus /></el-icon> <el-divider direction="vertical" class="mr-4"/>
</el-button> <el-button text @click="addProblem">
<el-icon><Plus /></el-icon>
</el-button>
</span>
</p> </p>
<div v-loading="loading" style="height: 350px"> <div v-loading="loading">
<el-scrollbar> <el-scrollbar height="359px">
<el-input <div class="p-24" style="padding-top: 16px">
ref="inputRef" <el-input
v-if="isAddProblem" ref="inputRef"
v-model="problemValue" v-if="isAddProblem"
@change="addProblemHandle" v-model="problemValue"
placeholder="请输入问题,回车保存" @change="addProblemHandle"
class="mb-8" placeholder="请输入问题,回车保存"
autofocus class="mb-8"
/> autofocus
/>
<template v-for="(item, index) in problemList" :key="index"> <template v-for="(item, index) in problemList" :key="index">
<TagEllipsis <TagEllipsis
@close="delProblemHandle(item, index)" @close="delProblemHandle(item, index)"
class="question-tag" class="question-tag"
type="info" type="info"
effect="plain" effect="plain"
closable closable
> >
{{ item.content }} {{ item.content }}
</TagEllipsis> </TagEllipsis>
</template> </template>
</div>
</el-scrollbar> </el-scrollbar>
</div> </div>
</template> </template>

View File

@ -13,7 +13,7 @@
</template> </template>
<div <div
class="document-detail__main p-16" class="document-detail__main p-16"
v-loading="paginationConfig.current_page === 1 && loading" v-loading="(paginationConfig.current_page === 1 && loading) || changeStateloading"
> >
<div class="flex-between p-8"> <div class="flex-between p-8">
<span>{{ paginationConfig.total }} 段落</span> <span>{{ paginationConfig.total }} 段落</span>
@ -110,6 +110,7 @@ const {
const ParagraphDialogRef = ref() const ParagraphDialogRef = ref()
const loading = ref(false) const loading = ref(false)
const changeStateloading = ref(false)
const documentDetail = ref<any>({}) const documentDetail = ref<any>({})
const paragraphDetail = ref<any[]>([]) const paragraphDetail = ref<any[]>([])
const title = ref('') const title = ref('')
@ -132,8 +133,7 @@ function changeState(bool: Boolean, row: any) {
const obj = { const obj = {
is_active: bool is_active: bool
} }
loading.value = true paragraph.asyncPutParagraph(id, documentId, row.id, obj, changeStateloading).then((res) => {})
paragraph.asyncPutParagraph(id, documentId, row.id, obj, loading).then((res) => {})
} }
function deleteParagraph(row: any) { function deleteParagraph(row: any) {