Ver código fonte

增加查核配置及相关评分管理/修复部分bug

code4eat 4 anos atrás
pai
commit
950495fb4d
63 arquivos alterados com 3137 adições e 282 exclusões
  1. 1 1
      .env.development
  2. 1 1
      .env.production
  3. 1 1
      package.json
  4. 43 8
      src/api/checkGroupManage.js
  5. 66 0
      src/api/checkItem.js
  6. 33 2
      src/api/checkPointManage.js
  7. 34 0
      src/api/situation.js
  8. BIN
      src/assets/images/checkStatusIcon.jpg
  9. BIN
      src/assets/images/nextCheckTime.jpg
  10. BIN
      src/assets/images/situation-case.jpg
  11. BIN
      src/assets/images/situation-system.jpg
  12. BIN
      src/assets/images/theme.png
  13. BIN
      src/assets/images/theme0.png
  14. BIN
      src/assets/images/theme1.png
  15. 6 4
      src/components/Modal/modal.js
  16. 34 5
      src/config/menuConfig.js
  17. 12 3
      src/config/routeMap.js
  18. 10 0
      src/mock/index.js
  19. 94 67
      src/mock/login.js
  20. 51 20
      src/utils/request.js
  21. 18 19
      src/views/checkGroupManage/checkGroupManage.jsx
  22. 316 0
      src/views/checkGroupManage/checkTypeManage.jsx
  23. 2 2
      src/views/checkGroupManage/table.js
  24. 627 0
      src/views/checkItemManage/checkItem/checkItem.jsx
  25. 164 0
      src/views/checkItemManage/checkItem/table.js
  26. 318 0
      src/views/checkItemManage/checkItemResultSelector/checkItemResultSelector.jsx
  27. 172 0
      src/views/checkItemManage/checkItemResultSelector/table.js
  28. 223 44
      src/views/checkPointManage/checkItem/checkItem.jsx
  29. 6 3
      src/views/checkPointManage/checkItem/table.js
  30. 3 1
      src/views/checkPointManage/checkPointAndCheckItem/checkPointAndCheckItem.jsx
  31. 2 2
      src/views/checkPointManage/checkPointAndCheckItem/table.js
  32. 3 1
      src/views/checkPointManage/pointAndCheckGroup/pointAndCheckGroup.jsx
  33. 3 1
      src/views/checkPointManage/pointAndGroup/pointAndGroup.jsx
  34. 2 2
      src/views/checkPointManage/pointAndGroup/table.js
  35. 5 3
      src/views/checkPointManage/pointAndProvisions/pointAndProvisions.jsx
  36. 12 6
      src/views/checkPointManage/pointManage/pointManage.jsx
  37. 28 14
      src/views/conditionManage/condition.jsx
  38. 3 1
      src/views/conditionManage/conditionAndGroupIdentity/conditionAndGroupIdentity.jsx
  39. 6 5
      src/views/groupManage/groupIdentity/groupIdentity.jsx
  40. 23 14
      src/views/groupManage/groupIdentity/table.js
  41. 11 8
      src/views/groupManage/groupIdentityAndGroup/groupIdentityAndGroup.jsx
  42. 6 5
      src/views/groupManage/groupIdentityAndGroup/table.js
  43. 61 12
      src/views/groupManage/groupMana/groupMana.jsx
  44. 17 2
      src/views/groupManage/groupMana/table.js
  45. 1 1
      src/views/layout/Header/index.jsx
  46. 1 1
      src/views/layout/Sider/Menu/index.less
  47. 15 9
      src/views/layout/Sider/index.jsx
  48. 4 2
      src/views/personnelManagement/permissionMaintenance/permissionMaintenance.jsx
  49. 2 2
      src/views/personnelManagement/permissionMaintenance/table.js
  50. 3 1
      src/views/personnelManagement/personAndCheckGroup/personAndCheckGroup.jsx
  51. 3 1
      src/views/personnelManagement/personAndGroup/personAndGroup.jsx
  52. 7 6
      src/views/personnelManagement/personnelInformation/personnelInformation.jsx
  53. 4 2
      src/views/provisionsManage/provisions.jsx
  54. 209 0
      src/views/situationCreate/components/condition/condition.jsx
  55. 13 0
      src/views/situationCreate/components/condition/condition.less
  56. 134 0
      src/views/situationCreate/components/createFlow/createFlow.jsx
  57. 22 0
      src/views/situationCreate/components/createFlow/createFlow.less
  58. 79 0
      src/views/situationCreate/components/selectSituation/selectSituation.jsx
  59. 49 0
      src/views/situationCreate/components/selectSituation/selectSituation.less
  60. 64 0
      src/views/situationCreate/components/situationList/situationList.jsx
  61. 54 0
      src/views/situationCreate/components/situationList/situationList.less
  62. 56 0
      src/views/situationCreate/situationCreate.jsx
  63. BIN
      追踪方法学后台管理_build0517_v0.1.1.zip

+ 1 - 1
.env.development

@@ -1,5 +1,5 @@
 # base api
-REACT_APP_BASE_API = 'http://172.18.116.20:8802/'
+REACT_APP_BASE_API = 'http://192.168.51.80:8081/'
 
 #112.124.59.133:8081  linux服务器
 #121.43.139.179:8802  公网

+ 1 - 1
.env.production

@@ -1,5 +1,5 @@
 # base api
-REACT_APP_BASE_API = 'http://172.18.116.20:8802/'
+REACT_APP_BASE_API = 'http://121.43.139.179:8802/'
 
 #192.168.51.80
 #112.124.59.133:8081 服务器

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "trackMethodology",
-  "version": "1.0.0",
+  "version": "0.1.1",
   "author": "",
   "license": "MIT",
   "private": true,

+ 43 - 8
src/api/checkGroupManage.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-04-28 08:40:01
- * @LastEditTime: 2021-04-30 16:10:23
+ * @LastEditTime: 2021-05-12 10:42:23
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /react-antd-admin-template/src/api/checkGroupManage.js
@@ -73,17 +73,52 @@ export function getCheckGroupManager() {
   })
 }
 
-// //新增单位时候选择管理员列表
-// export function getPersonListForBind() {
-//   return request({
-//     url: '/employee/getDeptManager',
-//     method: 'get'
-//   })
-// }
+//获取查核方式字典列表
+export function getCheckTypeDictionary(data) {
+  return request({
+    url: '/dictionary/list',
+    method: 'get',
+    params:{...data}
+  })
+}
+
+//添加查核方式字典时下拉列表
+export function getCheckWays() {
+  return request({
+    url: '/dictionary/getCheckWays',
+    method: 'get',
+  })
+}
 
 export function listAll() {
     return request({
       url: '/checkPoint/listAll',
       method: 'get',
     })
+}
+//查核方式字典新增
+export function addCheckDictionary(data) {
+  return request({
+    url: '/dictionary/addDictionary',
+    method: 'post',
+    data
+  })
+}
+
+//查核方式字典编辑
+export function editCheckDictionary(data) {
+  return request({
+    url: '/dictionary/editDictionary',
+    method: 'post',
+    data
+  })
+}
+
+//查核方式字典删除
+export function delCheckDictionary(data) {
+  return request({
+    url: '/dictionary/delDictionary',
+    method: 'post',
+    data
+  })
 }

+ 66 - 0
src/api/checkItem.js

@@ -0,0 +1,66 @@
+/*
+ * @Author: your name
+ * @Date: 2021-05-14 09:30:59
+ * @LastEditTime: 2021-05-14 16:20:51
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /react-antd-admin-template/src/api/checkItem.js
+ */
+
+
+import request from '@/utils/request'
+
+
+//查核项结果弹窗列表
+export function getCheckItemResultPopList(data) {
+  return request({
+    url: '/itemResult/list',
+    method: 'get',
+    params:{...data}
+  })
+}
+
+//获取所有查核项列表 不分页,用于中间选择
+export function getCheckItemListForSelect() {
+    return request({
+      url: '/checkItem/listAll',
+      method: 'get',
+    })
+}
+
+//编辑查核项弹窗结果列表
+export function editCheckItemListForSelect(data) {
+    return request({
+      url: '/itemResult/editItemResult',
+      method: 'post',
+      data
+    })
+}
+
+//新增查核项弹窗结果列表
+export function addCheckItemListForSelect(data) {
+    return request({
+      url: '/itemResult/addCheckResult',
+      method: 'post',
+      data
+    })
+}
+
+//删除查核项弹窗结果列表
+export function delCheckItemListForSelect(data) {
+    return request({
+      url: '/itemResult/delItemResult',
+      method: 'post',
+      data
+    })
+}
+
+//新增查核项查核属性
+export function addCheckItemAttr(data) {
+    return request({
+      url: '/checkItemAttr/addItemAttr',
+      method: 'post',
+      data
+    })
+}
+

+ 33 - 2
src/api/checkPointManage.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-04-27 17:11:09
- * @LastEditTime: 2021-05-05 21:30:26
+ * @LastEditTime: 2021-05-14 11:26:10
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /react-antd-admin-template/src/api/checkPointManage.js
@@ -42,6 +42,8 @@ export function addCheckPoint(data) {
     })
 }
 
+
+//获取查核项列表
 export function getCheckItem(data) {
     return request({
       url: '/checkItem/list',
@@ -49,6 +51,26 @@ export function getCheckItem(data) {
       params:{...data}
     })
 }
+
+
+//获取查核项结果配置添加时下拉列表
+export function getCheckItemCheckResultSelecterList() {
+  return request({
+    url: '/checkItemAttr/listCheckSelected',
+    method: 'get',
+  })
+}
+
+//编辑查核项时新增查核结果
+export function addCheckItemCheckResult(data) {
+  return request({
+    url: '/checkItemAttr/editItemAttr',
+    method: 'post',
+    data
+  })
+}
+
+
 //获取所有查核组列表不分页,用于中间表选择
 export function getCheckGroupForBind() {
     return request({
@@ -200,4 +222,13 @@ export function delCheckPointAndCheckItemPage(data) {
     method: 'post',
     data
   })
-}
+}
+
+//获取查核方式下拉列表
+export function getCheckItemTypeList() {
+  return request({
+    url: '/dictionary/getCheckItemSelector',
+    method: 'get',
+  })
+}
+

+ 34 - 0
src/api/situation.js

@@ -0,0 +1,34 @@
+/*
+ * @Author: your name
+ * @Date: 2021-05-10 09:35:02
+ * @LastEditTime: 2021-05-10 17:27:28
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /react-antd-admin-template/src/api/situation.js
+ */
+
+
+import request from '@/utils/request'
+
+
+
+//获取情境列表
+export function situationList() {
+
+  return request({
+    method: 'GET',
+    url: 'situation/list'
+  })
+}
+
+//获取条件列表
+export function getConditionList(data) {
+
+    return request({
+      method: 'GET',
+      url: 'common/conditions',
+      params:{...data}
+    })
+}
+  
+

BIN
src/assets/images/checkStatusIcon.jpg


BIN
src/assets/images/nextCheckTime.jpg


BIN
src/assets/images/situation-case.jpg


BIN
src/assets/images/situation-system.jpg


BIN
src/assets/images/theme.png


BIN
src/assets/images/theme0.png


BIN
src/assets/images/theme1.png


+ 6 - 4
src/components/Modal/modal.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-04-26 11:42:56
- * @LastEditTime: 2021-04-30 21:38:26
+ * @LastEditTime: 2021-05-15 14:35:03
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /react-antd-admin-template/src/components/Modal/modal.js
@@ -38,10 +38,12 @@ class ModalWrap extends React.Component {
   };
 
   handleCancel = e => {
-    
+    const {
+      handleCancelCallback=()=>{}
+  } = this.props;
     this.setState({
       visible: false,
-    });
+    },()=>handleCancelCallback());
   };
 
 
@@ -54,7 +56,7 @@ class ModalWrap extends React.Component {
           Open Modal
         </Button> */}
         <Modal
-          title="Basic Modal"
+          title="表单"
           visible={this.state.visible}
           onOk={this.handleOk}
           onCancel={this.handleCancel}

+ 34 - 5
src/config/menuConfig.js

@@ -9,6 +9,12 @@ const menuList = [
     icon: "home",
     roles:["admin","editor","guest","group-leader","company-manager"]
   },
+  // {
+  //   title: "情境管理",
+  //   path: "/situationCreate/situationCreate",
+  //   icon: "lock",
+  //   roles:["admin","editor","guest","group-leader","company-manager"]
+  // },
   {
     title: "人员管理",
     path: "/personnelManagement",
@@ -88,11 +94,11 @@ const menuList = [
         path: "/checkPointManage/pointManage/pointManage",
         roles:["admin","editor","guest","group-leader","company-manager"]
       },
-      {
-        title: "查核项管理",
-        path: "/checkPointManage/checkItem/checkItem",
-        roles:["admin","editor","guest","group-leader","company-manager"]
-      },
+      // {
+      //   title: "查核项管理",
+      //   path: "/checkPointManage/checkItem/checkItem",
+      //   roles:["admin","editor","guest","group-leader","company-manager"]
+      // },
       {
         title: "要点与单位",
         path: "/checkPointManage/pointAndGroup/pointAndGroup",
@@ -126,6 +132,29 @@ const menuList = [
         path: "/checkGroupManage/checkGroupManage",
         roles:["admin","editor","guest","group-leader","company-manager"]
       },
+      {
+        title: "查核方式维护",
+        path: "/checkGroupManage/checkTypeManage",
+        roles:["admin","editor","guest","group-leader","company-manager"]
+      },
+    ],
+  },
+  {
+    title: "查核项管理",
+    path: "/checkItemManage",
+    icon: "file-excel",
+    roles:["admin","editor","guest","group-leader","company-manager"],
+    children: [
+      {
+        title: "查核项管理",
+        path: "/checkItemManage/checkItem/checkItem",
+        roles:["admin","editor","guest","group-leader","company-manager"]
+      },
+      {
+        title: "查核结果弹窗列表管理",
+        path: "/checkItemManage/checkItemResultSelector/checkItemResultSelector",
+        roles:["admin","editor","guest","group-leader","company-manager"]
+      },
     ],
   },
   {

+ 12 - 3
src/config/routeMap.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-04-23 15:39:41
- * @LastEditTime: 2021-05-05 21:18:47
+ * @LastEditTime: 2021-05-14 09:19:51
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /react-antd-admin-template/src/config/routeMap.js
@@ -10,6 +10,7 @@
 import Loadable from 'react-loadable';
 import Loading from '@/components/Loading'
 const Dashboard = Loadable({loader: () => import(/*webpackChunkName:'Dashboard'*/'@/views/dashboard'),loading: Loading});
+const SituationCreate = Loadable({loader: () => import(/*webpackChunkName:'Dashboard'*/'@/views/situationCreate/situationCreate'),loading: Loading});
 const PermissionMaintenance = Loadable({loader: () => import(/*webpackChunkName:'Bug'*/'@/views/personnelManagement/permissionMaintenance/permissionMaintenance'),loading: Loading});
 const PersonnelInformation = Loadable({loader: () => import(/*webpackChunkName:'Dashboard'*/'@/views/personnelManagement/personnelInformation/personnelInformation'),loading: Loading});
 const PersonAndCheckGroup = Loadable({loader: () => import(/*webpackChunkName:'Bug'*/'@/views/personnelManagement/personAndCheckGroup/personAndCheckGroup'),loading: Loading});
@@ -20,8 +21,10 @@ const GroupIdentity = Loadable({loader: () => import(/*webpackChunkName:'Dashboa
 const GroupMana = Loadable({loader: () => import(/*webpackChunkName:'Dashboard'*/'@/views/groupManage/groupMana/groupMana'),loading: Loading});
 const GroupIdentityAndGroup = Loadable({loader: () => import(/*webpackChunkName:'Dashboard'*/'@/views/groupManage/groupIdentityAndGroup/groupIdentityAndGroup'),loading: Loading});
 const PointManage = Loadable({loader: () => import(/*webpackChunkName:'Dashboard'*/'@/views/checkPointManage/pointManage/pointManage'),loading: Loading});
-const CheckItemManage = Loadable({loader: () => import(/*webpackChunkName:'Dashboard'*/'@/views/checkPointManage/checkItem/checkItem'),loading: Loading});
+const CheckItemManage = Loadable({loader: () => import(/*webpackChunkName:'Dashboard'*/'@/views/checkItemManage/checkItem/checkItem'),loading: Loading});
+const CheckItemResultSelector = Loadable({loader: () => import(/*webpackChunkName:'Dashboard'*/'@/views/checkItemManage/checkItemResultSelector/checkItemResultSelector'),loading: Loading});
 const CheckGroupManage = Loadable({loader: () => import(/*webpackChunkName:'Dashboard'*/'@/views/checkGroupManage/checkGroupManage'),loading: Loading});
+const CheckTypeManage = Loadable({loader: () => import(/*webpackChunkName:'Dashboard'*/'@/views/checkGroupManage/checkTypeManage'),loading: Loading});
 const ProvisionsManage = Loadable({loader: () => import(/*webpackChunkName:'Dashboard'*/'@/views/provisionsManage/provisions'),loading: Loading});
 const PointAndCheckGroup = Loadable({loader: () => import(/*webpackChunkName:'Dashboard'*/'@/views/checkPointManage/pointAndCheckGroup/pointAndCheckGroup'),loading: Loading});
 const PointAndGroup = Loadable({loader: () => import(/*webpackChunkName:'Dashboard'*/'@/views/checkPointManage/pointAndGroup/pointAndGroup'),loading: Loading});
@@ -33,6 +36,8 @@ const Error404 = Loadable({loader: () => import(/*webpackChunkName:'Error404'*/'
 
 export default [
   { path: "/dashboard", component: Dashboard, roles: ["admin","editor","guest"] },
+  //情境创建
+  { path: "/situationCreate/situationCreate", component: SituationCreate, roles: ["admin","editor","guest"] },
   //权限维护
   { path: "/personnelManagement/permissionMaintenance/permissionMaintenance", component: PermissionMaintenance, roles: ["admin","editor","guest"] },
   //人员管理
@@ -54,7 +59,9 @@ export default [
   //要点维护
   { path: "/checkPointManage/pointManage/pointManage", component: PointManage, roles: ["admin","editor","guest"] },
   //查核项维护
-  { path: "/checkPointManage/checkItem/checkItem", component: CheckItemManage, roles: ["admin","editor","guest"] },
+  { path: "/checkItemManage/checkItem/checkItem", component: CheckItemManage, roles: ["admin","editor","guest"] },
+  //查核项查核结果下拉选项管理
+  { path: "/checkItemManage/checkItemResultSelector/checkItemResultSelector", component: CheckItemResultSelector, roles: ["admin","editor","guest"] },
   //要点与单位
   { path: "/checkPointManage/pointAndGroup/pointAndGroup", component: PointAndGroup, roles: ["admin","editor","guest"] },
   //要点与查核组
@@ -65,6 +72,8 @@ export default [
   { path: "/checkPointManage/pointAndProvisions/pointAndProvisions", component: PointAndProvisions, roles: ["admin","editor","guest"] },
   //查核组管理
   { path: "/checkGroupManage/checkGroupManage", component: CheckGroupManage, roles: ["admin","editor","guest"] },
+  //查核方式管理
+  { path: "/checkGroupManage/checkTypeManage", component: CheckTypeManage, roles: ["admin","editor","guest"] },
   //条文条款管理
   { path: "/provisionsManage/provisions", component: ProvisionsManage, roles: ["admin","editor","guest"] },
   //错误

+ 10 - 0
src/mock/index.js

@@ -1,3 +1,11 @@
+/*
+ * @Author: your name
+ * @Date: 2021-04-23 15:39:41
+ * @LastEditTime: 2021-05-10 17:25:42
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /react-antd-admin-template/src/mock/index.js
+ */
 import Mock from "mockjs";
 import loginAPI from "./login";
 
@@ -5,6 +13,8 @@ import loginAPI from "./login";
 // 登录与用户相关
 // Mock.mock(/\/login/, "post", loginAPI.login);
 Mock.mock(/\/logout/, "post", loginAPI.logout);
+Mock.mock(/\/situation/, "get", loginAPI.situationList);
+Mock.mock(/\/conditions/, "get", loginAPI.conditionList);
 // Mock.mock(/\/userInfo/, "post", loginAPI.userInfo);
 // Mock.mock(/\/user\/list/, "get", loginAPI.getUsers);
 // Mock.mock(/\/user\/delete/, "post", loginAPI.deleteUser);

+ 94 - 67
src/mock/login.js

@@ -44,73 +44,6 @@ export default {
       token,
     };
   },
-  userInfo: (config) => {
-    const token = config.body;
-    const userInfo = users[token];
-    if (!userInfo) {
-      return {
-        status: 1,
-        message: "获取用户信息失败",
-      };
-    }
-    return {
-      status: 0,
-      userInfo,
-    };
-  },
-  getUsers: () => {
-    return {
-      status: 0,
-      users: Object.values(users),
-    };
-  },
-  deleteUser: (config) => {
-    const { id } = JSON.parse(config.body);
-    const token = tokens[id];
-    if (token) {
-      delete tokens[id];
-      delete users[token];
-    }
-    return {
-      status: 0,
-    };
-  },
-  editUser: (config) => {
-    const data = JSON.parse(config.body);
-    const { id } = data;
-    const token = tokens[id];
-    if (token) {
-      users[token] = { ...users[token], ...data };
-    }
-    return {
-      status: 0,
-    };
-  },
-  ValidatUserID: (config) => {
-    const userID = config.body;
-    const token = tokens[userID];
-    if (token) {
-      return {
-        status: 1,
-      };
-    } else {
-      return {
-        status: 0
-      };
-    }
-  },
-  addUser: (config) => {
-    const data = JSON.parse(config.body);
-    const { id } = data;
-    tokens[id] = `${id}-token`
-    users[`${id}-token`] = {
-      ...users["guest-token"],
-      ...data
-    }
-    return {
-      status: 0,
-    };
-  },
   logout: (_) => {
     return {
       status: 0,
@@ -120,4 +53,98 @@ export default {
       },
     };
   },
+  situationList:()=>{
+    return {
+      status:200,
+      data:[
+        {
+          checkGroupId: 1,
+          checkGroupName: "查核组",
+          checkStatus: "第1/1次查核计划进行中",
+          id: 152,
+          name: "5.8测试",
+          nextCheckTime: "无",
+          toDistributeCount: 1,
+          topic: 0
+        },
+        {
+          checkGroupId: 1,
+          checkGroupName: "查核组",
+          checkStatus: "第3/7次查核计划进行中",
+          id: 151,
+          name: "TTTTTT",
+          nextCheckTime: "2021年05月11日",
+          toDistributeCount: 6,
+          topic: 1
+        },
+        {
+          checkGroupId: 1,
+          checkGroupName: "查核组",
+          checkStatus: "第4/22次查核计划进行中",
+          id: 150,
+          name: "hhz",
+          nextCheckTime: "2021年05月11日",
+          toDistributeCount: 20,
+          topic: 0
+        },
+        {
+          checkGroupId: 1,
+          checkGroupName: "查核组",
+          checkStatus: "第1/6次查核计划进行中",
+          id: 149,
+          name: "追踪多查核组情况",
+          nextCheckTime: "2021年05月26日",
+          toDistributeCount: 4,
+          topic: 0
+        },
+        {
+          checkGroupId: 1,
+          checkGroupName: "查核组",
+          checkStatus: "第1/6次查核计划进行中",
+          id: 149,
+          name: "追踪多查核组情况",
+          nextCheckTime: "2021年05月26日",
+          toDistributeCount: 4,
+          topic: 0
+        }
+      ]
+    }
+  },
+  conditionList:()=>{
+    return {
+      status:200,
+      data:[
+         {
+          child: [],
+          description: "测试条件",
+          id: 6042,
+          name: "测试条件22",
+          parentId: 0
+         },
+         {
+          child: [
+             {
+              description: "",
+              id: 21,
+              name: "住院",
+              parentId: 20,
+              child:[
+                {
+                  child: [],
+                  description: "",
+                  id: 23,
+                  name: "RCC",
+                  parentId: 21
+                }
+              ]
+             }
+          ],
+          description: "",
+          id: 20,
+          name: "急诊",
+          parentId: 0
+         }
+      ]
+    }
+  }
 };

+ 51 - 20
src/utils/request.js

@@ -15,7 +15,6 @@ service.interceptors.request.use(
   (config) => {
     // Do something before request is sent
     if (store.getState().user.token) {
-      // 让每个请求携带token-- ['Authorization']为自定义key 请根据实际情况自行修改
       config.headers.token = getToken();
     }
     return config;
@@ -32,7 +31,7 @@ service.interceptors.response.use(
   (response) =>{
     console.log({response});
     const {data} = response;
-    console.log(data);
+    // console.log(data);
     if(data.status===200){
       return response;
     }else{
@@ -107,27 +106,59 @@ service.interceptors.response.use(
         },
       });
     }
-    if (status === 404) {
-        return
-    }
     if (status === 400) {
          console.log('400',error.response);
-         Modal.confirm({
-          title: "出现错误?",
-          content:
-            "出现错误",
-          okText: "确定",
-          // cancelText: "取消",
-          onOk() {
-            // let token = store.getState().user.token;
-            // store.dispatch(logout(token));
-          },
-          onCancel() {
-            console.log("Cancel");
-          },
-        });
-        return {error}
+         const {data} = error.response;
+        if(data=='无效的令牌{"msg":"无效的令牌","status":499}'){
+            Modal.confirm({
+              title: "出现错误?",
+              content:
+              '登录令牌已过期,请重新登录',
+              okText: "确定",
+              // cancelText: "取消",
+              onOk() {
+                let token = store.getState().user.token;
+                store.dispatch(logout(token));
+              },
+              onCancel() {
+                console.log("Cancel");
+              },
+            });
+        }else {
+          Modal.confirm({
+            title: "出现错误?",
+            content:
+            error.response.data,
+            okText: "确定",
+            // cancelText: "取消",
+            onOk() {
+              // let token = store.getState().user.token;
+              // store.dispatch(logout(token));
+            },
+            onCancel() {
+              console.log("Cancel");
+            },
+          });
+        }
+        // return {error}
     }
+    if (status === 499) {
+       Modal.confirm({
+        title: "出现错误?",
+        content:
+        '登录令牌已过期,请重新登录',
+        okText: "确定",
+        // cancelText: "取消",
+        onOk() {
+          let token = store.getState().user.token;
+          store.dispatch(logout(token));
+        },
+        onCancel() {
+          console.log("Cancel");
+        },
+      });
+      // return {error}
+  }
     return Promise.reject(error);
   }
 );

+ 18 - 19
src/views/checkGroupManage/checkGroupManage.jsx

@@ -13,7 +13,6 @@ const {Search} = Input;
 
 class TableForm extends React.Component {
     
-
     constructor(props){
          super(props);
          
@@ -29,16 +28,16 @@ class TableForm extends React.Component {
 
     handleCommit = () => {
         console.log('开始校验表单');
-        return new Promise((resolve,reject)=>{
-          this.props.form.validateFields((err,values) => {
-            if (!err) {
-              let data = {
-                ...this.props.content,
-                ...values
+          return new Promise((resolve,reject)=>{
+            this.props.form.validateFields((err,values) => {
+              if (!err) {
+                let data = {
+                  ...this.props.content,
+                  ...values
+                }
+                resolve(data);
               }
-              resolve(data);
-            }
-        });
+          });
         })
     };
 
@@ -82,10 +81,11 @@ class TableForm extends React.Component {
             });
         })
     }
+    
     bindPerson=(obj)=>{
         bindCheckGroupAndEmp(obj).then(res=>{
             // console.log({res});
-          if(res.data.msg=="success"){
+          if(res&&res.data.msg=="success"){
                this.setState({
                 BindPersonStatus:'success'
                })
@@ -96,7 +96,7 @@ class TableForm extends React.Component {
     bindCheckPoint=(obj)=>{
         bindCheckGroupAndCheckPoint(obj).then(res=>{
             // console.log({res});
-          if(res.data.msg=="success"){
+          if(res&&res.data.msg=="success"){
                this.setState({
                 BindStatus:'success'
                })
@@ -136,9 +136,6 @@ class TableForm extends React.Component {
       })
     }
 
-    // componentDidUpdate(prevProps,prevState){
-    //     console.log({prevProps,prevState});
-    // }
 
     shouldComponentUpdate(nextProps,nextState){
     
@@ -153,7 +150,7 @@ class TableForm extends React.Component {
         const {name,groupManagerName,isManager} = content;
         
         // const bindGroupDefault = groupManaList.length>0?groupManaList[0].name:'bindGroupDefault';
-        console.log({content});
+        // console.log({content});
         const formItemLayout = {
             labelCol: {
               xs: { span: 24 },
@@ -284,6 +281,7 @@ const CheckGroupManage = () => {
   const modalNode = useRef(null);
   const formNode = useRef(null);
   const thisForm = useRef(null);
+  const [searchKey,setsearchKey] = useState('');
 //   let [editingKey,seteditingKey] = useState('');
 
   const columns = [
@@ -379,7 +377,7 @@ const CheckGroupManage = () => {
 
       if(!ifEdit){
         const seletedItem = formNodeState.groupManageList.filter(item=>item.id==formData.groupManagerId);
-        console.log({seletedItem});
+        // console.log({seletedItem});
         const param = {
             "name":formData.name , // 查核组名称 必填
             "groupManagerId":formData.groupManagerId, // 组长id 必填
@@ -400,7 +398,7 @@ const CheckGroupManage = () => {
         // console.log({param});
         editCheckGroup(param).then(res=>{
           if(res&&res.data.msg=="success"){
-            getData();
+            getData({page:pages.currPage});
            }
         });
       }
@@ -408,11 +406,12 @@ const CheckGroupManage = () => {
 
   const paginationCallback = (obj)=>{
     const {currPage} = obj;
-    getData({page:currPage-1,pageSize:10});
+    getData({page:currPage,pageSize:10,keyword:searchKey});
   }
 
   const onSearch = (searchKey)=>{
     //  console.log({searchKey});
+    setsearchKey(searchKey);
      getData({
        'keyword':searchKey?searchKey:''
      });

+ 316 - 0
src/views/checkGroupManage/checkTypeManage.jsx

@@ -0,0 +1,316 @@
+import React,{ useState,useEffect,useRef } from 'react';
+
+import {getCheckTypeDictionary,getCheckWays,addCheckDictionary,editCheckDictionary,delCheckDictionary} from "@/api/checkGroupManage.js";
+import { Button,Form,Input,Select} from 'antd';
+import EditableFormTable from './table';
+import ModalWrap from '@/components/Modal/modal.js';
+
+
+const { Option } = Select;
+const {Search} = Input;
+
+class TableForm extends React.Component {
+    
+    constructor(props){
+         super(props);
+         
+         this.state = {
+            checkTypeList:[]
+         };
+    }
+
+    handleCommit = () => {
+        console.log('开始校验表单');
+          return new Promise((resolve,reject)=>{
+            this.props.form.validateFields((err,values) => {
+              if (!err) {
+                let data = {
+                  ...this.props.content,
+                  ...values
+                }
+                resolve(data);
+              }
+          });
+        })
+    };
+
+
+    componentWillUnmount(){
+        this.props.form.resetFields();
+    }
+
+    componentDidMount(){
+        getCheckWays().then(res=>{
+        // console.log({res});
+        const temp = res.data.data;
+        this.setState({
+            checkTypeList:temp
+        })
+      });
+    }
+
+
+    shouldComponentUpdate(nextProps,nextState){
+    
+          return true;
+    }
+    
+    render(){
+        
+        const { getFieldDecorator } = this.props.form;
+        const {content,edit} = this.props;
+        const {checkTypeList} = this.state;
+        const {itemCode} = content;
+        
+        // const bindGroupDefault = groupManaList.length>0?groupManaList[0].name:'bindGroupDefault';
+        // console.log({content});
+        const formItemLayout = {
+            labelCol: {
+              xs: { span: 24 },
+              sm: { span:6 },
+            },
+            wrapperCol: {
+              xs: { span: 12 },
+              sm: { span: 12 },
+            },
+        };
+        const config =(key,rules)=>{
+          return {
+            initialValue:edit?key:'',
+            rules: [
+              ...rules
+            ],
+          }
+        }
+
+        return (
+            <Form {...formItemLayout}  >
+                   {/* <Form.Item label="查核方式名">
+                    {
+                        getFieldDecorator('itemName',config(itemName,[{required: true,message: '请输入查核方式名!',}]))(<Input />)
+                    }
+                   </Form.Item> */}
+                   <Form.Item label="选择查核方式" >                
+                        {
+                            getFieldDecorator('itemCode',config(itemCode,[{required: true,}]))(
+                                <Select
+                                    placeholder="" >
+                                    {
+                                        checkTypeList.map((v,k)=>{
+                                            return (
+                                               <Option key={k} value={v.itemCode}>{v.itemName}</Option>
+                                            )
+                                        })
+                                    }
+                                </Select>,
+                            )
+                        }
+                   </Form.Item>
+            </Form>         
+        )
+    }
+}
+
+const WrappedTableForm = Form.create({ name: 'register' })(TableForm);
+
+
+
+
+
+
+const Page = () => {
+
+  let [arr,setarr] = useState([]);
+  let [pages,setpages] = useState({});
+  let [ifUpdateList,setifUpdateList]=useState(false);
+  let [ifRender,setifRender] = useState(false);
+  let [ifShowDialog,setifShowDialog] = useState(false);
+  const [item,setitem]=useState({});
+  const [ifEdit,setifEdit]=useState(false);
+  const modalNode = useRef(null);
+  const formNode = useRef(null);
+  const thisForm = useRef(null);
+  const [searchKey,setsearchKey] = useState('');
+//   let [editingKey,seteditingKey] = useState('');
+
+  const columns = [
+    {
+      title: 'id',
+      dataIndex: 'id',
+      key: 'id',
+      width:'10%',
+      render: text => <a>{text}</a>,
+    },
+    {
+      title: '字典类型',
+      dataIndex: 'typeCode',
+      key: 'typeCode',
+      editable: false,
+    },
+    {
+        title: '字典类型名称',
+        dataIndex: 'typeName',
+        key: 'typeName',
+        editable: false,
+    },
+    {
+        title: '字典code',
+        dataIndex: 'itemCode',
+        key: 'itemCode',
+        editable: false,
+    },
+    {
+        title: '字典名称',
+        dataIndex: 'itemName',
+        key: 'itemName',
+        editable: false,
+    },
+    {
+        title: '检索码',
+        dataIndex: 'searchCode',
+        key: 'searchCode',
+        editable: false,
+    },
+  ];
+
+
+
+  const getData = async (pageObj)=>{
+    let data = await getCheckTypeDictionary(pageObj);
+    
+    const renderData = data.data.data.list.map((item,index)=>{
+          return {
+              ...item,
+              key:item['id'],
+            //   editable: true,
+          }
+    })
+    setarr(renderData);
+    setpages({
+        'currPage':data.data.data.currPage,
+        'totalPage':data.data.data.totalPage,
+        'totalCount':data.data.data.totalCount,
+    });
+    setifRender(false);
+    setifRender(true);
+
+  }
+
+  const callbackFromChild = (data)=>{
+        setitem(data);
+        setifEdit(true);
+        thisForm.current&&thisForm.current.resetFields();
+        modalNode.current.showModal();
+  }
+
+  const deleteCallback = (record)=>{
+    // console.log('删除');
+    delCheckDictionary([record.id]).then(res=>{
+        if(res.data.msg=="success"){
+                getData();
+        }
+    })
+  }
+
+  const handleAdd=()=>{
+
+    setifEdit(false);
+    //初始化表单
+    if(arr.length>0){
+      setitem(arr[0]);
+    }else{
+      setitem({
+        "itemCode": "",   // 下拉款中选择中的key
+        "itemName": ""
+      });
+    }
+    
+    modalNode.current.showModal();
+  }
+
+
+
+  const commitForm = async ()=>{  //表单提交
+      console.log('提交表单');
+      // console.log({formNode});
+      const formData = await formNode.current.handleCommit();
+      const formNodeState = formNode.current.state;
+      
+      modalNode.current.handleCancel();
+      thisForm.current.resetFields();
+
+      const seletedItem = formNodeState.checkTypeList.filter(item=>item.itemCode==formData.itemCode);
+      
+      if(!ifEdit){
+       
+        // console.log({seletedItem});
+        const param = {
+            "itemCode":formData.itemCode , 
+            "itemName":seletedItem.length>0?seletedItem[0].itemName:'' 
+        }
+        addCheckDictionary(param).then(res=>{
+
+          if(res&&res.data.msg=="success"){
+           getData();
+          }
+        })
+      }
+      if(ifEdit){
+        const editItem = item;
+        const param = {
+            "id":editItem.id, 
+            "itemCode":formData.itemCode , 
+            "itemName":seletedItem.length>0?seletedItem[0].itemName:'' 
+        }
+        // console.log({param});
+        editCheckDictionary(param).then(res=>{
+          if(res&&res.data.msg=="success"){
+            getData({page:pages.currPage});
+           }
+        });
+      }
+  }
+
+  const paginationCallback = (obj)=>{
+    const {currPage} = obj;
+    getData({page:currPage,pageSize:10,keyword:searchKey});
+  }
+
+  const onSearch = (searchKey)=>{
+    //  console.log({searchKey});
+    setsearchKey(searchKey);
+     getData({
+       'keyword':searchKey?searchKey:''
+     });
+  }
+
+  
+  useEffect(()=>{
+    getData();
+  },[]);
+
+  return ( 
+    <div className="app-container">
+          <h1>查核方式字典管理</h1>
+          <ModalWrap ref={modalNode} show={ifShowDialog} handleOkCallback={commitForm} >
+                <WrappedTableForm edit={ifEdit} content={item} ref={thisForm} wrappedComponentRef={formNode} />
+          </ModalWrap>
+          
+          <div style={{display:'flex',flexDirection:'row'}}>
+          <Button onClick={handleAdd} type="primary" style={{ marginBottom: 16,marginRight:20 }}>
+             新增查核方式字典
+          </Button>
+          <Search style={{ width: 200 }} allowClear placeholder="请输入字典名"  onSearch={onSearch} enterButton />
+          </div>
+          {
+             ifRender&& <EditableFormTable columns={columns}  pages={pages} paginationCallback={paginationCallback}  data={arr} deleteCallback={deleteCallback} callbackFromChild={callbackFromChild}  ifUpdateList={ifUpdateList}/>
+          }
+    </div>
+  );
+}
+
+
+
+
+ 
+export default Page;

+ 2 - 2
src/views/checkGroupManage/table.js

@@ -4,7 +4,7 @@
 /*
  * @Author: your name
  * @Date: 2021-04-27 11:19:40
- * @LastEditTime: 2021-04-30 15:45:25
+ * @LastEditTime: 2021-05-16 21:45:23
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /react-antd-admin-template/src/views/groupManage/groupIdentity/table.js
@@ -138,7 +138,7 @@ class EditableTable extends React.Component {
         showQuickJumper: false,
         showTotal: () => `共${totalCount}条`,
         pageSize: 10,
-        current: currPage+1,
+        current: currPage,
         total: totalCount,
         onChange: (current) => this.changePage(current),
     }

+ 627 - 0
src/views/checkItemManage/checkItem/checkItem.jsx

@@ -0,0 +1,627 @@
+import React,{ useState,useEffect,useRef } from 'react';
+
+import {getCheckItem,getCheckItemTypeList,listAll,delCheckItem,addCheckItem,editCheckItem,
+  bindCheckItemAndCheckPoint,addCheckItemCheckResult,getCheckItemCheckResultSelecterList,} from "@/api/checkPointManage.js";
+import {addCheckItemAttr} from "@/api/checkItem.js";
+import { Button,Form,Input,Select,Tag,Tooltip,message} from 'antd';
+import EditableFormTable from './table';
+import ModalWrap from '@/components/Modal/modal.js';
+// import { TAGSVIEW_EMPTY_TAGLIST } from '../../../store/action-types';
+
+const { Option } = Select;
+const InputGroup = Input.Group;
+const { Search } = Input;
+
+
+class TableForm extends React.Component {
+    
+
+    constructor(props){
+         super(props);
+         
+         this.state = {
+          depTypeList:[],
+          checkPointList:[],
+          checkTypeList:[],
+          checkResultList:[],//查核结果配置
+          addCheckItemResultSelect:[],
+          BindStatus:'',
+          ifClear:false,
+          BindPointStatus:'',
+          checkResultName:'',//
+          checkResultCount:'',
+         };
+    }
+
+    handleCommit = () => {
+        console.log('开始校验表单');
+        return new Promise((resolve,reject)=>{
+          this.props.form.validateFields((err,values) => {
+            if (!err) {
+              let data = {
+                ...this.props.content,
+                ...values,
+                // checkModelList
+                itemAttrs:this.state.checkResultList
+              }
+              console.log({'handleCommit':data});
+              resolve(data);
+            }
+        });
+        })
+      
+    };
+
+    handleSelectChange=(value)=>{
+      // console.log(value);
+      const {checkItemId} = this.props.content;
+      this.setState({
+        BindStatus:'validating'
+      },()=>{
+          this.bindPoint({
+            checkItemId:checkItemId,
+            checkPointIds:[value]
+          });
+      })
+    }
+    //当删除查核结果配置
+    onTagClose=(e)=>{
+        // console.log('onTagClose',e);
+        // console.log(this.state.checkResultList);
+        const checkResultListByFilter = this.state.checkResultList.filter(item=>item.attr != e);
+        // console.log({checkResultListByFilter});
+        this.setState({
+          checkResultList:checkResultListByFilter
+        })
+    }
+    //更新查核结果配置
+    updateCheckResultList=()=>{
+      const {checkResultList,checkResultName,checkResultCount} = this.state;
+      if(checkResultName&&checkResultCount){
+        this.setState({
+          checkResultList:[...checkResultList,{attr:checkResultName,value:checkResultCount}],
+        },()=>this.setState({checkResultName:'',checkResultCount:''}))
+      }else {
+        message.warning('抱歉,未填写配置项!');
+      }
+      
+    }
+
+    bindPoint=(obj)=>{
+      // console.log({obj});
+      bindCheckItemAndCheckPoint(obj).then(res=>{
+          if(res&&res.data.msg=="success"){
+               this.setState({
+                BindStatus:'success'
+               })
+          }
+        })
+    }
+
+    initData(){
+      const {content,edit} = this.props;
+
+      if(edit&&content.itemAttrs){
+        const editCheckItemResultList = JSON.parse(content.itemAttrs);
+        console.log({editCheckItemResultList});
+        this.setState({
+          checkResultList:editCheckItemResultList
+        })
+      
+      }
+    }
+
+    onAddCheckItemResultSelectChange=(e)=>{
+        // console.log({e});
+        this.setState({
+          checkResultName:e
+        })
+    }
+
+    clearData(){
+      this.setState({
+        checkResultName:'',
+        checkResultList:[],
+        checkResultCount:''
+      })
+    }
+
+    componentWillUnmount(){
+        this.props.form.resetFields();
+    }
+
+    componentDidMount(){
+      console.log('Form_componentDidMount');
+      listAll().then(res=>{
+        // console.log({res});
+        const temp = res.data.data;
+        this.setState({
+          checkPointList:temp
+        })
+      });
+      //获取添加查核项结果下拉列表
+      getCheckItemCheckResultSelecterList().then(res=>{
+        const temp = res.data.data;
+        // console.log({temp});
+        this.setState({
+          addCheckItemResultSelect:temp
+        })
+      });
+      
+      getCheckItemTypeList().then(res=>{
+        const temp = res.data.data;
+        this.setState({
+          checkTypeList:temp
+        })
+      });
+
+      this.initData();
+    
+      
+    }
+
+
+
+    shouldComponentUpdate(nextProps,nextState){
+          // console.log({nextProps,nextState})  
+          return true;
+    }
+
+    componentDidUpdate(prevProps) {
+      const {content} = this.props;
+      // console.log('start_diff_itemAttr',prevProps.content.itemAttr,content);
+      if (content.itemAttr != prevProps.itemAttr) {
+          // console.log('update_checkResultList');
+           this.initData();
+      }
+    }
+    
+    render(){
+        
+        const { getFieldDecorator } = this.props.form;
+        const {content,edit} = this.props;
+        const {depTypeList,BindStatus,checkPointList,checkTypeList,ifClear,checkResultList,checkResultName,checkResultCount,addCheckItemResultSelect} = this.state;
+        const {checkItemName,rightAnswerText,relatedRules,checkModelList,score,itemAttr} = content;
+        // const bindGroupDefault = groupManaList.length>0?groupManaList[0].name:'bindGroupDefault';
+        // console.log({content,edit});
+        const formItemLayout = {
+            labelCol: {
+              xs: { span: 24 },
+              sm: { span:6 },
+            },
+            wrapperCol: {
+              xs: { span: 12 },
+              sm: { span: 12 },
+            },
+        };
+        const config =(key,rules)=>{
+          // console.log({key});
+          return {
+            initialValue:edit?key:'',
+            rules: [
+              ...rules
+            ],
+          }
+        }
+
+        return (
+            <Form {...formItemLayout}  >
+                   <Form.Item label="查核项">
+                    {
+                        getFieldDecorator('checkItemName',config(checkItemName,[{required: true,message: '请输入查核项名!',}]))(<Input />)
+                    }
+                   </Form.Item>
+                   <Form.Item label="查核方式">
+                    {
+                        getFieldDecorator('checkModeList',config(checkModelList,[{required: true,message: '请选择查核方式!',}]))(
+                          <Select
+                              placeholder=""
+                          >
+                              {
+                                checkTypeList.map((v,k)=>{
+                                    return (
+                                      <Option key={k} value={v.itemCode}>{v.itemName}</Option>
+                                    )
+                                })
+                              }
+                          </Select>,
+                        )
+                    }
+                   </Form.Item>
+                   {
+                     edit&&<Form.Item label="查核项分数" style={{display:edit?'block':'none'}}>
+                     {
+                         getFieldDecorator('score',config(score,[{required:false,message: '请输入查核分数!',}]))(<Input />)
+                     }
+                     </Form.Item>
+                   }
+                   
+                   <Form.Item label="查核项查核结果配置" style={{display:edit?'block':'none'}}>
+                    {
+                        getFieldDecorator('itemAttr',config('',[{required: false,message: '请输入配置查核结果!',}]))(
+                          <div style={{borderRadius:'4px',minHeight:'70px',display:ifClear?'none':'block'}}>
+                               <InputGroup compact>
+                                  <Tooltip title="请选择查核结果名">
+                                  <Select
+                                    style={{ width:'50%'}}
+                                    placeholder="请选择查核结果名"
+                                    value={checkResultName}
+                                    onChange={this.onAddCheckItemResultSelectChange}
+                                    // // onFocus={onFocus}
+                                    // // onBlur={onBlur}
+                                  >
+                                    {
+                                      addCheckItemResultSelect.map((item,index)=>{
+                                           return (
+                                              <Option key={index} value={item}>{item}</Option>
+                                           )
+                                      })
+                                    }
+                                  </Select>
+                                  </Tooltip>
+                                  <Tooltip title="请定义查核结果对应的分值占比,如:50">
+                                      <Input style={{ width: '30%' }} onChange={(e)=>{this.setState({checkResultCount:e.target.value})}} value={checkResultCount} placeholder="如:50" />
+                                  </Tooltip>
+                                  <Button type="primary" onClick={this.updateCheckResultList}>添加</Button>
+                               </InputGroup>
+                               <Form.Item >
+                               {
+                                 getFieldDecorator('score',config(score,[{required: false,message: '请输入查核分数!',}]))(
+                                      <div>
+                                           {
+                                            checkResultList&&checkResultList.map((item,index)=>{
+                                              const tagName = item.attr;
+                                              return (
+                                                <Tag color="#4E78FF"  closable key={index} onClose={this.onTagClose.bind(this,tagName)}>
+                                                    {`${item.attr}|${item.value}%`}
+                                                </Tag>
+                                              )
+                                            })
+                                          }
+                                      </div>
+                                 )
+                               }
+                               </Form.Item>
+                          </div>
+                        )
+                    }
+                   </Form.Item>
+                   <Form.Item label="应知应会文字">
+                    {
+                        getFieldDecorator('rightAnswerText',config(rightAnswerText,[{required: false,message: '!',}]))(<Input.TextArea autoSize={{minRows:5}} />)
+                    }
+                   </Form.Item>
+                   <Form.Item label="相关条文">
+                    {
+                        getFieldDecorator('relatedRules',config(relatedRules,[{required: false,message: '!',}]))(<Input.TextArea autoSize={{minRows:5}} />)
+                    }
+                   </Form.Item>
+                   
+                   <Form.Item label="绑定查核要点"
+                       hasFeedback
+                       style={{display:edit?'block':'none'}}
+                       validateStatus={BindStatus}   //validating,success,warning
+                   >
+                    {
+                        getFieldDecorator('bindPoint',config('',[{required: false,}]))(
+                          <Select
+                             placeholder=""
+                             onChange={this.handleSelectChange}
+                             showSearch
+                            optionFilterProp="children"
+                            filterOption={(input, option) =>
+                              option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
+                            }
+                          >
+                             {
+                                checkPointList.map((v,k)=>{
+                                    return (
+                                      <Option key={k} value={v.id}>{v.name}</Option>
+                                    )
+                                })
+                              }
+                          </Select>,
+                        )
+                    }
+                   </Form.Item>
+          </Form>         
+        )
+    }
+}
+
+const WrappedTableForm = Form.create({ name: 'register' })(TableForm);
+
+
+const CheckItem = () => {
+
+  let [arr,setarr] = useState([]);
+  let [pages,setpages] = useState({});
+  let [ifUpdateList,setifUpdateList]=useState(false);
+  let [ifRender,setifRender] = useState(false);
+  let [ifShowDialog,setifShowDialog] = useState(false);
+  const [item,setitem]=useState({});
+  const [ifEdit,setifEdit]=useState(false);
+  const modalNode = useRef(null);
+  const formNode = useRef(null);
+  const thisForm = useRef(null);
+  const [searchKey,setsearchKey] = useState('');
+  const [ifRenderModal,set_ifRenderModal] = useState(true);
+//   let [editingKey,seteditingKey] = useState('');
+
+  const columns = [
+    {
+      title: 'id',
+      dataIndex: 'checkItemId',
+      width:'10%',
+      key: 'checkItemId',
+      render: text => <a>{text}</a>,
+    },
+    {
+      title: '查核项',
+      dataIndex: 'checkItemName',
+      key: 'checkItemName',
+      editable: true,
+      width:'15%'
+    },
+    {
+      title: '查核方式',
+      dataIndex: 'checkModelList',
+      key: 'checkModelList',
+      editable: true,
+      width:'10%'
+    },
+    {
+      title: '拥有查核结果',
+      key: 'itemAttrs',
+      width:'20%',
+      dataIndex: 'itemAttrs',
+      render: tags =>{
+  
+        const newTags = tags?JSON.parse(tags):[];
+        // console.log({newTags});
+        return (
+          <span>
+          {newTags&&newTags.map(tag => {
+            return (
+              <Tag  key={tag.attr}>
+                  {tag.attr}
+              </Tag>
+            );
+          })}
+          </span>
+        )
+      },
+    },
+    {
+        title: '应知应会文字',
+        dataIndex: 'rightAnswerText',
+        key: 'rightAnswerText',
+        editable: true,
+        width:'20%'
+    },
+   
+    {
+        title: '应知应会图片url',
+        dataIndex: 'rightAnswerImage',
+        key: 'rightAnswerImage',
+        editable: false,
+        width:'20%'
+    },
+    {
+        title: '相关条文',
+        dataIndex: 'relatedRules',
+        key: 'relatedRules',
+        editable: false,
+        width:'20%'
+    },
+  ];
+
+
+
+  const getData = async (pageObj)=>{
+    let data = await getCheckItem(pageObj);
+    if(data.data.data){
+      const renderData = data.data.data.list.map((item,index)=>{
+        return {
+            ...item,
+            key:item['id'],
+          //   editable: true,
+        }
+      })
+      setarr(renderData);
+    }else {
+      console.log('data为null');
+      return
+    }
+    setpages({
+        'currPage':data.data.data.currPage,
+        'totalPage':data.data.data.totalPage,
+        'totalCount':data.data.data.totalCount,
+    });
+    setifRender(false);
+    setifRender(true);
+  }
+
+  const callbackFromChild = (data)=>{
+        set_ifRenderModal(true);
+        setitem(data);
+        setifEdit(true);
+        thisForm.current&&thisForm.current.resetFields();
+        modalNode.current&&modalNode.current.showModal();
+  }
+
+  const deleteCallback = (record)=>{
+    // console.log({record});
+    delCheckItem([record.checkItemId]).then(res=>{
+        if(res&&res.data.msg=="success"){
+                getData();
+        }
+    })
+  }
+
+  const handleAdd=()=>{
+    set_ifRenderModal(true);
+    setifEdit(false);
+    //初始化表单
+    if(arr.length>0){
+      setitem(arr[0]);
+    }else{
+      setitem({
+        "checkModeList": "", // 查核方式 必填(暂时写死,需要考虑(下拉框选择))
+        "checkItemName": "",// 查核项目名称 必填
+        "relatedRules": "", // 相关条文
+        "rightAnswerImage": "", // 正确答案图片url 上传图片接口待定
+        "rightAnswerText": "" // 正确答案文字 
+      });
+    }
+    modalNode.current.showModal();
+  }
+
+
+
+  const commitForm = async ()=>{  //表单提交
+      console.log('提交表单');
+      const formData = await formNode.current.handleCommit();
+      // console.log({formNode,thisForm});
+      modalNode.current.handleCancel();
+      //清空表单缓存
+      // resetForm();
+  
+
+      if(!ifEdit){
+        const param = {
+            "checkModeList":formData.checkModeList, // 查核方式 必填(暂时写死,需要考虑(下拉框选择))
+            "name":formData.checkItemName,// 查核项目名称 必填
+            "relatedRules":formData.relatedRules, // 相关条文
+            "rightAnswerImage":'', // 正确答案图片url 上传图片接口待定
+            "rightAnswerText": formData.rightAnswerText,// 正确答案文字  
+            // "score":formData.score,//查核项分数
+        }
+        addCheckItem(param).then(res=>{
+          if(res&&res.data.msg=="success"){
+           getData();
+          }
+        })
+      }
+      if(ifEdit){
+        const currentEditItem = item;
+      
+        // const checkResultListByFilter = formData.itemAttrs.filter(item=>{
+        //       let needNoCommitList = JSON.parse(currentEditItem.itemAttrs);
+        //       let temp = needNoCommitList.filter(v=>v.attr == item.attr);
+        //       return temp.length==0;
+        // });
+
+        const paramForCheckItemresult = {
+          "checkItemId":item.checkItemId,   // 查核项id
+          "id":item.attrId,
+          "score":parseInt(formData.score),  // 分数
+          "itemAttrs":formData.itemAttrs,
+        }
+        const param = {
+            "id":item.checkItemId,
+            "checkModeList": formData.checkModeList, // 查核方式
+            "name":formData.checkItemName, // 名称必填
+            "relatedRules":formData.relatedRules, // 相关条文
+            "rightAnswerImage":item.rightAnswerImage,// 应知应会图片url
+            "rightAnswerText":formData.rightAnswerText, // 应知应会文字
+        }
+
+        console.log({param,item})
+        
+        const editCheckItemFunc = ()=>{
+          editCheckItem(param).then(res=>{
+            if(res&&res.data.msg=="success"){
+              getData({page:pages.currPage});
+             }
+          });
+        }
+
+        //不存在查核属性id时,调用查核属性新增
+        if(item.attrId){ 
+          addCheckItemCheckResult(paramForCheckItemresult).then(res=>{
+            if(res&&res.data.msg=="success"){
+              console.log('查核项结果配置成功');
+              editCheckItemFunc();
+              // getData({page:pages.currPage});
+            }
+          });
+        }else {
+          const param = {
+            'checkItemId':item.checkItemId,
+            'itemAttr':formData.itemAttrs,
+            'score':formData.score
+          }
+          addCheckItemAttr(param).then(res=>{
+            if(res&&res.data.msg=="success"){
+              editCheckItemFunc();
+            }
+          });
+        }
+      }
+  }
+
+  const paginationCallback = (obj)=>{
+    const {currPage} = obj;
+    getData({page:currPage,pageSize:10,keyword:searchKey});
+  }
+
+  const onSearch = (searchKey)=>{
+      //  console.log({searchKey});
+      setsearchKey(searchKey);
+       getData({
+         'keyword':searchKey?searchKey:''
+       });
+  }
+
+  const resetForm = ()=>{
+      thisForm.current.resetFields();
+      formNode.current.state.BindStatus='';
+      formNode.current.state.BindPointStatus='';
+      formNode.current.clearData();
+      // set_ifRenderModal(false);
+  }
+
+  const handleCancelCallback = ()=>{
+      console.log('modal_closed');
+      resetForm();
+      set_ifRenderModal(false);
+      // set_ifRenderModal(true);
+
+  }
+
+
+  
+  useEffect(()=>{
+    getData();
+  },[]);
+
+  return ( 
+    <div className="app-container">
+          <h1>查核项管理</h1>
+          <ModalWrap width={1000} ref={modalNode} show={ifShowDialog} handleOkCallback={commitForm} handleCancelCallback={handleCancelCallback} >
+           {
+            ifRenderModal&&<WrappedTableForm edit={ifEdit} content={item} ref={thisForm} wrappedComponentRef={formNode} />
+           }
+          </ModalWrap>
+        
+          
+          <div style={{display:'flex',flexDirection:'row'}}>
+          <Button onClick={handleAdd} type="primary" style={{ marginBottom: 16,marginRight:20 }}>
+             新增查核项
+          </Button>
+          <Search style={{ width: 200 }} allowClear placeholder="请输入查核项"  onSearch={onSearch} enterButton />
+          </div>
+
+          {
+             ifRender&& <EditableFormTable columns={columns} paginationCallback={paginationCallback} pages={pages}  data={arr} deleteCallback={deleteCallback} callbackFromChild={callbackFromChild}  ifUpdateList={ifUpdateList}/>
+          }
+    </div>
+  );
+}
+
+
+
+
+ 
+export default CheckItem;

+ 164 - 0
src/views/checkItemManage/checkItem/table.js

@@ -0,0 +1,164 @@
+/*
+ * @Author: your name
+ * @Date: 2021-04-27 18:08:04
+ * @LastEditTime: 2021-05-16 21:46:37
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /react-antd-admin-template/src/views/checkPointManage/checkItem/table.js
+ */
+
+
+/*
+ * @Author: your name
+ * @Date: 2021-04-27 11:19:40
+ * @LastEditTime: 2021-04-27 15:20:38
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /react-antd-admin-template/src/views/groupManage/groupIdentity/table.js
+ */
+
+import React from 'react';
+import { Table,Popconfirm, Form,Divider} from 'antd';
+
+
+
+
+class EditableTable extends React.Component {
+  
+  static defaultProps = {
+        editCallback: ()=>{},
+        deleteCallback:()=>{},
+        callbackFromChild:()=>{},
+        config:{
+            action:{
+                deleteBtn:true,
+                editBtn:true,  
+                editPermissionBtn:false
+            }
+        } 
+  }
+
+  constructor(props) {
+    super(props);
+    this.state = { data:[], editingKey: '',loading:false};
+
+    this.columns = [
+
+      ...props.columns,
+      {
+        title: '操作',
+        fixed: 'right',
+        width: 110,
+        dataIndex: 'operation',
+        render: (text, record) => {
+          const { editingKey} = this.state;
+        //   console.log({editingKey,record});
+          return (
+            <span>
+                 <a disabled={editingKey !== ''} onClick={() => this.editItem(record)}>
+                        编辑
+                 </a>
+                 <Divider type="vertical" />
+                 <Popconfirm title=" 是否确定删除?" onConfirm={()=>this.delItem(record)}>
+                    <a disabled={editingKey !== ''} >
+                            删除
+                    </a>
+                 </Popconfirm>
+                 {/* <Divider type="vertical" />
+                 <a disabled={editingKey !== ''} onClick={() => this.bindGroup(record)}>
+                        绑定单位
+                 </a> */}
+             </span>
+ 
+          );
+        },
+      },
+    ];
+  }
+
+
+
+  componentDidMount(){
+    this.setState({
+        data:this.props.data
+    });
+    
+  }
+
+  componentDidUpdate(prevProps, prevState){
+    // console.log({prevProps, prevState});
+    if(prevProps.ifUpdateList){
+        console.log('update');
+        this.setState({
+            data:this.props.data
+        });
+    }
+  }
+
+  isEditing = record => {
+    //   console.log(record.id,this.state.editingKey);
+      return record.id === this.state.editingKey;
+  }
+  
+  editItem=(record)=>{
+      this.props.callbackFromChild(record);
+  }
+
+  delItem=record=>{
+      this.props.deleteCallback(record);
+  }
+
+  changePage(current){
+    this.setState({ loading: true });
+    this.props.paginationCallback({'currPage':current})
+  }
+
+
+  render() {
+    
+    const columns = this.columns.map(col => {
+      if (!col.editable) {
+        return col;
+      }
+      return {
+        ...col,
+        onCell: record => ({
+          record,
+        }),
+      };
+    });
+
+    const {
+        currPage,
+        totalCount,
+    } = this.props.pages;
+
+    const paginationProps = {
+        showSizeChanger: false,
+        showQuickJumper: false,
+        showTotal: () => `共${totalCount}条`,
+        pageSize: 10,
+        current: currPage,
+        total: totalCount,
+        onChange: (current) => this.changePage(current),
+    }
+
+    return (
+        <Table
+          bordered
+          loading={this.state.loading}
+          pagination={paginationProps}
+          dataSource={this.state.data}
+          columns={columns}
+          scroll={{x:1900}}
+          rowClassName="editable-row"
+          rowKey={(record, index) => index}
+        />
+    );
+  }
+}
+
+const EditableFormTable = Form.create()(EditableTable);
+
+
+export default EditableFormTable;

+ 318 - 0
src/views/checkItemManage/checkItemResultSelector/checkItemResultSelector.jsx

@@ -0,0 +1,318 @@
+import React,{ useState,useEffect,useRef } from 'react';
+
+import {getCheckItemResultPopList,getCheckItemListForSelect,editCheckItemListForSelect,addCheckItemListForSelect,delCheckItemListForSelect} from "@/api/checkItem.js";
+import { Button,Form,Input,Select} from 'antd';
+import EditableFormTable from './table';
+import ModalWrap from '@/components/Modal/modal.js';
+
+
+const { Option } = Select;
+const {Search} = Input;
+
+class TableForm extends React.Component {
+    
+    constructor(props){
+         super(props);
+         
+         this.state = {
+            checkItemListForSelect:[]
+         };
+    }
+
+    handleCommit = () => {
+        console.log('开始校验表单');
+          return new Promise((resolve,reject)=>{
+            this.props.form.validateFields((err,values) => {
+              if (!err) {
+                let data = {
+                  ...this.props.content,
+                  ...values
+                }
+                resolve(data);
+              }
+          });
+        })
+    };
+
+
+    componentWillUnmount(){
+        this.props.form.resetFields();
+    }
+
+    componentDidMount(){
+        getCheckItemListForSelect().then(res=>{
+        // console.log({res});
+        const temp = res.data.data;
+        this.setState({
+            checkItemListForSelect:temp
+        })
+      });
+    }
+
+
+    shouldComponentUpdate(nextProps,nextState){
+    
+          return true;
+    }
+    
+    render(){
+        
+        const { getFieldDecorator } = this.props.form;
+        const {content,edit} = this.props;
+        const {checkItemListForSelect} = this.state;
+        const {resultName,checkItemName} = content;
+        
+        // const bindGroupDefault = groupManaList.length>0?groupManaList[0].name:'bindGroupDefault';
+        // console.log({content});
+        const formItemLayout = {
+            labelCol: {
+              xs: { span: 24 },
+              sm: { span:6 },
+            },
+            wrapperCol: {
+              xs: { span: 12 },
+              sm: { span: 12 },
+            },
+        };
+        const config =(key,rules)=>{
+          return {
+            initialValue:edit?key:'',
+            rules: [
+              ...rules
+            ],
+          }
+        }
+
+        return (
+            <Form {...formItemLayout}  >
+                   <Form.Item label="查核结果">
+                    {
+                        getFieldDecorator('resultName',config(resultName,[{required: true,message: '请输入查核结果!',}]))(<Input />)
+                    }
+                   </Form.Item>
+                   <Form.Item label="选择查核项" >                
+                        {
+                            getFieldDecorator('checkItemId',config(checkItemName,[{required: true,message: '请选择查核项!'}]))(
+                                <Select
+                                    showSearch
+                                    placeholder="" 
+                                    optionFilterProp="children"
+                                    // onChange={onChange}
+                                    // onFocus={onFocus}
+                                    // onBlur={onBlur}
+                                    // onSearch={onSearch}
+                                    filterOption={(input, option) =>
+                                         option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
+                                    }
+                                    
+                                >
+                                    {
+                                        checkItemListForSelect.map((v,k)=>{
+                                            return (
+                                               <Option key={k} value={v.id}>{v.name}</Option>
+                                            )
+                                        })
+                                    }
+                                </Select>,
+                            )
+                        }
+                   </Form.Item>
+            </Form>         
+        )
+    }
+}
+
+const WrappedTableForm = Form.create({ name: 'register' })(TableForm);
+
+
+
+
+
+
+const Page = () => {
+
+  let [arr,setarr] = useState([]);
+  let [pages,setpages] = useState({});
+  let [ifUpdateList,setifUpdateList]=useState(false);
+  let [ifRender,setifRender] = useState(false);
+  let [ifShowDialog,setifShowDialog] = useState(false);
+  const [item,setitem]=useState({});
+  const [ifEdit,setifEdit]=useState(false);
+  const modalNode = useRef(null);
+  const formNode = useRef(null);
+  const thisForm = useRef(null);
+  const [searchKey,setsearchKey] = useState('');
+//   let [editingKey,seteditingKey] = useState('');
+
+  const columns = [
+    {
+      title: 'id',
+      dataIndex: 'id',
+      key: 'id',
+      width:'10%',
+      render: text => <a>{text}</a>,
+    },
+    {
+      title: '查核项',
+      dataIndex: 'checkItemName',
+      key: 'checkItemName',
+      editable: false,
+      width:'40%',
+    },
+    {
+        title: '查核结果',
+        dataIndex: 'resultName',
+        key: 'resultName',
+        width:'30%',
+        editable: false,
+    },
+    {
+        title: '创建时间',
+        dataIndex: 'createTime',
+        key: 'createTime',
+        width:'20%',
+        editable: false,
+    }
+  ];
+
+
+
+  const getData = async (pageObj)=>{
+    let data = await getCheckItemResultPopList(pageObj);
+    
+    const renderData = data.data.data.list.map((item,index)=>{
+          return {
+              ...item,
+              key:item['id'],
+            //   editable: true,
+          }
+    })
+    setarr(renderData);
+    setpages({
+        'currPage':data.data.data.currPage,
+        'totalPage':data.data.data.totalPage,
+        'totalCount':data.data.data.totalCount,
+    });
+    setifRender(false);
+    setifRender(true);
+
+  }
+
+  const callbackFromChild = (data)=>{
+        setitem(data);
+        setifEdit(true);
+        thisForm.current&&thisForm.current.resetFields();
+        modalNode.current.showModal();
+  }
+
+  const deleteCallback = (record)=>{
+    // console.log('删除');
+    delCheckItemListForSelect([record.id]).then(res=>{
+        if(res.data.msg=="success"){
+                getData();
+        }
+    })
+  }
+
+  const handleAdd=()=>{
+
+    setifEdit(false);
+    //初始化表单
+    if(arr.length>0){
+      setitem(arr[0]);
+    }else{
+      setitem({
+        "itemCode": "",   // 下拉款中选择中的key
+        "itemName": ""
+      });
+    }
+    
+    modalNode.current.showModal();
+  }
+
+
+
+  const commitForm = async ()=>{  //表单提交
+      console.log('提交表单');
+      // console.log({formNode});
+      const formData = await formNode.current.handleCommit();
+    //   const formNodeState = formNode.current.state;
+      
+      modalNode.current.handleCancel();
+      thisForm.current.resetFields();
+
+    //   const seletedItem = formNodeState.checkItemListForSelect.filter(item=>item.id==formData.itemCode);
+      
+      if(!ifEdit){
+       
+        // console.log({seletedItem});
+        const param = {
+             "checkItemId": formData.checkItemId,
+             "resultName":formData.resultName
+        }
+        addCheckItemListForSelect(param).then(res=>{
+
+          if(res&&res.data.msg=="success"){
+           getData();
+          }
+        })
+      }
+      if(ifEdit){
+        const editItem = item;
+        const param = {
+            "id":editItem.id,
+            "resultName":formData.resultName
+
+        }
+        // console.log({param});
+        editCheckItemListForSelect(param).then(res=>{
+          if(res&&res.data.msg=="success"){
+            getData({page:pages.currPage});
+           }
+        });
+      }
+  }
+
+  const paginationCallback = (obj)=>{
+    const {currPage} = obj;
+    getData({page:currPage,pageSize:10,keyword:searchKey});
+  }
+
+  const onSearch = (searchKey)=>{
+    //  console.log({searchKey});
+    setsearchKey(searchKey);
+     getData({
+       'keyword':searchKey?searchKey:''
+     });
+  }
+
+  
+  useEffect(()=>{
+    getData();
+  },[]);
+
+  return ( 
+    <div className="app-container">
+          <h1>查核结果弹窗字典管理</h1>
+          <ModalWrap ref={modalNode} show={ifShowDialog} handleOkCallback={commitForm} >
+                <WrappedTableForm edit={ifEdit} content={item} ref={thisForm} wrappedComponentRef={formNode} />
+          </ModalWrap>
+          
+          <div style={{display:'flex',flexDirection:'row'}}>
+          <Button onClick={handleAdd} type="primary" style={{ marginBottom: 16,marginRight:20 }}>
+             新增查核结果字典
+          </Button>
+          <Search style={{ width: 200 }} allowClear placeholder="请输入查核结果"  onSearch={onSearch} enterButton />
+          </div>
+          {
+             ifRender&& <EditableFormTable columns={columns}  pages={pages} paginationCallback={paginationCallback}  data={arr} deleteCallback={deleteCallback} callbackFromChild={callbackFromChild}  ifUpdateList={ifUpdateList}/>
+          }
+    </div>
+  );
+}
+
+
+
+
+ 
+export default Page;

+ 172 - 0
src/views/checkItemManage/checkItemResultSelector/table.js

@@ -0,0 +1,172 @@
+/*
+ * @Author: your name
+ * @Date: 2021-05-14 09:15:39
+ * @LastEditTime: 2021-05-17 11:39:36
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /react-antd-admin-template/src/views/checkItemManage/checkItemResultSelector/table.js
+ */
+
+
+
+/*
+ * @Author: your name
+ * @Date: 2021-04-27 11:19:40
+ * @LastEditTime: 2021-04-30 15:45:25
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /react-antd-admin-template/src/views/groupManage/groupIdentity/table.js
+ */
+
+import React from 'react';
+import { Table,Popconfirm, Form,Divider} from 'antd';
+
+// const data = [];
+// for (let i = 0; i < 100; i++) {
+//   data.push({
+//     key: i.toString(),
+//     name: `Edrward ${i}`,
+//     age: 32,
+//     address: `London Park no. ${i}`,
+//   });
+// }
+
+
+class EditableTable extends React.Component {
+  
+//   static defaultProps = {
+//         editCallback: ()=>{},
+//         deleteCallback:()=>{},
+//         callbackFromChild:()=>{},
+//         config:{
+//             action:{
+//                 deleteBtn:true,
+//                 editBtn:true,  
+//                 editPermissionBtn:false
+//             }
+//         } 
+//   }
+
+  constructor(props) {
+    super(props);
+    this.state = { data:[], editingKey: '',loading:false};
+
+    this.columns = [
+
+      ...props.columns,
+      {
+        title: '操作',
+        fixed: 'right',
+        dataIndex: 'operation',
+        render: (text, record) => {
+          const { editingKey} = this.state;
+        //   console.log({editingKey,record});
+          return (
+            <span>
+                 <a disabled={editingKey !== ''} onClick={() => this.editItem(record)}>
+                        编辑
+                 </a>
+                 <Divider type="vertical" />
+                 <Popconfirm title=" 是否确定删除?" onConfirm={()=>this.delItem(record)}>
+                    <a disabled={editingKey !== ''} >
+                            删除
+                    </a>
+                 </Popconfirm>
+                 {/* <Divider type="vertical" />
+                 <a disabled={editingKey !== ''} onClick={() => this.bindGroup(record)}>
+                        绑定单位
+                 </a> */}
+             </span>
+ 
+          );
+        },
+      },
+    ];
+  }
+
+
+
+  componentDidMount(){
+    this.setState({
+        data:this.props.data
+    });
+    
+  }
+
+  componentDidUpdate(prevProps, prevState){
+    // console.log({prevProps, prevState});
+    if(prevProps.ifUpdateList){
+        console.log('update');
+        this.setState({
+            data:this.props.data
+        });
+    }
+  }
+
+  isEditing = record => {
+    //   console.log(record.id,this.state.editingKey);
+      return record.id === this.state.editingKey;
+  }
+  
+  editItem=(record)=>{
+      this.props.callbackFromChild(record);
+  }
+
+  delItem=record=>{
+      this.props.deleteCallback(record);
+  }
+
+  changePage(current){
+    this.setState({ loading: true });
+    this.props.paginationCallback({'currPage':current})
+  }
+
+
+  render() {
+    
+    const columns = this.columns.map(col => {
+      if (!col.editable) {
+        return col;
+      }
+      return {
+        ...col,
+        onCell: record => ({
+          record,
+        }),
+      };
+    });
+
+    const {
+        currPage,
+        totalPage,
+        totalCount,
+    } = this.props.pages;
+
+    const paginationProps = {
+        showSizeChanger: false,
+        showQuickJumper: false,
+        showTotal: () => `共${totalCount}条`,
+        pageSize: 10,
+        current: currPage,
+        total: totalCount,
+        onChange: (current) => this.changePage(current),
+    }
+
+    return (
+        <Table
+          bordered
+          loading={this.state.loading}
+          pagination={paginationProps}
+          dataSource={this.state.data}
+          columns={columns}
+          rowClassName="editable-row"
+          scroll={{ x: 1500 }}
+        />
+    );
+  }
+}
+
+const EditableFormTable = Form.create()(EditableTable);
+
+
+export default EditableFormTable;

+ 223 - 44
src/views/checkPointManage/checkItem/checkItem.jsx

@@ -1,16 +1,18 @@
 import React,{ useState,useEffect,useRef } from 'react';
 
-import {getCheckItem,bindCheckPointAndCheckItem,listAll,delCheckItem,addCheckItem,editCheckItem,bindCheckItemAndCheckPoint} from "@/api/checkPointManage.js";
+import {getCheckItem,getCheckItemTypeList,listAll,delCheckItem,addCheckItem,editCheckItem,
+  bindCheckItemAndCheckPoint,addCheckItemCheckResult,getCheckItemCheckResultSelecterList} from "@/api/checkPointManage.js";
 // import {getOutpatientList} from "@/api/checkCondition.js";
-import { Button,Form,Input,Select} from 'antd';
+import { Button,Form,Input,Select,Tag,Tooltip} from 'antd';
 import EditableFormTable from './table';
 import ModalWrap from '@/components/Modal/modal.js';
 // import { TAGSVIEW_EMPTY_TAGLIST } from '../../../store/action-types';
 
 const { Option } = Select;
-
+const InputGroup = Input.Group;
 const { Search } = Input;
 
+
 class TableForm extends React.Component {
     
 
@@ -20,8 +22,13 @@ class TableForm extends React.Component {
          this.state = {
           depTypeList:[],
           checkPointList:[],
+          checkTypeList:[],
+          checkResultList:[],//查核结果配置
+          addCheckItemResultSelect:[],
           BindStatus:'',
           BindPointStatus:'',
+          checkResultName:'',//
+          checkResultCount:'',
          };
     }
 
@@ -32,7 +39,8 @@ class TableForm extends React.Component {
             if (!err) {
               let data = {
                 ...this.props.content,
-                ...values
+                ...values,
+                itemAttr:this.state.checkResultList
               }
               resolve(data);
             }
@@ -53,6 +61,23 @@ class TableForm extends React.Component {
           });
       })
     }
+    //当删除查核结果配置
+    onTagClose=(e)=>{
+        // console.log('onTagClose',e);
+        // console.log(this.state.checkResultList);
+        const checkResultListByFilter = this.state.checkResultList.filter(item=>item.attr != e);
+        // console.log({checkResultListByFilter});
+        this.setState({
+          checkResultList:checkResultListByFilter
+        })
+    }
+    //更新查核结果配置
+    updateCheckResultList=()=>{
+      const {checkResultList,checkResultName,checkResultCount} = this.state;
+      this.setState({
+        checkResultList:[...checkResultList,{attr:checkResultName,value:checkResultCount}]
+      },()=>this.setState({checkResultName:'',checkResultCount:''}))
+    }
 
     bindPoint=(obj)=>{
       bindCheckItemAndCheckPoint(obj).then(res=>{
@@ -65,23 +90,52 @@ class TableForm extends React.Component {
         })
     }
 
+    onAddCheckItemResultSelectChange=(e)=>{
+        // console.log({e});
+        this.setState({
+          checkResultName:e
+        })
+    }
+
     componentWillUnmount(){
         this.props.form.resetFields();
     }
 
     componentDidMount(){
       listAll().then(res=>{
-        console.log({res});
+        // console.log({res});
         const temp = res.data.data;
         this.setState({
           checkPointList:temp
         })
-      })
+      });
+      //获取添加查核项结果下拉列表
+      getCheckItemCheckResultSelecterList().then(res=>{
+        const temp = res.data.data;
+        // console.log({temp});
+        this.setState({
+          addCheckItemResultSelect:temp
+        })
+      });
+    
+      getCheckItemTypeList().then(res=>{
+        const temp = res.data.data;
+        this.setState({
+          checkTypeList:temp
+        })
+      });
+      
+      const {content,edit} = this.props;
+      const editCheckItemResultList = JSON.parse(content.itemAttrs);
+      // console.log('json',content.itemAttrs);
+      if(edit){
+         this.setState({
+          checkResultList:editCheckItemResultList
+         })
+      }
     }
 
-    // componentDidUpdate(prevProps,prevState){
-    //     console.log({prevProps,prevState});
-    // }
+
 
     shouldComponentUpdate(nextProps,nextState){
     
@@ -92,10 +146,10 @@ class TableForm extends React.Component {
         
         const { getFieldDecorator } = this.props.form;
         const {content,edit} = this.props;
-        const {depTypeList,BindStatus,checkPointList,BindPointStatus} = this.state;
-        const {name,rightAnswerText,relatedRules,checkModeList} = content;
+        const {depTypeList,BindStatus,checkPointList,checkTypeList,checkResultList,checkResultName,checkResultCount,addCheckItemResultSelect} = this.state;
+        const {checkItemName,rightAnswerText,relatedRules,checkModelList,score,itemAttr} = content;
         // const bindGroupDefault = groupManaList.length>0?groupManaList[0].name:'bindGroupDefault';
-        // console.log({content});
+        console.log({content,edit});
         const formItemLayout = {
             labelCol: {
               xs: { span: 24 },
@@ -107,6 +161,7 @@ class TableForm extends React.Component {
             },
         };
         const config =(key,rules)=>{
+          console.log({key});
           return {
             initialValue:edit?key:'',
             rules: [
@@ -118,23 +173,103 @@ class TableForm extends React.Component {
         return (
             <Form {...formItemLayout}  >
                    <Form.Item label="查核项">
-                   {
-                        getFieldDecorator('name',config(name,[{required: true,message: '请输入单位分类名!',}]))(<Input />)
+                    {
+                        getFieldDecorator('checkItemName',config(checkItemName,[{required: true,message: '请输入查核项名!',}]))(<Input />)
                     }
                    </Form.Item>
-                   <Form.Item label="应知应会文字">
-                   {
-                        getFieldDecorator('rightAnswerText',config(rightAnswerText,[{required: true,message: '请输入单位分类名!',}]))(<Input />)
+                   <Form.Item label="查核方式">
+                    {
+                        getFieldDecorator('checkModeList',config(checkModelList,[{required: true,message: '请选择查核方式!',}]))(
+                          <Select
+                              placeholder=""
+                          >
+                              {
+                                checkTypeList.map((v,k)=>{
+                                    return (
+                                      <Option key={k} value={v.itemCode}>{v.itemName}</Option>
+                                    )
+                                })
+                              }
+                          </Select>,
+                        )
                     }
                    </Form.Item>
-                   <Form.Item label="相关条文">
-                   {
-                        getFieldDecorator('relatedRules',config(relatedRules,[{required: true,message: '请输入单位分类名!',}]))(<Input />)
+                   <Form.Item label="查核项分数" style={{display:edit?'block':'none'}}>
+                    {
+                        getFieldDecorator('score',config(score,[{required: true,message: '请输入查核分数!',}]))(<Input />)
                     }
                    </Form.Item>
-                   <Form.Item label="查核方式">
-                   {
-                        getFieldDecorator('checkModeList',config(checkModeList,[{required: true,message: '请输入单位分类名!',}]))(<Input />)
+                   <Form.Item label="查核项查核结果配置" style={{display:edit?'block':'none'}}>
+                    {
+                        getFieldDecorator('itemAttr',config(itemAttr,[{required: false,message: '请输入配置查核结果!',}]))(
+                          <div style={{borderRadius:'4px',minHeight:'70px'}}>
+                               <InputGroup compact>
+                                  <Tooltip title="请选择查核结果名">
+                                  <Select
+                                    showSearch
+                                    style={{ width:'50%' }}
+                                    placeholder="请选择查核结果名"
+                                    optionFilterProp="children"
+                                    onChange={this.onAddCheckItemResultSelectChange}
+                                    // onFocus={onFocus}
+                                    // onBlur={onBlur}
+                                  >
+                                    {
+                                      addCheckItemResultSelect.map((item,index)=>{
+                                           return (
+                                              <Option key={index} value={item}>{item}</Option>
+                                           )
+                                      })
+                                    }
+                                  </Select>
+                                  </Tooltip>
+                                  <Tooltip title="请定义查核结果对应的分值占比,如:50">
+                                      <Input style={{ width: '30%' }} onChange={(e)=>{this.setState({checkResultCount:e.target.value})}} value={checkResultCount} placeholder="如:50" />
+                                  </Tooltip>
+                                  <Button type="primary" onClick={this.updateCheckResultList}>添加</Button>
+                               </InputGroup>
+                               <Form.Item >
+                               {
+                                 getFieldDecorator('score',config(score,[{required: true,message: '请输入查核分数!',}]))(
+                                      <div>
+                                           {
+                                            checkResultList.map((item,index)=>{
+                                              // return(
+                                              //        <Tag  closable key={index} onClose={this.onTagClose.bind(this,item.attr)} style={{padding:0,border:'none'}}>
+                                              //              <InputGroup compact>
+                                              //                 <Tooltip title="请定义查核结果名">
+                                              //                       <Input style={{ width: '70%' }} onChange={(e)=>{this.setState({checkResultName:e.target.value})}}  defaultValue={item.attr} placeholder="如:缺失"  />
+                                              //                 </Tooltip>
+                                              //                 <Tooltip title="请定义查核结果对应的分值占比,如:50">
+                                              //                       <Input style={{ width: '30%' }} onChange={(e)=>{this.setState({checkResultCount:e.target.value})}} defaultValue={item.value} placeholder="如:50" />
+                                              //                 </Tooltip>
+                                              //              </InputGroup>
+                                              //        </Tag>
+                                              // );
+                                              const tagName = item.attr;
+                                              return (
+                                                <Tag color="#4E78FF"  closable key={index} onClose={this.onTagClose.bind(this,tagName)}>
+                                                    {`${item.attr}|${item.value}%`}
+                                                </Tag>
+                                              )
+                                            })
+                                          }
+                                      </div>
+                                 )
+                               }
+                               </Form.Item>
+                          </div>
+                        )
+                    }
+                   </Form.Item>
+                   <Form.Item label="应知应会文字">
+                    {
+                        getFieldDecorator('rightAnswerText',config(rightAnswerText,[{required: false,message: '!',}]))(<Input.TextArea autoSize={{minRows:5}} />)
+                    }
+                   </Form.Item>
+                   <Form.Item label="相关条文">
+                    {
+                        getFieldDecorator('relatedRules',config(relatedRules,[{required: false,message: '!',}]))(<Input.TextArea autoSize={{minRows:5}} />)
                     }
                    </Form.Item>
                    
@@ -173,10 +308,6 @@ class TableForm extends React.Component {
 const WrappedTableForm = Form.create({ name: 'register' })(TableForm);
 
 
-
-
-
-
 const CheckItem = () => {
 
   let [arr,setarr] = useState([]);
@@ -189,22 +320,52 @@ const CheckItem = () => {
   const modalNode = useRef(null);
   const formNode = useRef(null);
   const thisForm = useRef(null);
+  const [searchKey,setsearchKey] = useState('');
 //   let [editingKey,seteditingKey] = useState('');
 
   const columns = [
     {
       title: 'id',
-      dataIndex: 'id',
-      key: 'id',
+      dataIndex: 'checkItemId',
+      width:'10%',
+      key: 'checkItemId',
       render: text => <a>{text}</a>,
     },
     {
       title: '查核项',
-      dataIndex: 'name',
-      key: 'name',
+      dataIndex: 'checkItemName',
+      key: 'checkItemName',
       editable: true,
       width:'15%'
     },
+    {
+      title: '查核方式',
+      dataIndex: 'checkModelList',
+      key: 'checkModelList',
+      editable: true,
+      width:'10%'
+    },
+    {
+      title: '拥有查核结果',
+      key: 'itemAttrs',
+      width:'20%',
+      dataIndex: 'itemAttrs',
+      render: tags =>{
+        const newTags = JSON.parse(tags);
+        console.log({newTags});
+        return (
+          <span>
+          {newTags&&newTags.map(tag => {
+            return (
+              <Tag  key={tag.attr}>
+                  {tag.attr}
+              </Tag>
+            );
+          })}
+          </span>
+        )
+      },
+    },
     {
         title: '应知应会文字',
         dataIndex: 'rightAnswerText',
@@ -217,14 +378,15 @@ const CheckItem = () => {
         title: '应知应会图片url',
         dataIndex: 'rightAnswerImage',
         key: 'rightAnswerImage',
-        editable: true,
+        editable: false,
         width:'20%'
     },
     {
         title: '相关条文',
         dataIndex: 'relatedRules',
         key: 'relatedRules',
-        editable: true,
+        editable: false,
+        width:'20%'
     },
   ];
 
@@ -305,7 +467,8 @@ const CheckItem = () => {
             "name":formData.name,// 查核项目名称 必填
             "relatedRules":formData.relatedRules, // 相关条文
             "rightAnswerImage":'', // 正确答案图片url 上传图片接口待定
-            "rightAnswerText": formData.rightAnswerText// 正确答案文字  
+            "rightAnswerText": formData.rightAnswerText,// 正确答案文字  
+            // "score":formData.score,//查核项分数
         }
         addCheckItem(param).then(res=>{
           if(res.data.msg=="success"){
@@ -314,30 +477,46 @@ const CheckItem = () => {
         })
       }
       if(ifEdit){
+        const paramForCheckItemresult = {
+          "checkItemId":item.checkItemId,   // 查核项id
+          "score":parseInt(formData.score),  // 分数
+          "itemAttr":formData.itemAttr,
+        }
         const param = {
-            "id":item.id,
+            "id":item.checkItemId,
             "checkModeList": formData.checkModeList, // 查核方式
-            "name":formData.name, // 名称必填
+            "name":formData.checkItemName, // 名称必填
             "relatedRules":formData.relatedRules, // 相关条文
             "rightAnswerImage":item.rightAnswerImage,// 应知应会图片url
-            "rightAnswerText":formData.rightAnswerText // 应知应会文字
+            "rightAnswerText":formData.rightAnswerText, // 应知应会文字
         }
-        // console.log({param});
-        editCheckItem(param).then(res=>{
-          if(res.data.msg=="success"){
-            getData();
-           }
+        // console.log({param,paramForCheckItemresult});
+        //
+
+        addCheckItemCheckResult(paramForCheckItemresult).then(res=>{
+              if(res&&res.data.msg=="success"){
+                console.log('查核项结果配置成功');
+                editCheckItem(param).then(res=>{
+                  if(res&&res.data.msg=="success"){
+                    getData({page:pages.currPage});
+                   }
+                });
+                // getData({page:pages.currPage});
+              }
         });
+
+        
       }
   }
 
   const paginationCallback = (obj)=>{
     const {currPage} = obj;
-    getData({page:currPage,pageSize:10});
+    getData({page:currPage,pageSize:10,keyword:searchKey});
   }
 
   const onSearch = (searchKey)=>{
       //  console.log({searchKey});
+      setsearchKey(searchKey);
        getData({
          'keyword':searchKey?searchKey:''
        });
@@ -351,7 +530,7 @@ const CheckItem = () => {
   return ( 
     <div className="app-container">
           <h1>查核项管理</h1>
-          <ModalWrap ref={modalNode} show={ifShowDialog} handleOkCallback={commitForm} >
+          <ModalWrap width={1000} ref={modalNode} show={ifShowDialog} handleOkCallback={commitForm} >
                 <WrappedTableForm edit={ifEdit} content={item} ref={thisForm} wrappedComponentRef={formNode} />
           </ModalWrap>
           <div style={{display:'flex',flexDirection:'row'}}>

+ 6 - 3
src/views/checkPointManage/checkItem/table.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-04-27 18:08:04
- * @LastEditTime: 2021-04-30 15:47:42
+ * @LastEditTime: 2021-05-16 21:50:01
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /react-antd-admin-template/src/views/checkPointManage/checkItem/table.js
@@ -47,6 +47,8 @@ class EditableTable extends React.Component {
       ...props.columns,
       {
         title: '操作',
+        fixed: 'right',
+        width: 110,
         dataIndex: 'operation',
         render: (text, record) => {
           const { editingKey} = this.state;
@@ -108,7 +110,7 @@ class EditableTable extends React.Component {
 
   changePage(current){
     this.setState({ loading: true });
-    this.props.paginationCallback({'currPage':current-1})
+    this.props.paginationCallback({'currPage':current})
   }
 
 
@@ -136,7 +138,7 @@ class EditableTable extends React.Component {
         showQuickJumper: false,
         showTotal: () => `共${totalCount}条`,
         pageSize: 10,
-        current: currPage+1,
+        current: currPage,
         total: totalCount,
         onChange: (current) => this.changePage(current),
     }
@@ -148,6 +150,7 @@ class EditableTable extends React.Component {
           pagination={paginationProps}
           dataSource={this.state.data}
           columns={columns}
+          scroll={{x:1900}}
           rowClassName="editable-row"
         />
     );

+ 3 - 1
src/views/checkPointManage/checkPointAndCheckItem/checkPointAndCheckItem.jsx

@@ -17,6 +17,7 @@ const GroupIdentityAndGroup = () => {
   let [pages,setpages] = useState({});
   let [ifUpdateList,setifUpdateList]=useState(false);
   let [ifRender,setifRender] = useState(false);
+  const [searchKey,setsearchKey] = useState('');
  
   const columns = [
     {
@@ -87,12 +88,13 @@ const GroupIdentityAndGroup = () => {
 
   const paginationCallback = (obj)=>{
     const {currPage} = obj;
-    getData({page:currPage,pageSize:10});
+    getData({page:currPage,pageSize:10,keyword:searchKey});
   }
 
 
   const onSearch = (searchKey)=>{
     //  console.log({searchKey});
+    setsearchKey(searchKey);
      getData({
        'keyword':searchKey?searchKey:''
      });

+ 2 - 2
src/views/checkPointManage/checkPointAndCheckItem/table.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-05-05 21:15:17
- * @LastEditTime: 2021-05-05 21:15:50
+ * @LastEditTime: 2021-05-16 21:50:18
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /react-antd-admin-template/src/views/checkPointManage/checkPointAndCheckItem/table.js
@@ -89,7 +89,7 @@ class EditableTable extends React.Component {
 
   changePage(current){
     this.setState({ loading: true });
-    this.props.paginationCallback({'currPage':current-1})
+    this.props.paginationCallback({'currPage':current})
   }
 
 

+ 3 - 1
src/views/checkPointManage/pointAndCheckGroup/pointAndCheckGroup.jsx

@@ -14,6 +14,7 @@ const PointAndCheckGroup = () => {
   let [pages,setpages] = useState({});
   let [ifUpdateList,setifUpdateList]=useState(false);
   let [ifRender,setifRender] = useState(false);
+  const [searchKey,setsearchKey] = useState('');
  
   const columns = [
     {
@@ -77,11 +78,12 @@ const PointAndCheckGroup = () => {
 
   const paginationCallback = (obj)=>{
     const {currPage} = obj;
-    getData({page:currPage,pageSize:10});
+    getData({page:currPage,pageSize:10,keyword:searchKey});
   }
   
   const onSearch = (searchKey)=>{
     //  console.log({searchKey});
+    setsearchKey(searchKey);
      getData({
        'keyword':searchKey?searchKey:''
      });

+ 3 - 1
src/views/checkPointManage/pointAndGroup/pointAndGroup.jsx

@@ -14,6 +14,7 @@ const CheckGroupManage = () => {
   let [pages,setpages] = useState({});
   let [ifUpdateList,setifUpdateList]=useState(false);
   let [ifRender,setifRender] = useState(false);
+  const [searchKey,setsearchKey] = useState('');
  
   const columns = [
     {
@@ -84,12 +85,13 @@ const CheckGroupManage = () => {
 
   const paginationCallback = (obj)=>{
     const {currPage} = obj;
-    getData({page:currPage,pageSize:10});
+    getData({page:currPage,pageSize:10,keyword:searchKey});
   }
 
 
   const onSearch = (searchKey)=>{
     //  console.log({searchKey});
+    setsearchKey(searchKey);
      getData({
        'keyword':searchKey?searchKey:''
      });

+ 2 - 2
src/views/checkPointManage/pointAndGroup/table.js

@@ -5,7 +5,7 @@
 /*
  * @Author: your name
  * @Date: 2021-04-27 11:19:40
- * @LastEditTime: 2021-04-30 15:55:30
+ * @LastEditTime: 2021-05-16 21:50:53
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /react-antd-admin-template/src/views/groupManage/groupIdentity/table.js
@@ -81,7 +81,7 @@ class EditableTable extends React.Component {
 
   changePage(current){
     this.setState({ loading: true });
-    this.props.paginationCallback({'currPage':current-1})
+    this.props.paginationCallback({'currPage':current})
   }
 
 

+ 5 - 3
src/views/checkPointManage/pointAndProvisions/pointAndProvisions.jsx

@@ -14,6 +14,7 @@ const PointAndCheckGroup = () => {
   let [pages,setpages] = useState({});
   let [ifUpdateList,setifUpdateList]=useState(false);
   let [ifRender,setifRender] = useState(false);
+  const [searchKey,setsearchKey] = useState('');
  
   const columns = [
     {
@@ -37,8 +38,8 @@ const PointAndCheckGroup = () => {
     },
     {
         title: '查核要点ID',
-        dataIndex: 'articleId',
-        key: 'articleId',
+        dataIndex: 'checkPointId',
+        key: 'checkPointId',
         editable: true,
     },
     {
@@ -83,11 +84,12 @@ const PointAndCheckGroup = () => {
 
   const paginationCallback = (obj)=>{
     const {currPage} = obj;
-    getData({page:currPage,pageSize:10});
+    getData({page:currPage,pageSize:10,keyword:searchKey});
   }
   
   const onSearch = (searchKey)=>{
     //  console.log({searchKey});
+    setsearchKey(searchKey);
      getData({
        'keyword':searchKey?searchKey:''
      });

+ 12 - 6
src/views/checkPointManage/pointManage/pointManage.jsx

@@ -161,7 +161,6 @@ class TableForm extends React.Component {
     // }
 
     shouldComponentUpdate(nextProps,nextState){
-    
           return true;
     }
     
@@ -195,7 +194,7 @@ class TableForm extends React.Component {
         return (
             <Form {...formItemLayout}  >
                    <Form.Item label="查核要点">
-                   {
+                    {
                         getFieldDecorator('name',config(name,[{required: true,message: '请输入单位分类名!',}]))(<Input />)
                     }
                    </Form.Item>
@@ -305,6 +304,8 @@ const PointManage = () => {
   const [ifEdit,setifEdit]=useState(false);
   const modalNode = useRef(null);
   const formNode = useRef(null);
+  const thisForm = useRef(null);
+  const [searchKey,setsearchKey] = useState('');
 //   let [editingKey,seteditingKey] = useState('');
 
   const columns = [
@@ -388,6 +389,10 @@ const PointManage = () => {
       // console.log({formNode});
       const formData = await formNode.current.handleCommit();
       modalNode.current.handleCancel();
+      thisForm.current&&thisForm.current.resetFields();
+      formNode.current.state.BindGroupStatus='';
+      formNode.current.state.BindCheckItemStatus='';
+      formNode.current.state.BindCheckGroupStatus='';
 
       if(!ifEdit){
         const param = {
@@ -395,7 +400,7 @@ const PointManage = () => {
         }
         addCheckPoint(param).then(res=>{
           if(res&&res.data.msg=="success"){
-           getData();
+           getData({currPage:pages.currPage});
           }
         })
       }
@@ -406,7 +411,7 @@ const PointManage = () => {
         }
         editCheckPointList(param).then(res=>{
           if(res&&res.data.msg=="success"){
-           getData();
+            getData({page:pages.currPage});
           }
         })
       }
@@ -414,11 +419,12 @@ const PointManage = () => {
   
   const paginationCallback = (obj)=>{
     const {currPage} = obj;
-    getData({page:currPage,pageSize:10});
+    getData({page:currPage,pageSize:10,keyword:searchKey});
   }
 
   const onSearch = (searchKey)=>{
     //  console.log({searchKey});
+    setsearchKey(searchKey);
      getData({
        'keyword':searchKey?searchKey:''
      });
@@ -432,7 +438,7 @@ const PointManage = () => {
     <div className="app-container">
           <h1>查核要点维护</h1>
           <ModalWrap ref={modalNode} show={ifShowDialog} handleOkCallback={commitForm} >
-                <WrappedTableForm edit={ifEdit} content={item} wrappedComponentRef={formNode} />
+                <WrappedTableForm edit={ifEdit} content={item} ref={thisForm} wrappedComponentRef={formNode} />
           </ModalWrap>
           
           <div style={{display:'flex',flexDirection:'row'}}>

+ 28 - 14
src/views/conditionManage/condition.jsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-04-27 08:49:09
- * @LastEditTime: 2021-05-05 20:08:31
+ * @LastEditTime: 2021-05-17 10:28:17
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /react-antd-admin-template/src/views/conditionManage/comdition.js
@@ -34,7 +34,8 @@ class TableForm extends React.Component {
     outpatientList:[],
     BindStatus:'',
     groupIdentityList:[],
-    parentList:[]
+    parentList:[],
+    loading:false
   }
   handleCommit = () => {
     console.log('开始校验表单');
@@ -75,6 +76,18 @@ class TableForm extends React.Component {
       })
   }
 
+  onSelectParentFocus=()=>{
+    this.setState({loading:true},()=>{
+      getConditionParentList().then(data=>{
+        this.setState({
+          parentList:data.data.data,
+          loading:false
+         })
+      });
+    });
+    
+  }
+
   componentDidMount(){
     getOutpatientList().then(data=>{
          this.setState({
@@ -87,17 +100,13 @@ class TableForm extends React.Component {
         groupIdentityList:data.data.data
        })
     });
-    getConditionParentList().then(data=>{
-      this.setState({
-        parentList:data.data.data
-       })
-    });
+    
   }
 
   render() {
     
     const { getFieldDecorator } = this.props.form;
-    const {outpatientList,BindStatus,groupIdentityList,parentList} = this.state;
+    const {outpatientList,BindStatus,groupIdentityList,parentList,loading} = this.state;
     const {edit,content} = this.props;
     const {name,depType,conditionType,description,parentId} = content;
     const getKeyName = (parentId)=>{
@@ -138,10 +147,13 @@ class TableForm extends React.Component {
           )}
         </Form.Item>
         <Form.Item {...formItemLayout} label="选择父级条件">
-          {getFieldDecorator('parentId',config(getKeyName(parentId),[{required:true,message: '选择父级条件',}]))(
+          {getFieldDecorator('parentId',config(getKeyName(parentId),[{required:false,message: '选择父级条件',}]))(
             <Select
               placeholder="选择父级条件"
               style={{ width: '100%' }}
+              loading={loading}
+              // open={!loading}
+              onFocus={this.onSelectParentFocus}
               onChange={this.handleSelectParentChange}
             >
               
@@ -221,6 +233,7 @@ const PermissionMaintenance = () => {
   const modalNode = useRef(null);
   const formNode = useRef(null);
   const thisForm = useRef(null);
+  const [searchKey,setsearchKey] = useState('');
 //   let [editingKey,seteditingKey] = useState('');
 
   const columns = [
@@ -334,8 +347,8 @@ const PermissionMaintenance = () => {
         "depType": (formData.depType=='门诊'||formData.depType==1)?1:2, // 门急诊类型 1-门诊 2-急诊
         "description":formData.description, // 说明
         "name":formData.name, // 条件名称
-        "parentId":formData.parentId, // 父级条件id
-        "parentName": formData.name, // 父级条件id,没有选择0
+        "parentId":formData.parentId?formData.parentId:0, // 父级条件id
+        "parentName": formData.name?formData.name:'0', // 父级条件id,没有选择0
         "sortNo":formData.sortNo
       }
       addCondition(param).then(res=>{
@@ -351,7 +364,7 @@ const PermissionMaintenance = () => {
         ...formData,
         "depType": (formData.depType=='门诊'||formData.depType==1)?1:2, // 门急诊类型 1-门诊 2-急诊
         "conditionType":(formData.conditionType=='个案'||formData.conditionType=='0')?'0':'1',  // 条件类型:0个案 1系统
-        "parentId":selectedParent[0].id, // 父级条件id
+        "parentId":selectedParent.length>0?selectedParent[0].id:0, // 父级条件id
         // "depType": formData.depType=='急诊'?1:2, // 门急诊类型 1-门诊 2-急诊
         // "description":formData.description, // 说明
         // "name":formData.name, // 条件名称
@@ -363,7 +376,7 @@ const PermissionMaintenance = () => {
       editCondition(param).then(res=>{
         // console.log({res});
         if(res&&res.data.msg==="success"){
-          getData();
+          getData({page:pages.currPage});
         }
       });
     }
@@ -371,11 +384,12 @@ const PermissionMaintenance = () => {
 
   const paginationCallback = (obj)=>{
     const {currPage} = obj;
-    getData({page:currPage,pageSize:10});
+    getData({page:currPage,pageSize:10,keyword:searchKey});
   }
 
   const onSearch = (searchKey)=>{
     //  console.log({searchKey});
+    setsearchKey(searchKey);
      getData({
        'keyword':searchKey?searchKey:''
      });

+ 3 - 1
src/views/conditionManage/conditionAndGroupIdentity/conditionAndGroupIdentity.jsx

@@ -14,6 +14,7 @@ const CheckGroupManage = () => {
   let [pages,setpages] = useState({});
   let [ifUpdateList,setifUpdateList]=useState(false);
   let [ifRender,setifRender] = useState(false);
+  const [searchKey,setsearchKey] = useState('');
  
   const columns = [
     {
@@ -84,11 +85,12 @@ const CheckGroupManage = () => {
 
   const paginationCallback = (obj)=>{
     const {currPage} = obj;
-    getData({page:currPage,pageSize:10});
+    getData({page:currPage,pageSize:10,keyword:searchKey});
   }
 
   const onSearch = (searchKey)=>{
     //  console.log({searchKey});
+    setsearchKey(searchKey);
      getData({
        'keyword':searchKey?searchKey:''
      });

+ 6 - 5
src/views/groupManage/groupIdentity/groupIdentity.jsx

@@ -180,7 +180,6 @@ class TableForm extends React.Component {
                     {
                         getFieldDecorator('bindGroup',config('',[{required: false,}]))(
                           <Select
-            
                             style={{ width: 200 }}
                             placeholder=""
                             optionFilterProp="children"
@@ -253,6 +252,8 @@ const GroupIdentity = () => {
   const modalNode = useRef(null);
   const formNode = useRef(null);
   const thisForm = useRef(null);
+  const [searchKey,setsearchKey] = useState('');
+  const [selectRowObj,setselectRowObj] = useState(null);
 //   let [editingKey,seteditingKey] = useState('');
 
   const columns = [
@@ -316,7 +317,6 @@ const GroupIdentity = () => {
   }
 
   const handleAdd=()=>{
-
     setifEdit(false);
     //初始化表单
     if(arr.length>0){
@@ -367,7 +367,7 @@ const GroupIdentity = () => {
         // console.log({param});
         editGroupIdentity(param).then(res=>{
           if(res.data.msg=="success"){
-            getData();
+            getData({page:pages.currPage});
            }
         });
       }
@@ -375,11 +375,12 @@ const GroupIdentity = () => {
 
   const paginationCallback = (obj)=>{
     const {currPage} = obj;
-    getData({page:currPage,pageSize:10});
+    getData({page:currPage,pageSize:10,keyword:searchKey});
   }
 
   const onSearch = (searchKey)=>{
     //  console.log({searchKey});
+    setsearchKey(searchKey);
      getData({
        'keyword':searchKey?searchKey:''
      });
@@ -402,7 +403,7 @@ const GroupIdentity = () => {
           <Search style={{ width: 200 }} allowClear placeholder="请输入单位分类"  onSearch={onSearch} enterButton />
           </div>
           {
-             ifRender&& <EditableFormTable columns={columns} pages={pages} paginationCallback={paginationCallback}  data={arr}  deleteCallback={deleteCallback} callbackFromChild={callbackFromChild} ifUpdateList={ifUpdateList}/>
+             ifRender&& <EditableFormTable selectRowObj={selectRowObj} columns={columns} pages={pages} paginationCallback={paginationCallback}  data={arr}  deleteCallback={deleteCallback} callbackFromChild={callbackFromChild} ifUpdateList={ifUpdateList}/>
           }
     </div>
   );

+ 23 - 14
src/views/groupManage/groupIdentity/table.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-04-27 11:19:40
- * @LastEditTime: 2021-04-28 16:00:50
+ * @LastEditTime: 2021-05-07 11:48:14
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /react-antd-admin-template/src/views/groupManage/groupIdentity/table.js
@@ -9,18 +9,6 @@
 
 import React from 'react';
 import { Table,Popconfirm, Form,Divider} from 'antd';
-
-// const data = [];
-// for (let i = 0; i < 100; i++) {
-//   data.push({
-//     key: i.toString(),
-//     name: `Edrward ${i}`,
-//     age: 32,
-//     address: `London Park no. ${i}`,
-//   });
-// }
-
-
 class EditableTable extends React.Component {
   
   static defaultProps = {
@@ -38,7 +26,7 @@ class EditableTable extends React.Component {
 
   constructor(props) {
     super(props);
-    this.state = { data:[], editingKey: '',loading:false};
+    this.state = { data:[], editingKey: '',loading:false,};
 
     this.columns = [
 
@@ -110,6 +98,26 @@ class EditableTable extends React.Component {
   }
 
 
+
+  // rowSelection object indicates the need for row selection
+  rowSelection(){
+    if(this.props.selectRowObj){
+         return this.props.selectRowObj
+    }else {
+         return null;
+    }
+    // return {
+    //   onChange: (selectedRowKeys, selectedRows) => {
+    //     console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
+    //   },
+    //   getCheckboxProps: record => ({
+    //     disabled: record.name === 'Disabled User', // Column configuration not to be checked
+    //     name: record.name,
+    //   }),
+    // }
+  };
+
+
   render() {
     
     const columns = this.columns.map(col => {
@@ -142,6 +150,7 @@ class EditableTable extends React.Component {
     return (
         <Table
           bordered
+          rowSelection={this.rowSelection()}
           loading={this.state.loading}
           pagination={paginationProps}
           dataSource={this.state.data}

+ 11 - 8
src/views/groupManage/groupIdentityAndGroup/groupIdentityAndGroup.jsx

@@ -15,6 +15,7 @@ const GroupIdentityAndGroup = () => {
   let [pages,setpages] = useState({});
   let [ifUpdateList,setifUpdateList]=useState(false);
   let [ifRender,setifRender] = useState(false);
+  const [searchKey,setsearchKey] = useState('');
  
   const columns = [
     {
@@ -30,12 +31,12 @@ const GroupIdentityAndGroup = () => {
       key: 'deptClassId',
       editable: true,
     },
-    {
-        title: '部门名称',
-        dataIndex: 'deptName',
-        key: 'deptName',
-        editable: true,
-    },
+    // {
+    //     title: '部门名称',
+    //     dataIndex: 'deptName',
+    //     key: 'deptName',
+    //     editable: true,
+    // },
     {
         title: '单位分类名',
         dataIndex: 'deptClassName',
@@ -76,6 +77,7 @@ const GroupIdentityAndGroup = () => {
     })
     setarr(renderData);
     setpages({
+        'pageSize':data.data.data.pageSize,
         'currPage':data.data.data.currPage,
         'totalPage':data.data.data.totalPage,
         'totalCount':data.data.data.totalCount,
@@ -96,13 +98,14 @@ const GroupIdentityAndGroup = () => {
 
 
   const paginationCallback = (obj)=>{
-    const {currPage} = obj;
-    getData({page:currPage,pageSize:10});
+    const {currPage,pageSize} = obj;
+    getData({page:currPage,pageSize:pageSize,keyword:searchKey});
   }
 
 
   const onSearch = (searchKey)=>{
     //  console.log({searchKey});
+    setsearchKey(searchKey);
      getData({
        'keyword':searchKey?searchKey:''
      });

+ 6 - 5
src/views/groupManage/groupIdentityAndGroup/table.js

@@ -5,7 +5,7 @@
 /*
  * @Author: your name
  * @Date: 2021-04-27 11:19:40
- * @LastEditTime: 2021-05-05 20:54:02
+ * @LastEditTime: 2021-05-15 15:56:23
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /react-antd-admin-template/src/views/groupManage/groupIdentity/table.js
@@ -79,9 +79,9 @@ class EditableTable extends React.Component {
       this.props.deleteCallback(record);
   }
 
-  changePage(current){
+  changePage(current,pageSize){
     this.setState({ loading: true });
-    this.props.paginationCallback({'currPage':current-1})
+    this.props.paginationCallback({'currPage':current,pageSize:pageSize})
   }
 
 
@@ -102,16 +102,17 @@ class EditableTable extends React.Component {
     const {
         currPage,
         totalCount,
+        pageSize
     } = this.props.pages;
 
     const paginationProps = {
         showSizeChanger: false,
         showQuickJumper: false,
         showTotal: () => `共${totalCount}条`,
-        pageSize: 10,
+        pageSize: pageSize,
         current: currPage,
         total: totalCount,
-        onChange: (current) => this.changePage(current),
+        onChange: (current) => this.changePage(current,pageSize),
     }
 
     return (

+ 61 - 12
src/views/groupManage/groupMana/groupMana.jsx

@@ -1,6 +1,6 @@
 import React,{ useState,useEffect,useRef } from 'react';
 
-import {getGroupManaList,addGroupMana,delGroupMana,
+import {getGroupManaList,addGroupMana,delGroupMana,getGroupIdentityList,
   editGroupMana,getPersonList,groupBindPerson,getCheckPointList,groupBindCheckPoint,
   getDeptManager,
 } from "@/api/groupManage.js";
@@ -235,10 +235,6 @@ class TableForm extends React.Component {
 const WrappedTableForm = Form.create({ name: 'register' })(TableForm);
 
 
-
-
-
-
 const GroupMana = () => {
 
   let [arr,setarr] = useState([]);
@@ -251,7 +247,11 @@ const GroupMana = () => {
   const modalNode = useRef(null);
   const formNode = useRef(null);
   const thisForm = useRef(null);
-//   let [editingKey,seteditingKey] = useState('');
+  const [searchKey,setsearchKey] = useState('');
+  const [selectRowObj,setselectRowObj] = useState(null);
+  const [checkedBox,set_checkedBox] = useState([]);
+  const [groupIdentity,set_groupIdentity] = useState([]);
+
 
   const columns = [
     {
@@ -267,13 +267,13 @@ const GroupMana = () => {
       editable: true,
     },
     {
-        title: '门诊管理员ID',
+        title: '管理员ID',
         dataIndex: 'deptManagerId',
         key: 'deptManagerId',
         editable: true,
     },
     {
-        title: '门诊管理员',
+        title: '管理员',
         dataIndex: 'deptManagerName',
         key: 'deptManagerName',
         editable: true,
@@ -281,7 +281,7 @@ const GroupMana = () => {
   ];
 
 
-
+  //获取表格数据
   const getData = async (pageObj)=>{
     let data = await getGroupManaList(pageObj);
     const renderData = data.data.data.list.map((item,index)=>{
@@ -300,6 +300,12 @@ const GroupMana = () => {
     setifRender(false);
     setifRender(true);
   }
+  //获取绑定下拉列表
+  const getBindSelectData= async (obj)=>{
+    let data = await getGroupIdentityList(obj);
+    set_groupIdentity(data.data.data.list);
+    console.log('getBindSelectData',data)
+  }
 
   const callbackFromChild = (data)=>{
         setitem(data);
@@ -368,7 +374,7 @@ const GroupMana = () => {
         // console.log({param});
         editGroupMana(param).then(res=>{
           if(res&&res.data.msg=="success"){
-            getData();
+            getData({page:pages.currPage});
            }
         });
       }
@@ -376,18 +382,41 @@ const GroupMana = () => {
   
   const paginationCallback = (obj)=>{
     const {currPage} = obj;
-    getData({page:currPage,pageSize:10});
+    getData({page:currPage,pageSize:10,keyword:searchKey});
+  }
+  
+  //绑定操作
+  const bindAction = ()=>{
+    selectRowObj?setselectRowObj(null):setselectRowObj({})
   }
 
   const onSearch = (searchKey)=>{
     //  console.log({searchKey});
+    setsearchKey(searchKey);
      getData({
        'keyword':searchKey?searchKey:''
      });
   }
+
+  // const onChange=(value)=>{
+  //   console.log(`selected ${value}`);
+  // }
+  
+  // const onBlur=()=>{
+  //   console.log('blur');
+  //   // setselectRowObj(null)
+  // }
+  
+  // const onFocus=()=>{
+  //   console.log('focus');
+  //   if(checkedBox.length == 0){
+  //     message.warning('请先勾选需要绑定!');
+  //   }
+  // }
   
   useEffect(()=>{
     getData();
+    // getBindSelectData();
   },[]);
 
   return ( 
@@ -401,10 +430,30 @@ const GroupMana = () => {
           <Button onClick={handleAdd} type="primary" style={{ marginBottom: 16,marginRight:20 }}>
              新增单位
           </Button>
+          {/* <Button onClick={bindAction} type="primary" style={{ marginBottom: 16,marginRight:20 }}>
+             {selectRowObj?'取消绑定操作':'选择绑定单位分类'}
+          </Button> */}
+          {/* <Select
+            showSearch
+            style={{ width: 170,marginRight:10}}
+            placeholder="选择绑定单位分类"
+            optionFilterProp="children"
+            onChange={onChange}
+            onFocus={onFocus}
+            onBlur={onBlur}
+            onSearch={onSearch}
+            // disabled={checkedBox.length>0?false:false}
+            filterOption={(input, option) =>
+              option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
+            }
+          >
+            <Option value="lucy">Lucy</Option>
+            <Option value="tom">Tom</Option>
+          </Select> */}
           <Search style={{ width: 200 }} allowClear placeholder="请输入单位名"  onSearch={onSearch} enterButton />
           </div>
           {
-             ifRender&& <EditableFormTable columns={columns} pages={pages} paginationCallback={paginationCallback}  data={arr} deleteCallback={deleteCallback} callbackFromChild={callbackFromChild} ifUpdateList={ifUpdateList}/>
+             ifRender&& <EditableFormTable set_checkedBox={set_checkedBox} columns={columns} pages={pages} paginationCallback={paginationCallback}  data={arr} deleteCallback={deleteCallback} callbackFromChild={callbackFromChild} ifUpdateList={ifUpdateList}/>
           }
     </div>
   );

+ 17 - 2
src/views/groupManage/groupMana/table.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-04-27 13:59:57
- * @LastEditTime: 2021-04-30 14:18:27
+ * @LastEditTime: 2021-05-13 11:18:12
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /react-antd-admin-template/src/views/groupManage/groupMana/table.js
@@ -113,9 +113,23 @@ class EditableTable extends React.Component {
     this.props.paginationCallback({'currPage':current})
   }
 
+  // rowSelection object indicates the need for row selection
+  rowSelection(){
+    const {set_checkedBox} = this.props;
+    return {
+      onChange: (selectedRowKeys, selectedRows) => {
+        console.log('selectedRowKeys',selectedRowKeys, 'selectedRows: ', selectedRows);
+        selectedRowKeys.length>0&&set_checkedBox(selectedRowKeys);
+      },
+      getCheckboxProps: record => ({
+        disabled: record.name === 'Disabled User', // Column configuration not to be checked
+        name: record.name,
+      }),
+    }
+  };
+
   render() {
     
-    
     const columns = this.columns.map(col => {
       if (!col.editable) {
         return col;
@@ -151,6 +165,7 @@ class EditableTable extends React.Component {
     return (
         <Table
           bordered
+          rowSelection={this.rowSelection()}
           loading={this.state.loading}
           pagination={paginationProps}
           dataSource={this.state.data}

+ 1 - 1
src/views/layout/Header/index.jsx

@@ -21,7 +21,7 @@ const LayoutHeader = (props) => {
     fixedHeader,
   } = props;
 
-  const  [userName,setuserName] = useState('name')
+  const  [userName,setuserName] = useState('name');
   // token && getUserInfo(token);
   
   getUserInfo().then(data=>{

+ 1 - 1
src/views/layout/Sider/Menu/index.less

@@ -1,3 +1,3 @@
 .sidebar-menu-container {
-  height:calc(100% - 64px)
+  height:calc(100% - 104px)
 }

+ 15 - 9
src/views/layout/Sider/index.jsx

@@ -3,20 +3,26 @@ import { connect } from "react-redux";
 import { Layout } from "antd";
 import Logo from "./Logo";
 import Menu from "./Menu";
+const packageInfo = require('../../../../package.json');
 const { Sider } = Layout;
 
 const LayoutSider = (props) => {
   const { sidebarCollapsed, sidebarLogo } = props;
   return (
-    <Sider
-      collapsible
-      collapsed={sidebarCollapsed}
-      trigger={null}
-      style={{ zIndex: "10" }}
-    >
-      {sidebarLogo ? <Logo /> : null}
-      <Menu />
-    </Sider>
+    <div style={{ position:'relative'}}>
+      <Sider
+        collapsible
+        collapsed={sidebarCollapsed}
+        trigger={null}
+        style={{ zIndex: "10",height:'100%' }}
+      >
+        {sidebarLogo ? <Logo /> : null}
+        <Menu />
+        <div style={{ display:'flex',position:'absolute',justifyContent:'flex-start',paddingLeft:'25px',
+                      zIndex: "10",color:'rgba(255, 255, 255, 0.65)',width:'100%',height:'40px',alignItems:'center',fontSize:'14px'
+        }}>{`当前版本 v${packageInfo.version}`}</div>
+      </Sider>
+    </div>
   );
 };
 

+ 4 - 2
src/views/personnelManagement/permissionMaintenance/permissionMaintenance.jsx

@@ -91,6 +91,7 @@ const PermissionMaintenance = () => {
   const [editItem,seteditItem] = useState({});
   const modalNode = useRef(null);
   const formNode = useRef(null);
+  const [searchKey,setsearchKey] = useState('');
 //   let [editingKey,seteditingKey] = useState('');
 
   const columns = [
@@ -157,7 +158,7 @@ const PermissionMaintenance = () => {
               }
               editUser(newData).then(data=>{
                 //    console.log({'修改后的数据':data});
-                   getData();
+                getData({page:pages.currPage});
              });
       });
 
@@ -173,11 +174,12 @@ const PermissionMaintenance = () => {
 
   const paginationCallback = (obj)=>{
     const {currPage} = obj;
-    getData({page:currPage,pageSize:10});
+    getData({page:currPage,pageSize:10,keyword:searchKey});
   }
 
   const onSearch = (searchKey)=>{
     //  console.log({searchKey});
+    setsearchKey(searchKey);
      getData({
        'keyword':searchKey?searchKey:''
      });

+ 2 - 2
src/views/personnelManagement/permissionMaintenance/table.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-04-27 13:59:57
- * @LastEditTime: 2021-04-30 15:54:02
+ * @LastEditTime: 2021-05-16 21:53:42
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /react-antd-admin-template/src/views/groupManage/groupMana/table.js
@@ -110,7 +110,7 @@ class EditableTable extends React.Component {
 
   changePage(current){
     this.setState({ loading: true });
-    this.props.paginationCallback({'currPage':current-1})
+    this.props.paginationCallback({'currPage':current})
   }
 
   render() {

+ 3 - 1
src/views/personnelManagement/personAndCheckGroup/personAndCheckGroup.jsx

@@ -14,6 +14,7 @@ const PointAndCheckGroup = () => {
   let [pages,setpages] = useState({});
   let [ifUpdateList,setifUpdateList]=useState(false);
   let [ifRender,setifRender] = useState(false);
+  const [searchKey,setsearchKey] = useState('');
  
   const columns = [
     {
@@ -89,11 +90,12 @@ const PointAndCheckGroup = () => {
 
   const paginationCallback = (obj)=>{
     const {currPage} = obj;
-    getData({page:currPage,pageSize:10});
+    getData({page:currPage,pageSize:10,keyword:searchKey});
   }
 
   const onSearch = (searchKey)=>{
     //  console.log({searchKey});
+     setsearchKey(searchKey);
      getData({
        'keyword':searchKey?searchKey:''
      });

+ 3 - 1
src/views/personnelManagement/personAndGroup/personAndGroup.jsx

@@ -14,6 +14,7 @@ const PersonAndGroup = () => {
   let [pages,setpages] = useState({});
   let [ifUpdateList,setifUpdateList]=useState(false);
   let [ifRender,setifRender] = useState(false);
+  const [searchKey,setsearchKey] = useState('');
  
   const columns = [
     {
@@ -83,11 +84,12 @@ const PersonAndGroup = () => {
 
   const paginationCallback = (obj)=>{
     const {currPage} = obj;
-    getData({page:currPage,pageSize:10});
+    getData({page:currPage,pageSize:10,keyword:searchKey});
   }
   
   const onSearch = (searchKey)=>{
     //  console.log({searchKey});
+     setsearchKey(searchKey);
      getData({
        'keyword':searchKey?searchKey:''
      });

+ 7 - 6
src/views/personnelManagement/personnelInformation/personnelInformation.jsx

@@ -177,6 +177,7 @@ const GroupMana = () => {
   const modalNode = useRef(null);
   const formNode = useRef(null);
   const thisForm = useRef(null);
+  const [searchKey,setsearchKey] = useState('');
 //   let [editingKey,seteditingKey] = useState('');
 
   const columns = [
@@ -239,7 +240,7 @@ const GroupMana = () => {
   const deleteCallback = (record)=>{
     //   console.log('删除');
     deleteUsers([record.id]).then(res=>{
-        if(res.data.status==200){
+        if(res&&res.data.status==200){
                 getData();
         }
     })
@@ -269,7 +270,7 @@ const GroupMana = () => {
             "telPhone":formData.telPhone   // 电话 
           }
           addUser(param).then(res=>{
-            if(res.data.status==200){
+            if(res&&res.data.status==200){
                 modalNode.current.handleCancel();
                 getData();
             }
@@ -285,9 +286,9 @@ const GroupMana = () => {
           }
           // console.log({param});
           editUser(param).then(res=>{
-            if(res.data.status==200){
+            if(res&&res.data.status==200){
               modalNode.current.handleCancel();
-              getData();
+              getData({page:pages.currPage});
              }
           });
         }
@@ -298,11 +299,11 @@ const GroupMana = () => {
   
   const paginationCallback = (obj)=>{
     const {currPage} = obj;
-    getData({page:currPage,pageSize:10});
+    getData({page:currPage,pageSize:10,keyword:searchKey});
   }
 
   const onSearch = (searchKey)=>{
-    //  console.log({searchKey});
+     setsearchKey(searchKey)
      getData({
        'keyword':searchKey?searchKey:''
      });

+ 4 - 2
src/views/provisionsManage/provisions.jsx

@@ -183,6 +183,7 @@ const CheckGroupManage = () => {
   const modalNode = useRef(null);
   const formNode = useRef(null);
   const thisForm = useRef(null);
+  const [searchKey,setsearchKey] = useState('');
 //   let [editingKey,seteditingKey] = useState('');
 
   const columns = [
@@ -314,7 +315,7 @@ const CheckGroupManage = () => {
         // console.log({param});
         editProvisions(param).then(res=>{
           if(res&&res.data.msg=="success"){
-            getData();
+            getData({page:pages.currPage});
            }
         });
       }
@@ -322,11 +323,12 @@ const CheckGroupManage = () => {
 
   const paginationCallback = (obj)=>{
     const {currPage} = obj;
-    getData({page:currPage,pageSize:10});
+    getData({page:currPage,pageSize:10,keyword:searchKey});
   }
 
   const onSearch = (searchKey)=>{
     //  console.log({searchKey});
+     setsearchKey(searchKey);
      getData({
        'keyword':searchKey?searchKey:''
      });

+ 209 - 0
src/views/situationCreate/components/condition/condition.jsx

@@ -0,0 +1,209 @@
+import React,{ useEffect, useState} from 'react';
+import {getConditionList} from '@/api/situation.js';
+import './condition.less';
+import { Tabs,Tree } from 'antd';
+
+
+
+const { TabPane } = Tabs;
+const { TreeNode, DirectoryTree } = Tree;
+
+const treeData2 = [
+      {
+        child: [
+            {
+                child: [
+                    {
+                     description: "",
+                     id: 21,
+                     name: "住院",
+                     parentId: 20,
+                     child:[
+                       {
+                         child: [],
+                         description: "",
+                         id: 23,
+                         name: "RCC",
+                         parentId: 21
+                       }
+                     ]
+                    }
+                 ],
+                 description: "",
+                 id: 20,
+                 name: "急诊",
+                 parentId: 0
+            }
+        ],
+        description: "测试条件",
+        id: 6042,
+        name: "测试条件22",
+        parentId: 0
+       },
+       {
+        child: [
+           
+        ],
+        description: "",
+        id: 201,
+        name: "急诊2",
+        parentId: 0
+       }
+];
+
+const Condition = (props)=>{
+    const {updateCreateFlowState,getCreateFlowState} = props;
+    const [treeData,set_treeData] = useState([]);
+    const [currentTabIndex,set_currentTabIndex] = useState(1);
+
+    const onChange = (e)=>{
+        //  console.log({e});
+        set_currentTabIndex(e)
+         if(updateCreateFlowState){
+            updateCreateFlowState({
+                'state':{
+                    depType:parseInt(e),//depType=1  门诊  2 急诊
+                    conditionIds:[],//切换tab重置选中
+                }  
+
+            })
+         }
+    }
+
+    const getConditions = async ()=>{
+         let data = await getConditionList();
+         console.log({data});
+         set_treeData(data.data.data);
+    }
+
+    useEffect(()=>{
+        getConditions();
+    },[]);
+    
+    return (
+        <div className="selectCondition">
+                    <h1>请选择追踪条件(可多选)</h1>
+                    <div className="conditionWrap">
+                        <Tabs defaultActiveKey="1" size="large" onChange={onChange}>
+                            
+                            <TabPane tab="门诊" key="1">
+                                {
+                                    currentTabIndex==1&&<TreeMap updateCreateFlowState={updateCreateFlowState} getCreateFlowState={getCreateFlowState} treeData={treeData} />
+                                }
+                            </TabPane>
+                            <TabPane tab="急诊" key="2">
+                                {
+                                    currentTabIndex==2&&<TreeMap updateCreateFlowState={updateCreateFlowState} getCreateFlowState={getCreateFlowState} treeData={treeData2} />
+                                }
+                            </TabPane>
+                        </Tabs>
+                    </div>
+        </div>
+    )
+}
+
+const TreeMap = (props)=>{
+    
+    const {treeData,updateCreateFlowState,getCreateFlowState} = props;
+    
+    const [treeState,set_treeState] = useState({
+        expandedKeys: [],
+        autoExpandParent: true,
+        checkedKeys: [],
+        selectedKeys: [],
+    });
+    
+    const onExpand = expandedKeys => {
+        console.log('onExpand', expandedKeys);
+        // if not set autoExpandParent to false, if children expanded, parent can not collapse.
+        // or, you can remove all expanded children keys.
+        set_treeState({
+            ...treeState,
+            expandedKeys,
+            autoExpandParent: false,
+        });
+    };
+
+    const optionsHandle = (arr, conditionIds)=>{
+        let options = [...arr].map((item)=>{
+            return {
+                ...item,
+                selectFlag: conditionIds.includes((item.id).toString()),
+                child: optionsHandle(item.child, conditionIds)
+            }
+        });
+        // console.log({options});
+        return options;
+    }
+    
+    const  onCheck = checkedKeys => {
+        console.log('onCheck', checkedKeys);
+        set_treeState({
+            ...treeState,
+            checkedKeys
+        });
+        updateCreateFlowState({
+            'state':{
+                filterCondition:optionsHandle(treeData,checkedKeys),
+                conditionIds:checkedKeys
+            }
+        })
+    };
+    
+    const  onSelect = (selectedKeys, info) => {
+        console.log('onSelect', info);
+        set_treeState({
+            ...treeState,
+            selectedKeys
+        });
+    };
+    
+    const renderTreeNodes = (data)=>{
+        let checkedIds = [];
+        let node=data.map(item => {
+            // console.log({item});
+     
+            if (item.child&&item.child.length>0) {
+              return (
+                <TreeNode title={item.name} key={item.id} dataRef={item} >
+                  {renderTreeNodes(item.child)}
+                </TreeNode>
+              );
+            }
+            return <TreeNode key={item.id} title={item.name} />;
+        });
+        
+        return node;
+    }
+
+    useEffect(()=>{
+        //获取已选择的条件
+        const {conditionIds,isEdit} = getCreateFlowState(); 
+        set_treeState({
+            ...treeState,
+            checkedKeys:conditionIds
+        });
+    },[]);
+
+    return (
+        <div className="conditionTree">
+               <Tree
+                    checkable
+                    onExpand={onExpand}
+                    expandedKeys={treeState.expandedKeys}
+                    autoExpandParent={treeState.autoExpandParent}
+                    onCheck={onCheck}
+                    checkedKeys={treeState.checkedKeys}
+                    onSelect={onSelect}
+                    selectedKeys={treeState.selectedKeys}
+                >
+                    {treeData.length>0&&renderTreeNodes(treeData)}
+                </Tree>
+        </div>
+    )
+}
+
+
+export default Condition;
+
+

+ 13 - 0
src/views/situationCreate/components/condition/condition.less

@@ -0,0 +1,13 @@
+
+
+.selectCondition {
+    // position: absolute;
+    .conditionWrap {
+        margin-top: 20px;
+    }
+}
+.conditionTree {
+    min-height: 500px;
+    margin-bottom: 20px;
+    background-color: #fff;
+}

+ 134 - 0
src/views/situationCreate/components/createFlow/createFlow.jsx

@@ -0,0 +1,134 @@
+import React,{ useState,useEffect,useRef } from 'react';
+
+import {situationList} from "@/api/situation.js";
+// // import {getOutpatientList} from "@/api/checkCondition.js";
+import { Steps, Button, message } from 'antd';
+
+// import ModalWrap from '@/components/Modal/modal.js';
+import './createFlow.less';
+import SelectSituation from '../selectSituation/selectSituation';
+import Condition from '../condition/condition';
+
+const { Step } = Steps;
+
+const steps = [
+    {
+      title: '主题',
+      content: 'theme',
+      tip:'请选择主题!'
+    },
+    {
+      title: '条件',
+      content: 'filterCondition',
+      tip:'请选择追踪条件!'
+    },
+    {
+      title: '查核组',
+      content: 'Last-content',
+    },
+    {
+        title: '地图',
+        content: 'Last-content',
+    },
+    {
+        title: '计划',
+        content: 'Last-content',
+    },
+    {
+        title: '预览',
+        content: 'Last-content',
+    },
+];
+
+const CreateFlow = ()=>{
+
+    const [current,set_current] = useState(0);
+    const [state,set_state] = useState({
+        depType:1,//门急诊类型 1-门诊 2-急诊
+        isEdit:false, //是否为编辑模式
+    });
+
+    // const getSituationList = async ()=>{
+    //     let data = await situationList();
+        
+    //     set_situationArr(data.data.data);
+    //     console.log({data});
+    // }
+
+    // useEffect(()=>{
+    //     getSituationList();
+    // },[]);
+
+    const updateCreateFlowState=(stateObj)=>{
+        console.log('收到子组件的更新',stateObj);
+        const {current,state} = stateObj;
+        if(state)set_state({...state,...stateObj});
+        if(current)set_current(current);
+    }
+
+    const getCreateFlowState = ()=>{
+        return state;
+    }
+
+    const next=()=>{
+        // selectSituationObj&&selectSituationObj.current.selectThemeHandle();
+        if(state[steps[current].content]){ //选择主题
+            set_current(prev=>prev+1);
+        }else if(state[steps[current].content]){ //选择条件
+            set_current(prev=>prev+1);
+        }else{
+            message.warning(steps[current].tip)
+        }
+    }
+    
+    const prev=()=>{
+        set_current(prev=>prev-1);
+    }
+
+    return (
+        <div className="situationListMod">
+               <div className="content">
+                    <Steps className="steps" current={current}>
+                            {steps.map(item => (
+                                <Step key={item.title} title={item.title} />
+                            ))}
+                    </Steps>
+                    {
+                        current==0&&<div style={{width:'80%'}}>
+                                <SelectSituation   updateCreateFlowState={updateCreateFlowState} getCreateFlowState={getCreateFlowState} />
+                        </div>
+                    }
+                    {
+                        current==1&&<div style={{width:'80%'}}>
+                                <Condition   updateCreateFlowState={updateCreateFlowState}  getCreateFlowState={getCreateFlowState}/>
+                        </div>
+                    }
+               </div>
+
+
+               <div className="bottomBtnGroup">
+               {current > 0 && (
+                    <Button className="bottomBtn"  size="large" style={{ marginLeft: 8 }} onClick={() =>prev()}>
+                     上一步
+                    </Button>
+                )}
+                {current < steps.length - 1 && (
+                    <Button className="bottomBtn" size="large" type="primary" onClick={() =>next()}>
+                      下一步
+                    </Button>
+                )}
+                {current === steps.length - 1 && (
+                    <Button className="bottomBtn"  size="large" type="primary" onClick={() => message.success('Processing complete!')}>
+                       确定
+                    </Button>
+                )}
+                
+               </div>
+        </div>
+    )
+}
+
+
+export default CreateFlow;
+
+

+ 22 - 0
src/views/situationCreate/components/createFlow/createFlow.less

@@ -0,0 +1,22 @@
+
+
+.situationListMod {
+    .content {
+        min-height:600px;
+        padding: 60px;
+        padding-top: 20px;
+        padding-bottom: 0;
+        .steps {
+            width: 70%;
+            margin-bottom: 20px;
+        }
+    }
+    .bottomBtnGroup {
+        display: flex;
+        justify-content: center;
+        .bottomBtn {
+            width: 10%;
+            margin:0 10px;
+        }
+    }
+}

+ 79 - 0
src/views/situationCreate/components/selectSituation/selectSituation.jsx

@@ -0,0 +1,79 @@
+import React,{ useEffect, useState} from 'react';
+// import ModalWrap from '@/components/Modal/modal.js';
+import './selectSituation.less';
+
+import themeCaseIcon from '../../../../assets/images/theme0.png';
+import themeSystemIcon from '../../../../assets/images/theme1.png'
+import themeSelectedIcon from '../../../../assets/images/theme.png'
+
+const list = [
+    {
+		id: 0, 
+		title: '个案追踪', 
+		des: '评价诊疗服务的内涵质量以及对各种诊疗规范、临床路径等的执行力',
+	},{
+		id: 1, 
+		title: '系统追踪', 
+		des: '评价对各种质量与安全管理制度与流程的执行力、医院服务的连贯性及多学科综合的服务能力',
+    }
+];
+
+
+
+const SelectSituation = (props)=>{
+    
+    const [selectedIndex,set_selectedIndex] = useState(-1);
+
+    const selectThemeHandle = (index)=>{
+           const {updateCreateFlowState} = props;
+           set_selectedIndex(index)
+           if(updateCreateFlowState)updateCreateFlowState({'state':{theme:{...list[index]}}});
+    }
+
+    const init = ()=>{
+        const {getCreateFlowState} = props;
+        if(getCreateFlowState&&getCreateFlowState()){
+              const {theme} = getCreateFlowState();
+              if(theme){
+                // console.log({theme});
+                set_selectedIndex(theme.id);
+              }
+              
+           
+        }
+    }
+
+    useEffect(()=>{
+        init();
+    },[]);
+
+    return (
+        <div className="selectSituation">
+             
+                    <h1>选定一个主题进行跟踪</h1>
+               
+                    <div className="situationWrap">
+                            {
+                                list.map((item,index)=>{
+                                      return (
+                                          <div key={index} className="themeList" onClick={()=>selectThemeHandle(index)}>
+                                                 <img src={item.id==0?themeCaseIcon:themeSystemIcon} />
+                                                 {selectedIndex==index&&<img className="activedIcon" src={themeSelectedIcon} />}
+                                                 <div className="themeInfo">
+                                                     <h1>{item.title}</h1>
+                                                     <div className="themeInfoDetail">{item.des}</div>
+                                                 </div>
+                                          </div>
+                                      )
+                                })
+                            }
+                    </div>
+
+        </div>
+    )
+}
+
+
+export default SelectSituation;
+
+

+ 49 - 0
src/views/situationCreate/components/selectSituation/selectSituation.less

@@ -0,0 +1,49 @@
+
+
+
+.selectSituation {
+    // position: absolute;
+    .situationWrap {
+        display: flex;
+        width: 70%;
+        flex-direction: row;
+        justify-content: space-between;
+        padding-top: 50px;
+        .themeList {
+            position: relative;
+            display: flex;
+            flex-direction: row;
+            justify-content: center;
+            align-items: center;
+            width: 48%;
+            height: 150px;
+            cursor: pointer;
+            padding: 0 20px;
+            background: linear-gradient(270deg, #00CCBB 0%, #00CCAA 100%);
+            box-shadow: 0px 20px 20px 0px rgba(0, 204, 170, 0.2);
+            border-radius: 24px;
+            .activedIcon {
+                position: absolute;
+                top:20px;
+                right:0;
+                width: 8%;
+            }
+            img {
+                width: 20%;
+                margin-right: 20px;
+            }
+            h1 {
+                color: #fff;
+            }
+            .themeInfoDetail {
+                color: #fff;
+            }
+
+            &:nth-child(2){
+                background: linear-gradient(270deg, #6697FE 0%, #4980F2 100%);
+                box-shadow: 0px 20px 20px 0px rgba(73, 128, 242, 0.2);
+                border-radius: 24px;
+            }
+        }
+    }
+}

+ 64 - 0
src/views/situationCreate/components/situationList/situationList.jsx

@@ -0,0 +1,64 @@
+import React,{ useState,useEffect,useRef } from 'react';
+
+import {situationList} from "@/api/situation.js";
+// // import {getOutpatientList} from "@/api/checkCondition.js";
+// import { Button,Form,Input,Select} from 'antd';
+
+import ModalWrap from '@/components/Modal/modal.js';
+import './situationList.less';
+
+import checkStatusIcon from '../../../../assets/images/checkStatusIcon.jpg';
+import nextCheckTime from '../../../../assets/images/nextCheckTime.jpg';
+import situationCase from '../../../../assets/images/situation-case.jpg';
+import situationSystem from '../../../../assets/images/situation-system.jpg';
+
+
+const SituationList = (props)=>{
+
+    const [situationArr,set_situationArr] = useState([]);
+
+    const getSituationList = async ()=>{
+        let data = await situationList();
+        
+        set_situationArr(data.data.data);
+        console.log({data});
+    }
+
+    const addSituationhandle = ()=>{
+        const {updateSituationCreateModState} = props;
+        if(updateSituationCreateModState){
+            updateSituationCreateModState({key:'isAdd',value:true});
+        }
+    }
+
+    useEffect(()=>{
+        getSituationList();
+    },[]);
+
+    return (
+        <div className="situationListMod">
+               <h1>情境列表</h1>
+               <div className="listWrap">
+                   <div className="hoverAddBtn" onClick={addSituationhandle}>+</div>
+                   {
+                        situationArr.map((item,index)=>{
+                              return (
+                                    <div key={index} className="situation">
+                                             <img className="topic" src={item.topic?situationCase:situationSystem}  />
+                                             <h3>{item.name}</h3>
+                                             <h4>{item.checkGroupName}</h4>
+                                             <div className="checkStatus"><img src={checkStatusIcon} />{item.checkStatus}</div>
+                                             <div className="nextCheckTime"><img src={nextCheckTime} />{item.nextCheckTime}</div>
+                                    </div>
+                              )
+                        })
+                   }
+               </div>
+        </div>
+    )
+}
+
+
+export default SituationList;
+
+

+ 54 - 0
src/views/situationCreate/components/situationList/situationList.less

@@ -0,0 +1,54 @@
+
+
+
+.situationListMod {
+    .listWrap {
+        position: relative;
+        display: flex;
+        flex-direction: row;
+        justify-content: space-between;
+        flex-wrap: wrap;
+        .hoverAddBtn {
+            position: fixed;
+            right:40px;
+            bottom: 60px;
+            width: 60px;
+            height: 60px;
+            z-index: 10;
+            cursor: pointer;
+            line-height: 46px;
+            text-align: center;
+            // justify-content: center;
+            // align-items: center;
+            border-radius: 50%;
+            font-size: 50px;
+            color: #FFFFFF;
+            background: linear-gradient(90deg, #3377FF 0%, #3399FF 99%);
+            box-shadow: 0px 10px 16px 0px rgba(41, 95, 204, 0.3);
+        }
+        .situation {
+            position: relative;
+            width: 24%;
+            height: 120px;
+            cursor: pointer;
+            background: #FFFFFF;
+            box-shadow: 0px 6px 20px 0px rgba(0, 13, 51, 0.1);
+            border-radius: 8px;
+            padding: 10px;
+            margin-bottom: 20px;
+            .topic {
+                position: absolute;
+                width:50px;
+                right: 0;
+                top:0;
+            }
+            .checkStatus,.nextCheckTime {
+                 img {
+                     width: 14px;
+                     margin-top: -3px;
+                     margin-right: 5px;
+                 }
+            }
+        }
+    }
+}

+ 56 - 0
src/views/situationCreate/situationCreate.jsx

@@ -0,0 +1,56 @@
+import React,{ useState,useEffect,useRef } from 'react';
+
+import {} from "@/api/checkPointManage.js";
+// import {getOutpatientList} from "@/api/checkCondition.js";
+import { Button,Form,Input,Select} from 'antd';
+
+import ModalWrap from '@/components/Modal/modal.js';
+import SituationList from './components/situationList/situationList';
+import CreateFlow from './components/createFlow/createFlow';
+
+const SituationCreate = () => {
+
+  let [ifShowDialog,setifShowDialog] = useState(false);
+  const [isAdd,set_isAdd] = useState(true);
+
+  const modalNode = useRef(null);
+
+
+  const commitForm = async ()=>{  //表单提交
+      console.log('提交表单');
+        
+  }
+  
+  const updateSituationCreateModState=(updateObj)=>{
+        const {key,value} = updateObj;
+        if(key == 'isAdd')set_isAdd(value);
+  }
+
+  useEffect(()=>{
+    // getData();
+   
+    // console.log(this);
+  },[]);
+
+  return ( 
+    <div className="app-container">
+          {/* <h1>情境管理</h1> */}
+          <ModalWrap ref={modalNode} show={ifShowDialog} handleOkCallback={commitForm} >
+                <h1>1111</h1>
+          </ModalWrap>
+          <div className="content">
+                 {!isAdd&&<SituationList updateSituationCreateModState={updateSituationCreateModState} />}
+                 {isAdd&&<CreateFlow />}
+          </div>
+          <div style={{display:'flex',flexDirection:'row'}}>
+          
+          </div>
+    </div>
+  );
+}
+
+
+
+
+ 
+export default SituationCreate;

BIN
追踪方法学后台管理_build0517_v0.1.1.zip