bm-admin-ui 1.0.29-alpha → 1.0.31-alpha

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.
@@ -1980,9 +1980,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1980
1980
  }
1981
1981
  }
1982
1982
  watch(isExpand, (val) => {
1983
- setTimeout(() => {
1984
- handleChangeExpand(val);
1985
- }, 0);
1983
+ nextTick(() => handleChangeExpand(val));
1986
1984
  }, {
1987
1985
  immediate: true
1988
1986
  });
@@ -112,7 +112,6 @@ declare const BmUpload: import("bm-admin-ui/es/utils/with-install").SFCWithInsta
112
112
  picClass: string;
113
113
  alignCenter: boolean;
114
114
  canNotViewAccept: string;
115
- fileDetail: boolean;
116
115
  myBtn: boolean;
117
116
  }>;
118
117
  uploadConfigs: import("vue").Ref<{
@@ -1404,7 +1404,6 @@ const _sfc_main = {
1404
1404
  picClass: "",
1405
1405
  alignCenter: false,
1406
1406
  canNotViewAccept: ".rar,.zip",
1407
- fileDetail: true,
1408
1407
  myBtn: false
1409
1408
  },
1410
1409
  uploadConfigs: {
@@ -1482,18 +1481,18 @@ const _sfc_main = {
1482
1481
  if (methods.fileIsDelete(file)) {
1483
1482
  return;
1484
1483
  }
1485
- emit("successFile", data);
1486
1484
  state.fileList[file.uid].status = "success";
1487
1485
  let uri = data?.url;
1488
- let item = state.extraConfigs.fileDetail ? {
1486
+ let item = {
1489
1487
  name: file.name,
1490
1488
  size: file.size,
1491
1489
  type: file.type,
1492
1490
  uid: file.uid,
1493
1491
  url: uri
1494
- } : uri;
1492
+ };
1495
1493
  state.uploadedList.push(item);
1496
1494
  state.fileList[file.uid].url = uri;
1495
+ emit("successFile", data);
1497
1496
  emit("success", state.uploadedList);
1498
1497
  emit("update", state.uploadedList);
1499
1498
  },
@@ -1507,10 +1506,13 @@ const _sfc_main = {
1507
1506
  emit("error", error);
1508
1507
  },
1509
1508
  async deleteFile(uid) {
1510
- const index = state.uploadedList.findIndex((ele) => state.extraConfigs.fileDetail ? ele === state.fileList[uid].url : ele.url === state.fileList[uid].url);
1511
- emit("deleteFile", state.fileList[uid]);
1512
- state.uploadedList.splice(index, 1);
1509
+ let targetFile = state.fileList[uid];
1513
1510
  delete state.fileList[uid];
1511
+ const index = state.uploadedList.findIndex((ele) => ele.url === targetFile.url);
1512
+ if (index !== -1) {
1513
+ state.uploadedList.splice(index, 1);
1514
+ }
1515
+ emit("deleteFile", targetFile);
1514
1516
  emit("delete", state.uploadedList);
1515
1517
  emit("update", state.uploadedList);
1516
1518
  },
@@ -112,7 +112,6 @@ declare const _default: {
112
112
  picClass: string;
113
113
  alignCenter: boolean;
114
114
  canNotViewAccept: string;
115
- fileDetail: boolean;
116
115
  myBtn: boolean;
117
116
  }>;
118
117
  uploadConfigs: import("vue").Ref<{
package/index.esm.js CHANGED
@@ -28147,9 +28147,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
28147
28147
  }
28148
28148
  }
28149
28149
  watch(isExpand, (val) => {
28150
- setTimeout(() => {
28151
- handleChangeExpand(val);
28152
- }, 0);
28150
+ nextTick(() => handleChangeExpand(val));
28153
28151
  }, {
28154
28152
  immediate: true
28155
28153
  });
@@ -46140,7 +46138,6 @@ const _sfc_main$3 = {
46140
46138
  picClass: "",
46141
46139
  alignCenter: false,
46142
46140
  canNotViewAccept: ".rar,.zip",
46143
- fileDetail: true,
46144
46141
  myBtn: false
46145
46142
  },
46146
46143
  uploadConfigs: {
@@ -46218,18 +46215,18 @@ const _sfc_main$3 = {
46218
46215
  if (methods.fileIsDelete(file)) {
46219
46216
  return;
46220
46217
  }
46221
- emit("successFile", data);
46222
46218
  state.fileList[file.uid].status = "success";
46223
46219
  let uri = data?.url;
46224
- let item = state.extraConfigs.fileDetail ? {
46220
+ let item = {
46225
46221
  name: file.name,
46226
46222
  size: file.size,
46227
46223
  type: file.type,
46228
46224
  uid: file.uid,
46229
46225
  url: uri
46230
- } : uri;
46226
+ };
46231
46227
  state.uploadedList.push(item);
46232
46228
  state.fileList[file.uid].url = uri;
46229
+ emit("successFile", data);
46233
46230
  emit("success", state.uploadedList);
46234
46231
  emit("update", state.uploadedList);
46235
46232
  },
@@ -46243,10 +46240,13 @@ const _sfc_main$3 = {
46243
46240
  emit("error", error);
46244
46241
  },
46245
46242
  async deleteFile(uid) {
46246
- const index = state.uploadedList.findIndex((ele) => state.extraConfigs.fileDetail ? ele === state.fileList[uid].url : ele.url === state.fileList[uid].url);
46247
- emit("deleteFile", state.fileList[uid]);
46248
- state.uploadedList.splice(index, 1);
46243
+ let targetFile = state.fileList[uid];
46249
46244
  delete state.fileList[uid];
46245
+ const index = state.uploadedList.findIndex((ele) => ele.url === targetFile.url);
46246
+ if (index !== -1) {
46247
+ state.uploadedList.splice(index, 1);
46248
+ }
46249
+ emit("deleteFile", targetFile);
46250
46250
  emit("delete", state.uploadedList);
46251
46251
  emit("update", state.uploadedList);
46252
46252
  },
package/index.js CHANGED
@@ -28155,9 +28155,7 @@ var process = {
28155
28155
  }
28156
28156
  }
28157
28157
  require$$1$1.watch(isExpand, (val) => {
28158
- setTimeout(() => {
28159
- handleChangeExpand(val);
28160
- }, 0);
28158
+ require$$1$1.nextTick(() => handleChangeExpand(val));
28161
28159
  }, {
28162
28160
  immediate: true
28163
28161
  });
@@ -46148,7 +46146,6 @@ var process = {
46148
46146
  picClass: "",
46149
46147
  alignCenter: false,
46150
46148
  canNotViewAccept: ".rar,.zip",
46151
- fileDetail: true,
46152
46149
  myBtn: false
46153
46150
  },
46154
46151
  uploadConfigs: {
@@ -46226,18 +46223,18 @@ var process = {
46226
46223
  if (methods.fileIsDelete(file)) {
46227
46224
  return;
46228
46225
  }
46229
- emit("successFile", data);
46230
46226
  state.fileList[file.uid].status = "success";
46231
46227
  let uri = data?.url;
46232
- let item = state.extraConfigs.fileDetail ? {
46228
+ let item = {
46233
46229
  name: file.name,
46234
46230
  size: file.size,
46235
46231
  type: file.type,
46236
46232
  uid: file.uid,
46237
46233
  url: uri
46238
- } : uri;
46234
+ };
46239
46235
  state.uploadedList.push(item);
46240
46236
  state.fileList[file.uid].url = uri;
46237
+ emit("successFile", data);
46241
46238
  emit("success", state.uploadedList);
46242
46239
  emit("update", state.uploadedList);
46243
46240
  },
@@ -46251,10 +46248,13 @@ var process = {
46251
46248
  emit("error", error);
46252
46249
  },
46253
46250
  async deleteFile(uid) {
46254
- const index = state.uploadedList.findIndex((ele) => state.extraConfigs.fileDetail ? ele === state.fileList[uid].url : ele.url === state.fileList[uid].url);
46255
- emit("deleteFile", state.fileList[uid]);
46256
- state.uploadedList.splice(index, 1);
46251
+ let targetFile = state.fileList[uid];
46257
46252
  delete state.fileList[uid];
46253
+ const index = state.uploadedList.findIndex((ele) => ele.url === targetFile.url);
46254
+ if (index !== -1) {
46255
+ state.uploadedList.splice(index, 1);
46256
+ }
46257
+ emit("deleteFile", targetFile);
46258
46258
  emit("delete", state.uploadedList);
46259
46259
  emit("update", state.uploadedList);
46260
46260
  },
@@ -1988,9 +1988,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1988
1988
  }
1989
1989
  }
1990
1990
  vue.watch(isExpand, (val) => {
1991
- setTimeout(() => {
1992
- handleChangeExpand(val);
1993
- }, 0);
1991
+ vue.nextTick(() => handleChangeExpand(val));
1994
1992
  }, {
1995
1993
  immediate: true
1996
1994
  });
@@ -112,7 +112,6 @@ declare const BmUpload: import("bm-admin-ui/es/utils/with-install").SFCWithInsta
112
112
  picClass: string;
113
113
  alignCenter: boolean;
114
114
  canNotViewAccept: string;
115
- fileDetail: boolean;
116
115
  myBtn: boolean;
117
116
  }>;
118
117
  uploadConfigs: import("vue").Ref<{
@@ -1408,7 +1408,6 @@ const _sfc_main = {
1408
1408
  picClass: "",
1409
1409
  alignCenter: false,
1410
1410
  canNotViewAccept: ".rar,.zip",
1411
- fileDetail: true,
1412
1411
  myBtn: false
1413
1412
  },
1414
1413
  uploadConfigs: {
@@ -1486,18 +1485,18 @@ const _sfc_main = {
1486
1485
  if (methods.fileIsDelete(file)) {
1487
1486
  return;
1488
1487
  }
1489
- emit("successFile", data);
1490
1488
  state.fileList[file.uid].status = "success";
1491
1489
  let uri = data?.url;
1492
- let item = state.extraConfigs.fileDetail ? {
1490
+ let item = {
1493
1491
  name: file.name,
1494
1492
  size: file.size,
1495
1493
  type: file.type,
1496
1494
  uid: file.uid,
1497
1495
  url: uri
1498
- } : uri;
1496
+ };
1499
1497
  state.uploadedList.push(item);
1500
1498
  state.fileList[file.uid].url = uri;
1499
+ emit("successFile", data);
1501
1500
  emit("success", state.uploadedList);
1502
1501
  emit("update", state.uploadedList);
1503
1502
  },
@@ -1511,10 +1510,13 @@ const _sfc_main = {
1511
1510
  emit("error", error);
1512
1511
  },
1513
1512
  async deleteFile(uid) {
1514
- const index = state.uploadedList.findIndex((ele) => state.extraConfigs.fileDetail ? ele === state.fileList[uid].url : ele.url === state.fileList[uid].url);
1515
- emit("deleteFile", state.fileList[uid]);
1516
- state.uploadedList.splice(index, 1);
1513
+ let targetFile = state.fileList[uid];
1517
1514
  delete state.fileList[uid];
1515
+ const index = state.uploadedList.findIndex((ele) => ele.url === targetFile.url);
1516
+ if (index !== -1) {
1517
+ state.uploadedList.splice(index, 1);
1518
+ }
1519
+ emit("deleteFile", targetFile);
1518
1520
  emit("delete", state.uploadedList);
1519
1521
  emit("update", state.uploadedList);
1520
1522
  },
@@ -112,7 +112,6 @@ declare const _default: {
112
112
  picClass: string;
113
113
  alignCenter: boolean;
114
114
  canNotViewAccept: string;
115
- fileDetail: boolean;
116
115
  myBtn: boolean;
117
116
  }>;
118
117
  uploadConfigs: import("vue").Ref<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bm-admin-ui",
3
- "version": "1.0.29-alpha",
3
+ "version": "1.0.31-alpha",
4
4
  "private": false,
5
5
  "description": "An Admin Component Library for Bm",
6
6
  "license": "UNLICENSED",