ai-chat-bot-interface 1.0.8 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierignore +5 -0
- package/.prettierrc.cjs +37 -0
- package/index.html +1 -1
- package/package.json +5 -3
- package/src/App.vue +4 -12
- package/src/ChatUi.less +45 -26
- package/src/ChatUi.vue +184 -118
- package/src/assets/styles/public.less +5 -2
- package/src/components/DishesCard.vue +8 -9
- package/src/components/DishesList.vue +16 -12
- package/src/components/OperateModule.vue +175 -0
- package/src/components/PlanCard.vue +5 -6
- package/src/components/icons/BackIcon.vue +19 -0
- package/src/components/icons/ClearIcon.vue +10 -3
- package/src/components/icons/CloseIcon.vue +9 -2
- package/src/components/icons/NewSessionIcon.vue +11 -4
- package/src/components/icons/SendIcon.vue +14 -3
- package/src/components/icons/loadingIcon.vue +76 -0
- package/src/components/icons/loadingIcon2.vue +88 -0
- package/src/components/icons/newChat.vue +18 -0
- package/src/components/icons/tagIcon.vue +18 -0
- package/src/main.js +4 -4
- package/src/style.css +4 -79
- package/src/utils/request.js +15 -17
- package/vite.config.js +20 -3
- package/src/components/HelloWorld.vue +0 -43
- package/src/mock.js +0 -162
package/.prettierignore
ADDED
package/.prettierrc.cjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
// 一行最多 80 字符
|
|
3
|
+
printWidth: 80,
|
|
4
|
+
// 使用 4 个空格缩进
|
|
5
|
+
tabWidth: 2,
|
|
6
|
+
// 不使用 tab 缩进,而使用空格
|
|
7
|
+
useTabs: false,
|
|
8
|
+
// 行尾需要有分号
|
|
9
|
+
semi: true,
|
|
10
|
+
// 使用单引号代替双引号
|
|
11
|
+
singleQuote: true,
|
|
12
|
+
// 对象的 key 仅在必要时用引号
|
|
13
|
+
quoteProps: 'as-needed',
|
|
14
|
+
// jsx 不使用单引号,而使用双引号
|
|
15
|
+
jsxSingleQuote: false,
|
|
16
|
+
// 末尾使用逗号
|
|
17
|
+
trailingComma: 'all',
|
|
18
|
+
// 大括号内的首尾需要空格 { foo: bar }
|
|
19
|
+
bracketSpacing: true,
|
|
20
|
+
// jsx 标签的反尖括号需要换行
|
|
21
|
+
jsxBracketSameLine: false,
|
|
22
|
+
// 箭头函数,只有一个参数的时候,也需要括号
|
|
23
|
+
arrowParens: 'always',
|
|
24
|
+
// 每个文件格式化的范围是文件的全部内容
|
|
25
|
+
rangeStart: 0,
|
|
26
|
+
rangeEnd: Infinity,
|
|
27
|
+
// 不需要写文件开头的 @prettier
|
|
28
|
+
requirePragma: false,
|
|
29
|
+
// 不需要自动在文件开头插入 @prettier
|
|
30
|
+
insertPragma: false,
|
|
31
|
+
// 使用默认的折行标准
|
|
32
|
+
proseWrap: 'preserve',
|
|
33
|
+
// 根据显示样式决定 html 要不要折行
|
|
34
|
+
htmlWhitespaceSensitivity: 'css',
|
|
35
|
+
// 换行符使用 lf
|
|
36
|
+
endOfLine: 'auto'
|
|
37
|
+
}
|
package/index.html
CHANGED
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-chat-bot-interface",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"description": "A AI chat bot interface. (private)",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"dev": "vite",
|
|
10
10
|
"build": "vite build",
|
|
11
|
-
"preview": "vite preview"
|
|
11
|
+
"preview": "vite preview",
|
|
12
|
+
"prettier:write": "prettier --write src"
|
|
12
13
|
},
|
|
13
14
|
"keywords": [
|
|
14
15
|
"vue3",
|
|
@@ -21,7 +22,8 @@
|
|
|
21
22
|
"devDependencies": {
|
|
22
23
|
"@vitejs/plugin-vue": "^5.2.1",
|
|
23
24
|
"less": "^4.2.2",
|
|
24
|
-
"vite": "^6.1.0"
|
|
25
|
+
"vite": "^6.1.0",
|
|
26
|
+
"prettier": "^2.6.2"
|
|
25
27
|
},
|
|
26
28
|
"author": "lin_26",
|
|
27
29
|
"license": "MIT"
|
package/src/App.vue
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import ChatUi from './ChatUi.vue'
|
|
2
|
+
import ChatUi from './ChatUi.vue';
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<template>
|
|
6
|
-
<div style="width: 100vw; height: 100vh
|
|
7
|
-
<chat-ui bot-id="
|
|
8
|
-
token="pat_123"
|
|
9
|
-
uid="5555"
|
|
10
|
-
/>
|
|
6
|
+
<div style="width: 100vw; height: 100vh">
|
|
7
|
+
<chat-ui bot-id="111" token="555" uid="262" />
|
|
11
8
|
</div>
|
|
12
9
|
</template>
|
|
13
|
-
|
|
14
|
-
<style>
|
|
15
|
-
#app {
|
|
16
|
-
padding: 0;
|
|
17
|
-
}
|
|
18
|
-
</style>
|
|
10
|
+
<style></style>
|
package/src/ChatUi.less
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
@import './assets/styles/public';
|
|
3
|
-
|
|
4
1
|
.btn {
|
|
5
2
|
background-color: #fff;
|
|
6
3
|
padding: 8px;
|
|
@@ -33,7 +30,7 @@
|
|
|
33
30
|
border-radius: 8px;
|
|
34
31
|
border: 1px solid rgba(68, 83, 130, 0.25);
|
|
35
32
|
&:hover {
|
|
36
|
-
background-color: #
|
|
33
|
+
background-color: #eaeaea;
|
|
37
34
|
}
|
|
38
35
|
}
|
|
39
36
|
}
|
|
@@ -61,10 +58,7 @@
|
|
|
61
58
|
}
|
|
62
59
|
|
|
63
60
|
&_header {
|
|
64
|
-
|
|
65
|
-
flex-direction: row;
|
|
66
|
-
justify-content: space-between;
|
|
67
|
-
align-items: center;
|
|
61
|
+
.flexrbc();
|
|
68
62
|
box-sizing: border-box;
|
|
69
63
|
padding: 0 16px;
|
|
70
64
|
height: 56px;
|
|
@@ -77,18 +71,43 @@
|
|
|
77
71
|
.flexrsc();
|
|
78
72
|
|
|
79
73
|
.logo {
|
|
80
|
-
width:
|
|
81
|
-
height:
|
|
74
|
+
width: 32px;
|
|
75
|
+
height: 32px;
|
|
76
|
+
border-radius: 50%;
|
|
82
77
|
margin-right: 16px;
|
|
83
78
|
}
|
|
79
|
+
.back {
|
|
80
|
+
.flexrcc();
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
font-size: 24px;
|
|
83
|
+
width: 32px;
|
|
84
|
+
height: 32px;
|
|
85
|
+
gap: 15px;
|
|
86
|
+
}
|
|
87
|
+
.name {
|
|
88
|
+
font-weight: 600;
|
|
89
|
+
font-size: 14px;
|
|
90
|
+
color: #000;
|
|
91
|
+
line-height: 16px;
|
|
92
|
+
&_box {
|
|
93
|
+
}
|
|
94
|
+
&_sub {
|
|
95
|
+
font-weight: 400;
|
|
96
|
+
font-size: 10px;
|
|
97
|
+
color: #666;
|
|
98
|
+
line-height: 12px;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
84
101
|
}
|
|
85
102
|
|
|
86
103
|
.btn {
|
|
87
|
-
|
|
104
|
+
.flexrcc();
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
font-size: 32px;
|
|
88
107
|
background-color: @bg-color;
|
|
89
108
|
|
|
90
109
|
&_group {
|
|
91
|
-
.flexrec()
|
|
110
|
+
.flexrec();
|
|
92
111
|
}
|
|
93
112
|
}
|
|
94
113
|
}
|
|
@@ -102,13 +121,15 @@
|
|
|
102
121
|
overflow-y: auto;
|
|
103
122
|
|
|
104
123
|
.replay {
|
|
105
|
-
.flexrss();
|
|
106
124
|
margin: 20px 0;
|
|
107
125
|
|
|
108
126
|
.name {
|
|
127
|
+
.flexrsc();
|
|
109
128
|
width: 100%;
|
|
110
129
|
text-align: left;
|
|
111
|
-
font-size:
|
|
130
|
+
font-size: 10px;
|
|
131
|
+
padding-bottom: 10px;
|
|
132
|
+
gap: 5px;
|
|
112
133
|
}
|
|
113
134
|
|
|
114
135
|
.time {
|
|
@@ -117,9 +138,9 @@
|
|
|
117
138
|
}
|
|
118
139
|
|
|
119
140
|
.avatar {
|
|
120
|
-
width:
|
|
121
|
-
height:
|
|
122
|
-
|
|
141
|
+
width: 20px;
|
|
142
|
+
height: 20px;
|
|
143
|
+
border-radius: 10px;
|
|
123
144
|
}
|
|
124
145
|
|
|
125
146
|
.box {
|
|
@@ -127,19 +148,20 @@
|
|
|
127
148
|
font-size: 14px;
|
|
128
149
|
font-weight: 400;
|
|
129
150
|
text-align: left;
|
|
130
|
-
background-color:
|
|
151
|
+
background-color: @sys-bg;
|
|
131
152
|
padding: 12px 16px;
|
|
132
153
|
border-radius: @border-radius;
|
|
154
|
+
border-top-left-radius: 2px;
|
|
133
155
|
|
|
134
156
|
/deep/ .text {
|
|
135
157
|
word-break: break-all;
|
|
136
158
|
white-space: pre-wrap;
|
|
159
|
+
margin: 0;
|
|
137
160
|
|
|
138
161
|
a {
|
|
139
162
|
color: #039938;
|
|
140
163
|
}
|
|
141
164
|
}
|
|
142
|
-
|
|
143
165
|
}
|
|
144
166
|
|
|
145
167
|
.recm {
|
|
@@ -156,17 +178,14 @@
|
|
|
156
178
|
|
|
157
179
|
&.role_user {
|
|
158
180
|
.flexres();
|
|
159
|
-
|
|
160
|
-
.avatar {
|
|
161
|
-
margin: 0 0 0 12px;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
181
|
.name {
|
|
182
|
+
.flexrec();
|
|
165
183
|
text-align: right;
|
|
166
184
|
}
|
|
167
|
-
|
|
168
185
|
.box {
|
|
169
|
-
|
|
186
|
+
border-radius: @border-radius;
|
|
187
|
+
border-top-right-radius: 2px;
|
|
188
|
+
background-color: @user-bg;
|
|
170
189
|
}
|
|
171
190
|
}
|
|
172
191
|
}
|