Commit 8d902bb1 authored by wuhao's avatar wuhao 🎯

asder

parent bfdb22d0
This diff is collapsed.
...@@ -36,6 +36,7 @@ import { PlusOutlined, DownOutlined, CloseOutlined, RedoOutlined } from '@ant-de ...@@ -36,6 +36,7 @@ import { PlusOutlined, DownOutlined, CloseOutlined, RedoOutlined } from '@ant-de
import BraftEditor from 'braft-editor'; import BraftEditor from 'braft-editor';
import EditTable from './EditTable'; import EditTable from './EditTable';
import EditorItem from './EditorItem'; import EditorItem from './EditorItem';
import Diyrule from './Diyrule';
import defaultSetting from '../../../config/defaultSettings'; import defaultSetting from '../../../config/defaultSettings';
const { Image, Form, Upload, Col, Pagination, Avatar, Dropdown, Menu, Tabs, message } = Antd; const { Image, Form, Upload, Col, Pagination, Avatar, Dropdown, Menu, Tabs, message } = Antd;
...@@ -70,6 +71,7 @@ const FormItems = { ...@@ -70,6 +71,7 @@ const FormItems = {
UploadImage, UploadImage,
UploadDragger, UploadDragger,
Editor, Editor,
Diyrules,
FormList, FormList,
FormSelectList, FormSelectList,
CheckboxItem, CheckboxItem,
...@@ -1304,6 +1306,19 @@ function Editor({ item, colProps, formRef }) { ...@@ -1304,6 +1306,19 @@ function Editor({ item, colProps, formRef }) {
); );
} }
// editor
function Diyrules({ item, colProps, formRef }) {
let col = item.colProps ?? colProps;
let curkey = item.key ?? item.dataIndex;
return (
<Col {...col}>
<ProForm.Item name={curkey} label={item.title} {...item.formItemProps}>
<Diyrule />
</ProForm.Item>
</Col>
);
}
function FormList({ item, colProps, formRef }) { function FormList({ item, colProps, formRef }) {
let col = item.colProps ?? colProps; let col = item.colProps ?? colProps;
let fields = item.columns; let fields = item.columns;
......
...@@ -20,6 +20,16 @@ function getcolumns(setdrawer) { ...@@ -20,6 +20,16 @@ function getcolumns(setdrawer) {
dataIndex: 'ruleNames', dataIndex: 'ruleNames',
key: 'ruleNames', key: 'ruleNames',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
hideInForm: true,
},
{
title: '规则配置',
dataIndex: 'nrList',
hideInTable: true,
valueType: 'diyrules',
colProps: {
span: 24,
},
}, },
]; ];
} }
......
...@@ -152,8 +152,7 @@ function Rules(props) { ...@@ -152,8 +152,7 @@ function Rules(props) {
item: null, item: null,
detailpath: null, detailpath: null,
title: '新增', title: '新增',
type: 'add', val: 'add',
val: 'only',
onFinish: async (vals) => { onFinish: async (vals) => {
console.log(1); console.log(1);
let params = { let params = {
...@@ -192,9 +191,7 @@ function Rules(props) { ...@@ -192,9 +191,7 @@ function Rules(props) {
})); }));
}} }}
{...drawer} {...drawer}
> />
{drawer?.type == 'add' ? <AddRules /> : null}
</DrawerPro>
</div> </div>
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment