@ibiz-template/vue3-components 0.7.14 → 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/{wang-editor-PQvDXaA9.js → wang-editor-XpJH4SXt.js} +1 -1
- package/dist/{xlsx-util-OfvrEAre.js → xlsx-util-MJWwC396.js} +1 -1
- package/es/common/carousel/carousel.d.ts +5 -5
- package/es/common/carousel/carousel.mjs +2 -2
- package/es/common/carousel-card/carousel-card.css +1 -1
- package/es/control/context-menu/context-menu.d.ts +0 -1
- package/es/control/context-menu/context-menu.mjs +26 -15
- package/es/control/context-menu/index.d.ts +0 -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/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.css +1 -1
- package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.mjs +1 -2
- package/es/editor/html/wang-editor/wang-editor.css +1 -1
- package/es/editor/html/wang-editor/wang-editor.mjs +2 -2
- package/es/editor/text-box/input/input.css +1 -1
- package/es/locale/index.d.ts +72 -1
- package/es/locale/index.mjs +64 -1
- package/es/panel-component/panel-static-carousel/index.d.ts +1 -1
- package/es/panel-component/panel-static-carousel/panel-static-carousel.css +1 -0
- package/es/panel-component/panel-static-carousel/panel-static-carousel.d.ts +1 -1
- package/es/panel-component/panel-static-carousel/panel-static-carousel.mjs +8 -8
- package/es/panel-component/short-cut/index.d.ts +2 -2
- package/es/panel-component/short-cut/short-cut.css +1 -1
- package/es/panel-component/short-cut/short-cut.d.ts +2 -2
- package/es/panel-component/short-cut/short-cut.mjs +26 -23
- package/es/view-engine/edit-view.engine.mjs +5 -1
- package/es/view-engine/opt-view.engine.mjs +5 -1
- package/lib/common/carousel/carousel.cjs +2 -2
- package/lib/common/carousel-card/carousel-card.css +1 -1
- package/lib/control/context-menu/context-menu.cjs +25 -14
- 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/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.cjs +1 -2
- package/lib/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.css +1 -1
- package/lib/editor/html/wang-editor/wang-editor.cjs +2 -2
- package/lib/editor/html/wang-editor/wang-editor.css +1 -1
- package/lib/editor/text-box/input/input.css +1 -1
- package/lib/locale/index.cjs +64 -1
- package/lib/panel-component/panel-static-carousel/panel-static-carousel.cjs +8 -8
- package/lib/panel-component/panel-static-carousel/panel-static-carousel.css +1 -0
- package/lib/panel-component/short-cut/short-cut.cjs +26 -23
- package/lib/panel-component/short-cut/short-cut.css +1 -1
- package/lib/view-engine/edit-view.engine.cjs +5 -1
- package/lib/view-engine/opt-view.engine.cjs +5 -1
- package/package.json +7 -7
- package/dist/index-8tvyarHw.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ref } from 'vue';
|
|
1
|
+
import { Ref, PropType } from 'vue';
|
|
2
2
|
import './carousel.scss';
|
|
3
3
|
export declare const IBizCarouselComponent: import("vue").DefineComponent<{
|
|
4
4
|
carouselData: {
|
|
@@ -62,8 +62,8 @@ export declare const IBizCarouselComponent: import("vue").DefineComponent<{
|
|
|
62
62
|
type: NumberConstructor;
|
|
63
63
|
default: number;
|
|
64
64
|
};
|
|
65
|
-
|
|
66
|
-
type:
|
|
65
|
+
showMode: {
|
|
66
|
+
type: PropType<"DEFAULT" | "CARD">;
|
|
67
67
|
required: true;
|
|
68
68
|
};
|
|
69
69
|
}, {
|
|
@@ -131,8 +131,8 @@ export declare const IBizCarouselComponent: import("vue").DefineComponent<{
|
|
|
131
131
|
type: NumberConstructor;
|
|
132
132
|
default: number;
|
|
133
133
|
};
|
|
134
|
-
|
|
135
|
-
type:
|
|
134
|
+
showMode: {
|
|
135
|
+
type: PropType<"DEFAULT" | "CARD">;
|
|
136
136
|
required: true;
|
|
137
137
|
};
|
|
138
138
|
}>>, {
|
|
@@ -21,7 +21,7 @@ const IBizCarouselComponent = /* @__PURE__ */ defineComponent({
|
|
|
21
21
|
type: Number,
|
|
22
22
|
default: 3e3
|
|
23
23
|
},
|
|
24
|
-
|
|
24
|
+
showMode: {
|
|
25
25
|
type: String,
|
|
26
26
|
required: true
|
|
27
27
|
}
|
|
@@ -61,7 +61,7 @@ const IBizCarouselComponent = /* @__PURE__ */ defineComponent({
|
|
|
61
61
|
}, null);
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
|
-
return createVNode("div", null, [this.
|
|
64
|
+
return createVNode("div", null, [this.showMode === "CARD" ? createVNode(resolveComponent("IBizCarousel-card"), {
|
|
65
65
|
"swipeData": this.swipeData,
|
|
66
66
|
"isAuto": this.isAuto,
|
|
67
67
|
"timeSpan": this.timeSpan
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-carousel-card{position:relative;z-index:1;padding:0;margin-right:auto;margin-left:auto;overflow:hidden;list-style:none}.ibiz-carousel-card__swiper-list{position:relative;z-index:1;padding:0;margin-right:auto;margin-left:auto;overflow:hidden;list-style:none}.ibiz-carousel-card__swiper-main{position:relative;z-index:1;box-sizing:content-box;display:flex;width:100%;height:100%;transition:transform .5s ease-in-out;transition-property:transform}.ibiz-carousel-card__swiper-main img{display:block;display:inline-block;flex-shrink:0;border-radius:4px;box-shadow:0 4px 8px 0 rgba(0,0,0,.2),0 6px 20px 0 rgba(0,0,0,.19)}.ibiz-carousel-card__leftBtn{position:absolute;top:0;left:0;z-index:2;height:100%;background-image:linear-gradient(90deg,#fff
|
|
1
|
+
.ibiz-carousel-card{position:relative;z-index:1;padding:0;margin-right:auto;margin-left:auto;overflow:hidden;list-style:none}.ibiz-carousel-card__swiper-list{position:relative;z-index:1;padding:0;margin-right:auto;margin-left:auto;overflow:hidden;list-style:none}.ibiz-carousel-card__swiper-main{position:relative;z-index:1;box-sizing:content-box;display:flex;width:100%;height:100%;transition:transform .5s ease-in-out;transition-property:transform}.ibiz-carousel-card__swiper-main img{display:block;display:inline-block;flex-shrink:0;border-radius:4px;box-shadow:0 4px 8px 0 rgba(0,0,0,.2),0 6px 20px 0 rgba(0,0,0,.19)}.ibiz-carousel-card__leftBtn{position:absolute;top:0;left:0;z-index:2;height:100%;background-image:linear-gradient(90deg,#fff 0,rgba(255,255,255,0));transition:.4s}.ibiz-carousel-card__rightBtn{position:absolute;top:0;right:0;z-index:2;height:100%;background-image:linear-gradient(270deg,#fff 0,rgba(255,255,255,0));transition:.4s}.ibiz-carousel-card__dot{z-index:1;display:flex;justify-content:center;margin-top:20px}.ibiz-carousel-card__dot-item{width:8px;height:8px;margin-right:8px;cursor:pointer;background:#eee;border-radius:4px;transition:all .5s ease}.ibiz-carousel-card__dot-item.isActive{width:16px;background:#6698ff}
|
|
@@ -34,7 +34,6 @@ export declare const ContextMenuControl: import("vue").DefineComponent<{
|
|
|
34
34
|
}, {
|
|
35
35
|
c: ContextMenuController;
|
|
36
36
|
ns: import("@ibiz-template/core").Namespace;
|
|
37
|
-
visible: import("vue").ComputedRef<boolean>;
|
|
38
37
|
expandDetails: Ref<IDETBUIActionItem[]>;
|
|
39
38
|
groupDetails: Ref<IDETBUIActionItem[]>;
|
|
40
39
|
groupButtonRef: Ref<any>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isVNode, ref,
|
|
1
|
+
import { isVNode, ref, watch, resolveComponent, createVNode, defineComponent } from 'vue';
|
|
2
2
|
import { useControlController, useNamespace } from '@ibiz-template/vue3-util';
|
|
3
3
|
import './context-menu.css';
|
|
4
4
|
import { ContextMenuController } from '@ibiz-template/runtime';
|
|
@@ -55,10 +55,6 @@ const ContextMenuControl = /* @__PURE__ */ defineComponent({
|
|
|
55
55
|
const groupButtonRef = ref();
|
|
56
56
|
const dropdownRef = ref();
|
|
57
57
|
const popoverVisible = ref(false);
|
|
58
|
-
const visible = computed(() => {
|
|
59
|
-
const index = groupDetails.value.findIndex((item) => c.state.buttonsState[item.id].visible);
|
|
60
|
-
return index !== -1;
|
|
61
|
-
});
|
|
62
58
|
const transformLanguage = (items) => {
|
|
63
59
|
if (!Array.isArray(items)) {
|
|
64
60
|
return;
|
|
@@ -110,7 +106,6 @@ const ContextMenuControl = /* @__PURE__ */ defineComponent({
|
|
|
110
106
|
return {
|
|
111
107
|
c,
|
|
112
108
|
ns,
|
|
113
|
-
visible,
|
|
114
109
|
expandDetails,
|
|
115
110
|
groupDetails,
|
|
116
111
|
groupButtonRef,
|
|
@@ -196,17 +191,24 @@ const ContextMenuControl = /* @__PURE__ */ defineComponent({
|
|
|
196
191
|
return null;
|
|
197
192
|
});
|
|
198
193
|
};
|
|
199
|
-
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
if (this.mode === "buttons") {
|
|
194
|
+
const renderGroup = () => {
|
|
203
195
|
let _slot;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
196
|
+
if (this.groupDetails.length === 0) {
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
const pvisible = this.groupDetails.findIndex((item) => {
|
|
200
|
+
return this.c.state.buttonsState[item.id].visible === true;
|
|
201
|
+
}) !== -1;
|
|
202
|
+
if (!pvisible) {
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
const pdisabled = this.groupDetails.findIndex((item) => {
|
|
206
|
+
return this.c.state.buttonsState[item.id].disabled === false;
|
|
207
|
+
}) === -1;
|
|
208
|
+
return [createVNode(resolveComponent("el-button"), {
|
|
208
209
|
"size": "small",
|
|
209
210
|
"text": true,
|
|
211
|
+
"disabled": pdisabled,
|
|
210
212
|
"ref": "groupButtonRef",
|
|
211
213
|
"class": [this.ns.e("item"), this.ns.is("expand", this.popoverVisible)]
|
|
212
214
|
}, {
|
|
@@ -225,7 +227,16 @@ const ContextMenuControl = /* @__PURE__ */ defineComponent({
|
|
|
225
227
|
"transition": "none"
|
|
226
228
|
}, _isSlot(_slot = renderActions(this.groupDetails, false)) ? _slot : {
|
|
227
229
|
default: () => [_slot]
|
|
228
|
-
})]
|
|
230
|
+
})];
|
|
231
|
+
};
|
|
232
|
+
if (!this.c.state.buttonsState.visible) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
if (this.mode === "buttons") {
|
|
236
|
+
return createVNode("div", {
|
|
237
|
+
"class": [this.ns.b(), this.ns.m("buttons")],
|
|
238
|
+
"onClick": (e) => e.stopPropagation()
|
|
239
|
+
}, [renderActions(this.expandDetails), renderGroup()]);
|
|
229
240
|
}
|
|
230
241
|
return createVNode(resolveComponent("el-dropdown"), {
|
|
231
242
|
"ref": "dropdownRef",
|
|
@@ -30,7 +30,6 @@ export declare const IBizContextMenuControl: import("@ibiz-template/vue3-util").
|
|
|
30
30
|
}, {
|
|
31
31
|
c: import("@ibiz-template/runtime").ContextMenuController;
|
|
32
32
|
ns: import("@ibiz-template/core").Namespace;
|
|
33
|
-
visible: import("vue").ComputedRef<boolean>;
|
|
34
33
|
expandDetails: import("vue").Ref<import("@ibiz/model-core").IDETBUIActionItem[]>;
|
|
35
34
|
groupDetails: import("vue").Ref<import("@ibiz/model-core").IDETBUIActionItem[]>;
|
|
36
35
|
groupButtonRef: import("vue").Ref<any>;
|
|
@@ -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;
|