cloud-web-corejs 1.1.0-dev.82 → 1.1.0-dev.84
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/package.json +1 -1
- package/src/components/VabUpload/mixins.js +5 -0
- package/src/components/VabUpload/view.vue +4 -0
- package/src/components/baseAttachment/index.vue +1 -0
- package/src/components/baseAttachment/mixins.js +17 -0
- package/src/components/baseAttachment/showList.vue +12 -2
- package/src/components/baseAttachment/uploadDialog.vue +2 -1
- package/src/components/hiprint/hiprint.bundle.js +5 -1
- package/src/components/table/vxeFilter/mixin.js +326 -326
- package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +7 -0
- package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +1 -0
- package/src/components/xform/form-designer/form-widget/field-widget/vabUpload2-widget.vue +186 -153
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/field-vabUpload-editor.vue +22 -9
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload2/field-vabUpload2-editor.vue +13 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/showDownloadButton-editor.vue +29 -0
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +1 -0
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +3 -0
- package/src/components/xform/form-render/container-item/data-table-item.vue +1 -0
- package/src/components/xform/form-render/container-item/data-table-mixin.js +116 -0
- package/src/microRouter/index.js +5 -0
- package/src/store/modules/permission.js +2 -0
|
@@ -348,8 +348,92 @@ modules = {
|
|
|
348
348
|
this.fieldSchemaMap = {};
|
|
349
349
|
this.rowIdData.splice(0, this.rowIdData.length);
|
|
350
350
|
this.unregisterFromRefList();
|
|
351
|
+
this.restoreFilterScroll();
|
|
351
352
|
},
|
|
352
353
|
methods: {
|
|
354
|
+
/**
|
|
355
|
+
* 只在列筛选弹层打开时,把表体撑到弹层底部。
|
|
356
|
+
* 空表不再把弹层裁在滚动区外面,详情区滚动条随之出现;关闭后收回。
|
|
357
|
+
*/
|
|
358
|
+
handleFilterVisible({ visible } = {}) {
|
|
359
|
+
this.restoreFilterScroll();
|
|
360
|
+
if (!visible) return;
|
|
361
|
+
this.$nextTick(() => {
|
|
362
|
+
this.$nextTick(() => this.expandFilterScroll());
|
|
363
|
+
});
|
|
364
|
+
},
|
|
365
|
+
expandFilterScroll() {
|
|
366
|
+
this.restoreFilterScroll();
|
|
367
|
+
let grid = this.getGridTable();
|
|
368
|
+
let panel =
|
|
369
|
+
grid &&
|
|
370
|
+
grid.$el &&
|
|
371
|
+
grid.$el.querySelector(".vxe-table--filter-wrapper.is--active");
|
|
372
|
+
let body =
|
|
373
|
+
grid &&
|
|
374
|
+
grid.$el &&
|
|
375
|
+
grid.$el.querySelector(".vxe-table--main-wrapper > .vxe-table--body-wrapper");
|
|
376
|
+
if (!panel || !body) return;
|
|
377
|
+
let options = this.widget.options || {};
|
|
378
|
+
let bounded = !!(options.tableHeight || options.isQueryTable);
|
|
379
|
+
let prevMinHeight = body.style.minHeight;
|
|
380
|
+
let overflow = Math.ceil(
|
|
381
|
+
panel.getBoundingClientRect().bottom - body.getBoundingClientRect().bottom + 8
|
|
382
|
+
);
|
|
383
|
+
if (!bounded && overflow > 1) {
|
|
384
|
+
body.style.minHeight = body.getBoundingClientRect().height + overflow + "px";
|
|
385
|
+
}
|
|
386
|
+
let scrollEl = null;
|
|
387
|
+
let delta = 0;
|
|
388
|
+
let scroller = this.findFilterScroller(panel);
|
|
389
|
+
if (scroller) {
|
|
390
|
+
let gap = Math.ceil(
|
|
391
|
+
panel.getBoundingClientRect().bottom -
|
|
392
|
+
scroller.getBoundingClientRect().bottom +
|
|
393
|
+
8
|
|
394
|
+
);
|
|
395
|
+
if (gap > 1) {
|
|
396
|
+
let maxScroll = Math.max(0, scroller.scrollHeight - scroller.clientHeight);
|
|
397
|
+
let nextTop = Math.min(scroller.scrollTop + gap, maxScroll);
|
|
398
|
+
delta = nextTop - scroller.scrollTop;
|
|
399
|
+
if (delta > 0) {
|
|
400
|
+
scroller.scrollTop = nextTop;
|
|
401
|
+
scrollEl = scroller;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
if ((!bounded && overflow > 1) || delta) {
|
|
406
|
+
this._filterScrollState = { body, prevMinHeight, scrollEl, delta };
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
findFilterScroller(panel) {
|
|
410
|
+
let node = panel.parentElement;
|
|
411
|
+
while (node && node !== document.documentElement) {
|
|
412
|
+
let overflowY = window.getComputedStyle(node).overflowY;
|
|
413
|
+
if (overflowY === "auto" || overflowY === "scroll") {
|
|
414
|
+
let gap =
|
|
415
|
+
panel.getBoundingClientRect().bottom - node.getBoundingClientRect().bottom;
|
|
416
|
+
let canScroll = node.scrollHeight > node.clientHeight + 1;
|
|
417
|
+
if (gap > 1 && canScroll && !this.filterScrollbarClipped(node)) return node;
|
|
418
|
+
}
|
|
419
|
+
node = node.parentElement;
|
|
420
|
+
}
|
|
421
|
+
return null;
|
|
422
|
+
},
|
|
423
|
+
filterScrollbarClipped(el) {
|
|
424
|
+
let parent = el.parentElement;
|
|
425
|
+
if (!parent) return false;
|
|
426
|
+
let overflowX = window.getComputedStyle(parent).overflowX;
|
|
427
|
+
if (overflowX !== "hidden" && overflowX !== "clip") return false;
|
|
428
|
+
return el.getBoundingClientRect().right > parent.getBoundingClientRect().right + 1;
|
|
429
|
+
},
|
|
430
|
+
restoreFilterScroll() {
|
|
431
|
+
let state = this._filterScrollState;
|
|
432
|
+
if (!state) return;
|
|
433
|
+
if (state.delta && state.scrollEl) state.scrollEl.scrollTop -= state.delta;
|
|
434
|
+
state.body.style.minHeight = state.prevMinHeight;
|
|
435
|
+
this._filterScrollState = null;
|
|
436
|
+
},
|
|
353
437
|
/** @param {String} reason 取消原因。取消当前普通查询并使旧响应失效。 */
|
|
354
438
|
cancelActiveTableQuery(reason = "query cancelled") {
|
|
355
439
|
this.tableQuerySeq += 1;
|
|
@@ -2663,6 +2747,33 @@ modules = {
|
|
|
2663
2747
|
}
|
|
2664
2748
|
return conditions;
|
|
2665
2749
|
},
|
|
2750
|
+
/**
|
|
2751
|
+
* 列里有多行输入时,算出能完整放下输入框的行高。
|
|
2752
|
+
* 表格默认行高 36px,多行框会被裁切,边框和拖拽角叠在一起。
|
|
2753
|
+
* @param {Array} columns VXE 列。
|
|
2754
|
+
* @returns {Number|null} 行高(px);没有多行输入列时返回 null。
|
|
2755
|
+
*/
|
|
2756
|
+
getTextareaColumnRowHeight(columns) {
|
|
2757
|
+
let maxRows = 0;
|
|
2758
|
+
const visit = (list) => {
|
|
2759
|
+
(list || []).forEach((col) => {
|
|
2760
|
+
const params = col.params || {};
|
|
2761
|
+
[params.widget, params.editWidget]
|
|
2762
|
+
.concat(params.widgetList || [])
|
|
2763
|
+
.forEach((widget) => {
|
|
2764
|
+
if (!widget || widget.type !== "textarea") return;
|
|
2765
|
+
const rows = Number(widget.options && widget.options.rows);
|
|
2766
|
+
maxRows = Math.max(maxRows, rows > 0 ? rows : 3);
|
|
2767
|
+
});
|
|
2768
|
+
if (col.children && col.children.length) visit(col.children);
|
|
2769
|
+
});
|
|
2770
|
+
};
|
|
2771
|
+
visit(columns);
|
|
2772
|
+
if (!maxRows) return null;
|
|
2773
|
+
// 12px 字、1.4 行高按每行 22px,再加输入框内边距、边框和单元格上下 2px。
|
|
2774
|
+
// 至少 52px:即使只配了 1 行,32px 的最小高度加上留白也放不进 36px 的行。
|
|
2775
|
+
return Math.max(maxRows * 22 + 16, 52);
|
|
2776
|
+
},
|
|
2666
2777
|
/**
|
|
2667
2778
|
* 将设计器列转换成 VXE 列,挂载展示/编辑插槽及列级格式化配置。
|
|
2668
2779
|
* 同时收集行级组件模板,供 fieldSchemaMap 为每行克隆独立 schema。
|
|
@@ -3424,6 +3535,11 @@ modules = {
|
|
|
3424
3535
|
let rowConfig = {};
|
|
3425
3536
|
if (this.widget.options.tableRowHeight) {
|
|
3426
3537
|
rowConfig.height = this.widget.options.tableRowHeight;
|
|
3538
|
+
} else {
|
|
3539
|
+
const textareaRowHeight = this.getTextareaColumnRowHeight(columns);
|
|
3540
|
+
if (textareaRowHeight) {
|
|
3541
|
+
rowConfig.height = textareaRowHeight;
|
|
3542
|
+
}
|
|
3427
3543
|
}
|
|
3428
3544
|
|
|
3429
3545
|
// 宿主经 dataTableOption.config 覆写时,treeConfig 必须深合并而不是整体
|
package/src/microRouter/index.js
CHANGED
|
@@ -92,6 +92,10 @@ export function registerSubApps(apps, options = {}) {
|
|
|
92
92
|
const subAppMenus = options.subAppMenus || {};
|
|
93
93
|
const mainAdapter = options.mainAdapter || createDefaultMainAdapter();
|
|
94
94
|
const userInfo = options.userInfo || null;
|
|
95
|
+
// 按钮/菜单禁用名单(menuCode)。登录时已写入 user.dispermissions,这里做快照下发
|
|
96
|
+
const dispermissions = Array.isArray(options.dispermissions)
|
|
97
|
+
? options.dispermissions.slice()
|
|
98
|
+
: [];
|
|
95
99
|
microAppConfigs = {};
|
|
96
100
|
(apps || []).forEach((app) => {
|
|
97
101
|
const menus = subAppMenus[app.appCode] || [];
|
|
@@ -100,6 +104,7 @@ export function registerSubApps(apps, options = {}) {
|
|
|
100
104
|
token: getToken(),
|
|
101
105
|
lang: localStorage.getItem("i18n-lang") || "",
|
|
102
106
|
userInfo,
|
|
107
|
+
dispermissions,
|
|
103
108
|
mainAdapter,
|
|
104
109
|
};
|
|
105
110
|
const entry = resolveEntry(app.entry);
|
|
@@ -267,6 +267,8 @@ const actions = {
|
|
|
267
267
|
registerSubApps(hostRegistryApps, {
|
|
268
268
|
subAppMenus,
|
|
269
269
|
userInfo: buildUserInfoSnapshot(rootState.user),
|
|
270
|
+
dispermissions:
|
|
271
|
+
(rootState.user && rootState.user.dispermissions) || [],
|
|
270
272
|
});
|
|
271
273
|
}
|
|
272
274
|
return dispatch("setSidebarRoute", rows);
|