|
@@ -37,8 +37,7 @@ function AddSubOrg(props) {
|
|
const next = () => {
|
|
const next = () => {
|
|
setCurrent(current + 1);
|
|
setCurrent(current + 1);
|
|
setIsChange(true)
|
|
setIsChange(true)
|
|
- console.log(form.getFieldsValue());
|
|
|
|
-
|
|
|
|
|
|
+
|
|
};
|
|
};
|
|
const pre = () => {
|
|
const pre = () => {
|
|
setCurrent(current - 1);
|
|
setCurrent(current - 1);
|
|
@@ -50,7 +49,7 @@ function AddSubOrg(props) {
|
|
setVisible(false)
|
|
setVisible(false)
|
|
}
|
|
}
|
|
const goback = () => {
|
|
const goback = () => {
|
|
- if ((form.getFieldsValue().name != undefined || form.getFieldsValue().type != undefined) && type!=2) {
|
|
|
|
|
|
+ if (form.getFieldsValue().name != undefined && type != 2) {
|
|
setVisible(true)
|
|
setVisible(true)
|
|
} else {
|
|
} else {
|
|
back()
|
|
back()
|
|
@@ -113,7 +112,7 @@ function StepContent(props) {
|
|
number: '${label} is not a valid number!',
|
|
number: '${label} is not a valid number!',
|
|
},
|
|
},
|
|
};
|
|
};
|
|
-
|
|
|
|
|
|
+
|
|
//获取菜单数据
|
|
//获取菜单数据
|
|
function getTreeData() {
|
|
function getTreeData() {
|
|
xPost(api.getUserMenuResourceTree, { type: 0 }).then((res) => {
|
|
xPost(api.getUserMenuResourceTree, { type: 0 }).then((res) => {
|
|
@@ -157,10 +156,11 @@ function StepContent(props) {
|
|
}
|
|
}
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
if (type == 2) {
|
|
if (type == 2) {
|
|
- const treeDatas = detail.getRoleDTO?structureTreeData(detail.getRoleDTO.loginUserMenuResourceTree):[];
|
|
|
|
|
|
+ const treeDatas = detail.getRoleDTO ? structureTreeData(detail.getRoleDTO.loginUserMenuResourceTree) : [];
|
|
setTabDatas(treeDatas);
|
|
setTabDatas(treeDatas);
|
|
setSysCheckeds(detail.sids);
|
|
setSysCheckeds(detail.sids);
|
|
getStaticInfos()
|
|
getStaticInfos()
|
|
|
|
+ setActiveTab(detail.softwares[0].id);
|
|
} else {
|
|
} else {
|
|
getTreeData();
|
|
getTreeData();
|
|
getStaticInfos()
|
|
getStaticInfos()
|
|
@@ -200,7 +200,6 @@ function StepContent(props) {
|
|
|
|
|
|
}
|
|
}
|
|
function onTabChange(activeTab) {
|
|
function onTabChange(activeTab) {
|
|
-
|
|
|
|
setName(activeTab.split('-')[0])
|
|
setName(activeTab.split('-')[0])
|
|
setActiveTab(activeTab.split('-')[1])
|
|
setActiveTab(activeTab.split('-')[1])
|
|
}
|
|
}
|
|
@@ -280,7 +279,7 @@ function StepContent(props) {
|
|
hidden={current !== 0}
|
|
hidden={current !== 0}
|
|
rules={[{ required: true }]}>
|
|
rules={[{ required: true }]}>
|
|
{orgType == 4 ?
|
|
{orgType == 4 ?
|
|
- <Input placeholder='科室' disabled />
|
|
|
|
|
|
+ <Input placeholder='科室' disabled />
|
|
:
|
|
:
|
|
<Select placeholder='请选择类型'>
|
|
<Select placeholder='请选择类型'>
|
|
{hisTypeList.map((item, i) => {
|
|
{hisTypeList.map((item, i) => {
|
|
@@ -314,14 +313,14 @@ function StepContent(props) {
|
|
<Form.Item
|
|
<Form.Item
|
|
label="用户名"
|
|
label="用户名"
|
|
hidden
|
|
hidden
|
|
- name={type == 2?['addHospitalUserVO', 'id']:''}>
|
|
|
|
|
|
+ name={type == 2 ? ['addHospitalUserVO', 'id'] : ''}>
|
|
<Input placeholder='用户名是组织中唯一标识,请勿重复' autoComplete='off' disabled={type == 2 ? true : false} />
|
|
<Input placeholder='用户名是组织中唯一标识,请勿重复' autoComplete='off' disabled={type == 2 ? true : false} />
|
|
</Form.Item>
|
|
</Form.Item>
|
|
<Form.Item
|
|
<Form.Item
|
|
label="用户名"
|
|
label="用户名"
|
|
hidden={current !== 1}
|
|
hidden={current !== 1}
|
|
name={['addHospitalUserVO', 'username']}
|
|
name={['addHospitalUserVO', 'username']}
|
|
- rules={type != 2 ? [{ required: true }]:null}>
|
|
|
|
|
|
+ rules={type != 2 ? [{ required: true }] : null}>
|
|
<Input placeholder='用户名是组织中唯一标识,请勿重复' autoComplete='off' disabled={type == 2 ? true : false} />
|
|
<Input placeholder='用户名是组织中唯一标识,请勿重复' autoComplete='off' disabled={type == 2 ? true : false} />
|
|
</Form.Item>
|
|
</Form.Item>
|
|
<Form.Item
|
|
<Form.Item
|
|
@@ -351,7 +350,7 @@ function StepContent(props) {
|
|
}
|
|
}
|
|
return Promise.reject(new Error('两次密码输入不一致!'));
|
|
return Promise.reject(new Error('两次密码输入不一致!'));
|
|
},
|
|
},
|
|
- })]:null}>
|
|
|
|
|
|
+ })] : null}>
|
|
<Input placeholder='8-12位大小写字母、数字、特殊字符' autoComplete='off' disabled={type == 2 ? true : false} />
|
|
<Input placeholder='8-12位大小写字母、数字、特殊字符' autoComplete='off' disabled={type == 2 ? true : false} />
|
|
</Form.Item>
|
|
</Form.Item>
|
|
<Form.Item
|
|
<Form.Item
|
|
@@ -416,9 +415,9 @@ function StepContent(props) {
|
|
</Form.Item>
|
|
</Form.Item>
|
|
</Form>
|
|
</Form>
|
|
<div className="button-box">
|
|
<div className="button-box">
|
|
- {current !== 0 ? <Button onClick={handlePre}>上一步</Button> : null}
|
|
|
|
- {current !== 2 ? <Button onClick={handleNext} type='primary'>下一步</Button> : null}
|
|
|
|
- {current === 2 ? <Button onClick={handleSave} type='primary'>保存</Button> : null}
|
|
|
|
|
|
+ {current !== 0 && orgType != 4 ? <Button onClick={handlePre}>上一步</Button> : null}
|
|
|
|
+ {current !== 2 && orgType != 4 ? <Button onClick={handleNext} type='primary'>下一步</Button> : null}
|
|
|
|
+ {current === 2 || orgType == 4 ? <Button onClick={handleSave} type='primary'>保存</Button> : null}
|
|
</div>
|
|
</div>
|
|
</>
|
|
</>
|
|
)
|
|
)
|