diff --git a/src/components/card/CardProj.tsx b/src/components/card/CardProj.tsx index 331b19e..4a5e337 100644 --- a/src/components/card/CardProj.tsx +++ b/src/components/card/CardProj.tsx @@ -32,32 +32,32 @@ import SoftwareManagementShow from '../../route/proj/edit/ProjConfigModListShow. import DisplayOrder from '../../route/proj/edit/ProjConfigMenuList.tsx' import DisplayOrderShow from '../../route/proj/edit/ProjConfigMenuListShow.tsx' export default function CardProj(props: any) { - // 选项数组 - const [tagArray, setTagArray] = useState([]) - // 获取标签 - const getTag = () => { - get({ - messageApi, - url: `/api/proj/tag/list-tag`, - onBefore() { + // // 选项数组 + // const [tagArray, setTagArray] = useState([]) + // // 获取标签 + // const getTag = () => { + // get({ + // messageApi, + // url: `/api/proj/tag/list-tag`, + // onBefore() { - }, - onSuccess(data: any) { - // console.log('标签信息', data); - const newarrty: any = (data.data).map((item: any) => ({ - value: item.key, - label: item.value - })); - // console.log('标签信息', newarrty); + // }, + // onSuccess(data: any) { + // // console.log('标签信息', data); + // const newarrty: any = (data.data).map((item: any) => ({ + // value: item.key, + // label: item.value + // })); + // // console.log('标签信息', newarrty); - setTagArray(newarrty) + // setTagArray(newarrty) - }, - onFinally() { + // }, + // onFinally() { - } - }) - } + // } + // }) + // } // 更新标签状态 const upTag = (dataId:string,projId:string) => { post({ @@ -73,6 +73,7 @@ export default function CardProj(props: any) { onSuccess() { // console.log(data); // props.upData + // props.updata() }, onFinally() { @@ -107,11 +108,11 @@ export default function CardProj(props: any) { const isShow = data.pay.chargeAdditionals.includes('PKG') || data.pay.charge.includes('ALL') const [messageApi, messageContext] = useMessage(); - const [projCategoryId, setProjCategoryId] = useState(data.projCategoryId); - const [projCategoryName, setProjCategoryName] = useState(data.projCategoryName); + // const [projCategoryId, setProjCategoryId] = useState(data.projCategoryId); + // const [projCategoryName, setProjCategoryName] = useState(data.projCategoryName); const [charge, setCharge] = useState(''); const [payCharge, setPayCharge] = useState(''); - const indexListContext = useContext(IndexListContext); + // const indexListContext = useContext(IndexListContext); /** * 生成状态 */ @@ -164,7 +165,7 @@ export default function CardProj(props: any) { // console.log('额外收费视频',videoDemoValue); // console.log('额外收费加急',URGENTvalue); // console.log('基础服务费',basicsValue); - getTag() + // getTag() }, []) return ( @@ -185,7 +186,7 @@ export default function CardProj(props: any) {
{data.gmtCreate}
- {tagArray.map((item:any) => { + {props.tagArray.map((item:any) => { return (
= useRef(null); @@ -62,9 +62,9 @@ export default function ListProj() { rows: 10, keywords: keywords, charge: name, - chargeAdditionals:chargeAdditionals, - tagDataId:tagDataId, - authorId:authorId, + chargeAdditionals: chargeAdditionals, + tagDataId: tagDataId, + authorId: authorId, projCategoryId: indexListContext.category, status: indexListContext.status ? indexListContext.status : getMenuActive() } @@ -73,8 +73,8 @@ export default function ListProj() { setIsLoading(true); }, onSuccess({ data }) { - console.log('数据',data); - + console.log('数据', data); + setPage(data.page); setTotal(data.total); setProjs(data.rows); @@ -91,7 +91,35 @@ export default function ListProj() { } }) } + // 选项数组 + const [tagArray, setTagArray] = useState([]) + // 获取标签 + const getTag = () => { + get({ + messageApi, + url: `/api/proj/tag/list-tag`, + onBefore() { + }, + onSuccess(data: any) { + // console.log('标签信息', data); + const newarrty: any = (data.data).map((item: any) => ({ + value: item.key, + label: item.value + })); + // console.log('标签信息', newarrty); + + setTagArray(newarrty) + + }, + onFinally() { + + } + }) + } + useEffect(()=>{ + getTag() + },[]) // 更新数据 const upreqData = () => { get>({ @@ -103,9 +131,9 @@ export default function ListProj() { rows: 10, keywords: keywords, charge: name, - chargeAdditionals:chargeAdditionals, - tagDataId:tagDataId, - authorId:authorId, + chargeAdditionals: chargeAdditionals, + tagDataId: tagDataId, + authorId: authorId, projCategoryId: indexListContext.category, status: indexListContext.status ? indexListContext.status : getMenuActive() } @@ -121,7 +149,7 @@ export default function ListProj() { } }) } - + const renderList = () => { if (projs.length == 0) { @@ -143,7 +171,8 @@ export default function ListProj() { return (
) @@ -168,7 +197,7 @@ export default function ListProj() { setTimeout(() => { setShowPage(true) }, 0); - }, [indexListContext.status, keywords, name,chargeAdditionals,tagDataId,authorId]) + }, [indexListContext.status, keywords, name, chargeAdditionals, tagDataId, authorId]) useEffect(() => { reqData(page);