|
@@ -45,7 +45,7 @@ function AddData(props) {
|
|
|
const staticInfo = useSelector(state => {
|
|
|
return state.staticInfo;
|
|
|
});
|
|
|
- const { dataList } = staticInfo;console.log('formData:',formData)
|
|
|
+ const { dataList } = staticInfo;
|
|
|
const initialValues = formData
|
|
|
const validateMessages = {
|
|
|
required: '${label}不能为空',
|
|
@@ -68,7 +68,7 @@ function AddData(props) {
|
|
|
const data = authChecksArr[tabIndex]||{};
|
|
|
const sysObj = form.getFieldValue().softwareVOS[tabIndex]||{};
|
|
|
const dataType = sysObj.dataType;
|
|
|
- const isCustom = dataType === '7';console.log(form.getFieldValue(),dataType,isCustom)
|
|
|
+ const isCustom = dataType === '7';
|
|
|
//判断权限范围类型,是否显示自定义内容
|
|
|
setShowCustom(isCustom);
|
|
|
if(!isCustom||!data){ //非自定义不处理
|
|
@@ -77,12 +77,15 @@ function AddData(props) {
|
|
|
const depts = data.depts||[];
|
|
|
const doctors = data.doctors||[];
|
|
|
const hospitals = data.hospitals||[];
|
|
|
+ const hosIds = filterIds(hospitals);
|
|
|
+ const deptIds = filterIds(depts);
|
|
|
setCheckedUser(doctors);
|
|
|
- setCheckedUserIds(filterIds(doctors,'name'));
|
|
|
- setCheckedHosIds(filterIds(hospitals,'name'));
|
|
|
+ setCheckedUserIds(filterIds(doctors,['id','name']));
|
|
|
+ setCheckedTreeItems(filterIds(hospitals,['hospitalId','hospitalName','id','name'],true));
|
|
|
+ setCheckedHosIds(hosIds);
|
|
|
//setHosArr(hospitals||[]);
|
|
|
setCheckedDepts([...hospitals,...depts]);
|
|
|
- setCheckedDeptIds(filterIds((hospitals).concat(depts)));
|
|
|
+ setCheckedDeptIds(hosIds.concat(deptIds));
|
|
|
}
|
|
|
//获取当前用于所属角色
|
|
|
function getCreateRoles(softwareId) {
|
|
@@ -138,21 +141,24 @@ function AddData(props) {
|
|
|
arr[tabIndex].id = tabKey
|
|
|
arr[tabIndex].softwareMenuIds = []
|
|
|
arr[tabIndex].dataAuthDetails = []
|
|
|
- arr[tabIndex].selectedRowKeys = []
|
|
|
+ //arr[tabIndex].selectedRowKeys = []
|
|
|
if (e.target.value !== '7') {
|
|
|
+ setShowCustom(false);
|
|
|
arr[tabIndex].dataAuthDetails = [{
|
|
|
dataType: e.target.value
|
|
|
}]
|
|
|
+ }else{
|
|
|
+ setShowCustom(true);
|
|
|
}
|
|
|
- tags[tabIndex] = []
|
|
|
+ //tags[tabIndex] = []
|
|
|
val[i] = e.target.value
|
|
|
- selectedRowKeys[tabIndex] = []
|
|
|
+ //selectedRowKeys[tabIndex] = []
|
|
|
form.setFieldsValue({
|
|
|
softwareVOS: arr
|
|
|
});
|
|
|
- setTags([...tags])
|
|
|
- setValue([...val])
|
|
|
- setSelectedRowKeys([...selectedRowKeys])
|
|
|
+ //setTags([...tags])
|
|
|
+ //setValue([...val])
|
|
|
+ //setSelectedRowKeys([...selectedRowKeys])
|
|
|
setIsChange(true)
|
|
|
};
|
|
|
|
|
@@ -208,7 +214,7 @@ function AddData(props) {
|
|
|
});
|
|
|
const docArr = unique(arr);
|
|
|
formData.softwareVOS[tabIndex].dataAuthDetails = [...docArr,...checkedDepts];
|
|
|
- formData.softwareVOS[tabIndex].selectedRowKeys = selectedRowKeys;
|
|
|
+ //formData.softwareVOS[tabIndex].selectedRowKeys = selectedRowKeys;
|
|
|
form.setFieldsValue({
|
|
|
softwareVOS: formData.softwareVOS
|
|
|
});
|
|
@@ -226,11 +232,11 @@ function AddData(props) {
|
|
|
});
|
|
|
//console.log('排序后:',posArr);
|
|
|
const structDepts = structureDeptTag(posArr);
|
|
|
- const {deptIds,hosIds,paramHos,paramDept} = structDepts;console.log('选中:',checkedDepts)
|
|
|
+ const {deptIds,hosIds,paramHos,paramDept} = structDepts;
|
|
|
let deptIdsArr=[...deptIds];
|
|
|
let deptArr=[...paramDept];
|
|
|
let hosIdsArr=[...hosIds];
|
|
|
- let hosArr=[...paramHos];
|
|
|
+ let hosArr=[...paramHos];console.log('树选中:',hosIdsArr)
|
|
|
setCheckedDepts(hosArr.concat(deptArr)); //显示的排序可能需要再考虑一下
|
|
|
setCheckedDeptIds(deptIdsArr);
|
|
|
setCheckedHosIds(hosIdsArr);
|
|
@@ -328,7 +334,7 @@ function AddData(props) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- const onFinish = value => {
|
|
|
+ const onFinish = () => {
|
|
|
console.log(form.getFieldsValue());
|
|
|
save(form.getFieldsValue())
|
|
|
};
|
|
@@ -390,9 +396,7 @@ function AddData(props) {
|
|
|
</Form.Item>
|
|
|
</TabPane>
|
|
|
<TabPane tab="可看科室" key="1" forceRender={isEdit && form.getFieldValue().softwareVOS[i] ? true : false}>
|
|
|
- <Form.Item
|
|
|
- name={['softwareVOS', i, 'softwareMenuIds']}
|
|
|
- >
|
|
|
+ <Form.Item>
|
|
|
<MyDeptStruct checkeds={checkedTreeItems} checkEv={handleCheckDept} />
|
|
|
</Form.Item>
|
|
|
</TabPane>
|