This commit is contained in:
wangdan-fit2cloud 2024-01-18 18:41:32 +08:00
parent e83afe74c5
commit f74bafd59a
2 changed files with 10 additions and 16 deletions

View File

@ -0,0 +1,4 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.5 2H21.5C22.0523 2 22.5 2.44772 22.5 3V17C22.5 17.5523 22.0523 18 21.5 18H2.5C1.94772 18 1.5 17.5523 1.5 17V3C1.5 2.44772 1.94772 2 2.5 2ZM3.5 14V16H20.5V14H3.5Z" fill="white"/>
<path d="M6.5 20H17.5C17.7761 20 18 20.2239 18 20.5V21.5C18 21.7761 17.7761 22 17.5 22H6.5C6.22386 22 6 21.7761 6 21.5V20.5C6 20.2239 6.22386 20 6.5 20Z" fill="#D8D8D8"/>
</svg>

After

Width:  |  Height:  |  Size: 464 B

View File

@ -17,7 +17,6 @@
class="paragraph-source-card cursor mb-8"
:class="item.is_active ? '' : 'disabled'"
:showIcon="false"
@click="editParagraph(item)"
>
<template #icon>
<AppAvatar :name="index + 1 + ''" class="mr-12 avatar-light" :size="22" />
@ -45,13 +44,11 @@
</el-form-item>
</el-form>
</el-scrollbar>
<ParagraphDialog ref="ParagraphDialogRef" title="分段详情" @refresh="refresh" />
</el-dialog>
</template>
<script setup lang="ts">
import { ref, watch, nextTick } from 'vue'
import ParagraphDialog from '@/views/paragraph/component/ParagraphDialog.vue'
import { cloneDeep } from 'lodash'
const emit = defineEmits(['refresh'])
const ParagraphDialogRef = ref()
@ -64,21 +61,14 @@ watch(dialogVisible, (bool) => {
}
})
const open = (data: any) => {
detail.value = data
const open = (data: any, id?: string) => {
detail.value = cloneDeep(data)
detail.value.paragraph_list = id
? detail.value.paragraph_list.filter((v) => v.dataset_id === id)
: detail.value.paragraph_list
dialogVisible.value = true
}
function editParagraph(row: any) {
ParagraphDialogRef.value.open(row)
}
function refresh(data: any) {
if (data) {
const index = detail.value.paragraph_list.findIndex((v) => v.id === data.id)
detail.value.paragraph_list.splice(index, 1, data)
}
}
defineExpose({ open })
</script>
<style lang="scss" scoped>