💥 feat(模块): 城市运营二维码
This commit is contained in:
@ -7,6 +7,7 @@ import {
|
||||
ProFormText,
|
||||
ProFormDigit,
|
||||
ProFormMoney,
|
||||
ProFormUploadButton,
|
||||
} from '@ant-design/pro-components';
|
||||
import { ModalForm, PageContainer, ProTable } from '@ant-design/pro-components';
|
||||
import '@umijs/max';
|
||||
@ -18,6 +19,7 @@ import React, { useEffect, useMemo, useRef, useState } from 'react';
|
||||
|
||||
import { CITY_OPTIONS } from '@/constants/city';
|
||||
import { TIME_FORMAT } from '@/constants/global';
|
||||
import { uploadFile } from '@/services/file';
|
||||
import { deleteCityOperator, getAllStaffList, getCityOpratorList, updateCityOperator } from '@/services/list';
|
||||
|
||||
const useStyles = createStyles(({ token }) => {
|
||||
@ -66,7 +68,10 @@ const TableList: React.FC = () => {
|
||||
message.success('操作成功');
|
||||
actionRef.current?.reload();
|
||||
};
|
||||
|
||||
const handleUpload = async (file: File) => {
|
||||
const { url } = await uploadFile({ file, type: 'IMAGE' });
|
||||
return url;
|
||||
};
|
||||
useEffect(() => {
|
||||
getAllStaffOptions();
|
||||
}, []);
|
||||
@ -109,6 +114,26 @@ const TableList: React.FC = () => {
|
||||
valueType: 'textarea',
|
||||
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: '可群发数量',
|
||||
dataIndex: 'sendCount',
|
||||
@ -190,6 +215,7 @@ const TableList: React.FC = () => {
|
||||
cityName: formData.city.label,
|
||||
groupLink: formData.groupLink,
|
||||
sendCount: formData.sendCount,
|
||||
qroupQrCode: formData.qrCode[0].xhr.responseURL,
|
||||
price: formData.price,
|
||||
};
|
||||
console.log('update confirm', formData, params);
|
||||
@ -217,6 +243,17 @@ const TableList: React.FC = () => {
|
||||
rules={[{ required: true, message: '必填项' }]}
|
||||
/>
|
||||
<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 }} />
|
||||
<ProFormMoney
|
||||
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;
|
||||
groupLink: string;
|
||||
sendCount: number;
|
||||
contactQrCode: string;
|
||||
groupQrCode: string;
|
||||
price: number;
|
||||
id: number;
|
||||
}
|
||||
@ -375,6 +377,7 @@ declare namespace API {
|
||||
cityName?: string;
|
||||
cityCode: string;
|
||||
groupLink: string;
|
||||
qroupQrCode: string;
|
||||
sendCount?: number;
|
||||
price?: number;
|
||||
created?: string;
|
||||
|
||||
Reference in New Issue
Block a user