super-page-runtime 2.2.26 → 2.2.29-tmp2
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/_virtual/_plugin-vue_export-helper.js +7 -5
- package/dist/es/assets/chart-themes/theme1.js +6 -2
- package/dist/es/assets/chart-themes/theme2.js +6 -2
- package/dist/es/assets/chart-themes/theme3.js +6 -2
- package/dist/es/components/runtime/utils/api/api-util.js +7 -4
- package/dist/es/components/runtime/utils/api/page-expose-util.js +443 -135
- package/dist/es/components/runtime/utils/assemblys-config.js +369 -13
- package/dist/es/components/runtime/utils/barcode-util.js +33 -9
- package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +306 -122
- package/dist/es/components/runtime/utils/charts/chart-gauge-util.js +68 -29
- package/dist/es/components/runtime/utils/charts/chart-pie-util.js +152 -68
- package/dist/es/components/runtime/utils/charts/chart-radar-util.js +124 -46
- package/dist/es/components/runtime/utils/charts/chart-scatter-util.js +99 -36
- package/dist/es/components/runtime/utils/charts/chart-util.js +522 -224
- package/dist/es/components/runtime/utils/common-util.js +156 -76
- package/dist/es/components/runtime/utils/eventBus.js +8 -3
- package/dist/es/components/runtime/utils/events/event-util.js +775 -362
- package/dist/es/components/runtime/utils/events/print-label.js +140 -72
- package/dist/es/components/runtime/utils/events/standard-event.js +2320 -808
- package/dist/es/components/runtime/utils/events/validator-util.js +560 -224
- package/dist/es/components/runtime/utils/form/date-shortcuts.js +88 -28
- package/dist/es/components/runtime/utils/form/scan-util.js +162 -61
- package/dist/es/components/runtime/utils/global-refs.js +84 -53
- package/dist/es/components/runtime/utils/i18n-util.js +20 -11
- package/dist/es/components/runtime/utils/interfaces/page-design-types.js +7 -2
- package/dist/es/components/runtime/utils/page-helper-util.js +660 -279
- package/dist/es/components/runtime/utils/page-init-util.js +406 -141
- package/dist/es/components/runtime/utils/page-permission-util.js +531 -22
- package/dist/es/components/runtime/utils/page-store.js +68 -23
- package/dist/es/components/runtime/utils/store-util.js +13 -9
- package/dist/es/components/runtime/utils/store.js +2 -2
- package/dist/es/components/runtime/utils/table-utils.js +81 -40
- package/dist/es/components/runtime/utils/tree-utils.js +37 -17
- package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +83 -21
- package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue2.js +46 -14
- package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue2.js +132 -36
- package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/export-pdf/exportpdf-runtime.vue2.js +18 -4
- package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +107 -17
- package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +198 -50
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue.js +42 -12
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-breadcrumb.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue.js +60 -7
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header-group.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue.js +203 -52
- package/dist/es/components/runtime/views/assemblys/chart/common/common-chart-header.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue.js +4 -4
- package/dist/es/components/runtime/views/assemblys/chart/common/common-homepage-search.vue2.js +162 -46
- package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +109 -32
- package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +166 -43
- package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +117 -32
- package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +118 -32
- package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +597 -246
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue.js +42 -4
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column-item.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue.js +62 -8
- package/dist/es/components/runtime/views/assemblys/chart/table/group-column.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +160 -29
- package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +62 -13
- package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +594 -212
- package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue.js +139 -29
- package/dist/es/components/runtime/views/assemblys/common/export-form-report-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue.js +125 -21
- package/dist/es/components/runtime/views/assemblys/common/remove-signer-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue.js +102 -16
- package/dist/es/components/runtime/views/assemblys/common/task-informition-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/card/card-runtime.vue2.js +81 -18
- package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue2.js +82 -17
- package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/container/container-runtime.vue2.js +86 -14
- package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +79 -21
- package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/form/form-runtime.vue2.js +61 -16
- package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue2.js +37 -10
- package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue2.js +127 -38
- package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +76 -28
- package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +178 -61
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +810 -302
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +635 -262
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +115 -40
- package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +215 -56
- package/dist/es/components/runtime/views/assemblys/error-render.vue.js +21 -3
- package/dist/es/components/runtime/views/assemblys/error-render.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +154 -42
- package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue.js +98 -34
- package/dist/es/components/runtime/views/assemblys/form/common/title-suffix-element.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/custom/custom-runtime.vue2.js +200 -52
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +239 -68
- package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue2.js +109 -31
- package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/divider/divider-runtime.vue2.js +59 -21
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +188 -56
- package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue2.js +103 -22
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +245 -57
- package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/label/label-runtime.vue2.js +174 -32
- package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +107 -28
- package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +4 -4
- package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue2.js +50 -13
- package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/radio/radio-runtime.vue2.js +194 -64
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +249 -88
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +263 -80
- package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/separatelabel/separatelabel-runtime.vue2.js +57 -13
- package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/switch/switch-runtime.vue2.js +155 -30
- package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +129 -40
- package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue2.js +107 -22
- package/dist/es/components/runtime/views/assemblys/home-chart-render.vue.js +188 -89
- package/dist/es/components/runtime/views/assemblys/home-chart-render.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/object-render.vue.js +272 -133
- package/dist/es/components/runtime/views/assemblys/object-render.vue2.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-runtime.vue2.js +46 -18
- package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/text-history/textflow-runtime.vue2.js +49 -21
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue2.js +58 -20
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue.js +2 -2
- package/dist/es/components/runtime/views/assemblys/workflow/workflow-node/workflownode-runtime.vue2.js +53 -16
- package/dist/es/components/runtime/views/home-chart.vue.js +160 -40
- package/dist/es/components/runtime/views/home-chart.vue2.js +2 -2
- package/dist/es/components/runtime/views/super-page-dialog.vue.js +139 -20
- package/dist/es/components/runtime/views/super-page-dialog.vue2.js +2 -2
- package/dist/es/components/runtime/views/super-page.vue.js +754 -226
- package/dist/es/components/runtime/views/super-page.vue2.js +2 -2
- package/dist/es/i18n/langs/cn.js +55 -2
- package/dist/es/i18n/langs/en.js +55 -2
- package/package.json +2 -2
|
@@ -1,41 +1,130 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import { ElTabs
|
|
3
|
-
import
|
|
4
|
-
import { SuperIcon
|
|
5
|
-
import { handleAfterInitEvent
|
|
6
|
-
import { $t
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
1
|
+
import { defineComponent, ref, onMounted, nextTick, createBlock, openBlock, unref, normalizeClass, normalizeStyle, withCtx, createElementBlock, Fragment, renderList, createElementVNode, createCommentVNode, toDisplayString } from "vue";
|
|
2
|
+
import { ElTabs, ElTabPane } from "element-plus";
|
|
3
|
+
import _sfc_main$1 from "../../object-render.vue.js";
|
|
4
|
+
import { SuperIcon } from "agilebuilder-ui";
|
|
5
|
+
import { handleAfterInitEvent, handleEvent } from "../../../../utils/events/event-util.js";
|
|
6
|
+
import { $t } from "../../../../utils/i18n-util.js";
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "tabs-runtime",
|
|
9
|
+
props: {
|
|
10
|
+
pageContext: {},
|
|
11
|
+
configure: {}
|
|
12
|
+
},
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
const activeName = ref(null);
|
|
16
|
+
activeName.value = props.configure.props.defaultOpen ? props.configure.props.defaultOpen : 1;
|
|
17
|
+
const thisRef = ref(null);
|
|
18
|
+
const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
|
|
19
|
+
const runtimeStyle = runtimeInfo.style;
|
|
20
|
+
const runtimeClass = runtimeInfo.class;
|
|
21
|
+
const headerStyle = runtimeInfo.headerStyle;
|
|
22
|
+
function tabClick(pane, ev) {
|
|
23
|
+
const params = {
|
|
24
|
+
pane,
|
|
25
|
+
ev
|
|
26
|
+
};
|
|
27
|
+
const activeTab = pane.paneName;
|
|
28
|
+
props.pageContext.activeTab = activeTab;
|
|
29
|
+
props.pageContext.activeLabel = params.label;
|
|
30
|
+
return handleEvent(activeTab, props.pageContext, props.configure, "tab-click", params);
|
|
31
|
+
}
|
|
32
|
+
function tabChange(paneName) {
|
|
33
|
+
const params = {
|
|
34
|
+
paneName
|
|
35
|
+
};
|
|
36
|
+
props.pageContext.activeTab = paneName;
|
|
37
|
+
return handleEvent(paneName, props.pageContext, props.configure, "tab-change", params);
|
|
38
|
+
}
|
|
39
|
+
function tabRemove(paneName) {
|
|
40
|
+
const params = {
|
|
41
|
+
paneName
|
|
42
|
+
};
|
|
43
|
+
return handleEvent(paneName, props.pageContext, props.configure, "tab-remove", params);
|
|
44
|
+
}
|
|
45
|
+
function tabAdd() {
|
|
46
|
+
return handleEvent(null, props.pageContext, props.configure, "tab-add");
|
|
47
|
+
}
|
|
48
|
+
function tabEdit(paneName, action) {
|
|
49
|
+
const params = {
|
|
50
|
+
paneName,
|
|
51
|
+
action
|
|
52
|
+
};
|
|
53
|
+
return handleEvent(paneName, props.pageContext, props.configure, "edit", params);
|
|
54
|
+
}
|
|
55
|
+
onMounted(() => {
|
|
56
|
+
nextTick(() => {
|
|
57
|
+
let tabsDom = [];
|
|
58
|
+
props.configure.items.forEach((item) => {
|
|
59
|
+
if (item.code) {
|
|
60
|
+
tabsDom.push(document.querySelector("." + item.code));
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
handleAfterInitEvent(null, props.pageContext, props.configure, {
|
|
64
|
+
componentRef: thisRef.value,
|
|
65
|
+
tabsDom,
|
|
66
|
+
entity: props.pageContext.entity.data,
|
|
67
|
+
pageData: props.pageContext.entity.page
|
|
68
|
+
});
|
|
69
|
+
});
|
|
36
70
|
});
|
|
37
|
-
|
|
38
|
-
|
|
71
|
+
return (_ctx, _cache) => {
|
|
72
|
+
return openBlock(), createBlock(unref(ElTabs), {
|
|
73
|
+
ref_key: "thisRef",
|
|
74
|
+
ref: thisRef,
|
|
75
|
+
modelValue: activeName.value,
|
|
76
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeName.value = $event),
|
|
77
|
+
type: _ctx.configure.props.cardType,
|
|
78
|
+
"tab-position": _ctx.configure.props.tabPosition,
|
|
79
|
+
style: normalizeStyle(unref(runtimeStyle)),
|
|
80
|
+
class: normalizeClass(unref(runtimeClass)),
|
|
81
|
+
onTabClick: tabClick,
|
|
82
|
+
onTabChange: tabChange,
|
|
83
|
+
onTabRemove: tabRemove,
|
|
84
|
+
onTabAdd: tabAdd,
|
|
85
|
+
onEdit: tabEdit
|
|
86
|
+
}, {
|
|
87
|
+
default: withCtx(() => [
|
|
88
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.configure.items, (item, index) => {
|
|
89
|
+
return openBlock(), createBlock(unref(ElTabPane), {
|
|
90
|
+
label: item.label,
|
|
91
|
+
name: item.index
|
|
92
|
+
}, {
|
|
93
|
+
label: withCtx(() => [
|
|
94
|
+
createElementVNode("span", {
|
|
95
|
+
class: normalizeClass(item.code)
|
|
96
|
+
}, [
|
|
97
|
+
item.iconType && item.iconValue ? (openBlock(), createBlock(unref(SuperIcon), {
|
|
98
|
+
key: 0,
|
|
99
|
+
iconType: item.iconType,
|
|
100
|
+
iconValue: item.iconValue,
|
|
101
|
+
style: { "margin-right": "2px" }
|
|
102
|
+
}, null, 8, ["iconType", "iconValue"])) : createCommentVNode("", true),
|
|
103
|
+
createElementVNode("span", {
|
|
104
|
+
style: normalizeStyle(unref(headerStyle))
|
|
105
|
+
}, toDisplayString(unref($t)(item.label)), 5)
|
|
106
|
+
], 2)
|
|
107
|
+
]),
|
|
108
|
+
default: withCtx(() => [
|
|
109
|
+
createElementVNode("div", null, [
|
|
110
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.items, (element, itemIndex) => {
|
|
111
|
+
return openBlock(), createBlock(_sfc_main$1, {
|
|
112
|
+
key: element.uuid,
|
|
113
|
+
pageContext: _ctx.pageContext,
|
|
114
|
+
configure: element
|
|
115
|
+
}, null, 8, ["pageContext", "configure"]);
|
|
116
|
+
}), 128))
|
|
117
|
+
])
|
|
118
|
+
]),
|
|
119
|
+
_: 2
|
|
120
|
+
}, 1032, ["label", "name"]);
|
|
121
|
+
}), 256))
|
|
122
|
+
]),
|
|
123
|
+
_: 1
|
|
124
|
+
}, 8, ["modelValue", "type", "tab-position", "style", "class"]);
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
});
|
|
39
128
|
export {
|
|
40
|
-
|
|
129
|
+
_sfc_main as default
|
|
41
130
|
};
|
|
@@ -1,34 +1,82 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent, ref, onMounted, nextTick, onUnmounted, createElementBlock, openBlock, createElementVNode, normalizeStyle, normalizeClass, unref, Fragment, renderList, createBlock } from "vue";
|
|
2
|
+
import _sfc_main$1 from "../../object-render.vue.js";
|
|
3
3
|
import "../../../../utils/global-refs.js";
|
|
4
|
-
import { handleAfterInitEvent
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
import { handleAfterInitEvent } from "../../../../utils/events/event-util.js";
|
|
5
|
+
const _hoisted_1 = { class: "amb-widget-tools-parent" };
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "tools-runtime",
|
|
8
|
+
props: {
|
|
9
|
+
pageContext: {},
|
|
10
|
+
configure: {}
|
|
11
|
+
},
|
|
12
|
+
setup(__props) {
|
|
13
|
+
const props = __props;
|
|
14
|
+
const thisRef = ref(null);
|
|
15
|
+
const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
|
|
16
|
+
const runtimeStyle = ref(runtimeInfo.style ? runtimeInfo.style : {});
|
|
17
|
+
const runtimeClass = runtimeInfo.class;
|
|
18
|
+
onMounted(() => {
|
|
19
|
+
if (thisRef.value && thisRef.value.parentNode) {
|
|
20
|
+
const resizeObserver2 = new ResizeObserver((entries) => {
|
|
21
|
+
caculatePositionStyle();
|
|
22
|
+
});
|
|
23
|
+
resizeObserver2.observe(thisRef.value.parentNode);
|
|
24
|
+
}
|
|
25
|
+
nextTick(() => {
|
|
26
|
+
handleAfterInitEvent(null, props.pageContext, props.configure, {
|
|
27
|
+
componentRef: thisRef.value,
|
|
28
|
+
entity: props.pageContext.entity.data,
|
|
29
|
+
pageData: props.pageContext.entity.page
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
onUnmounted(() => {
|
|
34
|
+
});
|
|
35
|
+
function caculatePositionStyle() {
|
|
36
|
+
if (thisRef.value && thisRef.value.parentNode) {
|
|
37
|
+
const thisProps = props.configure.props;
|
|
38
|
+
const position = thisProps.position;
|
|
39
|
+
if (position == "top1" || position == "bottom1") {
|
|
40
|
+
const tempStyle = {};
|
|
41
|
+
tempStyle["position"] = "fixed !important";
|
|
42
|
+
tempStyle["z-index"] = "1";
|
|
43
|
+
const contentObj = [thisRef.value.parentNode];
|
|
44
|
+
if (contentObj && contentObj.length > 0) {
|
|
45
|
+
const contentRec = contentObj[0].getBoundingClientRect();
|
|
46
|
+
if (position == "top") {
|
|
47
|
+
tempStyle["top"] = contentRec.top + "px";
|
|
48
|
+
}
|
|
49
|
+
if (position == "bottom") {
|
|
50
|
+
tempStyle["bottom"] = "10px";
|
|
21
51
|
}
|
|
22
52
|
}
|
|
23
|
-
|
|
24
|
-
|
|
53
|
+
const parentRec = thisRef.value.parentNode.getBoundingClientRect();
|
|
54
|
+
console.log("parentRec", parentRec);
|
|
55
|
+
tempStyle["width"] = parentRec.width - 25 + "px";
|
|
56
|
+
Object.assign(runtimeStyle.value, tempStyle);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
25
59
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
60
|
+
return (_ctx, _cache) => {
|
|
61
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
62
|
+
createElementVNode("div", {
|
|
63
|
+
class: normalizeClass(["amb-widget-container-tool amb-widget-tools", unref(runtimeClass)]),
|
|
64
|
+
style: normalizeStyle(runtimeStyle.value),
|
|
65
|
+
ref_key: "thisRef",
|
|
66
|
+
ref: thisRef
|
|
67
|
+
}, [
|
|
68
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.configure.items, (element, itemIndex) => {
|
|
69
|
+
return openBlock(), createBlock(_sfc_main$1, {
|
|
70
|
+
key: element.uuid,
|
|
71
|
+
pageContext: _ctx.pageContext,
|
|
72
|
+
configure: element
|
|
73
|
+
}, null, 8, ["pageContext", "configure"]);
|
|
74
|
+
}), 128))
|
|
75
|
+
], 6)
|
|
76
|
+
]);
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
});
|
|
32
80
|
export {
|
|
33
|
-
|
|
81
|
+
_sfc_main as default
|
|
34
82
|
};
|
|
@@ -1,67 +1,184 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { getFormModelFields
|
|
5
|
-
import { generateCodeByRule
|
|
6
|
-
import { setVariableValue
|
|
7
|
-
import { handleEvent
|
|
8
|
-
import
|
|
9
|
-
import { $t
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
try {
|
|
28
|
-
v(I.value, e4, { format: Q.value });
|
|
29
|
-
} catch (e5) {
|
|
1
|
+
import { defineComponent, computed, ref, onMounted, watch, resolveComponent, createBlock, openBlock, normalizeStyle, normalizeClass, unref, withCtx, createElementBlock, createCommentVNode, toDisplayString } from "vue";
|
|
2
|
+
import qrcode from "qrcode";
|
|
3
|
+
import JsBarcode from "jsbarcode";
|
|
4
|
+
import { getFormModelFields } from "../../../../utils/page-init-util.js";
|
|
5
|
+
import { generateCodeByRule } from "../../../../utils/barcode-util.js";
|
|
6
|
+
import { setVariableValue, getVariableValue } from "../../../../utils/page-helper-util.js";
|
|
7
|
+
import { handleEvent } from "../../../../utils/events/event-util.js";
|
|
8
|
+
import http from "agilebuilder-ui/src/utils/request";
|
|
9
|
+
import { $t } from "../../../../utils/i18n-util.js";
|
|
10
|
+
const _hoisted_1 = ["src"];
|
|
11
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
+
__name: "barcode-runtime",
|
|
13
|
+
props: {
|
|
14
|
+
pageContext: {},
|
|
15
|
+
configure: {}
|
|
16
|
+
},
|
|
17
|
+
setup(__props, { expose: __expose }) {
|
|
18
|
+
const props = __props;
|
|
19
|
+
const entity = props.pageContext.entity ? props.pageContext.entity : {};
|
|
20
|
+
let dynamicFields = getFormModelFields(props.pageContext, props.configure);
|
|
21
|
+
const dynamicModelMethod = computed({
|
|
22
|
+
get() {
|
|
23
|
+
return getVariableValue(entity, dynamicFields);
|
|
24
|
+
},
|
|
25
|
+
set(value) {
|
|
26
|
+
setVariableValue(entity, dynamicFields, value);
|
|
30
27
|
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
28
|
+
});
|
|
29
|
+
const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
|
|
30
|
+
const designProperty = ref(runtimeInfo.props ? runtimeInfo.props : {});
|
|
31
|
+
const runtimeStyle = runtimeInfo.style;
|
|
32
|
+
const runtimeClass = runtimeInfo.class;
|
|
33
|
+
const headerStyle = runtimeInfo.headerStyle;
|
|
34
|
+
const qrUrl = ref("");
|
|
35
|
+
const barcode = ref(null);
|
|
36
|
+
const barcodeFormat = ref(designProperty.value.brCodeFormat ?? "CODE128");
|
|
37
|
+
const watchVariableNames = ref([]);
|
|
38
|
+
onMounted(() => {
|
|
39
|
+
if (designProperty.value.generateRule) {
|
|
40
|
+
if (designProperty.value.generateRuleType === "fixed") {
|
|
41
|
+
handleFixedFormat();
|
|
42
|
+
} else {
|
|
43
|
+
handleSelectedRule();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (dynamicModelMethod.value) {
|
|
47
|
+
createCode(dynamicModelMethod.value);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
function getValue() {
|
|
51
|
+
return getVariableValue(entity, dynamicFields);
|
|
52
|
+
}
|
|
53
|
+
function setValue(value) {
|
|
54
|
+
return setVariableValue(entity, dynamicFields, value);
|
|
55
|
+
}
|
|
56
|
+
function handleFixedFormat() {
|
|
57
|
+
watchVariableNames.value = Array.from(
|
|
58
|
+
designProperty.value.generateRule.matchAll(/\$\{(\w+)\}/g),
|
|
59
|
+
(m) => m[1]
|
|
60
|
+
);
|
|
61
|
+
watchVariableNames.value.forEach((name) => {
|
|
62
|
+
watch(
|
|
63
|
+
() => props.pageContext.entity.data[name],
|
|
64
|
+
(newValue, oldValue) => {
|
|
65
|
+
if (newValue !== void 0 && newValue !== null) {
|
|
66
|
+
generateFixedFormatCode();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
);
|
|
45
70
|
});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
71
|
+
}
|
|
72
|
+
function handleSelectedRule() {
|
|
73
|
+
http.get(
|
|
74
|
+
window["$vueApp"].config.globalProperties.baseAPI + "/dc/setting-barcode-models/by-code/" + designProperty.value.generateRule
|
|
75
|
+
).then((res) => {
|
|
76
|
+
const rule = JSON.parse(res.barcodeModelItems);
|
|
77
|
+
rule.forEach((item) => {
|
|
78
|
+
if (item.propDbName !== "-1" && item.propDbName !== -1) {
|
|
79
|
+
watchVariableNames.value.push(item.propDbName);
|
|
80
|
+
watch(
|
|
81
|
+
() => props.pageContext.entity.data[item.propDbName],
|
|
82
|
+
(newValue, oldValue) => {
|
|
83
|
+
if (newValue !== void 0 && newValue !== null) {
|
|
84
|
+
const codeValue = generateCodeByRule(rule, props.pageContext.entity.data);
|
|
85
|
+
if (codeValue) {
|
|
86
|
+
generateCode(codeValue);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
);
|
|
53
91
|
}
|
|
54
|
-
})
|
|
92
|
+
});
|
|
93
|
+
}).catch((error) => {
|
|
94
|
+
console.error("获取条码规则失败:", error);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function generateFixedFormatCode() {
|
|
98
|
+
let allVariablesPresent = true;
|
|
99
|
+
watchVariableNames.value.forEach((name) => {
|
|
100
|
+
if (!props.pageContext.entity.data[name]) {
|
|
101
|
+
allVariablesPresent = false;
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
55
104
|
});
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
105
|
+
if (allVariablesPresent) {
|
|
106
|
+
let barCodeValue = replaceVariables(
|
|
107
|
+
designProperty.value.generateRule,
|
|
108
|
+
props.pageContext.entity.data
|
|
109
|
+
);
|
|
110
|
+
generateCode(barCodeValue);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function generateCode(value) {
|
|
114
|
+
createCode(value);
|
|
115
|
+
setValue(value);
|
|
116
|
+
handleEvent(value, props.pageContext, props.configure, "change", {
|
|
117
|
+
entity
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function createCode(value) {
|
|
121
|
+
if (designProperty.value.type === "QR-code") {
|
|
122
|
+
createQrCode(value);
|
|
123
|
+
} else {
|
|
124
|
+
createBarCode(value);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function createBarCode(codeValue) {
|
|
128
|
+
try {
|
|
129
|
+
JsBarcode(barcode.value, codeValue, { format: barcodeFormat.value });
|
|
130
|
+
} catch (error) {
|
|
131
|
+
console.error("生成条形码时发生错误:", error);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
function createQrCode(codeValue) {
|
|
135
|
+
qrcode.toDataURL(codeValue, (err, url) => {
|
|
136
|
+
if (err) {
|
|
137
|
+
console.error(err);
|
|
138
|
+
} else {
|
|
139
|
+
qrUrl.value = url;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
function replaceVariables(template, variables) {
|
|
144
|
+
const regex = /\$\{(\w+)\}/g;
|
|
145
|
+
return template.replace(regex, (match, keyword) => {
|
|
146
|
+
return variables.hasOwnProperty(keyword) ? variables[keyword] : match;
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
__expose({
|
|
150
|
+
getValue,
|
|
151
|
+
setValue
|
|
152
|
+
});
|
|
153
|
+
return (_ctx, _cache) => {
|
|
154
|
+
const _component_el_form_item = resolveComponent("el-form-item");
|
|
155
|
+
return openBlock(), createBlock(_component_el_form_item, {
|
|
156
|
+
required: designProperty.value.required ? true : false,
|
|
157
|
+
class: normalizeClass(unref(runtimeClass)),
|
|
158
|
+
"label-width": designProperty.value.labelWidth,
|
|
159
|
+
style: normalizeStyle(unref(runtimeStyle))
|
|
160
|
+
}, {
|
|
161
|
+
label: withCtx(() => [
|
|
162
|
+
designProperty.value.tittleShow ? (openBlock(), createElementBlock("div", {
|
|
163
|
+
key: 0,
|
|
164
|
+
style: normalizeStyle({ ...unref(headerStyle) })
|
|
165
|
+
}, toDisplayString(unref($t)(designProperty.value.title)), 5)) : createCommentVNode("", true)
|
|
166
|
+
]),
|
|
167
|
+
default: withCtx(() => [
|
|
168
|
+
designProperty.value.type === "QR-code" ? (openBlock(), createElementBlock("img", {
|
|
169
|
+
key: 0,
|
|
170
|
+
src: qrUrl.value
|
|
171
|
+
}, null, 8, _hoisted_1)) : (openBlock(), createElementBlock("canvas", {
|
|
172
|
+
key: 1,
|
|
173
|
+
ref_key: "barcode",
|
|
174
|
+
ref: barcode
|
|
175
|
+
}, null, 512))
|
|
176
|
+
]),
|
|
177
|
+
_: 1
|
|
178
|
+
}, 8, ["required", "class", "label-width", "style"]);
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
});
|
|
65
182
|
export {
|
|
66
|
-
|
|
183
|
+
_sfc_main as default
|
|
67
184
|
};
|