@ibiz-template/vue3-components 0.7.30-alpha.3 → 0.7.31-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chart-0UV2FAN6.js +1 -0
- package/dist/index-YQyitjSg.js +1 -0
- package/dist/index-maJGu4b8.js +4 -0
- package/dist/index-trS6uS3E.js +1 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/wang-editor-AcjI1Mdj.js +1 -0
- package/dist/{xlsx-util-cTIccUxx.js → xlsx-util-OUxT4A8O.js} +1 -1
- package/es/common/fullscreen-toolbar/fullscreen-toolbar.css +1 -1
- package/es/common/fullscreen-toolbar/fullscreen-toolbar.mjs +10 -0
- package/es/common/index.mjs +2 -0
- package/es/common/pql-editor/components/index.d.ts +1 -0
- package/es/common/pql-editor/components/index.mjs +3 -0
- package/es/common/pql-editor/components/pql-editor-suggestion/pql-editor-suggestion.css +1 -0
- package/es/common/pql-editor/components/pql-editor-suggestion/pql-editor-suggestion.d.ts +28 -0
- package/es/common/pql-editor/components/pql-editor-suggestion/pql-editor-suggestion.mjs +49 -0
- package/es/common/pql-editor/pql-editor.css +1 -0
- package/es/common/pql-editor/pql-editor.d.ts +68 -0
- package/es/common/pql-editor/pql-editor.mjs +606 -0
- package/es/common/pql-editor/pql-editor.module.d.ts +47 -0
- package/es/common/pql-editor/pql-editor.module.mjs +176 -0
- package/es/common/pql-editor/utils/index.d.ts +15 -0
- package/es/common/pql-editor/utils/index.mjs +270 -0
- package/es/control/chart/chart.css +1 -1
- package/es/control/chart/chart.d.ts +5 -5
- package/es/control/chart/chart.mjs +60 -36
- package/es/control/dashboard/custom-dashboard-container/custom-dashboard-container.d.ts +16 -13
- package/es/control/dashboard/portlet/portlet-layout/portlet-layout.css +1 -1
- package/es/control/dashboard/portlet/portlet-layout/portlet-layout.d.ts +8 -0
- package/es/control/dashboard/portlet/portlet-layout/portlet-layout.mjs +12 -2
- package/es/control/dashboard/portlet/report-portlet/index.d.ts +1 -0
- package/es/control/dashboard/portlet/report-portlet/report-portlet.d.ts +1 -0
- package/es/control/dashboard/portlet/report-portlet/report-portlet.mjs +10 -2
- package/es/control/dashboard/portlet/report-portlet/report-portlet.provider.d.ts +2 -2
- package/es/control/drtab/drtab-control.util.mjs +1 -1
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.d.ts +15 -12
- package/es/control/grid/grid/grid.mjs +2 -2
- package/es/control/grid/grid-column/grid-field-column/grid-field-column.d.ts +4 -2
- package/es/control/grid/grid-column/grid-field-column/grid-field-column.mjs +32 -2
- package/es/control/grid/grid-column/grid-field-column/index.d.ts +4 -0
- package/es/control/list/list.mjs +13 -1
- package/es/control/search-bar/filter-tree/filter-tree.css +1 -1
- package/es/control/search-bar/filter-tree/filter-tree.d.ts +30 -3
- package/es/control/search-bar/filter-tree/filter-tree.mjs +83 -9
- package/es/control/search-bar/search-bar.mjs +10 -1
- package/es/control/tree-grid/index.d.ts +1 -0
- package/es/control/tree-grid/tree-grid.d.ts +1 -0
- package/es/control/tree-grid/tree-grid.mjs +4 -1
- package/es/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/index.d.ts +1 -1
- package/es/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-field-column.d.ts +1 -1
- package/es/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-field-column.mjs +4 -9
- package/es/editor/array/ibiz-array/ibiz-array.d.ts +1 -1
- package/es/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.d.ts +1 -1
- package/es/editor/carousel/ibiz-carousel/ibiz-carousel.d.ts +1 -1
- package/es/editor/cascader/ibiz-cascader/ibiz-cascader.d.ts +1 -1
- package/es/editor/check-box/ibiz-checkbox/ibiz-checkbox.d.ts +1 -1
- package/es/editor/check-box-list/checkbox-list-editor.controller.d.ts +7 -0
- package/es/editor/check-box-list/checkbox-list-editor.controller.mjs +11 -0
- package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.css +1 -1
- package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.d.ts +1 -1
- package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.mjs +2 -1
- package/es/editor/code/monaco-editor/monaco-editor.d.ts +1 -1
- package/es/editor/color-picker/ibiz-color-picker/ibiz-color-picker.d.ts +1 -1
- package/es/editor/data-picker/ibiz-mpicker/ibiz-mpicker.d.ts +1 -1
- package/es/editor/data-picker/ibiz-picker/ibiz-picker.d.ts +1 -1
- package/es/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.d.ts +1 -1
- package/es/editor/data-picker/ibiz-picker-embed-view/ibiz-picker-embed-view.d.ts +2 -2
- package/es/editor/data-picker/ibiz-picker-link/ibiz-picker-link.d.ts +1 -1
- package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.d.ts +1 -1
- package/es/editor/date-picker/ibiz-date-picker/ibiz-date-picker.d.ts +1 -1
- package/es/editor/date-range/ibiz-date-range-picker/ibiz-date-range-picker.d.ts +1 -1
- package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.d.ts +1 -1
- package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.mjs +1 -1
- package/es/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.d.ts +1 -1
- package/es/editor/html/wang-editor/wang-editor.d.ts +1 -1
- package/es/editor/html/wang-editor/wang-editor.mjs +3 -0
- package/es/editor/list-box/ibiz-list-box/ibiz-list-box.d.ts +1 -1
- package/es/editor/number-range/ibiz-number-range-picker/ibiz-number-range-picker.d.ts +1 -1
- package/es/editor/preset/preset-rawitem/ibiz-preset-rawitem/ibiz-preset-rawitem.d.ts +1 -1
- package/es/editor/radio-button-list/ibiz-radio/ibiz-radio.css +1 -1
- package/es/editor/radio-button-list/ibiz-radio/ibiz-radio.d.ts +1 -1
- package/es/editor/radio-button-list/ibiz-radio/ibiz-radio.mjs +2 -1
- package/es/editor/radio-button-list/radio-button-list.controller.d.ts +8 -0
- package/es/editor/radio-button-list/radio-button-list.controller.mjs +23 -0
- package/es/editor/rate/ibiz-rate/ibiz-rate.d.ts +1 -1
- package/es/editor/raw/ibiz-raw/ibiz-raw.d.ts +1 -1
- package/es/editor/slider/ibiz-slider/ibiz-slider.d.ts +1 -1
- package/es/editor/span/span/span.css +1 -1
- package/es/editor/span/span/span.d.ts +1 -1
- package/es/editor/span/span/span.mjs +2 -1
- package/es/editor/span/span-link/span-link.d.ts +1 -1
- package/es/editor/stepper/ibiz-stepper/ibiz-stepper.d.ts +1 -1
- package/es/editor/switch/ibiz-switch/ibiz-switch.d.ts +1 -1
- package/es/editor/text-box/ibiz-input-ip/ibiz-input-ip.d.ts +1 -1
- package/es/editor/text-box/ibiz-input-number/ibiz-input-number.d.ts +1 -1
- package/es/editor/text-box/input/input.d.ts +1 -1
- package/es/editor/upload/ibiz-file-upload/ibiz-file-upload.d.ts +1 -1
- package/es/editor/upload/ibiz-image-preview/ibiz-image-preview.d.ts +1 -1
- package/es/editor/upload/ibiz-image-upload/ibiz-image-upload.d.ts +1 -1
- package/es/editor/user/ibiz-searchcond-edit/ibiz-searchcond-edit.d.ts +1 -1
- package/es/interface/i-pql-item.d.ts +52 -0
- package/es/interface/i-pql-item.mjs +1 -0
- package/es/interface/i-pql-node.d.ts +37 -0
- package/es/interface/i-pql-node.mjs +1 -0
- package/es/interface/i-schema-field.d.ts +51 -0
- package/es/interface/i-schema-field.mjs +1 -0
- package/es/interface/index.d.ts +3 -0
- package/es/interface/index.mjs +5 -0
- package/es/locale/en/index.d.ts +9 -4
- package/es/locale/en/index.mjs +6 -6
- package/es/locale/zh-CN/index.d.ts +9 -4
- package/es/locale/zh-CN/index.mjs +6 -6
- package/es/panel-component/short-cut/index.d.ts +1 -1
- package/es/panel-component/short-cut/short-cut.d.ts +1 -1
- package/es/util/fullscreen/fullscreen-util.d.ts +8 -2
- package/es/util/fullscreen/fullscreen-util.mjs +22 -2
- package/es/view-engine/edit-view.engine.mjs +28 -32
- package/lib/common/fullscreen-toolbar/fullscreen-toolbar.cjs +10 -0
- package/lib/common/fullscreen-toolbar/fullscreen-toolbar.css +1 -1
- package/lib/common/index.cjs +2 -0
- package/lib/common/pql-editor/components/index.cjs +7 -0
- package/lib/common/pql-editor/components/pql-editor-suggestion/pql-editor-suggestion.cjs +51 -0
- package/lib/common/pql-editor/components/pql-editor-suggestion/pql-editor-suggestion.css +1 -0
- package/lib/common/pql-editor/pql-editor.cjs +608 -0
- package/lib/common/pql-editor/pql-editor.css +1 -0
- package/lib/common/pql-editor/pql-editor.module.cjs +182 -0
- package/lib/common/pql-editor/utils/index.cjs +280 -0
- package/lib/control/chart/chart.cjs +59 -35
- package/lib/control/chart/chart.css +1 -1
- package/lib/control/dashboard/portlet/portlet-layout/portlet-layout.cjs +12 -2
- package/lib/control/dashboard/portlet/portlet-layout/portlet-layout.css +1 -1
- package/lib/control/dashboard/portlet/report-portlet/report-portlet.cjs +9 -1
- package/lib/control/drtab/drtab-control.util.cjs +1 -1
- package/lib/control/grid/grid/grid.cjs +2 -2
- package/lib/control/grid/grid-column/grid-field-column/grid-field-column.cjs +32 -2
- package/lib/control/list/list.cjs +13 -1
- package/lib/control/search-bar/filter-tree/filter-tree.cjs +82 -8
- package/lib/control/search-bar/filter-tree/filter-tree.css +1 -1
- package/lib/control/search-bar/search-bar.cjs +10 -1
- package/lib/control/tree-grid/tree-grid.cjs +4 -1
- package/lib/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-field-column/tree-grid-ex-field-column.cjs +3 -8
- package/lib/editor/check-box-list/checkbox-list-editor.controller.cjs +11 -0
- package/lib/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.cjs +2 -1
- package/lib/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.css +1 -1
- package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.cjs +1 -1
- package/lib/editor/html/wang-editor/wang-editor.cjs +3 -0
- package/lib/editor/radio-button-list/ibiz-radio/ibiz-radio.cjs +2 -1
- package/lib/editor/radio-button-list/ibiz-radio/ibiz-radio.css +1 -1
- package/lib/editor/radio-button-list/radio-button-list.controller.cjs +23 -0
- package/lib/editor/span/span/span.cjs +2 -1
- package/lib/editor/span/span/span.css +1 -1
- package/lib/interface/i-pql-item.cjs +3 -0
- package/lib/interface/i-pql-node.cjs +3 -0
- package/lib/interface/i-schema-field.cjs +3 -0
- package/lib/interface/index.cjs +7 -0
- package/lib/locale/en/index.cjs +6 -6
- package/lib/locale/zh-CN/index.cjs +6 -6
- package/lib/util/fullscreen/fullscreen-util.cjs +22 -2
- package/lib/view-engine/edit-view.engine.cjs +28 -32
- package/package.json +10 -9
- package/dist/chart-JFzIz6Oa.js +0 -1
- package/dist/index-Nw4GzACH.js +0 -1
- package/dist/index-Va9AxP7w.js +0 -4
- package/dist/index-qjfHTzTv.js +0 -1
- package/dist/wang-editor-YqnK5uQU.js +0 -1
- /package/es/node_modules/.pnpm/{@ibiz-template_core@0.7.28_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.30_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.28_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.30_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
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { SlateEditor, DomEditor } from '@wangeditor/editor';
|
|
2
|
+
import '../../node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/index.mjs';
|
|
3
|
+
import { isMove } from './utils/index.mjs';
|
|
4
|
+
import { h } from '../../node_modules/.pnpm/snabbdom@3.5.1/node_modules/snabbdom/build/h.mjs';
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
const pqlType = [
|
|
8
|
+
"pql-field",
|
|
9
|
+
"pql-field-value",
|
|
10
|
+
"pql-field-operator",
|
|
11
|
+
"pql-field-connection"
|
|
12
|
+
];
|
|
13
|
+
function withPqlPlugin(editor) {
|
|
14
|
+
var _a;
|
|
15
|
+
const { isVoid, isInline, deleteBackward, deleteFragment, insertText } = editor;
|
|
16
|
+
const newEditor = editor;
|
|
17
|
+
const config = newEditor.getConfig();
|
|
18
|
+
const pql = (_a = config.EXTEND_CONF) == null ? void 0 : _a.pql;
|
|
19
|
+
let timer;
|
|
20
|
+
const updateCursor = () => {
|
|
21
|
+
var _a2;
|
|
22
|
+
const { selection } = editor;
|
|
23
|
+
if (selection && ((_a2 = selection.focus) == null ? void 0 : _a2.offset) === 0) {
|
|
24
|
+
const node = SlateEditor.node(editor, selection)[0];
|
|
25
|
+
if (node) {
|
|
26
|
+
const el = editor.toDOMNode(node);
|
|
27
|
+
if (isMove(el)) {
|
|
28
|
+
editor.move(1);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
newEditor.isVoid = (el) => {
|
|
34
|
+
const type = DomEditor.getNodeType(el);
|
|
35
|
+
if (pqlType.includes(type)) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
return isVoid(el);
|
|
39
|
+
};
|
|
40
|
+
newEditor.isInline = (el) => {
|
|
41
|
+
const type = DomEditor.getNodeType(el);
|
|
42
|
+
if (pqlType.includes(type)) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
return isInline(el);
|
|
46
|
+
};
|
|
47
|
+
newEditor.deleteBackward = (unit) => {
|
|
48
|
+
deleteBackward(unit);
|
|
49
|
+
if (pql && pql.showSuggestion) {
|
|
50
|
+
window.clearTimeout(timer);
|
|
51
|
+
timer = window.setTimeout(() => {
|
|
52
|
+
updateCursor();
|
|
53
|
+
pql.showSuggestion();
|
|
54
|
+
}, 10);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
newEditor.deleteFragment = (direction) => {
|
|
58
|
+
deleteFragment(direction);
|
|
59
|
+
if (pql && pql.showSuggestion) {
|
|
60
|
+
window.clearTimeout(timer);
|
|
61
|
+
timer = window.setTimeout(() => {
|
|
62
|
+
updateCursor();
|
|
63
|
+
pql.showSuggestion();
|
|
64
|
+
}, 10);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
newEditor.insertText = (text) => {
|
|
68
|
+
insertText(text);
|
|
69
|
+
if (pql && pql.showSuggestion) {
|
|
70
|
+
window.clearTimeout(timer);
|
|
71
|
+
timer = window.setTimeout(() => {
|
|
72
|
+
pql.showSuggestion();
|
|
73
|
+
}, 10);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
return newEditor;
|
|
77
|
+
}
|
|
78
|
+
function renderPqlElement(el) {
|
|
79
|
+
const { type, label = "" } = el;
|
|
80
|
+
if (type === "pql-field-operator" || type === "pql-field-connection") {
|
|
81
|
+
return h(
|
|
82
|
+
"span",
|
|
83
|
+
{
|
|
84
|
+
props: {
|
|
85
|
+
contentEditable: false
|
|
86
|
+
},
|
|
87
|
+
style: {
|
|
88
|
+
display: "inline-block",
|
|
89
|
+
lineHeight: "22px"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
[label]
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
if (type === "pql-field-value") {
|
|
96
|
+
return h(
|
|
97
|
+
"span",
|
|
98
|
+
{
|
|
99
|
+
props: {
|
|
100
|
+
contentEditable: false
|
|
101
|
+
},
|
|
102
|
+
style: {
|
|
103
|
+
display: "inline-block",
|
|
104
|
+
lineHeight: "22px",
|
|
105
|
+
color: "#5dcfff"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
[label]
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
const vNode = h(
|
|
112
|
+
"span",
|
|
113
|
+
{
|
|
114
|
+
props: {
|
|
115
|
+
contentEditable: false
|
|
116
|
+
},
|
|
117
|
+
style: {
|
|
118
|
+
color: "#6698ff",
|
|
119
|
+
backgroundColor: "#edf2fd",
|
|
120
|
+
display: "inline-block",
|
|
121
|
+
padding: "0 5px",
|
|
122
|
+
borderRadius: "3px",
|
|
123
|
+
lineHeight: "22px"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
[label]
|
|
127
|
+
);
|
|
128
|
+
return vNode;
|
|
129
|
+
}
|
|
130
|
+
function pqlToHtml(el) {
|
|
131
|
+
const type = el.type || "";
|
|
132
|
+
if (!type) {
|
|
133
|
+
return el.text || "";
|
|
134
|
+
}
|
|
135
|
+
const html = '<span\n data-pql="true"\n data-w-e-type="'.concat(type, '"\n data-w-e-is-void\n data-w-e-is-inline\n data-label="').concat(el.label || "", '"\n data-value="').concat(el.value || "", '"\n ></span>');
|
|
136
|
+
return html;
|
|
137
|
+
}
|
|
138
|
+
function parsePqlHtml(domElem) {
|
|
139
|
+
const type = domElem.getAttribute("data-w-e-type") || "";
|
|
140
|
+
const label = domElem.getAttribute("data-label") || "";
|
|
141
|
+
const value = domElem.getAttribute("data-value") || "";
|
|
142
|
+
if (type) {
|
|
143
|
+
return {
|
|
144
|
+
type,
|
|
145
|
+
label,
|
|
146
|
+
value,
|
|
147
|
+
children: [{ text: "" }]
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
children: [{ text: "" }]
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
const PqlModule = {
|
|
155
|
+
editorPlugin: withPqlPlugin,
|
|
156
|
+
renderElems: pqlType.map((type) => {
|
|
157
|
+
return {
|
|
158
|
+
type,
|
|
159
|
+
renderElem: renderPqlElement
|
|
160
|
+
};
|
|
161
|
+
}),
|
|
162
|
+
elemsToHtml: pqlType.map((type) => {
|
|
163
|
+
return {
|
|
164
|
+
type,
|
|
165
|
+
elemToHtml: pqlToHtml
|
|
166
|
+
};
|
|
167
|
+
}),
|
|
168
|
+
parseElemsHtml: [
|
|
169
|
+
{
|
|
170
|
+
selector: 'span[data-pql="true"]',
|
|
171
|
+
parseElemHtml: parsePqlHtml
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export { PqlModule, parsePqlHtml, pqlToHtml, renderPqlElement, withPqlPlugin };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CodeListItem, ValueOP } from '@ibiz-template/runtime';
|
|
2
|
+
import { IPqlItem, IPqlNode, ISchemaField } from '../../../interface';
|
|
3
|
+
export declare const FilterModes: {
|
|
4
|
+
valueOP: ValueOP;
|
|
5
|
+
label: string;
|
|
6
|
+
sqlOP: string;
|
|
7
|
+
}[];
|
|
8
|
+
export declare const ExcludeOPs: string[];
|
|
9
|
+
export declare const generateItems: (children: IData[]) => IPqlItem[];
|
|
10
|
+
export declare const generateCustomCond: (items: IPqlItem[], fields: ISchemaField[]) => string;
|
|
11
|
+
export declare const parseCustomCond: (cond: string) => IData[] | undefined;
|
|
12
|
+
export declare const pqlItemsToPqlNodes: (items: IPqlItem[], fields: ISchemaField[], getCodeListItems: (_id: string) => Promise<readonly CodeListItem[]>) => Promise<IPqlNode[]>;
|
|
13
|
+
export declare const pqlNodeToHtml: (node: IPqlNode) => string;
|
|
14
|
+
export declare const pqlNodesToHtml: (nodes: IPqlNode[]) => string;
|
|
15
|
+
export declare function isMove(el?: HTMLElement | null): boolean;
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { RuntimeError } from '@ibiz-template/core';
|
|
2
|
+
import { ValueOP } from '@ibiz-template/runtime';
|
|
3
|
+
|
|
4
|
+
"use strict";
|
|
5
|
+
const FilterModes = [
|
|
6
|
+
{ valueOP: ValueOP.EQ, label: "\u7B49\u4E8E", sqlOP: "=" },
|
|
7
|
+
{ valueOP: ValueOP.NOT_EQ, label: "\u4E0D\u7B49\u4E8E", sqlOP: "<>" },
|
|
8
|
+
{ valueOP: ValueOP.GT, label: "\u5927\u4E8E", sqlOP: ">" },
|
|
9
|
+
{ valueOP: ValueOP.GT_AND_EQ, label: "\u5927\u4E8E\u7B49\u4E8E", sqlOP: ">=" },
|
|
10
|
+
{ valueOP: ValueOP.LT, label: "\u5C0F\u4E8E", sqlOP: "<" },
|
|
11
|
+
{ valueOP: ValueOP.LT_AND_EQ, label: "\u5C0F\u4E8E\u7B49\u4E8E", sqlOP: "<=" },
|
|
12
|
+
{ valueOP: ValueOP.IS_NULL, label: "\u4E3A\u7A7A", sqlOP: "Nil" },
|
|
13
|
+
{ valueOP: ValueOP.IS_NOT_NULL, label: "\u975E\u7A7A", sqlOP: "NotNil" },
|
|
14
|
+
{ valueOP: ValueOP.IN, label: "\u5C5E\u4E8E", sqlOP: "In" },
|
|
15
|
+
{ valueOP: ValueOP.NOT_IN, label: "\u4E0D\u5C5E\u4E8E", sqlOP: "NotIn" },
|
|
16
|
+
{ valueOP: ValueOP.LIKE, label: "\u6587\u672C\u5305\u542B", sqlOP: "%" },
|
|
17
|
+
{ valueOP: ValueOP.LIFT_LIKE, label: "\u6587\u672C\u5DE6\u5305\u542B", sqlOP: "%#" },
|
|
18
|
+
{ valueOP: ValueOP.RIGHT_LIKE, label: "\u6587\u672C\u53F3\u5305\u542B", sqlOP: "#%" },
|
|
19
|
+
{ valueOP: ValueOP.EXISTS, label: "\u5B58\u5728", sqlOP: "EXISTS" },
|
|
20
|
+
{ valueOP: ValueOP.NOT_EXISTS, label: "\u4E0D\u5B58\u5728", sqlOP: "NOTEXISTS" }
|
|
21
|
+
];
|
|
22
|
+
const ExcludeOPs = [
|
|
23
|
+
ValueOP.IS_NULL,
|
|
24
|
+
ValueOP.IS_NOT_NULL,
|
|
25
|
+
ValueOP.EXISTS,
|
|
26
|
+
ValueOP.NOT_EXISTS
|
|
27
|
+
];
|
|
28
|
+
const filterModeMap = /* @__PURE__ */ new Map();
|
|
29
|
+
FilterModes.forEach((mode) => {
|
|
30
|
+
filterModeMap.set(mode.valueOP, mode);
|
|
31
|
+
});
|
|
32
|
+
const symbolMap = /* @__PURE__ */ new Map();
|
|
33
|
+
FilterModes.forEach((mode) => {
|
|
34
|
+
symbolMap.set(mode.sqlOP, mode.valueOP);
|
|
35
|
+
});
|
|
36
|
+
const generateItems = (children) => {
|
|
37
|
+
if (!children.length) {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
const items = [];
|
|
41
|
+
for (let i = 0; i < children.length; i++) {
|
|
42
|
+
if (i !== 0) {
|
|
43
|
+
const connection = children[i];
|
|
44
|
+
if (connection && connection.type === "pql-field-connection") {
|
|
45
|
+
if (i === children.length - 1) {
|
|
46
|
+
throw new RuntimeError("pql\u8282\u70B9\u89E3\u6790\u9519\u8BEF");
|
|
47
|
+
}
|
|
48
|
+
items.push({
|
|
49
|
+
type: "connection",
|
|
50
|
+
value: {
|
|
51
|
+
label: connection.label,
|
|
52
|
+
value: connection.value
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
} else {
|
|
56
|
+
throw new RuntimeError("pql\u8282\u70B9\u89E3\u6790\u9519\u8BEF");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const key = children[i !== 0 ? ++i : i];
|
|
60
|
+
const operator = children[++i];
|
|
61
|
+
if (key && operator && key.type === "pql-field" && operator.type === "pql-field-operator") {
|
|
62
|
+
if (operator.value && ExcludeOPs.includes(operator.value)) {
|
|
63
|
+
items.push({
|
|
64
|
+
type: "condition",
|
|
65
|
+
key: {
|
|
66
|
+
label: key.label,
|
|
67
|
+
value: key.value
|
|
68
|
+
},
|
|
69
|
+
operator: {
|
|
70
|
+
label: operator.label,
|
|
71
|
+
value: operator.value
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
continue;
|
|
75
|
+
} else {
|
|
76
|
+
const value = children[++i];
|
|
77
|
+
if (value && (value.type === "pql-field-value" || value.text)) {
|
|
78
|
+
items.push({
|
|
79
|
+
type: "condition",
|
|
80
|
+
key: {
|
|
81
|
+
label: key.label,
|
|
82
|
+
value: key.value
|
|
83
|
+
},
|
|
84
|
+
operator: {
|
|
85
|
+
label: operator.label,
|
|
86
|
+
value: operator.value
|
|
87
|
+
},
|
|
88
|
+
value: {
|
|
89
|
+
label: value.type === "pql-field-value" ? value.label : value.text,
|
|
90
|
+
value: value.type === "pql-field-value" ? value.value : value.text
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
throw new RuntimeError("pql\u8282\u70B9\u89E3\u6790\u9519\u8BEF");
|
|
98
|
+
}
|
|
99
|
+
return items;
|
|
100
|
+
};
|
|
101
|
+
const generateCustomCond = (items, fields) => {
|
|
102
|
+
const map = /* @__PURE__ */ new Map();
|
|
103
|
+
fields.forEach((item) => {
|
|
104
|
+
map.set(item.appDEFieldId, item);
|
|
105
|
+
});
|
|
106
|
+
let cond = "";
|
|
107
|
+
items.forEach((item) => {
|
|
108
|
+
var _a, _b, _c;
|
|
109
|
+
if (item.type === "condition") {
|
|
110
|
+
const { key, operator, value } = item;
|
|
111
|
+
const symbol = (_a = filterModeMap.get(operator == null ? void 0 : operator.value)) == null ? void 0 : _a.sqlOP;
|
|
112
|
+
cond += "$".concat(JSON.stringify({
|
|
113
|
+
name: (key == null ? void 0 : key.value) || "",
|
|
114
|
+
caption: (key == null ? void 0 : key.label) || ""
|
|
115
|
+
}), " ").concat(symbol, " $").concat(JSON.stringify({
|
|
116
|
+
value: (value == null ? void 0 : value.value) || "",
|
|
117
|
+
caption: (value == null ? void 0 : value.label) || "",
|
|
118
|
+
field: "".concat(((_b = map.get((key == null ? void 0 : key.value) || "")) == null ? void 0 : _b.appDataEntityFullTag) || "", ".").concat((key == null ? void 0 : key.value) || "")
|
|
119
|
+
}));
|
|
120
|
+
}
|
|
121
|
+
if (item.type === "connection") {
|
|
122
|
+
cond += " ".concat((_c = item.value) == null ? void 0 : _c.value, " ");
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
return cond;
|
|
126
|
+
};
|
|
127
|
+
const parseCustomCond = (cond) => {
|
|
128
|
+
var _a;
|
|
129
|
+
try {
|
|
130
|
+
const items = cond.split(" ");
|
|
131
|
+
const pqlItems = [];
|
|
132
|
+
for (let i = 0; i < items.length; i++) {
|
|
133
|
+
if (i !== 0) {
|
|
134
|
+
const connection = items[i];
|
|
135
|
+
if (connection === "and" || connection === "or") {
|
|
136
|
+
if (i === items.length - 1) {
|
|
137
|
+
throw new RuntimeError("pql\u81EA\u5B9A\u4E49\u6761\u4EF6\u89E3\u6790\u9519\u8BEF");
|
|
138
|
+
}
|
|
139
|
+
pqlItems.push({
|
|
140
|
+
type: "connection",
|
|
141
|
+
value: {
|
|
142
|
+
label: connection,
|
|
143
|
+
value: connection
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
} else {
|
|
147
|
+
throw new RuntimeError("pql\u81EA\u5B9A\u4E49\u6761\u4EF6\u89E3\u6790\u9519\u8BEF");
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
const key = items[i !== 0 ? ++i : i];
|
|
151
|
+
const operator = items[++i];
|
|
152
|
+
const value = items[++i];
|
|
153
|
+
if (key && /^\$/.test(key) && operator && value && /^\$/.test(value)) {
|
|
154
|
+
const keyObj = JSON.parse(key.slice(1));
|
|
155
|
+
const valueObj = JSON.parse(value.slice(1));
|
|
156
|
+
pqlItems.push({
|
|
157
|
+
type: "condition",
|
|
158
|
+
key: {
|
|
159
|
+
label: keyObj.caption,
|
|
160
|
+
value: keyObj.name
|
|
161
|
+
},
|
|
162
|
+
operator: {
|
|
163
|
+
label: ((_a = filterModeMap.get(symbolMap.get(operator))) == null ? void 0 : _a.label) || "",
|
|
164
|
+
value: symbolMap.get(operator)
|
|
165
|
+
},
|
|
166
|
+
value: {
|
|
167
|
+
label: valueObj.caption,
|
|
168
|
+
value: valueObj.value
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
throw new RuntimeError("pql\u81EA\u5B9A\u4E49\u6761\u4EF6\u89E3\u6790\u9519\u8BEF");
|
|
174
|
+
}
|
|
175
|
+
return pqlItems;
|
|
176
|
+
} catch (err) {
|
|
177
|
+
ibiz.log.error(err == null ? void 0 : err.message);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
const pqlItemsToPqlNodes = async (items, fields, getCodeListItems) => {
|
|
181
|
+
const nodes = [];
|
|
182
|
+
const codeListMap = /* @__PURE__ */ new Map();
|
|
183
|
+
const fieldList = fields.filter(
|
|
184
|
+
(child) => items.some((item) => {
|
|
185
|
+
var _a;
|
|
186
|
+
return ((_a = item.key) == null ? void 0 : _a.value) === child.appDEFieldId;
|
|
187
|
+
})
|
|
188
|
+
);
|
|
189
|
+
await Promise.all(
|
|
190
|
+
fieldList.map(async (item) => {
|
|
191
|
+
if (item.appCodeListId) {
|
|
192
|
+
const codeItems = await getCodeListItems(item.appCodeListId);
|
|
193
|
+
if (codeItems) {
|
|
194
|
+
codeListMap.set(item.appDEFieldId, codeItems);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
})
|
|
198
|
+
);
|
|
199
|
+
items.forEach((item) => {
|
|
200
|
+
var _a, _b;
|
|
201
|
+
if (item.type === "condition") {
|
|
202
|
+
const { key, operator, value } = item;
|
|
203
|
+
nodes.push({
|
|
204
|
+
type: "pql-field",
|
|
205
|
+
label: key == null ? void 0 : key.label,
|
|
206
|
+
value: key == null ? void 0 : key.value
|
|
207
|
+
});
|
|
208
|
+
nodes.push({
|
|
209
|
+
type: "pql-field-operator",
|
|
210
|
+
label: operator == null ? void 0 : operator.label,
|
|
211
|
+
value: operator == null ? void 0 : operator.value
|
|
212
|
+
});
|
|
213
|
+
const field = fields.find((child) => child.appDEFieldId === (key == null ? void 0 : key.value));
|
|
214
|
+
if (field && field.appCodeListId) {
|
|
215
|
+
const codeItems = codeListMap.get(field.appDEFieldId);
|
|
216
|
+
const codeItem = codeItems == null ? void 0 : codeItems.find((child) => child.value === (value == null ? void 0 : value.value));
|
|
217
|
+
if (codeItem) {
|
|
218
|
+
nodes.push({
|
|
219
|
+
type: "pql-field-value",
|
|
220
|
+
label: value == null ? void 0 : value.label,
|
|
221
|
+
value: value == null ? void 0 : value.value
|
|
222
|
+
});
|
|
223
|
+
} else {
|
|
224
|
+
nodes.push({
|
|
225
|
+
text: value == null ? void 0 : value.value
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
} else {
|
|
229
|
+
nodes.push({
|
|
230
|
+
text: value == null ? void 0 : value.value
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
if (item.type === "connection") {
|
|
235
|
+
nodes.push({
|
|
236
|
+
type: "pql-field-connection",
|
|
237
|
+
label: (_a = item.value) == null ? void 0 : _a.label,
|
|
238
|
+
value: (_b = item.value) == null ? void 0 : _b.value
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
return nodes;
|
|
243
|
+
};
|
|
244
|
+
const pqlNodeToHtml = (node) => {
|
|
245
|
+
const type = node.type || "";
|
|
246
|
+
if (!type) {
|
|
247
|
+
return node.text || "";
|
|
248
|
+
}
|
|
249
|
+
const html = '<span\n data-pql="true"\n data-w-e-type="'.concat(type, '"\n data-w-e-is-void\n data-w-e-is-inline\n data-label="').concat(node.label || "", '"\n data-value="').concat(node.value || "", '"\n ></span>');
|
|
250
|
+
return html;
|
|
251
|
+
};
|
|
252
|
+
const pqlNodesToHtml = (nodes) => {
|
|
253
|
+
let html = "<p>";
|
|
254
|
+
nodes.forEach((node) => {
|
|
255
|
+
html += pqlNodeToHtml(node);
|
|
256
|
+
});
|
|
257
|
+
html += "</p>";
|
|
258
|
+
return html;
|
|
259
|
+
};
|
|
260
|
+
function isMove(el) {
|
|
261
|
+
if (!el) {
|
|
262
|
+
return false;
|
|
263
|
+
}
|
|
264
|
+
if (el.getAttribute("data-slate-node") === "element" && el.getAttribute("data-slate-inline") && el.getAttribute("data-slate-void")) {
|
|
265
|
+
return true;
|
|
266
|
+
}
|
|
267
|
+
return isMove(el.parentElement);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export { ExcludeOPs, FilterModes, generateCustomCond, generateItems, isMove, parseCustomCond, pqlItemsToPqlNodes, pqlNodeToHtml, pqlNodesToHtml };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-control-chart{width:100%;height:100%}.ibiz-control-chart__chart-grid{width:100%;height:100%}.ibiz-control-chart__chart-grid.is-show-grid{display:flex;height:calc(100% - 16px)}.ibiz-control-chart__chart-grid--bottom{flex-direction:column}.ibiz-control-chart__chart-grid--top{flex-direction:column-reverse}.ibiz-control-chart__chart-grid--left{flex-direction:row-reverse}.ibiz-control-chart__chart-grid--right{flex-direction:row}.ibiz-control-chart__chart-grid.is-no-data{display:none}.ibiz-control-chart__chart-grid-container{position:relative;flex:1;height:50%}.ibiz-control-chart__chart-grid-container.is-bottom{width:100%;height:50%;min-height:50%}.ibiz-control-chart__chart-grid-container.is-top{width:100%;height:50%;min-height:50%}.ibiz-control-chart__chart-grid-container.is-left{width:50%;min-width:50%;height:100%}.ibiz-control-chart__chart-grid-container.is-right{width:50%;min-width:50%;height:100%}.ibiz-control-chart__chart-grid-container.is-no-grid{flex:unset;width:100%;height:100%}.ibiz-control-chart__chart{width:100%;height:100%}.ibiz-control-chart__drill-
|
|
1
|
+
.ibiz-control-chart{width:100%;height:100%}.ibiz-control-chart__chart-grid{width:100%;height:100%}.ibiz-control-chart__chart-grid.is-show-grid{display:flex;height:calc(100% - 16px)}.ibiz-control-chart__chart-grid--bottom{flex-direction:column}.ibiz-control-chart__chart-grid--top{flex-direction:column-reverse}.ibiz-control-chart__chart-grid--left{flex-direction:row-reverse}.ibiz-control-chart__chart-grid--right{flex-direction:row}.ibiz-control-chart__chart-grid.is-no-data{display:none}.ibiz-control-chart__chart-grid-container{position:relative;flex:1;height:50%}.ibiz-control-chart__chart-grid-container.is-bottom{width:100%;height:50%;min-height:50%}.ibiz-control-chart__chart-grid-container.is-top{width:100%;height:50%;min-height:50%}.ibiz-control-chart__chart-grid-container.is-left{width:50%;min-width:50%;height:100%}.ibiz-control-chart__chart-grid-container.is-right{width:50%;min-width:50%;height:100%}.ibiz-control-chart__chart-grid-container.is-no-grid{flex:unset;width:100%;height:100%}.ibiz-control-chart__chart{width:100%;height:100%}.ibiz-control-chart__drill-detail{position:absolute;top:0;left:0;width:150px;padding:var(--ibiz-spacing-tight) 0;background:var(--ibiz-color-bg-1);border:1px solid var(--ibiz-color-border);border-radius:var(--ibiz-border-radius-small);box-shadow:var(--ibiz-color-elevated)}.ibiz-control-chart__drill-detail--item{display:flex;gap:var(--ibiz-spacing-tight);align-items:center;height:40px;padding:var(--ibiz-spacing-tight) var(--ibiz-spacing-base-loose);font-size:var(--ibiz-font-size-regular);cursor:pointer}.ibiz-control-chart__drill-detail--item:hover{background-color:var(--ibiz-color-fill-1)}.ibiz-control-chart__drill-detail--item-text{margin-bottom:var(--ibiz-spacing-super-tight)}.ibiz-control-chart__grid{flex:1;height:auto}.ibiz-control-chart__grid .cell{text-overflow:ellipsis;white-space:nowrap}.ibiz-control-chart__grid .el-table__body-wrapper{border-bottom:1px solid var(--ibiz-color-border)}.ibiz-control-chart__empty{display:none;height:100%}.ibiz-control-chart__empty.is-no-data{display:flex}.ibiz-control-chart-chart-container{width:100%;height:100%}
|
|
@@ -53,11 +53,11 @@ declare const ChartControl: import("vue").DefineComponent<{
|
|
|
53
53
|
chartRef: import("vue").Ref<any>;
|
|
54
54
|
uuid: string;
|
|
55
55
|
showCheck: import("vue").Ref<boolean>;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
drillDetailPos: import("vue").Ref<{}>;
|
|
57
|
+
drillDetailRef: import("vue").Ref<any>;
|
|
58
|
+
openDrillDetail: (_event: MouseEvent) => void;
|
|
59
59
|
renderGrid: () => JSX.Element;
|
|
60
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "
|
|
60
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "drillDetail"[], "drillDetail", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
61
61
|
modelData: {
|
|
62
62
|
type: PropType<IDEChart>;
|
|
63
63
|
required: true;
|
|
@@ -103,7 +103,7 @@ declare const ChartControl: import("vue").DefineComponent<{
|
|
|
103
103
|
required: false;
|
|
104
104
|
};
|
|
105
105
|
}>> & {
|
|
106
|
-
|
|
106
|
+
onDrillDetail?: ((...args: any[]) => any) | undefined;
|
|
107
107
|
}, {
|
|
108
108
|
params: IParams;
|
|
109
109
|
mdctrlActiveMode: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isVNode, ref, watch, nextTick, onMounted, resolveComponent, createVNode, onBeforeUnmount, defineComponent } from 'vue';
|
|
2
|
-
import { useControlController, useNamespace
|
|
2
|
+
import { useControlController, useNamespace } from '@ibiz-template/vue3-util';
|
|
3
3
|
import { init } from 'echarts';
|
|
4
4
|
import { createUUID } from 'qx-util';
|
|
5
5
|
import { ChartController } from '@ibiz-template/runtime';
|
|
@@ -44,7 +44,7 @@ const ChartControl = /* @__PURE__ */ defineComponent({
|
|
|
44
44
|
required: false
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
|
-
emits: ["
|
|
47
|
+
emits: ["drillDetail"],
|
|
48
48
|
setup(props, {
|
|
49
49
|
emit
|
|
50
50
|
}) {
|
|
@@ -54,9 +54,8 @@ const ChartControl = /* @__PURE__ */ defineComponent({
|
|
|
54
54
|
const maxHeight = ref(0);
|
|
55
55
|
const uuid = createUUID();
|
|
56
56
|
const showCheck = ref(false);
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
let func;
|
|
57
|
+
const drillDetailPos = ref({});
|
|
58
|
+
const drillDetailRef = ref();
|
|
60
59
|
let tempParams;
|
|
61
60
|
const initSimpleData = () => {
|
|
62
61
|
if (!props.data) {
|
|
@@ -93,19 +92,35 @@ const ChartControl = /* @__PURE__ */ defineComponent({
|
|
|
93
92
|
const getGridData = () => {
|
|
94
93
|
return c.state.gridData || [];
|
|
95
94
|
};
|
|
96
|
-
const
|
|
95
|
+
const computedDrillDetailPos = (params) => {
|
|
97
96
|
if (params.event) {
|
|
98
97
|
const event = params.event.event;
|
|
99
|
-
event.stopPropagation();
|
|
100
|
-
event.preventDefault();
|
|
101
98
|
const {
|
|
102
99
|
offsetX,
|
|
103
100
|
offsetY
|
|
104
101
|
} = params.event;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
102
|
+
const {
|
|
103
|
+
clientWidth
|
|
104
|
+
} = event.target;
|
|
105
|
+
if (offsetX + 160 > clientWidth) {
|
|
106
|
+
drillDetailPos.value = {
|
|
107
|
+
top: "".concat(offsetY - 20, "px"),
|
|
108
|
+
left: "".concat(offsetX - 160, "px")
|
|
109
|
+
};
|
|
110
|
+
} else {
|
|
111
|
+
drillDetailPos.value = {
|
|
112
|
+
top: "".concat(offsetY, "px"),
|
|
113
|
+
left: "".concat(offsetX + 16, "px")
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
const setDrillState = () => {
|
|
119
|
+
showCheck.value = false;
|
|
120
|
+
};
|
|
121
|
+
const setTipState = () => {
|
|
122
|
+
if (!showCheck.value) {
|
|
123
|
+
c.changeTooltipState(true);
|
|
109
124
|
}
|
|
110
125
|
};
|
|
111
126
|
let resizeObserver;
|
|
@@ -114,6 +129,8 @@ const ChartControl = /* @__PURE__ */ defineComponent({
|
|
|
114
129
|
const chart = init(chartRef.value);
|
|
115
130
|
c.initChart(chart);
|
|
116
131
|
window.addEventListener("resize", setHeight);
|
|
132
|
+
window.addEventListener("pointerdown", setDrillState);
|
|
133
|
+
window.addEventListener("click", setTipState);
|
|
117
134
|
if (chartRef.value && ResizeObserver) {
|
|
118
135
|
resizeObserver = new ResizeObserver(() => {
|
|
119
136
|
c.resizeChart();
|
|
@@ -121,31 +138,36 @@ const ChartControl = /* @__PURE__ */ defineComponent({
|
|
|
121
138
|
resizeObserver.observe(chartRef.value);
|
|
122
139
|
}
|
|
123
140
|
setHeight();
|
|
124
|
-
|
|
141
|
+
const drillDetails = (_b = (_a = props.modelData.controlParam) == null ? void 0 : _a.ctrlParams) == null ? void 0 : _b.ENABLEDRILLDETAIL;
|
|
142
|
+
if (drillDetails == null ? void 0 : drillDetails.length) {
|
|
125
143
|
chart.on("click", (params) => {
|
|
144
|
+
const serieModel = c.computedClickSerieModel(params);
|
|
145
|
+
if (!serieModel) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const tempDrill = drillDetails.find((item) => {
|
|
149
|
+
return item.name === serieModel.valueField;
|
|
150
|
+
});
|
|
151
|
+
if (!tempDrill || !tempDrill.isDrill) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
126
154
|
tempParams = params;
|
|
155
|
+
computedDrillDetailPos(params);
|
|
127
156
|
chart.dispatchAction({
|
|
128
157
|
type: "hideTip"
|
|
129
158
|
});
|
|
130
|
-
showCheck.value = true;
|
|
131
159
|
c.changeTooltipState(false);
|
|
132
|
-
|
|
133
|
-
showCheck.value = false;
|
|
134
|
-
c.changeTooltipState(true);
|
|
135
|
-
func.stop();
|
|
136
|
-
});
|
|
137
|
-
computedDrillDownPos(params);
|
|
160
|
+
showCheck.value = true;
|
|
138
161
|
});
|
|
139
162
|
}
|
|
140
163
|
});
|
|
141
|
-
const
|
|
164
|
+
const openDrillDetail = (_event) => {
|
|
165
|
+
_event.stopPropagation();
|
|
166
|
+
_event.preventDefault();
|
|
142
167
|
showCheck.value = false;
|
|
143
|
-
if (func) {
|
|
144
|
-
func.stop();
|
|
145
|
-
}
|
|
146
168
|
c.changeTooltipState(true);
|
|
147
|
-
const param = c.
|
|
148
|
-
emit("
|
|
169
|
+
const param = c.computedDrillDetailParam(tempParams);
|
|
170
|
+
emit("drillDetail", param);
|
|
149
171
|
};
|
|
150
172
|
watch(() => c.state.showGrid, () => {
|
|
151
173
|
setHeight();
|
|
@@ -175,6 +197,8 @@ const ChartControl = /* @__PURE__ */ defineComponent({
|
|
|
175
197
|
};
|
|
176
198
|
onBeforeUnmount(() => {
|
|
177
199
|
window.removeEventListener("resize", setHeight);
|
|
200
|
+
window.removeEventListener("pointerdown", setDrillState);
|
|
201
|
+
window.removeEventListener("click", setTipState);
|
|
178
202
|
resizeObserver == null ? void 0 : resizeObserver.disconnect();
|
|
179
203
|
});
|
|
180
204
|
return {
|
|
@@ -183,9 +207,9 @@ const ChartControl = /* @__PURE__ */ defineComponent({
|
|
|
183
207
|
chartRef,
|
|
184
208
|
uuid,
|
|
185
209
|
showCheck,
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
210
|
+
drillDetailPos,
|
|
211
|
+
drillDetailRef,
|
|
212
|
+
openDrillDetail,
|
|
189
213
|
renderGrid
|
|
190
214
|
};
|
|
191
215
|
},
|
|
@@ -209,12 +233,12 @@ const ChartControl = /* @__PURE__ */ defineComponent({
|
|
|
209
233
|
"ref": "chartRef",
|
|
210
234
|
"class": [this.ns.e("chart")]
|
|
211
235
|
}, [ibiz.i18n.t("control.chart.chartPlaceholder")]), this.showCheck ? createVNode("div", {
|
|
212
|
-
"ref": "
|
|
213
|
-
"class": this.ns.e("drill-
|
|
214
|
-
"style": this.
|
|
215
|
-
"
|
|
236
|
+
"ref": "drillDetailRef",
|
|
237
|
+
"class": this.ns.e("drill-detail"),
|
|
238
|
+
"style": this.drillDetailPos,
|
|
239
|
+
"onPointerdown": this.openDrillDetail
|
|
216
240
|
}, [createVNode("div", {
|
|
217
|
-
"class": this.ns.em("drill-
|
|
241
|
+
"class": this.ns.em("drill-detail", "item")
|
|
218
242
|
}, [createVNode("svg", {
|
|
219
243
|
"viewBox": "0 0 16 16",
|
|
220
244
|
"xmlns": "http://www.w3.org/2000/svg",
|
|
@@ -230,8 +254,8 @@ const ChartControl = /* @__PURE__ */ defineComponent({
|
|
|
230
254
|
"d": "M11.626 0c1.057 0 1.923.818 2 1.855l.005.15v3.411a.6.6 0 0 1-1.192.097l-.008-.097.001-1.348V2.005c0-.41-.31-.749-.705-.799l-.101-.006h-9.62c-.41 0-.75.308-.8.704l-.006.101v11.989c0 .41.308.75.705.8l.101.006h5.906l.017-.004.016-.003h2.074a.598.598 0 1 1 .107 1.187l-.095.01V16H2.006a2.006 2.006 0 0 1-2-1.856L0 13.994V2.005C0 .948.818.082 1.856.005L2.006 0h9.62zm-1.595 6.328a3.669 3.669 0 0 1 3.665 3.665c0 .79-.251 1.523-.678 2.123l2.412 2.412a.6.6 0 1 1-.848.85l-2.41-2.412a3.646 3.646 0 0 1-2.14.692 3.67 3.67 0 0 1-3.667-3.665 3.67 3.67 0 0 1 3.666-3.665zm-5.106 5.29a.6.6 0 0 1 .097 1.191l-.097.008H2.85a.6.6 0 0 1-.097-1.192l.097-.008h2.074zm5.106-4.09a2.468 2.468 0 0 0-2.466 2.465 2.468 2.468 0 0 0 2.466 2.466 2.47 2.47 0 0 0 2.466-2.466 2.469 2.469 0 0 0-2.466-2.465zm-4.815-.126a.6.6 0 0 1 .097 1.193l-.097.007h-2.35A.6.6 0 0 1 2.77 7.41l.098-.008h2.349zm5.58-4a.6.6 0 0 1 .097 1.192l-.097.008H2.867A.6.6 0 0 1 2.77 3.41l.097-.008h7.929z",
|
|
231
255
|
"id": "asp\u5408\u5E76\u5F62\u72B6"
|
|
232
256
|
}, null)])]), createVNode("div", {
|
|
233
|
-
"class": this.ns.em("drill-
|
|
234
|
-
}, [ibiz.i18n.t("control.chart.
|
|
257
|
+
"class": this.ns.em("drill-detail", "item-text")
|
|
258
|
+
}, [ibiz.i18n.t("control.chart.drillDetail")])])]) : null]), this.c.state.showGrid ? createVNode("div", {
|
|
235
259
|
"class": this.ns.e("grid")
|
|
236
260
|
}, [this.renderGrid()]) : null])])]
|
|
237
261
|
});
|