@ibiz-template/vue3-components 0.7.15 → 0.7.16

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.
Files changed (54) hide show
  1. package/dist/index-8VqjTY2N.js +4 -0
  2. package/dist/{index-Hg_8xCYx.js → index-B_FGiHpY.js} +1 -1
  3. package/dist/{index-8Lu2Ax-_.js → index-Q8y2iWnX.js} +1 -1
  4. package/dist/index.min.css +1 -1
  5. package/dist/index.system.min.js +1 -1
  6. package/dist/{xlsx-util-5nNxB32e.js → xlsx-util-AIEyudtA.js} +1 -1
  7. package/es/control/drbar/drbar.controller.d.ts +24 -0
  8. package/es/control/drbar/drbar.controller.mjs +107 -13
  9. package/es/control/drbar/drbar.mjs +3 -2
  10. package/es/control/drtab/drtab.controller.d.ts +39 -0
  11. package/es/control/drtab/drtab.controller.mjs +112 -5
  12. package/es/control/drtab/drtab.mjs +3 -2
  13. package/es/control/grid/grid-column/grid-field-column/grid-field-column.d.ts +0 -1
  14. package/es/control/grid/grid-column/grid-field-column/grid-field-column.mjs +4 -8
  15. package/es/control/grid/grid-column/grid-field-column/index.d.ts +0 -1
  16. package/es/editor/autocomplete/autocomplete-editor.controller.d.ts +9 -1
  17. package/es/editor/autocomplete/autocomplete-editor.controller.mjs +12 -1
  18. package/es/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.mjs +8 -1
  19. package/es/editor/data-picker/ibiz-mpicker/ibiz-mpicker.mjs +13 -2
  20. package/es/editor/data-picker/ibiz-picker/ibiz-picker.mjs +11 -1
  21. package/es/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.mjs +13 -2
  22. package/es/editor/data-picker/picker-editor.controller.d.ts +9 -1
  23. package/es/editor/data-picker/picker-editor.controller.mjs +12 -1
  24. package/es/editor/list-box/ibiz-list-box/ibiz-list-box.mjs +27 -7
  25. package/es/editor/list-box/list-box-picker-editor.controller.d.ts +18 -2
  26. package/es/editor/list-box/list-box-picker-editor.controller.mjs +29 -1
  27. package/es/locale/en/index.d.ts +1 -0
  28. package/es/locale/en/index.mjs +2 -1
  29. package/es/locale/index.d.ts +72 -1
  30. package/es/locale/index.mjs +64 -1
  31. package/es/locale/zh-CN/index.d.ts +1 -0
  32. package/es/locale/zh-CN/index.mjs +2 -1
  33. package/es/view-engine/edit-view.engine.mjs +5 -1
  34. package/es/view-engine/opt-view.engine.mjs +5 -1
  35. package/lib/control/drbar/drbar.cjs +3 -2
  36. package/lib/control/drbar/drbar.controller.cjs +106 -12
  37. package/lib/control/drtab/drtab.cjs +3 -2
  38. package/lib/control/drtab/drtab.controller.cjs +111 -4
  39. package/lib/control/grid/grid-column/grid-field-column/grid-field-column.cjs +4 -8
  40. package/lib/editor/autocomplete/autocomplete-editor.controller.cjs +11 -0
  41. package/lib/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.cjs +7 -0
  42. package/lib/editor/data-picker/ibiz-mpicker/ibiz-mpicker.cjs +12 -1
  43. package/lib/editor/data-picker/ibiz-picker/ibiz-picker.cjs +10 -0
  44. package/lib/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.cjs +12 -1
  45. package/lib/editor/data-picker/picker-editor.controller.cjs +11 -0
  46. package/lib/editor/list-box/ibiz-list-box/ibiz-list-box.cjs +26 -6
  47. package/lib/editor/list-box/list-box-picker-editor.controller.cjs +28 -0
  48. package/lib/locale/en/index.cjs +2 -1
  49. package/lib/locale/index.cjs +64 -1
  50. package/lib/locale/zh-CN/index.cjs +2 -1
  51. package/lib/view-engine/edit-view.engine.cjs +5 -1
  52. package/lib/view-engine/opt-view.engine.cjs +5 -1
  53. package/package.json +5 -5
  54. package/dist/index-vUHyK4p8.js +0 -4
@@ -1,5 +1,5 @@
1
1
  import { IHttpResponse } from '@ibiz-template/core';
2
- import { EditorController, IViewConfig } from '@ibiz-template/runtime';
2
+ import { EditorController, IViewConfig, IAcItemProvider } from '@ibiz-template/runtime';
3
3
  import { IAppDEACMode, IDEACModeDataItem, IPicker } from '@ibiz/model-core';
4
4
  /**
5
5
  * 数据选择编辑器控制器
@@ -59,6 +59,14 @@ export declare class PickerEditorController extends EditorController<IPicker> {
59
59
  objectIdField: string | undefined;
60
60
  objectNameField: string | undefined;
61
61
  objectValueField: string | undefined;
62
+ /**
63
+ * 自填列表项适配器
64
+ *
65
+ * @author zhanghengfeng
66
+ * @date 2024-05-21 17:05:50
67
+ * @type {IAcItemProvider}
68
+ */
69
+ acItemProvider?: IAcItemProvider;
62
70
  protected onInit(): Promise<void>;
63
71
  /**
64
72
  * 初始化noAc和noButton
@@ -1,5 +1,5 @@
1
1
  import { RuntimeModelError } from '@ibiz-template/core';
2
- import { EditorController, getDeACMode, OpenAppViewCommand } from '@ibiz-template/runtime';
2
+ import { EditorController, getDeACMode, getAcItemProvider, OpenAppViewCommand } from '@ibiz-template/runtime';
3
3
  import { mergeDeepLeft } from 'ramda';
4
4
 
5
5
  "use strict";
@@ -66,6 +66,14 @@ class PickerEditorController extends EditorController {
66
66
  __publicField(this, "objectNameField", "");
67
67
  // 对象值属性
68
68
  __publicField(this, "objectValueField", "");
69
+ /**
70
+ * 自填列表项适配器
71
+ *
72
+ * @author zhanghengfeng
73
+ * @date 2024-05-21 17:05:50
74
+ * @type {IAcItemProvider}
75
+ */
76
+ __publicField(this, "acItemProvider");
69
77
  }
70
78
  async onInit() {
71
79
  var _a, _b, _c, _d;
@@ -103,6 +111,9 @@ class PickerEditorController extends EditorController {
103
111
  }
104
112
  );
105
113
  }
114
+ if (this.deACMode.itemSysPFPluginId) {
115
+ this.acItemProvider = await getAcItemProvider(this.deACMode);
116
+ }
106
117
  }
107
118
  }
108
119
  }
@@ -1,4 +1,4 @@
1
- import { isVNode, computed, ref, watch, resolveComponent, mergeProps, createVNode, defineComponent } from 'vue';
1
+ import { isVNode, computed, ref, watch, resolveComponent, mergeProps, h, createVNode, defineComponent } from 'vue';
2
2
  import { getListBoxProps, getEditorEmits, useNamespace, useCodeListListen, useFocusAndBlur } from '@ibiz-template/vue3-util';
3
3
  import { isNil } from 'ramda';
4
4
  import './ibiz-list-box.css';
@@ -166,9 +166,19 @@ const IBizListBox = /* @__PURE__ */ defineComponent({
166
166
  "label": item.value,
167
167
  "disabled": this.disabled || this.readonly || item.disableSelect === true
168
168
  }, {
169
- default: () => [createVNode("span", {
170
- "class": this.ns.e("text")
171
- }, [item.text])]
169
+ default: () => {
170
+ const c = this.controller;
171
+ if (c.acItemProvider) {
172
+ const component = resolveComponent(c.acItemProvider.component);
173
+ return h(component, {
174
+ item,
175
+ controller: c
176
+ });
177
+ }
178
+ return createVNode("span", {
179
+ "class": this.ns.e("text")
180
+ }, [item.text]);
181
+ }
172
182
  }))) ? _slot : {
173
183
  default: () => [_slot]
174
184
  }) : createVNode(resolveComponent("el-radio-group"), mergeProps({
@@ -182,9 +192,19 @@ const IBizListBox = /* @__PURE__ */ defineComponent({
182
192
  this.onSelectArrayChange(item.value);
183
193
  }
184
194
  }, {
185
- default: () => [createVNode("span", {
186
- "class": this.ns.e("text")
187
- }, [item.text])]
195
+ default: () => {
196
+ const c = this.controller;
197
+ if (c.acItemProvider) {
198
+ const component = resolveComponent(c.acItemProvider.component);
199
+ return h(component, {
200
+ item,
201
+ controller: c
202
+ });
203
+ }
204
+ return createVNode("span", {
205
+ "class": this.ns.e("text")
206
+ }, [item.text]);
207
+ }
188
208
  }))) ? _slot2 : {
189
209
  default: () => [_slot2]
190
210
  })]);
@@ -1,6 +1,6 @@
1
1
  import { IHttpResponse } from '@ibiz-template/core';
2
- import { EditorController } from '@ibiz-template/runtime';
3
- import { IListBoxPicker } from '@ibiz/model-core';
2
+ import { EditorController, IAcItemProvider } from '@ibiz-template/runtime';
3
+ import { IAppDEACMode, IListBoxPicker } from '@ibiz/model-core';
4
4
  /**
5
5
  * 列表框picker编辑器控制器
6
6
  * @return {*}
@@ -20,6 +20,22 @@ export declare class ListBoxPickerEditorController extends EditorController<ILis
20
20
  * 数据集codeName
21
21
  */
22
22
  interfaceName: string;
23
+ /**
24
+ * 实体自填模式模型
25
+ *
26
+ * @author zhanghengfeng
27
+ * @date 2024-05-21 17:05:03
28
+ * @type {IAppDEACMode}
29
+ */
30
+ deACMode?: IAppDEACMode;
31
+ /**
32
+ * 自填列表项适配器
33
+ *
34
+ * @author zhanghengfeng
35
+ * @date 2024-05-21 17:05:25
36
+ * @type {IAcItemProvider}
37
+ */
38
+ acItemProvider?: IAcItemProvider;
23
39
  protected onInit(): Promise<void>;
24
40
  /**
25
41
  * 加载实体数据集数据
@@ -1,5 +1,5 @@
1
1
  import { RuntimeModelError } from '@ibiz-template/core';
2
- import { EditorController } from '@ibiz-template/runtime';
2
+ import { EditorController, getDeACMode, getAcItemProvider } from '@ibiz-template/runtime';
3
3
  import { mergeDeepLeft } from 'ramda';
4
4
 
5
5
  "use strict";
@@ -24,6 +24,22 @@ class ListBoxPickerEditorController extends EditorController {
24
24
  * 数据集codeName
25
25
  */
26
26
  __publicField(this, "interfaceName", "");
27
+ /**
28
+ * 实体自填模式模型
29
+ *
30
+ * @author zhanghengfeng
31
+ * @date 2024-05-21 17:05:03
32
+ * @type {IAppDEACMode}
33
+ */
34
+ __publicField(this, "deACMode");
35
+ /**
36
+ * 自填列表项适配器
37
+ *
38
+ * @author zhanghengfeng
39
+ * @date 2024-05-21 17:05:25
40
+ * @type {IAcItemProvider}
41
+ */
42
+ __publicField(this, "acItemProvider");
27
43
  }
28
44
  async onInit() {
29
45
  super.onInit();
@@ -31,6 +47,18 @@ class ListBoxPickerEditorController extends EditorController {
31
47
  if (this.model.appDEDataSetId) {
32
48
  this.interfaceName = this.model.appDEDataSetId;
33
49
  }
50
+ if (this.model.appDataEntityId && this.model.appDEACModeId) {
51
+ this.deACMode = await getDeACMode(
52
+ this.model.appDEACModeId,
53
+ this.model.appDataEntityId,
54
+ this.context.srfappid
55
+ );
56
+ if (this.deACMode) {
57
+ if (this.deACMode.itemSysPFPluginId) {
58
+ this.acItemProvider = await getAcItemProvider(this.deACMode);
59
+ }
60
+ }
61
+ }
34
62
  }
35
63
  }
36
64
  /**
@@ -732,6 +732,7 @@ declare const _default: {
732
732
  viewPlugin: string;
733
733
  correspondViewTypeStyle: string;
734
734
  toolbarItem: string;
735
+ acItem: string;
735
736
  };
736
737
  };
737
738
  service: {
@@ -738,7 +738,8 @@ var index = {
738
738
  frontEndPluginNode: "Cannot find interface logic front-end plugin node, plugin {pluginKey} corresponding adapter",
739
739
  viewPlugin: "Cannot find the adapter corresponding to the view plugin {pluginKey}.",
740
740
  correspondViewTypeStyle: "Cannot find an adapter for view type: [{viewType}] corresponding to view style: [{viewStyle}].",
741
- toolbarItem: "Cannot find the adapter corresponding to the toolbar item plugin {pluginKey}."
741
+ toolbarItem: "Cannot find the adapter corresponding to the toolbar item plugin {pluginKey}.",
742
+ acItem: "Cannot find the adapter corresponding to the ac item plugin {pluginKey}."
742
743
  }
743
744
  },
744
745
  service: {
@@ -1,9 +1,37 @@
1
1
  import { I18n } from '@ibiz-template/core';
2
2
  declare const i18n: import("vue-i18n").I18n<{}, {}, {}, string, false>;
3
3
  export declare class IBizI18n implements I18n {
4
+ /**
5
+ * html元素
6
+ *
7
+ * @author tony001
8
+ * @date 2024-05-20 22:05:58
9
+ * @protected
10
+ * @type {HTMLElement}
11
+ */
4
12
  protected html: HTMLElement;
13
+ /**
14
+ * 默认语言
15
+ *
16
+ * @author tony001
17
+ * @date 2024-05-20 22:05:13
18
+ * @protected
19
+ * @type {string}
20
+ */
5
21
  protected defaultLang: string;
22
+ /**
23
+ * 语言资源映射表
24
+ *
25
+ * @author tony001
26
+ * @date 2024-05-20 22:05:38
27
+ * @protected
28
+ */
6
29
  protected langMap: Map<string, () => Promise<IData>>;
30
+ /**
31
+ * Creates an instance of IBizI18n.
32
+ * @author tony001
33
+ * @date 2024-05-20 22:05:50
34
+ */
7
35
  constructor();
8
36
  /**
9
37
  * 初始化加载默认多语言文件
@@ -22,16 +50,59 @@ export declare class IBizI18n implements I18n {
22
50
  */
23
51
  setLangConfigs(languages: Record<string, () => Promise<IData>>): void;
24
52
  /**
25
- * 设置
53
+ * 设置语言
26
54
  *
27
55
  * @author chitanda
28
56
  * @date 2023-08-24 16:08:42
29
57
  * @param {string} lang
30
58
  */
31
59
  setLang(lang: string): void;
60
+ /**
61
+ * 获取语言
62
+ *
63
+ * @author tony001
64
+ * @date 2024-05-20 22:05:05
65
+ * @return {*} {string}
66
+ */
32
67
  getLang(): string;
68
+ /**
69
+ * 格式化
70
+ *
71
+ * @author tony001
72
+ * @date 2024-05-20 22:05:00
73
+ * @param {string} tag
74
+ * @param {(IParams | undefined)} [options]
75
+ * @return {*} {string}
76
+ */
33
77
  t(tag: string, options?: IParams | undefined): string;
78
+ /**
79
+ * 格式化
80
+ *
81
+ * @author tony001
82
+ * @date 2024-05-20 22:05:05
83
+ * @param {string} tag
84
+ * @param {(string | undefined)} [defaultMsg]
85
+ * @param {IParams} [options]
86
+ * @return {*} {string}
87
+ */
34
88
  t(tag: string, defaultMsg?: string | undefined, options?: IParams): string;
89
+ /**
90
+ * 合并语言资源
91
+ *
92
+ * @author tony001
93
+ * @date 2024-05-20 22:05:01
94
+ * @param {IParams} data
95
+ */
96
+ mergeLocaleMessage(data: IParams): void;
97
+ /**
98
+ * 合并指定语言资源
99
+ *
100
+ * @author tony001
101
+ * @date 2024-05-20 22:05:21
102
+ * @param {string} lang
103
+ * @param {IParams} data
104
+ */
105
+ mergeLocaleMessage(lang: string, data: IParams): void;
35
106
  }
36
107
  declare const iBizI18n: IBizI18n;
37
108
  export { i18n, iBizI18n };
@@ -12,9 +12,37 @@ const i18n = createI18n({
12
12
  locale: "zh-CN"
13
13
  });
14
14
  class IBizI18n {
15
+ /**
16
+ * Creates an instance of IBizI18n.
17
+ * @author tony001
18
+ * @date 2024-05-20 22:05:50
19
+ */
15
20
  constructor() {
21
+ /**
22
+ * html元素
23
+ *
24
+ * @author tony001
25
+ * @date 2024-05-20 22:05:58
26
+ * @protected
27
+ * @type {HTMLElement}
28
+ */
16
29
  __publicField(this, "html");
30
+ /**
31
+ * 默认语言
32
+ *
33
+ * @author tony001
34
+ * @date 2024-05-20 22:05:13
35
+ * @protected
36
+ * @type {string}
37
+ */
17
38
  __publicField(this, "defaultLang");
39
+ /**
40
+ * 语言资源映射表
41
+ *
42
+ * @author tony001
43
+ * @date 2024-05-20 22:05:38
44
+ * @protected
45
+ */
18
46
  __publicField(this, "langMap", /* @__PURE__ */ new Map());
19
47
  this.defaultLang = "zh-CN";
20
48
  this.html = document.querySelector("html");
@@ -56,7 +84,7 @@ class IBizI18n {
56
84
  });
57
85
  }
58
86
  /**
59
- * 设置
87
+ * 设置语言
60
88
  *
61
89
  * @author chitanda
62
90
  * @date 2023-08-24 16:08:42
@@ -73,9 +101,26 @@ class IBizI18n {
73
101
  }
74
102
  });
75
103
  }
104
+ /**
105
+ * 获取语言
106
+ *
107
+ * @author tony001
108
+ * @date 2024-05-20 22:05:05
109
+ * @return {*} {string}
110
+ */
76
111
  getLang() {
77
112
  return this.html.getAttribute("lang") || this.defaultLang;
78
113
  }
114
+ /**
115
+ * 格式化
116
+ *
117
+ * @author tony001
118
+ * @date 2024-05-20 22:05:44
119
+ * @param {unknown} tag
120
+ * @param {unknown} [defaultMsg]
121
+ * @param {unknown} [options]
122
+ * @return {*} {string}
123
+ */
79
124
  t(tag, defaultMsg, options) {
80
125
  return i18n.global.t(
81
126
  tag,
@@ -83,6 +128,24 @@ class IBizI18n {
83
128
  options
84
129
  );
85
130
  }
131
+ /**
132
+ * 合并语言资源
133
+ * @param lang
134
+ * @param data
135
+ */
136
+ mergeLocaleMessage(dataOrLang, data) {
137
+ if (typeof dataOrLang === "string") {
138
+ const lang = dataOrLang;
139
+ i18n.global.mergeLocaleMessage(lang, data);
140
+ } else {
141
+ const langData = dataOrLang;
142
+ if (langData && Object.keys(langData).length > 0) {
143
+ Object.keys(langData).forEach((key) => {
144
+ i18n.global.mergeLocaleMessage(key, langData[key]);
145
+ });
146
+ }
147
+ }
148
+ }
86
149
  }
87
150
  const iBizI18n = new IBizI18n();
88
151
 
@@ -730,6 +730,7 @@ declare const _default: {
730
730
  viewPlugin: string;
731
731
  correspondViewTypeStyle: string;
732
732
  toolbarItem: string;
733
+ acItem: string;
733
734
  };
734
735
  };
735
736
  service: {
@@ -736,7 +736,8 @@ var index = {
736
736
  frontEndPluginNode: "\u627E\u4E0D\u5230\u754C\u9762\u903B\u8F91\u524D\u7AEF\u63D2\u4EF6\u8282\u70B9\uFF0C\u63D2\u4EF6{pluginKey}\u5BF9\u5E94\u7684\u9002\u914D\u5668",
737
737
  viewPlugin: "\u627E\u4E0D\u5230\u89C6\u56FE\u63D2\u4EF6{pluginKey}\u5BF9\u5E94\u7684\u9002\u914D\u5668",
738
738
  correspondViewTypeStyle: "\u627E\u4E0D\u5230\u89C6\u56FE\u7C7B\u578B\uFF1A[{viewType}]\u7684\u89C6\u56FE\u6837\u5F0F\uFF1A[{viewStyle}]\u5BF9\u5E94\u7684\u9002\u914D\u5668",
739
- toolbarItem: "\u627E\u4E0D\u5230\u5DE5\u5177\u680F\u9879\u63D2\u4EF6{pluginKey}\u5BF9\u5E94\u7684\u9002\u914D\u5668"
739
+ toolbarItem: "\u627E\u4E0D\u5230\u5DE5\u5177\u680F\u9879\u63D2\u4EF6{pluginKey}\u5BF9\u5E94\u7684\u9002\u914D\u5668",
740
+ acItem: "\u627E\u4E0D\u5230\u81EA\u586B\u5217\u8868\u9879\u63D2\u4EF6{pluginKey}\u5BF9\u5E94\u7684\u9002\u914D\u5668"
740
741
  }
741
742
  },
742
743
  service: {
@@ -97,7 +97,11 @@ class EditViewEngine extends ViewEngineBase {
97
97
  };
98
98
  this.form.evt.on("onLoadSuccess", (event) => {
99
99
  formDataStateChange(event);
100
- this.view.state.srfactiveviewdata = event.data[0];
100
+ const data = event.data[0];
101
+ this.view.state.srfactiveviewdata = data;
102
+ if (data.srfreadonly) {
103
+ this.view.context.srfreadonly = true;
104
+ }
101
105
  evt.emit("onDataChange", { ...event, actionType: "LOAD" });
102
106
  });
103
107
  this.form.evt.on("onLoadDraftSuccess", (event) => {
@@ -64,7 +64,11 @@ class OptViewEngine extends ViewEngineBase {
64
64
  }
65
65
  };
66
66
  this.form.evt.on("onLoadSuccess", (event) => {
67
- this.view.state.srfactiveviewdata = event.data[0];
67
+ const data = event.data[0];
68
+ this.view.state.srfactiveviewdata = data;
69
+ if (data.srfreadonly) {
70
+ this.view.context.srfreadonly = true;
71
+ }
68
72
  formDataStateChange(event);
69
73
  });
70
74
  this.form.evt.on("onLoadDraftSuccess", (event) => {
@@ -150,13 +150,14 @@ const DRBarControl = /* @__PURE__ */ vue.defineComponent({
150
150
  const {
151
151
  isCreated,
152
152
  drBarItems,
153
- selectedItem
153
+ selectedItem,
154
+ isCalculatedPermission
154
155
  } = this.c.state;
155
156
  return vue.createVNode(vue.resolveComponent("iBizControlBase"), {
156
157
  "controller": this.c,
157
158
  "class": this.ns.b()
158
159
  }, {
159
- default: () => [isCreated && vue.createVNode(vue.resolveComponent("el-menu"), {
160
+ default: () => [isCreated && isCalculatedPermission && vue.createVNode(vue.resolveComponent("el-menu"), {
160
161
  "class": this.ns.e("menu"),
161
162
  "mode": this.showMode,
162
163
  "default-active": selectedItem,
@@ -119,6 +119,78 @@ class DRBarController extends runtime.ControlController {
119
119
  this.initDRBarItems();
120
120
  await this.initCounter();
121
121
  }
122
+ /**
123
+ * 通过计数器数据,计算项状态
124
+ *
125
+ * @author zhanghengfeng
126
+ * @date 2024-05-16 18:05:14
127
+ * @param {IData} [_data]
128
+ * @param {boolean} [reset=true]
129
+ */
130
+ calcItemStateByCounter(_data, reset = true) {
131
+ this.state.drBarItems.forEach((item) => {
132
+ var _a;
133
+ if ((_a = item.children) == null ? void 0 : _a.length) {
134
+ item.children.forEach((childItem) => {
135
+ const visible = runtime.calcItemVisibleByCounter(childItem, this.counter);
136
+ if (visible !== void 0) {
137
+ childItem.visible = visible;
138
+ }
139
+ });
140
+ item.visible = item.children.some((childItem) => childItem.visible);
141
+ } else {
142
+ const visible = runtime.calcItemVisibleByCounter(item, this.counter);
143
+ if (visible !== void 0) {
144
+ item.visible = visible;
145
+ }
146
+ }
147
+ });
148
+ if (this.state.selectedItem && reset) {
149
+ const { visible, defaultVisibleItem } = this.getItemVisibleState(
150
+ this.state.selectedItem
151
+ );
152
+ if (!visible && defaultVisibleItem) {
153
+ this.handleSelectChange(defaultVisibleItem.tag);
154
+ }
155
+ }
156
+ }
157
+ /**
158
+ * 获取对应项的显示状态
159
+ *
160
+ * @author zhanghengfeng
161
+ * @date 2024-05-16 17:05:15
162
+ * @param {string} key
163
+ * @return {*} {{
164
+ * visible: boolean;
165
+ * defaultVisibleItem?: IDRBarItemsState;
166
+ * }}
167
+ */
168
+ getItemVisibleState(key) {
169
+ let visible = true;
170
+ let defaultVisibleItem;
171
+ this.state.drBarItems.forEach((item) => {
172
+ if (item.children) {
173
+ if (!defaultVisibleItem) {
174
+ defaultVisibleItem = item.children.find((child) => child.visible);
175
+ }
176
+ const drBarItem = item.children.find((child) => child.tag === key);
177
+ if (drBarItem) {
178
+ visible = !!drBarItem.visible;
179
+ }
180
+ } else {
181
+ if (!defaultVisibleItem && item.visible) {
182
+ defaultVisibleItem = item;
183
+ }
184
+ if (item.tag === key) {
185
+ visible = !!item.visible;
186
+ }
187
+ }
188
+ });
189
+ return {
190
+ visible,
191
+ defaultVisibleItem
192
+ };
193
+ }
122
194
  /**
123
195
  * 计算关系界面组权限
124
196
  *
@@ -126,16 +198,19 @@ class DRBarController extends runtime.ControlController {
126
198
  * @memberof DRBarController
127
199
  */
128
200
  async calcPermitted(item) {
201
+ var _a;
129
202
  let permitted = true;
130
- if (item.dataAccessAction) {
131
- const app = await ibiz.hub.getApp(this.context.srfappid);
132
- const data = this.getData().length > 0 ? this.getData()[0] : void 0;
133
- permitted = await app.authority.calcByDataAccessAction(
134
- item.dataAccessAction,
135
- this.context,
136
- data,
137
- this.model.appDataEntityId
138
- );
203
+ const data = ((_a = this.getData()) == null ? void 0 : _a.length) ? this.getData()[0] : void 0;
204
+ const visible = await runtime.calcItemVisible(
205
+ item,
206
+ this.context,
207
+ this.params,
208
+ this.model.appDataEntityId,
209
+ this.model.appId,
210
+ data
211
+ );
212
+ if (visible !== void 0) {
213
+ permitted = visible;
139
214
  }
140
215
  item.visible = permitted;
141
216
  }
@@ -161,6 +236,8 @@ class DRBarController extends runtime.ControlController {
161
236
  }
162
237
  })
163
238
  );
239
+ this.calcItemStateByCounter({}, false);
240
+ this.state.isCalculatedPermission = true;
164
241
  }
165
242
  /**
166
243
  * 加载完成
@@ -172,7 +249,11 @@ class DRBarController extends runtime.ControlController {
172
249
  await super.onMounted();
173
250
  if (this.form) {
174
251
  this.form.evt.on("onLoadSuccess", async (event) => {
175
- this.view.state.srfactiveviewdata = event.data[0];
252
+ const data = event.data[0];
253
+ this.view.state.srfactiveviewdata = data;
254
+ if (data.srfreadonly) {
255
+ this.view.context.srfreadonly = true;
256
+ }
176
257
  await this.calcDrBarItemsState();
177
258
  this.handleFormChange();
178
259
  this.doDefaultSelect();
@@ -252,6 +333,7 @@ class DRBarController extends runtime.ControlController {
252
333
  if (item.capLanguageRes) {
253
334
  itemCaption = ibiz.i18n.t(item.capLanguageRes.lanResTag, item.caption);
254
335
  }
336
+ const { enableMode, testAppDELogicId, testScriptCode } = item;
255
337
  return {
256
338
  tag: item.id,
257
339
  caption: itemCaption,
@@ -260,7 +342,10 @@ class DRBarController extends runtime.ControlController {
260
342
  counterId: item.counterId,
261
343
  visible: false,
262
344
  // 默认不显示
263
- dataAccessAction: item.dataAccessAction || void 0
345
+ dataAccessAction: item.dataAccessAction || void 0,
346
+ enableMode,
347
+ testAppDELogicId,
348
+ testScriptCode
264
349
  };
265
350
  };
266
351
  if (dedrbarGroups && dedrctrlItems) {
@@ -423,7 +508,13 @@ class DRBarController extends runtime.ControlController {
423
508
  }
424
509
  if (key) {
425
510
  const isRoutePushed = !!this.routeDepth && runtime.hasSubRoute(this.routeDepth);
426
- this.handleSelectChange(key, isRoutePushed);
511
+ const { visible, defaultVisibleItem } = this.getItemVisibleState(key);
512
+ if (!visible && defaultVisibleItem) {
513
+ key = defaultVisibleItem.tag;
514
+ this.handleSelectChange(key);
515
+ } else {
516
+ this.handleSelectChange(key, isRoutePushed);
517
+ }
427
518
  this.state.defaultItem = key;
428
519
  }
429
520
  }
@@ -443,6 +534,8 @@ class DRBarController extends runtime.ControlController {
443
534
  this.context,
444
535
  { ...this.params }
445
536
  );
537
+ this.calcItemStateByCounter = this.calcItemStateByCounter.bind(this);
538
+ this.counter.onChange(this.calcItemStateByCounter);
446
539
  }
447
540
  }
448
541
  /**
@@ -456,6 +549,7 @@ class DRBarController extends runtime.ControlController {
456
549
  async onDestroyed() {
457
550
  await super.onDestroyed();
458
551
  if (this.counter) {
552
+ this.counter.offChange(this.calcItemStateByCounter);
459
553
  this.counter.destroy();
460
554
  }
461
555
  }
@@ -96,13 +96,14 @@ const DRTabControl = /* @__PURE__ */ vue.defineComponent({
96
96
  let _slot;
97
97
  const {
98
98
  isCreated,
99
- drTabPages
99
+ drTabPages,
100
+ isCalculatedPermission
100
101
  } = this.c.state;
101
102
  return vue.createVNode(vue.resolveComponent("iBizControlBase"), {
102
103
  "controller": this.c,
103
104
  "class": this.ns.b()
104
105
  }, {
105
- default: () => [isCreated && vue.createVNode(vue.resolveComponent("el-tabs"), {
106
+ default: () => [isCreated && isCalculatedPermission && vue.createVNode(vue.resolveComponent("el-tabs"), {
106
107
  "modelValue": this.c.state.activeName,
107
108
  "onUpdate:modelValue": ($event) => this.c.state.activeName = $event,
108
109
  "onTabChange": this.handleTabChange