| @@ -230,4 +230,4 @@ export default [ | |||
| // } | |||
| // ] | |||
| // } | |||
| ] | |||
| ] | |||
| @@ -8,6 +8,6 @@ | |||
| </head> | |||
| <body> | |||
| <div id="root"></div> | |||
| <script src="/umi.8cdc18ca.js"></script> | |||
| <script src="/umi.847c9816.js"></script> | |||
| </body> | |||
| </html> | |||
| @@ -29,6 +29,7 @@ declare namespace CompanyType { | |||
| company_photos ?: Object[], | |||
| longitude?: Number, | |||
| latitude?: Number, | |||
| status?: Number, | |||
| // 其他参数 | |||
| location_arr ?: number[] | |||
| @@ -43,8 +44,8 @@ declare namespace CompanyType { | |||
| famous ?: Number, | |||
| member_type ?: Number, | |||
| member_status ?: Number, | |||
| start_date ?: Date, | |||
| end_date ?: Date, | |||
| start_date ?: Date | String, | |||
| end_date ?: Date | String, | |||
| sale ?: String, | |||
| // 其他参数 | |||
| @@ -1,59 +1,81 @@ | |||
| import { useState } from "react"; | |||
| import { useEffect, useState } from "react"; | |||
| import { request } from '@umijs/max'; | |||
| import { baseUrl } from '@/constants/index' | |||
| import { message } from 'antd'; | |||
| import { message, Space, Image } from 'antd'; | |||
| import { ProFormUploadButton } from '@ant-design/pro-components'; | |||
| import { Imageprefix } from '@/constants'; | |||
| type UploadModelProps = { | |||
| form_name: string; | |||
| uploadTxt: string; | |||
| image_type: number | 1; | |||
| image_length: number | 1; | |||
| onUploadComplete: (filename: string) => void; | |||
| multiple: boolean | false | |||
| multiple: boolean | false, | |||
| imageUrl?: String | undefined; | |||
| }; | |||
| const UploadModel: React.FC<UploadModelProps> = (props) => { | |||
| const { onUploadComplete, uploadTxt, image_type, form_name, image_length , multiple} = props; | |||
| const { onUploadComplete, uploadTxt, image_type, form_name, image_length, multiple, imageUrl } = props; | |||
| const handleUploadComplete = (filename: string) => { | |||
| if (onUploadComplete) { | |||
| if (filename) { | |||
| onUploadComplete(filename); | |||
| } | |||
| }; | |||
| const [image_url, setImageUrl] = useState<string>(imageUrl) | |||
| useEffect(() => { | |||
| setImageUrl(imageUrl) | |||
| }, [imageUrl]) | |||
| return ( | |||
| <> | |||
| <ProFormUploadButton | |||
| label={uploadTxt} | |||
| name={form_name} | |||
| icon={null} | |||
| title={uploadTxt} | |||
| fieldProps={{ | |||
| maxCount: image_length, | |||
| multiple: multiple, | |||
| fileList: [], | |||
| listType: 'picture-card', | |||
| showUploadList: false, | |||
| customRequest: (e) => { | |||
| let formdata = new FormData(); | |||
| formdata.append('image', e.file); | |||
| console.log(formdata) | |||
| request(baseUrl + '/common/image/upload?imgtype=' + image_type, { | |||
| method: 'post', | |||
| data: formdata, | |||
| Headers: { | |||
| Authorization: sessionStorage.getItem('token'), | |||
| 'X-Requested-With': null | |||
| } | |||
| }).then(res => { | |||
| handleUploadComplete(res.data.filename) | |||
| }).catch(err => { | |||
| console.log(err) | |||
| message.error('上传失败') | |||
| }) | |||
| } | |||
| }} | |||
| > | |||
| </ProFormUploadButton> | |||
| <Space> | |||
| <ProFormUploadButton | |||
| label={uploadTxt} | |||
| name={form_name} | |||
| icon={null} | |||
| title={uploadTxt} | |||
| fieldProps={{ | |||
| maxCount: image_length, | |||
| multiple: multiple, | |||
| fileList: [], | |||
| listType: 'picture-card', | |||
| showUploadList: false, | |||
| customRequest: (e) => { | |||
| let formdata = new FormData(); | |||
| formdata.append('image', e.file); | |||
| console.log(formdata) | |||
| request(baseUrl + '/common/image/upload?imgtype=' + image_type, { | |||
| method: 'post', | |||
| data: formdata, | |||
| Headers: { | |||
| Authorization: sessionStorage.getItem('token'), | |||
| 'X-Requested-With': null | |||
| } | |||
| }).then(res => { | |||
| setImageUrl(res.data.filename) | |||
| handleUploadComplete(res.data.filename) | |||
| }).catch(err => { | |||
| console.log(err) | |||
| message.error('上传失败') | |||
| }) | |||
| } | |||
| }} | |||
| > | |||
| </ProFormUploadButton> | |||
| { | |||
| image_url && <Image src={`${Imageprefix}${image_url}`} width={102} height={102} style={{ borderRadius: 8 }} /> | |||
| } | |||
| </Space> | |||
| </> | |||
| ) | |||
| } | |||
| @@ -36,27 +36,31 @@ const PagesMainActivityListTable: React.FC = ({ dispatch, openModel, getId }: an | |||
| }} | |||
| > | |||
| <ProTable | |||
| size='small' | |||
| scroll={{ y: 480, x: 'auto' }} | |||
| bordered={true} | |||
| actionRef={actionRef} | |||
| dataSource={list} | |||
| search={{ span: 8, labelWidth: 'auto' }} | |||
| rowSelection={{ | |||
| type: 'checkbox' | |||
| }} | |||
| columns={[{ | |||
| title: 'ID', | |||
| dataIndex: 'id', | |||
| width: 100, | |||
| width: 200, | |||
| search: false, | |||
| }, | |||
| { | |||
| title: '地址', | |||
| dataIndex: 'address', | |||
| width: 240, | |||
| width: 200, | |||
| search: false | |||
| }, | |||
| { | |||
| title: '地址分类', | |||
| dataIndex: 'cate', | |||
| valueType: 'select', | |||
| width: 100, | |||
| width: 200, | |||
| valueEnum: { | |||
| '菊城人才': { | |||
| text: '菊城人才', | |||
| @@ -79,21 +83,19 @@ const PagesMainActivityListTable: React.FC = ({ dispatch, openModel, getId }: an | |||
| title: '审核账号', | |||
| dataIndex: 'audit_mobile', | |||
| ellipsis: true, | |||
| width: 120, | |||
| width: 200, | |||
| search: false | |||
| }, | |||
| { | |||
| title: '审核人', | |||
| dataIndex: 'contact_person', | |||
| width: 120, | |||
| width: 200, | |||
| search: false | |||
| }, | |||
| { | |||
| title: '操作', | |||
| width: 100, | |||
| key: 'option', | |||
| valueType: 'option', | |||
| fixed: 'right', | |||
| render: (_, record, action) => [ | |||
| <Button key='1' type='link' onClick={() => { | |||
| setId(record.id) | |||
| @@ -6,6 +6,7 @@ import { | |||
| ProFormText, | |||
| ProFormSegmented, | |||
| ProFormDigit, | |||
| ProFormRadio, | |||
| ProForm | |||
| } from '@ant-design/pro-components'; | |||
| import { ConfigProvider, Flex, Space, Modal, message, Row, Col } from 'antd'; | |||
| @@ -98,7 +99,7 @@ const PagesMainAdvertisementListCreate: React.FC = ({ dispatch, dictModel, openM | |||
| }} | |||
| > | |||
| <Row gutter={[16, 16]}> | |||
| <Col span={24}> | |||
| <Col span={12}> | |||
| <ProFormText | |||
| label="广告位置,按照该格式:来源页面广告位名" | |||
| name="name" | |||
| @@ -106,12 +107,12 @@ const PagesMainAdvertisementListCreate: React.FC = ({ dispatch, dictModel, openM | |||
| rules={[{ required: true, message: '请输入广告位置,如:小程序首页轮播图;小程序首页企业LOGO图' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={24}> | |||
| <Col span={12}> | |||
| <ProFormText | |||
| label="广告位置代码,使用拼音缩写,不要超过十个字母,按照该格式:xcx(小程序)/gw(官网)-ym(页面)-ggwm(广告位名), 如:minisylbt(小程序首页轮播图)" | |||
| label="广告位置代码,使用拼音缩写,不要超过十个字母" | |||
| name="code" | |||
| placeholder="请输入广告位置代码,如:如:minisylbt(小程序首页轮播图)" | |||
| rules={[{ required: true, message: '请输入广告位置代码,如:如:minisylbt(小程序首页轮播图)' }]} | |||
| placeholder="请输入广告位置代码,使用拼音缩写,不要超过十个字母" | |||
| rules={[{ required: true, message: '请输入广告位置代码,使用拼音缩写,不要超过十个字母s' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={12}> | |||
| @@ -136,10 +137,9 @@ const PagesMainAdvertisementListCreate: React.FC = ({ dispatch, dictModel, openM | |||
| </Col> | |||
| <Col span={12}> | |||
| <ProFormDigit label="行间距" name="row_padding" min={1} rules={[{ required: true, message: '请输入行间距' }]} /> | |||
| </Col> | |||
| <Col span={12}> | |||
| <ProFormSegmented | |||
| <ProFormRadio.Group | |||
| name="random_show" | |||
| label="随机显示" | |||
| request={async () => [ | |||
| @@ -150,7 +150,7 @@ const PagesMainAdvertisementListCreate: React.FC = ({ dispatch, dictModel, openM | |||
| /> | |||
| </Col> | |||
| <Col span={12}> | |||
| <ProFormSegmented | |||
| <ProFormRadio.Group | |||
| name="disabled_status" | |||
| label="禁用状态" | |||
| request={async () => [ | |||
| @@ -4,8 +4,8 @@ import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
| import { | |||
| ProTable, TableDropdown | |||
| } from '@ant-design/pro-components'; | |||
| import { Button, Image, ConfigProvider, Select } from 'antd'; | |||
| import { GetAdvertareaList} from '@/apis/api'; | |||
| import { Button, Image, ConfigProvider, Space, Descriptions } from 'antd'; | |||
| import { GetAdvertareaList } from '@/apis/api'; | |||
| const PagesMainAdvertisementListTable: React.FC = ({ dispatch, openModel, getId }: any) => { | |||
| const actionRef = useRef<ActionType>(); | |||
| @@ -24,6 +24,24 @@ const PagesMainAdvertisementListTable: React.FC = ({ dispatch, openModel, getId | |||
| } | |||
| }, [openModel.openModal]) | |||
| const expandedRowRender = (record) => { | |||
| return ( | |||
| <> | |||
| <Space direction='vertical' style={{ width: '100%' }}> | |||
| <Descriptions title="基本信息" bordered column={3} contentStyle={{ fontWeight: 'bold' }} labelStyle={{ width: 180 }}> | |||
| <Descriptions.Item label="限制显示广告数">{record.ad_num}</Descriptions.Item> | |||
| <Descriptions.Item label="显示列数">{record.cols}</Descriptions.Item> | |||
| <Descriptions.Item label="广告显示宽度">{record.width}</Descriptions.Item> | |||
| <Descriptions.Item label="广告显示高度">{record.height}</Descriptions.Item> | |||
| <Descriptions.Item label="列间距">{record.col_padding}</Descriptions.Item> | |||
| <Descriptions.Item label="行间距">{record.row_padding}</Descriptions.Item> | |||
| </Descriptions> | |||
| </Space > | |||
| </> | |||
| ); | |||
| }; | |||
| return ( | |||
| <> | |||
| <ConfigProvider | |||
| @@ -35,69 +53,46 @@ const PagesMainAdvertisementListTable: React.FC = ({ dispatch, openModel, getId | |||
| }} | |||
| > | |||
| <ProTable | |||
| size='small' | |||
| scroll={{ y: 480, x: 'auto' }} | |||
| bordered={true} | |||
| scroll={{ x: 1300 }} | |||
| actionRef={actionRef} | |||
| dataSource={list} | |||
| columns={[ { | |||
| search={{ span: 8, labelWidth: 'auto' }} | |||
| rowSelection={{ | |||
| type: 'checkbox' | |||
| }} | |||
| expandable={{ | |||
| expandedRowRender | |||
| }} | |||
| columns={[{ | |||
| title: 'ID', | |||
| dataIndex: 'id', | |||
| width: 100, | |||
| search: false, | |||
| }, | |||
| { | |||
| title: '广告位置', | |||
| dataIndex: 'name', | |||
| width: 240 | |||
| }, | |||
| { | |||
| title: '广告位置代码', | |||
| dataIndex: 'code', | |||
| search: false | |||
| }, | |||
| { | |||
| title: '限制显示广告数', | |||
| dataIndex: 'ad_num', | |||
| search: false | |||
| }, | |||
| { | |||
| title: '显示列数', | |||
| dataIndex: 'cols', | |||
| search: false | |||
| },{ | |||
| title: '广告显示宽度', | |||
| dataIndex: 'width', | |||
| search: false | |||
| },{ | |||
| title: '广告显示高度', | |||
| dataIndex: 'height', | |||
| search: false | |||
| },{ | |||
| title: '列间距', | |||
| dataIndex: 'col_padding', | |||
| search: false | |||
| },{ | |||
| title: '行间距', | |||
| dataIndex: 'row_padding', | |||
| search: false | |||
| }, | |||
| { | |||
| title: '操作', | |||
| width: 300, | |||
| key: 'option', | |||
| valueType: 'option', | |||
| fixed: 'right', | |||
| render: (_, record, action) => [ | |||
| <Button key='1' type='link' onClick={() => { | |||
| setId(record.id) | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}>编辑</Button>, | |||
| <Button key='2' type='link' onClick={() => { | |||
| { | |||
| title: '广告位置', | |||
| dataIndex: 'name', | |||
| }, | |||
| { | |||
| title: '广告位置代码', | |||
| dataIndex: 'code', | |||
| }}>删除</Button> | |||
| ], | |||
| }, | |||
| search: false | |||
| }, | |||
| { | |||
| title: '操作', | |||
| key: 'option', | |||
| valueType: 'option', | |||
| render: (_, record, action) => [ | |||
| <Button key='1' type='link' onClick={() => { | |||
| setId(record.id) | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}>编辑</Button>, | |||
| <Button key='2' type='link' onClick={() => { | |||
| }}>删除</Button> | |||
| ], | |||
| }, | |||
| ]} | |||
| rowKey="id" | |||
| pagination={{ | |||
| @@ -122,7 +117,7 @@ const PagesMainAdvertisementListTable: React.FC = ({ dispatch, openModel, getId | |||
| sort: 'id', | |||
| sortby: 'desc', | |||
| keyword: params.name, | |||
| }).then(res => { | |||
| setList(res.data.advertareas) | |||
| setTotal(res.data.total) | |||
| @@ -130,6 +125,10 @@ const PagesMainAdvertisementListTable: React.FC = ({ dispatch, openModel, getId | |||
| } | |||
| headerTitle="广告位置列表" | |||
| toolBarRender={() => [ | |||
| <Button type="primary" onClick={() => { | |||
| }}> | |||
| 批量删除 | |||
| </Button>, | |||
| <Button type="primary" onClick={() => { | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}> | |||
| @@ -7,7 +7,7 @@ import { | |||
| ProFormSegmented, | |||
| ProFormSelect, | |||
| ProForm, | |||
| FormControlRender, | |||
| ProFormRadio, | |||
| ProFormDatePicker, | |||
| ProFormDigit | |||
| } from '@ant-design/pro-components'; | |||
| @@ -41,7 +41,7 @@ const PagesMainAdvertisementPutinCreate: React.FC = ({ dispatch, dictModel, open | |||
| theme={{ | |||
| token: { | |||
| colorPrimary: '#4FBE70', | |||
| } , components: { | |||
| }, components: { | |||
| Segmented: { | |||
| itemSelectedBg: '#19be6e', | |||
| itemSelectedColor: '#ffffff' | |||
| @@ -111,97 +111,110 @@ const PagesMainAdvertisementPutinCreate: React.FC = ({ dispatch, dictModel, open | |||
| } | |||
| }} | |||
| > | |||
| <ProFormText | |||
| label="广告标题" | |||
| name="title" | |||
| placeholder="请输入广告标题" | |||
| rules={[{ required: true, message: '请输入广告标题' }]} | |||
| /> | |||
| <ProFormSelect | |||
| showSearch | |||
| name="area_id" | |||
| label="投放位置" | |||
| placeholder="请选择投放位置" | |||
| fieldProps={{ | |||
| fieldNames: selectfieldNames | |||
| }} | |||
| request={(keyword) => | |||
| GetAdvertareaList({ page: 1, pagesize: 100, keyword: keyword.keyWords }).then(res => { | |||
| return res.data.advertareas; | |||
| }) | |||
| } | |||
| rules={[{ required: true, message: '请选择投放位置' }]} | |||
| /> | |||
| <Row gutter={[16, 16]}> | |||
| { | |||
| detail ? | |||
| <Col span={24} style={{ display: 'flex' }}> | |||
| <UploadModel multiple={false} form_name="image_url" image_length={1} uploadTxt="上传封面图" image_type={3} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| {uploadedFilephotoName ? <Image src={`${Imageprefix}${uploadedFilephotoName}`} style={{ marginLeft: '16px', marginTop: '32px', width: '100px', height: '100px' }}></Image> : <Image src={`${Imageprefix}${detail?.image_url}`} style={{ marginLeft: '16px', marginTop: '32px', width: '100px', height: '100px' }}></Image>} | |||
| </Col> : <> | |||
| <Col span={24} style={{ display: 'flex' }}> | |||
| <UploadModel multiple={false} form_name="image_url" image_length={1} uploadTxt="上传封面图" image_type={3} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| {uploadedFilephotoName ? <Col span={8}> <Image src={`${Imageprefix}${uploadedFilephotoName}`} style={{ marginTop: '32px', width: '100px', height: '100px' }}></Image> </Col> : ''} | |||
| </Col> | |||
| </> | |||
| } | |||
| <Col span={24}> | |||
| <UploadModel multiple={false} form_name="image_url" image_length={1} uploadTxt="上传封面图" image_type={3} imageUrl={detail?.photo} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormText | |||
| label="广告标题" | |||
| name="title" | |||
| placeholder="请输入广告标题" | |||
| rules={[{ required: true, message: '请输入广告标题' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormSelect | |||
| showSearch | |||
| name="area_id" | |||
| label="投放位置" | |||
| placeholder="请选择投放位置" | |||
| fieldProps={{ | |||
| fieldNames: selectfieldNames | |||
| }} | |||
| request={(keyword) => | |||
| GetAdvertareaList({ page: 1, pagesize: 100, keyword: keyword.keyWords, sortby: 'desc', }).then(res => { | |||
| return res.data.advertareas; | |||
| }) | |||
| } | |||
| rules={[{ required: true, message: '请选择投放位置' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormText | |||
| label="说明" | |||
| name="ad_description" | |||
| placeholder="请输入说明" | |||
| rules={[{ required: true, message: '请输入说明' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={24}> | |||
| <ProFormText | |||
| label="跳转网址,小程序内部路径,以/pages/开头,如/pages/index/index, 外部网址需以http://或https://开头, 没有链接就填 //" | |||
| name="target_url" | |||
| placeholder="请输入跳转网址" | |||
| rules={[{ required: true, message: '请输入跳转网址' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormDigit | |||
| label="此广告展示顺序" | |||
| placeholder="请输入此广告展示顺序,请输入优先级的数字" | |||
| name="show_order" | |||
| min={1} | |||
| rules={[{ required: true, message: '请输入此广告展示顺序,请输入优先级的数字' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormDatePicker | |||
| width={'lg'} | |||
| name="valid_date" | |||
| label="有效时间" | |||
| fieldProps={{ | |||
| format: 'YYYY-MM-DD' | |||
| }} | |||
| rules={[{ required: true, message: '请选择有效时间' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormRadio.Group | |||
| name="hide_ad" | |||
| label="是否隐藏广告" | |||
| request={async () => [ | |||
| { label: '是', value: 1 }, | |||
| { label: '否', value: 2 } | |||
| ]} | |||
| rules={[{ required: true, message: '请选择是否隐藏广告' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormSelect | |||
| showSearch | |||
| name="company_id" | |||
| label="选择企业,没有企业选人才市场" | |||
| placeholder="请选择企业" | |||
| fieldProps={{ | |||
| fieldNames: selectfieldCompanyNames | |||
| }} | |||
| rules={[{ required: true, message: '请选择企业' }]} | |||
| request={(keyword) => | |||
| getCompanyList({ page: 1, pagesize: 100, keyword: keyword.keyWords }).then(res => { | |||
| return res.data.list; | |||
| }) | |||
| } | |||
| /> | |||
| </Col> | |||
| </Row> | |||
| <ProFormText | |||
| label="说明" | |||
| name="ad_description" | |||
| placeholder="请输入说明" | |||
| rules={[{ required: true, message: '请输入说明' }]} | |||
| /> | |||
| <ProFormText | |||
| label="跳转网址,小程序内部路径,以/pages/开头,如/pages/index/index, 外部网址需以http://或https://开头, 没有链接就填 //" | |||
| name="target_url" | |||
| placeholder="请输入跳转网址" | |||
| rules={[{ required: true, message: '请输入跳转网址' }]} | |||
| /> | |||
| <ProFormDigit | |||
| label="此广告展示顺序" | |||
| placeholder="请输入此广告展示顺序,请输入优先级的数字" | |||
| name="show_order" | |||
| min={1} | |||
| rules={[{ required: true, message: '请输入此广告展示顺序,请输入优先级的数字' }]} | |||
| /> | |||
| <ProFormDatePicker | |||
| name="valid_date" | |||
| label="有效时间" | |||
| fieldProps={{ | |||
| format: 'YYYY-MM-DD' | |||
| }} | |||
| rules={[{ required: true, message: '请选择有效时间' }]} | |||
| /> | |||
| <ProFormSegmented | |||
| name="hide_ad" | |||
| label="是否隐藏广告" | |||
| request={async () => [ | |||
| { label: '是', value: 1 }, | |||
| { label: '否', value: 2 } | |||
| ]} | |||
| rules={[{ required: true, message: '请选择是否隐藏广告' }]} | |||
| /> | |||
| <ProFormSelect | |||
| showSearch | |||
| name="company_id" | |||
| label="选择企业,没有企业选人才市场" | |||
| placeholder="请选择企业" | |||
| fieldProps={{ | |||
| fieldNames: selectfieldCompanyNames | |||
| }} | |||
| rules={[{ required: true, message: '请选择企业' }]} | |||
| request={(keyword) => | |||
| getCompanyList({ page: 1, pagesize: 100, keyword: keyword.keyWords }).then(res => { | |||
| return res.data.list; | |||
| }) | |||
| } | |||
| /> | |||
| </ProForm> | |||
| </Modal> | |||
| </ConfigProvider> | |||
| </ConfigProvider > | |||
| </> | |||
| ); | |||
| }; | |||
| @@ -4,8 +4,8 @@ import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
| import { | |||
| ProTable, ProFormSelect | |||
| } from '@ant-design/pro-components'; | |||
| import { Button, Popconfirm, ConfigProvider, Tag,message } from 'antd'; | |||
| import { GetAdvertscheduleList, getCompanyList, GetAdvertareaList, PostAdvertscheduleDel} from '@/apis/api'; | |||
| import { Button, Popconfirm, ConfigProvider, Tag, message } from 'antd'; | |||
| import { GetAdvertscheduleList, getCompanyList, GetAdvertareaList, PostAdvertscheduleDel } from '@/apis/api'; | |||
| const selectfieldNames = { label: 'full_name', value: 'id' }; | |||
| const selectfieldAreaNames = { label: 'name', value: 'id' }; | |||
| @@ -37,135 +37,137 @@ const PagesMainAdvertisementPutinTable: React.FC = ({ dispatch, openModel, getId | |||
| }} | |||
| > | |||
| <ProTable | |||
| size='small' | |||
| scroll={{ y: 480, x: 'auto' }} | |||
| bordered={true} | |||
| scroll={{ x: 1300 }} | |||
| actionRef={actionRef} | |||
| dataSource={list} | |||
| columns={[ { | |||
| search={{ span: 8, labelWidth: 'auto' }} | |||
| rowSelection={{ | |||
| type: 'checkbox' | |||
| }} | |||
| columns={[{ | |||
| title: 'ID', | |||
| dataIndex: 'id', | |||
| width: 100, | |||
| width: 200, | |||
| search: false, | |||
| }, | |||
| { | |||
| title: '投放标题', | |||
| dataIndex: 'title', | |||
| width: 240 | |||
| }, | |||
| { | |||
| title: '投放位置', | |||
| dataIndex: 'area_name', | |||
| search: false | |||
| }, | |||
| { | |||
| title: '投放位置', | |||
| dataIndex: 'area_id', | |||
| hidden: true, | |||
| valueType: 'select', | |||
| renderFormItem: () => { | |||
| return ( | |||
| <ProFormSelect | |||
| width='lg' | |||
| fieldProps={{ | |||
| fieldNames: selectfieldAreaNames, | |||
| }} | |||
| request={async (keyword) => | |||
| GetAdvertareaList({ page: 1, pagesize: 100, keyword: keyword.keyWords }).then(res => { | |||
| return res.data.advertareas; | |||
| }) | |||
| } | |||
| placeholder="请选择投放位置" | |||
| /> | |||
| ) | |||
| } | |||
| }, | |||
| { | |||
| title: '投放描述', | |||
| dataIndex: 'ad_description', | |||
| search: false | |||
| }, | |||
| { | |||
| title: '企业', | |||
| dataIndex: 'company_name', | |||
| search: false | |||
| }, | |||
| { | |||
| title: '企业', | |||
| dataIndex: 'company_id', | |||
| hidden: true, | |||
| valueType: 'select', | |||
| renderFormItem: () => { | |||
| return ( | |||
| <ProFormSelect | |||
| showSearch | |||
| fieldProps={{ | |||
| fieldNames: selectfieldNames, | |||
| }} | |||
| request={async (keyword) => | |||
| getCompanyList({ page: 1, pagesize: 100, keyword: keyword.keyWords }).then(res => { | |||
| return res.data.list; | |||
| }) | |||
| } | |||
| placeholder="请选择企业" | |||
| /> | |||
| ) | |||
| } | |||
| }, | |||
| { | |||
| title: '投放状态', | |||
| dataIndex: 'hide_ad', | |||
| render: (_, record) => (<> | |||
| { | |||
| <> | |||
| {record.hide_ad === 0 && <Tag>未设置</Tag> } | |||
| {record.hide_ad === 1 && <Tag>隐藏</Tag>} | |||
| {record.hide_ad === 2 && <Tag color="green">显示</Tag> } | |||
| </> | |||
| } | |||
| { | |||
| title: '投放标题', | |||
| dataIndex: 'title', | |||
| width: 200 | |||
| }, | |||
| { | |||
| title: '投放位置', | |||
| dataIndex: 'area_name', | |||
| width: 200, | |||
| </>), | |||
| valueType: 'select', | |||
| valueEnum: { | |||
| 0: { text: '全部' }, | |||
| 1: { | |||
| text: '隐藏广告', | |||
| }, | |||
| 2: { | |||
| text: '显示广告', | |||
| } | |||
| }, | |||
| }, | |||
| { | |||
| title: '操作', | |||
| width: 300, | |||
| key: 'option', | |||
| valueType: 'option', | |||
| fixed: 'right', | |||
| render: (_, record, action) => [ | |||
| <Button key='1' type='link' onClick={() => { | |||
| setId(record.id) | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}>编辑</Button>, | |||
| <Popconfirm | |||
| title="是否删除" | |||
| onConfirm={(e) => { | |||
| PostAdvertscheduleDel({ id: record.id }).then(res => { | |||
| message.success('删除成功') | |||
| actionRef.current.reload(); | |||
| search: false | |||
| }, | |||
| { | |||
| title: '投放位置', | |||
| dataIndex: 'area_id', | |||
| hidden: true, | |||
| valueType: 'select', | |||
| renderFormItem: () => { | |||
| return ( | |||
| <ProFormSelect | |||
| width='lg' | |||
| fieldProps={{ | |||
| fieldNames: selectfieldAreaNames, | |||
| }} | |||
| request={async (keyword) => | |||
| GetAdvertareaList({ page: 1, pagesize: 100, keyword: keyword.keyWords }).then(res => { | |||
| return res.data.advertareas; | |||
| }) | |||
| } | |||
| placeholder="请选择投放位置" | |||
| /> | |||
| ) | |||
| } | |||
| }, | |||
| { | |||
| title: '投放描述', | |||
| dataIndex: 'ad_description', | |||
| width: 200, | |||
| search: false | |||
| }, | |||
| { | |||
| title: '企业', | |||
| dataIndex: 'company_name', | |||
| width: 200, | |||
| search: false | |||
| }, | |||
| { | |||
| title: '企业', | |||
| dataIndex: 'company_id', | |||
| hidden: true, | |||
| valueType: 'select', | |||
| renderFormItem: () => { | |||
| return ( | |||
| <ProFormSelect | |||
| showSearch | |||
| fieldProps={{ | |||
| fieldNames: selectfieldNames, | |||
| }} | |||
| okText="删除" | |||
| cancelText="取消" | |||
| > | |||
| <a | |||
| key="delete" | |||
| > | |||
| 删除 | |||
| </a> | |||
| </Popconfirm> | |||
| ], | |||
| request={async (keyword) => | |||
| getCompanyList({ page: 1, pagesize: 100, keyword: keyword.keyWords }).then(res => { | |||
| return res.data.list; | |||
| }) | |||
| } | |||
| placeholder="请选择企业" | |||
| /> | |||
| ) | |||
| } | |||
| }, | |||
| { | |||
| title: '投放状态', | |||
| dataIndex: 'hide_ad', | |||
| width: 200, | |||
| valueType: 'select', | |||
| valueEnum: { | |||
| 0: { text: '全部' , | |||
| status: 'Errorr'}, | |||
| 1: { | |||
| text: '隐藏', | |||
| status: 'Errorr' | |||
| }, | |||
| 2: { | |||
| text: '显示', | |||
| status: 'Processing' | |||
| } | |||
| }, | |||
| }, | |||
| { | |||
| title: '操作', | |||
| key: 'option', | |||
| valueType: 'option', | |||
| render: (_, record, action) => [ | |||
| <Button key='1' type='link' onClick={() => { | |||
| setId(record.id) | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}>编辑</Button>, | |||
| <Popconfirm | |||
| title="是否删除" | |||
| onConfirm={(e) => { | |||
| PostAdvertscheduleDel({ id: record.id }).then(res => { | |||
| message.success('删除成功') | |||
| actionRef.current.reload(); | |||
| }) | |||
| }} | |||
| okText="删除" | |||
| cancelText="取消" | |||
| > | |||
| <a | |||
| key="delete" | |||
| > | |||
| 删除 | |||
| </a> | |||
| </Popconfirm> | |||
| ], | |||
| }, | |||
| ]} | |||
| rowKey="id" | |||
| pagination={{ | |||
| @@ -190,7 +192,7 @@ const PagesMainAdvertisementPutinTable: React.FC = ({ dispatch, openModel, getId | |||
| sort: 'id', | |||
| sortby: 'desc', | |||
| keyword: params.title, | |||
| hide_ad: params.hide_ad ? params.hide_ad : 0, | |||
| hide_ad: params.hide_ad ? params.hide_ad : 0, | |||
| company_id: params.company_id, | |||
| area_id: params.area_id | |||
| }).then(res => { | |||
| @@ -38,7 +38,7 @@ const PagesMainCompanyDepartmentCreate: React.FC = ({ dispatch, dictModel, openM | |||
| maskClosable={false} | |||
| footer={null} | |||
| destroyOnClose | |||
| width={1000} | |||
| width={600} | |||
| onCancel={() => { | |||
| dispatch({ type: 'openModel/getOpenModal', payload: false }) | |||
| }} | |||
| @@ -85,6 +85,7 @@ const PagesMainCompanyDepartmentCreate: React.FC = ({ dispatch, dictModel, openM | |||
| } | |||
| }} | |||
| > | |||
| <ProFormSelect | |||
| showSearch | |||
| name="company_id" | |||
| @@ -5,7 +5,7 @@ import type { ActionType } from '@ant-design/pro-components'; | |||
| import { | |||
| ProTable, ProFormSelect | |||
| } from '@ant-design/pro-components'; | |||
| import { Button, ConfigProvider, } from 'antd'; | |||
| import { Button, ConfigProvider, Modal } from 'antd'; | |||
| import { GetCompanyDepartmentList, getCompanyList, GetCompanyInfo } from '@/apis/api'; | |||
| const selectfieldNames = { label: 'full_name', value: 'id' }; | |||
| const PagesMainCompanyDepartmentTable: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
| @@ -38,24 +38,30 @@ const PagesMainCompanyDepartmentTable: React.FC = ({ dispatch, getId, openModel | |||
| > | |||
| <ProTable | |||
| scroll={{ x: 1300 }} | |||
| size='small' | |||
| scroll={{ y: 480, x: 'auto' }} | |||
| bordered={true} | |||
| actionRef={actionRef} | |||
| dataSource={list} | |||
| search={{ span: 8, labelWidth: 'auto' }} | |||
| rowSelection={{ | |||
| type: 'checkbox' | |||
| }} | |||
| columns={[ | |||
| { | |||
| title: '部门名称', | |||
| dataIndex: 'name', | |||
| width: 300 | |||
| width: 200 | |||
| }, | |||
| { | |||
| title: '所属企业', | |||
| dataIndex: 'company_name', | |||
| width: 300, | |||
| width: 200 | |||
| }, | |||
| { | |||
| title: '所属企业', | |||
| dataIndex: 'company_id', | |||
| width: 300, | |||
| width: 200, | |||
| hidden: true, | |||
| valueType: 'select', | |||
| renderFormItem: () => { | |||
| @@ -85,38 +91,44 @@ const PagesMainCompanyDepartmentTable: React.FC = ({ dispatch, getId, openModel | |||
| { | |||
| title: '联系人', | |||
| search: false, | |||
| width: 200, | |||
| dataIndex: 'contact' | |||
| }, | |||
| { | |||
| title: '联系电话', | |||
| search: false, | |||
| width: 200, | |||
| dataIndex: 'phone' | |||
| }, | |||
| { | |||
| title: '手机', | |||
| search: false, | |||
| width: 200, | |||
| dataIndex: 'mobile' | |||
| }, | |||
| { | |||
| title: '邮箱', | |||
| search: false, | |||
| width: 200, | |||
| dataIndex: 'email' | |||
| }, | |||
| { | |||
| title: '操作', | |||
| width: 300, | |||
| key: 'option', | |||
| valueType: 'option', | |||
| fixed: 'right', | |||
| render: (_, record, action) => [ | |||
| <Button key='1' type='link' onClick={() => { | |||
| setId(record.id) | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}>编辑</Button> | |||
| }}>编辑</Button>, | |||
| <Button key='2' type='link' danger onClick={() => { | |||
| setId(record.id) | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}>删除</Button> | |||
| ], | |||
| }, | |||
| ]} | |||
| @@ -154,15 +166,31 @@ const PagesMainCompanyDepartmentTable: React.FC = ({ dispatch, getId, openModel | |||
| sessionStorage.removeItem('company_info') | |||
| } | |||
| setCompanyId(0) | |||
| actionRef.current.reload(); | |||
| actionRef.current?.reload(); | |||
| }} | |||
| headerTitle="部门列表" | |||
| toolBarRender={() => [ | |||
| <Button type="primary" onClick={() => { | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}> | |||
| 添加部门 | |||
| </Button> | |||
| toolBarRender={() => [<Button type="primary" onClick={() => { | |||
| Modal.confirm({ | |||
| title: '批量删除', | |||
| content: '确定要删除所选的数据吗,参数:id', | |||
| onOk() { | |||
| }, | |||
| onCancel() { | |||
| console.log('Cancel'); | |||
| }, | |||
| okText: '确定', | |||
| cancelText: '取消', | |||
| centered: true | |||
| }); | |||
| }}> | |||
| 批量删除 | |||
| </Button>, | |||
| <Button type="primary" onClick={() => { | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}> | |||
| 添加部门 | |||
| </Button>, | |||
| ]} | |||
| /> | |||
| @@ -1,29 +1,22 @@ | |||
| import { useRef, useState, useEffect } from 'react'; | |||
| import { connect } from '@umijs/max'; | |||
| import type { ProFormInstance } from '@ant-design/pro-components'; | |||
| import { | |||
| StepsForm, ProCard, | |||
| ProFormDatePicker, | |||
| ProFormDependency, | |||
| ProFormText, | |||
| ProFormCascader, | |||
| ProFormRadio, | |||
| FormControlRender, | |||
| ProFormSelect | |||
| } from '@ant-design/pro-components'; | |||
| import { Row, Col, Image, ConfigProvider, Modal, Switch, Form, message, Button } from 'antd'; | |||
| import { addCompany, PostCompanyEdit, GetCompanyInfo } from '@/apis/api'; | |||
| import { Imageprefix } from '@/constants'; | |||
| import { StepsForm, ProCard, ProFormDatePicker, ProFormDependency, ProFormText, ProFormCascader, ProFormRadio, FormControlRender, ProFormSelect } from '@ant-design/pro-components'; | |||
| import { Row, Col, Image, ConfigProvider, Modal, Space, Form, message, Button } from 'antd'; | |||
| import { selectfieldNames, cascaderfieldNames, Imageprefix } from '@/constants' | |||
| import { findAncestors } from '@/utils/dataHelper' | |||
| import { disAfterData } from '@/utils/format' | |||
| import MapComponent from '@/components/Common/map'; | |||
| import RichComponent from '@/components/Common/rich'; | |||
| import UploadModel from '@/components/Common/upload'; | |||
| const selectfieldNames = { label: 'name', value: 'id', children: 'children' }; | |||
| const cascaderfieldNames = { label: 'name', value: 'id', children: 'children' }; | |||
| import { addCompany, PostCompanyEdit, GetCompanyInfo } from '@/apis/api'; | |||
| const PagesMainCompanyListCreate: React.FC = ({ dispatch, dictModel, openModel, id }: any) => { | |||
| interface PagesMainCompanyListCreateProps { | |||
| id: any | |||
| } | |||
| const PagesMainCompanyListCreate: React.FC<PagesMainCompanyListCreateProps> = ({ dispatch, dictModel, openModel, id }: any) => { | |||
| const formRef = useRef<ProFormInstance>(); | |||
| const formMapRef = useRef< | |||
| React.MutableRefObject<ProFormInstance<any> | undefined>[] | |||
| @@ -41,13 +34,13 @@ const PagesMainCompanyListCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| }; | |||
| const [uploadedFilelicenseName, setUploadedFilelicenseName] = useState<string>(''); | |||
| const handleFileUploadedlicense = (filename: string) => { | |||
| const handleFileUploadedlicense = (filename: string) => { | |||
| setUploadedFilelicenseName(filename); | |||
| }; | |||
| const [uploadedFilephotosName, setUploadedFilephotosName] = useState<object[]>([]); | |||
| const handleFileUploadedphotos = (filename: string) => { | |||
| const handleFileUploadedphotos = (filename: string) => { | |||
| setUploadedFilephotosName([...uploadedFilephotosName, { photo: filename }]); | |||
| }; | |||
| @@ -103,7 +96,6 @@ const PagesMainCompanyListCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| formInstanceRef?.current?.setFieldsValue(res.data); | |||
| }); | |||
| setDetail(res.data) | |||
| }); | |||
| } else { | |||
| setDetail(null) | |||
| @@ -141,7 +133,7 @@ const PagesMainCompanyListCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| message.success('提交成功') | |||
| dispatch({ type: 'openModel/getOpenModal', payload: false }) | |||
| } else { | |||
| let res = await addCompany(values) | |||
| message.success('提交成功') | |||
| dispatch({ type: 'openModel/getOpenModal', payload: false }) | |||
| @@ -422,93 +414,58 @@ const PagesMainCompanyListCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| }} | |||
| > | |||
| <Row gutter={[16, 16]}> | |||
| { | |||
| detail ? | |||
| <Col span={6}> | |||
| <UploadModel multiple={false} form_name="photo" image_length={1} uploadTxt="上传企业照片" image_type={3} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| </Col> : <> | |||
| <Col span={6}> | |||
| <UploadModel multiple={false} form_name="photo" image_length={1} uploadTxt="上传企业照片" image_type={3} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| </Col> | |||
| </> | |||
| } | |||
| <Col span={8}> | |||
| <ProFormRadio.Group | |||
| name="photo_status" | |||
| label="企业照片审核状态" | |||
| radioType="button" | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { | |||
| label: '待审', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '通过', | |||
| value: 2, | |||
| }, | |||
| { | |||
| label: '不通过', | |||
| value: 3, | |||
| } | |||
| ]} | |||
| /> | |||
| <Col span={12}> | |||
| <Space direction='vertical'> | |||
| <UploadModel multiple={false} form_name="photo" image_length={1} uploadTxt="上传企业照片" image_type={3} imageUrl={detail?.photo} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| <ProFormRadio.Group | |||
| name="photo_status" | |||
| label="企业照片审核状态" | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { | |||
| label: '待审', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '通过', | |||
| value: 2, | |||
| }, | |||
| { | |||
| label: '不通过', | |||
| value: 3, | |||
| } | |||
| ]} | |||
| /> | |||
| </Space> | |||
| </Col> | |||
| { | |||
| detail ? | |||
| <Col span={8}> | |||
| {uploadedFilephotoName ? <Image src={`${Imageprefix}${uploadedFilephotoName}`} style={{ marginTop: '32px', width: '100px', height: '100px' }}></Image> : <Image src={`${Imageprefix}${detail?.photo}`} style={{ marginTop: '32px', width: '100px', height: '100px' }}></Image>} | |||
| </Col> : <> | |||
| {uploadedFilephotoName ? <Col span={8}> <Image src={`${Imageprefix}${uploadedFilephotoName}`} style={{ marginTop: '32px', width: '100px', height: '100px' }}></Image> </Col> : ''} | |||
| </> | |||
| } | |||
| </Row> | |||
| <Row gutter={[16, 16]}> | |||
| { | |||
| detail ? | |||
| <Col span={6}> | |||
| <UploadModel multiple={false} form_name="photo" image_length={1} uploadTxt="上传营业执照" image_type={4} onUploadComplete={handleFileUploadedlicense}></UploadModel> | |||
| </Col> : <Col span={6}> | |||
| <UploadModel multiple={false} form_name="license_path" image_length={1} uploadTxt="上传营业执照" image_type={4} onUploadComplete={handleFileUploadedlicense}></UploadModel> | |||
| </Col> | |||
| } | |||
| <Col span={8}> | |||
| <ProFormRadio.Group | |||
| name="license_status" | |||
| label="营业执照审核状态" | |||
| radioType="button" | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { | |||
| label: '待审', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '通过', | |||
| value: 2, | |||
| }, | |||
| { | |||
| label: '不通过', | |||
| value: 3, | |||
| } | |||
| ]} | |||
| /> | |||
| <Col span={12}> | |||
| <Space direction='vertical'> | |||
| <UploadModel multiple={false} form_name="license_path" image_length={1} uploadTxt="上传营业执照" imageUrl={detail?.license_path} image_type={4} onUploadComplete={handleFileUploadedlicense}></UploadModel> | |||
| <ProFormRadio.Group | |||
| name="license_status" | |||
| label="营业执照审核状态" | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { | |||
| label: '待审', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '通过', | |||
| value: 2, | |||
| }, | |||
| { | |||
| label: '不通过', | |||
| value: 3, | |||
| } | |||
| ]} | |||
| /> | |||
| </Space> | |||
| </Col> | |||
| { | |||
| detail ? | |||
| <Col span={8}> | |||
| {uploadedFilelicenseName ? <Image src={`${Imageprefix}${uploadedFilelicenseName}`} style={{ marginTop: '32px', width: '100px', height: '100px' }}></Image> : <Image src={`${Imageprefix}${detail?.license_path}`} style={{ marginTop: '32px', width: '100px', height: '100px' }}></Image>} | |||
| </Col> : <> | |||
| {uploadedFilelicenseName ? <Col span={8}> <Image src={`${Imageprefix}${uploadedFilelicenseName}`} style={{ marginTop: '32px', width: '100px', height: '100px' }}></Image> </Col> : ''} | |||
| </> | |||
| } | |||
| </Row> | |||
| <Row gutter={[16, 16]}> | |||
| { | |||
| detail ? | |||
| <Col span={24} style={{ display: 'flex' }}> | |||
| @@ -1,13 +1,16 @@ | |||
| import { useRef, useState, useEffect } from 'react'; | |||
| import { connect, history } from '@umijs/max'; | |||
| import { connect, history, Link } from '@umijs/max'; | |||
| import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
| import { | |||
| ProTable, TableDropdown, PageContainer | |||
| ProTable, TableDropdown, ProForm | |||
| } from '@ant-design/pro-components'; | |||
| import { Button, Image, ConfigProvider, Select, message, DatePicker } from 'antd'; | |||
| import { getCompanyList, GetCompanyInfo, updateCompany, PostCompanyExport, getRoleGetpermissionids } from '@/apis/api'; | |||
| import { Button, Image, ConfigProvider, Select, message, Descriptions, Space, Radio, Modal, Row, Col, Badge } from 'antd'; | |||
| import { getCompanyList, GetCompanyInfo, updateCompany, PostCompanyExport, PostCompanyEdit } from '@/apis/api'; | |||
| import { Imageprefix } from '@/constants'; | |||
| import { findId } from '@/utils/dataHelper'; | |||
| import { Header } from 'antd/es/layout/layout'; | |||
| import UploadModel from '@/components/Common/upload'; | |||
| const PagesMainCompanyListTable: React.FC = ({ dispatch, openModel, getId }: any) => { | |||
| @@ -16,6 +19,8 @@ const PagesMainCompanyListTable: React.FC = ({ dispatch, openModel, getId }: any | |||
| const [total, setTotal] = useState<number>(0) | |||
| const [page, setPage] = useState<number>(1) | |||
| const [pageSize, setPageSize] = useState<number>(10) | |||
| const [expandedRowKeys, setExpandedRowKeys] = useState<string[]>([]) | |||
| const setId = (id: number) => { | |||
| getId(id) | |||
| @@ -24,15 +29,157 @@ const PagesMainCompanyListTable: React.FC = ({ dispatch, openModel, getId }: any | |||
| const [addButton, setAddButton] = useState<boolean>(true) | |||
| const [editButton, setEditButton] = useState<boolean>(true) | |||
| useEffect(() => { | |||
| if (!openModel.openModal) { | |||
| actionRef.current.reload(); | |||
| actionRef.current?.reload(); | |||
| } | |||
| }, [openModel.openModal]) | |||
| const [uploadedFilephotoName, setUploadedFilephotoName] = useState<string>(''); | |||
| const uploadedFilephotoNameRef = useRef<string>(''); | |||
| const handleFileUploadedphoto = (filename: string) => { | |||
| setUploadedFilephotoName(filename); | |||
| }; | |||
| useEffect(() => { | |||
| uploadedFilephotoNameRef.current = uploadedFilephotoName; | |||
| }, [uploadedFilephotoName]) | |||
| const [uploadedFilelicenseName, setUploadedFilelicenseName] = useState<string>(''); | |||
| const uploadedFilelicenseNameRef = useRef<string>(''); | |||
| const handleFileUploadedlicense = (filename: string) => { | |||
| setUploadedFilelicenseName(filename); | |||
| }; | |||
| useEffect(() => { | |||
| uploadedFilelicenseNameRef.current = uploadedFilelicenseName; | |||
| }, [uploadedFilelicenseName]) | |||
| const expandedRowRender = (record) => { | |||
| return ( | |||
| <> | |||
| <Space direction='vertical' style={{ width: '100%' }}> | |||
| <Descriptions title="基本信息" bordered column={3} contentStyle={{ fontWeight: 'bold' }} labelStyle={{ width: 180 }}> | |||
| <Descriptions.Item label="成立日期">{record.establishment_date}</Descriptions.Item> | |||
| <Descriptions.Item label="来源">{record.origin_text}</Descriptions.Item> | |||
| <Descriptions.Item label="登录次数">{record.login_count}</Descriptions.Item> | |||
| <Descriptions.Item label="点击次数">{record.click_count}</Descriptions.Item> | |||
| <Descriptions.Item label="企业照片"> | |||
| <Space align='center'> | |||
| <Image src={`${Imageprefix}${record.photo}`} width={60} height={60} /> | |||
| <Button size='small' type='primary' onClick={() => { | |||
| Modal.confirm({ | |||
| title: '更换企业照片', | |||
| content: (<> | |||
| <ProForm submitter={{ render: false }}> | |||
| <UploadModel multiple={false} form_name="photo" image_length={1} uploadTxt="更换企业照片" image_type={3} imageUrl={record.photo} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| </ProForm> | |||
| </>), | |||
| async onOk() { | |||
| let info = await GetCompanyInfo({ id: record.id }); | |||
| let res = await updateCompany({ ...info.data, photo: uploadedFilephotoNameRef.current }); | |||
| setUploadedFilephotoName(''); | |||
| actionRef.current?.reload(); | |||
| }, | |||
| onCancel() { | |||
| console.log('Cancel'); | |||
| }, | |||
| okText: '保存', | |||
| cancelText: '取消', | |||
| centered: true, | |||
| }); | |||
| }}>更换企业照片</Button> | |||
| </Space> | |||
| </Descriptions.Item> | |||
| <Descriptions.Item label="照片审核"> | |||
| <Radio.Group value={record.photo_status} size='small' onChange={async (e) => { | |||
| let info = await GetCompanyInfo({ id: record.id }); | |||
| let res = await updateCompany({ ...info.data, photo_status: e.target.value }); | |||
| actionRef.current?.reload(); | |||
| }}> | |||
| <Radio value={1}>待审</Radio> | |||
| <Radio value={2}>通过</Radio> | |||
| <Radio value={3}>不通过</Radio> | |||
| </Radio.Group> | |||
| </Descriptions.Item> | |||
| <Descriptions.Item label="登录账号">{record.login_name}</Descriptions.Item> | |||
| <Descriptions.Item label="营业执照"> | |||
| <Space align='center'> | |||
| <Image src={`${Imageprefix}${record.license_path}`} width={60} height={60} /> | |||
| <Button size='small' type='primary' onClick={() => { | |||
| Modal.confirm({ | |||
| title: '更换营业执照', | |||
| content: (<> | |||
| <ProForm submitter={{ render: false }}> | |||
| <UploadModel multiple={false} form_name="license_path" image_length={1} uploadTxt="更换营业执照" image_type={3} imageUrl={record.license_path} onUploadComplete={handleFileUploadedlicense}></UploadModel> | |||
| </ProForm> | |||
| </>), | |||
| async onOk() { | |||
| let info = await GetCompanyInfo({ id: record.id }); | |||
| let res = await updateCompany({ ...info.data, license_path: uploadedFilelicenseNameRef.current }); | |||
| setUploadedFilelicenseName(''); | |||
| actionRef.current?.reload(); | |||
| }, | |||
| onCancel() { | |||
| console.log('Cancel'); | |||
| }, | |||
| okText: '保存', | |||
| cancelText: '取消', | |||
| centered: true, | |||
| }); | |||
| }}>更换营业执照</Button> | |||
| </Space> | |||
| </Descriptions.Item> | |||
| <Descriptions.Item label="营业执照审核"> | |||
| <Radio.Group value={record.photo_status} size='small' onChange={async (e) => { | |||
| let info = await GetCompanyInfo({ id: record.id }); | |||
| let res = await updateCompany({ ...info.data, license_status: e.target.value }); | |||
| actionRef.current?.reload(); | |||
| }}> | |||
| <Radio value={1}>待审</Radio> | |||
| <Radio value={2}>通过</Radio> | |||
| <Radio value={3}>不通过</Radio> | |||
| </Radio.Group> | |||
| </Descriptions.Item> | |||
| </Descriptions> | |||
| <Descriptions title="会员信息" bordered column={3} contentStyle={{ fontWeight: 'bold' }} labelStyle={{ width: 180 }}> | |||
| <Descriptions.Item label="会员类型"> | |||
| { | |||
| record.member_type_text && <Button type="primary" size='small' onClick={() => { | |||
| sessionStorage.setItem('vip_company_info', JSON.stringify(record)) | |||
| history.push({ | |||
| pathname: '/company/vip' | |||
| }) | |||
| }}> | |||
| {record.member_type_text} | |||
| </Button> | |||
| } | |||
| </Descriptions.Item> | |||
| <Descriptions.Item label="开始时间"> | |||
| {record.start_date} | |||
| </Descriptions.Item> | |||
| <Descriptions.Item label="到期时间"> | |||
| {record.end_date} | |||
| </Descriptions.Item> | |||
| <Descriptions.Item label="剩余点数"> | |||
| {record.code} | |||
| </Descriptions.Item> | |||
| <Descriptions.Item label="会员状态"> | |||
| { | |||
| record.member_status === 2 ? <Badge status="processing" text={record.member_status_text} /> : <Badge status="error" text={record.member_status_text} /> | |||
| } | |||
| </Descriptions.Item> | |||
| </Descriptions> | |||
| </Space > | |||
| </> | |||
| ); | |||
| }; | |||
| return ( | |||
| <> | |||
| <ConfigProvider | |||
| @@ -40,98 +187,97 @@ const PagesMainCompanyListTable: React.FC = ({ dispatch, openModel, getId }: any | |||
| token: { | |||
| colorPrimary: '#4FBE70', | |||
| colorLink: '#4FBE70', | |||
| }, | |||
| components: { | |||
| Descriptions: { | |||
| labelBg: '#ffffff', | |||
| contentColor: '#000' | |||
| }, | |||
| } | |||
| }} | |||
| > | |||
| <ProTable | |||
| size='small' | |||
| scroll={{ y: 480, x: 'auto' }} | |||
| bordered={true} | |||
| scroll={{ x: 1300 }} | |||
| actionRef={actionRef} | |||
| dataSource={list} | |||
| search={{ span: 8, labelWidth: 'auto' }} | |||
| rowSelection={{ | |||
| type: 'checkbox' | |||
| }} | |||
| expandable={{ | |||
| expandedRowRender | |||
| }} | |||
| columns={[ | |||
| { | |||
| title: '筛选日期', | |||
| dataIndex: 'date_range', | |||
| hidden: true, | |||
| width: 120, | |||
| valueType: 'dateRange', | |||
| width: 200 | |||
| }, | |||
| { | |||
| title: 'ID', | |||
| dataIndex: 'id', | |||
| width: 100, | |||
| fixed: 'left', | |||
| width: 200 | |||
| }, | |||
| { | |||
| title: '企业名称', | |||
| dataIndex: 'full_name', | |||
| width: 240, | |||
| width: 200 | |||
| }, | |||
| { | |||
| title: '来源', | |||
| dataIndex: 'origin_text', | |||
| search: false, | |||
| width: 100, | |||
| title: '社会统一信用代码', | |||
| dataIndex: 'registration_number', | |||
| width: 200, | |||
| search: false | |||
| }, | |||
| { | |||
| title: '登录次数', | |||
| dataIndex: 'login_count', | |||
| search: false, | |||
| width: 100 | |||
| title: '性质', | |||
| dataIndex: 'nature_text', | |||
| width: 200, | |||
| search: false | |||
| }, | |||
| { | |||
| title: '点击次数', | |||
| dataIndex: 'click_count', | |||
| search: false, | |||
| width: 100 | |||
| title: '规模', | |||
| dataIndex: 'scale_text', | |||
| width: 200, | |||
| search: false | |||
| }, | |||
| { | |||
| title: '会员类型', | |||
| dataIndex: 'member_type', | |||
| width: 100, | |||
| hidden: true, | |||
| title: '账号状态', | |||
| dataIndex: 'status', | |||
| width: 200, | |||
| render: (_, record) => (<> | |||
| <Radio.Group size='small' value={record.status} onChange={async (e) => { | |||
| actionRef.current?.reload(); | |||
| }}> | |||
| <Radio value={1}>开通</Radio> | |||
| <Radio value={2}>关闭</Radio> | |||
| </Radio.Group> | |||
| </>), | |||
| valueType: 'select', | |||
| valueEnum: { | |||
| 0: { text: '全部' }, | |||
| 1: { | |||
| text: '试用申请中', | |||
| text: '开通', | |||
| status: 'Processing' | |||
| }, | |||
| 2: { | |||
| text: '试用正式', | |||
| }, | |||
| 3: { | |||
| text: '普通申请中', | |||
| }, | |||
| 4: { | |||
| text: '普通正式', | |||
| }, | |||
| 5: { | |||
| text: 'VIP申请中', | |||
| }, | |||
| 6: { | |||
| text: 'VIP正式', | |||
| text: '关闭', | |||
| status: 'Error' | |||
| }, | |||
| }, | |||
| }, | |||
| { | |||
| title: '会员类型', | |||
| dataIndex: 'member_type_text', | |||
| dataIndex: 'member_type', | |||
| width: 100, | |||
| search: false, | |||
| render: (_, record) => (<> | |||
| { | |||
| record.member_type_text && <Button type="primary" size='small' onClick={() => { | |||
| sessionStorage.setItem('vip_company_info', JSON.stringify(record)) | |||
| history.push({ | |||
| pathname: '/company/vip' | |||
| }) | |||
| }}> | |||
| {record.member_type_text} | |||
| </Button> | |||
| } | |||
| </>), | |||
| hidden: true, | |||
| valueType: 'select', | |||
| valueEnum: { | |||
| 0: { text: '全部' }, | |||
| @@ -155,176 +301,10 @@ const PagesMainCompanyListTable: React.FC = ({ dispatch, openModel, getId }: any | |||
| }, | |||
| }, | |||
| }, | |||
| { | |||
| title: '开始时间', | |||
| dataIndex: 'start_date', | |||
| width: 140 | |||
| }, | |||
| { | |||
| title: '到期时间', | |||
| dataIndex: 'end_date', | |||
| search: false, | |||
| width: 140 | |||
| }, { | |||
| title: '剩余点数', | |||
| dataIndex: 'code', | |||
| search: false, | |||
| width: 100 | |||
| }, | |||
| { | |||
| title: '会员状态', | |||
| dataIndex: 'member_status', | |||
| width: 100, | |||
| hidden: true, | |||
| valueType: 'select', | |||
| valueEnum: { | |||
| 0: { text: '全部' }, | |||
| 1: { | |||
| text: '待审', | |||
| }, | |||
| 2: { | |||
| text: '正常', | |||
| }, | |||
| 3: { | |||
| text: '到期', | |||
| }, | |||
| 4: { | |||
| text: '推荐', | |||
| } | |||
| }, | |||
| }, | |||
| { | |||
| title: '状态', | |||
| dataIndex: 'status', | |||
| hidden: true, | |||
| valueType: 'select', | |||
| valueEnum: { | |||
| 0: { text: '全部' }, | |||
| 1: { | |||
| text: '开通', | |||
| }, | |||
| 2: { | |||
| text: '关闭', | |||
| }, | |||
| }, | |||
| }, | |||
| { | |||
| title: '会员状态', | |||
| dataIndex: 'member_status_text', | |||
| width: 120, | |||
| search: false, | |||
| valueType: 'select', | |||
| valueEnum: { | |||
| 0: { text: '全部' }, | |||
| 1: { | |||
| text: '待审', | |||
| }, | |||
| 2: { | |||
| text: '正常', | |||
| }, | |||
| 3: { | |||
| text: '到期', | |||
| }, | |||
| 4: { | |||
| text: '推荐', | |||
| } | |||
| }, | |||
| }, | |||
| { | |||
| title: '企业照片', | |||
| dataIndex: 'photo', | |||
| search: false, | |||
| width: 100, | |||
| render: (_, record) => (<> | |||
| <Image src={`${Imageprefix + record.photo}`} width={40} height={40} /> | |||
| </> | |||
| ) | |||
| }, { | |||
| title: '照片审核', | |||
| dataIndex: 'photo_status_text', | |||
| search: false, | |||
| width: 120, | |||
| render: (_, record) => (<> | |||
| <Select | |||
| size="small" | |||
| style={{ width: 100 }} | |||
| value={record.photo_status_text} | |||
| options={[ | |||
| { | |||
| label: '待审', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '通过', | |||
| value: 2, | |||
| }, | |||
| { | |||
| label: '不通过', | |||
| value: 3, | |||
| }, | |||
| ]} | |||
| onChange={async (value) => { | |||
| let info = await GetCompanyInfo({ id: record.id }); | |||
| let res = await updateCompany({ ...info.data, photo_status: value }); | |||
| actionRef.current.reload(); | |||
| }} | |||
| ></Select> | |||
| </>) | |||
| }, | |||
| { | |||
| title: '营业执照', | |||
| dataIndex: 'license_path', | |||
| search: false, | |||
| width: 120, | |||
| render: (_, record) => (<> | |||
| <Image src={`${Imageprefix}${record.license_path}`} width={40} height={40} /> | |||
| </> | |||
| ) | |||
| }, | |||
| { | |||
| title: '营业执照审核', | |||
| dataIndex: 'license_status_text', | |||
| search: false, | |||
| width: 120, | |||
| render: (_, record) => (<> | |||
| <Select | |||
| size="small" | |||
| style={{ width: 100 }} | |||
| value={record.license_status_text} | |||
| options={[ | |||
| { | |||
| label: '待审', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '通过', | |||
| value: 2, | |||
| }, | |||
| { | |||
| label: '不通过', | |||
| value: 3, | |||
| }, | |||
| ]} | |||
| onChange={async (value) => { | |||
| let info = await GetCompanyInfo({ id: record.id }); | |||
| let res = await updateCompany({ ...info.data, license_status: value }); | |||
| actionRef.current.reload(); | |||
| }} | |||
| ></Select> | |||
| </>) | |||
| }, | |||
| { | |||
| title: '登录账号', | |||
| dataIndex: 'login_name', | |||
| width: 200 | |||
| }, | |||
| { | |||
| title: '操作', | |||
| width: 300, | |||
| key: 'option', | |||
| valueType: 'option', | |||
| fixed: 'right', | |||
| render: (_, record, action) => [ | |||
| <> | |||
| { | |||
| @@ -341,32 +321,22 @@ const PagesMainCompanyListTable: React.FC = ({ dispatch, openModel, getId }: any | |||
| pathname: '/company/department' | |||
| }) | |||
| }) | |||
| }}>查看部门</Button>, | |||
| <TableDropdown | |||
| key="actionGroup" | |||
| menus={[ | |||
| { | |||
| name: '查看职位', | |||
| key: '3', | |||
| onClick: () => { | |||
| GetCompanyInfo({ id: record.id }).then(res => { | |||
| sessionStorage.setItem('post_company_info', JSON.stringify(res.data)) | |||
| history.push({ | |||
| pathname: '/company/post' | |||
| }) | |||
| }) | |||
| }, | |||
| }, | |||
| { | |||
| name: '子账号解绑', | |||
| key: '4', | |||
| onClick: () => { | |||
| setId(record.id) | |||
| dispatch({ type: 'openModel/getOpenBindModal', payload: true }) | |||
| }, | |||
| }, | |||
| ]} | |||
| />, | |||
| }}>企业部门</Button>, | |||
| <Button key='3' type='link' onClick={() => { | |||
| GetCompanyInfo({ id: record.id }).then(res => { | |||
| sessionStorage.setItem('post_company_info', JSON.stringify(res.data)) | |||
| history.push({ | |||
| pathname: '/company/post' | |||
| }) | |||
| }) | |||
| }}>企业职位</Button>, | |||
| <Link to={`/company/vip?full_name=${record.full_name}`}>会员信息</Link>, | |||
| <Button key='5' type='link' onClick={() => { | |||
| setId(record.id) | |||
| dispatch({ type: 'openModel/getOpenBindModal', payload: true }) | |||
| }}>子账号解绑</Button>, | |||
| ], | |||
| }, | |||
| ]} | |||
| @@ -407,6 +377,55 @@ const PagesMainCompanyListTable: React.FC = ({ dispatch, openModel, getId }: any | |||
| } | |||
| headerTitle="企业列表" | |||
| toolBarRender={() => [ | |||
| <Button type="primary" onClick={() => { | |||
| Modal.confirm({ | |||
| title: '请选择对批量数据进行何种操作', | |||
| content: (<> | |||
| <div>参数: id, status</div> | |||
| <Radio.Group size='small' onChange={async (e) => { | |||
| actionRef.current?.reload(); | |||
| }}> | |||
| <Row gutter={[20, 20]} style={{ padding: 20 }}> | |||
| <Col span={12}> | |||
| <Radio value={1}>开通账号</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>禁用1天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>禁用3天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>禁用7天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>禁用15天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>禁用30天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>永久禁用</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={2}>关闭账号</Radio> | |||
| </Col> | |||
| </Row> | |||
| </Radio.Group> | |||
| </>), | |||
| onOk() { | |||
| }, | |||
| onCancel() { | |||
| console.log('Cancel'); | |||
| }, | |||
| okText: '确定', | |||
| cancelText: '取消', | |||
| centered: true | |||
| }); | |||
| }}> | |||
| 批量管理账号 | |||
| </Button>, | |||
| <Button type="primary" onClick={() => { | |||
| message.info('数据导出需要时间,请耐心等待') | |||
| PostCompanyExport().then(res => { | |||
| @@ -15,7 +15,7 @@ import { | |||
| ProFormTreeSelect, | |||
| ProFormDigitRange | |||
| } from '@ant-design/pro-components'; | |||
| import { Row, Col, Image, ConfigProvider, Modal, Switch, Form, message, } from 'antd'; | |||
| import { Row, Col, Image, ConfigProvider, Modal, Space, Form, message, } from 'antd'; | |||
| import { getCompanyList, GetCompanyDepartmentList, PostCompanyJobAdd, PostCompanyJobEdit, PostCompanyJobInfo, GetCompanyInfo, GetCompanyDepartmentInfo } from '@/apis/api'; | |||
| import { Imageprefix } from '@/constants'; | |||
| import { verifyPhone } from '@/utils/VerifyHelper'; | |||
| @@ -95,7 +95,7 @@ const PagesMainCompanyListCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| afterOpenChange={async (open) => { | |||
| if (open && id) { | |||
| let res = await PostCompanyJobInfo({ id: id }) | |||
| let res1 = await GetCompanyInfo({ id: res.data.company_id }) | |||
| let res1 = await GetCompanyInfo({ id: res.data.company_id }) | |||
| sessionStorage.setItem('post_company_info', JSON.stringify(res1.data)) | |||
| formMapRef?.current?.forEach((formInstanceRef) => { | |||
| res.data.age_arr = [res.data.age_min, res.data.age_max]; | |||
| @@ -207,16 +207,16 @@ const PagesMainCompanyListCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| > | |||
| <Row gutter={[16, 16]}> | |||
| <Col span={24}> | |||
| <ProFormSegmented | |||
| <ProFormRadio.Group | |||
| name="urgent" | |||
| label="是否紧急" | |||
| request={async () => [ | |||
| options={[ | |||
| { label: '是', value: 1 }, | |||
| { label: '否', value: 2 } | |||
| ]} | |||
| /> | |||
| </Col> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormSelect | |||
| showSearch | |||
| @@ -402,7 +402,7 @@ const PagesMainCompanyListCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| }} | |||
| > | |||
| <Row gutter={[16, 16]}> | |||
| <Col span={24}> | |||
| <Col span={12}> | |||
| <Form.Item | |||
| name='gangweizhize' | |||
| label="岗位职责" | |||
| @@ -429,7 +429,7 @@ const PagesMainCompanyListCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| </FormControlRender> | |||
| </Form.Item> | |||
| </Col> | |||
| <Col span={24}> | |||
| <Col span={12}> | |||
| <Form.Item | |||
| name='renzhiyaoqiu' | |||
| label="任职要求" | |||
| @@ -457,17 +457,17 @@ const PagesMainCompanyListCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| </Form.Item> | |||
| </Col> | |||
| <Col span={5}> | |||
| <ProFormSegmented | |||
| <ProFormRadio.Group | |||
| name="fulltime" | |||
| label="是否全职" | |||
| request={async () => [ | |||
| options={[ | |||
| { label: '是', value: 1 }, | |||
| { label: '否', value: 2 } | |||
| ]} | |||
| /> | |||
| </Col> | |||
| <Col span={5}> | |||
| <ProFormSegmented | |||
| <ProFormRadio.Group | |||
| name="parttime" | |||
| label="是否兼职" | |||
| request={async () => [ | |||
| @@ -477,7 +477,7 @@ const PagesMainCompanyListCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| /> | |||
| </Col> | |||
| <Col span={5}> | |||
| <ProFormSegmented | |||
| <ProFormRadio.Group | |||
| name="casual" | |||
| label="是否临时" | |||
| request={async () => [ | |||
| @@ -487,7 +487,7 @@ const PagesMainCompanyListCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| /> | |||
| </Col> | |||
| <Col span={5}> | |||
| <ProFormSegmented | |||
| <ProFormRadio.Group | |||
| name="practical" | |||
| label="是否实习" | |||
| request={async () => [ | |||
| @@ -497,7 +497,7 @@ const PagesMainCompanyListCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| /> | |||
| </Col> | |||
| <Col span={4}> | |||
| <ProFormSegmented | |||
| <ProFormRadio.Group | |||
| name="campus" | |||
| label="校园招聘" | |||
| request={async () => [ | |||
| @@ -659,10 +659,7 @@ const PagesMainCompanyListCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| <ProFormRadio.Group | |||
| name="degree_better" | |||
| label="是否是最高学历" | |||
| radioType="button" | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { | |||
| label: '是', | |||
| @@ -725,10 +722,7 @@ const PagesMainCompanyListCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| <ProFormRadio.Group | |||
| name="sex" | |||
| label="性别要求" | |||
| radioType="button" | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { | |||
| label: '男', | |||
| @@ -762,10 +756,6 @@ const PagesMainCompanyListCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| <ProFormRadio.Group | |||
| name="marital_status" | |||
| label="婚姻状况" | |||
| radioType="button" | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { | |||
| label: '已婚', | |||
| @@ -845,7 +835,7 @@ const PagesMainCompanyListCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| }} | |||
| > | |||
| <Row gutter={[16, 16]}> | |||
| <Col span={24}> | |||
| <Col span={12}> | |||
| <ProFormText | |||
| label="联系人" | |||
| name="contact" | |||
| @@ -853,7 +843,7 @@ const PagesMainCompanyListCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| rules={[{ required: true, message: '请输入联系人' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={24}> | |||
| <Col span={12}> | |||
| <ProFormText | |||
| label="担任职位" | |||
| name="possession" | |||
| @@ -861,124 +851,120 @@ const PagesMainCompanyListCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| /> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormText | |||
| label="联系电话" | |||
| name="phone" | |||
| placeholder="请输入联系电话" | |||
| rules={[{ required: true, message: '请输入联系电话' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={16}> | |||
| <ProFormRadio.Group | |||
| name="phone_public" | |||
| label="是否公开联系电话" | |||
| radioType="button" | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { | |||
| label: '是', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '否', | |||
| value: 2, | |||
| } | |||
| ]} | |||
| /> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormText | |||
| label="手机" | |||
| name="mobile" | |||
| placeholder="请输入手机" | |||
| rules={[{ required: true, message: '请输入手机' }]} | |||
| /> | |||
| <Col span={12}> | |||
| <Space> | |||
| <ProFormText | |||
| width={'md'} | |||
| label="联系电话" | |||
| name="phone" | |||
| placeholder="请输入联系电话" | |||
| rules={[{ required: true, message: '请输入联系电话' }]} | |||
| /> | |||
| <ProFormRadio.Group | |||
| name="phone_public" | |||
| label="是否公开联系电话" | |||
| options={[ | |||
| { | |||
| label: '是', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '否', | |||
| value: 2, | |||
| } | |||
| ]} | |||
| /> | |||
| </Space> | |||
| </Col> | |||
| <Col span={16}> | |||
| <ProFormRadio.Group | |||
| name="mobile_public" | |||
| label="是否公开手机" | |||
| radioType="button" | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { | |||
| label: '是', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '否', | |||
| value: 2, | |||
| } | |||
| ]} | |||
| <Col span={12}> | |||
| <Space > | |||
| <ProFormText | |||
| width={'md'} | |||
| label="手机" | |||
| name="mobile" | |||
| placeholder="请输入手机" | |||
| rules={[{ required: true, message: '请输入手机' }]} | |||
| /> | |||
| <ProFormRadio.Group | |||
| name="mobile_public" | |||
| label="是否公开手机" | |||
| options={[ | |||
| { | |||
| label: '是', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '否', | |||
| value: 2, | |||
| } | |||
| ]} | |||
| /> | |||
| </Space> | |||
| /> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormText | |||
| label="邮箱" | |||
| name="email" | |||
| placeholder="请输入邮箱" | |||
| /> | |||
| <Col span={12}> | |||
| <Space > | |||
| <ProFormText | |||
| width={'md'} | |||
| label="邮箱" | |||
| name="email" | |||
| placeholder="请输入邮箱" | |||
| /> | |||
| <ProFormRadio.Group | |||
| name="email_public" | |||
| label="是否公开邮箱" | |||
| options={[ | |||
| { | |||
| label: '是', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '否', | |||
| value: 2, | |||
| } | |||
| ]} | |||
| /> | |||
| </Space> | |||
| </Col> | |||
| <Col span={16}> | |||
| <ProFormRadio.Group | |||
| name="email_public" | |||
| label="是否公开邮箱" | |||
| radioType="button" | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { | |||
| label: '是', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '否', | |||
| value: 2, | |||
| } | |||
| ]} | |||
| /> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormText | |||
| label="传真" | |||
| name="fax" | |||
| placeholder="请输入传真" | |||
| <Col span={12}> | |||
| <Space> | |||
| <ProFormText | |||
| width={'md'} | |||
| label="传真" | |||
| name="fax" | |||
| placeholder="请输入传真" | |||
| /> | |||
| <ProFormRadio.Group | |||
| name="fax_public" | |||
| label="是否公开传真" | |||
| options={[ | |||
| { | |||
| label: '是', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '否', | |||
| value: 2, | |||
| } | |||
| ]} | |||
| /> | |||
| </Space> | |||
| /> | |||
| </Col> | |||
| <Col span={16}> | |||
| <ProFormRadio.Group | |||
| name="fax_public" | |||
| label="是否公开传真" | |||
| radioType="button" | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { | |||
| label: '是', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '否', | |||
| value: 2, | |||
| } | |||
| ]} | |||
| /> | |||
| </Col> | |||
| <Col span={24}> | |||
| <ProFormSegmented | |||
| name="status" | |||
| label="职位状态" | |||
| request={async () => [ | |||
| @@ -4,7 +4,7 @@ import type { ActionType } from '@ant-design/pro-components'; | |||
| import { | |||
| ProTable, ProFormSelect | |||
| } from '@ant-design/pro-components'; | |||
| import { Button, ConfigProvider,message } from 'antd'; | |||
| import { Button, ConfigProvider, message, Space, Descriptions, Radio, Row, Col, Modal } from 'antd'; | |||
| import { GetCompanyJobList, getCompanyList, GetCompanyInfo, PostJobExport } from '@/apis/api'; | |||
| import { Imageprefix } from '@/constants'; | |||
| const selectfieldNames = { label: 'full_name', value: 'id' }; | |||
| @@ -15,16 +15,19 @@ const PagesMainCompanyPostTable: React.FC = ({ dispatch, getId, openModel }: any | |||
| const [page, setPage] = useState<number>(1) | |||
| const [pageSize, setPageSize] = useState<number>(10) | |||
| const [companyId, setCompanyId] = useState<number>(0); | |||
| const [expandedRowKeys, setExpandedRowKeys] = useState<string[]>([]) | |||
| const setId = (id: number) => { | |||
| getId(id) | |||
| } | |||
| useEffect(() => { | |||
| if (!openModel.openModal) { | |||
| actionRef.current.reload(); | |||
| actionRef.current?.reload(); | |||
| } | |||
| }, [openModel.openModal]) | |||
| return ( | |||
| <> | |||
| <ConfigProvider | |||
| @@ -38,28 +41,32 @@ const PagesMainCompanyPostTable: React.FC = ({ dispatch, getId, openModel }: any | |||
| > | |||
| <ProTable | |||
| scroll={{ x: 1300 }} | |||
| size='small' | |||
| scroll={{ y: 480, x: 'auto' }} | |||
| bordered={true} | |||
| actionRef={actionRef} | |||
| dataSource={list} | |||
| search={{ span: 8, labelWidth: 'auto' }} | |||
| rowSelection={{ | |||
| type: 'checkbox' | |||
| }} | |||
| columns={[ | |||
| { | |||
| title: '筛选日期', | |||
| dataIndex: 'date_range', | |||
| hidden: true, | |||
| width: 120, | |||
| valueType: 'dateRange', | |||
| }, | |||
| { | |||
| title: 'ID', | |||
| dataIndex: 'id', | |||
| width: 100, | |||
| fixed: 'left', | |||
| width: 200 | |||
| }, | |||
| { | |||
| title: '所属企业', | |||
| dataIndex: 'full_name', | |||
| width: 300, | |||
| width: 200, | |||
| valueType: 'select', | |||
| renderFormItem: () => { | |||
| return ( | |||
| @@ -87,61 +94,72 @@ const PagesMainCompanyPostTable: React.FC = ({ dispatch, getId, openModel }: any | |||
| { | |||
| title: '职位名称', | |||
| dataIndex: 'name', | |||
| width: 200, | |||
| fixed: 'left' | |||
| width: 200 | |||
| }, | |||
| { | |||
| title: '点击次数', | |||
| dataIndex: 'click_count', | |||
| width: 200, | |||
| search: false, | |||
| width: 100 | |||
| }, | |||
| { | |||
| title: '职位状态', | |||
| dataIndex: 'status', | |||
| width: 100, | |||
| hidden: true, | |||
| valueType: 'select', | |||
| width: 200, | |||
| colSize: 16, | |||
| valueType: 'radio', | |||
| initialValue: '0', | |||
| valueEnum: { | |||
| 0: { text: '全部' }, | |||
| 1: { | |||
| text: '发布中', | |||
| status: 'Processing' | |||
| }, | |||
| 2: { | |||
| text: '未发布', | |||
| status: 'Error' | |||
| }, | |||
| 3: { | |||
| text: '暂停', | |||
| status: 'Error' | |||
| }, | |||
| 4: { | |||
| text: '已锁定', | |||
| status: 'Error' | |||
| }, | |||
| 5: { | |||
| text: '回收站', | |||
| status: 'Error' | |||
| }, | |||
| 6: { | |||
| text: '已过期', | |||
| status: 'Error' | |||
| } | |||
| }, | |||
| }, | |||
| { | |||
| title: '状态', | |||
| dataIndex: 'status_text', | |||
| title: '有效期(天)', | |||
| dataIndex: 'useful_life', | |||
| width: 200, | |||
| search: false, | |||
| width: 100 | |||
| }, | |||
| { | |||
| title: '有效期(天)', | |||
| dataIndex: 'useful_life', | |||
| title: '发布时间', | |||
| dataIndex: 'publish_date', | |||
| width: 200, | |||
| search: false, | |||
| }, | |||
| { | |||
| title: '到期时间', | |||
| dataIndex: 'disabled_date', | |||
| width: 200, | |||
| search: false, | |||
| width: 150 | |||
| }, | |||
| { | |||
| title: '操作', | |||
| width: 300, | |||
| key: 'option', | |||
| valueType: 'option', | |||
| fixed: 'right', | |||
| render: (_, record, action) => [ | |||
| <Button key='1' type='link' onClick={() => { | |||
| setId(record.id) | |||
| @@ -174,7 +192,7 @@ const PagesMainCompanyPostTable: React.FC = ({ dispatch, getId, openModel }: any | |||
| sortby: 'desc', | |||
| keyword: params.name, | |||
| expired: params.expired, | |||
| status: params.status, | |||
| status: params.status ? params.status : 0, | |||
| company_id: sessionStorage.getItem('post_company_info') ? JSON.parse(sessionStorage.getItem('post_company_info')).id : companyId, | |||
| start_date: params.date_range ? params.date_range[0] : '', | |||
| end_date: params.date_range ? params.date_range[1] : '', | |||
| @@ -188,25 +206,108 @@ const PagesMainCompanyPostTable: React.FC = ({ dispatch, getId, openModel }: any | |||
| sessionStorage.removeItem('post_company_info') | |||
| } | |||
| setCompanyId(0) | |||
| actionRef.current.reload(); | |||
| actionRef.current?.reload(); | |||
| }} | |||
| headerTitle="部门列表" | |||
| toolBarRender={() => [ | |||
| <Button type="primary" onClick={() => { | |||
| message.info('数据导出需要时间,请耐心等待') | |||
| PostJobExport().then(res => { | |||
| let url = Imageprefix + res.data.excel_url; | |||
| window.open(url); | |||
| message.info('数据导出完毕') | |||
| }) | |||
| }}> | |||
| 导出数据 | |||
| </Button>, | |||
| <Button type="primary" onClick={() => { | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}> | |||
| 添加职位 | |||
| </Button> | |||
| headerTitle="职位列表" | |||
| toolBarRender={() => [<Button type="primary" onClick={() => { | |||
| Modal.confirm({ | |||
| title: '批量发布', | |||
| content: (<> | |||
| <h4 style={{ fontWeight: 'bold' }}>有效期:</h4> | |||
| <Radio.Group size='small' onChange={async (e) => { | |||
| actionRef.current?.reload(); | |||
| }}> | |||
| <Row gutter={[20, 20]} style={{ padding: 20 }}> | |||
| <Col span={12}> | |||
| <Radio value={1}>1天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>3天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>7天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>15天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>30天</Radio> | |||
| </Col> | |||
| </Row> | |||
| </Radio.Group> | |||
| </>), | |||
| onOk() { | |||
| }, | |||
| onCancel() { | |||
| console.log('Cancel'); | |||
| }, | |||
| okText: '确定', | |||
| cancelText: '取消', | |||
| centered: true | |||
| }); | |||
| }}> | |||
| 批量发布 | |||
| </Button>, | |||
| <Button type="primary" onClick={() => { | |||
| Modal.confirm({ | |||
| title: '批量更改状态', | |||
| content: (<> | |||
| <Radio.Group size='small' onChange={async (e) => { | |||
| actionRef.current?.reload(); | |||
| }}> | |||
| <Row gutter={[20, 20]} style={{ padding: 20 }}> | |||
| <Col span={12}> | |||
| <Radio value={1}>发布中</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>未发布</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>暂停</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>已锁定</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>回收站</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>已过期</Radio> | |||
| </Col> | |||
| </Row> | |||
| </Radio.Group> | |||
| </>), | |||
| onOk() { | |||
| }, | |||
| onCancel() { | |||
| console.log('Cancel'); | |||
| }, | |||
| okText: '确定', | |||
| cancelText: '取消', | |||
| centered: true | |||
| }); | |||
| }}> | |||
| 批量更改状态 | |||
| </Button>, | |||
| <Button type="primary" onClick={() => { | |||
| message.info('数据导出需要时间,请耐心等待') | |||
| PostJobExport().then(res => { | |||
| let url = Imageprefix + res.data.excel_url; | |||
| window.open(url); | |||
| message.info('数据导出完毕') | |||
| }) | |||
| }}> | |||
| 导出数据 | |||
| </Button>, | |||
| <Button type="primary" onClick={() => { | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}> | |||
| 添加职位 | |||
| </Button> | |||
| ]} | |||
| /> | |||
| @@ -7,7 +7,7 @@ import { | |||
| ProForm, | |||
| ProFormDateRangePicker | |||
| } from '@ant-design/pro-components'; | |||
| import { ConfigProvider, Flex, Space, Modal, message } from 'antd'; | |||
| import { ConfigProvider, Flex, Space, Modal, message, Row, Col } from 'antd'; | |||
| import { PostCompanyVipmanage, GetCompanyVipInfo } from '@/apis/api'; | |||
| import dayjs from "dayjs"; | |||
| @@ -40,7 +40,7 @@ const PagesMainCompanyPostCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| maskClosable={false} | |||
| footer={null} | |||
| destroyOnClose | |||
| width={1000} | |||
| width={680} | |||
| onCancel={() => { | |||
| dispatch({ type: 'openModel/getOpenModal', payload: false }) | |||
| }} | |||
| @@ -50,6 +50,7 @@ const PagesMainCompanyPostCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| request={async () => { | |||
| if (id) { | |||
| let res = await GetCompanyVipInfo({ id: id }) | |||
| res.data.dateRange = [res.data.start_date ? res.data.start_date : null, res.data.end_date ? res.data.end_date : null] | |||
| return res.data; | |||
| } | |||
| }} | |||
| @@ -66,125 +67,134 @@ const PagesMainCompanyPostCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| }} | |||
| onFinish={async (values) => { | |||
| values.id = id; | |||
| values.start_date = values.dateRange[0]; | |||
| values.end_date = values.dateRange[1]; | |||
| values.start_date = values.dateRange && values.dateRange.length > 0 ? values.dateRange[0] : ''; | |||
| values.end_date = values.dateRange && values.dateRange.length > 0 ? values.dateRange[1] : ''; | |||
| delete values.dateRange; | |||
| let res = await PostCompanyVipmanage(values) | |||
| message.success('提交成功') | |||
| dispatch({ type: 'openModel/getOpenModal', payload: false }) | |||
| }} | |||
| > | |||
| <ProFormRadio.Group | |||
| name="probation" | |||
| label="见习基地" | |||
| radioType="button" | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { | |||
| label: '是', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '否', | |||
| value: 2, | |||
| } | |||
| ]} | |||
| /> | |||
| <ProFormRadio.Group | |||
| name="famous" | |||
| label="知名企业" | |||
| radioType="button" | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { | |||
| label: '是', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '否', | |||
| value: 2, | |||
| } | |||
| ]} | |||
| /> | |||
| <ProFormRadio.Group | |||
| name="member_type" | |||
| label="会员类型" | |||
| radioType="button" | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { | |||
| label: '试用申请中', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '试用正式', | |||
| value: 2, | |||
| }, | |||
| { | |||
| label: '普通申请中', | |||
| value: 3, | |||
| }, | |||
| { | |||
| label: '普通正式', | |||
| value: 4, | |||
| }, | |||
| { | |||
| label: 'VIP申请中', | |||
| value: 5, | |||
| }, | |||
| { | |||
| label: 'VIP正式', | |||
| value: 6, | |||
| } | |||
| ]} | |||
| /> | |||
| <ProFormRadio.Group | |||
| name="member_status" | |||
| label="会员状态" | |||
| radioType="button" | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { | |||
| label: '待审', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '正常', | |||
| value: 2, | |||
| }, | |||
| { | |||
| label: '到期', | |||
| value: 3, | |||
| }, | |||
| { | |||
| label: '推荐', | |||
| value: 4, | |||
| } | |||
| ]} | |||
| /> | |||
| <ProFormDateRangePicker | |||
| name="dateRange" | |||
| label="会员生效时间" | |||
| placeholder={['会员生效时间', '会员失效时间']} | |||
| fieldProps={{ | |||
| format: 'YYYY-MM-DD' | |||
| }} | |||
| /> | |||
| <ProFormText | |||
| name="sale" | |||
| label="业务员" | |||
| placeholder="请输入业务员" | |||
| /> | |||
| <Row gutter={[16, 16]}> | |||
| <Col span={6}> | |||
| <ProFormRadio.Group | |||
| name="probation" | |||
| label="见习基地" | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { | |||
| label: '是', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '否', | |||
| value: 2, | |||
| } | |||
| ]} | |||
| /> | |||
| </Col> | |||
| <Col span={6}> | |||
| <ProFormRadio.Group | |||
| name="famous" | |||
| label="知名企业" | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { | |||
| label: '是', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '否', | |||
| value: 2, | |||
| } | |||
| ]} | |||
| /> | |||
| </Col> | |||
| <Col span={24}> | |||
| <ProFormRadio.Group | |||
| name="member_type" | |||
| label="会员类型" | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { | |||
| label: '试用申请中', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '试用正式', | |||
| value: 2, | |||
| }, | |||
| { | |||
| label: '普通申请中', | |||
| value: 3, | |||
| }, | |||
| { | |||
| label: '普通正式', | |||
| value: 4, | |||
| }, | |||
| { | |||
| label: 'VIP申请中', | |||
| value: 5, | |||
| }, | |||
| { | |||
| label: 'VIP正式', | |||
| value: 6, | |||
| } | |||
| ]} | |||
| /> | |||
| </Col> | |||
| <Col span={24}> | |||
| <ProFormRadio.Group | |||
| name="member_status" | |||
| label="会员状态" | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { | |||
| label: '待审', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '正常', | |||
| value: 2, | |||
| }, | |||
| { | |||
| label: '到期', | |||
| value: 3, | |||
| }, | |||
| { | |||
| label: '推荐', | |||
| value: 4, | |||
| } | |||
| ]} | |||
| /> | |||
| </Col> | |||
| <Col span={12}> | |||
| <ProFormDateRangePicker | |||
| name="dateRange" | |||
| label="会员生效时间" | |||
| placeholder={['会员生效时间', '会员失效时间']} | |||
| fieldProps={{ | |||
| format: 'YYYY-MM-DD' | |||
| }} | |||
| /> | |||
| </Col> | |||
| <Col span={12}> | |||
| <ProFormText | |||
| name="sale" | |||
| label="业务员" | |||
| placeholder="请输入业务员" | |||
| /> | |||
| </Col> | |||
| </Row> | |||
| </ProForm> | |||
| @@ -4,11 +4,12 @@ import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
| import { | |||
| ProFormText, | |||
| ProForm, | |||
| ProFormSegmented, | |||
| ProFormRadio, | |||
| ProFormDigit | |||
| } from '@ant-design/pro-components'; | |||
| import { ConfigProvider, Flex, Space, Modal, message } from 'antd'; | |||
| import { ConfigProvider, Flex, Space, Modal, message, } from 'antd'; | |||
| import { PostCompanyFeechange } from '@/apis/api'; | |||
| import { PostCompanyVipmanage, GetCompanyVipInfo } from '@/apis/api'; | |||
| const selectfieldNames = { label: 'full_name', value: 'id' }; | |||
| @@ -27,7 +28,7 @@ const PagesMainCompanyPostCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| theme={{ | |||
| token: { | |||
| colorPrimary: '#4FBE70', | |||
| } , components: { | |||
| }, components: { | |||
| Segmented: { | |||
| itemSelectedBg: '#19be6e', | |||
| itemSelectedColor: '#ffffff' | |||
| @@ -38,17 +39,24 @@ const PagesMainCompanyPostCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| <Modal | |||
| open={openPreview} | |||
| title='编辑VIP' | |||
| title='变更点数' | |||
| centered | |||
| maskClosable={false} | |||
| footer={null} | |||
| destroyOnClose | |||
| width={1000} | |||
| width={480} | |||
| onCancel={() => { | |||
| dispatch({ type: 'openModel/getOpenFeeModal', payload: false }) | |||
| }} | |||
| > | |||
| <ProForm<CompanyType.fee> | |||
| request={async () => { | |||
| if (id) { | |||
| let res = await GetCompanyVipInfo({ id: id }) | |||
| res.data.fee = res.data.balance_fee | |||
| return res.data; | |||
| } | |||
| }} | |||
| formRef={formRef} | |||
| submitter={{ | |||
| searchConfig: { | |||
| @@ -57,7 +65,6 @@ const PagesMainCompanyPostCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| }, | |||
| render: (_, dom) => { return <Flex justify='flex-end'> <Space>{dom}</Space></Flex> }, | |||
| onReset: () => { | |||
| setOpenPreview(false) | |||
| } | |||
| }} | |||
| @@ -75,11 +82,13 @@ const PagesMainCompanyPostCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| min={0} | |||
| rules={[{ required: true, message: '请输入点数值' }]} | |||
| /> | |||
| <ProFormSegmented | |||
| <ProFormRadio.Group | |||
| name="change_type" | |||
| label="变更类型" | |||
| request={async () => [ | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { | |||
| label: '增加', | |||
| value: 1, | |||
| @@ -90,6 +99,7 @@ const PagesMainCompanyPostCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| } | |||
| ]} | |||
| rules={[{ required: true, message: '请选择变更类型' }]} | |||
| /> | |||
| <ProFormText | |||
| @@ -97,7 +107,6 @@ const PagesMainCompanyPostCreate: React.FC = ({ dispatch, dictModel, openModel, | |||
| label="备注说明" | |||
| placeholder="备注说明" | |||
| rules={[{ required: true, message: '请输入备注说明' }]} | |||
| /> | |||
| </ProForm> | |||
| @@ -1,11 +1,11 @@ | |||
| import { useRef, useState, useEffect } from 'react'; | |||
| import { connect } from '@umijs/max'; | |||
| import { useSearchParams, connect } from '@umijs/max'; | |||
| import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
| import { | |||
| ProTable | |||
| } from '@ant-design/pro-components'; | |||
| import { Button, Image, ConfigProvider, Input } from 'antd'; | |||
| import { PostCompanyViplist ,PostCompanyFeechange} from '@/apis/api'; | |||
| import { Button, Image, ConfigProvider, Input, Descriptions, Space, Modal, Radio, Row, Col } from 'antd'; | |||
| import { PostCompanyViplist, PostCompanyFeechange } from '@/apis/api'; | |||
| import { Imageprefix } from '@/constants'; | |||
| @@ -13,11 +13,12 @@ import { Imageprefix } from '@/constants'; | |||
| const CompanyListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
| const actionRef = useRef<ActionType>(); | |||
| const [searchParams, setSearchParams] = useSearchParams(); | |||
| const [list, setList] = useState<object[]>([]) | |||
| const [total, setTotal] = useState<number>(0) | |||
| const [page, setPage] = useState<number>(1) | |||
| const [pageSize, setPageSize] = useState<number>(10) | |||
| const [fullname, setFullname] = useState<any>(sessionStorage.getItem('vip_company_info') ? JSON.parse(sessionStorage.getItem('vip_company_info')).full_name : '') | |||
| const setId = (id: number) => { | |||
| getId(id) | |||
| @@ -25,16 +26,33 @@ const CompanyListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
| useEffect(() => { | |||
| if (!openModel.openModal) { | |||
| actionRef.current.reload(); | |||
| actionRef.current?.reload(); | |||
| } | |||
| }, [openModel.openModal]) | |||
| useEffect(() => { | |||
| if (!openModel.openFeeModal) { | |||
| actionRef.current.reload(); | |||
| actionRef.current?.reload(); | |||
| } | |||
| }, [openModel.openFeeModal]) | |||
| const expandedRowRender = (record) => { | |||
| return ( | |||
| <> | |||
| <Space direction='vertical' style={{ width: '100%' }}> | |||
| <Descriptions title="基本信息" bordered column={3} contentStyle={{ fontWeight: 'bold' }} labelStyle={{ width: 180 }}> | |||
| <Descriptions.Item label="见习基地">{record.probation_text}</Descriptions.Item> | |||
| <Descriptions.Item label="知名企业">{record.famous_text}</Descriptions.Item> | |||
| <Descriptions.Item label="业务员">{record.sales}</Descriptions.Item> | |||
| </Descriptions> | |||
| </Space > | |||
| </> | |||
| ); | |||
| }; | |||
| return ( | |||
| <> | |||
| <ConfigProvider | |||
| @@ -46,102 +64,116 @@ const CompanyListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
| } | |||
| }} | |||
| > | |||
| <ProTable | |||
| scroll={{ x: 1300 }} | |||
| scroll={{ y: 480, x: 'auto' }} | |||
| bordered={true} | |||
| actionRef={actionRef} | |||
| dataSource={list} | |||
| search={{ | |||
| span: 8, labelWidth: 'auto', | |||
| }} | |||
| rowSelection={{ | |||
| type: 'checkbox' | |||
| }} | |||
| expandable={{ | |||
| expandedRowRender | |||
| }} | |||
| columns={[ | |||
| { | |||
| title: '筛选日期', | |||
| dataIndex: 'date_range', | |||
| hidden: true, | |||
| width: 120, | |||
| valueType: 'dateRange', | |||
| search: { | |||
| transform: (value) => { | |||
| return { | |||
| start_date: value[0], | |||
| end_date: value[1], | |||
| }; | |||
| }, | |||
| }, | |||
| }, | |||
| { | |||
| title: 'ID', | |||
| dataIndex: 'id', | |||
| width: 80, | |||
| fixed: 'left', | |||
| width: 200, | |||
| }, | |||
| { | |||
| title: '企业名称', | |||
| dataIndex: 'full_name', | |||
| width: 300, | |||
| fixed: 'left', | |||
| valueType: 'input', | |||
| renderFormItem: () => { | |||
| width: 200, | |||
| renderFormItem: (_, { type, defaultRender }) => { | |||
| return ( | |||
| <><Input placeholder="请输入企业名称" value={fullname} onChange={(e) => { | |||
| setFullname(e.target.value) | |||
| }} /></> | |||
| <Input | |||
| placeholder="请输入企业名称" | |||
| defaultValue={searchParams.get('full_name')} | |||
| onChange={(e) => { | |||
| console.log(e.target.value); | |||
| }} | |||
| /> | |||
| ) | |||
| } | |||
| }, | |||
| { | |||
| title: '见习基地', | |||
| dataIndex: 'probation_text', | |||
| search: false, | |||
| width: 100, | |||
| }, | |||
| { | |||
| title: '知名企业', | |||
| dataIndex: 'famous_text', | |||
| search: false, | |||
| width: 100 | |||
| }, | |||
| }, | |||
| { | |||
| title: '会员类型', | |||
| dataIndex: 'member_type_text', | |||
| width: 200, | |||
| search: false, | |||
| width: 100 | |||
| }, | |||
| { | |||
| title: '会员状态', | |||
| dataIndex: 'member_status_text', | |||
| width: 100, | |||
| dataIndex: 'member_status', | |||
| width: 200, | |||
| search: false, | |||
| valueEnum: { | |||
| 0: { text: '全部' }, | |||
| 1: { | |||
| text: '待审', | |||
| status: 'Error' | |||
| }, | |||
| 2: { | |||
| text: '正常', | |||
| status: 'Processing' | |||
| }, | |||
| 3: { | |||
| text: '到期', | |||
| status: 'Error' | |||
| }, | |||
| 4: { | |||
| text: '推荐', | |||
| status: 'Error' | |||
| }, | |||
| }, | |||
| }, | |||
| { | |||
| title: '开始时间', | |||
| dataIndex: 'start_date', | |||
| width: 200, | |||
| search: false, | |||
| width: 200 | |||
| }, | |||
| { | |||
| title: '到期时间', | |||
| dataIndex: 'end_date', | |||
| width: 200, | |||
| search: false, | |||
| width: 200 | |||
| }, { | |||
| title: '剩余点数', | |||
| dataIndex: 'balance_fee', | |||
| width: 200, | |||
| search: false, | |||
| width: 100, | |||
| }, | |||
| { | |||
| title: '业务员', | |||
| dataIndex: 'sales', | |||
| search: false, | |||
| width: 200 | |||
| }, | |||
| { | |||
| title: '操作', | |||
| width: 300, | |||
| key: 'option', | |||
| valueType: 'option', | |||
| fixed: 'right', | |||
| render: (_, record, action) => [ | |||
| <Button key='1' type='link' onClick={() => { | |||
| setId(record.id) | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}>编辑</Button>, | |||
| <Button key='1' type='link' onClick={() => { | |||
| <Button key='2' type='link' onClick={() => { | |||
| setId(record.id) | |||
| dispatch({ type: 'openModel/getOpenFeeModal', payload: true }) | |||
| }}>变更点数</Button> | |||
| @@ -170,22 +202,86 @@ const CompanyListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
| pagesize: pageSize, | |||
| sort: 'id', | |||
| sortby: 'desc', | |||
| keyword: fullname, | |||
| start_date: params.date_range ? params.date_range[0] : '', | |||
| end_date: params.date_range ? params.date_range[1] : '', | |||
| keyword: searchParams.get('full_name') ? searchParams.get('full_name') : params.full_name, | |||
| id: params.id, | |||
| start_date: params.start_date, | |||
| end_date: params.end_date, | |||
| }).then(res => { | |||
| setList(res.data.list) | |||
| setTotal(res.data.total) | |||
| }) | |||
| } | |||
| onReset={() => { | |||
| if (sessionStorage.getItem('vip_company_info')) { | |||
| sessionStorage.removeItem('vip_company_info') | |||
| } | |||
| setFullname('') | |||
| actionRef.current.reload(); | |||
| }} | |||
| headerTitle="企业列表" | |||
| headerTitle="VIP企业列表" | |||
| toolBarRender={() => [ | |||
| <Button type="primary" onClick={() => { | |||
| Modal.confirm({ | |||
| title: '请选择对批量数据开通哪种会员类型', | |||
| content: (<> | |||
| <div>参数: id, member_type,start_date,end_date </div> | |||
| <h4 style={{ fontWeight: 'bold' }}>类型:</h4> | |||
| <Radio.Group size='small' onChange={async (e) => { | |||
| actionRef.current?.reload(); | |||
| }}> | |||
| <Row gutter={[20, 20]} style={{ padding: 20 }}> | |||
| <Col span={12}> | |||
| <Radio value={1}>试用申请中</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>试用正式</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>普通申请中</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>普通正式</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>VIP申请中</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>VIP正式</Radio> | |||
| </Col> | |||
| </Row> | |||
| </Radio.Group> | |||
| <h4 style={{ fontWeight: 'bold' }}>时长:</h4> | |||
| <Radio.Group size='small' onChange={async (e) => { | |||
| actionRef.current?.reload(); | |||
| }}> | |||
| <Row gutter={[20, 20]} style={{ padding: 20 }}> | |||
| <Col span={12}> | |||
| <Radio value={1}>1天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>3天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>7天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>15天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>30天</Radio> | |||
| </Col> | |||
| </Row> | |||
| </Radio.Group> | |||
| </>), | |||
| onOk() { | |||
| }, | |||
| onCancel() { | |||
| console.log('Cancel'); | |||
| }, | |||
| okText: '保存', | |||
| cancelText: '取消', | |||
| centered: true | |||
| }); | |||
| }}> | |||
| 批量开通会员 | |||
| </Button>, | |||
| ]} | |||
| /> | |||
| </ConfigProvider> | |||
| </> | |||
| @@ -197,4 +293,5 @@ const CompanyListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
| export default connect(({ dictModel, openModel }: any) => ({ | |||
| dictModel, | |||
| openModel | |||
| }))(CompanyListPage); | |||
| }))(CompanyListPage); | |||
| @@ -8,7 +8,7 @@ import { | |||
| ProFormDependency, | |||
| FormControlRender, | |||
| ProForm, | |||
| ProFormSegmented | |||
| ProFormRadio | |||
| } from '@ant-design/pro-components'; | |||
| import { ConfigProvider, Flex, Space, Modal, message, Form, Row, Col, Image } from 'antd'; | |||
| import { PostRecruitmentUpdate, PostRecruitmentAdd, GetCompanyInfo, GetRecruitmentDetail } from '@/apis/api'; | |||
| @@ -108,73 +108,39 @@ const PagesMainFairListCreate: React.FC = ({ dispatch, dictModel, openModel, id | |||
| } | |||
| }} | |||
| > | |||
| <ProFormText | |||
| name="title" | |||
| label="招聘会主题" | |||
| placeholder="请输入招聘会主题" | |||
| rules={[{ required: true, message: '请输入招聘会主题' } | |||
| ]} | |||
| /> | |||
| <Form.Item | |||
| name='content' | |||
| label="招聘会内容" | |||
| rules={[{ required: true }]} | |||
| > | |||
| <FormControlRender> | |||
| {() => { | |||
| return ( | |||
| <ProFormDependency name={['content']} > | |||
| {({ content }, form) => { | |||
| return ( | |||
| <RichComponent placeholder="请输入招聘会内容" defaultValue={content} | |||
| onChange={(value) => { | |||
| setRichTxt(value) | |||
| form.formRef.current.setFieldsValue({ | |||
| content: value | |||
| }) | |||
| }}></RichComponent> | |||
| ); | |||
| }} | |||
| </ProFormDependency> | |||
| ); | |||
| }} | |||
| </FormControlRender> | |||
| </Form.Item> | |||
| <ProFormDateTimeRangePicker | |||
| name="dateRange" | |||
| label="选择有效的日期时间范围" | |||
| fieldProps={{ | |||
| format: 'YYYY-MM-DD HH:mm:ss' | |||
| }} | |||
| rules={[{ required: true, message: '请选择有效的时间范围' }]} | |||
| /> | |||
| <Row gutter={[16, 16]}> | |||
| { | |||
| detail ? | |||
| <Col span={6}> | |||
| <UploadModel multiple={false} form_name="photo" image_length={1} uploadTxt="上传招聘会照片" image_type={3} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| </Col> : <> | |||
| <Col span={6}> | |||
| <UploadModel multiple={false} form_name="photo" image_length={1} uploadTxt="上传招聘会照片" image_type={3} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| </Col> | |||
| </> | |||
| } | |||
| { | |||
| detail ? | |||
| <Col span={6}> | |||
| {uploadedFilephotoName ? <Image src={`${Imageprefix}${uploadedFilephotoName}`} style={{ marginTop: '32px', width: '100px', height: '100px' }}></Image> : <Image src={`${Imageprefix}${detail?.photo}`} style={{ marginTop: '32px', width: '100px', height: '100px' }}></Image>} | |||
| </Col> : <> | |||
| {uploadedFilephotoName ? <Col span={6}> <Image src={`${Imageprefix}${uploadedFilephotoName}`} style={{ marginTop: '32px', width: '100px', height: '100px' }}></Image> </Col> : ''} | |||
| </> | |||
| } | |||
| <Col span={24}> | |||
| <UploadModel multiple={false} form_name="photo" image_length={1} uploadTxt="上传招聘会照片" image_type={3} imageUrl={detail?.photo} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| </Col> | |||
| <Col span={12}> | |||
| <ProFormText | |||
| name="title" | |||
| label="招聘会主题" | |||
| placeholder="请输入招聘会主题" | |||
| rules={[{ required: true, message: '请输入招聘会主题' } | |||
| ]} | |||
| /> | |||
| </Col> | |||
| <Col span={12}> | |||
| <ProFormDateTimeRangePicker | |||
| name="dateRange" | |||
| label="选择有效的日期时间范围" | |||
| fieldProps={{ | |||
| format: 'YYYY-MM-DD HH:mm:ss' | |||
| }} | |||
| rules={[{ required: true, message: '请选择有效的时间范围' }]} | |||
| /> | |||
| </Col> | |||
| {/* <Col span={24}> | |||
| <Switch checked={mapSwitch} checkedChildren='地图已显示' unCheckedChildren="地图已关闭" onChange={(val) => { | |||
| setMapSwitch(val) | |||
| }} /> | |||
| </Col> */} | |||
| <Col span={24}> | |||
| <Col span={8}> | |||
| <ProFormText | |||
| label="详细地址" | |||
| name="address" | |||
| @@ -192,15 +158,49 @@ const PagesMainFairListCreate: React.FC = ({ dispatch, dictModel, openModel, id | |||
| }}></MapComponent> | |||
| </Col> | |||
| } */} | |||
| <Col span={24}> | |||
| <ProFormSegmented | |||
| <Col span={6}> | |||
| <ProFormRadio.Group | |||
| name="status" | |||
| label="招聘会状态" | |||
| request={async () => [ | |||
| fieldProps={{ | |||
| buttonStyle: 'solid' | |||
| }} | |||
| options={[ | |||
| { label: '开启', value: 1 }, | |||
| { label: '结束', value: 2 } | |||
| ]} | |||
| /> | |||
| </Col> | |||
| <Col span={24}> | |||
| <Form.Item | |||
| name='content' | |||
| label="招聘会内容" | |||
| rules={[{ required: true }]} | |||
| > | |||
| <FormControlRender> | |||
| {() => { | |||
| return ( | |||
| <ProFormDependency name={['content']} > | |||
| {({ content }, form) => { | |||
| return ( | |||
| <RichComponent placeholder="请输入招聘会内容" defaultValue={content} | |||
| onChange={(value) => { | |||
| setRichTxt(value) | |||
| form.formRef.current.setFieldsValue({ | |||
| content: value | |||
| }) | |||
| }}></RichComponent> | |||
| ); | |||
| }} | |||
| </ProFormDependency> | |||
| ); | |||
| }} | |||
| </FormControlRender> | |||
| </Form.Item> | |||
| </Col> | |||
| </Row> | |||
| </ProForm> | |||
| @@ -2,11 +2,15 @@ import { useRef, useState, useEffect } from 'react'; | |||
| import { connect, history } from '@umijs/max'; | |||
| import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
| import { | |||
| ProTable | |||
| ProTable, ProForm | |||
| } from '@ant-design/pro-components'; | |||
| import { Button, ConfigProvider, Tag } from 'antd'; | |||
| import { Button, ConfigProvider, Tag, Modal, Radio, Row, Col, Descriptions, Space, Image } from 'antd'; | |||
| import { Imageprefix } from '@/constants'; | |||
| import { listRecruitment, GetRecruitmentDetail } from '@/apis/api'; | |||
| import UploadModel from '@/components/Common/upload'; | |||
| const MainFairListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
| const actionRef = useRef<ActionType>(); | |||
| const [list, setList] = useState<object[]>([]) | |||
| @@ -20,10 +24,37 @@ const MainFairListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
| useEffect(() => { | |||
| if (!openModel.openModal) { | |||
| actionRef.current.reload(); | |||
| actionRef.current?.reload(); | |||
| } | |||
| }, [openModel.openModal]) | |||
| const [uploadedFilephotoName, setUploadedFilephotoName] = useState<string>(''); | |||
| const uploadedFilephotoNameRef = useRef<string>(''); | |||
| const handleFileUploadedphoto = (filename: string) => { | |||
| setUploadedFilephotoName(filename); | |||
| }; | |||
| useEffect(() => { | |||
| uploadedFilephotoNameRef.current = uploadedFilephotoName; | |||
| }, [uploadedFilephotoName]) | |||
| const expandedRowRender = (record) => { | |||
| return ( | |||
| <> | |||
| <Space direction='vertical' style={{ width: '100%' }}> | |||
| <Descriptions title="参会信息" bordered column={3} contentStyle={{ fontWeight: 'bold' }} labelStyle={{ width: 180 }}> | |||
| <Descriptions.Item label="参与的企业总数">{record.join_count}</Descriptions.Item> | |||
| <Descriptions.Item label="已审核企业总数">{record.job_count}</Descriptions.Item> | |||
| <Descriptions.Item label="参与职位数">{record.job_count}</Descriptions.Item> | |||
| <Descriptions.Item label="需求人数">{record.recruiting_num}</Descriptions.Item> | |||
| </Descriptions> | |||
| </Space > | |||
| </> | |||
| ); | |||
| }; | |||
| return ( | |||
| <> | |||
| <ConfigProvider | |||
| @@ -37,15 +68,21 @@ const MainFairListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
| > | |||
| <ProTable | |||
| size='small' | |||
| scroll={{ y: 480, x: 'auto' }} | |||
| bordered={true} | |||
| scroll={{ x: 1300 }} | |||
| actionRef={actionRef} | |||
| dataSource={list} | |||
| search={{ span: 8, labelWidth: 'auto' }} | |||
| rowSelection={{ | |||
| type: 'checkbox' | |||
| }} | |||
| expandable={{ | |||
| expandedRowRender | |||
| }} | |||
| columns={[{ | |||
| title: 'ID', | |||
| dataIndex: 'id', | |||
| width: 80, | |||
| width: 200, | |||
| }, | |||
| { | |||
| title: '招聘会名称', | |||
| @@ -62,51 +99,40 @@ const MainFairListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
| width: 200, | |||
| search: false | |||
| }, { | |||
| title: '开通状态', | |||
| title: '开启状态', | |||
| dataIndex: 'status', | |||
| width: 100, | |||
| width: 300, | |||
| render: (_, record) => (<> | |||
| { | |||
| <> | |||
| {record.status === 1 ? <Tag color="green">进行中</Tag> : <Tag color="red">已结束</Tag>} | |||
| </> | |||
| } | |||
| <Radio.Group size='small' value={record.status} onChange={async (e) => { | |||
| actionRef.current?.reload(); | |||
| }}> | |||
| <Radio value={1}>已开启</Radio> | |||
| <Radio value={2}>已关闭</Radio> | |||
| </Radio.Group> | |||
| </>), | |||
| valueType: 'select', | |||
| valueEnum: { | |||
| 0: { text: '全部' }, | |||
| 1: { | |||
| text: '进行中', | |||
| text: '已开启', | |||
| }, | |||
| 2: { | |||
| text: '已结束', | |||
| text: '已关闭', | |||
| } | |||
| }, | |||
| }, { | |||
| title: '参与的企业总数', | |||
| dataIndex: 'join_count', | |||
| width: 120, | |||
| search: false | |||
| }, { | |||
| title: '已审核企业总数', | |||
| dataIndex: 'audit_count', | |||
| width: 120, | |||
| search: false | |||
| }, { | |||
| title: '参与职位数', | |||
| dataIndex: 'job_count', | |||
| width: 100, | |||
| search: false | |||
| }, { | |||
| title: '需求人数', | |||
| dataIndex: 'recruiting_num', | |||
| width: 100, | |||
| search: false | |||
| title: '封面图', | |||
| dataIndex: 'photo', | |||
| width: 200, | |||
| search: false, | |||
| render: (_, record) => (<> | |||
| <Image src={`${Imageprefix}${record.photo}`} width={60} height={60} /> | |||
| </> | |||
| ) | |||
| }, | |||
| { | |||
| title: '操作', | |||
| width: 120, | |||
| key: 'option', | |||
| valueType: 'option', | |||
| render: (_, record, action) => [ | |||
| @@ -114,11 +140,38 @@ const MainFairListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
| setId(record) | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}>编辑</Button>, | |||
| <Button size='small' type='link' onClick={() => { | |||
| Modal.confirm({ | |||
| title: '更换图片', | |||
| content: (<> | |||
| <ProForm submitter={{ render: false }}> | |||
| <UploadModel multiple={false} form_name="photo" image_length={1} uploadTxt="更换图片" image_type={3} imageUrl={record.photo} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| </ProForm> | |||
| </>), | |||
| async onOk() { | |||
| // let info = await GetCompanyInfo({ id: record.id }); | |||
| // let res = await updateCompany({ ...info.data, license_path: uploadedFilelicenseNameRef.current }); | |||
| // setUploadedFilelicenseName(''); | |||
| actionRef.current?.reload(); | |||
| }, | |||
| onCancel() { | |||
| console.log('Cancel'); | |||
| }, | |||
| okText: '保存', | |||
| cancelText: '取消', | |||
| centered: true, | |||
| }); | |||
| }}>更换图片</Button>, | |||
| <Button key='2' type='link' onClick={() => { | |||
| setId(record) | |||
| dispatch({ type: 'openModel/getOpenFairDetailModal', payload: true }) | |||
| }}>详情</Button> | |||
| }}>详情</Button>, | |||
| <Button key='3' type='link' onClick={() => { | |||
| setId(record) | |||
| dispatch({ type: 'openModel/getOpenFairDetailModal', payload: true }) | |||
| }}>参与企业</Button> | |||
| ], | |||
| }, | |||
| ]} | |||
| @@ -151,12 +204,65 @@ const MainFairListPage: React.FC = ({ dispatch, getId, openModel }: any) => { | |||
| setTotal(res.data.total) | |||
| }) | |||
| } | |||
| toolBarRender={() => [ | |||
| <Button type="primary" onClick={() => { | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}> | |||
| 添加招聘会 | |||
| </Button> | |||
| toolBarRender={() => [<Button type="primary" onClick={() => { | |||
| Modal.confirm({ | |||
| title: '请选择对批量数据进行何种操作', | |||
| content: (<> | |||
| <h4 style={{ fontWeight: 'bold' }}>状态:</h4> | |||
| <Radio.Group size='small' onChange={async (e) => { | |||
| actionRef.current?.reload(); | |||
| }}> | |||
| <Row gutter={[20, 20]} style={{ padding: 20 }}> | |||
| <Col span={12}> | |||
| <Radio value={1}>开启</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>关闭</Radio> | |||
| </Col> | |||
| </Row> | |||
| </Radio.Group> | |||
| <h4 style={{ fontWeight: 'bold' }}>时长:</h4> | |||
| <Radio.Group size='small' onChange={async (e) => { | |||
| actionRef.current?.reload(); | |||
| }}> | |||
| <Row gutter={[20, 20]} style={{ padding: 20 }}> | |||
| <Col span={12}> | |||
| <Radio value={1}>1天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>3天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>7天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>15天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>30天</Radio> | |||
| </Col> | |||
| </Row> | |||
| </Radio.Group> | |||
| </>), | |||
| onOk() { | |||
| }, | |||
| onCancel() { | |||
| console.log('Cancel'); | |||
| }, | |||
| okText: '保存', | |||
| cancelText: '取消', | |||
| centered: true | |||
| }); | |||
| }}> | |||
| 批量管理招聘会 | |||
| </Button>, | |||
| <Button type="primary" onClick={() => { | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}> | |||
| 添加招聘会 | |||
| </Button> | |||
| ]} | |||
| headerTitle="招聘会列表" | |||
| /> | |||
| @@ -38,10 +38,11 @@ const MainFeedbackListPage: React.FC = ({ dispatch, getId, openModel }: any) => | |||
| <ProTable | |||
| size='small' | |||
| scroll={{ y: 480, x: 'auto' }} | |||
| bordered={true} | |||
| scroll={{ x: 1300 }} | |||
| actionRef={actionRef} | |||
| dataSource={list} | |||
| search={{ span: 8, labelWidth: 'auto' }} | |||
| columns={[ | |||
| { | |||
| title: '用户', | |||
| @@ -57,10 +58,8 @@ const MainFeedbackListPage: React.FC = ({ dispatch, getId, openModel }: any) => | |||
| }, | |||
| { | |||
| title: '操作', | |||
| width: 300, | |||
| key: 'option', | |||
| valueType: 'option', | |||
| fixed: 'right', | |||
| render: (_, record, action) => [ | |||
| <Button key='1' type='link' onClick={() => { | |||
| setId(record.id) | |||
| @@ -6,6 +6,7 @@ import { | |||
| ProFormText, | |||
| ProFormSegmented, | |||
| ProFormSelect, | |||
| ProFormRadio, | |||
| ProForm, | |||
| FormControlRender, | |||
| ProFormDependency, | |||
| @@ -74,7 +75,7 @@ const PagesMainInformationArticleCreate: React.FC = ({ dispatch, dictModel, open | |||
| let res = await GetArticleDetail({ id: id }) | |||
| setUploadedFilephotoName(res.data.cover_img) | |||
| res.data.section_arr = [res.data.section_name] | |||
| setDetail(res.data) | |||
| return res.data; | |||
| } else { | |||
| @@ -128,72 +129,59 @@ const PagesMainInformationArticleCreate: React.FC = ({ dispatch, dictModel, open | |||
| } | |||
| }} | |||
| > | |||
| <ProFormText | |||
| label="文章标题" | |||
| name="title" | |||
| placeholder="请输入文章标题" | |||
| rules={[{ required: true, message: '请输入文章标题' }]} | |||
| /> | |||
| <Row gutter={[16, 16]}> | |||
| { | |||
| detail ? | |||
| <Col span={24} style={{ display: 'flex' }}> | |||
| <UploadModel multiple={false} form_name="cover_img" image_length={1} uploadTxt="上传封面图" image_type={3} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| {uploadedFilephotoName ? <Image src={`${Imageprefix}${uploadedFilephotoName}`} style={{ marginLeft: '16px', marginTop: '32px', width: '100px', height: '100px' }}></Image> : <Image src={`${Imageprefix}${detail?.cover_img}`} style={{ marginLeft: '16px', marginTop: '32px', width: '100px', height: '100px' }}></Image>} | |||
| </Col> : <> | |||
| <Col span={24} style={{ display: 'flex' }}> | |||
| <UploadModel multiple={false} form_name="cover_img" image_length={1} uploadTxt="上传封面图" image_type={3} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| {uploadedFilephotoName ? <Col span={8}> <Image src={`${Imageprefix}${uploadedFilephotoName}`} style={{ marginTop: '32px', width: '100px', height: '100px' }}></Image> </Col> : ''} | |||
| </Col> | |||
| </> | |||
| } | |||
| </Row> | |||
| <ProFormSwitch fieldProps={{ | |||
| checked: showUplaod, | |||
| checkedChildren: '关闭上传文件', | |||
| unCheckedChildren: '开启上传文件', | |||
| onChange: (val) => { | |||
| setShowUplaod(val) | |||
| } | |||
| }} /> | |||
| { | |||
| showUplaod && <> | |||
| <DragUpload form_name="doc_url" uploadTxt="上传文件" onUploadComplete={handleFileUploadedDoc}></DragUpload> | |||
| <Typography.Paragraph copyable>链接:{`${Imageprefix}${uploadedFileDocName}`}</Typography.Paragraph> | |||
| </> | |||
| } | |||
| <Col span={8}> | |||
| <UploadModel multiple={false} form_name="cover_img" image_length={1} uploadTxt="上传封面图" image_type={3} imageUrl={detail?.photo} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormRadio.Group | |||
| name="stick_top" | |||
| label="是否置顶" | |||
| request={async () => [ | |||
| { label: '是', value: 1 }, | |||
| { label: '否', value: 2 } | |||
| ]} | |||
| rules={[{ required: true, message: '请选择是否置顶' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormRadio.Group | |||
| name="hot" | |||
| label="成为热门" | |||
| request={async () => [ | |||
| { label: '普通', value: 1 }, | |||
| { label: '热门推荐', value: 2 } | |||
| ]} | |||
| rules={[{ required: true, message: '请选择是否成为热门' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormText | |||
| label="文章标题" | |||
| name="title" | |||
| placeholder="请输入文章标题" | |||
| rules={[{ required: true, message: '请输入文章标题' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormCascader | |||
| label="栏目/频道" | |||
| name="section_arr" | |||
| fieldProps={{ | |||
| fieldNames: cascaderfieldNames, | |||
| changeOnSelect: true | |||
| }} | |||
| placeholder="请选择栏目/频道" | |||
| request={(keyword) => | |||
| listSection({ page: 1, pagesize: 100, keyword: keyword.keyWords, sortby: 'desc', }).then(res => { | |||
| return res.data.sections; | |||
| }) | |||
| } | |||
| /> | |||
| </Col> | |||
| <ProFormCascader | |||
| label="栏目/频道" | |||
| name="section_arr" | |||
| fieldProps={{ | |||
| fieldNames: cascaderfieldNames, | |||
| changeOnSelect: true | |||
| }} | |||
| placeholder="请选择栏目/频道" | |||
| request={(keyword) => | |||
| listSection({ page: 1, pagesize: 100, keyword: keyword.keyWords }).then(res => { | |||
| return res.data.sections; | |||
| }) | |||
| } | |||
| /> | |||
| {/* <ProFormSelect | |||
| showSearch | |||
| name="section_id" | |||
| label="栏目/频道" | |||
| placeholder="请选择栏目/频道" | |||
| fieldProps={{ | |||
| fieldNames: selectfieldNames | |||
| }} | |||
| request={(keyword) => | |||
| listSection({ page: 1, pagesize: 100, keyword: keyword.keyWords }).then(res => { | |||
| return res.data.sections; | |||
| }) | |||
| } | |||
| /> */} | |||
| <Row gutter={[16, 16]}> | |||
| <Col span={24}> | |||
| <Form.Item | |||
| name='content' | |||
| @@ -220,31 +208,30 @@ const PagesMainInformationArticleCreate: React.FC = ({ dispatch, dictModel, open | |||
| </FormControlRender> | |||
| </Form.Item> | |||
| </Col> | |||
| <Col span={24}> | |||
| <ProFormSwitch fieldProps={{ | |||
| checked: showUplaod, | |||
| checkedChildren: '关闭上传文件', | |||
| unCheckedChildren: '开启上传文件', | |||
| onChange: (val) => { | |||
| setShowUplaod(val) | |||
| } | |||
| }} /> | |||
| { | |||
| showUplaod && <> | |||
| <DragUpload form_name="doc_url" uploadTxt="上传文件" onUploadComplete={handleFileUploadedDoc}></DragUpload> | |||
| <Typography.Paragraph copyable>链接:{`${Imageprefix}${uploadedFileDocName}`}</Typography.Paragraph> | |||
| </> | |||
| } | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormText | |||
| name="author" | |||
| label="作者" | |||
| placeholder="请输入作者" | |||
| /> | |||
| </Col> | |||
| </Row> | |||
| <ProFormSegmented | |||
| name="stick_top" | |||
| label="是否置顶" | |||
| request={async () => [ | |||
| { label: '是', value: 1 }, | |||
| { label: '否', value: 2 } | |||
| ]} | |||
| rules={[{ required: true, message: '请选择是否置顶' }]} | |||
| /> | |||
| <ProFormSegmented | |||
| name="hot" | |||
| label="成为热门" | |||
| request={async () => [ | |||
| { label: '普通', value: 1 }, | |||
| { label: '热门推荐', value: 2 } | |||
| ]} | |||
| rules={[{ required: true, message: '请选择是否成为热门' }]} | |||
| /> | |||
| <ProFormText | |||
| name="author" | |||
| label="作者" | |||
| placeholder="请输入作者" | |||
| /> | |||
| </ProForm> | |||
| </Modal> | |||
| @@ -2,12 +2,13 @@ import { useRef, useState, useEffect } from 'react'; | |||
| import { connect, history } from '@umijs/max'; | |||
| import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
| import { | |||
| ProTable, TableDropdown,ProFormSelect | |||
| ProTable, TableDropdown, ProFormSelect | |||
| } from '@ant-design/pro-components'; | |||
| import { Button, Image, ConfigProvider, Popconfirm, message , Tag} from 'antd'; | |||
| import { listArticle, listSection, delArticle} from '@/apis/api'; | |||
| import { Button, Image, ConfigProvider, Popconfirm, message, Modal } from 'antd'; | |||
| import { listArticle, listSection, delArticle } from '@/apis/api'; | |||
| import { Imageprefix } from '@/constants'; | |||
| const selectfieldNames = { label: 'name', value: 'id', children: 'childs' }; | |||
| import UploadModel from '@/components/Common/upload'; | |||
| const PagesMainInformationArticleTable: React.FC = ({ dispatch, openModel, getId }: any) => { | |||
| const actionRef = useRef<ActionType>(); | |||
| @@ -22,10 +23,20 @@ const PagesMainInformationArticleTable: React.FC = ({ dispatch, openModel, getId | |||
| useEffect(() => { | |||
| if (!openModel.openModal) { | |||
| actionRef.current.reload(); | |||
| actionRef.current?.reload(); | |||
| } | |||
| }, [openModel.openModal]) | |||
| const [uploadedFilephotoName, setUploadedFilephotoName] = useState<string>(''); | |||
| const uploadedFilephotoNameRef = useRef<string>(''); | |||
| const handleFileUploadedphoto = (filename: string) => { | |||
| setUploadedFilephotoName(filename); | |||
| }; | |||
| useEffect(() => { | |||
| uploadedFilephotoNameRef.current = uploadedFilephotoName; | |||
| }, [uploadedFilephotoName]) | |||
| return ( | |||
| <> | |||
| <ConfigProvider | |||
| @@ -37,101 +48,136 @@ const PagesMainInformationArticleTable: React.FC = ({ dispatch, openModel, getId | |||
| }} | |||
| > | |||
| <ProTable | |||
| size='small' | |||
| scroll={{ y: 480, x: 'auto' }} | |||
| bordered={true} | |||
| scroll={{ x: 1300 }} | |||
| actionRef={actionRef} | |||
| dataSource={list} | |||
| columns={[ { | |||
| search={{ span: 8, labelWidth: 'auto' }} | |||
| rowSelection={{ | |||
| type: 'checkbox' | |||
| }} | |||
| columns={[{ | |||
| title: 'ID', | |||
| dataIndex: 'id', | |||
| width: 100, | |||
| width: 200, | |||
| search: false, | |||
| }, | |||
| { | |||
| title: '文章名', | |||
| dataIndex: 'title', | |||
| width: 400, | |||
| }, | |||
| { | |||
| title: '所属栏目', | |||
| dataIndex: 'section_name', | |||
| search: false | |||
| }, | |||
| { | |||
| title: '所属栏目', | |||
| dataIndex: 'section_id', | |||
| hidden: true, | |||
| valueType: 'select', | |||
| renderFormItem: () => { | |||
| return ( | |||
| <ProFormSelect | |||
| width='lg' | |||
| fieldProps={{ | |||
| fieldNames: selectfieldNames, | |||
| }} | |||
| request={async (keyword) => | |||
| listSection({ page: 1, pagesize: 100, keyword: keyword.keyWords }).then(res => { | |||
| return res.data.sections; | |||
| }) | |||
| } | |||
| placeholder="请选择所属栏目" | |||
| /> | |||
| ) | |||
| } | |||
| }, | |||
| { | |||
| title: '封面图', | |||
| dataIndex: 'cover_img', | |||
| search: false, | |||
| render: (_, record) => (<> | |||
| <Image src={`${Imageprefix}${record.cover_img}`} width={40} height={40}/> | |||
| </> | |||
| { | |||
| title: '文章名', | |||
| dataIndex: 'title', | |||
| width: 200, | |||
| }, | |||
| { | |||
| title: '所属栏目', | |||
| dataIndex: 'section_name', | |||
| search: false, | |||
| width: 200, | |||
| }, | |||
| { | |||
| title: '所属栏目', | |||
| dataIndex: 'section_id', | |||
| hidden: true, | |||
| valueType: 'select', | |||
| renderFormItem: () => { | |||
| return ( | |||
| <ProFormSelect | |||
| width='lg' | |||
| fieldProps={{ | |||
| fieldNames: selectfieldNames, | |||
| }} | |||
| request={async (keyword) => | |||
| listSection({ page: 1, pagesize: 100, keyword: keyword.keyWords }).then(res => { | |||
| return res.data.sections; | |||
| }) | |||
| } | |||
| placeholder="请选择所属栏目" | |||
| /> | |||
| ) | |||
| } | |||
| }, | |||
| { | |||
| title: '封面图', | |||
| dataIndex: 'cover_img', | |||
| search: false, | |||
| width: 200, | |||
| render: (_, record) => (<> | |||
| <Image src={`${Imageprefix}${record.cover_img}`} width={60} height={60} /> | |||
| </> | |||
| ) | |||
| }, | |||
| { | |||
| title: '置顶', | |||
| dataIndex: 'stick_top', | |||
| width: 200, | |||
| valueEnum: { | |||
| 0: { text: '全部' }, | |||
| 1: { | |||
| text: '置顶', | |||
| status: 'Processing' | |||
| }, | |||
| 2: { | |||
| text: '未置顶', | |||
| status: 'Error' | |||
| }, | |||
| }, | |||
| { | |||
| title: '置顶', | |||
| dataIndex: 'stick_top', | |||
| search: false, | |||
| render: (_, record) => (<> | |||
| { | |||
| <> | |||
| {record.stick_top === 1 ? <Tag color="green">置顶</Tag> : <Tag>未置顶</Tag>} | |||
| </> | |||
| } | |||
| </>), | |||
| }, | |||
| { | |||
| title: '热门', | |||
| dataIndex: 'hot', | |||
| search: false, | |||
| width: 200, | |||
| valueEnum: { | |||
| 0: { text: '全部' }, | |||
| 1: { | |||
| text: '热门推荐', | |||
| status: 'Processing' | |||
| }, | |||
| 2: { | |||
| text: '普通', | |||
| status: 'Error' | |||
| }, | |||
| }, | |||
| { | |||
| title: '热门', | |||
| dataIndex: 'hot', | |||
| search: false, | |||
| render: (_, record) => (<> | |||
| { | |||
| <> | |||
| {record.hot === 1 ? <Tag >普通</Tag> : <Tag color="red">热门推荐</Tag>} | |||
| </> | |||
| } | |||
| }, | |||
| </>), | |||
| }, | |||
| { | |||
| title: '作者', | |||
| dataIndex: 'author', | |||
| search: false | |||
| }, | |||
| { | |||
| title: '操作', | |||
| width: 300, | |||
| key: 'option', | |||
| valueType: 'option', | |||
| fixed: 'right', | |||
| render: (_, record, action) => [ | |||
| <Button key='1' type='link' onClick={() => { | |||
| setId(record.id) | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}>编辑</Button>, | |||
| <Popconfirm | |||
| { | |||
| title: '作者', | |||
| dataIndex: 'author', | |||
| search: false, | |||
| width: 200, | |||
| }, | |||
| { | |||
| title: '操作', | |||
| key: 'option', | |||
| valueType: 'option', | |||
| render: (_, record, action) => [ | |||
| <Button key='1' type='link' onClick={() => { | |||
| setId(record.id) | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}>编辑</Button>, | |||
| <Button size='small' type='link' onClick={() => { | |||
| Modal.confirm({ | |||
| title: '更换图片', | |||
| content: (<> | |||
| <ProForm submitter={{ render: false }}> | |||
| <UploadModel multiple={false} form_name="photo" image_length={1} uploadTxt="更换图片" image_type={3} imageUrl={record.photo} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| </ProForm> | |||
| </>), | |||
| async onOk() { | |||
| // let info = await GetCompanyInfo({ id: record.id }); | |||
| // let res = await updateCompany({ ...info.data, license_path: uploadedFilelicenseNameRef.current }); | |||
| // setUploadedFilelicenseName(''); | |||
| actionRef.current?.reload(); | |||
| }, | |||
| onCancel() { | |||
| console.log('Cancel'); | |||
| }, | |||
| okText: '保存', | |||
| cancelText: '取消', | |||
| centered: true, | |||
| }); | |||
| }}>更换图片</Button>, | |||
| <Popconfirm | |||
| title="是否删除" | |||
| onConfirm={(e) => { | |||
| delArticle({ id: record.id }).then(res => { | |||
| @@ -142,14 +188,15 @@ const PagesMainInformationArticleTable: React.FC = ({ dispatch, openModel, getId | |||
| okText="删除" | |||
| cancelText="取消" | |||
| > | |||
| <a | |||
| <Button | |||
| type='link' | |||
| key="delete" | |||
| > | |||
| 删除 | |||
| </a> | |||
| </Button> | |||
| </Popconfirm> | |||
| ], | |||
| }, | |||
| ], | |||
| }, | |||
| ]} | |||
| rowKey="id" | |||
| pagination={{ | |||
| @@ -5,7 +5,7 @@ import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
| import { | |||
| ProFormText, | |||
| ProFormSegmented, | |||
| ProFormSelect, | |||
| ProFormRadio, | |||
| ProForm | |||
| } from '@ant-design/pro-components'; | |||
| import { ConfigProvider, Flex, Space, Modal, message, Image, Row, Col, Switch } from 'antd'; | |||
| @@ -88,7 +88,8 @@ const PagesMainInformationSectionCreate: React.FC = ({ dispatch, dictModel, open | |||
| cover_img: '', | |||
| parent_id: -1, | |||
| description: '', | |||
| display: 1 | |||
| display: 1, | |||
| park: 2 | |||
| } | |||
| } | |||
| }} | |||
| @@ -125,55 +126,59 @@ const PagesMainInformationSectionCreate: React.FC = ({ dispatch, dictModel, open | |||
| } | |||
| }} | |||
| > | |||
| <ProFormText | |||
| label="栏目名称" | |||
| name="name" | |||
| placeholder="请输入栏目名称" | |||
| rules={[{ required: true, message: '请输入栏目名称' }]} | |||
| /> | |||
| <ProFormText | |||
| label="栏目编码,用英文字母表示,编码不能与其他栏目编码重复" | |||
| name="code" | |||
| placeholder="请输入栏目编码,用英文字母表示,编码不能与其他栏目编码重复" | |||
| rules={[{ required: true, message: '请输入栏目编码,用英文字母表示,编码不能与其他栏目编码重复' }]} | |||
| /> | |||
| <ProFormText | |||
| name="description" | |||
| label="描述" | |||
| placeholder="请输入描述" | |||
| rules={[{ required: true, message: '请输入描述' } | |||
| ]} | |||
| /> | |||
| <Row gutter={[16, 16]}> | |||
| { | |||
| detail ? | |||
| <Col span={24} style={{ display: 'flex' }}> | |||
| <UploadModel multiple={false} form_name="cover_img" image_length={1} uploadTxt="上传封面图" image_type={3} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| {uploadedFilephotoName ? <Image src={`${Imageprefix}${uploadedFilephotoName}`} style={{ marginLeft: '16px', marginTop: '32px', width: '100px', height: '100px' }}></Image> : <Image src={`${Imageprefix}${detail?.cover_img}`} style={{ marginLeft: '16px', marginTop: '32px', width: '100px', height: '100px' }}></Image>} | |||
| </Col> : <> | |||
| <Col span={24} style={{ display: 'flex' }}> | |||
| <UploadModel multiple={false} form_name="cover_img" image_length={1} uploadTxt="上传封面图" image_type={3} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| {uploadedFilephotoName ? <Col span={8}> <Image src={`${Imageprefix}${uploadedFilephotoName}`} style={{ marginTop: '32px', width: '100px', height: '100px' }}></Image> </Col> : ''} | |||
| </Col> | |||
| </> | |||
| } | |||
| <Col span={24}> | |||
| <UploadModel multiple={false} form_name="cover_img" image_length={1} uploadTxt="上传封面图" image_type={3} imageUrl={detail?.photo} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormText | |||
| label="栏目名称" | |||
| name="name" | |||
| placeholder="请输入栏目名称" | |||
| rules={[{ required: true, message: '请输入栏目名称' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={16}> | |||
| <ProFormText | |||
| label="栏目编码,用英文字母表示,不可重复" | |||
| name="code" | |||
| placeholder="栏目编码,用英文字母表示,不可重复" | |||
| rules={[{ required: true, message: '请输入栏目编码,用英文字母表示,不可重' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormText | |||
| name="description" | |||
| label="描述" | |||
| placeholder="请输入描述" | |||
| rules={[{ required: true, message: '请输入描述' } | |||
| ]} | |||
| /> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormRadio.Group | |||
| name="display" | |||
| label="是否显示" | |||
| request={async () => [ | |||
| { label: '是', value: 1 }, | |||
| { label: '否', value: 2 } | |||
| ]} | |||
| /> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormRadio.Group | |||
| name="park" | |||
| label="是否是科创园栏目" | |||
| request={async () => [ | |||
| { label: '是', value: 1 }, | |||
| { label: '否', value: 2 } | |||
| ]} | |||
| /> | |||
| </Col> | |||
| </Row> | |||
| <ProFormSegmented | |||
| name="display" | |||
| label="是否显示" | |||
| request={async () => [ | |||
| { label: '是', value: 1 }, | |||
| { label: '否', value: 2 } | |||
| ]} | |||
| /> | |||
| <ProFormSegmented | |||
| name="park" | |||
| label="是否是科创园栏目" | |||
| request={async () => [ | |||
| { label: '是', value: 1 }, | |||
| { label: '否', value: 2 } | |||
| ]} | |||
| /> | |||
| </ProForm> | |||
| </Modal> | |||
| </ConfigProvider> | |||
| @@ -2,11 +2,12 @@ import { useRef, useState, useEffect } from 'react'; | |||
| import { connect, history } from '@umijs/max'; | |||
| import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
| import { | |||
| ProTable, TableDropdown | |||
| ProTable, ProForm | |||
| } from '@ant-design/pro-components'; | |||
| import { Button, Image, ConfigProvider, Popconfirm, message,Tag } from 'antd'; | |||
| import { Button, Image, ConfigProvider, Popconfirm, message, Modal } from 'antd'; | |||
| import { listSection, delSection } from '@/apis/api'; | |||
| import { Imageprefix } from '@/constants'; | |||
| import UploadModel from '@/components/Common/upload'; | |||
| const PagesMainInformationSectionTable: React.FC = ({ dispatch, openModel, getId }: any) => { | |||
| const actionRef = useRef<ActionType>(); | |||
| @@ -21,10 +22,20 @@ const PagesMainInformationSectionTable: React.FC = ({ dispatch, openModel, getId | |||
| useEffect(() => { | |||
| if (!openModel.openModal) { | |||
| actionRef.current.reload(); | |||
| actionRef.current?.reload(); | |||
| } | |||
| }, [openModel.openModal]) | |||
| const [uploadedFilephotoName, setUploadedFilephotoName] = useState<string>(''); | |||
| const uploadedFilephotoNameRef = useRef<string>(''); | |||
| const handleFileUploadedphoto = (filename: string) => { | |||
| setUploadedFilephotoName(filename); | |||
| }; | |||
| useEffect(() => { | |||
| uploadedFilephotoNameRef.current = uploadedFilephotoName; | |||
| }, [uploadedFilephotoName]) | |||
| return ( | |||
| <> | |||
| <ConfigProvider | |||
| @@ -36,43 +47,52 @@ const PagesMainInformationSectionTable: React.FC = ({ dispatch, openModel, getId | |||
| }} | |||
| > | |||
| <ProTable | |||
| size='small' | |||
| scroll={{ y: 480, x: 'auto' }} | |||
| bordered={true} | |||
| scroll={{ x: 1300 }} | |||
| actionRef={actionRef} | |||
| dataSource={list} | |||
| search={{ span: 8, labelWidth: 'auto' }} | |||
| rowSelection={{ | |||
| type: 'checkbox' | |||
| }} | |||
| columns={[ | |||
| { | |||
| title: 'ID', | |||
| dataIndex: 'id', | |||
| width: 100, | |||
| width: 200, | |||
| search: false, | |||
| }, | |||
| { | |||
| title: '栏目名称', | |||
| dataIndex: 'name' | |||
| dataIndex: 'name', | |||
| width: 200, | |||
| }, | |||
| { | |||
| title: '栏目编码', | |||
| dataIndex: 'code' | |||
| dataIndex: 'code', | |||
| width: 200, | |||
| }, | |||
| { | |||
| title: '可见', | |||
| dataIndex: 'display', | |||
| search: false, | |||
| render: (_, record) => (<> | |||
| { | |||
| <> | |||
| {record.display === 1 ? <Tag color="green">可见</Tag> : <Tag>不可见</Tag>} | |||
| </> | |||
| } | |||
| </>), | |||
| width: 200, | |||
| valueEnum: { | |||
| 0: { text: '全部' }, | |||
| 1: { | |||
| text: '可见', | |||
| status: 'Processing' | |||
| }, | |||
| 2: { | |||
| text: '不可见', | |||
| status: 'Error' | |||
| }, | |||
| }, | |||
| }, | |||
| { | |||
| title: '封面图', | |||
| dataIndex: 'cover_img', | |||
| search: false, | |||
| width: 200, | |||
| render: (_, record) => (<> | |||
| <Image src={`${Imageprefix}${record.cover_img}`} width={40} height={40} /> | |||
| </> | |||
| @@ -81,19 +101,41 @@ const PagesMainInformationSectionTable: React.FC = ({ dispatch, openModel, getId | |||
| { | |||
| title: '描述', | |||
| dataIndex: 'description', | |||
| width: 200, | |||
| search: false | |||
| }, | |||
| { | |||
| title: '操作', | |||
| width: 300, | |||
| key: 'option', | |||
| valueType: 'option', | |||
| fixed: 'right', | |||
| render: (_, record, action) => [ | |||
| <Button key='1' type='link' onClick={() => { | |||
| setId(record) | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}>编辑</Button>, | |||
| <Button size='small' type='link' onClick={() => { | |||
| Modal.confirm({ | |||
| title: '更换图片', | |||
| content: (<> | |||
| <ProForm submitter={{ render: false }}> | |||
| <UploadModel multiple={false} form_name="photo" image_length={1} uploadTxt="更换图片" image_type={3} imageUrl={record.photo} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| </ProForm> | |||
| </>), | |||
| async onOk() { | |||
| // let info = await GetCompanyInfo({ id: record.id }); | |||
| // let res = await updateCompany({ ...info.data, license_path: uploadedFilelicenseNameRef.current }); | |||
| // setUploadedFilelicenseName(''); | |||
| actionRef.current?.reload(); | |||
| }, | |||
| onCancel() { | |||
| console.log('Cancel'); | |||
| }, | |||
| okText: '保存', | |||
| cancelText: '取消', | |||
| centered: true, | |||
| }); | |||
| }}>更换图片</Button>, | |||
| <Button key='1' type='link' onClick={() => { | |||
| record.nextlevel = record.id // 添加下级栏目,把id赋值给nextlevel | |||
| setId(record) | |||
| @@ -110,11 +152,13 @@ const PagesMainInformationSectionTable: React.FC = ({ dispatch, openModel, getId | |||
| okText="删除" | |||
| cancelText="取消" | |||
| > | |||
| <a | |||
| <Button | |||
| danger | |||
| type='link' | |||
| key="delete" | |||
| > | |||
| 删除 | |||
| </a> | |||
| </Button> | |||
| </Popconfirm> | |||
| ], | |||
| }, | |||
| @@ -149,12 +193,65 @@ const PagesMainInformationSectionTable: React.FC = ({ dispatch, openModel, getId | |||
| }) | |||
| } | |||
| headerTitle="栏目/频道" | |||
| toolBarRender={() => [ | |||
| <Button type="primary" onClick={() => { | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}> | |||
| 添加栏目/频道 | |||
| </Button> | |||
| toolBarRender={() => [<Button type="primary" onClick={() => { | |||
| Modal.confirm({ | |||
| title: '请选择对批量数据进行何种操作', | |||
| content: (<> | |||
| <h4 style={{ fontWeight: 'bold' }}>状态:</h4> | |||
| <Radio.Group size='small' onChange={async (e) => { | |||
| actionRef.current?.reload(); | |||
| }}> | |||
| <Row gutter={[20, 20]} style={{ padding: 20 }}> | |||
| <Col span={12}> | |||
| <Radio value={1}>开启</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>关闭</Radio> | |||
| </Col> | |||
| </Row> | |||
| </Radio.Group> | |||
| <h4 style={{ fontWeight: 'bold' }}>时长:</h4> | |||
| <Radio.Group size='small' onChange={async (e) => { | |||
| actionRef.current?.reload(); | |||
| }}> | |||
| <Row gutter={[20, 20]} style={{ padding: 20 }}> | |||
| <Col span={12}> | |||
| <Radio value={1}>1天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>3天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>7天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>15天</Radio> | |||
| </Col> | |||
| <Col span={12}> | |||
| <Radio value={1}>30天</Radio> | |||
| </Col> | |||
| </Row> | |||
| </Radio.Group> | |||
| </>), | |||
| onOk() { | |||
| }, | |||
| onCancel() { | |||
| console.log('Cancel'); | |||
| }, | |||
| okText: '保存', | |||
| cancelText: '取消', | |||
| centered: true | |||
| }); | |||
| }}> | |||
| 批量管理可见状态 | |||
| </Button>, | |||
| <Button type="primary" onClick={() => { | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}> | |||
| 添加栏目/频道 | |||
| </Button> | |||
| ]} | |||
| expandable={{ | |||
| childrenColumnName: 'childs', // 指定子节点数据的字段名 | |||
| @@ -4,7 +4,10 @@ import type { ActionType } from '@ant-design/pro-components'; | |||
| import { | |||
| ProTable | |||
| } from '@ant-design/pro-components'; | |||
| import { Button, ConfigProvider, Select } from 'antd'; | |||
| import { | |||
| Button, ConfigProvider, Modal, | |||
| Radio | |||
| } from 'antd'; | |||
| import { GetCustomerList, GetCustomerDetail, PostCustomerUpdate, PostCustomerDel } from '@/apis/api'; | |||
| import { Imageprefix } from '@/constants'; | |||
| @@ -40,9 +43,15 @@ const PagesMainJobseekerAccountTable: React.FC = ({ dispatch, getId, dictModel, | |||
| > | |||
| <ProTable | |||
| scroll={{ x: 1300 }} | |||
| size='small' | |||
| scroll={{ y: 480, x: 'auto' }} | |||
| bordered={true} | |||
| actionRef={actionRef} | |||
| dataSource={list} | |||
| search={{ span: 8, labelWidth: 'auto' }} | |||
| rowSelection={{ | |||
| type: 'checkbox' | |||
| }} | |||
| columns={[ | |||
| { | |||
| title: '用户', | |||
| @@ -51,40 +60,38 @@ const PagesMainJobseekerAccountTable: React.FC = ({ dispatch, getId, dictModel, | |||
| }, { | |||
| title: '邮箱', | |||
| dataIndex: 'email', | |||
| search: false | |||
| search: false, | |||
| width: 200 | |||
| }, | |||
| { | |||
| title: '联系方式', | |||
| dataIndex: 'mobile', | |||
| search: false | |||
| search: false, | |||
| width: 200 | |||
| }, | |||
| { | |||
| title: '登录次数', | |||
| dataIndex: 'login_count', | |||
| search: false | |||
| search: false, | |||
| width: 200 | |||
| }, | |||
| { | |||
| title: '账号状态', | |||
| dataIndex: 'status', | |||
| width: 200, | |||
| render: (_, record) => (<> | |||
| { | |||
| <> | |||
| <Select style={{ width: '100%' }} | |||
| value={record.status === 1 ? '使用' : '禁用'} | |||
| options={[{ name: '正常', id: 1 }, { name: '禁用', id: 2 }]} | |||
| fieldNames={selectfieldNames} | |||
| onChange={(value) => { | |||
| PostCustomerUpdate({ | |||
| id: record.id, | |||
| status: value | |||
| }).then(res => { | |||
| actionRef.current.reload() | |||
| }) | |||
| }}> | |||
| </Select> | |||
| </> | |||
| } | |||
| <Radio.Group size='small' value={record.status} onChange={async (e) => { | |||
| PostCustomerUpdate({ | |||
| id: record.id, | |||
| status: e.target.value | |||
| }).then(res => { | |||
| actionRef.current?.reload() | |||
| }) | |||
| actionRef.current?.reload(); | |||
| }}> | |||
| <Radio value={1}>使用中</Radio> | |||
| <Radio value={2}>已禁用</Radio> | |||
| </Radio.Group> | |||
| </>), | |||
| valueType: 'select', | |||
| valueEnum: { | |||
| @@ -100,14 +107,13 @@ const PagesMainJobseekerAccountTable: React.FC = ({ dispatch, getId, dictModel, | |||
| { | |||
| title: '注册日期', | |||
| dataIndex: 'created_at', | |||
| search: false | |||
| search: false, | |||
| width: 200, | |||
| }, | |||
| { | |||
| title: '操作', | |||
| width: 100, | |||
| key: 'option', | |||
| valueType: 'option', | |||
| fixed: 'right', | |||
| render: (_, record, action) => [ | |||
| <Button key='1' type='link' onClick={() => { | |||
| setId(record) | |||
| @@ -148,6 +154,32 @@ const PagesMainJobseekerAccountTable: React.FC = ({ dispatch, getId, dictModel, | |||
| }) | |||
| } | |||
| headerTitle="简历列表" | |||
| toolBarRender={() => [ | |||
| <Button type="primary" onClick={() => { | |||
| Modal.confirm({ | |||
| title: '请选择对批量数据进行何种操作', | |||
| content: (<> | |||
| <Radio.Group size='small' onChange={async (e) => { | |||
| actionRef.current?.reload(); | |||
| }}> | |||
| <Radio value={1}>开通</Radio> | |||
| <Radio value={2}>禁用</Radio> | |||
| </Radio.Group> | |||
| </>), | |||
| onOk() { | |||
| }, | |||
| onCancel() { | |||
| console.log('Cancel'); | |||
| }, | |||
| okText: '保存', | |||
| cancelText: '取消', | |||
| centered: true | |||
| }); | |||
| }}> | |||
| 批量管理账号 | |||
| </Button>, | |||
| ]} | |||
| /> | |||
| </ConfigProvider> | |||
| @@ -43,7 +43,7 @@ const PagesMainJobseekerListCreate: React.FC = ({ dispatch, dictModel, openModel | |||
| maskClosable={false} | |||
| footer={null} | |||
| destroyOnClose | |||
| width={'80%'} | |||
| width={1200} | |||
| onCancel={() => { | |||
| dispatch({ type: 'openModel/getOpenModal', payload: false }) | |||
| }} | |||
| @@ -53,7 +53,7 @@ const PagesMainJobseekerListResumeBasic: React.FC = ({ dispatch, dictModel, open | |||
| theme={{ | |||
| token: { | |||
| colorPrimary: '#4FBE70', | |||
| } , components: { | |||
| }, components: { | |||
| Segmented: { | |||
| itemSelectedBg: '#19be6e', | |||
| itemSelectedColor: '#ffffff' | |||
| @@ -68,7 +68,7 @@ const PagesMainJobseekerListResumeBasic: React.FC = ({ dispatch, dictModel, open | |||
| let res = await GetJobapplicantDetail({ customer_id: id.customer_id }) | |||
| res.data.reg_arr = [ | |||
| res.data.reg_level1 ? res.data.reg_level1 : 0, | |||
| res.data.reg_level2? res.data.reg_level2 : 0, | |||
| res.data.reg_level2 ? res.data.reg_level2 : 0, | |||
| res.data.reg_level3 ? res.data.reg_level3 : 0, | |||
| res.data.reg_level4 ? res.data.reg_level4 : 0 | |||
| ] | |||
| @@ -131,19 +131,9 @@ const PagesMainJobseekerListResumeBasic: React.FC = ({ dispatch, dictModel, open | |||
| }} | |||
| > | |||
| <Row gutter={[16, 16]}> | |||
| { | |||
| detail ? | |||
| <Col span={24} style={{ display: 'flex' }}> | |||
| <UploadModel multiple={false} form_name="photo" image_length={1} uploadTxt="个人照片" image_type={3} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| {uploadedFilephotoName ? <Image src={`${Imageprefix}${uploadedFilephotoName}`} style={{ marginLeft: '16px', marginTop: '32px', width: '100px', height: '100px' }}></Image> : <Image src={`${Imageprefix}${detail?.photo}`} style={{ marginLeft: '16px', marginTop: '32px', width: '100px', height: '100px' }}></Image>} | |||
| </Col> : <> | |||
| <Col span={24} style={{ display: 'flex' }}> | |||
| <UploadModel multiple={false} form_name="photo" image_length={1} uploadTxt="个人照片" image_type={3} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| {uploadedFilephotoName ? <Col span={8}> <Image src={`${Imageprefix}${uploadedFilephotoName}`} style={{ marginTop: '32px', width: '100px', height: '100px' }}></Image> </Col> : ''} | |||
| </Col> | |||
| </> | |||
| } | |||
| <Col span={24} style={{ display: 'flex' }}> | |||
| <UploadModel multiple={false} form_name="photo" image_length={1} uploadTxt="个人照片" image_type={3} imageUrl={uploadedFilephotoName} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| </Col> | |||
| <Col span={8}> | |||
| <ProFormText | |||
| label="姓名" | |||
| @@ -183,8 +173,8 @@ const PagesMainJobseekerListResumeBasic: React.FC = ({ dispatch, dictModel, open | |||
| }, () => ({ | |||
| validator: (rule, value) => { | |||
| let info = verifyIdCard(value); | |||
| if (typeof (info) == 'boolean') { | |||
| return Promise.resolve(); | |||
| } | |||
| @@ -59,98 +59,84 @@ const PagesMainJobseekerListResumeCredetial: React.FC = ({ dispatch, dictModel, | |||
| } | |||
| }} | |||
| columns={[ { | |||
| columns={[{ | |||
| title: 'ID', | |||
| dataIndex: 'id', | |||
| editable: false, | |||
| width: 100 | |||
| }, | |||
| { | |||
| title: '证书名称', | |||
| dataIndex: 'name', | |||
| formItemProps: { | |||
| rules: [ | |||
| { | |||
| required: true, | |||
| message: '请输入证书名称', | |||
| }, | |||
| ], | |||
| }, | |||
| }, | |||
| { | |||
| title: '证书描述', | |||
| dataIndex: 'description', | |||
| formItemProps: { | |||
| rules: [ | |||
| { | |||
| required: true, | |||
| message: '请输入证书描述', | |||
| }, | |||
| ], | |||
| }, | |||
| { | |||
| title: '证书名称', | |||
| dataIndex: 'name', | |||
| formItemProps: { | |||
| rules: [ | |||
| { | |||
| required: true, | |||
| message: '请输入证书名称', | |||
| }, | |||
| ], | |||
| }, | |||
| { | |||
| title: '证书', | |||
| dataIndex: 'certificate_photo', | |||
| formItemProps: { | |||
| rules: [ | |||
| { | |||
| required: true, | |||
| message: '请上传证书', | |||
| }, | |||
| ], | |||
| }, | |||
| render: (text, record) => ( | |||
| <> | |||
| <Image src={`${Imageprefix + record.certificate_photo}`} width={40} height={40} preview={false} /> | |||
| </> | |||
| ), | |||
| renderFormItem: (_, record, { isEditable }) => { | |||
| return isEditable ? <> | |||
| { | |||
| <Row> | |||
| <Col span={24} style={{ display: 'flex' }}> | |||
| <UploadModel multiple={false} form_name="certificate_photo" image_length={1} uploadTxt="证书" image_type={2} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| {uploadedFilephotoName ? <Image src={`${Imageprefix}${uploadedFilephotoName}`} style={{ marginLeft: '16px', width: '100px', height: '100px' }}></Image> : <Image src={`${Imageprefix}${record?.certificate_photo}`} style={{ marginLeft: '16px', marginTop: '32px', width: '100px', height: '100px' }}></Image>} | |||
| </Col> | |||
| </Row> | |||
| } | |||
| </> : | |||
| <> | |||
| { | |||
| <Row> | |||
| <Col span={24} style={{ display: 'flex' }}> | |||
| <UploadModel multiple={false} form_name="certificate_photo" image_length={1} uploadTxt="证书" image_type={2} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| {uploadedFilephotoName ? <Col span={8}> <Image src={`${Imageprefix}${uploadedFilephotoName}`} style={{marginLeft: '16px', width: '100px', height: '100px' }}></Image> </Col> : ''} | |||
| </Col> | |||
| </Row> | |||
| } | |||
| </>; | |||
| }, | |||
| }, | |||
| { | |||
| title: '证书描述', | |||
| dataIndex: 'description', | |||
| formItemProps: { | |||
| rules: [ | |||
| { | |||
| required: true, | |||
| message: '请输入证书描述', | |||
| }, | |||
| ], | |||
| }, | |||
| { | |||
| title: '操作', | |||
| valueType: 'option', | |||
| width: 200, | |||
| render: (text, record, _, action) => [ | |||
| <a | |||
| key="editable" | |||
| onClick={() => { | |||
| action?.startEditable?.(record.id); | |||
| }} | |||
| > | |||
| 编辑 | |||
| </a>, | |||
| <a | |||
| key="delete" | |||
| onClick={() => { | |||
| }} | |||
| > | |||
| 删除 | |||
| </a>, | |||
| }, | |||
| { | |||
| title: '证书', | |||
| dataIndex: 'certificate_photo', | |||
| formItemProps: { | |||
| rules: [ | |||
| { | |||
| required: true, | |||
| message: '请上传证书', | |||
| }, | |||
| ], | |||
| }, | |||
| render: (text, record) => ( | |||
| <> | |||
| <Image src={`${Imageprefix + record.certificate_photo}`} width={40} height={40} preview={false} /> | |||
| </> | |||
| ), | |||
| renderFormItem: (_, record, { isEditable }) => { | |||
| return isEditable ? <> | |||
| <UploadModel multiple={false} form_name="certificate_photo" image_length={1} uploadTxt="证书" image_type={2} imageUrl={record.certificate_photo} onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| </> : | |||
| <> | |||
| <UploadModel multiple={false} form_name="certificate_photo" image_length={1} uploadTxt="证书" image_type={2} imageUrl='' onUploadComplete={handleFileUploadedphoto}></UploadModel> | |||
| </>; | |||
| }, | |||
| }, | |||
| { | |||
| title: '操作', | |||
| valueType: 'option', | |||
| width: 200, | |||
| render: (text, record, _, action) => [ | |||
| <a | |||
| key="editable" | |||
| onClick={() => { | |||
| action?.startEditable?.(record.id); | |||
| }} | |||
| > | |||
| 编辑 | |||
| </a>, | |||
| <a | |||
| key="delete" | |||
| onClick={() => { | |||
| }} | |||
| > | |||
| 删除 | |||
| </a>, | |||
| ], | |||
| }, | |||
| ]} | |||
| editable={{ | |||
| type: 'single', | |||
| @@ -4,7 +4,7 @@ import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
| import { | |||
| ProTable, ProForm, ProFormSelect, ProFormText, ProFormDependency | |||
| } from '@ant-design/pro-components'; | |||
| import { Button, ConfigProvider, Image, message, Select, Input, Row, Col, Space, Flex } from 'antd'; | |||
| import { Button, ConfigProvider, Image, message, Modal, Input, Row, Col, Space, Radio, Descriptions } from 'antd'; | |||
| import { PostJobseekerList, PostJobseekerExport, PostJobapplicantUpdate } from '@/apis/api'; | |||
| import { Imageprefix } from '@/constants'; | |||
| @@ -50,6 +50,45 @@ const PagesMainJobseekerListTable: React.FC = ({ dispatch, getId, dictModel, ope | |||
| dispatch({ type: 'dictModel/getList', payload: { code: 2027, type: 'setIndustryPostList' } }) | |||
| dispatch({ type: 'dictModel/getList', payload: { code: 2010, type: 'setPoliticalList' } }) | |||
| }, []) | |||
| const expandedRowRender = (record) => { | |||
| return ( | |||
| <> | |||
| <Space direction='vertical' style={{ width: '100%' }}> | |||
| <Descriptions title="基本信息" bordered column={3} contentStyle={{ fontWeight: 'bold' }} labelStyle={{ width: 180 }}> | |||
| <Descriptions.Item label="英语">{record.english_txt}</Descriptions.Item> | |||
| <Descriptions.Item label="国语">{record.mandarin_txt}</Descriptions.Item> | |||
| <Descriptions.Item label="粤语">{record.cantonese_txt}</Descriptions.Item> | |||
| <Descriptions.Item label="职称">{record.title_txt}</Descriptions.Item> | |||
| <Descriptions.Item label="政治面貌">{record.political_status_txt}</Descriptions.Item> | |||
| <Descriptions.Item label="月薪要求范围">{record.salary_range_txt}</Descriptions.Item> | |||
| <Descriptions.Item label="审核状态"> | |||
| <Radio.Group size='small' defaultValue={record.status} onChange={async (e) => { | |||
| let res = await PostJobapplicantUpdate({ customer_id: record.customer_id, id: record.id, status: e.target.value }); | |||
| actionRef.current?.reload(); | |||
| }}> | |||
| <Radio value={1}>待审</Radio> | |||
| <Radio value={2}>通过</Radio> | |||
| <Radio value={3}>不通过</Radio> | |||
| </Radio.Group> | |||
| </Descriptions.Item> | |||
| { | |||
| record.status == 3 ? <> | |||
| <Descriptions.Item label="不通过原因"> | |||
| <Input size='small' placeholder='输入原因,按回车键保存' defaultValue={record.status_txt} onPressEnter={async (e) => { | |||
| let res = await PostJobapplicantUpdate({ customer_id: record.customer_id, id: record.id, status: 3, audit_memo: e.target.value }); | |||
| actionRef.current?.reload(); | |||
| }}></Input> | |||
| </Descriptions.Item> | |||
| </> : record.status_txt | |||
| } | |||
| </Descriptions> | |||
| </Space > | |||
| </> | |||
| ); | |||
| }; | |||
| return ( | |||
| <> | |||
| <ConfigProvider | |||
| @@ -63,16 +102,23 @@ const PagesMainJobseekerListTable: React.FC = ({ dispatch, getId, dictModel, ope | |||
| <ProTable | |||
| size='small' | |||
| scroll={{ y: 480, x: 'auto' }} | |||
| bordered={true} | |||
| scroll={{ x: 1300 }} | |||
| actionRef={actionRef} | |||
| dataSource={list} | |||
| search={{ span: 8, labelWidth: 'auto' }} | |||
| rowSelection={{ | |||
| type: 'checkbox' | |||
| }} | |||
| expandable={{ | |||
| expandedRowRender | |||
| }} | |||
| columns={[ | |||
| { | |||
| title: '筛选日期', | |||
| dataIndex: 'date_range', | |||
| hidden: true, | |||
| width: 120, | |||
| width: 200, | |||
| valueType: 'dateRange', | |||
| }, | |||
| { | |||
| @@ -82,7 +128,7 @@ const PagesMainJobseekerListTable: React.FC = ({ dispatch, getId, dictModel, ope | |||
| }, { | |||
| title: '性别', | |||
| dataIndex: 'gender', | |||
| width: 80, | |||
| width: 200, | |||
| valueType: 'select', | |||
| valueEnum: { | |||
| '男': '男', | |||
| @@ -91,12 +137,12 @@ const PagesMainJobseekerListTable: React.FC = ({ dispatch, getId, dictModel, ope | |||
| }, { | |||
| title: '教育程度', | |||
| dataIndex: 'education_txt', | |||
| width: 120, | |||
| width: 200, | |||
| search: false | |||
| }, { | |||
| title: '教育程度', | |||
| dataIndex: 'education', | |||
| width: 120, | |||
| width: 200, | |||
| hidden: true, | |||
| valueType: 'select', | |||
| fieldProps: { | |||
| @@ -105,14 +151,9 @@ const PagesMainJobseekerListTable: React.FC = ({ dispatch, getId, dictModel, ope | |||
| } | |||
| }, | |||
| { | |||
| title: '英语', | |||
| dataIndex: 'english_txt', | |||
| width: 120, | |||
| search: false | |||
| }, { | |||
| title: '英语', | |||
| dataIndex: 'english', | |||
| width: 120, | |||
| width: 200, | |||
| hidden: true, | |||
| valueType: 'select', | |||
| fieldProps: { | |||
| @@ -121,31 +162,19 @@ const PagesMainJobseekerListTable: React.FC = ({ dispatch, getId, dictModel, ope | |||
| } | |||
| }, | |||
| { | |||
| title: '国语', | |||
| dataIndex: 'mandarin_txt', | |||
| width: 120, | |||
| search: false | |||
| }, { | |||
| title: '国语', | |||
| dataIndex: 'mandarin', | |||
| width: 120, | |||
| width: 200, | |||
| hidden: true, | |||
| valueType: 'select', | |||
| fieldProps: { | |||
| fieldNames: selectfieldNames, | |||
| options: dictModel.degreeList | |||
| } | |||
| }, { | |||
| title: '粤语', | |||
| dataIndex: 'cantonese_txt', | |||
| width: 120, | |||
| search: false | |||
| }, { | |||
| title: '粤语', | |||
| dataIndex: 'cantonese', | |||
| width: 120, | |||
| width: 200, | |||
| hidden: true, | |||
| valueType: 'select', | |||
| fieldProps: { | |||
| @@ -154,14 +183,9 @@ const PagesMainJobseekerListTable: React.FC = ({ dispatch, getId, dictModel, ope | |||
| } | |||
| }, | |||
| { | |||
| title: '职称', | |||
| dataIndex: 'title_txt', | |||
| width: 120, | |||
| search: false | |||
| }, { | |||
| title: '职称', | |||
| dataIndex: 'title', | |||
| width: 120, | |||
| width: 200, | |||
| hidden: true, | |||
| valueType: 'select', | |||
| fieldProps: { | |||
| @@ -170,29 +194,19 @@ const PagesMainJobseekerListTable: React.FC = ({ dispatch, getId, dictModel, ope | |||
| } | |||
| }, | |||
| { | |||
| title: '政治面貌', | |||
| dataIndex: 'political_status_txt', | |||
| width: 120, | |||
| search: false | |||
| }, { | |||
| title: '政治面貌', | |||
| dataIndex: 'political_status', | |||
| width: 120, | |||
| width: 200, | |||
| hidden: true, | |||
| valueType: 'select', | |||
| fieldProps: { | |||
| fieldNames: selectfieldNames, | |||
| options: dictModel.politicalList | |||
| } | |||
| }, { | |||
| title: '月薪要求范围', | |||
| dataIndex: 'salary_range_txt', | |||
| width: 120, | |||
| search: false | |||
| }, { | |||
| title: '月薪要求', | |||
| dataIndex: 'salary_range_desire', | |||
| width: 120, | |||
| width: 200, | |||
| hidden: true, | |||
| valueType: 'select', | |||
| fieldProps: { | |||
| @@ -202,64 +216,21 @@ const PagesMainJobseekerListTable: React.FC = ({ dispatch, getId, dictModel, ope | |||
| }, | |||
| { | |||
| title: '审核状态', | |||
| dataIndex: 'status_txt', | |||
| width: 120, | |||
| search: false, | |||
| render: (_, record) => (<> | |||
| <Select style={{ width: 100 }} size='small' defaultValue={record.status_txt} options={[ | |||
| { | |||
| label: '待审', | |||
| value: 1, | |||
| }, | |||
| { | |||
| label: '通过', | |||
| value: 2, | |||
| }, | |||
| { | |||
| label: '不通过', | |||
| value: 3, | |||
| }, | |||
| ]} onChange={async (value) => { | |||
| let res = await PostJobapplicantUpdate({ customer_id: record.customer_id, id: record.id, status: value }); | |||
| actionRef.current.reload(); | |||
| }} /> | |||
| </>) | |||
| }, | |||
| { | |||
| title: '审核原因', | |||
| dataIndex: 'audit_memo', | |||
| dataIndex: 'status', | |||
| width: 200, | |||
| search: false, | |||
| render: (_, record) => ( | |||
| <> | |||
| { | |||
| record.status == 3 ? <> | |||
| <Input size='small' placeholder='输入原因,按回车键保存' onPressEnter={async (e) => { | |||
| let res = await PostJobapplicantUpdate({ customer_id: record.customer_id, id: record.id, status: 3, audit_memo: e.target.value }); | |||
| actionRef.current.reload(); | |||
| }}></Input></> : record.status_txt | |||
| } | |||
| </> | |||
| ) | |||
| hidden: true, | |||
| valueType: 'select', | |||
| valueEnum: { | |||
| 0: '全部', | |||
| 1: '待审核', | |||
| 2: '审核通过', | |||
| 3: '审核不通过' | |||
| } | |||
| }, | |||
| // { | |||
| // title: '审核状态', | |||
| // dataIndex: 'status', | |||
| // width: 120, | |||
| // hidden: true, | |||
| // valueType: 'select', | |||
| // valueEnum: { | |||
| // 0: '全部', | |||
| // 1: '待审核', | |||
| // 2: '审核通过', | |||
| // 3: '审核不通过' | |||
| // } | |||
| // }, | |||
| { | |||
| title: '简历是否可见', | |||
| dataIndex: 'hide_resume', | |||
| width: 120, | |||
| width: 200, | |||
| search: false, | |||
| render: (_, record) => (<> | |||
| { | |||
| @@ -273,7 +244,7 @@ const PagesMainJobseekerListTable: React.FC = ({ dispatch, getId, dictModel, ope | |||
| { | |||
| title: '简历是否在家政模块可见', | |||
| dataIndex: 'house_keeping_status', | |||
| width: 120, | |||
| width: 200, | |||
| search: false, | |||
| render: (_, record) => (<> | |||
| { | |||
| @@ -286,10 +257,8 @@ const PagesMainJobseekerListTable: React.FC = ({ dispatch, getId, dictModel, ope | |||
| }, | |||
| { | |||
| title: '操作', | |||
| width: 400, | |||
| key: 'option', | |||
| valueType: 'option', | |||
| fixed: 'right', | |||
| render: (_, record, action) => [ | |||
| <Button key='1' type='link' onClick={() => { | |||
| setId(record) | |||
| @@ -349,17 +318,48 @@ const PagesMainJobseekerListTable: React.FC = ({ dispatch, getId, dictModel, ope | |||
| setTotal(res.data.total) | |||
| }) | |||
| } | |||
| toolBarRender={() => [ | |||
| <Button type="primary" onClick={() => { | |||
| message.info('数据导出需要时间,请耐心等待') | |||
| PostJobseekerExport().then(res => { | |||
| let url = Imageprefix + res.data.excel_url; | |||
| window.open(url); | |||
| message.info('数据导出完毕') | |||
| }) | |||
| }}> | |||
| 导出数据 | |||
| </Button> | |||
| toolBarRender={() => [<Button type="primary" onClick={(record) => { | |||
| Modal.confirm({ | |||
| title: '请选择对批量数据审核', | |||
| content: (<> | |||
| <Space direction='vertical' style={{ width: '100%', padding: 20 }}> | |||
| <Radio.Group size='small' onChange={async (e) => { | |||
| actionRef.current?.reload(); | |||
| }}> | |||
| <Radio value={2}>通过</Radio> | |||
| <Radio value={3}>不通过</Radio> | |||
| </Radio.Group> | |||
| <h4>如不通过请输入原因,按回车键保存,也可不填</h4> | |||
| <Input style={{ width: '100%' }} placeholder='此处不通过原因' defaultValue={record.status_txt} onPressEnter={async (e) => { | |||
| let res = await PostJobapplicantUpdate({ customer_id: record.customer_id, id: record.id, status: 3, audit_memo: e.target.value }); | |||
| actionRef.current?.reload(); | |||
| }}></Input> | |||
| </Space> | |||
| </>), | |||
| onOk() { | |||
| }, | |||
| onCancel() { | |||
| console.log('Cancel'); | |||
| }, | |||
| okText: '保存', | |||
| cancelText: '取消', | |||
| centered: true | |||
| }); | |||
| }}> | |||
| 批量审核 | |||
| </Button>, | |||
| <Button type="primary" onClick={() => { | |||
| message.info('数据导出需要时间,请耐心等待') | |||
| PostJobseekerExport().then(res => { | |||
| let url = Imageprefix + res.data.excel_url; | |||
| window.open(url); | |||
| message.info('数据导出完毕') | |||
| }) | |||
| }}> | |||
| 导出数据 | |||
| </Button> | |||
| ]} | |||
| headerTitle="简历列表" | |||
| /> | |||
| @@ -100,9 +100,9 @@ const PagesPermissionAccountCreate: React.FC = ({ dispatch, dictModel, openModel | |||
| }} | |||
| onFinish={async (values) => { | |||
| values.province = values.location_arr && values.location_arr.length > 0 && values.location_arr[0] ? values.location_arr[0] : 0; | |||
| values.city = values.location_arr && values.location_arr.length > 0 && values.location_arr[1] ? values.location_arr[1] : 0; | |||
| values.district = values.location_arr && values.location_arr.length > 0 && values.location_arr[2] ? values.location_arr[2] : 0; | |||
| values.street = values.location_arr && values.location_arr.length > 0 && values.location_arr[3] ? values.location_arr[3] : 0; | |||
| values.city = values.location_arr && values.location_arr.length > 0 && values.location_arr[1] ? values.location_arr[1] : 0; | |||
| values.district = values.location_arr && values.location_arr.length > 0 && values.location_arr[2] ? values.location_arr[2] : 0; | |||
| values.street = values.location_arr && values.location_arr.length > 0 && values.location_arr[3] ? values.location_arr[3] : 0; | |||
| delete values.location_arr; | |||
| values.roleids = values.roleids.join(',') | |||
| console.log(values.roleids) | |||
| @@ -118,31 +118,6 @@ const PagesPermissionAccountCreate: React.FC = ({ dispatch, dictModel, openModel | |||
| } | |||
| }} | |||
| > | |||
| <ProFormText | |||
| label="手机号" | |||
| name="mobile" | |||
| placeholder="请输入手机号" | |||
| rules={[{ required: true, message: '请输入手机号' }]} | |||
| /> | |||
| <ProFormText.Password | |||
| label="密码" | |||
| name="password" | |||
| placeholder="请输入密码" | |||
| rules={[{ required: true, message: '请输入密码' }]} | |||
| /> | |||
| <ProFormText.Password | |||
| label="确认密码" | |||
| name="repassword" | |||
| placeholder="请输入确认密码" | |||
| rules={[{ required: true, message: '请输入确认密码' }]} | |||
| /> | |||
| <ProFormText | |||
| label="昵称" | |||
| name="nickname" | |||
| placeholder="请输入昵称" | |||
| /> | |||
| <Row gutter={[16, 16]}> | |||
| { | |||
| detail ? | |||
| @@ -156,38 +131,84 @@ const PagesPermissionAccountCreate: React.FC = ({ dispatch, dictModel, openModel | |||
| </Col> | |||
| </> | |||
| } | |||
| <Col span={12}> | |||
| <ProFormText | |||
| label="手机号" | |||
| name="mobile" | |||
| placeholder="请输入手机号" | |||
| rules={[{ required: true, message: '请输入手机号' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={12}> | |||
| <ProFormText.Password | |||
| label="密码" | |||
| name="password" | |||
| placeholder="请输入密码" | |||
| rules={[{ required: true, message: '请输入密码' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={12}> | |||
| <ProFormText.Password | |||
| label="确认密码" | |||
| name="repassword" | |||
| placeholder="请输入确认密码" | |||
| rules={[{ required: true, message: '请输入确认密码' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={12}> | |||
| <ProFormText | |||
| label="昵称" | |||
| name="nickname" | |||
| placeholder="请输入昵称" | |||
| /> | |||
| </Col> | |||
| <Col span={12}> | |||
| <ProFormText | |||
| label="邮箱" | |||
| name="email" | |||
| placeholder="请输入邮箱" | |||
| /> | |||
| </Col> | |||
| <Col span={12}> | |||
| <ProFormSelect | |||
| showSearch | |||
| name="roleids" | |||
| label="选择角色" | |||
| placeholder="请选择角色" | |||
| fieldProps={{ | |||
| fieldNames: selectfieldNames, | |||
| mode: 'multiple' | |||
| }} | |||
| request={(keyword) => | |||
| GetRoleList({ page: 1, pagesize: 100, keyword: keyword.keyWords }).then(res => { | |||
| return res.data.roles.filter(item => item.id !== 3); | |||
| }) | |||
| } | |||
| rules={[{ required: true, message: '请输入确认密码' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={12}> | |||
| <ProFormCascader | |||
| label="选择社区" | |||
| name="location_arr" | |||
| fieldProps={{ | |||
| fieldNames: cascaderfieldNames, | |||
| options: dictModel.areaList, | |||
| changeOnSelect: true | |||
| }} | |||
| placeholder="企业所在地区" | |||
| /> | |||
| </Col> | |||
| </Row> | |||
| <ProFormText | |||
| label="邮箱" | |||
| name="email" | |||
| placeholder="请输入邮箱" | |||
| /> | |||
| <ProFormSelect | |||
| showSearch | |||
| name="roleids" | |||
| label="选择角色" | |||
| placeholder="请选择角色" | |||
| fieldProps={{ | |||
| fieldNames: selectfieldNames, | |||
| mode: 'multiple' | |||
| }} | |||
| request={(keyword) => | |||
| GetRoleList({ page: 1, pagesize: 100, keyword: keyword.keyWords }).then(res => { | |||
| return res.data.roles.filter(item => item.id !== 3 ); | |||
| }) | |||
| } | |||
| rules={[{ required: true, message: '请输入确认密码' }]} | |||
| /> | |||
| <ProFormCascader | |||
| label="选择社区" | |||
| name="location_arr" | |||
| fieldProps={{ | |||
| fieldNames: cascaderfieldNames, | |||
| options: dictModel.areaList, | |||
| changeOnSelect: true | |||
| }} | |||
| placeholder="企业所在地区" | |||
| /> | |||
| </ProForm> | |||
| </Modal> | |||
| @@ -5,7 +5,7 @@ import { | |||
| ProTable, TableDropdown | |||
| } from '@ant-design/pro-components'; | |||
| import { Button, Image, ConfigProvider, Tag } from 'antd'; | |||
| import { getAccount} from '@/apis/api'; | |||
| import { getAccount } from '@/apis/api'; | |||
| import { Imageprefix } from '@/constants'; | |||
| const PagesPermissionAccountTable: React.FC = ({ dispatch, openModel, getId }: any) => { | |||
| @@ -36,11 +36,11 @@ const PagesPermissionAccountTable: React.FC = ({ dispatch, openModel, getId }: a | |||
| }} | |||
| > | |||
| <ProTable | |||
| size='small' | |||
| scroll={{ y: 480, x: 'auto' }} | |||
| bordered={true} | |||
| scroll={{ x: 1300 }} | |||
| actionRef={actionRef} | |||
| dataSource={list} | |||
| search={{ span: 8, labelWidth: 'auto' }} | |||
| columns={[ | |||
| { | |||
| title: '手机号码', | |||
| @@ -64,13 +64,11 @@ const PagesPermissionAccountTable: React.FC = ({ dispatch, openModel, getId }: a | |||
| title: '角色ID', | |||
| dataIndex: 'roleids', | |||
| search: false, | |||
| }, | |||
| }, | |||
| { | |||
| title: '操作', | |||
| width: 300, | |||
| key: 'option', | |||
| valueType: 'option', | |||
| fixed: 'right', | |||
| render: (_, record, action) => [ | |||
| <Button key='1' type='link' onClick={() => { | |||
| setId(record.id) | |||
| @@ -105,7 +103,7 @@ const PagesPermissionAccountTable: React.FC = ({ dispatch, openModel, getId }: a | |||
| sort: 'id', | |||
| sortby: 'desc', | |||
| keyword: params.mobile, | |||
| }).then(res => { | |||
| setList(res.data.users) | |||
| setTotal(res.data.total) | |||
| @@ -8,11 +8,11 @@ import { | |||
| ProFormSelect, | |||
| ProForm, | |||
| FormControlRender, | |||
| ProFormDependency, | |||
| ProFormRadio, | |||
| ProFormSwitch | |||
| } from '@ant-design/pro-components'; | |||
| import { ConfigProvider, Flex, Space, Modal, message, Image, Row, Col, Switch, Form, Typography } from 'antd'; | |||
| import { addPermission, updatePermission, getPermissionListWithchilds, GetDetailPermission} from '@/apis/api'; | |||
| import { addPermission, updatePermission, getPermissionListWithchilds, GetDetailPermission } from '@/apis/api'; | |||
| const selectfieldNames = { label: 'name', value: 'id' }; | |||
| @@ -34,7 +34,7 @@ const PagesPermissionListCreate: React.FC = ({ dispatch, dictModel, openModel, i | |||
| theme={{ | |||
| token: { | |||
| colorPrimary: '#4FBE70', | |||
| } , components: { | |||
| }, components: { | |||
| Segmented: { | |||
| itemSelectedBg: '#19be6e', | |||
| itemSelectedColor: '#ffffff' | |||
| @@ -49,7 +49,7 @@ const PagesPermissionListCreate: React.FC = ({ dispatch, dictModel, openModel, i | |||
| maskClosable={false} | |||
| footer={null} | |||
| destroyOnClose | |||
| width={1000} | |||
| width={600} | |||
| onCancel={() => { | |||
| dispatch({ type: 'openModel/getOpenModal', payload: false }) | |||
| }} | |||
| @@ -65,7 +65,7 @@ const PagesPermissionListCreate: React.FC = ({ dispatch, dictModel, openModel, i | |||
| path: '', | |||
| action: '', | |||
| module: '', | |||
| p_type: '', | |||
| p_type: 2, | |||
| parent_id: id.nextlevel, | |||
| description: '' | |||
| }; | |||
| @@ -81,12 +81,12 @@ const PagesPermissionListCreate: React.FC = ({ dispatch, dictModel, openModel, i | |||
| path: '', | |||
| action: '', | |||
| module: '', | |||
| p_type: '', | |||
| p_type: 2, | |||
| parent_id: 0, | |||
| description: '', | |||
| } | |||
| } | |||
| }} | |||
| submitter={{ | |||
| searchConfig: { | |||
| @@ -120,44 +120,61 @@ const PagesPermissionListCreate: React.FC = ({ dispatch, dictModel, openModel, i | |||
| } | |||
| }} | |||
| > | |||
| <ProFormText | |||
| label="权限/菜单名称" | |||
| name="name" | |||
| placeholder="请输入权限/菜单名称" | |||
| rules={[{ required: true, message: '请输入权限/菜单名称' }]} | |||
| /> | |||
| <ProFormText | |||
| label="路径" | |||
| name="path" | |||
| placeholder="请输入路径" | |||
| rules={[{ required: true, message: '请输入路径' }]} | |||
| /> | |||
| <ProFormText | |||
| label="标识名称" | |||
| name="action" | |||
| placeholder="请输入标识名称" | |||
| rules={[{ required: true, message: '请输入标识名称' }]} | |||
| /> | |||
| <ProFormText | |||
| label="指向页面" | |||
| name="module" | |||
| placeholder="请输入指向页面" | |||
| rules={[{ required: true, message: '请输入指向页面' }]} | |||
| /> | |||
| <ProFormSegmented | |||
| name="p_type" | |||
| label="权限类型" | |||
| request={async () => [ | |||
| { label: '权限', value: 1 }, | |||
| { label: '菜单', value: 2 } | |||
| ]} | |||
| rules={[{ required: true, message: '请选择是否置顶' }]} | |||
| /> | |||
| <ProFormText | |||
| name="description" | |||
| label="描述" | |||
| placeholder="请输入描述" | |||
| /> | |||
| <Row gutter={16}> | |||
| <Col span={24}> | |||
| <ProFormText | |||
| label="权限/菜单名称" | |||
| name="name" | |||
| placeholder="请输入权限/菜单名称" | |||
| rules={[{ required: true, message: '请输入权限/菜单名称' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={24}> | |||
| <ProFormText | |||
| label="路径" | |||
| name="path" | |||
| placeholder="请输入路径" | |||
| rules={[{ required: true, message: '请输入路径' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={24}> | |||
| <ProFormText | |||
| label="标识名称" | |||
| name="action" | |||
| placeholder="请输入标识名称" | |||
| rules={[{ required: true, message: '请输入标识名称' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={24}> | |||
| <ProFormText | |||
| label="指向页面" | |||
| name="module" | |||
| placeholder="请输入指向页面" | |||
| rules={[{ required: true, message: '请输入指向页面' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={24}> | |||
| <ProFormRadio.Group | |||
| name="p_type" | |||
| label="权限类型" | |||
| request={async () => [ | |||
| { label: '权限', value: 1 }, | |||
| { label: '菜单', value: 2 } | |||
| ]} | |||
| rules={[{ required: true, message: '请选择权限类型' }]} | |||
| /> | |||
| </Col> | |||
| <Col span={24}> | |||
| <ProFormText | |||
| name="description" | |||
| label="描述" | |||
| placeholder="请输入描述" | |||
| /> | |||
| </Col> | |||
| </Row> | |||
| </ProForm> | |||
| </Modal> | |||
| </ConfigProvider> | |||
| @@ -63,7 +63,7 @@ const PagesPermissionListParent: React.FC = ({ dispatch, dictModel, openModel, i | |||
| maskClosable={false} | |||
| footer={null} | |||
| destroyOnClose | |||
| width={1000} | |||
| width={600} | |||
| onCancel={() => { | |||
| dispatch({ type: 'openModel/getOpenParentModal', payload: false }) | |||
| }} | |||
| @@ -4,7 +4,7 @@ import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
| import { | |||
| ProTable, TableDropdown | |||
| } from '@ant-design/pro-components'; | |||
| import { Button, Image, ConfigProvider, Tag, Modal } from 'antd'; | |||
| import { Button, Image, ConfigProvider, Tag, Badge } from 'antd'; | |||
| import { getPermissionListWithchilds } from '@/apis/api'; | |||
| import { Imageprefix } from '@/constants'; | |||
| @@ -19,7 +19,7 @@ const PagesPermissionListTable: React.FC = ({ dispatch, openModel, getId }: any) | |||
| getId(id) | |||
| } | |||
| useEffect(() => { | |||
| if (!openModel.openParentModal) { | |||
| actionRef.current.reload(); | |||
| @@ -43,74 +43,75 @@ const PagesPermissionListTable: React.FC = ({ dispatch, openModel, getId }: any) | |||
| }} | |||
| > | |||
| <ProTable | |||
| size='small' | |||
| search={false} | |||
| scroll={{ y: 480, x: 'auto' }} | |||
| bordered={true} | |||
| scroll={{ x: 1300 }} | |||
| actionRef={actionRef} | |||
| dataSource={list} | |||
| search={false} | |||
| columns={[ | |||
| { | |||
| title: 'ID', | |||
| dataIndex: 'id', | |||
| width: 100, | |||
| width: 200, | |||
| search: false, | |||
| }, | |||
| { | |||
| title: '权限/菜单', | |||
| dataIndex: 'name', | |||
| width: 300, | |||
| width: 200, | |||
| search: false, | |||
| render: (_, record) => (<> | |||
| {record.p_type == 1 ? <>{record.name} <Tag>权限</Tag></> : <>{record.name} <Tag color='green'>菜单</Tag></>} | |||
| </> | |||
| ) | |||
| }, { | |||
| title: '权限/菜单', | |||
| title: '类型', | |||
| dataIndex: 'p_type', | |||
| search: false, | |||
| width: 100, | |||
| render: (_, record) => (<> | |||
| {record.p_type == 1 ? <><Tag>权限</Tag></> : <> <Tag color='green'>菜单</Tag></>} | |||
| </> | |||
| ) | |||
| width: 200, | |||
| valueEnum: { | |||
| 1: { | |||
| text: '权限', | |||
| status: 'Error' | |||
| }, | |||
| 2: { | |||
| text: '菜单', | |||
| status: 'Processing' | |||
| }, | |||
| }, | |||
| }, { | |||
| title: '路径', | |||
| dataIndex: 'path', | |||
| search: false, | |||
| width: 180, | |||
| width: 200, | |||
| }, { | |||
| title: '标识名称', | |||
| dataIndex: 'action', | |||
| search: false, | |||
| width: 180, | |||
| width: 200, | |||
| }, { | |||
| title: '指向页面', | |||
| dataIndex: 'module', | |||
| search: false, | |||
| width: 180, | |||
| }, { | |||
| width: 200, | |||
| }, | |||
| { | |||
| title: '上级菜单id', | |||
| dataIndex: 'parent_id', | |||
| search: false, | |||
| width: 180, | |||
| width: 200, | |||
| render: (_, record) => (<> | |||
| {record.parent_id == -1 ? '当前已是顶级菜单' : record.parent_id} | |||
| {record.parent_id == -1 ? <Badge status="processing" text='顶级菜单' /> : <Badge status="error" text={record.parent_id}/> } | |||
| </> | |||
| ) | |||
| }, { | |||
| title: '描述', | |||
| dataIndex: 'description', | |||
| search: false, | |||
| width: 180, | |||
| width: 200, | |||
| }, | |||
| { | |||
| title: '操作', | |||
| width: 400, | |||
| key: 'option', | |||
| valueType: 'option', | |||
| fixed: 'right', | |||
| render: (_, record, action) => [ | |||
| <Button key='1' type='link' onClick={() => { | |||
| setId(record) | |||
| @@ -35,7 +35,7 @@ const PagesPermissionRoleCreate: React.FC = ({ dispatch, dictModel, openModel, i | |||
| maskClosable={false} | |||
| footer={null} | |||
| destroyOnClose | |||
| width={1000} | |||
| width={600} | |||
| onCancel={() => { | |||
| dispatch({ type: 'openModel/getOpenModal', payload: false }) | |||
| }} | |||
| @@ -36,25 +36,26 @@ const PagesPermissionRoleTable: React.FC = ({ dispatch, openModel, getId }: any) | |||
| }} | |||
| > | |||
| <ProTable | |||
| size='small' | |||
| scroll={{ y: 480, x: 'auto' }} | |||
| bordered={true} | |||
| scroll={{ x: 1300 }} | |||
| actionRef={actionRef} | |||
| dataSource={list} | |||
| search={{ span: 8, labelWidth: 'auto' }} | |||
| columns={[ | |||
| { | |||
| title: 'ID', | |||
| dataIndex: 'id', | |||
| width: 100, | |||
| search: false, | |||
| }, | |||
| { | |||
| title: '角色名', | |||
| dataIndex: 'name' | |||
| dataIndex: 'name', | |||
| }, | |||
| { | |||
| title: '别名', | |||
| dataIndex: 'code', | |||
| search: false, | |||
| }, | |||
| { | |||
| @@ -64,10 +65,8 @@ const PagesPermissionRoleTable: React.FC = ({ dispatch, openModel, getId }: any) | |||
| }, | |||
| { | |||
| title: '操作', | |||
| width: 300, | |||
| key: 'option', | |||
| valueType: 'option', | |||
| fixed: 'right', | |||
| render: (_, record, action) => [ | |||
| <Button key='1' type='link' onClick={() => { | |||
| setId(record.id) | |||
| @@ -4,11 +4,11 @@ import type { ActionType, ProFormInstance } from '@ant-design/pro-components'; | |||
| import { | |||
| ProFormText, | |||
| ProFormSegmented, | |||
| ProFormSelect, | |||
| ProFormRadio, | |||
| ProForm | |||
| } from '@ant-design/pro-components'; | |||
| import { ConfigProvider, Flex, Space, Modal, message, Image, Row, Col, Switch } from 'antd'; | |||
| import {PostDictAdd, PostDictUpdate , GetDictDetail } from '@/apis/api'; | |||
| import { PostDictAdd, PostDictUpdate, GetDictDetail } from '@/apis/api'; | |||
| @@ -28,7 +28,7 @@ const PagesSettingDictionaryCreate: React.FC = ({ dispatch, dictModel, openModel | |||
| theme={{ | |||
| token: { | |||
| colorPrimary: '#4FBE70', | |||
| } , components: { | |||
| }, components: { | |||
| Segmented: { | |||
| itemSelectedBg: '#19be6e', | |||
| itemSelectedColor: '#ffffff' | |||
| @@ -43,7 +43,7 @@ const PagesSettingDictionaryCreate: React.FC = ({ dispatch, dictModel, openModel | |||
| maskClosable={false} | |||
| footer={null} | |||
| destroyOnClose | |||
| width={1000} | |||
| width={600} | |||
| onCancel={() => { | |||
| dispatch({ type: 'openModel/getOpenModal', payload: false }) | |||
| }} | |||
| @@ -59,7 +59,7 @@ const PagesSettingDictionaryCreate: React.FC = ({ dispatch, dictModel, openModel | |||
| parent_id: id.nextlevel, | |||
| name: '', | |||
| value: '', | |||
| display: '', | |||
| display: 'S', | |||
| childs: null, | |||
| }; | |||
| } else { | |||
| @@ -74,7 +74,7 @@ const PagesSettingDictionaryCreate: React.FC = ({ dispatch, dictModel, openModel | |||
| parent_id: -1, | |||
| name: '', | |||
| value: '', | |||
| display: '', | |||
| display: 'S', | |||
| childs: null, | |||
| } | |||
| } | |||
| @@ -130,7 +130,7 @@ const PagesSettingDictionaryCreate: React.FC = ({ dispatch, dictModel, openModel | |||
| name="value" | |||
| placeholder="请输入字典代码值" | |||
| /> | |||
| <ProFormSegmented | |||
| <ProFormRadio.Group | |||
| name="display" | |||
| label="是否显示" | |||
| request={async () => [ | |||
| @@ -5,7 +5,7 @@ import { | |||
| ProTable, TableDropdown | |||
| } from '@ant-design/pro-components'; | |||
| import { Button, Image, ConfigProvider, Tag } from 'antd'; | |||
| import { GetDictList} from '@/apis/api'; | |||
| import { GetDictList } from '@/apis/api'; | |||
| import { Imageprefix } from '@/constants'; | |||
| const PagesSettingDictionaryTable: React.FC = ({ dispatch, openModel, getId }: any) => { | |||
| @@ -38,8 +38,8 @@ const PagesSettingDictionaryTable: React.FC = ({ dispatch, openModel, getId }: a | |||
| <ProTable | |||
| size='small' | |||
| search={false} | |||
| scroll={{ y: 480, x: 'auto' }} | |||
| bordered={true} | |||
| scroll={{ x: 1300 }} | |||
| actionRef={actionRef} | |||
| dataSource={list} | |||
| columns={[ | |||
| @@ -61,10 +61,8 @@ const PagesSettingDictionaryTable: React.FC = ({ dispatch, openModel, getId }: a | |||
| }, | |||
| { | |||
| title: '操作', | |||
| width: 300, | |||
| key: 'option', | |||
| valueType: 'option', | |||
| fixed: 'right', | |||
| render: (_, record, action) => [ | |||
| <Button key='1' type='link' onClick={() => { | |||
| setId(record) | |||
| @@ -76,7 +74,7 @@ const PagesSettingDictionaryTable: React.FC = ({ dispatch, openModel, getId }: a | |||
| dispatch({ type: 'openModel/getOpenModal', payload: true }) | |||
| }}>添加下级字典</Button>, | |||
| <Button key='2' type='link' onClick={() => { | |||
| }}>删除</Button>, | |||
| ], | |||
| }, | |||