feat:移除无效引用
This commit is contained in:
parent
4ea2065f22
commit
0690b15ce3
|
@ -1,7 +1,6 @@
|
|||
import {unstable_noStore as noStore} from 'next/cache';
|
||||
import axios, {AxiosResponse} from "axios";
|
||||
import {DataType, DictType, ResponseVO, ResultPage} from "@/app/lib/definitions";
|
||||
import { URL } from 'url';
|
||||
export async function getTaskTreeResult(requestParam:string): Promise<ResponseVO<ResultPage<DataType>>> {
|
||||
noStore();
|
||||
try {
|
||||
|
@ -109,37 +108,6 @@ export async function deleteTask(id:number): Promise<ResponseVO<string>> {
|
|||
}
|
||||
}
|
||||
|
||||
export async function editState(id:number,state:number): Promise<ResponseVO<string>> {
|
||||
noStore();
|
||||
try {
|
||||
// 使用 Axios 发送 DELETE 删除数据
|
||||
const response: AxiosResponse<ResponseVO<string>> = await axios.patch('http://taskmanagerserver.com:8090/task/'+id);
|
||||
// 从响应中提取数据并返回
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
// 处理错误
|
||||
console.error('Error fetching data:', error);
|
||||
// 返回一个默认值或者抛出错误
|
||||
throw new Error('Failed to fetch data');
|
||||
}
|
||||
}
|
||||
|
||||
export async function editPriority(id:number,priority:number): Promise<ResponseVO<string>> {
|
||||
noStore();
|
||||
try {
|
||||
// 使用 Axios 发送 DELETE 删除数据
|
||||
const response: AxiosResponse<ResponseVO<string>> = await axios.patch('http://taskmanagerserver.com:8090/task/'+id);
|
||||
// 从响应中提取数据并返回
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
// 处理错误
|
||||
console.error('Error fetching data:', error);
|
||||
// 返回一个默认值或者抛出错误
|
||||
throw new Error('Failed to fetch data');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//0,重要紧急红色,1,重要不紧急黄色,2,不重要紧急灰色,3不重要,不紧急绿色
|
||||
export const taskPriorityList: DictType[] = [
|
||||
{
|
||||
|
|
|
@ -3,7 +3,6 @@ import React, {Fragment} from "react";
|
|||
import {TitleOperation} from "@/app/ui/task/TitleOperation";
|
||||
import LocalContext from "@/app/ui/LocalContent";
|
||||
import dayjs from "dayjs";
|
||||
import {taskPriorityList} from "@/app/lib/task/project/data";
|
||||
import {ConfigProvider} from "antd";
|
||||
|
||||
export default function Layout({children}: { children: React.ReactNode }) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, {useContext} from "react";
|
||||
import {Button, DatePicker, Flex, Select, Space} from "antd";
|
||||
import {Button, DatePicker, Select, Space} from "antd";
|
||||
import {usePathname, useRouter} from "next/navigation";
|
||||
import {DetailModelForm} from "@/app/ui/task/project/DetailModelForm";
|
||||
import {OPERATION_BUTTON_TYPE, taskStateList} from "@/app/lib/task/project/data";
|
||||
|
@ -7,7 +7,6 @@ import '@/app/ui/task/TitleOperation.modules.css'
|
|||
import LocalContext from "@/app/ui/LocalContent";
|
||||
import {RequestDateType} from "@/app/ui/task/RequestDateType";
|
||||
import dayjs, {Dayjs} from "dayjs";
|
||||
import {element} from "prop-types";
|
||||
|
||||
interface TitleOperationProps {
|
||||
setTaskState: (value: string) => void;
|
||||
|
|
|
@ -1,22 +1,14 @@
|
|||
'use client'
|
||||
import React, {useEffect, useState} from 'react';
|
||||
import '@/app/ui/task/four/detailForm.modules.css'
|
||||
import {PlusOutlined} from '@ant-design/icons';
|
||||
import {
|
||||
Button,
|
||||
Cascader,
|
||||
Checkbox,
|
||||
ColorPicker,
|
||||
DatePicker,
|
||||
Form,
|
||||
Input,
|
||||
InputNumber, message,
|
||||
Radio,
|
||||
message,
|
||||
Select,
|
||||
Slider, Space,
|
||||
Switch,
|
||||
TreeSelect,
|
||||
Upload,
|
||||
Space,
|
||||
} from 'antd';
|
||||
import {RangePickerProps} from "antd/es/date-picker";
|
||||
import dayjs from "dayjs";
|
||||
|
@ -28,8 +20,7 @@ import {
|
|||
taskStateList,
|
||||
updateTask
|
||||
} from "@/app/lib/task/project/data";
|
||||
import {DataType, DictType} from "@/app/lib/definitions";
|
||||
import {DATE_TIME} from "@/app/lib/constants";
|
||||
import {DataType} from "@/app/lib/definitions";
|
||||
|
||||
export interface DetailFormProps {
|
||||
itemId: number,
|
||||
|
@ -41,8 +32,7 @@ export interface DetailFormProps {
|
|||
|
||||
export const DetailForm: React.FC<DetailFormProps> = (props) => {
|
||||
const [form] = Form.useForm();
|
||||
const [componentDisabled, setComponentDisabled] =
|
||||
useState<boolean>(props.operationId === OPERATION_BUTTON_TYPE.DETAIL);
|
||||
const [componentDisabled] = useState<boolean>(props.operationId === OPERATION_BUTTON_TYPE.DETAIL);
|
||||
const {RangePicker} = DatePicker;
|
||||
const {TextArea} = Input;
|
||||
// const [taskMessage,setTaskMessage]=useState<any>({name:"useState没效果吗,是这样的"});
|
||||
|
@ -71,12 +61,6 @@ export const DetailForm: React.FC<DetailFormProps> = (props) => {
|
|||
form.setFieldsValue(data)
|
||||
}
|
||||
}, [])
|
||||
const normFile = (e: any) => {
|
||||
if (Array.isArray(e)) {
|
||||
return e;
|
||||
}
|
||||
return e?.fileList;
|
||||
};
|
||||
const range = (start: number, end: number) => {
|
||||
const result = [];
|
||||
for (let i = start; i < end; i++) {
|
||||
|
|
Loading…
Reference in New Issue