diff --git a/src/app/page.tsx b/src/app/page.tsx index e2f236d..a246fa1 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,17 +1,22 @@ 'use client' -import { useRouter} from "next/navigation"; +import {usePathname,useSearchParams, useRouter} from "next/navigation"; import dayjs from "dayjs"; import {useEffect} from "react"; -import { isMobile } from 'react-device-detect'; - export default function Home() { + const {replace} = useRouter(); useEffect(()=>{ + const pathName = usePathname() + const searchParams = useSearchParams() + console.log({pathName},{searchParams}) if(localStorage.getItem('platform-security')){ - if (isMobile){ - replace('/mobile/') - }else { - replace("/task/project") + if (!pathName){ + var callBack = searchParams.get("callBack"); + if (callBack){ + replace(decodeURI(callBack)) + }else { + replace("/task/project") + } } }else { replace("/login") diff --git a/src/components/DiaryOption.tsx b/src/components/DiaryOption.tsx index 9cc40ff..bf55ddc 100644 --- a/src/components/DiaryOption.tsx +++ b/src/components/DiaryOption.tsx @@ -62,6 +62,7 @@ const DiaryOption = (props: SelectDiary) => { const [diaryList, setDiaryList] = useState([]); const [diaryReduceList, setDiaryReduceList] = useState([]) const [page, setPage] = useState(1); + const [selectLoading,setSelectLoading]=useState(false); const noMore = { id: '0', keyId: 'o0', @@ -99,6 +100,7 @@ const DiaryOption = (props: SelectDiary) => { if (!open) { return } + setSendValueFlag(true) const fakeDataUrl = process.env.NEXT_PUBLIC_TODO_REQUEST_URL + `/task/message/diary/select`; fetch(fakeDataUrl, { method: 'POST', headers: { @@ -121,6 +123,7 @@ const DiaryOption = (props: SelectDiary) => { listRef.current.scrollTo({top: 9999999}); } } + setSendValueFlag(false) }); }; @@ -134,9 +137,9 @@ const DiaryOption = (props: SelectDiary) => { diaryList.filter(taskLog => { if (currentIndex === 0) { return true - } else if (currentIndex === 1 && taskLog.enableFlag === "1") { + } else if (currentIndex === 1 && taskLog.enableFlag !== "0") { return true - } else if (currentIndex === 2 && taskLog.enableFlag === "0") { + } else if (currentIndex === 2 && taskLog.enableFlag !== "1") { return true } else return false; }).reduce((map, taskLog) => { @@ -288,7 +291,6 @@ const DiaryOption = (props: SelectDiary) => { }, }) // 点击操作 end - return ( - + { // const [loading, setLoading] = useState(false); @@ -9,7 +10,7 @@ const ShareOption = (props: { taskId: string }) => { const [buttonIndex, setButtonIndex] = useState(1); const [qrCodeValue, setQrCodeValue] = useState("-"); const [qrCodeStatus, setQrCodeStatus] = useState<'active' | 'expired' | 'loading' | 'scanned'>("loading"); - + const [joinId,setJoinId] = useState(""); function doDownload(url: string, fileName: string) { const a = document.createElement('a'); a.download = fileName; @@ -37,7 +38,22 @@ const ShareOption = (props: { taskId: string }) => { }; const generateQrcode = () => { - + const clientId: string = uuidv4().substring(0,32); + // 分享人必须有权限 + // 生成分享信息同时适用链接和二维码 + addTaskPassAPI({taskId:props.taskId,pass:clientId,joinCheck:'1'}).then(res=>{ + if (res.data.status.success){ + let qrCodeData = { + taskId: props.taskId, pass: clientId, + passId: res.data.data.id, + local: "马上行计划管理", + opType: "SHARE_OPTION" + } + setJoinId(res.data.data.id!) + setQrCodeValue(JSON.stringify(qrCodeData)) + setQrCodeStatus("active") + } + }); } const showModal = () => { setOpen(true); @@ -47,14 +63,7 @@ const ShareOption = (props: { taskId: string }) => { setOpen(false); }; useEffect(() => { - // 分享人必须有权限 - // 生成分享信息同时适用链接和二维码 - const clientId: string = uuidv4(); - let qrCodeData = { - taskId: props.taskId, pass: clientId, local: "马上行计划管理", opType: "SHARE_OPTION" - } - setQrCodeValue(JSON.stringify(qrCodeData)) - setQrCodeStatus("active") + generateQrcode() }, []); return ( @@ -72,22 +81,22 @@ const ShareOption = (props: { taskId: string }) => { , - , - , + // , + // , ]} > {buttonIndex == 1 &&
@@ -109,7 +118,8 @@ const ShareOption = (props: { taskId: string }) => {
} diff --git a/src/components/StepSort.tsx b/src/components/StepSort.tsx index 356f4ba..91c3424 100644 --- a/src/components/StepSort.tsx +++ b/src/components/StepSort.tsx @@ -1,7 +1,8 @@ import React, {CSSProperties, Fragment, useState} from "react"; import {DragDropContext, Droppable, Draggable, DropResult, DraggingStyle, NotDraggingStyle} from "react-beautiful-dnd"; import {TaskStepSortVO} from "@/components/type/TaskSort.d"; -import {Button, Drawer} from "antd"; +import {Button, Drawer, Modal} from "antd"; +import TextArea from "antd/es/input/TextArea"; // fake data generator const getItems = (count: number, offset = 0) => @@ -23,25 +24,21 @@ const grid = 8; const getItemStyle = (isDragging: boolean, draggableStyle: DraggingStyle | NotDraggingStyle | undefined): CSSProperties => ({ // some basic styles to make the items look a bit nicer userSelect: "none", - padding: grid * 2, + // padding: grid, margin: `0 0 ${grid}px 0`, - - // change background colour if dragging - background: isDragging ? "lightgreen" : "grey", - - // styles we need to apply on draggables + background: isDragging ? "lightgreen" : "white", ...draggableStyle }); const getListStyle = (isDraggingOver: boolean) => ({ - background: isDraggingOver ? "lightblue" : "lightgrey", - padding: grid, - width: 250 + background: isDraggingOver ? "lightblue" : "white", + width: "100%" }); const StepSort = (props: { taskId: string }) => { const [state, setState] = useState(getItems(5, 10)); // 抽屉 start const [open, setOpen] = useState(false); + const [dialogueOpen, setDialogueOpen] = useState(false); function onDragEnd(result: DropResult) { const {source, destination} = result; @@ -57,10 +54,30 @@ const StepSort = (props: { taskId: string }) => { return ( + + +