@ibiz-template/vue3-components 0.7.3 → 0.7.5
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-QdhEqiEH.js +4 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{xlsx-util-bB9hH3iO.js → xlsx-util-iqcGVBHE.js} +1 -1
- package/es/common/rawitem/rawitem.mjs +5 -3
- package/es/common/view-message/view-message.d.ts +1 -0
- package/es/common/view-message/view-message.mjs +5 -1
- package/es/control/app-menu/app-menu.mjs +5 -3
- package/es/control/drbar/drbar.mjs +9 -4
- package/es/control/drtab/drtab.controller.mjs +3 -0
- package/es/control/drtab/drtab.mjs +17 -5
- package/es/control/form/form-detail/form-tab-panel/form-tab-panel.mjs +5 -4
- package/es/control/grid/grid/grid-control.util.d.ts +3 -0
- package/es/control/grid/grid/grid-control.util.mjs +97 -1
- package/es/control/grid/grid/grid.mjs +8 -1
- package/es/control/grid/grid/index.mjs +1 -1
- package/es/control/grid/grid-column/grid-field-column/grid-field-column.d.ts +2 -0
- package/es/control/grid/grid-column/grid-field-column/grid-field-column.mjs +18 -5
- package/es/control/grid/grid-column/grid-field-column/index.d.ts +2 -0
- package/es/control/grid/index.mjs +1 -1
- package/es/control/index.mjs +1 -1
- package/es/control/tree/tree.mjs +9 -4
- package/es/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.mjs +1 -1
- package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.mjs +7 -1
- package/es/editor/code/monaco-editor/monaco-editor.mjs +13 -1
- package/es/editor/data-picker/ibiz-picker/ibiz-picker.mjs +1 -1
- package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.mjs +7 -1
- package/es/editor/list-box/ibiz-list-box/ibiz-list-box.mjs +7 -1
- package/es/editor/radio-button-list/ibiz-radio/ibiz-radio.mjs +7 -1
- package/es/editor/span/span/span.mjs +7 -1
- package/es/index.mjs +1 -1
- package/es/panel-component/nav-pos-index/nav-pos-index.controller.d.ts +27 -0
- package/es/panel-component/nav-pos-index/nav-pos-index.controller.mjs +43 -0
- package/es/panel-component/nav-pos-index/nav-pos-index.mjs +3 -0
- package/es/panel-component/user-action/user-action.mjs +6 -0
- package/es/web-app/router/index.mjs +44 -2
- package/lib/common/rawitem/rawitem.cjs +5 -3
- package/lib/common/view-message/view-message.cjs +5 -1
- package/lib/control/app-menu/app-menu.cjs +5 -3
- package/lib/control/drbar/drbar.cjs +8 -3
- package/lib/control/drtab/drtab.cjs +16 -4
- package/lib/control/drtab/drtab.controller.cjs +3 -0
- package/lib/control/form/form-detail/form-tab-panel/form-tab-panel.cjs +5 -4
- package/lib/control/grid/grid/grid-control.util.cjs +97 -0
- package/lib/control/grid/grid/grid.cjs +7 -0
- package/lib/control/grid/grid/index.cjs +1 -0
- package/lib/control/grid/grid-column/grid-field-column/grid-field-column.cjs +16 -3
- package/lib/control/grid/index.cjs +1 -0
- package/lib/control/index.cjs +1 -0
- package/lib/control/tree/tree.cjs +8 -3
- package/lib/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.cjs +1 -1
- package/lib/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.cjs +6 -0
- package/lib/editor/code/monaco-editor/monaco-editor.cjs +13 -1
- package/lib/editor/data-picker/ibiz-picker/ibiz-picker.cjs +1 -1
- package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.cjs +6 -0
- package/lib/editor/list-box/ibiz-list-box/ibiz-list-box.cjs +6 -0
- package/lib/editor/radio-button-list/ibiz-radio/ibiz-radio.cjs +6 -0
- package/lib/editor/span/span/span.cjs +6 -0
- package/lib/index.cjs +1 -0
- package/lib/panel-component/nav-pos-index/nav-pos-index.cjs +3 -0
- package/lib/panel-component/nav-pos-index/nav-pos-index.controller.cjs +43 -0
- package/lib/panel-component/user-action/user-action.cjs +6 -0
- package/lib/web-app/router/index.cjs +44 -2
- package/package.json +6 -6
- package/dist/index-GhyQOvbY.js +0 -4
package/es/index.mjs
CHANGED
|
@@ -17,7 +17,7 @@ export { IBizSplitTrigger } from './common/split-trigger/split-trigger.mjs';
|
|
|
17
17
|
export { IBizSortBar } from './common/sort-bar/sort-bar.mjs';
|
|
18
18
|
export { IBizAppMenuControl } from './control/app-menu/index.mjs';
|
|
19
19
|
export { IBizAppMenuIconViewControl } from './control/app-menu-icon-view/index.mjs';
|
|
20
|
-
export { useAppGridBase, useAppGridPagination, useGridHeaderStyle, useITableEvent } from './control/grid/grid/grid-control.util.mjs';
|
|
20
|
+
export { useAppGridBase, useAppGridPagination, useGridDraggable, useGridHeaderStyle, useITableEvent } from './control/grid/grid/grid-control.util.mjs';
|
|
21
21
|
export { IBizGridControl } from './control/grid/grid/index.mjs';
|
|
22
22
|
export { IBizGridFieldColumn } from './control/grid/grid-column/grid-field-column/index.mjs';
|
|
23
23
|
export { IBizGridUAColumn } from './control/grid/grid-column/grid-ua-column/index.mjs';
|
|
@@ -35,6 +35,14 @@ export declare class NavPosIndexController extends PanelItemController<IPanelRaw
|
|
|
35
35
|
* @type {boolean}
|
|
36
36
|
*/
|
|
37
37
|
autoGoLast: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* 无缓存
|
|
40
|
+
* @author lxm
|
|
41
|
+
* @date 2024-04-22 04:12:41
|
|
42
|
+
* @readonly
|
|
43
|
+
* @type {boolean}
|
|
44
|
+
*/
|
|
45
|
+
noCache: boolean;
|
|
38
46
|
protected createState(): NavPosIndexState;
|
|
39
47
|
setRouter(router: Router): void;
|
|
40
48
|
/**
|
|
@@ -60,6 +68,16 @@ export declare class NavPosIndexController extends PanelItemController<IPanelRaw
|
|
|
60
68
|
* @type {(IAppMenuController | undefined)}
|
|
61
69
|
*/
|
|
62
70
|
get appmenu(): IAppMenuController | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* 自定义补充参数
|
|
73
|
+
*
|
|
74
|
+
* @author zk
|
|
75
|
+
* @date 2023-09-27 03:09:02
|
|
76
|
+
* @type {IData}
|
|
77
|
+
* @memberof NavPosController
|
|
78
|
+
*/
|
|
79
|
+
rawItemParams: IData;
|
|
80
|
+
protected onInit(): Promise<void>;
|
|
63
81
|
/**
|
|
64
82
|
* 改变显示视图
|
|
65
83
|
* @author lxm
|
|
@@ -124,4 +142,13 @@ export declare class NavPosIndexController extends PanelItemController<IPanelRaw
|
|
|
124
142
|
* @protected
|
|
125
143
|
*/
|
|
126
144
|
protected goLast(): void;
|
|
145
|
+
/**
|
|
146
|
+
* 处理自定义补充参数 [{key:'name',value:'data'}] => {name:'data'}
|
|
147
|
+
*
|
|
148
|
+
* @author zk
|
|
149
|
+
* @date 2023-09-27 03:09:55
|
|
150
|
+
* @protected
|
|
151
|
+
* @memberof NavPosController
|
|
152
|
+
*/
|
|
153
|
+
protected handleRawItemParams(): void;
|
|
127
154
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PanelItemController, ViewMode, Modal } from '@ibiz-template/runtime';
|
|
2
2
|
import { routerCallback } from '@ibiz-template/vue3-util';
|
|
3
|
+
import { notNilEmpty } from 'qx-util';
|
|
3
4
|
import { NavPosIndexState } from './nav-pos-index.state.mjs';
|
|
4
5
|
|
|
5
6
|
"use strict";
|
|
@@ -33,6 +34,23 @@ class NavPosIndexController extends PanelItemController {
|
|
|
33
34
|
* @type {boolean}
|
|
34
35
|
*/
|
|
35
36
|
__publicField(this, "autoGoLast", true);
|
|
37
|
+
/**
|
|
38
|
+
* 无缓存
|
|
39
|
+
* @author lxm
|
|
40
|
+
* @date 2024-04-22 04:12:41
|
|
41
|
+
* @readonly
|
|
42
|
+
* @type {boolean}
|
|
43
|
+
*/
|
|
44
|
+
__publicField(this, "noCache", false);
|
|
45
|
+
/**
|
|
46
|
+
* 自定义补充参数
|
|
47
|
+
*
|
|
48
|
+
* @author zk
|
|
49
|
+
* @date 2023-09-27 03:09:02
|
|
50
|
+
* @type {IData}
|
|
51
|
+
* @memberof NavPosController
|
|
52
|
+
*/
|
|
53
|
+
__publicField(this, "rawItemParams", {});
|
|
36
54
|
}
|
|
37
55
|
createState() {
|
|
38
56
|
var _a;
|
|
@@ -70,6 +88,11 @@ class NavPosIndexController extends PanelItemController {
|
|
|
70
88
|
get appmenu() {
|
|
71
89
|
return this.panel.getController("appmenu");
|
|
72
90
|
}
|
|
91
|
+
async onInit() {
|
|
92
|
+
await super.onInit();
|
|
93
|
+
this.handleRawItemParams();
|
|
94
|
+
this.noCache = this.rawItemParams.expcache === "NO_CACHE";
|
|
95
|
+
}
|
|
73
96
|
/**
|
|
74
97
|
* 改变显示视图
|
|
75
98
|
* @author lxm
|
|
@@ -248,6 +271,26 @@ class NavPosIndexController extends PanelItemController {
|
|
|
248
271
|
ibiz.util.setBrowserTitle("");
|
|
249
272
|
}
|
|
250
273
|
}
|
|
274
|
+
/**
|
|
275
|
+
* 处理自定义补充参数 [{key:'name',value:'data'}] => {name:'data'}
|
|
276
|
+
*
|
|
277
|
+
* @author zk
|
|
278
|
+
* @date 2023-09-27 03:09:55
|
|
279
|
+
* @protected
|
|
280
|
+
* @memberof NavPosController
|
|
281
|
+
*/
|
|
282
|
+
handleRawItemParams() {
|
|
283
|
+
var _a;
|
|
284
|
+
let params = {};
|
|
285
|
+
const rawItemParams = (_a = this.model.rawItem) == null ? void 0 : _a.rawItemParams;
|
|
286
|
+
if (notNilEmpty(rawItemParams)) {
|
|
287
|
+
params = rawItemParams.reduce((param, item) => {
|
|
288
|
+
param[item.key.toLowerCase()] = item.value;
|
|
289
|
+
return param;
|
|
290
|
+
}, {});
|
|
291
|
+
}
|
|
292
|
+
Object.assign(this.rawItemParams, params);
|
|
293
|
+
}
|
|
251
294
|
}
|
|
252
295
|
|
|
253
296
|
export { NavPosIndexController };
|
|
@@ -69,6 +69,9 @@ const NavPosIndex = /* @__PURE__ */ defineComponent({
|
|
|
69
69
|
default: ({
|
|
70
70
|
Component
|
|
71
71
|
}) => {
|
|
72
|
+
if (this.c.noCache) {
|
|
73
|
+
return Component ? createVNode(Component, null, null) : null;
|
|
74
|
+
}
|
|
72
75
|
return createVNode(resolveComponent("keepAlive"), {
|
|
73
76
|
"include": cacheKeys,
|
|
74
77
|
"max": 30,
|
|
@@ -45,6 +45,12 @@ const UserAction = /* @__PURE__ */ defineComponent({
|
|
|
45
45
|
return item.id === id;
|
|
46
46
|
});
|
|
47
47
|
if (targetMenu) {
|
|
48
|
+
if (targetMenu.accessKey) {
|
|
49
|
+
const app = await ibiz.hub.getApp(c.panel.context.srfappid);
|
|
50
|
+
const permitted = app.authority.calcByResCode(targetMenu.accessKey);
|
|
51
|
+
if (!permitted)
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
48
54
|
const tempContext = c.panel.context.clone();
|
|
49
55
|
const tempParam = c.panel.params;
|
|
50
56
|
tempContext.srfappid = targetMenu.appId || ibiz.env.appId;
|
|
@@ -146,7 +146,49 @@ class AppRouter {
|
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
148
|
path: ":view6(".concat(viewReg, ")/:params6(").concat(paramReg, ")"),
|
|
149
|
-
component: RouterShell
|
|
149
|
+
component: RouterShell,
|
|
150
|
+
children: [
|
|
151
|
+
{
|
|
152
|
+
path: "error/:code",
|
|
153
|
+
name: "errorView7",
|
|
154
|
+
component: ErrorView
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
path: "".concat(RouteConst.ROUTE_MODAL_TAG, "/:modalView(").concat(viewReg, ")/:modalParams(").concat(paramReg, ")"),
|
|
158
|
+
components: {
|
|
159
|
+
[RouteConst.ROUTE_MODAL_TAG]: ModalRouterShell
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
path: ":view7(".concat(viewReg, ")/:params7(").concat(paramReg, ")"),
|
|
164
|
+
component: RouterShell,
|
|
165
|
+
children: [
|
|
166
|
+
{
|
|
167
|
+
path: "error/:code",
|
|
168
|
+
name: "errorView8",
|
|
169
|
+
component: ErrorView
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
path: "".concat(RouteConst.ROUTE_MODAL_TAG, "/:modalView(").concat(viewReg, ")/:modalParams(").concat(paramReg, ")"),
|
|
173
|
+
components: {
|
|
174
|
+
[RouteConst.ROUTE_MODAL_TAG]: ModalRouterShell
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
path: ":view8(".concat(viewReg, ")/:params8(").concat(paramReg, ")"),
|
|
179
|
+
component: RouterShell
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
path: ":pathMatch(.*)*",
|
|
183
|
+
redirect: { name: "errorView8" }
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
path: ":pathMatch(.*)*",
|
|
189
|
+
redirect: { name: "errorView7" }
|
|
190
|
+
}
|
|
191
|
+
]
|
|
150
192
|
},
|
|
151
193
|
{
|
|
152
194
|
path: ":pathMatch(.*)*",
|
|
@@ -156,7 +198,7 @@ class AppRouter {
|
|
|
156
198
|
},
|
|
157
199
|
{
|
|
158
200
|
path: ":pathMatch(.*)*",
|
|
159
|
-
redirect: { name: "
|
|
201
|
+
redirect: { name: "errorView5" }
|
|
160
202
|
}
|
|
161
203
|
]
|
|
162
204
|
},
|
|
@@ -31,7 +31,7 @@ const IBizRawItem = /* @__PURE__ */ vue.defineComponent({
|
|
|
31
31
|
}
|
|
32
32
|
const rawItemType = vue.ref(props.type || contentType || "");
|
|
33
33
|
const rawItemContent = vue.ref("");
|
|
34
|
-
let sysImage
|
|
34
|
+
let sysImage;
|
|
35
35
|
if (contentType === "IMAGE") {
|
|
36
36
|
sysImage = rawItem.sysImage;
|
|
37
37
|
}
|
|
@@ -71,7 +71,7 @@ const IBizRawItem = /* @__PURE__ */ vue.defineComponent({
|
|
|
71
71
|
const rawItemText = vue.ref("");
|
|
72
72
|
const convertValue = () => {
|
|
73
73
|
if (rawItemType.value === "IMAGE") {
|
|
74
|
-
if (typeof props.content === "string") {
|
|
74
|
+
if (props.content && typeof props.content === "string") {
|
|
75
75
|
if (isImg(props.content)) {
|
|
76
76
|
rawItemContent.value = {
|
|
77
77
|
imagePath: props.content
|
|
@@ -81,6 +81,8 @@ const IBizRawItem = /* @__PURE__ */ vue.defineComponent({
|
|
|
81
81
|
cssClass: props.content
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
+
} else if (sysImage) {
|
|
85
|
+
rawItemContent.value = sysImage;
|
|
84
86
|
}
|
|
85
87
|
}
|
|
86
88
|
if (["TEXT", "HEADING1", "HEADING2", "HEADING3", "HEADING4", "HEADING5", "HEADING6", "PARAGRAPH", "HTML", "RAW"].includes(rawItemType.value)) {
|
|
@@ -124,7 +126,7 @@ const IBizRawItem = /* @__PURE__ */ vue.defineComponent({
|
|
|
124
126
|
};
|
|
125
127
|
convertValue();
|
|
126
128
|
vue.watch(() => props.content, (newVal, oldVal) => {
|
|
127
|
-
if (newVal !== oldVal) {
|
|
129
|
+
if (newVal && newVal !== oldVal) {
|
|
128
130
|
rawItemContent.value = newVal;
|
|
129
131
|
convertValue();
|
|
130
132
|
}
|
|
@@ -69,11 +69,15 @@ const ViewMessage = /* @__PURE__ */ vue.defineComponent({
|
|
|
69
69
|
});
|
|
70
70
|
const handleAlertClose = (index) => {
|
|
71
71
|
items.value[index].hidden = true;
|
|
72
|
-
const isHiddenCarouse = items.value.every((
|
|
72
|
+
const isHiddenCarouse = items.value.every((item2) => item2.hidden);
|
|
73
73
|
if (isHiddenCarouse) {
|
|
74
74
|
isHiddenContainer.value = true;
|
|
75
75
|
}
|
|
76
76
|
uuid.value = qxUtil.createUUID();
|
|
77
|
+
const item = items.value[index];
|
|
78
|
+
if (item.removeMode === 1) {
|
|
79
|
+
localStorage.setItem(item.key, "1");
|
|
80
|
+
}
|
|
77
81
|
};
|
|
78
82
|
const handleChange = (index) => {
|
|
79
83
|
initialIndex.value = index;
|
|
@@ -192,6 +192,9 @@ const AppMenuControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
192
192
|
defaultActive.value = activeMenu ? activeMenu.id : "";
|
|
193
193
|
}
|
|
194
194
|
});
|
|
195
|
+
const fn = (data) => {
|
|
196
|
+
counterData.value = data;
|
|
197
|
+
};
|
|
195
198
|
c.evt.on("onMounted", async () => {
|
|
196
199
|
const allItems = c.getAllItems();
|
|
197
200
|
const defaultActiveMenuItem = allItems.find((item) => {
|
|
@@ -216,13 +219,12 @@ const AppMenuControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
216
219
|
if (counterRefId) {
|
|
217
220
|
counter = c.getCounter(counterRefId);
|
|
218
221
|
if (counter) {
|
|
219
|
-
counter.onChange(
|
|
220
|
-
counterData.value = data;
|
|
221
|
-
});
|
|
222
|
+
counter.onChange(fn);
|
|
222
223
|
}
|
|
223
224
|
}
|
|
224
225
|
});
|
|
225
226
|
vue.onUnmounted(() => {
|
|
227
|
+
counter == null ? void 0 : counter.offChange(fn);
|
|
226
228
|
counter == null ? void 0 : counter.destroy();
|
|
227
229
|
});
|
|
228
230
|
const menuMode = vue.computed(() => {
|
|
@@ -46,13 +46,18 @@ const DRBarControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
46
46
|
const ns = vue3Util.useNamespace("control-".concat(c.model.controlType.toLowerCase()));
|
|
47
47
|
const router = vueRouter.useRouter();
|
|
48
48
|
const counterData = vue.reactive({});
|
|
49
|
+
const fn = (counter) => {
|
|
50
|
+
Object.assign(counterData, counter);
|
|
51
|
+
};
|
|
49
52
|
c.evt.on("onCreated", () => {
|
|
50
53
|
if (c.counter) {
|
|
51
|
-
c.counter.onChange(
|
|
52
|
-
Object.assign(counterData, counter);
|
|
53
|
-
}, true);
|
|
54
|
+
c.counter.onChange(fn, true);
|
|
54
55
|
}
|
|
55
56
|
});
|
|
57
|
+
vue.onUnmounted(() => {
|
|
58
|
+
var _a;
|
|
59
|
+
(_a = c.counter) == null ? void 0 : _a.offChange(fn);
|
|
60
|
+
});
|
|
56
61
|
c.setRouter(router);
|
|
57
62
|
const handleSelect = (key) => {
|
|
58
63
|
c.handleSelectChange(key);
|
|
@@ -36,13 +36,18 @@ const DRTabControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
36
36
|
const ns = vue3Util.useNamespace("control-".concat(c.model.controlType.toLowerCase()));
|
|
37
37
|
const router = vueRouter.useRouter();
|
|
38
38
|
const counterData = vue.reactive({});
|
|
39
|
+
const fn = (counter) => {
|
|
40
|
+
Object.assign(counterData, counter);
|
|
41
|
+
};
|
|
39
42
|
c.evt.on("onCreated", () => {
|
|
40
43
|
if (c.counter) {
|
|
41
|
-
c.counter.onChange(
|
|
42
|
-
Object.assign(counterData, counter);
|
|
43
|
-
}, true);
|
|
44
|
+
c.counter.onChange(fn, true);
|
|
44
45
|
}
|
|
45
46
|
});
|
|
47
|
+
vue.onUnmounted(() => {
|
|
48
|
+
var _a;
|
|
49
|
+
(_a = c.counter) == null ? void 0 : _a.offChange(fn);
|
|
50
|
+
});
|
|
46
51
|
c.setRouter(router);
|
|
47
52
|
const handleTabChange = () => {
|
|
48
53
|
c.handleTabChange();
|
|
@@ -62,10 +67,17 @@ const DRTabControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
62
67
|
const {
|
|
63
68
|
srfnav
|
|
64
69
|
} = routePath.pathNodes[depth - 1];
|
|
70
|
+
const isRoutePushed = !!c.routeDepth && runtime.hasSubRoute(c.routeDepth);
|
|
65
71
|
if (srfnav && c.state.activeName && c.state.activeName !== srfnav) {
|
|
66
72
|
c.state.activeName = srfnav;
|
|
67
|
-
const isRoutePushed = !!c.routeDepth && runtime.hasSubRoute(c.routeDepth);
|
|
68
73
|
c.handleTabChange(isRoutePushed);
|
|
74
|
+
} else if (!srfnav) {
|
|
75
|
+
const routeNoSub = !!c.routeDepth && !runtime.hasSubRoute(c.routeDepth);
|
|
76
|
+
const doTabChange = c.state.activeName !== c.state.defaultName || routeNoSub;
|
|
77
|
+
if (doTabChange) {
|
|
78
|
+
c.state.activeName = c.state.defaultName;
|
|
79
|
+
c.handleTabChange(isRoutePushed);
|
|
80
|
+
}
|
|
69
81
|
}
|
|
70
82
|
}
|
|
71
83
|
}
|
|
@@ -170,6 +170,9 @@ class DRTabController extends runtime.ControlController {
|
|
|
170
170
|
sysImage: editItemSysImage,
|
|
171
171
|
fullPath: this.routeDepth ? vue3Util.getNestedRoutePath(this.router.currentRoute.value, this.routeDepth) : ""
|
|
172
172
|
});
|
|
173
|
+
this.state.defaultName = "";
|
|
174
|
+
} else {
|
|
175
|
+
this.state.defaultName = (dedrtabPages == null ? void 0 : dedrtabPages[0].id) || "";
|
|
173
176
|
}
|
|
174
177
|
dedrtabPages == null ? void 0 : dedrtabPages.forEach((item) => {
|
|
175
178
|
let itemCaption = item.caption;
|
|
@@ -38,6 +38,9 @@ const FormTabPanel = /* @__PURE__ */ vue.defineComponent({
|
|
|
38
38
|
pageC.onClick(event);
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
+
const fn = (data) => {
|
|
42
|
+
counterData.value = data;
|
|
43
|
+
};
|
|
41
44
|
vue.onMounted(() => {
|
|
42
45
|
var _a, _b;
|
|
43
46
|
const defaultSlots = ((_a = slots.default) == null ? void 0 : _a.call(slots)) || [];
|
|
@@ -52,14 +55,12 @@ const FormTabPanel = /* @__PURE__ */ vue.defineComponent({
|
|
|
52
55
|
if (counterRefId.value) {
|
|
53
56
|
counter = props.controller.getCounter(counterRefId.value);
|
|
54
57
|
if (counter) {
|
|
55
|
-
counter.onChange(
|
|
56
|
-
counterData.value = data;
|
|
57
|
-
});
|
|
58
|
+
counter.onChange(fn);
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
});
|
|
61
62
|
vue.onUnmounted(() => {
|
|
62
|
-
counter == null ? void 0 : counter.
|
|
63
|
+
counter == null ? void 0 : counter.offChange(fn);
|
|
63
64
|
});
|
|
64
65
|
return {
|
|
65
66
|
ns,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var core = require('@ibiz-template/core');
|
|
3
4
|
var runtime = require('@ibiz-template/runtime');
|
|
4
5
|
var vue = require('vue');
|
|
5
6
|
|
|
@@ -92,6 +93,9 @@ function useITableEvent(c) {
|
|
|
92
93
|
if (row.srfkey) {
|
|
93
94
|
activeClassName += " id-".concat(row.srfkey);
|
|
94
95
|
}
|
|
96
|
+
if (c.enableRowEditOrder) {
|
|
97
|
+
activeClassName += " enable-order";
|
|
98
|
+
}
|
|
95
99
|
return activeClassName;
|
|
96
100
|
}
|
|
97
101
|
function handleHeaderCellClassName({
|
|
@@ -293,8 +297,101 @@ function useGridHeaderStyle(tableRef, ns) {
|
|
|
293
297
|
headerCssVars
|
|
294
298
|
};
|
|
295
299
|
}
|
|
300
|
+
function useGridDraggable(tableRef, ns, c) {
|
|
301
|
+
if (!c.enableRowEditOrder || !c.model.orderValueAppDEFieldId) {
|
|
302
|
+
return {};
|
|
303
|
+
}
|
|
304
|
+
let draggingDom = null;
|
|
305
|
+
let dragIndex = 0;
|
|
306
|
+
let draggingKey = "";
|
|
307
|
+
let draggingData = null;
|
|
308
|
+
const cleanups = [];
|
|
309
|
+
const calcSrfKeyByClass = (classList) => {
|
|
310
|
+
let result = "";
|
|
311
|
+
classList.forEach((className) => {
|
|
312
|
+
if (className.startsWith("id-")) {
|
|
313
|
+
result = className.replace("id-", "");
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
return result;
|
|
317
|
+
};
|
|
318
|
+
const setRowDragEvent = (item) => {
|
|
319
|
+
item.setAttribute("draggable", "true");
|
|
320
|
+
const cleanDragStart = core.listenJSEvent(
|
|
321
|
+
item,
|
|
322
|
+
"dragstart",
|
|
323
|
+
(event) => {
|
|
324
|
+
if (event.target) {
|
|
325
|
+
draggingDom = event.target;
|
|
326
|
+
event.dataTransfer.effectAllowed = "move";
|
|
327
|
+
draggingKey = calcSrfKeyByClass(draggingDom.classList);
|
|
328
|
+
dragIndex = c.state.rows.findIndex(
|
|
329
|
+
(row) => row.data.srfkey === draggingKey
|
|
330
|
+
);
|
|
331
|
+
draggingData = c.state.rows[dragIndex];
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
);
|
|
335
|
+
const cleanDragEnter = core.listenJSEvent(
|
|
336
|
+
item,
|
|
337
|
+
"dragenter",
|
|
338
|
+
(event) => {
|
|
339
|
+
event.preventDefault();
|
|
340
|
+
const targetDom = event.currentTarget;
|
|
341
|
+
const targetKey = calcSrfKeyByClass(targetDom.classList);
|
|
342
|
+
const targetIndex = c.state.rows.findIndex(
|
|
343
|
+
(row) => row.data.srfkey === targetKey
|
|
344
|
+
);
|
|
345
|
+
if (draggingKey === targetKey || targetIndex === -1) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
c.state.rows.splice(dragIndex, 1);
|
|
349
|
+
c.state.rows.splice(targetIndex, 0, draggingData);
|
|
350
|
+
dragIndex = targetIndex;
|
|
351
|
+
}
|
|
352
|
+
);
|
|
353
|
+
const cleanDragOver = core.listenJSEvent(
|
|
354
|
+
item,
|
|
355
|
+
"dragover",
|
|
356
|
+
(event) => {
|
|
357
|
+
event.preventDefault();
|
|
358
|
+
}
|
|
359
|
+
);
|
|
360
|
+
const cleanDragEnd = core.listenJSEvent(item, "dragend", (event) => {
|
|
361
|
+
event.preventDefault();
|
|
362
|
+
c.onDragChange();
|
|
363
|
+
});
|
|
364
|
+
cleanups.push(cleanDragStart);
|
|
365
|
+
cleanups.push(cleanDragEnter);
|
|
366
|
+
cleanups.push(cleanDragOver);
|
|
367
|
+
cleanups.push(cleanDragEnd);
|
|
368
|
+
};
|
|
369
|
+
vue.watch(
|
|
370
|
+
[() => tableRef.value, () => c.state.isLoaded],
|
|
371
|
+
(table, isLoaded) => {
|
|
372
|
+
if (!isLoaded || !table) {
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
const grid = tableRef.value.$el;
|
|
376
|
+
if (grid) {
|
|
377
|
+
const rows = grid.getElementsByClassName("el-table__row");
|
|
378
|
+
rows.forEach((item) => {
|
|
379
|
+
setRowDragEvent(item);
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
);
|
|
384
|
+
return {
|
|
385
|
+
cleanup: () => {
|
|
386
|
+
cleanups.forEach((cleanup) => {
|
|
387
|
+
cleanup();
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
};
|
|
391
|
+
}
|
|
296
392
|
|
|
297
393
|
exports.useAppGridBase = useAppGridBase;
|
|
298
394
|
exports.useAppGridPagination = useAppGridPagination;
|
|
395
|
+
exports.useGridDraggable = useGridDraggable;
|
|
299
396
|
exports.useGridHeaderStyle = useGridHeaderStyle;
|
|
300
397
|
exports.useITableEvent = useITableEvent;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var vue = require('vue');
|
|
4
4
|
var vue3Util = require('@ibiz-template/vue3-util');
|
|
5
5
|
var runtime = require('@ibiz-template/runtime');
|
|
6
|
+
var core = require('@ibiz-template/core');
|
|
6
7
|
var gridControl_util = require('./grid-control.util.cjs');
|
|
7
8
|
require('./grid.css');
|
|
8
9
|
var useRowEditPopover = require('../row-edit-popover/use-row-edit-popover.cjs');
|
|
@@ -166,6 +167,9 @@ const GridControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
166
167
|
const {
|
|
167
168
|
headerCssVars
|
|
168
169
|
} = gridControl_util.useGridHeaderStyle(tableRef, ns);
|
|
170
|
+
const {
|
|
171
|
+
cleanup = core.NOOP
|
|
172
|
+
} = gridControl_util.useGridDraggable(tableRef, ns, c);
|
|
169
173
|
const renderNoData = () => {
|
|
170
174
|
var _a;
|
|
171
175
|
const {
|
|
@@ -231,6 +235,9 @@ const GridControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
231
235
|
};
|
|
232
236
|
vue.onUnmounted(() => {
|
|
233
237
|
zIndex.decrement();
|
|
238
|
+
if (cleanup !== core.NOOP) {
|
|
239
|
+
cleanup();
|
|
240
|
+
}
|
|
234
241
|
});
|
|
235
242
|
return {
|
|
236
243
|
c,
|
|
@@ -27,6 +27,7 @@ const IBizGridControl = vue3Util.withInstall(grid.GridControl, (v) => {
|
|
|
27
27
|
|
|
28
28
|
exports.useAppGridBase = gridControl_util.useAppGridBase;
|
|
29
29
|
exports.useAppGridPagination = gridControl_util.useAppGridPagination;
|
|
30
|
+
exports.useGridDraggable = gridControl_util.useGridDraggable;
|
|
30
31
|
exports.useGridHeaderStyle = gridControl_util.useGridHeaderStyle;
|
|
31
32
|
exports.useITableEvent = gridControl_util.useITableEvent;
|
|
32
33
|
exports.IBizGridControl = IBizGridControl;
|
|
@@ -41,6 +41,7 @@ const GridFieldColumn = /* @__PURE__ */ vue.defineComponent({
|
|
|
41
41
|
});
|
|
42
42
|
const fieldValue = vue.computed(() => props.row.data[props.controller.fieldName]);
|
|
43
43
|
const formatValue = vue.computed(() => props.controller.formatValue(fieldValue.value));
|
|
44
|
+
const codeListValue = vue.computed(() => runtime.ValueExUtil.toText(props.controller.model, fieldValue.value));
|
|
44
45
|
const codeListText = vue.ref("");
|
|
45
46
|
const onInfoTextChange = (text) => {
|
|
46
47
|
codeListText.value = text;
|
|
@@ -54,6 +55,16 @@ const GridFieldColumn = /* @__PURE__ */ vue.defineComponent({
|
|
|
54
55
|
const onActionClick = async (detail, event) => {
|
|
55
56
|
await props.controller.onActionClick(detail, props.row, event);
|
|
56
57
|
};
|
|
58
|
+
const items = vue.ref([]);
|
|
59
|
+
if (props.controller.codeList) {
|
|
60
|
+
items.value = props.controller.codeListItems;
|
|
61
|
+
}
|
|
62
|
+
const fn = (data) => {
|
|
63
|
+
if (data) {
|
|
64
|
+
items.value = data;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
vue3Util.useCodeListListen(props.controller.model.appCodeListId, props.controller.context.srfappid, fn);
|
|
57
68
|
return {
|
|
58
69
|
ns,
|
|
59
70
|
onCellClick,
|
|
@@ -63,8 +74,10 @@ const GridFieldColumn = /* @__PURE__ */ vue.defineComponent({
|
|
|
63
74
|
CustomHtml,
|
|
64
75
|
fieldValue,
|
|
65
76
|
formatValue,
|
|
77
|
+
codeListValue,
|
|
66
78
|
tooltip,
|
|
67
|
-
zIndex
|
|
79
|
+
zIndex,
|
|
80
|
+
items
|
|
68
81
|
};
|
|
69
82
|
},
|
|
70
83
|
render() {
|
|
@@ -87,9 +100,9 @@ const GridFieldColumn = /* @__PURE__ */ vue.defineComponent({
|
|
|
87
100
|
} else if (c.codeList) {
|
|
88
101
|
content = vue.createVNode(vue.resolveComponent("iBizCodeList"), {
|
|
89
102
|
"class": this.ns.e("text"),
|
|
90
|
-
"codeListItems":
|
|
103
|
+
"codeListItems": this.items,
|
|
91
104
|
"codeList": c.codeList,
|
|
92
|
-
"value": this.
|
|
105
|
+
"value": this.codeListValue,
|
|
93
106
|
"onClick": this.onTextClick,
|
|
94
107
|
"onInfoTextChange": this.onInfoTextChange,
|
|
95
108
|
"title": this.tooltip
|
|
@@ -13,6 +13,7 @@ var index$4 = require('./grid-column/grid-group-column/index.cjs');
|
|
|
13
13
|
exports.IBizGridControl = index.IBizGridControl;
|
|
14
14
|
exports.useAppGridBase = gridControl_util.useAppGridBase;
|
|
15
15
|
exports.useAppGridPagination = gridControl_util.useAppGridPagination;
|
|
16
|
+
exports.useGridDraggable = gridControl_util.useGridDraggable;
|
|
16
17
|
exports.useGridHeaderStyle = gridControl_util.useGridHeaderStyle;
|
|
17
18
|
exports.useITableEvent = gridControl_util.useITableEvent;
|
|
18
19
|
exports.IBizGridFieldColumn = index$1.IBizGridFieldColumn;
|
package/lib/control/index.cjs
CHANGED
|
@@ -102,6 +102,7 @@ exports.IBizGanttControl = index$R.IBizGanttControl;
|
|
|
102
102
|
exports.IBizContextMenuControl = index$S.IBizContextMenuControl;
|
|
103
103
|
exports.useAppGridBase = gridControl_util.useAppGridBase;
|
|
104
104
|
exports.useAppGridPagination = gridControl_util.useAppGridPagination;
|
|
105
|
+
exports.useGridDraggable = gridControl_util.useGridDraggable;
|
|
105
106
|
exports.useGridHeaderStyle = gridControl_util.useGridHeaderStyle;
|
|
106
107
|
exports.useITableEvent = gridControl_util.useITableEvent;
|
|
107
108
|
exports.IBizGridControl = index$2.IBizGridControl;
|
|
@@ -71,16 +71,21 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
71
71
|
const c = vue3Util.useControlController((...args) => new runtime.TreeController(...args));
|
|
72
72
|
const cascadeSelect = vue.ref(false);
|
|
73
73
|
const counterData = vue.reactive({});
|
|
74
|
+
const fn = (counter) => {
|
|
75
|
+
Object.assign(counterData, counter);
|
|
76
|
+
};
|
|
74
77
|
c.evt.on("onCreated", () => {
|
|
75
78
|
if (c.counter) {
|
|
76
|
-
c.counter.onChange(
|
|
77
|
-
Object.assign(counterData, counter);
|
|
78
|
-
}, true);
|
|
79
|
+
c.counter.onChange(fn, true);
|
|
79
80
|
}
|
|
80
81
|
if (c.controlParams.cascadeselect) {
|
|
81
82
|
cascadeSelect.value = true;
|
|
82
83
|
}
|
|
83
84
|
});
|
|
85
|
+
vue.onUnmounted(() => {
|
|
86
|
+
var _a;
|
|
87
|
+
(_a = c.counter) == null ? void 0 : _a.offChange(fn);
|
|
88
|
+
});
|
|
84
89
|
const ns = vue3Util.useNamespace("control-".concat(c.model.controlType.toLowerCase()));
|
|
85
90
|
const treeRef = vue.ref(null);
|
|
86
91
|
const treeviewRef = vue.ref(null);
|
|
@@ -168,7 +168,7 @@ const IBizAutoComplete = /* @__PURE__ */ vue.defineComponent({
|
|
|
168
168
|
"placeholder": this.c.placeHolder,
|
|
169
169
|
"placement": "bottom",
|
|
170
170
|
"clearable": this.autoCompleteClearable,
|
|
171
|
-
"popper-class":
|
|
171
|
+
"popper-class": this.ns.e("transfer"),
|
|
172
172
|
"teleported": !this.showFormDefaultContent,
|
|
173
173
|
"fetch-suggestions": this.onSearch,
|
|
174
174
|
"onClear": this.onClear,
|
|
@@ -40,6 +40,12 @@ const IBizCheckboxList = /* @__PURE__ */ vue.defineComponent({
|
|
|
40
40
|
}
|
|
41
41
|
return "str";
|
|
42
42
|
});
|
|
43
|
+
const fn = (data) => {
|
|
44
|
+
if (data) {
|
|
45
|
+
items.value = data;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
vue3Util.useCodeListListen(c.model.appCodeListId, c.context.srfappid, fn);
|
|
43
49
|
let valueSeparator = ",";
|
|
44
50
|
if (codeList && codeList.valueSeparator) {
|
|
45
51
|
valueSeparator = codeList.valueSeparator;
|