提交 a056d54d 作者: 龚洪江

功能:路由权限

......@@ -83,7 +83,7 @@ jobs:
{
"msgtype": "markdown",
"markdown": {
"content": "### GitHub构建并推送镜像失败 \n
"content": "### `GitHub构建并推送镜像失败` \n
> - 提交人: ${{github.actor}} \n
> - 提交信息: ${{github.event.head_commit.message}} \n
> - 提交到仓库: ${{github.repository}} \n
......
......@@ -84,7 +84,7 @@ jobs:
{
"msgtype": "markdown",
"markdown": {
"content": "### GitHub构建并推送镜像失败 \n
"content": "### `GitHub构建并推送镜像失败` \n
> - 提交人: ${{github.actor}} \n
> - 提交信息: ${{github.event.head_commit.message}} \n
> - 提交到仓库: ${{github.repository}} \n
......
......@@ -13,8 +13,13 @@ COPY . .
# else echo "env PROFILES_ACTIVE not found. exec npm run build" && npm run build; \
# fi
RUN \
<<<<<<< HEAD
if [ "${PROFILES_ACTIVE}" = "development" ]; then echo "env PROFILES_ACTIVE=development. exec npm run buildDev"; \
else echo "env PROFILES_ACTIVE not found. exec npm run build"; \
=======
if [ "${PROFILES_ACTIVE}" = "development" ]; then echo "env PROFILES_ACTIVE=development. exec npm run buildDev" && npm run buildDev; \
else echo "env PROFILES_ACTIVE !=development. exec npm run build" && npm run build; \
>>>>>>> 7e17670714d6d48af870fd9addc10720db10c2ac
fi
RUN npm run build
......
......@@ -14,4 +14,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/admin
newTag: 9213a72a2ce5c629e5ed2f8b6d3659010787a41a
newTag: c137159a51734042bc2ea2d72537dc4e1fc0b947
......@@ -3,7 +3,7 @@ kind: Deployment
metadata:
name: admin-deployment
spec:
replicas: 2
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
......
import { InterFunction, InterItemFunction } from '~/api/interface';
import { InterFunction, InterListFunction } from '~/api/interface';
//论坛-列表
export type forumListType = InterItemFunction<
export type forumListType = InterListFunction<
{ keyword?: string },
{
id: number;
description: string;
mediaVO: null;
show: number;
userBaseInfo: {
nickName: string;
userImg: string;
userName: null;
phone: string;
uid: string;
userImg: string;
userName: string;
};
show: number;
id: number;
}[]
userAccountId: number;
dynamicPublishTime: string;
checkStatus: 0 | 1 | 2;
}
>;
//论坛-删除
export type deleteForumType = InterFunction<{ dynamicId: number }, any>;
......@@ -44,3 +48,8 @@ export type likeUserInfoType = InterFunction<
{ dynamicId: number },
{ nickName: string; userImg: string; userName: string }[]
>;
// 论坛-审核
export type checkDynamicType = InterFunction<
{ dynamicId: number; status: number },
NonNullable<unknown>
>;
import {
checkDynamicType,
deleteForumType,
forumDetailType,
forumListType,
......@@ -23,4 +24,7 @@ export class ForumManageAPI {
// 论坛-点赞人信息
static getLikeUserInfoList: likeUserInfoType = (params) =>
axios.get('/release/backstage/forum/likeUserInfo', { params });
// 动态审核
static checkDynamic: checkDynamicType = (params) =>
axios.get('/release/backstage/forum/checkDynamic', { params });
}
......@@ -3,13 +3,20 @@ import { Button, message, Modal, Table, Tooltip } from 'antd';
import { ColumnsType } from 'antd/es/table';
import { useEffect, useState } from 'react';
import DynamicDetailModal from './components/dynamicDetailModal';
import { ForumManageAPI } from '../../../api';
import { InterDataType, InterReqListType, PaginationProps } from '../../../api/interface';
import { forumDetailType, forumListType } from '../../../api/interface/forumManageType';
import { ForumManageAPI } from '~/api';
import { InterDataType, InterListType, InterReqListType, PaginationProps } from '~/api/interface';
import { forumDetailType, forumListType } from '~/api/interface/forumManageType';
import './index.scss';
// 动态审核状态
const checkStatusList = [
{ label: '审核中', value: 0 },
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 2 },
];
//论坛列表返回类型
type forumType = InterDataType<forumListType>['list'];
type forumType = InterListType<forumListType>;
//论坛列表参数类型
type forumParameters = InterReqListType<forumListType>;
//论坛详情返回类型
......@@ -44,6 +51,12 @@ const DynamicList = () => {
),
},
{
title: '审核状态',
align: 'center',
dataIndex: 'checkStatus',
render: (text: number) => checkStatusList.find((i) => i.value === text)?.label || text,
},
{
title: '用户UID',
align: 'center',
render: (_text: string, record) => <div>{record.userBaseInfo?.uid || ''}</div>,
......@@ -54,18 +67,41 @@ const DynamicList = () => {
render: (_text: string, record) => <div>{record.userBaseInfo?.phone || ''}</div>,
},
{
title: '发布时间',
align: 'center',
dataIndex: 'dynamicPublishTime',
},
{
title: '操作',
align: 'center',
fixed: 'right',
width: 180,
render: (_text: string, record) => (
<>
<Button
type='link'
onClick={() => handleCheckStatus(record)}
disabled={record.checkStatus !== 0}
>
审核
</Button>
<Button type='link' onClick={() => lookDynamicDetail(record)}>
查看详情
详情
</Button>
<Button type='link' onClick={() => deleteForumClick(record)}>
强制删除
<Button
type='link'
onClick={() => deleteForumClick(record)}
danger
disabled={record.checkStatus === 0}
>
删除
</Button>
<Button type='link' onClick={() => hiddenForumClick(record)}>
{record.show ? '恢复显示' : '强制隐藏'}
<Button
type='link'
onClick={() => hiddenForumClick(record)}
disabled={record.checkStatus === 0}
>
{record.show ? '显示' : '隐藏'}
</Button>
</>
),
......@@ -155,7 +191,30 @@ const DynamicList = () => {
}
});
};
// 是否确认审核
const handleCheckStatus = (record: forumType[0]) => {
Modal.confirm({
title: `确认审核`,
content: `请确认是否审核通过?通过后动态将展示在论坛列表`,
okText: '审核通过',
cancelText: '审核不通过',
onOk: async () => {
const res = await ForumManageAPI.checkDynamic({ dynamicId: record.id, status: 1 });
if (res && res.code === '200') {
message.success('操作成功');
paginationChange(pagination.pageNo, pagination.pageSize);
}
},
onCancel: async () => {
const res = await ForumManageAPI.checkDynamic({ dynamicId: record.id, status: 2 });
if (res && res.code === '200') {
message.success('操作成功');
paginationChange(pagination.pageNo, pagination.pageSize);
}
},
});
};
// 组件挂载
useEffect(() => {
getDynamicList();
}, []);
......@@ -163,6 +222,7 @@ const DynamicList = () => {
<div className='dynamic-list'>
<SearchBox search={searchColumnsData} searchData={searchSuccess} />
<Table
size={'small'}
bordered
columns={tableColumns}
dataSource={tableData}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论