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
| <!-- 消息列表为空时,展示 prompt 列表 -->
| <template>
| <div class="chat-empty">
| <!-- title -->
| <div class="center-container">
| <div class="title">工业互联网平台 AI</div>
| <div class="role-list">
| <div
| class="role-item"
| v-for="prompt in promptList"
| :key="prompt.prompt"
| @click="handlerPromptClick(prompt)"
| >
| {{ prompt.prompt }}
| </div>
| </div>
| </div>
| </div>
| </template>
| <script setup lang="ts">
| const promptList = [
| {
| prompt: '今天气怎么样?'
| },
| {
| prompt: '写一首好听的诗歌?'
| }
| ] // prompt 列表
|
| const emits = defineEmits(['onPrompt'])
|
| /** 选中 prompt 点击 */
| const handlerPromptClick = async ({ prompt }) => {
| emits('onPrompt', prompt)
| }
| </script>
| <style scoped lang="scss">
| .chat-empty {
| position: relative;
| display: flex;
| flex-direction: row;
| justify-content: center;
| width: 100%;
| height: 100%;
|
| .center-container {
| display: flex;
| flex-direction: column;
| justify-content: center;
|
| .title {
| font-size: 28px;
| font-weight: bold;
| text-align: center;
| }
|
| .role-list {
| display: flex;
| flex-direction: row;
| flex-wrap: wrap;
| align-items: center;
| justify-content: center;
| width: 460px;
| margin-top: 20px;
|
| .role-item {
| display: flex;
| justify-content: center;
| width: 180px;
| line-height: 50px;
| border: 1px solid #e4e4e4;
| border-radius: 10px;
| margin: 10px;
| cursor: pointer;
| }
|
| .role-item:hover {
| background-color: rgba(243, 243, 243, 0.73);
| }
| }
| }
| }
| </style>
|
|