mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-23 23:53:55 +08:00
update:插件名称前,不同颜色的点易让人产生误解
This commit is contained in:
@@ -104,7 +104,7 @@
|
||||
<div slot="content">
|
||||
<div><strong>功能名称:</strong> {{ func.name }}</div>
|
||||
</div>
|
||||
<div class="icon-dot" :style="{ backgroundColor: getFunctionColor(func.name) }">
|
||||
<div class="icon-dot">
|
||||
{{ getFunctionDisplayChar(func.name) }}
|
||||
</div>
|
||||
</el-tooltip>
|
||||
@@ -189,10 +189,6 @@ export default {
|
||||
voiceOptions: [],
|
||||
showFunctionDialog: false,
|
||||
currentFunctions: [],
|
||||
functionColorMap: [
|
||||
'#FF6B6B', '#4ECDC4', '#45B7D1',
|
||||
'#96CEB4', '#FFEEAD', '#D4A5A5', '#A2836E'
|
||||
],
|
||||
allFunctions: [],
|
||||
originalFunctions: [],
|
||||
}
|
||||
@@ -428,20 +424,16 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
getFunctionColor(name) {
|
||||
const hash = [...name].reduce((acc, char) => acc + char.charCodeAt(0), 0);
|
||||
return this.functionColorMap[hash % this.functionColorMap.length];
|
||||
},
|
||||
getFunctionDisplayChar(name) {
|
||||
if (!name || name.length === 0) return '';
|
||||
|
||||
|
||||
for (let i = 0; i < name.length; i++) {
|
||||
const char = name[i];
|
||||
if (/[\u4e00-\u9fa5a-zA-Z0-9]/.test(char)) {
|
||||
return char;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 如果没有找到有效字符,返回第一个字符
|
||||
return name.charAt(0);
|
||||
},
|
||||
@@ -768,11 +760,12 @@ export default {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: white;
|
||||
color: #5778ff;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
background-color: #e6ebff;
|
||||
}
|
||||
|
||||
::v-deep .el-form-item__label {
|
||||
|
||||
Reference in New Issue
Block a user