支持企微通讯录缺失手机号(07-26-internal-ops-recovery-baseline)

这个提交包含在:
2026-07-27 13:05:27 +08:00
父节点 9875bc37a4
当前提交 2526052e73
共修改 24 个文件,包含 845 行新增和 63 行删除
+2 -2
查看文件
@@ -91,7 +91,7 @@ export type EmployeeSummary = {
id: string;
employeeNo: string;
name: string;
phone: string;
phone: string | null;
email: string;
status: EmployeeStatus;
departmentId: string;
@@ -231,7 +231,7 @@ export type EmployeeProfile = {
id: string;
employeeNo: string;
name: string;
phone: string;
phone: string | null;
email: string;
status: EmployeeStatus;
employmentStatus: EmployeeEmploymentStatus;
+1 -1
查看文件
@@ -35,7 +35,7 @@ export type MeResponse = {
id: string;
employeeNo: string;
name: string;
phone: string;
phone: string | null;
email: string;
departmentId: string;
directManagerId: string | null;
+2 -2
查看文件
@@ -6,7 +6,7 @@ export type UserSummary = {
id: string;
employeeNo: string;
name: string;
phone: string;
phone: string | null;
email: string;
status: UserStatus;
departmentId: string;
@@ -89,7 +89,7 @@ export async function fetchUsers(params: {
export async function createUser(payload: {
name: string;
phone: string;
phone: string | null;
email: string;
departmentId?: string;
directManagerId?: string | null;
+1 -1
查看文件
@@ -802,7 +802,7 @@ export function EmployeeProfilePage() {
<div>
<div className="text-sm text-zinc-500">手机 / 邮箱</div>
<div className="mt-2 text-sm text-zinc-900">
{profile.employee.phone} / {profile.employee.email}
{profile.employee.phone ?? "未填写"} / {profile.employee.email}
</div>
</div>
<div>
+1 -1
查看文件
@@ -322,7 +322,7 @@ export function UserManagementPage() {
</TableCell>
<TableCell className="text-sm">
<div>{item.email}</div>
<div className="text-zinc-500">{item.phone}</div>
<div className="text-zinc-500">{item.phone ?? "手机号未填写"}</div>
</TableCell>
<TableCell><StatusBadge status={item.status} /></TableCell>
<TableCell className="text-xs">{formatRoleCodes(item.roleCodes)}</TableCell>
@@ -13,7 +13,7 @@ import { Label } from "../../components/ui/label";
export interface CreateUserFormData {
name: string;
phone: string;
phone: string | null;
email: string;
departmentId: string | undefined;
directManagerId: string | null;
@@ -61,7 +61,6 @@ export function CreateUserDialog({
const canSubmit =
!isPending &&
trimmedName !== "" &&
trimmedPhone !== "" &&
trimmedEmail !== "" &&
rolesArray.length >= 1;
@@ -84,7 +83,7 @@ export function CreateUserDialog({
function handleSubmit() {
onSubmit({
name: trimmedName,
phone: trimmedPhone,
phone: trimmedPhone || null,
email: trimmedEmail,
departmentId: departmentId || undefined,
directManagerId: directManagerId ? directManagerId : null,
@@ -117,13 +116,13 @@ export function CreateUserDialog({
/>
</div>
<div className="grid gap-2">
<Label htmlFor="phone">手机号</Label>
<Label htmlFor="phone">手机号(可暂不填写)</Label>
<Input
id="phone"
data-testid="users-create-phone"
value={phone}
onChange={(e) => setPhone(e.target.value)}
placeholder="13800000001"
placeholder="后续可由本人授权或管理员补齐"
/>
</div>
<div className="grid gap-2">
@@ -31,7 +31,7 @@ export interface UserImportDialogProps {
const TEMPLATE_CSV = [
"employeeNo,name,phone,email,departmentName,title,directManagerEmployeeNo,roles,hireDate",
"E1001,李经理,13800000001,[email protected],行政部,经理,,manager,2026-03-01",
"E1002,张三,13800000002,[email protected],行政部,员工,E1001,employee,2026-03-15",
"E1002,张三,,[email protected],行政部,员工,E1001,employee,2026-03-15",
].join("\n");
function toCsvCell(value: string) {
@@ -205,10 +205,10 @@ export function UserImportDialog({ open, onOpenChange, onImported }: UserImportD
}}
/>
<div className="text-xs text-zinc-500">
必填列:employeeNo、name、phone、email、departmentName
必填列:employeeNo、name、email、departmentName
</div>
<div className="text-xs text-zinc-500">
选填列:title、directManagerEmployeeNo、roles、hireDate
选填列:phone、title、directManagerEmployeeNo、roles、hireDate
</div>
{selectedFile ? (
<div className="rounded-lg border border-zinc-200 px-3 py-2 text-xs text-zinc-600">