提交 | 用户 | 时间
|
820397
|
1 |
<!-- 消息列表为空时,展示 prompt 列表 --> |
H |
2 |
<template> |
|
3 |
<div class="chat-empty"> |
|
4 |
<!-- title --> |
|
5 |
<div class="center-container"> |
|
6 |
<div class="title">工业互联网平台 AI</div> |
|
7 |
<div class="role-list"> |
|
8 |
<div |
|
9 |
class="role-item" |
|
10 |
v-for="prompt in promptList" |
|
11 |
:key="prompt.prompt" |
|
12 |
@click="handlerPromptClick(prompt)" |
|
13 |
> |
|
14 |
{{ prompt.prompt }} |
|
15 |
</div> |
|
16 |
</div> |
|
17 |
</div> |
|
18 |
</div> |
|
19 |
</template> |
|
20 |
<script setup lang="ts"> |
|
21 |
const promptList = [ |
|
22 |
{ |
|
23 |
prompt: '今天气怎么样?' |
|
24 |
}, |
|
25 |
{ |
|
26 |
prompt: '写一首好听的诗歌?' |
|
27 |
} |
|
28 |
] // prompt 列表 |
|
29 |
|
|
30 |
const emits = defineEmits(['onPrompt']) |
|
31 |
|
|
32 |
/** 选中 prompt 点击 */ |
|
33 |
const handlerPromptClick = async ({ prompt }) => { |
|
34 |
emits('onPrompt', prompt) |
|
35 |
} |
|
36 |
</script> |
|
37 |
<style scoped lang="scss"> |
|
38 |
.chat-empty { |
|
39 |
position: relative; |
|
40 |
display: flex; |
|
41 |
flex-direction: row; |
|
42 |
justify-content: center; |
|
43 |
width: 100%; |
|
44 |
height: 100%; |
|
45 |
|
|
46 |
.center-container { |
|
47 |
display: flex; |
|
48 |
flex-direction: column; |
|
49 |
justify-content: center; |
|
50 |
|
|
51 |
.title { |
|
52 |
font-size: 28px; |
|
53 |
font-weight: bold; |
|
54 |
text-align: center; |
|
55 |
} |
|
56 |
|
|
57 |
.role-list { |
|
58 |
display: flex; |
|
59 |
flex-direction: row; |
|
60 |
flex-wrap: wrap; |
|
61 |
align-items: center; |
|
62 |
justify-content: center; |
|
63 |
width: 460px; |
|
64 |
margin-top: 20px; |
|
65 |
|
|
66 |
.role-item { |
|
67 |
display: flex; |
|
68 |
justify-content: center; |
|
69 |
width: 180px; |
|
70 |
line-height: 50px; |
|
71 |
border: 1px solid #e4e4e4; |
|
72 |
border-radius: 10px; |
|
73 |
margin: 10px; |
|
74 |
cursor: pointer; |
|
75 |
} |
|
76 |
|
|
77 |
.role-item:hover { |
|
78 |
background-color: rgba(243, 243, 243, 0.73); |
|
79 |
} |
|
80 |
} |
|
81 |
} |
|
82 |
} |
|
83 |
</style> |