@fmdeui/fmui 1.0.78 → 1.0.80

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,3 +38,4 @@ 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 fdRules(value: string, field: string): string;
@@ -1 +1,7 @@
1
1
  export declare function getlimit(value: string): any;
2
+ /**
3
+ * 获取表单字段属性
4
+ * @param value 表单字段路径
5
+ * @returns 表单字段属性
6
+ */
7
+ export declare function getFrmItemProp(path: string, 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, hAuth, hAuthAll, hAuths } from './packages/hooks/authFunction.mjs';
19
+ export { auth, authAll, auths, fdRules, 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 { getlimit } from './packages/hooks/limitsFunction.mjs';
33
+ export { getFrmItemProp, getlimit } 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';
@@ -27,6 +27,39 @@ function authDirective(app) {
27
27
  if (!flag) el.parentNode.removeChild(el);
28
28
  }
29
29
  });
30
+ app.directive("hdtable", {
31
+ mounted(el, binding) {
32
+ const stores = useUserInfo();
33
+ const config = typeof binding.value === "string" ? { path: binding.value, field: "" } : binding.value;
34
+ const item = stores.userInfos.formDesc.find((item2) => item2.path === config.path);
35
+ if (item && item.formDes.length > 0) {
36
+ const xitem = item.formDes.find((v) => v.field === config.field);
37
+ if (xitem && xitem.isTable == 0) el.parentNode.removeChild(el);
38
+ }
39
+ }
40
+ });
41
+ app.directive("hpquery", {
42
+ mounted(el, binding) {
43
+ const stores = useUserInfo();
44
+ const config = typeof binding.value === "string" ? { path: binding.value, field: "" } : binding.value;
45
+ const item = stores.userInfos.formDesc.find((item2) => item2.path === config.path);
46
+ if (item && item.formDes.length > 0) {
47
+ const xitem = item.formDes.find((v) => v.field === config.field);
48
+ if (xitem && xitem.isQuery == 0) el.parentNode.removeChild(el);
49
+ }
50
+ }
51
+ });
52
+ app.directive("hpaddupdate", {
53
+ mounted(el, binding) {
54
+ const stores = useUserInfo();
55
+ const config = typeof binding.value === "string" ? { path: binding.value, field: "" } : binding.value;
56
+ const item = stores.userInfos.formDesc.find((item2) => item2.path === config.path);
57
+ if (item && item.formDes.length > 0) {
58
+ const xitem = item.formDes.find((v) => v.field === config.field);
59
+ if (xitem && xitem.isAddUpdate == 0) el.parentNode.removeChild(el);
60
+ }
61
+ }
62
+ });
30
63
  }
31
64
 
32
65
  export { authDirective };
@@ -30,5 +30,20 @@ function hAuths(el, value) {
30
30
  function hAuthAll(el, value) {
31
31
  return withDirectives(el, [[resolveDirective("auth-all"), value]]);
32
32
  }
33
+ function fdRules(value, field) {
34
+ const stores = useUserInfo();
35
+ const item = stores.userInfos.formDesc.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: "\u8BF7\u9009\u62E9", trigger: "blur" });
42
+ if (xitem.isFromValid == 1)
43
+ rels.push({ pattern: /^[1-9]\d*$/, message: "\u8BF7\u9009\u62E9\u6240\u5C5E\u64CD\u4F5C\u90E8", trigger: "blur" });
44
+ }
45
+ }
46
+ return rels;
47
+ }
33
48
 
34
- export { auth, authAll, auths, hAuth, hAuthAll, hAuths };
49
+ export { auth, authAll, auths, fdRules, hAuth, hAuthAll, hAuths };
@@ -1,5 +1,5 @@
1
1
  export { buildLocaleContext, buildTranslator, translate, useLocale } from './useLocale.mjs';
2
- export { auth, authAll, auths, hAuth, hAuthAll, hAuths } from './authFunction.mjs';
2
+ export { auth, authAll, auths, fdRules, 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 { getlimit } from './limitsFunction.mjs';
10
+ export { getFrmItemProp, getlimit } from './limitsFunction.mjs';
@@ -7,5 +7,14 @@ function getlimit(value) {
7
7
  if (matched) return matched.limit;
8
8
  return null;
9
9
  }
10
+ function getFrmItemProp(path, field) {
11
+ const stores = useUserInfo();
12
+ const item = stores.userInfos.formDesc.find((item2) => item2.path === path);
13
+ if (item && item.formDes.length > 0) {
14
+ const xitem = item.formDes.find((v) => v.field === field);
15
+ if (xitem) return xitem.isRequired == 1 || xitem.isFromValid > 0;
16
+ }
17
+ return false;
18
+ }
10
19
 
11
- export { getlimit };
20
+ export { getFrmItemProp, getlimit };
@@ -92,6 +92,7 @@ const useUserInfo = defineStore("userInfo", {
92
92
  roles: d.roles,
93
93
  powers: d.powers,
94
94
  limits: d.limit,
95
+ formDesc: d.formDesc,
95
96
  authApiList: d.apis,
96
97
  lastChangePasswordTime: d.lastChangePasswordTime,
97
98
  time: (/* @__PURE__ */ new Date()).getTime()
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! fmdeui-fmui v1.0.78 */
1
+ /*! fmdeui-fmui v1.0.80 */
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('@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
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) :
@@ -3813,6 +3813,7 @@
3813
3813
  roles: d.roles,
3814
3814
  powers: d.powers,
3815
3815
  limits: d.limit,
3816
+ formDesc: d.formDesc,
3816
3817
  authApiList: d.apis,
3817
3818
  lastChangePasswordTime: d.lastChangePasswordTime,
3818
3819
  time: (/* @__PURE__ */ new Date()).getTime()
@@ -3922,6 +3923,39 @@
3922
3923
  if (!flag) el.parentNode.removeChild(el);
3923
3924
  }
3924
3925
  });
3926
+ app.directive("hdtable", {
3927
+ mounted(el, binding) {
3928
+ const stores = useUserInfo();
3929
+ const config = typeof binding.value === "string" ? { path: binding.value, field: "" } : binding.value;
3930
+ const item = stores.userInfos.formDesc.find((item2) => item2.path === config.path);
3931
+ if (item && item.formDes.length > 0) {
3932
+ const xitem = item.formDes.find((v) => v.field === config.field);
3933
+ if (xitem && xitem.isTable == 0) el.parentNode.removeChild(el);
3934
+ }
3935
+ }
3936
+ });
3937
+ app.directive("hpquery", {
3938
+ mounted(el, binding) {
3939
+ const stores = useUserInfo();
3940
+ const config = typeof binding.value === "string" ? { path: binding.value, field: "" } : binding.value;
3941
+ const item = stores.userInfos.formDesc.find((item2) => item2.path === config.path);
3942
+ if (item && item.formDes.length > 0) {
3943
+ const xitem = item.formDes.find((v) => v.field === config.field);
3944
+ if (xitem && xitem.isQuery == 0) el.parentNode.removeChild(el);
3945
+ }
3946
+ }
3947
+ });
3948
+ app.directive("hpaddupdate", {
3949
+ mounted(el, binding) {
3950
+ const stores = useUserInfo();
3951
+ const config = typeof binding.value === "string" ? { path: binding.value, field: "" } : binding.value;
3952
+ const item = stores.userInfos.formDesc.find((item2) => item2.path === config.path);
3953
+ if (item && item.formDes.length > 0) {
3954
+ const xitem = item.formDes.find((v) => v.field === config.field);
3955
+ if (xitem && xitem.isAddUpdate == 0) el.parentNode.removeChild(el);
3956
+ }
3957
+ }
3958
+ });
3925
3959
  }
3926
3960
 
3927
3961
  function wavesDirective(app) {
@@ -19903,6 +19937,21 @@
19903
19937
  function hAuthAll(el, value) {
19904
19938
  return vue.withDirectives(el, [[vue.resolveDirective("auth-all"), value]]);
19905
19939
  }
19940
+ function fdRules(value, field) {
19941
+ const stores = useUserInfo();
19942
+ const item = stores.userInfos.formDesc.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: "\u8BF7\u9009\u62E9", trigger: "blur" });
19949
+ if (xitem.isFromValid == 1)
19950
+ rels.push({ pattern: /^[1-9]\d*$/, message: "\u8BF7\u9009\u62E9\u6240\u5C5E\u64CD\u4F5C\u90E8", trigger: "blur" });
19951
+ }
19952
+ }
19953
+ return rels;
19954
+ }
19906
19955
 
19907
19956
  function getpower(value) {
19908
19957
  const stores = useUserInfo();
@@ -20442,6 +20491,15 @@
20442
20491
  if (matched) return matched.limit;
20443
20492
  return null;
20444
20493
  }
20494
+ function getFrmItemProp(path, field) {
20495
+ const stores = useUserInfo();
20496
+ const item = stores.userInfos.formDesc.find((item2) => item2.path === path);
20497
+ if (item && item.formDes.length > 0) {
20498
+ const xitem = item.formDes.find((v) => v.field === field);
20499
+ if (xitem) return xitem.isRequired == 1 || xitem.isFromValid > 0;
20500
+ }
20501
+ return false;
20502
+ }
20445
20503
 
20446
20504
  const _hoisted_1$s = { key: 0 };
20447
20505
  const _hoisted_2$i = { key: 0 };
@@ -30621,6 +30679,7 @@
30621
30679
  exports.downloadStreamFile = downloadStreamFile;
30622
30680
  exports.en = en;
30623
30681
  exports.exportExcel = exportExcel;
30682
+ exports.fdRules = fdRules;
30624
30683
  exports.feature = feature;
30625
30684
  exports.fileToBase64 = fileToBase64;
30626
30685
  exports.flowLoading = flowLoading;
@@ -30631,6 +30690,7 @@
30631
30690
  exports.getCountryCode = getCountryCode;
30632
30691
  exports.getFileName = getFileName;
30633
30692
  exports.getFileUrl = getFileUrl;
30693
+ exports.getFrmItemProp = getFrmItemProp;
30634
30694
  exports.getHeader = getHeader;
30635
30695
  exports.getJWTDate = getJWTDate;
30636
30696
  exports.getOpOrg = getOpOrg;