@fmdeui/fmui 1.0.79 → 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,4 +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): string;
41
+ export declare function fdRules(value: string, field: string): string;
@@ -4,4 +4,4 @@ export declare function getlimit(value: string): any;
4
4
  * @param value 表单字段路径
5
5
  * @returns 表单字段属性
6
6
  */
7
- export declare function getFrmItemProp(value: string): boolean;
7
+ export declare function getFrmItemProp(path: string, field: string): boolean;
@@ -30,22 +30,34 @@ function authDirective(app) {
30
30
  app.directive("hdtable", {
31
31
  mounted(el, binding) {
32
32
  const stores = useUserInfo();
33
- const item = stores.userInfos.formDesc.find((item2) => item2.path === binding.value);
34
- if (item && item.isTable == 0) el.parentNode.removeChild(el);
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
+ }
35
39
  }
36
40
  });
37
41
  app.directive("hpquery", {
38
42
  mounted(el, binding) {
39
43
  const stores = useUserInfo();
40
- const item = stores.userInfos.formDesc.find((item2) => item2.path === binding.value);
41
- if (item && item.isQuery == 0) el.parentNode.removeChild(el);
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
+ }
42
50
  }
43
51
  });
44
52
  app.directive("hpaddupdate", {
45
53
  mounted(el, binding) {
46
54
  const stores = useUserInfo();
47
- const item = stores.userInfos.formDesc.find((item2) => item2.path === binding.value);
48
- if (item && item.isAddUpdate == 0) el.parentNode.removeChild(el);
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
+ }
49
61
  }
50
62
  });
51
63
  }
@@ -30,14 +30,19 @@ 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) {
33
+ function fdRules(value, field) {
34
34
  const stores = useUserInfo();
35
35
  const item = stores.userInfos.formDesc.find((item2) => item2.path === value);
36
36
  let rels = [];
37
- if (item && item.isRequired == 1)
38
- rels.push({ required: true, message: "\u8BF7\u9009\u62E9", trigger: "blur" });
39
- if (item && item.isFromValid == 1)
40
- rels.push({ pattern: /^[1-9]\d*$/, message: "\u8BF7\u9009\u62E9\u6240\u5C5E\u64CD\u4F5C\u90E8", trigger: "blur" });
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
+ }
41
46
  return rels;
42
47
  }
43
48
 
@@ -7,10 +7,13 @@ function getlimit(value) {
7
7
  if (matched) return matched.limit;
8
8
  return null;
9
9
  }
10
- function getFrmItemProp(value) {
10
+ function getFrmItemProp(path, field) {
11
11
  const stores = useUserInfo();
12
- const item = stores.userInfos.formDesc.find((item2) => item2.path === value);
13
- if (item) return item.isRequired == 1 || item.isFromValid > 0;
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
+ }
14
17
  return false;
15
18
  }
16
19
 
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! fmdeui-fmui v1.0.79 */
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) :
@@ -3926,22 +3926,34 @@
3926
3926
  app.directive("hdtable", {
3927
3927
  mounted(el, binding) {
3928
3928
  const stores = useUserInfo();
3929
- const item = stores.userInfos.formDesc.find((item2) => item2.path === binding.value);
3930
- if (item && item.isTable == 0) el.parentNode.removeChild(el);
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
+ }
3931
3935
  }
3932
3936
  });
3933
3937
  app.directive("hpquery", {
3934
3938
  mounted(el, binding) {
3935
3939
  const stores = useUserInfo();
3936
- const item = stores.userInfos.formDesc.find((item2) => item2.path === binding.value);
3937
- if (item && item.isQuery == 0) el.parentNode.removeChild(el);
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
+ }
3938
3946
  }
3939
3947
  });
3940
3948
  app.directive("hpaddupdate", {
3941
3949
  mounted(el, binding) {
3942
3950
  const stores = useUserInfo();
3943
- const item = stores.userInfos.formDesc.find((item2) => item2.path === binding.value);
3944
- if (item && item.isAddUpdate == 0) el.parentNode.removeChild(el);
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
+ }
3945
3957
  }
3946
3958
  });
3947
3959
  }
@@ -19925,14 +19937,19 @@
19925
19937
  function hAuthAll(el, value) {
19926
19938
  return vue.withDirectives(el, [[vue.resolveDirective("auth-all"), value]]);
19927
19939
  }
19928
- function fdRules(value) {
19940
+ function fdRules(value, field) {
19929
19941
  const stores = useUserInfo();
19930
19942
  const item = stores.userInfos.formDesc.find((item2) => item2.path === value);
19931
19943
  let rels = [];
19932
- if (item && item.isRequired == 1)
19933
- rels.push({ required: true, message: "\u8BF7\u9009\u62E9", trigger: "blur" });
19934
- if (item && item.isFromValid == 1)
19935
- rels.push({ pattern: /^[1-9]\d*$/, message: "\u8BF7\u9009\u62E9\u6240\u5C5E\u64CD\u4F5C\u90E8", trigger: "blur" });
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
+ }
19936
19953
  return rels;
19937
19954
  }
19938
19955
 
@@ -20474,10 +20491,13 @@
20474
20491
  if (matched) return matched.limit;
20475
20492
  return null;
20476
20493
  }
20477
- function getFrmItemProp(value) {
20494
+ function getFrmItemProp(path, field) {
20478
20495
  const stores = useUserInfo();
20479
- const item = stores.userInfos.formDesc.find((item2) => item2.path === value);
20480
- if (item) return item.isRequired == 1 || item.isFromValid > 0;
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
+ }
20481
20501
  return false;
20482
20502
  }
20483
20503