'use client'; import { useState } from 'react'; import { PageContainer } from '@/components/layout'; import { cn } from '@/utils/helpers'; import styles from './authorization.module.scss'; /** * 省/市公司数据接口 */ interface CompanyItem { id: string; avatar: string; nickname: string; accountId: string; province: string; city?: string; teamAdoptions: number; authStatus: 'authorized' | 'pending'; } /** * 阶梯性考核目标数据接口 */ interface TargetItem { month: string; provinceMonthly: number; provinceTotal: number; cityMonthly: number; cityTotal: number; } /** * 特殊城市规则接口 */ interface SpecialCityRule { city: string; enabled: boolean; } // 模拟省公司数据 const mockProvinceCompanies: CompanyItem[] = [ { id: '1', avatar: '', nickname: '用户昵称一', accountId: '123456789', province: '广东省', teamAdoptions: 1234, authStatus: 'authorized' }, ]; // 模拟市公司数据 const mockCityCompanies: CompanyItem[] = [ { id: '1', avatar: '', nickname: '用户昵称二', accountId: '987654321', province: '广东省', city: '深圳市', teamAdoptions: 567, authStatus: 'pending' }, ]; // 阶梯性考核目标数据 const targetData: TargetItem[] = [ { month: '第 1 个月', provinceMonthly: 500, provinceTotal: 500, cityMonthly: 100, cityTotal: 100 }, { month: '第 2 个月', provinceMonthly: 500, provinceTotal: 1000, cityMonthly: 100, cityTotal: 200 }, { month: '...', provinceMonthly: 0, provinceTotal: 0, cityMonthly: 0, cityTotal: 0 }, { month: '第 9 个月', provinceMonthly: 1000, provinceTotal: 6000, cityMonthly: 200, cityTotal: 1200 }, ]; // 特殊城市规则 const specialCities: SpecialCityRule[] = [ { city: '北京市', enabled: false }, { city: '上海市', enabled: true }, ]; /** * 授权管理页面 * 基于 UIPro Figma 设计实现 */ export default function AuthorizationPage() { // 省公司规则状态 const [provinceThreshold, setProvinceThreshold] = useState('500'); const [provinceBenefit, setProvinceBenefit] = useState('20'); const [provinceAfterBenefit, setProvinceAfterBenefit] = useState('20'); const [provinceResetEnabled, setProvinceResetEnabled] = useState(true); // 市公司规则状态 const [cityThreshold, setCityThreshold] = useState('100'); const [cityBenefit, setCityBenefit] = useState('40'); const [cityAfterBenefit, setCityAfterBenefit] = useState('40'); const [cityResetEnabled, setCityResetEnabled] = useState(true); // 授权限制规则 const [topRankLimit, setTopRankLimit] = useState('10'); const [specialRules, setSpecialRules] = useState(specialCities); // 渲染开关组件 const renderToggle = (checked: boolean, onChange: (checked: boolean) => void) => (
帮助:在此管理和筛选具备省公司资格的账号,并发起授权操作。
帮助:在此管理和筛选具备市公司资格的账号,并发起授权操作。
当省公司完成全部阶梯性考核后,可在此授权为正式省公司。
当市公司完成全部阶梯性考核后,可在此授权为正式市公司。
帮助:完成全部 9 个月阶梯考核后,可升级为正式省/市公司。