ns-base-module 1.1.66 → 1.1.67
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.
|
@@ -32,7 +32,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
32
32
|
// import { initLang } from "@/utils/language";
|
|
33
33
|
import { CopyOutlined, DeleteOutlined, PlusOutlined, SettingOutlined, ShareAltOutlined, UserOutlined } from "@ant-design/icons";
|
|
34
34
|
import { Button, Checkbox, Input, message, Popconfirm, Popover, Radio, Tooltip, Tree } from "antd";
|
|
35
|
-
import { cloneDeep,
|
|
35
|
+
import { cloneDeep, isArray, isEmpty } from "lodash";
|
|
36
36
|
import React, { memo, useEffect, useMemo, useState } from "react";
|
|
37
37
|
import { DndProvider } from "react-dnd";
|
|
38
38
|
import { HTML5Backend } from "react-dnd-html5-backend";
|
|
@@ -40,7 +40,7 @@ import Dustbin from "./Dustbin";
|
|
|
40
40
|
import "../../style/components/TableHeaderConfigPopover.scss";
|
|
41
41
|
import { initLang } from "../utils/language";
|
|
42
42
|
import { queryColumnsConfig, setFormTemplates } from "../utils/services/global";
|
|
43
|
-
import {
|
|
43
|
+
import { adapterColumns, sortColums } from "./utils";
|
|
44
44
|
// 设置界面
|
|
45
45
|
var ColumnsToolbarRender = /*#__PURE__*/memo(function (props) {
|
|
46
46
|
var columns = props.columns,
|
|
@@ -814,39 +814,36 @@ var ColumnsToolbar = function ColumnsToolbar(_ref4) {
|
|
|
814
814
|
var handleSet = function handleSet(item) {
|
|
815
815
|
try {
|
|
816
816
|
// 匹配是否有字段修改
|
|
817
|
-
|
|
818
|
-
// 删掉新数组没有的字段
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
//
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
for (var _j = 0, _k2 = props.columns.length; _j < _k2; _j++) {
|
|
848
|
-
_loop3(_j);
|
|
849
|
-
}
|
|
817
|
+
// const JsonPares = JSON.parse(item.define) as any;
|
|
818
|
+
// // 删掉新数组没有的字段
|
|
819
|
+
// for (let j = 0, k = JsonPares.length; j < k; j++) {
|
|
820
|
+
// const _code = JsonPares[j].code ? "code" : "dataIndex";
|
|
821
|
+
// if (!find(props.columns, (o) => o[_code] === JsonPares[j][_code])) {
|
|
822
|
+
// JsonPares.splice(j, 1);
|
|
823
|
+
// k -= 1;
|
|
824
|
+
// }
|
|
825
|
+
// }
|
|
826
|
+
// // 新增新数组字段 || 更新名称
|
|
827
|
+
// for (let j = 0, k = props.columns.length; j < k; j++) {
|
|
828
|
+
// const _code = props.columns[j].code ? "code" : "dataIndex";
|
|
829
|
+
// const _findItem = find(
|
|
830
|
+
// JsonPares,
|
|
831
|
+
// (o) => o[_code] === props.columns[j][_code]
|
|
832
|
+
// );
|
|
833
|
+
// if (!_findItem) {
|
|
834
|
+
// JsonPares.push(initColumns([props.columns[j]], null)[0]);
|
|
835
|
+
// } else {
|
|
836
|
+
// // 更新名称
|
|
837
|
+
// if (_findItem.title !== props.columns[j].title) {
|
|
838
|
+
// _findItem.title = props.columns[j].title;
|
|
839
|
+
// }
|
|
840
|
+
// }
|
|
841
|
+
// }
|
|
842
|
+
|
|
843
|
+
var _adapterColumns = adapterColumns([_objectSpread(_objectSpread({}, item), {}, {
|
|
844
|
+
is_default: "Y"
|
|
845
|
+
})], props.columns),
|
|
846
|
+
JsonPares = _adapterColumns.JsonPares;
|
|
850
847
|
setColumnsCofnig(JsonPares);
|
|
851
848
|
setShowConfig(true);
|
|
852
849
|
setEditItem(item);
|