💥 feat(模块): 城市运营二维码
This commit is contained in:
@ -7,6 +7,7 @@ import {
|
|||||||
ProFormText,
|
ProFormText,
|
||||||
ProFormDigit,
|
ProFormDigit,
|
||||||
ProFormMoney,
|
ProFormMoney,
|
||||||
|
ProFormUploadButton,
|
||||||
} from '@ant-design/pro-components';
|
} from '@ant-design/pro-components';
|
||||||
import { ModalForm, PageContainer, ProTable } from '@ant-design/pro-components';
|
import { ModalForm, PageContainer, ProTable } from '@ant-design/pro-components';
|
||||||
import '@umijs/max';
|
import '@umijs/max';
|
||||||
@ -18,6 +19,7 @@ import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|||||||
|
|
||||||
import { CITY_OPTIONS } from '@/constants/city';
|
import { CITY_OPTIONS } from '@/constants/city';
|
||||||
import { TIME_FORMAT } from '@/constants/global';
|
import { TIME_FORMAT } from '@/constants/global';
|
||||||
|
import { uploadFile } from '@/services/file';
|
||||||
import { deleteCityOperator, getAllStaffList, getCityOpratorList, updateCityOperator } from '@/services/list';
|
import { deleteCityOperator, getAllStaffList, getCityOpratorList, updateCityOperator } from '@/services/list';
|
||||||
|
|
||||||
const useStyles = createStyles(({ token }) => {
|
const useStyles = createStyles(({ token }) => {
|
||||||
@ -66,7 +68,10 @@ const TableList: React.FC = () => {
|
|||||||
message.success('操作成功');
|
message.success('操作成功');
|
||||||
actionRef.current?.reload();
|
actionRef.current?.reload();
|
||||||
};
|
};
|
||||||
|
const handleUpload = async (file: File) => {
|
||||||
|
const { url } = await uploadFile({ file, type: 'IMAGE' });
|
||||||
|
return url;
|
||||||
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getAllStaffOptions();
|
getAllStaffOptions();
|
||||||
}, []);
|
}, []);
|
||||||
@ -109,6 +114,26 @@ const TableList: React.FC = () => {
|
|||||||
valueType: 'textarea',
|
valueType: 'textarea',
|
||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '企微好友二维码',
|
||||||
|
dataIndex: 'contactQrCode',
|
||||||
|
valueType: 'textarea',
|
||||||
|
copyable: true,
|
||||||
|
search: false,
|
||||||
|
render(_dom, { contactQrCode }) {
|
||||||
|
return <img className={styles.img} src={contactQrCode} alt="" />;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '进群二维码',
|
||||||
|
dataIndex: 'groupQrCode',
|
||||||
|
valueType: 'textarea',
|
||||||
|
copyable: true,
|
||||||
|
search: false,
|
||||||
|
render(_dom, { groupQrCode }) {
|
||||||
|
return <img className={styles.img} src={groupQrCode} alt="" />;
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '可群发数量',
|
title: '可群发数量',
|
||||||
dataIndex: 'sendCount',
|
dataIndex: 'sendCount',
|
||||||
@ -190,6 +215,7 @@ const TableList: React.FC = () => {
|
|||||||
cityName: formData.city.label,
|
cityName: formData.city.label,
|
||||||
groupLink: formData.groupLink,
|
groupLink: formData.groupLink,
|
||||||
sendCount: formData.sendCount,
|
sendCount: formData.sendCount,
|
||||||
|
qroupQrCode: formData.qrCode[0].xhr.responseURL,
|
||||||
price: formData.price,
|
price: formData.price,
|
||||||
};
|
};
|
||||||
console.log('update confirm', formData, params);
|
console.log('update confirm', formData, params);
|
||||||
@ -217,6 +243,17 @@ const TableList: React.FC = () => {
|
|||||||
rules={[{ required: true, message: '必填项' }]}
|
rules={[{ required: true, message: '必填项' }]}
|
||||||
/>
|
/>
|
||||||
<ProFormText name="groupLink" label="进群链接" rules={[{ message: '请输入链接', type: 'url' }]} />
|
<ProFormText name="groupLink" label="进群链接" rules={[{ message: '请输入链接', type: 'url' }]} />
|
||||||
|
<ProFormUploadButton
|
||||||
|
name="qrCode"
|
||||||
|
label="上传"
|
||||||
|
max={1}
|
||||||
|
accept="image/*"
|
||||||
|
rules={[{ required: true, message: '必填项' }]}
|
||||||
|
fieldProps={{
|
||||||
|
name: 'file',
|
||||||
|
}}
|
||||||
|
action={handleUpload}
|
||||||
|
/>
|
||||||
<ProFormDigit name="sendCount" label="可群发数量" min={1} fieldProps={{ precision: 0 }} />
|
<ProFormDigit name="sendCount" label="可群发数量" min={1} fieldProps={{ precision: 0 }} />
|
||||||
<ProFormMoney
|
<ProFormMoney
|
||||||
name="price"
|
name="price"
|
||||||
|
|||||||
3
src/services/typings.d.ts
vendored
3
src/services/typings.d.ts
vendored
@ -364,6 +364,8 @@ declare namespace API {
|
|||||||
cityCode: string;
|
cityCode: string;
|
||||||
groupLink: string;
|
groupLink: string;
|
||||||
sendCount: number;
|
sendCount: number;
|
||||||
|
contactQrCode: string;
|
||||||
|
groupQrCode: string;
|
||||||
price: number;
|
price: number;
|
||||||
id: number;
|
id: number;
|
||||||
}
|
}
|
||||||
@ -375,6 +377,7 @@ declare namespace API {
|
|||||||
cityName?: string;
|
cityName?: string;
|
||||||
cityCode: string;
|
cityCode: string;
|
||||||
groupLink: string;
|
groupLink: string;
|
||||||
|
qroupQrCode: string;
|
||||||
sendCount?: number;
|
sendCount?: number;
|
||||||
price?: number;
|
price?: number;
|
||||||
created?: string;
|
created?: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user