update: 设备生成主题、表情、字体入口调整

This commit is contained in:
qinjinglin 2026-01-15 16:52:22 +08:00
parent f11548fbc8
commit e7244a8ba5
15 changed files with 96 additions and 50 deletions

View file

@ -1,5 +1,6 @@
module.exports = { module.exports = {
plugins: { plugins: {
tailwindcss: {}, tailwindcss: {},
autoprefixer: {}
}, },
} }

View file

@ -77,7 +77,7 @@
<!-- 使用可复用的配置表单 --> <!-- 使用可复用的配置表单 -->
<div v-if="showManualEdit" class="mt-4"> <div v-if="showManualEdit" class="mt-4">
<ConfigForm :config="customConfig" /></div> <ConfigForm :config="customConfig" @updateConfig="updateConfig" /></div>
</div> </div>
</div> </div>
@ -99,9 +99,9 @@
</div> </div>
<!-- 手动配置表单 --> <!-- 手动配置表单 -->
<div class="border-2 border-gray-300 rounded-lg p-4"> <div class="border border-gray-300 rounded-lg p-4">
<h3 class="text-lg font-medium text-gray-900 mb-4">{{ $t('chipConfig.manualConfigTitle') }}</h3> <h3 class="text-lg font-medium text-gray-900 mb-4">{{ $t('chipConfig.manualConfigTitle') }}</h3>
<ConfigForm :config="customConfig" :show-required="true" /> <ConfigForm :config="customConfig" :show-required="true" @updateConfig="updateConfig" />
</div> </div>
</div> </div>
@ -127,6 +127,7 @@ const ConfigForm = {
default: false default: false
} }
}, },
emits: ["updateConfig"],
render() { render() {
return h('div', { class: 'grid grid-cols-1 md:grid-cols-3 gap-4' }, [ return h('div', { class: 'grid grid-cols-1 md:grid-cols-3 gap-4' }, [
// 芯片型号选择 // 芯片型号选择
@ -135,14 +136,18 @@ const ConfigForm = {
this.$t('chipConfig.chipRequired') + ' ', this.$t('chipConfig.chipRequired') + ' ',
this.showRequired ? h('span', { class: 'text-red-500' }, '*') : '' this.showRequired ? h('span', { class: 'text-red-500' }, '*') : ''
]), ]),
h('select', { h('el-select', {
class: 'w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500', class: 'w-full',
value: this.config.model, props: {
value: this.config.model,
},
on: { on: {
change: (e) => { this.config.model = e.target.value } change: (value) => {
this.$emit('updateConfig', { model: value })
}
} }
}, this.$parent.CHIP_OPTIONS.map(option => }, this.$parent.CHIP_OPTIONS.map(option =>
h('option', { attrs: { value: option.value }, key: option.value }, option.label) h('el-option', { attrs: { value: option.value, label: option.label }, key: option.value }, option.label)
)) ))
]), ]),
@ -152,19 +157,22 @@ const ConfigForm = {
this.$t('chipConfig.widthRequired') + ' ', this.$t('chipConfig.widthRequired') + ' ',
this.showRequired ? h('span', { class: 'text-red-500' }, '*') : '' this.showRequired ? h('span', { class: 'text-red-500' }, '*') : ''
]), ]),
h('input', { h('el-input-number', {
class: 'w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500', class: 'w-full',
attrs: { attrs: {
type: 'number', type: 'number',
min: 128, min: 128,
max: 800, max: 800,
placeholder: '320', placeholder: '320',
}, },
domProps: { props: {
value: this.config.display.width, value: this.config.display.width,
"controls-position": "right",
}, },
on: { on: {
input: (e) => { this.config.display.width = Number(e.target.value) } input: (value) => {
this.$emit('updateConfig', { display: { ...this.config.display, width: value } })
}
} }
}) })
]), ]),
@ -175,19 +183,22 @@ const ConfigForm = {
this.$t('chipConfig.heightRequired') + ' ', this.$t('chipConfig.heightRequired') + ' ',
this.showRequired ? h('span', { class: 'text-red-500' }, '*') : '' this.showRequired ? h('span', { class: 'text-red-500' }, '*') : ''
]), ]),
h('input', { h('el-input-number', {
class: 'w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500', class: 'w-full',
attrs: { attrs: {
type: 'number', type: 'number',
min: 128, min: 128,
max: 600, max: 600,
placeholder: '240', placeholder: '240',
}, },
domProps: { props: {
value: this.config.display.height, value: this.config.display.height,
"controls-position": "right",
}, },
on: { on: {
input: (e) => { this.config.display.height = Number(e.target.value) } input: (value) => {
this.$emit('updateConfig', { display: { ...this.config.display, height: value } })
}
} }
}) })
]) ])
@ -462,6 +473,10 @@ export default {
return false return false
} }
}, },
// 更新自定义配置
updateConfig(obj) {
this.customConfig = { ...this.customConfig, ...obj };
},
// 切换手动编辑 // 切换手动编辑
toggleManualEdit() { toggleManualEdit() {

View file

@ -14,7 +14,7 @@
</svg> </svg>
</button> </button>
<!-- 烧录中提示 --> <!-- 烧录中提示 -->
<div v-else class="text-sm text-orange-600 font-medium"> <div v-else class="text-sm text-red-50 font-medium">
{{ $t('generateModal.flashingInProgress') }} {{ $t('generateModal.flashingInProgress') }}
</div> </div>
</div> </div>
@ -150,8 +150,8 @@
{{ $t('generateModal.downloadAssets') }} {{ $t('generateModal.downloadAssets') }}
</span> </span>
</el-button> </el-button>
<!-- 注释在线烧录设备功能 -->
<el-button <!-- <el-button
@click="startOnlineFlash" @click="startOnlineFlash"
:disabled="!deviceOnline" :disabled="!deviceOnline"
class="w-full" class="w-full"
@ -163,7 +163,7 @@
</svg> </svg>
{{ $t('generateModal.flashToDevice') }} {{ $t('generateModal.flashToDevice') }}
</span> </span>
</el-button> </el-button> -->
</div> </div>
</div> </div>

View file

@ -186,21 +186,25 @@
<!-- 操作按钮 --> <!-- 操作按钮 -->
<div class="flex justify-between"> <div class="flex justify-between">
<button <el-button
@click="$emit('prev')" @click="$emit('prev')"
class="bg-gray-500 hover:bg-gray-600 text-white px-6 py-2 rounded-lg font-medium transition-colors" type="info"
class="px-8 py-2"
> >
{{ $t('generateSummary.previous') }} {{ $t('generateSummary.previous') }}
</button> </el-button>
<button <el-button
@click="$emit('generate')" @click="$emit('generate')"
class="bg-green-500 hover:bg-green-600 text-white px-8 py-2 rounded-lg font-medium transition-colors flex items-center" type="success"
class="px-8 py-2"
> >
<svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20"> <div class="flex items-center">
<path fill-rule="evenodd" d="M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z" clip-rule="evenodd"/> <svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20">
</svg> <path fill-rule="evenodd" d="M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z" clip-rule="evenodd"/>
{{ $t('generateSummary.generate') }} </svg>
</button> {{ $t('generateSummary.generate') }}
</div>
</el-button>
</div> </div>
</div> </div>
</template> </template>

View file

@ -53,18 +53,18 @@
<!-- Navigation Buttons --> <!-- Navigation Buttons -->
<div class="flex justify-between"> <div class="flex justify-between">
<button <el-button
@click="$emit('prev')" @click="$emit('prev')"
class="bg-gray-500 hover:bg-gray-600 text-white px-6 py-2 rounded-lg font-medium transition-colors" type="info"
> >
{{ $t('themeDesign.previous') }} {{ $t('themeDesign.previous') }}
</button> </el-button>
<button <el-button
@click="handleNext" @click="handleNext"
class="bg-primary-500 hover:bg-primary-600 text-white px-6 py-2 rounded-lg font-medium transition-colors" type="primary"
> >
{{ $t('themeDesign.next') }} {{ $t('themeDesign.next') }}
</button> </el-button>
</div> </div>
</div> </div>
</template> </template>
@ -75,21 +75,17 @@ import FontConfig from './tabs/FontConfig.vue'
import EmojiConfig from './tabs/EmojiConfig.vue' import EmojiConfig from './tabs/EmojiConfig.vue'
import BackgroundConfig from './tabs/BackgroundConfig.vue' import BackgroundConfig from './tabs/BackgroundConfig.vue'
// Icons (simple SVG components)
// 麦克风图标 // 麦克风图标
const MicrophoneIcon = { const MicrophoneIcon = {
render(h) { // 接收 h 函数(createElement)作为参数 render(h) {
return h('svg', { return h('svg', {
// SVG 基础属性(放在 attrs 中)
attrs: { attrs: {
fill: 'none', fill: 'none',
stroke: 'currentColor', stroke: 'currentColor',
viewBox: '0 0 24 24' viewBox: '0 0 24 24'
}, },
// 样式类名(可选,也可在使用时传递)
class: 'w-5 h-5' class: 'w-5 h-5'
}, [ }, [
// 子节点:path 标签
h('path', { h('path', {
attrs: { attrs: {
'stroke-linecap': 'round', 'stroke-linecap': 'round',

View file

@ -7,7 +7,7 @@
<!-- 表情类型选择 --> <!-- 表情类型选择 -->
<div class="space-y-4"> <div class="space-y-4">
<div class="flex flex-wrap gap-3"> <div class="flex flex-wrap justify-center gap-3">
<button <button
@click="setEmojiType('none')" @click="setEmojiType('none')"
:class="[ :class="[

View file

@ -448,6 +448,7 @@ export default {
'device.bindWithCode': '6-stelliger Bestätigungscode-Bindung', 'device.bindWithCode': '6-stelliger Bestätigungscode-Bindung',
'device.manualAdd': 'Manuell hinzufügen', 'device.manualAdd': 'Manuell hinzufügen',
'device.unbind': 'Bindung aufheben', 'device.unbind': 'Bindung aufheben',
'device.deviceThemeGeneration': 'Gerätethema erstellen',
'device.toolCall': 'Werkzeugaufruf', 'device.toolCall': 'Werkzeugaufruf',
'device.selectAtLeastOne': 'Bitte wählen Sie mindestens einen Datensatz aus', 'device.selectAtLeastOne': 'Bitte wählen Sie mindestens einen Datensatz aus',
'device.confirmBatchUnbind': 'Sind Sie sicher, dass Sie {count} ausgewählte Geräte entbinden möchten?', 'device.confirmBatchUnbind': 'Sind Sie sicher, dass Sie {count} ausgewählte Geräte entbinden möchten?',

View file

@ -448,6 +448,7 @@ export default {
'device.bindWithCode': '6-digit Verification Code Binding', 'device.bindWithCode': '6-digit Verification Code Binding',
'device.manualAdd': 'Manual Add', 'device.manualAdd': 'Manual Add',
'device.unbind': 'Unbind', 'device.unbind': 'Unbind',
'device.deviceThemeGeneration': 'Device theme generation',
'device.toolCall': 'Tool Call', 'device.toolCall': 'Tool Call',
'device.selectAtLeastOne': 'Please select at least one record', 'device.selectAtLeastOne': 'Please select at least one record',
'device.confirmBatchUnbind': 'Are you sure you want to unbind {count} selected devices?', 'device.confirmBatchUnbind': 'Are you sure you want to unbind {count} selected devices?',

View file

@ -448,6 +448,7 @@ export default {
'device.bindWithCode': 'Liên kết bằng mã xác minh 6 chữ số', 'device.bindWithCode': 'Liên kết bằng mã xác minh 6 chữ số',
'device.manualAdd': 'Thêm thủ công', 'device.manualAdd': 'Thêm thủ công',
'device.unbind': 'Hủy liên kết', 'device.unbind': 'Hủy liên kết',
'device.deviceThemeGeneration': 'Tạo chủ đề thiết bị',
'device.toolCall': 'Gọi công cụ', 'device.toolCall': 'Gọi công cụ',
'device.selectAtLeastOne': 'Vui lòng chọn ít nhất một bản ghi', 'device.selectAtLeastOne': 'Vui lòng chọn ít nhất một bản ghi',
'device.confirmBatchUnbind': 'Bạn có chắc chắn muốn hủy liên kết {count} thiết bị đã chọn?', 'device.confirmBatchUnbind': 'Bạn có chắc chắn muốn hủy liên kết {count} thiết bị đã chọn?',

View file

@ -448,6 +448,7 @@ export default {
'device.bindWithCode': '6位验证码绑定', 'device.bindWithCode': '6位验证码绑定',
'device.manualAdd': '手动添加', 'device.manualAdd': '手动添加',
'device.unbind': '解绑', 'device.unbind': '解绑',
'device.deviceThemeGeneration': '设备主题生成',
'device.toolCall': '工具调用', 'device.toolCall': '工具调用',
'device.selectAtLeastOne': '请至少选择一条记录', 'device.selectAtLeastOne': '请至少选择一条记录',
'device.confirmBatchUnbind': '确认要解绑选中的 {count} 台设备吗?', 'device.confirmBatchUnbind': '确认要解绑选中的 {count} 台设备吗?',

View file

@ -448,6 +448,7 @@ export default {
'device.bindWithCode': '6位驗證碼綁定', 'device.bindWithCode': '6位驗證碼綁定',
'device.manualAdd': '手動添加', 'device.manualAdd': '手動添加',
'device.unbind': '解綁', 'device.unbind': '解綁',
'device.deviceThemeGeneration': '設備主題生成',
'device.toolCall': '工具調用', 'device.toolCall': '工具調用',
'device.selectAtLeastOne': '請至少選擇一條記錄', 'device.selectAtLeastOne': '請至少選擇一條記錄',
'device.confirmBatchUnbind': '確認要解綁選中的 {count} 台設備嗎?', 'device.confirmBatchUnbind': '確認要解綁選中的 {count} 台設備嗎?',

View file

@ -15,7 +15,7 @@
} }
.step-indicator.inactive { .step-indicator.inactive {
@apply bg-gray-200 text-gray-500; @apply bg-white text-gray-500;
} }
.tab-button { .tab-button {

View file

@ -64,6 +64,9 @@
<el-button size="mini" type="text" @click="handleUnbind(scope.row.device_id)"> <el-button size="mini" type="text" @click="handleUnbind(scope.row.device_id)">
{{ $t('device.unbind') }} {{ $t('device.unbind') }}
</el-button> </el-button>
<el-button v-if="canGenerate(scope.row)" size="mini" type="text" @click="handleGenertor">
{{ $t('device.deviceThemeGeneration') }}
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -334,6 +337,9 @@ export default {
}); });
}); });
}, },
handleGenertor() {
this.$router.push('/voice-box-custom')
},
goFirst() { goFirst() {
this.currentPage = 1; this.currentPage = 1;
}, },
@ -467,6 +473,11 @@ export default {
this.$message.error(msg || this.$t('message.error')) this.$message.error(msg || this.$t('message.error'))
}) })
}, },
// 判断是否可以生成表情、主题、字体bin文件
canGenerate(row) {
const version = row.firmwareVersion.replace(/\./g, '');
return Number(version) >= 200;
},
} }
}; };
</script> </script>

View file

@ -1,7 +1,8 @@
<template> <template>
<div class="min-h-screen bg-gray-50"> <div class="min-h-screen voice-box">
<HeaderBar />
<!-- Header --> <!-- Header -->
<header class="bg-white shadow-sm border-b"> <!-- <header class="bg-white shadow-sm border-b">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4"> <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4">
<div class="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 sm:gap-0"> <div class="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 sm:gap-0">
<h1 class="text-2xl font-bold text-gray-900">{{ $t('header.title') }}</h1> <h1 class="text-2xl font-bold text-gray-900">{{ $t('header.title') }}</h1>
@ -10,10 +11,10 @@
</div> </div>
</div> </div>
</div> </div>
</header> </header> -->
<!-- Main Content --> <!-- Main Content -->
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"> <main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-8">
<div> <div>
<!-- 配置状态提示(右下角浮动通知) --> <!-- 配置状态提示(右下角浮动通知) -->
<div <div
@ -59,12 +60,12 @@
</div> </div>
<span class="text-sm mt-2 text-gray-600">{{ step.titleKey }}</span> <span class="text-sm mt-2 text-gray-600">{{ step.titleKey }}</span>
</div> </div>
<div v-if="index < steps.length - 1" class="w-16 h-0.5 bg-gray-300 mx-4"></div> <div v-if="index < steps.length - 1" class="w-16 h-0.5 bg-white mx-4"></div>
</div> </div>
</div> </div>
<!-- Step Content --> <!-- Step Content -->
<div class="bg-white rounded-lg shadow-sm border p-6"> <div class="bg-white rounded-lg p-6">
<ChipConfig <ChipConfig
v-if="currentStep === 0" v-if="currentStep === 0"
v-model="config.chip" v-model="config.chip"
@ -106,6 +107,7 @@
</div> </div>
</template> </template>
<script> <script>
import HeaderBar from "@/components/HeaderBar.vue";
import ChipConfig from '@/components/ChipConfig.vue' import ChipConfig from '@/components/ChipConfig.vue'
import DeviceStatus from '@/components/DeviceStatus.vue' import DeviceStatus from '@/components/DeviceStatus.vue'
@ -119,6 +121,7 @@ import WebSocketTransfer from '@/utils/WebSocketTransfer.js'
export default { export default {
name: "VoiceBoxCustom", name: "VoiceBoxCustom",
components: { components: {
HeaderBar,
ChipConfig, ChipConfig,
DeviceStatus, DeviceStatus,
ThemeDesign, ThemeDesign,
@ -621,3 +624,9 @@ export default {
}, },
} }
</script> </script>
<style scoped>
.voice-box {
background: linear-gradient(to bottom right, #dce8ff, #e4eeff, #e6cbfd) center;
}
</style>

View file

@ -19,6 +19,11 @@ module.exports = {
500: '#3b82f6', 500: '#3b82f6',
600: '#2563eb', 600: '#2563eb',
700: '#1d4ed8' 700: '#1d4ed8'
},
orange: {
50: '#fff7ed',
200: '#fed7aa',
800: '#9a3412'
} }
} }
}, },