lanjianrong 4 tahun lalu
induk
melakukan
60ad1fca04

+ 8 - 4
package.json

@@ -78,7 +78,11 @@
   },
   "devDependencies": {
     "@ant-design/pro-cli": "^1.0.18",
+    "@babel/plugin-proposal-class-properties": "^7.16.7",
+    "@babel/plugin-proposal-decorators": "^7.17.2",
     "@babel/plugin-proposal-optional-chaining": "^7.13.12",
+    "@babel/preset-env": "^7.16.11",
+    "@babel/preset-react": "^7.16.7",
     "@types/classnames": "^2.2.7",
     "@types/express": "^4.17.0",
     "@types/history": "^4.7.2",
@@ -93,10 +97,6 @@
     "@umijs/plugin-esbuild": "^1.0.1",
     "@umijs/plugin-sass": "^1.1.1",
     "@umijs/preset-ant-design-pro": "^1.2.0",
-    "eslint-plugin-javascript": "^1.3.4",
-    "eslint-plugin-jsx": "^0.1.0",
-    "eslint-plugin-react": "^7.24.0",
-    "eslint-plugin-typescript": "^0.14.0",
     "@umijs/preset-react": "1.8.12",
     "@umijs/yorkie": "^2.0.3",
     "agent-base": "^6.0.2",
@@ -112,6 +112,10 @@
     "enzyme": "^3.11.0",
     "eslint": "^7.18.0",
     "eslint-plugin-import": "^2.23.4",
+    "eslint-plugin-javascript": "^1.3.4",
+    "eslint-plugin-jsx": "^0.1.0",
+    "eslint-plugin-react": "^7.24.0",
+    "eslint-plugin-typescript": "^0.14.0",
     "express": "^4.17.1",
     "gh-pages": "^3.0.0",
     "jsdom-global": "^3.0.2",

File diff ditekan karena terlalu besar
+ 1057 - 8
pnpm-lock.yaml


+ 0 - 71
src/models/single.js

@@ -1,71 +0,0 @@
-// 单例控制器
-
-import { isNullOrUnDef } from '@/utils/is'
-
-export default {
-  namespace: 'single',
-  state: {
-    drawer: {
-      visible: false,
-      config: {}
-    },
-    modal: {
-      visible: false,
-      // search: null,
-      config: {}
-    }
-  },
-  effects: {
-    *toggleDrawer({ payload }, { put }) {
-      yield put({
-        type: 'changeDrawer',
-        payload
-      })
-    },
-    *toggleModal({ payload }, { put }) {
-      yield put({
-        type: 'changeModal',
-        payload
-      })
-    },
-    *setProps({ payload }, { put }) {
-      yield put({
-        type: 'changeState',
-        payload
-      })
-    }
-  },
-  reducers: {
-    // 改变state对应type的config
-    changeState(state, action) {
-      return {
-        ...state,
-        [action.payload.type]: { ...state[action.payload.type], config: action.payload.config }
-      }
-    },
-    changeDrawer(state, action) {
-      if (isNullOrUnDef(action.payload)) {
-        return {
-          ...state,
-          drawer: { ...state.drawer, visible: !state.drawer.visible }
-        }
-      }
-      return {
-        ...state,
-        drawer: { ...state.drawer, visible: action.payload }
-      }
-    },
-    changeModal(state, action) {
-      if (isNullOrUnDef(action.payload)) {
-        return {
-          ...state,
-          modal: { ...state.modal, visible: !state.modal.visible }
-        }
-      }
-      return {
-        ...state,
-        modal: { ...state.modal, visible: action.payload }
-      }
-    }
-  }
-}

+ 8 - 1
src/pages/Customer/Company/components/CompanyDetail/index.jsx

@@ -32,7 +32,14 @@ const CompanyDetail = props => {
   const initData = async (id = dataId) => {
     setState({ ...state, loading: true })
     const {
-      data: { customer = {}, log = [], serviceLog = [], software = {}, client = {}, business = {} },
+      data: {
+        customer = {},
+        log = [],
+        serviceLog = [],
+        software = {},
+        client = {},
+        business = {}
+      } = {},
       code = -1
     } = await apiCompanyDetail(id)
     if (code === consts.RET_CODE.SUCCESS) {