diff --git a/.microcompact/mpo0vye9/functions.Edit:1.txt b/.microcompact/mpo0vye9/functions.Edit:1.txt new file mode 100644 index 0000000..b11bc85 --- /dev/null +++ b/.microcompact/mpo0vye9/functions.Edit:1.txt @@ -0,0 +1,23 @@ +The file /home/project/src/pages/MemberManage.tsx has been updated. Made 1 replacement. + +Here's the result of running `cat -n` on a snippet of the edited file: + 44→ password: '' + 45→ }); + 46→ const [editingMaster, setEditingMaster] = useState(false); + 47→ + 48→ // 公司信息 + 49→ const [companyInfo, setCompanyInfo] = useState<{ + 50→ name: string; + 51→ contact_phone: string | null; + 52→ role: string; + 53→ } | null>(null); + 54→ + 55→ // 帮助系统弹窗状态 + 56→ const [showUserManual, setShowUserManual] = useState(false); + 57→ const [showFeedback, setShowFeedback] = useState(false); + 58→ const [showAbout, setShowAbout] = useState(false); + 59→ + 60→ useEffect(() => { + 61→ if (!auth.user) return; + 62→ // 只有主账号可以管理子账号 + 63→ if (!auth.user.is_master) { \ No newline at end of file diff --git a/.microcompact/mpo0vyj1/functions.Edit:2.txt b/.microcompact/mpo0vyj1/functions.Edit:2.txt new file mode 100644 index 0000000..86268eb --- /dev/null +++ b/.microcompact/mpo0vyj1/functions.Edit:2.txt @@ -0,0 +1,68 @@ +The file /home/project/src/pages/MemberManage.tsx has been updated. Made 1 replacement. + +Here's the result of running `cat -n` on a snippet of the edited file: + 382→ + 383→ + 384→ + 385→ + 386→ {/* 帮助与支持卡片 */} + 387→
用户手册
+ 404→详细使用指南
+ 405→用户反馈
+ 419→提交问题或建议
+ 420→关于
+ 434→版本信息与版权
+ 435→删除后该子账号将无法登录,是否确认删除?
+ 805→| 颜色 | + 139→产品码 | + 140→库存 | + 141→操作 | + 142→
|---|
| 颜色 | + 194→产品码 | + 195→库存 | + 196→操作 | + 197→
|---|
| 颜色 | + 141→产品码 | + 142→库存 | + 143→操作 | + 144→
|---|
| 颜色 | + 180→产品码 | + 181→库存 | + 182→操作 | + 183→
|---|
| 颜色 | + 235→产品码 | + 236→库存 | + 237→操作 | + 238→
|---|
详细的使用指南和操作说明
+详细的使用指南和操作说明
+ 计划产量: {planTargetQuantity}米 | {isManualMode ? '请手动输入纱线信息' : '请确认纱线库存分配'} +
+
+
该计划没有纱线配比数据
++ 计划配比: {alloc.yarnRatio.yarn_name} | + 计划用量: {alloc.requiredQuantity}kg +
++ 配比: {Number(alloc.yarnRatio.ratio).toFixed(0)}% | + 每米用量: {alloc.yarnRatio.amount_per_meter}g/m | + 总需: {alloc.requiredQuantity}kg +
++ 部分纱线库存不足或匹配失败,建议切换到手动分配模式。 +
+| 颜色 | +产品码 | +库存 | +操作 | +
|---|
| 颜色 | -产品码 | -库存 | -操作 | -
|---|
| 颜色 | +产品码 | +库存 | +操作 | +
|---|
| 颜色 | +产品码 | +库存 | +操作 | +
|---|
{productName}
@@ -223,21 +277,46 @@ export function ProductList({加载中...
只有主账号可以管理账号
当前登录账号
+当前登录账号
{auth.user?.username}
用户手册
@@ -409,10 +451,10 @@ export function MemberManage() { whileHover={{ scale: 1.02 }} whileTap={{ scale: 0.98 }} onClick={() => setShowFeedback(true)} - className="flex items-center gap-3 p-4 bg-emerald-50 rounded-xl hover:bg-emerald-100 transition-colors text-left" + className={`flex items-center gap-3 p-4 ${theme.bg} rounded-xl ${theme.bgHover} transition-colors text-left`} > -用户反馈
@@ -424,10 +466,10 @@ export function MemberManage() { whileHover={{ scale: 1.02 }} whileTap={{ scale: 0.98 }} onClick={() => setShowAbout(true)} - className="flex items-center gap-3 p-4 bg-purple-50 rounded-xl hover:bg-purple-100 transition-colors text-left" + className={`flex items-center gap-3 p-4 ${theme.bg} rounded-xl ${theme.bgHover} transition-colors text-left`} > -关于
@@ -451,7 +493,7 @@ export function MemberManage() { whileHover={{ scale: isMobile ? 1 : 1.05 }} whileTap={{ scale: 0.95 }} onClick={handleOpenModal} - className="px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors" + className={`px-6 py-2 ${theme.button} text-white rounded-lg transition-colors`} > 添加子账号 @@ -535,7 +577,7 @@ export function MemberManage() { type="text" value={formData.username} onChange={(e) => setFormData({ ...formData, username: e.target.value })} - className="w-full pl-10 pr-4 py-2.5 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-all" + className={`w-full pl-10 pr-4 py-2.5 border border-gray-300 rounded-lg ${theme.ring} focus:border-transparent transition-all`} placeholder="请输入用户名(至少3个字符)" required /> @@ -552,7 +594,7 @@ export function MemberManage() { type="text" value={formData.displayName} onChange={(e) => setFormData({ ...formData, displayName: e.target.value })} - className="w-full pl-10 pr-4 py-2.5 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-all" + className={`w-full pl-10 pr-4 py-2.5 border border-gray-300 rounded-lg ${theme.ring} focus:border-transparent transition-all`} placeholder="请输入姓名" required /> @@ -569,7 +611,7 @@ export function MemberManage() { type="tel" value={formData.phone} onChange={(e) => setFormData({ ...formData, phone: e.target.value })} - className="w-full pl-10 pr-4 py-2.5 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-all" + className={`w-full pl-10 pr-4 py-2.5 border border-gray-300 rounded-lg ${theme.ring} focus:border-transparent transition-all`} placeholder="请输入手机号" required /> @@ -584,7 +626,7 @@ export function MemberManage() { type="password" value={formData.password} onChange={(e) => setFormData({ ...formData, password: e.target.value })} - className="w-full px-4 py-2.5 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-all" + className={`w-full px-4 py-2.5 border border-gray-300 rounded-lg ${theme.ring} focus:border-transparent transition-all`} placeholder="请输入密码(至少6个字符)" required /> @@ -614,7 +656,7 @@ export function MemberManage() { whileTap={{ scale: 0.98 }} type="submit" disabled={submitting} - className="flex-1 py-2.5 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors font-medium disabled:opacity-50 disabled:cursor-not-allowed" + className={`flex-1 py-2.5 ${theme.button} text-white rounded-lg transition-colors font-medium disabled:opacity-50 disabled:cursor-not-allowed`} > {submitting ? '创建中...' : '创建子账号'} @@ -705,14 +747,14 @@ export function MemberManage() {留空则保持原密码不变
@@ -774,7 +816,7 @@ export function MemberManage() { whileTap={{ scale: 0.98 }} type="submit" disabled={editingMaster} - className="flex-1 py-2.5 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors font-medium disabled:opacity-50 disabled:cursor-not-allowed" + className={`flex-1 py-2.5 ${theme.button} text-white rounded-lg transition-colors font-medium disabled:opacity-50 disabled:cursor-not-allowed`} > {editingMaster ? '保存中...' : '保存修改'} diff --git a/src/pages/purchaser/Dashboard.tsx b/src/pages/purchaser/Dashboard.tsx index 6840471..ef72e46 100644 --- a/src/pages/purchaser/Dashboard.tsx +++ b/src/pages/purchaser/Dashboard.tsx @@ -3,7 +3,7 @@ import { useNavigate } from 'react-router-dom'; import { useAuth } from '../../contexts/AuthContext'; import { supabase } from '../../supabase/client'; import { motion } from 'framer-motion'; -import { FileText, Plus, Warehouse, Factory, ArrowLeft, Users, TrendingUp, Package, Clock, Building2, CheckCircle2, DollarSign, Droplets, LogOut, HelpCircle } from 'lucide-react'; +import { FileText, Plus, Warehouse, Factory, ArrowLeft, Users, TrendingUp, Package, Clock, Building2, CheckCircle2, DollarSign, Droplets, LogOut, HelpCircle, X, BookOpen, MessageSquare, Info, Camera } from 'lucide-react'; import { useResponsive } from '../../hooks/useResponsive'; import { OnboardingGuide, shouldShowOnboarding } from '../../components/OnboardingGuide'; import { NotificationCenter } from '../../components/NotificationCenter'; @@ -14,25 +14,21 @@ import { UserManual } from '../../components/UserManual'; import type { ProductionPlan } from '../../types'; const statusMap: Record{(auth.user as any)?.display_name || auth.user?.username || '用户'},欢迎回来
+{(auth.user as any)?.display_name || auth.user?.username || '用户'},欢迎回来
暂无进行中的计划
+{plan.fabric_code}-{plan.color_code}
+暂无计划
-{plan.fabric_code}-{plan.color_code}
-{plan.target_quantity}米
-计划产量
-{(auth.user as any)?.display_name || auth.user?.username || '用户'}
+{auth.company?.name || '采购商'}
+ + {auth.user?.is_master ? '主账号' : '子账号'} + +账号管理
+管理团队成员和账户设置
+用户手册
+查看详细使用指南
+用户反馈
+提交问题或建议
+关于
+版本信息与版权
+