@ibiz-template/vue3-components 0.6.0-alpha.3 → 0.6.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-UyccsQgR.js +4 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{xlsx-util-Ao2cn6nx.js → xlsx-util-G9ywpMYa.js} +1 -1
- package/es/common/data-import2/data-import2.css +1 -1
- package/es/common/data-import2/data-import2.mjs +3 -1
- package/es/control/drbar/drbar.controller.mjs +3 -0
- package/es/control/form/form-detail/form-item/form-item.mjs +1 -0
- package/es/control/tab-exp-panel/tab-exp-panel.mjs +9 -21
- package/es/control/toolbar/toolbar.mjs +1 -0
- package/es/control/tree/index.d.ts +1 -0
- package/es/control/tree/tree.css +1 -1
- package/es/control/tree/tree.d.ts +1 -0
- package/es/control/tree/tree.mjs +12 -5
- package/es/control/tree-grid-ex/index.d.ts +1 -0
- package/es/control/tree-grid-ex/tree-grid-ex.d.ts +1 -0
- package/es/control/tree-grid-ex/tree-grid-ex.mjs +8 -0
- package/es/editor/color-picker/ibiz-color-picker/ibiz-color-picker.d.ts +1 -0
- package/es/editor/color-picker/ibiz-color-picker/ibiz-color-picker.mjs +5 -1
- package/es/editor/data-picker/ibiz-picker/ibiz-picker.mjs +2 -2
- package/es/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.mjs +1 -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.d.ts +6 -8
- package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.mjs +139 -48
- package/es/editor/data-picker/picker-editor.controller.mjs +9 -2
- package/es/editor/span/span/span.css +1 -1
- package/es/panel-component/user-message/internal-message/common/internal-message-default/internal-message-default.provider.mjs +3 -17
- package/es/util/app-modal/app-modal-component.d.ts +0 -1
- package/es/util/app-modal/app-modal-component.mjs +3 -9
- package/es/view-engine/edit-view.engine.d.ts +7 -0
- package/es/view-engine/edit-view.engine.mjs +87 -37
- package/es/view-engine/pickup-tree-view.engine.d.ts +15 -0
- package/es/view-engine/pickup-tree-view.engine.mjs +60 -3
- package/lib/common/data-import2/data-import2.cjs +3 -1
- package/lib/common/data-import2/data-import2.css +1 -1
- package/lib/control/drbar/drbar.controller.cjs +3 -0
- package/lib/control/form/form-detail/form-item/form-item.cjs +1 -0
- package/lib/control/tab-exp-panel/tab-exp-panel.cjs +8 -20
- package/lib/control/toolbar/toolbar.cjs +1 -0
- package/lib/control/tree/tree.cjs +11 -4
- package/lib/control/tree/tree.css +1 -1
- package/lib/control/tree-grid-ex/tree-grid-ex.cjs +8 -0
- package/lib/editor/color-picker/ibiz-color-picker/ibiz-color-picker.cjs +5 -1
- package/lib/editor/data-picker/ibiz-picker/ibiz-picker.cjs +1 -1
- package/lib/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.cjs +1 -1
- package/lib/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.cjs +138 -47
- package/lib/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.css +1 -1
- package/lib/editor/data-picker/picker-editor.controller.cjs +8 -1
- package/lib/editor/span/span/span.css +1 -1
- package/lib/panel-component/user-message/internal-message/common/internal-message-default/internal-message-default.provider.cjs +2 -16
- package/lib/util/app-modal/app-modal-component.cjs +3 -9
- package/lib/view-engine/edit-view.engine.cjs +87 -37
- package/lib/view-engine/pickup-tree-view.engine.cjs +59 -2
- package/package.json +6 -6
- package/dist/index-YUUYgkW-.js +0 -4
|
@@ -1,8 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ViewCallTag } from '@ibiz-template/runtime';
|
|
2
2
|
import { TreeViewEngine } from './tree-view.engine.mjs';
|
|
3
3
|
|
|
4
4
|
"use strict";
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
+
var __publicField = (obj, key, value) => {
|
|
8
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
9
|
+
return value;
|
|
10
|
+
};
|
|
5
11
|
class PickupTreeViewEngine extends TreeViewEngine {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
/**
|
|
15
|
+
* 选中数据
|
|
16
|
+
*
|
|
17
|
+
* @type {IData[]}
|
|
18
|
+
* @memberof PickupViewEngine
|
|
19
|
+
*/
|
|
20
|
+
__publicField(this, "selectData", []);
|
|
21
|
+
}
|
|
6
22
|
/**
|
|
7
23
|
* 创建完成
|
|
8
24
|
*
|
|
@@ -16,6 +32,41 @@ class PickupTreeViewEngine extends TreeViewEngine {
|
|
|
16
32
|
this.view.slotProps.tree = {};
|
|
17
33
|
}
|
|
18
34
|
this.view.slotProps.tree.singleSelect = this.view.state.singleSelect;
|
|
35
|
+
if (this.view.state.selectedData) {
|
|
36
|
+
this.selectData = this.view.state.selectedData.map((item) => {
|
|
37
|
+
return {
|
|
38
|
+
...item,
|
|
39
|
+
_id: item.srfnodeid
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
const set = /* @__PURE__ */ new Set();
|
|
43
|
+
this.selectData.forEach((item) => {
|
|
44
|
+
if (item.srfnodeid) {
|
|
45
|
+
const keys = this.calcExpandKeys(item.srfnodeid);
|
|
46
|
+
keys.forEach((key) => set.add(key));
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
this.view.slotProps.tree.defaultExpandedKeys = Array.from(set);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 根据key计算需要展开的节点标识
|
|
54
|
+
* @author lxm
|
|
55
|
+
* @date 2023-11-07 02:42:45
|
|
56
|
+
* @param {string} key
|
|
57
|
+
* @return {*} {string[]}
|
|
58
|
+
*/
|
|
59
|
+
calcExpandKeys(key) {
|
|
60
|
+
const expandedKeys = [];
|
|
61
|
+
key.split(":").forEach((item, index) => {
|
|
62
|
+
if (index === 0) {
|
|
63
|
+
expandedKeys.push(item);
|
|
64
|
+
} else {
|
|
65
|
+
expandedKeys.push("".concat(expandedKeys[index - 1], ":").concat(item));
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
expandedKeys.pop();
|
|
69
|
+
return expandedKeys;
|
|
19
70
|
}
|
|
20
71
|
/**
|
|
21
72
|
* 挂载完成
|
|
@@ -26,15 +77,21 @@ class PickupTreeViewEngine extends TreeViewEngine {
|
|
|
26
77
|
*/
|
|
27
78
|
async onMounted() {
|
|
28
79
|
const { model } = this.view;
|
|
80
|
+
let forbiddenSelectionChange = false;
|
|
29
81
|
this.xdataControl.evt.on("onSelectionChange", async (event) => {
|
|
30
|
-
if (
|
|
31
|
-
|
|
82
|
+
if (forbiddenSelectionChange) {
|
|
83
|
+
return;
|
|
32
84
|
}
|
|
33
85
|
this.view.evt.emit("onSelectionChange", { ...event });
|
|
34
86
|
});
|
|
35
87
|
this.xdataControl.evt.on("onActive", async (event) => {
|
|
36
88
|
this.view.evt.emit("onDataActive", { ...event });
|
|
37
89
|
});
|
|
90
|
+
this.xdataControl.evt.on("onLoadSuccess", () => {
|
|
91
|
+
forbiddenSelectionChange = true;
|
|
92
|
+
this.xdataControl.setSelection(this.selectData);
|
|
93
|
+
forbiddenSelectionChange = false;
|
|
94
|
+
});
|
|
38
95
|
if (!this.view.state.noLoadDefault && model.loadDefault) {
|
|
39
96
|
this.load();
|
|
40
97
|
}
|
|
@@ -454,7 +454,9 @@ const DataImport2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
454
454
|
}), this.previewinfo[0] && this.previewinfo[0].length ? vue.createVNode("div", {
|
|
455
455
|
"class": "ibiz-control-toolbar__item"
|
|
456
456
|
}, [vue.createVNode(vue.resolveComponent("el-button"), {
|
|
457
|
-
"onClick": this.onButtonImportClick
|
|
457
|
+
"onClick": this.onButtonImportClick,
|
|
458
|
+
"disabled": !this.selectValues.join(""),
|
|
459
|
+
"title": !this.selectValues.join("") ? "\u8BF7\u9009\u62E9\u5217\u5BFC\u5165\u5C5E\u6027!" : ""
|
|
458
460
|
}, _isSlot(_slot2 = ibiz.i18n.t("component.dataImport2.import")) ? _slot2 : {
|
|
459
461
|
default: () => [_slot2]
|
|
460
462
|
})]) : ""])])])]), vue.createVNode(vue.resolveComponent("data-import2-table"), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-data-import2{display:flex;flex-flow:column nowrap;min-width:644px;
|
|
1
|
+
.ibiz-data-import2{display:flex;flex-flow:column nowrap;min-width:644px;background:var(--ibiz-color-bg-1)}.ibiz-data-import2.ibiz-view{height:568px}.ibiz-data-import2__data-import2-toolbar{display:flex;align-items:center;justify-content:space-between}.ibiz-data-import2__data-import2-toolbar-container{display:flex;align-items:center;justify-content:space-between}.ibiz-data-import2__select-option-item-button{height:100%}
|
|
@@ -252,6 +252,9 @@ class DRBarController extends runtime.ControlController {
|
|
|
252
252
|
*/
|
|
253
253
|
handleSelectChange(key, isRoutePushed = false) {
|
|
254
254
|
var _a;
|
|
255
|
+
if (this.state.selectedItem === key) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
255
258
|
const drBarItem = (_a = this.model.dedrctrlItems) == null ? void 0 : _a.find((item) => item.id === key);
|
|
256
259
|
if (drBarItem) {
|
|
257
260
|
this.setVisible("navPos");
|
|
@@ -69,6 +69,7 @@ const FormItem = /* @__PURE__ */ vue.defineComponent({
|
|
|
69
69
|
}
|
|
70
70
|
return vue.createVNode(vue.resolveComponent("iBizFormItemContainer"), {
|
|
71
71
|
"class": [this.ns.b(), this.ns.m(this.modelData.id), ...this.controller.containerClass],
|
|
72
|
+
"style": this.modelData.cssStyle,
|
|
72
73
|
"required": this.c.state.required,
|
|
73
74
|
"error": this.c.state.error,
|
|
74
75
|
"label": this.c.labelCaption,
|
|
@@ -44,28 +44,16 @@ const TabExpPanelControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
44
44
|
const route = vueRouter.useRoute();
|
|
45
45
|
vue.watch(() => route.fullPath, (newVal, oldVal) => {
|
|
46
46
|
if (newVal !== oldVal) {
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const tempFullPath = route.fullPath.split("/").slice(0, nextKeyNumber).join("/");
|
|
56
|
-
c.state.tabPages.forEach((page) => {
|
|
57
|
-
if (page.fullPath === tempFullPath) {
|
|
58
|
-
c.state.activeName = page.tabTag;
|
|
47
|
+
const depth = c.view.modal.routeDepth;
|
|
48
|
+
if (depth) {
|
|
49
|
+
const routePath = vue3Util.route2routePath(route);
|
|
50
|
+
const {
|
|
51
|
+
srfnav
|
|
52
|
+
} = routePath.pathNodes[depth - 1];
|
|
53
|
+
if (srfnav && c.state.activeName && c.state.activeName !== srfnav) {
|
|
54
|
+
c.state.activeName = srfnav;
|
|
59
55
|
c.handleTabChange();
|
|
60
56
|
}
|
|
61
|
-
});
|
|
62
|
-
if (c.state.activeName) {
|
|
63
|
-
const currentPage = c.state.tabPages.find((page) => {
|
|
64
|
-
return page.tabTag === c.state.activeName;
|
|
65
|
-
});
|
|
66
|
-
if (currentPage) {
|
|
67
|
-
currentPage.fullPath = tempFullPath;
|
|
68
|
-
}
|
|
69
57
|
}
|
|
70
58
|
}
|
|
71
59
|
}, {
|
|
@@ -72,6 +72,7 @@ const ToolbarControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
72
72
|
return vue.createVNode(vue.resolveComponent("el-sub-menu"), {
|
|
73
73
|
"class": ns.b("submenu"),
|
|
74
74
|
"index": item.id,
|
|
75
|
+
"title": item.tooltip,
|
|
75
76
|
"popper-class": ns.b("submenu-popper")
|
|
76
77
|
}, {
|
|
77
78
|
default: () => {
|
|
@@ -69,6 +69,7 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
69
69
|
},
|
|
70
70
|
setup() {
|
|
71
71
|
const c = vue3Util.useControlController((...args) => new runtime.TreeController(...args));
|
|
72
|
+
const cascadeSelect = vue.ref(false);
|
|
72
73
|
const counterData = vue.reactive({});
|
|
73
74
|
c.evt.on("onCreated", () => {
|
|
74
75
|
if (c.counter) {
|
|
@@ -76,6 +77,9 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
76
77
|
Object.assign(counterData, counter);
|
|
77
78
|
}, true);
|
|
78
79
|
}
|
|
80
|
+
if (c.controlParams.cascadeselect) {
|
|
81
|
+
cascadeSelect.value = true;
|
|
82
|
+
}
|
|
79
83
|
});
|
|
80
84
|
const ns = vue3Util.useNamespace("control-".concat(c.model.controlType.toLowerCase()));
|
|
81
85
|
const treeRef = vue.ref(null);
|
|
@@ -122,7 +126,8 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
122
126
|
_id: node._id,
|
|
123
127
|
_uuid: node._uuid,
|
|
124
128
|
_leaf: node._leaf,
|
|
125
|
-
_text: node._text
|
|
129
|
+
_text: node._text,
|
|
130
|
+
_disableSelect: node._disableSelect
|
|
126
131
|
}));
|
|
127
132
|
};
|
|
128
133
|
c.evt.on("onAfterRefreshParent", (event) => {
|
|
@@ -406,6 +411,7 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
406
411
|
treeRefreshKey,
|
|
407
412
|
editingNodeKey,
|
|
408
413
|
editingNodeText,
|
|
414
|
+
cascadeSelect,
|
|
409
415
|
findNodeData: elTreeUtil.findNodeData,
|
|
410
416
|
onCheck,
|
|
411
417
|
onNodeClick,
|
|
@@ -454,12 +460,13 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
454
460
|
"expand-on-click-node": false,
|
|
455
461
|
"auto-expand-parent": false,
|
|
456
462
|
"show-checkbox": !this.c.state.singleSelect,
|
|
457
|
-
"check-strictly":
|
|
463
|
+
"check-strictly": !this.cascadeSelect,
|
|
458
464
|
"default-expanded-keys": this.c.state.expandedKeys,
|
|
459
465
|
"props": {
|
|
460
466
|
label: "_text",
|
|
461
467
|
children: "_children",
|
|
462
|
-
isLeaf: "_leaf"
|
|
468
|
+
isLeaf: "_leaf",
|
|
469
|
+
disabled: "_disableSelect"
|
|
463
470
|
},
|
|
464
471
|
"lazy": true,
|
|
465
472
|
"load": this.loadData,
|
|
@@ -527,7 +534,7 @@ const TreeControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
527
534
|
"onDblclick": (evt) => this.onNodeDbClick(nodeData, evt),
|
|
528
535
|
"onClick": (evt) => this.onNodeClick(nodeData, evt),
|
|
529
536
|
"onContextmenu": (evt) => this.onNodeContextmenu(nodeData, evt),
|
|
530
|
-
"class": [this.ns.b("node"), (_b = nodeModel.sysCss) == null ? void 0 : _b.cssName]
|
|
537
|
+
"class": [this.ns.b("node"), nodeData._disableSelect ? this.ns.bm("node", "disabled") : "", (_b = nodeModel.sysCss) == null ? void 0 : _b.cssName]
|
|
531
538
|
}, [content, this.renderCounter(nodeModel), this.renderContextMenu(nodeModel, nodeData)]);
|
|
532
539
|
}
|
|
533
540
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-control-treeview{--ibiz-control-treeview-padding:var(--ibiz-spacing-tight) var(--ibiz-spacing-base);--ibiz-control-treeview-icon-height:var(--ibiz-spacing-base);--ibiz-control-treeview-icon-width:var(--ibiz-spacing-base);height:100%;padding:var(--ibiz-control-treeview-padding)}.ibiz-control-treeview-node{display:flex;flex-grow:1;flex-shrink:1;align-items:center;min-width:1px;height:100%}.ibiz-control-treeview-node__icon{width:var(--ibiz-control-treeview-icon-width);height:var(--ibiz-control-treeview-icon-height);margin-right:var(--ibiz-spacing-tight)}.ibiz-control-treeview-node__label{flex-grow:1;flex-shrink:1;min-width:1px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ibiz-control-treeview-node:hover .ibiz-control-treeview-context-menu-trigger{display:inline-block}.ibiz-control-treeview-context-menu-trigger{display:none;flex-shrink:0;width:30px;text-align:center;cursor:pointer}.ibiz-control-treeview-context-menu-trigger__caption-icon{vertical-align:middle}.ibiz-control-treeview-context-menu.mx-context-menu{padding:var(--ibiz-spacing-extra-tight) 0}.ibiz-control-treeview-context-menu.mx-context-menu .mx-context-menu-item{padding:var(--ibiz-spacing-tight) var(--ibiz-spacing-base)}.ibiz-control-treeview-quick-search{margin-bottom:var(--ibiz-spacing-tight)}
|
|
1
|
+
.ibiz-control-treeview{--ibiz-control-treeview-padding:var(--ibiz-spacing-tight) var(--ibiz-spacing-base);--ibiz-control-treeview-icon-height:var(--ibiz-spacing-base);--ibiz-control-treeview-icon-width:var(--ibiz-spacing-base);height:100%;padding:var(--ibiz-control-treeview-padding)}.ibiz-control-treeview-node{display:flex;flex-grow:1;flex-shrink:1;align-items:center;min-width:1px;height:100%}.ibiz-control-treeview-node__icon{width:var(--ibiz-control-treeview-icon-width);height:var(--ibiz-control-treeview-icon-height);margin-right:var(--ibiz-spacing-tight)}.ibiz-control-treeview-node__label{flex-grow:1;flex-shrink:1;min-width:1px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ibiz-control-treeview-node:hover .ibiz-control-treeview-context-menu-trigger{display:inline-block}.ibiz-control-treeview-node--disabled{color:var(--ibiz-color-disabled-text);cursor:not-allowed}.ibiz-control-treeview-context-menu-trigger{display:none;flex-shrink:0;width:30px;text-align:center;cursor:pointer}.ibiz-control-treeview-context-menu-trigger__caption-icon{vertical-align:middle}.ibiz-control-treeview-context-menu.mx-context-menu{padding:var(--ibiz-spacing-extra-tight) 0}.ibiz-control-treeview-context-menu.mx-context-menu .mx-context-menu-item{padding:var(--ibiz-spacing-tight) var(--ibiz-spacing-base)}.ibiz-control-treeview-quick-search{margin-bottom:var(--ibiz-spacing-tight)}
|
|
@@ -5,6 +5,7 @@ var vue3Util = require('@ibiz-template/vue3-util');
|
|
|
5
5
|
var runtime = require('@ibiz-template/runtime');
|
|
6
6
|
require('./tree-grid-ex.css');
|
|
7
7
|
var core = require('@ibiz-template/core');
|
|
8
|
+
var qxUtil = require('qx-util');
|
|
8
9
|
var useRowEditPopover = require('./use-row-edit-popover.cjs');
|
|
9
10
|
|
|
10
11
|
"use strict";
|
|
@@ -66,6 +67,7 @@ const TreeGridExControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
66
67
|
return temp;
|
|
67
68
|
});
|
|
68
69
|
};
|
|
70
|
+
const tableRefreshKey = vue.ref(qxUtil.createUUID());
|
|
69
71
|
const treeRootData = vue.computed(() => {
|
|
70
72
|
if (!c.state.isLoaded) {
|
|
71
73
|
return [];
|
|
@@ -78,11 +80,15 @@ const TreeGridExControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
78
80
|
}, []);
|
|
79
81
|
});
|
|
80
82
|
const elTableData = vue.computed(() => {
|
|
83
|
+
tableRefreshKey.value = qxUtil.createUUID();
|
|
81
84
|
if (treeRootData.value.length === 0) {
|
|
82
85
|
return [];
|
|
83
86
|
}
|
|
84
87
|
return toElNodes(treeRootData.value, true);
|
|
85
88
|
});
|
|
89
|
+
c.evt.on("onAfterRefreshParent", () => {
|
|
90
|
+
tableRefreshKey.value = qxUtil.createUUID();
|
|
91
|
+
});
|
|
86
92
|
const loadData = async (item, treeNode, callback) => {
|
|
87
93
|
let nodes;
|
|
88
94
|
const nodeData = c.getNodeData(item.id);
|
|
@@ -157,6 +163,7 @@ const TreeGridExControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
157
163
|
tableRef,
|
|
158
164
|
elTableData,
|
|
159
165
|
renderColumns,
|
|
166
|
+
tableRefreshKey,
|
|
160
167
|
renderNoData,
|
|
161
168
|
loadData,
|
|
162
169
|
onRowClick,
|
|
@@ -209,6 +216,7 @@ const TreeGridExControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
209
216
|
}, {
|
|
210
217
|
default: () => [this.c.state.isLoaded && vue.createVNode(vue.resolveComponent("el-table"), {
|
|
211
218
|
"ref": "tableRef",
|
|
219
|
+
"key": this.tableRefreshKey,
|
|
212
220
|
"class": this.ns.e("table"),
|
|
213
221
|
"border": true,
|
|
214
222
|
"row-key": "id",
|
|
@@ -16,6 +16,7 @@ const IBizColorPicker = /* @__PURE__ */ vue.defineComponent({
|
|
|
16
16
|
const c = props.controller;
|
|
17
17
|
const currentVal = vue.ref("");
|
|
18
18
|
const colorPicker = vue.ref(null);
|
|
19
|
+
const predefineColors = vue.ref(["#000000", "#2C2C2C", "#50555C", "#ACB3BF", "#D0D3D9", "#C4C4C4", "#DADADA", "#E5E5E5", "#F0F0F0", "#F24E1E", "#E99C58", "#FFC700", "#FF4D00", "#FF00D6", "#D82E57", "#8E1DE8", "#0ACF83", "#18A0FB", "#A259FF", "#907CFF"]);
|
|
19
20
|
const showFormDefaultContent = vue.computed(() => {
|
|
20
21
|
if (props.controlParams && props.controlParams.editmode === "hover") {
|
|
21
22
|
return true;
|
|
@@ -59,6 +60,7 @@ const IBizColorPicker = /* @__PURE__ */ vue.defineComponent({
|
|
|
59
60
|
ns,
|
|
60
61
|
c,
|
|
61
62
|
currentVal,
|
|
63
|
+
predefineColors,
|
|
62
64
|
contentStyle,
|
|
63
65
|
colorPicker,
|
|
64
66
|
handleChange,
|
|
@@ -85,7 +87,9 @@ const IBizColorPicker = /* @__PURE__ */ vue.defineComponent({
|
|
|
85
87
|
"onChange": this.handleChange,
|
|
86
88
|
"onBlur": this.onBlur,
|
|
87
89
|
"onFocus": this.onFocus,
|
|
88
|
-
"size": "small"
|
|
90
|
+
"size": "small",
|
|
91
|
+
"predefine": this.predefineColors,
|
|
92
|
+
"show-alpha": true
|
|
89
93
|
}, null), vue.createVNode("span", {
|
|
90
94
|
"class": this.ns.b("text")
|
|
91
95
|
}, [this.currentVal])]);
|
|
@@ -163,7 +163,7 @@ const IBizPicker = /* @__PURE__ */ vue.defineComponent({
|
|
|
163
163
|
vue.onMounted(() => {
|
|
164
164
|
vue.watch(() => props.data[c.valueItem], async (newVal, oldVal) => {
|
|
165
165
|
if (newVal !== oldVal) {
|
|
166
|
-
if (!isLoaded.value && editorRef.value) {
|
|
166
|
+
if (!isLoaded.value && editorRef.value && ramda.isNil(props.value)) {
|
|
167
167
|
await onSearch("");
|
|
168
168
|
}
|
|
169
169
|
const curItem = items.value.find((item) => Object.is(item[c.keyName], newVal));
|
|
@@ -91,7 +91,7 @@ const IBizPickerDropDown = /* @__PURE__ */ vue.defineComponent({
|
|
|
91
91
|
vue.onMounted(() => {
|
|
92
92
|
vue.watch(() => props.data[c.valueItem], async (newVal, oldVal) => {
|
|
93
93
|
if (newVal !== oldVal) {
|
|
94
|
-
if (!isLoaded.value && editorRef.value) {
|
|
94
|
+
if (!isLoaded.value && editorRef.value && ramda.isNil(props.value)) {
|
|
95
95
|
shouldLoad.value = true;
|
|
96
96
|
await onSearch("");
|
|
97
97
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
var vue = require('vue');
|
|
4
4
|
var vue3Util = require('@ibiz-template/vue3-util');
|
|
5
5
|
require('./ibiz-picker-select-view.css');
|
|
6
|
-
var ramda = require('ramda');
|
|
7
6
|
var runtime = require('@ibiz-template/runtime');
|
|
7
|
+
var ramda = require('ramda');
|
|
8
8
|
|
|
9
9
|
"use strict";
|
|
10
10
|
function _isSlot(s) {
|
|
@@ -32,9 +32,24 @@ const IBizPickerSelectView = /* @__PURE__ */ vue.defineComponent({
|
|
|
32
32
|
const queryValue = vue.ref("");
|
|
33
33
|
const visible = vue.ref(false);
|
|
34
34
|
const pickViewWidth = vue.ref("auto");
|
|
35
|
-
const context = vue.ref(
|
|
36
|
-
const params = vue.ref(
|
|
35
|
+
const context = vue.ref(c.context);
|
|
36
|
+
const params = vue.ref(c.params);
|
|
37
|
+
vue.watch(() => props.data, (newVal) => {
|
|
38
|
+
const {
|
|
39
|
+
context: tempContext,
|
|
40
|
+
params: tempParams
|
|
41
|
+
} = c.handlePublicParams(newVal, c.context, c.params);
|
|
42
|
+
Object.assign(context.value, tempContext);
|
|
43
|
+
Object.assign(params.value, tempParams);
|
|
44
|
+
}, {
|
|
45
|
+
immediate: true,
|
|
46
|
+
deep: true
|
|
47
|
+
});
|
|
37
48
|
const isEditable = vue.ref(false);
|
|
49
|
+
const multipleTempValue = vue.ref(null);
|
|
50
|
+
const multipleTempText = vue.ref(null);
|
|
51
|
+
const multipleObjs = vue.ref(null);
|
|
52
|
+
const showView = vue.ref(false);
|
|
38
53
|
const showFormDefaultContent = vue.computed(() => {
|
|
39
54
|
if (props.controlParams && props.controlParams.editmode === "hover") {
|
|
40
55
|
return true;
|
|
@@ -50,12 +65,6 @@ const IBizPickerSelectView = /* @__PURE__ */ vue.defineComponent({
|
|
|
50
65
|
}, 100);
|
|
51
66
|
}
|
|
52
67
|
};
|
|
53
|
-
const onInputChange = () => {
|
|
54
|
-
context.value = {
|
|
55
|
-
query: queryValue.value,
|
|
56
|
-
...context.value
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
68
|
const triggerMenu = (show) => {
|
|
60
69
|
if (props.disabled) {
|
|
61
70
|
return;
|
|
@@ -86,10 +95,30 @@ const IBizPickerSelectView = /* @__PURE__ */ vue.defineComponent({
|
|
|
86
95
|
params.value.selectedData = selectedData.value;
|
|
87
96
|
}
|
|
88
97
|
} else {
|
|
89
|
-
keySet.value = [];
|
|
90
98
|
const selectItems = [];
|
|
99
|
+
keySet.value = [];
|
|
100
|
+
items.value = [];
|
|
91
101
|
if (newVal) {
|
|
92
|
-
if (
|
|
102
|
+
if (c.model.valueType === "OBJECTS") {
|
|
103
|
+
newVal.forEach((item) => {
|
|
104
|
+
const _item = ramda.clone(item);
|
|
105
|
+
Object.assign(_item, {
|
|
106
|
+
[c.keyName]: item[c.objectIdField],
|
|
107
|
+
[c.textName]: item[c.objectNameField]
|
|
108
|
+
});
|
|
109
|
+
if (c.objectValueField) {
|
|
110
|
+
Object.assign(_item, {
|
|
111
|
+
...item[c.objectValueField]
|
|
112
|
+
});
|
|
113
|
+
delete _item[c.objectValueField];
|
|
114
|
+
}
|
|
115
|
+
if (_item[c.keyName]) {
|
|
116
|
+
items.value.push(_item);
|
|
117
|
+
keySet.value.push(_item[c.keyName]);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
selectItems.push(...newVal);
|
|
121
|
+
} else if (!props.data || !c.valueItem || !props.data[c.valueItem]) {
|
|
93
122
|
ibiz.log.error("\u503C\u9879\u5F02\u5E38");
|
|
94
123
|
} else {
|
|
95
124
|
const tempValue = props.data[c.valueItem].split(",");
|
|
@@ -100,7 +129,6 @@ const IBizPickerSelectView = /* @__PURE__ */ vue.defineComponent({
|
|
|
100
129
|
srfkey
|
|
101
130
|
});
|
|
102
131
|
});
|
|
103
|
-
items.value = [];
|
|
104
132
|
selectItems.forEach((item) => {
|
|
105
133
|
keySet.value.push(item.srfkey);
|
|
106
134
|
const index = items.value.findIndex((i) => Object.is(i.srfkey, item.srfkey));
|
|
@@ -114,10 +142,10 @@ const IBizPickerSelectView = /* @__PURE__ */ vue.defineComponent({
|
|
|
114
142
|
}
|
|
115
143
|
}
|
|
116
144
|
selectedData.value = selectItems;
|
|
117
|
-
|
|
145
|
+
multipleObjs.value = selectItems;
|
|
118
146
|
}
|
|
119
147
|
}, {
|
|
120
|
-
immediate:
|
|
148
|
+
immediate: true,
|
|
121
149
|
deep: true
|
|
122
150
|
});
|
|
123
151
|
vue.onMounted(() => {
|
|
@@ -137,9 +165,26 @@ const IBizPickerSelectView = /* @__PURE__ */ vue.defineComponent({
|
|
|
137
165
|
}
|
|
138
166
|
emit("change", null);
|
|
139
167
|
};
|
|
168
|
+
const onInputChange = (e) => {
|
|
169
|
+
if (!e) {
|
|
170
|
+
onClear();
|
|
171
|
+
}
|
|
172
|
+
};
|
|
140
173
|
const onViewDataChange = (event) => {
|
|
141
174
|
if (event.length === 0) {
|
|
142
|
-
|
|
175
|
+
if (singleSelect.value) {
|
|
176
|
+
onClear();
|
|
177
|
+
} else {
|
|
178
|
+
items.value = [];
|
|
179
|
+
if (c.model.valueType === "OBJECTS") {
|
|
180
|
+
multipleObjs.value = null;
|
|
181
|
+
} else {
|
|
182
|
+
if (c.valueItem) {
|
|
183
|
+
multipleTempValue.value = null;
|
|
184
|
+
}
|
|
185
|
+
multipleTempText.value = null;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
143
188
|
return;
|
|
144
189
|
}
|
|
145
190
|
if (singleSelect.value) {
|
|
@@ -154,6 +199,15 @@ const IBizPickerSelectView = /* @__PURE__ */ vue.defineComponent({
|
|
|
154
199
|
} else {
|
|
155
200
|
emit("change", tempText);
|
|
156
201
|
}
|
|
202
|
+
} else if (c.model.valueType === "OBJECTS") {
|
|
203
|
+
if (event && Array.isArray(event)) {
|
|
204
|
+
const objs = [];
|
|
205
|
+
event.forEach((item) => {
|
|
206
|
+
const obj = c.handleObjectParams(item);
|
|
207
|
+
objs.push(obj);
|
|
208
|
+
});
|
|
209
|
+
multipleObjs.value = objs;
|
|
210
|
+
}
|
|
157
211
|
} else {
|
|
158
212
|
let tempValue = "";
|
|
159
213
|
let tempText = "";
|
|
@@ -176,9 +230,9 @@ const IBizPickerSelectView = /* @__PURE__ */ vue.defineComponent({
|
|
|
176
230
|
tempValue = tempValue.substring(0, tempValue.length - 1);
|
|
177
231
|
tempText = tempText.substring(0, tempText.length - 1);
|
|
178
232
|
if (c.valueItem) {
|
|
179
|
-
|
|
233
|
+
multipleTempValue.value = tempValue;
|
|
180
234
|
}
|
|
181
|
-
|
|
235
|
+
multipleTempText.value = tempText;
|
|
182
236
|
}
|
|
183
237
|
};
|
|
184
238
|
const openLinkView = async (e) => {
|
|
@@ -198,20 +252,31 @@ const IBizPickerSelectView = /* @__PURE__ */ vue.defineComponent({
|
|
|
198
252
|
}
|
|
199
253
|
});
|
|
200
254
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
255
|
+
if (c.model.valueType === "OBJECTS") {
|
|
256
|
+
const objs = [];
|
|
257
|
+
val.forEach((item) => {
|
|
258
|
+
const obj = c.handleObjectParams(item);
|
|
259
|
+
objs.push(obj);
|
|
260
|
+
});
|
|
261
|
+
emit("change", objs);
|
|
262
|
+
} else {
|
|
263
|
+
let tempValue = "";
|
|
264
|
+
let tempText = "";
|
|
265
|
+
val.forEach((select) => {
|
|
266
|
+
const srfkey = select[c.keyName] ? select[c.keyName] : select.srfkey;
|
|
267
|
+
tempValue += "".concat(srfkey, ",");
|
|
268
|
+
const srfmajortext = select[c.textName] ? select[c.textName] : select.srfmajortext;
|
|
269
|
+
tempText += "".concat(srfmajortext, ",");
|
|
270
|
+
});
|
|
271
|
+
tempValue = tempValue.substring(0, tempValue.length - 1);
|
|
272
|
+
tempText = tempText.substring(0, tempText.length - 1);
|
|
273
|
+
if (c.valueItem) {
|
|
274
|
+
multipleTempValue.value = tempValue;
|
|
275
|
+
emit("change", tempValue, c.valueItem);
|
|
276
|
+
}
|
|
277
|
+
multipleTempText.value = tempText;
|
|
278
|
+
emit("change", tempText);
|
|
213
279
|
}
|
|
214
|
-
emit("change", tempText);
|
|
215
280
|
};
|
|
216
281
|
const remoteMethod = (e) => {
|
|
217
282
|
queryValue.value = e;
|
|
@@ -219,6 +284,9 @@ const IBizPickerSelectView = /* @__PURE__ */ vue.defineComponent({
|
|
|
219
284
|
const onSelectionChange = (event) => {
|
|
220
285
|
if (event.data) {
|
|
221
286
|
onViewDataChange(event.data);
|
|
287
|
+
if (singleSelect.value && editorRef.value) {
|
|
288
|
+
editorRef.value.handleClose();
|
|
289
|
+
}
|
|
222
290
|
}
|
|
223
291
|
};
|
|
224
292
|
const modal = new runtime.Modal({
|
|
@@ -245,8 +313,21 @@ const IBizPickerSelectView = /* @__PURE__ */ vue.defineComponent({
|
|
|
245
313
|
if (singleSelect.value) {
|
|
246
314
|
return queryValue.value;
|
|
247
315
|
}
|
|
248
|
-
return selectedData.value.map((item) => item.
|
|
316
|
+
return selectedData.value.map((item) => item[c.textName]).join(",");
|
|
249
317
|
});
|
|
318
|
+
const onVisibleChange = (e) => {
|
|
319
|
+
showView.value = e;
|
|
320
|
+
if (!e && !singleSelect.value) {
|
|
321
|
+
if (c.model.valueType === "OBJECTS") {
|
|
322
|
+
emit("change", multipleObjs.value);
|
|
323
|
+
} else {
|
|
324
|
+
if (c.valueItem) {
|
|
325
|
+
emit("change", multipleTempValue.value, c.valueItem);
|
|
326
|
+
}
|
|
327
|
+
emit("change", multipleTempText.value);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
};
|
|
250
331
|
return {
|
|
251
332
|
ns,
|
|
252
333
|
c,
|
|
@@ -274,7 +355,10 @@ const IBizPickerSelectView = /* @__PURE__ */ vue.defineComponent({
|
|
|
274
355
|
valueText,
|
|
275
356
|
isEditable,
|
|
276
357
|
setEditable,
|
|
277
|
-
showFormDefaultContent
|
|
358
|
+
showFormDefaultContent,
|
|
359
|
+
onVisibleChange,
|
|
360
|
+
showView,
|
|
361
|
+
selectedData
|
|
278
362
|
};
|
|
279
363
|
},
|
|
280
364
|
render() {
|
|
@@ -283,7 +367,8 @@ const IBizPickerSelectView = /* @__PURE__ */ vue.defineComponent({
|
|
|
283
367
|
"trigger": "click",
|
|
284
368
|
"teleported": false,
|
|
285
369
|
"class": this.ns.b("select"),
|
|
286
|
-
"popper-class": this.ns.b("popper")
|
|
370
|
+
"popper-class": this.ns.b("popper"),
|
|
371
|
+
"onVisibleChange": this.onVisibleChange
|
|
287
372
|
}, {
|
|
288
373
|
default: () => {
|
|
289
374
|
let _slot;
|
|
@@ -294,6 +379,7 @@ const IBizPickerSelectView = /* @__PURE__ */ vue.defineComponent({
|
|
|
294
379
|
"disabled": this.disabled,
|
|
295
380
|
"readonly": this.readonly,
|
|
296
381
|
"onChange": this.onInputChange,
|
|
382
|
+
"clearable": true,
|
|
297
383
|
"onFocus": (e) => {
|
|
298
384
|
this.onFocus(e);
|
|
299
385
|
},
|
|
@@ -304,13 +390,13 @@ const IBizPickerSelectView = /* @__PURE__ */ vue.defineComponent({
|
|
|
304
390
|
return [this.queryValue && !this.disabled && !this.readonly && vue.createVNode("ion-icon", {
|
|
305
391
|
"onClick": this.onClear,
|
|
306
392
|
"name": "clear"
|
|
307
|
-
}, null), this.c.model.linkAppViewId &&
|
|
393
|
+
}, null), this.c.model.linkAppViewId && vue.createVNode("ion-icon", {
|
|
308
394
|
"onClick": this.openLinkView,
|
|
309
395
|
"name": "link-arrow"
|
|
310
396
|
}, null)];
|
|
311
397
|
}
|
|
312
398
|
}) : vue.createVNode(vue.resolveComponent("el-select"), {
|
|
313
|
-
"popper-class": "select",
|
|
399
|
+
"popper-class": this.ns.b("select-popover"),
|
|
314
400
|
"model-value": this.keySet,
|
|
315
401
|
"placeholder": this.c.placeHolder ? this.c.placeHolder : " ",
|
|
316
402
|
"multiple": true,
|
|
@@ -335,19 +421,24 @@ const IBizPickerSelectView = /* @__PURE__ */ vue.defineComponent({
|
|
|
335
421
|
});
|
|
336
422
|
},
|
|
337
423
|
dropdown: () => {
|
|
424
|
+
if (!this.showView) {
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
338
427
|
const viewShell = vue.resolveComponent("IBizViewShell");
|
|
339
|
-
return
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
}
|
|
428
|
+
return this.c.pickupView && vue.h(viewShell, {
|
|
429
|
+
context: this.context,
|
|
430
|
+
params: this.params,
|
|
431
|
+
viewId: this.c.pickupView.id,
|
|
432
|
+
style: {
|
|
433
|
+
height: "100%",
|
|
434
|
+
width: this.pickViewWidth
|
|
435
|
+
},
|
|
436
|
+
state: {
|
|
437
|
+
singleSelect: this.singleSelect,
|
|
438
|
+
selectedData: this.selectedData
|
|
439
|
+
},
|
|
440
|
+
onSelectionChange: this.onSelectionChange,
|
|
441
|
+
modal: this.modal
|
|
351
442
|
});
|
|
352
443
|
}
|
|
353
444
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-picker-select-view{width:100%}.ibiz-picker-select-view .el-dropdown{width:100%}.ibiz-picker-select-view .el-select{width:100%}.ibiz-picker-select-view-popper.el-popper.el-dropdown__popper{width:100%;max-height:500px;overflow:auto}.ibiz-picker-select-view-popper.el-popper.el-dropdown__popper .el-scrollbar .el-dropdown__list{background:var(--ibiz-color-primary-text)}.ibiz-picker-select-view-popper.el-popper.el-dropdown__popper .el-scrollbar .el-dropdown__list .el-dropdown-menu{background:var(--ibiz-color-primary-text)}.ibiz-picker-select-view-form-default-content{display:none}.ibiz-form-item .ibiz-picker-select-view.is-show-default:hover .ibiz-picker-select-view-form-default-content{display:none}.ibiz-form-item .ibiz-picker-select-view.is-show-default:hover .ibiz-picker-select-view-select{display:block}.ibiz-form-item .ibiz-picker-select-view.is-show-default .ibiz-picker-select-view-form-default-content{display:flex;align-items:center;width:100%;height:var(--ibiz-editor-default-line-height);padding:var(--ibiz-form-item-hover-edit-padding);font-family:Arial,sans-serif;font-size:var(--ibiz-form-item-font-size);line-height:var(--ibiz-editor-default-line-height);color:var(--ibiz-form-item-text-color)}.ibiz-form-item .ibiz-picker-select-view.is-show-default .ibiz-picker-select-view-form-default-content .ibiz-picker-select-view-content-item{height:22px;padding:0 9px;margin:2px 6px 2px 0;font-size:var(--ibiz-font-size-small);line-height:22px;color:var(--ibiz-editor-default-text-color);background-color:var(--ibiz-color-fill-0);border:1px solid transparent;border-radius:var(--ibiz-border-radius-small)}.ibiz-form-item .ibiz-picker-select-view.is-show-default .ibiz-picker-select-view-select{display:none}.ibiz-form-item .ibiz-picker-select-view.is-show-default.is-editable .ibiz-picker-select-view-form-default-content{display:none}.ibiz-form-item .ibiz-picker-select-view.is-show-default.is-editable .ibiz-picker-select-view-select{display:block}
|
|
1
|
+
.ibiz-picker-select-view{width:100%}.ibiz-picker-select-view .el-dropdown{width:100%}.ibiz-picker-select-view .el-select{width:100%}.ibiz-picker-select-view-popper.el-popper.el-dropdown__popper{width:100%;min-height:100px;max-height:500px;overflow:auto}.ibiz-picker-select-view-popper.el-popper.el-dropdown__popper .el-scrollbar .el-dropdown__list{background:var(--ibiz-color-primary-text)}.ibiz-picker-select-view-popper.el-popper.el-dropdown__popper .el-scrollbar .el-dropdown__list .el-dropdown-menu{background:var(--ibiz-color-primary-text)}.ibiz-picker-select-view-form-default-content{display:none}.ibiz-form-item .ibiz-picker-select-view.is-show-default:hover .ibiz-picker-select-view-form-default-content{display:none}.ibiz-form-item .ibiz-picker-select-view.is-show-default:hover .ibiz-picker-select-view-select{display:block}.ibiz-form-item .ibiz-picker-select-view.is-show-default .ibiz-picker-select-view-form-default-content{display:flex;align-items:center;width:100%;height:var(--ibiz-editor-default-line-height);padding:var(--ibiz-form-item-hover-edit-padding);font-family:Arial,sans-serif;font-size:var(--ibiz-form-item-font-size);line-height:var(--ibiz-editor-default-line-height);color:var(--ibiz-form-item-text-color)}.ibiz-form-item .ibiz-picker-select-view.is-show-default .ibiz-picker-select-view-form-default-content .ibiz-picker-select-view-content-item{height:22px;padding:0 9px;margin:2px 6px 2px 0;font-size:var(--ibiz-font-size-small);line-height:22px;color:var(--ibiz-editor-default-text-color);background-color:var(--ibiz-color-fill-0);border:1px solid transparent;border-radius:var(--ibiz-border-radius-small)}.ibiz-form-item .ibiz-picker-select-view.is-show-default .ibiz-picker-select-view-select{display:none}.ibiz-form-item .ibiz-picker-select-view.is-show-default.is-editable .ibiz-picker-select-view-form-default-content{display:none}.ibiz-form-item .ibiz-picker-select-view.is-show-default.is-editable .ibiz-picker-select-view-select{display:block}.ibiz-picker-select-view-select-popover{display:none}
|