1
This commit is contained in:
2
dist/index.html
vendored
2
dist/index.html
vendored
@@ -8,6 +8,6 @@
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script src="/umi.5ca12c9d.js"></script>
|
||||
<script src="/umi.7a718c7d.js"></script>
|
||||
|
||||
</body></html>
|
||||
File diff suppressed because one or more lines are too long
10
dist/src__pages__config__config__index.8cc1c487.async.js
vendored
Normal file
10
dist/src__pages__config__config__index.8cc1c487.async.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
dist/umi.5ca12c9d.js → dist/umi.7a718c7d.js
vendored
2
dist/umi.5ca12c9d.js → dist/umi.7a718c7d.js
vendored
File diff suppressed because one or more lines are too long
@@ -6,7 +6,7 @@ import {
|
||||
EditableProTable,
|
||||
ActionType
|
||||
} from '@ant-design/pro-components';
|
||||
import { Card, message, Tabs, InputNumber, TimePicker, Input } from 'antd';
|
||||
import { Card, message, Tabs, InputNumber, TimePicker, Input, Button } from 'antd';
|
||||
import type { FC } from 'react';
|
||||
import React, { useState, useRef, useEffect } from 'react';
|
||||
import { config, configUpdate } from '@/services/config/index'
|
||||
@@ -17,10 +17,14 @@ import dayjs from 'dayjs';
|
||||
const BasicForm: FC<Record<string, any>> = () => {
|
||||
const [dataValue, setDateValue] = useState<any>([])
|
||||
const [activeKey, setActiveKey] = useState('DEPOSIT');
|
||||
const [form] = ProForm.useForm();
|
||||
const [dataValueFrom, setDateValueFrom] = useState<any>([])
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
config().then(({ data }) => {
|
||||
configName(data)
|
||||
setDateValueFrom(data)
|
||||
})
|
||||
}, []);
|
||||
|
||||
@@ -100,20 +104,10 @@ const BasicForm: FC<Record<string, any>> = () => {
|
||||
);
|
||||
|
||||
|
||||
const configName = (data) => {
|
||||
setDateValue(data.map((i) => {
|
||||
const configName = (valueList) => {
|
||||
setDateValue(valueList.map((i) => {
|
||||
let data = null
|
||||
let configValue = JSON.parse(i.configValue)
|
||||
|
||||
if (i.configKey == 'ALERT_EMAIL') {
|
||||
let list = configValue.email.map((item, index) => {
|
||||
return {
|
||||
id: index + 1 + 'AAA',
|
||||
email: item
|
||||
}
|
||||
})
|
||||
console.log(defaultData, 'defaultDatadefaultDatadefaultDatadefaultData');
|
||||
}
|
||||
let value = {
|
||||
id: i.id,
|
||||
configName: i.configName,
|
||||
@@ -413,59 +407,44 @@ const BasicForm: FC<Record<string, any>> = () => {
|
||||
</ProForm >
|
||||
}
|
||||
|
||||
// if (i.configKey == 'ALERT_EMAIL') {
|
||||
// value.email = value.email.map((item, index) => {
|
||||
// return {
|
||||
// id: index + 1 + 'AAA',
|
||||
// email: item
|
||||
// }
|
||||
// })
|
||||
// console.log(value, 'value.emial');
|
||||
// data = <ProForm
|
||||
// style={{
|
||||
// marginTop: 8,
|
||||
// maxWidth: 600,
|
||||
// }}
|
||||
// layout="vertical"
|
||||
// initialValues={value}
|
||||
// onFinish={onFinish}
|
||||
// >
|
||||
// <ProForm.Group>
|
||||
// <ProFormDigit
|
||||
// name="id"
|
||||
// disabled
|
||||
// hidden={true}
|
||||
// />
|
||||
// <ProForm.Item
|
||||
// label="数组数据"
|
||||
// name="email"
|
||||
// >
|
||||
// <EditableProTable
|
||||
// rowKey="id"
|
||||
// toolBarRender={false}
|
||||
// columns={columns}
|
||||
// recordCreatorProps={{
|
||||
// newRecordType: 'dataSource',
|
||||
// position: 'top',
|
||||
// record: () => ({
|
||||
// id: Date.now(),
|
||||
// addonBefore: 'ccccccc',
|
||||
// decs: 'testdesc',
|
||||
// }),
|
||||
// }}
|
||||
// editable={{
|
||||
// type: 'multiple',
|
||||
// editableKeys,
|
||||
// onChange: setEditableRowKeys,
|
||||
// actionRender: (row, _, dom) => {
|
||||
// return [dom.delete];
|
||||
// },
|
||||
// }}
|
||||
// />
|
||||
// </ProForm.Item>
|
||||
// </ProForm.Group>
|
||||
// </ProForm >
|
||||
// }
|
||||
if (i.configKey == 'ALERT_EMAIL') {
|
||||
data = <ProForm
|
||||
style={{
|
||||
marginTop: 8,
|
||||
maxWidth: 600,
|
||||
}}
|
||||
form={form}
|
||||
layout="vertical"
|
||||
initialValues={value}
|
||||
onFinish={onFinish}
|
||||
>
|
||||
<ProForm.Group>
|
||||
<ProFormDigit
|
||||
name="id"
|
||||
disabled
|
||||
hidden={true}
|
||||
/>
|
||||
{value.email.map((_, index) => (
|
||||
<ProForm.Item key={index} name={['email', index]}>
|
||||
<Input placeholder={`请输入邮箱`} />
|
||||
</ProForm.Item>
|
||||
))}
|
||||
<Button onClick={() => {
|
||||
let aaa = valueList.map((i, n) => {
|
||||
let configValueData = JSON.parse(i.configValue)
|
||||
if (i.configKey == 'ALERT_EMAIL') {
|
||||
configValueData.email.push('')
|
||||
}
|
||||
return {
|
||||
...i,
|
||||
configValue: JSON.stringify(configValueData)
|
||||
}
|
||||
})
|
||||
configName(aaa)
|
||||
}}>添加</Button>
|
||||
</ProForm.Group>
|
||||
</ProForm >
|
||||
}
|
||||
|
||||
return {
|
||||
key: i.configKey,
|
||||
|
||||
Reference in New Issue
Block a user