@zgfe/modules-settings 1.2.2-node.0 → 1.2.3-log.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/es/constants/api.d.ts +5 -0
  2. package/es/constants/api.js +9 -0
  3. package/es/modules/appSettings/member/index.js +5 -10
  4. package/es/modules/appSettings/member/modal.d.ts +0 -1
  5. package/es/modules/appSettings/member/modal.js +0 -4
  6. package/es/modules/companySetting/edit/authConfig.d.ts +0 -1
  7. package/es/modules/companySetting/edit/authConfig.js +17 -18
  8. package/es/modules/companySetting/edit/authConfigCEP.d.ts +0 -1
  9. package/es/modules/companySetting/edit/authConfigCEP.js +4 -5
  10. package/es/modules/companySetting/edit/user.d.ts +0 -1
  11. package/es/modules/companySetting/edit/user.js +1 -4
  12. package/es/modules/companySetting/edit/userGroup.d.ts +0 -1
  13. package/es/modules/companySetting/edit/userGroup.js +1 -6
  14. package/es/modules/companySetting/index.js +12 -9
  15. package/es/modules/companySetting/operationLog/index.d.ts +4 -0
  16. package/es/modules/companySetting/operationLog/index.js +187 -0
  17. package/es/modules/companySetting/operationLog/index.less +21 -0
  18. package/es/modules/companySetting/user/index.d.ts +0 -1
  19. package/es/modules/companySetting/user/index.js +0 -5
  20. package/es/modules/companySetting/userGroup/authConfigDetail.d.ts +0 -1
  21. package/es/modules/companySetting/userGroup/authConfigDetail.js +8 -9
  22. package/es/modules/companySetting/userGroup/groupItem.d.ts +0 -1
  23. package/es/modules/companySetting/userGroup/groupItem.js +0 -2
  24. package/es/modules/companySetting/userGroup/index.d.ts +0 -1
  25. package/es/modules/companySetting/userGroup/index.js +0 -3
  26. package/es/modules/personalSetting/index.js +5 -0
  27. package/es/modules/personalSetting/securityLog/index.d.ts +4 -0
  28. package/es/modules/personalSetting/securityLog/index.js +156 -0
  29. package/es/modules/personalSetting/securityLog/index.less +10 -0
  30. package/es/modules/systemSetting/notice/index.js +16 -16
  31. package/es/utils/functionalPermissions.d.ts +0 -1
  32. package/es/utils/functionalPermissions.js +5 -207
  33. package/package.json +2 -2
@@ -46,5 +46,10 @@ declare let apis: {
46
46
  mfa: {
47
47
  resetMfa: string;
48
48
  };
49
+ log: {
50
+ operationLog: string;
51
+ securityLog: string;
52
+ getLogTime: string;
53
+ };
49
54
  };
50
55
  export default apis;
@@ -52,6 +52,15 @@ var apis = {
52
52
  // 多因子认证
53
53
  mfa: {
54
54
  resetMfa: '/user/v2resetMfa.jsp'
55
+ },
56
+ // 日志
57
+ log: {
58
+ // 操作日志
59
+ operationLog: '/zg/web/v2/system/operationLog',
60
+ // 安全日志
61
+ securityLog: '/zg/web/v2/system/securityLog',
62
+ // 时间范围查询
63
+ getLogTime: '/zg/web/v2/system/getLogTime'
55
64
  }
56
65
  };
57
66
  export default apis;
@@ -39,16 +39,12 @@ var AppMember = function AppMember() {
39
39
  setLeftMenus = _useState10[1];
40
40
  var _useState11 = useState(false),
41
41
  _useState12 = _slicedToArray(_useState11, 2),
42
- isMarsUi = _useState12[0],
43
- setIsMarsUi = _useState12[1];
44
- var _useState13 = useState(false),
42
+ isModalOpen = _useState12[0],
43
+ setIsModalOpen = _useState12[1];
44
+ var _useState13 = useState({}),
45
45
  _useState14 = _slicedToArray(_useState13, 2),
46
- isModalOpen = _useState14[0],
47
- setIsModalOpen = _useState14[1];
48
- var _useState15 = useState({}),
49
- _useState16 = _slicedToArray(_useState15, 2),
50
- modalData = _useState16[0],
51
- setModalData = _useState16[1];
46
+ modalData = _useState14[0],
47
+ setModalData = _useState14[1];
52
48
  var setingModalhandle = function setingModalhandle(data, dealArr) {
53
49
  setModalData({
54
50
  data: data,
@@ -196,7 +192,6 @@ var AppMember = function AppMember() {
196
192
  setIsModalOpen: setIsModalOpen,
197
193
  companyAppList: companyAppList,
198
194
  leftMenus: leftMenus,
199
- isMarsUi: isMarsUi,
200
195
  data: modalData.data,
201
196
  dealArr: modalData.dealArr
202
197
  }));
@@ -7,7 +7,6 @@ declare const SetingModal: React.FC<{
7
7
  data: any;
8
8
  companyAppList: AppListItem[];
9
9
  leftMenus: LeftMenusItem[];
10
- isMarsUi: boolean;
11
10
  dealArr: any;
12
11
  }>;
13
12
  export default SetingModal;
@@ -11,7 +11,6 @@ var SetingModal = function SetingModal(props) {
11
11
  data = props.data,
12
12
  companyAppList = props.companyAppList,
13
13
  leftMenus = props.leftMenus,
14
- isMarsUi = props.isMarsUi,
15
14
  dealArr = props.dealArr;
16
15
  return /*#__PURE__*/React.createElement(Modal, {
17
16
  className: "seting-modal-box",
@@ -30,7 +29,6 @@ var SetingModal = function SetingModal(props) {
30
29
  authConfig: data.authConfig.defaultAuth,
31
30
  companyAppList: companyAppList,
32
31
  leftMenus: leftMenus,
33
- isMarsUi: isMarsUi,
34
32
  id: data.id,
35
33
  type: 1,
36
34
  serviceType: currentUser === null || currentUser === void 0 ? void 0 : currentUser.serviceType
@@ -44,7 +42,6 @@ var SetingModal = function SetingModal(props) {
44
42
  key: item.id,
45
43
  authConfig: item.authConfig,
46
44
  leftMenus: leftMenus,
47
- isMarsUi: isMarsUi,
48
45
  companyAppList: companyAppList,
49
46
  name: item === null || item === void 0 ? void 0 : item.groupName,
50
47
  groupId: item.id,
@@ -57,7 +54,6 @@ var SetingModal = function SetingModal(props) {
57
54
  funAuth: []
58
55
  },
59
56
  leftMenus: leftMenus,
60
- isMarsUi: isMarsUi,
61
57
  companyAppList: companyAppList,
62
58
  name: '',
63
59
  type: 2,
@@ -4,7 +4,6 @@ import { AppListItem, Config, LeftMenusItem } from '../../../types';
4
4
  declare const Info: React.FC<{
5
5
  config: Config;
6
6
  appList: Array<AppListItem>;
7
- isMarsUi: boolean;
8
7
  leftMenus: LeftMenusItem[];
9
8
  ref: any;
10
9
  }>;
@@ -12,7 +12,6 @@ import AuthGroup from './authGroup';
12
12
  var Info = /*#__PURE__*/forwardRef(function (props, ref) {
13
13
  var config = props.config,
14
14
  appList = props.appList,
15
- isMarsUi = props.isMarsUi,
16
15
  leftMenus = props.leftMenus;
17
16
  var _useState = useState({}),
18
17
  _useState2 = _slicedToArray(_useState, 2),
@@ -59,7 +58,7 @@ var Info = /*#__PURE__*/forwardRef(function (props, ref) {
59
58
  console.log('functionalPermissions');
60
59
  if (functionalPermissions.checked) {
61
60
  funAuth.push({
62
- resource: funPermissions[isMarsUi ? 'mars' : 'standard'].all.key,
61
+ resource: funPermissions['standard'].all.key,
63
62
  opts: [constants.functionOpts.all]
64
63
  });
65
64
  functionalPermissions.children && functionalPermissions.children.forEach(function (item) {
@@ -201,7 +200,7 @@ var Info = /*#__PURE__*/forwardRef(function (props, ref) {
201
200
  console.log(map);
202
201
  // 顶部菜单功能权限
203
202
  var loopFormatTopMenu = function loopFormatTopMenu(topMenu, checkAll) {
204
- var menuFunPerConstants = funPermissions[isMarsUi ? 'mars' : 'standard'][topMenu.name];
203
+ var menuFunPerConstants = funPermissions['standard'][topMenu.name];
205
204
  // 菜单不在权限配置中
206
205
  if (!menuFunPerConstants) {
207
206
  return null;
@@ -259,7 +258,7 @@ var Info = /*#__PURE__*/forwardRef(function (props, ref) {
259
258
  return formatMenu;
260
259
  };
261
260
  var menuFun = [];
262
- var isAll = !!map[funPermissions[isMarsUi ? 'mars' : 'standard'].all.key];
261
+ var isAll = !!map[funPermissions['standard'].all.key];
263
262
  console.log('dskfhk', leftMenus);
264
263
  leftMenus.forEach(function (menu) {
265
264
  var topMenuFun = loopFormatTopMenu(menu, isAll);
@@ -270,29 +269,29 @@ var Info = /*#__PURE__*/forwardRef(function (props, ref) {
270
269
  menuFun.push(topMenuFun);
271
270
  }
272
271
  });
273
- var settingIsAll = !!map[funPermissions[isMarsUi ? 'mars' : 'standard'].setting.default.key];
272
+ var settingIsAll = !!map[funPermissions['standard'].setting.default.key];
274
273
  menuFun.push({
275
- describe: funPermissions[isMarsUi ? 'mars' : 'standard'].setting.default.describe,
276
- key: funPermissions[isMarsUi ? 'mars' : 'standard'].setting.default.key,
277
- checked: isAll || !!map[funPermissions[isMarsUi ? 'mars' : 'standard'].setting.default.key],
274
+ describe: funPermissions['standard'].setting.default.describe,
275
+ key: funPermissions['standard'].setting.default.key,
276
+ checked: isAll || !!map[funPermissions['standard'].setting.default.key],
278
277
  indeterminate: false,
279
278
  disable: false,
280
279
  supportVirtualApp: true,
281
280
  children: [{
282
- // ...funPermissions[isMarsUi ? 'mars' : 'standard'].setting.company,
283
- describe: funPermissions[isMarsUi ? 'mars' : 'standard'].setting.company.describe,
284
- key: funPermissions[isMarsUi ? 'mars' : 'standard'].setting.company.key,
281
+ // ...funPermissions['standard'].setting.company,
282
+ describe: funPermissions['standard'].setting.company.describe,
283
+ key: funPermissions['standard'].setting.company.key,
285
284
  disable: false,
286
285
  supportVirtualApp: true,
287
- checked: isAll || settingIsAll || !!map[funPermissions[isMarsUi ? 'mars' : 'standard'].setting.company.key],
286
+ checked: isAll || settingIsAll || !!map[funPermissions['standard'].setting.company.key],
288
287
  children: []
289
288
  }, {
290
- // ...funPermissions[isMarsUi ? 'mars' : 'standard'].setting.app,
291
- describe: funPermissions[isMarsUi ? 'mars' : 'standard'].setting.app.describe,
292
- key: funPermissions[isMarsUi ? 'mars' : 'standard'].setting.app.key,
289
+ // ...funPermissions['standard'].setting.app,
290
+ describe: funPermissions['standard'].setting.app.describe,
291
+ key: funPermissions['standard'].setting.app.key,
293
292
  disable: false,
294
293
  supportVirtualApp: true,
295
- checked: isAll || settingIsAll || !!map[funPermissions[isMarsUi ? 'mars' : 'standard'].setting.app.key],
294
+ checked: isAll || settingIsAll || !!map[funPermissions['standard'].setting.app.key],
296
295
  children: []
297
296
  }]
298
297
  });
@@ -305,8 +304,8 @@ var Info = /*#__PURE__*/forwardRef(function (props, ref) {
305
304
  console.log(menuFun);
306
305
  setFunctionalPermissions({
307
306
  describe: '功能权限',
308
- key: funPermissions[isMarsUi ? 'mars' : 'standard'].all.key,
309
- // checked: !!map[funPermissions[isMarsUi ? 'mars' : 'standard'].all.key],
307
+ key: funPermissions['standard'].all.key,
308
+ // checked: !!map[funPermissions['standard'].all.key],
310
309
  checked: checkedArr.length === menuFun.length,
311
310
  disable: false,
312
311
  supportVirtualApp: true,
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import './styles/authConfig.less';
3
3
  import { CheckAll, DataListItem } from '../../../types';
4
4
  declare const AuthConfigCEP: React.FC<{
5
- isMarsUi: boolean;
6
5
  CEPData: [Array<DataListItem>, Array<DataListItem>, CheckAll];
7
6
  ref: any;
8
7
  }>;
@@ -16,8 +16,7 @@ import constants from './../../../utils/constants';
16
16
  import funPermissions from './../../../utils/functionalPermissions';
17
17
  import AuthGroup from './authGroup';
18
18
  var AuthConfigCEP = /*#__PURE__*/forwardRef(function (props, ref) {
19
- var isMarsUi = props.isMarsUi,
20
- CEPData = props.CEPData;
19
+ var CEPData = props.CEPData;
21
20
  var _useState = useState({}),
22
21
  _useState2 = _slicedToArray(_useState, 2),
23
22
  dataPermissions = _useState2[0],
@@ -169,8 +168,8 @@ var AuthConfigCEP = /*#__PURE__*/forwardRef(function (props, ref) {
169
168
  });
170
169
  setFunctionalPermissions({
171
170
  describe: '功能权限',
172
- key: funPermissions[isMarsUi ? 'mars' : 'standard'].all.key,
173
- // checked: !!map[funPermissions[isMarsUi ? 'mars' : 'standard'].all.key],
171
+ key: funPermissions['standard'].all.key,
172
+ // checked: !!map[funPermissions['standard'].all.key],
174
173
  checked: checkedFunArr.length === dealFunConfigList.length,
175
174
  disable: false,
176
175
  supportVirtualApp: true,
@@ -187,7 +186,7 @@ var AuthConfigCEP = /*#__PURE__*/forwardRef(function (props, ref) {
187
186
  setDataPermissions({
188
187
  key: 1,
189
188
  describe: '数据权限',
190
- // checked: !!map[funPermissions[isMarsUi ? 'mars' : 'standard'].all.key],
189
+ // checked: !!map[funPermissions['standard'].all.key],
191
190
  checked: checkedAppArr.length === dealAppConfigList.length,
192
191
  indeterminate: !(checkedAppArr.length === dealAppConfigList.length || !checkedAppArr.length && !indeterminateAppArr.length),
193
192
  children: dealAppConfigList
@@ -6,7 +6,6 @@ declare const Info: React.FC<{
6
6
  data: AllMembersItem;
7
7
  allGroupInfos: Array<AllGroupInfosItem>;
8
8
  companyAppList: AppListItem[];
9
- isMarsUi: boolean;
10
9
  leftMenus: LeftMenusItem[];
11
10
  serviceType: number;
12
11
  onCancel: () => void;
@@ -23,7 +23,6 @@ var Info = function Info(props) {
23
23
  data = props.data,
24
24
  allGroupInfos = props.allGroupInfos,
25
25
  companyAppList = props.companyAppList,
26
- isMarsUi = props.isMarsUi,
27
26
  leftMenus = props.leftMenus,
28
27
  serviceType = props.serviceType,
29
28
  onCancel = props.onCancel,
@@ -277,15 +276,13 @@ var Info = function Info(props) {
277
276
  ref: refAuthConfig,
278
277
  config: data.authConfig ? data.authConfig.defaultAuth : {},
279
278
  appList: companyAppList,
280
- isMarsUi: isMarsUi,
281
279
  leftMenus: leftMenus
282
280
  })) : null, !serviceType || serviceType === 2 ? /*#__PURE__*/React.createElement(Tabs.TabPane, {
283
281
  tab: "CEP",
284
282
  key: "cep"
285
283
  }, /*#__PURE__*/React.createElement(AuthConfigCEP, {
286
284
  ref: refAuthCEPConfig,
287
- CEPData: CEPData,
288
- isMarsUi: isMarsUi
285
+ CEPData: CEPData
289
286
  })) : null), /*#__PURE__*/React.createElement("div", {
290
287
  className: "company-setting-footer"
291
288
  }, /*#__PURE__*/React.createElement(Button, {
@@ -6,7 +6,6 @@ declare const CompanySettingUserGroup: React.FC<{
6
6
  data: AllGroupInfosItem | undefined;
7
7
  allGroupInfos: Array<AllGroupInfosItem>;
8
8
  companyAppList: AppListItem[];
9
- isMarsUi: boolean;
10
9
  leftMenus: LeftMenusItem[];
11
10
  isAdmin: boolean;
12
11
  serviceType: number;
@@ -24,7 +24,6 @@ var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
24
24
  data = props.data,
25
25
  allGroupInfos = props.allGroupInfos,
26
26
  companyAppList = props.companyAppList,
27
- isMarsUi = props.isMarsUi,
28
27
  leftMenus = props.leftMenus,
29
28
  isAdmin = props.isAdmin,
30
29
  serviceType = props.serviceType,
@@ -353,17 +352,13 @@ var CompanySettingUserGroup = function CompanySettingUserGroup(props) {
353
352
  ref: refAuthConfig,
354
353
  config: data && data.authConfig || {},
355
354
  appList: companyAppList,
356
- isMarsUi: isMarsUi,
357
355
  leftMenus: leftMenus
358
356
  })) : null, !serviceType || serviceType === 2 ? /*#__PURE__*/React.createElement(Tabs.TabPane, {
359
357
  tab: "CEP",
360
358
  key: "cep"
361
359
  }, /*#__PURE__*/React.createElement(AuthConfigCEP, {
362
360
  ref: refAuthCEPConfig,
363
- CEPData: CEPData,
364
- // config={data.authConfig}
365
- // appList={companyAppList}
366
- isMarsUi: isMarsUi
361
+ CEPData: CEPData
367
362
  })) : null), /*#__PURE__*/React.createElement("div", {
368
363
  className: "company-setting-footer"
369
364
  }, /*#__PURE__*/React.createElement(Button, {
@@ -25,6 +25,7 @@ import AppList from './appList';
25
25
  import VirtualApp from './virtualApp';
26
26
  import Cost from './cost';
27
27
  import WechatBinding from './wechatBinding';
28
+ import OperationLog from './operationLog';
28
29
  var CompanySetting = function CompanySetting(props) {
29
30
  var showWeChatMenu = props.showWeChatMenu,
30
31
  showMarketMenu = props.showMarketMenu,
@@ -36,7 +37,6 @@ var CompanySetting = function CompanySetting(props) {
36
37
  envs = _useContext.envs;
37
38
  var _ref = envs || {},
38
39
  zgText = _ref.zgText,
39
- isMarsUi = _ref.isMarsUi,
40
40
  showVirtualApp = _ref.showVirtualApp,
41
41
  showDataDaily = _ref.showDataDaily,
42
42
  ENVIRONMENT = _ref.ENVIRONMENT;
@@ -640,7 +640,7 @@ var CompanySetting = function CompanySetting(props) {
640
640
  companyName: companyName,
641
641
  changeCompanyNameCallback: changeCompanyNameCallback
642
642
  }),
643
- hidden: isMarsUi
643
+ hidden: false
644
644
  }, {
645
645
  key: 'userGroup',
646
646
  label: '用户组',
@@ -649,13 +649,12 @@ var CompanySetting = function CompanySetting(props) {
649
649
  companyAppList: companyAppList,
650
650
  allGroupInfos: allGroupInfos,
651
651
  leftMenus: leftMenus,
652
- isMarsUi: isMarsUi,
653
652
  isAdmin: isAdmin,
654
653
  delGroupCallback: delGroupCallback,
655
654
  updateGroupAuthCallback: updateGroupAuthCallback,
656
655
  serviceType: serviceType
657
656
  }),
658
- hidden: isMarsUi
657
+ hidden: false
659
658
  }, {
660
659
  key: 'user',
661
660
  label: '用户',
@@ -667,7 +666,6 @@ var CompanySetting = function CompanySetting(props) {
667
666
  companyAppList: companyAppList,
668
667
  allGroupInfos: allGroupInfos,
669
668
  leftMenus: leftMenus,
670
- isMarsUi: isMarsUi,
671
669
  removeUserCallback: removeUserCallback,
672
670
  changeUserAuthCallback: changeUserAuthCallback,
673
671
  createMembersCallback: createMembersCallback,
@@ -675,7 +673,7 @@ var CompanySetting = function CompanySetting(props) {
675
673
  isAdmin: isAdmin,
676
674
  serviceType: serviceType
677
675
  }),
678
- hidden: isMarsUi
676
+ hidden: false
679
677
  }, {
680
678
  key: 'appList',
681
679
  label: '应用',
@@ -696,7 +694,7 @@ var CompanySetting = function CompanySetting(props) {
696
694
  gotoAppPanel: gotoAppPanel,
697
695
  closeCreateCallback: closeCreateCallback
698
696
  }),
699
- hidden: isMarsUi
697
+ hidden: false
700
698
  }, {
701
699
  key: 'virtualApp',
702
700
  label: '虚拟应用',
@@ -709,7 +707,7 @@ var CompanySetting = function CompanySetting(props) {
709
707
  delVirtualAppCallback: delVirtualAppCallback,
710
708
  editVirtualAppCallback: editVirtualAppCallback
711
709
  }),
712
- hidden: !showVirtualApp || isMarsUi
710
+ hidden: !showVirtualApp
713
711
  }, {
714
712
  key: 'cost',
715
713
  label: '套餐',
@@ -718,12 +716,17 @@ var CompanySetting = function CompanySetting(props) {
718
716
  companyAppList: companyAppList,
719
717
  companyId: companyId
720
718
  }),
721
- hidden: isMarsUi
719
+ hidden: false
722
720
  }, {
723
721
  key: 'weChatBinding',
724
722
  label: '微信账号绑定',
725
723
  content: /*#__PURE__*/React.createElement(WechatBinding, null),
726
724
  hidden: !(showWeChatMenu && showMarketMenu && showDataDaily && isAdmin)
725
+ }, {
726
+ key: 'operationLog',
727
+ label: '操作日志',
728
+ content: /*#__PURE__*/React.createElement(OperationLog, null),
729
+ hidden: !isAdmin
727
730
  }];
728
731
  return /*#__PURE__*/React.createElement("div", {
729
732
  className: "setting setting-content company-setting"
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ declare const OperationLog: React.FC;
4
+ export default OperationLog;
@@ -0,0 +1,187 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ import { BizTable } from '@zgfe/business-lib';
14
+ import React, { useEffect, useState } from 'react';
15
+ import request from '../../../utils/ajax';
16
+ import apis from '../../../constants/api';
17
+ import { DatePicker, Radio } from 'antd';
18
+ import locale from 'antd/es/date-picker/locale/zh_CN';
19
+ import moment from 'moment';
20
+ import './index.less';
21
+ var OperationLog = function OperationLog() {
22
+ var classPrefix = 'operation-log-page';
23
+ var _useState = useState({
24
+ page: 1,
25
+ size: 10,
26
+ year: '',
27
+ month: ''
28
+ }),
29
+ _useState2 = _slicedToArray(_useState, 2),
30
+ condition = _useState2[0],
31
+ setCondition = _useState2[1];
32
+ var _useState3 = useState(true),
33
+ _useState4 = _slicedToArray(_useState3, 2),
34
+ loading = _useState4[0],
35
+ setLoading = _useState4[1];
36
+ var _useState5 = useState(0),
37
+ _useState6 = _slicedToArray(_useState5, 2),
38
+ total = _useState6[0],
39
+ setTotal = _useState6[1];
40
+ var _useState7 = useState('1'),
41
+ _useState8 = _slicedToArray(_useState7, 2),
42
+ logType = _useState8[0],
43
+ setLogType = _useState8[1];
44
+ var _useState9 = useState([]),
45
+ _useState10 = _slicedToArray(_useState9, 2),
46
+ dateRange = _useState10[0],
47
+ setDateRange = _useState10[1];
48
+ var _useState11 = useState(0),
49
+ _useState12 = _slicedToArray(_useState11, 2),
50
+ time = _useState12[0],
51
+ setTime = _useState12[1];
52
+ var _useState13 = useState([]),
53
+ _useState14 = _slicedToArray(_useState13, 2),
54
+ tableData = _useState14[0],
55
+ setTableData = _useState14[1];
56
+ var columns = [{
57
+ title: '应用(应用ID)',
58
+ dataIndex: 'appId',
59
+ key: 'appId'
60
+ }, {
61
+ title: '操作人(登录账号)',
62
+ dataIndex: 'operatorName',
63
+ key: 'operatorName'
64
+ }, {
65
+ title: '功能模块',
66
+ dataIndex: 'targetType',
67
+ key: 'targetType'
68
+ }, {
69
+ title: '操作类型',
70
+ dataIndex: 'operationType',
71
+ key: 'operationType'
72
+ }, {
73
+ title: '操作设备',
74
+ dataIndex: 'userAgent',
75
+ key: 'userAgent'
76
+ }, {
77
+ title: 'IP地址',
78
+ dataIndex: 'userAccessIp',
79
+ key: 'userAccessIp'
80
+ }, {
81
+ title: '操作时间',
82
+ dataIndex: 'gmtCreate',
83
+ key: 'gmtCreate'
84
+ }];
85
+ useEffect(function () {
86
+ queryData();
87
+ }, [logType]);
88
+ useEffect(function () {
89
+ if (time) clearTimeout(time);
90
+ setTime(setTimeout(function () {
91
+ console.log(condition, 'condition');
92
+ queryLog();
93
+ }, 500));
94
+ }, [condition]);
95
+ function queryData() {
96
+ request(apis.log.getLogTime, {
97
+ method: 'get',
98
+ params: {
99
+ type: logType
100
+ }
101
+ }).then(function (res) {
102
+ if (parseInt(res === null || res === void 0 ? void 0 : res.code) == 100000) {
103
+ var maxDate = res.data[res.data.length - 1] || '';
104
+ setDateRange(res.data);
105
+ setCondition(function (v) {
106
+ return _objectSpread(_objectSpread({}, v), {}, {
107
+ year: moment(maxDate).format('YYYY'),
108
+ month: moment(maxDate).format('MM')
109
+ });
110
+ });
111
+ }
112
+ });
113
+ }
114
+ function queryLog() {
115
+ setLoading(true);
116
+ if (!condition.year || !condition.month) return;
117
+ request(apis.log.operationLog, {
118
+ method: 'post',
119
+ data: _objectSpread({
120
+ type: logType
121
+ }, condition)
122
+ }).then(function (res) {
123
+ if (parseInt(res === null || res === void 0 ? void 0 : res.code) == 100000) {
124
+ setTotal(res.data.count);
125
+ setTableData(res.data.logs);
126
+ setLoading(false);
127
+ }
128
+ });
129
+ }
130
+ function disabledDate(current) {
131
+ var date = moment(current._d).format('YYYYMM');
132
+ return !dateRange.includes(date);
133
+ }
134
+ function onChangeTime(current) {
135
+ setCondition(function (v) {
136
+ return _objectSpread(_objectSpread({}, v), {}, {
137
+ year: moment(current._d).format('YYYY'),
138
+ month: moment(current._d).format('MM')
139
+ });
140
+ });
141
+ }
142
+ function onChangeType(data) {
143
+ setLogType(data.target.value);
144
+ }
145
+ function onChangeTable(data) {
146
+ setCondition(function (v) {
147
+ return _objectSpread(_objectSpread({}, v), {}, {
148
+ page: data.current,
149
+ size: data.pageSize
150
+ });
151
+ });
152
+ }
153
+ return /*#__PURE__*/React.createElement("div", {
154
+ className: classPrefix
155
+ }, /*#__PURE__*/React.createElement("div", {
156
+ className: "".concat(classPrefix, "-header")
157
+ }, /*#__PURE__*/React.createElement(Radio.Group, {
158
+ onChange: onChangeType,
159
+ value: logType
160
+ }, /*#__PURE__*/React.createElement(Radio.Button, {
161
+ value: "1"
162
+ }, "\u67E5\u8BE2\u65E5\u5FD7"), /*#__PURE__*/React.createElement(Radio.Button, {
163
+ value: "2"
164
+ }, "\u64CD\u4F5C\u65E5\u5FD7"), /*#__PURE__*/React.createElement(Radio.Button, {
165
+ value: "3"
166
+ }, "\u6743\u9650\u65E5\u5FD7")), condition.year && /*#__PURE__*/React.createElement(DatePicker, {
167
+ value: moment("".concat(condition.year, "-").concat(condition.month), 'YYYY-MM'),
168
+ picker: "month",
169
+ disabledDate: disabledDate,
170
+ locale: locale,
171
+ onChange: onChangeTime,
172
+ inputReadOnly: true,
173
+ allowClear: false
174
+ })), /*#__PURE__*/React.createElement("div", {
175
+ className: "".concat(classPrefix, "-table")
176
+ }, /*#__PURE__*/React.createElement(BizTable, {
177
+ columns: columns,
178
+ onChange: onChangeTable,
179
+ dataSource: tableData,
180
+ total: total,
181
+ loading: loading,
182
+ scroll: {
183
+ x: 'max-content'
184
+ }
185
+ })));
186
+ };
187
+ export default OperationLog;
@@ -0,0 +1,21 @@
1
+ .operation-log-page {
2
+ display: flex;
3
+ flex-direction: column;
4
+ &-header {
5
+ display: flex;
6
+ justify-content: space-between;
7
+ margin-bottom: 30px;
8
+ }
9
+ &-table {
10
+ flex: 1;
11
+ overflow-y: auto;
12
+ }
13
+ .ant-radio-group {
14
+ .ant-radio-button-wrapper:first-child {
15
+ border-radius: 4px 0 0 4px;
16
+ }
17
+ .ant-radio-button-wrapper:last-child {
18
+ border-radius: 0 4px 4px 0;
19
+ }
20
+ }
21
+ }
@@ -10,7 +10,6 @@ declare const User: React.FC<{
10
10
  groupHashList: GroupHashList;
11
11
  companyAppList: AppListItem[];
12
12
  leftMenus: LeftMenusItem[];
13
- isMarsUi: boolean;
14
13
  isAdmin: boolean;
15
14
  serviceType: number;
16
15
  removeUserCallback: (delIndex: number) => void;
@@ -28,7 +28,6 @@ var User = function User(props) {
28
28
  groupHashList = props.groupHashList,
29
29
  companyAppList = props.companyAppList,
30
30
  leftMenus = props.leftMenus,
31
- isMarsUi = props.isMarsUi,
32
31
  isAdmin = props.isAdmin,
33
32
  serviceType = props.serviceType,
34
33
  removeUserCallback = props.removeUserCallback,
@@ -385,7 +384,6 @@ var User = function User(props) {
385
384
  authConfig: data.authConfig ? data.authConfig.defaultAuth : {},
386
385
  companyAppList: companyAppList,
387
386
  leftMenus: leftMenus,
388
- isMarsUi: isMarsUi,
389
387
  id: data.id,
390
388
  type: 1,
391
389
  serviceType: serviceType
@@ -402,7 +400,6 @@ var User = function User(props) {
402
400
  key: item.id,
403
401
  authConfig: item.authConfig ? item.authConfig : {},
404
402
  leftMenus: leftMenus,
405
- isMarsUi: isMarsUi,
406
403
  companyAppList: companyAppList,
407
404
  name: item.groupName,
408
405
  groupId: item.id,
@@ -415,7 +412,6 @@ var User = function User(props) {
415
412
  funAuth: []
416
413
  },
417
414
  leftMenus: leftMenus,
418
- isMarsUi: isMarsUi,
419
415
  companyAppList: companyAppList,
420
416
  name: '',
421
417
  type: 2,
@@ -471,7 +467,6 @@ var User = function User(props) {
471
467
  onCancel: function onCancel() {
472
468
  return setUserEditAuthState(false);
473
469
  },
474
- isMarsUi: isMarsUi,
475
470
  leftMenus: leftMenus,
476
471
  changeUserAuthCallback: function changeUserAuthCallback(id) {
477
472
  getMenbers();