提交 63111efd 作者: ZhangLingKun

功能:热点新闻置顶

上级 0867d327
...@@ -122,6 +122,7 @@ export type industryNewsListType = InterItemFunction< ...@@ -122,6 +122,7 @@ export type industryNewsListType = InterItemFunction<
newsTitle: string; newsTitle: string;
origin: string; origin: string;
surfaceImg: string; surfaceImg: string;
isHot: number;
}[] }[]
>; >;
//行业新闻-新增 //行业新闻-新增
...@@ -132,6 +133,7 @@ export type addIndustryNewsType = InterFunction< ...@@ -132,6 +133,7 @@ export type addIndustryNewsType = InterFunction<
newsTitle: string; newsTitle: string;
origin: string; origin: string;
surfaceImg: string; surfaceImg: string;
isHot: number;
}, },
any any
>; >;
......
...@@ -163,6 +163,7 @@ const TopicList = () => { ...@@ -163,6 +163,7 @@ const TopicList = () => {
} }
/> />
<Table <Table
size='small'
bordered bordered
dataSource={tableData} dataSource={tableData}
rowKey='id' rowKey='id'
......
import { FC, useEffect, useState } from 'react'; import { FC, useEffect, useState } from 'react';
import { Form, Input, message, Modal, ModalProps } from 'antd'; import { Form, Input, message, Modal, ModalProps, Select } from 'antd';
import { Uploader } from '~/components/uploader'; import { Uploader } from '~/components/uploader';
import { UploadOutlined } from '@ant-design/icons'; import { UploadOutlined } from '@ant-design/icons';
import RichText from '~/components/richText'; import RichText from '~/components/richText';
...@@ -123,6 +123,20 @@ const AddOrEditNewsModal: FC<ModalProps & selfProps> = ({ ...@@ -123,6 +123,20 @@ const AddOrEditNewsModal: FC<ModalProps & selfProps> = ({
<Input placeholder='请输入文章作者' maxLength={30} /> <Input placeholder='请输入文章作者' maxLength={30} />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label='是否置顶'
name='isHot'
rules={[{ required: true, message: '请选择是否置顶' }]}
initialValue={0}
>
<Select
placeholder='请选择是否置顶'
options={[
{ value: 0, label: '普通' },
{ value: 1, label: '置顶' },
]}
></Select>
</Form.Item>
<Form.Item
label='封面图' label='封面图'
name='surfaceImg' name='surfaceImg'
rules={[{ required: true, message: '请上传封面图' }]} rules={[{ required: true, message: '请上传封面图' }]}
......
...@@ -27,6 +27,7 @@ const IndustryNews = () => { ...@@ -27,6 +27,7 @@ const IndustryNews = () => {
{ {
title: '序号', title: '序号',
align: 'center', align: 'center',
width: 50,
render: (_text: string, _record, index: number) => render: (_text: string, _record, index: number) =>
(pagination.pageNo - 1) * pagination.pageSize + index + 1, (pagination.pageNo - 1) * pagination.pageSize + index + 1,
}, },
...@@ -53,12 +54,19 @@ const IndustryNews = () => { ...@@ -53,12 +54,19 @@ const IndustryNews = () => {
dataIndex: 'newsAuthor', dataIndex: 'newsAuthor',
}, },
{ {
title: '封图片', title: '封图片',
align: 'center', align: 'center',
dataIndex: 'surfaceImg', dataIndex: 'surfaceImg',
render: (text: string) => <Image src={text} width={50} height={50} />, render: (text: string) => <Image src={text} width={50} height={50} />,
}, },
{ {
title: '类型',
align: 'center',
dataIndex: 'isHot',
render: (text) => (text === 0 ? '普通' : '置顶'),
width: 50,
},
{
title: '操作', title: '操作',
align: 'center', align: 'center',
width: '20%', width: '20%',
......
...@@ -8,6 +8,7 @@ import { SystemManageAPI } from '~/api'; ...@@ -8,6 +8,7 @@ import { SystemManageAPI } from '~/api';
import { listCompanyPage } from '~/api/interface/systemManageType'; import { listCompanyPage } from '~/api/interface/systemManageType';
import { useNavigate } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
import AddEditModal from './comp/addEditModal'; import AddEditModal from './comp/addEditModal';
import { useSelector } from 'react-redux';
// 列表的数据类型 // 列表的数据类型
type TableType = InterListType<listCompanyPage>; type TableType = InterListType<listCompanyPage>;
...@@ -86,7 +87,7 @@ const CompanyManageView = () => { ...@@ -86,7 +87,7 @@ const CompanyManageView = () => {
search: `id=${record.id}`, search: `id=${record.id}`,
}); });
}; };
const { userInfo } = useSelector((state: any) => state.UserInfo);
// componentDidMount // componentDidMount
useEffect(() => { useEffect(() => {
query = {}; query = {};
...@@ -170,6 +171,7 @@ const CompanyManageView = () => { ...@@ -170,6 +171,7 @@ const CompanyManageView = () => {
onClick={() => { onClick={() => {
setAddEditModalVisible(true); setAddEditModalVisible(true);
}} }}
disabled={!userInfo.roleInfo.superAdmin}
> >
新增单位 新增单位
</Button> </Button>
......
...@@ -422,6 +422,7 @@ export const routerList: Array<RouteObjectType> = [ ...@@ -422,6 +422,7 @@ export const routerList: Array<RouteObjectType> = [
id: 410, id: 410,
title: '需求收集', title: '需求收集',
icon: <MonitorOutlined />, icon: <MonitorOutlined />,
hidden: true,
}, },
}, },
{ {
...@@ -686,6 +687,7 @@ export const routerList: Array<RouteObjectType> = [ ...@@ -686,6 +687,7 @@ export const routerList: Array<RouteObjectType> = [
id: 830, id: 830,
title: '服务订单', title: '服务订单',
icon: <CreditCardOutlined />, icon: <CreditCardOutlined />,
hidden: true,
}, },
}, },
{ {
...@@ -1039,6 +1041,7 @@ export const routerList: Array<RouteObjectType> = [ ...@@ -1039,6 +1041,7 @@ export const routerList: Array<RouteObjectType> = [
id: 1250, id: 1250,
title: '通用分类', title: '通用分类',
icon: <CoffeeOutlined />, icon: <CoffeeOutlined />,
hidden: true,
}, },
}, },
{ {
...@@ -1060,6 +1063,7 @@ export const routerList: Array<RouteObjectType> = [ ...@@ -1060,6 +1063,7 @@ export const routerList: Array<RouteObjectType> = [
id: 1260, id: 1260,
title: '目录管理', title: '目录管理',
icon: <UnorderedListOutlined />, icon: <UnorderedListOutlined />,
hidden: true,
}, },
}, },
], ],
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论