@zgfe/modules-settings 1.2.4-alpha.2 → 1.2.4-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.
@@ -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;
@@ -125,8 +125,8 @@ var AppMember = function AppMember() {
125
125
  request(apis.app.queryAppList, {
126
126
  method: 'get'
127
127
  }).then(function (res) {
128
- console.log(222, res, res === null || res === void 0 ? void 0 : res.data.appList);
129
- setCompanyAppList((res === null || res === void 0 ? void 0 : res.data.appList) || []);
128
+ var _res$data;
129
+ setCompanyAppList((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.appList) || []);
130
130
  });
131
131
  // 请求左侧菜单
132
132
  request(apis.app.queryLeftMenus, {
@@ -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,
@@ -92,9 +93,6 @@ var CompanySetting = function CompanySetting(props) {
92
93
  _useState24 = _slicedToArray(_useState23, 2),
93
94
  companyAppList = _useState24[0],
94
95
  setCompanyAppList = _useState24[1];
95
- useEffect(function () {
96
- console.log('companyAppList', companyAppList);
97
- }, [companyAppList]);
98
96
  var _useState25 = useState([]),
99
97
  _useState26 = _slicedToArray(_useState25, 2),
100
98
  appList = _useState26[0],
@@ -183,9 +181,7 @@ var CompanySetting = function CompanySetting(props) {
183
181
  request(api.app.queryAppList, {
184
182
  method: 'get'
185
183
  }).then(function (res) {
186
- console.log(111, res, res.data.appList);
187
184
  setCompanyAppList(res && res.data.appList || []);
188
- console.log(111333, res && res.data.appList);
189
185
  if (settingCurrentUser && authConfig && authConfig.dataAuth) {
190
186
  var appIds = authConfig.dataAuth.map(function (item) {
191
187
  return item.appId;
@@ -727,6 +723,11 @@ var CompanySetting = function CompanySetting(props) {
727
723
  label: '微信账号绑定',
728
724
  content: /*#__PURE__*/React.createElement(WechatBinding, null),
729
725
  hidden: !(showWeChatMenu && showMarketMenu && showDataDaily && isAdmin)
726
+ }, {
727
+ key: 'operationLog',
728
+ label: '操作日志',
729
+ content: /*#__PURE__*/React.createElement(OperationLog, null),
730
+ hidden: !isAdmin
730
731
  }];
731
732
  return /*#__PURE__*/React.createElement("div", {
732
733
  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,206 @@
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 React, { useEffect, useState } from 'react';
14
+ import request from '../../../utils/ajax';
15
+ import apis from '../../../constants/api';
16
+ import { DatePicker, Radio, Table } from 'antd';
17
+ import locale from 'antd/es/date-picker/locale/zh_CN';
18
+ import moment from 'moment';
19
+ import './index.less';
20
+ var OperationLog = function OperationLog() {
21
+ var classPrefix = 'operation-log-page';
22
+ var _useState = useState({
23
+ page: 1,
24
+ size: 10,
25
+ year: '',
26
+ month: ''
27
+ }),
28
+ _useState2 = _slicedToArray(_useState, 2),
29
+ condition = _useState2[0],
30
+ setCondition = _useState2[1];
31
+ var _useState3 = useState(true),
32
+ _useState4 = _slicedToArray(_useState3, 2),
33
+ loading = _useState4[0],
34
+ setLoading = _useState4[1];
35
+ var _useState5 = useState(0),
36
+ _useState6 = _slicedToArray(_useState5, 2),
37
+ total = _useState6[0],
38
+ setTotal = _useState6[1];
39
+ var _useState7 = useState('1'),
40
+ _useState8 = _slicedToArray(_useState7, 2),
41
+ logType = _useState8[0],
42
+ setLogType = _useState8[1];
43
+ var _useState9 = useState([]),
44
+ _useState10 = _slicedToArray(_useState9, 2),
45
+ dateRange = _useState10[0],
46
+ setDateRange = _useState10[1];
47
+ var _useState11 = useState(0),
48
+ _useState12 = _slicedToArray(_useState11, 2),
49
+ time = _useState12[0],
50
+ setTime = _useState12[1];
51
+ var _useState13 = useState([]),
52
+ _useState14 = _slicedToArray(_useState13, 2),
53
+ tableData = _useState14[0],
54
+ setTableData = _useState14[1];
55
+ var columns = [{
56
+ title: '应用(应用ID)',
57
+ dataIndex: 'appId',
58
+ key: 'appId'
59
+ }, {
60
+ title: '操作人(登录账号)',
61
+ dataIndex: 'operatorName',
62
+ key: 'operatorName'
63
+ }, {
64
+ title: '功能模块',
65
+ dataIndex: 'targetType',
66
+ key: 'targetType'
67
+ }, {
68
+ title: '操作类型',
69
+ dataIndex: 'operationType',
70
+ key: 'operationType'
71
+ }, {
72
+ title: '操作设备',
73
+ dataIndex: 'userAgent',
74
+ key: 'userAgent'
75
+ }, {
76
+ title: 'IP地址',
77
+ dataIndex: 'userAccessIp',
78
+ key: 'userAccessIp'
79
+ }, {
80
+ title: '操作时间',
81
+ dataIndex: 'gmtCreate',
82
+ key: 'gmtCreate'
83
+ }];
84
+ useEffect(function () {
85
+ queryData();
86
+ }, [logType]);
87
+ useEffect(function () {
88
+ // if (time) clearTimeout(time);
89
+ // setTime(
90
+ // setTimeout(() => {
91
+ // console.log(condition, 'condition');
92
+ // queryLog();
93
+ // }, 500),
94
+ // );
95
+ console.log(condition);
96
+ queryLog();
97
+ }, [condition]);
98
+ function queryData() {
99
+ request(apis.log.getLogTime, {
100
+ method: 'get',
101
+ params: _objectSpread({
102
+ type: logType
103
+ }, condition)
104
+ }).then(function (res) {
105
+ if (parseInt(res === null || res === void 0 ? void 0 : res.code) == 100000) {
106
+ var maxDate = res.data[res.data.length - 1] || '';
107
+ setDateRange(res.data);
108
+ setCondition(function () {
109
+ return {
110
+ page: 1,
111
+ size: 10,
112
+ year: moment(maxDate).format('YYYY'),
113
+ month: moment(maxDate).format('MM')
114
+ };
115
+ });
116
+ }
117
+ });
118
+ }
119
+ function queryLog() {
120
+ setLoading(true);
121
+ if (!condition.year || !condition.month) return;
122
+ request(apis.log.operationLog, {
123
+ method: 'post',
124
+ data: _objectSpread({
125
+ type: logType
126
+ }, condition)
127
+ }).then(function (res) {
128
+ if (parseInt(res === null || res === void 0 ? void 0 : res.code) == 100000) {
129
+ setTotal(res.data.count);
130
+ setTableData(res.data.logs);
131
+ setLoading(false);
132
+ }
133
+ });
134
+ }
135
+ function disabledDate(current) {
136
+ var date = moment(current._d).format('YYYYMM');
137
+ return !dateRange.includes(date);
138
+ }
139
+ function onChangeTime(current) {
140
+ setCondition(function () {
141
+ return {
142
+ page: 1,
143
+ size: 10,
144
+ year: moment(current._d).format('YYYY'),
145
+ month: moment(current._d).format('MM')
146
+ };
147
+ });
148
+ }
149
+ function onChangeType(data) {
150
+ setLogType(data.target.value);
151
+ }
152
+ function onChangeTable(page, pageSize) {
153
+ setCondition(function (v) {
154
+ return _objectSpread(_objectSpread({}, v), {}, {
155
+ page: page,
156
+ size: pageSize
157
+ });
158
+ });
159
+ }
160
+ return /*#__PURE__*/React.createElement("div", {
161
+ className: classPrefix
162
+ }, /*#__PURE__*/React.createElement("div", {
163
+ className: "".concat(classPrefix, "-header")
164
+ }, /*#__PURE__*/React.createElement(Radio.Group, {
165
+ onChange: onChangeType,
166
+ value: logType
167
+ }, /*#__PURE__*/React.createElement(Radio.Button, {
168
+ value: "1"
169
+ }, "\u67E5\u8BE2\u65E5\u5FD7"), /*#__PURE__*/React.createElement(Radio.Button, {
170
+ value: "2"
171
+ }, "\u64CD\u4F5C\u65E5\u5FD7"), /*#__PURE__*/React.createElement(Radio.Button, {
172
+ value: "3"
173
+ }, "\u6743\u9650\u65E5\u5FD7")), condition.year && /*#__PURE__*/React.createElement(DatePicker, {
174
+ value: moment("".concat(condition.year, "-").concat(condition.month), 'YYYY-MM'),
175
+ picker: "month",
176
+ disabledDate: disabledDate,
177
+ locale: locale,
178
+ onChange: onChangeTime,
179
+ inputReadOnly: true,
180
+ allowClear: false
181
+ })), /*#__PURE__*/React.createElement("div", {
182
+ className: "".concat(classPrefix, "-table")
183
+ }, /*#__PURE__*/React.createElement(Table, {
184
+ columns: columns,
185
+ dataSource: tableData,
186
+ loading: loading,
187
+ scroll: {
188
+ x: 'max-content'
189
+ },
190
+ pagination: {
191
+ className: 'biz-pagination',
192
+ current: condition.page,
193
+ pageSize: condition.size,
194
+ showQuickJumper: true,
195
+ showSizeChanger: true,
196
+ total: total,
197
+ showTotal: function showTotal(totalNum) {
198
+ return /*#__PURE__*/React.createElement("span", null, "\u5171 ", /*#__PURE__*/React.createElement("a", {
199
+ className: "biz-table-total"
200
+ }, totalNum), " \u6761");
201
+ },
202
+ onChange: onChangeTable
203
+ }
204
+ })));
205
+ };
206
+ 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
+ }
@@ -13,6 +13,7 @@ import PersonalUnbinding from './unbinding';
13
13
  import { useContext } from 'react';
14
14
  import { BizGlobalDataContext } from '@zgfe/business-lib';
15
15
  import util from '../../utils/util';
16
+ import SecurityLog from './securityLog';
16
17
  var PersonalSetting = function PersonalSetting(_ref) {
17
18
  var settingsCallback = _ref.settingsCallback;
18
19
  var _useContext = useContext(BizGlobalDataContext),
@@ -49,6 +50,10 @@ var PersonalSetting = function PersonalSetting(_ref) {
49
50
  label: '解绑虚拟MFA',
50
51
  hidden: !(currentUser === null || currentUser === void 0 ? void 0 : currentUser.secret) || isDemo,
51
52
  content: /*#__PURE__*/React.createElement(PersonalUnbinding, null)
53
+ }, {
54
+ key: '4',
55
+ label: '安全日志',
56
+ content: /*#__PURE__*/React.createElement(SecurityLog, null)
52
57
  }];
53
58
  return /*#__PURE__*/React.createElement(SettingTabs, {
54
59
  typeName: "personal",
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ declare const SecurityLog: React.FC;
4
+ export default SecurityLog;
@@ -0,0 +1,171 @@
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 { DatePicker, Spin, Table } from 'antd';
14
+ import locale from 'antd/es/date-picker/locale/zh_CN';
15
+ import moment from 'moment';
16
+ import React, { useEffect, useState } from 'react';
17
+ import request from '../../../utils/ajax';
18
+ import apis from '../../../constants/api';
19
+ import './index.less';
20
+ var SecurityLog = function SecurityLog() {
21
+ var classPrefix = 'security-log-page';
22
+ var _useState = useState({
23
+ page: 1,
24
+ size: 10,
25
+ year: '',
26
+ month: ''
27
+ }),
28
+ _useState2 = _slicedToArray(_useState, 2),
29
+ condition = _useState2[0],
30
+ setCondition = _useState2[1];
31
+ var _useState3 = useState(0),
32
+ _useState4 = _slicedToArray(_useState3, 2),
33
+ total = _useState4[0],
34
+ setTotal = _useState4[1];
35
+ var _useState5 = useState([]),
36
+ _useState6 = _slicedToArray(_useState5, 2),
37
+ dateRange = _useState6[0],
38
+ setDateRange = _useState6[1];
39
+ var _useState7 = useState(true),
40
+ _useState8 = _slicedToArray(_useState7, 2),
41
+ dateLoading = _useState8[0],
42
+ setDateLoading = _useState8[1];
43
+ var _useState9 = useState(true),
44
+ _useState10 = _slicedToArray(_useState9, 2),
45
+ tableLoading = _useState10[0],
46
+ setTableLoading = _useState10[1];
47
+ var _useState11 = useState([]),
48
+ _useState12 = _slicedToArray(_useState11, 2),
49
+ tableData = _useState12[0],
50
+ setTableData = _useState12[1];
51
+ var _useState13 = useState(0),
52
+ _useState14 = _slicedToArray(_useState13, 2),
53
+ time = _useState14[0],
54
+ setTime = _useState14[1];
55
+ var columns = [{
56
+ title: '详情',
57
+ dataIndex: 'operationType',
58
+ key: 'operationType'
59
+ }, {
60
+ title: 'IP',
61
+ dataIndex: 'userAccessIp',
62
+ key: 'userAccessIp'
63
+ }, {
64
+ title: '时间',
65
+ dataIndex: 'gmtCreate',
66
+ key: 'gmtCreate'
67
+ }];
68
+ useEffect(function () {
69
+ queryData();
70
+ }, []);
71
+ useEffect(function () {
72
+ // if (time) clearTimeout(time);
73
+ // setTime(
74
+ // setTimeout(() => {
75
+ // queryLog();
76
+ // }, 500),
77
+ // );
78
+ queryLog();
79
+ }, [condition]);
80
+ function queryData() {
81
+ setDateLoading(true);
82
+ request(apis.log.getLogTime, {
83
+ method: 'get',
84
+ params: {
85
+ type: 4
86
+ }
87
+ }).then(function (res) {
88
+ if (parseInt(res === null || res === void 0 ? void 0 : res.code) == 100000) {
89
+ setDateLoading(false);
90
+ var maxDate = res.data[res.data.length - 1] || '';
91
+ setDateRange(res.data);
92
+ setCondition(function (v) {
93
+ return _objectSpread(_objectSpread({}, v), {}, {
94
+ year: moment(maxDate).format('YYYY'),
95
+ month: moment(maxDate).format('MM')
96
+ });
97
+ });
98
+ }
99
+ });
100
+ }
101
+ function queryLog() {
102
+ if (!condition.year || !condition.month) return;
103
+ setTableLoading(true);
104
+ request(apis.log.securityLog, {
105
+ method: 'post',
106
+ data: condition
107
+ }).then(function (res) {
108
+ if (parseInt(res === null || res === void 0 ? void 0 : res.code) == 100000) {
109
+ setTotal(res.data.total);
110
+ setTableData(res.data.logs);
111
+ setTableLoading(false);
112
+ }
113
+ });
114
+ }
115
+ function disabledDate(current) {
116
+ var date = moment(current._d).format('YYYYMM');
117
+ return !dateRange.includes(date);
118
+ }
119
+ function onChangeTime(current) {
120
+ setCondition(function () {
121
+ return {
122
+ page: 1,
123
+ size: 10,
124
+ year: moment(current._d).format('YYYY'),
125
+ month: moment(current._d).format('MM')
126
+ };
127
+ });
128
+ }
129
+ function onChangeTable(page, pageSize) {
130
+ setCondition(function (v) {
131
+ return _objectSpread(_objectSpread({}, v), {}, {
132
+ page: page,
133
+ size: pageSize
134
+ });
135
+ });
136
+ }
137
+ return /*#__PURE__*/React.createElement("div", {
138
+ className: classPrefix
139
+ }, dateLoading ? /*#__PURE__*/React.createElement("div", {
140
+ className: "".concat(classPrefix, "-spin")
141
+ }, /*#__PURE__*/React.createElement(Spin, null)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
142
+ className: "".concat(classPrefix, "-header")
143
+ }, /*#__PURE__*/React.createElement(DatePicker, {
144
+ value: moment("".concat(condition.year, "-").concat(condition.month), 'YYYY-MM'),
145
+ picker: "month",
146
+ disabledDate: disabledDate,
147
+ locale: locale,
148
+ onChange: onChangeTime,
149
+ inputReadOnly: true,
150
+ allowClear: false
151
+ })), /*#__PURE__*/React.createElement(Table, {
152
+ columns: columns,
153
+ dataSource: tableData,
154
+ loading: tableLoading,
155
+ pagination: {
156
+ className: 'biz-pagination',
157
+ current: condition.page,
158
+ pageSize: condition.size,
159
+ showQuickJumper: true,
160
+ showSizeChanger: true,
161
+ total: total,
162
+ showTotal: function showTotal(totalNum) {
163
+ return /*#__PURE__*/React.createElement("span", null, "\u5171 ", /*#__PURE__*/React.createElement("a", {
164
+ className: "biz-table-total"
165
+ }, totalNum), " \u6761");
166
+ },
167
+ onChange: onChangeTable
168
+ }
169
+ })));
170
+ };
171
+ export default SecurityLog;
@@ -0,0 +1,10 @@
1
+ .security-log-page {
2
+ &-spin {
3
+ padding-top: 200px;
4
+ text-align: center;
5
+ }
6
+ &-header {
7
+ margin-bottom: 30px;
8
+ text-align: right;
9
+ }
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-settings",
3
- "version": "1.2.4-alpha.2",
3
+ "version": "1.2.4-log.0",
4
4
  "module": "es/index.js",
5
5
  "typings": "es/index.d.ts",
6
6
  "files": [
@@ -38,7 +38,7 @@
38
38
  "@types/lodash": "^4.14.182",
39
39
  "@umijs/fabric": "^2.8.1",
40
40
  "@umijs/test": "^3.0.5",
41
- "@zgfe/business-lib": "^1.1.40",
41
+ "@zgfe/business-lib": "^1.1.50",
42
42
  "@zgfe/modules-demo-manage": "^1.0.1",
43
43
  "antd": "4.22.6",
44
44
  "dumi": "^1.1.0",
@@ -51,7 +51,7 @@
51
51
  "umi-request": "^1.4.0",
52
52
  "yorkie": "^2.0.0"
53
53
  },
54
- "gitHead": "64597a6367e12586630eab956ab5ee39961a1f57",
54
+ "gitHead": "654a8fad9793509052f832ef2dae04a8fdc7d04e",
55
55
  "gitHooks": {
56
56
  "pre-commit": "lint-staged"
57
57
  }