super-page-designer 2.0.31 → 2.0.37
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/es/components/design/utils/assemblys-config.js +395 -88
- package/dist/es/components/design/utils/container-design-util.js +6 -8
- package/dist/es/components/design/utils/interfaces/page-design-types.d.ts +3 -2
- package/dist/es/components/design/utils/page-explore-util.d.ts +2 -2
- package/dist/es/components/design/utils/page-explore-util.js +5 -17
- package/dist/es/components/design/utils/page-table-util.js +4 -2
- package/dist/es/components/design/views/assemblys/button/button/button-attr-base.vue.js +6 -3
- package/dist/es/components/design/views/assemblys/button/button/button-attr.vue.js +0 -1
- package/dist/es/components/design/views/assemblys/common/common-style-border.vue.js +1 -1
- package/dist/es/components/design/views/assemblys/common/common-style-margin.vue.js +9 -9
- package/dist/es/components/design/views/assemblys/common/common-style-padding.vue.js +9 -9
- package/dist/es/components/design/views/assemblys/common/common-variable-bind.vue.d.ts +9 -0
- package/dist/es/components/design/views/assemblys/common/common-variable-bind.vue.js +1 -1
- package/dist/es/components/design/views/assemblys/common/common-variable-bind.vue2.js +225 -21
- package/dist/es/components/design/views/assemblys/common/page-permission-select.vue.js +77 -31
- package/dist/es/components/design/views/assemblys/container/card/card-attr-style.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/container/card/card-design.vue2.js +12 -11
- package/dist/es/components/design/views/assemblys/container/collapse/collapse-attr-style.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/container/container/container-attr-style.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/container/flex/flex-attr-style.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/container/flex/flex-design.vue2.js +31 -15
- package/dist/es/components/design/views/assemblys/container/form/form-attr-base.vue.js +2 -2
- package/dist/es/components/design/views/assemblys/container/form/form-attr-style.vue.js +21 -16
- package/dist/es/components/design/views/assemblys/container/form/form-design.vue2.js +16 -19
- package/dist/es/components/design/views/assemblys/container/iframe/iframe-attr-style.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/container/tabs/tabs-attr-style.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/container/tools/tools-attr-style.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/data/component/attr-header.vue.js +46 -5
- package/dist/es/components/design/views/assemblys/data/component/attr-header.vue2.js +1 -45
- package/dist/es/components/design/views/assemblys/data/table/table-attr-base.vue.js +2 -57
- package/dist/es/components/design/views/assemblys/data/table/table-attr.vue2.js +10 -10
- package/dist/es/components/design/views/assemblys/form/checkbox/checkbox-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/date-picker/datepicker-attr-base.vue.js +57 -27
- package/dist/es/components/design/views/assemblys/form/date-picker/datepicker-design.vue2.js +9 -106
- package/dist/es/components/design/views/assemblys/form/dept-tree/depttree-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/file-upload/fileupload-attr-base.vue.js +5 -2
- package/dist/es/components/design/views/assemblys/form/input-number/input-number-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/input-text/inputtext-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/label/label-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/link/link-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/radio/radio-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/rich-text/richtext-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/select/select-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/switch/switch-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/tag/tag-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/textarea/textarea-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/object-design.vue.js +6 -1
- package/dist/es/components/design/views/design/page-design.vue.js +14 -20
- package/dist/es/components/design/views/design/page-event/config.vue.js +7 -1
- package/dist/es/components/design/views/design/page-event/config.vue2.js +1 -7
- package/dist/es/components/design/views/design/page-event/page-event-content.vue.js +594 -5
- package/dist/es/components/design/views/design/page-event/page-event-content.vue2.js +1 -594
- package/dist/es/components/design/views/design/page-event/page-event-view.vue.js +2 -2
- package/dist/es/components/design/views/design/view/attr-container.vue.js +23 -1
- package/dist/es/components/design/views/design/view/components/quick-add-dialog.vue.js +13 -4
- package/dist/es/components/design/views/design/view/components/quick-add-fields.vue.js +0 -1
- package/dist/es/components/design/views/design/view/view-design-display.vue.js +88 -81
- package/dist/es/components/design/views/design/view/view-design-preview.vue.js +21 -2
- package/dist/es/stores/page-store.js +2 -1
- package/dist/es/style.css +1086 -1329
- package/package.json +5 -5
- package/dist/es/components/design/views/assemblys/button/button/button-attr.vue3.js +0 -1
- package/dist/es/components/design/views/assemblys/data/component/attr-header.vue3.js +0 -1
- package/dist/es/components/design/views/design/page-event/page-event-content.vue3.js +0 -1
|
@@ -42,8 +42,9 @@ export interface Component extends Object {
|
|
|
42
42
|
* 页面对象
|
|
43
43
|
*/
|
|
44
44
|
export interface PageDesign extends Component {
|
|
45
|
-
systemCode
|
|
46
|
-
systemVersion
|
|
45
|
+
systemCode?: string;
|
|
46
|
+
systemVersion?: number;
|
|
47
|
+
backendUrl?: string;
|
|
47
48
|
code: string;
|
|
48
49
|
dimensions?: string;
|
|
49
50
|
tableSysCode?: string;
|
|
@@ -11,7 +11,7 @@ function convertToExploreTreeDatas(designItems, searchItemName, cachePageItemMap
|
|
|
11
11
|
}
|
|
12
12
|
const treeItems = [];
|
|
13
13
|
for (let index = 0; index < designItems.length; index++) {
|
|
14
|
-
const treeItem = convertPageItemToTreeItem(designItems[index], searchItemName, cachePageItemMap
|
|
14
|
+
const treeItem = convertPageItemToTreeItem(designItems[index], searchItemName, cachePageItemMap);
|
|
15
15
|
if (treeItem) {
|
|
16
16
|
treeItems.push(treeItem);
|
|
17
17
|
}
|
|
@@ -23,16 +23,17 @@ function convertPageItemToTreeItem(pageItem, searchItemName, cachePageItemMap, e
|
|
|
23
23
|
const children = [];
|
|
24
24
|
if (pageItem.items && pageItem.items.length > 0) {
|
|
25
25
|
for (let index = 0; index < pageItem.items.length; index++) {
|
|
26
|
-
const childItem = convertPageItemToTreeItem(pageItem.items[index], searchItemName, cachePageItemMap
|
|
26
|
+
const childItem = convertPageItemToTreeItem(pageItem.items[index], searchItemName, cachePageItemMap);
|
|
27
27
|
if (childItem != null) {
|
|
28
28
|
children.push(childItem);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
+
const title = pageItem.props && pageItem.props.base ? pageItem.props.base.title : void 0;
|
|
32
33
|
let isHas = true;
|
|
33
34
|
if (children.length == 0 && searchItemName) {
|
|
34
35
|
isHas = false;
|
|
35
|
-
if (pageItem.type && pageItem.type.indexOf(searchItemName) > -1 || pageItem.label && pageItem.label.indexOf(searchItemName) > -1 || pageItem.name && pageItem.name.indexOf(searchItemName) > -1) {
|
|
36
|
+
if (pageItem.type && pageItem.type.indexOf(searchItemName) > -1 || pageItem.label && pageItem.label.indexOf(searchItemName) > -1 || pageItem.name && pageItem.name.indexOf(searchItemName) > -1 || title && title.indexOf(searchItemName) > -1) {
|
|
36
37
|
isHas = true;
|
|
37
38
|
}
|
|
38
39
|
}
|
|
@@ -40,26 +41,13 @@ function convertPageItemToTreeItem(pageItem, searchItemName, cachePageItemMap, e
|
|
|
40
41
|
const treeItem = {
|
|
41
42
|
componentIndex: pageItem.componentIndex,
|
|
42
43
|
name: pageItem.name,
|
|
43
|
-
label: pageItem.label,
|
|
44
|
+
label: title ? title + "(" + pageItem.label + ")" : pageItem.label,
|
|
44
45
|
uuid: pageItem.uuid,
|
|
45
46
|
children
|
|
46
47
|
};
|
|
47
48
|
if (cachePageItemMap != null && pageItem.componentIndex) {
|
|
48
49
|
cachePageItemMap.value[pageItem.componentIndex] = pageItem;
|
|
49
50
|
}
|
|
50
|
-
if (eventResult != null && pageItem.componentIndex && pageItem.events) {
|
|
51
|
-
const filteredEvents = pageItem.events.filter((event) => event.eventName !== void 0 && event.eventName !== null && event.eventName !== "");
|
|
52
|
-
if (filteredEvents && filteredEvents.length > 0) {
|
|
53
|
-
filteredEvents.forEach((event) => {
|
|
54
|
-
event.componentName = pageItem.name;
|
|
55
|
-
event.componentLabel = pageItem.label;
|
|
56
|
-
event.componentUuid = pageItem.uuid;
|
|
57
|
-
event.componentProp = pageItem.prop;
|
|
58
|
-
event.componentIndex = pageItem.componentIndex;
|
|
59
|
-
});
|
|
60
|
-
eventResult.value = eventResult.value.concat(filteredEvents);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
51
|
return treeItem;
|
|
64
52
|
} else {
|
|
65
53
|
return null;
|
|
@@ -381,8 +381,10 @@ function getControlConfig(item) {
|
|
|
381
381
|
}
|
|
382
382
|
function getPropsFormat(item) {
|
|
383
383
|
if (item.props.format && item.props.format.type === "hyperlinks") {
|
|
384
|
-
|
|
385
|
-
|
|
384
|
+
debugger;
|
|
385
|
+
const format = {};
|
|
386
|
+
format.type = item.props.format.type;
|
|
387
|
+
format.jumpPageJson = JSON.stringify(item.props.linkPage);
|
|
386
388
|
return JSON.stringify(format);
|
|
387
389
|
}
|
|
388
390
|
return JSON.stringify(item.props.format);
|
|
@@ -40,7 +40,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
40
40
|
code: "DC_TEMPLATE_MANAGEMENT"
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
http.post(
|
|
43
|
+
http.post(
|
|
44
|
+
window["$vueApp"].config.globalProperties.baseAPI + `/dc/template-management/list/${props.pageDesign.systemCode}`,
|
|
45
|
+
data
|
|
46
|
+
).then((res) => {
|
|
44
47
|
templateList.value = res.data;
|
|
45
48
|
});
|
|
46
49
|
}
|
|
@@ -588,9 +591,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
588
591
|
default: withCtx(() => [
|
|
589
592
|
(openBlock(true), createElementBlock(Fragment, null, renderList(templateList.value, (item) => {
|
|
590
593
|
return openBlock(), createBlock(_component_el_option, {
|
|
591
|
-
key: item.
|
|
594
|
+
key: item.uuid,
|
|
592
595
|
label: item.fileName,
|
|
593
|
-
value: item.
|
|
596
|
+
value: item.uuid
|
|
594
597
|
}, null, 8, ["label", "value"]);
|
|
595
598
|
}), 128))
|
|
596
599
|
]),
|
|
@@ -38,7 +38,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
38
38
|
}),
|
|
39
39
|
createVNode(_component_el_form_item, {
|
|
40
40
|
label: "线宽",
|
|
41
|
-
style: { "margin-top": "
|
|
41
|
+
style: { "margin-top": "0px" }
|
|
42
42
|
}, {
|
|
43
43
|
default: withCtx(() => [
|
|
44
44
|
createVNode(_component_el_input_number, {
|
|
@@ -21,13 +21,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
21
21
|
default: withCtx(() => [
|
|
22
22
|
createElementVNode("div", _hoisted_1, [
|
|
23
23
|
createVNode(_component_el_form_item, {
|
|
24
|
-
label: "
|
|
24
|
+
label: "左边距",
|
|
25
25
|
style: { "margin-top": "4px" }
|
|
26
26
|
}, {
|
|
27
27
|
default: withCtx(() => [
|
|
28
28
|
createVNode(_component_el_input_number, {
|
|
29
|
-
modelValue: __props.configure.style.
|
|
30
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.configure.style.
|
|
29
|
+
modelValue: __props.configure.style.marginLeft,
|
|
30
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.configure.style.marginLeft = $event),
|
|
31
31
|
min: 0,
|
|
32
32
|
max: 40
|
|
33
33
|
}, null, 8, ["modelValue"])
|
|
@@ -49,13 +49,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
49
49
|
_: 1
|
|
50
50
|
}),
|
|
51
51
|
createVNode(_component_el_form_item, {
|
|
52
|
-
label: "
|
|
52
|
+
label: "上边距",
|
|
53
53
|
style: { "margin-top": "-10px" }
|
|
54
54
|
}, {
|
|
55
55
|
default: withCtx(() => [
|
|
56
56
|
createVNode(_component_el_input_number, {
|
|
57
|
-
modelValue: __props.configure.style.
|
|
58
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => __props.configure.style.
|
|
57
|
+
modelValue: __props.configure.style.marginTop,
|
|
58
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => __props.configure.style.marginTop = $event),
|
|
59
59
|
min: 0,
|
|
60
60
|
max: 40
|
|
61
61
|
}, null, 8, ["modelValue"])
|
|
@@ -63,13 +63,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
63
63
|
_: 1
|
|
64
64
|
}),
|
|
65
65
|
createVNode(_component_el_form_item, {
|
|
66
|
-
label: "
|
|
66
|
+
label: "下边距",
|
|
67
67
|
style: { "margin-top": "-10px", "margin-bottom": "-15px" }
|
|
68
68
|
}, {
|
|
69
69
|
default: withCtx(() => [
|
|
70
70
|
createVNode(_component_el_input_number, {
|
|
71
|
-
modelValue: __props.configure.style.
|
|
72
|
-
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => __props.configure.style.
|
|
71
|
+
modelValue: __props.configure.style.marginBottom,
|
|
72
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => __props.configure.style.marginBottom = $event),
|
|
73
73
|
min: 0,
|
|
74
74
|
max: 40
|
|
75
75
|
}, null, 8, ["modelValue"])
|
|
@@ -21,13 +21,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
21
21
|
default: withCtx(() => [
|
|
22
22
|
createElementVNode("div", _hoisted_1, [
|
|
23
23
|
createVNode(_component_el_form_item, {
|
|
24
|
-
label: "
|
|
24
|
+
label: "左边距",
|
|
25
25
|
style: { "margin-top": "4px" }
|
|
26
26
|
}, {
|
|
27
27
|
default: withCtx(() => [
|
|
28
28
|
createVNode(_component_el_input_number, {
|
|
29
|
-
modelValue: __props.configure.style.
|
|
30
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.configure.style.
|
|
29
|
+
modelValue: __props.configure.style.paddingLeft,
|
|
30
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.configure.style.paddingLeft = $event),
|
|
31
31
|
min: 0,
|
|
32
32
|
max: 100
|
|
33
33
|
}, null, 8, ["modelValue"])
|
|
@@ -49,13 +49,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
49
49
|
_: 1
|
|
50
50
|
}),
|
|
51
51
|
createVNode(_component_el_form_item, {
|
|
52
|
-
label: "
|
|
52
|
+
label: "上边距",
|
|
53
53
|
style: { "margin-top": "-10px" }
|
|
54
54
|
}, {
|
|
55
55
|
default: withCtx(() => [
|
|
56
56
|
createVNode(_component_el_input_number, {
|
|
57
|
-
modelValue: __props.configure.style.
|
|
58
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => __props.configure.style.
|
|
57
|
+
modelValue: __props.configure.style.paddingTop,
|
|
58
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => __props.configure.style.paddingTop = $event),
|
|
59
59
|
min: 0,
|
|
60
60
|
max: 100
|
|
61
61
|
}, null, 8, ["modelValue"])
|
|
@@ -63,13 +63,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
63
63
|
_: 1
|
|
64
64
|
}),
|
|
65
65
|
createVNode(_component_el_form_item, {
|
|
66
|
-
label: "
|
|
66
|
+
label: "下边距",
|
|
67
67
|
style: { "margin-top": "-10px", "margin-bottom": "-15px" }
|
|
68
68
|
}, {
|
|
69
69
|
default: withCtx(() => [
|
|
70
70
|
createVNode(_component_el_input_number, {
|
|
71
|
-
modelValue: __props.configure.style.
|
|
72
|
-
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => __props.configure.style.
|
|
71
|
+
modelValue: __props.configure.style.paddingBottom,
|
|
72
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => __props.configure.style.paddingBottom = $event),
|
|
73
73
|
min: 0,
|
|
74
74
|
max: 100
|
|
75
75
|
}, null, 8, ["modelValue"])
|
|
@@ -32,6 +32,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
32
32
|
type: BooleanConstructor;
|
|
33
33
|
default: boolean;
|
|
34
34
|
};
|
|
35
|
+
isRange: {
|
|
36
|
+
type: BooleanConstructor;
|
|
37
|
+
default: boolean;
|
|
38
|
+
};
|
|
35
39
|
}, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
36
40
|
"update:modelValue": (...args: any[]) => void;
|
|
37
41
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
@@ -68,6 +72,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
68
72
|
type: BooleanConstructor;
|
|
69
73
|
default: boolean;
|
|
70
74
|
};
|
|
75
|
+
isRange: {
|
|
76
|
+
type: BooleanConstructor;
|
|
77
|
+
default: boolean;
|
|
78
|
+
};
|
|
71
79
|
}>> & {
|
|
72
80
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
|
73
81
|
}, {
|
|
@@ -76,5 +84,6 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
76
84
|
paramTypes: string[];
|
|
77
85
|
showLabel: boolean;
|
|
78
86
|
needParams: boolean;
|
|
87
|
+
isRange: boolean;
|
|
79
88
|
}, {}>;
|
|
80
89
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./common-variable-bind.vue2.js";
|
|
2
2
|
import "./common-variable-bind.vue3.js";
|
|
3
3
|
import _export_sfc from "../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const BindVariable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const BindVariable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-98728067"]]);
|
|
5
5
|
export {
|
|
6
6
|
BindVariable as default
|
|
7
7
|
};
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import { defineComponent, ref, onMounted, computed, watch, resolveComponent, openBlock, createElementBlock, toDisplayString, createBlock, withCtx, createVNode, withDirectives, withModifiers, unref, vShow, createElementVNode, createTextVNode, normalizeStyle, nextTick, pushScopeId, popScopeId } from "vue";
|
|
1
|
+
import { defineComponent, ref, onMounted, onUnmounted, computed, watch, resolveComponent, openBlock, createElementBlock, toDisplayString, createBlock, withCtx, createVNode, withDirectives, withModifiers, unref, vShow, createElementVNode, createTextVNode, normalizeStyle, createCommentVNode, nextTick, pushScopeId, popScopeId } from "vue";
|
|
2
2
|
import { CircleClose, Plus, InfoFilled, Search } from "@element-plus/icons-vue";
|
|
3
3
|
import http from "agilebuilder-ui/src/utils/request";
|
|
4
|
-
import { getUuidv4 } from "../../../utils/common-util.js";
|
|
5
|
-
import { getTypeOptions,
|
|
4
|
+
import { deepCopy, getUuidv4 } from "../../../utils/common-util.js";
|
|
5
|
+
import { getTypeOptions, taskVarOptions, contextVarOptions } from "./common-variable-bind-option.js";
|
|
6
6
|
import { usePageContextStore } from "../../../../../stores/page-store.js";
|
|
7
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
7
|
+
const _withScopeId = (n) => (pushScopeId("data-v-98728067"), n = n(), popScopeId(), n);
|
|
8
8
|
const _hoisted_1 = { key: 0 };
|
|
9
9
|
const _hoisted_2 = { style: { "margin-top": "10px", "font-size": "10px", "display": "flex", "align-items": "center", "justify-self": "center" } };
|
|
10
10
|
const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { style: { "margin-left": "5px" } }, "输入变量名后点击加号按钮添加", -1));
|
|
11
11
|
const _hoisted_4 = { style: { "font-size": "10px", "line-height": "40px" } };
|
|
12
12
|
const _hoisted_5 = { style: { "margin-top": "4px", "margin-bottom": "8px", "font-size": "10px", "display": "flex", "align-items": "center", "justify-self": "center" } };
|
|
13
13
|
const _hoisted_6 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { style: { "margin-left": "5px" } }, "输入变量名后点击加号按钮添加", -1));
|
|
14
|
-
const _hoisted_7 =
|
|
15
|
-
|
|
14
|
+
const _hoisted_7 = {
|
|
15
|
+
key: 0,
|
|
16
|
+
style: { "display": "flex" }
|
|
17
|
+
};
|
|
18
|
+
const _hoisted_8 = ["title"];
|
|
19
|
+
const _hoisted_9 = ["title"];
|
|
20
|
+
const _hoisted_10 = { class: "totalStyle" };
|
|
16
21
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
22
|
...{
|
|
18
23
|
name: "ValueSetInput",
|
|
@@ -40,6 +45,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
40
45
|
needParams: {
|
|
41
46
|
type: Boolean,
|
|
42
47
|
default: false
|
|
48
|
+
},
|
|
49
|
+
isRange: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false
|
|
43
52
|
}
|
|
44
53
|
},
|
|
45
54
|
emits: ["update:modelValue"],
|
|
@@ -47,19 +56,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
47
56
|
const pageContextUtil = usePageContextStore();
|
|
48
57
|
const emits = __emit;
|
|
49
58
|
const props = __props;
|
|
59
|
+
const popoverVisible = ref(false);
|
|
50
60
|
const defalutValue = ref("");
|
|
61
|
+
const inputRef = ref(null);
|
|
62
|
+
const contentRef = ref(null);
|
|
51
63
|
const typeOptions = ref([]);
|
|
52
64
|
const showInput = ref(false);
|
|
53
65
|
const labelValue = ref("");
|
|
66
|
+
ref(false);
|
|
54
67
|
const paramType = ref("");
|
|
55
68
|
const paramValue = ref("");
|
|
56
69
|
const valueOptions = ref([]);
|
|
57
70
|
const selectOptions = ref({});
|
|
58
71
|
const searchValue = ref("");
|
|
59
72
|
ref("");
|
|
60
|
-
const popoverRef = ref();
|
|
73
|
+
const popoverRef = ref(null);
|
|
61
74
|
const selectInputType = ["context", "system", "task", "data", "page"];
|
|
62
75
|
onMounted(() => {
|
|
76
|
+
window.addEventListener("click", handleClickOutside);
|
|
63
77
|
const pageContext = pageContextUtil.pageContext;
|
|
64
78
|
let hasTask = false;
|
|
65
79
|
let hasData = false;
|
|
@@ -93,7 +107,89 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
93
107
|
paramType.value = newOptions.length > 0 ? newOptions[0].value : "";
|
|
94
108
|
setValueOptions(paramType.value);
|
|
95
109
|
}
|
|
110
|
+
console.log("popoverRef", popoverRef.value);
|
|
111
|
+
});
|
|
112
|
+
onUnmounted(() => {
|
|
113
|
+
window.removeEventListener("click", handleClickOutside);
|
|
96
114
|
});
|
|
115
|
+
let lastTarget = null;
|
|
116
|
+
function handleClickOutside(event) {
|
|
117
|
+
if (paramTypeCheck) {
|
|
118
|
+
paramTypeCheck = false;
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
let popoverDom = null;
|
|
122
|
+
if (contentRef.value) {
|
|
123
|
+
popoverDom = contentRef.value.$el.parentNode;
|
|
124
|
+
}
|
|
125
|
+
if (!event.target || !popoverDom) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (event.target === lastTarget) {
|
|
129
|
+
console.log("与最后的点击一致");
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const inputDom = inputRef.value ? inputRef.value.input : null;
|
|
133
|
+
if (inputDom && (event.target === inputDom || inputDom.contains(event.target))) {
|
|
134
|
+
console.log("click contains input");
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (event.target === popoverDom || popoverDom.contains(event.target)) {
|
|
138
|
+
console.log("click contains");
|
|
139
|
+
lastTarget = event.target;
|
|
140
|
+
} else {
|
|
141
|
+
if (contentRef.value.$el) {
|
|
142
|
+
console.log("contentRef.value.$el.contains", contentRef.value.$el.contains(event.target));
|
|
143
|
+
}
|
|
144
|
+
console.log("click contains--------not");
|
|
145
|
+
if (popoverVisible.value) {
|
|
146
|
+
closePopover(true);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
const symbolUnits = ref([
|
|
151
|
+
{
|
|
152
|
+
label: "天",
|
|
153
|
+
value: "d"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
label: "周",
|
|
157
|
+
value: "w"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
label: "月",
|
|
161
|
+
value: "m"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
label: "年",
|
|
165
|
+
value: "y"
|
|
166
|
+
}
|
|
167
|
+
]);
|
|
168
|
+
const symbolUnitFormatter = (unit) => {
|
|
169
|
+
const items = symbolUnits.value.filter((item) => {
|
|
170
|
+
return item.value == unit;
|
|
171
|
+
});
|
|
172
|
+
if (items.length > 0) {
|
|
173
|
+
return items[0].label;
|
|
174
|
+
} else {
|
|
175
|
+
return "";
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
let popoverTimeout = null;
|
|
179
|
+
function closePopover(immediate) {
|
|
180
|
+
clearTimeout(popoverTimeout);
|
|
181
|
+
if (immediate) {
|
|
182
|
+
popoverVisible.value = false;
|
|
183
|
+
} else {
|
|
184
|
+
popoverTimeout = setTimeout(() => {
|
|
185
|
+
popoverVisible.value = false;
|
|
186
|
+
}, 2e3);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function openPopover() {
|
|
190
|
+
clearTimeout(popoverTimeout);
|
|
191
|
+
popoverVisible.value = true;
|
|
192
|
+
}
|
|
97
193
|
const filterTableData = computed(
|
|
98
194
|
() => (
|
|
99
195
|
//等于System时为全部
|
|
@@ -154,6 +250,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
154
250
|
}
|
|
155
251
|
return props.modelValue;
|
|
156
252
|
}
|
|
253
|
+
let paramTypeCheck = false;
|
|
157
254
|
function paramTypeChange(selParamType) {
|
|
158
255
|
if (selParamType) {
|
|
159
256
|
if (Array.isArray(selParamType)) {
|
|
@@ -173,10 +270,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
173
270
|
if (paramType.value == "system") {
|
|
174
271
|
querySystemParams();
|
|
175
272
|
}
|
|
273
|
+
paramTypeCheck = true;
|
|
176
274
|
}
|
|
177
275
|
function setValueOptions(value) {
|
|
178
276
|
if (value === "context") {
|
|
179
|
-
|
|
277
|
+
let options = contextVarOptions;
|
|
278
|
+
if (props.isRange) {
|
|
279
|
+
options = deepCopy(options);
|
|
280
|
+
for (let i = 0; i < options.length; i++) {
|
|
281
|
+
let o = options[i];
|
|
282
|
+
if (o.value == "currentDate") {
|
|
283
|
+
options.splice(i + 1, 0, {
|
|
284
|
+
value: "currentDate",
|
|
285
|
+
symbolUnit: "d",
|
|
286
|
+
symbol: "-",
|
|
287
|
+
type: "range"
|
|
288
|
+
});
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
valueOptions.value = options;
|
|
180
294
|
} else if (value === "system") {
|
|
181
295
|
valueOptions.value = selectOptions.value.systemVarOptions || [];
|
|
182
296
|
} else if (value === "task") {
|
|
@@ -195,10 +309,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
195
309
|
popoverRef.value.hide();
|
|
196
310
|
}
|
|
197
311
|
function selectRow(row) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
312
|
+
if (row.type == "range") {
|
|
313
|
+
if (row.symbolNum === "") {
|
|
314
|
+
ElMessage.warning("周期不能为空!");
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
if (isNaN(row.symbolNum)) {
|
|
318
|
+
ElMessage.warning("周期为无效的数字!");
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
if (row.symbolNum != "0") {
|
|
322
|
+
paramValue.value = row.value + row.symbol + row.symbolNum + row.symbolUnit;
|
|
323
|
+
} else {
|
|
324
|
+
paramValue.value = row.value;
|
|
325
|
+
}
|
|
326
|
+
} else {
|
|
327
|
+
paramValue.value = row.value;
|
|
328
|
+
}
|
|
329
|
+
defalutValue.value = "${" + paramType.value + "." + paramValue.value + "}";
|
|
330
|
+
emits("update:modelValue", defalutValue.value, row.alias);
|
|
331
|
+
closePopover(true);
|
|
202
332
|
}
|
|
203
333
|
function addRequestParam(paramName) {
|
|
204
334
|
paramValue.value = paramName;
|
|
@@ -211,7 +341,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
211
341
|
}
|
|
212
342
|
defalutValue.value = "${" + paramType.value + "." + paramValue.value + "}";
|
|
213
343
|
emits("update:modelValue", defalutValue.value);
|
|
214
|
-
|
|
344
|
+
closePopover(true);
|
|
215
345
|
}
|
|
216
346
|
function addPageParams() {
|
|
217
347
|
searchValue.value = searchValue.value.trim();
|
|
@@ -244,10 +374,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
244
374
|
defalutValue.value = "${" + paramType.value + "." + searchValue.value + "}";
|
|
245
375
|
searchValue.value = "";
|
|
246
376
|
emits("update:modelValue", defalutValue.value);
|
|
247
|
-
|
|
377
|
+
closePopover(true);
|
|
248
378
|
}
|
|
249
379
|
function getValueLabel(valueType, value) {
|
|
250
380
|
if (selectInputType.includes(valueType)) {
|
|
381
|
+
if (valueType === "context" && value && value.startsWith("currentDate") && value.length > 11) {
|
|
382
|
+
const str = value.substring(11);
|
|
383
|
+
const symbol = str.substring(0, 1);
|
|
384
|
+
const num = str.substring(1, str.length - 1);
|
|
385
|
+
const unit = str.substring(str.length - 1);
|
|
386
|
+
return num + symbolUnitFormatter(unit) + ("+" === symbol ? "后" : "前");
|
|
387
|
+
}
|
|
251
388
|
const option = valueOptions.value.find((item) => item.value === value);
|
|
252
389
|
if (option) {
|
|
253
390
|
return option.label;
|
|
@@ -265,6 +402,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
265
402
|
}
|
|
266
403
|
}
|
|
267
404
|
function showPopover() {
|
|
405
|
+
openPopover();
|
|
268
406
|
nextTick(() => {
|
|
269
407
|
setSelectOptions();
|
|
270
408
|
if (paramType.value) {
|
|
@@ -281,6 +419,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
281
419
|
const _component_el_empty = resolveComponent("el-empty");
|
|
282
420
|
const _component_el_button = resolveComponent("el-button");
|
|
283
421
|
const _component_el_table_column = resolveComponent("el-table-column");
|
|
422
|
+
const _component_el_option = resolveComponent("el-option");
|
|
423
|
+
const _component_el_select = resolveComponent("el-select");
|
|
284
424
|
const _component_el_table = resolveComponent("el-table");
|
|
285
425
|
const _component_el_row = resolveComponent("el-row");
|
|
286
426
|
const _component_el_popover = resolveComponent("el-popover");
|
|
@@ -288,7 +428,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
288
428
|
key: 1,
|
|
289
429
|
ref_key: "popoverRef",
|
|
290
430
|
ref: popoverRef,
|
|
291
|
-
|
|
431
|
+
visible: popoverVisible.value,
|
|
292
432
|
width: 400
|
|
293
433
|
}, {
|
|
294
434
|
reference: withCtx(() => [
|
|
@@ -296,6 +436,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
296
436
|
readonly: "",
|
|
297
437
|
size: __props.size,
|
|
298
438
|
title: defalutValue.value,
|
|
439
|
+
ref_key: "inputRef",
|
|
440
|
+
ref: inputRef,
|
|
299
441
|
onClick: showPopover,
|
|
300
442
|
formatter,
|
|
301
443
|
modelValue: defalutValue.value,
|
|
@@ -319,7 +461,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
319
461
|
}, 8, ["size", "title", "modelValue"])
|
|
320
462
|
]),
|
|
321
463
|
default: withCtx(() => [
|
|
322
|
-
createVNode(_component_el_row,
|
|
464
|
+
createVNode(_component_el_row, {
|
|
465
|
+
ref_key: "contentRef",
|
|
466
|
+
ref: contentRef
|
|
467
|
+
}, {
|
|
323
468
|
default: withCtx(() => [
|
|
324
469
|
createVNode(_component_el_col, { span: 8 }, {
|
|
325
470
|
default: withCtx(() => [
|
|
@@ -460,25 +605,84 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
460
605
|
prop: "label"
|
|
461
606
|
}, {
|
|
462
607
|
default: withCtx((scope) => [
|
|
463
|
-
|
|
608
|
+
paramType.value == "context" && scope.row.type == "range" ? (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
609
|
+
createVNode(_component_el_input, {
|
|
610
|
+
size: "small",
|
|
611
|
+
modelValue: scope.row.symbolNum,
|
|
612
|
+
"onUpdate:modelValue": ($event) => scope.row.symbolNum = $event,
|
|
613
|
+
placeholder: "",
|
|
614
|
+
style: { "width": "35px", "margin-left": "4px" }
|
|
615
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
616
|
+
createVNode(_component_el_select, {
|
|
617
|
+
size: "small",
|
|
618
|
+
style: { "margin-left": "4px", "width": "50px" },
|
|
619
|
+
modelValue: scope.row.symbolUnit,
|
|
620
|
+
"onUpdate:modelValue": ($event) => scope.row.symbolUnit = $event,
|
|
621
|
+
placeholder: ""
|
|
622
|
+
}, {
|
|
623
|
+
default: withCtx(() => [
|
|
624
|
+
createVNode(_component_el_option, {
|
|
625
|
+
label: "天",
|
|
626
|
+
value: "d"
|
|
627
|
+
}),
|
|
628
|
+
createVNode(_component_el_option, {
|
|
629
|
+
label: "周",
|
|
630
|
+
value: "w"
|
|
631
|
+
}),
|
|
632
|
+
createVNode(_component_el_option, {
|
|
633
|
+
label: "月",
|
|
634
|
+
value: "m"
|
|
635
|
+
}),
|
|
636
|
+
createVNode(_component_el_option, {
|
|
637
|
+
label: "年",
|
|
638
|
+
value: "y"
|
|
639
|
+
})
|
|
640
|
+
]),
|
|
641
|
+
_: 2
|
|
642
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"]),
|
|
643
|
+
createVNode(_component_el_select, {
|
|
644
|
+
size: "small",
|
|
645
|
+
style: { "margin-left": "4px", "width": "50px" },
|
|
646
|
+
modelValue: scope.row.symbol,
|
|
647
|
+
"onUpdate:modelValue": ($event) => scope.row.symbol = $event,
|
|
648
|
+
placeholder: ""
|
|
649
|
+
}, {
|
|
650
|
+
default: withCtx(() => [
|
|
651
|
+
createVNode(_component_el_option, {
|
|
652
|
+
label: "前",
|
|
653
|
+
value: "-"
|
|
654
|
+
}),
|
|
655
|
+
createVNode(_component_el_option, {
|
|
656
|
+
label: "后",
|
|
657
|
+
value: "+"
|
|
658
|
+
})
|
|
659
|
+
]),
|
|
660
|
+
_: 2
|
|
661
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])
|
|
662
|
+
])) : createCommentVNode("", true),
|
|
663
|
+
paramType.value == "data" ? (openBlock(), createElementBlock("span", {
|
|
664
|
+
key: 1,
|
|
665
|
+
title: scope.row.label + " " + scope.row.value
|
|
666
|
+
}, toDisplayString(scope.row.label + " " + scope.row.value), 9, _hoisted_8)) : (openBlock(), createElementBlock("span", {
|
|
667
|
+
key: 2,
|
|
464
668
|
title: scope.row.label
|
|
465
|
-
}, toDisplayString(scope.row.label), 9,
|
|
669
|
+
}, toDisplayString(scope.row.label), 9, _hoisted_9))
|
|
466
670
|
]),
|
|
467
671
|
_: 1
|
|
468
672
|
})
|
|
469
673
|
]),
|
|
470
674
|
_: 1
|
|
471
675
|
}, 8, ["height", "data"]),
|
|
472
|
-
createElementVNode("div",
|
|
676
|
+
createElementVNode("div", _hoisted_10, "总计:" + toDisplayString(filterTableData.value.length), 1)
|
|
473
677
|
]),
|
|
474
678
|
_: 1
|
|
475
679
|
}))
|
|
476
680
|
]),
|
|
477
681
|
_: 1
|
|
478
|
-
})
|
|
682
|
+
}, 512)
|
|
479
683
|
]),
|
|
480
684
|
_: 1
|
|
481
|
-
},
|
|
685
|
+
}, 8, ["visible"]));
|
|
482
686
|
};
|
|
483
687
|
}
|
|
484
688
|
});
|