suerprisePlus
2024-08-05 30e393df7b1d89c4172a7f4bec6e80e2dc00c373
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<template>
    <div class="semanticFunctionBox">
        <el-card class="elCard">
            <div class="cardContent">
                <div style="flex:1;">
                    <contentList :parentData="parentData"></contentList>
                </div>
                <div>
                    <enter-box @sendmsg="sendMessage"></enter-box>
                </div>
            </div>
        </el-card>
    </div>
</template>
 
<script>
import contentList from './contentList.vue';
import enterBox from './enterBox.vue';
export default {
    components: {
        enterBox,
        contentList
    },
    data() {
        return {
            sendMsg: null,
            parentData: {},
        }
    },
    mounted() {
 
    },
    methods: {
        sendMessage(res) {
            var valMsg = res.val;
            if (res.type == "text") {
                this.parentData = {
                    type: res.type,
                    msg: valMsg.replaceAll('\n', '')
                }
 
            } else if (res.type == "insertFile") {
                this.parentData = {
                    type: res.type,
                    msg: valMsg
                }
 
            }
            this.$nextTick(() => {
                this.parentData = {}
            })
        },
 
    }
}
</script>
 
<style lang="scss" scoped>
.semanticFunctionBox {
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    position: absolute;
    margin: 10px;
    border-radius: 5px;
 
    ::v-deep.el-card__body {
        padding: 10px;
        width: 100%;
        height: 100%;
    }
 
    .elCard {
        width: 100%;
        height: 100%;
 
    }
 
    .cardContent {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        padding: 10px;
 
    }
 
 
 
}
</style>