feat(P4): precompute移植+app.js sources双向回填+回归1003/1003+验收体积/文件/data.json
Deploy to GitHub Pages / deploy (push) Failing after 16s
Regression / regression (push) Failing after 15m2s

This commit is contained in:
aurora-admin
2026-09-12 14:18:41 +08:00
parent 16f365a045
commit c65a69c34e
401 changed files with 22932 additions and 140 deletions
+70
View File
@@ -0,0 +1,70 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Aurora Admin · Dropdown (H5)</title>
<link rel="stylesheet" href="../.design_library/aurora-admin/colors_and_type.css">
<style>
/* 对齐 组件2.txt Dropdown 规范:项高32px、内边距左右12px、悬停 #F5F7FA、危险 #CF1322、面板圆角6px/阴影中/最小宽120px */
.demo { padding: 24px; background: var(--au-color-page-bg); color: var(--au-color-text-body); font-family: var(--font-family); }
h1 { font-size: 20px; margin: 0 0 4px; }
.sub { color: var(--au-color-text-secondary); margin: 0 0 24px; font-size: 12px; }
.aa-dropdown { position: relative; display: inline-block; }
.aa-dropdown-trigger {
border: 1px solid var(--au-color-border); background: var(--au-color-card-bg); border-radius: 4px; height: 32px; padding: 0 12px;
cursor: pointer; font-size: 14px; color: var(--au-color-text-body); display: inline-flex; align-items: center; gap: 4px;
}
.aa-dropdown-trigger:hover { border-color: var(--au-color-brand); }
.aa-dropdown-panel {
position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 120px;
background: var(--au-color-card-bg); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); padding: 4px 0;
}
.aa-dropdown-item {
display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; cursor: pointer;
font-size: 14px; color: var(--au-color-text-body); white-space: nowrap;
}
.aa-dropdown-item:hover { background: var(--au-color-page-bg); }
.aa-dropdown-item.is-danger { color: var(--au-color-error); }
.aa-dropdown-item.is-disabled { color: var(--au-color-text-disabled); cursor: not-allowed; }
.aa-dropdown-item.is-disabled:hover { background: transparent; }
.aa-dropdown-divider { height: 1px; background: var(--au-color-border-strong); margin: 4px 0; }
</style>
</head>
<body>
<div class="demo">
<h1>Aurora Admin · Dropdown 组件(纯 H5)</h1>
<p class="sub">对齐 Dropdown 规范:菜单项高32px、内边距左右12px、悬停 #F5F7FA、危险项 #CF1322、面板圆角6px/阴影中/最小宽120px</p>
<div class="aa-dropdown" id="dd">
<button class="aa-dropdown-trigger" role="button" tabindex="0" aria-haspopup="listbox" aria-expanded="false" onclick="toggle()">操作 ▾</button>
<div class="aa-dropdown-panel" hidden>
<div class="aa-dropdown-item" role="menuitem" tabindex="0" data-key="edit">编辑</div>
<div class="aa-dropdown-item" role="menuitem" tabindex="0" data-key="copy">复制</div>
<div class="aa-dropdown-divider"></div>
<div class="aa-dropdown-item" role="menuitem" tabindex="0" data-key="disable" class="is-disabled" style="pointer-events:none;color:var(--color-text-placeholder)">不可用的项</div>
<div class="aa-dropdown-item is-danger" role="menuitem" tabindex="0" data-key="delete">删除</div>
</div>
</div>
</div>
<script>
const dd = document.getElementById('dd');
function toggle() {
const p = dd.querySelector('.aa-dropdown-panel');
p.hidden = !p.hidden;
}
dd.querySelectorAll('.aa-dropdown-item[data-key]').forEach(it => {
it.addEventListener('click', () => {
if (it.classList.contains('is-disabled')) return;
alert('选择了:' + it.dataset.key);
dd.querySelector('.aa-dropdown-panel').hidden = true;
});
});
document.addEventListener('click', (e) => {
if (!dd.contains(e.target)) dd.querySelector('.aa-dropdown-panel').hidden = true;
});
</script>
</body>
</html>
+64
View File
@@ -0,0 +1,64 @@
import React, { useState, useRef, useEffect } from 'react';
import './Dropdown.css';
/**
* Aurora Admin Dropdown(React)
* 对齐 组件2.txt Dropdown 规范:触发器点击展开、菜单项高32px、内边距左右12px、悬停 #F5F7FA、危险项 #CF1322、面板圆角6px/阴影中/最小宽120px
* items: [{ key, label, danger?, disabled?, divider?, icon? }]
*/
export default function Dropdown({ items = [], trigger = '操作', onSelect }) {
const [open, setOpen] = useState(false);
const rootRef = useRef(null);
useEffect(() => {
function onDocClick(e) {
if (rootRef.current && !rootRef.current.contains(e.target)) setOpen(false);
}
document.addEventListener('click', onDocClick);
return () => document.removeEventListener('click', onDocClick);
}, []);
const handleClick = (item) => {
if (item.disabled || item.divider) return;
onSelect && onSelect(item.key != null ? item.key : item.label);
setOpen(false);
};
return (
<div className="aa-dropdown" ref={rootRef}>
<div className="aa-dropdown-trigger" onClick={() => setOpen((o) => !o)}>
{trigger}
</div>
{open && (
<div className="aa-dropdown-panel">
{items.map((item, i) =>
item.divider ? (
<div key={`d${i}`} className="aa-dropdown-divider" />
) : (
<div
key={item.key || i}
className={`aa-dropdown-item${item.danger ? ' is-danger' : ''}${item.disabled ? ' is-disabled' : ''}`}
onClick={() => handleClick(item)}
>
{item.icon && <span className="ico">{item.icon}</span>}
{item.label}
</div>
)
)}
</div>
)}
</div>
);
}
/*
用法示例:
import Dropdown from './Dropdown';
const items = [
{ key: 'edit', label: '编辑' },
{ key: 'copy', label: '复制' },
{ divider: true },
{ key: 'delete', label: '删除', danger: true }
];
<Dropdown items={items} onSelect={(k) => console.log(k)} />
*/
+68
View File
@@ -0,0 +1,68 @@
<template>
<div class="aa-dropdown" ref="root">
<div class="aa-dropdown-trigger" @click="open = !open">
<slot>操作</slot>
</div>
<div v-show="open" class="aa-dropdown-panel">
<template v-for="(item, i) in items">
<div v-if="item.divider" :key="'d' + i" class="aa-dropdown-divider"></div>
<div
v-else
:key="item.key || i"
class="aa-dropdown-item"
:class="{ 'is-danger': item.danger, 'is-disabled': item.disabled }"
@click="onClick(item)"
>
<span v-if="item.icon" class="ico">{{ item.icon }}</span>
{{ item.label }}
</div>
</template>
</div>
</div>
</template>
<script>
export default {
name: 'AaDropdown',
props: {
items: { type: Array, default: () => [] }, // [{ key, label, danger, disabled, divider, icon }]
triggerText: { type: String, default: '操作' }
},
data() { return { open: false }; },
methods: {
onClick(item) {
if (item.disabled || item.divider) return;
this.$emit('select', item.key != null ? item.key : item.label);
this.open = false;
},
onDocClick(e) {
if (this.$refs.root && !this.$refs.root.contains(e.target)) this.open = false;
}
},
mounted() { document.addEventListener('click', this.onDocClick); },
beforeDestroy() { document.removeEventListener('click', this.onDocClick); }
};
</script>
<!-- 样式对齐 组件2.txt Dropdown 规范 -->
<style>
.aa-dropdown { position: relative; display: inline-block; }
.aa-dropdown-trigger {
border: 1px solid #E8ECF1; background: #fff; border-radius: 4px; height: 32px; padding: 0 12px;
cursor: pointer; font-size: 14px; color: #262626; display: inline-flex; align-items: center; gap: 4px;
}
.aa-dropdown-trigger:hover { border-color: #2F54EB; }
.aa-dropdown-panel {
position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 120px;
background: #fff; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); padding: 4px 0;
}
.aa-dropdown-item {
display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; cursor: pointer;
font-size: 14px; color: #262626; white-space: nowrap;
}
.aa-dropdown-item:hover { background: #F5F7FA; }
.aa-dropdown-item.is-danger { color: #CF1322; }
.aa-dropdown-item.is-disabled { color: #BFBFBF; cursor: not-allowed; }
.aa-dropdown-item.is-disabled:hover { background: transparent; }
.aa-dropdown-divider { height: 1px; background: #F0F0F0; margin: 4px 0; }
</style>
+67
View File
@@ -0,0 +1,67 @@
<template>
<div class="aa-dropdown" ref="root">
<div class="aa-dropdown-trigger" @click="open = !open">
<slot>操作</slot>
</div>
<div v-show="open" class="aa-dropdown-panel">
<template v-for="(item, i) in items" :key="item.key || 'd' + i">
<div v-if="item.divider" class="aa-dropdown-divider"></div>
<div
v-else
class="aa-dropdown-item"
:class="{ 'is-danger': item.danger, 'is-disabled': item.disabled }"
@click="onClick(item)"
>
<span v-if="item.icon" class="ico">{{ item.icon }}</span>
{{ item.label }}
</div>
</template>
</div>
</div>
</template>
<script setup>
import { ref, onMounted, onBeforeUnmount } from 'vue';
defineProps({
items: { type: Array, default: () => [] } // [{ key, label, danger, disabled, divider, icon }]
});
const emit = defineEmits(['select']);
const open = ref(false);
const root = ref(null);
function onClick(item) {
if (item.disabled || item.divider) return;
emit('select', item.key != null ? item.key : item.label);
open.value = false;
}
function onDocClick(e) {
if (root.value && !root.value.contains(e.target)) open.value = false;
}
onMounted(() => document.addEventListener('click', onDocClick));
onBeforeUnmount(() => document.removeEventListener('click', onDocClick));
</script>
<!-- 样式对齐 组件2.txt Dropdown 规范 -->
<style scoped>
.aa-dropdown { position: relative; display: inline-block; }
.aa-dropdown-trigger {
border: 1px solid #E8ECF1; background: #fff; border-radius: 4px; height: 32px; padding: 0 12px;
cursor: pointer; font-size: 14px; color: #262626; display: inline-flex; align-items: center; gap: 4px;
}
.aa-dropdown-trigger:hover { border-color: #2F54EB; }
.aa-dropdown-panel {
position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 120px;
background: #fff; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); padding: 4px 0;
}
.aa-dropdown-item {
display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; cursor: pointer;
font-size: 14px; color: #262626; white-space: nowrap;
}
.aa-dropdown-item:hover { background: #F5F7FA; }
.aa-dropdown-item.is-danger { color: #CF1322; }
.aa-dropdown-item.is-disabled { color: #BFBFBF; cursor: not-allowed; }
.aa-dropdown-item.is-disabled:hover { background: transparent; }
.aa-dropdown-divider { height: 1px; background: #F0F0F0; margin: 4px 0; }
</style>