feat(P4): precompute移植+app.js sources双向回填+回归1003/1003+验收体积/文件/data.json
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
<!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 · EmployeeCard (H5)</title>
|
||||
<link rel="stylesheet" href="../.design_library/aurora-admin/colors_and_type.css">
|
||||
<style>
|
||||
/* 对齐 组件9.txt EmployeeCard 规范:头像/姓名/工号/部门/职位/状态、悬停快捷操作、标签、可显联系方式、圆角8px/阴影低/内边距16px */
|
||||
.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; }
|
||||
.row { display: flex; flex-wrap: wrap; gap: 16px; }
|
||||
|
||||
.aa-emp-card { width: 280px; background: var(--au-color-card-bg); border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); padding: 16px; position: relative; box-sizing: border-box; }
|
||||
.aa-emp-top { display: flex; align-items: center; gap: 12px; }
|
||||
.aa-emp-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--au-color-brand-bg); color: var(--au-color-brand); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 18px; flex-shrink: 0; overflow: hidden; }
|
||||
.aa-emp-avatar img { width: 100%; height: 100%; object-fit: cover; }
|
||||
.aa-emp-name { font-size: 16px; font-weight: 600; color: var(--au-color-text-title); display: flex; align-items: center; gap: 8px; }
|
||||
.aa-emp-status { font-size: 12px; padding: 0 6px; border-radius: 2px; line-height: 18px; }
|
||||
.aa-emp-status.active { background: var(--au-color-tag-green-bg); color: var(--au-color-success); }
|
||||
.aa-emp-status.left { background: var(--au-color-disabled-bg); color: var(--au-color-text-secondary); }
|
||||
.aa-emp-id { font-size: 12px; color: var(--au-color-text-secondary); margin-top: 2px; }
|
||||
.aa-emp-meta { margin-top: 12px; font-size: 13px; color: var(--au-color-text-tertiary); line-height: 22px; }
|
||||
.aa-emp-tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
|
||||
.aa-emp-tag { background: var(--au-color-brand-bg); color: var(--au-color-brand); font-size: 12px; padding: 1px 8px; border-radius: 2px; }
|
||||
.aa-emp-contact { margin-top: 12px; font-size: 13px; color: var(--au-color-text-tertiary); line-height: 22px; border-top: 1px solid var(--au-color-border-strong); padding-top: 10px; }
|
||||
.aa-emp-actions {
|
||||
position: absolute; top: 12px; right: 12px; display: none; gap: 4px;
|
||||
background: var(--au-color-card-bg); border: 1px solid var(--au-color-border); border-radius: 4px; padding: 2px;
|
||||
}
|
||||
.aa-emp-card:hover .aa-emp-actions { display: flex; }
|
||||
.aa-emp-actions button { border: none; background: none; cursor: pointer; color: var(--au-color-text-secondary); font-size: 12px; padding: 2px 6px; border-radius: 3px; }
|
||||
.aa-emp-actions button:hover { color: var(--au-color-brand); background: var(--au-color-brand-bg); }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="demo">
|
||||
<h1>Aurora Admin · EmployeeCard 组件(纯 H5)</h1>
|
||||
<p class="sub">对齐 EmployeeCard 规范:头像/姓名/工号/部门/职位/状态、悬停快捷操作、技能标签、可显联系方式、圆角8px/阴影低/内边距16px</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="aa-emp-card">
|
||||
<div class="aa-emp-actions">
|
||||
<button onclick="alert('发消息')">发消息</button>
|
||||
<button onclick="alert('查看详情')">详情</button>
|
||||
<button onclick="alert('编辑')">编辑</button>
|
||||
</div>
|
||||
<div class="aa-emp-top">
|
||||
<div class="aa-emp-avatar">张</div>
|
||||
<div>
|
||||
<div class="aa-emp-name">张伟 <span class="aa-emp-status active">在职</span></div>
|
||||
<div class="aa-emp-id">工号:E1001</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="aa-emp-meta">部门:技术中心 · 前端组<br>职位:高级前端工程师</div>
|
||||
<div class="aa-emp-tags"><span class="aa-emp-tag">React</span><span class="aa-emp-tag">TypeScript</span><span class="aa-emp-tag">架构</span></div>
|
||||
</div>
|
||||
|
||||
<div class="aa-emp-card">
|
||||
<div class="aa-emp-actions">
|
||||
<button onclick="alert('发消息')">发消息</button>
|
||||
<button onclick="alert('查看详情')">详情</button>
|
||||
<button onclick="alert('编辑')">编辑</button>
|
||||
</div>
|
||||
<div class="aa-emp-top">
|
||||
<div class="aa-emp-avatar">李</div>
|
||||
<div>
|
||||
<div class="aa-emp-name">李娜 <span class="aa-emp-status left">离职</span></div>
|
||||
<div class="aa-emp-id">工号:E1024</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="aa-emp-meta">部门:产品中心 · 产品组<br>职位:产品经理</div>
|
||||
<div class="aa-emp-tags"><span class="aa-emp-tag">B端</span><span class="aa-emp-tag">数据</span></div>
|
||||
<div class="aa-emp-contact">电话:138-0000-0000<br>邮箱:lina@example.com</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,59 @@
|
||||
import React from 'react';
|
||||
import './EmployeeCard.css';
|
||||
|
||||
/**
|
||||
* Aurora Admin EmployeeCard(React)
|
||||
* 对齐 组件9.txt EmployeeCard 规范:头像/姓名/工号/部门/职位/状态、悬停快捷操作、标签、可显联系方式、圆角8px/阴影低/内边距16px
|
||||
* employee: { name, empId, dept, position, status:'active'|'left', avatar?, tags?, phone?, email? }
|
||||
*/
|
||||
export default function EmployeeCard({ employee, showContact = false, onMessage, onView, onEdit }) {
|
||||
const statusText = employee.status === 'left' ? '离职' : '在职';
|
||||
return (
|
||||
<div className="aa-emp-card">
|
||||
<div className="aa-emp-actions">
|
||||
<button onClick={() => onMessage && onMessage(employee)}>发消息</button>
|
||||
<button onClick={() => onView && onView(employee)}>详情</button>
|
||||
<button onClick={() => onEdit && onEdit(employee)}>编辑</button>
|
||||
</div>
|
||||
|
||||
<div className="aa-emp-top">
|
||||
<div className="aa-emp-avatar">
|
||||
{employee.avatar
|
||||
? <img src={employee.avatar} alt={employee.name} />
|
||||
: <span>{(employee.name || '?').charAt(0)}</span>}
|
||||
</div>
|
||||
<div>
|
||||
<div className="aa-emp-name">
|
||||
{employee.name}
|
||||
<span className={`aa-emp-status ${employee.status}`}>{statusText}</span>
|
||||
</div>
|
||||
<div className="aa-emp-id">工号:{employee.empId}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="aa-emp-meta">
|
||||
部门:{employee.dept}<br />职位:{employee.position}
|
||||
</div>
|
||||
|
||||
{employee.tags && employee.tags.length > 0 && (
|
||||
<div className="aa-emp-tags">
|
||||
{employee.tags.map((t) => <span key={t} className="aa-emp-tag">{t}</span>)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{showContact && (employee.phone || employee.email) && (
|
||||
<div className="aa-emp-contact">
|
||||
{employee.phone && <div>电话:{employee.phone}</div>}
|
||||
{employee.email && <div>邮箱:{employee.email}</div>}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
用法示例:
|
||||
import EmployeeCard from './EmployeeCard';
|
||||
const emp = { name: '张伟', empId: 'E1001', dept: '技术中心 · 前端组', position: '高级前端工程师', status: 'active', tags: ['React','TS'] };
|
||||
<EmployeeCard employee={emp} showContact onEdit={(e) => console.log(e)} />
|
||||
*/
|
||||
@@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<div class="aa-emp-card">
|
||||
<div class="aa-emp-actions">
|
||||
<button @click="$emit('message', employee)">发消息</button>
|
||||
<button @click="$emit('view', employee)">详情</button>
|
||||
<button @click="$emit('edit', employee)">编辑</button>
|
||||
</div>
|
||||
|
||||
<div class="aa-emp-top">
|
||||
<div class="aa-emp-avatar">
|
||||
<img v-if="employee.avatar" :src="employee.avatar" :alt="employee.name">
|
||||
<span v-else>{{ initial }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<div class="aa-emp-name">
|
||||
{{ employee.name }}
|
||||
<span class="aa-emp-status" :class="employee.status">{{ statusText }}</span>
|
||||
</div>
|
||||
<div class="aa-emp-id">工号:{{ employee.empId }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="aa-emp-meta">
|
||||
部门:{{ employee.dept }}<br>职位:{{ employee.position }}
|
||||
</div>
|
||||
|
||||
<div v-if="employee.tags && employee.tags.length" class="aa-emp-tags">
|
||||
<span v-for="t in employee.tags" :key="t" class="aa-emp-tag">{{ t }}</span>
|
||||
</div>
|
||||
|
||||
<div v-if="showContact && (employee.phone || employee.email)" class="aa-emp-contact">
|
||||
<div v-if="employee.phone">电话:{{ employee.phone }}</div>
|
||||
<div v-if="employee.email">邮箱:{{ employee.email }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'AaEmployeeCard',
|
||||
props: {
|
||||
employee: { type: Object, required: true }, // { name, empId, dept, position, status, avatar?, tags?, phone?, email? }
|
||||
showContact: { type: Boolean, default: false }
|
||||
},
|
||||
computed: {
|
||||
initial() { return (this.employee.name || '?').charAt(0); },
|
||||
statusText() { return this.employee.status === 'left' ? '离职' : '在职'; }
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<!-- 样式对齐 组件9.txt EmployeeCard 规范 -->
|
||||
<style>
|
||||
.aa-emp-card { width: 280px; background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); padding: 16px; position: relative; box-sizing: border-box; }
|
||||
.aa-emp-top { display: flex; align-items: center; gap: 12px; }
|
||||
.aa-emp-avatar { width: 48px; height: 48px; border-radius: 50%; background: #F0F5FF; color: #2F54EB; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 18px; flex-shrink: 0; overflow: hidden; }
|
||||
.aa-emp-avatar img { width: 100%; height: 100%; object-fit: cover; }
|
||||
.aa-emp-name { font-size: 16px; font-weight: 600; color: #1F2329; display: flex; align-items: center; gap: 8px; }
|
||||
.aa-emp-status { font-size: 12px; padding: 0 6px; border-radius: 2px; line-height: 18px; }
|
||||
.aa-emp-status.active { background: #F6FFED; color: #2E7D0A; }
|
||||
.aa-emp-status.left { background: #F5F5F5; color: #6E6E6E; }
|
||||
.aa-emp-id { font-size: 12px; color: #6E6E6E; margin-top: 2px; }
|
||||
.aa-emp-meta { margin-top: 12px; font-size: 13px; color: #595959; line-height: 22px; }
|
||||
.aa-emp-tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
|
||||
.aa-emp-tag { background: #F0F5FF; color: #2F54EB; font-size: 12px; padding: 1px 8px; border-radius: 2px; }
|
||||
.aa-emp-contact { margin-top: 12px; font-size: 13px; color: #595959; line-height: 22px; border-top: 1px solid #F0F0F0; padding-top: 10px; }
|
||||
.aa-emp-actions {
|
||||
position: absolute; top: 12px; right: 12px; display: none; gap: 4px;
|
||||
background: #fff; border: 1px solid #E8ECF1; border-radius: 4px; padding: 2px;
|
||||
}
|
||||
.aa-emp-card:hover .aa-emp-actions { display: flex; }
|
||||
.aa-emp-actions button { border: none; background: none; cursor: pointer; color: #6E6E6E; font-size: 12px; padding: 2px 6px; border-radius: 3px; }
|
||||
.aa-emp-actions button:hover { color: #2F54EB; background: #F0F5FF; }
|
||||
</style>
|
||||
@@ -0,0 +1,73 @@
|
||||
<template>
|
||||
<div class="aa-emp-card">
|
||||
<div class="aa-emp-actions">
|
||||
<button @click="emit('message', employee)">发消息</button>
|
||||
<button @click="emit('view', employee)">详情</button>
|
||||
<button @click="emit('edit', employee)">编辑</button>
|
||||
</div>
|
||||
|
||||
<div class="aa-emp-top">
|
||||
<div class="aa-emp-avatar">
|
||||
<img v-if="employee.avatar" :src="employee.avatar" :alt="employee.name">
|
||||
<span v-else>{{ initial }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<div class="aa-emp-name">
|
||||
{{ employee.name }}
|
||||
<span class="aa-emp-status" :class="employee.status">{{ statusText }}</span>
|
||||
</div>
|
||||
<div class="aa-emp-id">工号:{{ employee.empId }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="aa-emp-meta">
|
||||
部门:{{ employee.dept }}<br>职位:{{ employee.position }}
|
||||
</div>
|
||||
|
||||
<div v-if="employee.tags && employee.tags.length" class="aa-emp-tags">
|
||||
<span v-for="t in employee.tags" :key="t" class="aa-emp-tag">{{ t }}</span>
|
||||
</div>
|
||||
|
||||
<div v-if="showContact && (employee.phone || employee.email)" class="aa-emp-contact">
|
||||
<div v-if="employee.phone">电话:{{ employee.phone }}</div>
|
||||
<div v-if="employee.email">邮箱:{{ employee.email }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
employee: { type: Object, required: true }, // { name, empId, dept, position, status, avatar?, tags?, phone?, email? }
|
||||
showContact: { type: Boolean, default: false }
|
||||
});
|
||||
const emit = defineEmits(['message', 'view', 'edit']);
|
||||
|
||||
const initial = computed(() => (props.employee.name || '?').charAt(0));
|
||||
const statusText = computed(() => (props.employee.status === 'left' ? '离职' : '在职'));
|
||||
</script>
|
||||
|
||||
<!-- 样式对齐 组件9.txt EmployeeCard 规范 -->
|
||||
<style scoped>
|
||||
.aa-emp-card { width: 280px; background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); padding: 16px; position: relative; box-sizing: border-box; }
|
||||
.aa-emp-top { display: flex; align-items: center; gap: 12px; }
|
||||
.aa-emp-avatar { width: 48px; height: 48px; border-radius: 50%; background: #F0F5FF; color: #2F54EB; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 18px; flex-shrink: 0; overflow: hidden; }
|
||||
.aa-emp-avatar img { width: 100%; height: 100%; object-fit: cover; }
|
||||
.aa-emp-name { font-size: 16px; font-weight: 600; color: #1F2329; display: flex; align-items: center; gap: 8px; }
|
||||
.aa-emp-status { font-size: 12px; padding: 0 6px; border-radius: 2px; line-height: 18px; }
|
||||
.aa-emp-status.active { background: #F6FFED; color: #2E7D0A; }
|
||||
.aa-emp-status.left { background: #F5F5F5; color: #6E6E6E; }
|
||||
.aa-emp-id { font-size: 12px; color: #6E6E6E; margin-top: 2px; }
|
||||
.aa-emp-meta { margin-top: 12px; font-size: 13px; color: #595959; line-height: 22px; }
|
||||
.aa-emp-tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
|
||||
.aa-emp-tag { background: #F0F5FF; color: #2F54EB; font-size: 12px; padding: 1px 8px; border-radius: 2px; }
|
||||
.aa-emp-contact { margin-top: 12px; font-size: 13px; color: #595959; line-height: 22px; border-top: 1px solid #F0F0F0; padding-top: 10px; }
|
||||
.aa-emp-actions {
|
||||
position: absolute; top: 12px; right: 12px; display: none; gap: 4px;
|
||||
background: #fff; border: 1px solid #E8ECF1; border-radius: 4px; padding: 2px;
|
||||
}
|
||||
.aa-emp-card:hover .aa-emp-actions { display: flex; }
|
||||
.aa-emp-actions button { border: none; background: none; cursor: pointer; color: #6E6E6E; font-size: 12px; padding: 2px 6px; border-radius: 3px; }
|
||||
.aa-emp-actions button:hover { color: #2F54EB; background: #F0F5FF; }
|
||||
</style>
|
||||
Reference in New Issue
Block a user