ns-base-module 1.1.72 → 1.1.73

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,21 +1,41 @@
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; }
1
7
  import { CopyOutlined } from "@ant-design/icons";
2
8
  import { message } from "antd";
3
9
  import { get } from "lodash";
4
- import React from "react";
10
+ import React, { useEffect, useState } from "react";
5
11
  import { initLang } from "../utils/language";
6
12
  var CopyCol = function CopyCol(_ref) {
7
13
  var dataSource = _ref.dataSource,
8
14
  dataIndex = _ref.dataIndex,
9
15
  list = _ref.list;
16
+ var _useState = useState(),
17
+ _useState2 = _slicedToArray(_useState, 2),
18
+ dataSource_ = _useState2[0],
19
+ setDataSource_ = _useState2[1];
10
20
  // 复制
21
+
22
+ useEffect(function () {
23
+ if (dataSource) {
24
+ setDataSource_(dataSource);
25
+ }
26
+ }, [JSON.stringify(dataSource)]);
11
27
  var handleCopy = function handleCopy() {
12
28
  try {
13
29
  var str = "";
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);
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
+ }
19
39
  }
20
40
  });
21
41
  }
@@ -66,6 +86,9 @@ var CopyCol = function CopyCol(_ref) {
66
86
  };
67
87
  return /*#__PURE__*/React.createElement("span", {
68
88
  className: "copy-icon-wrap",
89
+ style: {
90
+ display: "block"
91
+ },
69
92
  onClick: function onClick() {
70
93
  return handleCopy();
71
94
  }
@@ -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 React, { useState, useEffect } from 'react';
13
- import { Input } from 'antd';
12
+ import { Input } from "antd";
13
+ import React, { useEffect, useState } from "react";
14
14
  var TextAreaWrapper = Input.TextArea;
15
15
  var SearchWrapper = Input.Search;
16
16
  var PasswordWrapper = Input.Password;
@@ -19,14 +19,17 @@ 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
- return /*#__PURE__*/React.createElement(SearchWrapper, 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
+ }));
30
33
  };
31
34
  var Password = function Password(props) {
32
35
  return /*#__PURE__*/React.createElement(PasswordWrapper, props);
@@ -83,4 +86,4 @@ InputWrapper.Password = Password;
83
86
  InputWrapper.InputBlur = InputBlur;
84
87
  InputWrapper.TextAreaBlur = TextAreaBlur;
85
88
  export default InputWrapper;
86
- export { TextArea, Search, Password, InputBlur };
89
+ export { InputBlur, Password, Search, TextArea };
@@ -95,3 +95,89 @@
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,10 +21,12 @@ 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
+
24
26
  import Checkbox from "../Entry/components/Checkbox";
25
27
  import Input from "../Entry/components/Input";
26
28
  import CopyCol from "../CopyCol";
27
- import { cloneDeep, find, flattenDeep, get } from "lodash";
29
+ import { cloneDeep, find, flattenDeep, get, isFunction } from "lodash";
28
30
  import "../../style/components/FilterPopover.scss";
29
31
  import { initLang } from "../utils/language";
30
32
  // import request from "../utils/request";
@@ -52,6 +54,7 @@ var Filter = function Filter(props) {
52
54
  menuCode = props.menuCode,
53
55
  argument = props.argument,
54
56
  request = props.request,
57
+ newRequest = props.newRequest,
55
58
  open = props.open,
56
59
  variablePara = props.variablePara,
57
60
  exportAllParam = props.exportAllParam;
@@ -71,7 +74,7 @@ var Filter = function Filter(props) {
71
74
  setSearchval = _useState6[1];
72
75
  var searchValue = useRef("");
73
76
  var searchEmnuValue = useRef([]); // 枚举搜索
74
-
77
+ var srolRef = useRef(null);
75
78
  var orderTypeRef = useRef("");
76
79
  var orderKeyRef = useRef("");
77
80
  var page = useRef({
@@ -94,8 +97,8 @@ var Filter = function Filter(props) {
94
97
  // 获取列表
95
98
  var getDates = /*#__PURE__*/function () {
96
99
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
97
- var _searchEmnuValue$curr, _res$data, _res$data2;
98
- var _list, checkValues, _label, _searchArgument, params, res, datas, arr, _datas;
100
+ var _searchEmnuValue$curr;
101
+ var _list, checkValues, _label, _searchArgument, params, res, datas, _res, _res2, dataRow, arr, _datas;
99
102
  return _regeneratorRuntime().wrap(function _callee$(_context) {
100
103
  while (1) switch (_context.prev = _context.next) {
101
104
  case 0:
@@ -142,14 +145,41 @@ var Filter = function Filter(props) {
142
145
  orderKey: orderKeyRef.current || orderKey,
143
146
  orderType: orderTypeRef.current || orderType
144
147
  };
145
- _context.next = 11;
148
+ res = {};
149
+ datas = [];
150
+ if (!isFunction(request)) {
151
+ _context.next = 18;
152
+ break;
153
+ }
154
+ _context.next = 14;
146
155
  return request === null || request === void 0 ? void 0 : request("/querier/menu", {
147
156
  method: "POST",
148
157
  data: params
149
158
  });
150
- case 11:
159
+ case 14:
151
160
  res = _context.sent;
152
161
  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:
153
183
  arr = [];
154
184
  if (dataIndex) {
155
185
  datas.map(function (d) {
@@ -174,9 +204,7 @@ var Filter = function Filter(props) {
174
204
  setChecked([].concat(_toConsumableArray(checked), arr));
175
205
  }
176
206
  }
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:
207
+ case 31:
180
208
  case "end":
181
209
  return _context.stop();
182
210
  }
@@ -188,23 +216,26 @@ var Filter = function Filter(props) {
188
216
  }();
189
217
  var updateOpen = useRef(false);
190
218
  useEffect(function () {
191
- if (updateOpen.current === open) return;
192
- updateOpen.current = open; // 防止当前筛选被更新
219
+ console.log("updateOpen.currentupdateOpen.current:", open, argument, updateOpen.current);
220
+
221
+ // if (updateOpen.current === open) return;
222
+ // updateOpen.current = open; // 防止当前筛选被更新
193
223
 
194
224
  if (open) {
195
225
  // 半选状态 - 不刷新列表
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
- }
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
+ // }
205
235
  }
206
236
  }, [dictItems, JSON.stringify(argument), open]);
207
237
  var loadMoreData = function loadMoreData() {
238
+ console.log("jiahzihl");
208
239
  if (page.current.pageNum * page.current.pageSize >= page.current.total) return;
209
240
  page.current.pageNum = page.current.pageNum + 1;
210
241
  getDates();
@@ -331,7 +362,11 @@ var Filter = function Filter(props) {
331
362
  var searchListCheckBox = function searchListCheckBox() {
332
363
  return searchList.map(function (item, index) {
333
364
  return /*#__PURE__*/React.createElement("div", {
334
- key: "".concat(item)
365
+ key: "".concat(item),
366
+ style: {
367
+ display: "block",
368
+ width: "100%"
369
+ }
335
370
  }, /*#__PURE__*/React.createElement(Checkbox, {
336
371
  value: item
337
372
  }, item));
@@ -385,17 +420,13 @@ var Filter = function Filter(props) {
385
420
  var handleSelectSearch = function handleSelectSearch() {
386
421
  onSearch(selectValue);
387
422
  };
388
-
389
- // const hasEntryItem = useMemo(() => {
390
- // return entryType && _TYPES.includes(entryType);
391
- // }, [entryType]);
392
-
423
+ console.log("list.lengthlist.length:", list.length, dataIndex + "-" + "scrollableDiv");
393
424
  return /*#__PURE__*/React.createElement("div", {
394
425
  className: "filter-wrapper-body"
395
426
  }, sort && /*#__PURE__*/React.createElement("div", {
396
427
  className: "sort"
397
428
  }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(CopyCol, {
398
- dataSource: dataSource,
429
+ dataSource: searchList,
399
430
  dataIndex: dataIndex
400
431
  })), /*#__PURE__*/React.createElement("span", {
401
432
  onClick: function onClick() {
@@ -418,14 +449,6 @@ var Filter = function Filter(props) {
418
449
  allowClear: true,
419
450
  onSearch: onSearch,
420
451
  onPaste: handlePaste
421
- // placeholder={
422
- // (dictItems && dictItems.length) || !(menuCode && formTemplateCode)
423
- // ? initLang({
424
- // id: "button.rest.filterTip",
425
- // defaultValue: "只能筛选当前页",
426
- // })
427
- // : ""
428
- // }
429
452
  }), /*#__PURE__*/React.createElement(React.Fragment, null, !!searchList.length && /*#__PURE__*/React.createElement(Checkbox, {
430
453
  checked: allChecked,
431
454
  indeterminate: checked.length > 0 && checked.length < list.length,
@@ -438,26 +461,28 @@ var Filter = function Filter(props) {
438
461
  }
439
462
  }), /*#__PURE__*/React.createElement("div", {
440
463
  className: "filter-group",
464
+ ref: srolRef,
441
465
  id: "".concat(dataIndex, "-scrollableDiv")
442
- }, /*#__PURE__*/React.createElement(InfiniteScroll, {
466
+ }, srolRef.current && /*#__PURE__*/React.createElement(InfiniteScroll, {
443
467
  dataLength: list.length,
444
468
  next: loadMoreData,
445
469
  hasMore: page.current.pageNum * page.current.pageSize < total,
446
470
  loader: /*#__PURE__*/React.createElement(Divider, {
447
471
  plain: true,
448
472
  style: {
449
- margin: 10
473
+ margin: "10px 0"
450
474
  }
451
475
  }),
452
476
  endMessage: /*#__PURE__*/React.createElement(Divider, {
453
477
  plain: true,
454
478
  style: {
455
- margin: 10
479
+ margin: "10px 0"
456
480
  }
457
481
  })
458
482
  // endMessage={<Divider plain>无更多数据</Divider>}
483
+ // scrollableTarget={`${dataIndex}-scrollableDiv`}
459
484
  ,
460
- scrollableTarget: "".concat(dataIndex, "-scrollableDiv")
485
+ scrollableTarget: srolRef.current
461
486
  }, /*#__PURE__*/React.createElement(CheckboxGroup, {
462
487
  value: checked,
463
488
  onChange: onChange
@@ -24,11 +24,9 @@ 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";
28
27
  import { get, isEmpty } from "lodash";
28
+ import IconCreate from "../Icon";
29
29
  import Filter from "./Filter";
30
- // import { filterContext } from '@/my-context';
31
-
32
30
  var content = function content(_ref) {
33
31
  var list = _ref.list,
34
32
  onSort = _ref.onSort,
@@ -90,19 +88,26 @@ var Index = function Index(_ref2) {
90
88
  // 活动的icon显示
91
89
  var visibilityStyle = useMemo(function () {
92
90
  var _value = get(props === null || props === void 0 ? void 0 : props.filterSearch, "".concat(dataIndex, ".value"), "");
93
- if (!_value) return null;
94
91
  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
+ }
95
97
  if (orderKey !== null && orderKey !== void 0 && orderKey.includes(dataIndex)) return {
96
- visibility: "visible"
98
+ visibility: "visible",
99
+ display: "block",
100
+ color: "#06B50F"
97
101
  };
98
102
  if (searchFlag) return {
99
- visibility: "visible"
103
+ visibility: "visible",
104
+ display: "block",
105
+ color: "#06B50F"
100
106
  };
101
- if (isEmpty(filterValue)) return null;
102
- if (!filterValue[dataIndex] || isEmpty(list)) return null;
103
- if (list.length === filterValue[dataIndex].length) return null;
104
107
  return {
105
- visibility: "visible"
108
+ visibility: "visible",
109
+ display: "block",
110
+ color: "#06B50F"
106
111
  };
107
112
  }, [filterValue, list, dataIndex, orderKey, searchFlag, props.filterSearch]);
108
113
  var onFilterSearchValue = function onFilterSearchValue(value) {
@@ -126,11 +131,12 @@ var Index = function Index(_ref2) {
126
131
  dataSource: dataSource,
127
132
  open: open
128
133
  }, props))
129
- }, /*#__PURE__*/React.createElement(CaretDownOutlined, {
134
+ }, /*#__PURE__*/React.createElement(IconCreate, {
130
135
  className: "proTableFilter",
136
+ type: "icon-ns-biaodan-shaixuan",
131
137
  style: _objectSpread({
132
138
  marginLeft: 4,
133
- color: "#888"
139
+ color: "var(--header-text-color, #888)"
134
140
  }, visibilityStyle)
135
141
  }));
136
142
  };