Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
admin
Commits
30dba701
提交
30dba701
authored
7月 15, 2023
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:标签管理
上级
720e0b0b
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
89 行增加
和
6 行删除
+89
-6
index.tsx
src/pages/resourceManage/tagManage/index.tsx
+87
-6
isRoute.ts
src/utils/isRoute.ts
+2
-0
没有找到文件。
src/pages/resourceManage/tagManage/index.tsx
浏览文件 @
30dba701
import
SearchBox
,
{
searchColumns
}
from
'~/components/search-box'
;
import
SearchBox
,
{
searchColumns
}
from
'~/components/search-box'
;
import
{
Button
,
Table
}
from
'antd'
;
import
{
Button
,
Table
,
Image
}
from
'antd'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
ColumnsType
}
from
'antd/es/table'
;
import
{
ColumnsType
}
from
'antd/es/table'
;
import
{
useState
}
from
'react'
;
import
{
use
Effect
,
use
State
}
from
'react'
;
import
AddOrEditTagModal
from
'./components/addOrEditTagModal'
;
import
AddOrEditTagModal
from
'./components/addOrEditTagModal'
;
import
{
InterDataType
,
InterReqType
}
from
'~/api/interface'
;
import
{
cooperationListTag
}
from
'~/api/interface/customManageType'
;
import
{
CustomManageAPI
}
from
'~/api'
;
// 列表类型
type
TableType
=
InterDataType
<
cooperationListTag
>
;
// 请求的参数
type
ReqType
=
InterReqType
<
cooperationListTag
>
;
// 搜索表单的数据
let
query
:
ReqType
=
{};
//行业新闻
//行业新闻
const
TagManage
=
()
=>
{
const
TagManage
=
()
=>
{
const
searchColumnsData
:
searchColumns
[]
=
[
const
searchColumnsData
:
searchColumns
[]
=
[
...
@@ -18,31 +29,91 @@ const TagManage = () => {
...
@@ -18,31 +29,91 @@ const TagManage = () => {
{
{
title
:
'序号'
,
title
:
'序号'
,
align
:
'center'
,
align
:
'center'
,
render
:
(
_text
,
_record
,
index
)
=>
(
pagination
.
current
-
1
)
*
pagination
.
pageSize
+
index
+
1
,
},
},
{
{
title
:
'标签名称'
,
title
:
'标签名称'
,
align
:
'center'
,
align
:
'center'
,
dataIndex
:
'tagName'
,
},
{
title
:
'标签描述'
,
align
:
'center'
,
dataIndex
:
'tagDescription'
,
width
:
'250px'
,
ellipsis
:
true
,
},
},
{
{
title
:
'标签
类型
'
,
title
:
'标签
需求
'
,
align
:
'center'
,
align
:
'center'
,
dataIndex
:
'tagRequire'
,
width
:
'250px'
,
ellipsis
:
true
,
},
},
{
{
title
:
'标签等级图标'
,
title
:
'标签等级图标'
,
align
:
'center'
,
align
:
'center'
,
dataIndex
:
'tagImg'
,
render
:
(
text
)
=>
<
Image
src=
{
text
}
alt=
{
'图标'
}
style=
{
{
width
:
'32px'
,
height
:
'32px'
}
}
/>,
},
},
{
{
title
:
'操作'
,
title
:
'操作'
,
align
:
'center'
,
align
:
'center'
,
fixed
:
'right'
,
width
:
'100px'
,
render
:
()
=>
(
render
:
()
=>
(
<>
<>
<
Button
type=
'link'
>
编辑
</
Button
>
<
Button
type=
'link'
>
编辑
</
Button
>
<
Button
type=
'link'
>
删除
</
Button
>
<
Button
type=
'link'
danger
>
删除
</
Button
>
</>
</>
),
),
},
},
];
];
const
[
tableData
]
=
useState
<
any
>
([{
id
:
1
}]);
// 表格数据
const
[
tableData
,
setTableData
]
=
useState
<
TableType
>
([]);
// 表格分页配置
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment
// @ts-ignore
const
[
pagination
,
setPagination
]
=
useState
({
total
:
0
,
pageSize
:
10
,
current
:
1
,
totalPage
:
0
,
});
// 加载列表
const
getTableList
=
async
(
value
=
{})
=>
{
// 只需要修改这个地方的接口即可
const
res
=
await
CustomManageAPI
.
cooperationListTag
({
pageNo
:
pagination
.
current
,
pageSize
:
pagination
.
pageSize
,
...
value
,
...
query
,
});
if
(
res
&&
res
.
code
===
'200'
)
{
// const { list, pageNo, totalCount, pageSize, totalPage } = res.result; // 解构
// setPagination({
// total: totalCount,
// current: pageNo,
// pageSize,
// totalPage,
// });
setTableData
(
res
.
result
);
}
};
// 翻页
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment
// @ts-ignore
const
paginationChange
=
(
pageNo
:
number
,
pageSize
:
number
)
=>
{
getTableList
({
pageNo
,
pageSize
}).
then
();
};
// 表单提交
const
onFinish
=
(
data
:
ReqType
)
=>
{
pagination
.
current
=
1
;
query
=
data
;
getTableList
(
data
).
then
();
};
const
[
addOrEditTagModalShow
,
setAddOrEditTagModalShow
]
=
useState
<
boolean
>
(
false
);
const
[
addOrEditTagModalShow
,
setAddOrEditTagModalShow
]
=
useState
<
boolean
>
(
false
);
const
addOrEditTagClick
=
()
=>
{
const
addOrEditTagClick
=
()
=>
{
...
@@ -51,6 +122,9 @@ const TagManage = () => {
...
@@ -51,6 +122,9 @@ const TagManage = () => {
const
addOrEditTagModalCancel
=
()
=>
{
const
addOrEditTagModalCancel
=
()
=>
{
setAddOrEditTagModalShow
(
false
);
setAddOrEditTagModalShow
(
false
);
};
};
useEffect
(()
=>
{
getTableList
().
then
();
},
[]);
return
(
return
(
<
div
className=
'tag-manage'
>
<
div
className=
'tag-manage'
>
<
SearchBox
<
SearchBox
...
@@ -60,8 +134,15 @@ const TagManage = () => {
...
@@ -60,8 +134,15 @@ const TagManage = () => {
新建
新建
</
Button
>
</
Button
>
}
}
searchData=
{
onFinish
}
/>
/>
<
Table
bordered
columns=
{
tableColumns
}
dataSource=
{
tableData
}
rowKey=
'id'
></
Table
>
<
Table
bordered
columns=
{
tableColumns
}
dataSource=
{
tableData
}
rowKey=
'id'
size=
{
'small'
}
></
Table
>
<
AddOrEditTagModal
open=
{
addOrEditTagModalShow
}
onCancel=
{
addOrEditTagModalCancel
}
/>
<
AddOrEditTagModal
open=
{
addOrEditTagModalShow
}
onCancel=
{
addOrEditTagModalCancel
}
/>
</
div
>
</
div
>
);
);
...
...
src/utils/isRoute.ts
浏览文件 @
30dba701
// 过滤路由
// 过滤路由
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import
{
limitEntity
}
from
'@/api/modules/role'
;
import
{
limitEntity
}
from
'@/api/modules/role'
;
export
const
filterRouter
=
(
list
:
any
,
routeList
:
limitEntity
[])
=>
{
export
const
filterRouter
=
(
list
:
any
,
routeList
:
limitEntity
[])
=>
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论