fix(小组件): 空态图标按场景分家 + 桌面面板拖拽态翻白
build / build (push) Successful in 42s

- 管理台空态改用新线性图标 widget-empty-line.svg(虚线框+加号,currentColor 可着色)
- 桌面小工具面板空态还原原版 widget-empty.svg(内嵌灰度仪表盘 PNG,4279f99 版)
- _widget.scss 拖拽态翻白:背景/边框/阴影与前景令牌一并反转,避免重演「白底压白字」
This commit is contained in:
chenxing
2026-10-12 08:47:45 +08:00
parent 5a19a4ed79
commit a3ddb90a8a
4 changed files with 35 additions and 8 deletions
+4
View File
@@ -0,0 +1,4 @@
<svg width="120" height="120" viewBox="0 0 120 120" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="14" y="14" width="92" height="92" rx="10" fill="none" stroke="currentColor" stroke-width="2" stroke-dasharray="6 7" stroke-linecap="round"/>
<path d="M60 44v32M44 60h32" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 350 B

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 350 B

After

Width:  |  Height:  |  Size: 12 KiB

+16 -3
View File
@@ -85,12 +85,25 @@
}
}
// 拖拽态加深 + 加强模糊(旧版翻白 → 浅灰图标压浅白,是这轮修掉的反向翻车)
// 拖拽态翻白(沿用旧版白色语义:面板与 header 一并提亮,模糊略加强)。
// ⚠️ 该元素同时挂着 .widget-wrap,--wg-fg* 是给深色玻璃配的白字,
// 翻白后必须同步反转为深色,否则重演「白底压白字 / 浅灰图标不可见」。
&__drag {
background: rgba(15, 23, 42, 0.56);
--wg-glass-bg: rgba(255, 255, 255, 0.6);
--wg-glass-border: rgba(15, 23, 42, 0.08);
--wg-glass-shadow: 0 14px 44px rgba(15, 23, 42, 0.2);
--wg-fg: #1f2d3d;
--wg-fg-dim: rgba(31, 45, 61, 0.62);
--wg-fg-shadow: none;
background: var(--wg-glass-bg);
backdrop-filter: blur(22px) saturate(150%);
-webkit-backdrop-filter: blur(22px) saturate(150%);
box-shadow: 0 14px 44px rgba(0, 0, 0, 0.38);
box-shadow: var(--wg-glass-shadow);
.widget-header {
background: rgba(255, 255, 255, 0.5);
}
}
}
+7 -2
View File
@@ -45,7 +45,9 @@
<div v-if="loading" class="wm-loading">加载中…</div>
<div v-else class="wgrid">
<div v-if="items.length === 0" class="empty-state">
<div class="es-ic">🧩</div>
<div class="es-ic">
<SvgIcon name="widget-empty-line" size="72" color="#c4c9d2" />
</div>
<h5>候选池是空的</h5>
<p>新环境不会自动种数据(手工种子只在 <code>resources/sql/widget_catalog.sql</code>,启动期 seeding 仅在库里一行都没有时才补 3 个内置键)。<br />可先把前端注册表里已有的内置组件登记进来。</p>
<div class="es-actions">
@@ -118,6 +120,7 @@ import { Message } from "view-ui-plus";
import UserSettingApi from "@/api/UserSettingApi";
import { widgetRegistry } from "@/components/widgets";
import MyConfirm from "@/components/MyConfirm";
import SvgIcon from "@/components/SvgIcon.vue";
import { useDefaultStore } from "@/store";
import type { WidgetCatalog } from "@/types";
import WidgetCard from "./WidgetCard.vue";
@@ -606,7 +609,9 @@ $wm-brand-weak: color.mix(#ffffff, $wm-brand, 90%);
border: 1px dashed var(--wm-line2);
border-radius: 10px;
.es-ic {
font-size: 30px;
display: flex;
justify-content: center;
line-height: 0;
}
h5 {
font-size: 14.5px;