@fmdeui/fmui 1.0.127 → 1.0.129

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.
@@ -13,6 +13,10 @@ export declare const FmInputNumber: {
13
13
  type: StringConstructor;
14
14
  default: string;
15
15
  };
16
+ decimalPlaces: {
17
+ type: NumberConstructor;
18
+ default: number;
19
+ };
16
20
  modelValue: {
17
21
  type: PropType<number>;
18
22
  required: true;
@@ -27,6 +31,7 @@ export declare const FmInputNumber: {
27
31
  defaultValue: number;
28
32
  placeholder: string;
29
33
  bType: string;
34
+ decimalPlaces: number;
30
35
  }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
31
36
  P: {};
32
37
  B: {};
@@ -47,6 +52,10 @@ export declare const FmInputNumber: {
47
52
  type: StringConstructor;
48
53
  default: string;
49
54
  };
55
+ decimalPlaces: {
56
+ type: NumberConstructor;
57
+ default: number;
58
+ };
50
59
  modelValue: {
51
60
  type: PropType<number>;
52
61
  required: true;
@@ -58,6 +67,7 @@ export declare const FmInputNumber: {
58
67
  defaultValue: number;
59
68
  placeholder: string;
60
69
  bType: string;
70
+ decimalPlaces: number;
61
71
  }>;
62
72
  __isFragment?: never;
63
73
  __isTeleport?: never;
@@ -75,6 +85,10 @@ export declare const FmInputNumber: {
75
85
  type: StringConstructor;
76
86
  default: string;
77
87
  };
88
+ decimalPlaces: {
89
+ type: NumberConstructor;
90
+ default: number;
91
+ };
78
92
  modelValue: {
79
93
  type: PropType<number>;
80
94
  required: true;
@@ -89,6 +103,7 @@ export declare const FmInputNumber: {
89
103
  defaultValue: number;
90
104
  placeholder: string;
91
105
  bType: string;
106
+ decimalPlaces: number;
92
107
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
93
108
  $slots: {
94
109
  prepend?(_: {}): any;
@@ -24,6 +24,13 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
24
24
  type: StringConstructor;
25
25
  default: string;
26
26
  };
27
+ /**
28
+ * 限制小数位数
29
+ */
30
+ decimalPlaces: {
31
+ type: NumberConstructor;
32
+ default: number;
33
+ };
27
34
  modelValue: {
28
35
  type: PropType<number>;
29
36
  required: true;
@@ -44,6 +51,13 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
44
51
  type: StringConstructor;
45
52
  default: string;
46
53
  };
54
+ /**
55
+ * 限制小数位数
56
+ */
57
+ decimalPlaces: {
58
+ type: NumberConstructor;
59
+ default: number;
60
+ };
47
61
  modelValue: {
48
62
  type: PropType<number>;
49
63
  required: true;
@@ -55,6 +69,7 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
55
69
  defaultValue: number;
56
70
  placeholder: string;
57
71
  bType: string;
72
+ decimalPlaces: number;
58
73
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
59
74
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
60
75
  export default _default;
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 } from './packages/utils/uploadfileurl.mjs';
33
+ export { 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';
@@ -15,6 +15,13 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
15
15
  bType: {
16
16
  type: String,
17
17
  default: "money"
18
+ },
19
+ /**
20
+ * 限制小数位数
21
+ */
22
+ decimalPlaces: {
23
+ type: Number,
24
+ default: 2
18
25
  }
19
26
  }, {
20
27
  "modelValue": { required: true, default: 0 },
@@ -55,7 +62,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
55
62
  cleaned = parts.join(".");
56
63
  if (cleaned.includes(".")) {
57
64
  const [intPart, decPart] = cleaned.split(".");
58
- cleaned = `${intPart}.${decPart.substring(0, 2)}`;
65
+ cleaned = `${intPart}.${decPart.substring(0, props.decimalPlaces)}`;
59
66
  }
60
67
  modelValue.value = cleaned;
61
68
  emit("handleInput", cleaned);
@@ -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 } from './uploadfileurl.mjs';
16
+ export { 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';
@@ -18,5 +18,70 @@ const showFileUrl = (url) => {
18
18
  return url;
19
19
  }
20
20
  };
21
+ const showFileUrlByType = (url) => {
22
+ if (url == "" || url == null || url == void 0) {
23
+ return "";
24
+ }
25
+ if (url == "logo.png" || url.includes("base64,") > 0) {
26
+ return url;
27
+ }
28
+ const match = url.match(/\.([a-zA-Z0-9]+)(?:\?|#|$)/);
29
+ const ftype = match ? match[1].toLowerCase() : "";
30
+ let fileType = getFileTypeByPath(ftype);
31
+ if (fileType == "") {
32
+ if (window.__env__.VITE_IMG_URL) {
33
+ return window.__env__.VITE_IMG_URL + url;
34
+ } else {
35
+ return url;
36
+ }
37
+ } else {
38
+ if (window.__env__.VITE_IMG_URL) {
39
+ return window.__env__.VITE_IMG_URL + fileType;
40
+ } else {
41
+ return fileType;
42
+ }
43
+ }
44
+ };
45
+ const getFileTypeByPath = (Suffix) => {
46
+ switch (Suffix) {
47
+ case "doc":
48
+ case "docx":
49
+ return "filetype/word.png";
50
+ break;
51
+ case "xls":
52
+ case "xlsx":
53
+ return "filetype/Excel.png";
54
+ break;
55
+ case "ppt":
56
+ case "pptx":
57
+ return "filetype/ppt.png";
58
+ break;
59
+ case "pdf":
60
+ return "filetype/pdf.png";
61
+ break;
62
+ case "txt":
63
+ return "filetype/txt.png";
64
+ break;
65
+ case "mp3":
66
+ return "filetype/mp3.png";
67
+ break;
68
+ case "mp4":
69
+ case "avi":
70
+ case "wmv":
71
+ return "filetype/video.png";
72
+ break;
73
+ case "zip":
74
+ case "rar":
75
+ case "7z":
76
+ case "gz":
77
+ case "bz2":
78
+ case "tar":
79
+ return "filetype/zip.png";
80
+ break;
81
+ default:
82
+ return "";
83
+ break;
84
+ }
85
+ };
21
86
 
22
- export { getFileUrl, showFileUrl };
87
+ export { getFileUrl, showFileUrl, showFileUrlByType };
@@ -5,4 +5,5 @@ declare const getFileUrl: (row: any) => string;
5
5
  * @returns
6
6
  */
7
7
  declare const showFileUrl: (url: any) => any;
8
- export { getFileUrl, showFileUrl, };
8
+ declare const showFileUrlByType: (url: any) => any;
9
+ export { getFileUrl, showFileUrl, showFileUrlByType, };
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! fmdeui-fmui v1.0.127 */
1
+ /*! fmdeui-fmui v1.0.129 */
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) :
@@ -2254,6 +2254,62 @@
2254
2254
  return url;
2255
2255
  }
2256
2256
  };
2257
+ const showFileUrlByType = (url) => {
2258
+ if (url == "" || url == null || url == void 0) {
2259
+ return "";
2260
+ }
2261
+ if (url == "logo.png" || url.includes("base64,") > 0) {
2262
+ return url;
2263
+ }
2264
+ const match = url.match(/\.([a-zA-Z0-9]+)(?:\?|#|$)/);
2265
+ const ftype = match ? match[1].toLowerCase() : "";
2266
+ let fileType = getFileTypeByPath(ftype);
2267
+ if (fileType == "") {
2268
+ if (window.__env__.VITE_IMG_URL) {
2269
+ return window.__env__.VITE_IMG_URL + url;
2270
+ } else {
2271
+ return url;
2272
+ }
2273
+ } else {
2274
+ if (window.__env__.VITE_IMG_URL) {
2275
+ return window.__env__.VITE_IMG_URL + fileType;
2276
+ } else {
2277
+ return fileType;
2278
+ }
2279
+ }
2280
+ };
2281
+ const getFileTypeByPath = (Suffix) => {
2282
+ switch (Suffix) {
2283
+ case "doc":
2284
+ case "docx":
2285
+ return "filetype/word.png";
2286
+ case "xls":
2287
+ case "xlsx":
2288
+ return "filetype/Excel.png";
2289
+ case "ppt":
2290
+ case "pptx":
2291
+ return "filetype/ppt.png";
2292
+ case "pdf":
2293
+ return "filetype/pdf.png";
2294
+ case "txt":
2295
+ return "filetype/txt.png";
2296
+ case "mp3":
2297
+ return "filetype/mp3.png";
2298
+ case "mp4":
2299
+ case "avi":
2300
+ case "wmv":
2301
+ return "filetype/video.png";
2302
+ case "zip":
2303
+ case "rar":
2304
+ case "7z":
2305
+ case "gz":
2306
+ case "bz2":
2307
+ case "tar":
2308
+ return "filetype/zip.png";
2309
+ default:
2310
+ return "";
2311
+ }
2312
+ };
2257
2313
 
2258
2314
  const Local = {
2259
2315
  // 查看 v2.4.3版本更新日志
@@ -27305,6 +27361,13 @@
27305
27361
  bType: {
27306
27362
  type: String,
27307
27363
  default: "money"
27364
+ },
27365
+ /**
27366
+ * 限制小数位数
27367
+ */
27368
+ decimalPlaces: {
27369
+ type: Number,
27370
+ default: 2
27308
27371
  }
27309
27372
  }, {
27310
27373
  "modelValue": { required: true, default: 0 },
@@ -27345,7 +27408,7 @@
27345
27408
  cleaned = parts.join(".");
27346
27409
  if (cleaned.includes(".")) {
27347
27410
  const [intPart, decPart] = cleaned.split(".");
27348
- cleaned = `${intPart}.${decPart.substring(0, 2)}`;
27411
+ cleaned = `${intPart}.${decPart.substring(0, props.decimalPlaces)}`;
27349
27412
  }
27350
27413
  modelValue.value = cleaned;
27351
27414
  emit("handleInput", cleaned);
@@ -33856,6 +33919,7 @@
33856
33919
  exports.setJsCdn = setJsCdn;
33857
33920
  exports.setupI18n = setupI18n;
33858
33921
  exports.showFileUrl = showFileUrl;
33922
+ exports.showFileUrlByType = showFileUrlByType;
33859
33923
  exports.showTabelColumn = showTabelColumn;
33860
33924
  exports.signalR = signalR;
33861
33925
  exports.signatureByKSort = signatureByKSort;