From 5493acab8e17bf6166f9886c727b2e5d9e10abfb Mon Sep 17 00:00:00 2001 From: 1708-huayu <57060237+1708-huayu@users.noreply.github.com> Date: Mon, 28 Jul 2025 18:53:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0=E4=BA=8C=E7=BB=B4?= =?UTF-8?q?=E7=A0=81=E6=93=8D=E4=BD=9C=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DiaryOption.tsx | 4 +- src/components/ShareOption.tsx | 85 +++++++++++++++++++++++++ src/ui/login/XcxLoginPage.tsx | 3 +- src/ui/task/RightOption.tsx | 3 + src/ui/task/drag/DroppableTable.tsx | 1 + src/ui/task/project/DetailModelForm.tsx | 7 +- 6 files changed, 99 insertions(+), 4 deletions(-) create mode 100644 src/components/ShareOption.tsx diff --git a/src/components/DiaryOption.tsx b/src/components/DiaryOption.tsx index 929bb7e..0825d4e 100644 --- a/src/components/DiaryOption.tsx +++ b/src/components/DiaryOption.tsx @@ -244,7 +244,9 @@ const DiaryOption = (props: SelectDiary) => { label: '复制', key: '1', onClick: () => { - copyToClipboard(clickTaskDiary!.description) + copyToClipboard(clickTaskDiary!.description).then(res=>{ + res && message.info(`复制成功${clickTaskDiary!.description.length>5?clickTaskDiary!.description.substring(0,5)+"...":clickTaskDiary!.description}`) + }) } }, { diff --git a/src/components/ShareOption.tsx b/src/components/ShareOption.tsx new file mode 100644 index 0000000..d70a21e --- /dev/null +++ b/src/components/ShareOption.tsx @@ -0,0 +1,85 @@ +import React, {Fragment, useEffect, useState} from 'react'; +import {Button, Image, Modal, QRCode} from 'antd'; +import { v4 as uuidv4 } from 'uuid'; + +const ShareOption = (props:{taskId:string} ) => { + const [loading, setLoading] = useState(false); + const [open, setOpen] = useState(false); + const [buttonIndex, setButtonIndex] = useState(0); + const [qrCodeValue, setQrCodeValue] = useState("-"); + const [qrCodeStatus, setQrCodeStatus]=useState<'active' | 'expired' | 'loading' | 'scanned'>("active"); + + const generateQrcode =()=>{ + + } + const showModal = () => { + setOpen(true); + }; + + const handleOk = () => { + setLoading(true); + setTimeout(() => { + setLoading(false); + setOpen(false); + }, 3000); + }; + + const handleCancel = () => { + setOpen(false); + }; + useEffect(() => { + // 分享人必须有权限 + const clientId: string = uuidv4(); + let qrCodeData={ + taskId:props.taskId,pass:clientId,local:"马上行计划管理",opType:"SHARE_OPTION" + } + setQrCodeValue(JSON.stringify(qrCodeData)) + }, []); + + return ( + + + + 返回 + , + , + , + ]} + > + {buttonIndex==1&&
+
+
微信小程序二维码
+ + +
+
+
小程序扫描二维码,有效期7天
+ + +
+
} + +
+
+ ); +}; +export default ShareOption; \ No newline at end of file diff --git a/src/ui/login/XcxLoginPage.tsx b/src/ui/login/XcxLoginPage.tsx index 2f42222..4bcff34 100644 --- a/src/ui/login/XcxLoginPage.tsx +++ b/src/ui/login/XcxLoginPage.tsx @@ -40,7 +40,8 @@ export default function XcxLoginPage() { const clientId: string = uuidv4(); generateQrcodeAPI({clientId}).then(res=>{ let qrCodeData={ - clientId,serverId:res.data.data,local:"马上行计划管理" + clientId,serverId:res.data.data,local:"马上行计划管理", + opType:"LOGIN_OPTION" } setQrCodeValue(JSON.stringify(qrCodeData)) setQrCodeStatus("active") diff --git a/src/ui/task/RightOption.tsx b/src/ui/task/RightOption.tsx index 381d810..79324ea 100644 --- a/src/ui/task/RightOption.tsx +++ b/src/ui/task/RightOption.tsx @@ -7,6 +7,7 @@ import Link from "next/link"; import {DetailModelForm} from "@/ui/task/project/DetailModelForm"; interface OperationButtonProps { itemId: string, + taskType?:string, itemName: string, priority?:string, pid: string, @@ -124,11 +125,13 @@ const RightOption: React.FC = (props) => { itemId={operateState.operationId === OPERATION_BUTTON_TYPE.UPDATE||operateState.operationId === OPERATION_BUTTON_TYPE.DETAIL?props.itemId:undefined} pPid={props.pPid} pid={operateState.operationId === OPERATION_BUTTON_TYPE.ADD_CHILD ?props.itemId:undefined} + taskType={props.taskType} operationId={operateState.operationId} description={operateState.operationId === OPERATION_BUTTON_TYPE.DETAIL ? '任务详情' : operateState.operationId === OPERATION_BUTTON_TYPE.ADD_CHILD ? '添加支线任务' : operateState.operationId === OPERATION_BUTTON_TYPE.UPDATE ? '修改任务' : '未知操作'} open={operateState.openModal} + closeOpen={() => setOperateState({...operateState, openModal: false})} reloadData={handleCancel}/>} ); diff --git a/src/ui/task/drag/DroppableTable.tsx b/src/ui/task/drag/DroppableTable.tsx index b22caa0..fd92661 100644 --- a/src/ui/task/drag/DroppableTable.tsx +++ b/src/ui/task/drag/DroppableTable.tsx @@ -83,6 +83,7 @@ export const DroppableTable = React.memo((props: DroppableTableProps) => { {(provided, snapshot) => ( = (props) => { if (!editFormDisable) { result.push(...defaultDoms) } else { - result.push() + if (props.taskType=='1') { + result.push() + } result.push() }