mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: vueDraggable disabled
This commit is contained in:
parent
948ec2fde6
commit
4715e4d84e
|
|
@ -201,6 +201,6 @@ function getModelFn() {
|
|||
})
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
defineExpose({ open, dialogVisible })
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@
|
|||
</el-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import { ref, computed, watch } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import GenerateRelatedDialog from '@/components/generate-related-dialog/index.vue'
|
||||
import ParagraphDialog from '@/views/paragraph/component/ParagraphDialog.vue'
|
||||
|
|
@ -154,7 +154,7 @@ const permissionPrecise = computed (() => {
|
|||
return permissionMap['knowledge'][apiType.value]
|
||||
})
|
||||
|
||||
const emit = defineEmits(['clickCard','changeState', 'deleteParagraph', 'refresh', 'refreshMigrateParagraph','move'])
|
||||
const emit = defineEmits(['dialogVisibleChange','clickCard','changeState', 'deleteParagraph', 'refresh', 'refreshMigrateParagraph','move'])
|
||||
const loading = ref(false)
|
||||
const changeStateloading = ref(false)
|
||||
const show = ref(false)
|
||||
|
|
@ -222,7 +222,7 @@ function editParagraph(row: any) {
|
|||
const cardClick = permissionPrecise.value.doc_edit(id)
|
||||
|
||||
function handleClickCard(row: any) {
|
||||
if (!cardClick)
|
||||
if (!cardClick || dialogVisible.value)
|
||||
{return }
|
||||
if (!props.disabled) {
|
||||
editParagraph(row)
|
||||
|
|
@ -248,6 +248,11 @@ function refresh(data?: any) {
|
|||
function refreshMigrateParagraph() {
|
||||
emit('refreshMigrateParagraph', props.data)
|
||||
}
|
||||
|
||||
const dialogVisible = computed(()=> ParagraphDialogRef.value?.dialogVisible || SelectDocumentDialogRef.value?.dialogVisible || GenerateRelatedDialogRef.value?.dialogVisible)
|
||||
watch(dialogVisible, (val: boolean)=>{
|
||||
emit('dialogVisibleChange', val)
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.paragraph-box {
|
||||
|
|
|
|||
|
|
@ -8,9 +8,6 @@
|
|||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
@click.stop
|
||||
@mousemove.stop
|
||||
@mousedown.stop
|
||||
@keydown.stop
|
||||
>
|
||||
<el-row v-loading="loading">
|
||||
<el-col :span="18">
|
||||
|
|
@ -165,6 +162,6 @@ const handleDebounceClick = debounce(() => {
|
|||
submitHandle()
|
||||
}, 200)
|
||||
|
||||
defineExpose({ open })
|
||||
defineExpose({ open, dialogVisible })
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
|
|
|
|||
|
|
@ -86,6 +86,6 @@ function changeDocument(document_id: string) {
|
|||
localStorage.setItem(id + 'chat_document_id', document_id)
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
defineExpose({ open, dialogVisible })
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@
|
|||
<VueDraggable
|
||||
ref="el"
|
||||
v-model="paragraphDetail"
|
||||
:disabled="isBatch === true || shareDisabled || !permissionPrecise.doc_edit(id)"
|
||||
:disabled="isBatch === true || shareDisabled || dialogVisible || !permissionPrecise.doc_edit(id)"
|
||||
handle=".handle"
|
||||
:animation="150"
|
||||
ghostClass="ghost"
|
||||
|
|
@ -118,6 +118,7 @@
|
|||
@refresh="refresh"
|
||||
@refreshMigrateParagraph="refreshMigrateParagraph"
|
||||
:disabled="shareDisabled"
|
||||
@dialogVisibleChange="dialogVisibleChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -163,7 +164,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref, onMounted, computed } from 'vue'
|
||||
import { reactive, ref, onMounted, computed, watch } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import ParagraphDialog from './component/ParagraphDialog.vue'
|
||||
import ParagraphCard from './component/ParagraphCard.vue'
|
||||
|
|
@ -201,6 +202,14 @@ const title = ref('')
|
|||
const search = ref('')
|
||||
const searchType = ref('title')
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
watch(()=>ParagraphDialogRef.value?.dialogVisible, (val: boolean) => {
|
||||
dialogVisible.value = val
|
||||
})
|
||||
function dialogVisibleChange(val: boolean) {
|
||||
dialogVisible.value = val
|
||||
}
|
||||
|
||||
const handleClick = (e: MouseEvent, ele: any) => {
|
||||
e.preventDefault()
|
||||
document.querySelector(`${ele}`)?.scrollIntoView({ behavior: 'smooth', block: 'start' })
|
||||
|
|
|
|||
Loading…
Reference in New Issue