获取审核通过、待审核的数据
This commit is contained in:
@@ -15,7 +15,21 @@ export const editLinkDataAPI = (data: Web) => Request<Web>("PATCH", "/link", { d
|
||||
export const getLinkDataAPI = (id?: number) => Request<Web>("GET", `/link/${id}`)
|
||||
|
||||
// 获取网站列表
|
||||
export const getLinkListAPI = (data?: QueryData) => getListAPI<Web>("/link", data)
|
||||
export const getLinkListAPI = (data?: QueryData) => Request<Web[]>("POST", `/link/list`, {
|
||||
data: { ...data?.query },
|
||||
params: {
|
||||
sort: data?.sort,
|
||||
}
|
||||
})
|
||||
|
||||
// 分页获取评论列表
|
||||
export const getLinkPagingAPI = (data?: QueryData) => Request<Paginate<Web[]>>("POST", `/link/paging`, {
|
||||
data: { ...data?.query },
|
||||
params: {
|
||||
sort: data?.sort,
|
||||
...data?.pagination
|
||||
}
|
||||
})
|
||||
|
||||
// 获取网站类型列表
|
||||
export const getLinkTypeListAPI = () => {
|
||||
|
||||
@@ -111,8 +111,8 @@ const WallPage = () => {
|
||||
const query: FilterWall = {
|
||||
key: values.content,
|
||||
cateId: values.cateId,
|
||||
startDate: values.createTime ? values.createTime[0].valueOf() + '' : undefined,
|
||||
endDate: values.createTime ? values.createTime[1].valueOf() + '' : undefined,
|
||||
startDate: values?.createTime?.[0]?.valueOf()?.toString(),
|
||||
endDate: values?.createTime?.[1]?.valueOf()?.toString(),
|
||||
}
|
||||
|
||||
const { data } = await getWallListAPI({ query });
|
||||
|
||||
@@ -10,14 +10,18 @@ import link from './image/link.svg'
|
||||
import { Web } from "@/types/app/web"
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
type Menu = "comment" | "link" | "wall"
|
||||
|
||||
export default () => {
|
||||
const activeSty = "bg-[#f9f9ff] text-primary"
|
||||
const [active, setActive] = useState(1)
|
||||
const [active, setActive] = useState<Menu>("link")
|
||||
const [linkList, setLinkList] = useState<Web[]>([])
|
||||
|
||||
const getLinkList = async () => {
|
||||
const { data } = await getLinkListAPI()
|
||||
setLinkList((data as Web[]).filter(item => item.auditStatus === 0))
|
||||
const { data } = await getLinkListAPI({ query: { status: 0 } })
|
||||
console.log(data, 444);
|
||||
|
||||
setLinkList(data as Web[])
|
||||
}
|
||||
useEffect(() => {
|
||||
getLinkList()
|
||||
@@ -54,24 +58,24 @@ export default () => {
|
||||
<div className="w-2/12 min-h-96 pr-4 border-r border-[#eee]">
|
||||
<ul className="space-y-1">
|
||||
<li
|
||||
className={`flex items-center w-full py-3 px-4 hover:bg-[#f9f9ff] hover:text-primary ${active === 0 ? activeSty : ''} rounded-md text-base cursor-pointer transition-colors`}
|
||||
onClick={() => setActive(0)}
|
||||
className={`flex items-center w-full py-3 px-4 hover:bg-[#f9f9ff] hover:text-primary ${active === "comment" ? activeSty : ''} rounded-md text-base cursor-pointer transition-colors`}
|
||||
onClick={() => setActive("comment")}
|
||||
>
|
||||
<img src={comment} alt="" className="w-8 mr-4" />
|
||||
<span>评论</span>
|
||||
</li>
|
||||
|
||||
<li
|
||||
className={`flex items-center w-full py-3 px-4 hover:bg-[#f9f9ff] hover:text-primary ${active === 1 ? activeSty : ''} rounded-md text-base cursor-pointer transition-colors`}
|
||||
onClick={() => setActive(1)}
|
||||
className={`flex items-center w-full py-3 px-4 hover:bg-[#f9f9ff] hover:text-primary ${active === "link" ? activeSty : ''} rounded-md text-base cursor-pointer transition-colors`}
|
||||
onClick={() => setActive("link")}
|
||||
>
|
||||
<img src={link} alt="" className="w-8 mr-4" />
|
||||
<span>友联</span>
|
||||
</li>
|
||||
|
||||
<li
|
||||
className={`flex items-center w-full py-3 px-4 hover:bg-[#f9f9ff] hover:text-primary ${active === 2 ? activeSty : ''} rounded-md text-base cursor-pointer transition-colors`}
|
||||
onClick={() => setActive(2)}
|
||||
className={`flex items-center w-full py-3 px-4 hover:bg-[#f9f9ff] hover:text-primary ${active === "wall" ? activeSty : ''} rounded-md text-base cursor-pointer transition-colors`}
|
||||
onClick={() => setActive("wall")}
|
||||
>
|
||||
<img src={info} alt="" className="w-8 mr-4" />
|
||||
<span>留言</span>
|
||||
|
||||
1
src/types/response.d.ts
vendored
1
src/types/response.d.ts
vendored
@@ -22,6 +22,7 @@ interface Page {
|
||||
interface FilterData {
|
||||
key?: string,
|
||||
content?: string,
|
||||
status?: 0 | 1,
|
||||
startDate?: string,
|
||||
endDate?: string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user