营业执照上传开发
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Modal, Form, Input, DatePicker, Upload, Button, message } from 'antd';
|
import { Modal, Form, Input, DatePicker, Upload, Button, message, Row, Col, Select } from 'antd';
|
||||||
import { UploadOutlined, DeleteOutlined } from '@ant-design/icons';
|
import { UploadOutlined, DeleteOutlined } from '@ant-design/icons';
|
||||||
import type { UploadFile } from 'antd/es/upload/interface';
|
import type { UploadFile } from 'antd/es/upload/interface';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { uploadPolicyFile } from '@/services/cms/policyInfo';
|
import { uploadPolicyFile } from '@/services/cms/policyInfo';
|
||||||
|
import { getDictValueEnum } from '@/services/system/dict';
|
||||||
|
import type { DictValueEnumObj } from '@/components/DictTag';
|
||||||
|
|
||||||
const { TextArea } = Input;
|
const { TextArea } = Input;
|
||||||
|
|
||||||
@@ -18,6 +20,13 @@ const EditModal: React.FC<EditModalProps> = ({ open, values, onCancel, onSubmit
|
|||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [fileList, setFileList] = useState<UploadFile[]>([]);
|
const [fileList, setFileList] = useState<UploadFile[]>([]);
|
||||||
const [uploading, setUploading] = useState(false);
|
const [uploading, setUploading] = useState(false);
|
||||||
|
const [userTypeEnum, setUserTypeEnum] = useState<DictValueEnumObj>({});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getDictValueEnum('user_type', false, true).then((data) => {
|
||||||
|
setUserTypeEnum(data);
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (open) {
|
if (open) {
|
||||||
@@ -25,6 +34,9 @@ const EditModal: React.FC<EditModalProps> = ({ open, values, onCancel, onSubmit
|
|||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
...values,
|
...values,
|
||||||
publishTime: values.publishTime ? dayjs(values.publishTime) : undefined,
|
publishTime: values.publishTime ? dayjs(values.publishTime) : undefined,
|
||||||
|
policyTag: values.policyTag
|
||||||
|
? String(values.policyTag).split(',').filter(Boolean)
|
||||||
|
: undefined,
|
||||||
});
|
});
|
||||||
// 如果有已上传的文件,显示在列表中
|
// 如果有已上传的文件,显示在列表中
|
||||||
if (values.fileUrl && values.fileName) {
|
if (values.fileUrl && values.fileName) {
|
||||||
@@ -81,53 +93,92 @@ const EditModal: React.FC<EditModalProps> = ({ open, values, onCancel, onSubmit
|
|||||||
|
|
||||||
const handleOk = async () => {
|
const handleOk = async () => {
|
||||||
const formValues = await form.validateFields();
|
const formValues = await form.validateFields();
|
||||||
|
const { policyTag, publishTime, ...rest } = formValues;
|
||||||
onSubmit({
|
onSubmit({
|
||||||
...formValues,
|
...rest,
|
||||||
id: values?.id,
|
id: values?.id,
|
||||||
publishTime: formValues.publishTime?.format('YYYY-MM-DD'),
|
publishTime: publishTime?.format('YYYY-MM-DD'),
|
||||||
|
policyTag: Array.isArray(policyTag) ? policyTag.join(',') : policyTag,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const userTypeOptions = Object.values(userTypeEnum).map((item) => ({
|
||||||
|
label: item.label,
|
||||||
|
value: item.value,
|
||||||
|
}));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
title={values ? '编辑政策' : '新增政策'}
|
title={values ? '编辑政策' : '新增政策'}
|
||||||
open={open}
|
open={open}
|
||||||
onCancel={onCancel}
|
onCancel={onCancel}
|
||||||
onOk={handleOk}
|
onOk={handleOk}
|
||||||
width={700}
|
width={900}
|
||||||
destroyOnClose
|
destroyOnClose
|
||||||
>
|
>
|
||||||
<Form form={form} layout="vertical">
|
<Form form={form} layout="vertical">
|
||||||
|
<Row gutter={16}>
|
||||||
|
<Col span={12}>
|
||||||
<Form.Item name="zcmc" label="政策名称" rules={[{ required: true, message: '请输入政策名称' }]}>
|
<Form.Item name="zcmc" label="政策名称" rules={[{ required: true, message: '请输入政策名称' }]}>
|
||||||
<Input placeholder="请输入政策名称" />
|
<Input placeholder="请输入政策名称" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
<Form.Item name="zclx" label="政策类型">
|
<Form.Item name="zclx" label="政策类型">
|
||||||
<Input placeholder="请输入政策类型" />
|
<Input placeholder="请输入政策类型" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
<Form.Item name="zcLevel" label="政策级别">
|
<Form.Item name="zcLevel" label="政策级别">
|
||||||
<Input placeholder="请输入政策级别" />
|
<Input placeholder="请输入政策级别" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Form.Item name="policyTag" label="人员类型">
|
||||||
|
<Select
|
||||||
|
mode="multiple"
|
||||||
|
allowClear
|
||||||
|
placeholder="请选择人员类型"
|
||||||
|
options={userTypeOptions}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
<Form.Item name="sourceUnit" label="发文单位">
|
<Form.Item name="sourceUnit" label="发文单位">
|
||||||
<Input placeholder="请输入发文单位" />
|
<Input placeholder="请输入发文单位" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
<Form.Item name="acceptUnit" label="受理单位">
|
<Form.Item name="acceptUnit" label="受理单位">
|
||||||
<Input placeholder="请输入受理单位" />
|
<Input placeholder="请输入受理单位" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
<Form.Item name="publishTime" label="发文时间">
|
<Form.Item name="publishTime" label="发文时间">
|
||||||
<DatePicker style={{ width: '100%' }} />
|
<DatePicker style={{ width: '100%' }} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="zcContent" label="政策内容">
|
</Col>
|
||||||
<TextArea rows={4} placeholder="请输入政策内容" />
|
<Col span={12}>
|
||||||
</Form.Item>
|
|
||||||
<Form.Item name="subsidyStandard" label="补贴标准">
|
|
||||||
<TextArea rows={2} placeholder="请输入补贴标准" />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item name="handleChannel" label="经办渠道">
|
<Form.Item name="handleChannel" label="经办渠道">
|
||||||
<Input placeholder="请输入经办渠道" />
|
<Input placeholder="请输入经办渠道" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
<Col span={24}>
|
||||||
|
<Form.Item name="zcContent" label="政策内容">
|
||||||
|
<TextArea rows={4} placeholder="请输入政策内容" />
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
<Col span={24}>
|
||||||
|
<Form.Item name="subsidyStandard" label="补贴标准">
|
||||||
|
<TextArea rows={2} placeholder="请输入补贴标准" />
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
<Col span={24}>
|
||||||
<Form.Item name="applyCondition" label="申报条件">
|
<Form.Item name="applyCondition" label="申报条件">
|
||||||
<TextArea rows={2} placeholder="请输入申报条件" />
|
<TextArea rows={2} placeholder="请输入申报条件" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
<Col span={24}>
|
||||||
<Form.Item label="政策文件">
|
<Form.Item label="政策文件">
|
||||||
{fileList.length > 0 ? (
|
{fileList.length > 0 ? (
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
|
||||||
@@ -154,15 +205,19 @@ const EditModal: React.FC<EditModalProps> = ({ open, values, onCancel, onSubmit
|
|||||||
</Upload>
|
</Upload>
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
<Col span={24}>
|
||||||
|
<Form.Item name="remark" label="备注">
|
||||||
|
<TextArea rows={2} placeholder="请输入备注" />
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
<Form.Item name="fileUrl" hidden>
|
<Form.Item name="fileUrl" hidden>
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="fileName" hidden>
|
<Form.Item name="fileName" hidden>
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="remark" label="备注">
|
|
||||||
<TextArea rows={2} placeholder="请输入备注" />
|
|
||||||
</Form.Item>
|
|
||||||
</Form>
|
</Form>
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import { useAccess } from '@umijs/max';
|
import { useAccess } from '@umijs/max';
|
||||||
import { Button, message, Modal } from 'antd';
|
import { Button, message, Modal } from 'antd';
|
||||||
import { ActionType, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
import { ActionType, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||||
@@ -10,6 +10,8 @@ import {
|
|||||||
updatePolicyInfo,
|
updatePolicyInfo,
|
||||||
deletePolicyInfo,
|
deletePolicyInfo,
|
||||||
} from '@/services/cms/policyInfo';
|
} from '@/services/cms/policyInfo';
|
||||||
|
import { getDictValueEnum } from '@/services/system/dict';
|
||||||
|
import DictTag, { DictValueEnumObj } from '@/components/DictTag';
|
||||||
import EditModal from './components/EditModal';
|
import EditModal from './components/EditModal';
|
||||||
import DetailModal from './components/DetailModal';
|
import DetailModal from './components/DetailModal';
|
||||||
|
|
||||||
@@ -20,6 +22,13 @@ const PolicyMgmt: React.FC = () => {
|
|||||||
const [detailModalVisible, setDetailModalVisible] = useState(false);
|
const [detailModalVisible, setDetailModalVisible] = useState(false);
|
||||||
const [currentRow, setCurrentRow] = useState<API.PolicyInfo.PolicyInfoItem>();
|
const [currentRow, setCurrentRow] = useState<API.PolicyInfo.PolicyInfoItem>();
|
||||||
const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([]);
|
const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([]);
|
||||||
|
const [userTypeEnum, setUserTypeEnum] = useState<DictValueEnumObj>({});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getDictValueEnum('user_type', false, true).then((data) => {
|
||||||
|
setUserTypeEnum(data);
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
const handleDelete = async (ids: string) => {
|
const handleDelete = async (ids: string) => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
@@ -56,6 +65,25 @@ const PolicyMgmt: React.FC = () => {
|
|||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '标签',
|
||||||
|
dataIndex: 'policyTag',
|
||||||
|
hideInSearch: true,
|
||||||
|
width: 160,
|
||||||
|
render: (_, record) => {
|
||||||
|
if (!record.policyTag) {
|
||||||
|
return '-';
|
||||||
|
}
|
||||||
|
const tags = String(record.policyTag).split(',').filter(Boolean);
|
||||||
|
return (
|
||||||
|
<span style={{ display: 'flex', flexWrap: 'wrap', gap: 4 }}>
|
||||||
|
{tags.map((tag) => (
|
||||||
|
<DictTag key={tag} enums={userTypeEnum} value={tag.trim()} />
|
||||||
|
))}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '发文单位',
|
title: '发文单位',
|
||||||
dataIndex: 'sourceUnit',
|
dataIndex: 'sourceUnit',
|
||||||
|
|||||||
1
src/types/cms/policyInfo.d.ts
vendored
1
src/types/cms/policyInfo.d.ts
vendored
@@ -24,6 +24,7 @@ declare namespace API.PolicyInfo {
|
|||||||
|
|
||||||
export interface PolicyInfoItem {
|
export interface PolicyInfoItem {
|
||||||
id: number;
|
id: number;
|
||||||
|
policyTag?: string;
|
||||||
zcmc: string;
|
zcmc: string;
|
||||||
zclx: string;
|
zclx: string;
|
||||||
zcLevel: string;
|
zcLevel: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user