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