react-admin-kit
Version:
A react based UI components for admin system
50 lines • 1.38 kB
JavaScript
import { useRef } from 'react';
import { SchemaForm } from "../../..";
import { columns } from "./columns";
import { Button } from 'antd';
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
var Readonly = function Readonly() {
var formRef = useRef();
var onFinish = function onFinish(values) {
console.log({
values: values
});
};
return /*#__PURE__*/_jsxs("div", {
children: [/*#__PURE__*/_jsx("div", {
style: {
display: 'flex',
justifyContent: 'space-between'
},
children: /*#__PURE__*/_jsx(Button, {
onClick: function onClick() {
var _formRef$current;
(_formRef$current = formRef.current) === null || _formRef$current === void 0 || _formRef$current.setFieldsValue({
name: '马先生',
id: 6,
queryId: 60
});
},
children: "setFieldsBtn"
})
}), /*#__PURE__*/_jsx(SchemaForm, {
layout: "horizontal",
grid: true,
onFinish: onFinish,
formRef: formRef,
columns: columns,
readonly: true,
initialValues: {
name: '王先生',
phone: 1202228888,
mail: 'mail.com',
chargePerson: '1',
chargePhone: '123456789',
id: 8,
queryId: 80
}
})]
});
};
export default Readonly;