Skip to content

Commit 0e78245

Browse files
perf: Style optimization and some icon updates
1 parent 27a26f3 commit 0e78245

File tree

58 files changed

+745
-630
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+745
-630
lines changed

ui/src/assets/hit-test-empty.png

-447 Bytes
Loading

ui/src/components/ai-chat/component/operation-button/LogOperationButton.vue

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
<div>
99
<!-- 语音播放 -->
1010
<span v-if="tts">
11-
<el-tooltip effect="dark" :content="$t('chat.operation.play')" placement="top" v-if="!audioPlayerStatus">
11+
<el-tooltip
12+
effect="dark"
13+
:content="$t('chat.operation.play')"
14+
placement="top"
15+
v-if="!audioPlayerStatus"
16+
>
1217
<el-button text @click="playAnswerText(data?.answer_text)">
1318
<AppIcon iconName="app-video-play"></AppIcon>
1419
</el-button>
@@ -33,7 +38,7 @@
3338
placement="top"
3439
>
3540
<el-button text @click="editContent(data)">
36-
<el-icon><EditPen /></el-icon>
41+
<AppIcon iconName="app-edit"></AppIcon>
3742
</el-button>
3843
</el-tooltip>
3944

@@ -54,7 +59,13 @@
5459
<EditContentDialog ref="EditContentDialogRef" @refresh="refreshContent" />
5560
<EditMarkDialog ref="EditMarkDialogRef" @refresh="refreshMark" />
5661
<!-- 先渲染,不然不能播放 -->
57-
<audio ref="audioPlayer" v-for="item in audioList" :key="item" controls hidden="hidden"></audio>
62+
<audio
63+
ref="audioPlayer"
64+
v-for="item in audioList"
65+
:key="item"
66+
controls
67+
hidden="hidden"
68+
></audio>
5869
</div>
5970
</div>
6071
</template>
@@ -70,20 +81,20 @@ import { MsgError } from '@/utils/message'
7081
import { t } from '@/locales'
7182
const route = useRoute()
7283
const {
73-
params: { id }
84+
params: { id },
7485
} = route as any
7586
7687
const props = defineProps({
7788
data: {
7889
type: Object,
79-
default: () => {}
90+
default: () => {},
8091
},
8192
applicationId: {
8293
type: String,
83-
default: ''
94+
default: '',
8495
},
8596
tts: Boolean,
86-
tts_type: String
97+
tts_type: String,
8798
})
8899
89100
const emit = defineEmits(['update:data'])
@@ -135,12 +146,9 @@ function markdownToPlainText(md: string) {
135146
}
136147
137148
function removeFormRander(text: string) {
138-
return text
139-
.replace(/<form_rander>[\s\S]*?<\/form_rander>/g, '')
140-
.trim()
149+
return text.replace(/<form_rander>[\s\S]*?<\/form_rander>/g, '').trim()
141150
}
142151
143-
144152
const playAnswerText = (text: string) => {
145153
if (!text) {
146154
text = t('chat.tip.answerMessage')
@@ -165,7 +173,8 @@ const playAnswerTextPart = () => {
165173
}
166174
if (audioList.value[currentAudioIndex.value].includes('<audio')) {
167175
if (audioPlayer.value) {
168-
audioPlayer.value[currentAudioIndex.value].src = audioList.value[currentAudioIndex.value].match(/src="([^"]*)"/)?.[1] || ''
176+
audioPlayer.value[currentAudioIndex.value].src =
177+
audioList.value[currentAudioIndex.value].match(/src="([^"]*)"/)?.[1] || ''
169178
audioPlayer.value[currentAudioIndex.value].play() // 自动播放音频
170179
audioPlayer.value[currentAudioIndex.value].onended = () => {
171180
currentAudioIndex.value += 1
@@ -176,7 +185,10 @@ const playAnswerTextPart = () => {
176185
if (audioList.value[currentAudioIndex.value] !== utterance.value?.text) {
177186
window.speechSynthesis.cancel()
178187
}
179-
if (window.speechSynthesis.paused && audioList.value[currentAudioIndex.value] === utterance.value?.text) {
188+
if (
189+
window.speechSynthesis.paused &&
190+
audioList.value[currentAudioIndex.value] === utterance.value?.text
191+
) {
180192
window.speechSynthesis.resume()
181193
return
182194
}
@@ -200,7 +212,11 @@ const playAnswerTextPart = () => {
200212
return
201213
}
202214
applicationApi
203-
.postTextToSpeech((props.applicationId as string) || (id as string), { text: audioList.value[currentAudioIndex.value] }, loading)
215+
.postTextToSpeech(
216+
(props.applicationId as string) || (id as string),
217+
{ text: audioList.value[currentAudioIndex.value] },
218+
loading,
219+
)
204220
.then(async (res: any) => {
205221
if (res.type === 'application/json') {
206222
const text = await res.text()
@@ -252,7 +268,6 @@ const pausePlayAnswerText = () => {
252268
}
253269
}
254270
255-
256271
function refreshMark() {
257272
buttonData.value.improve_paragraph_id_list = []
258273
emit('update:data', buttonData.value)

ui/src/components/ai-chat/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
class="user-input-button mb-8"
8686
@click="toggleUserInput"
8787
>
88-
<el-icon :size="16" class="mr-4"><EditPen /></el-icon>
88+
<AppIcon iconName="app-edit" :size="16" class="mr-4"></AppIcon>
8989
<span class="ellipsis">
9090
{{ userInputTitle || $t('chat.userInput') }}
9191
</span>

ui/src/components/app-icon/index.ts

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,69 @@ export const iconMap: any = {
263263
])
264264
},
265265
},
266+
'app-edit': {
267+
iconReader: () => {
268+
return h('i', [
269+
h(
270+
'svg',
271+
{
272+
style: { height: '100%', width: '100%' },
273+
viewBox: '0 0 1024 1024',
274+
version: '1.1',
275+
xmlns: 'http://www.w3.org/2000/svg',
276+
},
277+
[
278+
h('path', {
279+
d: 'M524.032 239.701333l85.973333 85.973334 63.786667-63.829334-86.314667-86.784-63.445333 64.64z m25.685333 146.346667l-85.418666-85.418667-292.266667 297.984v0.128l82.56 82.56h0.170667l294.954666-295.253333z m199.68-77.226667l0.256 0.256L290.730667 768H128a42.666667 42.666667 0 0 1-42.666667-42.666667v-162.730666l443.306667-446.72-0.426667-0.426667 30.08-30.037333a42.666667 42.666667 0 0 1 60.330667 0l0.085333 0.042666 146.517334 147.328a42.666667 42.666667 0 0 1-0.085334 60.245334l-15.786666 15.786666zM106.666667 853.333333h810.666666a21.333333 21.333333 0 0 1 21.333334 21.333334v42.666666a21.333333 21.333333 0 0 1-21.333334 21.333334h-810.666666a21.333333 21.333333 0 0 1-21.333334-21.333334v-42.666666a21.333333 21.333333 0 0 1 21.333334-21.333334z',
280+
fill: 'currentColor',
281+
}),
282+
],
283+
),
284+
])
285+
},
286+
},
287+
'app-delete': {
288+
iconReader: () => {
289+
return h('i', [
290+
h(
291+
'svg',
292+
{
293+
style: { height: '100%', width: '100%' },
294+
viewBox: '0 0 1024 1024',
295+
version: '1.1',
296+
xmlns: 'http://www.w3.org/2000/svg',
297+
},
298+
[
299+
h('path', {
300+
d: 'M341.333333 170.666667V128a42.666667 42.666667 0 0 1 42.666667-42.666667h256a42.666667 42.666667 0 0 1 42.666667 42.666667v42.666667h228.650666c9.514667 0 12.970667 0.981333 16.426667 2.858666a19.370667 19.370667 0 0 1 8.106667 8.064c1.834667 3.456 2.816 6.912 2.816 16.426667v30.634667c0 9.514667-0.981333 12.970667-2.858667 16.426666a19.370667 19.370667 0 0 1-8.064 8.106667c-3.456 1.834667-6.912 2.816-16.426667 2.816H853.333333v640a42.666667 42.666667 0 0 1-42.666666 42.666667H213.333333a42.666667 42.666667 0 0 1-42.666666-42.666667V256H112.682667c-9.514667 0-12.970667-0.981333-16.426667-2.858667a19.370667 19.370667 0 0 1-8.106667-8.064C86.357333 241.621333 85.333333 238.165333 85.333333 228.693333v-30.634666c0-9.514667 0.981333-12.970667 2.858667-16.426667a19.370667 19.370667 0 0 1 8.064-8.106667C99.712 171.690667 103.168 170.666667 112.64 170.666667H341.333333zM256 256v597.333333h512V256H256z m149.333333 85.333333h42.666667a21.333333 21.333333 0 0 1 21.333333 21.333334v384a21.333333 21.333333 0 0 1-21.333333 21.333333h-42.666667a21.333333 21.333333 0 0 1-21.333333-21.333333v-384a21.333333 21.333333 0 0 1 21.333333-21.333334z m170.666667 0h42.666667a21.333333 21.333333 0 0 1 21.333333 21.333334v384a21.333333 21.333333 0 0 1-21.333333 21.333333h-42.666667a21.333333 21.333333 0 0 1-21.333333-21.333333v-384a21.333333 21.333333 0 0 1 21.333333-21.333334z',
301+
fill: 'currentColor',
302+
}),
303+
],
304+
),
305+
])
306+
},
307+
},
308+
'app-more': {
309+
iconReader: () => {
310+
return h('i', [
311+
h(
312+
'svg',
313+
{
314+
style: { height: '100%', width: '100%' },
315+
viewBox: '0 0 1024 1024',
316+
version: '1.1',
317+
xmlns: 'http://www.w3.org/2000/svg',
318+
},
319+
[
320+
h('path', {
321+
d: 'M768 448h85.333333a21.248 21.248 0 0 1 21.333334 21.333333v85.333334a21.248 21.248 0 0 1-21.333334 21.333333h-85.333333a21.333333 21.333333 0 0 1-21.333333-21.333333v-85.333334a21.248 21.248 0 0 1 21.333333-21.333333z m-597.333333 0h85.333333a21.290667 21.290667 0 0 1 21.333333 21.333333v85.333334a21.333333 21.333333 0 0 1-21.333333 21.333333H170.666667a21.290667 21.290667 0 0 1-21.333334-21.333333v-85.333334a21.333333 21.333333 0 0 1 21.333334-21.333333z m298.666666 0h85.333334a21.248 21.248 0 0 1 21.333333 21.333333v85.333334a21.248 21.248 0 0 1-21.333333 21.333333h-85.333334a21.333333 21.333333 0 0 1-21.333333-21.333333v-85.333334a21.248 21.248 0 0 1 21.333333-21.333333z',
322+
fill: 'currentColor',
323+
}),
324+
],
325+
),
326+
])
327+
},
328+
},
266329
// 动态加载的图标
267330
...dynamicIcons,
268331
}

ui/src/components/dynamics-form/constructor/items/MultiSelectConstructor.vue

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
<div class="grid-content ep-bg-purple" />
1717
{{ $t('dynamicsForm.tag.label') }}
1818
</el-col>
19-
<el-col :span="12"
20-
><div class="grid-content ep-bg-purple" />
21-
{{ $t('dynamicsForm.Select.label') }}</el-col
22-
>
19+
<el-col :span="12">
20+
<div class="grid-content ep-bg-purple" />
21+
{{ $t('dynamicsForm.Select.label') }}
22+
</el-col>
2323
</el-row>
2424
<el-row
2525
style="width: 100%"
@@ -28,23 +28,26 @@
2828
:gutter="10"
2929
class="mb-8"
3030
>
31-
<el-col :span="10"
32-
><div class="grid-content ep-bg-purple" />
33-
<el-input v-model="formValue.option_list[$index].label" :placeholder="$t('dynamicsForm.tag.placeholder')"
34-
/></el-col>
35-
<el-col :span="12"
36-
><div class="grid-content ep-bg-purple" />
31+
<el-col :span="10">
32+
<div class="grid-content ep-bg-purple" />
33+
<el-input
34+
v-model="formValue.option_list[$index].label"
35+
:placeholder="$t('dynamicsForm.tag.placeholder')"
36+
/>
37+
</el-col>
38+
<el-col :span="12">
39+
<div class="grid-content ep-bg-purple" />
3740
<el-input
3841
v-model="formValue.option_list[$index].value"
3942
:placeholder="$t('dynamicsForm.Select.label')"
40-
/></el-col>
41-
<el-col :span="1"
42-
><div class="grid-content ep-bg-purple" />
43+
/>
44+
</el-col>
45+
<el-col :span="1">
46+
<div class="grid-content ep-bg-purple" />
4347
<el-button link class="ml-8" @click.stop="delOption($index)">
44-
<el-icon>
45-
<Delete />
46-
</el-icon> </el-button
47-
></el-col>
48+
<AppIcon iconName="app-delete"></AppIcon>
49+
</el-button>
50+
</el-col>
4851
</el-row>
4952
</el-form-item>
5053
<el-form-item
@@ -54,7 +57,12 @@
5457
prop="default_value"
5558
:rules="
5659
formValue.required
57-
? [{ required: true, message: `${$t('dynamicsForm.default.label')}${$t('dynamicsForm.default.requiredMessage')}` }]
60+
? [
61+
{
62+
required: true,
63+
message: `${$t('dynamicsForm.default.label')}${$t('dynamicsForm.default.requiredMessage')}`,
64+
},
65+
]
5866
: []
5967
"
6068
>
@@ -96,7 +104,7 @@ const formValue = computed({
96104
},
97105
get: () => {
98106
return props.modelValue
99-
}
107+
},
100108
})
101109
102110
const addOption = () => {
@@ -119,7 +127,7 @@ const getData = () => {
119127
show_default_value: formValue.value.show_default_value,
120128
text_field: 'label',
121129
value_field: 'value',
122-
option_list: formValue.value.option_list
130+
option_list: formValue.value.option_list,
123131
}
124132
}
125133
const rander = (form_data: any) => {

ui/src/components/dynamics-form/constructor/items/RadioCardConstructor.vue

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
<div class="grid-content ep-bg-purple" />
1818
{{ $t('dynamicsForm.tag.label') }}
1919
</el-col>
20-
<el-col :span="12"
21-
><div class="grid-content ep-bg-purple" />
22-
{{ $t('dynamicsForm.Select.label') }}</el-col
23-
>
20+
<el-col :span="12">
21+
<div class="grid-content ep-bg-purple" />
22+
{{ $t('dynamicsForm.Select.label') }}
23+
</el-col>
2424
</el-row>
2525
<el-row
2626
style="width: 100%"
@@ -29,23 +29,26 @@
2929
:gutter="10"
3030
class="mb-8"
3131
>
32-
<el-col :span="10"
33-
><div class="grid-content ep-bg-purple" />
34-
<el-input v-model="formValue.option_list[$index].label" :placeholder="$t('dynamicsForm.tag.placeholder')"
35-
/></el-col>
36-
<el-col :span="12"
37-
><div class="grid-content ep-bg-purple" />
32+
<el-col :span="10">
33+
<div class="grid-content ep-bg-purple" />
34+
<el-input
35+
v-model="formValue.option_list[$index].label"
36+
:placeholder="$t('dynamicsForm.tag.placeholder')"
37+
/>
38+
</el-col>
39+
<el-col :span="12">
40+
<div class="grid-content ep-bg-purple" />
3841
<el-input
3942
v-model="formValue.option_list[$index].value"
4043
:placeholder="$t('dynamicsForm.Select.label')"
41-
/></el-col>
42-
<el-col :span="1"
43-
><div class="grid-content ep-bg-purple" />
44+
/>
45+
</el-col>
46+
<el-col :span="1">
47+
<div class="grid-content ep-bg-purple" />
4448
<el-button link class="ml-8" @click.stop="delOption($index)">
45-
<el-icon>
46-
<Delete />
47-
</el-icon> </el-button
48-
></el-col>
49+
<AppIcon iconName="app-delete"></AppIcon>
50+
</el-button>
51+
</el-col>
4952
</el-row>
5053
</el-form-item>
5154
<el-form-item
@@ -55,7 +58,12 @@
5558
prop="default_value"
5659
:rules="
5760
formValue.required
58-
? [{ required: true, message: `${$t('dynamicsForm.default.label')}${$t('dynamicsForm.default.requiredMessage')}` }]
61+
? [
62+
{
63+
required: true,
64+
message: `${$t('dynamicsForm.default.label')}${$t('dynamicsForm.default.requiredMessage')}`,
65+
},
66+
]
5967
: []
6068
"
6169
>
@@ -87,7 +95,7 @@ const formValue = computed({
8795
},
8896
get: () => {
8997
return props.modelValue
90-
}
98+
},
9199
})
92100
93101
const addOption = () => {
@@ -112,7 +120,7 @@ const getData = () => {
112120
show_default_value: formValue.value.show_default_value,
113121
text_field: 'label',
114122
value_field: 'value',
115-
option_list: formValue.value.option_list
123+
option_list: formValue.value.option_list,
116124
}
117125
}
118126
const rander = (form_data: any) => {

0 commit comments

Comments
 (0)