提交 63111efd 作者: ZhangLingKun

功能:热点新闻置顶

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