jinbi-utils 1.0.3 → 1.0.5

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.
Files changed (55) hide show
  1. package/dist/index.esm.js +276 -1
  2. package/dist/index.esm.min.js +2 -2
  3. package/dist/index.umd.js +279 -0
  4. package/dist/index.umd.min.js +1 -1
  5. package/docs/assets/js/search.json +1 -1
  6. package/docs/classes/http_apibuilder.apibuilder-1.html +497 -0
  7. package/docs/classes/http_apibuilder.insertbuilder-1.html +448 -0
  8. package/docs/classes/http_apibuilder.querybuilder-1.html +906 -0
  9. package/docs/classes/http_apibuilder.updatebuilder-1.html +543 -0
  10. package/docs/globals.html +7 -0
  11. package/docs/index.html +6 -0
  12. package/docs/interfaces/constant.ifromtype.html +6 -0
  13. package/docs/interfaces/dom.svginfo.html +6 -0
  14. package/docs/interfaces/file.compressimgqualitycallback.html +6 -0
  15. package/docs/interfaces/file.compressimgscalecallback.html +6 -0
  16. package/docs/interfaces/file.exportbyblobparams.html +6 -0
  17. package/docs/interfaces/file.filesizeobject.html +6 -0
  18. package/docs/interfaces/file.genexportbyblobparams.html +6 -0
  19. package/docs/interfaces/http_apibuilder.fieldcatalog-1.html +253 -0
  20. package/docs/interfaces/http_apibuilder.fieldcatalogitem-1.html +363 -0
  21. package/docs/interfaces/http_apibuilder.filter-1.html +309 -0
  22. package/docs/interfaces/http_apibuilder.filters-1.html +295 -0
  23. package/docs/interfaces/http_apibuilder.insertparams-1.html +295 -0
  24. package/docs/interfaces/http_apibuilder.orderby-1.html +295 -0
  25. package/docs/interfaces/http_apibuilder.queryparams-1.html +337 -0
  26. package/docs/interfaces/http_apibuilder.updateitem-1.html +295 -0
  27. package/docs/interfaces/http_apibuilder.updateparams-1.html +295 -0
  28. package/docs/modules/array.html +6 -0
  29. package/docs/modules/color.html +6 -0
  30. package/docs/modules/common.html +6 -0
  31. package/docs/modules/constant.html +6 -0
  32. package/docs/modules/date.html +6 -0
  33. package/docs/modules/dom.html +6 -0
  34. package/docs/modules/file.html +6 -0
  35. package/docs/modules/http.html +6 -0
  36. package/docs/modules/http_apibuilder.html +350 -0
  37. package/docs/modules/iam.html +6 -0
  38. package/docs/modules/middleware.html +6 -0
  39. package/docs/modules/number.html +6 -0
  40. package/docs/modules/object.html +6 -0
  41. package/docs/modules/print.html +6 -0
  42. package/docs/modules/string.html +6 -0
  43. package/docs/modules/validate.html +6 -0
  44. package/package.json +9 -1
  45. package/src/http/apiBuilder/README.md +529 -0
  46. package/src/http/apiBuilder/api-builder.ts +375 -0
  47. package/src/http/apiBuilder/example.ts +243 -0
  48. package/src/http/apiBuilder/index.ts +1 -0
  49. package/src/http/apiBuilder//345/277/253/351/200/237/345/217/202/350/200/203.md +199 -0
  50. package/src/index.ts +1 -0
  51. package/tsconfig.json +1 -1
  52. package/types/http/apiBuilder/api-builder.d.ts +193 -0
  53. package/types/http/apiBuilder/example.d.ts +4 -0
  54. package/types/http/apiBuilder/index.d.ts +1 -0
  55. package/types/index.d.ts +1 -0
package/dist/index.esm.js CHANGED
@@ -481,6 +481,20 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
481
481
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
482
482
  PERFORMANCE OF THIS SOFTWARE.
483
483
  ***************************************************************************** */
484
+ /* global Reflect, Promise */
485
+
486
+ var extendStatics = function(d, b) {
487
+ extendStatics = Object.setPrototypeOf ||
488
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
489
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
490
+ return extendStatics(d, b);
491
+ };
492
+
493
+ function __extends(d, b) {
494
+ extendStatics(d, b);
495
+ function __() { this.constructor = d; }
496
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
497
+ }
484
498
 
485
499
  var __assign = function() {
486
500
  __assign = Object.assign || function __assign(t) {
@@ -1527,6 +1541,267 @@ var http = function (_a) {
1527
1541
  return request;
1528
1542
  };
1529
1543
 
1544
+ /**
1545
+ * API 请求参数构建工具
1546
+ * @description 用于快速组装后端 JSON 格式请求参数
1547
+ */
1548
+ /**
1549
+ * API 构建器基类
1550
+ */
1551
+ var BaseBuilder = /** @class */ (function () {
1552
+ function BaseBuilder(fieldCatalog) {
1553
+ this.fieldCatalog = fieldCatalog;
1554
+ // 只有传入 fieldCatalog 时才添加到 params
1555
+ this.params = (fieldCatalog ? { field_catalog: fieldCatalog } : {});
1556
+ }
1557
+ /**
1558
+ * 获取构建的参数
1559
+ */
1560
+ BaseBuilder.prototype.build = function () {
1561
+ return this.params;
1562
+ };
1563
+ return BaseBuilder;
1564
+ }());
1565
+ /**
1566
+ * API 构建器主类
1567
+ */
1568
+ var ApiBuilder = /** @class */ (function () {
1569
+ function ApiBuilder(fieldCatalog) {
1570
+ this.fieldCatalog = fieldCatalog;
1571
+ }
1572
+ /**
1573
+ * 创建查询请求构建器
1574
+ */
1575
+ ApiBuilder.prototype.query = function () {
1576
+ return new QueryBuilder(this.fieldCatalog);
1577
+ };
1578
+ /**
1579
+ * 创建新增请求构建器
1580
+ */
1581
+ ApiBuilder.prototype.insert = function () {
1582
+ return new InsertBuilder(this.fieldCatalog);
1583
+ };
1584
+ /**
1585
+ * 创建更新请求构建器
1586
+ */
1587
+ ApiBuilder.prototype.update = function () {
1588
+ return new UpdateBuilder(this.fieldCatalog);
1589
+ };
1590
+ // 静态方法保持向后兼容
1591
+ ApiBuilder.query = function (fieldCatalog) {
1592
+ return new QueryBuilder(fieldCatalog);
1593
+ };
1594
+ ApiBuilder.insert = function (fieldCatalog) {
1595
+ return new InsertBuilder(fieldCatalog);
1596
+ };
1597
+ ApiBuilder.update = function (fieldCatalog) {
1598
+ return new UpdateBuilder(fieldCatalog);
1599
+ };
1600
+ return ApiBuilder;
1601
+ }());
1602
+ /**
1603
+ * 查询构建器
1604
+ */
1605
+ var QueryBuilder = /** @class */ (function (_super) {
1606
+ __extends(QueryBuilder, _super);
1607
+ function QueryBuilder(fieldCatalog) {
1608
+ var _this = _super.call(this, fieldCatalog) || this;
1609
+ _this.params = __assign(__assign({}, _this.params), { filters: { logic: 'and', filters: [] }, order_by: [], limit: 100, offset: 0 });
1610
+ return _this;
1611
+ }
1612
+ QueryBuilder.prototype.where = function (fieldOrConditions, opOrValue, value) {
1613
+ var _this = this;
1614
+ // 对象形式: where({ user_id: 10086, status: 1 })
1615
+ if (typeof fieldOrConditions === 'object') {
1616
+ Object.entries(fieldOrConditions).forEach(function (_a) {
1617
+ var field = _a[0], val = _a[1];
1618
+ _this.params.filters.filters.push({ field: field, op: '=', value: val });
1619
+ });
1620
+ return this;
1621
+ }
1622
+ // 两参数形式: where('user_id', 10086) - 默认 =
1623
+ if (value === undefined) {
1624
+ this.params.filters.filters.push({ field: fieldOrConditions, op: '=', value: opOrValue });
1625
+ return this;
1626
+ }
1627
+ // 三参数形式: where('user_id', '=', 10086)
1628
+ this.params.filters.filters.push({ field: fieldOrConditions, op: opOrValue, value: value });
1629
+ return this;
1630
+ };
1631
+ QueryBuilder.prototype.orWhere = function (fieldOrConditions, opOrValue, value) {
1632
+ this.params.filters.logic = 'or';
1633
+ return this.where(fieldOrConditions, opOrValue, value);
1634
+ };
1635
+ /**
1636
+ * WHERE IN
1637
+ */
1638
+ QueryBuilder.prototype.whereIn = function (field, values) {
1639
+ this.params.filters.filters.push({ field: field, op: 'in', value: values });
1640
+ return this;
1641
+ };
1642
+ /**
1643
+ * WHERE NOT IN
1644
+ */
1645
+ QueryBuilder.prototype.whereNotIn = function (field, values) {
1646
+ this.params.filters.filters.push({ field: field, op: 'not in', value: values });
1647
+ return this;
1648
+ };
1649
+ /**
1650
+ * WHERE LIKE
1651
+ */
1652
+ QueryBuilder.prototype.whereLike = function (field, value) {
1653
+ this.params.filters.filters.push({ field: field, op: 'like', value: value });
1654
+ return this;
1655
+ };
1656
+ /**
1657
+ * WHERE BETWEEN
1658
+ */
1659
+ QueryBuilder.prototype.whereBetween = function (field, min, max) {
1660
+ this.params.filters.filters.push({ field: field, op: 'between', value: [min, max] });
1661
+ return this;
1662
+ };
1663
+ /**
1664
+ * WHERE NULL
1665
+ */
1666
+ QueryBuilder.prototype.whereNull = function (field) {
1667
+ this.params.filters.filters.push({ field: field, op: 'is null', value: null });
1668
+ return this;
1669
+ };
1670
+ /**
1671
+ * WHERE NOT NULL
1672
+ */
1673
+ QueryBuilder.prototype.whereNotNull = function (field) {
1674
+ this.params.filters.filters.push({ field: field, op: 'is not null', value: null });
1675
+ return this;
1676
+ };
1677
+ /**
1678
+ * 设置逻辑运算符(不推荐直接使用,建议用 orWhere)
1679
+ */
1680
+ QueryBuilder.prototype.logic = function (logic) {
1681
+ this.params.filters.logic = logic;
1682
+ return this;
1683
+ };
1684
+ /**
1685
+ * 添加排序
1686
+ */
1687
+ QueryBuilder.prototype.orderBy = function (field, direction) {
1688
+ if (direction === void 0) { direction = 'asc'; }
1689
+ this.params.order_by.push({ field: field, direction: direction });
1690
+ return this;
1691
+ };
1692
+ /**
1693
+ * 设置 LIMIT
1694
+ */
1695
+ QueryBuilder.prototype.limit = function (limit) {
1696
+ this.params.limit = limit;
1697
+ return this;
1698
+ };
1699
+ /**
1700
+ * 设置 OFFSET
1701
+ */
1702
+ QueryBuilder.prototype.offset = function (offset) {
1703
+ this.params.offset = offset;
1704
+ return this;
1705
+ };
1706
+ /**
1707
+ * 设置分页(便捷方法)
1708
+ */
1709
+ QueryBuilder.prototype.paginate = function (limit, offset) {
1710
+ if (offset === void 0) { offset = 0; }
1711
+ this.params.limit = limit;
1712
+ this.params.offset = offset;
1713
+ return this;
1714
+ };
1715
+ return QueryBuilder;
1716
+ }(BaseBuilder));
1717
+ /**
1718
+ * 新增构建器
1719
+ */
1720
+ var InsertBuilder = /** @class */ (function (_super) {
1721
+ __extends(InsertBuilder, _super);
1722
+ function InsertBuilder(fieldCatalog) {
1723
+ var _this = _super.call(this, fieldCatalog) || this;
1724
+ _this.params = __assign(__assign({}, _this.params), { insert: [] });
1725
+ return _this;
1726
+ }
1727
+ /**
1728
+ * 添加一条记录
1729
+ */
1730
+ InsertBuilder.prototype.add = function (data) {
1731
+ this.params.insert.push(data);
1732
+ return this;
1733
+ };
1734
+ /**
1735
+ * 批量添加记录
1736
+ */
1737
+ InsertBuilder.prototype.addBatch = function (dataList) {
1738
+ var _a;
1739
+ (_a = this.params.insert).push.apply(_a, dataList);
1740
+ return this;
1741
+ };
1742
+ return InsertBuilder;
1743
+ }(BaseBuilder));
1744
+ /**
1745
+ * 更新构建器
1746
+ */
1747
+ var UpdateBuilder = /** @class */ (function (_super) {
1748
+ __extends(UpdateBuilder, _super);
1749
+ function UpdateBuilder(fieldCatalog) {
1750
+ var _this = _super.call(this, fieldCatalog) || this;
1751
+ _this.currentUpdate = null;
1752
+ _this.params = __assign(__assign({}, _this.params), { update: [] });
1753
+ return _this;
1754
+ }
1755
+ /**
1756
+ * 设置要更新的字段和值
1757
+ */
1758
+ UpdateBuilder.prototype.set = function (fields) {
1759
+ this.currentUpdate = { set: fields, where: {} };
1760
+ return this;
1761
+ };
1762
+ UpdateBuilder.prototype.where = function (fieldOrConditions, value) {
1763
+ if (!this.currentUpdate) {
1764
+ throw new Error('必须先调用 set() 方法');
1765
+ }
1766
+ if (typeof fieldOrConditions === 'object') {
1767
+ this.currentUpdate.where = __assign(__assign({}, this.currentUpdate.where), fieldOrConditions);
1768
+ }
1769
+ else {
1770
+ this.currentUpdate.where[fieldOrConditions] = value;
1771
+ }
1772
+ return this;
1773
+ };
1774
+ /**
1775
+ * 完成当前更新操作,开始下一个
1776
+ */
1777
+ UpdateBuilder.prototype.and = function () {
1778
+ if (this.currentUpdate) {
1779
+ this.params.update.push(this.currentUpdate);
1780
+ this.currentUpdate = null;
1781
+ }
1782
+ return this;
1783
+ };
1784
+ /**
1785
+ * 批量添加更新操作
1786
+ */
1787
+ UpdateBuilder.prototype.setBatch = function (updates) {
1788
+ var _a;
1789
+ (_a = this.params.update).push.apply(_a, updates);
1790
+ return this;
1791
+ };
1792
+ /**
1793
+ * 构建最终参数
1794
+ */
1795
+ UpdateBuilder.prototype.build = function () {
1796
+ if (this.currentUpdate) {
1797
+ this.params.update.push(this.currentUpdate);
1798
+ this.currentUpdate = null;
1799
+ }
1800
+ return this.params;
1801
+ };
1802
+ return UpdateBuilder;
1803
+ }(BaseBuilder));
1804
+
1530
1805
  /**
1531
1806
  * 日志记录中间件
1532
1807
  *
@@ -1938,4 +2213,4 @@ function getSvgInfo(svg) {
1938
2213
  }
1939
2214
  }
1940
2215
 
1941
- export { addClass, addDays, base64ToBlob, base64ToFile, blobToDataURL, buildUUID, calcFileSize, ceil, clearLoginData, compatibleDate, compressImg, computeMoney, convertBase64UrlToBlob, convertCurrency, copyTextToClipboard, darken, dataURLtoBlob, deepEqual, delay, deviceDetection, fileSizeFormat, filterRepeat, findNodePath, floor, formatBank, formatBytes, formatCentsToYuan, formatEmptyValue, formatFloat, formatMoney, formatPhone, formatPhoneHide, formatTime, formateTimestamp, fromNow, genExportByBlob, generateEnglishLetters, getCookie, getDeviceType, getEnvironment, getFileData, getFromType, getIsComWx, getIsDevelopment, getKeyList, getQueryMap, getQueryString, getQueryVariable, getSvgInfo, getTicket, getToken, getWecomToken, handleFlatStr, hasClass, hexToRgb, hideTextAtIndex, http, httpEnum, humpTurnDashed, intersection, isAllEmpty, isEmail, isEmpty, isExternal, isImage, isIncludeAllChildren, isMobile, isMobileSimple, isPhone, isQQ, isTelephone, isUrl, lighten, newDate, openLink, randomString, recordLogMiddleWare, removeClass, removeTicket, removeToken, rgbToHex, setTicket, subBefore, sum, toThousands, toggleClass, trimVal, uuid, validateTwoDecimal };
2216
+ export { ApiBuilder, InsertBuilder, QueryBuilder, UpdateBuilder, addClass, addDays, base64ToBlob, base64ToFile, blobToDataURL, buildUUID, calcFileSize, ceil, clearLoginData, compatibleDate, compressImg, computeMoney, convertBase64UrlToBlob, convertCurrency, copyTextToClipboard, darken, dataURLtoBlob, deepEqual, delay, deviceDetection, fileSizeFormat, filterRepeat, findNodePath, floor, formatBank, formatBytes, formatCentsToYuan, formatEmptyValue, formatFloat, formatMoney, formatPhone, formatPhoneHide, formatTime, formateTimestamp, fromNow, genExportByBlob, generateEnglishLetters, getCookie, getDeviceType, getEnvironment, getFileData, getFromType, getIsComWx, getIsDevelopment, getKeyList, getQueryMap, getQueryString, getQueryVariable, getSvgInfo, getTicket, getToken, getWecomToken, handleFlatStr, hasClass, hexToRgb, hideTextAtIndex, http, httpEnum, humpTurnDashed, intersection, isAllEmpty, isEmail, isEmpty, isExternal, isImage, isIncludeAllChildren, isMobile, isMobileSimple, isPhone, isQQ, isTelephone, isUrl, lighten, newDate, openLink, randomString, recordLogMiddleWare, removeClass, removeTicket, removeToken, rgbToHex, setTicket, subBefore, sum, toThousands, toggleClass, trimVal, uuid, validateTwoDecimal };
@@ -1,4 +1,4 @@
1
- import e from"axios";var t={isWxWork:"wecom",isWeixin:"wechat",isMobile:"mobile",isMobileAny:"mobile"};function r(e){return new Promise((function(t){return setTimeout(t,e)}))}function n(){if("undefined"==typeof window)return!1;var e=navigator.userAgent.toLowerCase(),t=/midp/i.test(e),r=/ucweb/i.test(e),n=/android/i.test(e),o=/iphone os/i.test(e),i=/windows ce/i.test(e),a=/windows mobile/i.test(e),u=/rv:1.2.3.4/i.test(e);return t||r||n||o||i||a||u}function o(e){return null===e||""===e||void 0===e}var i=function(){localStorage.removeItem("wecom_userinfo"),localStorage.removeItem("wecom_token"),localStorage.removeItem("projectActive"),localStorage.removeItem("loginTime"),localStorage.removeItem("projectInfo")},a=function(e,t){var r=new RegExp("&{1}"+t+"\\=[a-zA-Z0-9_-]+","g"),n=e.replace(/\?/g,"&").match(r)[0];return n.substr(n.indexOf("=")+1)},u=function(e){for(var t=window.location.search.substring(1).split("&"),r=0;r<t.length;r++){var n=t[r].split("=");if(n[0]===e)return n[1]}return!1},c=function(){return localStorage.getItem("wecom_token")},s=function(){var e=navigator.userAgent.toLowerCase(),t=/wxwork/.test(e),r=/micromessenger/.test(e)&&!t,n=window.innerWidth<=768;return{isWxWork:t,isWeixin:r,isMobileScreen:n,isMobileAny:t||r||n}},f=function(e){var r="wecom";for(var n in e){if(e[n]){r=t[n];break}}return r};function l(e){e=e||32;for(var t="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",r=t.length,n="",o=0;o<e;o++)n+=t.charAt(Math.floor(Math.random()*r));return n}var d=function(e){for(var t="",r=document.cookie.split("; "),n=0;n<r.length;n++){var o=r[n].split("=");if(o[0]===e){t=o[1];break}}return t},p=function(){for(var e=[],t=0;t<=15;t++)e[t]=t.toString(16);var r="";for(t=1;t<=36;t++)r+=9===t||14===t||19===t||24===t?"-":15===t?4:20===t?e[4*Math.random()|8]:e[16*Math.random()|0];return r.replace(/-/g,"")},g=function(){return localStorage.getItem("jsapiTicket")},v=function(e){return localStorage.setItem("jsapiTicket",e)},h=function(){return localStorage.removeItem("jsapiTicket")},m=function(e,t){if(void 0===t&&(t="YYYY年MM月DD日 hh:mm:ss"),!e)return"-";var r=new Date(e),n=r.getFullYear()+"",o=r.getMonth()+1,i=r.getDate(),a=r.getHours()>9?r.getHours():"0"+r.getHours(),u=r.getMinutes()>9?r.getMinutes():"0"+r.getMinutes(),c=r.getSeconds()>9?r.getSeconds():"0"+r.getSeconds();return t.replace("YYYY",n+"").replace("MM",o+"").replace("DD",i+"").replace("hh",a+"").replace("mm",u+"").replace("ss",c+"")},y=function(e){for(var t=window.atob(e.split(",")[1]),r=new ArrayBuffer(t.length),n=new Uint8Array(r),o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return new Blob([r],{type:"image/png"})},w=function(){var e=window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i),t=/micromessenger/i.test(navigator.userAgent),r=/wxwork/i.test(navigator.userAgent);return r&&e?"com-wx-mobile":r&&!e?"com-wx-pc":t&&e?"wx-mobile":t&&!e?"wx-pc":"other"},b=function(){return/wxwork/i.test(navigator.userAgent)},S=function(){var e=!1;return"uat2-h5-wecom.hengdayun.com"!==location.origin&&"127.0.0.1:8081"!==location.origin&&"localhost:8081"!==location.origin||(e=!0),e},A=function(e,t){var r=new Set;return e.filter((function(e){var n=e[t];return!r.has(n)&&(r.add(n),!0)}))},M=function(e){for(var t=e.split(","),r=t[0].match(/:(.\*?);/)[1],n=atob(t[1]),o=n.length,i=new Uint8Array(o);o--;)i[o]=n.charCodeAt(o);return new Blob([i],{type:r})},x=function(e,t){for(var r=e.split(","),n=r[0].match(/:(.*);/)[1],o=atob(r[1]),i=o.length,a=new Uint8Array(i);i--;)a[i]=o.charCodeAt(i);return new File([a],t,{type:n})},C=function(e){return/^image\//i.test(e)},R=function(e){var t=e.split(","),r=t[0],n=void 0===r?"":r,o=t[1],i=void 0===o?"":o;return{name:decodeURIComponent(n),url:decodeURIComponent(i)}},E=function(e){return!e||""===e||/^(\d+)(\.\d{1,2})?$/.test(e.toString())},I=function(e,t){var r,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[];if(t=t||n.length,e)for(r=0;r<e;r++)o[r]=n[0|Math.random()*t];else{var i=void 0;for(o[8]=o[13]=o[18]=o[23]="-",o[14]="4",r=0;r<36;r++)o[r]||(i=0|16*Math.random(),o[r]=n[19==r?3&i|8:i])}return o.join("")},k=function(e,t){var r=e.toLowerCase();return"localstorage"===r?localStorage.getItem("token")||"":"sessionstorage"===r?sessionStorage.getItem("token")||"":localStorage.getItem("token")||sessionStorage.getItem("token")||""},N=function(e,t){var r=e.toLowerCase();"localstorage"===r?localStorage.removeItem("token"):"sessionstorage"===r?sessionStorage.removeItem("token"):(localStorage.removeItem("token"),sessionStorage.getItem("token"))};function B(e){return"string"==typeof e?e.replace(/-/g,"/"):e}function O(e){return e?new Date(B(e)):new Date}function T(e,t){void 0===e&&(e=Date.now()),void 0===t&&(t="yyyy-MM-dd HH:mm:ss"),e=B(e);var r={"M+":(e=new Date(e)).getMonth()+1,"d+":e.getDate(),"h+":e.getHours()%12==0?12:e.getHours()%12,"H+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};return/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(""+e.getFullYear()).substr(4-RegExp.$1.length))),Object.keys(r).forEach((function(e){new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1===RegExp.$1.length?r[e]:("00"+r[e]).substr((""+r[e]).length)))})),t}function D(e,t,r){if(void 0===t&&(t="yyyy年MM月dd日 HH时mm分ss秒"),void 0===r&&(r="-"),o(e))return r;e=B(e);var n=new Date(e),i=(Date.now()-n.getTime())/1e3;return i<0?e:i<30?"刚刚":i<3600?Math.ceil(i/60)+"分钟前":i<86400?Math.floor(i/3600)+"小时前":i<172800?"1天前":T(e,t)}function P(e,t,r){if(void 0===t&&(t=0),void 0===r&&(r="yyyy-MM-dd"),o(e))return"-";e=B(e);var n=new Date(e);return n.setDate(n.getDate()+Number(t)),T(n,r)}
1
+ import t from"axios";var e={isWxWork:"wecom",isWeixin:"wechat",isMobile:"mobile",isMobileAny:"mobile"};function r(t){return new Promise((function(e){return setTimeout(e,t)}))}function n(){if("undefined"==typeof window)return!1;var t=navigator.userAgent.toLowerCase(),e=/midp/i.test(t),r=/ucweb/i.test(t),n=/android/i.test(t),o=/iphone os/i.test(t),i=/windows ce/i.test(t),a=/windows mobile/i.test(t),u=/rv:1.2.3.4/i.test(t);return e||r||n||o||i||a||u}function o(t){return null===t||""===t||void 0===t}var i=function(){localStorage.removeItem("wecom_userinfo"),localStorage.removeItem("wecom_token"),localStorage.removeItem("projectActive"),localStorage.removeItem("loginTime"),localStorage.removeItem("projectInfo")},a=function(t,e){var r=new RegExp("&{1}"+e+"\\=[a-zA-Z0-9_-]+","g"),n=t.replace(/\?/g,"&").match(r)[0];return n.substr(n.indexOf("=")+1)},u=function(t){for(var e=window.location.search.substring(1).split("&"),r=0;r<e.length;r++){var n=e[r].split("=");if(n[0]===t)return n[1]}return!1},s=function(){return localStorage.getItem("wecom_token")},c=function(){var t=navigator.userAgent.toLowerCase(),e=/wxwork/.test(t),r=/micromessenger/.test(t)&&!e,n=window.innerWidth<=768;return{isWxWork:e,isWeixin:r,isMobileScreen:n,isMobileAny:e||r||n}},f=function(t){var r="wecom";for(var n in t){if(t[n]){r=e[n];break}}return r};function l(t){t=t||32;for(var e="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",r=e.length,n="",o=0;o<t;o++)n+=e.charAt(Math.floor(Math.random()*r));return n}var p=function(t){for(var e="",r=document.cookie.split("; "),n=0;n<r.length;n++){var o=r[n].split("=");if(o[0]===t){e=o[1];break}}return e},d=function(){for(var t=[],e=0;e<=15;e++)t[e]=e.toString(16);var r="";for(e=1;e<=36;e++)r+=9===e||14===e||19===e||24===e?"-":15===e?4:20===e?t[4*Math.random()|8]:t[16*Math.random()|0];return r.replace(/-/g,"")},h=function(){return localStorage.getItem("jsapiTicket")},g=function(t){return localStorage.setItem("jsapiTicket",t)},m=function(){return localStorage.removeItem("jsapiTicket")},v=function(t,e){if(void 0===e&&(e="YYYY年MM月DD日 hh:mm:ss"),!t)return"-";var r=new Date(t),n=r.getFullYear()+"",o=r.getMonth()+1,i=r.getDate(),a=r.getHours()>9?r.getHours():"0"+r.getHours(),u=r.getMinutes()>9?r.getMinutes():"0"+r.getMinutes(),s=r.getSeconds()>9?r.getSeconds():"0"+r.getSeconds();return e.replace("YYYY",n+"").replace("MM",o+"").replace("DD",i+"").replace("hh",a+"").replace("mm",u+"").replace("ss",s+"")},y=function(t){for(var e=window.atob(t.split(",")[1]),r=new ArrayBuffer(e.length),n=new Uint8Array(r),o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return new Blob([r],{type:"image/png"})},w=function(){var t=window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i),e=/micromessenger/i.test(navigator.userAgent),r=/wxwork/i.test(navigator.userAgent);return r&&t?"com-wx-mobile":r&&!t?"com-wx-pc":e&&t?"wx-mobile":e&&!t?"wx-pc":"other"},b=function(){return/wxwork/i.test(navigator.userAgent)},S=function(){var t=!1;return"uat2-h5-wecom.hengdayun.com"!==location.origin&&"127.0.0.1:8081"!==location.origin&&"localhost:8081"!==location.origin||(t=!0),t},A=function(t,e){var r=new Set;return t.filter((function(t){var n=t[e];return!r.has(n)&&(r.add(n),!0)}))},M=function(t){for(var e=t.split(","),r=e[0].match(/:(.\*?);/)[1],n=atob(e[1]),o=n.length,i=new Uint8Array(o);o--;)i[o]=n.charCodeAt(o);return new Blob([i],{type:r})},C=function(t,e){for(var r=t.split(","),n=r[0].match(/:(.*);/)[1],o=atob(r[1]),i=o.length,a=new Uint8Array(i);i--;)a[i]=o.charCodeAt(i);return new File([a],e,{type:n})},x=function(t){return/^image\//i.test(t)},E=function(t){var e=t.split(","),r=e[0],n=void 0===r?"":r,o=e[1],i=void 0===o?"":o;return{name:decodeURIComponent(n),url:decodeURIComponent(i)}},R=function(t){return!t||""===t||/^(\d+)(\.\d{1,2})?$/.test(t.toString())},I=function(t,e){var r,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[];if(e=e||n.length,t)for(r=0;r<t;r++)o[r]=n[0|Math.random()*e];else{var i=void 0;for(o[8]=o[13]=o[18]=o[23]="-",o[14]="4",r=0;r<36;r++)o[r]||(i=0|16*Math.random(),o[r]=n[19==r?3&i|8:i])}return o.join("")},N=function(t,e){var r=t.toLowerCase();return"localstorage"===r?localStorage.getItem("token")||"":"sessionstorage"===r?sessionStorage.getItem("token")||"":localStorage.getItem("token")||sessionStorage.getItem("token")||""},k=function(t,e){var r=t.toLowerCase();"localstorage"===r?localStorage.removeItem("token"):"sessionstorage"===r?sessionStorage.removeItem("token"):(localStorage.removeItem("token"),sessionStorage.getItem("token"))};function B(t){return"string"==typeof t?t.replace(/-/g,"/"):t}function U(t){return t?new Date(B(t)):new Date}function O(t,e){void 0===t&&(t=Date.now()),void 0===e&&(e="yyyy-MM-dd HH:mm:ss"),t=B(t);var r={"M+":(t=new Date(t)).getMonth()+1,"d+":t.getDate(),"h+":t.getHours()%12==0?12:t.getHours()%12,"H+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),S:t.getMilliseconds()};return/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(""+t.getFullYear()).substr(4-RegExp.$1.length))),Object.keys(r).forEach((function(t){new RegExp("("+t+")").test(e)&&(e=e.replace(RegExp.$1,1===RegExp.$1.length?r[t]:("00"+r[t]).substr((""+r[t]).length)))})),e}function j(t,e,r){if(void 0===e&&(e="yyyy年MM月dd日 HH时mm分ss秒"),void 0===r&&(r="-"),o(t))return r;t=B(t);var n=new Date(t),i=(Date.now()-n.getTime())/1e3;return i<0?t:i<30?"刚刚":i<3600?Math.ceil(i/60)+"分钟前":i<86400?Math.floor(i/3600)+"小时前":i<172800?"1天前":O(t,e)}function T(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r="yyyy-MM-dd"),o(t))return"-";t=B(t);var n=new Date(t);return n.setDate(n.getDate()+Number(e)),O(n,r)}
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -12,4 +12,4 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var j=function(){return(j=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function U(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function u(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,u)}c((n=n.apply(e,t||[])).next())}))}function F(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function z(e,t){if(void 0===t&&(t=2),0===e)return"0 Bytes";var r=t<0?0:t,n=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,n)).toFixed(r))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][n]}var H={operation:"divide",factor:100,precision:2,formatAsCurrency:!1,currencySymbol:"¥"};function $(e,t){if(void 0===t&&(t="-"),o(e))return t;var r=e.toString();return r.includes(".")||(r+="."),r.replace(/\d(?=(\d{3})+\.)/g,(function(e){return e+","})).replace(/\.$/,"")}function q(e){void 0===e&&(e="");if(o(e))return"";if(Number(e)>=1e15)return e;var t,r,n,i=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],a=["","拾","佰","仟"],u=["","万","亿","兆"],c=["角","分","毫","厘"],s="";if("0"===(e=parseFloat(e).toString()))return s=i[0]+"元整";if(-1===(e=e.toString()).indexOf(".")?(t=e,r=""):(t=(n=e.split("."))[0],r=n[1].substr(0,4)),parseInt(t,10)>0){for(var f=0,l=t.length,d=0;d<l;d+=1){var p=t.substr(d,1),g=l-d-1,v=g/4,h=g%4;"0"===p?f+=1:(f>0&&(s+=i[0]),f=0,s+=i[parseInt(p,10)]+a[h]),0===h&&f<4&&(s+=u[v])}s+="元"}if(""!==r){var m=r.length;for(d=0;d<m;d+=1){var y=r.substr(d,1);"0"!==y&&(s+=i[Number(y)]+c[d])}}return""===s?s+=i[0]+"元整":""===r&&(s+="整"),s}function W(e,t){void 0===t&&(t=2);var r=parseFloat(String(e));if(Number.isNaN(r))return"";var n=(r=Math.round(Number(e)*Math.pow(10,t))/Math.pow(10,t)).toString(),o=n.indexOf(".");for(o<0&&(o=n.length,n+=".");n.length<=o+t;)n+="0";return n}function Y(e,t){if(void 0===t&&(t=0),o(e))return e;var r=Math.pow(10,t),n=Number(e)*r;return Math.ceil(n)/r}function _(e,t){if(void 0===t&&(t=0),o(e))return e;var r=Math.pow(10,t),n=Number(e)*r;return Math.floor(n)/r}function G(e,t){var r=L(e,t),n=j(j({},H),t);if(n.formatter)return n.formatter(r);if(n.formatAsCurrency){var o=r.toFixed(n.precision),i=r>=1e3?$(o):o;return""+n.currencySymbol+i}return r.toFixed(n.precision)}function L(e,t){var r,n,o=j(j({},H),t);if(null==e||""===e)return 0;if("string"==typeof e){var i=e.replace(/[^\d.-]/g,"");r=i?parseFloat(i):0}else r=e;if(isNaN(r))return 0;if(n="multiply"===o.operation?r*o.factor:0!==o.factor?r/o.factor:0,void 0!==o.precision){var a=Math.pow(10,o.precision);n=Math.round(n*a)/a}return n}function Z(e,t){return G(e,j({operation:"divide",factor:100,formatAsCurrency:!0},t))}function J(e,t){void 0===t&&(t="B");var r=["B","KB","MB","GB","TB"],n=r.indexOf(t.toUpperCase());for(n=-1===n?0:n;e>=1024&&n<r.length;)e/=1024,n+=1;return{size:e,unit:r[n]}}function K(e,t,r){if(void 0===t&&(t="B"),void 0===r&&(r="-"),o(e))return r;var n=J(parseFloat(e.toString()),t);return""+Y(n.size,2)+n.unit}function Q(e){for(var t=e.match(/:(.*?);/)[1],r=window.atob(e.split(",")[1]),n=new ArrayBuffer(r.length),o=new Uint8Array(n),i=0;i<r.length;i+=1)o[i]=r.charCodeAt(i);return new Blob([n],{type:t})}function V(e){return new Promise((function(t,r){var n=new FileReader;n.onload=function(e){e&&e.target?t(e.target.result):r(e)},n.onerror=function(e){r(e)},n.readAsDataURL(e)}))}function X(e,t,r){return new Promise((function(n,o){var i=parseFloat((e.size/1024/1024).toString()),a=new FileReader;a.onload=function(a){var u=new Image;u.onload=function(){var o=u.width,a=u.height,c=document.createElement("canvas"),s=c.getContext("2d"),f=t?t(o,a):1;(Number.isNaN(f)||"number"!=typeof f)&&(f=1);var l=r?r(i,f,o,a):1;if((Number.isNaN(l)||"number"!=typeof l)&&(l=1),s){var d=parseInt((o*f).toString(),10),p=parseInt((a*f).toString(),10);c.setAttribute("width",d.toString()),c.setAttribute("height",p.toString()),s.drawImage(u,0,0,d,p)}var g=c.toDataURL(e.type,l);n(Q(g))},u.onerror=function(e){o(e)},a.target&&(u.src=a.target.result)},a.onerror=function(e){o(e)},a.readAsDataURL(e)}))}function ee(e){var t=e.axiosRequest,r=e.notWithCredentials,n=void 0===r?[]:r;return function(e){var r=this,o=e.filename,i=e.url,a=e.data,u=void 0===a?{}:a,c=e.params,s=void 0===c?{}:c,f=e.method,l=void 0===f?"post":f;return new Promise((function(e,a){t({method:l,url:i,data:u,params:s,responseType:"blob",config:{withCredentials:n.some((function(e){return!i.includes(e)}))}}).then((function(t){return U(r,void 0,void 0,(function(){var r,n,i,u,c,s,f,l,d,p;return F(this,(function(g){switch(g.label){case 0:return"application/json"!==(r=null==t?void 0:t.data).type?[3,1]:((n=new FileReader).readAsText(r,"utf-8"),n.onload=function(){var e={};try{e=JSON.parse(n.result)}catch(t){e=r}a(e)},[3,3]);case 1:try{i=t.headers,u=i["content-disposition"],c=decodeURIComponent(u.split(";")[1].split("filename=")[1]),o&&!o.includes(".")?(s=c.split("."),f=s[s.length-1],o+="."+f):o||(o=c)}catch(e){o||(o="download.xlsx")}return l=new Blob([t.data]),d=document.createElement("a"),[4,V(l)];case 2:p=g.sent(),d.href=p,d.download=o,document.body.appendChild(d),d.click(),document.body.removeChild(d),e(t),g.label=3;case 3:return[2]}}))}))})).catch((function(e){a(e)}))}))}}function te(e,t){var r=Object.keys,n=typeof e;return e&&t&&"object"===n&&n===typeof t?r(e).length===r(t).length&&r(e).every((function(r){return te(e[r],t[r])})):e===t}function re(e,t,r,n,o){if(void 0===o&&(o=[]),o.push(e),e[r]===t)throw"GOT IT!";if(e[n]&&e[n].length>0)for(var i=0;i<e[n].length;i++)re(e[n][i],t,r,n,o);o.pop()}function ne(e,t,r,n){var o=[];try{for(var i=0;i<r.length;i++)re(r[i],e,t,n,o)}catch(e){return o}}function oe(e){return/^(https?:|mailto:|tel:)/.test(e)}function ie(e){if(!e)return e;return e.replace(/^\s+|\s+$/g,"")}function ae(e){return/^0?(13[0-9]|14[5-9]|15[012356789]|166|17[0-8]|18[0-9]|19[8-9])[0-9]{8}$/.test(e.toString())}function ue(e){return e=e.toString(),/^1/.test(e)&&11===e.length}function ce(e){return/^0[1-9][0-9]{1,2}-[2-8][0-9]{6,7}$/.test(String(e))}function se(e){return/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(e)}function fe(e){return/^[1-9][0-9]{4,9}$/gim.test(String(e))}function le(e){return/^[1](([3][0-9])|([4][0,1,4-9])|([5][0-3,5-9])|([6][2,5,6,7])|([7][0-8])|([8][0-9])|([9][0-3,5-9]))[0-9]{8}$/.test(e)}function de(e){return new RegExp("^(?:(https?|ftp|rtsp|mms|ws|wss):\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?:localhost)|(?:[1-9]\\d{0,2}(?:\\.\\d{1,3}){3})|(?:$[0-9a-fA-F:]+$)|(?:(?:[a-zA-Z0-9-_]+\\.)+[a-zA-Z]{2,63}))(?::\\d{1,5})?(?:[/?#]\\S*)?$","i").test(e)}function pe(e,t){return void 0===t&&(t="-"),o(e)?t:e}function ge(e,t,r){if(void 0===t&&(t=" "),void 0===r&&(r="-"),o(e))return r;if(11!==e.toString().length)return e;var n=e.toString().replace(/[^\d]/g,"").split(""),i="";return n.forEach((function(e,r){3!==r&&7!==r||(i+=t),i+=e})),i}function ve(e,t){if(void 0===t&&(t=""),o(e))return t;if(11!==e.toString().length)return e;var r=e.toString();return r.substr(0,3)+"****"+r.substr(7,11)}function he(e,t){return void 0===t&&(t=""),o(e)?t:e.toString().replace(/\s/g,"").replace(/(.{4})/g,"$1 ")}function me(){for(var e=[],t=65;t<91;t+=1)e.push(String.fromCharCode(t));return e}function ye(e){void 0===e&&(e="");return e.replace(/\B([A-Z])/g,"-$1").toLowerCase()}function we(e,t){return e&&"string"==typeof t?e.substring(0,e.indexOf(t)):""}function be(e){if(!/^(?:(https?|ftp|rtsp|mms|ws|wss):\/\/)?/i.test(e))return console.error(e+"不符合超链接规范"),{};var t=e.indexOf("?");if(-1===t)return{};for(var r={},n=0,o=e.slice(t+1).split("&");n<o.length;n++){var i=o[n].split("="),a=i[0],u=i[1];a&&(r[a]=u||"")}return r}function Se(e,t,r){void 0===r&&(r="*"),"number"==typeof e&&(e=e.toString()),Array.isArray(t)||(t=[t]);for(var n=e.split(""),o=0,i=t;o<i.length;o++){var a=i[o];if("object"!=typeof a||Array.isArray(a))"number"==typeof a&&Number.isInteger(a)&&a>=0&&a<n.length&&(n[a]=r);else{var u=a.start,c=a.end;u>=0&&u<c&&c<n.length&&n.fill(r,u,c+1)}}return n.join("")}var Ae={HTTP_STATUS:{TEMP_RESPOND:{Continue:100,SwitchingProtocal:101},SUCCESS:{Ok:200,Created:201,Accepted:202,NoAuthoritativeInformation:203,NoContent:204,ResetContent:205,ParticalContent:206},REDIRECT:{MultipleChoice:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,TemporaryRedirect:307,PermanentRedirect:308},REQUEST_ERROR:{BadRequest:400,UnAuthorized:401,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAccepted:406,ProxyAuthorizationRequired:407,RequestTimeout:408,UpgradeRequired:426,TokenUnAuthorized:499},SERVER_ERROR:{InternalServerError:500,BadGateway:502,ServiceUnavailable:503,GateTimeout:504,HttpVersionNotSupported:505}},CODES:{Success:"00000",UnAuthorized:"00099",UnAuthorizedPhone:"11001",UnAuthorizedWecom:"11000",UnAuthorizedHavePhone:"11002"},ERR_CODE_WHITE_LIST:[]},Me=e.create({timeout:15e3,headers:{"Content-Type":"application/json"}}),xe=function(e){var t=e.cacheType,r=e.currentMode,n=e.errorCb,o=e.getTokenCb;e.tokenKey;return Me.interceptors.request.use((function(e){return U(void 0,void 0,void 0,(function(){var r,n;return F(this,(function(o){return r=k(t),n=s(),e.headers.Authorization=r,e.headers.token=r,e.headers.FrontType=f(n),[2,e]}))}))}),(function(e){return Promise.reject(e)})),Me.interceptors.response.use((function(e){return U(void 0,void 0,void 0,(function(){var n,i,a;return F(this,(function(u){return n=e.data,i=n.code||e.status,n instanceof Blob||i===Ae.CODES.Success?[2,n]:i===Ae.CODES.UnAuthorized?("local"!==r&&"dev"!==r&&"development"!==r&&(N(t),o&&"function"==typeof o&&o()),[2,Promise.reject(new Error("token过期!"))]):(a=n.message||n.msg,[2,Promise.reject(new Error(a||"Error"))])}))}))}),(function(e){return U(void 0,void 0,void 0,(function(){return F(this,(function(t){return n&&"function"==typeof n&&n(e),[2,Promise.reject(e)]}))}))})),Me},Ce=function(e){return function(t,r){return U(void 0,void 0,void 0,(function(){var n,o,i,a,u,c,s;return F(this,(function(f){switch(f.label){case 0:return n=t.ip||t.request.ip,o=t.path,i=t.method,a=Re(),u={method:t.method,url:t.url,query:t.query,body:t.request.body},c=t.headers,[4,r()];case 1:return f.sent(),s={status:t.status,body:t.body,headers:t.response.headers},Ee({system:e,ip:n,path:o,method:i,time:a,params:u,headers:c,result:s}),[2]}}))}))}},Re=function(){var e=new Date;return e.getFullYear()+""+"年"+(e.getMonth()+1+"")+"月"+(e.getDate()+"")+"日"+(e.getHours()+"")+":"+(e.getMinutes()+"")},Ee=function(t){console.log("logData---------",t);e.post("https://fe-log-producer.jinbizhihui.com/log/save",t)};var Ie=function(e,t){void 0===e&&(e="state");var r=function(e,t){void 0===t&&(t="state");for(var r,n=e;"string"==typeof n;)try{r=n,n=decodeURIComponent(n),n=JSON.parse(n)}catch(e){n=r;break}for(;n&&"object"==typeof n&&t in n&&("string"==typeof n[t]||"object"==typeof n[t]);)if("string"==typeof(n=n[t]))try{n=decodeURIComponent(n),n=JSON.parse(n)}catch(e){break}return n}(t,e);return"object"==typeof r?JSON.stringify(r):String(r)};function ke(e){var t=e.replace("#","").match(/../g);return t?t.map((function(e){return parseInt(e,16)})):[0,0,0]}function Ne(e,t,r){var n=function(e){var t=e.toString(16);return 1===t.length?"0"+t:t};return"#"+n(e)+n(t)+n(r)}function Be(e,t){var r=ke(e).map((function(e){return Math.floor(e*(1-t))}));return Ne(r[0],r[1],r[2])}function Oe(e,t){var r=ke(e).map((function(e){return Math.floor((255-e)*t+e)}));return Ne(r[0],r[1],r[2])}function Te(e,t){if(!Array.isArray(e))return[];for(var r=[],n=0,o=e;n<o.length;n++){var i=o[n];i&&void 0!==i[t]&&null!==i[t]&&r.push(i[t])}return r}function De(e,t,r){if(!Array.isArray(e)||!Array.isArray(t))return!1;var n=r||function(e,t){return JSON.stringify(e)===JSON.stringify(t)};return t.every((function(t){return e.some((function(e){return n(e,t)}))}))}function Pe(e){return null==e||("string"==typeof e?0===e.trim().length:Array.isArray(e)?0===e.length:"object"==typeof e&&0===Object.keys(e).length)}function je(e,t){return Array.isArray(e)&&Array.isArray(t)?e.filter((function(e){return t.includes(e)})):[]}function Ue(e){return Array.isArray(e)&&e.length>0?e.reduce((function(e,t){return e+t}),0):0}function Fe(e,t){return!("undefined"==typeof window||!e)&&!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function ze(e,t){"undefined"!=typeof window&&e&&(Fe(e,t)||(e.className+=" "+t))}function He(e,t){if("undefined"!=typeof window&&e&&Fe(e,t)){var r=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(r," ").trim()}}function $e(e,t,r){if("undefined"!=typeof window){var n=r||document.body,o=n.className;o=o.replace(t,"").trim(),n.className=e?(o+" "+t).trim():o}}function qe(e,t){if(void 0===t&&(t="_blank"),"undefined"!=typeof window){var r=document.createElement("a");r.setAttribute("href",e),r.setAttribute("target",t),r.setAttribute("rel","noreferrer noopener"),r.setAttribute("id","external");var n=document.getElementById("external");n&&document.body.removeChild(n),document.body.appendChild(r),r.click(),r.remove()}}function We(e){if("undefined"==typeof window||"undefined"==typeof document)return!1;var t=document.createElement("textarea"),r=document.activeElement;t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="12pt",t.style.border="0",t.style.padding="0",t.style.margin="0";var n=document.getSelection(),o=null;n&&n.rangeCount>0&&(o=n.getRangeAt(0)),document.body.appendChild(t),t.select(),t.selectionStart=0,t.selectionEnd=e.length;var i=!1;try{i=document.execCommand("copy")}catch(e){console.error("复制失败:",e)}return t.remove(),o&&n&&(n.removeAllRanges(),n.addRange(o)),r&&r.focus(),i}function Ye(e){if("undefined"==typeof window||"undefined"==typeof DOMParser)return e;try{var t=(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("svg");if(!t)return e;var r=t.getAttribute("viewBox");if(!r)throw new Error("Invalid SVG string: Missing viewBox attribute.");var n=r.split(" ");return{width:parseInt(n[2],10),height:parseInt(n[3],10),body:Array.from(t.querySelectorAll("path")).map((function(e){return e.outerHTML})).join(" ")}}catch(t){return console.error("解析 SVG 失败:",t),e}}export{ze as addClass,P as addDays,M as base64ToBlob,x as base64ToFile,V as blobToDataURL,p as buildUUID,J as calcFileSize,Y as ceil,i as clearLoginData,B as compatibleDate,X as compressImg,L as computeMoney,y as convertBase64UrlToBlob,q as convertCurrency,We as copyTextToClipboard,Be as darken,Q as dataURLtoBlob,te as deepEqual,r as delay,n as deviceDetection,K as fileSizeFormat,A as filterRepeat,ne as findNodePath,_ as floor,he as formatBank,z as formatBytes,Z as formatCentsToYuan,pe as formatEmptyValue,W as formatFloat,G as formatMoney,ge as formatPhone,ve as formatPhoneHide,T as formatTime,m as formateTimestamp,D as fromNow,ee as genExportByBlob,me as generateEnglishLetters,d as getCookie,s as getDeviceType,w as getEnvironment,R as getFileData,f as getFromType,b as getIsComWx,S as getIsDevelopment,Te as getKeyList,be as getQueryMap,a as getQueryString,u as getQueryVariable,Ye as getSvgInfo,g as getTicket,k as getToken,c as getWecomToken,Ie as handleFlatStr,Fe as hasClass,ke as hexToRgb,Se as hideTextAtIndex,xe as http,Ae as httpEnum,ye as humpTurnDashed,je as intersection,Pe as isAllEmpty,se as isEmail,o as isEmpty,oe as isExternal,C as isImage,De as isIncludeAllChildren,ae as isMobile,ue as isMobileSimple,le as isPhone,fe as isQQ,ce as isTelephone,de as isUrl,Oe as lighten,O as newDate,qe as openLink,l as randomString,Ce as recordLogMiddleWare,He as removeClass,h as removeTicket,N as removeToken,Ne as rgbToHex,v as setTicket,we as subBefore,Ue as sum,$ as toThousands,$e as toggleClass,ie as trimVal,I as uuid,E as validateTwoDecimal};
15
+ ***************************************************************************** */var D=function(t,e){return(D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function P(t,e){function r(){this.constructor=t}D(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var F=function(){return(F=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function _(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))}function z(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function H(t,e){if(void 0===e&&(e=2),0===t)return"0 Bytes";var r=e<0?0:e,n=Math.floor(Math.log(t)/Math.log(1024));return parseFloat((t/Math.pow(1024,n)).toFixed(r))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][n]}var $={operation:"divide",factor:100,precision:2,formatAsCurrency:!1,currencySymbol:"¥"};function q(t,e){if(void 0===e&&(e="-"),o(t))return e;var r=t.toString();return r.includes(".")||(r+="."),r.replace(/\d(?=(\d{3})+\.)/g,(function(t){return t+","})).replace(/\.$/,"")}function W(t){void 0===t&&(t="");if(o(t))return"";if(Number(t)>=1e15)return t;var e,r,n,i=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],a=["","拾","佰","仟"],u=["","万","亿","兆"],s=["角","分","毫","厘"],c="";if("0"===(t=parseFloat(t).toString()))return c=i[0]+"元整";if(-1===(t=t.toString()).indexOf(".")?(e=t,r=""):(e=(n=t.split("."))[0],r=n[1].substr(0,4)),parseInt(e,10)>0){for(var f=0,l=e.length,p=0;p<l;p+=1){var d=e.substr(p,1),h=l-p-1,g=h/4,m=h%4;"0"===d?f+=1:(f>0&&(c+=i[0]),f=0,c+=i[parseInt(d,10)]+a[m]),0===m&&f<4&&(c+=u[g])}c+="元"}if(""!==r){var v=r.length;for(p=0;p<v;p+=1){var y=r.substr(p,1);"0"!==y&&(c+=i[Number(y)]+s[p])}}return""===c?c+=i[0]+"元整":""===r&&(c+="整"),c}function Y(t,e){void 0===e&&(e=2);var r=parseFloat(String(t));if(Number.isNaN(r))return"";var n=(r=Math.round(Number(t)*Math.pow(10,e))/Math.pow(10,e)).toString(),o=n.indexOf(".");for(o<0&&(o=n.length,n+=".");n.length<=o+e;)n+="0";return n}function L(t,e){if(void 0===e&&(e=0),o(t))return t;var r=Math.pow(10,e),n=Number(t)*r;return Math.ceil(n)/r}function G(t,e){if(void 0===e&&(e=0),o(t))return t;var r=Math.pow(10,e),n=Number(t)*r;return Math.floor(n)/r}function Z(t,e){var r=J(t,e),n=F(F({},$),e);if(n.formatter)return n.formatter(r);if(n.formatAsCurrency){var o=r.toFixed(n.precision),i=r>=1e3?q(o):o;return""+n.currencySymbol+i}return r.toFixed(n.precision)}function J(t,e){var r,n,o=F(F({},$),e);if(null==t||""===t)return 0;if("string"==typeof t){var i=t.replace(/[^\d.-]/g,"");r=i?parseFloat(i):0}else r=t;if(isNaN(r))return 0;if(n="multiply"===o.operation?r*o.factor:0!==o.factor?r/o.factor:0,void 0!==o.precision){var a=Math.pow(10,o.precision);n=Math.round(n*a)/a}return n}function K(t,e){return Z(t,F({operation:"divide",factor:100,formatAsCurrency:!0},e))}function Q(t,e){void 0===e&&(e="B");var r=["B","KB","MB","GB","TB"],n=r.indexOf(e.toUpperCase());for(n=-1===n?0:n;t>=1024&&n<r.length;)t/=1024,n+=1;return{size:t,unit:r[n]}}function V(t,e,r){if(void 0===e&&(e="B"),void 0===r&&(r="-"),o(t))return r;var n=Q(parseFloat(t.toString()),e);return""+L(n.size,2)+n.unit}function X(t){for(var e=t.match(/:(.*?);/)[1],r=window.atob(t.split(",")[1]),n=new ArrayBuffer(r.length),o=new Uint8Array(n),i=0;i<r.length;i+=1)o[i]=r.charCodeAt(i);return new Blob([n],{type:e})}function tt(t){return new Promise((function(e,r){var n=new FileReader;n.onload=function(t){t&&t.target?e(t.target.result):r(t)},n.onerror=function(t){r(t)},n.readAsDataURL(t)}))}function et(t,e,r){return new Promise((function(n,o){var i=parseFloat((t.size/1024/1024).toString()),a=new FileReader;a.onload=function(a){var u=new Image;u.onload=function(){var o=u.width,a=u.height,s=document.createElement("canvas"),c=s.getContext("2d"),f=e?e(o,a):1;(Number.isNaN(f)||"number"!=typeof f)&&(f=1);var l=r?r(i,f,o,a):1;if((Number.isNaN(l)||"number"!=typeof l)&&(l=1),c){var p=parseInt((o*f).toString(),10),d=parseInt((a*f).toString(),10);s.setAttribute("width",p.toString()),s.setAttribute("height",d.toString()),c.drawImage(u,0,0,p,d)}var h=s.toDataURL(t.type,l);n(X(h))},u.onerror=function(t){o(t)},a.target&&(u.src=a.target.result)},a.onerror=function(t){o(t)},a.readAsDataURL(t)}))}function rt(t){var e=t.axiosRequest,r=t.notWithCredentials,n=void 0===r?[]:r;return function(t){var r=this,o=t.filename,i=t.url,a=t.data,u=void 0===a?{}:a,s=t.params,c=void 0===s?{}:s,f=t.method,l=void 0===f?"post":f;return new Promise((function(t,a){e({method:l,url:i,data:u,params:c,responseType:"blob",config:{withCredentials:n.some((function(t){return!i.includes(t)}))}}).then((function(e){return _(r,void 0,void 0,(function(){var r,n,i,u,s,c,f,l,p,d;return z(this,(function(h){switch(h.label){case 0:return"application/json"!==(r=null==e?void 0:e.data).type?[3,1]:((n=new FileReader).readAsText(r,"utf-8"),n.onload=function(){var t={};try{t=JSON.parse(n.result)}catch(e){t=r}a(t)},[3,3]);case 1:try{i=e.headers,u=i["content-disposition"],s=decodeURIComponent(u.split(";")[1].split("filename=")[1]),o&&!o.includes(".")?(c=s.split("."),f=c[c.length-1],o+="."+f):o||(o=s)}catch(t){o||(o="download.xlsx")}return l=new Blob([e.data]),p=document.createElement("a"),[4,tt(l)];case 2:d=h.sent(),p.href=d,p.download=o,document.body.appendChild(p),p.click(),document.body.removeChild(p),t(e),h.label=3;case 3:return[2]}}))}))})).catch((function(t){a(t)}))}))}}function nt(t,e){var r=Object.keys,n=typeof t;return t&&e&&"object"===n&&n===typeof e?r(t).length===r(e).length&&r(t).every((function(r){return nt(t[r],e[r])})):t===e}function ot(t,e,r,n,o){if(void 0===o&&(o=[]),o.push(t),t[r]===e)throw"GOT IT!";if(t[n]&&t[n].length>0)for(var i=0;i<t[n].length;i++)ot(t[n][i],e,r,n,o);o.pop()}function it(t,e,r,n){var o=[];try{for(var i=0;i<r.length;i++)ot(r[i],t,e,n,o)}catch(t){return o}}function at(t){return/^(https?:|mailto:|tel:)/.test(t)}function ut(t){if(!t)return t;return t.replace(/^\s+|\s+$/g,"")}function st(t){return/^0?(13[0-9]|14[5-9]|15[012356789]|166|17[0-8]|18[0-9]|19[8-9])[0-9]{8}$/.test(t.toString())}function ct(t){return t=t.toString(),/^1/.test(t)&&11===t.length}function ft(t){return/^0[1-9][0-9]{1,2}-[2-8][0-9]{6,7}$/.test(String(t))}function lt(t){return/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(t)}function pt(t){return/^[1-9][0-9]{4,9}$/gim.test(String(t))}function dt(t){return/^[1](([3][0-9])|([4][0,1,4-9])|([5][0-3,5-9])|([6][2,5,6,7])|([7][0-8])|([8][0-9])|([9][0-3,5-9]))[0-9]{8}$/.test(t)}function ht(t){return new RegExp("^(?:(https?|ftp|rtsp|mms|ws|wss):\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?:localhost)|(?:[1-9]\\d{0,2}(?:\\.\\d{1,3}){3})|(?:$[0-9a-fA-F:]+$)|(?:(?:[a-zA-Z0-9-_]+\\.)+[a-zA-Z]{2,63}))(?::\\d{1,5})?(?:[/?#]\\S*)?$","i").test(t)}function gt(t,e){return void 0===e&&(e="-"),o(t)?e:t}function mt(t,e,r){if(void 0===e&&(e=" "),void 0===r&&(r="-"),o(t))return r;if(11!==t.toString().length)return t;var n=t.toString().replace(/[^\d]/g,"").split(""),i="";return n.forEach((function(t,r){3!==r&&7!==r||(i+=e),i+=t})),i}function vt(t,e){if(void 0===e&&(e=""),o(t))return e;if(11!==t.toString().length)return t;var r=t.toString();return r.substr(0,3)+"****"+r.substr(7,11)}function yt(t,e){return void 0===e&&(e=""),o(t)?e:t.toString().replace(/\s/g,"").replace(/(.{4})/g,"$1 ")}function wt(){for(var t=[],e=65;e<91;e+=1)t.push(String.fromCharCode(e));return t}function bt(t){void 0===t&&(t="");return t.replace(/\B([A-Z])/g,"-$1").toLowerCase()}function St(t,e){return t&&"string"==typeof e?t.substring(0,t.indexOf(e)):""}function At(t){if(!/^(?:(https?|ftp|rtsp|mms|ws|wss):\/\/)?/i.test(t))return console.error(t+"不符合超链接规范"),{};var e=t.indexOf("?");if(-1===e)return{};for(var r={},n=0,o=t.slice(e+1).split("&");n<o.length;n++){var i=o[n].split("="),a=i[0],u=i[1];a&&(r[a]=u||"")}return r}function Mt(t,e,r){void 0===r&&(r="*"),"number"==typeof t&&(t=t.toString()),Array.isArray(e)||(e=[e]);for(var n=t.split(""),o=0,i=e;o<i.length;o++){var a=i[o];if("object"!=typeof a||Array.isArray(a))"number"==typeof a&&Number.isInteger(a)&&a>=0&&a<n.length&&(n[a]=r);else{var u=a.start,s=a.end;u>=0&&u<s&&s<n.length&&n.fill(r,u,s+1)}}return n.join("")}var Ct={HTTP_STATUS:{TEMP_RESPOND:{Continue:100,SwitchingProtocal:101},SUCCESS:{Ok:200,Created:201,Accepted:202,NoAuthoritativeInformation:203,NoContent:204,ResetContent:205,ParticalContent:206},REDIRECT:{MultipleChoice:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,TemporaryRedirect:307,PermanentRedirect:308},REQUEST_ERROR:{BadRequest:400,UnAuthorized:401,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAccepted:406,ProxyAuthorizationRequired:407,RequestTimeout:408,UpgradeRequired:426,TokenUnAuthorized:499},SERVER_ERROR:{InternalServerError:500,BadGateway:502,ServiceUnavailable:503,GateTimeout:504,HttpVersionNotSupported:505}},CODES:{Success:"00000",UnAuthorized:"00099",UnAuthorizedPhone:"11001",UnAuthorizedWecom:"11000",UnAuthorizedHavePhone:"11002"},ERR_CODE_WHITE_LIST:[]},xt=t.create({timeout:15e3,headers:{"Content-Type":"application/json"}}),Et=function(t){var e=t.cacheType,r=t.currentMode,n=t.errorCb,o=t.getTokenCb;t.tokenKey;return xt.interceptors.request.use((function(t){return _(void 0,void 0,void 0,(function(){var r,n;return z(this,(function(o){return r=N(e),n=c(),t.headers.Authorization=r,t.headers.token=r,t.headers.FrontType=f(n),[2,t]}))}))}),(function(t){return Promise.reject(t)})),xt.interceptors.response.use((function(t){return _(void 0,void 0,void 0,(function(){var n,i,a;return z(this,(function(u){return n=t.data,i=n.code||t.status,n instanceof Blob||i===Ct.CODES.Success?[2,n]:i===Ct.CODES.UnAuthorized?("local"!==r&&"dev"!==r&&"development"!==r&&(k(e),o&&"function"==typeof o&&o()),[2,Promise.reject(new Error("token过期!"))]):(a=n.message||n.msg,[2,Promise.reject(new Error(a||"Error"))])}))}))}),(function(t){return _(void 0,void 0,void 0,(function(){return z(this,(function(e){return n&&"function"==typeof n&&n(t),[2,Promise.reject(t)]}))}))})),xt},Rt=function(){function t(t){this.fieldCatalog=t,this.params=t?{field_catalog:t}:{}}return t.prototype.build=function(){return this.params},t}(),It=function(){function t(t){this.fieldCatalog=t}return t.prototype.query=function(){return new Nt(this.fieldCatalog)},t.prototype.insert=function(){return new kt(this.fieldCatalog)},t.prototype.update=function(){return new Bt(this.fieldCatalog)},t.query=function(t){return new Nt(t)},t.insert=function(t){return new kt(t)},t.update=function(t){return new Bt(t)},t}(),Nt=function(t){function e(e){var r=t.call(this,e)||this;return r.params=F(F({},r.params),{filters:{logic:"and",filters:[]},order_by:[],limit:100,offset:0}),r}return P(e,t),e.prototype.where=function(t,e,r){var n=this;return"object"==typeof t?(Object.entries(t).forEach((function(t){var e=t[0],r=t[1];n.params.filters.filters.push({field:e,op:"=",value:r})})),this):void 0===r?(this.params.filters.filters.push({field:t,op:"=",value:e}),this):(this.params.filters.filters.push({field:t,op:e,value:r}),this)},e.prototype.orWhere=function(t,e,r){return this.params.filters.logic="or",this.where(t,e,r)},e.prototype.whereIn=function(t,e){return this.params.filters.filters.push({field:t,op:"in",value:e}),this},e.prototype.whereNotIn=function(t,e){return this.params.filters.filters.push({field:t,op:"not in",value:e}),this},e.prototype.whereLike=function(t,e){return this.params.filters.filters.push({field:t,op:"like",value:e}),this},e.prototype.whereBetween=function(t,e,r){return this.params.filters.filters.push({field:t,op:"between",value:[e,r]}),this},e.prototype.whereNull=function(t){return this.params.filters.filters.push({field:t,op:"is null",value:null}),this},e.prototype.whereNotNull=function(t){return this.params.filters.filters.push({field:t,op:"is not null",value:null}),this},e.prototype.logic=function(t){return this.params.filters.logic=t,this},e.prototype.orderBy=function(t,e){return void 0===e&&(e="asc"),this.params.order_by.push({field:t,direction:e}),this},e.prototype.limit=function(t){return this.params.limit=t,this},e.prototype.offset=function(t){return this.params.offset=t,this},e.prototype.paginate=function(t,e){return void 0===e&&(e=0),this.params.limit=t,this.params.offset=e,this},e}(Rt),kt=function(t){function e(e){var r=t.call(this,e)||this;return r.params=F(F({},r.params),{insert:[]}),r}return P(e,t),e.prototype.add=function(t){return this.params.insert.push(t),this},e.prototype.addBatch=function(t){var e;return(e=this.params.insert).push.apply(e,t),this},e}(Rt),Bt=function(t){function e(e){var r=t.call(this,e)||this;return r.currentUpdate=null,r.params=F(F({},r.params),{update:[]}),r}return P(e,t),e.prototype.set=function(t){return this.currentUpdate={set:t,where:{}},this},e.prototype.where=function(t,e){if(!this.currentUpdate)throw new Error("必须先调用 set() 方法");return"object"==typeof t?this.currentUpdate.where=F(F({},this.currentUpdate.where),t):this.currentUpdate.where[t]=e,this},e.prototype.and=function(){return this.currentUpdate&&(this.params.update.push(this.currentUpdate),this.currentUpdate=null),this},e.prototype.setBatch=function(t){var e;return(e=this.params.update).push.apply(e,t),this},e.prototype.build=function(){return this.currentUpdate&&(this.params.update.push(this.currentUpdate),this.currentUpdate=null),this.params},e}(Rt),Ut=function(t){return function(e,r){return _(void 0,void 0,void 0,(function(){var n,o,i,a,u,s,c;return z(this,(function(f){switch(f.label){case 0:return n=e.ip||e.request.ip,o=e.path,i=e.method,a=Ot(),u={method:e.method,url:e.url,query:e.query,body:e.request.body},s=e.headers,[4,r()];case 1:return f.sent(),c={status:e.status,body:e.body,headers:e.response.headers},jt({system:t,ip:n,path:o,method:i,time:a,params:u,headers:s,result:c}),[2]}}))}))}},Ot=function(){var t=new Date;return t.getFullYear()+""+"年"+(t.getMonth()+1+"")+"月"+(t.getDate()+"")+"日"+(t.getHours()+"")+":"+(t.getMinutes()+"")},jt=function(e){console.log("logData---------",e);t.post("https://fe-log-producer.jinbizhihui.com/log/save",e)};var Tt=function(t,e){void 0===t&&(t="state");var r=function(t,e){void 0===e&&(e="state");for(var r,n=t;"string"==typeof n;)try{r=n,n=decodeURIComponent(n),n=JSON.parse(n)}catch(t){n=r;break}for(;n&&"object"==typeof n&&e in n&&("string"==typeof n[e]||"object"==typeof n[e]);)if("string"==typeof(n=n[e]))try{n=decodeURIComponent(n),n=JSON.parse(n)}catch(t){break}return n}(e,t);return"object"==typeof r?JSON.stringify(r):String(r)};function Dt(t){var e=t.replace("#","").match(/../g);return e?e.map((function(t){return parseInt(t,16)})):[0,0,0]}function Pt(t,e,r){var n=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e};return"#"+n(t)+n(e)+n(r)}function Ft(t,e){var r=Dt(t).map((function(t){return Math.floor(t*(1-e))}));return Pt(r[0],r[1],r[2])}function _t(t,e){var r=Dt(t).map((function(t){return Math.floor((255-t)*e+t)}));return Pt(r[0],r[1],r[2])}function zt(t,e){if(!Array.isArray(t))return[];for(var r=[],n=0,o=t;n<o.length;n++){var i=o[n];i&&void 0!==i[e]&&null!==i[e]&&r.push(i[e])}return r}function Ht(t,e,r){if(!Array.isArray(t)||!Array.isArray(e))return!1;var n=r||function(t,e){return JSON.stringify(t)===JSON.stringify(e)};return e.every((function(e){return t.some((function(t){return n(t,e)}))}))}function $t(t){return null==t||("string"==typeof t?0===t.trim().length:Array.isArray(t)?0===t.length:"object"==typeof t&&0===Object.keys(t).length)}function qt(t,e){return Array.isArray(t)&&Array.isArray(e)?t.filter((function(t){return e.includes(t)})):[]}function Wt(t){return Array.isArray(t)&&t.length>0?t.reduce((function(t,e){return t+e}),0):0}function Yt(t,e){return!("undefined"==typeof window||!t)&&!!t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}function Lt(t,e){"undefined"!=typeof window&&t&&(Yt(t,e)||(t.className+=" "+e))}function Gt(t,e){if("undefined"!=typeof window&&t&&Yt(t,e)){var r=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(r," ").trim()}}function Zt(t,e,r){if("undefined"!=typeof window){var n=r||document.body,o=n.className;o=o.replace(e,"").trim(),n.className=t?(o+" "+e).trim():o}}function Jt(t,e){if(void 0===e&&(e="_blank"),"undefined"!=typeof window){var r=document.createElement("a");r.setAttribute("href",t),r.setAttribute("target",e),r.setAttribute("rel","noreferrer noopener"),r.setAttribute("id","external");var n=document.getElementById("external");n&&document.body.removeChild(n),document.body.appendChild(r),r.click(),r.remove()}}function Kt(t){if("undefined"==typeof window||"undefined"==typeof document)return!1;var e=document.createElement("textarea"),r=document.activeElement;e.value=t,e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",e.style.fontSize="12pt",e.style.border="0",e.style.padding="0",e.style.margin="0";var n=document.getSelection(),o=null;n&&n.rangeCount>0&&(o=n.getRangeAt(0)),document.body.appendChild(e),e.select(),e.selectionStart=0,e.selectionEnd=t.length;var i=!1;try{i=document.execCommand("copy")}catch(t){console.error("复制失败:",t)}return e.remove(),o&&n&&(n.removeAllRanges(),n.addRange(o)),r&&r.focus(),i}function Qt(t){if("undefined"==typeof window||"undefined"==typeof DOMParser)return t;try{var e=(new DOMParser).parseFromString(t,"image/svg+xml").querySelector("svg");if(!e)return t;var r=e.getAttribute("viewBox");if(!r)throw new Error("Invalid SVG string: Missing viewBox attribute.");var n=r.split(" ");return{width:parseInt(n[2],10),height:parseInt(n[3],10),body:Array.from(e.querySelectorAll("path")).map((function(t){return t.outerHTML})).join(" ")}}catch(e){return console.error("解析 SVG 失败:",e),t}}export{It as ApiBuilder,kt as InsertBuilder,Nt as QueryBuilder,Bt as UpdateBuilder,Lt as addClass,T as addDays,M as base64ToBlob,C as base64ToFile,tt as blobToDataURL,d as buildUUID,Q as calcFileSize,L as ceil,i as clearLoginData,B as compatibleDate,et as compressImg,J as computeMoney,y as convertBase64UrlToBlob,W as convertCurrency,Kt as copyTextToClipboard,Ft as darken,X as dataURLtoBlob,nt as deepEqual,r as delay,n as deviceDetection,V as fileSizeFormat,A as filterRepeat,it as findNodePath,G as floor,yt as formatBank,H as formatBytes,K as formatCentsToYuan,gt as formatEmptyValue,Y as formatFloat,Z as formatMoney,mt as formatPhone,vt as formatPhoneHide,O as formatTime,v as formateTimestamp,j as fromNow,rt as genExportByBlob,wt as generateEnglishLetters,p as getCookie,c as getDeviceType,w as getEnvironment,E as getFileData,f as getFromType,b as getIsComWx,S as getIsDevelopment,zt as getKeyList,At as getQueryMap,a as getQueryString,u as getQueryVariable,Qt as getSvgInfo,h as getTicket,N as getToken,s as getWecomToken,Tt as handleFlatStr,Yt as hasClass,Dt as hexToRgb,Mt as hideTextAtIndex,Et as http,Ct as httpEnum,bt as humpTurnDashed,qt as intersection,$t as isAllEmpty,lt as isEmail,o as isEmpty,at as isExternal,x as isImage,Ht as isIncludeAllChildren,st as isMobile,ct as isMobileSimple,dt as isPhone,pt as isQQ,ft as isTelephone,ht as isUrl,_t as lighten,U as newDate,Jt as openLink,l as randomString,Ut as recordLogMiddleWare,Gt as removeClass,m as removeTicket,k as removeToken,Pt as rgbToHex,g as setTicket,St as subBefore,Wt as sum,q as toThousands,Zt as toggleClass,ut as trimVal,I as uuid,R as validateTwoDecimal};