@fmdeui/fmui 1.0.129 → 1.0.130

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/es/index.mjs CHANGED
@@ -30,7 +30,7 @@ export { feature, useSysApi } from './packages/api/sys/index.mjs';
30
30
  export { flowLoading } from './packages/utils/flowLoading.mjs';
31
31
  export { formatAxis, formatDate, formatPast, getBdate, getEdate, getWeek } from './packages/utils/formatTime.mjs';
32
32
  export { gcj02ToBd09, wgs84ToBd09, wgs84ToGcj02 } from './packages/utils/gpsConvertor.mjs';
33
- export { getFileUrl, showFileUrl, showFileUrlByType } from './packages/utils/uploadfileurl.mjs';
33
+ export { getFileDownloadUrl, getFileUrl, showFileUrl, showFileUrlByType } from './packages/utils/uploadfileurl.mjs';
34
34
  export { getFormItemLabel, getFormItemProp, getRules, getShowColumn, getShowColumnWidth, getSubFormFields, getlimit, showTabelColumn } from './packages/hooks/limitsFunction.mjs';
35
35
  export { getpower, powerAuthDel } from './packages/hooks/powerFunction.mjs';
36
36
  export { judgementIdCard, verifiyNumberInteger, verifyAccount, verifyAndSpace, verifyCarNum, verifyCnAndSpace, verifyEmail, verifyEnAndSpace, verifyFullName, verifyIPAddress, verifyIdCard, verifyNumberCnUppercase, verifyNumberComma, verifyNumberIntegerAndFloat, verifyNumberPercentage, verifyNumberPercentageFloat, verifyPassword, verifyPasswordPowerful, verifyPasswordStrength, verifyPhone, verifyPostalCode, verifyTelPhone, verifyTextColor, verifyUrl } from './packages/utils/toolsValidate.mjs';
@@ -13,7 +13,7 @@ export { gcj02ToBd09, wgs84ToBd09, wgs84ToGcj02 } from './gpsConvertor.mjs';
13
13
  export { StringToObj } from './json-utils.mjs';
14
14
  export { NextLoading } from './loading.mjs';
15
15
  import './md5Signature.mjs';
16
- export { getFileUrl, showFileUrl, showFileUrlByType } from './uploadfileurl.mjs';
16
+ export { getFileDownloadUrl, getFileUrl, showFileUrl, showFileUrlByType } from './uploadfileurl.mjs';
17
17
  export { accessTokenKey, axiosInstance, cancelAllRequest, cancelRequest, clearAccessTokens, clearTokens, decryptJWT, getHeader, getJWTDate, getToken, reLoadLoginAccessToken, refreshAccessTokenKey, request2, default as service, sleep, tansParams } from './request.mjs';
18
18
  export { saulVModel } from './saulVModel.mjs';
19
19
  export { AppItem, getAppItemData, getAppItemText } from './gloabdata.mjs';
@@ -42,6 +42,22 @@ const showFileUrlByType = (url) => {
42
42
  }
43
43
  }
44
44
  };
45
+ const getFileDownloadUrl = (url) => {
46
+ if (url == "" || url == null || url == void 0) {
47
+ return "";
48
+ }
49
+ const match = url.match(/\.([a-zA-Z0-9]+)(?:\?|#|$)/);
50
+ const ftype = match ? match[1].toLowerCase() : "";
51
+ let fileType = getFileTypeByPath(ftype);
52
+ if (fileType != "") {
53
+ if (window.__env__.VITE_IMG_URL) {
54
+ return window.__env__.VITE_IMG_URL + url;
55
+ } else {
56
+ return url;
57
+ }
58
+ }
59
+ return "";
60
+ };
45
61
  const getFileTypeByPath = (Suffix) => {
46
62
  switch (Suffix) {
47
63
  case "doc":
@@ -84,4 +100,4 @@ const getFileTypeByPath = (Suffix) => {
84
100
  }
85
101
  };
86
102
 
87
- export { getFileUrl, showFileUrl, showFileUrlByType };
103
+ export { getFileDownloadUrl, getFileUrl, showFileUrl, showFileUrlByType };
@@ -6,4 +6,5 @@ declare const getFileUrl: (row: any) => string;
6
6
  */
7
7
  declare const showFileUrl: (url: any) => any;
8
8
  declare const showFileUrlByType: (url: any) => any;
9
- export { getFileUrl, showFileUrl, showFileUrlByType, };
9
+ declare const getFileDownloadUrl: (url: any) => any;
10
+ export { getFileUrl, showFileUrl, showFileUrlByType, getFileDownloadUrl, };
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! fmdeui-fmui v1.0.129 */
1
+ /*! fmdeui-fmui v1.0.130 */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vxe-table'), require('@vxe-ui/plugin-render-element'), require('@vxe-ui/plugin-export-xlsx'), require('vxe-pc-ui'), require('exceljs'), require('@element-plus/icons-vue'), require('vue'), require('element-plus'), require('lodash-es'), require('js-cookie'), require('pinia'), require('vue-router'), require('@vueuse/core'), require('crypto-js'), require('xlsx-js-style'), require('vue-i18n'), require('sortablejs'), require('screenfull'), require('push.js'), require('mitt'), require('@microsoft/signalr'), require('axios')) :
4
4
  typeof define === 'function' && define.amd ? define(['exports', 'vxe-table', '@vxe-ui/plugin-render-element', '@vxe-ui/plugin-export-xlsx', 'vxe-pc-ui', 'exceljs', '@element-plus/icons-vue', 'vue', 'element-plus', 'lodash-es', 'js-cookie', 'pinia', 'vue-router', '@vueuse/core', 'crypto-js', 'xlsx-js-style', 'vue-i18n', 'sortablejs', 'screenfull', 'push.js', 'mitt', '@microsoft/signalr', 'axios'], factory) :
@@ -2278,6 +2278,22 @@
2278
2278
  }
2279
2279
  }
2280
2280
  };
2281
+ const getFileDownloadUrl = (url) => {
2282
+ if (url == "" || url == null || url == void 0) {
2283
+ return "";
2284
+ }
2285
+ const match = url.match(/\.([a-zA-Z0-9]+)(?:\?|#|$)/);
2286
+ const ftype = match ? match[1].toLowerCase() : "";
2287
+ let fileType = getFileTypeByPath(ftype);
2288
+ if (fileType != "") {
2289
+ if (window.__env__.VITE_IMG_URL) {
2290
+ return window.__env__.VITE_IMG_URL + url;
2291
+ } else {
2292
+ return url;
2293
+ }
2294
+ }
2295
+ return "";
2296
+ };
2281
2297
  const getFileTypeByPath = (Suffix) => {
2282
2298
  switch (Suffix) {
2283
2299
  case "doc":
@@ -33858,6 +33874,7 @@
33858
33874
  exports.getBdate = getBdate;
33859
33875
  exports.getCountryCode = getCountryCode;
33860
33876
  exports.getEdate = getEdate;
33877
+ exports.getFileDownloadUrl = getFileDownloadUrl;
33861
33878
  exports.getFileName = getFileName;
33862
33879
  exports.getFileUrl = getFileUrl;
33863
33880
  exports.getFormItemLabel = getFormItemLabel;