perf: 优化播放图标

This commit is contained in:
wangdan-fit2cloud 2024-09-24 16:56:53 +08:00
parent 24d099d078
commit bc28cc0ac7
7 changed files with 81 additions and 35 deletions

View File

@ -225,7 +225,7 @@ function initMaxkbStyle(root){
}
#maxkb-chat-container {
width: 420px;
width: 450px;
height: 600px;
display:none;
}

View File

@ -7,12 +7,14 @@
<div>
<!-- 语音播放 -->
<span v-if="tts">
<el-tooltip effect="dark" content="语音播放" placement="top">
<el-button v-if="!audioPlayerStatus" text @click="playAnswerText(data?.answer_text)">
<el-tooltip effect="dark" content="点击播放" placement="top" v-if="!audioPlayerStatus">
<el-button text @click="playAnswerText(data?.answer_text)">
<AppIcon iconName="app-video-play"></AppIcon>
</el-button>
<el-button v-else text @click="pausePlayAnswerText()">
<el-icon><VideoPause /></el-icon>
</el-tooltip>
<el-tooltip v-else effect="dark" content="停止" placement="top">
<el-button type="primary" text @click="pausePlayAnswerText()">
<AppIcon iconName="app-video-pause"></AppIcon>
</el-button>
</el-tooltip>
<el-divider direction="vertical" />

View File

@ -7,17 +7,14 @@
<div>
<!-- 语音播放 -->
<span v-if="tts">
<el-tooltip effect="dark" content="语音播放" placement="top">
<el-button
v-if="!audioPlayerStatus"
text
:disabled="!data?.write_ed"
@click="playAnswerText(data?.answer_text)"
>
<el-tooltip effect="dark" content="点击播放" placement="top" v-if="!audioPlayerStatus">
<el-button text :disabled="!data?.write_ed" @click="playAnswerText(data?.answer_text)">
<AppIcon iconName="app-video-play"></AppIcon>
</el-button>
<el-button v-else text :disabled="!data?.write_ed" @click="pausePlayAnswerText()">
<el-icon><VideoPause /></el-icon>
</el-tooltip>
<el-tooltip v-else effect="dark" content="停止" placement="top">
<el-button type="primary" text :disabled="!data?.write_ed" @click="pausePlayAnswerText()">
<AppIcon iconName="app-video-pause"></AppIcon>
</el-button>
</el-tooltip>
<el-divider direction="vertical" />

View File

@ -196,9 +196,7 @@
>00:{{ recorderTime < 10 ? `0${recorderTime}` : recorderTime }}</el-text
>
<el-button text type="primary" @click="stopRecording" :loading="recorderLoading">
<el-icon>
<VideoPause />
</el-icon>
<AppIcon iconName="app-video-stop"></AppIcon>
</el-button>
</div>
<el-divider v-if="!startRecorderTime && !recorderLoading" direction="vertical" />
@ -853,7 +851,7 @@ const startRecording = async () => {
2若无 https 配置则需要修改浏览器安全配置Chrome 设置如下<br/>
(1) 地址栏输入chrome://flags/#unsafely-treat-insecure-origin-as-secure<br/>
(2) http 站点配置在文本框中例如: http://127.0.0.1:8080</p>
<img src="${new URL(`../../assets/tipIMG.jpg`, import.meta.url).href}" width="750"/>`,
<img src="${new URL(`../../assets/tipIMG.jpg`, import.meta.url).href}" style="width: 100%;" />`,
{
confirmButtonText: '我知道了',
dangerouslyUseHTMLString: true,
@ -871,7 +869,7 @@ const startRecording = async () => {
2若无 https 配置则需要修改浏览器安全配置Chrome 设置如下<br/>
(1) 地址栏输入chrome://flags/#unsafely-treat-insecure-origin-as-secure<br/>
(2) http 站点配置在文本框中例如: http://127.0.0.1:8080</p>
<img src="${new URL(`../../assets/tipIMG.jpg`, import.meta.url).href}" width="750"/>`,
<img src="${new URL(`../../assets/tipIMG.jpg`, import.meta.url).href}" style="width: 100%;" />`,
{
confirmButtonText: '我知道了',
dangerouslyUseHTMLString: true,

View File

@ -1143,13 +1143,63 @@ export const iconMap: any = {
'svg',
{
style: { height: '100%', width: '100%' },
viewBox: '0 0 16 16',
viewBox: '0 0 1024 1024',
version: '1.1',
xmlns: 'http://www.w3.org/2000/svg'
},
[
h('path', {
d: 'M7.66667 3.68233V12.3177L4.66667 10.01V5.99L7.66667 3.68233ZM7.89333 2C7.74633 2 7.60333 2.04867 7.487 2.13833L3.59367 5.13333C3.42933 5.25933 3.33333 5.45467 3.33333 5.66167V10.3383C3.33333 10.5453 3.42933 10.7407 3.59367 10.8667L7.487 13.8617C7.60333 13.9513 7.74633 14 7.89333 14H8.33333C8.70167 14 9 13.7017 9 13.3333V2.66667C9 2.29833 8.70167 2 8.33333 2H7.89333ZM1 5.66667C1 5.48267 1.14933 5.33333 1.33333 5.33333H2C2.184 5.33333 2.33333 5.48267 2.33333 5.66667V10.3333C2.33333 10.5173 2.184 10.6667 2 10.6667H1.33333C1.14933 10.6667 1 10.5173 1 10.3333V5.66667ZM13.2973 12.1873C13.1727 12.3153 12.968 12.3107 12.8417 12.184L12.3723 11.715C12.2373 11.58 12.244 11.36 12.3757 11.222C13.1757 10.3843 13.6667 9.24967 13.6667 8C13.6667 6.75467 13.179 5.62333 12.384 4.78667C12.253 4.64833 12.2467 4.42933 12.3813 4.29467L12.8507 3.82533C12.9773 3.69867 13.182 3.694 13.307 3.82267C14.355 4.903 15 6.376 15 8C15 9.62867 14.351 11.106 13.2973 12.1873ZM11.4043 10.3087C11.2833 10.4347 11.084 10.4263 10.9603 10.303L10.4987 9.84099C10.3573 9.69966 10.3737 9.46733 10.5053 9.31666C10.8133 8.96499 11 8.50433 11 7.99999C11 7.49966 10.816 7.04199 10.5123 6.69133C10.382 6.54066 10.3663 6.30933 10.507 6.16866L10.9693 5.70666C11.0933 5.58266 11.2933 5.57466 11.4143 5.70166C11.9837 6.29966 12.3333 7.10899 12.3333 7.99999C12.3333 8.89599 11.9797 9.70966 11.4043 10.3087Z',
d: 'M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768z m469.333333-384c0 259.2-210.133333 469.333333-469.333333 469.333333S42.666667 771.2 42.666667 512 252.8 42.666667 512 42.666667s469.333333 210.133333 469.333333 469.333333z',
fill: 'currentColor'
}),
h('path', {
d: 'M686.890667 539.776l-253.141334 159.274667a32.298667 32.298667 0 0 1-44.8-10.453334 32.896 32.896 0 0 1-4.949333-17.322666V352.768a32.64 32.64 0 0 1 32.512-32.768c6.101333 0 12.074667 1.706667 17.28 4.992l253.098667 159.232a32.853333 32.853333 0 0 1 0 55.552z',
fill: 'currentColor'
})
]
)
])
}
},
'app-video-stop': {
iconReader: () => {
return h('i', [
h(
'svg',
{
style: { height: '100%', width: '100%' },
viewBox: '0 0 1024 1024',
version: '1.1',
xmlns: 'http://www.w3.org/2000/svg'
},
[
h('path', {
d: 'M981.333333 512c0 259.2-210.133333 469.333333-469.333333 469.333333S42.666667 771.2 42.666667 512 252.8 42.666667 512 42.666667s469.333333 210.133333 469.333333 469.333333z m-85.333333 0a384 384 0 1 0-768 0 384 384 0 0 0 768 0zM384 341.333333h256c23.466667 0 42.666667 19.072 42.666667 42.666667v256c0 23.552-19.2 42.666667-42.666667 42.666667H384c-23.466667 0-42.666667-19.114667-42.666667-42.666667V384c0-23.594667 19.2-42.666667 42.666667-42.666667z',
fill: 'currentColor'
})
]
)
])
}
},
'app-video-pause': {
iconReader: () => {
return h('i', [
h(
'svg',
{
style: { height: '100%', width: '100%' },
viewBox: '0 0 1024 1024',
version: '1.1',
xmlns: 'http://www.w3.org/2000/svg'
},
[
h('path', {
d: 'M405.333333 341.333333a21.333333 21.333333 0 0 0-21.333333 21.333334v298.666666a21.333333 21.333333 0 0 0 21.333333 21.333334h42.666667a21.333333 21.333333 0 0 0 21.333333-21.333334v-298.666666a21.333333 21.333333 0 0 0-21.333333-21.333334h-42.666667zM576 341.333333a21.333333 21.333333 0 0 0-21.333333 21.333334v298.666666a21.333333 21.333333 0 0 0 21.333333 21.333334h42.666667a21.333333 21.333333 0 0 0 21.333333-21.333334v-298.666666a21.333333 21.333333 0 0 0-21.333333-21.333334h-42.666667z',
fill: 'currentColor'
}),
h('path', {
d: 'M512 42.666667C252.8 42.666667 42.666667 252.8 42.666667 512s210.133333 469.333333 469.333333 469.333333 469.333333-210.133333 469.333333-469.333333S771.2 42.666667 512 42.666667zM128 512a384 384 0 1 1 768 0 384 384 0 0 1-768 0z',
fill: 'currentColor'
})
]

View File

@ -43,23 +43,22 @@
<template #label>
<div class="flex-between">
选项值
<el-button link type="primary" @click="addOption()">
<el-button link type="primary" @click.stop="addOption()">
<el-icon class="mr-4"><Plus /></el-icon>
</el-button>
</div>
</template>
<template #default>
<div
class="w-full flex-between mb-8"
:key="option"
v-for="(option, $index) in form.optionList"
>
<el-input v-model.lazy="form.optionList[$index]" placeholder="请输入选项值" />
<el-button link class="ml-8" @click="delOption($index)">
<el-icon><Delete /></el-icon>
</el-button>
</div>
</template>
<div
class="w-full flex-between mb-8"
v-for="(option, $index) in form.optionList"
:key="$index"
>
<el-input v-model="form.optionList[$index]" placeholder="请输入选项值" />
<el-button link class="ml-8" @click.stop="delOption($index)">
<el-icon><Delete /></el-icon>
</el-button>
</div>
</el-form-item>
<el-form-item label="是否必填" @click.prevent>
<el-switch size="small" v-model="form.is_required"></el-switch>

View File

@ -12,7 +12,7 @@ export default defineConfig(({ mode }) => {
const prefix = process.env.VITE_DYNAMIC_PREFIX || ENV.VITE_BASE_PATH;
const proxyConf: Record<string, string | ProxyOptions> = {}
proxyConf['/api'] = {
target: 'http://127.0.0.1:8080',
target: 'http://81.70.36.87:8000',
changeOrigin: true,
rewrite: (path) => path.replace(ENV.VITE_BASE_PATH, '/')
}