@ibiz-template/vue3-components 0.7.15 → 0.7.16-alpha.0
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-dATrePJW.js +4 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{xlsx-util-5nNxB32e.js → xlsx-util-MJWwC396.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/locale/index.d.ts +72 -1
- package/es/locale/index.mjs +64 -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/locale/index.cjs +64 -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;
|
package/es/locale/index.d.ts
CHANGED
|
@@ -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 };
|