This commit is contained in:
PC-202306242200\Administrator
2024-11-13 10:39:57 +08:00
parent 24b01dc283
commit 4549453dff
5 changed files with 57 additions and 78 deletions

2
dist/index.html vendored
View File

@@ -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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -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,