@gingkoo/pandora-explorer 0.0.1-alpha.18 → 0.0.1-alpha.19
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/lib/es/components/tree/index.d.ts +3 -0
- package/lib/es/index.js +509 -69
- package/lib/es/index.js.map +1 -1
- package/lib/es/utils/helper.d.ts +1 -1
- package/package.json +1 -1
package/lib/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @gingkoo/pandora-explorer v0.0.1-alpha.
|
|
2
|
+
* @gingkoo/pandora-explorer v0.0.1-alpha.19
|
|
3
3
|
*/
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import cx$1 from 'classnames';
|
|
@@ -17,6 +17,7 @@ import VirtualList from 'rc-virtual-list';
|
|
|
17
17
|
import CSSMotion, { Provider } from 'rc-motion';
|
|
18
18
|
import toArray from 'rc-util/lib/Children/toArray';
|
|
19
19
|
import omit from 'rc-util/lib/omit';
|
|
20
|
+
import ReactDOM from 'react-dom';
|
|
20
21
|
|
|
21
22
|
function styleInject(css, ref) {
|
|
22
23
|
if ( ref === void 0 ) ref = {};
|
|
@@ -65,7 +66,7 @@ const getKey$1 = (randomLength = 3) => {
|
|
|
65
66
|
let str = Number(Math.random().toString().substr(2, randomLength) + Date.now()).toString(36);
|
|
66
67
|
return str.toUpperCase();
|
|
67
68
|
};
|
|
68
|
-
const convertBytesToSize = bytes => {
|
|
69
|
+
const convertBytesToSize = (bytes = 2) => {
|
|
69
70
|
const thresh = 1024;
|
|
70
71
|
if (Math.abs(bytes) < thresh) {
|
|
71
72
|
return bytes + ' B';
|
|
@@ -1791,8 +1792,8 @@ const ExplorerHead = props => {
|
|
|
1791
1792
|
children: "\u6587\u4EF6\u4E0A\u4F20"
|
|
1792
1793
|
}), jsx("input", {
|
|
1793
1794
|
type: 'file',
|
|
1794
|
-
onChange: e => {
|
|
1795
|
-
props?.onUpload?.(e.target.files[0], store.curInfo);
|
|
1795
|
+
onChange: async e => {
|
|
1796
|
+
await props?.onUpload?.(e.target.files[0], store.curInfo);
|
|
1796
1797
|
loadData?.(store.curInfo?.key);
|
|
1797
1798
|
}
|
|
1798
1799
|
})]
|
|
@@ -5156,6 +5157,7 @@ function TableItem(props) {
|
|
|
5156
5157
|
onMenuClick,
|
|
5157
5158
|
rename,
|
|
5158
5159
|
onRename,
|
|
5160
|
+
onSelect,
|
|
5159
5161
|
...param
|
|
5160
5162
|
} = props;
|
|
5161
5163
|
return jsx(Dropdown, {
|
|
@@ -5323,9 +5325,7 @@ var TreeItem = (props => {
|
|
|
5323
5325
|
})
|
|
5324
5326
|
}) : jsxs("div", {
|
|
5325
5327
|
className: 'explorer-tree-node',
|
|
5326
|
-
onClick: () => {
|
|
5327
|
-
onSelect?.();
|
|
5328
|
-
},
|
|
5328
|
+
onClick: () => {},
|
|
5329
5329
|
children: [jsx("div", {
|
|
5330
5330
|
className: 'node-title',
|
|
5331
5331
|
children: title || ''
|
|
@@ -5422,12 +5422,14 @@ var Tree = (props => {
|
|
|
5422
5422
|
treeData,
|
|
5423
5423
|
checks,
|
|
5424
5424
|
height,
|
|
5425
|
+
expandedKeys,
|
|
5425
5426
|
width: _widht,
|
|
5426
5427
|
columns,
|
|
5427
5428
|
isload = false,
|
|
5428
5429
|
ischeck = false,
|
|
5429
5430
|
showLine = true,
|
|
5430
5431
|
animation = true,
|
|
5432
|
+
loadedKeys = undefined,
|
|
5431
5433
|
icon,
|
|
5432
5434
|
titleRender,
|
|
5433
5435
|
onChecks,
|
|
@@ -5437,7 +5439,8 @@ var Tree = (props => {
|
|
|
5437
5439
|
onMenuClick,
|
|
5438
5440
|
onRename,
|
|
5439
5441
|
loadData,
|
|
5440
|
-
filterData
|
|
5442
|
+
filterData,
|
|
5443
|
+
onExpand
|
|
5441
5444
|
} = props;
|
|
5442
5445
|
const ref = useRef(null);
|
|
5443
5446
|
const tree = useRef(null);
|
|
@@ -5636,6 +5639,7 @@ var Tree = (props => {
|
|
|
5636
5639
|
}), jsx(Tree$1, {
|
|
5637
5640
|
ref: tree,
|
|
5638
5641
|
checkStrictly: true,
|
|
5642
|
+
expandedKeys: expandedKeys,
|
|
5639
5643
|
checkable: type == 'table' ? true : false,
|
|
5640
5644
|
autoExpandParent: autoExpandParent,
|
|
5641
5645
|
defaultExpandedKeys: defaultExpandedKeys || [],
|
|
@@ -5661,6 +5665,9 @@ var Tree = (props => {
|
|
|
5661
5665
|
onContextMenu: e => {
|
|
5662
5666
|
e.preventDefault();
|
|
5663
5667
|
},
|
|
5668
|
+
onExpand: v => {
|
|
5669
|
+
onExpand?.(v);
|
|
5670
|
+
},
|
|
5664
5671
|
onDoubleClick: (v, node) => {
|
|
5665
5672
|
v.stopPropagation();
|
|
5666
5673
|
onDblclick && onDblclick?.(node.key, node);
|
|
@@ -5709,12 +5716,6 @@ var Tree = (props => {
|
|
|
5709
5716
|
}
|
|
5710
5717
|
onChecks && onChecks?.(arr);
|
|
5711
5718
|
},
|
|
5712
|
-
onSelect: item => {
|
|
5713
|
-
onSelect && onSelect?.({
|
|
5714
|
-
key: v.key,
|
|
5715
|
-
...v
|
|
5716
|
-
});
|
|
5717
|
-
},
|
|
5718
5719
|
columns: columns
|
|
5719
5720
|
});
|
|
5720
5721
|
}
|
|
@@ -5728,12 +5729,6 @@ var Tree = (props => {
|
|
|
5728
5729
|
setRename(null);
|
|
5729
5730
|
onRename && onRename(v.key, value, v);
|
|
5730
5731
|
},
|
|
5731
|
-
onSelect: () => {
|
|
5732
|
-
onSelect && onSelect?.({
|
|
5733
|
-
key: v.key,
|
|
5734
|
-
...v
|
|
5735
|
-
});
|
|
5736
|
-
},
|
|
5737
5732
|
onMenuClick: menu => {
|
|
5738
5733
|
if (menu == 'rename') {
|
|
5739
5734
|
setTimeout(() => {
|
|
@@ -5745,6 +5740,14 @@ var Tree = (props => {
|
|
|
5745
5740
|
}
|
|
5746
5741
|
});
|
|
5747
5742
|
},
|
|
5743
|
+
onSelect: (v, info) => {
|
|
5744
|
+
if (v[0]) {
|
|
5745
|
+
onSelect?.({
|
|
5746
|
+
key: v[0],
|
|
5747
|
+
...(info?.node || {})
|
|
5748
|
+
});
|
|
5749
|
+
}
|
|
5750
|
+
},
|
|
5748
5751
|
loadData: isload ? onLoadData : null,
|
|
5749
5752
|
treeData: type == 'table' ? [...data, {
|
|
5750
5753
|
key: '_ending',
|
|
@@ -6088,6 +6091,387 @@ function Tile(props) {
|
|
|
6088
6091
|
});
|
|
6089
6092
|
}
|
|
6090
6093
|
|
|
6094
|
+
var time = null;
|
|
6095
|
+
const SelectBox = props => {
|
|
6096
|
+
let {
|
|
6097
|
+
checks = [],
|
|
6098
|
+
className = '',
|
|
6099
|
+
dataClass,
|
|
6100
|
+
selectClass = '',
|
|
6101
|
+
regionClass,
|
|
6102
|
+
isDrag = true,
|
|
6103
|
+
isSelectBoxes = true,
|
|
6104
|
+
checkType = '',
|
|
6105
|
+
checkMode,
|
|
6106
|
+
action = 'stack',
|
|
6107
|
+
onChange
|
|
6108
|
+
} = props;
|
|
6109
|
+
const selectionRef = useRef(null);
|
|
6110
|
+
const clickRef = useRef(true);
|
|
6111
|
+
//选框
|
|
6112
|
+
const ref = useRef(null);
|
|
6113
|
+
//选择中
|
|
6114
|
+
const _dom = useRef([]);
|
|
6115
|
+
//目标
|
|
6116
|
+
const target = useRef(null);
|
|
6117
|
+
//盒子
|
|
6118
|
+
const box = useRef(null);
|
|
6119
|
+
//当前
|
|
6120
|
+
const cur = useRef([]);
|
|
6121
|
+
//判断单机还双击
|
|
6122
|
+
const isDclick = useRef(null);
|
|
6123
|
+
const [selects, setSelect] = useState([]);
|
|
6124
|
+
const [stageClickInfo, setStageClickInfo] = useState({
|
|
6125
|
+
show: false
|
|
6126
|
+
});
|
|
6127
|
+
useEffect(() => {
|
|
6128
|
+
setSelect(checks);
|
|
6129
|
+
}, [checks]);
|
|
6130
|
+
useEffect(() => {
|
|
6131
|
+
document.addEventListener('mousemove', handleBodyMousemove);
|
|
6132
|
+
document.addEventListener('mouseup', handleBodyMouseup);
|
|
6133
|
+
return () => {
|
|
6134
|
+
document.removeEventListener('mousemove', handleBodyMousemove);
|
|
6135
|
+
document.removeEventListener('mouseup', handleBodyMouseup);
|
|
6136
|
+
};
|
|
6137
|
+
}, [stageClickInfo, checkMode]);
|
|
6138
|
+
//判断鼠标点击位置 是否为目标区域
|
|
6139
|
+
function isSelectTarget(e) {
|
|
6140
|
+
let idx = [];
|
|
6141
|
+
Array.from(document.querySelectorAll(selectClass)).filter(v => {
|
|
6142
|
+
if (v.contains(e.target)) {
|
|
6143
|
+
let dataDom = v;
|
|
6144
|
+
if (dataClass) {
|
|
6145
|
+
dataDom = v.querySelector(dataClass);
|
|
6146
|
+
let id = dataDom.getAttribute('data-id');
|
|
6147
|
+
if (checkType) {
|
|
6148
|
+
let type = dataDom.getAttribute('data-type');
|
|
6149
|
+
if (type !== checkType) return;
|
|
6150
|
+
}
|
|
6151
|
+
if (id) {
|
|
6152
|
+
idx.push(id);
|
|
6153
|
+
}
|
|
6154
|
+
}
|
|
6155
|
+
}
|
|
6156
|
+
});
|
|
6157
|
+
if (idx.length) {
|
|
6158
|
+
return idx;
|
|
6159
|
+
}
|
|
6160
|
+
return null;
|
|
6161
|
+
}
|
|
6162
|
+
//鼠标移动
|
|
6163
|
+
function handleBodyMousemove(e) {
|
|
6164
|
+
const {
|
|
6165
|
+
clientX: x,
|
|
6166
|
+
clientY: y
|
|
6167
|
+
} = e;
|
|
6168
|
+
if (!time && cur?.current?.length && isDrag) {
|
|
6169
|
+
cur.current?.map((v, i) => {
|
|
6170
|
+
v.style.cssText = `
|
|
6171
|
+
position: absolute;
|
|
6172
|
+
transition: 0.3s;
|
|
6173
|
+
top:${y + i * 3}px;
|
|
6174
|
+
left:${x + i * 3}px;
|
|
6175
|
+
`;
|
|
6176
|
+
});
|
|
6177
|
+
time = setTimeout(() => {
|
|
6178
|
+
cur.current.forEach(v => v.remove());
|
|
6179
|
+
cur.current = [];
|
|
6180
|
+
}, 200);
|
|
6181
|
+
}
|
|
6182
|
+
if (isDrag && selects.length) {
|
|
6183
|
+
if (target.current) {
|
|
6184
|
+
target.current.style.cssText = `
|
|
6185
|
+
position: absolute;
|
|
6186
|
+
top:${y}px;
|
|
6187
|
+
left:${x}px;
|
|
6188
|
+
`;
|
|
6189
|
+
}
|
|
6190
|
+
} else {
|
|
6191
|
+
createBox(e);
|
|
6192
|
+
}
|
|
6193
|
+
}
|
|
6194
|
+
//鼠标松开
|
|
6195
|
+
function handleBodyMouseup() {
|
|
6196
|
+
if (target.current) {
|
|
6197
|
+
empty();
|
|
6198
|
+
} else {
|
|
6199
|
+
setStageClickInfo({
|
|
6200
|
+
show: false
|
|
6201
|
+
});
|
|
6202
|
+
const selectionDom = selectionRef.current;
|
|
6203
|
+
if (selectionDom) {
|
|
6204
|
+
selectionDom.style.cssText = `
|
|
6205
|
+
position: absolute;
|
|
6206
|
+
opacity: 0;
|
|
6207
|
+
top:1px;
|
|
6208
|
+
left: 1px;
|
|
6209
|
+
width: 0px;
|
|
6210
|
+
height: 0px;
|
|
6211
|
+
pointer-events: none;
|
|
6212
|
+
z-index: -1;
|
|
6213
|
+
`;
|
|
6214
|
+
}
|
|
6215
|
+
setTimeout(() => {
|
|
6216
|
+
clickRef.current = true;
|
|
6217
|
+
}, 300);
|
|
6218
|
+
}
|
|
6219
|
+
}
|
|
6220
|
+
//创建选框
|
|
6221
|
+
function createBox(e) {
|
|
6222
|
+
if (stageClickInfo.show) {
|
|
6223
|
+
let region = null;
|
|
6224
|
+
if (regionClass) {
|
|
6225
|
+
let dom = document.querySelector(regionClass);
|
|
6226
|
+
if (dom) {
|
|
6227
|
+
region = dom.getBoundingClientRect();
|
|
6228
|
+
}
|
|
6229
|
+
}
|
|
6230
|
+
if (region) {
|
|
6231
|
+
let {
|
|
6232
|
+
x: left,
|
|
6233
|
+
y: top,
|
|
6234
|
+
width,
|
|
6235
|
+
height
|
|
6236
|
+
} = region;
|
|
6237
|
+
let right = left + width;
|
|
6238
|
+
let bottom = top + height;
|
|
6239
|
+
let {
|
|
6240
|
+
clientX: x,
|
|
6241
|
+
clientY: y
|
|
6242
|
+
} = e;
|
|
6243
|
+
if (x > right || x < left || y > bottom || y < top) {
|
|
6244
|
+
return;
|
|
6245
|
+
}
|
|
6246
|
+
}
|
|
6247
|
+
const selectionDom = selectionRef.current;
|
|
6248
|
+
if (selectionDom) {
|
|
6249
|
+
let idx = [];
|
|
6250
|
+
if (checkMode == 'check') {
|
|
6251
|
+
idx = cloneDeep(checks);
|
|
6252
|
+
}
|
|
6253
|
+
let dom = [];
|
|
6254
|
+
// 终点
|
|
6255
|
+
const {
|
|
6256
|
+
clientX: x,
|
|
6257
|
+
clientY: y
|
|
6258
|
+
} = e;
|
|
6259
|
+
// 起点
|
|
6260
|
+
const {
|
|
6261
|
+
x: pX,
|
|
6262
|
+
y: pY
|
|
6263
|
+
} = stageClickInfo;
|
|
6264
|
+
if (!pX || !pY) {
|
|
6265
|
+
return null;
|
|
6266
|
+
}
|
|
6267
|
+
// 默认右下
|
|
6268
|
+
let sTop = pY;
|
|
6269
|
+
let sLeft = pX;
|
|
6270
|
+
let sWidth = x - pX;
|
|
6271
|
+
let sHeight = y - pY;
|
|
6272
|
+
// 左下
|
|
6273
|
+
if (x < pX && y > pY) {
|
|
6274
|
+
sLeft = x;
|
|
6275
|
+
sWidth = pX - x;
|
|
6276
|
+
}
|
|
6277
|
+
// 左上
|
|
6278
|
+
if (x < stageClickInfo.x && y < pY) {
|
|
6279
|
+
sLeft = x;
|
|
6280
|
+
sTop = y;
|
|
6281
|
+
sWidth = pX - x;
|
|
6282
|
+
sHeight = pY - y;
|
|
6283
|
+
}
|
|
6284
|
+
// 右上
|
|
6285
|
+
if (x > stageClickInfo.x && y < pY) {
|
|
6286
|
+
sTop = y;
|
|
6287
|
+
sHeight = pY - y;
|
|
6288
|
+
}
|
|
6289
|
+
Array.from(document.querySelectorAll(selectClass)).forEach((v, i) => {
|
|
6290
|
+
let dataDom = v;
|
|
6291
|
+
if (dataClass) {
|
|
6292
|
+
dataDom = v.querySelector(dataClass);
|
|
6293
|
+
}
|
|
6294
|
+
let {
|
|
6295
|
+
top,
|
|
6296
|
+
right,
|
|
6297
|
+
bottom,
|
|
6298
|
+
left
|
|
6299
|
+
} = v.getBoundingClientRect();
|
|
6300
|
+
let sRight = sLeft + sWidth;
|
|
6301
|
+
let sBottom = sTop + sHeight;
|
|
6302
|
+
//判断是否在选择区
|
|
6303
|
+
let leftCover = sLeft <= left && left <= sRight;
|
|
6304
|
+
let cmidst = sLeft >= left && sRight <= right; //内
|
|
6305
|
+
let rightCover = sLeft <= right && right <= sRight;
|
|
6306
|
+
let topCover = sTop <= top && top <= sBottom;
|
|
6307
|
+
let midst = sTop >= top && sBottom <= bottom; //内
|
|
6308
|
+
let bottomCover = sTop <= bottom && bottom <= sBottom;
|
|
6309
|
+
if ((leftCover || cmidst || rightCover) && (topCover || midst || bottomCover)) {
|
|
6310
|
+
if (checkType) {
|
|
6311
|
+
let type = dataDom.getAttribute('data-type');
|
|
6312
|
+
if (type !== checkType) return;
|
|
6313
|
+
}
|
|
6314
|
+
let id = dataDom.getAttribute('data-id');
|
|
6315
|
+
if (id && !idx.includes(id)) {
|
|
6316
|
+
idx.push(id);
|
|
6317
|
+
dom.push(v);
|
|
6318
|
+
}
|
|
6319
|
+
}
|
|
6320
|
+
});
|
|
6321
|
+
selectionDom.style.cssText = `
|
|
6322
|
+
position: absolute;
|
|
6323
|
+
background-color: rgba(30, 175, 249, .2);
|
|
6324
|
+
border: 1px solid rgba(30, 175, 249, 1);
|
|
6325
|
+
top:${sTop}px;
|
|
6326
|
+
left: ${sLeft}px;
|
|
6327
|
+
width: ${sWidth}px;
|
|
6328
|
+
height: ${sHeight}px;
|
|
6329
|
+
pointer-events: none;
|
|
6330
|
+
z-index: 10;
|
|
6331
|
+
`;
|
|
6332
|
+
_dom.current = dom;
|
|
6333
|
+
onChange(idx);
|
|
6334
|
+
}
|
|
6335
|
+
}
|
|
6336
|
+
}
|
|
6337
|
+
//创建虚拟节点
|
|
6338
|
+
function createVDom(e) {
|
|
6339
|
+
let body = document.querySelector('body');
|
|
6340
|
+
let _box = null;
|
|
6341
|
+
let _target = null;
|
|
6342
|
+
_box = document.createElement('div');
|
|
6343
|
+
_target = document.createElement('div');
|
|
6344
|
+
const {
|
|
6345
|
+
clientX: x,
|
|
6346
|
+
clientY: y
|
|
6347
|
+
} = e;
|
|
6348
|
+
_box.className = `_selectbox ${className}`;
|
|
6349
|
+
_box.style.cssText = `
|
|
6350
|
+
position: absolute;
|
|
6351
|
+
top:1px;
|
|
6352
|
+
left: 1px;
|
|
6353
|
+
width: 0px;
|
|
6354
|
+
height: 0px;
|
|
6355
|
+
pointer-events: none;
|
|
6356
|
+
overflow: visible !important;
|
|
6357
|
+
z-index: 999;
|
|
6358
|
+
`;
|
|
6359
|
+
_target.style.cssText = `
|
|
6360
|
+
position: absolute;
|
|
6361
|
+
top:${y}px;
|
|
6362
|
+
left:${x}px;
|
|
6363
|
+
pointer-events: none;
|
|
6364
|
+
`;
|
|
6365
|
+
_dom.current.map((v, i) => {
|
|
6366
|
+
let _cur = v.cloneNode(true);
|
|
6367
|
+
let data = v.getBoundingClientRect();
|
|
6368
|
+
_cur.style.cssText = `
|
|
6369
|
+
position: absolute;
|
|
6370
|
+
top:${data.top}px;
|
|
6371
|
+
left:${data.left}px;
|
|
6372
|
+
opacity:0.5;
|
|
6373
|
+
transition: 0.3s;
|
|
6374
|
+
`;
|
|
6375
|
+
cur.current.push(_cur);
|
|
6376
|
+
_box?.appendChild(_cur);
|
|
6377
|
+
if (i > 10) return;
|
|
6378
|
+
let value = v.cloneNode(true);
|
|
6379
|
+
if (action == 'stack') {
|
|
6380
|
+
value.style.cssText = `
|
|
6381
|
+
position: absolute;
|
|
6382
|
+
top:${i * 3}px;
|
|
6383
|
+
left:${i * 3}px;
|
|
6384
|
+
z-index: ${i * -1};
|
|
6385
|
+
width:${data?.width ? data?.width : 'auto'};
|
|
6386
|
+
opacity: 1;
|
|
6387
|
+
margin:0
|
|
6388
|
+
`;
|
|
6389
|
+
} else if (action == 'rotate') {
|
|
6390
|
+
value.style.cssText = `
|
|
6391
|
+
position: absolute;
|
|
6392
|
+
top:${i}px;
|
|
6393
|
+
left:${i}px;
|
|
6394
|
+
z-index: ${i * -1};
|
|
6395
|
+
transform: rotate(${4 * (i % 2 ? i * -1 : i)}deg);
|
|
6396
|
+
opacity: 1;
|
|
6397
|
+
margin:0
|
|
6398
|
+
`;
|
|
6399
|
+
}
|
|
6400
|
+
_target?.appendChild(value);
|
|
6401
|
+
});
|
|
6402
|
+
_box?.appendChild(_target);
|
|
6403
|
+
body?.appendChild(_box);
|
|
6404
|
+
box.current = _box;
|
|
6405
|
+
target.current = _target;
|
|
6406
|
+
}
|
|
6407
|
+
//清空
|
|
6408
|
+
function empty() {
|
|
6409
|
+
target.current?.remove();
|
|
6410
|
+
box.current?.remove();
|
|
6411
|
+
target.current = null;
|
|
6412
|
+
box.current = null;
|
|
6413
|
+
clickRef.current = false;
|
|
6414
|
+
}
|
|
6415
|
+
return jsxs("div", {
|
|
6416
|
+
ref: ref,
|
|
6417
|
+
className: cx$1(`${className}`),
|
|
6418
|
+
onClick: e => {},
|
|
6419
|
+
onMouseDown: e => {
|
|
6420
|
+
if (e.button === 2) return;
|
|
6421
|
+
if (isDclick.current) {
|
|
6422
|
+
clearTimeout(isDclick.current);
|
|
6423
|
+
isDclick.current = null;
|
|
6424
|
+
} else {
|
|
6425
|
+
let type = isSelectTarget(e);
|
|
6426
|
+
//选中
|
|
6427
|
+
//在区域未选中
|
|
6428
|
+
isDclick.current = setTimeout(() => {
|
|
6429
|
+
if (checks.includes(type?.[0])) {
|
|
6430
|
+
if (!isDrag && checkMode == 'check') {
|
|
6431
|
+
let arr = checks.filter(v => v !== type?.[0]);
|
|
6432
|
+
setSelect(arr);
|
|
6433
|
+
onChange(arr);
|
|
6434
|
+
}
|
|
6435
|
+
time = null;
|
|
6436
|
+
isDrag && createVDom(e);
|
|
6437
|
+
return;
|
|
6438
|
+
}
|
|
6439
|
+
if (Array.isArray(type)) {
|
|
6440
|
+
if (checkMode == 'check') {
|
|
6441
|
+
if (!checks.includes(type?.[0])) {
|
|
6442
|
+
let arr = [...selects, ...type];
|
|
6443
|
+
setSelect(arr);
|
|
6444
|
+
onChange(arr);
|
|
6445
|
+
}
|
|
6446
|
+
} else {
|
|
6447
|
+
setSelect(type);
|
|
6448
|
+
onChange(type);
|
|
6449
|
+
}
|
|
6450
|
+
}
|
|
6451
|
+
isDclick.current = null;
|
|
6452
|
+
}, 200);
|
|
6453
|
+
if (type) return;
|
|
6454
|
+
if (selects.length) {
|
|
6455
|
+
if (checkMode !== 'check') {
|
|
6456
|
+
setSelect([]);
|
|
6457
|
+
onChange([]);
|
|
6458
|
+
empty();
|
|
6459
|
+
}
|
|
6460
|
+
}
|
|
6461
|
+
clickRef.current = false;
|
|
6462
|
+
isSelectBoxes && setStageClickInfo({
|
|
6463
|
+
show: true,
|
|
6464
|
+
x: e.clientX,
|
|
6465
|
+
y: e.clientY
|
|
6466
|
+
});
|
|
6467
|
+
}
|
|
6468
|
+
},
|
|
6469
|
+
children: [props.children, /*#__PURE__*/ReactDOM.createPortal(jsx("div", {
|
|
6470
|
+
ref: selectionRef
|
|
6471
|
+
}), document.body)]
|
|
6472
|
+
});
|
|
6473
|
+
};
|
|
6474
|
+
|
|
6091
6475
|
var css_248z$2 = ".explorer-columns {\n width: 100%;\n height: 100%;\n display: flex;\n position: relative;\n}\n.explorer-columns .layer {\n position: relative;\n flex: 1 0 0;\n border-right: 1px solid #f5f5f5;\n}\n.explorer-columns .layer.select_col {\n box-shadow: 0 0 20px #e9f5ff inset;\n}\n.explorer-columns .layer.select_col::after {\n content: '';\n position: absolute;\n height: 4px;\n bottom: 0px;\n background: #50afff;\n left: 0;\n right: 0;\n}\n.explorer-columns .layer.list {\n min-width: 200px;\n}\n.explorer-columns .layer.list::before {\n position: absolute;\n content: '';\n top: 50%;\n right: 1px;\n width: 1px;\n height: 18px;\n margin-left: -1px;\n margin-top: -9px;\n border: 1px solid #ddd;\n border-top: none;\n border-bottom: none;\n backdrop-filter: none;\n border-radius: 0;\n background: transparent;\n box-sizing: content-box;\n -webkit-backdrop-filter: blur(10px);\n}\n.explorer-columns .layer.list .list-main {\n width: 100%;\n height: 100%;\n transition: 0.3s;\n padding-top: 5px;\n}\n.explorer-columns .layer.list .list-main .list-scroll::-webkit-scrollbar {\n width: 6px;\n}\n.explorer-columns .layer.list .list-main .list-scroll::-webkit-scrollbar-thumb {\n background-color: transparent;\n border-radius: 6px;\n transition: 0.3s;\n}\n.explorer-columns .layer.list .list-main:hover .list-scroll::-webkit-scrollbar-thumb {\n background-color: #00000030;\n}\n.explorer-columns .layer.list .drag {\n position: absolute;\n width: 8px;\n border-right: 1px solid #f5f5f5;\n right: -3px;\n top: 0;\n bottom: 0;\n cursor: col-resize;\n z-index: 10;\n}\n.explorer-columns .layer.list .drag:hover {\n background: #40a9ff4d;\n}\n.explorer-columns .layer.empty {\n display: flex;\n justify-content: center;\n padding-top: 100px;\n}\n.explorer-columns .layer.empty .empty-is-null {\n width: 200px;\n}\n.explorer-columns .layer.empty .empty-icon {\n height: 140px;\n}\n.explorer-columns .layer.empty .empty-desc {\n display: flex;\n justify-content: center;\n}\n.explorer-columns .layer.empty .empty-desc > span {\n display: inline-block;\n padding: 3px 10px;\n border-radius: 10px;\n line-height: 1;\n background: #a0a0a01a;\n color: #bbb;\n font-size: 0.9em;\n}\n.explorer-columns-list {\n padding-left: 10px;\n display: flex;\n height: 30px;\n margin-bottom: 2px;\n margin: 0 5px 3px 5px;\n align-items: center;\n border: 1px solid transparent;\n user-select: none;\n}\n.explorer-columns-list .columns-list-icon {\n display: flex;\n width: 18px;\n height: 18px;\n margin-right: 10px;\n flex-shrink: 0;\n}\n.explorer-columns-list .columns-list-title {\n flex: 1;\n display: flex;\n}\n.explorer-columns-list .columns-list-title .title {\n display: flex;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.explorer-columns-list .columns-list-title .edit {\n display: inline-block;\n width: 20px;\n line-height: 20px;\n font-size: 10px;\n text-align: center;\n border-radius: 3px;\n margin-left: 5px;\n color: #666;\n opacity: 0;\n transition: 0.3s;\n}\n.explorer-columns-list .columns-list-title .edit:hover {\n color: #50afff;\n background: #ffffff8a;\n cursor: pointer;\n}\n.explorer-columns-list .columns-list-tool {\n min-width: 30px;\n}\n.explorer-columns-list .columns-list-input {\n flex: 1;\n height: 100%;\n outline: 0;\n border: 0;\n margin-right: 10px;\n background: #fff;\n}\n.explorer-columns-list.acitve {\n background: #e3f0ff;\n}\n.explorer-columns-list.last {\n margin-bottom: 100px;\n}\n.explorer-columns-list.checks {\n background: #cce8ff;\n border-color: #a8d8ff !important;\n}\n.explorer-columns-list:hover {\n background: #e3f0ff;\n border-color: #c9e2ff;\n}\n.explorer-columns-list:hover .edit {\n opacity: 1;\n}\n.explorer-columns-loading {\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 999;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n.explorer-columns-loading .loading-content {\n width: 100px;\n height: 106px;\n border-radius: 6px;\n background: rgba(255, 255, 255, 0.7);\n box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.07);\n color: #888;\n}\n.explorer-columns-loading .loading-content-icon {\n display: flex;\n justify-content: center;\n margin: 25px auto 6px auto;\n font-size: 30px;\n}\n.explorer-columns-loading .loading-content-icon > i {\n animation: rotate 1.5s linear infinite;\n}\n.explorer-columns-loading .loading-content-title {\n padding-top: 15px;\n text-align: center;\n}\n@keyframes rotate {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n";
|
|
6092
6476
|
styleInject(css_248z$2);
|
|
6093
6477
|
|
|
@@ -6607,6 +6991,23 @@ function ModalTab(props) {
|
|
|
6607
6991
|
});
|
|
6608
6992
|
}
|
|
6609
6993
|
|
|
6994
|
+
const template = {
|
|
6995
|
+
tile: {
|
|
6996
|
+
action: 'rotate',
|
|
6997
|
+
className: 'file-select-box',
|
|
6998
|
+
selectClass: '.file-continer-main .file'
|
|
6999
|
+
},
|
|
7000
|
+
column: {
|
|
7001
|
+
className: 'explorer-columns',
|
|
7002
|
+
selectClass: '.explorer-columns-list',
|
|
7003
|
+
regionClass: '.explorer-columns .layer.list.select_col'
|
|
7004
|
+
},
|
|
7005
|
+
table: {
|
|
7006
|
+
className: 'explorer-tree table',
|
|
7007
|
+
dataClass: '.explorer-tree-row',
|
|
7008
|
+
selectClass: '.rc-tree-treenode'
|
|
7009
|
+
}
|
|
7010
|
+
};
|
|
6610
7011
|
const Layout$1 = props => {
|
|
6611
7012
|
const {
|
|
6612
7013
|
viewHeight: height,
|
|
@@ -6625,6 +7026,10 @@ const Layout$1 = props => {
|
|
|
6625
7026
|
onMenuClick
|
|
6626
7027
|
} = props;
|
|
6627
7028
|
const store = useContext(ExampleContext);
|
|
7029
|
+
const [expandkey, useExpandkey] = useState([]);
|
|
7030
|
+
useEffect(() => {
|
|
7031
|
+
useExpandkey([]);
|
|
7032
|
+
}, [store.curInfo?.key]);
|
|
6628
7033
|
function Loading() {
|
|
6629
7034
|
return jsx("div", {
|
|
6630
7035
|
className: 'explorer-columns-loading',
|
|
@@ -6654,64 +7059,97 @@ const Layout$1 = props => {
|
|
|
6654
7059
|
}
|
|
6655
7060
|
return jsxs("div", {
|
|
6656
7061
|
className: 'file-continer-main',
|
|
6657
|
-
children: [store?.loading == ApiStatusEnum.LOADING && jsx(Loading, {}),
|
|
6658
|
-
icons: store.getIcons,
|
|
6659
|
-
data: store.curlist,
|
|
6660
|
-
checks: checks,
|
|
6661
|
-
onLoadData: loadData,
|
|
6662
|
-
onClick: onClick,
|
|
6663
|
-
onRename: onRename,
|
|
6664
|
-
onMenuClick: onMenuClick,
|
|
6665
|
-
onDblclick: onDblclick,
|
|
6666
|
-
height: height,
|
|
6667
|
-
width: width
|
|
6668
|
-
}), store?.menutype == 'table' && jsx(Tree, {
|
|
6669
|
-
type: 'table',
|
|
7062
|
+
children: [store?.loading == ApiStatusEnum.LOADING && jsx(Loading, {}), jsxs(SelectBox, {
|
|
6670
7063
|
checks: checks,
|
|
6671
|
-
treeData: store.curlist,
|
|
6672
|
-
columns: store.columns,
|
|
6673
7064
|
checkType: store.checkType,
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
ischeck: truncate,
|
|
6682
|
-
onChecks: arr => {
|
|
7065
|
+
checkMode: store.checkMode,
|
|
7066
|
+
className: cx('file-select-box', {
|
|
7067
|
+
[template[store?.menutype || '']?.className || '']: Boolean(template?.[store.menutype]?.className)
|
|
7068
|
+
}),
|
|
7069
|
+
isDrag: isDrag,
|
|
7070
|
+
isSelectBoxes: isSelectBoxes,
|
|
7071
|
+
onChange: v => {
|
|
6683
7072
|
let map = store.dataMap || {};
|
|
6684
7073
|
let param = [];
|
|
6685
|
-
|
|
7074
|
+
v.forEach(checkedKeys => {
|
|
6686
7075
|
if (map[checkedKeys]) {
|
|
6687
7076
|
param.push(map[checkedKeys]);
|
|
6688
7077
|
}
|
|
6689
7078
|
});
|
|
6690
|
-
onCheck?.(
|
|
7079
|
+
onCheck?.(v, param);
|
|
6691
7080
|
},
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
store.
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
|
|
6711
|
-
|
|
6712
|
-
|
|
6713
|
-
|
|
6714
|
-
|
|
7081
|
+
onDrag: () => {},
|
|
7082
|
+
onEndDrag: () => {},
|
|
7083
|
+
onStartDrag: () => {},
|
|
7084
|
+
dataClass: template?.[store.menutype]?.dataClass,
|
|
7085
|
+
selectClass: template?.[store.menutype]?.selectClass,
|
|
7086
|
+
action: template?.[store.menutype]?.action,
|
|
7087
|
+
regionClass: template?.[store.menutype]?.regionClass,
|
|
7088
|
+
children: [store?.menutype == 'column' && jsx(Columns, {
|
|
7089
|
+
icons: store.getIcons,
|
|
7090
|
+
data: store.curlist,
|
|
7091
|
+
checks: checks,
|
|
7092
|
+
onLoadData: loadNode,
|
|
7093
|
+
onClick: onClick,
|
|
7094
|
+
onRename: onRename,
|
|
7095
|
+
onMenuClick: onMenuClick,
|
|
7096
|
+
onDblclick: onDblclick,
|
|
7097
|
+
height: height,
|
|
7098
|
+
width: width
|
|
7099
|
+
}), store?.menutype == 'table' && jsx(Tree, {
|
|
7100
|
+
type: 'table',
|
|
7101
|
+
checks: checks,
|
|
7102
|
+
expandedKeys: expandkey,
|
|
7103
|
+
loadedKeys: ['我的天啊/你好啊'],
|
|
7104
|
+
treeData: store.curlist,
|
|
7105
|
+
columns: store.columns,
|
|
7106
|
+
checkType: store.checkType,
|
|
7107
|
+
height: height - 24,
|
|
7108
|
+
width: width,
|
|
7109
|
+
animation: false,
|
|
7110
|
+
showLine: false,
|
|
7111
|
+
isOpenMenu: isOpenMenu,
|
|
7112
|
+
icon: store.getIcons,
|
|
7113
|
+
isload: true,
|
|
7114
|
+
ischeck: truncate,
|
|
7115
|
+
onChecks: arr => {
|
|
7116
|
+
let map = store.dataMap || {};
|
|
7117
|
+
let param = [];
|
|
7118
|
+
arr.forEach(checkedKeys => {
|
|
7119
|
+
if (map[checkedKeys]) {
|
|
7120
|
+
param.push(map[checkedKeys]);
|
|
7121
|
+
}
|
|
7122
|
+
});
|
|
7123
|
+
onCheck?.(arr, param);
|
|
7124
|
+
},
|
|
7125
|
+
onSelect: v => {
|
|
7126
|
+
if (v?.type == 'folder' && v.expanded) {
|
|
7127
|
+
store.setCurSelect(v.key);
|
|
7128
|
+
}
|
|
7129
|
+
},
|
|
7130
|
+
onRename: onRename,
|
|
7131
|
+
onMenuClick: onMenuClick,
|
|
7132
|
+
onDblclick: _onDblclick,
|
|
7133
|
+
loadData: loadNode,
|
|
7134
|
+
onExpand: v => {
|
|
7135
|
+
useExpandkey(v);
|
|
7136
|
+
},
|
|
7137
|
+
onChange: v => {
|
|
7138
|
+
store.setCurList(v);
|
|
7139
|
+
}
|
|
7140
|
+
}), store?.menutype == 'tile' && jsx(Tile, {
|
|
7141
|
+
width: width,
|
|
7142
|
+
height: height,
|
|
7143
|
+
size: store.menuSize,
|
|
7144
|
+
data: store.curlist,
|
|
7145
|
+
icons: store.getIcons,
|
|
7146
|
+
checks: checks,
|
|
7147
|
+
onSelect: onClick,
|
|
7148
|
+
onDblclick: _onDblclick,
|
|
7149
|
+
onRename: onRename,
|
|
7150
|
+
onMenuClick: onMenuClick,
|
|
7151
|
+
loadData: loadData
|
|
7152
|
+
})]
|
|
6715
7153
|
}), jsx(ModalTab, {
|
|
6716
7154
|
items: [],
|
|
6717
7155
|
showKey: []
|
|
@@ -7015,7 +7453,9 @@ const Explorer = props => {
|
|
|
7015
7453
|
};
|
|
7016
7454
|
let map = addLevel(curlist, {});
|
|
7017
7455
|
setDataMap(map);
|
|
7456
|
+
// setCurSelect('');
|
|
7018
7457
|
}, [curlist]);
|
|
7458
|
+
//清空日志
|
|
7019
7459
|
useEffect(() => {
|
|
7020
7460
|
let root = log[0];
|
|
7021
7461
|
if (!root?.includes(curInfo?.path)) {
|