AiTextDescModal.vue
1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!--手动录入text-->
<template>
<BasicModal title="段落详情" destroyOnClose @register="registerModal" :canFullscreen="false" width="600px" :footer="null">
<div class="p-2">
<div class="header">
<a-tag color="#a9c8ff">
<span>{{hitTextDescData.source}}</span>
</a-tag>
</div>
<div class="content">
<MarkdownViewer :value="hitTextDescData.content" />
</div>
</div>
</BasicModal>
</template>
<script lang="ts">
import { ref } from 'vue';
import BasicModal from '@/components/Modal/src/BasicModal.vue';
import { useModalInner } from '@/components/Modal';
import BasicForm from '@/components/Form/src/BasicForm.vue';
import { MarkdownViewer } from '@/components/Markdown';
export default {
name: 'AiTextDescModal',
components: {
MarkdownViewer,
BasicForm,
BasicModal,
},
emits: ['success', 'register'],
setup(props, { emit }) {
let hitTextDescData = ref<any>({})
//注册modal
const [registerModal, { closeModal, setModalProps }] = useModalInner(async (data) => {
hitTextDescData.value.source = 'score' + ' ' + data.score.toFixed(2);
hitTextDescData.value.content = data.content;
setModalProps({ header: '300px' })
});
return {
registerModal,
hitTextDescData
};
},
};
</script>
<style scoped lang="less">
.pointer {
cursor: pointer;
}
.header {
font-size: 16px;
font-weight: bold;
margin-top: 10px;
}
.content {
margin-top: 20px;
max-height: 600px;
overflow-y: auto;
overflow-x: auto;
}
.title-tag {
color: #477dee;
}
</style>