feat:title根据pName展示
This commit is contained in:
parent
55e5468d47
commit
5da031aebc
|
@ -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>
|
||||
{/*FOUC,Flash of Unstyled Content*/}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export type TaskSelectVO = {
|
||||
pid?:string|undefined|null;
|
||||
name?: string;
|
||||
state?: string;
|
||||
priority?: string;
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>,
|
||||
}
|
||||
];
|
||||
// 获取系统样式
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}}/>,
|
||||
|
|
Loading…
Reference in New Issue