@zgfe/modules-settings 1.2.3-log.0 → 1.2.3-log.1

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.
@@ -10,11 +10,10 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
10
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
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
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- import { BizTable } from '@zgfe/business-lib';
14
13
  import React, { useEffect, useState } from 'react';
15
14
  import request from '../../../utils/ajax';
16
15
  import apis from '../../../constants/api';
17
- import { DatePicker, Radio } from 'antd';
16
+ import { DatePicker, Radio, Table } from 'antd';
18
17
  import locale from 'antd/es/date-picker/locale/zh_CN';
19
18
  import moment from 'moment';
20
19
  import './index.less';
@@ -86,11 +85,14 @@ var OperationLog = function OperationLog() {
86
85
  queryData();
87
86
  }, [logType]);
88
87
  useEffect(function () {
89
- if (time) clearTimeout(time);
90
- setTime(setTimeout(function () {
91
- console.log(condition, 'condition');
92
- queryLog();
93
- }, 500));
88
+ // if (time) clearTimeout(time);
89
+ // setTime(
90
+ // setTimeout(() => {
91
+ // console.log(condition, 'condition');
92
+ // queryLog();
93
+ // }, 500),
94
+ // );
95
+ queryLog();
94
96
  }, [condition]);
95
97
  function queryData() {
96
98
  request(apis.log.getLogTime, {
@@ -102,11 +104,13 @@ var OperationLog = function OperationLog() {
102
104
  if (parseInt(res === null || res === void 0 ? void 0 : res.code) == 100000) {
103
105
  var maxDate = res.data[res.data.length - 1] || '';
104
106
  setDateRange(res.data);
105
- setCondition(function (v) {
106
- return _objectSpread(_objectSpread({}, v), {}, {
107
+ setCondition(function () {
108
+ return {
109
+ page: 1,
110
+ size: 10,
107
111
  year: moment(maxDate).format('YYYY'),
108
112
  month: moment(maxDate).format('MM')
109
- });
113
+ };
110
114
  });
111
115
  }
112
116
  });
@@ -132,11 +136,13 @@ var OperationLog = function OperationLog() {
132
136
  return !dateRange.includes(date);
133
137
  }
134
138
  function onChangeTime(current) {
135
- setCondition(function (v) {
136
- return _objectSpread(_objectSpread({}, v), {}, {
139
+ setCondition(function () {
140
+ return {
141
+ page: 1,
142
+ size: 10,
137
143
  year: moment(current._d).format('YYYY'),
138
144
  month: moment(current._d).format('MM')
139
- });
145
+ };
140
146
  });
141
147
  }
142
148
  function onChangeType(data) {
@@ -173,14 +179,26 @@ var OperationLog = function OperationLog() {
173
179
  allowClear: false
174
180
  })), /*#__PURE__*/React.createElement("div", {
175
181
  className: "".concat(classPrefix, "-table")
176
- }, /*#__PURE__*/React.createElement(BizTable, {
182
+ }, /*#__PURE__*/React.createElement(Table, {
177
183
  columns: columns,
178
- onChange: onChangeTable,
179
184
  dataSource: tableData,
180
- total: total,
181
185
  loading: loading,
182
186
  scroll: {
183
187
  x: 'max-content'
188
+ },
189
+ pagination: {
190
+ className: 'biz-pagination',
191
+ current: condition.page,
192
+ pageSize: condition.size,
193
+ showQuickJumper: true,
194
+ showSizeChanger: true,
195
+ total: total,
196
+ showTotal: function showTotal(totalNum) {
197
+ return /*#__PURE__*/React.createElement("span", null, "\u5171 ", /*#__PURE__*/React.createElement("a", {
198
+ className: "biz-table-total"
199
+ }, totalNum), " \u6761");
200
+ },
201
+ onChange: onChangeTable
184
202
  }
185
203
  })));
186
204
  };
@@ -10,8 +10,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
10
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
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
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- import { BizTable } from '@zgfe/business-lib';
14
- import { DatePicker, Spin } from 'antd';
13
+ import { DatePicker, Spin, Table } from 'antd';
15
14
  import locale from 'antd/es/date-picker/locale/zh_CN';
16
15
  import moment from 'moment';
17
16
  import React, { useEffect, useState } from 'react';
@@ -70,10 +69,13 @@ var SecurityLog = function SecurityLog() {
70
69
  queryData();
71
70
  }, []);
72
71
  useEffect(function () {
73
- if (time) clearTimeout(time);
74
- setTime(setTimeout(function () {
75
- queryLog();
76
- }, 500));
72
+ // if (time) clearTimeout(time);
73
+ // setTime(
74
+ // setTimeout(() => {
75
+ // queryLog();
76
+ // }, 500),
77
+ // );
78
+ queryLog();
77
79
  }, [condition]);
78
80
  function queryData() {
79
81
  setDateLoading(true);
@@ -104,7 +106,7 @@ var SecurityLog = function SecurityLog() {
104
106
  data: condition
105
107
  }).then(function (res) {
106
108
  if (parseInt(res === null || res === void 0 ? void 0 : res.code) == 100000) {
107
- setTotal(res.data.count);
109
+ setTotal(res.data.total);
108
110
  setTableData(res.data.logs);
109
111
  setTableLoading(false);
110
112
  }
@@ -115,11 +117,13 @@ var SecurityLog = function SecurityLog() {
115
117
  return !dateRange.includes(date);
116
118
  }
117
119
  function onChangeTime(current) {
118
- setCondition(function (v) {
119
- return _objectSpread(_objectSpread({}, v), {}, {
120
+ setCondition(function () {
121
+ return {
122
+ page: 1,
123
+ size: 10,
120
124
  year: moment(current._d).format('YYYY'),
121
125
  month: moment(current._d).format('MM')
122
- });
126
+ };
123
127
  });
124
128
  }
125
129
  function onChangeTable(data) {
@@ -144,13 +148,24 @@ var SecurityLog = function SecurityLog() {
144
148
  onChange: onChangeTime,
145
149
  inputReadOnly: true,
146
150
  allowClear: false
147
- })), /*#__PURE__*/React.createElement(BizTable, {
151
+ })), /*#__PURE__*/React.createElement(Table, {
148
152
  columns: columns,
149
153
  dataSource: tableData,
150
- total: total,
151
154
  loading: tableLoading,
152
- onChange: onChangeTable,
153
- rowKey: "id"
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
+ }
154
169
  })));
155
170
  };
156
171
  export default SecurityLog;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-settings",
3
- "version": "1.2.3-log.0",
3
+ "version": "1.2.3-log.1",
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": "8795f2c712d13f07c98254839670a04fff325fac",
54
+ "gitHead": "5fc1aaa286ea01442109c2456a85fff7c1a12257",
55
55
  "gitHooks": {
56
56
  "pre-commit": "lint-staged"
57
57
  }