Selaa lähdekoodia

del 国际化

code4eat 4 vuotta sitten
vanhempi
commit
e8f7366bf6
41 muutettua tiedostoa jossa 1290 lisäystä ja 1342 poistoa
  1. 18 13
      config/routes.js
  2. 113 0
      mock/menu.js
  3. 54 123
      mock/role.js
  4. 1 1
      src/app.jsx
  5. 14 0
      src/global.less
  6. 15 23
      src/pages/DepartmentMana/index.jsx
  7. 3 10
      src/pages/DepartmentMana/updateForm.jsx
  8. 0 196
      src/pages/TableList/components/UpdateForm.jsx
  9. 0 396
      src/pages/TableList/index.jsx
  10. 11 23
      src/pages/UserMana/index.js
  11. 10 41
      src/pages/accountingSubject/index.jsx
  12. 4 14
      src/pages/accountingSubject/updateForm.jsx
  13. 9 11
      src/pages/accountingSubjectConnect/index.jsx
  14. 7 17
      src/pages/accountingSubjectConnect/updateForm.jsx
  15. 10 19
      src/pages/apportionmentLevel/index.jsx
  16. 5 15
      src/pages/apportionmentLevel/updateForm.jsx
  17. 26 13
      src/pages/costAllocationParamsConnect/index.jsx
  18. 8 16
      src/pages/costAllocationParamsConnect/updateForm.jsx
  19. 7 33
      src/pages/costAllocationParamsConnect/updateForm_drawer.js
  20. 20 25
      src/pages/costAllocationParamsSetting/index.jsx
  21. 5 10
      src/pages/costAllocationParamsSetting/updateForm.jsx
  22. 7 34
      src/pages/costAllocationParamsSetting/updateForm_drawer.js
  23. 14 14
      src/pages/costProjectMana/index.jsx
  24. 4 10
      src/pages/costProjectMana/updateForm.jsx
  25. 11 20
      src/pages/districtMana/index.jsx
  26. 4 10
      src/pages/districtMana/updateForm.jsx
  27. 81 0
      src/pages/platformMana/menuManage/component/drawer.jsx
  28. 306 0
      src/pages/platformMana/menuManage/index.js
  29. 69 0
      src/pages/platformMana/menuManage/service.js
  30. 101 0
      src/pages/platformMana/menuManage/updateForm.jsx
  31. 81 0
      src/pages/platformMana/roleManage/component/drawer.jsx
  32. 137 26
      src/pages/platformMana/roleManage/index.js
  33. 36 18
      src/pages/platformMana/roleManage/service.js
  34. 43 78
      src/pages/platformMana/roleManage/updateForm.jsx
  35. 15 35
      src/pages/responsibilityCenter/index.jsx
  36. 7 18
      src/pages/responsibilityCenter/updateForm.jsx
  37. 11 14
      src/pages/responsibilityCenterConnect/index.jsx
  38. 7 17
      src/pages/responsibilityCenterConnect/updateForm.jsx
  39. 14 47
      src/pages/user/Login/index.jsx
  40. 2 2
      src/utils.js
  41. BIN
      成本核算_build0802.zip

+ 18 - 13
config/routes.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-22 15:04:09
- * @LastEditTime: 2021-08-02 18:48:49
+ * @LastEditTime: 2021-08-03 15:14:45
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/config/routes.js
@@ -23,18 +23,23 @@ export default [
       },
     ],
   },
-  // {
-  //   path: '/platformMana',
-  //   name: '平台系统管理',
-  //   icon: 'smile',
-  //   routes:[
-  //     {
-  //       name: '角色管理',
-  //       path: '/platformMana/roleManage',
-  //       component: './platformMana/roleManage/index',
-  //     }
-  //   ]
-  // },
+  {
+    path: '/platformMana',
+    name: '平台系统管理',
+    icon: 'smile',
+    routes:[
+      {
+        name: '角色管理',
+        path: '/platformMana/roleManage',
+        component: './platformMana/roleManage/index',
+      },
+      {
+        name: '菜单管理',
+        path: '/platformMana/menuManage',
+        component: './platformMana/menuManage/index',
+      }
+    ]
+  },
   {
     path: '/UserMana',
     name: '用户管理',

+ 113 - 0
mock/menu.js

@@ -0,0 +1,113 @@
+/*
+ * @Author: your name
+ * @Date: 2021-08-03 14:39:54
+ * @LastEditTime: 2021-08-03 16:36:21
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /CostAccountManaSys/mock/menu.js
+ */
+
+
+// eslint-disable-next-line import/no-extraneous-dependencies
+import moment from 'moment';
+import { parse } from 'url'; // mock tableListDataSource
+
+const genList = (current, pageSize) => {
+  const tableListDataSource = [];
+
+  for (let i = 0; i < pageSize; i += 1) {
+    const index = (current - 1) * 10 + i;
+    tableListDataSource.push({
+      key: index,
+      menuId: index,
+      parentId:index,
+      name: `菜单名 ${i}`,
+      path: `path路径 ${i}`,
+      url:`url路径 ${i}`,
+      perms:`授权 ${i}`,
+      type:0,
+      icon:`图标 ${i}`,
+      orderNum:`排序 ${i}`,
+      modifyUserName:`修改人 ${i}`,
+      children:[
+           {
+            key:`${i}${index}`,
+            menuId:`${i}${index}`,
+            parentId:index+1,
+            name: `菜单名 ${i}`,
+            path: `path路径 ${i}`,
+            url:`url路径 ${i}`,
+            perms:`授权 ${i}`,
+            type:0,
+            icon:`图标 ${i}`,
+            orderNum:`排序 ${i}`,
+            modifyUserName:`修改人 ${i}`,
+           }
+      ],
+      modifyTime: moment().format('YYYY-MM-DD'),
+    });
+  }
+  //   console.log({tableListDataSource});
+  tableListDataSource.reverse();
+  return tableListDataSource;
+};
+
+let tableListDataSource = genList(1, 100);
+
+function getList(req, res, u) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  const { current = 1, pageSize = 10 } = req.query;
+  let dataSource = [...tableListDataSource].slice((current - 1) * pageSize, current * pageSize);
+
+  const result = {
+    data: {
+      list: dataSource,
+      totalCount: tableListDataSource.length,
+      pageSize: pageSize,
+    },
+    status: 200,
+    success: true,
+  };
+  return res.json(result);
+}
+
+function postList(req, res, u, b) {
+
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+function delList(req, res, u, b) {
+  const { method, body } = req;
+  tableListDataSource = tableListDataSource.filter((item) => !body.includes(item.roleId));
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+function editList(req, res, u, b) {
+  const { method, body } = req;
+  const { roleId, userIds } = body;
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+
+export default {
+  'GET /api/costAccount/menu/list': getList,
+  'POST /api/costAccount/menu/save': postList,
+  'POST /api/costAccount/menu/edit': editList,
+};

+ 54 - 123
mock/role.js

@@ -1,15 +1,12 @@
 /*
  * @Author: your name
  * @Date: 2021-08-02 18:11:13
- * @LastEditTime: 2021-08-02 18:27:35
+ * @LastEditTime: 2021-08-03 11:12:18
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /CostAccountManaSys/mock/role.js
  */
 
-
-
-
 // eslint-disable-next-line import/no-extraneous-dependencies
 import moment from 'moment';
 import { parse } from 'url'; // mock tableListDataSource
@@ -20,22 +17,33 @@ const genList = (current, pageSize) => {
   for (let i = 0; i < pageSize; i += 1) {
     const index = (current - 1) * 10 + i;
     tableListDataSource.push({
-          key:index,
-          roleId:index,
-          roleName:`角色${i}`,
-          hospName:`院区${i}`,
-          modifyUserName:`变更人 ${index}`,
-          modifyTime:moment().format('YYYY-MM-DD'),
+      key: index,
+      roleId: index,
+      roleName: `角色${i}`,
+      hospName: `院区${i}`,
+      modifyUserName: `变更人 ${index}`,
+      users: [
+        {
+          id: 93,
+          name: '用户93',
+        },
+        {
+          id: 92,
+          name: '用户92',
+        },
+      ],
+      menus: [],
+      modifyTime: moment().format('YYYY-MM-DD'),
     });
   }
-//   console.log({tableListDataSource});
+  //   console.log({tableListDataSource});
   tableListDataSource.reverse();
   return tableListDataSource;
 };
 
 let tableListDataSource = genList(1, 100);
 
-function getUser(req, res, u) {
+function getList(req, res, u) {
   let realUrl = u;
 
   if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
@@ -43,138 +51,61 @@ function getUser(req, res, u) {
   }
 
   const { current = 1, pageSize = 10 } = req.query;
-  const params = parse(realUrl, true).query;
   let dataSource = [...tableListDataSource].slice((current - 1) * pageSize, current * pageSize);
 
-  if (params.sorter) {
-    const sorter = JSON.parse(params.sorter);
-    dataSource = dataSource.sort((prev, next) => {
-      let sortNumber = 0;
-      Object.keys(sorter).forEach((key) => {
-        if (sorter[key] === 'descend') {
-          if (prev[key] - next[key] > 0) {
-            sortNumber += -1;
-          } else {
-            sortNumber += 1;
-          }
-
-          return;
-        }
-
-        if (prev[key] - next[key] > 0) {
-          sortNumber += 1;
-        } else {
-          sortNumber += -1;
-        }
-      });
-      return sortNumber;
-    });
-  }
-
-  if (params.filter) {
-    const filter = JSON.parse(params.filter);
-
-    if (Object.keys(filter).length > 0) {
-      dataSource = dataSource.filter((item) => {
-        return Object.keys(filter).some((key) => {
-          if (!filter[key]) {
-            return true;
-          }
-
-          if (filter[key].includes(`${item[key]}`)) {
-            return true;
-          }
-
-          return false;
-        });
-      });
-    }
-  }
-
-  if (params.name) {
-    dataSource = dataSource.filter((data) => data?.name?.includes(params.name || ''));
-  }
-
   const result = {
     data: {
-        list:dataSource,
-        totalCount:tableListDataSource.length,
-        pageSize:pageSize,
+      list: dataSource,
+      totalCount: tableListDataSource.length,
+      pageSize: pageSize,
     },
-    status:200,
+    status: 200,
     success: true,
   };
   return res.json(result);
 }
 
-function postUser(req, res, u, b) {
+function postList(req, res, u, b) {
   let realUrl = u;
 
   if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
     realUrl = req.url;
   }
 
-//   const body = (b && b.body) || req.body;
-  const { method,body} = req;
-  const {name,account, hospitalStatus,password } = body;
-
-  switch (method) {
-    /* eslint no-case-declarations:0 */
-    case 'delete':
-      tableListDataSource = tableListDataSource.filter((item) => key.indexOf(item.key) === -1);
-      break;
-
-    case 'POST':
-      (() => {
-        const i = Math.ceil(Math.random() * 10000);
-        const newRule = {
-          key: tableListDataSource.length,
-          avatar: [
-            'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-            'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-          ][i % 2],
-          name,
-          account,
-          hospitalStatus,
-          password,
-          createdAt: moment().format('YYYY-MM-DD'),
-        };
-        tableListDataSource.unshift(newRule);
-        return res.json(newRule);
-      })();
-
-      return;
-
-    case 'update':
-      (() => {
-        let newRule = {};
-        tableListDataSource = tableListDataSource.map((item) => {
-          if (item.key === key) {
-            newRule = { ...item, desc, name };
-            return { ...item, desc, name };
-          }
-
-          return item;
-        });
-        return res.json(newRule);
-      })();
-
-      return;
-
-    default:
-      break;
-  }
+  const { method, body } = req;
+
+  tableListDataSource.push({ ...body });
 
   const result = {
-    list: tableListDataSource,
-    pagination: {
-      total: tableListDataSource.length,
-    },
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+function delList(req, res, u, b) {
+  const { method, body } = req;
+  tableListDataSource = tableListDataSource.filter((item) => !body.includes(item.roleId));
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+function bindList(req, res, u, b) {
+  const { method, body } = req;
+  const { roleId, userIds } = body;
+  const result = {
+    status: 200,
+    msg: '',
   };
   res.json(result);
 }
 
 export default {
-  'GET /api/costAccount/role/list': getUser,
-  'POST /api/costAccount/user/save': postUser,
+  'GET /api/costAccount/role/list': getList,
+  'POST /api/costAccount/role/save': postList,
+  'POST /api/costAccount/role/delete': delList,
+  'POST /api/costAccount/role/editUserRole': bindList,
 };

+ 1 - 1
src/app.jsx

@@ -162,7 +162,7 @@ export async function getInitialState() {
 
 //请求拦截器
 const authHeaderInterceptor = (url, options) => {
-  console.log({options});
+
   const {method} = options;
   if(method == 'post'){
     requestMethod='post'

+ 14 - 0
src/global.less

@@ -6,6 +6,9 @@ body,
   height: 100%;
 }
 
+
+//--custom
+
 @primary-color: #00528E !important;
 
 .ant-tree-checkbox-checked .ant-tree-checkbox-inner {
@@ -13,6 +16,17 @@ body,
   border-color: #00528E;
 }
 
+
+  .ant-col .ant-form-item-label {
+    flex: 1 !important;
+   }
+
+
+
+
+
+//----------------
+
 .colorWeak {
   filter: invert(80%);
 }

+ 15 - 23
src/pages/DepartmentMana/index.jsx

@@ -1,19 +1,19 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-02 18:55:53
+ * @LastEditTime: 2021-08-03 17:25:23
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
  */
 
 import { PlusOutlined } from '@ant-design/icons';
-import { Button, Popconfirm, message, Input, Drawer } from 'antd';
-import React, { useState, useRef, useEffect } from 'react';
-import { useIntl, FormattedMessage,useModel } from 'umi';
-import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+import { Button, Popconfirm} from 'antd';
+import React, { useState, useRef } from 'react';
+import { useModel } from 'umi';
+import { PageContainer } from '@ant-design/pro-layout';
 import ProTable from '@ant-design/pro-table';
-import { ModalForm, ProFormText, ProFormSelect } from '@ant-design/pro-form';
+import { ModalForm, ProFormText } from '@ant-design/pro-form';
 import UpdateForm from './updateForm';
 import CAUpload from '@/components/CAUpload';
 import { getDepartmentList ,editDepartmentList,delDepartment,addDepartment,importExcel} from './service';
@@ -23,9 +23,8 @@ const DepartmentMana = () => {
     {
       title: 'ID',
       dataIndex: 'id',
-      key: 'name',
+      key: 'id',
       hideInSearch: true,
-      render: (text) => <a>{text}</a>,
     },
     {
       title: '科室名',
@@ -39,12 +38,6 @@ const DepartmentMana = () => {
       key: 'departmentCode',
       hideInSearch: false,
     },
-    // {
-    //   title: '医院Id',
-    //   dataIndex: 'hospId',
-    //   key: 'hospId',
-    //   hideInSearch: true,
-    // },
     {
       title: '创建时间',
       dataIndex: 'createDateTime',
@@ -52,7 +45,7 @@ const DepartmentMana = () => {
       hideInSearch: true,
     },
     {
-      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      title:'操作',
       dataIndex: 'option',
       valueType: 'option',
       render: (_, record) => [
@@ -121,9 +114,13 @@ const DepartmentMana = () => {
   };
 
   //自定义上传回调
+
+  /**
+   * 
+   * @param {FormData} formData 
+   */
   const customRequestCallback = async (formData)=>{
     const resp = await importExcel({formData},{
-      // 'content-type': 'application/json'
       'content-type':'multipart/form-data',
     })
     if(status==200){
@@ -192,9 +189,7 @@ const DepartmentMana = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.departmentName" defaultMessage="科室名是必填项" />
-              ),
+              message:'科室名是必填项',
             },
           ]}
           width="sm"
@@ -205,9 +200,7 @@ const DepartmentMana = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.departmentCode" defaultMessage="科室编号是必填项" />
-              ),
+              message:'科室编号是必填项',
             },
           ]}
           width="sm"
@@ -218,7 +211,6 @@ const DepartmentMana = () => {
       {/* 更新 */}
       <UpdateForm
         onSubmit={async (value) => {
-          console.log({'编辑':value});
           const success = await editDepartmentList(value);
 
           if (success) {

+ 3 - 10
src/pages/DepartmentMana/updateForm.jsx

@@ -1,16 +1,13 @@
 import React from 'react';
-import { Modal } from 'antd';
 import {
-    ProFormSelect,
     ProFormText,
     ModalForm,
 } from '@ant-design/pro-form';
-import { useIntl, FormattedMessage } from 'umi';
+
 
 
 const UpdateForm = (props) => {
     const {updateModalVisible,updateModalVisibleChange,values,onSubmit} = props;
-    // console.log({values});
     return (
         <>
            {
@@ -29,9 +26,7 @@ const UpdateForm = (props) => {
                  rules={[
                    {
                      required: true,
-                     message: (
-                       <FormattedMessage id="pages.searchTable.departmentName" defaultMessage="科室名是必填项" />
-                     ),
+                     message:'科室名是必填项',
                    },
                  ]}
                  width="sm"
@@ -42,9 +37,7 @@ const UpdateForm = (props) => {
                  rules={[
                    {
                      required: true,
-                     message: (
-                       <FormattedMessage id="pages.searchTable.departmentCode" defaultMessage="科室编码是必填项" />
-                     ),
+                     message:'科室编码是必填项',
                    },
                  ]}
                  width="sm"

+ 0 - 196
src/pages/TableList/components/UpdateForm.jsx

@@ -1,196 +0,0 @@
-import React from 'react';
-import { Modal } from 'antd';
-import {
-  ProFormSelect,
-  ProFormText,
-  ProFormTextArea,
-  StepsForm,
-  ProFormRadio,
-  ProFormDateTimePicker,
-} from '@ant-design/pro-form';
-import { useIntl, FormattedMessage } from 'umi';
-
-const UpdateForm = (props) => {
-  const intl = useIntl();
-  return (
-    <StepsForm
-      stepsProps={{
-        size: 'small',
-      }}
-      stepsFormRender={(dom, submitter) => {
-        return (
-          <Modal
-            width={640}
-            bodyStyle={{
-              padding: '32px 40px 48px',
-            }}
-            destroyOnClose
-            title={intl.formatMessage({
-              id: 'pages.searchTable.updateForm.ruleConfig',
-              defaultMessage: '规则配置',
-            })}
-            visible={props.updateModalVisible}
-            footer={submitter}
-            onCancel={() => {
-              props.onCancel();
-            }}
-          >
-            {dom}
-          </Modal>
-        );
-      }}
-      onFinish={props.onSubmit}
-    >
-      <StepsForm.StepForm
-        initialValues={{
-          name: props.values.name,
-          desc: props.values.desc,
-        }}
-        title={intl.formatMessage({
-          id: 'pages.searchTable.updateForm.basicConfig',
-          defaultMessage: '基本信息',
-        })}
-      >
-        <ProFormText
-          name="name"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.ruleName.nameLabel',
-            defaultMessage: '规则名称',
-          })}
-          width="md"
-          rules={[
-            {
-              required: true,
-              message: (
-                <FormattedMessage
-                  id="pages.searchTable.updateForm.ruleName.nameRules"
-                  defaultMessage="请输入规则名称!"
-                />
-              ),
-            },
-          ]}
-        />
-        <ProFormTextArea
-          name="desc"
-          width="md"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.ruleDesc.descLabel',
-            defaultMessage: '规则描述',
-          })}
-          placeholder={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.ruleDesc.descPlaceholder',
-            defaultMessage: '请输入至少五个字符',
-          })}
-          rules={[
-            {
-              required: true,
-              message: (
-                <FormattedMessage
-                  id="pages.searchTable.updateForm.ruleDesc.descRules"
-                  defaultMessage="请输入至少五个字符的规则描述!"
-                />
-              ),
-              min: 5,
-            },
-          ]}
-        />
-      </StepsForm.StepForm>
-      <StepsForm.StepForm
-        initialValues={{
-          target: '0',
-          template: '0',
-        }}
-        title={intl.formatMessage({
-          id: 'pages.searchTable.updateForm.ruleProps.title',
-          defaultMessage: '配置规则属性',
-        })}
-      >
-        <ProFormSelect
-          name="target"
-          width="md"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.object',
-            defaultMessage: '监控对象',
-          })}
-          valueEnum={{
-            0: '表一',
-            1: '表二',
-          }}
-        />
-        <ProFormSelect
-          name="template"
-          width="md"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.ruleProps.templateLabel',
-            defaultMessage: '规则模板',
-          })}
-          valueEnum={{
-            0: '规则模板一',
-            1: '规则模板二',
-          }}
-        />
-        <ProFormRadio.Group
-          name="type"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.ruleProps.typeLabel',
-            defaultMessage: '规则类型',
-          })}
-          options={[
-            {
-              value: '0',
-              label: '强',
-            },
-            {
-              value: '1',
-              label: '弱',
-            },
-          ]}
-        />
-      </StepsForm.StepForm>
-      <StepsForm.StepForm
-        initialValues={{
-          type: '1',
-          frequency: 'month',
-        }}
-        title={intl.formatMessage({
-          id: 'pages.searchTable.updateForm.schedulingPeriod.title',
-          defaultMessage: '设定调度周期',
-        })}
-      >
-        <ProFormDateTimePicker
-          name="time"
-          width="md"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.schedulingPeriod.timeLabel',
-            defaultMessage: '开始时间',
-          })}
-          rules={[
-            {
-              required: true,
-              message: (
-                <FormattedMessage
-                  id="pages.searchTable.updateForm.schedulingPeriod.timeRules"
-                  defaultMessage="请选择开始时间!"
-                />
-              ),
-            },
-          ]}
-        />
-        <ProFormSelect
-          name="frequency"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.object',
-            defaultMessage: '监控对象',
-          })}
-          width="md"
-          valueEnum={{
-            month: '月',
-            week: '周',
-          }}
-        />
-      </StepsForm.StepForm>
-    </StepsForm>
-  );
-};
-
-export default UpdateForm;

+ 0 - 396
src/pages/TableList/index.jsx

@@ -1,396 +0,0 @@
-import { PlusOutlined } from '@ant-design/icons';
-import { Button, message, Input, Drawer } from 'antd';
-import React, { useState, useRef } from 'react';
-import { useIntl, FormattedMessage } from 'umi';
-import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
-import ProTable from '@ant-design/pro-table';
-import { ModalForm, ProFormText, ProFormTextArea } from '@ant-design/pro-form';
-import ProDescriptions from '@ant-design/pro-descriptions';
-import UpdateForm from './components/UpdateForm';
-import { rule, addRule, updateRule, removeRule } from '@/services/ant-design-pro/api';
-/**
- * @en-US Add node
- * @zh-CN 添加节点
- * @param fields
- */
-
-const handleAdd = async (fields) => {
-  const hide = message.loading('正在添加');
-
-  try {
-    await addRule({ ...fields });
-    hide();
-    message.success('Added successfully');
-    return true;
-  } catch (error) {
-    hide();
-    message.error('Adding failed, please try again!');
-    return false;
-  }
-};
-/**
- * @en-US Update node
- * @zh-CN 更新节点
- *
- * @param fields
- */
-
-const handleUpdate = async (fields) => {
-  const hide = message.loading('Configuring');
-
-  try {
-    await updateRule({
-      name: fields.name,
-      desc: fields.desc,
-      key: fields.key,
-    });
-    hide();
-    message.success('Configuration is successful');
-    return true;
-  } catch (error) {
-    hide();
-    message.error('Configuration failed, please try again!');
-    return false;
-  }
-};
-/**
- *  Delete node
- * @zh-CN 删除节点
- *
- * @param selectedRows
- */
-
-const handleRemove = async (selectedRows) => {
-  const hide = message.loading('正在删除');
-  if (!selectedRows) return true;
-
-  try {
-    await removeRule({
-      key: selectedRows.map((row) => row.key),
-    });
-    hide();
-    message.success('Deleted successfully and will refresh soon');
-    return true;
-  } catch (error) {
-    hide();
-    message.error('Delete failed, please try again');
-    return false;
-  }
-};
-
-const TableList = () => {
-  /**
-   * @en-US Pop-up window of new window
-   * @zh-CN 新建窗口的弹窗
-   *  */
-  const [createModalVisible, handleModalVisible] = useState(false);
-  /**
-   * @en-US The pop-up window of the distribution update window
-   * @zh-CN 分布更新窗口的弹窗
-   * */
-
-  const [updateModalVisible, handleUpdateModalVisible] = useState(false);
-  const [showDetail, setShowDetail] = useState(false);
-  const actionRef = useRef();
-  const [currentRow, setCurrentRow] = useState();
-  const [selectedRowsState, setSelectedRows] = useState([]);
-  /**
-   * @en-US International configuration
-   * @zh-CN 国际化配置
-   * */
-
-  const intl = useIntl();
-  const columns = [
-    {
-      title:'规则标题',
-      dataIndex: 'name',
-      tip: 'The rule name is the unique key',
-      render: (dom, entity) => {
-        return (
-          <a
-            onClick={() => {
-              setCurrentRow(entity);
-              setShowDetail(true);
-            }}
-          >
-            {dom}
-          </a>
-        );
-      },
-    },
-    {
-      title: <FormattedMessage id="pages.searchTable.titleDesc" defaultMessage="Description" />,
-      dataIndex: 'desc',
-      valueType: 'textarea',
-    },
-    {
-      title: (
-        <FormattedMessage
-          id="pages.searchTable.titleCallNo"
-          defaultMessage="Number of service calls"
-        />
-      ),
-      dataIndex: 'callNo',
-      sorter: true,
-      hideInForm: true,
-      renderText: (val) =>
-        `${val}${intl.formatMessage({
-          id: 'pages.searchTable.tenThousand',
-          defaultMessage: ' 万 ',
-        })}`,
-    },
-    {
-      title: <FormattedMessage id="pages.searchTable.titleStatus" defaultMessage="Status" />,
-      dataIndex: 'status',
-      hideInForm: true,
-      valueEnum: {
-        0: {
-          text: (
-            <FormattedMessage
-              id="pages.searchTable.nameStatus.default"
-              defaultMessage="Shut down"
-            />
-          ),
-          status: 'Default',
-        },
-        1: {
-          text: (
-            <FormattedMessage id="pages.searchTable.nameStatus.running" defaultMessage="Running" />
-          ),
-          status: 'Processing',
-        },
-        2: {
-          text: (
-            <FormattedMessage id="pages.searchTable.nameStatus.online" defaultMessage="Online" />
-          ),
-          status: 'Success',
-        },
-        3: {
-          text: (
-            <FormattedMessage
-              id="pages.searchTable.nameStatus.abnormal"
-              defaultMessage="Abnormal"
-            />
-          ),
-          status: 'Error',
-        },
-      },
-    },
-    {
-      title: (
-        <FormattedMessage
-          id="pages.searchTable.titleUpdatedAt"
-          defaultMessage="Last scheduled time"
-        />
-      ),
-      sorter: true,
-      dataIndex: 'updatedAt',
-      valueType: 'dateTime',
-      renderFormItem: (item, { defaultRender, ...rest }, form) => {
-        const status = form.getFieldValue('status');
-
-        if (`${status}` === '0') {
-          return false;
-        }
-
-        if (`${status}` === '3') {
-          return (
-            <Input
-              {...rest}
-              placeholder={intl.formatMessage({
-                id: 'pages.searchTable.exception',
-                defaultMessage: 'Please enter the reason for the exception!',
-              })}
-            />
-          );
-        }
-
-        return defaultRender(item);
-      },
-    },
-    {
-      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
-      dataIndex: 'option',
-      valueType: 'option',
-      render: (_, record) => [
-        <a
-          key="config"
-          onClick={() => {
-            handleUpdateModalVisible(true);
-            setCurrentRow(record);
-          }}
-        >
-          <FormattedMessage id="pages.searchTable.config" defaultMessage="Configuration" />
-        </a>,
-        <a key="subscribeAlert" href="https://procomponents.ant.design/">
-          <FormattedMessage
-            id="pages.searchTable.subscribeAlert"
-            defaultMessage="Subscribe to alerts"
-          />
-        </a>,
-      ],
-    },
-  ];
-  return (
-    <PageContainer>
-      <ProTable
-        headerTitle={intl.formatMessage({
-          id: 'pages.searchTable.title',
-          defaultMessage: 'Enquiry form',
-        })}
-        actionRef={actionRef}
-        rowKey="key"
-        search={{
-          labelWidth: 120,
-        }}
-        toolBarRender={() => [
-          <Button
-            type="primary"
-            key="primary"
-            onClick={() => {
-              handleModalVisible(true);
-            }}
-          >
-            <PlusOutlined /> <FormattedMessage id="pages.searchTable.new" defaultMessage="New" />
-          </Button>,
-        ]}
-        request={rule}
-        columns={columns}
-        rowSelection={{
-          onChange: (_, selectedRows) => {
-            setSelectedRows(selectedRows);
-          },
-        }}
-      />
-      {selectedRowsState?.length > 0 && (
-        <FooterToolbar
-          extra={
-            <div>
-              <FormattedMessage id="pages.searchTable.chosen" defaultMessage="Chosen" />{' '}
-              <a
-                style={{
-                  fontWeight: 600,
-                }}
-              >
-                {selectedRowsState.length}
-              </a>{' '}
-              <FormattedMessage id="pages.searchTable.item" defaultMessage="项" />
-              &nbsp;&nbsp;
-              <span>
-                <FormattedMessage
-                  id="pages.searchTable.totalServiceCalls"
-                  defaultMessage="Total number of service calls"
-                />{' '}
-                {selectedRowsState.reduce((pre, item) => pre + item.callNo, 0)}{' '}
-                <FormattedMessage id="pages.searchTable.tenThousand" defaultMessage="万" />
-              </span>
-            </div>
-          }
-        >
-          <Button
-            onClick={async () => {
-              await handleRemove(selectedRowsState);
-              setSelectedRows([]);
-              actionRef.current?.reloadAndRest?.();
-            }}
-          >
-            <FormattedMessage
-              id="pages.searchTable.batchDeletion"
-              defaultMessage="Batch deletion"
-            />
-          </Button>
-          <Button type="primary">
-            <FormattedMessage
-              id="pages.searchTable.batchApproval"
-              defaultMessage="Batch approval"
-            />
-          </Button>
-        </FooterToolbar>
-      )}
-      <ModalForm
-        title={intl.formatMessage({
-          id: 'pages.searchTable.createForm.newRule',
-          defaultMessage: 'New rule',
-        })}
-        width="400px"
-        visible={createModalVisible}
-        onVisibleChange={handleModalVisible}
-        onFinish={async (value) => {
-          const success = await handleAdd(value);
-
-          if (success) {
-            handleModalVisible(false);
-
-            if (actionRef.current) {
-              actionRef.current.reload();
-            }
-          }
-        }}
-      >
-        <ProFormText
-          label="查询选择器 - valueEnum"
-          rules={[
-            {
-              required: true,
-              message: (
-                <FormattedMessage
-                  id="pages.searchTable.ruleName"
-                  defaultMessage="Rule name is required"
-                />
-              ),
-            },
-          ]}
-          width="md"
-          name="name"
-        />
-        <ProFormTextArea width="md" name="desc" />
-      </ModalForm>
-      <UpdateForm
-        onSubmit={async (value) => {
-          const success = await handleUpdate(value);
-
-          if (success) {
-            handleUpdateModalVisible(false);
-            setCurrentRow(undefined);
-
-            if (actionRef.current) {
-              actionRef.current.reload();
-            }
-          }
-        }}
-        onCancel={() => {
-          handleUpdateModalVisible(false);
-          setCurrentRow(undefined);
-        }}
-        updateModalVisible={updateModalVisible}
-        values={currentRow || {}}
-      />
-
-      <Drawer
-        width={600}
-        visible={showDetail}
-        onClose={() => {
-          setCurrentRow(undefined);
-          setShowDetail(false);
-        }}
-        closable={false}
-      >
-        {currentRow?.name && (
-          <ProDescriptions
-            column={2}
-            title={currentRow?.name}
-            request={async () => ({
-              data: currentRow || {},
-            })}
-            params={{
-              id: currentRow?.name,
-            }}
-            columns={columns}
-          />
-        )}
-      </Drawer>
-    </PageContainer>
-  );
-};
-
-export default TableList;

+ 11 - 23
src/pages/UserMana/index.js

@@ -1,17 +1,17 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-02 18:57:24
+ * @LastEditTime: 2021-08-03 17:44:32
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
  */
 
 import { PlusOutlined } from '@ant-design/icons';
-import { Button, Popconfirm, message, Input, Modal } from 'antd';
-import React, { useState, useRef, useEffect } from 'react';
-import { useIntl, FormattedMessage,useModel } from 'umi';
-import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+import { Button, Popconfirm} from 'antd';
+import React, { useState, useRef} from 'react';
+import { useModel } from 'umi';
+import { PageContainer } from '@ant-design/pro-layout';
 import ProTable from '@ant-design/pro-table';
 import { ModalForm, ProFormText, ProFormSelect } from '@ant-design/pro-form';
 import UpdateForm from './updateForm';
@@ -25,13 +25,11 @@ const UserMana = () => {
       dataIndex: 'id',
       key: 'id',
       hideInSearch: true,
-      render: (text) => <a>{text}</a>,
     },
     {
       title: '姓名',
       dataIndex: 'name',
       key: 'name',
-      render: (text) => <a>{text}</a>,
     },
     {
       title: '用户名',
@@ -44,10 +42,10 @@ const UserMana = () => {
       dataIndex: 'hospitalStatus',
       key: 'hospitalStatus',
       hideInSearch: true,
-      render: (text) => <a>{text == 1 ? '在职' : '离职'}</a>,
+      render: (text) => <>{text == 1 ? '在职' : '离职'}</>,
     },
     {
-      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      title:'操作',
       dataIndex: 'option',
       valueType: 'option',
       render: (_, record) => [
@@ -55,7 +53,6 @@ const UserMana = () => {
           key="config"
           onClick={() => {
             handleUpdateModalVisible(true);
-            console.log({ record });
             setCurrentRow(record);
           }}
         >
@@ -83,7 +80,7 @@ const UserMana = () => {
   const {currentUser:{token}} = initialState;
   // const [shareParamsSetting,setShareParamsSetting] = useState(false);  //是否分摊参数设置
 
-  console.log({initialState});
+
   
   /**
    *
@@ -119,11 +116,8 @@ const UserMana = () => {
   //自定义上传回调
   const customRequestCallback = async (formData)=>{
     const resp = await importExcel({formData},{
-      // 'content-type': 'application/json'
       'content-type':'multipart/form-data',
     })
-
-
     const {status} = resp;
     if(status==200){
       if (actionRef.current) {
@@ -191,9 +185,7 @@ const UserMana = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.ruleName" defaultMessage="人员名是必填项" />
-              ),
+              message:'人员名是必填项',
             },
           ]}
           width="sm"
@@ -204,9 +196,7 @@ const UserMana = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.ruleName" defaultMessage="账户名是必填项" />
-              ),
+              message:'账户名是必填项',
             },
           ]}
           width="sm"
@@ -217,9 +207,7 @@ const UserMana = () => {
           rules={[
             {
               required: false,
-              message: (
-                <FormattedMessage id="pages.searchTable.password" defaultMessage="" />
-              ),
+              message:'',
             },
           ]}
           width="sm"

+ 10 - 41
src/pages/accountingSubject/index.jsx

@@ -1,24 +1,22 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-02 09:14:31
+ * @LastEditTime: 2021-08-03 16:55:26
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
  */
 
 import { PlusOutlined } from '@ant-design/icons';
-import { Button, Popconfirm, Table, Space, Cascader } from 'antd';
+import { Button, Popconfirm} from 'antd';
 import React, { useState, useRef, useEffect } from 'react';
-import { useIntl, FormattedMessage } from 'umi';
-import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+
+import { PageContainer} from '@ant-design/pro-layout';
 import ProTable from '@ant-design/pro-table';
-import ProForm, { ModalForm, ProFormText, ProFormSelect, ProFormDependency, LightFilter, ProFormDatePicker } from '@ant-design/pro-form';
+import { ModalForm, ProFormText, ProFormSelect} from '@ant-design/pro-form';
 import UpdateForm from './updateForm';
-// import CAUpload from '@/components/CAUpload';
 import { getAccountingSubjectList, editAccountingSubjectList, delAccountingSubject, addAccountingSubject, getAccountingSubjectForSelecter } from './service';
-import { idText } from 'typescript';
-// import { getApportionmentLevelListNoPage } from '../apportionmentLevel/service';
+
 
 
 
@@ -48,7 +46,7 @@ const AccountingSubject = () => {
       width: '20%'
     },
     {
-      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      title:'操作',
       dataIndex: 'option',
       valueType: 'option',
       key: 'option',
@@ -339,9 +337,7 @@ const AccountingSubject = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.accountingCode" defaultMessage="会计科目编码是必填项" />
-              ),
+              message:'会计科目编码是必填项',
             },
           ]}
           width="sm"
@@ -352,44 +348,17 @@ const AccountingSubject = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.accountingName" defaultMessage="会计科目名是必填项" />
-              ),
+              message:'会计科目名是必填项',
             },
           ]}
           width="sm"
           name="accountingName"
         />
-        {/* <ProFormSelect
-          rules={[
-            {
-              required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.accountingType" defaultMessage="请选择会计科目类型" />
-              ),
-            },
-          ]}
-          options={[
-            {
-              value: 1,
-              label: '收入',
-            },
-            {
-              value: 2,
-              label: '支出',
-            },
-          ]}
-          width="sm"
-          name="accountingType"
-          label="会计科目类型"
-        /> */}
         <ProFormSelect
           rules={[
             {
               required: false,
-              message: (
-                <FormattedMessage id="pages.searchTable.isBaseCode" defaultMessage="请选择" />
-              ),
+              message:'',
             },
           ]}
           options={[

+ 4 - 14
src/pages/accountingSubject/updateForm.jsx

@@ -1,19 +1,13 @@
-import React, { useState } from 'react';
+import React from 'react';
 import {
-  ProFormSelect,
   ProFormText,
-  ModalForm,
-  ProFormDependency
+  ModalForm
 } from '@ant-design/pro-form';
-import { useIntl, FormattedMessage } from 'umi';
 
-import { getApportionmentLevelListNoPage } from '../apportionmentLevel/service';
 
 
 const UpdateForm = (props) => {
   const { updateModalVisible, updateModalVisibleChange, values, onSubmit } = props;
-  const [selectedLevelList, setSelectedLevelList] = useState(null); //可选的分摊层级列表
-  const [selectedLevel, setSelectedLevel] = useState(null);
   // console.log({values});
   return (
     <>
@@ -33,9 +27,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.accountingCode" defaultMessage="会计科目编码是必填项" />
-                ),
+                message:'会计科目编码是必填项',
               },
             ]}
             width="sm"
@@ -46,9 +38,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.accountingName" defaultMessage="会计科目名是必填项" />
-                ),
+                message:'会计科目名是必填项',
               },
             ]}
             width="sm"

+ 9 - 11
src/pages/accountingSubjectConnect/index.jsx

@@ -1,21 +1,19 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-01 14:01:23
+ * @LastEditTime: 2021-08-03 16:58:29
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
  */
 
-import { PlusOutlined } from '@ant-design/icons';
-import { Button, Space, Table, Tag,Tooltip } from 'antd';
-import React, { useState, useRef, useEffect } from 'react';
-import { useIntl, FormattedMessage } from 'umi';
-import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+
+import { Space, Table, Tag } from 'antd';
+import React, { useState, useRef } from 'react';
+import { PageContainer } from '@ant-design/pro-layout';
 import ProTable from '@ant-design/pro-table';
-import { DrawerForm, formRef } from '@ant-design/pro-form';
-import UpdateForm from './updateForm';
-// import CAUpload from '@/components/CAUpload';
+import { DrawerForm } from '@ant-design/pro-form';
+
 import { getAccountProductConnectList,getAccountProductConnectableList,saveAccountProductConnected } from './service';
 
 const ResponsibilityCenterConnect = () => {
@@ -49,7 +47,7 @@ const ResponsibilityCenterConnect = () => {
       }
     },
     {
-      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      title:'操作',
       dataIndex: 'option',
       key: 'option',
       valueType: 'option',
@@ -170,7 +168,7 @@ const ResponsibilityCenterConnect = () => {
         onVisibleChange={(visible) => drawerVisibleChange(visible)}
         // onFinish={(value) => onSubmit({ ...values, ...value })}
         onFinish={async ()=>{
-             console.log({selectedRowKeys,currentRow});
+            //  console.log({selectedRowKeys,currentRow});
              const {id} = currentRow;
              const resp = await saveAccountProductConnected({id,products:selectedRowKeys});
              const {status} = resp;

+ 7 - 17
src/pages/accountingSubjectConnect/updateForm.jsx

@@ -5,7 +5,7 @@ import {
   ModalForm,
   ProFormDependency
 } from '@ant-design/pro-form';
-import { useIntl, FormattedMessage } from 'umi';
+
 
 
 const UpdateForm = (props) => {
@@ -15,7 +15,7 @@ const UpdateForm = (props) => {
     <>
       {
         JSON.stringify(values) !== '{}' && <ModalForm
-          title="编辑医院"
+          title="编辑"
           width="800px"
           initialValues={{ ...values }}
           labelCol={{ span: 5, offset: 3 }}
@@ -29,9 +29,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.responsibilityName" defaultMessage="医院名是必填项" />
-                ),
+                message:'医院名是必填项',
               },
             ]}
             width="sm"
@@ -41,9 +39,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.isGatherCenter" defaultMessage="请选择是否为汇总中心" />
-                ),
+                message:'请选择是否为汇总中心',
               },
             ]}
             options={[
@@ -64,9 +60,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.responsibilityType" defaultMessage="请选择责任类型" />
-                ),
+                message:'请选择责任类型',
               },
             ]}
             options={[
@@ -87,9 +81,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.shareLevel" defaultMessage="请选择分摊级别" />
-                ),
+                message:'请选择分摊级别',
               },
             ]}
             options={[
@@ -116,9 +108,7 @@ const UpdateForm = (props) => {
                   rules={[
                     {
                       required: false,
-                      message: (
-                        <FormattedMessage id="pages.searchTable.parentName" defaultMessage="..." />
-                      ),
+                      message:'',
                     },
                   ]}
                   width="sm"

+ 10 - 19
src/pages/apportionmentLevel/index.jsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-07-30 15:21:27
+ * @LastEditTime: 2021-08-03 17:05:02
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
@@ -9,13 +9,12 @@
 
 import { PlusOutlined } from '@ant-design/icons';
 import { Button, Popconfirm, Table, Space } from 'antd';
-import React, { useState, useRef, useEffect } from 'react';
-import { useIntl, FormattedMessage } from 'umi';
-import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+import React, { useState, useRef } from 'react';
+import { PageContainer } from '@ant-design/pro-layout';
 import ProTable from '@ant-design/pro-table';
 import { ModalForm, ProFormText, ProFormSelect, ProFormDigit } from '@ant-design/pro-form';
 import UpdateForm from './updateForm';
-// import CAUpload from '@/components/CAUpload';
+
 import { getApportionmentLevelList, editApportionmentLevelList, delApportionmentLevel, addApportionmentLevel } from './service';
 
 const ApportionmentLevel = () => {
@@ -47,7 +46,7 @@ const ApportionmentLevel = () => {
       render: (text) =><>{text == 0 ? '合并计算' : '分开计算'}</>,
     },
     {
-      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      title:'操作',
       dataIndex: 'option',
       valueType: 'option',
       render: (_, record) => [
@@ -188,9 +187,7 @@ const ApportionmentLevel = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.leverSort" defaultMessage="分摊层级序号是必填项" />
-              ),
+              message:'分摊层级序号是必填项',
             },
           ]}
           width="sm"
@@ -203,9 +200,7 @@ const ApportionmentLevel = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.shareName" defaultMessage="分摊层级名是必填项" />
-              ),
+              message:'分摊层级名是必填项',
             },
           ]}
           width="sm"
@@ -216,9 +211,7 @@ const ApportionmentLevel = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.targetLevel" defaultMessage="目标层级是必填项" />
-              ),
+              message:'目标层级是必填项',
             },
           ]}
           min={1} max={100}
@@ -229,9 +222,7 @@ const ApportionmentLevel = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.calcType" defaultMessage="请选择计算方式" />
-              ),
+              message:'请选择计算方式',
             },
           ]}
           options={[
@@ -254,7 +245,7 @@ const ApportionmentLevel = () => {
       {/* 更新 */}
       <UpdateForm
         onSubmit={async (value) => {
-          console.log({ '编辑': value });
+          // console.log({ '编辑': value });
           const success = await editApportionmentLevelList(value);
 
           if (success) {

+ 5 - 15
src/pages/apportionmentLevel/updateForm.jsx

@@ -2,10 +2,8 @@ import React from 'react';
 import {
   ProFormSelect,
   ProFormText,
-  ModalForm,
-  ProFormDependency
+  ModalForm
 } from '@ant-design/pro-form';
-import { useIntl, FormattedMessage } from 'umi';
 
 
 const UpdateForm = (props) => {
@@ -29,9 +27,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.leverSort" defaultMessage="分摊层级序号是必填项" />
-                ),
+                message:'分摊层级序号是必填项',
               },
             ]}
             width="sm"
@@ -43,9 +39,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.shareName" defaultMessage="分摊层级名是必填项" />
-                ),
+                message:'分摊层级名是必填项',
               },
             ]}
             width="sm"
@@ -56,9 +50,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.targetLevel" defaultMessage="目标层级是必填项" />
-                ),
+                message:'目标层级是必填项',
               },
             ]}
             width="sm"
@@ -68,9 +60,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.calcType" defaultMessage="请选择计算方式" />
-                ),
+                message:'请选择计算方式',
               },
             ]}
             options={[

+ 26 - 13
src/pages/costAllocationParamsConnect/index.jsx

@@ -1,17 +1,16 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-07-30 19:55:25
+ * @LastEditTime: 2021-08-03 17:10:11
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
  */
 
 import { PlusOutlined } from '@ant-design/icons';
-import { Button, Popconfirm, Cascader,Modal } from 'antd';
+import { Button, Popconfirm, Cascader} from 'antd';
 import React, { useState, useRef, useEffect } from 'react';
-import { useIntl, FormattedMessage } from 'umi';
-import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+import { PageContainer} from '@ant-design/pro-layout';
 import ProTable from '@ant-design/pro-table';
 import ProForm, { ModalForm, DrawerForm, ProFormSelect, ProFormTextArea, ProFormDigit } from '@ant-design/pro-form';
 import UpdateForm from './updateForm';
@@ -22,7 +21,7 @@ import {
   addCostshareparamConnect, getResponsibilityCenterSelecterList, getAccountingSubjectForSelecter,
   getHasSetParamsList, getParamsSelectableList, saveParamsList
 } from './service';
-import { set } from 'lodash-es';
+
 
 const DepartmentMana = () => {
   const columns = [
@@ -64,7 +63,7 @@ const DepartmentMana = () => {
       hideInSearch: true,
     },
     {
-      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      title:'操作',
       dataIndex: 'option',
       valueType: 'option',
       render: (_, record) => [
@@ -122,7 +121,7 @@ const DepartmentMana = () => {
       hideInSearch: false,
     },
     {
-      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      title:'操作',
       dataIndex: 'option',
       valueType: 'option',
       render: (_, record) => [
@@ -211,6 +210,10 @@ const DepartmentMana = () => {
     }
   };
 
+  /**
+   * 
+   * @param {Object} record 表格行数据
+   */
   const delParamsListHandler = (record)=>{
       const {id} = record;
       const arr = hasSetParamsList;
@@ -222,10 +225,19 @@ const DepartmentMana = () => {
   }
 
   //级联回调
+
+  /**
+   * 
+   * @param {Object} value 
+   */
   const cascaderChangeHandle = (value) => {
     setSelectedCascader(value[value.length - 1]);
   }
   //分摊参数回调
+  /**
+   * 
+   * @param {Boolean} bool 
+   */
   const drawerVisibleChange = async (bool) => {
     // console.log({currentRow});
     if (bool) {
@@ -244,7 +256,12 @@ const DepartmentMana = () => {
     }
     setDrawerVisible(bool);
   }
+  
 
+  /**
+   * 
+   * @param {Boolean} bool 
+   */
   const handleDrawerModalVisible = (bool) => {
     setDrawerMadalVisible(bool);
   }
@@ -320,9 +337,7 @@ const DepartmentMana = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.accountingType" defaultMessage="请选择责任中心" />
-              ),
+              message:'请选择责任中心',
             },
           ]}
           fieldProps={{//这里使用了select的onChange方法,必须使用这样的写法来进行调用onChange方法
@@ -461,9 +476,7 @@ const DepartmentMana = () => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.accountingType" defaultMessage="请选择责任中心" />
-                ),
+                message:'请选择责任中心',
               },
             ]}
 

+ 8 - 16
src/pages/costAllocationParamsConnect/updateForm.jsx

@@ -1,12 +1,11 @@
 import React, { useState,useEffect} from 'react';
 import { Cascader,Form } from 'antd';
-import ProForm, {
+import {
   ProFormSelect,
-  ProFormText,
   ModalForm,
   ProFormTextArea
 } from '@ant-design/pro-form';
-import { useIntl, FormattedMessage } from 'umi';
+
 
 import {
   getResponsibilityCenterSelecterList
@@ -16,7 +15,7 @@ import {
 const UpdateForm = (props) => {
   const { cascaderOptions, cascaderChangeHandle, values: record ,updateModalVisible, updateModalVisibleChange,onSubmit} = props;
   const { accountingId,responsibilityId } = record;
-  const [selectedCascader, setSelectedCascader] = useState(null);
+
   const [ifDisable, setIfDisable] = useState(false);
   const [selectedResponsibilityId, setSelectedResponsibilityId] = useState(null);
 
@@ -27,10 +26,8 @@ const UpdateForm = (props) => {
     const { data, msg, status } = resp;
     if (status == 200) {
       const selected = data.filter(item =>{
-          // console.log({item});
           return item.responsibilityId == responsibilityId
       });
-      // console.log({selected,data});
       if (selected&&selected.length>0&&selected[0].calcType == 0) {
         setIfDisable(true);
       } else {
@@ -56,19 +53,17 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.responsibilityId" defaultMessage="请选择责任中心" />
-                ),
+                message:'请选择责任中心',
               },
             ]}
             fieldProps={{//这里使用了select的onChange方法,必须使用这样的写法来进行调用onChange方法
               onChange: async (val) => {
                 setSelectedResponsibilityId(val);
                 const resp = await getResponsibilityCenterSelecterList();
-                const { data, msg, status } = resp;
+                const { data,status } = resp;
                 if (status == 200) {
                   const selected = data.filter(item => item.id == val);
-                  console.log({val,selected});
+       
                   if (selected && selected[0].calcType == 0) {
                     setIfDisable(true);
                   } else {
@@ -79,7 +74,7 @@ const UpdateForm = (props) => {
             }}
             request={async () => {
               const resp = await getResponsibilityCenterSelecterList();
-              const { data, msg, status } = resp;
+              const { data,status } = resp;
               if (status == 200) {
                 return data.map(item => ({
                   label: item.responsibilityName,
@@ -95,10 +90,7 @@ const UpdateForm = (props) => {
                 <Cascader disabled={ifDisable} options={cascaderOptions}    placeholder="请选择成本科目" onChange={cascaderChangeHandle} />
 
           </Form.Item>
-          {/* <ProForm.Group style={{ marginBottom: 20 }}>
-            <div style={{ marginLeft: 115 }}>请选择成本科目:</div>
-            <Cascader defaultValue={accountingId} disabled={ifDisable} options={cascaderOptions} onChange={cascaderChangeHandle} placeholder="请选择成本科目" />
-          </ProForm.Group> */}
+  
 
           <ProFormTextArea
             name="costNode"

+ 7 - 33
src/pages/costAllocationParamsConnect/updateForm_drawer.js

@@ -1,26 +1,22 @@
 /*
  * @Author: your name
  * @Date: 2021-07-30 18:09:25
- * @LastEditTime: 2021-08-01 14:07:20
+ * @LastEditTime: 2021-08-03 17:12:06
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/costAllocationParamsConnect/updateForm_drawer.js
  */
 
-import React, { useState, useEffect } from 'react';
-import { Cascader, Form } from 'antd';
-import ProForm, {
+import React, { useState} from 'react';
+import {
   ProFormSelect,
-  ProFormText,
   ModalForm,
   ProFormDigit,
 } from '@ant-design/pro-form';
-import { useIntl, FormattedMessage } from 'umi';
+
 
 import {
-    getCostshareparamConnectList, editCostshareparamConnectList, delCostshareparamConnect,
-    addCostshareparamConnect, getResponsibilityCenterSelecterList, getAccountingSubjectForSelecter,
-    getHasSetParamsList, getParamsSelectableList,saveParamsList
+    getParamsSelectableList
   } from './service';
 
 const UpdateFormDrawer = (props) => {
@@ -31,26 +27,9 @@ const UpdateFormDrawer = (props) => {
     currentResponsibilityRow,
     onSubmit,
   } = props;
-  const { accountingId, responsibilityId } = record;
-  const [ifDisable, setIfDisable] = useState(false);
+
   const [selectedParam, setSelectedParam] = useState(null);
-//   console.log({record})
 
-//   useEffect(async () => {
-//     const resp = await getResponsibilityCenterSelecterList();
-//     const { data, msg, status } = resp;
-//     if (status == 200) {
-//       const selected = data.filter((item) => {
-//         return item.responsibilityId == responsibilityId;
-//       });
-//     //   console.log({ selected, data });
-//       if (selected && selected.length > 0 && selected[0].calcType == 0) {
-//         setIfDisable(true);
-//       } else {
-//         setIfDisable(false);
-//       }
-//     }
-//   }, [record]);
 
   return (
     <>
@@ -69,12 +48,7 @@ const UpdateFormDrawer = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage
-                    id="pages.searchTable.accountingType"
-                    defaultMessage=""
-                  />
-                ),
+                message:'',
               },
             ]}
             fieldProps={{

+ 20 - 25
src/pages/costAllocationParamsSetting/index.jsx

@@ -1,22 +1,22 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-02 02:09:05
+ * @LastEditTime: 2021-08-03 17:17:27
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
  */
 
 import { PlusOutlined } from '@ant-design/icons';
-import { Button, Popconfirm, message, Space, Drawer,Table } from 'antd';
-import React, { useState, useRef, useEffect } from 'react';
-import { useIntl, FormattedMessage } from 'umi';
-import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+import { Button, Popconfirm, Space,Table } from 'antd';
+import React, { useState, useRef } from 'react';
+
+import { PageContainer } from '@ant-design/pro-layout';
 import ProTable from '@ant-design/pro-table';
 import { ModalForm, ProFormText, ProFormSelect,DrawerForm,ProFormDigit} from '@ant-design/pro-form';
 import UpdateForm from './updateForm';
 import UpdateFormDrawer from './updateForm_drawer';
-// import CAUpload from '@/components/CAUpload';
+
 import { getCostshareparamList, editCostshareparamList, delCostshareparam, addCostshareparam,updateCostShareParamByAccountId } from './service';
 import { getAccountingSubjectList} from '../accountingSubject/service';
 
@@ -43,7 +43,7 @@ const DepartmentMana = () => {
       render: (text) => <>{text == 1 ? '手动填写' : '按对应会计科目计算'}</>,
     },
     {
-      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      title:'操作',
       dataIndex: 'option',
       valueType: 'option',
       render: (_, record) =>{
@@ -173,7 +173,12 @@ const DepartmentMana = () => {
     const handleDrawerModalVisible = (bool) => {
       setDrawerMadalVisible(bool);
     }
+    
 
+    /**
+     * 
+     * @param {Number} key 
+     */
     const onTabChange = (key)=>{
       setAccountType(Number(key));
       if (actionDrawertableRef.current) {
@@ -239,9 +244,7 @@ const DepartmentMana = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.shareParamName" defaultMessage="成本分摊参数名是必填项" />
-              ),
+              message:'成本分摊参数名是必填项',
             },
           ]}
           width="sm"
@@ -252,9 +255,7 @@ const DepartmentMana = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.shareParamCode" defaultMessage="成本分摊参数编号是必填项" />
-              ),
+              message:'成本分摊参数编号是必填项',
             },
           ]}
           width="sm"
@@ -264,9 +265,7 @@ const DepartmentMana = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.accountingType" defaultMessage="请选择计算方式" />
-              ),
+              message:'请选择计算方式',
             },
           ]}
           options={[
@@ -296,7 +295,7 @@ const DepartmentMana = () => {
         onFinish={async () => {
 
           const {id} = currentResponsibilityRow;
-          console.log({selectedRowKeys,currentResponsibilityRow});
+          // console.log({selectedRowKeys,currentResponsibilityRow});
           const resp = await updateCostShareParamByAccountId({costShareParamId:id,accountIds:selectedRowKeys});
           const {status} = resp;
           setDrawerVisible(false);
@@ -326,7 +325,6 @@ const DepartmentMana = () => {
         >
         <ProTable
           columns={drawerTableColumns}
-          // request={[]}
           rowKey="id"
           actionRef={actionDrawertableRef}
           rowSelection={{
@@ -385,7 +383,7 @@ const DepartmentMana = () => {
           }}
 
           onFinish={async (value) => {
-            console.log({ '新增分摊参数': value, selectedParam,hasSetParamsList});
+            // console.log({ '新增分摊参数': value, selectedParam,hasSetParamsList});
             const { shareParamPopout } = value;
             const { id, shareParamCode, shareParamName } = selectedParam;
 
@@ -408,9 +406,7 @@ const DepartmentMana = () => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.accountingType" defaultMessage="请选择责任中心" />
-                ),
+                message:'请选择责任中心',
               },
             ]}
 
@@ -421,7 +417,6 @@ const DepartmentMana = () => {
                 // console.log({currentResponsibilityRow});
                 const resp = await getParamsSelectableList({ id });
                 const { data, status } = resp;
-                console.log({resp});
                 if (status == 200) {
                   const selected = data.list.filter(item => item.id == val);
                   console.log({ selected });
@@ -434,7 +429,7 @@ const DepartmentMana = () => {
               const { id } = currentResponsibilityRow;
               const resp = await getParamsSelectableList({ id });
               const { data, status } = resp;
-              console.log({ resp });
+
               if (status == 200) {
                 const temp = data.list.map(item => ({
                   label: item.shareParamName,
@@ -461,7 +456,7 @@ const DepartmentMana = () => {
                const index = hasSetParamsList.findIndex(item=>item.id == id);
                const temp = hasSetParamsList;
                temp[index] = value;
-               console.log({value,temp});
+
                setHasSetParamsList([].concat(temp));
                setDrawerUpdateModalVisible(false);
                if (actionDrawertableRef.current) {

+ 5 - 10
src/pages/costAllocationParamsSetting/updateForm.jsx

@@ -1,16 +1,15 @@
 import React from 'react';
-import { Modal } from 'antd';
+
 import {
-  ProFormSelect,
   ProFormText,
   ModalForm,
 } from '@ant-design/pro-form';
-import { useIntl, FormattedMessage } from 'umi';
+
 
 
 const UpdateForm = (props) => {
   const { updateModalVisible, updateModalVisibleChange, values, onSubmit } = props;
-  // console.log({values});
+
   return (
     <>
       {
@@ -29,9 +28,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.shareParamName" defaultMessage="成本分摊参数名是必填项" />
-                ),
+                message:'成本分摊参数名是必填项',
               },
             ]}
             width="sm"
@@ -42,9 +39,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.shareParamCode" defaultMessage="成本分摊参数编号是必填项" />
-                ),
+                message:'成本分摊参数编号是必填项',
               },
             ]}
             width="sm"

+ 7 - 34
src/pages/costAllocationParamsSetting/updateForm_drawer.js

@@ -1,26 +1,22 @@
 /*
  * @Author: your name
  * @Date: 2021-07-30 18:09:25
- * @LastEditTime: 2021-08-01 14:07:20
+ * @LastEditTime: 2021-08-03 17:18:46
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/costAllocationParamsConnect/updateForm_drawer.js
  */
 
-import React, { useState, useEffect } from 'react';
-import { Cascader, Form } from 'antd';
-import ProForm, {
+import React, { useState } from 'react';
+import {
   ProFormSelect,
-  ProFormText,
   ModalForm,
   ProFormDigit,
 } from '@ant-design/pro-form';
-import { useIntl, FormattedMessage } from 'umi';
+
 
 import {
-    getCostshareparamConnectList, editCostshareparamConnectList, delCostshareparamConnect,
-    addCostshareparamConnect, getResponsibilityCenterSelecterList, getAccountingSubjectForSelecter,
-    getHasSetParamsList, getParamsSelectableList,saveParamsList
+    getParamsSelectableList
   } from './service';
 
 const UpdateFormDrawer = (props) => {
@@ -31,26 +27,9 @@ const UpdateFormDrawer = (props) => {
     currentResponsibilityRow,
     onSubmit,
   } = props;
-  const { accountingId, responsibilityId } = record;
-  const [ifDisable, setIfDisable] = useState(false);
+
   const [selectedParam, setSelectedParam] = useState(null);
-//   console.log({record})
 
-//   useEffect(async () => {
-//     const resp = await getResponsibilityCenterSelecterList();
-//     const { data, msg, status } = resp;
-//     if (status == 200) {
-//       const selected = data.filter((item) => {
-//         return item.responsibilityId == responsibilityId;
-//       });
-//     //   console.log({ selected, data });
-//       if (selected && selected.length > 0 && selected[0].calcType == 0) {
-//         setIfDisable(true);
-//       } else {
-//         setIfDisable(false);
-//       }
-//     }
-//   }, [record]);
 
   return (
     <>
@@ -69,12 +48,7 @@ const UpdateFormDrawer = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage
-                    id="pages.searchTable.accountingType"
-                    defaultMessage=""
-                  />
-                ),
+                message:'',
               },
             ]}
             fieldProps={{
@@ -86,7 +60,6 @@ const UpdateFormDrawer = (props) => {
                 const { data, status } = resp;
                 if (status == 200) {
                   const selected = data.list.filter((item) => item.id == val);
-                  console.log({ selected });
                   setSelectedParam(selected[0]);
                 }
               },

+ 14 - 14
src/pages/costProjectMana/index.jsx

@@ -1,19 +1,19 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-02 19:00:33
+ * @LastEditTime: 2021-08-03 17:22:00
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
  */
 
 import { PlusOutlined } from '@ant-design/icons';
-import { Button, Popconfirm, Cascader } from 'antd';
-import React, { useState, useRef, useEffect } from 'react';
-import { useIntl, FormattedMessage,useModel } from 'umi';
-import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+import { Button, Popconfirm} from 'antd';
+import React, { useState, useRef} from 'react';
+import { useModel } from 'umi';
+import { PageContainer } from '@ant-design/pro-layout';
 import ProTable from '@ant-design/pro-table';
-import ProForm, { ModalForm, ProFormText, ProFormSelect, ProFormTextArea } from '@ant-design/pro-form';
+import { ModalForm, ProFormText} from '@ant-design/pro-form';
 import UpdateForm from './updateForm';
 import CAUpload from '@/components/CAUpload';
 import {
@@ -43,7 +43,7 @@ const DepartmentMana = () => {
       hideInSearch: false,
     },
     {
-      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      title:'操作',
       dataIndex: 'option',
       valueType: 'option',
       render: (_, record) => [
@@ -113,9 +113,13 @@ const DepartmentMana = () => {
   };
 
   //自定义上传回调
+
+  /**
+   * 
+   * @param {FormData} formData 
+   */
   const customRequestCallback = async (formData)=>{
     const resp = await importExcel({formData},{
-      // 'content-type': 'application/json'
       'content-type':'multipart/form-data',
     })
     const {status} = resp;
@@ -194,9 +198,7 @@ const DepartmentMana = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.productCode" defaultMessage="成本项目编码是必填项" />
-              ),
+              message:'成本项目编码是必填项',
             },
           ]}
           width="sm"
@@ -207,9 +209,7 @@ const DepartmentMana = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.productName" defaultMessage="成本项目名是必填项" />
-              ),
+              message:'成本项目名是必填项',
             },
           ]}
           width="sm"

+ 4 - 10
src/pages/costProjectMana/updateForm.jsx

@@ -1,16 +1,14 @@
 import React from 'react';
-import { Modal } from 'antd';
+
 import {
-  ProFormSelect,
   ProFormText,
   ModalForm,
 } from '@ant-design/pro-form';
-import { useIntl, FormattedMessage } from 'umi';
+
 
 
 const UpdateForm = (props) => {
   const { updateModalVisible, updateModalVisibleChange, values, onSubmit } = props;
-  // console.log({values});
   return (
     <>
       {
@@ -29,9 +27,7 @@ const UpdateForm = (props) => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.productCode" defaultMessage="成本项目编码是必填项" />
-              ),
+              message:'成本项目编码是必填项',
             },
           ]}
           width="sm"
@@ -42,9 +38,7 @@ const UpdateForm = (props) => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.productName" defaultMessage="成本项目名是必填项" />
-              ),
+              message:'成本项目名是必填项',
             },
           ]}
           width="sm"

+ 11 - 20
src/pages/districtMana/index.jsx

@@ -1,22 +1,21 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-07-30 10:25:05
+ * @LastEditTime: 2021-08-03 17:28:08
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
  */
 
 import { PlusOutlined } from '@ant-design/icons';
-import { Button, Popconfirm, Table, Space } from 'antd';
-import React, { useState, useRef, useEffect } from 'react';
-import { useIntl, FormattedMessage } from 'umi';
-import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+import { Button, Popconfirm} from 'antd';
+import React, { useState, useRef } from 'react';
+
+import { PageContainer} from '@ant-design/pro-layout';
 import ProTable from '@ant-design/pro-table';
 import { ModalForm, ProFormText, ProFormSelect, ProFormDependency } from '@ant-design/pro-form';
 import UpdateForm from './updateForm';
-import { CARequest } from '../../utils';
-// import CAUpload from '@/components/CAUpload';
+
 import { getDistrictList, editDistrictList, delDistrict, addDistrict,getMainDistrictList } from './service';
 
 const DistrictMana = () => {
@@ -26,7 +25,6 @@ const DistrictMana = () => {
       dataIndex: 'id',
       key: 'id',
       hideInSearch: true,
-      render: (text) => <a>{text}</a>,
     },
     {
       title: '医院名称',
@@ -66,7 +64,7 @@ const DistrictMana = () => {
       hideInSearch: true,
     },
     {
-      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      title:'操作',
       dataIndex: 'option',
       valueType: 'option',
       render: (_, record) => [
@@ -181,7 +179,6 @@ const DistrictMana = () => {
           handleModalVisible(bool);
         }}
         onFinish={async (value) => {
-          console.log({value});
           const {name,isHospital,id,sign} = value;
           const success = await addDistrict(isHospital==0?{
             name,isHospital,sign
@@ -203,9 +200,7 @@ const DistrictMana = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.name" defaultMessage="医院名是必填项" />
-              ),
+              message:'医院名是必填项',
             },
           ]}
           width="sm"
@@ -215,9 +210,7 @@ const DistrictMana = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.isHospital" defaultMessage="请选择是否为主院" />
-              ),
+              message:'请选择是否为主院',
             },
           ]}
           options={[
@@ -243,9 +236,7 @@ const DistrictMana = () => {
                 rules={[
                   {
                     required: true,
-                    message: (
-                      <FormattedMessage id="pages.searchTable.sign" defaultMessage="..." />
-                    ),
+                    message:'',
                   },
                 ]}
                 width="sm"
@@ -283,7 +274,7 @@ const DistrictMana = () => {
       {/* 更新 */}
       <UpdateForm
         onSubmit={async (value) => {
-          console.log({ '编辑': value });
+          // console.log({ '编辑': value });
           const success = await editDistrictList(value);
 
           if (success) {

+ 4 - 10
src/pages/districtMana/updateForm.jsx

@@ -5,7 +5,7 @@ import {
   ModalForm,
   ProFormDependency
 } from '@ant-design/pro-form';
-import { useIntl, FormattedMessage } from 'umi';
+
 import { getMainDistrictList } from './service';
 
 
@@ -31,9 +31,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.name" defaultMessage="医院名是必填项" />
-                ),
+                message:'医院名是必填项',
               },
             ]}
             width="sm"
@@ -44,9 +42,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.isHospital" defaultMessage="请选择是否为主院" />
-                ),
+                message:'请选择是否为主院',
               },
             ]}
             options={[
@@ -72,9 +68,7 @@ const UpdateForm = (props) => {
                   rules={[
                     {
                       required: false,
-                      message: (
-                        <FormattedMessage id="pages.searchTable.parentName" defaultMessage="..." />
-                      ),
+                      message:'',
                     },
                   ]}
                   width="sm"

+ 81 - 0
src/pages/platformMana/menuManage/component/drawer.jsx

@@ -0,0 +1,81 @@
+
+
+import React,{useState,useEffect,useRef} from 'react'
+import { PageContainer } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import {Table } from 'antd';
+import { DrawerForm } from '@ant-design/pro-form';
+
+
+
+
+
+
+export default function DrawerContent(props) {
+
+    const { 
+        visible=false,
+        onVisibleChange=()=>{},
+        currentRow={},
+        renderListFunc=()=>{},
+        onFinishFunc=()=>{console.log('init onFinishFunc')},
+        columns=[],
+        defaultSelected=[],
+        config={}
+    } = props;
+    
+    const {rowKeys='id',tableSearch=false,} = config;
+    const drawerRef = useRef();
+    const [selectedKeys,setSelectedKeys] = useState([]);
+
+    const renderDefault = ()=>{
+        const defaultSelects = defaultSelected;
+        setSelectedKeys(defaultSelects);
+    }
+
+
+    useEffect(()=>{
+        renderDefault();
+    },[currentRow,defaultSelected])
+
+
+
+    return visible&&currentRow&&columns.length>0 ? (
+        <PageContainer className="DrawerContent">
+            <DrawerForm
+                title="绑定用户"
+                visible={visible}
+                onVisibleChange={onVisibleChange}
+                formRef={drawerRef}
+                drawerProps={{
+                    forceRender: true,
+                    destroyOnClose: true,
+                }}
+                onFinish={async (values) => {
+                    //   console.log({onFinishFunc,values});
+                      onFinishFunc(values,selectedKeys);
+                }}
+            
+            >
+            
+                <ProTable
+                    columns={columns}
+                    rowKey={rowKeys}
+                    tableClassName="drawerContent"
+                    request={renderListFunc}
+                    search={tableSearch}
+                    rowSelection={{
+                        // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
+                        // 注释该行则默认不显示下拉选项
+                        selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
+                        selectedRowKeys:selectedKeys,
+                        onChange:(selectedRowKeys, selectedRows)=>{
+                            setSelectedKeys(selectedRowKeys);
+                        }
+                    }}
+                />
+            
+            </DrawerForm>
+        </PageContainer>
+    ) : <></>
+}

+ 306 - 0
src/pages/platformMana/menuManage/index.js

@@ -0,0 +1,306 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:13
+ * @LastEditTime: 2021-08-03 17:30:43
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
+ */
+
+import { PlusOutlined } from '@ant-design/icons';
+import { Button, Popconfirm} from 'antd';
+import React, { useState, useRef } from 'react';
+
+import { PageContainer } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import { ModalForm, ProFormText, ProFormSelect } from '@ant-design/pro-form';
+import UpdateForm from './updateForm';
+import {addList, editList, delList } from './service';
+import { getMenuList } from '@/pages/platformMana/menuManage/service';
+
+const UserMana = () => {
+  const columns = [
+    {
+      title: '菜单Id',
+      dataIndex: 'menuId',
+      key: 'menuId',
+      hideInSearch: true,
+    },
+    {
+      title: '菜单名称',
+      dataIndex: 'name',
+      key: 'name',
+    },
+    {
+      title: 'URL',
+      dataIndex: 'url',
+      key: 'url',
+    },
+    {
+      title: 'Path',
+      dataIndex: 'path',
+      key: 'path',
+      hideInSearch: true,
+    },
+    {
+      title: '变更人',
+      dataIndex: 'modifyUserName',
+      key: 'modifyUserName',
+      hideInSearch: true,
+    },
+    {
+      title: '变更日期',
+      dataIndex: 'modifyTime',
+      key: 'modifyTime',
+      valueType: 'date',
+    },
+    {
+      title: '操作',
+      dataIndex: 'option',
+      valueType: 'option',
+      render: (_, record) => [
+        <a
+          key="config"
+          onClick={() => {
+            setIfAddZeroLevelMenu(false);
+            handleModalVisible(true);
+            setCurrentRow(record);
+          }}
+        >
+          添加
+        </a>,
+        <a
+          key="config"
+          onClick={() => {
+            handleUpdateModalVisible(true);
+            setCurrentRow(record);
+          }}
+        >
+          编辑
+        </a>,
+        <Popconfirm
+          key="subscribeAlert"
+          title="是否确定删除?"
+          onConfirm={() => {
+            delUserHandler(record);
+          }}
+        >
+          <a>删除</a>
+        </Popconfirm>,
+      ],
+    },
+  ];
+
+  const [createModalVisible, handleModalVisible] = useState(false);
+  const [updateModalVisible, handleUpdateModalVisible] = useState(false);
+  const actionRef = useRef();
+  const [currentRow, setCurrentRow] = useState({});
+  const [ifAddZeroLevelMenu, setIfAddZeroLevelMenu] = useState(true);
+
+  // const [shareParamsSetting,setShareParamsSetting] = useState(false);  //是否分摊参数设置
+
+  /**
+   *
+   * @param {Boolean} bool 弹窗展示状态
+   */
+  const updateModalVisibleChange = (bool) => {
+    handleUpdateModalVisible(bool);
+    if (!bool) setCurrentRow(undefined);
+  };
+
+  //获取Drawer菜单列表
+  const getMenus = async (params = {}, sort, filter) => {
+    const res = await getMenuList(params);
+    return {
+      data: res.data.list,
+      total: res.data.totalCount,
+      success: res.success,
+    };
+  };
+
+  /**
+   *
+   * @param {Object} value 删除项数据
+   */
+  const delUserHandler = async (value) => {
+    const ids = [value.roleId];
+    const resp = await delList({ ids });
+    if (resp.status == 200) {
+      if (actionRef.current) {
+        actionRef.current.reload();
+      }
+    }
+  };
+
+  return (
+    <PageContainer>
+      <ProTable
+        columns={columns}
+        request={getMenus}
+        actionRef={actionRef}
+        rowKey="menuId"
+        toolBarRender={() => [
+          <Button
+            key="button"
+            icon={<PlusOutlined />}
+            type="primary"
+            onClick={() => {
+              setIfAddZeroLevelMenu(true);
+              handleModalVisible(true);
+            }}
+          >
+            新增
+          </Button>,
+        ]}
+        pagination={{
+          pageSize: 10,
+        }}
+        search={false}
+      />
+
+      <ModalForm
+        title="新增菜单"
+        width="800px"
+        labelCol={{ span: 5, offset: 3 }}
+        layout={'horizontal'}
+        modalProps={{
+          destroyOnClose:true
+        }}
+        visible={createModalVisible}
+        onVisibleChange={handleModalVisible}
+        onFinish={async (value) => {
+          const { parentId } = currentRow;
+          const resp = await addList({ ...value, parentId: ifAddZeroLevelMenu ? 0 : parentId });
+          const { status } = resp;
+          if (status == 200) {
+      
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+            return true;
+          }
+          setCurrentRow(undefined);
+        }}
+      >
+        <ProFormText
+          label="菜单名称"
+          rules={[
+            {
+              required: true,
+              message: '角色名是必填项!',
+            },
+          ]}
+          width="sm"
+          name="name"
+        />
+        <ProFormText
+          label="Path"
+          rules={[
+            {
+              required: true,
+              message: '菜单路径是必填项!',
+            },
+          ]}
+          width="sm"
+          name="path"
+        />
+        <ProFormText
+          label="权限字段"
+          rules={[
+            {
+              required: true,
+              message: '权限字段是必填项!',
+            },
+          ]}
+          width="sm"
+          name="perms"
+        />
+        <ProFormSelect
+          name="type"
+          label="类型"
+          width="sm"
+          options={[
+            { label: '目录', value: 0 },
+            { label: '菜单', value: 1 },
+            { label: '按钮', value: 2 },
+          ]}
+          fieldProps={{
+            optionItemRender(item) {
+              return item.label + ' - ' + item.value;
+            },
+          }}
+          placeholder="请选择类型"
+          rules={[{ required: true, message: '请选择类型!' }]}
+        />
+        <ProFormText
+          label="菜单Icon"
+          rules={[
+            {
+              required: false,
+            },
+          ]}
+          width="sm"
+          name="icon"
+        />
+        <ProFormText
+          label="菜单排序"
+          rules={[
+            {
+              required: false,
+            },
+          ]}
+          width="sm"
+          name="orderNum"
+        />
+      </ModalForm>
+
+      {/* 更新 */}
+      <UpdateForm
+        onSubmit={async (value) => {
+          const {menuId} = currentRow;
+          // console.log({'编辑':value});
+          const {
+            parentId,
+            name,
+            path,
+            url,
+            perms,
+            type,
+            icon,
+            orderNum
+          } = value;
+
+          const resp = await editList({
+            parentId,
+            name,
+            path,
+            url,
+            perms,
+            type,
+            icon,
+            orderNum,
+            id:menuId
+          });
+          const {status} = resp;
+          if (status==200) {
+            handleUpdateModalVisible(false);
+            setCurrentRow(undefined);
+
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+          }
+        }}
+        onCancel={() => {
+          handleUpdateModalVisible(false);
+          setCurrentRow(undefined);
+        }}
+        updateModalVisible={updateModalVisible}
+        updateModalVisibleChange={updateModalVisibleChange}
+        values={currentRow || {}}
+      />
+    </PageContainer>
+  );
+};
+
+export default UserMana;

+ 69 - 0
src/pages/platformMana/menuManage/service.js

@@ -0,0 +1,69 @@
+/*
+ * @Author: your name
+ * @Date: 2021-08-03 14:38:54
+ * @LastEditTime: 2021-08-03 16:34:48
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /CostAccountManaSys/src/pages/platformMana/menuManage/service.js
+ */
+
+
+
+import { request } from 'umi';
+
+//获角色列表
+export async function getMenuList(params, options) {
+    return request('/api/costAccount/menu/list', {
+      method: 'GET',
+      params: {...params},
+      ...(options || {}),
+    });
+}
+
+//新增菜单
+export async function addList(body, options) {
+    return request('/api/costAccount/menu/save', {
+      method: 'POST',
+      data: {...body},
+      ...(options || {}),
+    });
+}
+
+//编辑角色
+export async function editList(body, options) {
+  return request('/api/costAccount/menu/edit', {
+    method: 'POST',
+    data: {...body},
+    ...(options || {}),
+  });
+}
+
+//删除角色
+export async function delList(params, options) {
+  const {ids} = params;
+  return request(`/api/costAccount/role/delete`, {
+    data:ids,
+    method: 'POST',
+    ...(options || {}),
+  });
+}
+
+// //根据角色查询已绑用户
+// export async function getUsersByRoleId(params, options) {
+//   const {roleId} = params;
+//   return request(`/api/costAccount/role/editUserRole`, {
+//     data:{roleId, userIds},
+//     method: 'POST',
+//     ...(options || {}),
+//   });
+// }
+
+//角色绑定用户
+export async function roleBindUser(params, options) {
+  const {roleId, userIds} = params;
+  return request(`/api/costAccount/role/editUserRole`, {
+    data:{roleId, userIds},
+    method: 'POST',
+    ...(options || {}),
+  });
+}

+ 101 - 0
src/pages/platformMana/menuManage/updateForm.jsx

@@ -0,0 +1,101 @@
+import React from 'react';
+import {
+  ProFormText,
+  ModalForm,
+  ProFormSelect
+} from '@ant-design/pro-form';
+
+
+
+const UpdateForm = (props) => {
+  const { updateModalVisible, updateModalVisibleChange, values, onSubmit } = props;
+  return (
+    <>
+      {
+        JSON.stringify(values) !== '{}' && <ModalForm
+          title="编辑菜单"
+          width="800px"
+          initialValues={{ ...values }}
+          labelCol={{ span: 5, offset: 3 }}
+          layout={'horizontal'}
+          visible={updateModalVisible}
+          onVisibleChange={(visible) => updateModalVisibleChange(visible)}
+          onFinish={(value) => onSubmit({ ...values, ...value })}
+        >
+          <ProFormText
+            label="菜单名称"
+            rules={[
+              {
+                required: true,
+                message: '角色名是必填项!',
+              },
+            ]}
+            width="sm"
+            name="name"
+          />
+          <ProFormText
+            label="Path"
+            rules={[
+              {
+                required: true,
+                message: '菜单路径是必填项!',
+              },
+            ]}
+            width="sm"
+            name="path"
+          />
+          <ProFormText
+            label="权限字段"
+            rules={[
+              {
+                required: true,
+                message: '权限字段是必填项!',
+              },
+            ]}
+            width="sm"
+            name="perms"
+          />
+          <ProFormSelect
+            name="type"
+            label="类型"
+            width="sm"
+            options={[
+              { label: '目录', value: 0 },
+              { label: '菜单', value: 1 },
+              { label: '按钮', value: 2 },
+            ]}
+            fieldProps={{
+              optionItemRender(item) {
+                return item.label + ' - ' + item.value;
+              },
+            }}
+            placeholder="请选择类型"
+            rules={[{ required: true, message: '请选择类型!' }]}
+          />
+          <ProFormText
+            label="菜单Icon"
+            rules={[
+              {
+                required: false,
+              },
+            ]}
+            width="sm"
+            name="icon"
+          />
+          <ProFormText
+            label="菜单排序"
+            rules={[
+              {
+                required: false,
+              },
+            ]}
+            width="sm"
+            name="orderNum"
+          />
+        </ModalForm>
+      }
+    </>
+  );
+};
+
+export default UpdateForm;

+ 81 - 0
src/pages/platformMana/roleManage/component/drawer.jsx

@@ -0,0 +1,81 @@
+
+
+import React,{useState,useEffect,useRef} from 'react'
+import { PageContainer } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import {Table } from 'antd';
+import { DrawerForm } from '@ant-design/pro-form';
+
+
+
+
+
+
+export default function DrawerContent(props) {
+
+    const { 
+        visible=false,
+        onVisibleChange=()=>{},
+        currentRow={},
+        renderListFunc=()=>{},
+        onFinishFunc=()=>{console.log('init onFinishFunc')},
+        columns=[],
+        defaultSelected=[],
+        config={}
+    } = props;
+    
+    const {rowKeys='id',tableSearch=false,} = config;
+    const drawerRef = useRef();
+    const [selectedKeys,setSelectedKeys] = useState([]);
+
+    const renderDefault = ()=>{
+        const defaultSelects = defaultSelected;
+        setSelectedKeys(defaultSelects);
+    }
+
+
+    useEffect(()=>{
+        renderDefault();
+    },[currentRow,defaultSelected])
+
+
+
+    return visible&&currentRow&&columns.length>0 ? (
+        <PageContainer className="DrawerContent">
+            <DrawerForm
+                title="绑定用户"
+                visible={visible}
+                onVisibleChange={onVisibleChange}
+                formRef={drawerRef}
+                drawerProps={{
+                    forceRender: true,
+                    destroyOnClose: true,
+                }}
+                onFinish={async (values) => {
+                    //   console.log({onFinishFunc,values});
+                      onFinishFunc(values,selectedKeys);
+                }}
+            
+            >
+            
+                <ProTable
+                    columns={columns}
+                    rowKey={rowKeys}
+                    tableClassName="drawerContent"
+                    request={renderListFunc}
+                    search={tableSearch}
+                    rowSelection={{
+                        // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
+                        // 注释该行则默认不显示下拉选项
+                        selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
+                        selectedRowKeys:selectedKeys,
+                        onChange:(selectedRowKeys, selectedRows)=>{
+                            setSelectedKeys(selectedRowKeys);
+                        }
+                    }}
+                />
+            
+            </DrawerForm>
+        </PageContainer>
+    ) : <></>
+}

+ 137 - 26
src/pages/platformMana/roleManage/index.js

@@ -1,22 +1,24 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-02 18:27:21
+ * @LastEditTime: 2021-08-03 17:32:25
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
  */
 
 import { PlusOutlined } from '@ant-design/icons';
-import { Button, Popconfirm, message, Input, Modal } from 'antd';
-import React, { useState, useRef, useEffect } from 'react';
-import { useIntl, FormattedMessage,useModel } from 'umi';
-import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+import { Button, Popconfirm} from 'antd';
+import React, { useState, useRef } from 'react';
+import { PageContainer } from '@ant-design/pro-layout';
 import ProTable from '@ant-design/pro-table';
-import { ModalForm, ProFormText, ProFormSelect } from '@ant-design/pro-form';
+import { ModalForm, ProFormText } from '@ant-design/pro-form';
 import UpdateForm from './updateForm';
+import DrawerContent from './component/drawer';
+import { getRoleList, roleBindUser, addList, editList, delList,roleBindMenu } from './service';
+import { getUserList } from '@/pages/UserMana/service';
 
-import { getRoleList, addUser, editUser, delUser } from './service';
+import { getMenuList } from '@/pages/platformMana/menuManage/service';
 
 const UserMana = () => {
   const columns = [
@@ -41,16 +43,18 @@ const UserMana = () => {
       title: '变更日期',
       dataIndex: 'modifyTime',
       key: 'modifyTime',
+      valueType: 'date',
     },
     {
-      title:'操作',
+      title: '操作',
       dataIndex: 'option',
       valueType: 'option',
       render: (_, record) => [
         <a
           key="config"
           onClick={() => {
-            handleUpdateModalVisible(true);
+            setEditRoleBindUsers(true);
+            setDrawerVisible(true);
             setCurrentRow(record);
           }}
         >
@@ -59,7 +63,8 @@ const UserMana = () => {
         <a
           key="config"
           onClick={() => {
-            handleUpdateModalVisible(true);
+            setEditRoleBindUsers(false);
+            setDrawerVisible(true);
             setCurrentRow(record);
           }}
         >
@@ -78,7 +83,6 @@ const UserMana = () => {
           key="subscribeAlert"
           title="是否确定删除?"
           onConfirm={() => {
-            setCurrentRow(record);
             delUserHandler(record);
           }}
         >
@@ -88,16 +92,55 @@ const UserMana = () => {
     },
   ];
 
+  const DrawerTableUsersColumns = [
+    {
+      title: 'Id',
+      dataIndex: 'id',
+      key: 'id',
+      hideInSearch: true,
+    },
+    {
+      title: '姓名',
+      dataIndex: 'name',
+      key: 'name',
+    },
+    {
+      title: '用户名',
+      dataIndex: 'account',
+      key: 'account',
+      hideInSearch: true,
+    },
+    {
+      title: '在职状态',
+      dataIndex: 'hospitalStatus',
+      key: 'hospitalStatus',
+      hideInSearch: true,
+    },
+  ];
+  
+  const DrawerTableMenusColumns = [
+    {
+      title: 'Id',
+      dataIndex: 'menuId',
+      key: 'menuId',
+      hideInSearch: true,
+    },
+    {
+      title: '菜单名称',
+      dataIndex: 'name',
+      key: 'name',
+    }
+  ];
+
   const [createModalVisible, handleModalVisible] = useState(false);
   const [updateModalVisible, handleUpdateModalVisible] = useState(false);
   const actionRef = useRef();
   const [currentRow, setCurrentRow] = useState({});
- 
+  const [editRoleBindUsers, setEditRoleBindUsers] = useState(false);
+  const [drawerVisible, setDrawerVisible] = useState(false);
 
   // const [shareParamsSetting,setShareParamsSetting] = useState(false);  //是否分摊参数设置
 
-
-  
   /**
    *
    * @param {Boolean} bool 弹窗展示状态
@@ -117,19 +160,40 @@ const UserMana = () => {
     };
   };
 
+  //获取Drawer用户列表
+  const getUsers = async (params = {}, sort, filter) => {
+    const res = await getUserList(params);
+    return {
+      data: res.data.list,
+      total: res.data.totalCount,
+      success: res.success,
+    };
+  };
+
+  //获取Drawer菜单列表
+  const getMenus = async (params = {}, sort, filter) => {
+    const res = await getMenuList(params);
+    return {
+      data: res.data.list,
+      total: res.data.totalCount,
+      success: res.success,
+    };
+  };
+
   /**
    *
    * @param {Object} value 删除项数据
    */
   const delUserHandler = async (value) => {
-    const resp = await delUser(value);
-    if(resp.msg){
+    const ids = [value.roleId];
+    const resp = await delList({ ids });
+    if (resp.status == 200) {
       if (actionRef.current) {
         actionRef.current.reload();
       }
     }
   };
-  
+
   return (
     <PageContainer>
       <ProTable
@@ -148,7 +212,6 @@ const UserMana = () => {
           >
             新增
           </Button>,
-          
         ]}
         pagination={{
           pageSize: 10,
@@ -160,18 +223,17 @@ const UserMana = () => {
       />
 
       <ModalForm
-        title="新增角"
+        title="新增角"
         width="800px"
         labelCol={{ span: 5, offset: 3 }}
         layout={'horizontal'}
         visible={createModalVisible}
         onVisibleChange={handleModalVisible}
         onFinish={async (value) => {
-          const success = await addUser(value);
+          const success = await addList(value);
           //   console.log({ success });
           if (success) {
             handleModalVisible(false);
-
             if (actionRef.current) {
               actionRef.current.reload();
             }
@@ -183,7 +245,7 @@ const UserMana = () => {
           rules={[
             {
               required: true,
-              message:'角色名是必填项!',
+              message: '角色名是必填项!',
             },
           ]}
           width="sm"
@@ -194,20 +256,20 @@ const UserMana = () => {
           rules={[
             {
               required: false,
-              message:'',
+              message: '',
             },
           ]}
           width="sm"
           name="remark"
         />
-        
       </ModalForm>
 
       {/* 更新 */}
       <UpdateForm
         onSubmit={async (value) => {
           // console.log({value});
-          const success = await editUser(value);
+          const { roleId, roleName, remark } = value;
+          const success = await editList({ roleId, roleName, remark });
 
           if (success) {
             handleUpdateModalVisible(false);
@@ -227,7 +289,56 @@ const UserMana = () => {
         values={currentRow || {}}
       />
 
-
+      {editRoleBindUsers ? (
+        //编辑用户
+        <DrawerContent
+          columns={DrawerTableUsersColumns}
+          visible={drawerVisible}
+          currentRow={currentRow}
+          defaultSelected={[98, 87]}
+          onVisibleChange={(bool) => setDrawerVisible(bool)}
+          renderListFunc={getUsers}
+          config={{tableSearch:true}}
+          onFinishFunc={async (value, selectedRowKeys) => {
+            // console.log({value,selectedRowKeys});
+            const { roleId } = currentRow;
+            const resp = await roleBindUser({ roleId, userIds: selectedRowKeys });
+            const { status } = resp;
+            if (status == 200) {
+              setDrawerVisible(false);
+              setCurrentRow(undefined);
+              if (actionRef.current) {
+                actionRef.current.reload();
+              }
+            }
+          }}
+        />
+      ) : (
+        //编辑权限
+        <DrawerContent
+          columns={DrawerTableMenusColumns}
+          visible={drawerVisible}
+          currentRow={currentRow}
+          defaultSelected={[98, 87]}
+          onVisibleChange={(bool) => setDrawerVisible(bool)}
+          renderListFunc={getMenus}
+          config={{rowKeys:'menuId',tableSearch:false}}
+          tableSearch={false}
+          onFinishFunc={async (value, selectedRowKeys) => {
+            // console.log({value,selectedRowKeys});
+            const { roleId } = currentRow;
+            const resp = await roleBindMenu({ roleId, menuIds: selectedRowKeys });
+            const { status } = resp;
+            if (status == 200) {
+              setDrawerVisible(false);
+              setCurrentRow(undefined);
+              if (actionRef.current) {
+                actionRef.current.reload();
+              }
+            }
+          }}
+        />
+      )}
     </PageContainer>
   );
 };

+ 36 - 18
src/pages/platformMana/roleManage/service.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:31
- * @LastEditTime: 2021-08-02 18:10:07
+ * @LastEditTime: 2021-08-03 15:10:39
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/service.js
@@ -19,42 +19,60 @@ export async function getRoleList(params, options) {
     });
 }
 
-//新增人员
-export async function addUser(body, options) {
-    return request('/api/costAccount/user/save', {
+//新增角色
+export async function addList(body, options) {
+    return request('/api/costAccount/role/save', {
       method: 'POST',
       data: {...body},
       ...(options || {}),
     });
 }
 
-//编辑人员
-export async function editUser(body, options) {
-  return request('/api/costAccount/user/update', {
+//编辑角色
+export async function editList(body, options) {
+  return request('/api/costAccount/role/edit', {
     method: 'POST',
     data: {...body},
     ...(options || {}),
   });
 }
 
-//删除人员
-export async function delUser(params, options) {
-  const {id} = params;
-  const ids = [id];
-  return request(`/api/costAccount/user/delete`, {
+//删除角色
+export async function delList(params, options) {
+  const {ids} = params;
+  return request(`/api/costAccount/role/delete`, {
     data:ids,
     method: 'POST',
     ...(options || {}),
   });
 }
 
+// //根据角色查询已绑用户
+// export async function getUsersByRoleId(params, options) {
+//   const {roleId} = params;
+//   return request(`/api/costAccount/role/editUserRole`, {
+//     data:{roleId, userIds},
+//     method: 'POST',
+//     ...(options || {}),
+//   });
+// }
 
-//导入excel
-export async function importExcel(body, options) {
-  const {formData} = body;
-  return request('/api/costAccount/excel/importUser', {
+//角色绑定用户
+export async function roleBindUser(params, options) {
+  const {roleId, userIds} = params;
+  return request(`/api/costAccount/role/editUserRole`, {
+    data:{roleId, userIds},
     method: 'POST',
-    data:formData,
     ...(options || {}),
   });
-}
+}
+
+//角色绑定菜单
+export async function roleBindMenu(params, options) {
+  const {roleId, menuIds} = params;
+  return request(`/api/costAccount/role/editRoleMenu`, {
+    data:{roleId, menuIds},
+    method: 'POST',
+    ...(options || {}),
+  });
+}

+ 43 - 78
src/pages/platformMana/roleManage/updateForm.jsx

@@ -1,87 +1,52 @@
 import React from 'react';
-import { Modal } from 'antd';
 import {
-    ProFormSelect,
-    ProFormText,
-    ModalForm,
+  ProFormText,
+  ModalForm,
 } from '@ant-design/pro-form';
-import { useIntl, FormattedMessage } from 'umi';
+
 
 
 const UpdateForm = (props) => {
-    const {updateModalVisible,updateModalVisibleChange,values,onSubmit} = props;
-    return (
-        <>
-           {
-               JSON.stringify(values) !== '{}'&&<ModalForm
-               title="编辑人员"
-               width="800px"
-               initialValues={{...values}}
-               labelCol={{ span: 3, offset: 3 }}
-               layout={'horizontal'}
-               visible={updateModalVisible}
-               onVisibleChange={(visible)=>updateModalVisibleChange(visible)}
-               onFinish={(value)=>onSubmit({...values,...value})}
-             >
-               <ProFormText
-                 label="姓名"
-                 rules={[
-                   {
-                     required: true,
-                     message: (
-                       <FormattedMessage id="pages.searchTable.ruleName" defaultMessage="人员名是必填项" />
-                     ),
-                   },
-                 ]}
-                 width="sm"
-                 name="name"
-               />
-               <ProFormText
-                 label="账户"
-                 rules={[
-                   {
-                     required: true,
-                     message: (
-                       <FormattedMessage id="pages.searchTable.ruleName" defaultMessage="账户名是必填项" />
-                     ),
-                   },
-                 ]}
-                 width="sm"
-                 name="account"
-               />
-               <ProFormText
-                 label="密码"
-                 rules={[
-                   {
-                     required: false,
-                     message: (
-                       <FormattedMessage id="pages.searchTable.password" defaultMessage="" />
-                     ),
-                   },
-                 ]}
-                 placeholder="密码不修改时留空"
-                 width="sm"
-                 name="password"
-               />
-               <ProFormSelect
-                 options={[
-                   {
-                     value: 0,
-                     label: '离职',
-                   },
-                   {
-                     value: 1,
-                     label: '在职',
-                   },
-                 ]}
-                 width="sm"
-                 name="hospitalStatus"
-                 label="在职状态"
-               />
-             </ModalForm>
-           }
-        </>
-    );
+  const { updateModalVisible, updateModalVisibleChange, values, onSubmit } = props;
+  return (
+    <>
+      {
+        JSON.stringify(values) !== '{}' && <ModalForm
+          title="编辑角色"
+          width="800px"
+          initialValues={{ ...values }}
+          labelCol={{ span: 3, offset: 3 }}
+          layout={'horizontal'}
+          visible={updateModalVisible}
+          onVisibleChange={(visible) => updateModalVisibleChange(visible)}
+          onFinish={(value) => onSubmit({ ...values, ...value })}
+        >
+          <ProFormText
+            label="角色名"
+            rules={[
+              {
+                required: true,
+                message: '角色名是必填项!',
+              },
+            ]}
+            width="sm"
+            name="roleName"
+          />
+          <ProFormText
+            label="备注"
+            rules={[
+              {
+                required: false,
+                message: '',
+              },
+            ]}
+            width="sm"
+            name="remark"
+          />
+        </ModalForm>
+      }
+    </>
+  );
 };
 
 export default UpdateForm;

+ 15 - 35
src/pages/responsibilityCenter/index.jsx

@@ -1,19 +1,19 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-02 00:53:52
+ * @LastEditTime: 2021-08-03 17:34:40
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
  */
 
 import { PlusOutlined } from '@ant-design/icons';
-import { Button, Popconfirm, Table, Space } from 'antd';
-import React, { useState, useRef, useEffect } from 'react';
-import { useIntl, FormattedMessage } from 'umi';
-import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+import { Button, Popconfirm} from 'antd';
+import React, { useState, useRef } from 'react';
+
+import { PageContainer } from '@ant-design/pro-layout';
 import ProTable from '@ant-design/pro-table';
-import { ModalForm, ProFormText, ProFormSelect, ProFormDependency } from '@ant-design/pro-form';
+import { ModalForm, ProFormText, ProFormSelect } from '@ant-design/pro-form';
 import UpdateForm from './updateForm';
 // import CAUpload from '@/components/CAUpload';
 import { getResponsibilityCenterList, editResponsibilityCenterList, delResponsibilityCenter, addResponsibilityCenter } from './service';
@@ -34,13 +34,6 @@ const responsibilityCenter = () => {
       key: 'responsibilityCode',
       hideInSearch: true,
     },
-    // {
-    //   title: '责任中心级别',
-    //   dataIndex: 'responsibilityLevel',
-    //   key: 'responsibilityLevel',
-    //   hideInSearch: true,
-    //   width: '10%'
-    // },
     {
       title: '是否汇总中心',
       dataIndex: 'isGatherCenter',
@@ -72,7 +65,7 @@ const responsibilityCenter = () => {
       width: '15%'
     },
     {
-      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      title:'操作',
       dataIndex: 'option',
       valueType: 'option',
       width: '15%',
@@ -204,13 +197,10 @@ const responsibilityCenter = () => {
         }}
         formRef={ref}
         onFinish={async (value) => {
-          console.log({'新增':value,selectedLevel})
-          const {shareLevel} = value;
-          const body = {...value,shareName:selectedLevel.shareName,shareId:selectedLevel.id}
-          // console.log({body});
-          // return;
+          // console.log({'新增':value,selectedLevel})
+    
+          const body = {...value,shareName:selectedLevel.shareName,shareId:selectedLevel.id};
           const success = await addResponsibilityCenter(body);
-          //   console.log({ success });
           if (success) {
             handleModalVisible(false);
 
@@ -255,9 +245,7 @@ const responsibilityCenter = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.responsibilityName" defaultMessage="医院名是必填项" />
-              ),
+              message:'医院名是必填项',
             },
           ]}
           width="sm"
@@ -268,9 +256,7 @@ const responsibilityCenter = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.responsibilityCode" defaultMessage="责任中心编码是必填项" />
-              ),
+              message:'责任中心编码是必填项',
             },
           ]}
           width="sm"
@@ -280,9 +266,7 @@ const responsibilityCenter = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.isGatherCenter" defaultMessage="请选择是否为汇总中心" />
-              ),
+              message:'请选择是否为汇总中心',
             },
           ]}
           options={[
@@ -303,9 +287,7 @@ const responsibilityCenter = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.responsibilityType" defaultMessage="请选择责任类型" />
-              ),
+              message:'请选择责任类型',
             },
           ]}
           options={[
@@ -326,9 +308,7 @@ const responsibilityCenter = () => {
           rules={[
             {
               required: true,
-              message: (
-                <FormattedMessage id="pages.searchTable.shareLevel" defaultMessage="请选择分摊级别" />
-              ),
+              message:'请选择分摊级别',
             },
           ]}
           fieldProps={{

+ 7 - 18
src/pages/responsibilityCenter/updateForm.jsx

@@ -2,13 +2,12 @@ import React, { useState, useEffect } from 'react';
 import {
   ProFormSelect,
   ProFormText,
-  ModalForm,
-  ProFormDependency
+  ModalForm
 } from '@ant-design/pro-form';
-import { useIntl, FormattedMessage } from 'umi';
+
 
 import { getApportionmentLevelListNoPage } from '../apportionmentLevel/service';
-import { getResponsibilityCenterList, editResponsibilityCenterList, delResponsibilityCenter, addResponsibilityCenter } from './service';
+import { getResponsibilityCenterList } from './service';
 
 
 const UpdateForm = (props) => {
@@ -16,8 +15,6 @@ const UpdateForm = (props) => {
   const { responsibilityLevel, parentId } = values;
   const [selectedLevelList, setSelectedLevelList] = useState([]); //可选的分摊层级列表
   const [selectedLevel, setSelectedLevel] = useState(null);
-  console.log({ values });
-
 
   useEffect(() => {
     const temp = selectedLevelList.filter(item => item.leverSort == responsibilityLevel);
@@ -73,9 +70,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.responsibilityName" defaultMessage="医院名是必填项" />
-                ),
+                message:'医院名是必填项',
               },
             ]}
             width="sm"
@@ -85,9 +80,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.isGatherCenter" defaultMessage="请选择是否为汇总中心" />
-                ),
+                message:'请选择是否为汇总中心',
               },
             ]}
             options={[
@@ -108,9 +101,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.responsibilityType" defaultMessage="请选择责任类型" />
-                ),
+                message:'请选择责任类型',
               },
             ]}
             options={[
@@ -131,9 +122,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.shareLevel" defaultMessage="请选择分摊级别" />
-                ),
+                message:'请选择分摊级别',
               },
             ]}
             fieldProps={{

+ 11 - 14
src/pages/responsibilityCenterConnect/index.jsx

@@ -1,21 +1,20 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-01 13:58:05
+ * @LastEditTime: 2021-08-03 17:37:58
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
  */
 
-import { PlusOutlined } from '@ant-design/icons';
-import { Button, Space, Table, Tag } from 'antd';
-import React, { useState, useRef, useEffect } from 'react';
-import { useIntl, FormattedMessage } from 'umi';
-import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+
+import { Space, Table, Tag } from 'antd';
+import React, { useState, useRef } from 'react';
+
+import { PageContainer} from '@ant-design/pro-layout';
 import ProTable from '@ant-design/pro-table';
-import { DrawerForm, formRef } from '@ant-design/pro-form';
-import UpdateForm from './updateForm';
-// import CAUpload from '@/components/CAUpload';
+import { DrawerForm } from '@ant-design/pro-form';
+
 import { getResponsibilityCenterConnectList,getResponsibilityCenterConnectableList,saveResponsibilityCenterConnected } from './service';
 
 const ResponsibilityCenterConnect = () => {
@@ -49,13 +48,13 @@ const ResponsibilityCenterConnect = () => {
       }
     },
     {
-      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      title:'操作',
       dataIndex: 'option',
       key: 'option',
       valueType: 'option',
       width: '15%',
       render: (_, record) => {
-        const { isParent,isGatherCenter } = record;
+        const {isGatherCenter } = record;
         // console.log({record});
         return isGatherCenter==2 ? [
           <a
@@ -118,7 +117,6 @@ const ResponsibilityCenterConnect = () => {
   //获取责任中心对应列表
   const getList = async (params = {}, sort, filter) => {
     const res = await getResponsibilityCenterConnectList(params);
-    // console.log({res});
     const defaultKeys = res.data.list.map(item=>item.responsibilityId);
     setDefaultExpandedRowKeys(defaultKeys);
 
@@ -135,7 +133,7 @@ const ResponsibilityCenterConnect = () => {
     const {responsibilityId} = currentRow;
     const res = await getResponsibilityCenterConnectableList({...params,responsibilityId});
     const {data,status} = res;
-    // console.log({res,data,status});
+
     if(status == 200){
         return {
           data:data,
@@ -145,7 +143,6 @@ const ResponsibilityCenterConnect = () => {
   }
 
   const onExpandedRowsChange = (expandedRows)=>{
-      console.log({expandedRows});
       setDefaultExpandedRowKeys([].concat(expandedRows))
   }
 

+ 7 - 17
src/pages/responsibilityCenterConnect/updateForm.jsx

@@ -5,12 +5,12 @@ import {
   ModalForm,
   ProFormDependency
 } from '@ant-design/pro-form';
-import { useIntl, FormattedMessage } from 'umi';
+
 
 
 const UpdateForm = (props) => {
   const { updateModalVisible, updateModalVisibleChange, values, onSubmit } = props;
-  // console.log({values});
+
   return (
     <>
       {
@@ -29,9 +29,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.responsibilityName" defaultMessage="医院名是必填项" />
-                ),
+                message:'医院名是必填项',
               },
             ]}
             width="sm"
@@ -41,9 +39,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.isGatherCenter" defaultMessage="请选择是否为汇总中心" />
-                ),
+                message:'请选择是否为汇总中心',
               },
             ]}
             options={[
@@ -64,9 +60,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.responsibilityType" defaultMessage="请选择责任类型" />
-                ),
+                message:'请选择责任类型',
               },
             ]}
             options={[
@@ -87,9 +81,7 @@ const UpdateForm = (props) => {
             rules={[
               {
                 required: true,
-                message: (
-                  <FormattedMessage id="pages.searchTable.shareLevel" defaultMessage="请选择分摊级别" />
-                ),
+                message:'请选择分摊级别',
               },
             ]}
             options={[
@@ -116,9 +108,7 @@ const UpdateForm = (props) => {
                   rules={[
                     {
                       required: false,
-                      message: (
-                        <FormattedMessage id="pages.searchTable.parentName" defaultMessage="..." />
-                      ),
+                      message:'',
                     },
                   ]}
                   width="sm"

+ 14 - 47
src/pages/user/Login/index.jsx

@@ -1,21 +1,16 @@
 import {
-  AlipayCircleOutlined,
   LockOutlined,
-  MobileOutlined,
-  TaobaoCircleOutlined,
-  UserOutlined,
-  WeiboCircleOutlined,
+  UserOutlined
 } from '@ant-design/icons';
 import { Alert, message,notification} from 'antd';
 import React, { useState, useEffect } from 'react';
-import ProForm, { ProFormCaptcha, ProFormCheckbox, ProFormText, ProFormDependency, ProFormSelect } from '@ant-design/pro-form';
-import { useIntl, Link, history, FormattedMessage, SelectLang, useModel } from 'umi';
+import ProForm, {ProFormText} from '@ant-design/pro-form';
+import { Link, history, useModel } from 'umi';
 import Footer from '@/components/Footer';
-import { login, getSubHosp } from '@/services/user';
-import { getFakeCaptcha } from '@/services/ant-design-pro/login';
+import { login } from '@/services/user';
+
 import styles from './index.less';
-import CustomDialog from '@/components/Dialog';
-import { getQueryString } from '../../../utils.js';
+
 
 
 const LoginMessage = ({ content }) => (
@@ -37,15 +32,9 @@ const Login = () => {
   const { query = {} } = history.location;
   const { redirect,hospSign } = query;
   const { initialState, setInitialState } = useModel('@@initialState');
-  const intl = useIntl();
 
-  // const fetchUserInfo = async () => {
-  //   const userInfo = await initialState?.fetchUserInfo?.();
-  //   console.log({userInfo});
-  //   if (userInfo) {
-  //     await setInitialState((s) => ({ ...s, currentUser: userInfo }));
-  //   }
-  // };
+
+
 
   const { fetchSubHosp,sign } = initialState;
 
@@ -59,10 +48,7 @@ const Login = () => {
       const {status,msg,data} = loginResp;
       // console.log({status,msg,data});
       if (status == 200) {
-        const defaultloginSuccessMessage = intl.formatMessage({
-          id: 'pages.login.success',
-          defaultMessage: '登录成功!',
-        });
+        const defaultloginSuccessMessage = '登录成功!';
 
         if (localStorage.getItem('userData') == null || localStorage.getItem('userData') == undefined) {
           localStorage.setItem('userData',null);
@@ -91,10 +77,7 @@ const Login = () => {
       setUserLoginState(data);
     } catch (error) {
       console.log({error});
-      const defaultloginFailureMessage = intl.formatMessage({
-        id: 'pages.login.failure',
-        defaultMessage: '登录失败,请重试!',
-      });
+      const defaultloginFailureMessage = '登录失败,请重试!';
       message.error(defaultloginFailureMessage);
     }
 
@@ -136,10 +119,7 @@ const Login = () => {
             }}
             submitter={{
               searchConfig: {
-                submitText: intl.formatMessage({
-                  id: 'pages.login.submit',
-                  defaultMessage: '登录',
-                }),
+                submitText:'登录',
               },
               render: (_, dom) => dom.pop(),
               submitButtonProps: {
@@ -157,10 +137,7 @@ const Login = () => {
 
             {status === 'error' && loginType === 'account' && (
               <LoginMessage
-                content={intl.formatMessage({
-                  id: 'pages.login.accountLogin.errorMessage',
-                  defaultMessage: '账户或密码错误!',
-                })}
+                content={'账户或密码错误!'}
               />
             )}
             {type === 'account' && (
@@ -175,12 +152,7 @@ const Login = () => {
                   rules={[
                     {
                       required: true,
-                      message: (
-                        <FormattedMessage
-                          id="pages.login.username.required"
-                          defaultMessage="请输入用户名!"
-                        />
-                      ),
+                      message:'请输入用户名!',
                     },
                   ]}
                 />
@@ -194,12 +166,7 @@ const Login = () => {
                   rules={[
                     {
                       required: true,
-                      message: (
-                        <FormattedMessage
-                          id="pages.login.password.required"
-                          defaultMessage="请输入密码!"
-                        />
-                      ),
+                      message:'请输入密码!',
                     },
                   ]}
                 />

+ 2 - 2
src/utils.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 13:50:44
- * @LastEditTime: 2021-07-28 11:46:46
+ * @LastEditTime: 2021-08-03 17:46:47
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/utils.js
@@ -22,7 +22,7 @@
 const getQueryString = (name)=>{
     let reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
     let r = window.location.search.substr(1).match(reg);
-    console.log({r});
+ 
     if (r != null) {
         return decodeURIComponent(r[2]);
     };

BIN
成本核算_build0802.zip