| | |
| | | ], |
| | | }, |
| | | { |
| | | path: '/party', |
| | | // layout: false, |
| | | name: '党员管理', |
| | | // access: '/work_order_transaction_management', |
| | | routes: [ |
| | | { |
| | | name: '党员管理', |
| | | path: '/party/manage', |
| | | component: './party/manage/index', |
| | | // access: '/work_order_transaction_management/work_order_item_configuration', |
| | | }, |
| | | { |
| | | name: '添加党员', |
| | | path: '/party/manage/add', |
| | | hideInMenu: true, |
| | | component: './party/manage/components/addAndEdit', |
| | | // access: '/work_order_transaction_management/problem_type_management', |
| | | }, |
| | | { |
| | | name: '党员审核', |
| | | path: '/party/audit', |
| | | component: './party/audit/index', |
| | | // access: '/work_order_transaction_management/banner_management', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | path: '/message-notification', |
| | | // layout: false, |
| | | name: '消息通知', |
New file |
| | |
| | | import { Form, Input, Modal, Select, Upload, Space, Button, message, Row, Col, Divider } from 'antd'; |
| | | import { sendRequest } from '@/utils/antdUtils'; |
| | | import { LoadingOutlined, PlusOutlined } from '@ant-design/icons'; |
| | | import { forwardRef, useEffect, useImperativeHandle, useState } from 'react'; |
| | | import { customRequest } from '@/utils/utils'; |
| | | import { add, Edit, getDetail } from '../service' |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { span: 8 }, |
| | | wrapperCol: { span: 12 }, |
| | | }; |
| | | |
| | | const AddEditView = ({ visible, onSave, onUpdate, onCancel, }, ref) => { |
| | | const [form] = Form.useForm(); |
| | | const [fileList, setFileList] = useState([])//banner图片 |
| | | const [loading, setLoading] = useState(false); |
| | | const [editData, setEditData] = useState({}) |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { span: 6 }, |
| | | wrapperCol: { span: 20 }, |
| | | }; |
| | | |
| | | |
| | | useImperativeHandle(ref, () => { |
| | | return { |
| | | refreshData: (data) => { |
| | | |
| | | setEditData(data); |
| | | if (data.id) { |
| | | // getDetail(data.id).then(res => { |
| | | // if (res.data.url) { |
| | | // let obj = [{ |
| | | // uid: 1, |
| | | // name: 'banner', |
| | | // url: res.data.url |
| | | // }] |
| | | // setFileList(obj) |
| | | // form.setFieldsValue({ image: obj }) |
| | | // } |
| | | // form.setFieldsValue({name: res.data.name}) |
| | | // }) |
| | | } |
| | | }, |
| | | clean: () => { |
| | | form.resetFields(); |
| | | setFileList([]) |
| | | }, |
| | | }; |
| | | }); |
| | | |
| | | |
| | | |
| | | // 提交表单 |
| | | const submit = () => { |
| | | form.validateFields().then(async (values) => { |
| | | |
| | | values.url = fileList[0].url |
| | | delete values.image |
| | | if (editData.id) { |
| | | values.id = editData.id |
| | | onUpdate(values) |
| | | return |
| | | } |
| | | onSave(values) |
| | | }) |
| | | } |
| | | |
| | | return ( |
| | | <Modal |
| | | getContainer={false} |
| | | width="65%" |
| | | destroyOnClose |
| | | title={'提示'} |
| | | open={visible} |
| | | okText='确认' |
| | | onCancel={() => onCancel(false)} |
| | | onOk={submit} |
| | | > |
| | | <div style={{ width: '100%', textAlign: 'center', margin: '20px 0', fontWeight: 'bold' }}>确认审核{editData.type == 'sure' ? '同意' : '拒绝'}所选信息么?</div> |
| | | <Form scrollToFirstError layout="horizontal" {...formItemLayout} form={form}> |
| | | <Row> |
| | | <Col span={8}> |
| | | <Form.Item |
| | | name="name" |
| | | label='姓名' |
| | | required |
| | | > |
| | | <Input disabled placeholder='请输入'></Input> |
| | | </Form.Item> |
| | | <Form.Item |
| | | name="name" |
| | | label='所在社区' |
| | | required |
| | | > |
| | | <Input disabled placeholder='请输入'></Input> |
| | | </Form.Item> |
| | | <Form.Item |
| | | name="name" |
| | | label='头像上传' |
| | | required |
| | | > |
| | | <Input disabled placeholder='请输入'></Input> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={8}> |
| | | <Form.Item |
| | | name="name" |
| | | label='联系电话' |
| | | required |
| | | > |
| | | <Input disabled placeholder='请输入'></Input> |
| | | </Form.Item> |
| | | <Form.Item |
| | | name="name" |
| | | label='服务对象' |
| | | required |
| | | > |
| | | <Input disabled placeholder='请输入'></Input> |
| | | </Form.Item></Col> |
| | | <Col span={8}> |
| | | <Form.Item |
| | | name="name" |
| | | label='身份证号' |
| | | required |
| | | > |
| | | <Input disabled placeholder='请输入'></Input> |
| | | </Form.Item> |
| | | <Form.Item |
| | | name="name" |
| | | label='所在党组织' |
| | | required |
| | | > |
| | | <Input disabled placeholder='请输入'></Input> |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | {editData.type == 'refuse' && ( |
| | | <> |
| | | <Divider /> |
| | | <Row> |
| | | <Col span={8}> |
| | | <Form.Item |
| | | name="remark" |
| | | label='拒绝理由' |
| | | rules={[{ required: true, message: '拒绝理由必填' }]} |
| | | > |
| | | <Input.TextArea placeholder='请输入拒绝理由'></Input.TextArea> |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </> |
| | | )} |
| | | |
| | | |
| | | </Form> |
| | | </Modal> |
| | | ); |
| | | }; |
| | | |
| | | export default forwardRef(AddEditView); |
New file |
| | |
| | | import { PageContainer, ProTable } from '@ant-design/pro-components'; |
| | | import { buildProTableDataSource, sendRequest, showDelConfirm } from '@/utils/antdUtils'; |
| | | import { Button, message, Space,Cascader } from 'antd'; |
| | | import { useRef, useState } from 'react'; |
| | | import { Access, history, useAccess } from 'umi'; |
| | | import AddAndEdit from './components/index'; |
| | | import { getList, updateStatus, deleteBanner, add, Edit } from './service' |
| | | const Banner = () => { |
| | | |
| | | const actionRef = useRef(); |
| | | const access = useAccess(); |
| | | const addViewRef = useRef(); |
| | | const [modalVisible, handleModalVisible] = useState(false); |
| | | |
| | | const [items, setItems] = useState([]); |
| | | |
| | | const columns = [ |
| | | { |
| | | title: '姓名', |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title: '性别', |
| | | hideInSearch: true, |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title: '联系电话', |
| | | hideInSearch: true, |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title: '身份证号', |
| | | hideInSearch: true, |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title: '所在社区', |
| | | dataIndex: 'name', |
| | | renderFormItem: () => { |
| | | return ( |
| | | <Cascader |
| | | options={items} |
| | | fieldNames={{ value: 'key', label: 'name' }} |
| | | placeholder="请选择" |
| | | displayRender={(label) => label[label.length - 1]} |
| | | changeOnSelect={true} |
| | | /> |
| | | ); |
| | | }, |
| | | }, |
| | | { |
| | | title: '服务对象', |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title: '所在党组织', |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title: '申请时间', |
| | | dataIndex: 'status', |
| | | hideInSearch: true, |
| | | }, |
| | | { |
| | | title: '操作', |
| | | hideInSearch: true, |
| | | render: (text, record) => { |
| | | return ( |
| | | <Space> |
| | | {/* <Access accessible={access['/work_order_transaction_management/banner_management/del']}> */} |
| | | <Button |
| | | type="link" |
| | | onClick={() => { |
| | | addViewRef.current.refreshData({type:'sure',id:record.id}); |
| | | handleModalVisible(true); |
| | | }} |
| | | > |
| | | 通过 |
| | | </Button> |
| | | {/* </Access> */} |
| | | {/* <Access accessible={access['/work_order_transaction_management/banner_management/del']}> */} |
| | | <Button |
| | | type="link" |
| | | onClick={() => { |
| | | addViewRef.current.refreshData({type:'refuse',id:record.id}); |
| | | handleModalVisible(true); |
| | | }} |
| | | > |
| | | 拒绝 |
| | | </Button> |
| | | {/* </Access> */} |
| | | </Space > |
| | | ); |
| | | }, |
| | | }, |
| | | ] |
| | | |
| | | return <div> |
| | | <PageContainer title='党员审核' header={{ |
| | | breadcrumb: {}, |
| | | }}> |
| | | <ProTable |
| | | rowKey='id' |
| | | actionRef={actionRef} |
| | | columns={columns} |
| | | pagination={{ |
| | | showSizeChanger: true, |
| | | showQuickJumper: true, |
| | | defaultPageSize: 10, |
| | | }} |
| | | request={(params) => { |
| | | return buildProTableDataSource(getList, params) |
| | | }} |
| | | toolBarRender={false} |
| | | /> |
| | | <AddAndEdit |
| | | ref={addViewRef} |
| | | visible={modalVisible} |
| | | onCancel={() => handleModalVisible(false)} |
| | | onSave={async (fileds) => { |
| | | // const success = await sendRequest(add, fileds); |
| | | // if (success) { |
| | | // handleModalVisible(false); |
| | | // actionRef.current.reload(); |
| | | // } |
| | | }} |
| | | onUpdate={async (fileds) => { |
| | | // const success = await sendRequest(Edit, fileds); |
| | | // if (success) { |
| | | // handleModalVisible(false); |
| | | // actionRef.current.reload(); |
| | | // } |
| | | }} |
| | | /> |
| | | </PageContainer> |
| | | </div>; |
| | | }; |
| | | |
| | | export default Banner; |
New file |
| | |
| | | import { request } from '@umijs/max'; |
| | | |
| | | // 列表 |
| | | export const getList = async (data) => { |
| | | return request(`/api/huacheng-sangeshenbian/banner/list`, { |
| | | method: 'GET', |
| | | params:data |
| | | }); |
| | | } |
| | | // 详情 |
| | | export const getDetail = async (id) => { |
| | | return request(`/api/huacheng-sangeshenbian/banner/getBannerInfo/${id}`, { |
| | | method: 'GET', |
| | | // data |
| | | }); |
| | | } |
| | | |
| | | |
| | | // 删除 |
| | | export const deleteBanner = async (id) => { |
| | | return request(`/api/huacheng-sangeshenbian/banner/delete/${id}`, { |
| | | method: 'delete', |
| | | // params |
| | | }); |
| | | } |
| | | |
| | | // 添加 编辑 |
| | | export const add = async (data) => { |
| | | return request('/api/huacheng-sangeshenbian/banner/add', { |
| | | method: 'POST', |
| | | data, |
| | | }); |
| | | } |
| | | |
| | | // 添加 编辑 |
| | | export const Edit = async (data) => { |
| | | return request('/api/huacheng-sangeshenbian/banner/edit', { |
| | | method: 'POST', |
| | | data, |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
New file |
| | |
| | | import { sendRequest } from '@/utils/antdUtils'; |
| | | import { LoadingOutlined, PlusOutlined } from '@ant-design/icons'; |
| | | import { PageContainer, } from '@ant-design/pro-components'; |
| | | import { Button, Select, Row, Col, Input, Card, Space, Form, Upload, Spin, message, Cascader, InputNumber } from 'antd'; |
| | | import { useState, useEffect } from 'react'; |
| | | import { add, Edit, getDetail } from '../service'; |
| | | import { history, useLocation, useSearchParams } from 'umi'; |
| | | import { customRequest } from '@/utils/utils'; |
| | | const AddOrEditOrDetail = () => { |
| | | const [form] = Form.useForm(); |
| | | const [loading, setLoading] = useState(false); |
| | | const [searchParams, setSearchParams] = useSearchParams(); |
| | | |
| | | const [items, setItems] = useState([]); |
| | | const [adminLevel, setAdminLevel] = useState(1) |
| | | |
| | | const [fileList, setFileList] = useState([]) |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { span: 6 }, |
| | | wrapperCol: { span: 10 }, |
| | | } |
| | | const uploadButton = ( |
| | | <button |
| | | style={{ |
| | | border: 0, |
| | | background: 'none', |
| | | }} |
| | | type="button" |
| | | > |
| | | {loading ? <LoadingOutlined /> : <PlusOutlined />} |
| | | <div |
| | | style={{ |
| | | marginTop: 8, |
| | | }} |
| | | ></div> |
| | | </button> |
| | | ); |
| | | |
| | | const config = { |
| | | name: 'file', |
| | | action: 'https://huacheng.psciio.com/api/huacheng-communitybackstage/communitypartybuilding/uploadimage', |
| | | headers: { |
| | | Authorization: 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjE4OTI0MjE4MjgwODU4Mzc4MjYsInR5cGUiOjEsImV4cCI6MTc0MTY1OTg5MywiY3JlYXRlZCI6MTc0MDM2Mzg5MzE2MH0.o3Gc0g1LAo_kkL3X3QrC6qKwztxsp6psoTcpTreDzQUXGqPzUXw89fNSR5YKz8gzhtSuSKI2d6TJJYPX1IQCgw', |
| | | }, |
| | | }; |
| | | |
| | | useEffect(() => { |
| | | let adminInfo = JSON.parse(localStorage.getItem('userInfo')) |
| | | setAdminLevel(() => adminInfo.accountLevel)//角色权限1市级2区县3街道4社区5党员 |
| | | }, []) |
| | | // 上传前 |
| | | const beforeUpload = (file, type) => { |
| | | return new Promise(async (resolve, reject) => { |
| | | if (file.name.includes(',')) { |
| | | message.warning('上传图片名字不能包含英文逗号(,)'); |
| | | return Upload.LIST_IGNORE; |
| | | } |
| | | console.log('============================================') |
| | | setLoading(false) |
| | | |
| | | resolve(file); |
| | | }); |
| | | }; |
| | | const handleChange = ({ file: file, fileList: newFileList }, type) => { |
| | | console.log(file, 'newfilelist', newFileList, 'type', type) |
| | | if (file.status == 'error') { |
| | | setLoading(false) |
| | | // setFileList([]) |
| | | message.error('上传失败') |
| | | return |
| | | } |
| | | if (file.status == 'done') { |
| | | setLoading(false) |
| | | message.success('上传成功') |
| | | } |
| | | let list = newFileList.map((item) => { |
| | | if (item.status == 'done') { |
| | | if (!item.url) { |
| | | item.url = item.response.data; |
| | | } |
| | | } |
| | | return item.url |
| | | }); |
| | | console.log('newFileList', newFileList, 'list', list) |
| | | // if (type == 1) { |
| | | // setImageUrl1(newFileList) |
| | | // } else if (type == 2) { |
| | | // setImageUrl(newFileList) |
| | | // } |
| | | }; |
| | | |
| | | const submit = () => { |
| | | form.validateFields().then(async (values) => { |
| | | |
| | | }) |
| | | } |
| | | const checkIdCard = (rule, value) => { |
| | | const reg = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/; |
| | | if (!reg.test(value)) { |
| | | return Promise.reject('请输入正确的身份证号码'); |
| | | } |
| | | return Promise.resolve(); |
| | | }; |
| | | const checkPhone = (rule, value) => { |
| | | const reg = /^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/; |
| | | if (!reg.test(value)) { |
| | | return Promise.reject('请输入正确的手机号码'); |
| | | } |
| | | return Promise.resolve(); |
| | | }; |
| | | const checkPhoneUse = (e) => { |
| | | console.log('eeeeeeeeee', e.target.value) |
| | | } |
| | | |
| | | |
| | | |
| | | return ( |
| | | <PageContainer title={searchParams.get('detail') ? '党员详情' : searchParams.get('id') ? '编辑党员' : '添加党员'}> |
| | | <Spin spinning={loading}> |
| | | <Form scrollToFirstError layout="horizontal" {...formItemLayout} form={form}> |
| | | <Card style={{ background: '#fff', paddingTop: '15px' }}> |
| | | <Row> |
| | | <Col span={12}> |
| | | <Form.Item |
| | | name="name" |
| | | label='姓名' |
| | | rules={[{ required: true, message: '请输入党员姓名' }]} |
| | | > |
| | | <Input disabled={searchParams.get('detail')} placeholder='请输入'></Input> |
| | | </Form.Item> |
| | | <Form.Item |
| | | name="name" |
| | | label='联系电话' rules={[{ required: true, message: '请输入党员联系电话' }, { validator: checkPhone }]} |
| | | > |
| | | <Input disabled={searchParams.get('detail')} placeholder='请输入' maxLength={11} onBlur={checkPhoneUse} ></Input> |
| | | </Form.Item> |
| | | <Form.Item |
| | | name="idcard" |
| | | label='身份证号' rules={[{ required: true, message: '请输入党员身份证号' }, { validator: checkIdCard }]} |
| | | > |
| | | <Input disabled={searchParams.get('detail')} placeholder='请输入' maxLength={18}></Input> |
| | | </Form.Item> |
| | | |
| | | <Form.Item |
| | | name="name" |
| | | label='所在社区' |
| | | rules={[{ required: true, message: '请选择所在社区' }]} |
| | | > |
| | | <Cascader |
| | | disabled={searchParams.get('detail') || adminLevel == 4} |
| | | options={items} |
| | | fieldNames={{ value: 'key', label: 'name' }} |
| | | placeholder="请选择" |
| | | displayRender={(label) => label[label.length - 1]} |
| | | changeOnSelect={true} |
| | | /> |
| | | </Form.Item> |
| | | |
| | | <Form.Item |
| | | name="name" |
| | | label='服务对象' |
| | | // rules={[ { required: true,message: '请输入服务对象'}]} |
| | | > |
| | | <Input disabled={searchParams.get('detail')} placeholder='请输入'></Input> |
| | | </Form.Item> |
| | | <Form.Item |
| | | name="name" |
| | | label='所在党组织' |
| | | // rules={[ { required: true,message: '请输入所在党组织'}]} |
| | | > |
| | | <Input disabled={searchParams.get('detail')} placeholder='请输入'></Input> |
| | | </Form.Item> |
| | | |
| | | <Form.Item |
| | | name="image" |
| | | label="头像上传" |
| | | // extra={ |
| | | // <div> |
| | | // <div>推荐尺寸732px * 320px</div> |
| | | // </div> |
| | | // } |
| | | rules={[ |
| | | { |
| | | required: true, |
| | | message: '请上传头像', |
| | | }, |
| | | ]} |
| | | > |
| | | <Upload |
| | | {...config} |
| | | listType="picture-card" |
| | | maxCount={1} |
| | | beforeUpload={beforeUpload} |
| | | onChange={handleChange} |
| | | onRemove={() => { |
| | | setFileList([]) |
| | | form.setFieldsValue({ |
| | | image: '' |
| | | }) |
| | | }} |
| | | showUploadList={{ |
| | | showPreviewIcon: false, |
| | | }} |
| | | // customRequest={customRequest} |
| | | accept="image/png, image/jpeg, image/jpg" |
| | | fileList={fileList} |
| | | disabled={searchParams.get('detail')} |
| | | > |
| | | {fileList?.length == 1 || searchParams.get('detail') ? null : uploadButton} |
| | | </Upload> |
| | | </Form.Item> |
| | | <div style={{ display: 'flex', justifyContent: 'center' }}> |
| | | <Space size='large'> |
| | | <Button onClick={() => history.back()}>关闭</Button> |
| | | { |
| | | !searchParams.get('detail') && <Button type='primary' onClick={submit}>确认</Button> |
| | | } |
| | | </Space> |
| | | </div> |
| | | </Col> |
| | | </Row> |
| | | |
| | | </Card> |
| | | </Form> |
| | | </Spin> |
| | | </PageContainer > |
| | | ); |
| | | } |
| | | |
| | | export default AddOrEditOrDetail |
| | | |
New file |
| | |
| | | import { Form, Upload, Modal, Input, Button } from 'antd'; |
| | | import { UploadOutlined } from '@ant-design/icons'; |
| | | import React, { forwardRef, useImperativeHandle, useState } from 'react'; |
| | | import { useEffect } from 'react'; |
| | | import { downLoad } from '@/utils/utils'; |
| | | const formItemLayout = { |
| | | labelCol: { span: 4 }, |
| | | wrapperCol: { span: 18 }, |
| | | }; |
| | | |
| | | const { TextArea } = Input; |
| | | const ImportExport = ({ visible, onSave, onCancel }, ref) => { |
| | | const [form] = Form.useForm(); |
| | | const [status, setStatus] = useState(true); |
| | | const okHandle = () => { |
| | | onSave() |
| | | // form.validateFields().then((values) => { |
| | | // onSave(values.file.file); |
| | | // }); |
| | | }; |
| | | |
| | | const downLod = () => { |
| | | // downLoad('/tCheck/import-template', '检查项导入模版'); |
| | | }; |
| | | |
| | | const onChange = (e) => { |
| | | if (e.fileList && e.fileList.length > 0) { |
| | | setStatus(false); |
| | | } else { |
| | | setStatus(true); |
| | | } |
| | | }; |
| | | |
| | | useImperativeHandle(ref, () => { |
| | | return { |
| | | refreshData: (data) => {}, |
| | | clean: () => { |
| | | form.resetFields(); |
| | | }, |
| | | }; |
| | | }); |
| | | |
| | | return ( |
| | | <Modal |
| | | getContainer={false} |
| | | width="30%" |
| | | destroyOnClose |
| | | title={'导入党员信息'} |
| | | open={visible} |
| | | okText="立即导入" |
| | | onCancel={() => onCancel(false)} |
| | | onOk={okHandle} |
| | | > |
| | | <Form layout="horizontal" {...formItemLayout} form={form}> |
| | | <div style={{ width: '100%', textAlign: 'end', marginBottom: '32px' }}> |
| | | <a |
| | | onClick={() => { downLod();}} |
| | | > |
| | | 模版下载 |
| | | </a> |
| | | </div> |
| | | <Form.Item name="file" label="导入文件" rules={[{ required: true, message: '请上传文件' }]}> |
| | | <Upload |
| | | name="file" |
| | | maxCount="1" |
| | | listType="text" |
| | | accept=".xls,.xlsx,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" |
| | | onChange={(e) => { |
| | | onChange(e); |
| | | }} |
| | | showUploadList={true} |
| | | > |
| | | {status && <Button icon={<UploadOutlined />}>去选择</Button>} |
| | | </Upload> |
| | | </Form.Item> |
| | | </Form> |
| | | </Modal> |
| | | ); |
| | | }; |
| | | |
| | | export default forwardRef(ImportExport); |
New file |
| | |
| | | import { Form, Input, Modal, Select, Upload, Space, Button, message } from 'antd'; |
| | | import { PageContainer, ProTable } from '@ant-design/pro-components'; |
| | | import { forwardRef, useEffect, useImperativeHandle, useState,useRef } from 'react'; |
| | | |
| | | const AddEditView = ({ visible, onSave, onUpdate, onCancel, }, ref) => { |
| | | const actionRef = useRef(); |
| | | const [tableListData, setTableListData] = useState([]) |
| | | |
| | | const columns = [ |
| | | { |
| | | title: '姓名', |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title: '联系电话', |
| | | hideInSearch: true, |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title: '身份证号', |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title: '所在社区', |
| | | dataIndex: 'name', |
| | | }, |
| | | { |
| | | title: '服务对象', |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title: '所在党组织', |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title: '失败原因', |
| | | dataIndex: 'status', |
| | | }, |
| | | ] |
| | | |
| | | useImperativeHandle(ref, () => { |
| | | return { |
| | | refreshData: (data) => { |
| | | |
| | | |
| | | }, |
| | | clean: () => { |
| | | |
| | | }, |
| | | }; |
| | | }); |
| | | |
| | | |
| | | // 提交表单 |
| | | const submit = () => { |
| | | |
| | | } |
| | | |
| | | return ( |
| | | <Modal |
| | | getContainer={false} |
| | | width="65%" |
| | | destroyOnClose |
| | | title={'数据导入失败提示'} |
| | | open={visible} |
| | | onCancel={() => onCancel(false)} |
| | | footer={ |
| | | [ |
| | | <Button |
| | | key="submit" |
| | | type="primary" |
| | | onClick={() => onCancel(false)} |
| | | > |
| | | 确认 |
| | | </Button>, |
| | | ] |
| | | } |
| | | > |
| | | <div> |
| | | <div style={{width:'100%',textAlign:'center',marginBottom:'20px',fontWeight:'bold'}}>以下信息导入失败</div> |
| | | <ProTable |
| | | rowKey='id' |
| | | search={false} |
| | | actionRef={actionRef} |
| | | columns={columns} |
| | | dataSource={tableListData} |
| | | pagination={{ |
| | | showSizeChanger: true, |
| | | showQuickJumper: true, |
| | | defaultPageSize: 10, |
| | | }} |
| | | toolBarRender={false} |
| | | /> |
| | | |
| | | </div> |
| | | </Modal> |
| | | ); |
| | | }; |
| | | |
| | | export default forwardRef(AddEditView); |
New file |
| | |
| | | import { PageContainer, ProTable } from '@ant-design/pro-components'; |
| | | import { buildProTableDataSource, sendRequest, showDelConfirm } from '@/utils/antdUtils'; |
| | | import { Button, message, Space, Cascader } from 'antd'; |
| | | import { useRef, useState } from 'react'; |
| | | import { Access, history, useAccess } from 'umi'; |
| | | import AddAndEdit from './components/index'; |
| | | import ImportExcell from './components/export'; |
| | | import { getList, updateStatus, deleteBanner, add, Edit } from './service' |
| | | import { exportExcell } from '@/utils/utils' |
| | | const Banner = () => { |
| | | |
| | | const actionRef = useRef(); |
| | | const access = useAccess(); |
| | | const addViewRef = useRef(); |
| | | const [modalVisible, handleModalVisible] = useState(false); |
| | | const [items, setItems] = useState([]); |
| | | const [excelParams, setExcelParams] = useState({}); |
| | | |
| | | const [modalExport, handleModalExport] = useState(false); |
| | | |
| | | const columns = [ |
| | | { |
| | | title: '姓名', |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title: '性别', |
| | | hideInSearch: true, |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title: '所在社区', |
| | | dataIndex: 'name', |
| | | renderFormItem: () => { |
| | | return ( |
| | | <Cascader |
| | | options={items} |
| | | fieldNames={{ value: 'key', label: 'name' }} |
| | | placeholder="请选择" |
| | | displayRender={(label) => label[label.length - 1]} |
| | | changeOnSelect={true} |
| | | /> |
| | | ); |
| | | }, |
| | | }, |
| | | { |
| | | title: '服务对象', |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title: '所在党组织', |
| | | dataIndex: 'name' |
| | | }, |
| | | { |
| | | title: '状态', |
| | | dataIndex: 'status', |
| | | valueEnum: { |
| | | 0: { text: '全部' }, |
| | | 1: { text: '正常中' }, |
| | | 2: { text: '已冻结' }, |
| | | } |
| | | }, |
| | | { |
| | | title: '操作', |
| | | hideInSearch: true, |
| | | render: (text, record) => { |
| | | return ( |
| | | <Space> |
| | | {/* <Access accessible={access['/work_order_transaction_management/banner_management/edit']}> */} |
| | | <Button |
| | | type="link" |
| | | onClick={() => { |
| | | history.push(`/party/manage/add?type=edit&id=${record.id}`) |
| | | }} |
| | | > |
| | | 编辑 |
| | | </Button> |
| | | {/* </Access> */} |
| | | {/* <Access accessible={access['/work_order_transaction_management/banner_management/del']}> */} |
| | | <Button |
| | | type="link" |
| | | onClick={() => { |
| | | showDelConfirm(async () => { |
| | | // let status = await sendRequest(deleteBanner, record.id) |
| | | // if (status) { |
| | | // actionRef.current.reload(); |
| | | // } |
| | | }, '确认删除所选信息吗?'); |
| | | }} |
| | | > |
| | | 删除 |
| | | </Button> |
| | | {/* </Access> */} |
| | | {/* <Access accessible={access['/work_order_transaction_management/banner_management/del']}> */} |
| | | <Button |
| | | type="link" |
| | | onClick={() => { |
| | | history.push(`/party/manage/add?detail=true&id=${record.id}`) |
| | | }} |
| | | > |
| | | 查看详情 |
| | | </Button> |
| | | {/* </Access> */} |
| | | {/* <Access accessible={access['/work_order_transaction_management/banner_management/del']}> */} |
| | | <Button |
| | | type="link" |
| | | onClick={() => { |
| | | showDelConfirm(async () => { |
| | | // let status = await sendRequest(deleteBanner, record.id) |
| | | // if (status) { |
| | | // actionRef.current.reload(); |
| | | // } |
| | | }, '确认冻结该党员信息吗?'); |
| | | }} |
| | | > |
| | | 冻结 |
| | | </Button> |
| | | {/* </Access> */} |
| | | {/* <Access accessible={access['/work_order_transaction_management/banner_management/del']}> */} |
| | | <Button |
| | | type="link" |
| | | onClick={() => { |
| | | showDelConfirm(async () => { |
| | | // let status = await sendRequest(deleteBanner, record.id) |
| | | // if (status) { |
| | | // actionRef.current.reload(); |
| | | // } |
| | | }, '确认解冻该党员信息吗?'); |
| | | }} |
| | | > |
| | | 解冻 |
| | | </Button> |
| | | {/* </Access> */} |
| | | </Space > |
| | | ); |
| | | }, |
| | | }, |
| | | ] |
| | | |
| | | return <div> |
| | | <PageContainer title='党员管理' header={{ |
| | | breadcrumb: {}, |
| | | }}> |
| | | <ProTable |
| | | rowKey='id' |
| | | actionRef={actionRef} |
| | | columns={columns} |
| | | pagination={{ |
| | | showSizeChanger: true, |
| | | showQuickJumper: true, |
| | | defaultPageSize: 10, |
| | | }} |
| | | request={(params) => { |
| | | params.status = (params.status && params.status != 0) ? params.status : ''; |
| | | setExcelParams(() => params) |
| | | return buildProTableDataSource(getList, params) |
| | | }} |
| | | toolBarRender={(action, selectRows) => [ |
| | | <Space> |
| | | {/* <Access accessible={access['/work_order_transaction_management/banner_management/add']}> */} |
| | | <Button |
| | | type="primary" |
| | | onClick={() => { |
| | | history.push('/party/manage/add?type=add') |
| | | }} |
| | | > |
| | | 添加 |
| | | </Button> |
| | | {/* </Access> */} |
| | | {/* <Access accessible={access['/work_order_transaction_management/banner_management/add']}> */} |
| | | <Button |
| | | type="primary" |
| | | onClick={() => { |
| | | // exportExcell('党员列表', excelParams, '/promotion/mgt/coupon/receive-detail/export') |
| | | }} |
| | | > |
| | | 导出 |
| | | </Button> |
| | | {/* </Access> */} |
| | | {/* <Access accessible={access['/work_order_transaction_management/banner_management/add']}> */} |
| | | <Button |
| | | type="primary" |
| | | onClick={() => { |
| | | // history.push('/party/manage/add?type=add') |
| | | handleModalExport(true) |
| | | }} |
| | | > |
| | | 导入 |
| | | </Button> |
| | | {/* </Access> */} |
| | | </Space> |
| | | ]} |
| | | /> |
| | | <AddAndEdit |
| | | ref={addViewRef} |
| | | visible={modalVisible} |
| | | onCancel={() => handleModalVisible(false)} |
| | | onSave={async (fileds) => { |
| | | // const success = await sendRequest(add, fileds); |
| | | // if (success) { |
| | | handleModalVisible(false); |
| | | // actionRef.current.reload(); |
| | | // } |
| | | }} |
| | | onUpdate={async (fileds) => { |
| | | // const success = await sendRequest(Edit, fileds); |
| | | // if (success) { |
| | | handleModalVisible(false); |
| | | // actionRef.current.reload(); |
| | | // } |
| | | }} |
| | | /> |
| | | |
| | | <ImportExcell |
| | | visible={modalExport} |
| | | onSave={async (fileds) => { |
| | | console.log('上传文件数据', fileds); |
| | | handleModalExport(false); |
| | | handleModalVisible(true) |
| | | // const success = await sendRequest(enable, fileds); |
| | | // if (success) { |
| | | // handleModalExport(false); |
| | | |
| | | // // actionRef.current.reload(); |
| | | // // listCheck({ checkType: checktype, }).then(res => { |
| | | // // console.log('一键导入数据', res) |
| | | |
| | | // // }) |
| | | // } |
| | | }} |
| | | onCancel={() => handleModalExport(false)} |
| | | /> |
| | | </PageContainer> |
| | | </div>; |
| | | }; |
| | | |
| | | export default Banner; |
New file |
| | |
| | | import { request } from '@umijs/max'; |
| | | |
| | | // 列表 |
| | | export const getList = async (data) => { |
| | | return request(`/api/huacheng-sangeshenbian/banner/list`, { |
| | | method: 'GET', |
| | | params:data |
| | | }); |
| | | } |
| | | // 详情 |
| | | export const getDetail = async (id) => { |
| | | return request(`/api/huacheng-sangeshenbian/banner/getBannerInfo/${id}`, { |
| | | method: 'GET', |
| | | // data |
| | | }); |
| | | } |
| | | |
| | | |
| | | // 删除 |
| | | export const deleteBanner = async (id) => { |
| | | return request(`/api/huacheng-sangeshenbian/banner/delete/${id}`, { |
| | | method: 'delete', |
| | | // params |
| | | }); |
| | | } |
| | | |
| | | // 添加 编辑 |
| | | export const add = async (data) => { |
| | | return request('/api/huacheng-sangeshenbian/banner/add', { |
| | | method: 'POST', |
| | | data, |
| | | }); |
| | | } |
| | | |
| | | // 添加 编辑 |
| | | export const Edit = async (data) => { |
| | | return request('/api/huacheng-sangeshenbian/banner/edit', { |
| | | method: 'POST', |
| | | data, |
| | | }); |
| | | } |
| | | |
| | | |
| | | |