供应商消息以及代码优化

This commit is contained in:
孙景学
2025-07-04 08:47:01 +08:00
parent 359559f61b
commit 87baa97ae1
8 changed files with 45 additions and 25 deletions

View File

@ -1,9 +1,9 @@
import React, { useEffect, useState } from "react";
import { useIntl } from 'umi';
import { Form, Button, Table, Select, Input } from 'antd';
import { Form, Button, Table, Select, Input, Modal } from 'antd';
import type { ColumnsType, TablePaginationConfig } from 'antd/es/table';
import { SearchOutlined } from '@ant-design/icons';
import { page } from './services';
import { page, getExitMge } from './services';
import { getDictList } from '@/servers/api/dicts'
interface Data {
@ -97,6 +97,30 @@ const supplierNews: React.FC = () => {
// setCategoryOptions(data)
// }
// })
getExitMge().then((res) => {
const { code, data } = res;
if (code == 200) {
if (Array.isArray(data) && data.length > 0) {
Modal.info({
title: '消息通知',
width: 520,
content: (
<div>
<p>退</p>
<ul>
{data.map((item: any) => (
<li key={item.id} style={{ margin: '6px 0' }}>
退{item.content || '--'}
</li>
))}
</ul>
</div>
),
okText: '知道了'
});
}
}
})
getList({ pageNo: 1, pageSize: 10, content: '', type: '' });
}, []);
@ -109,7 +133,7 @@ const supplierNews: React.FC = () => {
style={{ marginBottom: 16 }}
>
<Form.Item name="content" label="消息内容">
<Input placeholder="请输入消息内容" allowClear maxLength={50}/>
<Input placeholder="请输入消息内容" allowClear maxLength={50} />
</Form.Item>
<Form.Item name="type" label="业务类型">
<Select placeholder="请选择业务类型" allowClear>

View File

@ -10,4 +10,8 @@ interface page {
content?: string;
type?: string;
}
export const page = (data: page) => request.post('/supplierMessage/page', { data });
export const page = (data: page) => request.post('/supplierMessage/page', { data });
/**
* 消息弹出
*/
export const getExitMge = () => request.get('/supplierMessage/getExitMge');