ns-base-module 1.0.19 → 1.0.21

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.
@@ -45,7 +45,8 @@ import { initColumns, sortColums } from "./utils";
45
45
  var ColumnsToolbarRender = /*#__PURE__*/memo(function (props) {
46
46
  var columns = props.columns,
47
47
  updateColumns = props.updateColumns,
48
- newColumns = props.newColumns;
48
+ newColumns = props.newColumns,
49
+ init = props.init;
49
50
  var _useState = useState([]),
50
51
  _useState2 = _slicedToArray(_useState, 2),
51
52
  columnsTree = _useState2[0],
@@ -765,9 +766,6 @@ var ColumnsToolbar = function ColumnsToolbar(_ref4) {
765
766
  if (item.perms_type === "private") {
766
767
  _templateUser.push(item);
767
768
  } else {
768
- // if (item.owner === 'Y') {
769
- // // 公共分享
770
- // }
771
769
  _template.push(item);
772
770
  }
773
771
  if (item.is_default === "Y") {
@@ -1133,7 +1131,64 @@ var ColumnsToolbar = function ColumnsToolbar(_ref4) {
1133
1131
  };
1134
1132
  var Index = function Index(_ref9) {
1135
1133
  var props = Object.assign({}, (_objectDestructuringEmpty(_ref9), _ref9));
1136
- return /*#__PURE__*/React.createElement(Popover, {
1134
+ useEffect(function () {
1135
+ if (props.init) {
1136
+ getColumnsFilter();
1137
+ }
1138
+ }, []);
1139
+ var getColumnsFilter = /*#__PURE__*/function () {
1140
+ var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
1141
+ var _res3;
1142
+ var res, _res4, _templateUser, _template;
1143
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
1144
+ while (1) switch (_context7.prev = _context7.next) {
1145
+ case 0:
1146
+ res = {}; // debugger;
1147
+ if (!(props !== null && props !== void 0 && props.request)) {
1148
+ _context7.next = 8;
1149
+ break;
1150
+ }
1151
+ _context7.next = 4;
1152
+ return props === null || props === void 0 ? void 0 : props.request();
1153
+ case 4:
1154
+ res = _context7.sent;
1155
+ res = {
1156
+ data: {
1157
+ data: res
1158
+ }
1159
+ };
1160
+ _context7.next = 11;
1161
+ break;
1162
+ case 8:
1163
+ _context7.next = 10;
1164
+ return queryColumnsConfig({
1165
+ menuCode: props.menuCode,
1166
+ formTemplateCode: props.formTemplateCode,
1167
+ queryType: props.crossQuery ? "cross" : "list"
1168
+ });
1169
+ case 10:
1170
+ res = _context7.sent;
1171
+ case 11:
1172
+ if ((_res3 = res) !== null && _res3 !== void 0 && (_res3 = _res3.data) !== null && _res3 !== void 0 && _res3.data) {
1173
+ _templateUser = [];
1174
+ _template = [];
1175
+ (_res4 = res) === null || _res4 === void 0 || (_res4 = _res4.data) === null || _res4 === void 0 || _res4.data.forEach(function (item) {
1176
+ if (item.is_default === "Y") {
1177
+ props.updateColumns(JSON.parse(item.define));
1178
+ }
1179
+ });
1180
+ }
1181
+ case 12:
1182
+ case "end":
1183
+ return _context7.stop();
1184
+ }
1185
+ }, _callee7);
1186
+ }));
1187
+ return function getColumnsFilter() {
1188
+ return _ref10.apply(this, arguments);
1189
+ };
1190
+ }();
1191
+ return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Popover, {
1137
1192
  placement: "bottomLeft",
1138
1193
  trigger: "click",
1139
1194
  title: "",
@@ -1145,6 +1200,6 @@ var Index = function Index(_ref9) {
1145
1200
  })
1146
1201
  }, /*#__PURE__*/React.createElement(SettingOutlined, {
1147
1202
  className: "icon-button-wrapper"
1148
- })));
1203
+ }))));
1149
1204
  };
1150
1205
  export default Index;
@@ -1 +1 @@
1
- {"version":3,"file":"updateColumns.d.ts","sourceRoot":"","sources":["updateColumns.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,aAAK,aAAa,GAAG;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,GAAG,CAAC;IACb,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC;CACtD,CAAC;AAEF,QAAA,MAAM,KAAK,UAAW,aAAa,sBAoBlC,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"updateColumns.d.ts","sourceRoot":"","sources":["updateColumns.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,aAAK,aAAa,GAAG;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,GAAG,CAAC;IACb,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC;CACtD,CAAC;AAEF,QAAA,MAAM,KAAK,UAAW,aAAa,sBAwBlC,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -1,3 +1,13 @@
1
+ var _excluded = ["menuCode", "formTemplateCode", "columns", "updateColumns"];
2
+ 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); }
3
+ 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; }
4
+ 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; }
5
+ /*
6
+ * @description:
7
+ * @author chenchangfu
8
+ * Copyright (c) 2019, AUTHOR. All rights reserved.
9
+ * AUTHOR PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
10
+ */
1
11
  import React from "react";
2
12
  import TableHeaderConfigPopover from "../TableHeaderConfigPopover";
3
13
  import { adapterColumns } from "./utils";
@@ -5,7 +15,8 @@ var Index = function Index(props) {
5
15
  var menuCode = props.menuCode,
6
16
  formTemplateCode = props.formTemplateCode,
7
17
  columns = props.columns,
8
- updateColumns = props.updateColumns;
18
+ updateColumns = props.updateColumns,
19
+ otherParam = _objectWithoutProperties(props, _excluded);
9
20
 
10
21
  // 新columns 和旧的模板对比 返回处理后数据
11
22
  var changeColumns = function changeColumns(tree) {
@@ -16,11 +27,13 @@ var Index = function Index(props) {
16
27
  JsonPares = _adapterColumns.JsonPares;
17
28
  updateColumns(JsonPares);
18
29
  };
19
- return /*#__PURE__*/React.createElement(TableHeaderConfigPopover, {
30
+ return /*#__PURE__*/React.createElement(TableHeaderConfigPopover, _extends({
31
+ request: otherParam.request,
32
+ saveColumn: otherParam.saveColumn,
20
33
  menuCode: menuCode,
21
34
  formTemplateCode: formTemplateCode,
22
35
  columns: columns,
23
36
  updateColumns: changeColumns
24
- });
37
+ }, otherParam));
25
38
  };
26
39
  export default Index;