fix
This commit is contained in:
parent
bdbef36d32
commit
a54f0a8c55
|
|
@ -5,4 +5,9 @@
|
||||||
box-shadow: 0 2px 3px #0000001a;
|
box-shadow: 0 2px 3px #0000001a;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
padding: 30px 32px;
|
padding: 30px 32px;
|
||||||
|
}
|
||||||
|
.formContainer {
|
||||||
|
padding-top: 32px;
|
||||||
|
width: 676px;
|
||||||
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
@ -13,55 +13,55 @@ function render() {
|
||||||
var relationArr2 = typeof relations === 'object'
|
var relationArr2 = typeof relations === 'object'
|
||||||
? relations
|
? relations
|
||||||
: relations && JSON.parse(relations);
|
: relations && JSON.parse(relations);
|
||||||
return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ showBack: true, title: "\u6DFB\u52A0\u6743\u9650" }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: (0, jsx_runtime_1.jsx)(tdesign_react_1.Row, tslib_1.__assign({ gutter: 16 }, { children: (0, jsx_runtime_1.jsx)(tdesign_react_1.Col, tslib_1.__assign({ span: 8 }, { children: (0, jsx_runtime_1.jsxs)(tdesign_react_1.Form, tslib_1.__assign({ colon: false, labelAlign: "right", labelWidth: "100px", layout: "vertical", preventSubmitDefault: true, resetType: "empty", showErrorMessage: true, submitWithWarningMessage: false }, { children: [(0, jsx_runtime_1.jsx)(FormItem, tslib_1.__assign({ label: "\u59D3\u540D", name: "name", rules: [
|
return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ showBack: true, title: "\u6DFB\u52A0\u6743\u9650" }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.formContainer }, { children: (0, jsx_runtime_1.jsx)(tdesign_react_1.Row, tslib_1.__assign({ gutter: 16 }, { children: (0, jsx_runtime_1.jsx)(tdesign_react_1.Col, tslib_1.__assign({ span: 8 }, { children: (0, jsx_runtime_1.jsxs)(tdesign_react_1.Form, tslib_1.__assign({ colon: false, labelAlign: "right", labelWidth: "100px", layout: "vertical", preventSubmitDefault: true, resetType: "empty", showErrorMessage: true, submitWithWarningMessage: false }, { children: [(0, jsx_runtime_1.jsx)(FormItem, tslib_1.__assign({ label: "\u59D3\u540D", name: "name", rules: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '姓名不能为空',
|
message: '姓名不能为空',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
},
|
},
|
||||||
] }, { children: (0, jsx_runtime_1.jsx)(tdesign_react_1.Input, { onChange: function (value, context) {
|
] }, { children: (0, jsx_runtime_1.jsx)(tdesign_react_1.Input, { onChange: function (value, context) {
|
||||||
_this.setUpdateData('name', value);
|
_this.setUpdateData('name', value);
|
||||||
}, value: name, align: "left", placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9", type: "text" }) })), (0, jsx_runtime_1.jsx)(FormItem, tslib_1.__assign({ label: "\u624B\u673A\u53F7\u7801", name: "mobile", rules: [
|
}, value: name, align: "left", placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9", type: "text" }) })), (0, jsx_runtime_1.jsx)(FormItem, tslib_1.__assign({ label: "\u624B\u673A\u53F7\u7801", name: "mobile", rules: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '手机号不能为空',
|
message: '手机号不能为空',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
min: 11,
|
min: 11,
|
||||||
message: '请输入11位手机号',
|
message: '请输入11位手机号',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
max: 11,
|
max: 11,
|
||||||
message: '请输入11位手机号',
|
message: '请输入11位手机号',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
},
|
},
|
||||||
] }, { children: (0, jsx_runtime_1.jsx)(tdesign_react_1.Input, { onChange: function (value, context) {
|
] }, { children: (0, jsx_runtime_1.jsx)(tdesign_react_1.Input, { onChange: function (value, context) {
|
||||||
_this.setUpdateData('mobile$user.0.mobile', value);
|
_this.setUpdateData('mobile$user.0.mobile', value);
|
||||||
}, maxlength: 11, value: mobile, align: "left", placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9", size: "medium", type: "tel" }) })), (0, jsx_runtime_1.jsx)(FormItem, tslib_1.__assign({ initialData: "12345678", label: "\u5BC6\u7801", name: "mobile", rules: [
|
}, maxlength: 11, value: mobile, align: "left", placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9", size: "medium", type: "tel" }) })), (0, jsx_runtime_1.jsx)(FormItem, tslib_1.__assign({ initialData: "12345678", label: "\u5BC6\u7801", name: "mobile", rules: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '密码不能为空',
|
message: '密码不能为空',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
},
|
},
|
||||||
] }, { children: (0, jsx_runtime_1.jsx)(tdesign_react_1.Input, { value: password, onChange: function (value) {
|
] }, { children: (0, jsx_runtime_1.jsx)(tdesign_react_1.Input, { value: password, onChange: function (value) {
|
||||||
_this.setUpdateData('password', value);
|
_this.setUpdateData('password', value);
|
||||||
}, align: "left", placeholder: "\u4E0D\u5C11\u4E8E\u516B\u4F4D", showClearIconOnEmpty: false, size: "medium", status: "default", type: "text" }) })), (0, jsx_runtime_1.jsx)(FormItem, tslib_1.__assign({ label: "\u6743\u9650", rules: [
|
}, align: "left", placeholder: "\u4E0D\u5C11\u4E8E\u516B\u4F4D", showClearIconOnEmpty: false, size: "medium", status: "default", type: "text" }) })), (0, jsx_runtime_1.jsx)(FormItem, tslib_1.__assign({ label: "\u6743\u9650", rules: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请至少选择一个权限',
|
message: '请至少选择一个权限',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
},
|
},
|
||||||
] }, { children: (0, jsx_runtime_1.jsx)(tdesign_react_1.Checkbox.Group, { value: relationArr, onChange: function (value) {
|
] }, { children: (0, jsx_runtime_1.jsx)(tdesign_react_1.Checkbox.Group, { value: relationArr, onChange: function (value) {
|
||||||
_this.setRelationValue(value);
|
_this.setRelationValue(value);
|
||||||
}, options: relationArr2.map(function (ele) { return ({
|
}, options: relationArr2.map(function (ele) { return ({
|
||||||
value: ele,
|
value: ele,
|
||||||
label: (_this.t &&
|
label: (_this.t &&
|
||||||
_this.t(entity + ':r.' + ele)) ||
|
_this.t(entity + ':r.' + ele)) ||
|
||||||
ele,
|
ele,
|
||||||
}); }) }) })), (0, jsx_runtime_1.jsxs)(FormItem, tslib_1.__assign({ style: { marginLeft: 100 } }, { children: [(0, jsx_runtime_1.jsx)(tdesign_react_1.Button, tslib_1.__assign({ theme: "primary", type: "submit", style: { marginRight: 10 }, onClick: function () {
|
}); }) }) })), (0, jsx_runtime_1.jsxs)(FormItem, tslib_1.__assign({ style: { marginLeft: 100 } }, { children: [(0, jsx_runtime_1.jsx)(tdesign_react_1.Button, tslib_1.__assign({ theme: "primary", type: "submit", style: { marginRight: 10 }, onClick: function () {
|
||||||
_this.onConfirm();
|
_this.onConfirm();
|
||||||
} }, { children: "\u63D0\u4EA4" })), (0, jsx_runtime_1.jsx)(tdesign_react_1.Button, tslib_1.__assign({ theme: "default", type: "reset" }, { children: "\u91CD\u7F6E" }))] }))] })) })) })) })) })));
|
} }, { children: "\u63D0\u4EA4" })), (0, jsx_runtime_1.jsx)(tdesign_react_1.Button, tslib_1.__assign({ theme: "default", type: "reset" }, { children: "\u91CD\u7F6E" }))] }))] })) })) })) })) })) })));
|
||||||
}
|
}
|
||||||
exports.default = render;
|
exports.default = render;
|
||||||
|
|
|
||||||
|
|
@ -5,4 +5,9 @@
|
||||||
box-shadow: 0 2px 3px #0000001a;
|
box-shadow: 0 2px 3px #0000001a;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
padding: 30px 32px;
|
padding: 30px 32px;
|
||||||
|
}
|
||||||
|
.formContainer {
|
||||||
|
padding-top: 32px;
|
||||||
|
width: 676px;
|
||||||
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
@ -21,142 +21,144 @@ export default function render(this: any) {
|
||||||
return (
|
return (
|
||||||
<PageHeader showBack={true} title="添加权限">
|
<PageHeader showBack={true} title="添加权限">
|
||||||
<div className={Style.container}>
|
<div className={Style.container}>
|
||||||
<Row gutter={16}>
|
<div className={Style.formContainer}>
|
||||||
<Col span={8}>
|
<Row gutter={16}>
|
||||||
<Form
|
<Col span={8}>
|
||||||
colon={false}
|
<Form
|
||||||
labelAlign="right"
|
colon={false}
|
||||||
labelWidth="100px"
|
labelAlign="right"
|
||||||
layout="vertical"
|
labelWidth="100px"
|
||||||
preventSubmitDefault
|
layout="vertical"
|
||||||
resetType="empty"
|
preventSubmitDefault
|
||||||
showErrorMessage
|
resetType="empty"
|
||||||
submitWithWarningMessage={false}
|
showErrorMessage
|
||||||
>
|
submitWithWarningMessage={false}
|
||||||
<FormItem
|
|
||||||
label="姓名"
|
|
||||||
name="name"
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '姓名不能为空',
|
|
||||||
type: 'error',
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
>
|
||||||
<Input
|
<FormItem
|
||||||
onChange={(value, context) => {
|
label="姓名"
|
||||||
this.setUpdateData('name', value);
|
name="name"
|
||||||
}}
|
rules={[
|
||||||
value={name}
|
{
|
||||||
align="left"
|
required: true,
|
||||||
placeholder="请输入内容"
|
message: '姓名不能为空',
|
||||||
type="text"
|
type: 'error',
|
||||||
/>
|
},
|
||||||
</FormItem>
|
]}
|
||||||
<FormItem
|
|
||||||
label="手机号码"
|
|
||||||
name="mobile"
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '手机号不能为空',
|
|
||||||
type: 'error',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
min: 11,
|
|
||||||
message: '请输入11位手机号',
|
|
||||||
type: 'error',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
max: 11,
|
|
||||||
message: '请输入11位手机号',
|
|
||||||
type: 'error',
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<Input
|
|
||||||
onChange={(value, context) => {
|
|
||||||
this.setUpdateData(
|
|
||||||
'mobile$user.0.mobile',
|
|
||||||
value
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
maxlength={11}
|
|
||||||
value={mobile}
|
|
||||||
align="left"
|
|
||||||
placeholder="请输入内容"
|
|
||||||
size="medium"
|
|
||||||
type="tel"
|
|
||||||
/>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem
|
|
||||||
initialData="12345678"
|
|
||||||
label="密码"
|
|
||||||
name="mobile"
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '密码不能为空',
|
|
||||||
type: 'error',
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<Input
|
|
||||||
value={password}
|
|
||||||
onChange={(value) => {
|
|
||||||
this.setUpdateData('password', value);
|
|
||||||
}}
|
|
||||||
align="left"
|
|
||||||
placeholder="不少于八位"
|
|
||||||
showClearIconOnEmpty={false}
|
|
||||||
size="medium"
|
|
||||||
status="default"
|
|
||||||
type="text"
|
|
||||||
/>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem
|
|
||||||
label="权限"
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请至少选择一个权限',
|
|
||||||
type: 'error',
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<Checkbox.Group
|
|
||||||
value={relationArr}
|
|
||||||
onChange={(value) => {
|
|
||||||
this.setRelationValue(value);
|
|
||||||
}}
|
|
||||||
options={relationArr2.map((ele) => ({
|
|
||||||
value: ele,
|
|
||||||
label:
|
|
||||||
(this.t &&
|
|
||||||
this.t(entity + ':r.' + ele)) ||
|
|
||||||
ele,
|
|
||||||
}))}
|
|
||||||
></Checkbox.Group>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem style={{ marginLeft: 100 }}>
|
|
||||||
<Button
|
|
||||||
theme="primary"
|
|
||||||
type="submit"
|
|
||||||
style={{ marginRight: 10 }}
|
|
||||||
onClick={() => {
|
|
||||||
this.onConfirm();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
提交
|
<Input
|
||||||
</Button>
|
onChange={(value, context) => {
|
||||||
<Button theme="default" type="reset">
|
this.setUpdateData('name', value);
|
||||||
重置
|
}}
|
||||||
</Button>
|
value={name}
|
||||||
</FormItem>
|
align="left"
|
||||||
</Form>
|
placeholder="请输入内容"
|
||||||
</Col>
|
type="text"
|
||||||
</Row>
|
/>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem
|
||||||
|
label="手机号码"
|
||||||
|
name="mobile"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '手机号不能为空',
|
||||||
|
type: 'error',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
min: 11,
|
||||||
|
message: '请输入11位手机号',
|
||||||
|
type: 'error',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
max: 11,
|
||||||
|
message: '请输入11位手机号',
|
||||||
|
type: 'error',
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Input
|
||||||
|
onChange={(value, context) => {
|
||||||
|
this.setUpdateData(
|
||||||
|
'mobile$user.0.mobile',
|
||||||
|
value
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
maxlength={11}
|
||||||
|
value={mobile}
|
||||||
|
align="left"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
size="medium"
|
||||||
|
type="tel"
|
||||||
|
/>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem
|
||||||
|
initialData="12345678"
|
||||||
|
label="密码"
|
||||||
|
name="mobile"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '密码不能为空',
|
||||||
|
type: 'error',
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Input
|
||||||
|
value={password}
|
||||||
|
onChange={(value) => {
|
||||||
|
this.setUpdateData('password', value);
|
||||||
|
}}
|
||||||
|
align="left"
|
||||||
|
placeholder="不少于八位"
|
||||||
|
showClearIconOnEmpty={false}
|
||||||
|
size="medium"
|
||||||
|
status="default"
|
||||||
|
type="text"
|
||||||
|
/>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem
|
||||||
|
label="权限"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请至少选择一个权限',
|
||||||
|
type: 'error',
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Checkbox.Group
|
||||||
|
value={relationArr}
|
||||||
|
onChange={(value) => {
|
||||||
|
this.setRelationValue(value);
|
||||||
|
}}
|
||||||
|
options={relationArr2.map((ele) => ({
|
||||||
|
value: ele,
|
||||||
|
label:
|
||||||
|
(this.t &&
|
||||||
|
this.t(entity + ':r.' + ele)) ||
|
||||||
|
ele,
|
||||||
|
}))}
|
||||||
|
></Checkbox.Group>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem style={{ marginLeft: 100 }}>
|
||||||
|
<Button
|
||||||
|
theme="primary"
|
||||||
|
type="submit"
|
||||||
|
style={{ marginRight: 10 }}
|
||||||
|
onClick={() => {
|
||||||
|
this.onConfirm();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
提交
|
||||||
|
</Button>
|
||||||
|
<Button theme="default" type="reset">
|
||||||
|
重置
|
||||||
|
</Button>
|
||||||
|
</FormItem>
|
||||||
|
</Form>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</PageHeader>
|
</PageHeader>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue