feat:title根据pName展示

This commit is contained in:
1708-huayu 2025-07-08 18:55:15 +08:00
parent 55e5468d47
commit 5da031aebc
10 changed files with 25 additions and 15 deletions

View File

@ -2,8 +2,8 @@ import type {Metadata} from "next";
import "@/ui/globals.css";
export const metadata: Metadata = {
title: "任务管理",
description: "任务管理小助手",
title: "马上行计划管理",
description: "马上行计划管理",
};
/**
* Root Layout (Required)
@ -18,7 +18,7 @@ export default function RootLayout({
return (
<html>
<head>
<title></title>
<title></title>
<link rel="icon" href="/favicon.ico"/>
<script src="/static/iconfont.js"></script>
{/*FOUCFlash of Unstyled Content*/}

View File

@ -26,7 +26,7 @@ export default function Layout({children}: { children: React.ReactNode }) {
const requestParam: Request<TaskSelectVO> = {
pageSize: 1000,
pageNumber: 1,
data: {state: data.taskState}
data: {state: data.taskState,pid:pid}
}
if (data.expectedStartTime.length>0){
const parse = JSON.parse(data.expectedStartTime);

View File

@ -1,4 +1,5 @@
export type TaskSelectVO = {
pid?:string|undefined|null;
name?: string;
state?: string;
priority?: string;

View File

@ -12,6 +12,7 @@ import {DetailModelForm} from "@/ui/task/project/DetailModelForm";
export interface OperationButtonProps {
itemId: string,
itemName:string,
priority?:string,
pid: string,
pPid: string,
@ -159,15 +160,15 @@ class OperationButton extends React.Component<OperationButtonProps, OperationMod
},
{
key: OPERATION_BUTTON_TYPE.SHOW_TREE,
label: <Link href={"/task/project?pid=" + this.props.itemId}></Link>,
label: <Link href={`/task/project?pid=${this.props.itemId}&pName=${this.props.itemName}`}></Link>,
},
{
key: OPERATION_BUTTON_TYPE.SHOW_FOUR,
label: <Link href={"/task/drag?pid=" + this.props.itemId}></Link>,
label: <Link href={`/task/drag?pid=${this.props.itemId}&pName=${this.props.itemName}`}></Link>,
},
{
key: OPERATION_BUTTON_TYPE.SHOW_CALENDAR,
label: <Link href={"/task/calendar?pid=" + this.props.itemId}></Link>,
label: <Link href={`/task/calendar?pid=${this.props.itemId}&pName=${this.props.itemName}`}></Link>,
}
];
return <Fragment>

View File

@ -7,6 +7,7 @@ import Link from "next/link";
import {DetailModelForm} from "@/ui/task/project/DetailModelForm";
interface OperationButtonProps {
itemId: string,
itemName: string,
priority?:string,
pid: string,
pPid: string,
@ -87,15 +88,15 @@ const RightOption: React.FC<OperationButtonProps> = (props) => {
},
{
key: OPERATION_BUTTON_TYPE.SHOW_TREE,
label: <Link href={"/task/project?pid=" + props.itemId}></Link>,
label: <Link href={`/task/project?pid=${props.itemId}&pName=${props.itemName}`}></Link>,
},
{
key: OPERATION_BUTTON_TYPE.SHOW_FOUR,
label: <Link href={"/task/drag?pid=" + props.itemId}></Link>,
label: <Link href={`/task/drag?pid=${props.itemId}&pName=${props.itemName}`}></Link>,
},
{
key: OPERATION_BUTTON_TYPE.SHOW_CALENDAR,
label: <Link href={"/task/calendar?pid=" + props.itemId}></Link>,
label: <Link href={`/task/calendar?pid=${props.itemId}&pName=${props.itemName}`}></Link>,
}
];
// 获取系统样式

View File

@ -1,4 +1,5 @@
import React, {Fragment, useContext} from "react";
'use client'
import React, {Fragment, useContext, useEffect} from "react";
import {Button, DatePicker, Select, Space} from "antd";
import {usePathname, useRouter} from "next/navigation";
import {DetailModelForm} from "@/ui/task/project/DetailModelForm";
@ -31,6 +32,12 @@ export const TitleOperation: React.FC<TitleOperationProps> = ({
expectStartTimeParseResult[0] && expectStartTimeParseResult[0].value ? dayjs(expectStartTimeParseResult[0].value.toString()) : undefined,
expectStartTimeParseResult[1] && expectStartTimeParseResult[1].value ? dayjs(expectStartTimeParseResult[1].value.toString()) : undefined
];
const pName = useSearchParams().get("pName");
useEffect(() => {
if(pName&&pName!=document.title){
document.title = pName;
}
}, [pName]);
return <div className="container">
<Space style={{marginTop: 0, "height": "42px", "alignContent": "center"}}>
<DetailModelForm haveButton={true} open={false} operationId={OPERATION_BUTTON_TYPE.ADD}

View File

@ -79,7 +79,7 @@ export const DroppableTable = React.memo((props: DroppableTableProps) => {
{props.taskList.map((record, index) => {
return <Draggable key={record.id} draggableId={record.id} index={index}>
{(provided, snapshot) => (
<RightOption itemId={record.id} pid={record.pid} pPid={record.pPid} children={<div
<RightOption itemId={record.id} itemName={record.name} pid={record.pid} pPid={record.pPid} children={<div
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}

View File

@ -152,7 +152,7 @@ const TreeTable: React.FC<TableSearchType> = (props) => {
columns={columns}
// rowSelection={{ ...rowSelection, checkStrictly}}
dataSource={props.resultDataTypeList.filter(resultDataType=>{
resultDataType.action= <OperationButton itemId={resultDataType.id} pid={resultDataType.pid} pPid={resultDataType.pPid} refreshDate={props.refreshDate}/>
resultDataType.action= <OperationButton itemId={resultDataType.id} itemName={resultDataType.name} pid={resultDataType.pid} pPid={resultDataType.pPid} refreshDate={props.refreshDate}/>
if (dataLocalContext.expectedStartTime.length === 0) {
return true;
}

View File

@ -166,7 +166,7 @@ const TreeTable: React.FC<TableSearchType> = (props) => {
columns={columns}
// rowSelection={{ ...rowSelection, checkStrictly}}
dataSource={props.resultDataTypeList.filter(resultDataType=>{
resultDataType.action= <OperationButton itemId={resultDataType.id} priority={resultDataType.priority} pid={resultDataType.pid} pPid={resultDataType.pPid} refreshDate={props.refreshDate}/>
resultDataType.action= <OperationButton itemId={resultDataType.id} itemName={resultDataType.name} priority={resultDataType.priority} pid={resultDataType.pid} pPid={resultDataType.pPid} refreshDate={props.refreshDate}/>
if (dataLocalContext.expectedStartTime.length === 0) {
return true;
}

View File

@ -155,7 +155,7 @@ const TreeTablePro: React.FC = () => {
key: 'option',
title: '操作',
valueType: 'option',
render: (_, record) => <OperationButton itemId={record.id} pid={record.pid} pPid={record.pPid}
render: (_, record) => <OperationButton itemId={record.id} itemName={record.name} pid={record.pid} pPid={record.pPid}
refreshDate={() => {
actionRef.current?.reload(false);
}}/>,