@fmdeui/fmui 1.0.84 → 1.0.86

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.
@@ -38,4 +38,3 @@ export declare function hAuths<T extends VNode>(el: T, value: Array<string>): T;
38
38
  * @returns VNode
39
39
  */
40
40
  export declare function hAuthAll<T extends VNode>(el: T, value: Array<string>): T;
41
- export declare function getRules(value: string, field: string, msg: string): string;
@@ -1,8 +1,27 @@
1
1
  export declare function getlimit(value: string): any;
2
+ /**
3
+ * 获取表单字段验证规则
4
+ * @param field 表单字段
5
+ * @param msg 验证提示
6
+ * @returns 验证规则
7
+ */
8
+ export declare function getRules(field: string, msg: string): string;
2
9
  /**
3
10
  * 获取表单字段属性
4
- * @param value 表单字段路径
11
+ * @param field 表单字段
5
12
  * @returns 表单字段属性
6
13
  */
7
- export declare function getFormItemProp(path: string, field: string): string;
8
- export declare function getFormItemLabel(path: string, field: string, defaultValue: string): string;
14
+ export declare function getFormItemProp(field: string): string;
15
+ /**
16
+ * 获取表单字段标签
17
+ * @param field 表单字段
18
+ * @param defaultValue 默认值
19
+ * @returns 表单字段标签
20
+ */
21
+ export declare function getFormItemLabel(field: string, defaultValue: string): string;
22
+ /**
23
+ * 获取表格字段是否显示
24
+ * @param field 表格字段
25
+ * @returns 表格字段是否显示
26
+ */
27
+ export declare function showTabelColumn(field: string): boolean;
package/es/index.mjs CHANGED
@@ -16,7 +16,7 @@ export { Local, Session } from './packages/utils/storage.mjs';
16
16
  export { NextLoading } from './packages/utils/loading.mjs';
17
17
  export { StringToObj } from './packages/utils/json-utils.mjs';
18
18
  export { accessTokenKey, axiosInstance, cancelAllRequest, cancelRequest, clearAccessTokens, clearTokens, decryptJWT, getHeader, getJWTDate, getToken, reLoadLoginAccessToken, refreshAccessTokenKey, request2, default as service, sleep, tansParams } from './packages/utils/request.mjs';
19
- export { auth, authAll, auths, getRules, hAuth, hAuthAll, hAuths } from './packages/hooks/authFunction.mjs';
19
+ export { auth, authAll, auths, hAuth, hAuthAll, hAuths } from './packages/hooks/authFunction.mjs';
20
20
  export { base64ToFile, blobToFile, dataURLtoBlob, fileToBase64, urlToBase64 } from './packages/utils/base64Conver.mjs';
21
21
  export { buildLocaleContext, buildTranslator, translate, useLocale } from './packages/hooks/useLocale.mjs';
22
22
  export { clone, isObjectValueEqual, judgementSameArr, removeDuplicate } from './packages/utils/arrayOperation.mjs';
@@ -30,7 +30,7 @@ export { flowLoading } from './packages/utils/flowLoading.mjs';
30
30
  export { formatAxis, formatDate, formatPast, getWeek } from './packages/utils/formatTime.mjs';
31
31
  export { gcj02ToBd09, wgs84ToBd09, wgs84ToGcj02 } from './packages/utils/gpsConvertor.mjs';
32
32
  export { getFileUrl, showFileUrl } from './packages/utils/uploadfileurl.mjs';
33
- export { getFormItemLabel, getFormItemProp, getlimit } from './packages/hooks/limitsFunction.mjs';
33
+ export { getFormItemLabel, getFormItemProp, getRules, getlimit, showTabelColumn } from './packages/hooks/limitsFunction.mjs';
34
34
  export { getpower, powerAuthDel } from './packages/hooks/powerFunction.mjs';
35
35
  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';
36
36
  export { loadSysInfo, updateFavicon } from './packages/hooks/sysInfo.mjs';
@@ -1,3 +1,4 @@
1
+ import { useRoute } from 'vue-router';
1
2
  import { useUserInfo } from '../stores/userInfo.mjs';
2
3
  import { judgementSameArr } from '../utils/arrayOperation.mjs';
3
4
 
@@ -30,10 +31,10 @@ function authDirective(app) {
30
31
  app.directive("hdtable", {
31
32
  mounted(el, binding) {
32
33
  const stores = useUserInfo();
33
- const config = typeof binding.value === "string" ? { path: binding.value, field: "" } : binding.value;
34
- const item = stores.userInfos.formDes.find((item2) => item2.path === config.path);
34
+ const route = useRoute();
35
+ const item = stores.userInfos.formDes.find((item2) => item2.path === route.path);
35
36
  if (item && item.formDes.length > 0) {
36
- const xitem = item.formDes.find((v) => v.field === config.field);
37
+ const xitem = item.formDes.find((v) => v.field === binding.value);
37
38
  if (xitem && xitem.isTable == 0) el.parentNode.removeChild(el);
38
39
  }
39
40
  }
@@ -41,10 +42,10 @@ function authDirective(app) {
41
42
  app.directive("hpquery", {
42
43
  mounted(el, binding) {
43
44
  const stores = useUserInfo();
44
- const config = typeof binding.value === "string" ? { path: binding.value, field: "" } : binding.value;
45
- const item = stores.userInfos.formDes.find((item2) => item2.path === config.path);
45
+ const route = useRoute();
46
+ const item = stores.userInfos.formDes.find((item2) => item2.path === route.path);
46
47
  if (item && item.formDes.length > 0) {
47
- const xitem = item.formDes.find((v) => v.field === config.field);
48
+ const xitem = item.formDes.find((v) => v.field === binding.value);
48
49
  if (xitem && xitem.isQuery == 0) el.parentNode.removeChild(el);
49
50
  }
50
51
  }
@@ -52,10 +53,10 @@ function authDirective(app) {
52
53
  app.directive("hpaddupdate", {
53
54
  mounted(el, binding) {
54
55
  const stores = useUserInfo();
55
- const config = typeof binding.value === "string" ? { path: binding.value, field: "" } : binding.value;
56
- const item = stores.userInfos.formDes.find((item2) => item2.path === config.path);
56
+ const route = useRoute();
57
+ const item = stores.userInfos.formDes.find((item2) => item2.path === route.path);
57
58
  if (item && item.formDes.length > 0) {
58
- const xitem = item.formDes.find((v) => v.field === config.field);
59
+ const xitem = item.formDes.find((v) => v.field === binding.value);
59
60
  if (xitem && xitem.isAddUpdate == 0) el.parentNode.removeChild(el);
60
61
  }
61
62
  }
@@ -30,20 +30,5 @@ function hAuths(el, value) {
30
30
  function hAuthAll(el, value) {
31
31
  return withDirectives(el, [[resolveDirective("auth-all"), value]]);
32
32
  }
33
- function getRules(value, field, msg) {
34
- const stores = useUserInfo();
35
- const item = stores.userInfos.formDes.find((item2) => item2.path === value);
36
- let rels = [];
37
- if (item && item.formDes.length > 0) {
38
- const xitem = item.formDes.find((v) => v.field === field);
39
- if (xitem) {
40
- if (xitem.isRequired == 1)
41
- rels.push({ required: true, message: msg, trigger: "blur" });
42
- if (xitem.isFromValid == 1)
43
- rels.push({ pattern: /^[1-9]\d*$/, message: msg, trigger: "blur" });
44
- }
45
- }
46
- return rels;
47
- }
48
33
 
49
- export { auth, authAll, auths, getRules, hAuth, hAuthAll, hAuths };
34
+ export { auth, authAll, auths, hAuth, hAuthAll, hAuths };
@@ -1,5 +1,5 @@
1
1
  export { buildLocaleContext, buildTranslator, translate, useLocale } from './useLocale.mjs';
2
- export { auth, authAll, auths, getRules, hAuth, hAuthAll, hAuths } from './authFunction.mjs';
2
+ export { auth, authAll, auths, hAuth, hAuthAll, hAuths } from './authFunction.mjs';
3
3
  export { getpower, powerAuthDel } from './powerFunction.mjs';
4
4
  export { useVxeTable } from './useVxeTableOptionsHook.mjs';
5
5
  export { loadSysInfo, updateFavicon } from './sysInfo.mjs';
@@ -7,4 +7,4 @@ export { cmpId, depId, getOpOrg, groupId, hasPrivilege, hasRoleCode, isAdmin, is
7
7
  export { useDateTimeShortCust } from './dateTimeShortCust.mjs';
8
8
  export { destroyIdleTimeout, initIdleTimeout, updateIdleTimeout } from './idleTimeout.mjs';
9
9
  export { provideFormEvents, useFormEvents } from './composables/useDialogEvents.mjs';
10
- export { getFormItemLabel, getFormItemProp, getlimit } from './limitsFunction.mjs';
10
+ export { getFormItemLabel, getFormItemProp, getRules, getlimit, showTabelColumn } from './limitsFunction.mjs';
@@ -1,4 +1,5 @@
1
1
  import '../stores/index.mjs';
2
+ import { useRoute } from 'vue-router';
2
3
  import { useUserInfo } from '../stores/userInfo.mjs';
3
4
 
4
5
  function getlimit(value) {
@@ -7,23 +8,56 @@ function getlimit(value) {
7
8
  if (matched) return matched.limit;
8
9
  return null;
9
10
  }
10
- function getFormItemProp(path, field) {
11
+ function getRules(field, msg) {
11
12
  const stores = useUserInfo();
12
- const item = stores.userInfos.formDes.find((item2) => item2.path === path);
13
+ const route = useRoute();
14
+ const item = stores.userInfos.formDes.find((item2) => item2.path === route.path);
15
+ let rels = [];
16
+ if (item && item.formDes.length > 0) {
17
+ const xitem = item.formDes.find((v) => v.field === field);
18
+ if (xitem) {
19
+ if (xitem.isRequired == 1)
20
+ rels.push({ required: true, message: msg, trigger: "blur" });
21
+ if (xitem.isFromValid == 1)
22
+ rels.push({ pattern: /^[1-9]\d*$/, message: msg, trigger: "blur" });
23
+ }
24
+ }
25
+ return rels;
26
+ }
27
+ function getFormItemProp(field) {
28
+ const stores = useUserInfo();
29
+ const route = useRoute();
30
+ const item = stores.userInfos.formDes.find((item2) => item2.path === route.path);
13
31
  if (item && item.formDes.length > 0) {
14
32
  const xitem = item.formDes.find((v) => v.field === field);
15
33
  if (xitem) return xitem.isRequired == 1 || xitem.isFromValid > 0 ? field : "";
16
34
  }
17
35
  return "";
18
36
  }
19
- function getFormItemLabel(path, field, defaultValue) {
37
+ function getFormItemLabel(field, defaultValue) {
20
38
  const stores = useUserInfo();
21
- const item = stores.userInfos.formDes.find((item2) => item2.path === path);
39
+ const route = useRoute();
40
+ const item = stores.userInfos.formDes.find((item2) => item2.path === route.path);
22
41
  if (item && item.formDes.length > 0) {
23
42
  const xitem = item.formDes.find((v) => v.field === field);
24
43
  if (xitem) return xitem.title && xitem.title != "" ? xitem.title : defaultValue;
25
44
  }
26
45
  return defaultValue;
27
46
  }
47
+ function showTabelColumn(field) {
48
+ const stores = useUserInfo();
49
+ const route = useRoute();
50
+ const item = stores.userInfos.formDes.find((item2) => item2.path === route.path);
51
+ if (item && item.formDes.length > 0) {
52
+ const xitem = item.formDes.find((v) => v.field === field);
53
+ if (xitem) {
54
+ if (xitem.isTable == 1)
55
+ return true;
56
+ else if (xitem.isTable == 0)
57
+ return false;
58
+ }
59
+ }
60
+ return true;
61
+ }
28
62
 
29
- export { getFormItemLabel, getFormItemProp, getlimit };
63
+ export { getFormItemLabel, getFormItemProp, getRules, getlimit, showTabelColumn };
package/index.js CHANGED
@@ -1,9 +1,9 @@
1
- /*! fmdeui-fmui v1.0.84 */
1
+ /*! fmdeui-fmui v1.0.86 */
2
2
  (function (global, factory) {
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('@vueuse/core'), require('crypto-js'), require('xlsx-js-style'), require('vue-i18n'), require('vue-router'), require('sortablejs'), require('screenfull'), require('push.js'), require('mitt'), require('@microsoft/signalr'), require('axios')) :
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', '@vueuse/core', 'crypto-js', 'xlsx-js-style', 'vue-i18n', 'vue-router', 'sortablejs', 'screenfull', 'push.js', 'mitt', '@microsoft/signalr', 'axios'], factory) :
5
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.fmdeuifmui = {}, global.VxeUITable, global.VxeUIPluginRenderElement, global.VxeUIPluginExportXLSX, global.VxeUIExport, global.ExcelJS, global.ElementPlusIconsVue, global.Vue, global.ElementPlus, global._, global.Cookies, global.Pinia, global.VueUse, global.CryptoJS, global.XLSX, global.vueI18n, global.vueRouter, global.Sortable, global.screenfull, global.Push, global.mitt, global.SignalR, global.axios));
6
- })(this, (function (exports, VxeUITable, VxeUIPluginRenderElement, VxeUIPluginExportXLSX, VxeUI, ExcelJS, svg, vue, elementPlus, lodashEs, Cookies, pinia$1, core, CryptoJS, XLSXS, vueI18n, vueRouter, Sortable, screenfull, Push, mitt, SignalR, axios) { 'use strict';
3
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue-router'), 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('@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
+ typeof define === 'function' && define.amd ? define(['exports', 'vue-router', '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', '@vueuse/core', 'crypto-js', 'xlsx-js-style', 'vue-i18n', 'sortablejs', 'screenfull', 'push.js', 'mitt', '@microsoft/signalr', 'axios'], factory) :
5
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.fmdeuifmui = {}, global.vueRouter, global.VxeUITable, global.VxeUIPluginRenderElement, global.VxeUIPluginExportXLSX, global.VxeUIExport, global.ExcelJS, global.ElementPlusIconsVue, global.Vue, global.ElementPlus, global._, global.Cookies, global.Pinia, global.VueUse, global.CryptoJS, global.XLSX, global.vueI18n, global.Sortable, global.screenfull, global.Push, global.mitt, global.SignalR, global.axios));
6
+ })(this, (function (exports, vueRouter, VxeUITable, VxeUIPluginRenderElement, VxeUIPluginExportXLSX, VxeUI, ExcelJS, svg, vue, elementPlus, lodashEs, Cookies, pinia$1, core, CryptoJS, XLSXS, vueI18n, Sortable, screenfull, Push, mitt, SignalR, axios) { 'use strict';
7
7
 
8
8
  function _interopNamespaceDefault(e) {
9
9
  var n = Object.create(null);
@@ -3926,10 +3926,10 @@
3926
3926
  app.directive("hdtable", {
3927
3927
  mounted(el, binding) {
3928
3928
  const stores = useUserInfo();
3929
- const config = typeof binding.value === "string" ? { path: binding.value, field: "" } : binding.value;
3930
- const item = stores.userInfos.formDes.find((item2) => item2.path === config.path);
3929
+ const route = vueRouter.useRoute();
3930
+ const item = stores.userInfos.formDes.find((item2) => item2.path === route.path);
3931
3931
  if (item && item.formDes.length > 0) {
3932
- const xitem = item.formDes.find((v) => v.field === config.field);
3932
+ const xitem = item.formDes.find((v) => v.field === binding.value);
3933
3933
  if (xitem && xitem.isTable == 0) el.parentNode.removeChild(el);
3934
3934
  }
3935
3935
  }
@@ -3937,10 +3937,10 @@
3937
3937
  app.directive("hpquery", {
3938
3938
  mounted(el, binding) {
3939
3939
  const stores = useUserInfo();
3940
- const config = typeof binding.value === "string" ? { path: binding.value, field: "" } : binding.value;
3941
- const item = stores.userInfos.formDes.find((item2) => item2.path === config.path);
3940
+ const route = vueRouter.useRoute();
3941
+ const item = stores.userInfos.formDes.find((item2) => item2.path === route.path);
3942
3942
  if (item && item.formDes.length > 0) {
3943
- const xitem = item.formDes.find((v) => v.field === config.field);
3943
+ const xitem = item.formDes.find((v) => v.field === binding.value);
3944
3944
  if (xitem && xitem.isQuery == 0) el.parentNode.removeChild(el);
3945
3945
  }
3946
3946
  }
@@ -3948,10 +3948,10 @@
3948
3948
  app.directive("hpaddupdate", {
3949
3949
  mounted(el, binding) {
3950
3950
  const stores = useUserInfo();
3951
- const config = typeof binding.value === "string" ? { path: binding.value, field: "" } : binding.value;
3952
- const item = stores.userInfos.formDes.find((item2) => item2.path === config.path);
3951
+ const route = vueRouter.useRoute();
3952
+ const item = stores.userInfos.formDes.find((item2) => item2.path === route.path);
3953
3953
  if (item && item.formDes.length > 0) {
3954
- const xitem = item.formDes.find((v) => v.field === config.field);
3954
+ const xitem = item.formDes.find((v) => v.field === binding.value);
3955
3955
  if (xitem && xitem.isAddUpdate == 0) el.parentNode.removeChild(el);
3956
3956
  }
3957
3957
  }
@@ -19937,21 +19937,6 @@
19937
19937
  function hAuthAll(el, value) {
19938
19938
  return vue.withDirectives(el, [[vue.resolveDirective("auth-all"), value]]);
19939
19939
  }
19940
- function getRules(value, field, msg) {
19941
- const stores = useUserInfo();
19942
- const item = stores.userInfos.formDes.find((item2) => item2.path === value);
19943
- let rels = [];
19944
- if (item && item.formDes.length > 0) {
19945
- const xitem = item.formDes.find((v) => v.field === field);
19946
- if (xitem) {
19947
- if (xitem.isRequired == 1)
19948
- rels.push({ required: true, message: msg, trigger: "blur" });
19949
- if (xitem.isFromValid == 1)
19950
- rels.push({ pattern: /^[1-9]\d*$/, message: msg, trigger: "blur" });
19951
- }
19952
- }
19953
- return rels;
19954
- }
19955
19940
 
19956
19941
  function getpower(value) {
19957
19942
  const stores = useUserInfo();
@@ -20491,24 +20476,57 @@
20491
20476
  if (matched) return matched.limit;
20492
20477
  return null;
20493
20478
  }
20494
- function getFormItemProp(path, field) {
20479
+ function getRules(field, msg) {
20480
+ const stores = useUserInfo();
20481
+ const route = vueRouter.useRoute();
20482
+ const item = stores.userInfos.formDes.find((item2) => item2.path === route.path);
20483
+ let rels = [];
20484
+ if (item && item.formDes.length > 0) {
20485
+ const xitem = item.formDes.find((v) => v.field === field);
20486
+ if (xitem) {
20487
+ if (xitem.isRequired == 1)
20488
+ rels.push({ required: true, message: msg, trigger: "blur" });
20489
+ if (xitem.isFromValid == 1)
20490
+ rels.push({ pattern: /^[1-9]\d*$/, message: msg, trigger: "blur" });
20491
+ }
20492
+ }
20493
+ return rels;
20494
+ }
20495
+ function getFormItemProp(field) {
20495
20496
  const stores = useUserInfo();
20496
- const item = stores.userInfos.formDes.find((item2) => item2.path === path);
20497
+ const route = vueRouter.useRoute();
20498
+ const item = stores.userInfos.formDes.find((item2) => item2.path === route.path);
20497
20499
  if (item && item.formDes.length > 0) {
20498
20500
  const xitem = item.formDes.find((v) => v.field === field);
20499
20501
  if (xitem) return xitem.isRequired == 1 || xitem.isFromValid > 0 ? field : "";
20500
20502
  }
20501
20503
  return "";
20502
20504
  }
20503
- function getFormItemLabel(path, field, defaultValue) {
20505
+ function getFormItemLabel(field, defaultValue) {
20504
20506
  const stores = useUserInfo();
20505
- const item = stores.userInfos.formDes.find((item2) => item2.path === path);
20507
+ const route = vueRouter.useRoute();
20508
+ const item = stores.userInfos.formDes.find((item2) => item2.path === route.path);
20506
20509
  if (item && item.formDes.length > 0) {
20507
20510
  const xitem = item.formDes.find((v) => v.field === field);
20508
20511
  if (xitem) return xitem.title && xitem.title != "" ? xitem.title : defaultValue;
20509
20512
  }
20510
20513
  return defaultValue;
20511
20514
  }
20515
+ function showTabelColumn(field) {
20516
+ const stores = useUserInfo();
20517
+ const route = vueRouter.useRoute();
20518
+ const item = stores.userInfos.formDes.find((item2) => item2.path === route.path);
20519
+ if (item && item.formDes.length > 0) {
20520
+ const xitem = item.formDes.find((v) => v.field === field);
20521
+ if (xitem) {
20522
+ if (xitem.isTable == 1)
20523
+ return true;
20524
+ else if (xitem.isTable == 0)
20525
+ return false;
20526
+ }
20527
+ }
20528
+ return true;
20529
+ }
20512
20530
 
20513
20531
  const _hoisted_1$s = { key: 0 };
20514
20532
  const _hoisted_2$i = { key: 0 };
@@ -30754,6 +30772,7 @@
30754
30772
  exports.setJsCdn = setJsCdn;
30755
30773
  exports.setupI18n = setupI18n;
30756
30774
  exports.showFileUrl = showFileUrl;
30775
+ exports.showTabelColumn = showTabelColumn;
30757
30776
  exports.signalR = signalR;
30758
30777
  exports.signatureByKSort = signatureByKSort;
30759
30778
  exports.sleep = sleep;