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";
|
import "@/ui/globals.css";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "任务管理",
|
title: "马上行计划管理",
|
||||||
description: "任务管理小助手",
|
description: "马上行计划管理",
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* Root Layout (Required)
|
* Root Layout (Required)
|
||||||
|
@ -18,7 +18,7 @@ export default function RootLayout({
|
||||||
return (
|
return (
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>任务管理</title>
|
<title>马上行计划管理</title>
|
||||||
<link rel="icon" href="/favicon.ico"/>
|
<link rel="icon" href="/favicon.ico"/>
|
||||||
<script src="/static/iconfont.js"></script>
|
<script src="/static/iconfont.js"></script>
|
||||||
{/*FOUC,Flash of Unstyled Content*/}
|
{/*FOUC,Flash of Unstyled Content*/}
|
||||||
|
|
|
@ -26,7 +26,7 @@ export default function Layout({children}: { children: React.ReactNode }) {
|
||||||
const requestParam: Request<TaskSelectVO> = {
|
const requestParam: Request<TaskSelectVO> = {
|
||||||
pageSize: 1000,
|
pageSize: 1000,
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
data: {state: data.taskState}
|
data: {state: data.taskState,pid:pid}
|
||||||
}
|
}
|
||||||
if (data.expectedStartTime.length>0){
|
if (data.expectedStartTime.length>0){
|
||||||
const parse = JSON.parse(data.expectedStartTime);
|
const parse = JSON.parse(data.expectedStartTime);
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
export type TaskSelectVO = {
|
export type TaskSelectVO = {
|
||||||
|
pid?:string|undefined|null;
|
||||||
name?: string;
|
name?: string;
|
||||||
state?: string;
|
state?: string;
|
||||||
priority?: string;
|
priority?: string;
|
||||||
|
|
|
@ -12,6 +12,7 @@ import {DetailModelForm} from "@/ui/task/project/DetailModelForm";
|
||||||
|
|
||||||
export interface OperationButtonProps {
|
export interface OperationButtonProps {
|
||||||
itemId: string,
|
itemId: string,
|
||||||
|
itemName:string,
|
||||||
priority?:string,
|
priority?:string,
|
||||||
pid: string,
|
pid: string,
|
||||||
pPid: string,
|
pPid: string,
|
||||||
|
@ -159,15 +160,15 @@ class OperationButton extends React.Component<OperationButtonProps, OperationMod
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: OPERATION_BUTTON_TYPE.SHOW_TREE,
|
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,
|
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,
|
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>
|
return <Fragment>
|
||||||
|
|
|
@ -7,6 +7,7 @@ import Link from "next/link";
|
||||||
import {DetailModelForm} from "@/ui/task/project/DetailModelForm";
|
import {DetailModelForm} from "@/ui/task/project/DetailModelForm";
|
||||||
interface OperationButtonProps {
|
interface OperationButtonProps {
|
||||||
itemId: string,
|
itemId: string,
|
||||||
|
itemName: string,
|
||||||
priority?:string,
|
priority?:string,
|
||||||
pid: string,
|
pid: string,
|
||||||
pPid: string,
|
pPid: string,
|
||||||
|
@ -87,15 +88,15 @@ const RightOption: React.FC<OperationButtonProps> = (props) => {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: OPERATION_BUTTON_TYPE.SHOW_TREE,
|
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,
|
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,
|
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 {Button, DatePicker, Select, Space} from "antd";
|
||||||
import {usePathname, useRouter} from "next/navigation";
|
import {usePathname, useRouter} from "next/navigation";
|
||||||
import {DetailModelForm} from "@/ui/task/project/DetailModelForm";
|
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[0] && expectStartTimeParseResult[0].value ? dayjs(expectStartTimeParseResult[0].value.toString()) : undefined,
|
||||||
expectStartTimeParseResult[1] && expectStartTimeParseResult[1].value ? dayjs(expectStartTimeParseResult[1].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">
|
return <div className="container">
|
||||||
<Space style={{marginTop: 0, "height": "42px", "alignContent": "center"}}>
|
<Space style={{marginTop: 0, "height": "42px", "alignContent": "center"}}>
|
||||||
<DetailModelForm haveButton={true} open={false} operationId={OPERATION_BUTTON_TYPE.ADD}
|
<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) => {
|
{props.taskList.map((record, index) => {
|
||||||
return <Draggable key={record.id} draggableId={record.id} index={index}>
|
return <Draggable key={record.id} draggableId={record.id} index={index}>
|
||||||
{(provided, snapshot) => (
|
{(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}
|
ref={provided.innerRef}
|
||||||
{...provided.draggableProps}
|
{...provided.draggableProps}
|
||||||
{...provided.dragHandleProps}
|
{...provided.dragHandleProps}
|
||||||
|
|
|
@ -152,7 +152,7 @@ const TreeTable: React.FC<TableSearchType> = (props) => {
|
||||||
columns={columns}
|
columns={columns}
|
||||||
// rowSelection={{ ...rowSelection, checkStrictly}}
|
// rowSelection={{ ...rowSelection, checkStrictly}}
|
||||||
dataSource={props.resultDataTypeList.filter(resultDataType=>{
|
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) {
|
if (dataLocalContext.expectedStartTime.length === 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,7 +166,7 @@ const TreeTable: React.FC<TableSearchType> = (props) => {
|
||||||
columns={columns}
|
columns={columns}
|
||||||
// rowSelection={{ ...rowSelection, checkStrictly}}
|
// rowSelection={{ ...rowSelection, checkStrictly}}
|
||||||
dataSource={props.resultDataTypeList.filter(resultDataType=>{
|
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) {
|
if (dataLocalContext.expectedStartTime.length === 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ const TreeTablePro: React.FC = () => {
|
||||||
key: 'option',
|
key: 'option',
|
||||||
title: '操作',
|
title: '操作',
|
||||||
valueType: 'option',
|
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={() => {
|
refreshDate={() => {
|
||||||
actionRef.current?.reload(false);
|
actionRef.current?.reload(false);
|
||||||
}}/>,
|
}}/>,
|
||||||
|
|
Loading…
Reference in New Issue