qidian-shared 1.0.26 → 1.0.28

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.
@@ -1276,6 +1276,9 @@ function extractSlotsWithoutPrefix(slots, prefix) {
1276
1276
  function easyCopy(data) {
1277
1277
  return JSON.parse(JSON.stringify(data));
1278
1278
  }
1279
+ function checkSameObject(newData, oldData) {
1280
+ return JSON.stringify(newData) === JSON.stringify(oldData);
1281
+ }
1279
1282
  function valueFillter(val, keys, data) {
1280
1283
  if (!val) return val;
1281
1284
  return val.replace(/(?:\${([^}]*)})|(?:\$([^&?\b]*))/g, ($1, $2, $3) => {
@@ -1331,6 +1334,9 @@ function toPrecision(num, precision = 0) {
1331
1334
  const result = Math.round(Number(num) * 10 ** precision) / 10 ** precision;
1332
1335
  return parseFloat(`${result}`);
1333
1336
  }
1337
+ function padZero(value, length) {
1338
+ return String(value).padStart(length, "0");
1339
+ }
1334
1340
  function toArr(target) {
1335
1341
  if (Array.isArray(target)) return target;
1336
1342
  if (isEmpty(target)) return [];
@@ -8024,6 +8030,21 @@ function easyDownload(res, name) {
8024
8030
  }, 1e3);
8025
8031
  }
8026
8032
  }
8033
+ function cutFilename(name, num) {
8034
+ if (!name) return "";
8035
+ const lastIndex = name.lastIndexOf(".");
8036
+ const suffix = lastIndex === -1 ? "" : name.substring(lastIndex + 1);
8037
+ return `${name.substring(0, num - suffix.length - 1)}.${suffix}`;
8038
+ }
8039
+ function cutFileSuffix(name) {
8040
+ if (!name) return "";
8041
+ const nameSplit = name.split(".");
8042
+ return nameSplit[nameSplit.length - 1];
8043
+ }
8044
+ function isTypeByName(name, suffixs) {
8045
+ if (!name) return false;
8046
+ return suffixs.some((suffix) => `.${cutFileSuffix(name)}`.toLowerCase() === suffix.toLowerCase());
8047
+ }
8027
8048
  var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
8028
8049
  function int2char(n) {
8029
8050
  return BI_RM.charAt(n);
@@ -12085,7 +12106,7 @@ function useServiceLoadMore({
12085
12106
  const res = { list: [], page: 1, total: 0 };
12086
12107
  const paginationV = vue.unref(pagination);
12087
12108
  const currentParams = paginationV !== false ? {
12088
- pageNum: params?.page ?? 1,
12109
+ pageNum: isEmpty(params?.page) ? 1 : params.page + 1,
12089
12110
  pageSize: params?.size ?? paginationV?.pageSize ?? 30
12090
12111
  } : void 0;
12091
12112
  if (currentParams?.pageNum === 1) firstLoad.value = true;
@@ -12428,7 +12449,10 @@ function useTimer(type = "timeout") {
12428
12449
  exports.MD5 = MD5;
12429
12450
  exports.buildTree = buildTree;
12430
12451
  exports.camelize = camelize;
12452
+ exports.checkSameObject = checkSameObject;
12431
12453
  exports.createEnum = createEnum;
12454
+ exports.cutFileSuffix = cutFileSuffix;
12455
+ exports.cutFilename = cutFilename;
12432
12456
  exports.decrypt = decrypt;
12433
12457
  exports.decryptBase64 = decryptBase64;
12434
12458
  exports.deleteUrlParams = deleteUrlParams;
@@ -12450,9 +12474,11 @@ exports.isEmpty = isEmpty;
12450
12474
  exports.isFunction = isFunction;
12451
12475
  exports.isObject = isObject;
12452
12476
  exports.isPromise = isPromise;
12477
+ exports.isTypeByName = isTypeByName;
12453
12478
  exports.kebabCase = kebabCase;
12454
12479
  exports.noop = noop;
12455
12480
  exports.objToStr = objToStr;
12481
+ exports.padZero = padZero;
12456
12482
  exports.resize = resize;
12457
12483
  exports.resizeDirective = resizeDirective;
12458
12484
  exports.setUrlParam = setUrlParam;