vue-element-ui-x 0.1.9-beta → 0.2.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/lib/components/Attachments/index.js +4 -4
- package/lib/components/Bubble/index.js +47 -34
- package/lib/components/BubbleList/index.js +65 -59
- package/lib/components/Conversations/index.js +29 -66
- package/lib/components/FilesCard/index.js +1 -1
- package/lib/components/Prompts/index.js +23 -23
- package/lib/components/Sender/index.js +6 -6
- package/lib/components/Think/index.js +1 -1
- package/lib/components/Thinking/index.js +5 -5
- package/lib/components/ThoughtChain/index.js +52 -41
- package/lib/components/Typewriter/index.js +46 -33
- package/lib/components/Welcome/index.js +5 -5
- package/lib/index.common.js +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.js +266 -463
- package/lib/index.umd.js +1 -1
- package/lib/mixins/index.js +105 -16
- package/package.json +1 -1
- package/src/components/Attachments/index.js +8 -8
- package/src/components/Bubble/index.js +6 -6
- package/src/components/Bubble/src/main.vue +299 -299
- package/src/components/BubbleList/index.js +8 -8
- package/src/components/BubbleList/src/loading.vue +75 -75
- package/src/components/BubbleList/src/main.vue +461 -466
- package/src/components/Conversations/index.js +8 -8
- package/src/components/Conversations/src/components/item.vue +13 -34
- package/src/components/Conversations/src/main.vue +4 -18
- package/src/components/FilesCard/index.js +8 -8
- package/src/components/FilesCard/src/fileSvg/audio.vue +38 -38
- package/src/components/FilesCard/src/fileSvg/code.vue +35 -35
- package/src/components/FilesCard/src/fileSvg/database.vue +94 -94
- package/src/components/FilesCard/src/fileSvg/excel.vue +38 -38
- package/src/components/FilesCard/src/fileSvg/file.vue +40 -40
- package/src/components/FilesCard/src/fileSvg/image.vue +40 -40
- package/src/components/FilesCard/src/fileSvg/index.js +46 -46
- package/src/components/FilesCard/src/fileSvg/link.vue +54 -54
- package/src/components/FilesCard/src/fileSvg/mark.vue +38 -38
- package/src/components/FilesCard/src/fileSvg/pdf.vue +38 -38
- package/src/components/FilesCard/src/fileSvg/ppt.vue +38 -38
- package/src/components/FilesCard/src/fileSvg/three.vue +38 -38
- package/src/components/FilesCard/src/fileSvg/txt.vue +38 -38
- package/src/components/FilesCard/src/fileSvg/unknown.vue +54 -54
- package/src/components/FilesCard/src/fileSvg/video.vue +38 -38
- package/src/components/FilesCard/src/fileSvg/word.vue +38 -38
- package/src/components/FilesCard/src/fileSvg/zip.vue +38 -38
- package/src/components/FilesCard/src/options.js +18 -18
- package/src/components/Prompts/index.js +8 -8
- package/src/components/Prompts/src/main.vue +248 -248
- package/src/components/Sender/index.js +8 -8
- package/src/components/Sender/src/components/ClearButton.vue +28 -28
- package/src/components/Sender/src/components/Loading.vue +53 -53
- package/src/components/Sender/src/components/LoadingButton.vue +39 -39
- package/src/components/Sender/src/components/SendButton.vue +26 -26
- package/src/components/Sender/src/components/SpeechButton.vue +24 -24
- package/src/components/Sender/src/components/SpeechLoading.vue +87 -87
- package/src/components/Sender/src/components/SpeechLoadingButton.vue +43 -43
- package/src/components/Thinking/index.js +8 -8
- package/src/components/ThoughtChain/index.js +8 -8
- package/src/components/Typewriter/index.js +8 -8
- package/src/components/Typewriter/src/main.vue +10 -2
- package/src/components/Welcome/index.js +8 -8
- package/src/components/Welcome/src/main.vue +151 -151
- package/src/index.js +0 -2
- package/src/mixins/recordMixin.js +0 -1
- package/src/mixins/sendMixin.js +104 -11
- package/src/mixins/streamMixin.js +3 -5
- package/src/styles/Attachments.scss +236 -236
- package/src/styles/Bubble.scss +157 -157
- package/src/styles/BubbleList.scss +148 -148
- package/src/styles/Conversations.scss +260 -260
- package/src/styles/FilesCard.scss +221 -221
- package/src/styles/Prompts.scss +195 -195
- package/src/styles/Sender.scss +199 -199
- package/src/styles/Thinking.scss +2 -2
- package/src/styles/ThoughtChain.scss +113 -113
- package/src/styles/Typewriter.scss +66 -66
- package/src/theme/var.scss +72 -72
- package/src/components/Think/index.js +0 -8
- package/src/components/Think/src/main.vue +0 -190
- package/src/styles/Think.scss +0 -134
- package/src/styles/button.scss +0 -302
- package/src/styles/var.scss +0 -1052
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
.typer-container {
|
|
2
|
-
overflow-x: auto;
|
|
3
|
-
}
|
|
4
|
-
.markdown-content ::v-deep ul {
|
|
5
|
-
list-style-type: disc;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.typing-markdown-cursor-foggy,
|
|
9
|
-
.typing-cursor-foggy {
|
|
10
|
-
&.markdown-content ::v-deep h1,
|
|
11
|
-
&.markdown-content ::v-deep h2,
|
|
12
|
-
&.markdown-content ::v-deep h3,
|
|
13
|
-
&.markdown-content ::v-deep h4,
|
|
14
|
-
&.markdown-content ::v-deep h5,
|
|
15
|
-
&.markdown-content ::v-deep h6,
|
|
16
|
-
&.markdown-content ::v-deep p,
|
|
17
|
-
&.markdown-content ::v-deep ol:last-child li,
|
|
18
|
-
&.markdown-content ::v-deep ul:last-child li {
|
|
19
|
-
position: relative;
|
|
20
|
-
overflow: hidden;
|
|
21
|
-
|
|
22
|
-
&:last-child:after {
|
|
23
|
-
content: '';
|
|
24
|
-
width: var(--cursor-fog-width);
|
|
25
|
-
height: 1.5em;
|
|
26
|
-
background: linear-gradient(90deg, transparent, var(--cursor-fog-bg-color));
|
|
27
|
-
position: absolute;
|
|
28
|
-
margin-left: calc(-1 * var(--cursor-fog-width));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// // 单独处理pre标签
|
|
33
|
-
// &.markdown-content ::v-deep pre {
|
|
34
|
-
// position: relative;
|
|
35
|
-
// overflow: hidden;
|
|
36
|
-
|
|
37
|
-
// &:last-child:after {
|
|
38
|
-
// content: '';
|
|
39
|
-
// width: var(--cursor-fog-width);
|
|
40
|
-
// height: 1.5em;
|
|
41
|
-
// background: linear-gradient(90deg, transparent, var(--cursor-fog-bg-color));
|
|
42
|
-
// position: absolute;
|
|
43
|
-
// margin-left: calc(-1 * var(--cursor-fog-width) );
|
|
44
|
-
// }
|
|
45
|
-
// }
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.typer-content.typing-cursor::after {
|
|
49
|
-
content: var(--cursor-char);
|
|
50
|
-
margin-left: 2px;
|
|
51
|
-
display: inline-block;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.typer-content.typing-cursor-foggy {
|
|
55
|
-
position: relative;
|
|
56
|
-
overflow: hidden;
|
|
57
|
-
|
|
58
|
-
&:last-child:after {
|
|
59
|
-
content: '';
|
|
60
|
-
width: var(--cursor-fog-width);
|
|
61
|
-
height: 100%;
|
|
62
|
-
background: linear-gradient(90deg, transparent, var(--cursor-fog-bg-color));
|
|
63
|
-
position: absolute;
|
|
64
|
-
margin-left: calc(-1 * var(--cursor-fog-width));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
1
|
+
.typer-container {
|
|
2
|
+
overflow-x: auto;
|
|
3
|
+
}
|
|
4
|
+
.markdown-content ::v-deep ul {
|
|
5
|
+
list-style-type: disc;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.typing-markdown-cursor-foggy,
|
|
9
|
+
.typing-cursor-foggy {
|
|
10
|
+
&.markdown-content ::v-deep h1,
|
|
11
|
+
&.markdown-content ::v-deep h2,
|
|
12
|
+
&.markdown-content ::v-deep h3,
|
|
13
|
+
&.markdown-content ::v-deep h4,
|
|
14
|
+
&.markdown-content ::v-deep h5,
|
|
15
|
+
&.markdown-content ::v-deep h6,
|
|
16
|
+
&.markdown-content ::v-deep p,
|
|
17
|
+
&.markdown-content ::v-deep ol:last-child li,
|
|
18
|
+
&.markdown-content ::v-deep ul:last-child li {
|
|
19
|
+
position: relative;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
|
|
22
|
+
&:last-child:after {
|
|
23
|
+
content: '';
|
|
24
|
+
width: var(--cursor-fog-width);
|
|
25
|
+
height: 1.5em;
|
|
26
|
+
background: linear-gradient(90deg, transparent, var(--cursor-fog-bg-color));
|
|
27
|
+
position: absolute;
|
|
28
|
+
margin-left: calc(-1 * var(--cursor-fog-width));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// // 单独处理pre标签
|
|
33
|
+
// &.markdown-content ::v-deep pre {
|
|
34
|
+
// position: relative;
|
|
35
|
+
// overflow: hidden;
|
|
36
|
+
|
|
37
|
+
// &:last-child:after {
|
|
38
|
+
// content: '';
|
|
39
|
+
// width: var(--cursor-fog-width);
|
|
40
|
+
// height: 1.5em;
|
|
41
|
+
// background: linear-gradient(90deg, transparent, var(--cursor-fog-bg-color));
|
|
42
|
+
// position: absolute;
|
|
43
|
+
// margin-left: calc(-1 * var(--cursor-fog-width) );
|
|
44
|
+
// }
|
|
45
|
+
// }
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.typer-content.typing-cursor::after {
|
|
49
|
+
content: var(--cursor-char);
|
|
50
|
+
margin-left: 2px;
|
|
51
|
+
display: inline-block;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.typer-content.typing-cursor-foggy {
|
|
55
|
+
position: relative;
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
|
|
58
|
+
&:last-child:after {
|
|
59
|
+
content: '';
|
|
60
|
+
width: var(--cursor-fog-width);
|
|
61
|
+
height: 100%;
|
|
62
|
+
background: linear-gradient(90deg, transparent, var(--cursor-fog-bg-color));
|
|
63
|
+
position: absolute;
|
|
64
|
+
margin-left: calc(-1 * var(--cursor-fog-width));
|
|
65
|
+
}
|
|
66
|
+
}
|
package/src/theme/var.scss
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
@import '~element-ui/packages/theme-chalk/src/common/var';
|
|
2
|
-
|
|
3
|
-
:root {
|
|
4
|
-
--color-primary: #{$--color-primary};
|
|
5
|
-
--color-success: #{$--color-success};
|
|
6
|
-
--color-warning: #{$--color-warning};
|
|
7
|
-
--color-danger: #{$--color-danger};
|
|
8
|
-
--color-info: #{$--color-info};
|
|
9
|
-
|
|
10
|
-
$--el-x-color-primary: $--color-primary;
|
|
11
|
-
$--el-x-color-success: $--color-success;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
$--el-x-color-primary: $--color-primary;
|
|
15
|
-
$--el-x-color-success: $--color-success;
|
|
16
|
-
// 字体大小
|
|
17
|
-
$--el-x-font-size-small: $--font-size-small !default;
|
|
18
|
-
$--el-x-font-size-base: $--font-size-base !default;
|
|
19
|
-
$--el-x-font-size-medium: $--font-size-medium !default;
|
|
20
|
-
$--el-x-font-size-large: $--font-size-large !default;
|
|
21
|
-
$--el-x-font-size-extra-large: $--font-size-extra-large !default;
|
|
22
|
-
|
|
23
|
-
// 字体颜色
|
|
24
|
-
$--el-x-text-color-primary: $--color-text-primary !default;
|
|
25
|
-
$--el-x-text-color-regular: $--color-text-regular !default;
|
|
26
|
-
$--el-x-text-color-secondary: $--color-text-secondary !default;
|
|
27
|
-
$--el-x-text-color-placeholder: $--color-text-placeholder !default;
|
|
28
|
-
$--el-x-text-color-disabled: $--color-text-placeholder !default;
|
|
29
|
-
|
|
30
|
-
// 行高
|
|
31
|
-
$--el-x-font-line-height-primary: $--font-line-height-primary;
|
|
32
|
-
|
|
33
|
-
// 填充背景
|
|
34
|
-
$--el-x-fill-color: $--message-background-color;
|
|
35
|
-
|
|
36
|
-
// 边框
|
|
37
|
-
|
|
38
|
-
$--el-x-border-radius-base: $--border-radius-base;
|
|
39
|
-
$--el-x-border-radius-md: 8px;
|
|
40
|
-
$--el-x-border-radius-round: 20px;
|
|
41
|
-
$--el-x-border-radius-small: $--border-radius-small;
|
|
42
|
-
$--el-x-border-radius-circle: $--border-radius-circle;
|
|
43
|
-
|
|
44
|
-
//间距
|
|
45
|
-
|
|
46
|
-
$--el-x-spacing-xs: 4px !default;
|
|
47
|
-
$--el-x-spacing-sm: 8px !default;
|
|
48
|
-
$--el-x-spacing-md: 12px !default;
|
|
49
|
-
$--el-x-spacing-lg: 16px !default;
|
|
50
|
-
$--el-x-spacing-xl: 20px !default;
|
|
51
|
-
|
|
52
|
-
// 内边距
|
|
53
|
-
|
|
54
|
-
$--el-x-padding-xs: 4px !default;
|
|
55
|
-
$--el-x-padding-sm: 8px !default;
|
|
56
|
-
$--el-x-padding-md: 12px !default;
|
|
57
|
-
$--el-x-padding-lg: $--font-size-large !default;
|
|
58
|
-
$--el-x-padding-xl: $--font-size-extra-large !default;
|
|
59
|
-
|
|
60
|
-
// 边框颜色
|
|
61
|
-
$--el-x-border-color: $--border-color-base;
|
|
62
|
-
|
|
63
|
-
// 边框宽度
|
|
64
|
-
$--el-x-border-width: $--border-width-base;
|
|
65
|
-
|
|
66
|
-
// 阴影
|
|
67
|
-
$--el-x-box-shadow-base: $--box-shadow-base;
|
|
68
|
-
|
|
69
|
-
// 边框半径
|
|
70
|
-
$--el-x-border-radius-sm: 2px !default;
|
|
71
|
-
$--el-x-border-radius-md: $--border-radius-base !default;
|
|
72
|
-
$--el-x-border-radius-lg: 8px !default;
|
|
1
|
+
@import '~element-ui/packages/theme-chalk/src/common/var';
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--color-primary: #{$--color-primary};
|
|
5
|
+
--color-success: #{$--color-success};
|
|
6
|
+
--color-warning: #{$--color-warning};
|
|
7
|
+
--color-danger: #{$--color-danger};
|
|
8
|
+
--color-info: #{$--color-info};
|
|
9
|
+
|
|
10
|
+
$--el-x-color-primary: $--color-primary;
|
|
11
|
+
$--el-x-color-success: $--color-success;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
$--el-x-color-primary: $--color-primary;
|
|
15
|
+
$--el-x-color-success: $--color-success;
|
|
16
|
+
// 字体大小
|
|
17
|
+
$--el-x-font-size-small: $--font-size-small !default;
|
|
18
|
+
$--el-x-font-size-base: $--font-size-base !default;
|
|
19
|
+
$--el-x-font-size-medium: $--font-size-medium !default;
|
|
20
|
+
$--el-x-font-size-large: $--font-size-large !default;
|
|
21
|
+
$--el-x-font-size-extra-large: $--font-size-extra-large !default;
|
|
22
|
+
|
|
23
|
+
// 字体颜色
|
|
24
|
+
$--el-x-text-color-primary: $--color-text-primary !default;
|
|
25
|
+
$--el-x-text-color-regular: $--color-text-regular !default;
|
|
26
|
+
$--el-x-text-color-secondary: $--color-text-secondary !default;
|
|
27
|
+
$--el-x-text-color-placeholder: $--color-text-placeholder !default;
|
|
28
|
+
$--el-x-text-color-disabled: $--color-text-placeholder !default;
|
|
29
|
+
|
|
30
|
+
// 行高
|
|
31
|
+
$--el-x-font-line-height-primary: $--font-line-height-primary;
|
|
32
|
+
|
|
33
|
+
// 填充背景
|
|
34
|
+
$--el-x-fill-color: $--message-background-color;
|
|
35
|
+
|
|
36
|
+
// 边框
|
|
37
|
+
|
|
38
|
+
$--el-x-border-radius-base: $--border-radius-base;
|
|
39
|
+
$--el-x-border-radius-md: 8px;
|
|
40
|
+
$--el-x-border-radius-round: 20px;
|
|
41
|
+
$--el-x-border-radius-small: $--border-radius-small;
|
|
42
|
+
$--el-x-border-radius-circle: $--border-radius-circle;
|
|
43
|
+
|
|
44
|
+
//间距
|
|
45
|
+
|
|
46
|
+
$--el-x-spacing-xs: 4px !default;
|
|
47
|
+
$--el-x-spacing-sm: 8px !default;
|
|
48
|
+
$--el-x-spacing-md: 12px !default;
|
|
49
|
+
$--el-x-spacing-lg: 16px !default;
|
|
50
|
+
$--el-x-spacing-xl: 20px !default;
|
|
51
|
+
|
|
52
|
+
// 内边距
|
|
53
|
+
|
|
54
|
+
$--el-x-padding-xs: 4px !default;
|
|
55
|
+
$--el-x-padding-sm: 8px !default;
|
|
56
|
+
$--el-x-padding-md: 12px !default;
|
|
57
|
+
$--el-x-padding-lg: $--font-size-large !default;
|
|
58
|
+
$--el-x-padding-xl: $--font-size-extra-large !default;
|
|
59
|
+
|
|
60
|
+
// 边框颜色
|
|
61
|
+
$--el-x-border-color: $--border-color-base;
|
|
62
|
+
|
|
63
|
+
// 边框宽度
|
|
64
|
+
$--el-x-border-width: $--border-width-base;
|
|
65
|
+
|
|
66
|
+
// 阴影
|
|
67
|
+
$--el-x-box-shadow-base: $--box-shadow-base;
|
|
68
|
+
|
|
69
|
+
// 边框半径
|
|
70
|
+
$--el-x-border-radius-sm: 2px !default;
|
|
71
|
+
$--el-x-border-radius-md: $--border-radius-base !default;
|
|
72
|
+
$--el-x-border-radius-lg: 8px !default;
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="el-x-think"
|
|
4
|
-
:style="{
|
|
5
|
-
'--el-x-think-button-width': buttonWidth,
|
|
6
|
-
'--el-x-think-animation-duration': duration,
|
|
7
|
-
'--el-x-think-content-wrapper-width': maxWidth,
|
|
8
|
-
'--el-x-think-content-wrapper-background-color': backgroundColor,
|
|
9
|
-
'--el-x-think-content-wrapper-color': color,
|
|
10
|
-
}"
|
|
11
|
-
>
|
|
12
|
-
<!-- 触发按钮 -->
|
|
13
|
-
<button
|
|
14
|
-
class="trigger"
|
|
15
|
-
:class="[status, { disabled: !disabled }]"
|
|
16
|
-
:disabled="disabled"
|
|
17
|
-
@click="changeExpand"
|
|
18
|
-
>
|
|
19
|
-
<span class="status-icon">
|
|
20
|
-
<slot
|
|
21
|
-
name="status-icon"
|
|
22
|
-
:status="status"
|
|
23
|
-
>
|
|
24
|
-
<i
|
|
25
|
-
v-if="status === 'thinking'"
|
|
26
|
-
class="is-loading el-icon-center el-icon-loading"
|
|
27
|
-
></i>
|
|
28
|
-
|
|
29
|
-
<i
|
|
30
|
-
v-if="status === 'start'"
|
|
31
|
-
class="el-icon-center start-color el-icon-opportunity"
|
|
32
|
-
></i>
|
|
33
|
-
|
|
34
|
-
<i
|
|
35
|
-
v-if="status === 'end'"
|
|
36
|
-
class="el-icon-center end-color el-icon-success"
|
|
37
|
-
></i>
|
|
38
|
-
|
|
39
|
-
<i
|
|
40
|
-
v-if="status === 'error'"
|
|
41
|
-
class="el-icon-center error-color el-icon-circle-close"
|
|
42
|
-
></i>
|
|
43
|
-
</slot>
|
|
44
|
-
</span>
|
|
45
|
-
|
|
46
|
-
<span class="label">
|
|
47
|
-
<slot
|
|
48
|
-
name="label"
|
|
49
|
-
:status="status"
|
|
50
|
-
>
|
|
51
|
-
{{
|
|
52
|
-
status === 'thinking'
|
|
53
|
-
? '思考中...'
|
|
54
|
-
: status === 'error'
|
|
55
|
-
? '思考遇到问题'
|
|
56
|
-
: status === 'end'
|
|
57
|
-
? '思考完成'
|
|
58
|
-
: '开始思考'
|
|
59
|
-
}}
|
|
60
|
-
</slot>
|
|
61
|
-
</span>
|
|
62
|
-
|
|
63
|
-
<transition name="rotate">
|
|
64
|
-
<span
|
|
65
|
-
v-if="!disabled"
|
|
66
|
-
class="arrow el-icon-center"
|
|
67
|
-
:class="{ expanded: isExpanded }"
|
|
68
|
-
>
|
|
69
|
-
<slot name="arrow">
|
|
70
|
-
<i class="el-icon-center el-icon-arrow-up"></i>
|
|
71
|
-
</slot>
|
|
72
|
-
</span>
|
|
73
|
-
</transition>
|
|
74
|
-
</button>
|
|
75
|
-
|
|
76
|
-
<!-- 内容区域 -->
|
|
77
|
-
<transition name="slide">
|
|
78
|
-
<div
|
|
79
|
-
v-show="isExpanded"
|
|
80
|
-
v-if="displayedContent"
|
|
81
|
-
class="content-wrapper"
|
|
82
|
-
:class="{ 'error-state': status === 'error' }"
|
|
83
|
-
>
|
|
84
|
-
<div class="content">
|
|
85
|
-
<slot
|
|
86
|
-
v-if="status !== 'error'"
|
|
87
|
-
name="content"
|
|
88
|
-
:content="displayedContent"
|
|
89
|
-
>
|
|
90
|
-
<pre>{{ displayedContent }}</pre>
|
|
91
|
-
</slot>
|
|
92
|
-
|
|
93
|
-
<slot
|
|
94
|
-
v-else
|
|
95
|
-
name="error"
|
|
96
|
-
:error-content="displayedContent"
|
|
97
|
-
>
|
|
98
|
-
<div class="error-message">{{ displayedContent }}</div>
|
|
99
|
-
</slot>
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
102
|
-
</transition>
|
|
103
|
-
</div>
|
|
104
|
-
</template>
|
|
105
|
-
|
|
106
|
-
<script>
|
|
107
|
-
export default {
|
|
108
|
-
name: 'ElXThink',
|
|
109
|
-
props: {
|
|
110
|
-
content: {
|
|
111
|
-
type: String,
|
|
112
|
-
default: '',
|
|
113
|
-
},
|
|
114
|
-
modelValue: {
|
|
115
|
-
type: Boolean,
|
|
116
|
-
default: true,
|
|
117
|
-
},
|
|
118
|
-
status: {
|
|
119
|
-
type: String,
|
|
120
|
-
default: 'start',
|
|
121
|
-
validator: function (value) {
|
|
122
|
-
return ['start', 'thinking', 'end', 'error'].indexOf(value) !== -1;
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
disabled: {
|
|
126
|
-
type: Boolean,
|
|
127
|
-
default: false,
|
|
128
|
-
},
|
|
129
|
-
autoCollapse: {
|
|
130
|
-
type: Boolean,
|
|
131
|
-
default: false,
|
|
132
|
-
},
|
|
133
|
-
buttonWidth: {
|
|
134
|
-
type: String,
|
|
135
|
-
default: '160px',
|
|
136
|
-
},
|
|
137
|
-
duration: {
|
|
138
|
-
type: String,
|
|
139
|
-
default: '0.2s',
|
|
140
|
-
},
|
|
141
|
-
maxWidth: {
|
|
142
|
-
type: String,
|
|
143
|
-
default: '500px',
|
|
144
|
-
},
|
|
145
|
-
backgroundColor: {
|
|
146
|
-
type: String,
|
|
147
|
-
default: '#fcfcfc',
|
|
148
|
-
},
|
|
149
|
-
color: {
|
|
150
|
-
type: String,
|
|
151
|
-
default: 'var(--el-color-info)',
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
data() {
|
|
155
|
-
return {
|
|
156
|
-
isExpanded: this.modelValue,
|
|
157
|
-
};
|
|
158
|
-
},
|
|
159
|
-
computed: {
|
|
160
|
-
displayedContent() {
|
|
161
|
-
return this.status === 'error' ? '思考过程中出现错误' : this.content;
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
watch: {
|
|
165
|
-
modelValue(newVal) {
|
|
166
|
-
this.isExpanded = newVal;
|
|
167
|
-
},
|
|
168
|
-
status(newVal) {
|
|
169
|
-
if (newVal === 'end' && this.autoCollapse) {
|
|
170
|
-
this.isExpanded = false;
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
methods: {
|
|
175
|
-
changeExpand() {
|
|
176
|
-
if (this.disabled) return;
|
|
177
|
-
this.isExpanded = !this.isExpanded;
|
|
178
|
-
this.$emit('change', {
|
|
179
|
-
value: this.isExpanded,
|
|
180
|
-
status: this.status,
|
|
181
|
-
});
|
|
182
|
-
this.$emit('update:expanded', this.isExpanded);
|
|
183
|
-
},
|
|
184
|
-
},
|
|
185
|
-
};
|
|
186
|
-
</script>
|
|
187
|
-
|
|
188
|
-
<style lang="scss">
|
|
189
|
-
@import '../../../styles/Think.scss';
|
|
190
|
-
</style>
|
package/src/styles/Think.scss
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
@import '../theme/var.scss';
|
|
2
|
-
|
|
3
|
-
.el-x-think {
|
|
4
|
-
font-family: system-ui, sans-serif;
|
|
5
|
-
margin: 0 auto;
|
|
6
|
-
|
|
7
|
-
.trigger {
|
|
8
|
-
display: flex;
|
|
9
|
-
align-items: center;
|
|
10
|
-
height: 100%;
|
|
11
|
-
width: var(--el-x-think-button-width);
|
|
12
|
-
gap: 8px;
|
|
13
|
-
padding: $--el-x-padding-sm $--el-x-padding-sm + 4px;
|
|
14
|
-
border: $--el-x-border-width solid $--el-x-border-color;
|
|
15
|
-
border-radius: $--el-x-border-radius-md;
|
|
16
|
-
background: $--color-white;
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
margin-bottom: $--el-x-spacing-sm;
|
|
19
|
-
|
|
20
|
-
/* 居中 */
|
|
21
|
-
.el-icon-center {
|
|
22
|
-
height: 100%;
|
|
23
|
-
display: flex;
|
|
24
|
-
align-items: center;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/* 开始颜色 */
|
|
28
|
-
.start-color {
|
|
29
|
-
color: $--color-warning;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/* 完成颜色 */
|
|
33
|
-
.end-color {
|
|
34
|
-
color: $--color-success;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/* 思考中颜色 */
|
|
38
|
-
.is-loading {
|
|
39
|
-
color: $--color-primary;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/* 思考失败颜色 */
|
|
43
|
-
.error-color {
|
|
44
|
-
color: $--color-danger;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&:hover {
|
|
48
|
-
background: #f8f8f8;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&.disabled {
|
|
52
|
-
cursor: pointer;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
&:disabled {
|
|
56
|
-
cursor: not-allowed;
|
|
57
|
-
opacity: 0.7;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.status-icon {
|
|
62
|
-
font-size: 1.2em;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.arrow {
|
|
66
|
-
margin-left: auto;
|
|
67
|
-
transition: transform var(--el-x-think-animation-duration);
|
|
68
|
-
|
|
69
|
-
&.expanded {
|
|
70
|
-
transform: rotate(180deg);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/* 滑动动画 */
|
|
75
|
-
.slide-enter-active,
|
|
76
|
-
.slide-leave-active {
|
|
77
|
-
transition: height var(--el-x-think-animation-duration) ease-in-out,
|
|
78
|
-
opacity var(--el-x-think-animation-duration) ease-in-out;
|
|
79
|
-
overflow: hidden;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.slide-enter,
|
|
83
|
-
.slide-leave-to {
|
|
84
|
-
height: 0 !important;
|
|
85
|
-
opacity: 0;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/* 内容区域样式 */
|
|
89
|
-
.content-wrapper {
|
|
90
|
-
box-sizing: border-box;
|
|
91
|
-
min-width: 0;
|
|
92
|
-
|
|
93
|
-
&.error-state {
|
|
94
|
-
border-color: #ffd0d0;
|
|
95
|
-
background: #fff0f0;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.content {
|
|
100
|
-
pre {
|
|
101
|
-
border: $--el-x-border-width solid $--el-x-border-color;
|
|
102
|
-
background: var(--el-x-think-content-wrapper-background-color);
|
|
103
|
-
padding: $--el-x-padding-sm $--el-x-padding-sm + 4px;
|
|
104
|
-
border-radius: $--el-x-border-radius-md;
|
|
105
|
-
max-width: var(--el-x-think-content-wrapper-width);
|
|
106
|
-
font-size: $--el-x-font-size-base;
|
|
107
|
-
color: var(--el-x-think-content-wrapper-color);
|
|
108
|
-
white-space: pre-wrap;
|
|
109
|
-
font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue,
|
|
110
|
-
sans-serif;
|
|
111
|
-
margin: 0;
|
|
112
|
-
line-height: $--el-x-font-line-height-primary;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.error-message {
|
|
117
|
-
color: $--color-danger;
|
|
118
|
-
height: fit-content;
|
|
119
|
-
padding: $--el-x-spacing-sm;
|
|
120
|
-
background: #ffeef0;
|
|
121
|
-
border-radius: $--el-x-border-radius-base;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/* 旋转动画 */
|
|
125
|
-
.rotate-enter-active,
|
|
126
|
-
.rotate-leave-active {
|
|
127
|
-
transition: transform var(--el-x-think-animation-duration);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.rotate-enter,
|
|
131
|
-
.rotate-leave-to {
|
|
132
|
-
transform: rotate(0deg);
|
|
133
|
-
}
|
|
134
|
-
}
|