super-page-runtime 2.0.44 → 2.0.49-beta1
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/assemblys-config.js +7 -0
- package/dist/es/components/runtime/utils/events/standard-event.js +11 -32
- package/dist/es/components/runtime/utils/events/validator-util.js +6 -26
- package/dist/es/components/runtime/utils/page-helper-util.js +1 -2
- package/dist/es/components/runtime/utils/page-init-util.js +1 -2
- package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +10 -6
- package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +10 -6
- package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue.js +4 -0
- package/dist/es/components/runtime/views/assemblys/data/tree/tree-runtime.vue2.js +48 -0
- package/dist/es/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue2.js +1 -1
- package/dist/es/components/runtime/views/assemblys/form/link/link-runtime.vue2.js +21 -18
- package/dist/es/components/runtime/views/assemblys/form/tag/tag-runtime.vue2.js +67 -26
- package/dist/es/components/runtime/views/super-page.vue.js +2 -5
- package/package.json +2 -2
|
@@ -263,6 +263,13 @@ const assemblyGroups = [
|
|
|
263
263
|
return import("../views/assemblys/data/table/table-runtime.vue.js");
|
|
264
264
|
})
|
|
265
265
|
},
|
|
266
|
+
{
|
|
267
|
+
name: "tree",
|
|
268
|
+
label: "树控件",
|
|
269
|
+
runtimeComponent: defineAsyncComponent(() => {
|
|
270
|
+
return import("../views/assemblys/data/tree/tree-runtime.vue.js");
|
|
271
|
+
})
|
|
272
|
+
},
|
|
266
273
|
{
|
|
267
274
|
name: "bar-code",
|
|
268
275
|
label: "条码",
|
|
@@ -2,7 +2,7 @@ import { getBaseUrl, getRealRestApiPath, upperFirstCase, packageTemplateFiles, d
|
|
|
2
2
|
import http from "agilebuilder-ui/src/utils/request";
|
|
3
3
|
import { getI18n } from "agilebuilder-ui/src/utils/util";
|
|
4
4
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
5
|
-
import { getToken } from "agilebuilder-ui/src/utils/auth";
|
|
5
|
+
import { setSessionCache, getToken } from "agilebuilder-ui/src/utils/auth";
|
|
6
6
|
import { getComponentRef } from "../global-refs.js";
|
|
7
7
|
import eventBus from "../eventBus.js";
|
|
8
8
|
import axios from "axios";
|
|
@@ -275,9 +275,7 @@ function exportFormReport(pageContext, configureObj, templateFile, isPdf) {
|
|
|
275
275
|
const additionalParamMap = getAdditionalParamMap(pageContext);
|
|
276
276
|
param["additionalParamMap"] = additionalParamMap;
|
|
277
277
|
let exportResult;
|
|
278
|
-
|
|
279
|
-
exportResult = exportFormPdf(fileName, backendUrl, param);
|
|
280
|
-
} else {
|
|
278
|
+
{
|
|
281
279
|
exportResult = exportFormReportSuccess(fileName, backendUrl, param);
|
|
282
280
|
}
|
|
283
281
|
if (exportResult) {
|
|
@@ -318,34 +316,6 @@ function exportFormReportSuccess(fileName, backendUrl, param) {
|
|
|
318
316
|
});
|
|
319
317
|
});
|
|
320
318
|
}
|
|
321
|
-
function exportFormPdf(fileName, backendUrl, param) {
|
|
322
|
-
return new Promise((resolve, reject) => {
|
|
323
|
-
const baseUrl = getBaseUrl(backendUrl);
|
|
324
|
-
const path = baseUrl + "/dsc/commons/export-pdf";
|
|
325
|
-
axios.defaults.headers.common.Authorization = getToken();
|
|
326
|
-
const request = axios.post(path, param, {
|
|
327
|
-
headers: {
|
|
328
|
-
"content-type": "application/x-www-form-urlencoded"
|
|
329
|
-
},
|
|
330
|
-
responseType: "blob"
|
|
331
|
-
});
|
|
332
|
-
request.then((response) => {
|
|
333
|
-
const blob = new Blob([response.data]);
|
|
334
|
-
const elink = document.createElement("a");
|
|
335
|
-
elink.download = fileName.substring(0, fileName.lastIndexOf(".")) + ".pdf";
|
|
336
|
-
elink.style.display = "none";
|
|
337
|
-
elink.target = "_blank";
|
|
338
|
-
elink.href = URL.createObjectURL(blob);
|
|
339
|
-
document.body.appendChild(elink);
|
|
340
|
-
elink.click();
|
|
341
|
-
URL.revokeObjectURL(elink.href);
|
|
342
|
-
document.body.removeChild(elink);
|
|
343
|
-
resolve(true);
|
|
344
|
-
}).catch((error) => {
|
|
345
|
-
reject(error);
|
|
346
|
-
});
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
319
|
function saveFunc(params, isListButton) {
|
|
350
320
|
return new Promise((resolve, reject) => {
|
|
351
321
|
const pageContext = params.pageContext;
|
|
@@ -1152,6 +1122,9 @@ function dealCompleteTaskParam(commonEntity, isInit, pageContext, params, operat
|
|
|
1152
1122
|
pageContext.initFormNo = commonEntity.formNo;
|
|
1153
1123
|
pageContext.emailTemplateCode = commonEntity.emailTemplateCode;
|
|
1154
1124
|
}
|
|
1125
|
+
if (formParam.entity) {
|
|
1126
|
+
cacheFormDataId(formParam.entity.id || formParam.entity.ID, pageContext);
|
|
1127
|
+
}
|
|
1155
1128
|
const completeTaskResult = formParam.completeTaskResult;
|
|
1156
1129
|
if (completeTaskResult) {
|
|
1157
1130
|
const completeTaskTipType = completeTaskResult.completeTaskTipType;
|
|
@@ -1800,6 +1773,12 @@ function isTaskComplete(completeTaskParam) {
|
|
|
1800
1773
|
}
|
|
1801
1774
|
return taskComplete;
|
|
1802
1775
|
}
|
|
1776
|
+
function cacheFormDataId(dataId, pageContext) {
|
|
1777
|
+
const additionalParamMap = getAdditionalParamMap(pageContext);
|
|
1778
|
+
if (dataId && additionalParamMap) {
|
|
1779
|
+
setSessionCache(additionalParamMap._t_ + "_id", dataId);
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1803
1782
|
export {
|
|
1804
1783
|
dealAfterOperate,
|
|
1805
1784
|
dealCompleteTaskParam,
|
|
@@ -74,25 +74,10 @@ function getEndObjectRule(rule, props, currentProp) {
|
|
|
74
74
|
}
|
|
75
75
|
function getValidator(columns) {
|
|
76
76
|
const rules = {};
|
|
77
|
-
if (columns) {
|
|
78
|
-
columns.forEach((editField) => {
|
|
79
|
-
const prop = editField.model;
|
|
80
|
-
if (prop && editField.validations) {
|
|
81
|
-
const validations = editField.validations;
|
|
82
|
-
if (prop.indexOf(".") > 0) {
|
|
83
|
-
setObjectPropRule(editField.prop, rules, validations);
|
|
84
|
-
} else {
|
|
85
|
-
if (validations && validations.length > 0) {
|
|
86
|
-
rules[prop] = [...validations];
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
77
|
return rules;
|
|
93
78
|
}
|
|
94
79
|
function validator(entity, rules, columns, rowIndex, isSql) {
|
|
95
|
-
return validatorEntity(entity, rules, columns, rowIndex, true
|
|
80
|
+
return validatorEntity(entity, rules, columns, rowIndex, true);
|
|
96
81
|
}
|
|
97
82
|
function sublistVerify(rules) {
|
|
98
83
|
if (!rules) {
|
|
@@ -118,7 +103,7 @@ function sublistVerify(rules) {
|
|
|
118
103
|
function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdate, isSql) {
|
|
119
104
|
let validateRules = sublistVerify(rules);
|
|
120
105
|
if ((!rules || rules === null) && columns) {
|
|
121
|
-
validateRules = getValidator(
|
|
106
|
+
validateRules = getValidator();
|
|
122
107
|
}
|
|
123
108
|
if (!validateRules || Object.keys(validateRules).length === 0) {
|
|
124
109
|
entity["validateErrorField"] = "";
|
|
@@ -136,11 +121,6 @@ function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdat
|
|
|
136
121
|
if (errors) {
|
|
137
122
|
result = errors[0].message;
|
|
138
123
|
fieldName = errors[0]["field"];
|
|
139
|
-
if (typeof rowIndex !== "undefined" && rowIndex !== null) {
|
|
140
|
-
result = getI18n().t("superPageRuntimeMessage.recordLine", {
|
|
141
|
-
row: rowIndex + 1
|
|
142
|
-
}) + "," + result;
|
|
143
|
-
}
|
|
144
124
|
ElMessage({
|
|
145
125
|
message: result,
|
|
146
126
|
showClose: true,
|
|
@@ -153,11 +133,11 @@ function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdat
|
|
|
153
133
|
}
|
|
154
134
|
if (fieldName && isShouldRepeateValdate === true) {
|
|
155
135
|
const reg1 = /[A-Z]+/;
|
|
156
|
-
if (
|
|
136
|
+
if (reg1.test(fieldName) && entity[fieldName.toLowerCase()] !== void 0) {
|
|
157
137
|
const copyEntity = JSON.parse(JSON.stringify(entity));
|
|
158
138
|
copyEntity[fieldName.toUpperCase()] = entity[fieldName.toLowerCase()];
|
|
159
139
|
delete copyEntity[fieldName.toLowerCase()];
|
|
160
|
-
result = validatorEntity(copyEntity, rules, columns, rowIndex, false
|
|
140
|
+
result = validatorEntity(copyEntity, rules, columns, rowIndex, false);
|
|
161
141
|
}
|
|
162
142
|
}
|
|
163
143
|
}
|
|
@@ -205,7 +185,7 @@ function validateWorkflowFormDataModel(dataModel, pageContext) {
|
|
|
205
185
|
if (!rules || Object.keys(rules).length === 0) {
|
|
206
186
|
result = true;
|
|
207
187
|
} else {
|
|
208
|
-
result = validator(handleModels, rules, null, null
|
|
188
|
+
result = validator(handleModels, rules, null, null);
|
|
209
189
|
}
|
|
210
190
|
if (result === true) {
|
|
211
191
|
const workflowFieldPermissionRules = pageContext.workflowRules;
|
|
@@ -269,7 +249,7 @@ function validateCommonFormDataModel(dataModel, pageContext, rules) {
|
|
|
269
249
|
if (!rules || Object.keys(rules).length === 0) {
|
|
270
250
|
resolve(handleModels);
|
|
271
251
|
} else {
|
|
272
|
-
const validateEntityResult = validator(handleModels, rules, null, null
|
|
252
|
+
const validateEntityResult = validator(handleModels, rules, null, null);
|
|
273
253
|
if (validateEntityResult === true) {
|
|
274
254
|
const validateResult = validateSubTables(pageContext);
|
|
275
255
|
if (validateResult === true) {
|
|
@@ -109,8 +109,7 @@ function getRequestObject(pageRequest) {
|
|
|
109
109
|
Object.assign(requestObj, route.query);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
if (requestObj["_t_"])
|
|
113
|
-
;
|
|
112
|
+
if (requestObj["_t_"]) ;
|
|
114
113
|
return requestObj;
|
|
115
114
|
}
|
|
116
115
|
function getModelFields(pageContext, formItemConfigure, prop) {
|
package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js
CHANGED
|
@@ -86,17 +86,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
86
86
|
hisGroupValue = headerInfo.groupValue;
|
|
87
87
|
refresh();
|
|
88
88
|
});
|
|
89
|
-
function refresh() {
|
|
89
|
+
function refresh(isHandle) {
|
|
90
90
|
if (!dataConfig) {
|
|
91
91
|
console.log("无数据源配置,不需要查询!");
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
94
|
dataConfig.services[0].groupValue = headerInfo.groupValue;
|
|
95
|
-
|
|
95
|
+
if (isHandle !== true) {
|
|
96
|
+
dataConfig.autoRefresh = true;
|
|
97
|
+
}
|
|
96
98
|
updateChartDatasources(props.pageContext, [dataConfig], headerInfo.drillParams);
|
|
97
99
|
}
|
|
98
100
|
const monitorFields = headerInfo.monitorFields;
|
|
99
|
-
monitorFieldChange(props.pageContext, monitorFields,
|
|
101
|
+
monitorFieldChange(props.pageContext, monitorFields, () => {
|
|
102
|
+
refresh(true);
|
|
103
|
+
});
|
|
100
104
|
function updateChartDatas(resultData) {
|
|
101
105
|
if (!resultData) {
|
|
102
106
|
resultData = [];
|
|
@@ -111,17 +115,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
111
115
|
return;
|
|
112
116
|
}
|
|
113
117
|
resultData.hasRender = true;
|
|
114
|
-
if (!dataConfig.
|
|
118
|
+
if (!dataConfig.autoRefresh) {
|
|
115
119
|
hisGroupValue = resultData.groupValue;
|
|
116
120
|
if (hisGroupValue && headerInfo.groupComponent !== "checkbox") {
|
|
117
121
|
hisGroupValue = hisGroupValue.join(",");
|
|
118
122
|
}
|
|
119
123
|
headerInfo.groupValue = hisGroupValue;
|
|
120
124
|
}
|
|
121
|
-
if (!dataConfig.
|
|
125
|
+
if (!dataConfig.autoRefresh || !enableDrill) {
|
|
122
126
|
clearChartSelected(props.pageContext, props.configure, chartRef.value.chart);
|
|
123
127
|
}
|
|
124
|
-
dataConfig.
|
|
128
|
+
dataConfig.autoRefresh = false;
|
|
125
129
|
updateChartOption(props.pageContext, props.configure, chartOption, resultData);
|
|
126
130
|
}
|
|
127
131
|
__expose({
|
|
@@ -84,17 +84,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
84
84
|
hisGroupValue = headerInfo.groupValue;
|
|
85
85
|
refresh();
|
|
86
86
|
});
|
|
87
|
-
function refresh() {
|
|
87
|
+
function refresh(isHandle) {
|
|
88
88
|
if (!dataConfig) {
|
|
89
89
|
console.log("无数据源配置,不需要查询!");
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
92
|
dataConfig.services[0].groupValue = headerInfo.groupValue;
|
|
93
|
-
|
|
93
|
+
if (isHandle !== true) {
|
|
94
|
+
dataConfig.autoRefresh = true;
|
|
95
|
+
}
|
|
94
96
|
updateChartDatasources(props.pageContext, [dataConfig], headerInfo.drillParams);
|
|
95
97
|
}
|
|
96
98
|
const monitorFields = headerInfo.monitorFields;
|
|
97
|
-
monitorFieldChange(props.pageContext, monitorFields,
|
|
99
|
+
monitorFieldChange(props.pageContext, monitorFields, () => {
|
|
100
|
+
refresh(true);
|
|
101
|
+
});
|
|
98
102
|
function updateChartDatas(resultData) {
|
|
99
103
|
if (!resultData) {
|
|
100
104
|
resultData = [];
|
|
@@ -109,17 +113,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
109
113
|
return;
|
|
110
114
|
}
|
|
111
115
|
resultData.hasRender = true;
|
|
112
|
-
if (!dataConfig.
|
|
116
|
+
if (!dataConfig.autoRefresh) {
|
|
113
117
|
hisGroupValue = resultData.groupValue;
|
|
114
118
|
if (hisGroupValue && headerInfo.groupComponent !== "checkbox") {
|
|
115
119
|
hisGroupValue = hisGroupValue.join(",");
|
|
116
120
|
}
|
|
117
121
|
headerInfo.groupValue = hisGroupValue;
|
|
118
122
|
}
|
|
119
|
-
if (!dataConfig.
|
|
123
|
+
if (!dataConfig.autoRefresh || !enableDrill) {
|
|
120
124
|
clearChartSelected(props.pageContext, props.configure, chartRef.value.chart);
|
|
121
125
|
}
|
|
122
|
-
dataConfig.
|
|
126
|
+
dataConfig.autoRefresh = false;
|
|
123
127
|
updateChartOption(props.pageContext, props.configure, chartOption, resultData);
|
|
124
128
|
console.log("chartOption--pie", chartOption);
|
|
125
129
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineComponent, computed, ref, resolveComponent, openBlock, createElementBlock, normalizeClass, unref, createVNode, normalizeStyle } from "vue";
|
|
2
|
+
import { getFormModelFields } from "../../../../utils/page-init-util.js";
|
|
3
|
+
import { getVariableValue, setVariableValue } from "../../../../utils/page-helper-util.js";
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "tree-runtime",
|
|
6
|
+
props: {
|
|
7
|
+
pageContext: {},
|
|
8
|
+
configure: {}
|
|
9
|
+
},
|
|
10
|
+
setup(__props) {
|
|
11
|
+
const props = __props;
|
|
12
|
+
const entity = props.pageContext.entity ? props.pageContext.entity : {};
|
|
13
|
+
let dynamicFields = getFormModelFields(props.pageContext, props.configure);
|
|
14
|
+
computed({
|
|
15
|
+
get() {
|
|
16
|
+
return getVariableValue(entity, dynamicFields);
|
|
17
|
+
},
|
|
18
|
+
set(value) {
|
|
19
|
+
setVariableValue(entity, dynamicFields, value);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
|
|
23
|
+
const runtimeStyle = runtimeInfo.style;
|
|
24
|
+
const runtimeClass = runtimeInfo.class;
|
|
25
|
+
runtimeInfo.headerStyle;
|
|
26
|
+
const designProperty = ref(runtimeInfo.props ? runtimeInfo.props : {});
|
|
27
|
+
return (_ctx, _cache) => {
|
|
28
|
+
const _component_el_tree = resolveComponent("el-tree");
|
|
29
|
+
return openBlock(), createElementBlock("div", {
|
|
30
|
+
class: normalizeClass(unref(runtimeClass))
|
|
31
|
+
}, [
|
|
32
|
+
createVNode(_component_el_tree, {
|
|
33
|
+
style: normalizeStyle([unref(runtimeStyle), { "width": "fit-content" }]),
|
|
34
|
+
data: designProperty.value.staticData,
|
|
35
|
+
"default-expand-all": designProperty.value.defaultExpandAll,
|
|
36
|
+
"expand-on-click-node": designProperty.value.expandOnClickNode,
|
|
37
|
+
indent: designProperty.value.retractWidth ? designProperty.value.retractWidth : 18,
|
|
38
|
+
accordion: designProperty.value.accordion,
|
|
39
|
+
"show-checkbox": designProperty.value.showCheckbox,
|
|
40
|
+
props: _ctx.defaultProps
|
|
41
|
+
}, null, 8, ["style", "data", "default-expand-all", "expand-on-click-node", "indent", "accordion", "show-checkbox", "props"])
|
|
42
|
+
], 2);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export {
|
|
47
|
+
_sfc_main as default
|
|
48
|
+
};
|
|
@@ -67,7 +67,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
67
67
|
}
|
|
68
68
|
autoSetAfterSelect(props.configure, props.pageContext, autoSets, selItems);
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
handleFormEvent(value, props.pageContext, props.configure, "change");
|
|
71
71
|
}
|
|
72
72
|
function updateOptions(newOptions) {
|
|
73
73
|
listOptions.value = newOptions ? newOptions : [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, ref, computed, resolveComponent, openBlock, createBlock, normalizeClass, unref, normalizeStyle, withCtx, createElementBlock, toDisplayString, createCommentVNode, createVNode, createTextVNode } from "vue";
|
|
2
2
|
import { getFormModelFields } from "../../../../utils/page-init-util.js";
|
|
3
|
-
import {
|
|
3
|
+
import { getVariableValue } from "../../../../utils/page-helper-util.js";
|
|
4
4
|
import { handleFormEvent } from "../../../../utils/events/event-util.js";
|
|
5
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
6
|
__name: "link-runtime",
|
|
@@ -10,29 +10,32 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
10
10
|
},
|
|
11
11
|
setup(__props) {
|
|
12
12
|
const props = __props;
|
|
13
|
-
getFormModelFields(props.pageContext, props.configure);
|
|
13
|
+
const modelFields = getFormModelFields(props.pageContext, props.configure);
|
|
14
14
|
const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
|
|
15
15
|
const runtimeStyle = runtimeInfo.style;
|
|
16
16
|
const runtimeClass = runtimeInfo.class;
|
|
17
17
|
const headerStyle = runtimeInfo.headerStyle;
|
|
18
18
|
const designProperty = ref(runtimeInfo.props ? runtimeInfo.props : {});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
contentVariable = propsBase.prop;
|
|
23
|
-
}
|
|
24
|
-
if (!contentVariable) {
|
|
25
|
-
contentVariable = "${page." + props.configure.uuid + "}";
|
|
26
|
-
}
|
|
19
|
+
console.log("designProperty", designProperty.value);
|
|
20
|
+
let formatting = designProperty.value.formatting;
|
|
21
|
+
const entity = props.pageContext.entity ? props.pageContext.entity : {};
|
|
27
22
|
const dynamicValue = computed(() => {
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
let resultValue = getVariableValue(entity, modelFields);
|
|
24
|
+
resultValue = resultValue == void 0 || resultValue == null ? "" : resultValue;
|
|
25
|
+
if (formatting) {
|
|
26
|
+
resultValue = formatting.replace(/\${value}/g, resultValue);
|
|
27
|
+
}
|
|
28
|
+
return resultValue;
|
|
30
29
|
});
|
|
31
30
|
let tooltipVariable = designProperty.value.tooltip;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
let tooltipValue = null;
|
|
32
|
+
if (tooltipVariable) {
|
|
33
|
+
tooltipValue = computed(() => {
|
|
34
|
+
let resultValue = getVariableValue(entity, modelFields);
|
|
35
|
+
resultValue = resultValue == void 0 || resultValue == null ? "" : resultValue;
|
|
36
|
+
return tooltipVariable.replace(/\${value}/g, resultValue);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
36
39
|
return (_ctx, _cache) => {
|
|
37
40
|
const _component_el_link = resolveComponent("el-link");
|
|
38
41
|
const _component_el_tooltip = resolveComponent("el-tooltip");
|
|
@@ -50,8 +53,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
50
53
|
]),
|
|
51
54
|
default: withCtx(() => [
|
|
52
55
|
createVNode(_component_el_tooltip, {
|
|
53
|
-
disabled: !tooltipValue
|
|
54
|
-
content: tooltipValue
|
|
56
|
+
disabled: !unref(tooltipValue),
|
|
57
|
+
content: unref(tooltipValue)
|
|
55
58
|
}, {
|
|
56
59
|
default: withCtx(() => [
|
|
57
60
|
createVNode(_component_el_link, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, resolveComponent, openBlock, createBlock, normalizeClass, unref, normalizeStyle, withCtx, createElementBlock, toDisplayString, createCommentVNode,
|
|
1
|
+
import { defineComponent, ref, computed, resolveComponent, openBlock, createBlock, normalizeClass, unref, normalizeStyle, withCtx, createElementBlock, toDisplayString, createCommentVNode, Fragment, renderList, createTextVNode } from "vue";
|
|
2
2
|
import { getFormModelFields } from "../../../../utils/page-init-util.js";
|
|
3
|
-
import {
|
|
3
|
+
import { getVariableValue, setVariableValue } from "../../../../utils/page-helper-util.js";
|
|
4
4
|
import { handleFormEvent } from "../../../../utils/events/event-util.js";
|
|
5
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
6
|
__name: "tag-runtime",
|
|
@@ -10,24 +10,61 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
10
10
|
},
|
|
11
11
|
setup(__props) {
|
|
12
12
|
const props = __props;
|
|
13
|
-
getFormModelFields(props.pageContext, props.configure);
|
|
13
|
+
const modelFields = getFormModelFields(props.pageContext, props.configure);
|
|
14
14
|
const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
|
|
15
15
|
const runtimeStyle = runtimeInfo.style;
|
|
16
16
|
const runtimeClass = runtimeInfo.class;
|
|
17
17
|
const headerStyle = runtimeInfo.headerStyle;
|
|
18
18
|
const designProperty = ref(runtimeInfo.props ? runtimeInfo.props : {});
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
let formatting = designProperty.value.formatting;
|
|
20
|
+
const entity = props.pageContext.entity ? props.pageContext.entity : {};
|
|
21
|
+
const dynamicValues = computed(() => {
|
|
22
|
+
let resultValue = getVariableValue(entity, modelFields);
|
|
23
|
+
if (resultValue === void 0 || resultValue === null) {
|
|
24
|
+
resultValue = [];
|
|
25
|
+
}
|
|
26
|
+
if (!Array.isArray(resultValue)) {
|
|
27
|
+
resultValue = (resultValue + "").split(",");
|
|
28
|
+
}
|
|
29
|
+
const options = [];
|
|
30
|
+
let no = 1;
|
|
31
|
+
for (const val of resultValue) {
|
|
32
|
+
if (val === void 0 || val === null || val === "") {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
const o = {
|
|
36
|
+
value: val,
|
|
37
|
+
label: val
|
|
38
|
+
};
|
|
39
|
+
if (formatting) {
|
|
40
|
+
o.label = formatting.replace(/\${value}/g, o.value).replace(/\${no}/g, no);
|
|
41
|
+
}
|
|
42
|
+
options.push(o);
|
|
43
|
+
no++;
|
|
44
|
+
}
|
|
45
|
+
return options;
|
|
30
46
|
});
|
|
47
|
+
function closeTag($event, tag) {
|
|
48
|
+
if (designProperty.value.closable) {
|
|
49
|
+
let resultValue = getVariableValue(entity, modelFields);
|
|
50
|
+
if (resultValue === void 0 || resultValue === null) {
|
|
51
|
+
resultValue = [];
|
|
52
|
+
}
|
|
53
|
+
const isArray = Array.isArray(resultValue);
|
|
54
|
+
if (!isArray) {
|
|
55
|
+
resultValue = (resultValue + "").split(",");
|
|
56
|
+
}
|
|
57
|
+
const index = resultValue.indexOf(tag.value);
|
|
58
|
+
if (index > -1) {
|
|
59
|
+
resultValue.splice(index, 1);
|
|
60
|
+
}
|
|
61
|
+
if (!isArray) {
|
|
62
|
+
resultValue = resultValue.join(",");
|
|
63
|
+
}
|
|
64
|
+
setVariableValue(entity, modelFields, resultValue);
|
|
65
|
+
}
|
|
66
|
+
handleFormEvent($event, props.pageContext, props.configure, "remove");
|
|
67
|
+
}
|
|
31
68
|
return (_ctx, _cache) => {
|
|
32
69
|
const _component_el_tag = resolveComponent("el-tag");
|
|
33
70
|
const _component_el_form_item = resolveComponent("el-form-item");
|
|
@@ -44,18 +81,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
44
81
|
}, toDisplayString(designProperty.value.title), 5)) : createCommentVNode("", true)
|
|
45
82
|
]),
|
|
46
83
|
default: withCtx(() => [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
84
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(dynamicValues.value, (tag) => {
|
|
85
|
+
return openBlock(), createBlock(_component_el_tag, {
|
|
86
|
+
key: tag,
|
|
87
|
+
size: designProperty.value.size,
|
|
88
|
+
closable: designProperty.value.closable,
|
|
89
|
+
type: designProperty.value.type,
|
|
90
|
+
style: { "margin-right": "4px" },
|
|
91
|
+
onClose: ($event) => closeTag($event, tag),
|
|
92
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(handleFormEvent)($event, _ctx.pageContext, _ctx.configure, "click"))
|
|
93
|
+
}, {
|
|
94
|
+
default: withCtx(() => [
|
|
95
|
+
createTextVNode(toDisplayString(tag.label), 1)
|
|
96
|
+
]),
|
|
97
|
+
_: 2
|
|
98
|
+
}, 1032, ["size", "closable", "type", "onClose"]);
|
|
99
|
+
}), 128))
|
|
59
100
|
]),
|
|
60
101
|
_: 1
|
|
61
102
|
}, 8, ["required", "class", "label-width", "style"]);
|
|
@@ -307,12 +307,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
307
307
|
buttonParams.value = null;
|
|
308
308
|
}
|
|
309
309
|
function doExportFormReport(templateFile) {
|
|
310
|
-
const isPdf = false;
|
|
311
310
|
exportFormReport(
|
|
312
311
|
buttonParams.value.pageContext,
|
|
313
312
|
buttonParams.value.configureObj,
|
|
314
|
-
templateFile
|
|
315
|
-
isPdf
|
|
313
|
+
templateFile
|
|
316
314
|
);
|
|
317
315
|
}
|
|
318
316
|
const _selectFile_ = ref(null);
|
|
@@ -324,8 +322,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
324
322
|
if (!_selectFile_.value) {
|
|
325
323
|
return;
|
|
326
324
|
}
|
|
327
|
-
if (_selectFile_.value.value === "" || _selectFile_.value.value === null)
|
|
328
|
-
return;
|
|
325
|
+
if (_selectFile_.value.value === "" || _selectFile_.value.value === null) return;
|
|
329
326
|
const fileObj = _selectFile_.value.files[0];
|
|
330
327
|
if (fileObj) {
|
|
331
328
|
_selectFile_.value.value = null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "super-page-runtime",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.49-beta1",
|
|
4
4
|
"description": "AgileBuilder super page runtime",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"main": "dist/es/index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
|
49
49
|
"@vue/eslint-config-prettier": "^8.0.0",
|
|
50
50
|
"@vue/test-utils": "^2.4.4",
|
|
51
|
-
"agilebuilder-ui": "1.0.
|
|
51
|
+
"agilebuilder-ui": "1.0.38",
|
|
52
52
|
"axios": "^1.6.8",
|
|
53
53
|
"cypress": "^13.6.6",
|
|
54
54
|
"element-plus": "^2.6.1",
|