@ibiz-template/vue3-components 0.7.40 → 0.7.41-alpha.1
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-8ZkS4CI0.js → index-4CBJktLS.js} +1 -1
- package/dist/{index-WNFQFxQd.js → index-QL7Ukex9.js} +1 -1
- package/dist/index-eIKUlAq_.js +4 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{map-chart-user-bTKfT7VH.js → map-chart-user-xOSZGbF2.js} +1 -1
- package/dist/{wang-editor-f_OOMd4x.js → wang-editor-6EirGFoh.js} +1 -1
- package/dist/{xlsx-util-3T0fByLw.js → xlsx-util-J1RHk00u.js} +1 -1
- package/es/common/map-chart-user/map-chart-user.util.mjs +1 -1
- package/es/control/app-menu/app-menu.d.ts +2 -2
- package/es/control/app-menu/app-menu.mjs +17 -9
- package/es/control/calendar/calendar.mjs +6 -2
- package/es/control/calendar/components/calendar-daily/use-calendar-daily.mjs +1 -1
- package/es/control/calendar/components/calendar-week/use-calendar-week.mjs +3 -3
- package/es/control/drbar/drbar.controller.mjs +4 -3
- package/es/control/drtab/drtab-control.util.mjs +1 -1
- package/es/control/grid/grid/grid-control.util.mjs +48 -2
- package/es/control/grid/row-edit-popover/row-edit-popover.css +1 -1
- package/es/control/kanban/kanban.mjs +6 -1
- package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.d.ts +1 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/index.d.ts +1 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/index.mjs +3 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/icon.d.ts +2 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/icon.mjs +19 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/interface.d.ts +99 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/interface.mjs +89 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer-util.d.ts +17 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer-util.mjs +103 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer.css +1 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer.d.ts +182 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer.mjs +146 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/icon.d.ts +1 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/icon.mjs +12 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/interface.d.ts +60 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/interface.mjs +52 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel-util.d.ts +14 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel-util.mjs +130 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel.css +1 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel.d.ts +108 -0
- package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel.mjs +116 -0
- package/es/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.css +1 -0
- package/es/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.d.ts +97 -0
- package/es/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.mjs +279 -0
- package/es/editor/data-picker/index.d.ts +1 -0
- package/es/editor/data-picker/index.mjs +1 -0
- package/es/editor/data-picker/picker-editor.provider.mjs +3 -0
- package/es/editor/dropdown-list/dropdown-list-editor.provider.mjs +3 -0
- package/es/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.css +1 -0
- package/es/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.d.ts +93 -0
- package/es/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.mjs +292 -0
- package/es/editor/dropdown-list/index.d.ts +1 -0
- package/es/editor/dropdown-list/index.mjs +1 -0
- package/es/editor/index.mjs +12 -0
- package/es/editor/rate/ibiz-rate/ibiz-rate.d.ts +3 -0
- package/es/locale/en/index.d.ts +10 -0
- package/es/locale/en/index.mjs +10 -0
- package/es/locale/zh-CN/index.d.ts +10 -0
- package/es/locale/zh-CN/index.mjs +10 -0
- package/es/panel-component/app-switch/app-switch.controller.mjs +11 -1
- package/es/panel-component/panel-tab-panel/panel-tab-panel.css +1 -1
- package/es/panel-component/searchform-buttons/searchform-buttons.css +1 -1
- package/es/util/fullscreen/fullscreen-util.mjs +1 -1
- package/es/web-app/components/router-shell/router-shell.mjs +6 -4
- package/lib/common/map-chart-user/map-chart-user.util.cjs +1 -1
- package/lib/control/app-menu/app-menu.cjs +16 -8
- package/lib/control/calendar/calendar.cjs +6 -2
- package/lib/control/calendar/components/calendar-daily/use-calendar-daily.cjs +1 -1
- package/lib/control/calendar/components/calendar-week/use-calendar-week.cjs +3 -3
- package/lib/control/drbar/drbar.controller.cjs +4 -3
- package/lib/control/drtab/drtab-control.util.cjs +1 -1
- package/lib/control/grid/grid/grid-control.util.cjs +48 -2
- package/lib/control/grid/row-edit-popover/row-edit-popover.css +1 -1
- package/lib/control/kanban/kanban.cjs +6 -1
- package/lib/editor/data-picker/ibiz-transfer-picker/components/index.cjs +7 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer/icon.cjs +22 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer/interface.cjs +99 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer-util.cjs +108 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer.cjs +148 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer/transfer.css +1 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/icon.cjs +14 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/interface.cjs +58 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel-util.cjs +133 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel.cjs +118 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel.css +1 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.cjs +281 -0
- package/lib/editor/data-picker/ibiz-transfer-picker/ibiz-transfer-picker.css +1 -0
- package/lib/editor/data-picker/index.cjs +2 -0
- package/lib/editor/data-picker/picker-editor.provider.cjs +3 -0
- package/lib/editor/dropdown-list/dropdown-list-editor.provider.cjs +3 -0
- package/lib/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.cjs +294 -0
- package/lib/editor/dropdown-list/ibiz-tree-picker/ibiz-tree-picker.css +1 -0
- package/lib/editor/dropdown-list/index.cjs +2 -0
- package/lib/editor/index.cjs +12 -0
- package/lib/locale/en/index.cjs +10 -0
- package/lib/locale/zh-CN/index.cjs +10 -0
- package/lib/panel-component/app-switch/app-switch.controller.cjs +11 -1
- package/lib/panel-component/panel-tab-panel/panel-tab-panel.css +1 -1
- package/lib/panel-component/searchform-buttons/searchform-buttons.css +1 -1
- package/lib/util/fullscreen/fullscreen-util.cjs +1 -1
- package/lib/web-app/components/router-shell/router-shell.cjs +6 -4
- package/package.json +5 -5
- package/dist/index-azhHVxuV.js +0 -4
- /package/es/node_modules/.pnpm/{@ibiz-template_core@0.7.40_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.41-alpha.1_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs +0 -0
- /package/lib/node_modules/.pnpm/{@ibiz-template_core@0.7.40_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.41-alpha.1_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs +0 -0
package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel.d.ts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import './transfer-panel.scss';
|
|
2
|
+
export declare const TransferPanel: import("vue").DefineComponent<{
|
|
3
|
+
data: {
|
|
4
|
+
type: import("vue").PropType<import("@ibiz-template/core").IApiData>;
|
|
5
|
+
default: () => import("@ibiz-template/core").IApiData;
|
|
6
|
+
};
|
|
7
|
+
optionRender: {
|
|
8
|
+
type: import("vue").PropType<(option: import("@ibiz-template/core").IApiData) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}>[]>;
|
|
13
|
+
};
|
|
14
|
+
placeholder: StringConstructor;
|
|
15
|
+
title: StringConstructor;
|
|
16
|
+
filterable: BooleanConstructor;
|
|
17
|
+
enableAcSearch: BooleanConstructor;
|
|
18
|
+
format: {
|
|
19
|
+
type: import("vue").PropType<import("../transfer/interface").TransferFormat>;
|
|
20
|
+
default: () => import("../transfer/interface").TransferFormat;
|
|
21
|
+
};
|
|
22
|
+
filterMethod: {
|
|
23
|
+
type: import("vue").PropType<(query: string, item: import("@ibiz-template/core").IApiData) => boolean>;
|
|
24
|
+
};
|
|
25
|
+
defaultChecked: {
|
|
26
|
+
type: import("vue").PropType<import("./interface").TransferKey[]>;
|
|
27
|
+
default: () => import("./interface").TransferKey[];
|
|
28
|
+
};
|
|
29
|
+
props: {
|
|
30
|
+
type: import("vue").PropType<import("./interface").TransferPropsAlias>;
|
|
31
|
+
default: () => import("./interface").TransferPropsAlias;
|
|
32
|
+
};
|
|
33
|
+
loading: {
|
|
34
|
+
type: BooleanConstructor;
|
|
35
|
+
default: boolean;
|
|
36
|
+
};
|
|
37
|
+
readonly: {
|
|
38
|
+
type: BooleanConstructor;
|
|
39
|
+
default: boolean;
|
|
40
|
+
};
|
|
41
|
+
}, {
|
|
42
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
43
|
+
query: import("vue").Ref<string>;
|
|
44
|
+
allChecked: import("vue").Ref<boolean>;
|
|
45
|
+
checkedSummary: import("vue").ComputedRef<any>;
|
|
46
|
+
hasNoMatch: import("vue").ComputedRef<boolean>;
|
|
47
|
+
hasFooter: import("vue").ComputedRef<boolean>;
|
|
48
|
+
checked: import("vue").Ref<import("./interface").TransferKey[]>;
|
|
49
|
+
filteredData: import("vue").Ref<any>;
|
|
50
|
+
propsAlias: import("vue").ComputedRef<any>;
|
|
51
|
+
isIndeterminate: import("vue").ComputedRef<any>;
|
|
52
|
+
onInputChange: (value: string) => void;
|
|
53
|
+
handleAllCheckedChange: (value: import("./interface").CheckboxValueType) => void;
|
|
54
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
55
|
+
checkedChange: (value: import("./interface").TransferKey[], movedKeys?: import("./interface").TransferKey[] | undefined) => boolean;
|
|
56
|
+
acSearch: (query: string) => string;
|
|
57
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
58
|
+
data: {
|
|
59
|
+
type: import("vue").PropType<import("@ibiz-template/core").IApiData>;
|
|
60
|
+
default: () => import("@ibiz-template/core").IApiData;
|
|
61
|
+
};
|
|
62
|
+
optionRender: {
|
|
63
|
+
type: import("vue").PropType<(option: import("@ibiz-template/core").IApiData) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
64
|
+
[key: string]: any;
|
|
65
|
+
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
66
|
+
[key: string]: any;
|
|
67
|
+
}>[]>;
|
|
68
|
+
};
|
|
69
|
+
placeholder: StringConstructor;
|
|
70
|
+
title: StringConstructor;
|
|
71
|
+
filterable: BooleanConstructor;
|
|
72
|
+
enableAcSearch: BooleanConstructor;
|
|
73
|
+
format: {
|
|
74
|
+
type: import("vue").PropType<import("../transfer/interface").TransferFormat>;
|
|
75
|
+
default: () => import("../transfer/interface").TransferFormat;
|
|
76
|
+
};
|
|
77
|
+
filterMethod: {
|
|
78
|
+
type: import("vue").PropType<(query: string, item: import("@ibiz-template/core").IApiData) => boolean>;
|
|
79
|
+
};
|
|
80
|
+
defaultChecked: {
|
|
81
|
+
type: import("vue").PropType<import("./interface").TransferKey[]>;
|
|
82
|
+
default: () => import("./interface").TransferKey[];
|
|
83
|
+
};
|
|
84
|
+
props: {
|
|
85
|
+
type: import("vue").PropType<import("./interface").TransferPropsAlias>;
|
|
86
|
+
default: () => import("./interface").TransferPropsAlias;
|
|
87
|
+
};
|
|
88
|
+
loading: {
|
|
89
|
+
type: BooleanConstructor;
|
|
90
|
+
default: boolean;
|
|
91
|
+
};
|
|
92
|
+
readonly: {
|
|
93
|
+
type: BooleanConstructor;
|
|
94
|
+
default: boolean;
|
|
95
|
+
};
|
|
96
|
+
}>> & {
|
|
97
|
+
onCheckedChange?: ((value: import("./interface").TransferKey[], movedKeys?: import("./interface").TransferKey[] | undefined) => any) | undefined;
|
|
98
|
+
onAcSearch?: ((query: string) => any) | undefined;
|
|
99
|
+
}, {
|
|
100
|
+
props: import("./interface").TransferPropsAlias;
|
|
101
|
+
data: import("@ibiz-template/core").IApiData;
|
|
102
|
+
loading: boolean;
|
|
103
|
+
readonly: boolean;
|
|
104
|
+
format: import("../transfer/interface").TransferFormat;
|
|
105
|
+
filterable: boolean;
|
|
106
|
+
enableAcSearch: boolean;
|
|
107
|
+
defaultChecked: import("./interface").TransferKey[];
|
|
108
|
+
}, {}>;
|
package/es/editor/data-picker/ibiz-transfer-picker/components/transfer-panel/transfer-panel.mjs
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { reactive, computed, toRefs, resolveComponent, createVNode, resolveDirective, withDirectives, defineComponent } from 'vue';
|
|
2
|
+
import { isEmpty } from 'ramda';
|
|
3
|
+
import { useNamespace } from '@ibiz-template/vue3-util';
|
|
4
|
+
import { transferPanelProps, transferPanelEmits } from './interface.mjs';
|
|
5
|
+
import { usePropsAlias, useCheck } from './transfer-panel-util.mjs';
|
|
6
|
+
import { Search } from './icon.mjs';
|
|
7
|
+
import './transfer-panel.css';
|
|
8
|
+
|
|
9
|
+
"use strict";
|
|
10
|
+
const TransferPanel = /* @__PURE__ */ defineComponent({
|
|
11
|
+
name: "IBizTransferPanel",
|
|
12
|
+
props: transferPanelProps,
|
|
13
|
+
emits: transferPanelEmits,
|
|
14
|
+
setup(props, {
|
|
15
|
+
emit,
|
|
16
|
+
slots
|
|
17
|
+
}) {
|
|
18
|
+
const ns = useNamespace("transfer-panel");
|
|
19
|
+
const panelState = reactive({
|
|
20
|
+
checked: [],
|
|
21
|
+
allChecked: false,
|
|
22
|
+
query: "",
|
|
23
|
+
checkChangeByUser: true
|
|
24
|
+
});
|
|
25
|
+
const propsAlias = usePropsAlias(props);
|
|
26
|
+
const {
|
|
27
|
+
filteredData,
|
|
28
|
+
checkedSummary,
|
|
29
|
+
isIndeterminate,
|
|
30
|
+
onInputChange,
|
|
31
|
+
handleAllCheckedChange
|
|
32
|
+
} = useCheck(props, panelState, emit);
|
|
33
|
+
const hasNoMatch = computed(() => !isEmpty(panelState.query) && isEmpty(filteredData.value));
|
|
34
|
+
const hasFooter = computed(() => !(slots.default && isEmpty(slots.default()[0].children)));
|
|
35
|
+
const {
|
|
36
|
+
checked,
|
|
37
|
+
allChecked,
|
|
38
|
+
query
|
|
39
|
+
} = toRefs(panelState);
|
|
40
|
+
return {
|
|
41
|
+
ns,
|
|
42
|
+
query,
|
|
43
|
+
allChecked,
|
|
44
|
+
checkedSummary,
|
|
45
|
+
hasNoMatch,
|
|
46
|
+
hasFooter,
|
|
47
|
+
checked,
|
|
48
|
+
filteredData,
|
|
49
|
+
propsAlias,
|
|
50
|
+
isIndeterminate,
|
|
51
|
+
onInputChange,
|
|
52
|
+
handleAllCheckedChange
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
render() {
|
|
56
|
+
var _a, _b;
|
|
57
|
+
return createVNode("div", {
|
|
58
|
+
"class": this.ns.b()
|
|
59
|
+
}, [createVNode("p", {
|
|
60
|
+
"class": this.ns.e("header")
|
|
61
|
+
}, [createVNode(resolveComponent("el-checkbox"), {
|
|
62
|
+
"modelValue": this.allChecked,
|
|
63
|
+
"onUpdate:modelValue": ($event) => this.allChecked = $event,
|
|
64
|
+
"disabled": this.readonly,
|
|
65
|
+
"indeterminate": this.isIndeterminate,
|
|
66
|
+
"validateEvent": false,
|
|
67
|
+
"onChange": this.handleAllCheckedChange
|
|
68
|
+
}, {
|
|
69
|
+
default: () => [this.title, createVNode("span", null, [this.checkedSummary])]
|
|
70
|
+
})]), createVNode("div", {
|
|
71
|
+
"class": [this.ns.e("body"), this.ns.is("with-footer", this.hasFooter)]
|
|
72
|
+
}, [this.filterable ? createVNode(resolveComponent("el-input"), {
|
|
73
|
+
"modelValue": this.query,
|
|
74
|
+
"onUpdate:modelValue": ($event) => this.query = $event,
|
|
75
|
+
"readonly": this.readonly,
|
|
76
|
+
"class": this.ns.e("filter"),
|
|
77
|
+
"size": "default",
|
|
78
|
+
"placeholder": this.placeholder,
|
|
79
|
+
"prefixIcon": () => Search(),
|
|
80
|
+
"clearable": true,
|
|
81
|
+
"validateEvent": false,
|
|
82
|
+
"onInput": this.onInputChange
|
|
83
|
+
}, null) : null, withDirectives(createVNode("div", {
|
|
84
|
+
"class": [this.ns.e("content"), this.ns.is("filterable", this.filterable)]
|
|
85
|
+
}, [!this.hasNoMatch && !isEmpty(this.data) ? createVNode(resolveComponent("el-checkbox-group"), {
|
|
86
|
+
"modelValue": this.checked,
|
|
87
|
+
"onUpdate:modelValue": ($event) => this.checked = $event,
|
|
88
|
+
"validateEvent": false,
|
|
89
|
+
"disabled": this.readonly,
|
|
90
|
+
"class": [this.ns.e("list")]
|
|
91
|
+
}, {
|
|
92
|
+
default: () => {
|
|
93
|
+
return this.filteredData.map((item) => {
|
|
94
|
+
return createVNode(resolveComponent("el-checkbox"), {
|
|
95
|
+
"class": this.ns.e("item"),
|
|
96
|
+
"key": item[this.propsAlias.key],
|
|
97
|
+
"label": item[this.propsAlias.key],
|
|
98
|
+
"disabled": !!item[this.propsAlias.disabled],
|
|
99
|
+
"validateEvent": false
|
|
100
|
+
}, {
|
|
101
|
+
default: () => {
|
|
102
|
+
var _a2;
|
|
103
|
+
return [(_a2 = this.optionRender) == null ? void 0 : _a2.call(this, item)];
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}) : createVNode("div", {
|
|
109
|
+
"class": this.ns.e("empty")
|
|
110
|
+
}, [this.$slots.empty ? (_b = (_a = this.$slots).empty) == null ? void 0 : _b.call(_a) : createVNode(resolveComponent("iBizNoData"), {
|
|
111
|
+
"class": this.ns.em("empty", "no-data")
|
|
112
|
+
}, null)])]), [[resolveDirective("loading"), this.enableAcSearch && this.loading]])])]);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
export { TransferPanel };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-transfer-picker{width:100%;height:100%}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Ref, VNode } from 'vue';
|
|
2
|
+
import { PickerEditorController } from '../picker-editor.controller';
|
|
3
|
+
import './ibiz-transfer-picker.scss';
|
|
4
|
+
/**
|
|
5
|
+
* 穿梭框选择(扩展)
|
|
6
|
+
*
|
|
7
|
+
* @description 用于通过穿梭框样式区分未选数据和已选数据。基于`数据选择`编辑器进行扩展,编辑器样式代码名称为:TRANSFER_PICKER
|
|
8
|
+
* @primary
|
|
9
|
+
* @editorparams {"name":"titles","parameterType":"string[]","defaultvalue":"[\"可选列表\",\"已选列表\"]","description":"用于自定义列表标题,该值为字符串数组。其中下标为 0 的字符串对应穿梭框左侧列表的标题,下标为 1 的字符串对应穿梭框右侧列表的标题"}
|
|
10
|
+
* @editorparams {"name":"buttontexts","parameterType":"string[]","defaultvalue":"[\"删除\",\"添加\"]","description":"用于自定义按钮显示文字,该值为字符串数组。其中下标为 0 的字符串对应左侧按钮文字,下标为 1 的字符串对应右侧按钮文字"}
|
|
11
|
+
* @editorparams {"name":"remotesearch","parameterType":"boolean","defaultvalue":"false","description":"是否启用远程过滤搜索功能。左侧列表默认采用本地过滤搜索,若此值为 true,则会开启远程过滤搜索"}
|
|
12
|
+
* @ignoreprops autoFocus | overflowMode | controlParams
|
|
13
|
+
* @ignoreemits blur | focus | enter
|
|
14
|
+
*/
|
|
15
|
+
export declare const IBizTransferPicker: import("vue").DefineComponent<{
|
|
16
|
+
value: (ArrayConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
|
|
17
|
+
controller: import("@ibiz-template/vue3-util").RequiredProp<import("vue").PropType<PickerEditorController>, undefined, undefined>;
|
|
18
|
+
data: import("@ibiz-template/vue3-util").RequiredProp<import("vue").PropType<import("@ibiz-template/core").IApiData>, undefined, undefined>;
|
|
19
|
+
disabled: {
|
|
20
|
+
type: BooleanConstructor;
|
|
21
|
+
};
|
|
22
|
+
readonly: {
|
|
23
|
+
type: BooleanConstructor;
|
|
24
|
+
default: boolean;
|
|
25
|
+
};
|
|
26
|
+
autoFocus: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
default: boolean;
|
|
29
|
+
};
|
|
30
|
+
overflowMode: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
};
|
|
33
|
+
controlParams: {
|
|
34
|
+
type: ObjectConstructor;
|
|
35
|
+
required: boolean;
|
|
36
|
+
};
|
|
37
|
+
}, {
|
|
38
|
+
c: PickerEditorController;
|
|
39
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
40
|
+
ns2: import("@ibiz-template/core").Namespace;
|
|
41
|
+
items: Ref<import("@ibiz-template/core").IApiData[]>;
|
|
42
|
+
loading: Ref<boolean>;
|
|
43
|
+
curValue: Ref<string[]>;
|
|
44
|
+
valueText: import("vue").ComputedRef<string>;
|
|
45
|
+
editorRef: Ref<any>;
|
|
46
|
+
curIndexs: Ref<string[]>;
|
|
47
|
+
leftChecked: Ref<string[]>;
|
|
48
|
+
rightChecked: Ref<string[]>;
|
|
49
|
+
titles: string[];
|
|
50
|
+
buttonTexts: string[];
|
|
51
|
+
enableRemoteSearch: boolean;
|
|
52
|
+
onSearch: (...args: unknown[]) => Promise<void>;
|
|
53
|
+
filterMethod: (query: string, item: IData) => boolean;
|
|
54
|
+
onRightChange: (selectKeys: Array<string | number>) => void;
|
|
55
|
+
onLeftCheckChange: (selectKeys: Array<string | number>) => void;
|
|
56
|
+
onRightCheckChange: (selectKeys: Array<string | number>) => void;
|
|
57
|
+
renderContentItem: (h: (type: string, vNodeProps: IParams | null, children?: string) => VNode, option: IParams) => VNode;
|
|
58
|
+
onLeftAcSearch: (query: string) => void;
|
|
59
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
60
|
+
change: (_value: unknown, _name?: string | undefined, _ignore?: boolean | undefined) => boolean;
|
|
61
|
+
blur: (_event?: import("@ibiz-template/core").IApiData | undefined) => boolean;
|
|
62
|
+
focus: (_event?: import("@ibiz-template/core").IApiData | undefined) => boolean;
|
|
63
|
+
enter: (_event?: import("@ibiz-template/core").IApiData | undefined) => boolean;
|
|
64
|
+
infoTextChange: (_text: string) => boolean;
|
|
65
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
66
|
+
value: (ArrayConstructor | ObjectConstructor | StringConstructor | NumberConstructor)[];
|
|
67
|
+
controller: import("@ibiz-template/vue3-util").RequiredProp<import("vue").PropType<PickerEditorController>, undefined, undefined>;
|
|
68
|
+
data: import("@ibiz-template/vue3-util").RequiredProp<import("vue").PropType<import("@ibiz-template/core").IApiData>, undefined, undefined>;
|
|
69
|
+
disabled: {
|
|
70
|
+
type: BooleanConstructor;
|
|
71
|
+
};
|
|
72
|
+
readonly: {
|
|
73
|
+
type: BooleanConstructor;
|
|
74
|
+
default: boolean;
|
|
75
|
+
};
|
|
76
|
+
autoFocus: {
|
|
77
|
+
type: BooleanConstructor;
|
|
78
|
+
default: boolean;
|
|
79
|
+
};
|
|
80
|
+
overflowMode: {
|
|
81
|
+
type: StringConstructor;
|
|
82
|
+
};
|
|
83
|
+
controlParams: {
|
|
84
|
+
type: ObjectConstructor;
|
|
85
|
+
required: boolean;
|
|
86
|
+
};
|
|
87
|
+
}>> & {
|
|
88
|
+
onFocus?: ((_event?: import("@ibiz-template/core").IApiData | undefined) => any) | undefined;
|
|
89
|
+
onBlur?: ((_event?: import("@ibiz-template/core").IApiData | undefined) => any) | undefined;
|
|
90
|
+
onChange?: ((_value: unknown, _name?: string | undefined, _ignore?: boolean | undefined) => any) | undefined;
|
|
91
|
+
onInfoTextChange?: ((_text: string) => any) | undefined;
|
|
92
|
+
onEnter?: ((_event?: import("@ibiz-template/core").IApiData | undefined) => any) | undefined;
|
|
93
|
+
}, {
|
|
94
|
+
disabled: boolean;
|
|
95
|
+
readonly: boolean;
|
|
96
|
+
autoFocus: boolean;
|
|
97
|
+
}, {}>;
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { ref, watch, computed, onMounted, mergeProps, createVNode, defineComponent } from 'vue';
|
|
2
|
+
import { getDataPickerProps, getEditorEmits, useNamespace } from '@ibiz-template/vue3-util';
|
|
3
|
+
import { debounce } from '@ibiz-template/core';
|
|
4
|
+
import { clone } from 'lodash-es';
|
|
5
|
+
import './components/index.mjs';
|
|
6
|
+
import './ibiz-transfer-picker.css';
|
|
7
|
+
import { TransferSelect } from './components/transfer/transfer.mjs';
|
|
8
|
+
|
|
9
|
+
"use strict";
|
|
10
|
+
const IBizTransferPicker = /* @__PURE__ */ defineComponent({
|
|
11
|
+
name: "IBizTransferPicker",
|
|
12
|
+
props: getDataPickerProps(),
|
|
13
|
+
emits: getEditorEmits(),
|
|
14
|
+
setup(props, {
|
|
15
|
+
emit
|
|
16
|
+
}) {
|
|
17
|
+
const ns = useNamespace("picker");
|
|
18
|
+
const ns2 = useNamespace("transfer-picker");
|
|
19
|
+
const c = props.controller;
|
|
20
|
+
const editorModel = c.model;
|
|
21
|
+
const curValue = ref([]);
|
|
22
|
+
const items = ref([]);
|
|
23
|
+
const selectItems = ref([]);
|
|
24
|
+
const loading = ref(false);
|
|
25
|
+
const editorRef = ref();
|
|
26
|
+
const curIndexs = ref([]);
|
|
27
|
+
const leftChecked = ref([]);
|
|
28
|
+
const rightChecked = ref([]);
|
|
29
|
+
const rightSelects = ref([]);
|
|
30
|
+
const valueType = c.model.valueType;
|
|
31
|
+
const valueSeparator = c.model.valueSeparator || ",";
|
|
32
|
+
let titles = [ibiz.i18n.t("editor.transferPicker.optionalList"), ibiz.i18n.t("editor.transferPicker.selectedList")];
|
|
33
|
+
let buttonTexts = [ibiz.i18n.t("app.delete"), ibiz.i18n.t("app.add")];
|
|
34
|
+
let enableRemoteSearch = false;
|
|
35
|
+
if (editorModel.editorParams) {
|
|
36
|
+
const {
|
|
37
|
+
editorParams
|
|
38
|
+
} = editorModel;
|
|
39
|
+
if (editorParams.titles) {
|
|
40
|
+
try {
|
|
41
|
+
titles = JSON.parse(editorParams.titles);
|
|
42
|
+
} catch (error) {
|
|
43
|
+
ibiz.log.info(error);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (editorParams.buttontexts) {
|
|
47
|
+
try {
|
|
48
|
+
buttonTexts = JSON.parse(editorParams.buttontexts);
|
|
49
|
+
} catch (error) {
|
|
50
|
+
ibiz.log.info(error);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (editorParams.remotesearch)
|
|
54
|
+
enableRemoteSearch = editorParams.remotesearch === "true";
|
|
55
|
+
}
|
|
56
|
+
watch(() => props.value, (newVal) => {
|
|
57
|
+
curValue.value = [];
|
|
58
|
+
selectItems.value = [];
|
|
59
|
+
if (newVal) {
|
|
60
|
+
if (valueType === "OBJECTS") {
|
|
61
|
+
newVal.forEach((item) => {
|
|
62
|
+
const _item = clone(item);
|
|
63
|
+
Object.assign(_item, {
|
|
64
|
+
[c.keyName]: item[c.objectIdField],
|
|
65
|
+
[c.textName]: item[c.objectNameField]
|
|
66
|
+
});
|
|
67
|
+
if (c.objectValueField) {
|
|
68
|
+
Object.assign(_item, {
|
|
69
|
+
...item[c.objectValueField]
|
|
70
|
+
});
|
|
71
|
+
delete _item[c.objectValueField];
|
|
72
|
+
}
|
|
73
|
+
if (_item[c.keyName]) {
|
|
74
|
+
selectItems.value.push(_item);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
} else if (c.objectIdField && valueSeparator) {
|
|
78
|
+
const values = newVal.split(valueSeparator);
|
|
79
|
+
values.forEach((value) => {
|
|
80
|
+
selectItems.value.push({
|
|
81
|
+
[c.keyName]: value
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
} else {
|
|
85
|
+
try {
|
|
86
|
+
selectItems.value = JSON.parse(newVal);
|
|
87
|
+
} catch (error) {
|
|
88
|
+
ibiz.log.error("SIMPLE\u7C7B\u578B\u5730\u5740\u680F\u503C\u683C\u5F0F".concat(newVal, "\u4E0D\u7B26\u5408JSON\u5B57\u7B26\u4E32\u8981\u6C42"));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
selectItems.value.forEach((item) => {
|
|
92
|
+
curValue.value.push(item[c.keyName]);
|
|
93
|
+
const index = items.value.findIndex((i) => Object.is(i[c.keyName], item[c.keyName]));
|
|
94
|
+
if (index < 0) {
|
|
95
|
+
items.value.push({
|
|
96
|
+
[c.keyName]: item[c.keyName],
|
|
97
|
+
[c.textName]: item[c.textName]
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}, {
|
|
103
|
+
immediate: true,
|
|
104
|
+
deep: true
|
|
105
|
+
});
|
|
106
|
+
watch(editorRef, (newVal) => {
|
|
107
|
+
if (props.autoFocus && newVal && newVal.focus) {
|
|
108
|
+
newVal.focus();
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
const handleRightChange = (result) => {
|
|
112
|
+
const selects = [];
|
|
113
|
+
if (result && Array.isArray(result)) {
|
|
114
|
+
result.forEach((select) => {
|
|
115
|
+
Object.assign(select, {
|
|
116
|
+
[c.keyName]: select[c.keyName] ? select[c.keyName] : select.srfkey,
|
|
117
|
+
[c.textName]: select[c.textName] ? select[c.textName] : select.srfmajortext
|
|
118
|
+
});
|
|
119
|
+
if (valueType === "OBJECTS") {
|
|
120
|
+
selects.push(c.handleObjectParams(select));
|
|
121
|
+
} else if (c.objectIdField) {
|
|
122
|
+
selects.push(select[c.keyName]);
|
|
123
|
+
} else {
|
|
124
|
+
selects.push({
|
|
125
|
+
[c.keyName]: select[c.keyName],
|
|
126
|
+
[c.textName]: select[c.textName]
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
const index = items.value.findIndex((item) => Object.is(item[c.keyName], select[c.keyName]));
|
|
130
|
+
if (index < 0) {
|
|
131
|
+
items.value.push(select);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
let value = null;
|
|
136
|
+
if (selects.length > 0) {
|
|
137
|
+
if (valueType === "OBJECTS") {
|
|
138
|
+
value = selects;
|
|
139
|
+
} else {
|
|
140
|
+
value = c.objectIdField ? selects.join(valueSeparator) : JSON.stringify(selects);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
emit("change", value);
|
|
144
|
+
};
|
|
145
|
+
const filterMethod = (query, item) => {
|
|
146
|
+
const textName = item[c.textName];
|
|
147
|
+
return !query || (textName == null ? void 0 : textName.toLowerCase().includes(query == null ? void 0 : query.toLowerCase()));
|
|
148
|
+
};
|
|
149
|
+
const onRightChange = (selectKeys) => {
|
|
150
|
+
const selects = selectKeys.map((key) => {
|
|
151
|
+
const selcetItem = items.value.find((item) => item[c.keyName] === key);
|
|
152
|
+
return selcetItem || {};
|
|
153
|
+
});
|
|
154
|
+
handleRightChange(selects);
|
|
155
|
+
};
|
|
156
|
+
const onLeftCheckChange = (selectKeys) => {
|
|
157
|
+
leftChecked.value = selectKeys;
|
|
158
|
+
};
|
|
159
|
+
const onRightCheckChange = (selectKeys) => {
|
|
160
|
+
rightChecked.value = selectKeys;
|
|
161
|
+
};
|
|
162
|
+
const getServiceData = async (query) => {
|
|
163
|
+
let data = [];
|
|
164
|
+
if (c.model.appDataEntityId) {
|
|
165
|
+
try {
|
|
166
|
+
const trimQuery = query.trim();
|
|
167
|
+
const res = await c.getServiceData(trimQuery, props.data);
|
|
168
|
+
if (res) {
|
|
169
|
+
data = res.data;
|
|
170
|
+
}
|
|
171
|
+
} catch (error) {
|
|
172
|
+
ibiz.log.error(error);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return data;
|
|
176
|
+
};
|
|
177
|
+
const onSearch = async (...args) => {
|
|
178
|
+
rightSelects.value = items.value.filter((item) => !!selectItems.value.find((item2) => item2[c.keyName] === item[c.keyName]));
|
|
179
|
+
const query = args[0] || "";
|
|
180
|
+
loading.value = true;
|
|
181
|
+
const data = await getServiceData(query);
|
|
182
|
+
if (data) {
|
|
183
|
+
items.value = [...rightSelects.value, ...data.filter((item) => !rightSelects.value.find((item2) => item2[c.keyName] === item[c.keyName]))];
|
|
184
|
+
}
|
|
185
|
+
rightChecked.value = [...rightChecked.value];
|
|
186
|
+
leftChecked.value = [...leftChecked.value];
|
|
187
|
+
loading.value = false;
|
|
188
|
+
};
|
|
189
|
+
const debounceSearch = debounce(onSearch, 1e3);
|
|
190
|
+
const onLeftAcSearch = (query) => {
|
|
191
|
+
debounceSearch(query);
|
|
192
|
+
};
|
|
193
|
+
const valueText = computed(() => {
|
|
194
|
+
return selectItems.value.map((item) => {
|
|
195
|
+
return item[c.textName];
|
|
196
|
+
}).join(",");
|
|
197
|
+
});
|
|
198
|
+
watch(valueText, (newVal, oldVal) => {
|
|
199
|
+
if (newVal !== oldVal) {
|
|
200
|
+
emit("infoTextChange", newVal);
|
|
201
|
+
}
|
|
202
|
+
}, {
|
|
203
|
+
immediate: true
|
|
204
|
+
});
|
|
205
|
+
onMounted(() => {
|
|
206
|
+
if (c.objectNameField) {
|
|
207
|
+
items.value = [];
|
|
208
|
+
onSearch("");
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
const renderContentItem = (h, option) => {
|
|
212
|
+
return h("span", {
|
|
213
|
+
title: option[c.textName]
|
|
214
|
+
}, option[c.textName]);
|
|
215
|
+
};
|
|
216
|
+
return {
|
|
217
|
+
c,
|
|
218
|
+
ns,
|
|
219
|
+
ns2,
|
|
220
|
+
items,
|
|
221
|
+
loading,
|
|
222
|
+
curValue,
|
|
223
|
+
valueText,
|
|
224
|
+
editorRef,
|
|
225
|
+
curIndexs,
|
|
226
|
+
leftChecked,
|
|
227
|
+
rightChecked,
|
|
228
|
+
titles,
|
|
229
|
+
buttonTexts,
|
|
230
|
+
enableRemoteSearch,
|
|
231
|
+
onSearch,
|
|
232
|
+
filterMethod,
|
|
233
|
+
onRightChange,
|
|
234
|
+
onLeftCheckChange,
|
|
235
|
+
onRightCheckChange,
|
|
236
|
+
renderContentItem,
|
|
237
|
+
onLeftAcSearch
|
|
238
|
+
};
|
|
239
|
+
},
|
|
240
|
+
render() {
|
|
241
|
+
const editContent = createVNode("div", {
|
|
242
|
+
"class": [this.ns.e("autocomplete")]
|
|
243
|
+
}, [createVNode(TransferSelect, mergeProps({
|
|
244
|
+
"ref": "editorRef",
|
|
245
|
+
"modelValue": this.curValue,
|
|
246
|
+
"onUpdate:modelValue": ($event) => this.curValue = $event,
|
|
247
|
+
"data": this.items,
|
|
248
|
+
"readonly": this.readonly || this.disabled,
|
|
249
|
+
"left-default-checked": this.leftChecked,
|
|
250
|
+
"right-default-checked": this.rightChecked,
|
|
251
|
+
"props": {
|
|
252
|
+
key: this.c.keyName,
|
|
253
|
+
label: this.c.textName
|
|
254
|
+
},
|
|
255
|
+
"filterable": true,
|
|
256
|
+
"filter-placeholder": this.c.placeHolder,
|
|
257
|
+
"enableRemoteSearch": this.enableRemoteSearch,
|
|
258
|
+
"titles": this.titles,
|
|
259
|
+
"button-texts": this.buttonTexts,
|
|
260
|
+
"format": {
|
|
261
|
+
noChecked: "${total}",
|
|
262
|
+
hasChecked: "${checked}/${total}"
|
|
263
|
+
},
|
|
264
|
+
"target-order": this.enableRemoteSearch ? "push" : "original",
|
|
265
|
+
"loading": this.loading,
|
|
266
|
+
"filterMethod": this.filterMethod,
|
|
267
|
+
"renderContent": this.renderContentItem,
|
|
268
|
+
"onChange": this.onRightChange,
|
|
269
|
+
"onLeftCheckChange": this.onLeftCheckChange,
|
|
270
|
+
"onRightCheckChange": this.onRightCheckChange,
|
|
271
|
+
"onLeftAcSearch": this.onLeftAcSearch
|
|
272
|
+
}, this.$attrs), null)]);
|
|
273
|
+
return createVNode("div", {
|
|
274
|
+
"class": [this.ns.b(), this.ns2.b(), this.disabled ? this.ns.m("disabled") : ""]
|
|
275
|
+
}, [editContent]);
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
export { IBizTransferPicker };
|
|
@@ -4,5 +4,6 @@ export { IBizPickerDropDown } from './ibiz-picker-dropdown/ibiz-picker-dropdown'
|
|
|
4
4
|
export { IBizPickerLink } from './ibiz-picker-link/ibiz-picker-link';
|
|
5
5
|
export { IBizPickerEmbedView } from './ibiz-picker-embed-view/ibiz-picker-embed-view';
|
|
6
6
|
export { IBizPickerSelectView } from './ibiz-picker-select-view/ibiz-picker-select-view';
|
|
7
|
+
export { IBizTransferPicker } from './ibiz-transfer-picker/ibiz-transfer-picker';
|
|
7
8
|
export * from './picker-editor.controller';
|
|
8
9
|
export * from './picker-editor.provider';
|
|
@@ -4,6 +4,7 @@ export { IBizPickerDropDown } from './ibiz-picker-dropdown/ibiz-picker-dropdown.
|
|
|
4
4
|
export { IBizPickerLink } from './ibiz-picker-link/ibiz-picker-link.mjs';
|
|
5
5
|
export { IBizPickerEmbedView } from './ibiz-picker-embed-view/ibiz-picker-embed-view.mjs';
|
|
6
6
|
export { IBizPickerSelectView } from './ibiz-picker-select-view/ibiz-picker-select-view.mjs';
|
|
7
|
+
export { IBizTransferPicker } from './ibiz-transfer-picker/ibiz-transfer-picker.mjs';
|
|
7
8
|
export { PickerEditorController } from './picker-editor.controller.mjs';
|
|
8
9
|
export { DataPickerEditorProvider } from './picker-editor.provider.mjs';
|
|
9
10
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-tree-picker{--ibiz-tree-picker-font-size:var(--ibiz-editor-default-text-size);display:flex;flex-direction:column;width:100%;height:100%;max-height:100%}.ibiz-tree-picker__search .el-input{--el-input-height:var(--ibiz-height-control-default);--el-font-size-base:var(--ibiz-tree-picker-font-size);margin:var(--ibiz-spacing-tight) 0}.ibiz-tree-picker__tree{--ibiz-font-size-regular:var(--ibiz-tree-picker-font-size);height:100%;overflow:auto}.ibiz-tree-picker__tree .el-checkbox.el-checkbox.el-checkbox .el-checkbox__inner{width:var(--ibiz-tree-picker-font-size);height:var(--ibiz-tree-picker-font-size)}
|