ns-base-module 2.0.11 → 2.0.13

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.
@@ -75,6 +75,8 @@ var Filter = function Filter(props) {
75
75
  var searchValue = useRef("");
76
76
  var searchEmnuValue = useRef([]); // 枚举搜索
77
77
  var srolRef = useRef(null);
78
+ var orderTypeRef = useRef("");
79
+ var orderKeyRef = useRef("");
78
80
  var page = useRef({
79
81
  pageNum: 1,
80
82
  pageSize: 40,
@@ -140,8 +142,8 @@ var Filter = function Filter(props) {
140
142
  pageSize: page.current.pageSize,
141
143
  distinctField: [dataIndex],
142
144
  variablePara: variablePara,
143
- orderKey: orderKey,
144
- orderType: orderType
145
+ orderKey: orderKeyRef.current || orderKey,
146
+ orderType: orderTypeRef.current || orderType
145
147
  };
146
148
  res = {};
147
149
  datas = [];
@@ -401,10 +403,16 @@ var Filter = function Filter(props) {
401
403
  };
402
404
  var handleSort = function handleSort(key) {
403
405
  if (checkSort === "asc" && key === "asc" || checkSort === "desc" && key === "desc") {
406
+ orderTypeRef.current = "";
407
+ orderKeyRef.current = "";
404
408
  onSort === null || onSort === void 0 || onSort("");
409
+ getDates();
405
410
  return;
406
411
  }
407
412
  onSort === null || onSort === void 0 || onSort(key);
413
+ orderKeyRef.current = dataIndex;
414
+ orderTypeRef.current = key;
415
+ getDates();
408
416
  };
409
417
  var selectSearch = function selectSearch(e) {
410
418
  setSelectValue(e);
@@ -87,7 +87,6 @@ var Index = function Index(_ref2) {
87
87
 
88
88
  // 活动的icon显示
89
89
  var visibilityStyle = useMemo(function () {
90
- console.log("filterValuefilterValue:", filterValue);
91
90
  var _value = get(props === null || props === void 0 ? void 0 : props.filterSearch, "".concat(dataIndex, ".value"), "");
92
91
  if (!dataIndex) return null;
93
92
  if (!_value) {
@@ -291,17 +291,12 @@ var Index = function Index(props) {
291
291
  }),
292
292
  onConfirm: confirm,
293
293
  onCancel: cancel
294
- }, /*#__PURE__*/React.createElement(Tooltip, {
295
- placement: "top",
296
- title: initLang({
297
- id: "prompt.delTemplate"
298
- })
299
294
  }, /*#__PURE__*/React.createElement(DeleteOutlined, {
300
295
  className: "set-icon",
301
296
  onClick: function onClick() {
302
297
  return handleDel(item);
303
298
  }
304
- })));
299
+ }));
305
300
  var copyDom = /*#__PURE__*/React.createElement(Tooltip, {
306
301
  placement: "top",
307
302
  title: initLang({
@@ -158,6 +158,13 @@ var ColumnsToolbarRender = /*#__PURE__*/memo(function (props) {
158
158
  dragNode = _ref2.dragNode;
159
159
  var nextColumns = cloneDeep(columnsTree);
160
160
 
161
+ // 禁止跨层级拖拽 模板 和更新的数据匹配渲染问题, 渲染时也只匹配同级增删改
162
+ // 修复 模板存储 a下的b, 新表头b在c下面 并改名d
163
+ if (node.parentCode !== dragNode.parentCode) {
164
+ message.warning("不允许改变层级");
165
+ return;
166
+ }
167
+
161
168
  // 找到 旧位置 删除自己
162
169
  var delDom = null;
163
170
  function _loopFind(tree, dom, command) {
@@ -80,6 +80,7 @@ var updateTemplateFilds = function updateTemplateFilds(JsonPares, _columns) {
80
80
  if (_findItem) {
81
81
  JsonPares[r] = _objectSpread(_objectSpread({}, _findItem), {}, {
82
82
  title: _findItem.title || JsonPares[r].title,
83
+ label: _findItem.label || JsonPares[r].label,
83
84
  fixed: JsonPares[r].fixed,
84
85
  width: JsonPares[r].width,
85
86
  checked: JsonPares[r].checked,
@@ -113,7 +114,7 @@ export function adapterColumns(customColumns, columns) {
113
114
  var _code = arr[j].code ? "code" : "dataIndex";
114
115
  if (commad === "del") {
115
116
  if (!find(_columns, function (o) {
116
- return o[_code] === arr[j][_code];
117
+ return o[_code] === arr[j][_code] && o.parentCode === arr[j].parentCode;
117
118
  })) {
118
119
  arr.splice(j, 1);
119
120
  _k -= 1;
@@ -151,7 +152,7 @@ export function adapterColumns(customColumns, columns) {
151
152
  var _loop3 = function _loop3(j) {
152
153
  var _code = _columns[j].code ? "code" : "dataIndex";
153
154
  if (!find(flaJsonPares, function (o) {
154
- return o[_code] === _columns[j][_code];
155
+ return o[_code] === _columns[j][_code] && o.parentCode === _columns[j].parentCode;
155
156
  })) {
156
157
  var _item = initColumns([_columns[j]], null)[0];
157
158
  if (_item.customizable !== false) {