|
@@ -1,7 +1,7 @@
|
|
|
/*
|
|
|
* @Author: your name
|
|
|
* @Date: 2022-01-13 15:22:48
|
|
|
- * @LastEditTime: 2023-03-24 11:25:37
|
|
|
+ * @LastEditTime: 2023-03-24 12:20:28
|
|
|
* @LastEditors: code4eat awesomedema@gmail.com
|
|
|
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
|
* @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/hospManage/index.tsx
|
|
@@ -171,10 +171,6 @@ const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
|
|
|
const [drawerTableDataFilterParams, set_drawerTableDataFilterParams] = useState<any | undefined>();
|
|
|
|
|
|
const [checkBoxCodes, set_checkBoxCodes] = useState<any[]>([]); //勾选的菜单
|
|
|
-
|
|
|
- const [needCancelCheckedMenus, set_needCancelCheckedMenus] = useState<any[]>([]);
|
|
|
-
|
|
|
-
|
|
|
const [drawerTableDataSearchKeywords, set_drawerTableDataSearchKeywords] = useState<string>('');
|
|
|
|
|
|
const [checkedTableMenuIds, set_checkedTableMenuIds] = useState<any[]>([]);
|
|
@@ -286,8 +282,10 @@ const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
|
|
|
];
|
|
|
|
|
|
const getTreeReqFunc = async (hospId: string) => {
|
|
|
- const resp = await getHospOwnSys(hospId);
|
|
|
- set_treeData(resp);
|
|
|
+ if(hospId){
|
|
|
+ const resp = await getHospOwnSys(hospId);
|
|
|
+ set_treeData(resp);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const onSelect: TreeProps['onSelect'] = (selectedKeys, info) => {
|
|
@@ -352,6 +350,7 @@ const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
|
|
|
|
|
|
|
|
|
const getTableData = async (params: any, sort: any, filter: any) => {
|
|
|
+
|
|
|
set_drawerTablereload(false);
|
|
|
if (currentSelectedTreeNode) {
|
|
|
const resp = await getMenuRelaPerm({ ...params, hospId: record.id });
|
|
@@ -380,7 +379,6 @@ const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
|
|
|
setTreeRecursion(resp);
|
|
|
|
|
|
set_checkBoxCodes(temp);
|
|
|
- console.log({temp});
|
|
|
set_checkedTableMenuIds(temp.map((a: any) => a.menuId));
|
|
|
set_oldSelectedMenuIds(temp.map((a: any) => a.menuId));
|
|
|
|
|
@@ -402,8 +400,6 @@ const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
|
|
|
|
|
|
let old = oldSelectedMenuIds;
|
|
|
|
|
|
- console.log({oldSelectedMenuIds,checkBoxCodes});
|
|
|
-
|
|
|
const result = checkBoxCodes.map((item: any) => {
|
|
|
|
|
|
old.splice(old.findIndex(a=>a == item.menuId),1);
|
|
@@ -422,7 +418,6 @@ const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
|
|
|
set_drawerTablereload(true);
|
|
|
set_checkBoxCodes([]);
|
|
|
set_checkedTableMenuIds([]);
|
|
|
- set_needCancelCheckedMenus([]);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -462,7 +457,7 @@ const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
|
|
|
//切换系统清空数据
|
|
|
set_checkBoxCodes([]);
|
|
|
set_checkedTableMenuIds([]);
|
|
|
- set_needCancelCheckedMenus([]);
|
|
|
+
|
|
|
|
|
|
}, [currentSelectedTreeNode]);
|
|
|
|
|
@@ -809,7 +804,7 @@ const HospManage: FC<PageProps> = ({ hospManageModel: state, dispatch }) => {
|
|
|
<div className='filter'>
|
|
|
<div className='filterItem'>
|
|
|
<span className='label'>检索:</span>
|
|
|
- <KCInput placeholder={'请输入参数名称'} style={{ width: 160 }} search allowClear
|
|
|
+ <KCInput placeholder={'请输入院区名称'} style={{ width: 160 }} search allowClear
|
|
|
onChange={(e) => {
|
|
|
set_tableDataSearchKeywords(e.target.value);
|
|
|
if (e.target.value.length == 0) {
|