@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.
- package/dist/index-8VqjTY2N.js +4 -0
- package/dist/{index-Hg_8xCYx.js → index-B_FGiHpY.js} +1 -1
- package/dist/{index-8Lu2Ax-_.js → index-Q8y2iWnX.js} +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{xlsx-util-5nNxB32e.js → xlsx-util-AIEyudtA.js} +1 -1
- package/es/control/drbar/drbar.controller.d.ts +24 -0
- package/es/control/drbar/drbar.controller.mjs +107 -13
- package/es/control/drbar/drbar.mjs +3 -2
- package/es/control/drtab/drtab.controller.d.ts +39 -0
- package/es/control/drtab/drtab.controller.mjs +112 -5
- package/es/control/drtab/drtab.mjs +3 -2
- package/es/control/grid/grid-column/grid-field-column/grid-field-column.d.ts +0 -1
- package/es/control/grid/grid-column/grid-field-column/grid-field-column.mjs +4 -8
- package/es/control/grid/grid-column/grid-field-column/index.d.ts +0 -1
- package/es/editor/autocomplete/autocomplete-editor.controller.d.ts +9 -1
- package/es/editor/autocomplete/autocomplete-editor.controller.mjs +12 -1
- package/es/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.mjs +8 -1
- package/es/editor/data-picker/ibiz-mpicker/ibiz-mpicker.mjs +13 -2
- package/es/editor/data-picker/ibiz-picker/ibiz-picker.mjs +11 -1
- package/es/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.mjs +13 -2
- package/es/editor/data-picker/picker-editor.controller.d.ts +9 -1
- package/es/editor/data-picker/picker-editor.controller.mjs +12 -1
- package/es/editor/list-box/ibiz-list-box/ibiz-list-box.mjs +27 -7
- package/es/editor/list-box/list-box-picker-editor.controller.d.ts +18 -2
- package/es/editor/list-box/list-box-picker-editor.controller.mjs +29 -1
- package/es/locale/en/index.d.ts +1 -0
- package/es/locale/en/index.mjs +2 -1
- package/es/locale/index.d.ts +72 -1
- package/es/locale/index.mjs +64 -1
- package/es/locale/zh-CN/index.d.ts +1 -0
- package/es/locale/zh-CN/index.mjs +2 -1
- package/es/view-engine/edit-view.engine.mjs +5 -1
- package/es/view-engine/opt-view.engine.mjs +5 -1
- package/lib/control/drbar/drbar.cjs +3 -2
- package/lib/control/drbar/drbar.controller.cjs +106 -12
- package/lib/control/drtab/drtab.cjs +3 -2
- package/lib/control/drtab/drtab.controller.cjs +111 -4
- package/lib/control/grid/grid-column/grid-field-column/grid-field-column.cjs +4 -8
- package/lib/editor/autocomplete/autocomplete-editor.controller.cjs +11 -0
- package/lib/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.cjs +7 -0
- package/lib/editor/data-picker/ibiz-mpicker/ibiz-mpicker.cjs +12 -1
- package/lib/editor/data-picker/ibiz-picker/ibiz-picker.cjs +10 -0
- package/lib/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.cjs +12 -1
- package/lib/editor/data-picker/picker-editor.controller.cjs +11 -0
- package/lib/editor/list-box/ibiz-list-box/ibiz-list-box.cjs +26 -6
- package/lib/editor/list-box/list-box-picker-editor.controller.cjs +28 -0
- package/lib/locale/en/index.cjs +2 -1
- package/lib/locale/index.cjs +64 -1
- package/lib/locale/zh-CN/index.cjs +2 -1
- package/lib/view-engine/edit-view.engine.cjs +5 -1
- package/lib/view-engine/opt-view.engine.cjs +5 -1
- package/package.json +5 -5
- package/dist/index-vUHyK4p8.js +0 -4
|
@@ -89,6 +89,30 @@ export declare class DRBarController extends ControlController<IDEDRBar, IDRBarS
|
|
|
89
89
|
* @memberof DRBarController
|
|
90
90
|
*/
|
|
91
91
|
onCreated(): Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* 通过计数器数据,计算项状态
|
|
94
|
+
*
|
|
95
|
+
* @author zhanghengfeng
|
|
96
|
+
* @date 2024-05-16 18:05:14
|
|
97
|
+
* @param {IData} [_data]
|
|
98
|
+
* @param {boolean} [reset=true]
|
|
99
|
+
*/
|
|
100
|
+
calcItemStateByCounter(_data?: IData, reset?: boolean): void;
|
|
101
|
+
/**
|
|
102
|
+
* 获取对应项的显示状态
|
|
103
|
+
*
|
|
104
|
+
* @author zhanghengfeng
|
|
105
|
+
* @date 2024-05-16 17:05:15
|
|
106
|
+
* @param {string} key
|
|
107
|
+
* @return {*} {{
|
|
108
|
+
* visible: boolean;
|
|
109
|
+
* defaultVisibleItem?: IDRBarItemsState;
|
|
110
|
+
* }}
|
|
111
|
+
*/
|
|
112
|
+
getItemVisibleState(key: string): {
|
|
113
|
+
visible: boolean;
|
|
114
|
+
defaultVisibleItem?: IDRBarItemsState;
|
|
115
|
+
};
|
|
92
116
|
/**
|
|
93
117
|
* 计算关系界面组权限
|
|
94
118
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ControlController, Srfuf, calcNavParams, hasSubRoute, CounterService } from '@ibiz-template/runtime';
|
|
1
|
+
import { ControlController, Srfuf, calcItemVisibleByCounter, calcItemVisible, calcNavParams, hasSubRoute, CounterService } from '@ibiz-template/runtime';
|
|
2
2
|
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -117,6 +117,78 @@ class DRBarController extends ControlController {
|
|
|
117
117
|
this.initDRBarItems();
|
|
118
118
|
await this.initCounter();
|
|
119
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* 通过计数器数据,计算项状态
|
|
122
|
+
*
|
|
123
|
+
* @author zhanghengfeng
|
|
124
|
+
* @date 2024-05-16 18:05:14
|
|
125
|
+
* @param {IData} [_data]
|
|
126
|
+
* @param {boolean} [reset=true]
|
|
127
|
+
*/
|
|
128
|
+
calcItemStateByCounter(_data, reset = true) {
|
|
129
|
+
this.state.drBarItems.forEach((item) => {
|
|
130
|
+
var _a;
|
|
131
|
+
if ((_a = item.children) == null ? void 0 : _a.length) {
|
|
132
|
+
item.children.forEach((childItem) => {
|
|
133
|
+
const visible = calcItemVisibleByCounter(childItem, this.counter);
|
|
134
|
+
if (visible !== void 0) {
|
|
135
|
+
childItem.visible = visible;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
item.visible = item.children.some((childItem) => childItem.visible);
|
|
139
|
+
} else {
|
|
140
|
+
const visible = calcItemVisibleByCounter(item, this.counter);
|
|
141
|
+
if (visible !== void 0) {
|
|
142
|
+
item.visible = visible;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
if (this.state.selectedItem && reset) {
|
|
147
|
+
const { visible, defaultVisibleItem } = this.getItemVisibleState(
|
|
148
|
+
this.state.selectedItem
|
|
149
|
+
);
|
|
150
|
+
if (!visible && defaultVisibleItem) {
|
|
151
|
+
this.handleSelectChange(defaultVisibleItem.tag);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* 获取对应项的显示状态
|
|
157
|
+
*
|
|
158
|
+
* @author zhanghengfeng
|
|
159
|
+
* @date 2024-05-16 17:05:15
|
|
160
|
+
* @param {string} key
|
|
161
|
+
* @return {*} {{
|
|
162
|
+
* visible: boolean;
|
|
163
|
+
* defaultVisibleItem?: IDRBarItemsState;
|
|
164
|
+
* }}
|
|
165
|
+
*/
|
|
166
|
+
getItemVisibleState(key) {
|
|
167
|
+
let visible = true;
|
|
168
|
+
let defaultVisibleItem;
|
|
169
|
+
this.state.drBarItems.forEach((item) => {
|
|
170
|
+
if (item.children) {
|
|
171
|
+
if (!defaultVisibleItem) {
|
|
172
|
+
defaultVisibleItem = item.children.find((child) => child.visible);
|
|
173
|
+
}
|
|
174
|
+
const drBarItem = item.children.find((child) => child.tag === key);
|
|
175
|
+
if (drBarItem) {
|
|
176
|
+
visible = !!drBarItem.visible;
|
|
177
|
+
}
|
|
178
|
+
} else {
|
|
179
|
+
if (!defaultVisibleItem && item.visible) {
|
|
180
|
+
defaultVisibleItem = item;
|
|
181
|
+
}
|
|
182
|
+
if (item.tag === key) {
|
|
183
|
+
visible = !!item.visible;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
return {
|
|
188
|
+
visible,
|
|
189
|
+
defaultVisibleItem
|
|
190
|
+
};
|
|
191
|
+
}
|
|
120
192
|
/**
|
|
121
193
|
* 计算关系界面组权限
|
|
122
194
|
*
|
|
@@ -124,16 +196,19 @@ class DRBarController extends ControlController {
|
|
|
124
196
|
* @memberof DRBarController
|
|
125
197
|
*/
|
|
126
198
|
async calcPermitted(item) {
|
|
199
|
+
var _a;
|
|
127
200
|
let permitted = true;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
201
|
+
const data = ((_a = this.getData()) == null ? void 0 : _a.length) ? this.getData()[0] : void 0;
|
|
202
|
+
const visible = await calcItemVisible(
|
|
203
|
+
item,
|
|
204
|
+
this.context,
|
|
205
|
+
this.params,
|
|
206
|
+
this.model.appDataEntityId,
|
|
207
|
+
this.model.appId,
|
|
208
|
+
data
|
|
209
|
+
);
|
|
210
|
+
if (visible !== void 0) {
|
|
211
|
+
permitted = visible;
|
|
137
212
|
}
|
|
138
213
|
item.visible = permitted;
|
|
139
214
|
}
|
|
@@ -159,6 +234,8 @@ class DRBarController extends ControlController {
|
|
|
159
234
|
}
|
|
160
235
|
})
|
|
161
236
|
);
|
|
237
|
+
this.calcItemStateByCounter({}, false);
|
|
238
|
+
this.state.isCalculatedPermission = true;
|
|
162
239
|
}
|
|
163
240
|
/**
|
|
164
241
|
* 加载完成
|
|
@@ -170,7 +247,11 @@ class DRBarController extends ControlController {
|
|
|
170
247
|
await super.onMounted();
|
|
171
248
|
if (this.form) {
|
|
172
249
|
this.form.evt.on("onLoadSuccess", async (event) => {
|
|
173
|
-
|
|
250
|
+
const data = event.data[0];
|
|
251
|
+
this.view.state.srfactiveviewdata = data;
|
|
252
|
+
if (data.srfreadonly) {
|
|
253
|
+
this.view.context.srfreadonly = true;
|
|
254
|
+
}
|
|
174
255
|
await this.calcDrBarItemsState();
|
|
175
256
|
this.handleFormChange();
|
|
176
257
|
this.doDefaultSelect();
|
|
@@ -250,6 +331,7 @@ class DRBarController extends ControlController {
|
|
|
250
331
|
if (item.capLanguageRes) {
|
|
251
332
|
itemCaption = ibiz.i18n.t(item.capLanguageRes.lanResTag, item.caption);
|
|
252
333
|
}
|
|
334
|
+
const { enableMode, testAppDELogicId, testScriptCode } = item;
|
|
253
335
|
return {
|
|
254
336
|
tag: item.id,
|
|
255
337
|
caption: itemCaption,
|
|
@@ -258,7 +340,10 @@ class DRBarController extends ControlController {
|
|
|
258
340
|
counterId: item.counterId,
|
|
259
341
|
visible: false,
|
|
260
342
|
// 默认不显示
|
|
261
|
-
dataAccessAction: item.dataAccessAction || void 0
|
|
343
|
+
dataAccessAction: item.dataAccessAction || void 0,
|
|
344
|
+
enableMode,
|
|
345
|
+
testAppDELogicId,
|
|
346
|
+
testScriptCode
|
|
262
347
|
};
|
|
263
348
|
};
|
|
264
349
|
if (dedrbarGroups && dedrctrlItems) {
|
|
@@ -421,7 +506,13 @@ class DRBarController extends ControlController {
|
|
|
421
506
|
}
|
|
422
507
|
if (key) {
|
|
423
508
|
const isRoutePushed = !!this.routeDepth && hasSubRoute(this.routeDepth);
|
|
424
|
-
this.
|
|
509
|
+
const { visible, defaultVisibleItem } = this.getItemVisibleState(key);
|
|
510
|
+
if (!visible && defaultVisibleItem) {
|
|
511
|
+
key = defaultVisibleItem.tag;
|
|
512
|
+
this.handleSelectChange(key);
|
|
513
|
+
} else {
|
|
514
|
+
this.handleSelectChange(key, isRoutePushed);
|
|
515
|
+
}
|
|
425
516
|
this.state.defaultItem = key;
|
|
426
517
|
}
|
|
427
518
|
}
|
|
@@ -441,6 +532,8 @@ class DRBarController extends ControlController {
|
|
|
441
532
|
this.context,
|
|
442
533
|
{ ...this.params }
|
|
443
534
|
);
|
|
535
|
+
this.calcItemStateByCounter = this.calcItemStateByCounter.bind(this);
|
|
536
|
+
this.counter.onChange(this.calcItemStateByCounter);
|
|
444
537
|
}
|
|
445
538
|
}
|
|
446
539
|
/**
|
|
@@ -454,6 +547,7 @@ class DRBarController extends ControlController {
|
|
|
454
547
|
async onDestroyed() {
|
|
455
548
|
await super.onDestroyed();
|
|
456
549
|
if (this.counter) {
|
|
550
|
+
this.counter.offChange(this.calcItemStateByCounter);
|
|
457
551
|
this.counter.destroy();
|
|
458
552
|
}
|
|
459
553
|
}
|
|
@@ -148,13 +148,14 @@ const DRBarControl = /* @__PURE__ */ defineComponent({
|
|
|
148
148
|
const {
|
|
149
149
|
isCreated,
|
|
150
150
|
drBarItems,
|
|
151
|
-
selectedItem
|
|
151
|
+
selectedItem,
|
|
152
|
+
isCalculatedPermission
|
|
152
153
|
} = this.c.state;
|
|
153
154
|
return createVNode(resolveComponent("iBizControlBase"), {
|
|
154
155
|
"controller": this.c,
|
|
155
156
|
"class": this.ns.b()
|
|
156
157
|
}, {
|
|
157
|
-
default: () => [isCreated && createVNode(resolveComponent("el-menu"), {
|
|
158
|
+
default: () => [isCreated && isCalculatedPermission && createVNode(resolveComponent("el-menu"), {
|
|
158
159
|
"class": this.ns.e("menu"),
|
|
159
160
|
"mode": this.showMode,
|
|
160
161
|
"default-active": selectedItem,
|
|
@@ -74,6 +74,45 @@ export declare class DRTabController extends ControlController<IDEDRTab, IDRTabS
|
|
|
74
74
|
* @memberof DRTabController
|
|
75
75
|
*/
|
|
76
76
|
onCreated(): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* 通过计数器数据,计算项状态
|
|
79
|
+
*
|
|
80
|
+
* @author zhanghengfeng
|
|
81
|
+
* @date 2024-05-16 17:05:01
|
|
82
|
+
*/
|
|
83
|
+
calcItemStateByCounter(): void;
|
|
84
|
+
/**
|
|
85
|
+
* 获取对应项的显示状态
|
|
86
|
+
*
|
|
87
|
+
* @author zhanghengfeng
|
|
88
|
+
* @date 2024-05-16 17:05:18
|
|
89
|
+
* @param {string} key
|
|
90
|
+
* @return {*} {{
|
|
91
|
+
* visible: boolean;
|
|
92
|
+
* defaultVisibleItem?: IDRTabPagesState;
|
|
93
|
+
* }}
|
|
94
|
+
*/
|
|
95
|
+
getItemVisibleState(key: string): {
|
|
96
|
+
visible: boolean;
|
|
97
|
+
defaultVisibleItem?: IDRTabPagesState;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* 计算项权限
|
|
101
|
+
*
|
|
102
|
+
* @author zhanghengfeng
|
|
103
|
+
* @date 2024-05-16 17:05:40
|
|
104
|
+
* @param {IDRTabPagesState} item
|
|
105
|
+
* @return {*} {Promise<void>}
|
|
106
|
+
*/
|
|
107
|
+
calcPermitted(item: IDRTabPagesState): Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* 计算项状态
|
|
110
|
+
*
|
|
111
|
+
* @author zhanghengfeng
|
|
112
|
+
* @date 2024-05-16 17:05:05
|
|
113
|
+
* @return {*} {Promise<void>}
|
|
114
|
+
*/
|
|
115
|
+
calcDrTabPagesState(): Promise<void>;
|
|
77
116
|
/**
|
|
78
117
|
* 加载完成
|
|
79
118
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ControlController, Srfuf, hasSubRoute, calcNavParams, CounterService } from '@ibiz-template/runtime';
|
|
1
|
+
import { ControlController, calcItemVisibleByCounter, calcItemVisible, Srfuf, hasSubRoute, calcNavParams, CounterService } from '@ibiz-template/runtime';
|
|
2
2
|
import { getNestedRoutePath } from '@ibiz-template/vue3-util';
|
|
3
3
|
|
|
4
4
|
"use strict";
|
|
@@ -95,6 +95,97 @@ class DRTabController extends ControlController {
|
|
|
95
95
|
await super.onCreated();
|
|
96
96
|
await this.initCounter();
|
|
97
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* 通过计数器数据,计算项状态
|
|
100
|
+
*
|
|
101
|
+
* @author zhanghengfeng
|
|
102
|
+
* @date 2024-05-16 17:05:01
|
|
103
|
+
*/
|
|
104
|
+
calcItemStateByCounter() {
|
|
105
|
+
this.state.drTabPages.forEach((item) => {
|
|
106
|
+
const visible = calcItemVisibleByCounter(item, this.counter);
|
|
107
|
+
if (visible !== void 0) {
|
|
108
|
+
item.hidden = !visible;
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
if (this.state.activeName) {
|
|
112
|
+
const { visible, defaultVisibleItem } = this.getItemVisibleState(
|
|
113
|
+
this.state.activeName
|
|
114
|
+
);
|
|
115
|
+
if (!visible && defaultVisibleItem) {
|
|
116
|
+
this.state.activeName = defaultVisibleItem.tag;
|
|
117
|
+
this.handleTabChange();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* 获取对应项的显示状态
|
|
123
|
+
*
|
|
124
|
+
* @author zhanghengfeng
|
|
125
|
+
* @date 2024-05-16 17:05:18
|
|
126
|
+
* @param {string} key
|
|
127
|
+
* @return {*} {{
|
|
128
|
+
* visible: boolean;
|
|
129
|
+
* defaultVisibleItem?: IDRTabPagesState;
|
|
130
|
+
* }}
|
|
131
|
+
*/
|
|
132
|
+
getItemVisibleState(key) {
|
|
133
|
+
let visible = true;
|
|
134
|
+
let defaultVisibleItem;
|
|
135
|
+
this.state.drTabPages.forEach((item) => {
|
|
136
|
+
if (!defaultVisibleItem && !item.hidden) {
|
|
137
|
+
defaultVisibleItem = item;
|
|
138
|
+
}
|
|
139
|
+
if (item.tag === key) {
|
|
140
|
+
visible = !item.hidden;
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
return {
|
|
144
|
+
visible,
|
|
145
|
+
defaultVisibleItem
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* 计算项权限
|
|
150
|
+
*
|
|
151
|
+
* @author zhanghengfeng
|
|
152
|
+
* @date 2024-05-16 17:05:40
|
|
153
|
+
* @param {IDRTabPagesState} item
|
|
154
|
+
* @return {*} {Promise<void>}
|
|
155
|
+
*/
|
|
156
|
+
async calcPermitted(item) {
|
|
157
|
+
var _a;
|
|
158
|
+
let permitted = true;
|
|
159
|
+
const data = ((_a = this.getData()) == null ? void 0 : _a.length) ? this.getData()[0] : void 0;
|
|
160
|
+
const visible = await calcItemVisible(
|
|
161
|
+
item,
|
|
162
|
+
this.context,
|
|
163
|
+
this.params,
|
|
164
|
+
this.model.appDataEntityId,
|
|
165
|
+
this.model.appId,
|
|
166
|
+
data
|
|
167
|
+
);
|
|
168
|
+
if (visible !== void 0) {
|
|
169
|
+
permitted = visible;
|
|
170
|
+
}
|
|
171
|
+
item.hidden = !permitted;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* 计算项状态
|
|
175
|
+
*
|
|
176
|
+
* @author zhanghengfeng
|
|
177
|
+
* @date 2024-05-16 17:05:05
|
|
178
|
+
* @return {*} {Promise<void>}
|
|
179
|
+
*/
|
|
180
|
+
async calcDrTabPagesState() {
|
|
181
|
+
await Promise.all(
|
|
182
|
+
this.state.drTabPages.map(async (item) => {
|
|
183
|
+
await this.calcPermitted(item);
|
|
184
|
+
})
|
|
185
|
+
);
|
|
186
|
+
this.calcItemStateByCounter();
|
|
187
|
+
this.state.isCalculatedPermission = true;
|
|
188
|
+
}
|
|
98
189
|
/**
|
|
99
190
|
* 加载完成
|
|
100
191
|
*
|
|
@@ -104,8 +195,13 @@ class DRTabController extends ControlController {
|
|
|
104
195
|
async onMounted() {
|
|
105
196
|
await super.onMounted();
|
|
106
197
|
if (this.form) {
|
|
107
|
-
this.form.evt.on("onLoadSuccess", (event) => {
|
|
108
|
-
|
|
198
|
+
this.form.evt.on("onLoadSuccess", async (event) => {
|
|
199
|
+
const data = event.data[0];
|
|
200
|
+
this.view.state.srfactiveviewdata = data;
|
|
201
|
+
if (data.srfreadonly) {
|
|
202
|
+
this.view.context.srfreadonly = true;
|
|
203
|
+
}
|
|
204
|
+
await this.calcDrTabPagesState();
|
|
109
205
|
this.handleFormChange();
|
|
110
206
|
});
|
|
111
207
|
this.form.evt.on("onLoadDraftSuccess", () => {
|
|
@@ -116,6 +212,9 @@ class DRTabController extends ControlController {
|
|
|
116
212
|
});
|
|
117
213
|
}
|
|
118
214
|
this.initDRTabPages();
|
|
215
|
+
if (!this.form) {
|
|
216
|
+
await this.calcDrTabPagesState();
|
|
217
|
+
}
|
|
119
218
|
}
|
|
120
219
|
/**
|
|
121
220
|
* 处理表单数据变更
|
|
@@ -177,13 +276,18 @@ class DRTabController extends ControlController {
|
|
|
177
276
|
if (item.capLanguageRes) {
|
|
178
277
|
itemCaption = ibiz.i18n.t(item.capLanguageRes.lanResTag, item.caption);
|
|
179
278
|
}
|
|
279
|
+
const { enableMode, dataAccessAction, testAppDELogicId, testScriptCode } = item;
|
|
180
280
|
drTabPages.push({
|
|
181
281
|
tag: item.id,
|
|
182
282
|
caption: itemCaption,
|
|
183
283
|
sysImage: item.sysImage,
|
|
184
284
|
hidden: false,
|
|
185
285
|
disabled: false,
|
|
186
|
-
counterId: item.counterId
|
|
286
|
+
counterId: item.counterId,
|
|
287
|
+
dataAccessAction,
|
|
288
|
+
enableMode,
|
|
289
|
+
testAppDELogicId,
|
|
290
|
+
testScriptCode
|
|
187
291
|
});
|
|
188
292
|
});
|
|
189
293
|
this.state.drTabPages = drTabPages;
|
|
@@ -213,7 +317,7 @@ class DRTabController extends ControlController {
|
|
|
213
317
|
this.openNavPosView(drBarItem, isRoutePushed);
|
|
214
318
|
} else {
|
|
215
319
|
this.setVisible("form");
|
|
216
|
-
if (this.routeDepth) {
|
|
320
|
+
if (this.routeDepth && this.state.drTabPages[0]) {
|
|
217
321
|
this.router.push(this.state.drTabPages[0].fullPath);
|
|
218
322
|
}
|
|
219
323
|
}
|
|
@@ -308,6 +412,8 @@ class DRTabController extends ControlController {
|
|
|
308
412
|
this.context,
|
|
309
413
|
{ ...this.params }
|
|
310
414
|
);
|
|
415
|
+
this.calcItemStateByCounter = this.calcItemStateByCounter.bind(this);
|
|
416
|
+
this.counter.onChange(this.calcItemStateByCounter);
|
|
311
417
|
}
|
|
312
418
|
}
|
|
313
419
|
/**
|
|
@@ -321,6 +427,7 @@ class DRTabController extends ControlController {
|
|
|
321
427
|
async onDestroyed() {
|
|
322
428
|
await super.onDestroyed();
|
|
323
429
|
if (this.counter) {
|
|
430
|
+
this.counter.offChange(this.calcItemStateByCounter);
|
|
324
431
|
this.counter.destroy();
|
|
325
432
|
}
|
|
326
433
|
}
|
|
@@ -94,13 +94,14 @@ const DRTabControl = /* @__PURE__ */ defineComponent({
|
|
|
94
94
|
let _slot;
|
|
95
95
|
const {
|
|
96
96
|
isCreated,
|
|
97
|
-
drTabPages
|
|
97
|
+
drTabPages,
|
|
98
|
+
isCalculatedPermission
|
|
98
99
|
} = this.c.state;
|
|
99
100
|
return createVNode(resolveComponent("iBizControlBase"), {
|
|
100
101
|
"controller": this.c,
|
|
101
102
|
"class": this.ns.b()
|
|
102
103
|
}, {
|
|
103
|
-
default: () => [isCreated && createVNode(resolveComponent("el-tabs"), {
|
|
104
|
+
default: () => [isCreated && isCalculatedPermission && createVNode(resolveComponent("el-tabs"), {
|
|
104
105
|
"modelValue": this.c.state.activeName,
|
|
105
106
|
"onUpdate:modelValue": ($event) => this.c.state.activeName = $event,
|
|
106
107
|
"onTabChange": this.handleTabChange
|
|
@@ -22,7 +22,6 @@ export declare const GridFieldColumn: import("vue").DefineComponent<{
|
|
|
22
22
|
codeListValue: import("vue").ComputedRef<string>;
|
|
23
23
|
tooltip: import("vue").ComputedRef<string | undefined>;
|
|
24
24
|
zIndex: number | undefined;
|
|
25
|
-
items: import("vue").Ref<readonly IData[]>;
|
|
26
25
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
26
|
controller: {
|
|
28
27
|
type: typeof GridFieldColumnController;
|
|
@@ -19,6 +19,7 @@ const GridFieldColumn = /* @__PURE__ */ defineComponent({
|
|
|
19
19
|
},
|
|
20
20
|
setup(props) {
|
|
21
21
|
const ns = useNamespace("grid-field-column");
|
|
22
|
+
const c = props.controller;
|
|
22
23
|
const zIndex = props.controller.grid.state.zIndex;
|
|
23
24
|
const onCellClick = (event) => {
|
|
24
25
|
if (props.controller.hasAction) {
|
|
@@ -51,13 +52,9 @@ const GridFieldColumn = /* @__PURE__ */ defineComponent({
|
|
|
51
52
|
const onActionClick = async (detail, event) => {
|
|
52
53
|
await props.controller.onActionClick(detail, props.row, event);
|
|
53
54
|
};
|
|
54
|
-
const items = ref([]);
|
|
55
|
-
if (props.controller.codeList) {
|
|
56
|
-
items.value = props.controller.codeListItems;
|
|
57
|
-
}
|
|
58
55
|
const fn = (data) => {
|
|
59
56
|
if (data) {
|
|
60
|
-
|
|
57
|
+
c.codeListItems = data;
|
|
61
58
|
}
|
|
62
59
|
};
|
|
63
60
|
useCodeListListen(props.controller.model.appCodeListId, props.controller.context.srfappid, fn);
|
|
@@ -72,8 +69,7 @@ const GridFieldColumn = /* @__PURE__ */ defineComponent({
|
|
|
72
69
|
formatValue,
|
|
73
70
|
codeListValue,
|
|
74
71
|
tooltip,
|
|
75
|
-
zIndex
|
|
76
|
-
items
|
|
72
|
+
zIndex
|
|
77
73
|
};
|
|
78
74
|
},
|
|
79
75
|
render() {
|
|
@@ -96,7 +92,7 @@ const GridFieldColumn = /* @__PURE__ */ defineComponent({
|
|
|
96
92
|
} else if (c.codeList) {
|
|
97
93
|
content = createVNode(resolveComponent("iBizCodeList"), {
|
|
98
94
|
"class": this.ns.e("text"),
|
|
99
|
-
"codeListItems":
|
|
95
|
+
"codeListItems": c.codeListItems,
|
|
100
96
|
"codeList": c.codeList,
|
|
101
97
|
"value": this.codeListValue,
|
|
102
98
|
"onClick": this.onTextClick,
|
|
@@ -19,7 +19,6 @@ export declare const IBizGridFieldColumn: import("@ibiz-template/vue3-util").Typ
|
|
|
19
19
|
codeListValue: import("vue").ComputedRef<string>;
|
|
20
20
|
tooltip: import("vue").ComputedRef<string | undefined>;
|
|
21
21
|
zIndex: number | undefined;
|
|
22
|
-
items: import("vue").Ref<readonly IData[]>;
|
|
23
22
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
24
23
|
controller: {
|
|
25
24
|
type: typeof import("@ibiz-template/runtime").GridFieldColumnController;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IHttpResponse } from '@ibiz-template/core';
|
|
2
|
-
import { EditorController } from '@ibiz-template/runtime';
|
|
2
|
+
import { EditorController, IAcItemProvider } from '@ibiz-template/runtime';
|
|
3
3
|
import { IAppDEACMode, IAutoComplete, IDEACModeDataItem } from '@ibiz/model-core';
|
|
4
4
|
/**
|
|
5
5
|
* 自动完成编辑器控制器
|
|
@@ -32,6 +32,14 @@ export declare class AutoCompleteEditorController extends EditorController<IAuto
|
|
|
32
32
|
* 自填数据项集合(已排除了value和text)
|
|
33
33
|
*/
|
|
34
34
|
dataItems: IDEACModeDataItem[];
|
|
35
|
+
/**
|
|
36
|
+
* 自填列表项适配器
|
|
37
|
+
*
|
|
38
|
+
* @author zhanghengfeng
|
|
39
|
+
* @date 2024-05-21 17:05:21
|
|
40
|
+
* @type {IAcItemProvider}
|
|
41
|
+
*/
|
|
42
|
+
acItemProvider?: IAcItemProvider;
|
|
35
43
|
protected onInit(): Promise<void>;
|
|
36
44
|
/**
|
|
37
45
|
* 加载实体数据集数据
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RuntimeModelError } from '@ibiz-template/core';
|
|
2
|
-
import { EditorController, getDeACMode } 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";
|
|
@@ -36,6 +36,14 @@ class AutoCompleteEditorController extends EditorController {
|
|
|
36
36
|
* 自填数据项集合(已排除了value和text)
|
|
37
37
|
*/
|
|
38
38
|
__publicField(this, "dataItems", []);
|
|
39
|
+
/**
|
|
40
|
+
* 自填列表项适配器
|
|
41
|
+
*
|
|
42
|
+
* @author zhanghengfeng
|
|
43
|
+
* @date 2024-05-21 17:05:21
|
|
44
|
+
* @type {IAcItemProvider}
|
|
45
|
+
*/
|
|
46
|
+
__publicField(this, "acItemProvider");
|
|
39
47
|
}
|
|
40
48
|
async onInit() {
|
|
41
49
|
super.onInit();
|
|
@@ -70,6 +78,9 @@ class AutoCompleteEditorController extends EditorController {
|
|
|
70
78
|
}
|
|
71
79
|
);
|
|
72
80
|
}
|
|
81
|
+
if (this.deACMode.itemSysPFPluginId) {
|
|
82
|
+
this.acItemProvider = await getAcItemProvider(this.deACMode);
|
|
83
|
+
}
|
|
73
84
|
}
|
|
74
85
|
}
|
|
75
86
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, computed, watch, resolveComponent, mergeProps, createVNode, defineComponent } from 'vue';
|
|
1
|
+
import { ref, computed, watch, resolveComponent, mergeProps, h, createVNode, defineComponent } from 'vue';
|
|
2
2
|
import { getAutoCompleteProps, getEditorEmits, useNamespace } from '@ibiz-template/vue3-util';
|
|
3
3
|
import './ibiz-autocomplete.css';
|
|
4
4
|
import { debounce } from 'lodash-es';
|
|
@@ -181,6 +181,13 @@ const IBizAutoComplete = /* @__PURE__ */ defineComponent({
|
|
|
181
181
|
default: ({
|
|
182
182
|
item
|
|
183
183
|
}) => {
|
|
184
|
+
if (this.c.acItemProvider) {
|
|
185
|
+
const component = resolveComponent(this.c.acItemProvider.component);
|
|
186
|
+
return h(component, {
|
|
187
|
+
item,
|
|
188
|
+
controller: this.c
|
|
189
|
+
});
|
|
190
|
+
}
|
|
184
191
|
return createVNode("div", {
|
|
185
192
|
"class": [this.ns.e("transfer-item"), this.ns.is("ellipsis", isEllipsis)],
|
|
186
193
|
"title": isEllipsis ? item[this.c.textName] : ""
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isVNode, ref, computed, watch, onMounted, resolveComponent, mergeProps, createVNode, defineComponent } from 'vue';
|
|
1
|
+
import { isVNode, ref, computed, watch, onMounted, resolveComponent, mergeProps, h, createVNode, defineComponent } from 'vue';
|
|
2
2
|
import { getDataPickerProps, getEditorEmits, useNamespace } from '@ibiz-template/vue3-util';
|
|
3
3
|
import './ibiz-mpicker.css';
|
|
4
4
|
import { clone } from 'lodash-es';
|
|
@@ -308,7 +308,18 @@ const IBizMPicker = /* @__PURE__ */ defineComponent({
|
|
|
308
308
|
"key": item[this.c.keyName],
|
|
309
309
|
"value": item[this.c.keyName],
|
|
310
310
|
"label": item[this.c.textName]
|
|
311
|
-
},
|
|
311
|
+
}, {
|
|
312
|
+
default: () => {
|
|
313
|
+
if (this.c.acItemProvider) {
|
|
314
|
+
const component = resolveComponent(this.c.acItemProvider.component);
|
|
315
|
+
return h(component, {
|
|
316
|
+
item,
|
|
317
|
+
controller: this.c
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
return createVNode("span", null, [item[this.c.textName] != null ? item[this.c.textName] : ""]);
|
|
321
|
+
}
|
|
322
|
+
});
|
|
312
323
|
})) ? _slot : {
|
|
313
324
|
default: () => [_slot]
|
|
314
325
|
}), !this.readonly && createVNode("div", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, computed, watch, onMounted, resolveComponent, createVNode, mergeProps, defineComponent } from 'vue';
|
|
1
|
+
import { ref, computed, watch, onMounted, resolveComponent, h, createVNode, mergeProps, defineComponent } from 'vue';
|
|
2
2
|
import { getDataPickerProps, getEditorEmits, useNamespace, renderString } from '@ibiz-template/vue3-util';
|
|
3
3
|
import { isEmpty, isNil } from 'ramda';
|
|
4
4
|
import './ibiz-picker.css';
|
|
@@ -205,6 +205,16 @@ const IBizPicker = /* @__PURE__ */ defineComponent({
|
|
|
205
205
|
context,
|
|
206
206
|
params
|
|
207
207
|
} = this.c;
|
|
208
|
+
if (this.c.acItemProvider) {
|
|
209
|
+
const component = resolveComponent(this.c.acItemProvider.component);
|
|
210
|
+
return h(component, {
|
|
211
|
+
item,
|
|
212
|
+
controller: this.c,
|
|
213
|
+
onClick: () => {
|
|
214
|
+
this.onACSelect(item);
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
}
|
|
208
218
|
return panel ? createVNode(resolveComponent("iBizControlShell"), {
|
|
209
219
|
"data": item,
|
|
210
220
|
"modelData": panel,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isVNode, ref, computed, watch, onMounted, resolveComponent, mergeProps, createVNode, defineComponent } from 'vue';
|
|
1
|
+
import { isVNode, ref, computed, watch, onMounted, resolveComponent, mergeProps, h, createVNode, defineComponent } from 'vue';
|
|
2
2
|
import { getDataPickerProps, getEditorEmits, useNamespace, renderString } from '@ibiz-template/vue3-util';
|
|
3
3
|
import { isNil, clone } from 'ramda';
|
|
4
4
|
import './ibiz-picker-dropdown.css';
|
|
@@ -240,7 +240,18 @@ const IBizPickerDropDown = /* @__PURE__ */ defineComponent({
|
|
|
240
240
|
"value": item[this.c.keyName],
|
|
241
241
|
"key": item[this.c.keyName],
|
|
242
242
|
"label": item[this.c.textName]
|
|
243
|
-
},
|
|
243
|
+
}, {
|
|
244
|
+
default: () => {
|
|
245
|
+
if (this.c.acItemProvider) {
|
|
246
|
+
const component = resolveComponent(this.c.acItemProvider.component);
|
|
247
|
+
return h(component, {
|
|
248
|
+
item,
|
|
249
|
+
controller: this.c
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
return createVNode("span", null, [item[this.c.textName] != null ? item[this.c.textName] : ""]);
|
|
253
|
+
}
|
|
254
|
+
});
|
|
244
255
|
})) ? _slot : {
|
|
245
256
|
default: () => [_slot]
|
|
246
257
|
});
|