@gingkoo/pandora-explorer 0.0.1-alpha.61 → 0.0.1-alpha.63

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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @gingkoo/pandora-explorer v0.0.1-alpha.61
2
+ * @gingkoo/pandora-explorer v0.0.1-alpha.63
3
3
  */
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import cx$1 from 'classnames';
@@ -4736,7 +4736,7 @@ registerMenu('cur-folder', [{
4736
4736
  }, {
4737
4737
  key: 'create',
4738
4738
  icon: 'folder',
4739
- title: '新建文件'
4739
+ title: '新建文件夹'
4740
4740
  }, {
4741
4741
  type: 'line'
4742
4742
  }, {
@@ -5156,6 +5156,7 @@ function Menu(props) {
5156
5156
  let edit = ['remove', 'copy', 'create', 'shear', 'paste', 'rename'];
5157
5157
  let download = ['download'];
5158
5158
  let upload = ['file-upload'];
5159
+ let delect = ['remove'];
5159
5160
  let arr = [];
5160
5161
  let _menu = menu.map(v => {
5161
5162
  let data = v;
@@ -5172,6 +5173,13 @@ function Menu(props) {
5172
5173
  });
5173
5174
  return;
5174
5175
  }
5176
+ if (!store.isDelect && delect.includes(v.key)) {
5177
+ arr.push({
5178
+ ...v,
5179
+ disabled: true
5180
+ });
5181
+ return;
5182
+ }
5175
5183
  if (!store.isDownload && download.includes(v.key)) {
5176
5184
  arr.push({
5177
5185
  ...v,
@@ -6110,6 +6118,10 @@ const ExplorerMenu = props => {
6110
6118
  loadMenu: loadMenu,
6111
6119
  onChange: onChange,
6112
6120
  onRename: onRename,
6121
+ isEdit: store.isEdit,
6122
+ isDelect: store.isDelect,
6123
+ isDownload: store.isDownload,
6124
+ isUpload: store.isDownload,
6113
6125
  openMenu: openMenu,
6114
6126
  closeMenu: store.closeMenu,
6115
6127
  onSelect: v => {
@@ -6621,11 +6633,11 @@ const SelectBox = props => {
6621
6633
  const items = e.dataTransfer.items;
6622
6634
  let files = [];
6623
6635
  let empty = [];
6624
- const getFile = item => new Promise((resolve, reject) => {
6636
+ const getFile = (item, path) => new Promise((resolve, reject) => {
6625
6637
  item.file(file => {
6626
6638
  resolve({
6627
6639
  file,
6628
- path: ''
6640
+ path: path
6629
6641
  }); // 假设路径为空字符串或根据需要调整
6630
6642
  }, reject);
6631
6643
  });
@@ -6633,7 +6645,7 @@ const SelectBox = props => {
6633
6645
  try {
6634
6646
  if (item.isFile) {
6635
6647
  // 使用自定义的 getFile 函数来获取文件
6636
- const fileInfo = await getFile(item);
6648
+ const fileInfo = await getFile(item, path);
6637
6649
  files.push(fileInfo);
6638
6650
  } else if (item.isDirectory) {
6639
6651
  const dirReader = item.createReader();
@@ -6676,8 +6688,6 @@ const SelectBox = props => {
6676
6688
  }
6677
6689
  if (!key) return;
6678
6690
  typeof props.onUpload === 'function' && props?.onUpload(files, key, empty);
6679
- store.curInfo && loadData(store.curInfo?.key);
6680
- store.curInfo?.key && store.reloadNode(store.curInfo.key);
6681
6691
  };
6682
6692
  function handleDragEnter(e) {
6683
6693
  e.preventDefault();
@@ -7359,6 +7369,7 @@ const Layout$1 = props => {
7359
7369
  }
7360
7370
  function _onDblclick(key, info) {
7361
7371
  if (info.type == 'folder') {
7372
+ if (!isNavtab) return;
7362
7373
  if (Array.isArray(info?.children) && !info?.children.lenght) {
7363
7374
  store.setCurInfo(info);
7364
7375
  store.setCurList(info?.children);
@@ -7375,7 +7386,10 @@ const Layout$1 = props => {
7375
7386
  store.setLog(arr);
7376
7387
  store.setLogIndex(arr.length);
7377
7388
  } else {
7378
- onDblclick?.(key, info);
7389
+ onDblclick?.(key, {
7390
+ ...info,
7391
+ isEdit: store.isEdit
7392
+ });
7379
7393
  }
7380
7394
  }
7381
7395
  function onRename(key, value, info) {
@@ -7440,6 +7454,7 @@ const Layout$1 = props => {
7440
7454
  columns: store.columns,
7441
7455
  checkType: store.checkType,
7442
7456
  isEdit: store.isEdit,
7457
+ isDelect: store.isDelect,
7443
7458
  isDownload: store.isDownload,
7444
7459
  isUpload: store.isDownload,
7445
7460
  height: height - 24,
@@ -7764,6 +7779,7 @@ const Explorer = /*#__PURE__*/forwardRef((props, ref) => {
7764
7779
  isUpload = true,
7765
7780
  isEdit = true,
7766
7781
  isDownload = true,
7782
+ isNavtab = true,
7767
7783
  createFile,
7768
7784
  onCopy,
7769
7785
  onShear,
@@ -7937,6 +7953,16 @@ const Explorer = /*#__PURE__*/forwardRef((props, ref) => {
7937
7953
  let map = addLevel(curlist, {});
7938
7954
  setDataMap(map);
7939
7955
  }, [curlist]);
7956
+ useEffect(() => {
7957
+ if (isNavtab) return;
7958
+ console.log(data, '我是data');
7959
+ console.log(curlist, '我是cur');
7960
+ if (!curlist?.length) {
7961
+ if (Array.isArray(data)) {
7962
+ setCurList(data);
7963
+ }
7964
+ }
7965
+ }, [curlist, isNavtab, data]);
7940
7966
  /* ************ 加载更新数据 **************** */
7941
7967
  async function loadData(key, param, closeload = true) {
7942
7968
  closeload && setLoading(ApiStatusEnum.LOADING);
@@ -8168,7 +8194,10 @@ const Explorer = /*#__PURE__*/forwardRef((props, ref) => {
8168
8194
  reloadNode(param.key);
8169
8195
  return;
8170
8196
  }
8171
- _onMenuClick?.(key, param);
8197
+ _onMenuClick?.(key, {
8198
+ ...param,
8199
+ isEdit: isEdit
8200
+ });
8172
8201
  }
8173
8202
  function openMenu(props, param) {
8174
8203
  closeMenu();