fix
This commit is contained in:
parent
bdbef36d32
commit
a54f0a8c55
|
|
@ -6,3 +6,8 @@
|
|||
border-radius: 3px;
|
||||
padding: 30px 32px;
|
||||
}
|
||||
.formContainer {
|
||||
padding-top: 32px;
|
||||
width: 676px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
|
@ -13,55 +13,55 @@ function render() {
|
|||
var relationArr2 = typeof relations === 'object'
|
||||
? 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: [
|
||||
{
|
||||
required: true,
|
||||
message: '姓名不能为空',
|
||||
type: 'error',
|
||||
},
|
||||
] }, { children: (0, jsx_runtime_1.jsx)(tdesign_react_1.Input, { onChange: function (value, context) {
|
||||
_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: [
|
||||
{
|
||||
required: true,
|
||||
message: '手机号不能为空',
|
||||
type: 'error',
|
||||
},
|
||||
{
|
||||
min: 11,
|
||||
message: '请输入11位手机号',
|
||||
type: 'error',
|
||||
},
|
||||
{
|
||||
max: 11,
|
||||
message: '请输入11位手机号',
|
||||
type: 'error',
|
||||
},
|
||||
] }, { children: (0, jsx_runtime_1.jsx)(tdesign_react_1.Input, { onChange: function (value, context) {
|
||||
_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: [
|
||||
{
|
||||
required: true,
|
||||
message: '密码不能为空',
|
||||
type: 'error',
|
||||
},
|
||||
] }, { children: (0, jsx_runtime_1.jsx)(tdesign_react_1.Input, { value: password, onChange: function (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: [
|
||||
{
|
||||
required: true,
|
||||
message: '请至少选择一个权限',
|
||||
type: 'error',
|
||||
},
|
||||
] }, { children: (0, jsx_runtime_1.jsx)(tdesign_react_1.Checkbox.Group, { value: relationArr, onChange: function (value) {
|
||||
_this.setRelationValue(value);
|
||||
}, options: relationArr2.map(function (ele) { return ({
|
||||
value: ele,
|
||||
label: (_this.t &&
|
||||
_this.t(entity + ':r.' + 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 () {
|
||||
_this.onConfirm();
|
||||
} }, { children: "\u63D0\u4EA4" })), (0, jsx_runtime_1.jsx)(tdesign_react_1.Button, tslib_1.__assign({ theme: "default", type: "reset" }, { children: "\u91CD\u7F6E" }))] }))] })) })) })) })) })));
|
||||
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,
|
||||
message: '姓名不能为空',
|
||||
type: 'error',
|
||||
},
|
||||
] }, { children: (0, jsx_runtime_1.jsx)(tdesign_react_1.Input, { onChange: function (value, context) {
|
||||
_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: [
|
||||
{
|
||||
required: true,
|
||||
message: '手机号不能为空',
|
||||
type: 'error',
|
||||
},
|
||||
{
|
||||
min: 11,
|
||||
message: '请输入11位手机号',
|
||||
type: 'error',
|
||||
},
|
||||
{
|
||||
max: 11,
|
||||
message: '请输入11位手机号',
|
||||
type: 'error',
|
||||
},
|
||||
] }, { children: (0, jsx_runtime_1.jsx)(tdesign_react_1.Input, { onChange: function (value, context) {
|
||||
_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: [
|
||||
{
|
||||
required: true,
|
||||
message: '密码不能为空',
|
||||
type: 'error',
|
||||
},
|
||||
] }, { children: (0, jsx_runtime_1.jsx)(tdesign_react_1.Input, { value: password, onChange: function (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: [
|
||||
{
|
||||
required: true,
|
||||
message: '请至少选择一个权限',
|
||||
type: 'error',
|
||||
},
|
||||
] }, { children: (0, jsx_runtime_1.jsx)(tdesign_react_1.Checkbox.Group, { value: relationArr, onChange: function (value) {
|
||||
_this.setRelationValue(value);
|
||||
}, options: relationArr2.map(function (ele) { return ({
|
||||
value: ele,
|
||||
label: (_this.t &&
|
||||
_this.t(entity + ':r.' + 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 () {
|
||||
_this.onConfirm();
|
||||
} }, { 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;
|
||||
|
|
|
|||
|
|
@ -6,3 +6,8 @@
|
|||
border-radius: 3px;
|
||||
padding: 30px 32px;
|
||||
}
|
||||
.formContainer {
|
||||
padding-top: 32px;
|
||||
width: 676px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
|
@ -21,142 +21,144 @@ export default function render(this: any) {
|
|||
return (
|
||||
<PageHeader showBack={true} title="添加权限">
|
||||
<div className={Style.container}>
|
||||
<Row gutter={16}>
|
||||
<Col span={8}>
|
||||
<Form
|
||||
colon={false}
|
||||
labelAlign="right"
|
||||
labelWidth="100px"
|
||||
layout="vertical"
|
||||
preventSubmitDefault
|
||||
resetType="empty"
|
||||
showErrorMessage
|
||||
submitWithWarningMessage={false}
|
||||
>
|
||||
<FormItem
|
||||
label="姓名"
|
||||
name="name"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '姓名不能为空',
|
||||
type: 'error',
|
||||
},
|
||||
]}
|
||||
<div className={Style.formContainer}>
|
||||
<Row gutter={16}>
|
||||
<Col span={8}>
|
||||
<Form
|
||||
colon={false}
|
||||
labelAlign="right"
|
||||
labelWidth="100px"
|
||||
layout="vertical"
|
||||
preventSubmitDefault
|
||||
resetType="empty"
|
||||
showErrorMessage
|
||||
submitWithWarningMessage={false}
|
||||
>
|
||||
<Input
|
||||
onChange={(value, context) => {
|
||||
this.setUpdateData('name', value);
|
||||
}}
|
||||
value={name}
|
||||
align="left"
|
||||
placeholder="请输入内容"
|
||||
type="text"
|
||||
/>
|
||||
</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();
|
||||
}}
|
||||
<FormItem
|
||||
label="姓名"
|
||||
name="name"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '姓名不能为空',
|
||||
type: 'error',
|
||||
},
|
||||
]}
|
||||
>
|
||||
提交
|
||||
</Button>
|
||||
<Button theme="default" type="reset">
|
||||
重置
|
||||
</Button>
|
||||
</FormItem>
|
||||
</Form>
|
||||
</Col>
|
||||
</Row>
|
||||
<Input
|
||||
onChange={(value, context) => {
|
||||
this.setUpdateData('name', value);
|
||||
}}
|
||||
value={name}
|
||||
align="left"
|
||||
placeholder="请输入内容"
|
||||
type="text"
|
||||
/>
|
||||
</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>
|
||||
</PageHeader>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue