From b5c951ed9869c262c76db39cb9f1944c8221fdb5 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Mon, 6 May 2024 15:56:00 +0800 Subject: [PATCH 1/9] =?UTF-8?q?feat:=20=E6=AE=B5=E8=90=BD=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=89=B9=E9=87=8F=E9=80=89=E6=8B=A9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/styles/app.scss | 30 ++++++++ ui/src/views/document/index.vue | 22 +++--- ui/src/views/paragraph/index.vue | 70 ++++++++++++++++++- .../problem/component/RelateProblemDialog.vue | 27 +------ 4 files changed, 110 insertions(+), 39 deletions(-) diff --git a/ui/src/styles/app.scss b/ui/src/styles/app.scss index 69b6440b48e..3743c0e7103 100644 --- a/ui/src/styles/app.scss +++ b/ui/src/styles/app.scss @@ -573,3 +573,33 @@ h4 { color: var(--app-text-color); } } + +// card 选中样式 +.selected { + border: 1px solid var(--el-color-primary) !important; + &:before { + content: ''; + position: absolute; + right: 0; + top: 0; + border: 14px solid var(--el-color-primary); + border-bottom-color: transparent; + border-left-color: transparent; + } + + &:after { + content: ''; + width: 3px; + height: 6px; + position: absolute; + right: 5px; + top: 2px; + border: 2px solid #fff; + border-top-color: transparent; + border-left-color: transparent; + transform: rotate(35deg); + } + &:hover { + border: 1px solid var(--el-color-primary); + } +} diff --git a/ui/src/views/document/index.vue b/ui/src/views/document/index.vue index 8e5a5a4bc51..9b7cffdd1e2 100644 --- a/ui/src/views/document/index.vue +++ b/ui/src/views/document/index.vue @@ -20,15 +20,15 @@ v-if="datasetDetail.type === '1'" >同步文档 - 迁移 - 设置 - 删除 + + 迁移 + + + 设置 + + + 删除 + { function openBatchEditDocument() { const arr: string[] = multipleSelection.value.map((v) => v.id) - if (batchEditDocumentDialogRef) { - batchEditDocumentDialogRef?.value?.open(arr) - } + batchEditDocumentDialogRef?.value?.open(arr) } /** diff --git a/ui/src/views/paragraph/index.vue b/ui/src/views/paragraph/index.vue index 8471f759518..55b4d0602e3 100644 --- a/ui/src/views/paragraph/index.vue +++ b/ui/src/views/paragraph/index.vue @@ -8,7 +8,16 @@ >)
- 添加分段 + 批量选择 + 取消选择 + + 添加分段 +
+ + +
+ + +
+
+ +
+ 迁移 + + 删除 + 已选 {{ multipleSelection.length }} 项 +
@@ -118,12 +155,24 @@ const title = ref('') const search = ref('') const searchType = ref('title') +// 批量操作 +const isBatch = ref(false) +const multipleSelection = ref([]) + const paginationConfig = reactive({ current_page: 1, page_size: 20, total: 0 }) +function selectHandle(id: string) { + if (multipleSelection.value.includes(id)) { + multipleSelection.value.splice(multipleSelection.value.indexOf(id), 1) + } else { + multipleSelection.value.push(id) + } +} + function searchHandle() { paginationConfig.current_page = 1 paragraphDetail.value = [] @@ -219,6 +268,12 @@ onMounted(() => { height: 210px; background: var(--app-layout-bg-color); border: 1px solid var(--app-layout-bg-color); + &.selected { + background: #ffffff; + &:hover { + background: #ffffff; + } + } &:hover { background: #ffffff; border: 1px solid var(--el-border-color); @@ -243,5 +298,18 @@ onMounted(() => { top: 16px; } } + + &__main { + position: relative; + box-sizing: border-box; + .mul-operation { + position: absolute; + bottom: 0; + left: 0; + padding: 16px 24px; + box-sizing: border-box; + background: #ffffff; + } + } } diff --git a/ui/src/views/problem/component/RelateProblemDialog.vue b/ui/src/views/problem/component/RelateProblemDialog.vue index 0641f85327b..7306a827ff0 100644 --- a/ui/src/views/problem/component/RelateProblemDialog.vue +++ b/ui/src/views/problem/component/RelateProblemDialog.vue @@ -80,7 +80,7 @@ :title="item.title || '-'" :description="item.content" class="paragraph-card cursor mb-16" - :class="isAssociation(item.id) ? 'active' : ''" + :class="isAssociation(item.id) ? 'selected' : ''" :showIcon="false" @click="associationClick(item)" > @@ -244,31 +244,6 @@ defineExpose({ open }) diff --git a/ui/src/views/paragraph/index.vue b/ui/src/views/paragraph/index.vue index ea1a5998330..66c70f74def 100644 --- a/ui/src/views/paragraph/index.vue +++ b/ui/src/views/paragraph/index.vue @@ -122,7 +122,9 @@
- 迁移 + + 迁移 + 删除 @@ -131,6 +133,7 @@
+