2025-05-30 06:34:24 +00:00
|
|
|
|
<template>
|
2025-06-06 08:32:03 +00:00
|
|
|
|
<div class="paragraph p-12-24">
|
|
|
|
|
|
<div class="flex align-center" style="width: 78%">
|
|
|
|
|
|
<back-button to="-1" style="margin-left: -4px"></back-button>
|
|
|
|
|
|
<h3 style="display: inline-block">{{ documentDetail?.name }}</h3>
|
|
|
|
|
|
<el-text type="info" v-if="documentDetail?.type === '1'"
|
|
|
|
|
|
>({{ $t('views.document.form.source_url.label') }}:<el-link
|
|
|
|
|
|
:href="documentDetail?.meta?.source_url"
|
|
|
|
|
|
target="_blank"
|
2025-05-30 06:34:24 +00:00
|
|
|
|
>
|
2025-06-06 08:32:03 +00:00
|
|
|
|
<span class="break-all">{{ documentDetail?.meta?.source_url }} </span></el-link
|
|
|
|
|
|
>)
|
|
|
|
|
|
</el-text>
|
|
|
|
|
|
</div>
|
2025-07-16 03:17:18 +00:00
|
|
|
|
<div class="header-button" v-if="!shareDisabled && permissionPrecise.doc_edit(id)">
|
2025-06-06 08:32:03 +00:00
|
|
|
|
<el-button @click="batchSelectedHandle(true)" v-if="isBatch === false">
|
|
|
|
|
|
{{ $t('views.paragraph.setting.batchSelected') }}
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
<el-button @click="batchSelectedHandle(false)" v-if="isBatch === true">
|
|
|
|
|
|
{{ $t('views.paragraph.setting.cancelSelected') }}
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
<el-button @click="addParagraph" type="primary" :disabled="loading" v-if="isBatch === false">
|
|
|
|
|
|
{{ $t('views.paragraph.addParagraph') }}
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<el-card
|
|
|
|
|
|
style="--el-card-padding: 0"
|
2025-06-06 12:08:15 +00:00
|
|
|
|
class="paragraph__main mt-16"
|
2025-05-30 06:34:24 +00:00
|
|
|
|
v-loading="(paginationConfig.current_page === 1 && loading) || changeStateloading"
|
|
|
|
|
|
>
|
2025-06-06 08:32:03 +00:00
|
|
|
|
<div class="flex-between p-12-16 border-b">
|
2025-05-30 06:34:24 +00:00
|
|
|
|
<span>{{ paginationConfig.total }} {{ $t('views.paragraph.paragraph_count') }}</span>
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
v-model="search"
|
|
|
|
|
|
:placeholder="$t('common.search')"
|
|
|
|
|
|
class="input-with-select"
|
|
|
|
|
|
style="width: 260px"
|
|
|
|
|
|
@change="searchHandle"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
>
|
|
|
|
|
|
<template #prepend>
|
|
|
|
|
|
<el-select v-model="searchType" placeholder="Select" style="width: 80px">
|
|
|
|
|
|
<el-option :label="$t('common.title')" value="title" />
|
|
|
|
|
|
<el-option :label="$t('common.content')" value="content" />
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-input>
|
|
|
|
|
|
</div>
|
2025-07-04 09:42:12 +00:00
|
|
|
|
<LayoutContainer showCollapse>
|
|
|
|
|
|
<template #left>
|
|
|
|
|
|
<div class="paragraph-sidebar p-16">
|
2025-07-07 07:04:35 +00:00
|
|
|
|
<el-scrollbar class="paragraph-scollbar">
|
|
|
|
|
|
<el-anchor
|
|
|
|
|
|
direction="vertical"
|
|
|
|
|
|
type="default"
|
|
|
|
|
|
:offset="130"
|
|
|
|
|
|
container=".paragraph-scollbar"
|
|
|
|
|
|
@click="handleClick"
|
|
|
|
|
|
>
|
|
|
|
|
|
<template v-for="(item, index) in paragraphDetail" :key="item.id">
|
2025-07-08 18:58:16 +00:00
|
|
|
|
<el-anchor-link :href="`#m${item.id}`" :title="item.title" v-if="item.title">
|
|
|
|
|
|
<span :title="item.title">
|
|
|
|
|
|
{{ item.title }}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</el-anchor-link>
|
2025-07-07 07:04:35 +00:00
|
|
|
|
</template>
|
|
|
|
|
|
</el-anchor>
|
|
|
|
|
|
</el-scrollbar>
|
2025-07-04 09:42:12 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
2025-06-06 12:08:15 +00:00
|
|
|
|
<div class="w-full">
|
|
|
|
|
|
<el-empty v-if="paragraphDetail.length == 0" :description="$t('common.noData')" />
|
|
|
|
|
|
<div v-else>
|
|
|
|
|
|
<el-scrollbar class="paragraph-scollbar">
|
|
|
|
|
|
<div class="paragraph-detail">
|
2025-06-13 09:12:31 +00:00
|
|
|
|
<el-checkbox-group v-model="multipleSelection">
|
|
|
|
|
|
<InfiniteScroll
|
|
|
|
|
|
:size="paragraphDetail.length"
|
|
|
|
|
|
:total="paginationConfig.total"
|
|
|
|
|
|
:page_size="paginationConfig.page_size"
|
|
|
|
|
|
v-model:current_page="paginationConfig.current_page"
|
|
|
|
|
|
@load="getParagraphList"
|
|
|
|
|
|
:loading="loading"
|
2025-06-06 12:08:15 +00:00
|
|
|
|
>
|
2025-06-13 09:12:31 +00:00
|
|
|
|
<VueDraggable
|
|
|
|
|
|
ref="el"
|
|
|
|
|
|
v-model="paragraphDetail"
|
2025-07-16 08:24:46 +00:00
|
|
|
|
:disabled="isBatch === true || shareDisabled || dialogVisible || !permissionPrecise.doc_edit(id)"
|
2025-06-13 09:12:31 +00:00
|
|
|
|
handle=".handle"
|
|
|
|
|
|
:animation="150"
|
|
|
|
|
|
ghostClass="ghost"
|
2025-06-19 13:32:14 +00:00
|
|
|
|
@end="onEnd"
|
2025-06-13 09:12:31 +00:00
|
|
|
|
>
|
2025-06-09 10:54:13 +00:00
|
|
|
|
<template v-for="(item, index) in paragraphDetail" :key="item.id">
|
2025-06-19 12:32:02 +00:00
|
|
|
|
<div :id="`m${item.id}`" class="flex mb-16">
|
2025-06-13 09:12:31 +00:00
|
|
|
|
<!-- 批量操作 -->
|
2025-06-19 12:32:02 +00:00
|
|
|
|
<div class="paragraph-card flex w-full" v-if="isBatch === true">
|
2025-06-13 09:12:31 +00:00
|
|
|
|
<el-checkbox :value="item.id" />
|
2025-07-15 08:31:26 +00:00
|
|
|
|
<ParagraphCard :data="item" class="mb-8 w-full" :disabled="true" @clickCard="toggleSelect(item.id)"/>
|
2025-06-13 09:12:31 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
<!-- 非批量操作 -->
|
2025-06-19 12:32:02 +00:00
|
|
|
|
<div class="handle paragraph-card flex w-full" :id="item.id" v-else>
|
2025-06-13 09:12:31 +00:00
|
|
|
|
<img
|
|
|
|
|
|
src="@/assets/sort.svg"
|
|
|
|
|
|
alt=""
|
|
|
|
|
|
height="15"
|
|
|
|
|
|
class="handle-img mr-8 mt-24 cursor"
|
|
|
|
|
|
/>
|
2025-06-19 12:32:02 +00:00
|
|
|
|
|
|
|
|
|
|
<ParagraphCard
|
|
|
|
|
|
:data="item"
|
2025-07-14 07:52:21 +00:00
|
|
|
|
:showMoveUp="index !== 0"
|
|
|
|
|
|
:showMoveDown="index < paragraphDetail.length-1"
|
2025-06-19 12:32:02 +00:00
|
|
|
|
class="mb-8 w-full"
|
|
|
|
|
|
@changeState="changeState"
|
|
|
|
|
|
@deleteParagraph="deleteParagraph"
|
2025-07-14 07:52:21 +00:00
|
|
|
|
@move="(val: string)=>onEnd(null, {paragraph_id: item.id,new_position: val==='up'?index-1:index+1}, index)"
|
2025-06-19 13:32:14 +00:00
|
|
|
|
@refresh="refresh"
|
|
|
|
|
|
@refreshMigrateParagraph="refreshMigrateParagraph"
|
2025-07-07 10:48:28 +00:00
|
|
|
|
:disabled="shareDisabled"
|
2025-07-16 08:24:46 +00:00
|
|
|
|
@dialogVisibleChange="dialogVisibleChange"
|
2025-06-19 12:32:02 +00:00
|
|
|
|
/>
|
2025-06-13 09:12:31 +00:00
|
|
|
|
</div>
|
2025-06-09 10:54:13 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
2025-06-13 09:12:31 +00:00
|
|
|
|
</VueDraggable>
|
|
|
|
|
|
</InfiniteScroll>
|
|
|
|
|
|
</el-checkbox-group>
|
2025-06-06 12:08:15 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
</el-scrollbar>
|
2025-06-06 08:32:03 +00:00
|
|
|
|
</div>
|
2025-06-06 12:08:15 +00:00
|
|
|
|
</div>
|
2025-07-04 09:42:12 +00:00
|
|
|
|
</LayoutContainer>
|
2025-05-30 06:34:24 +00:00
|
|
|
|
|
|
|
|
|
|
<div class="mul-operation border-t w-full" v-if="isBatch === true">
|
|
|
|
|
|
<el-button :disabled="multipleSelection.length === 0" @click="openGenerateDialog()">
|
|
|
|
|
|
{{ $t('views.document.generateQuestion.title') }}
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
<el-button :disabled="multipleSelection.length === 0" @click="openSelectDocumentDialog()">
|
|
|
|
|
|
{{ $t('views.document.setting.migration') }}
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|
|
|
<el-button :disabled="multipleSelection.length === 0" @click="deleteMulParagraph">
|
|
|
|
|
|
{{ $t('common.delete') }}
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
<span class="ml-8">
|
2025-06-25 13:58:01 +00:00
|
|
|
|
{{ $t('common.selected') }} {{ multipleSelection.length }}
|
2025-05-30 06:34:24 +00:00
|
|
|
|
{{ $t('views.document.items') }}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</div>
|
2025-06-06 08:32:03 +00:00
|
|
|
|
</el-card>
|
2025-06-25 08:59:42 +00:00
|
|
|
|
<ParagraphDialog
|
|
|
|
|
|
ref="ParagraphDialogRef"
|
|
|
|
|
|
:title="title"
|
|
|
|
|
|
:apiType="apiType"
|
|
|
|
|
|
@refresh="refresh"
|
|
|
|
|
|
/>
|
2025-06-27 03:37:53 +00:00
|
|
|
|
<SelectDocumentDialog
|
|
|
|
|
|
ref="SelectDocumentDialogRef"
|
|
|
|
|
|
@refresh="refreshMigrateParagraph"
|
|
|
|
|
|
:apiType="apiType"
|
|
|
|
|
|
/>
|
2025-06-24 14:12:17 +00:00
|
|
|
|
<GenerateRelatedDialog ref="GenerateRelatedDialogRef" @refresh="refresh" :apiType="apiType" />
|
2025-06-06 08:32:03 +00:00
|
|
|
|
</div>
|
2025-05-30 06:34:24 +00:00
|
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
2025-07-16 08:24:46 +00:00
|
|
|
|
import { reactive, ref, onMounted, computed, watch } from 'vue'
|
2025-05-30 06:34:24 +00:00
|
|
|
|
import { useRoute } from 'vue-router'
|
|
|
|
|
|
import ParagraphDialog from './component/ParagraphDialog.vue'
|
2025-06-06 12:08:15 +00:00
|
|
|
|
import ParagraphCard from './component/ParagraphCard.vue'
|
2025-05-30 06:34:24 +00:00
|
|
|
|
import SelectDocumentDialog from './component/SelectDocumentDialog.vue'
|
|
|
|
|
|
import GenerateRelatedDialog from '@/components/generate-related-dialog/index.vue'
|
2025-06-06 12:08:15 +00:00
|
|
|
|
import { VueDraggable } from 'vue-draggable-plus'
|
2025-05-30 06:34:24 +00:00
|
|
|
|
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
2025-06-24 14:12:17 +00:00
|
|
|
|
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
|
2025-07-16 03:17:18 +00:00
|
|
|
|
import permissionMap from '@/permission'
|
2025-05-30 06:34:24 +00:00
|
|
|
|
import { t } from '@/locales'
|
|
|
|
|
|
const route = useRoute()
|
|
|
|
|
|
const {
|
2025-06-06 08:32:03 +00:00
|
|
|
|
params: { id, documentId },
|
2025-07-07 10:48:28 +00:00
|
|
|
|
query: { type, isShared },
|
2025-05-30 06:34:24 +00:00
|
|
|
|
} = route as any
|
|
|
|
|
|
|
2025-06-24 14:12:17 +00:00
|
|
|
|
const apiType = computed(() => {
|
|
|
|
|
|
return type as 'systemShare' | 'workspace' | 'systemManage'
|
|
|
|
|
|
})
|
2025-07-07 10:48:28 +00:00
|
|
|
|
const shareDisabled = computed(() => {
|
|
|
|
|
|
return isShared === 'true'
|
|
|
|
|
|
})
|
2025-07-16 03:17:18 +00:00
|
|
|
|
const permissionPrecise = computed(() => {
|
|
|
|
|
|
return permissionMap['knowledge'][apiType.value]
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2025-06-24 14:12:17 +00:00
|
|
|
|
|
2025-05-30 06:34:24 +00:00
|
|
|
|
const SelectDocumentDialogRef = ref()
|
|
|
|
|
|
const ParagraphDialogRef = ref()
|
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
|
const changeStateloading = ref(false)
|
|
|
|
|
|
const documentDetail = ref<any>({})
|
|
|
|
|
|
const paragraphDetail = ref<any[]>([])
|
|
|
|
|
|
const title = ref('')
|
|
|
|
|
|
const search = ref('')
|
|
|
|
|
|
const searchType = ref('title')
|
|
|
|
|
|
|
2025-07-16 08:24:46 +00:00
|
|
|
|
const dialogVisible = ref(false)
|
|
|
|
|
|
watch(()=>ParagraphDialogRef.value?.dialogVisible, (val: boolean) => {
|
|
|
|
|
|
dialogVisible.value = val
|
|
|
|
|
|
})
|
|
|
|
|
|
function dialogVisibleChange(val: boolean) {
|
|
|
|
|
|
dialogVisible.value = val
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-06-17 06:43:59 +00:00
|
|
|
|
const handleClick = (e: MouseEvent, ele: any) => {
|
2025-06-06 12:08:15 +00:00
|
|
|
|
e.preventDefault()
|
2025-06-17 18:10:36 +00:00
|
|
|
|
document.querySelector(`${ele}`)?.scrollIntoView({ behavior: 'smooth', block: 'start' })
|
2025-06-06 12:08:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-05-30 06:34:24 +00:00
|
|
|
|
// 批量操作
|
|
|
|
|
|
const isBatch = ref(false)
|
|
|
|
|
|
const multipleSelection = ref<any[]>([])
|
|
|
|
|
|
|
2025-07-15 08:31:26 +00:00
|
|
|
|
function toggleSelect(id: number) {
|
|
|
|
|
|
const index = multipleSelection.value.indexOf(id)
|
|
|
|
|
|
if (index === -1) {
|
|
|
|
|
|
multipleSelection.value.push(id)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
multipleSelection.value.splice(index, 1)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-05-30 06:34:24 +00:00
|
|
|
|
const paginationConfig = reactive({
|
|
|
|
|
|
current_page: 1,
|
|
|
|
|
|
page_size: 30,
|
2025-06-06 08:32:03 +00:00
|
|
|
|
total: 0,
|
2025-05-30 06:34:24 +00:00
|
|
|
|
})
|
|
|
|
|
|
|
2025-06-08 08:43:40 +00:00
|
|
|
|
function deleteParagraph(id: string) {
|
|
|
|
|
|
const index = paragraphDetail.value.findIndex((v) => v.id === id)
|
|
|
|
|
|
paragraphDetail.value.splice(index, 1)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function changeState(id: string) {
|
|
|
|
|
|
const index = paragraphDetail.value.findIndex((v) => v.id === id)
|
|
|
|
|
|
paragraphDetail.value[index].is_active = !paragraphDetail.value[index].is_active
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-06-19 12:32:02 +00:00
|
|
|
|
function refreshMigrateParagraph(data: any) {
|
|
|
|
|
|
if (data) {
|
2025-07-01 11:16:58 +00:00
|
|
|
|
multipleSelection.value = [data.id]
|
2025-06-19 12:32:02 +00:00
|
|
|
|
}
|
2025-05-30 06:34:24 +00:00
|
|
|
|
paragraphDetail.value = paragraphDetail.value.filter(
|
2025-06-06 08:32:03 +00:00
|
|
|
|
(v) => !multipleSelection.value.includes(v.id),
|
2025-05-30 06:34:24 +00:00
|
|
|
|
)
|
|
|
|
|
|
multipleSelection.value = []
|
|
|
|
|
|
MsgSuccess(t('views.document.tip.migrationSuccess'))
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function openSelectDocumentDialog(row?: any) {
|
|
|
|
|
|
if (row) {
|
|
|
|
|
|
multipleSelection.value = [row.id]
|
|
|
|
|
|
}
|
|
|
|
|
|
SelectDocumentDialogRef.value.open(multipleSelection.value)
|
|
|
|
|
|
}
|
|
|
|
|
|
function deleteMulParagraph() {
|
|
|
|
|
|
MsgConfirm(
|
|
|
|
|
|
`${t('views.document.delete.confirmTitle1')} ${multipleSelection.value.length} ${t('views.document.delete.confirmTitle2')}`,
|
|
|
|
|
|
t('views.paragraph.delete.confirmMessage'),
|
|
|
|
|
|
{
|
|
|
|
|
|
confirmButtonText: t('common.confirm'),
|
2025-07-03 06:28:57 +00:00
|
|
|
|
confirmButtonClass: 'danger',
|
2025-06-06 08:32:03 +00:00
|
|
|
|
},
|
2025-05-30 06:34:24 +00:00
|
|
|
|
)
|
|
|
|
|
|
.then(() => {
|
2025-06-24 14:12:17 +00:00
|
|
|
|
loadSharedApi({ type: 'paragraph', systemType: apiType.value })
|
2025-06-09 10:54:13 +00:00
|
|
|
|
.putMulParagraph(id, documentId, multipleSelection.value, changeStateloading)
|
2025-05-30 06:34:24 +00:00
|
|
|
|
.then(() => {
|
|
|
|
|
|
paragraphDetail.value = paragraphDetail.value.filter(
|
2025-06-06 08:32:03 +00:00
|
|
|
|
(v) => !multipleSelection.value.includes(v.id),
|
2025-05-30 06:34:24 +00:00
|
|
|
|
)
|
|
|
|
|
|
multipleSelection.value = []
|
|
|
|
|
|
MsgSuccess(t('views.document.delete.successMessage'))
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
.catch(() => {})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function batchSelectedHandle(bool: boolean) {
|
|
|
|
|
|
isBatch.value = bool
|
|
|
|
|
|
multipleSelection.value = []
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function searchHandle() {
|
|
|
|
|
|
paginationConfig.current_page = 1
|
|
|
|
|
|
paragraphDetail.value = []
|
|
|
|
|
|
getParagraphList()
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function addParagraph() {
|
|
|
|
|
|
title.value = t('views.paragraph.addParagraph')
|
|
|
|
|
|
ParagraphDialogRef.value.open()
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getDetail() {
|
2025-07-08 09:10:26 +00:00
|
|
|
|
loadSharedApi({ type: 'document', isShared: shareDisabled.value, systemType: apiType.value })
|
2025-06-24 14:12:17 +00:00
|
|
|
|
.getDocumentDetail(id, documentId, loading)
|
|
|
|
|
|
.then((res: any) => {
|
|
|
|
|
|
documentDetail.value = res.data
|
|
|
|
|
|
})
|
2025-05-30 06:34:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getParagraphList() {
|
2025-07-08 09:10:26 +00:00
|
|
|
|
loadSharedApi({ type: 'paragraph', isShared: shareDisabled.value, systemType: apiType.value })
|
2025-06-17 09:44:52 +00:00
|
|
|
|
.getParagraphPage(
|
2025-05-30 06:34:24 +00:00
|
|
|
|
id,
|
|
|
|
|
|
documentId,
|
|
|
|
|
|
paginationConfig,
|
|
|
|
|
|
search.value && { [searchType.value]: search.value },
|
2025-06-06 08:32:03 +00:00
|
|
|
|
loading,
|
2025-05-30 06:34:24 +00:00
|
|
|
|
)
|
2025-06-24 14:12:17 +00:00
|
|
|
|
.then((res: any) => {
|
2025-05-30 06:34:24 +00:00
|
|
|
|
paragraphDetail.value = [...paragraphDetail.value, ...res.data.records]
|
|
|
|
|
|
paginationConfig.total = res.data.total
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function refresh(data: any) {
|
|
|
|
|
|
if (data) {
|
|
|
|
|
|
const index = paragraphDetail.value.findIndex((v) => v.id === data.id)
|
|
|
|
|
|
paragraphDetail.value.splice(index, 1, data)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
paginationConfig.current_page = 1
|
|
|
|
|
|
paragraphDetail.value = []
|
|
|
|
|
|
getParagraphList()
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const GenerateRelatedDialogRef = ref()
|
|
|
|
|
|
function openGenerateDialog(row?: any) {
|
|
|
|
|
|
const arr: string[] = []
|
|
|
|
|
|
if (row) {
|
|
|
|
|
|
arr.push(row.id)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
multipleSelection.value.map((v) => {
|
|
|
|
|
|
if (v) {
|
|
|
|
|
|
arr.push(v)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GenerateRelatedDialogRef.value.open(arr, 'paragraph')
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-07-14 07:52:21 +00:00
|
|
|
|
function onEnd(event?: any, params?: any, index?: number) {
|
|
|
|
|
|
const obj =params ?? {
|
2025-06-27 11:12:17 +00:00
|
|
|
|
paragraph_id: paragraphDetail.value[event.newIndex].id, // 当前拖动的段落ID
|
2025-07-01 11:16:58 +00:00
|
|
|
|
new_position: paragraphDetail.value[event.newIndex + 1].position, // 新位置的段落位置
|
2025-06-06 12:08:15 +00:00
|
|
|
|
}
|
2025-06-24 14:12:17 +00:00
|
|
|
|
loadSharedApi({ type: 'paragraph', systemType: apiType.value }).putAdjustPosition(
|
|
|
|
|
|
id,
|
|
|
|
|
|
documentId,
|
|
|
|
|
|
obj,
|
|
|
|
|
|
loading,
|
|
|
|
|
|
)
|
2025-07-14 07:52:21 +00:00
|
|
|
|
if(params) {
|
|
|
|
|
|
const movedItem = paragraphDetail.value.splice(index as number, 1)[0]
|
|
|
|
|
|
paragraphDetail.value.splice(params.new_position, 0, movedItem)
|
|
|
|
|
|
}
|
2025-06-06 12:08:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-05-30 06:34:24 +00:00
|
|
|
|
onMounted(() => {
|
|
|
|
|
|
getDetail()
|
|
|
|
|
|
getParagraphList()
|
|
|
|
|
|
})
|
|
|
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
2025-06-06 08:32:03 +00:00
|
|
|
|
.paragraph {
|
|
|
|
|
|
position: relative;
|
2025-05-30 06:34:24 +00:00
|
|
|
|
.header-button {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
right: calc(var(--app-base-px) * 3);
|
2025-06-06 08:32:03 +00:00
|
|
|
|
top: calc(var(--app-base-px) + 4px);
|
2025-05-30 06:34:24 +00:00
|
|
|
|
}
|
2025-06-06 12:08:15 +00:00
|
|
|
|
.paragraph-sidebar {
|
2025-07-04 09:42:12 +00:00
|
|
|
|
width: 100%;
|
2025-07-07 07:04:35 +00:00
|
|
|
|
height: calc(100vh - 215px);
|
2025-07-04 09:42:12 +00:00
|
|
|
|
box-sizing: border-box;
|
2025-05-30 06:34:24 +00:00
|
|
|
|
}
|
2025-06-06 12:08:15 +00:00
|
|
|
|
|
|
|
|
|
|
.paragraph-detail {
|
|
|
|
|
|
height: calc(100vh - 215px);
|
|
|
|
|
|
max-width: 1000px;
|
|
|
|
|
|
margin: 16px auto;
|
2025-06-13 09:12:31 +00:00
|
|
|
|
|
2025-06-18 13:39:39 +00:00
|
|
|
|
.el-checkbox-group {
|
|
|
|
|
|
font-size: inherit;
|
|
|
|
|
|
line-height: inherit;
|
|
|
|
|
|
}
|
2025-05-30 06:34:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&__main {
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
.mul-operation {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
bottom: 0;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
padding: 16px 24px;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-06-06 12:08:15 +00:00
|
|
|
|
.paragraph-card {
|
|
|
|
|
|
&.handle {
|
|
|
|
|
|
.handle-img {
|
|
|
|
|
|
visibility: hidden;
|
|
|
|
|
|
}
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
.handle-img {
|
|
|
|
|
|
visibility: visible;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-05-30 06:34:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
</style>
|