ns-base-module 1.1.73 → 1.1.74

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.
@@ -1,41 +1,21 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
- 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."); }
3
- 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); }
4
- 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; }
5
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
1
  import { CopyOutlined } from "@ant-design/icons";
8
2
  import { message } from "antd";
9
3
  import { get } from "lodash";
10
- import React, { useEffect, useState } from "react";
4
+ import React from "react";
11
5
  import { initLang } from "../utils/language";
12
6
  var CopyCol = function CopyCol(_ref) {
13
7
  var dataSource = _ref.dataSource,
14
8
  dataIndex = _ref.dataIndex,
15
9
  list = _ref.list;
16
- var _useState = useState(),
17
- _useState2 = _slicedToArray(_useState, 2),
18
- dataSource_ = _useState2[0],
19
- setDataSource_ = _useState2[1];
20
10
  // 复制
21
-
22
- useEffect(function () {
23
- if (dataSource) {
24
- setDataSource_(dataSource);
25
- }
26
- }, [JSON.stringify(dataSource)]);
27
11
  var handleCopy = function handleCopy() {
28
12
  try {
29
13
  var str = "";
30
- if (dataSource_) {
31
- dataSource_ === null || dataSource_ === void 0 || dataSource_.forEach(function (item) {
32
- if (typeof item === "string" || typeof item === "number") {
33
- str = str ? "".concat(str, "\r\n").concat(item) : "".concat(item);
34
- } else {
35
- var val = get(item, dataIndex, "");
36
- if (val && (typeof val === "string" || typeof val === "number")) {
37
- str = str ? "".concat(str, "\r\n").concat(val) : "".concat(val);
38
- }
14
+ if (dataSource) {
15
+ dataSource === null || dataSource === void 0 || dataSource.forEach(function (item) {
16
+ var val = get(item, dataIndex, "");
17
+ if (val && (typeof val === "string" || typeof val === "number")) {
18
+ str = str ? "".concat(str, "\r\n").concat(val) : "".concat(val);
39
19
  }
40
20
  });
41
21
  }
@@ -86,9 +66,6 @@ var CopyCol = function CopyCol(_ref) {
86
66
  };
87
67
  return /*#__PURE__*/React.createElement("span", {
88
68
  className: "copy-icon-wrap",
89
- style: {
90
- display: "block"
91
- },
92
69
  onClick: function onClick() {
93
70
  return handleCopy();
94
71
  }
@@ -9,8 +9,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
9
9
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
10
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
11
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
12
- import { Input } from "antd";
13
- import React, { useEffect, useState } from "react";
12
+ import React, { useState, useEffect } from 'react';
13
+ import { Input } from 'antd';
14
14
  var TextAreaWrapper = Input.TextArea;
15
15
  var SearchWrapper = Input.Search;
16
16
  var PasswordWrapper = Input.Password;
@@ -19,17 +19,14 @@ var InputWrapper = function InputWrapper(props) {
19
19
  return /*#__PURE__*/React.createElement(Input, _extends({
20
20
  allowClear: true
21
21
  }, props, {
22
- className: "disabled-input ".concat((_props$className = props === null || props === void 0 ? void 0 : props.className) !== null && _props$className !== void 0 ? _props$className : "")
22
+ className: "disabled-input ".concat((_props$className = props === null || props === void 0 ? void 0 : props.className) !== null && _props$className !== void 0 ? _props$className : '')
23
23
  }));
24
24
  };
25
25
  var TextArea = function TextArea(props) {
26
26
  return /*#__PURE__*/React.createElement(TextAreaWrapper, props);
27
27
  };
28
28
  var Search = function Search(props) {
29
- var _props$className2;
30
- return /*#__PURE__*/React.createElement(SearchWrapper, _extends({}, props, {
31
- className: "".concat((_props$className2 = props === null || props === void 0 ? void 0 : props.className) !== null && _props$className2 !== void 0 ? _props$className2 : "", " entry-form-border ")
32
- }));
29
+ return /*#__PURE__*/React.createElement(SearchWrapper, props);
33
30
  };
34
31
  var Password = function Password(props) {
35
32
  return /*#__PURE__*/React.createElement(PasswordWrapper, props);
@@ -86,4 +83,4 @@ InputWrapper.Password = Password;
86
83
  InputWrapper.InputBlur = InputBlur;
87
84
  InputWrapper.TextAreaBlur = TextAreaBlur;
88
85
  export default InputWrapper;
89
- export { InputBlur, Password, Search, TextArea };
86
+ export { TextArea, Search, Password, InputBlur };
@@ -95,89 +95,3 @@
95
95
  }
96
96
  }
97
97
  }
98
-
99
- // 2.0UI样式覆盖
100
- .ant-input-affix-wrapper:focus,
101
- .ant-input-affix-wrapper-focused {
102
- // border-bottom-color: fade(var(--primary-color), 100%);
103
- border-bottom-color: color-mix(
104
- in srgb,
105
- var(--form-border-color) 100%,
106
- transparent
107
- ) !important;
108
- border-radius: 0 !important;
109
- // box-shadow: 0 2px 0 fade(var(--form-border-color), 100%);
110
- box-shadow: 0 2px 0
111
- color-mix(in srgb, var(--form-border-color) 100%, transparent) !important;
112
- }
113
- .ant-select-focused:not(.ant-select-disabled).ant-select:not(
114
- .ant-select-customize-input
115
- )
116
- .ant-select-selector {
117
- // border-bottom-color: fade(var(--form-border-color), 100%);
118
- border-bottom-color: color-mix(
119
- in srgb,
120
- var(--form-border-color) 100%,
121
- transparent
122
- ) !important;
123
- border-radius: 0 !important;
124
- // box-shadow: 0 2px 0 fade(var(--form-border-color), 100%);
125
- box-shadow: 0 2px 0
126
- color-mix(in srgb, var(--form-border-color) 100%, transparent) !important;
127
- }
128
-
129
- .entry-form-border {
130
- border-color: var(--form-border-color);
131
- border-top: 0;
132
- border-right: 0;
133
- border-bottom: 1px solid var(--form-border-color);
134
- border-left: 0;
135
- border-radius: 0;
136
- &.ant-input-affix-wrapper-disabled {
137
- &:hover {
138
- border-bottom-color: transparent;
139
- box-shadow: none;
140
- }
141
- }
142
- &.ant-input-number-group-wrapper {
143
- .ant-input-number {
144
- border: none;
145
- }
146
- }
147
- &:focus {
148
- // border-bottom-color: fade(var(--primary-color), 100%);
149
- border-bottom-color: color-mix(
150
- in srgb,
151
- var(--form-border-color) 100%,
152
- transparent
153
- ) !important;
154
- border-radius: 0 !important;
155
- // box-shadow: 0 2px 0 fade(var(--form-border-color), 100%);
156
- box-shadow: 0 2px 0
157
- color-mix(in srgb, var(--form-border-color) 100%, transparent) !important;
158
- }
159
- &:hover {
160
- // border-bottom-color: fade(var(--primary-color), 100%);
161
- border-bottom-color: color-mix(
162
- in srgb,
163
- var(--form-border-color) 100%,
164
- transparent
165
- ) !important;
166
- border-radius: 0 !important;
167
- // box-shadow: 0 2px 0 fade(var(--form-border-color), 100%);
168
- box-shadow: 0 2px 0
169
- color-mix(in srgb, var(--form-border-color) 100%, transparent) !important;
170
- }
171
- &.ant-input-number-focused {
172
- // border-bottom-color: fade(var(--primary-color), 100%);
173
- border-bottom-color: color-mix(
174
- in srgb,
175
- var(--form-border-color) 100%,
176
- transparent
177
- ) !important;
178
- border-radius: 0 !important;
179
- // box-shadow: 0 2px 0 fade(var(--form-border-color), 100%);
180
- box-shadow: 0 2px 0
181
- color-mix(in srgb, var(--form-border-color) 100%, transparent) !important;
182
- }
183
- }
@@ -21,12 +21,10 @@ import { ArrowDownOutlined, ArrowUpOutlined } from "@ant-design/icons";
21
21
  import { Button, Divider } from "antd";
22
22
  import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
23
23
  import InfiniteScroll from "react-infinite-scroll-component";
24
- // import InfiniteScroll from "../sollr/index";
25
-
26
24
  import Checkbox from "../Entry/components/Checkbox";
27
25
  import Input from "../Entry/components/Input";
28
26
  import CopyCol from "../CopyCol";
29
- import { cloneDeep, find, flattenDeep, get, isFunction } from "lodash";
27
+ import { cloneDeep, find, flattenDeep, get } from "lodash";
30
28
  import "../../style/components/FilterPopover.scss";
31
29
  import { initLang } from "../utils/language";
32
30
  // import request from "../utils/request";
@@ -54,7 +52,6 @@ var Filter = function Filter(props) {
54
52
  menuCode = props.menuCode,
55
53
  argument = props.argument,
56
54
  request = props.request,
57
- newRequest = props.newRequest,
58
55
  open = props.open,
59
56
  variablePara = props.variablePara,
60
57
  exportAllParam = props.exportAllParam;
@@ -74,7 +71,7 @@ var Filter = function Filter(props) {
74
71
  setSearchval = _useState6[1];
75
72
  var searchValue = useRef("");
76
73
  var searchEmnuValue = useRef([]); // 枚举搜索
77
- var srolRef = useRef(null);
74
+
78
75
  var orderTypeRef = useRef("");
79
76
  var orderKeyRef = useRef("");
80
77
  var page = useRef({
@@ -97,8 +94,8 @@ var Filter = function Filter(props) {
97
94
  // 获取列表
98
95
  var getDates = /*#__PURE__*/function () {
99
96
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
100
- var _searchEmnuValue$curr;
101
- var _list, checkValues, _label, _searchArgument, params, res, datas, _res, _res2, dataRow, arr, _datas;
97
+ var _searchEmnuValue$curr, _res$data, _res$data2;
98
+ var _list, checkValues, _label, _searchArgument, params, res, datas, arr, _datas;
102
99
  return _regeneratorRuntime().wrap(function _callee$(_context) {
103
100
  while (1) switch (_context.prev = _context.next) {
104
101
  case 0:
@@ -145,41 +142,14 @@ var Filter = function Filter(props) {
145
142
  orderKey: orderKeyRef.current || orderKey,
146
143
  orderType: orderTypeRef.current || orderType
147
144
  };
148
- res = {};
149
- datas = [];
150
- if (!isFunction(request)) {
151
- _context.next = 18;
152
- break;
153
- }
154
- _context.next = 14;
145
+ _context.next = 11;
155
146
  return request === null || request === void 0 ? void 0 : request("/querier/menu", {
156
147
  method: "POST",
157
148
  data: params
158
149
  });
159
- case 14:
150
+ case 11:
160
151
  res = _context.sent;
161
152
  datas = get(res, "data.rows", []) || [];
162
- setTotal((_res = res) === null || _res === void 0 || (_res = _res.data) === null || _res === void 0 ? void 0 : _res.total);
163
- page.current.total = (_res2 = res) === null || _res2 === void 0 || (_res2 = _res2.data) === null || _res2 === void 0 ? void 0 : _res2.total;
164
- case 18:
165
- if (!isFunction(newRequest)) {
166
- _context.next = 25;
167
- break;
168
- }
169
- _context.next = 21;
170
- return newRequest === null || newRequest === void 0 ? void 0 : newRequest({
171
- url: "/api/querier/menu",
172
- method: "POST",
173
- data: _objectSpread(_objectSpread(_objectSpread({}, props === null || props === void 0 ? void 0 : props.requestOrderParam), params), {}, {
174
- withFieldConfigs: false
175
- })
176
- });
177
- case 21:
178
- dataRow = _context.sent;
179
- datas = get(dataRow, "rows", []) || [];
180
- setTotal(dataRow === null || dataRow === void 0 ? void 0 : dataRow.total);
181
- page.current.total = dataRow === null || dataRow === void 0 ? void 0 : dataRow.total;
182
- case 25:
183
153
  arr = [];
184
154
  if (dataIndex) {
185
155
  datas.map(function (d) {
@@ -204,7 +174,9 @@ var Filter = function Filter(props) {
204
174
  setChecked([].concat(_toConsumableArray(checked), arr));
205
175
  }
206
176
  }
207
- case 31:
177
+ setTotal(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.total);
178
+ page.current.total = res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.total;
179
+ case 21:
208
180
  case "end":
209
181
  return _context.stop();
210
182
  }
@@ -216,26 +188,23 @@ var Filter = function Filter(props) {
216
188
  }();
217
189
  var updateOpen = useRef(false);
218
190
  useEffect(function () {
219
- console.log("updateOpen.currentupdateOpen.current:", open, argument, updateOpen.current);
220
-
221
- // if (updateOpen.current === open) return;
222
- // updateOpen.current = open; // 防止当前筛选被更新
191
+ if (updateOpen.current === open) return;
192
+ updateOpen.current = open; // 防止当前筛选被更新
223
193
 
224
194
  if (open) {
225
195
  // 半选状态 - 不刷新列表
226
- // if (!(checked.length > 0 && checked.length < list.length)) {
227
- page.current.pageNum = 1;
228
- page.current.total = 20;
229
- searchValue.current = "";
230
- setSearchval("");
231
- setList([]);
232
- setChecked([]);
233
- getDates();
234
- // }
196
+ if (!(checked.length > 0 && checked.length < list.length)) {
197
+ page.current.pageNum = 1;
198
+ page.current.total = 20;
199
+ searchValue.current = "";
200
+ setSearchval("");
201
+ setList([]);
202
+ setChecked([]);
203
+ getDates();
204
+ }
235
205
  }
236
206
  }, [dictItems, JSON.stringify(argument), open]);
237
207
  var loadMoreData = function loadMoreData() {
238
- console.log("jiahzihl");
239
208
  if (page.current.pageNum * page.current.pageSize >= page.current.total) return;
240
209
  page.current.pageNum = page.current.pageNum + 1;
241
210
  getDates();
@@ -362,11 +331,7 @@ var Filter = function Filter(props) {
362
331
  var searchListCheckBox = function searchListCheckBox() {
363
332
  return searchList.map(function (item, index) {
364
333
  return /*#__PURE__*/React.createElement("div", {
365
- key: "".concat(item),
366
- style: {
367
- display: "block",
368
- width: "100%"
369
- }
334
+ key: "".concat(item)
370
335
  }, /*#__PURE__*/React.createElement(Checkbox, {
371
336
  value: item
372
337
  }, item));
@@ -420,13 +385,17 @@ var Filter = function Filter(props) {
420
385
  var handleSelectSearch = function handleSelectSearch() {
421
386
  onSearch(selectValue);
422
387
  };
423
- console.log("list.lengthlist.length:", list.length, dataIndex + "-" + "scrollableDiv");
388
+
389
+ // const hasEntryItem = useMemo(() => {
390
+ // return entryType && _TYPES.includes(entryType);
391
+ // }, [entryType]);
392
+
424
393
  return /*#__PURE__*/React.createElement("div", {
425
394
  className: "filter-wrapper-body"
426
395
  }, sort && /*#__PURE__*/React.createElement("div", {
427
396
  className: "sort"
428
397
  }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(CopyCol, {
429
- dataSource: searchList,
398
+ dataSource: dataSource,
430
399
  dataIndex: dataIndex
431
400
  })), /*#__PURE__*/React.createElement("span", {
432
401
  onClick: function onClick() {
@@ -449,6 +418,14 @@ var Filter = function Filter(props) {
449
418
  allowClear: true,
450
419
  onSearch: onSearch,
451
420
  onPaste: handlePaste
421
+ // placeholder={
422
+ // (dictItems && dictItems.length) || !(menuCode && formTemplateCode)
423
+ // ? initLang({
424
+ // id: "button.rest.filterTip",
425
+ // defaultValue: "只能筛选当前页",
426
+ // })
427
+ // : ""
428
+ // }
452
429
  }), /*#__PURE__*/React.createElement(React.Fragment, null, !!searchList.length && /*#__PURE__*/React.createElement(Checkbox, {
453
430
  checked: allChecked,
454
431
  indeterminate: checked.length > 0 && checked.length < list.length,
@@ -461,28 +438,26 @@ var Filter = function Filter(props) {
461
438
  }
462
439
  }), /*#__PURE__*/React.createElement("div", {
463
440
  className: "filter-group",
464
- ref: srolRef,
465
441
  id: "".concat(dataIndex, "-scrollableDiv")
466
- }, srolRef.current && /*#__PURE__*/React.createElement(InfiniteScroll, {
442
+ }, /*#__PURE__*/React.createElement(InfiniteScroll, {
467
443
  dataLength: list.length,
468
444
  next: loadMoreData,
469
445
  hasMore: page.current.pageNum * page.current.pageSize < total,
470
446
  loader: /*#__PURE__*/React.createElement(Divider, {
471
447
  plain: true,
472
448
  style: {
473
- margin: "10px 0"
449
+ margin: 10
474
450
  }
475
451
  }),
476
452
  endMessage: /*#__PURE__*/React.createElement(Divider, {
477
453
  plain: true,
478
454
  style: {
479
- margin: "10px 0"
455
+ margin: 10
480
456
  }
481
457
  })
482
458
  // endMessage={<Divider plain>无更多数据</Divider>}
483
- // scrollableTarget={`${dataIndex}-scrollableDiv`}
484
459
  ,
485
- scrollableTarget: srolRef.current
460
+ scrollableTarget: "".concat(dataIndex, "-scrollableDiv")
486
461
  }, /*#__PURE__*/React.createElement(CheckboxGroup, {
487
462
  value: checked,
488
463
  onChange: onChange
@@ -24,9 +24,11 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
24
24
  */
25
25
  import { Popover } from "antd";
26
26
  import React, { useMemo, useState } from "react";
27
+ import { CaretDownOutlined } from "@ant-design/icons";
27
28
  import { get, isEmpty } from "lodash";
28
- import IconCreate from "../Icon";
29
29
  import Filter from "./Filter";
30
+ // import { filterContext } from '@/my-context';
31
+
30
32
  var content = function content(_ref) {
31
33
  var list = _ref.list,
32
34
  onSort = _ref.onSort,
@@ -88,26 +90,19 @@ var Index = function Index(_ref2) {
88
90
  // 活动的icon显示
89
91
  var visibilityStyle = useMemo(function () {
90
92
  var _value = get(props === null || props === void 0 ? void 0 : props.filterSearch, "".concat(dataIndex, ".value"), "");
93
+ if (!_value) return null;
91
94
  if (!dataIndex) return null;
92
- if (!_value) {
93
- if (isEmpty(filterValue)) return null;
94
- if (!filterValue[dataIndex] || isEmpty(list)) return null;
95
- if (list.length === filterValue[dataIndex].length) return null;
96
- }
97
95
  if (orderKey !== null && orderKey !== void 0 && orderKey.includes(dataIndex)) return {
98
- visibility: "visible",
99
- display: "block",
100
- color: "#06B50F"
96
+ visibility: "visible"
101
97
  };
102
98
  if (searchFlag) return {
103
- visibility: "visible",
104
- display: "block",
105
- color: "#06B50F"
99
+ visibility: "visible"
106
100
  };
101
+ if (isEmpty(filterValue)) return null;
102
+ if (!filterValue[dataIndex] || isEmpty(list)) return null;
103
+ if (list.length === filterValue[dataIndex].length) return null;
107
104
  return {
108
- visibility: "visible",
109
- display: "block",
110
- color: "#06B50F"
105
+ visibility: "visible"
111
106
  };
112
107
  }, [filterValue, list, dataIndex, orderKey, searchFlag, props.filterSearch]);
113
108
  var onFilterSearchValue = function onFilterSearchValue(value) {
@@ -131,12 +126,11 @@ var Index = function Index(_ref2) {
131
126
  dataSource: dataSource,
132
127
  open: open
133
128
  }, props))
134
- }, /*#__PURE__*/React.createElement(IconCreate, {
129
+ }, /*#__PURE__*/React.createElement(CaretDownOutlined, {
135
130
  className: "proTableFilter",
136
- type: "icon-ns-biaodan-shaixuan",
137
131
  style: _objectSpread({
138
132
  marginLeft: 4,
139
- color: "var(--header-text-color, #888)"
133
+ color: "#888"
140
134
  }, visibilityStyle)
141
135
  }));
142
136
  };