zsw007 преди 3 години
родител
ревизия
f73870bb3c
променени са 3 файла, в които са добавени 7 реда и са изтрити 118 реда
  1. 5 25
      src/components/DictManager/AddDict.js
  2. 2 17
      src/components/ParaManager/AddPara.js
  3. 0 76
      src/components/ParaManager/index.js

+ 5 - 25
src/components/DictManager/AddDict.js

@@ -55,13 +55,8 @@ import React, {
     function swichChange(val) {
       form.setFieldsValue({ status: val ? 1 : 0 })
     }
-    // 判断元素存在格式
-    function getSameNum(val, arr) {
-      let processArr = arr.filter(function (value) {
-        return value == val;
-      })
-      return processArr.length;
-    }
+
+
     //递归获取科室
     function gethospitals(arr, val) {
       arr.forEach(item => {
@@ -99,21 +94,6 @@ import React, {
         }
       })
     }
-    const onChange = value => {
-      value.forEach(it => {
-        if (JSON.stringify(it).indexOf('-') > 0) {
-          addHospitalTreeVOs.depts.push(it.split('-')[1])
-        } else {
-          addHospitalTreeVOs.hospitals.push(it)
-          gethospitals(treeData, it)
-        }
-      })
-      setAddHospitalTreeVO(addHospitalTreeVOs)
-      console.log(form.getFieldsValue())
-    };
-    const onChangeRloe = value => {
-      form.setFieldsValue({ roles: value })
-    };
     
     const onFinish = values => {
       let params = values
@@ -157,9 +137,9 @@ import React, {
       props.cancel()
     }
       
-      function onValuesChange() {
-        props.isChange(form.isFieldsTouched())
-      }
+  function onValuesChange() {
+    props.isChange(form.isFieldsTouched())
+  }
   
     return (
       <>

+ 2 - 17
src/components/ParaManager/AddPara.js

@@ -75,27 +75,12 @@ function AddPara(props) {
       return arr.indexOf(item, 0) === index;
     });
   }
+
+  // 监听状态变化的时候的回调函数
   function swichChange(val) {
     form.setFieldsValue({ status: val ? 1 : 0 })
   }
   
-  //递归获取医院
-  function getdepts(arr) {
-    arr.forEach(item => {
-      if (JSON.stringify(item.value).indexOf('-') < 0) {
-        addHospitalTreeVOs.hospitals.push(item.value)
-      }
-      if (item.children && item.depts) {
-        item.children.forEach(it => {
-          addHospitalTreeVOs.depts.push(it.value.split('-')[1])
-        })
-        return
-      }
-      if (item.children) {
-        getdepts(item.children)
-      }
-    })
-  }
   
   // 点击保存
   const onFinish = values => {

+ 0 - 76
src/components/ParaManager/index.js

@@ -130,18 +130,6 @@ function DictManager() {
     })
   }
 
-  const onChange = value => {
-    value.forEach(it => {
-      if (JSON.stringify(it).indexOf('-') > 0) {
-        addHospitalTreeVOs.depts.push(it.split('-')[1])
-      } else {
-        addHospitalTreeVOs.hospitals.push(it)
-        gethospitals(HospitalNamesList, it)
-      }
-    })
-    setAddHospitalTreeVO(addHospitalTreeVOs)
-    console.log(form.getFieldsValue())
-  };
 
   //递归获取科室
   function gethospitals(arr, val) {
@@ -182,61 +170,7 @@ function DictManager() {
     })
   }
 
-  // 处理组织结构数据回显
-  function getHospitals(arr) {
-    arr.forEach((item, i, array) => {
-      item.value = item.hospitalId
-      item.title = item.hospitalName
-      if (!item.children && item.depts) {
-        item.depts.forEach(it => {
-          it.value = item.parentId + '-' + it.deptId
-          if (it.relation == 1) {
-            list.push(it.value)
-          }
-        })
-      }
-      if (item.type != 0 && item.relation == 1) {
-        list.push(item.value)
-        console.log(list)
-      }
-      if (item.children) {
-        getHospitals(item.children)
-      }
-    })
-    return list
-  }
 
-  // 禁用/启用接口
-  function disableUser(id, status) {
-    const param = { id: id, status: status };
-    xPost(api.disableUser, param).then((res) => {
-      if (res.data.code === 200) {
-        getHospitalSet();
-        setMsvisible(false);
-        setParaId(null)
-        message.success((status ? '启用' : '禁用') + "成功");
-      } else {
-        message.warning(res.data.msg || '操作失败');
-      }
-    }).catch(() => {
-      message.error("接口出错");
-    });
-  }
-
-  //重置密码
-  function onResetPsd(id) {
-    const param = { id: id };
-    xPost(api.resetPasswordUser, param).then((res) => {
-      if (res.data.code === 200) {
-        getHospitalSet();
-        message.success("重置成功");
-      } else {
-        message.warning(res.data.msg || '操作失败');
-      }
-    }).catch(() => {
-      message.error("接口出错");
-    });
-  }
 
   //删除
   function deleteHospitalSet() {
@@ -295,16 +229,6 @@ function DictManager() {
     setModalType(type)
   }
 
-  //提示框确认事件
-  // function handleOk() {
-  //   if (modalType == 1) {
-  //     deleteHospitalSet(id)
-  //   } else if (modalType == 2) {
-  //     disableUser(id, 0)
-  //   } else if (modalType == 3) {
-  //     onResetPsd(id);
-  //   }
-  // }
   
   // 确认删除是否继续
   function deleteCancel() {