zmdms-webui 0.0.138 → 0.0.139
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.
- package/dist/es/button/buttonExport.js +1 -1
- package/dist/es/table/components/EnhanceBodyCell.js +41 -21
- package/dist/es/uploadlist/hooks.js +3 -2
- package/dist/es/zttransfer/Container.js +10 -0
- package/dist/es/zttransfer/ZtTransfer.js +18 -0
- package/dist/es/zttransfer/index.css +1 -1
- package/dist/es/zttransfer/index.d.ts +1 -1
- package/dist/es/zttransfer/index.js +1 -1
- package/dist/es/zttransfer/interface.d.ts +4 -2
- package/dist/index.build.d.ts +1 -1
- package/dist/index.dark.css +1 -1
- package/dist/index.default.css +1 -1
- package/dist/index.es.js +1 -1
- package/package.json +2 -2
- package/dist/es/zttransfer/ztTransfer.js +0 -14
- /package/dist/es/zttransfer/{ztTransfer.d.ts → ZtTransfer.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __rest, __awaiter, __generator, __assign } from '../../_virtual/_tslib.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { useState, useEffect } from 'react';
|
|
3
|
+
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
4
4
|
import { useEditing, useIptRef, useTdRef } from './hooks.js';
|
|
5
5
|
import { getInnerIndex } from '../useInnerPagination.js';
|
|
6
6
|
import { getFormatter } from '../../inputnumber/utils.js';
|
|
@@ -29,11 +29,20 @@ var EnhanceCell = function (props) {
|
|
|
29
29
|
open: false,
|
|
30
30
|
message: "",
|
|
31
31
|
}), showPopover = _f[0], setShowPopover = _f[1];
|
|
32
|
-
|
|
32
|
+
// 点击时触发验证
|
|
33
|
+
// const [isCurrent, setIsCurrent] = useState<boolean>(false);
|
|
34
|
+
// 20231124 修改逻辑: 点击时不触发 点击只做一个必要条件
|
|
35
|
+
var isCurrentRef = useRef(false);
|
|
36
|
+
// 修改验证状态之一
|
|
37
|
+
var changeCurrentState = useCallback(function (isChange) {
|
|
38
|
+
// setIsCurrent(isChange);
|
|
39
|
+
isCurrentRef.current = isChange;
|
|
40
|
+
}, []);
|
|
33
41
|
var validateLatestRef = useLatest(validate);
|
|
34
42
|
var recordLatestRef = useLatest(newRecord);
|
|
35
43
|
var indexLatestRef = useLatest(index);
|
|
36
44
|
var titleLatestRef = useLatest(title);
|
|
45
|
+
var dataIndexLatestRef = useLatest(dataIndex);
|
|
37
46
|
// 是否需要校验
|
|
38
47
|
var triggerValidateKeys = (_b = validateLatestRef.current) === null || _b === void 0 ? void 0 : _b.triggerValidateKeys;
|
|
39
48
|
var getTriggerValues = function () {
|
|
@@ -45,9 +54,9 @@ var EnhanceCell = function (props) {
|
|
|
45
54
|
};
|
|
46
55
|
var triggerValues = getTriggerValues();
|
|
47
56
|
useEffect(function () {
|
|
48
|
-
if (!
|
|
49
|
-
|
|
50
|
-
}
|
|
57
|
+
// if (!isCurrentRef.current) {
|
|
58
|
+
// return;
|
|
59
|
+
// }
|
|
51
60
|
if (!isRealTimeValidate) {
|
|
52
61
|
return;
|
|
53
62
|
}
|
|
@@ -67,6 +76,7 @@ var EnhanceCell = function (props) {
|
|
|
67
76
|
itemRef: recordLatestRef,
|
|
68
77
|
indexRef: indexLatestRef,
|
|
69
78
|
titleRef: titleLatestRef,
|
|
79
|
+
dataIndexRef: dataIndexLatestRef,
|
|
70
80
|
})];
|
|
71
81
|
case 1:
|
|
72
82
|
_a.sent();
|
|
@@ -95,11 +105,12 @@ var EnhanceCell = function (props) {
|
|
|
95
105
|
indexLatestRef,
|
|
96
106
|
recordLatestRef,
|
|
97
107
|
titleLatestRef,
|
|
108
|
+
dataIndexLatestRef,
|
|
98
109
|
val,
|
|
99
110
|
validateLatestRef,
|
|
100
111
|
addErrorClass,
|
|
101
112
|
removeErrorClass,
|
|
102
|
-
isCurrent,
|
|
113
|
+
// isCurrent,
|
|
103
114
|
isRealTimeValidate,
|
|
104
115
|
triggerValues,
|
|
105
116
|
]);
|
|
@@ -119,9 +130,9 @@ var EnhanceCell = function (props) {
|
|
|
119
130
|
};
|
|
120
131
|
// 如果开启编辑 那么内部直接代理
|
|
121
132
|
if (typeof editable === "function" ? editable(newRecord) : editable) {
|
|
122
|
-
var
|
|
133
|
+
var _g = editableConfig || {
|
|
123
134
|
type: "input",
|
|
124
|
-
}, type =
|
|
135
|
+
}, type = _g.type, max = _g.max, min = _g.min, maxHandle = _g.maxHandle, minHandle = _g.minHandle, disabled = _g.disabled, disabledHandle = _g.disabledHandle, resetEditableConfigProps = __rest(_g, ["type", "max", "min", "maxHandle", "minHandle", "disabled", "disabledHandle"]);
|
|
125
136
|
var CurrentReactNode = null;
|
|
126
137
|
// 这里将children 替换成val 要显示的值
|
|
127
138
|
// let newChildren: any = children;
|
|
@@ -180,7 +191,11 @@ var EnhanceCell = function (props) {
|
|
|
180
191
|
console.error(err);
|
|
181
192
|
}
|
|
182
193
|
}
|
|
183
|
-
return (jsx("td", __assign({ ref: tdRef }, resetProps, { children: editing ? (jsx("div", __assign({ className: "ztxk-table__enhance-cell" }, { children: jsx(Popover
|
|
194
|
+
return (jsx("td", __assign({ ref: tdRef }, resetProps, { children: editing ? (jsx("div", __assign({ className: "ztxk-table__enhance-cell" }, { children: jsx(Popover
|
|
195
|
+
// trigger="click"
|
|
196
|
+
, __assign({
|
|
197
|
+
// trigger="click"
|
|
198
|
+
content: showPopover.message, open: showPopover.open, overlayClassName: "error-popover" }, { children: CurrentReactNode })) }))) : (jsx("div", __assign({ className: classNames("ztxk-table__enhance-cell-wrap", {
|
|
184
199
|
"ztxk-table__enhance-cell-wrap--disabled": resultDisabled,
|
|
185
200
|
}), style: {
|
|
186
201
|
lineHeight: resetEditableConfigProps.rows
|
|
@@ -189,47 +204,52 @@ var EnhanceCell = function (props) {
|
|
|
189
204
|
}, title: val, onClick: resultDisabled
|
|
190
205
|
? undefined
|
|
191
206
|
: function () {
|
|
192
|
-
|
|
207
|
+
changeCurrentState(true);
|
|
193
208
|
toggleEdit();
|
|
194
209
|
} }, { children: newChildren }))) })));
|
|
195
210
|
}
|
|
196
211
|
return (jsx("td", __assign({ ref: tdRef }, resetProps, { onClick: function () {
|
|
197
|
-
|
|
212
|
+
changeCurrentState(true);
|
|
198
213
|
} }, { children: jsx(Popover
|
|
199
214
|
// 将 click 改成 contextMenu
|
|
200
215
|
// click 会导致 Radio.Group元素 的点击文本选不中选项
|
|
216
|
+
// trigger="contextMenu"
|
|
201
217
|
, __assign({
|
|
202
218
|
// 将 click 改成 contextMenu
|
|
203
219
|
// click 会导致 Radio.Group元素 的点击文本选不中选项
|
|
204
|
-
trigger
|
|
220
|
+
// trigger="contextMenu"
|
|
221
|
+
content: showPopover.message, open: showPopover.open, overlayClassName: "error-popover", onOpenChange: function (open) {
|
|
205
222
|
setShowPopover(function (pre) {
|
|
206
223
|
return __assign(__assign({}, pre), { open: open });
|
|
207
224
|
});
|
|
208
225
|
} }, { children: children })) })));
|
|
209
226
|
};
|
|
210
227
|
function validateHandle(_a) {
|
|
211
|
-
var validateRef = _a.validateRef, value = _a.value, itemRef = _a.itemRef, indexRef = _a.indexRef, titleRef = _a.titleRef;
|
|
228
|
+
var validateRef = _a.validateRef, value = _a.value, itemRef = _a.itemRef, indexRef = _a.indexRef, titleRef = _a.titleRef, dataIndexRef = _a.dataIndexRef;
|
|
212
229
|
return __awaiter(this, void 0, void 0, function () {
|
|
213
|
-
var validate, item, index, title, validateFn, pattern, message, err_2, i, rp;
|
|
214
|
-
|
|
215
|
-
|
|
230
|
+
var validate, item, index, title, dataIndex, validateFn, pattern, message, newItem, err_2, i, rp;
|
|
231
|
+
var _b;
|
|
232
|
+
return __generator(this, function (_c) {
|
|
233
|
+
switch (_c.label) {
|
|
216
234
|
case 0:
|
|
217
235
|
validate = validateRef.current;
|
|
218
236
|
item = itemRef.current;
|
|
219
237
|
index = indexRef.current;
|
|
220
238
|
title = titleRef.current;
|
|
239
|
+
dataIndex = dataIndexRef.current;
|
|
221
240
|
if (!validate) return [3 /*break*/, 5];
|
|
222
241
|
validateFn = validate.validate, pattern = validate.pattern, message = validate.message;
|
|
223
242
|
if (!(typeof validateFn === "function")) return [3 /*break*/, 4];
|
|
224
|
-
|
|
243
|
+
_c.label = 1;
|
|
225
244
|
case 1:
|
|
226
|
-
|
|
227
|
-
|
|
245
|
+
_c.trys.push([1, 3, , 4]);
|
|
246
|
+
newItem = item && dataIndex ? __assign(__assign({}, item), (_b = {}, _b[dataIndex] = value, _b)) : item;
|
|
247
|
+
return [4 /*yield*/, validateFn(value, newItem, index + 1, title)];
|
|
228
248
|
case 2:
|
|
229
|
-
|
|
249
|
+
_c.sent();
|
|
230
250
|
return [3 /*break*/, 4];
|
|
231
251
|
case 3:
|
|
232
|
-
err_2 =
|
|
252
|
+
err_2 = _c.sent();
|
|
233
253
|
return [2 /*return*/, Promise.reject(err_2)];
|
|
234
254
|
case 4:
|
|
235
255
|
// 正则校验
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __assign, __awaiter, __generator } from '../_virtual/_tslib.js';
|
|
2
2
|
import { useCallback, useState, useEffect, useMemo } from 'react';
|
|
3
3
|
import { flushSync } from 'react-dom';
|
|
4
|
-
import { getFileExtension, isImageExtension, createDownloadLink, createUploadFileLink, getToken, exactRound, times, divide } from 'zmdms-utils';
|
|
4
|
+
import { getFileExtension, isImageExtension, createDownloadLink, createUploadFileLink, TOKEN_KEY, getToken, exactRound, times, divide } from 'zmdms-utils';
|
|
5
5
|
import MemoUploadList from './uploadList.js';
|
|
6
6
|
import { useLatest } from 'ahooks';
|
|
7
7
|
import { message } from 'antd';
|
|
@@ -174,7 +174,8 @@ function useBasicInfo(props) {
|
|
|
174
174
|
var fileAction = action ? action : createUploadFileLink({ API_BASEURL: API_BASEURL });
|
|
175
175
|
// 文件上传头部参数
|
|
176
176
|
var fileHeaders = useMemo(function () {
|
|
177
|
-
|
|
177
|
+
var _a;
|
|
178
|
+
return __assign((_a = {}, _a[TOKEN_KEY] = getToken() || "", _a), headers);
|
|
178
179
|
}, [headers]);
|
|
179
180
|
// 其余参数
|
|
180
181
|
var fileData = useMemo(function () {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __assign } from '../_virtual/_tslib.js';
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import SelectContainer from './SelectContainer.js';
|
|
4
|
+
|
|
5
|
+
var Container = function (props) {
|
|
6
|
+
var _a = props.mode, mode = _a === void 0 ? "multiple" : _a;
|
|
7
|
+
return (jsx("div", __assign({ className: "container" }, { children: mode === "multiple" ? (jsxs(Fragment, { children: [jsx(SelectContainer, { title: "\u53EF\u9009", contentPadding: true }), jsx(SelectContainer, { title: "\u5DF2\u9009", allowClear: true, onClear: function () { } })] })) : (jsx(SelectContainer, { contentPadding: true })) })));
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { Container as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { __rest, __assign } from '../_virtual/_tslib.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import Container from './Container.js';
|
|
4
|
+
import MemoTabs from '../tabs/tabs.js';
|
|
5
|
+
|
|
6
|
+
var ZtTransfer = function (_a) {
|
|
7
|
+
var resetProps = __rest(_a, []);
|
|
8
|
+
var items = [
|
|
9
|
+
{
|
|
10
|
+
label: "组织结构",
|
|
11
|
+
key: "item-1",
|
|
12
|
+
children: jsx(Container, __assign({}, resetProps)),
|
|
13
|
+
},
|
|
14
|
+
];
|
|
15
|
+
return (jsx("div", __assign({ className: "zt-transfer" }, { children: jsx(MemoTabs, { items: items, nonBorder: true }) })));
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { ZtTransfer as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.zt-transfer--container{border:1px solid #dee9f6;border-radius:4px;width:300px}.zt-transfer--container .title{align-items:center;background-color:#fafafa;border-bottom:1px solid #dee9f6;border-top-left-radius:4px;border-top-right-radius:4px;display:flex;justify-content:space-between;line-height:32px;padding:0 0 0 10px}.zt-transfer--container .title>button{padding:4px 10px}.zt-transfer--container .wrap{display:flex;flex-direction:column;height:400px}.zt-transfer--container .wrap .search{padding:10px}.zt-transfer--container .wrap .search .ant-input{height:30px}.zt-transfer--container .wrap .search .ant-btn{background-color:#fff;border-color:#d9d9d9}.zt-transfer--container .wrap .content{flex:1;overflow:auto}
|
|
1
|
+
.zt-transfer{padding:10px}.zt-transfer .container{display:flex;justify-content:space-between}.zt-transfer--container{border:1px solid #dee9f6;border-radius:4px;width:300px}.zt-transfer--container .title{align-items:center;background-color:#fafafa;border-bottom:1px solid #dee9f6;border-top-left-radius:4px;border-top-right-radius:4px;display:flex;justify-content:space-between;line-height:32px;padding:0 0 0 10px}.zt-transfer--container .title>button{padding:4px 10px}.zt-transfer--container .wrap{display:flex;flex-direction:column;height:400px}.zt-transfer--container .wrap .search{padding:10px}.zt-transfer--container .wrap .search .ant-input{height:30px}.zt-transfer--container .wrap .search .ant-btn{background-color:#fff;border-color:#d9d9d9}.zt-transfer--container .wrap .content{flex:1;overflow:auto}
|
package/dist/index.build.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export { default as AuthLoading } from './es/authloading/authLoading.js';
|
|
|
39
39
|
export { default as NotAuthPage } from './es/notauthpage/notAuthPage.js';
|
|
40
40
|
export { default as NotRoutePage } from './es/notroutepage/notRoutePage.js';
|
|
41
41
|
export { default as Alert } from './es/alert/alert.js';
|
|
42
|
-
export { default as ZtTransfer } from './es/zttransfer/
|
|
42
|
+
export { default as ZtTransfer } from './es/zttransfer/ZtTransfer.js';
|
|
43
43
|
export { Affix, Anchor, AutoComplete, Avatar, BackTop, Badge, Breadcrumb, Card, Carousel, Cascader, Checkbox, Col, Comment, ConfigProvider, Divider, Drawer, Dropdown, Empty, Grid, Image, Layout, List, Mentions, Menu, PageHeader, Popconfirm, Popover, Progress, Radio, Rate, Result, Row, Segmented, Skeleton, Slider, Space, Spin, Statistic, Steps, Switch, Timeline, Tooltip, Transfer, Typography, Upload, message, notification } from 'antd';
|
|
44
44
|
export { IModalOpenOptions, IModalProps, IModalRef } from './es/modal/interface.js';
|
|
45
45
|
export { IFooterDom, IFooterProps } from './es/footer/interface.js';
|