super-page-runtime 2.0.25 → 2.0.28
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/runtime/utils/api/api-util.js +9 -1
- package/dist/es/components/runtime/utils/assemblys-config.js +6 -0
- package/dist/es/components/runtime/utils/barcode-util.d.ts +8 -0
- package/dist/es/components/runtime/utils/barcode-util.js +36 -0
- package/dist/es/components/runtime/utils/common-util.js +1 -1
- package/dist/es/components/runtime/utils/events/event-util.js +1 -12
- package/dist/es/components/runtime/utils/events/print-label.d.ts +5 -0
- package/dist/es/components/runtime/utils/events/print-label.js +153 -0
- package/dist/es/components/runtime/utils/events/standard-event.d.ts +2 -0
- package/dist/es/components/runtime/utils/events/standard-event.js +61 -27
- package/dist/es/components/runtime/utils/page-helper-util.js +1 -0
- package/dist/es/components/runtime/utils/page-init-util.d.ts +1 -1
- package/dist/es/components/runtime/utils/page-init-util.js +16 -7
- package/dist/es/components/runtime/utils/table-utils.js +1 -10
- package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue.js +4 -0
- package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js +96 -0
- package/dist/es/components/runtime/views/assemblys/container/flex/flex-runtime.vue2.js +1 -1
- package/dist/es/components/runtime/views/assemblys/data/bar-code/barcode-runtime.vue2.js +5 -33
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +4 -3
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +15 -9
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +3 -2
- package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js +25 -1
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +77 -39
- package/dist/es/components/runtime/views/assemblys/object-render.vue.js +1 -1
- package/dist/es/components/runtime/views/super-page-dialog.vue.js +3 -0
- package/dist/es/components/runtime/views/super-page.vue.js +49 -39
- package/dist/es/i18n/langs/cn.js +54 -0
- package/dist/es/i18n/langs/en.js +54 -0
- package/dist/es/index.d.ts +3 -0
- package/dist/es/index.js +4 -0
- package/package.json +4 -3
package/dist/es/components/runtime/views/assemblys/button/print-label/printlabel-runtime.vue2.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { defineComponent, ref, resolveComponent, openBlock, createBlock, normalizeClass, unref, normalizeStyle, withCtx, createVNode, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString } from "vue";
|
|
2
|
+
import "agilebuilder-ui";
|
|
3
|
+
import { handleEvent } from "../../../../utils/events/event-util.js";
|
|
4
|
+
import _sfc_main$1 from "../button/button-runtime.vue2.js";
|
|
5
|
+
const _hoisted_1 = { key: 1 };
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "printlabel-runtime",
|
|
8
|
+
props: {
|
|
9
|
+
pageContext: {},
|
|
10
|
+
configure: {}
|
|
11
|
+
},
|
|
12
|
+
setup(__props) {
|
|
13
|
+
const props = __props;
|
|
14
|
+
const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
|
|
15
|
+
const designProperty = ref(runtimeInfo.props ? runtimeInfo.props : {});
|
|
16
|
+
const showDropdown = ref(false);
|
|
17
|
+
if (designProperty.value.template && designProperty.value.template.length > 1) {
|
|
18
|
+
showDropdown.value = true;
|
|
19
|
+
}
|
|
20
|
+
const runtimeStyle = runtimeInfo.style;
|
|
21
|
+
const runtimeClass = runtimeInfo.class;
|
|
22
|
+
return (_ctx, _cache) => {
|
|
23
|
+
const _component_el_button = resolveComponent("el-button");
|
|
24
|
+
const _component_ArrowDown = resolveComponent("ArrowDown");
|
|
25
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
26
|
+
const _component_el_text = resolveComponent("el-text");
|
|
27
|
+
const _component_el_dropdown_item = resolveComponent("el-dropdown-item");
|
|
28
|
+
const _component_el_dropdown_menu = resolveComponent("el-dropdown-menu");
|
|
29
|
+
const _component_el_dropdown = resolveComponent("el-dropdown");
|
|
30
|
+
return !showDropdown.value ? (openBlock(), createBlock(_sfc_main$1, {
|
|
31
|
+
key: 0,
|
|
32
|
+
configure: _ctx.configure,
|
|
33
|
+
pageContext: _ctx.pageContext
|
|
34
|
+
}, null, 8, ["configure", "pageContext"])) : (openBlock(), createBlock(_component_el_dropdown, {
|
|
35
|
+
key: 1,
|
|
36
|
+
class: normalizeClass(unref(runtimeClass)),
|
|
37
|
+
style: normalizeStyle(unref(runtimeStyle)),
|
|
38
|
+
placement: designProperty.value.placement,
|
|
39
|
+
"split-button": designProperty.value.splitButton,
|
|
40
|
+
disabled: designProperty.value.state === "disabled",
|
|
41
|
+
type: designProperty.value.buttonType,
|
|
42
|
+
size: designProperty.value.size,
|
|
43
|
+
trigger: designProperty.value.trigger
|
|
44
|
+
}, {
|
|
45
|
+
dropdown: withCtx(() => [
|
|
46
|
+
createVNode(_component_el_dropdown_menu, null, {
|
|
47
|
+
default: withCtx(() => [
|
|
48
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(designProperty.value.template, (item, index) => {
|
|
49
|
+
return openBlock(), createBlock(_component_el_dropdown_item, {
|
|
50
|
+
key: item,
|
|
51
|
+
onClick: ($event) => unref(handleEvent)($event, _ctx.pageContext, _ctx.configure, "click", { menuItem: item })
|
|
52
|
+
}, {
|
|
53
|
+
default: withCtx(() => [
|
|
54
|
+
createTextVNode(toDisplayString(item.label), 1)
|
|
55
|
+
]),
|
|
56
|
+
_: 2
|
|
57
|
+
}, 1032, ["onClick"]);
|
|
58
|
+
}), 128))
|
|
59
|
+
]),
|
|
60
|
+
_: 1
|
|
61
|
+
})
|
|
62
|
+
]),
|
|
63
|
+
default: withCtx(() => [
|
|
64
|
+
designProperty.value.triggerElement === "button" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
65
|
+
!designProperty.value.splitButton ? (openBlock(), createBlock(_component_el_button, {
|
|
66
|
+
key: 0,
|
|
67
|
+
size: designProperty.value.size,
|
|
68
|
+
type: designProperty.value.buttonType,
|
|
69
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(handleEvent)($event, _ctx.pageContext, _ctx.configure, "menuClick"))
|
|
70
|
+
}, {
|
|
71
|
+
default: withCtx(() => [
|
|
72
|
+
createTextVNode(toDisplayString(designProperty.value.title), 1)
|
|
73
|
+
]),
|
|
74
|
+
_: 1
|
|
75
|
+
}, 8, ["size", "type"])) : (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(designProperty.value.title), 1))
|
|
76
|
+
], 64)) : (openBlock(), createBlock(_component_el_text, { key: 1 }, {
|
|
77
|
+
default: withCtx(() => [
|
|
78
|
+
createTextVNode(toDisplayString(designProperty.value.title) + " ", 1),
|
|
79
|
+
createVNode(_component_el_icon, null, {
|
|
80
|
+
default: withCtx(() => [
|
|
81
|
+
createVNode(_component_ArrowDown)
|
|
82
|
+
]),
|
|
83
|
+
_: 1
|
|
84
|
+
})
|
|
85
|
+
]),
|
|
86
|
+
_: 1
|
|
87
|
+
}))
|
|
88
|
+
]),
|
|
89
|
+
_: 1
|
|
90
|
+
}, 8, ["class", "style", "placement", "split-button", "disabled", "type", "size", "trigger"]));
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
export {
|
|
95
|
+
_sfc_main as default
|
|
96
|
+
};
|
|
@@ -22,7 +22,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
22
22
|
justify: designProperty.value.flexJustify,
|
|
23
23
|
gutter: designProperty.value.flexGutter,
|
|
24
24
|
align: designProperty.value.alignItems,
|
|
25
|
-
style: normalizeStyle(unref(runtimeStyle)),
|
|
25
|
+
style: normalizeStyle([{ "display": "flex" }, unref(runtimeStyle)]),
|
|
26
26
|
class: normalizeClass(unref(runtimeClass))
|
|
27
27
|
}, {
|
|
28
28
|
default: withCtx(() => [
|
|
@@ -2,6 +2,7 @@ import { defineComponent, computed, ref, onMounted, watch, resolveComponent, ope
|
|
|
2
2
|
import qrcode from "qrcode";
|
|
3
3
|
import JsBarcode from "jsbarcode";
|
|
4
4
|
import { getFormModelFields } from "../../../../utils/page-init-util.js";
|
|
5
|
+
import { generateCodeByRule } from "../../../../utils/barcode-util.js";
|
|
5
6
|
import { getVariableValue, setVariableValue } from "../../../../utils/page-helper-util.js";
|
|
6
7
|
import { handleEvent } from "../../../../utils/events/event-util.js";
|
|
7
8
|
import "agilebuilder-ui/src/utils/request";
|
|
@@ -78,7 +79,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
78
79
|
() => props.pageContext.entity.data[item.fieldName],
|
|
79
80
|
(newValue, oldValue) => {
|
|
80
81
|
if (newValue !== void 0 && newValue !== null) {
|
|
81
|
-
generateCodeByRule(rule);
|
|
82
|
+
const codeValue = generateCodeByRule(rule, props.pageContext.entity.data);
|
|
83
|
+
if (codeValue) {
|
|
84
|
+
generateCode(codeValue);
|
|
85
|
+
}
|
|
82
86
|
}
|
|
83
87
|
}
|
|
84
88
|
);
|
|
@@ -101,38 +105,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
101
105
|
generateCode(barCodeValue);
|
|
102
106
|
}
|
|
103
107
|
}
|
|
104
|
-
function generateCodeByRule(rule) {
|
|
105
|
-
let allVariablesPresent = true;
|
|
106
|
-
let value = "";
|
|
107
|
-
rule.forEach((item) => {
|
|
108
|
-
if (item.fieldName !== "-1" && item.fieldName !== -1) {
|
|
109
|
-
const filedValue = props.pageContext.entity.data[item.fieldName];
|
|
110
|
-
if (item.suppliement && item.fieldLength) {
|
|
111
|
-
if (!filedValue) {
|
|
112
|
-
value += "".padEnd(item.fieldLength, item.suppliement);
|
|
113
|
-
} else {
|
|
114
|
-
if (filedValue.length > item.fieldLength) {
|
|
115
|
-
value += filedValue.substring(0, item.fieldLength);
|
|
116
|
-
} else {
|
|
117
|
-
value += filedValue.padEnd(item.fieldLength, item.suppliement);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
} else {
|
|
121
|
-
if (!filedValue) {
|
|
122
|
-
allVariablesPresent = false;
|
|
123
|
-
} else {
|
|
124
|
-
value += filedValue;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
} else {
|
|
128
|
-
value += item.fixedValue;
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
console.log(value);
|
|
132
|
-
if (allVariablesPresent) {
|
|
133
|
-
generateCode(value);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
108
|
function generateCode(value) {
|
|
137
109
|
createCode(value);
|
|
138
110
|
setValue(value);
|
|
@@ -4,7 +4,7 @@ import { setTableEvents, getEventFuncByType, canExecuteButton, doAfterClickEvent
|
|
|
4
4
|
import { getListCode, getRealRestApiPath } from "../../../../utils/common-util.js";
|
|
5
5
|
import { getAdditionalParamMap, getSaveFormRequestWithRow, standardEvents } from "../../../../utils/events/standard-event.js";
|
|
6
6
|
import { isPromise } from "agilebuilder-ui/src/utils/common-util";
|
|
7
|
-
import {
|
|
7
|
+
import { getDataTypeMapRequest, popupToPage } from "../../../../utils/table-utils.js";
|
|
8
8
|
import eventBus from "../../../../utils/eventBus.js";
|
|
9
9
|
import { getPermissionCodes } from "../../../../utils/page-init-util.js";
|
|
10
10
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -22,7 +22,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
22
22
|
const runtimeClass = runtimeInfo.class;
|
|
23
23
|
const systemCode = pageContext.systemCode;
|
|
24
24
|
const backendUrl = pageContext.backendUrl;
|
|
25
|
-
|
|
25
|
+
debugger;
|
|
26
|
+
const tableName = configure.props && configure.props.dataOrigin && configure.props.dataOrigin.tableName;
|
|
26
27
|
let baseURL = pageContext.backendUrl;
|
|
27
28
|
if (!baseURL) {
|
|
28
29
|
baseURL = window["$vueApp"].config.globalProperties.baseURL;
|
|
@@ -155,7 +156,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
155
156
|
if (!backendUrl && !tableName) {
|
|
156
157
|
return;
|
|
157
158
|
}
|
|
158
|
-
|
|
159
|
+
getDataTypeMapRequest(backendUrl, tableName).then((result) => {
|
|
159
160
|
if (!pageContext["dataTypeMaps"]) {
|
|
160
161
|
pageContext["dataTypeMaps"] = {};
|
|
161
162
|
}
|
|
@@ -16,8 +16,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
16
16
|
const props = __props;
|
|
17
17
|
const pageContext = props.pageContext;
|
|
18
18
|
const configure = props.configure;
|
|
19
|
+
const listCode = getListCode(pageContext.code, pageContext.version, configure.uuid);
|
|
19
20
|
const dataModel = pageContext.entity.data;
|
|
20
|
-
const prop =
|
|
21
|
+
const prop = listCode;
|
|
21
22
|
const additionalParamMap = getAdditionalParamMap(pageContext);
|
|
22
23
|
const tableEvents = configure.runtime && configure.runtime.events ? configure.runtime.events : [];
|
|
23
24
|
const selections = ref([]);
|
|
@@ -28,7 +29,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
28
29
|
const runtimeStyle = runtimeInfo.style;
|
|
29
30
|
const runtimeClass = runtimeInfo.class;
|
|
30
31
|
const entity = props.pageContext.entity ? props.pageContext.entity : {};
|
|
31
|
-
let dynamicFields = getFormModelFields(props.pageContext, props.configure);
|
|
32
|
+
let dynamicFields = getFormModelFields(props.pageContext, props.configure, prop);
|
|
32
33
|
const listViewShowFlag = ref(false);
|
|
33
34
|
const baseURL = window["$vueApp"].config.globalProperties.baseURL;
|
|
34
35
|
const listViewOptions = ref({
|
|
@@ -50,13 +51,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
50
51
|
if (runtimeClass) {
|
|
51
52
|
listViewOptions.value["tableClass"] = runtimeClass;
|
|
52
53
|
}
|
|
53
|
-
if (configure.props && configure.props.base && configure.props.base.subPaging ===
|
|
54
|
-
listViewOptions.value.showPageArea = false;
|
|
55
|
-
} else {
|
|
54
|
+
if (configure.props && configure.props.base && configure.props.base.subPaging === true) {
|
|
56
55
|
listViewOptions.value.showPageArea = true;
|
|
56
|
+
} else {
|
|
57
|
+
listViewOptions.value.showPageArea = false;
|
|
57
58
|
}
|
|
58
59
|
const gridRef = ref(null);
|
|
59
|
-
const listCode = getListCode(pageContext.code, pageContext.version, configure.uuid);
|
|
60
60
|
function currencyListViewSetting(canRrefreshSubtableData) {
|
|
61
61
|
if (canRrefreshSubtableData === void 0) {
|
|
62
62
|
canRrefreshSubtableData = judgeInitializationSubTable();
|
|
@@ -115,11 +115,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
115
115
|
return getVariableValue(entity, dynamicFields);
|
|
116
116
|
}
|
|
117
117
|
function changeInitializationSubTable(canRrefreshSubtableData) {
|
|
118
|
+
debugger;
|
|
118
119
|
currencyListViewSetting(canRrefreshSubtableData);
|
|
119
120
|
listViewOptions.value["isPageInfo"] = false;
|
|
120
|
-
listViewOptions.value["subTableData"] =
|
|
121
|
+
listViewOptions.value["subTableData"] = getValue();
|
|
121
122
|
listViewOptions.value.extraParam["subTableListViewCode"] = listCode;
|
|
122
|
-
listViewOptions.value.extraParam["subtableSetting"] = configure.props
|
|
123
|
+
listViewOptions.value.extraParam["subtableSetting"] = configure.props && configure.props.otherSettings ? JSON.stringify(configure.props.otherSettings.subtableSetting) : null;
|
|
123
124
|
listViewOptions.value.extraParam["additionalParamMap"] = additionalParamMap;
|
|
124
125
|
listViewOptions.value.extraParam["entityMap"] = pageContext.entity.data;
|
|
125
126
|
setGridDataEventOptions();
|
|
@@ -129,7 +130,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
129
130
|
setGridToStore();
|
|
130
131
|
}, 10);
|
|
131
132
|
}
|
|
132
|
-
changeInitializationSubTable();
|
|
133
133
|
function setGridDataEventOptions() {
|
|
134
134
|
setSubTableValidateInfo();
|
|
135
135
|
setTableEvents(listViewOptions.value, tableEvents, pageContext, configure);
|
|
@@ -164,6 +164,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
164
164
|
}
|
|
165
165
|
listViewOptions.value["actionPermission"] = actionPermission;
|
|
166
166
|
}
|
|
167
|
+
if (!listViewOptions.value["operations"]) {
|
|
168
|
+
listViewOptions.value["operations"] = {};
|
|
169
|
+
}
|
|
167
170
|
const subTableOperations = getOperations();
|
|
168
171
|
listViewOptions.value["operations"]["operation"] = subTableOperations;
|
|
169
172
|
listViewOptions.value["subTableCanAdd"] = isShowAdd();
|
|
@@ -175,6 +178,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
175
178
|
pageContext.tableUuids.push(configure.uuid);
|
|
176
179
|
}
|
|
177
180
|
function getOperations() {
|
|
181
|
+
debugger;
|
|
178
182
|
let operations = [];
|
|
179
183
|
if (isShowAdd()) {
|
|
180
184
|
const addButton = {
|
|
@@ -207,6 +211,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
207
211
|
}
|
|
208
212
|
return operations;
|
|
209
213
|
}
|
|
214
|
+
changeInitializationSubTable();
|
|
210
215
|
function getEntityId(row) {
|
|
211
216
|
if (row && row.id) {
|
|
212
217
|
return row.id;
|
|
@@ -281,6 +286,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
281
286
|
gridRef.value.deleteRow(rowIndex, listCode, false);
|
|
282
287
|
}
|
|
283
288
|
function changeGridData(gridData) {
|
|
289
|
+
debugger;
|
|
284
290
|
setVariableValue(entity, dynamicFields, gridData);
|
|
285
291
|
}
|
|
286
292
|
function changeRowsPerpage(pageSize) {
|
|
@@ -19,7 +19,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
19
19
|
const tableUuid = props.configure.uuid;
|
|
20
20
|
const superGridItems = props.pageContext.superGridItems;
|
|
21
21
|
const superGridSetting = superGridItems ? superGridItems[tableUuid] : null;
|
|
22
|
-
tableConfigure.value = superGridSetting.configure ? JSON.parse(superGridSetting.configure) : null;
|
|
22
|
+
tableConfigure.value = superGridSetting ? superGridSetting.configure ? JSON.parse(superGridSetting.configure) : null : props.configure;
|
|
23
|
+
debugger;
|
|
23
24
|
const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
|
|
24
25
|
runtimeInfo.style;
|
|
25
26
|
runtimeInfo.class;
|
|
@@ -71,7 +72,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
71
72
|
ref_key: "gridRef",
|
|
72
73
|
ref: gridRef,
|
|
73
74
|
pageContext: _ctx.pageContext,
|
|
74
|
-
configure:
|
|
75
|
+
configure: tableConfigure.value
|
|
75
76
|
}, null, 8, ["pageContext", "configure"])) : (openBlock(), createBlock(_sfc_main$2, {
|
|
76
77
|
key: 1,
|
|
77
78
|
ref_key: "gridRef",
|
package/dist/es/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue2.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, computed, ref, resolveComponent, openBlock, createBlock, normalizeClass, unref, normalizeStyle, withCtx, createElementBlock, toDisplayString, createCommentVNode } from "vue";
|
|
2
2
|
import { getFormModelFields } from "../../../../utils/page-init-util.js";
|
|
3
3
|
import { getVariableValue, setVariableValue } from "../../../../utils/page-helper-util.js";
|
|
4
|
-
import { handleEvent } from "../../../../utils/events/event-util.js";
|
|
4
|
+
import { getCustomFunc, handleEvent } from "../../../../utils/events/event-util.js";
|
|
5
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
6
|
__name: "datepicker-runtime",
|
|
7
7
|
props: {
|
|
@@ -25,6 +25,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
25
25
|
const runtimeClass = runtimeInfo.class;
|
|
26
26
|
const headerStyle = runtimeInfo.headerStyle;
|
|
27
27
|
const designProperty = ref(runtimeInfo.props ? runtimeInfo.props : {});
|
|
28
|
+
if (designProperty.value.shortcutsFunc) {
|
|
29
|
+
const func = getCustomFunc(props.pageContext, designProperty.value.shortcutsFunc);
|
|
30
|
+
if (func) {
|
|
31
|
+
let returns = func.apply(func, [
|
|
32
|
+
{
|
|
33
|
+
pageContext: props.pageContext,
|
|
34
|
+
configureObj: props.configure
|
|
35
|
+
}
|
|
36
|
+
]);
|
|
37
|
+
if (returns) {
|
|
38
|
+
if (typeof returns === "object") {
|
|
39
|
+
returns = [returns];
|
|
40
|
+
}
|
|
41
|
+
if (!designProperty.value.shortcuts) {
|
|
42
|
+
designProperty.value.shortcuts = [];
|
|
43
|
+
}
|
|
44
|
+
for (let r of returns) {
|
|
45
|
+
if (r.text && r.value) {
|
|
46
|
+
designProperty.value.shortcuts.push(r);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
28
52
|
return (_ctx, _cache) => {
|
|
29
53
|
const _component_el_time_picker = resolveComponent("el-time-picker");
|
|
30
54
|
const _component_el_date_picker = resolveComponent("el-date-picker");
|
package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { defineComponent, ref,
|
|
1
|
+
import { defineComponent, ref, resolveComponent, openBlock, createBlock, normalizeClass, unref, normalizeStyle, withCtx, createElementBlock, toDisplayString, createCommentVNode, createVNode } from "vue";
|
|
2
2
|
import { getVariableValue, setVariableValue } from "../../../../utils/page-helper-util.js";
|
|
3
|
-
import { fileUploadBeforeUpload
|
|
3
|
+
import { fileUploadBeforeUpload } from "../../../../utils/events/event-util.js";
|
|
4
|
+
import http from "agilebuilder-ui/src/utils/request";
|
|
5
|
+
import FsUploadNew from "agilebuilder-ui";
|
|
4
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
7
|
__name: "fileupload-runtime",
|
|
6
8
|
props: {
|
|
@@ -14,25 +16,36 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
14
16
|
const runtimeStyle = runtimeInfo.style;
|
|
15
17
|
const runtimeClass = runtimeInfo.class;
|
|
16
18
|
const headerStyle = runtimeInfo.headerStyle;
|
|
17
|
-
const fileSetObj = designProperty.value.fileSetObj;
|
|
18
|
-
fileSetObj.beforeUpload = beforeUpload;
|
|
19
|
-
fileSetObj.pageContext = props.pageContext;
|
|
20
|
-
fileSetObj.configureObj = props.configure;
|
|
21
19
|
const entity = props.pageContext.entity ? props.pageContext.entity : {};
|
|
22
20
|
const propsBase = props.configure.props.base ? props.configure.props.base : {};
|
|
23
|
-
propsBase.prop;
|
|
24
21
|
const pathFields = getFieldsByVariable(propsBase.prop);
|
|
25
22
|
const nameFields = getFieldsByVariable(propsBase.propName);
|
|
26
|
-
const initNames = getVariableValue(entity, nameFields);
|
|
27
23
|
const initPaths = getVariableValue(entity, pathFields);
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
24
|
+
const fileList = ref([]);
|
|
25
|
+
const fileInfo = ref({});
|
|
26
|
+
const baseURL = window.$vueApp.config.globalProperties.baseURL;
|
|
27
|
+
const baseAPI = window.$vueApp.config.globalProperties.baseAPI;
|
|
28
|
+
let url = baseURL;
|
|
29
|
+
if (!isPlateSys(props.pageContext.systemCode)) {
|
|
30
|
+
url = baseAPI;
|
|
31
|
+
}
|
|
32
|
+
if (initPaths) {
|
|
33
|
+
const uuids = initPaths.split(",");
|
|
34
|
+
if (uuids.length > 0) {
|
|
35
|
+
http.post(url + "/common/fs-upload/search-file-names").then((result) => {
|
|
36
|
+
const names = [];
|
|
37
|
+
for (let index = 0; index < uuids.length; index++) {
|
|
38
|
+
const uuid = uuids[index];
|
|
39
|
+
names.push(result[uuid]);
|
|
40
|
+
fileList.value.push({ showName: result[uuid], serverPath: uuid });
|
|
41
|
+
}
|
|
42
|
+
if (designProperty.value.displayType === "input") {
|
|
43
|
+
fileInfo.value.showName = names.join(",");
|
|
44
|
+
fileInfo.value.serverPath = uuids.join(",");
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
36
49
|
function getFieldsByVariable(variableName) {
|
|
37
50
|
if (!variableName) {
|
|
38
51
|
return [];
|
|
@@ -45,17 +58,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
45
58
|
function beforeUpload(params) {
|
|
46
59
|
return fileUploadBeforeUpload(params);
|
|
47
60
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
61
|
+
const onSuccess = (response, uploadFile, uploadFiles) => {
|
|
62
|
+
updateValue();
|
|
63
|
+
};
|
|
64
|
+
const onRemove = (file) => {
|
|
65
|
+
updateValue();
|
|
66
|
+
};
|
|
67
|
+
const updateValue = () => {
|
|
68
|
+
const names = [];
|
|
69
|
+
const uuids = [];
|
|
70
|
+
for (let index = 0; index < fileList.value.length; index++) {
|
|
71
|
+
names.push(fileList.value[index].showName);
|
|
72
|
+
uuids.push(fileList.value[index].serverPath);
|
|
73
|
+
}
|
|
74
|
+
setVariableValue(props.pageContext.entity, pathFields, uuids.join(","));
|
|
75
|
+
setVariableValue(props.pageContext.entity, nameFields, names.join(","));
|
|
76
|
+
};
|
|
77
|
+
function isPlateSys(systemCode) {
|
|
78
|
+
if (systemCode && (systemCode === "agilebuilder" || systemCode === "portal" || systemCode === "mms" || systemCode === "task" || systemCode === "wf" || systemCode === "dc" || systemCode === "mc" || systemCode === "mobile" || systemCode === "acs" || systemCode === "bs" || systemCode === "pcm")) {
|
|
79
|
+
return true;
|
|
80
|
+
} else {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
56
83
|
}
|
|
57
84
|
return (_ctx, _cache) => {
|
|
58
|
-
const _component_FsUploadList = resolveComponent("FsUploadList");
|
|
59
85
|
const _component_el_form_item = resolveComponent("el-form-item");
|
|
60
86
|
return designProperty.value.tittleShow ? (openBlock(), createBlock(_component_el_form_item, {
|
|
61
87
|
key: 0,
|
|
@@ -71,25 +97,37 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
71
97
|
}, toDisplayString(designProperty.value.title), 5)) : createCommentVNode("", true)
|
|
72
98
|
]),
|
|
73
99
|
default: withCtx(() => [
|
|
74
|
-
createVNode(
|
|
100
|
+
createVNode(unref(FsUploadNew), {
|
|
75
101
|
disabled: designProperty.value.state == "disabled",
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
102
|
+
displayType: designProperty.value.displayType,
|
|
103
|
+
accept: designProperty.value.accept,
|
|
104
|
+
multiple: designProperty.value.multiple,
|
|
105
|
+
placeholder: designProperty.value.placeholder,
|
|
106
|
+
limit: designProperty.value.limit,
|
|
107
|
+
"limit-file-size": designProperty.value.limitFileSize,
|
|
108
|
+
"file-info": fileInfo.value,
|
|
109
|
+
"file-list": fileList.value,
|
|
110
|
+
"on-success": onSuccess,
|
|
111
|
+
"on-remove": onRemove,
|
|
112
|
+
"before-upload": beforeUpload
|
|
113
|
+
}, null, 8, ["disabled", "displayType", "accept", "multiple", "placeholder", "limit", "limit-file-size", "file-info", "file-list"])
|
|
82
114
|
]),
|
|
83
115
|
_: 1
|
|
84
|
-
}, 8, ["required", "class", "label-width", "style"])) : (openBlock(), createBlock(
|
|
116
|
+
}, 8, ["required", "class", "label-width", "style"])) : (openBlock(), createBlock(unref(FsUploadNew), {
|
|
85
117
|
key: 1,
|
|
86
118
|
disabled: designProperty.value.state == "disabled",
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
119
|
+
displayType: designProperty.value.displayType,
|
|
120
|
+
accept: designProperty.value.accept,
|
|
121
|
+
multiple: designProperty.value.multiple,
|
|
122
|
+
placeholder: designProperty.value.placeholder,
|
|
123
|
+
limit: designProperty.value.limit,
|
|
124
|
+
"limit-file-size": designProperty.value.limitFileSize,
|
|
125
|
+
"file-info": fileInfo.value,
|
|
126
|
+
"file-list": fileList.value,
|
|
127
|
+
"on-success": onSuccess,
|
|
128
|
+
"on-remove": onRemove,
|
|
129
|
+
"before-upload": beforeUpload
|
|
130
|
+
}, null, 8, ["disabled", "displayType", "accept", "multiple", "placeholder", "limit", "limit-file-size", "file-info", "file-list"]));
|
|
93
131
|
};
|
|
94
132
|
}
|
|
95
133
|
});
|
|
@@ -142,7 +142,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
142
142
|
pageContext: _ctx.pageContext
|
|
143
143
|
}, null, 8, ["style", "class", "configure", "pageContext"])), [
|
|
144
144
|
[vShow, unref(showFlag)],
|
|
145
|
-
[_directive_permission, unref(permissionCodes)]
|
|
145
|
+
[_directive_permission, unref(permissionCodes) ? unref(permissionCodes) : "true"]
|
|
146
146
|
]);
|
|
147
147
|
};
|
|
148
148
|
}
|
|
@@ -40,6 +40,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
40
40
|
} catch (error) {
|
|
41
41
|
console.error(error);
|
|
42
42
|
}
|
|
43
|
+
if (dataId.value === null || dataId.value === void 0) {
|
|
44
|
+
dataId.value = props.parentPageEventParams["id"];
|
|
45
|
+
}
|
|
43
46
|
}
|
|
44
47
|
pageRequest.value["parentPageCode"] = myJumpPageSetting && myJumpPageSetting["parentPageCode"] ? myJumpPageSetting["parentPageCode"] : null;
|
|
45
48
|
pageRequest.value["parentPageVersion"] = myJumpPageSetting && myJumpPageSetting["parentPageVersion"] ? myJumpPageSetting["parentPageVersion"] : null;
|
|
@@ -173,7 +173,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
173
173
|
parentPageContext.value = params.pageContext;
|
|
174
174
|
parentConfigureObj.value = params.configureObj;
|
|
175
175
|
parentEventParams.value = params.eventParams;
|
|
176
|
-
openDialog(parentConfigureObj.value);
|
|
176
|
+
openDialog(parentConfigureObj.value, parentEventParams.value);
|
|
177
177
|
});
|
|
178
178
|
eventBus.$on(
|
|
179
179
|
eventPageInfo.value + "close-dialog",
|
|
@@ -181,7 +181,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
181
181
|
closeDialog({ isNeedValueMapping, dataModel, sourceTableName });
|
|
182
182
|
}
|
|
183
183
|
);
|
|
184
|
-
getFormData(pageContext.value);
|
|
185
184
|
watch(
|
|
186
185
|
() => pageContext.value.isRefresh,
|
|
187
186
|
(newValue) => {
|
|
@@ -194,6 +193,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
194
193
|
}
|
|
195
194
|
}
|
|
196
195
|
);
|
|
196
|
+
return getFormData(pageContext.value);
|
|
197
197
|
}
|
|
198
198
|
function initOptionDatas(pageContext2, optionConfigs) {
|
|
199
199
|
if (!optionConfigs || optionConfigs.length == 0) {
|
|
@@ -219,28 +219,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
onMounted(() => {
|
|
222
|
-
|
|
223
|
-
pageDesignResult.value = props.pageDesign;
|
|
224
|
-
setTimeout(() => {
|
|
225
|
-
initPageDesign(props.pageDesign);
|
|
226
|
-
if (props.pageDesign.tableRuntimes && Object.keys(props.pageDesign.tableRuntimes).length > 0) {
|
|
227
|
-
queryPageSuperGrids(props.pageDesign, pageContext.value, props.publishVersion).then((superGridItems) => {
|
|
228
|
-
pageContext.value.superGridItems = superGridItems;
|
|
229
|
-
isShowPage.value = true;
|
|
230
|
-
}).catch(() => {
|
|
231
|
-
isShowPage.value = true;
|
|
232
|
-
});
|
|
233
|
-
} else {
|
|
234
|
-
isShowPage.value = true;
|
|
235
|
-
}
|
|
236
|
-
}, 0);
|
|
237
|
-
} else if (props.pageCode) {
|
|
238
|
-
queryPageDesignByCode(props.pageCode).then((result) => {
|
|
239
|
-
pageDesignResult.value = result;
|
|
240
|
-
initPageDesign(result);
|
|
241
|
-
isShowPage.value = true;
|
|
242
|
-
});
|
|
243
|
-
}
|
|
222
|
+
initPage();
|
|
244
223
|
if (thisRef.value) {
|
|
245
224
|
setTimeout(() => {
|
|
246
225
|
const parentNode = thisRef.value.parentNode ? thisRef.value.parentNode : thisRef.value;
|
|
@@ -251,6 +230,36 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
251
230
|
}, 10);
|
|
252
231
|
}
|
|
253
232
|
});
|
|
233
|
+
function initPage() {
|
|
234
|
+
if (props.pageDesign != null) {
|
|
235
|
+
pageDesignResult.value = props.pageDesign;
|
|
236
|
+
setTimeout(() => {
|
|
237
|
+
initPageDesign(props.pageDesign).then(() => {
|
|
238
|
+
if (props.pageDesign.tableRuntimes && Object.keys(props.pageDesign.tableRuntimes).length > 0) {
|
|
239
|
+
queryPageSuperGrids(props.pageDesign, pageContext.value, props.publishVersion).then((superGridItems) => {
|
|
240
|
+
pageContext.value.superGridItems = superGridItems;
|
|
241
|
+
isShowPage.value = true;
|
|
242
|
+
}).catch(() => {
|
|
243
|
+
isShowPage.value = true;
|
|
244
|
+
});
|
|
245
|
+
} else {
|
|
246
|
+
isShowPage.value = true;
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
}, 0);
|
|
250
|
+
} else if (props.pageCode) {
|
|
251
|
+
queryPageDesignByCode(props.pageCode).then((appPageDesign) => {
|
|
252
|
+
if (appPageDesign && appPageDesign.designJson) {
|
|
253
|
+
const designJson = appPageDesign.designJson;
|
|
254
|
+
const pageConf = JSON.parse(designJson);
|
|
255
|
+
pageDesignResult.value = pageConf;
|
|
256
|
+
initPageDesign(pageConf).then(() => {
|
|
257
|
+
isShowPage.value = true;
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}
|
|
254
263
|
onUpdated(() => {
|
|
255
264
|
nextTick(() => {
|
|
256
265
|
if (pageContext.value && thisRef.value) {
|
|
@@ -337,16 +346,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
337
346
|
doRemoveSigners(buttonParams.value, selectRemoveTasks);
|
|
338
347
|
}
|
|
339
348
|
const router = useRouter();
|
|
340
|
-
function openDialog(configureObj) {
|
|
349
|
+
function openDialog(configureObj, eventParams) {
|
|
341
350
|
const myJumpPageSetting = configureObj && configureObj["props"] && configureObj["props"].linkPage ? configureObj["props"].linkPage : null;
|
|
342
351
|
if (myJumpPageSetting && myJumpPageSetting.jumpPageUrl) {
|
|
343
352
|
const additionalParamMap = getAdditionalParamMap(pageContext);
|
|
344
|
-
let dataId;
|
|
345
|
-
let ids;
|
|
346
|
-
if (additionalParamMap) {
|
|
347
|
-
dataId = additionalParamMap.id;
|
|
348
|
-
ids = additionalParamMap.ids;
|
|
349
|
-
}
|
|
353
|
+
let dataId = eventParams ? eventParams.id : null;
|
|
354
|
+
let ids = eventParams ? eventParams.ids : null;
|
|
350
355
|
const dataModel = pageContext.value.entity.data;
|
|
351
356
|
const pageModel = pageContext.value.entity.page;
|
|
352
357
|
let entity = {};
|
|
@@ -380,14 +385,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
380
385
|
console.error("页面配置信息不存在");
|
|
381
386
|
}
|
|
382
387
|
}
|
|
383
|
-
function closeDialog(
|
|
384
|
-
if (
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
388
|
+
function closeDialog(params) {
|
|
389
|
+
if (params) {
|
|
390
|
+
const isNeedValueMapping = params.isNeedValueMapping;
|
|
391
|
+
const dataModel = params.dataModel;
|
|
392
|
+
const sourceTableName = params.sourceTableName;
|
|
393
|
+
if (isNeedValueMapping) {
|
|
394
|
+
updateValuesWhenCloseDialog(
|
|
395
|
+
parentPageContext.value,
|
|
396
|
+
parentConfigureObj.value,
|
|
397
|
+
dataModel,
|
|
398
|
+
sourceTableName
|
|
399
|
+
);
|
|
400
|
+
}
|
|
391
401
|
}
|
|
392
402
|
parentPageContext.value = null;
|
|
393
403
|
parentConfigureObj.value = null;
|