super-page-runtime 2.1.50 → 2.1.54
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/page-expose-util.js +110 -3
- package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +12 -2
- package/dist/es/components/runtime/utils/charts/chart-util.js +14 -0
- package/dist/es/components/runtime/utils/common-util.d.ts +1 -0
- package/dist/es/components/runtime/utils/common-util.js +4 -0
- package/dist/es/components/runtime/utils/events/event-util.d.ts +1 -0
- package/dist/es/components/runtime/utils/events/event-util.js +14 -1
- package/dist/es/components/runtime/utils/events/standard-event.js +3 -1
- package/dist/es/components/runtime/utils/interfaces/page-design-types.d.ts +1 -0
- package/dist/es/components/runtime/utils/page-helper-util.d.ts +18 -0
- package/dist/es/components/runtime/utils/page-helper-util.js +23 -4
- package/dist/es/components/runtime/utils/page-init-util.js +3 -1
- package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +4 -1
- package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +5 -3
- package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +13 -2
- package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +6 -1
- package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +64 -0
- package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +4 -0
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +100 -20
- package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +1 -0
- package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +102 -35
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +7 -1
- package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +7 -1
- package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +1 -0
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +49 -26
- package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +20 -7
- package/package.json +2 -2
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent, ref, onMounted, resolveComponent, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, withDirectives, createVNode, vShow, withCtx, Fragment, renderList, createBlock, watch, h } from "vue";
|
|
1
|
+
import { defineComponent, ref, onMounted, resolveComponent, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, withDirectives, createVNode, vShow, withCtx, Fragment, renderList, createBlock, createCommentVNode, watch, h } from "vue";
|
|
2
2
|
import _sfc_main$1 from "../common/common-chart-header.vue.js";
|
|
3
|
-
import { getChartDatasFromPage, isPromise, getValueFromVariable } from "../../../../utils/page-helper-util.js";
|
|
3
|
+
import { getChartDatasFromPage, isPromise, getValueFromVariable, setValueForVariableName, updateChartDatasourcesByComponent } from "../../../../utils/page-helper-util.js";
|
|
4
4
|
import { getCustomFunc } from "../../../../utils/events/event-util.js";
|
|
5
5
|
import _sfc_main$2 from "./group-column.vue.js";
|
|
6
6
|
import _sfc_main$3 from "./normal-column.vue.js";
|
|
7
|
-
import
|
|
7
|
+
import _sfc_main$4 from "./table-pageination.vue.js";
|
|
8
|
+
import { getSummaryTitleColumn, getSummaryDataColumn, rowDataToColumn, getColumnToRowTableConfig, colDataToRow, computeFormula, summaryStatistics, replacePlaceholders, getHeaderCellStyleUtil, getRowStyleUtil, getCellStyleUtil, getIndexColumn } from "./chart-table-util.js";
|
|
8
9
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
10
|
__name: "table-runtime",
|
|
10
11
|
props: {
|
|
@@ -41,6 +42,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
41
42
|
const groupSummaryColumns = ref({});
|
|
42
43
|
const groupSummaryDataRowIndex = [];
|
|
43
44
|
const columnStyleSourceConfig = ref({});
|
|
45
|
+
const dataFormulaMapping = ref({});
|
|
46
|
+
const total = ref(0);
|
|
47
|
+
let tmpTableData = [];
|
|
44
48
|
if (!props.configure.props.modelCustom) {
|
|
45
49
|
if (!isEnableGroupHeader.value) {
|
|
46
50
|
tableColumnsConfig.value = props.configure.items;
|
|
@@ -50,7 +54,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
50
54
|
(_a = props.configure.items) == null ? void 0 : _a.forEach((item) => {
|
|
51
55
|
columnsConfigKeyValues.value[item.uuid] = item;
|
|
52
56
|
if (Object.keys(item.style).length > 0) {
|
|
53
|
-
columnStyleSourceConfig.value[item.props.base.prop] = {
|
|
57
|
+
columnStyleSourceConfig.value[item.props.base.prop] = {
|
|
58
|
+
cellStyle: item.style,
|
|
59
|
+
titleStyle: item.titleStyle
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
if (item.formula && item.formula.trim() !== "") {
|
|
63
|
+
dataFormulaMapping.value[item.props.base.prop] = item.formula;
|
|
54
64
|
}
|
|
55
65
|
});
|
|
56
66
|
}
|
|
@@ -76,7 +86,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
76
86
|
watch(
|
|
77
87
|
() => path.reduce((obj, key) => obj[key], props.pageContext.entity),
|
|
78
88
|
(newVal) => {
|
|
79
|
-
loadTable(JSON.parse(JSON.stringify(newVal)));
|
|
89
|
+
loadTable(JSON.parse(JSON.stringify(newVal)), null);
|
|
80
90
|
}
|
|
81
91
|
);
|
|
82
92
|
}
|
|
@@ -117,7 +127,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
117
127
|
}
|
|
118
128
|
}
|
|
119
129
|
}
|
|
120
|
-
let tmpTableData = [];
|
|
121
130
|
if (props.configure.props.dataOrigin.dataSource === "service" && resultData.result) {
|
|
122
131
|
tmpTableData = resultData.result[props.configure.props.dataOrigin.service.serviceDataField];
|
|
123
132
|
} else if (props.configure.props.dataOrigin.dataSource === "variable") {
|
|
@@ -128,16 +137,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
128
137
|
);
|
|
129
138
|
}
|
|
130
139
|
if (tmpTableData) {
|
|
131
|
-
loadTable(tmpTableData);
|
|
140
|
+
loadTable(tmpTableData, resultData);
|
|
132
141
|
}
|
|
133
142
|
}
|
|
134
|
-
function loadTable(
|
|
143
|
+
function loadTable(tmpTableData2, resultData) {
|
|
144
|
+
var _a2;
|
|
135
145
|
if (enableTransition("rowToColumn")) {
|
|
136
|
-
|
|
146
|
+
tmpTableData2 = rowDataToColumn(tmpTableData2, props.configure);
|
|
137
147
|
if (!isEnableGroupHeader.value) {
|
|
138
148
|
const updatedColumnConfig = updateColumnConfig(
|
|
139
149
|
tableColumnsConfig.value,
|
|
140
|
-
|
|
150
|
+
tmpTableData2,
|
|
141
151
|
props.configure.props.dataOrigin.rowToColumn.titleColumns,
|
|
142
152
|
props.configure.props.dataOrigin.rowToColumn.dataColumns
|
|
143
153
|
);
|
|
@@ -147,18 +157,29 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
147
157
|
if (!isEnableGroupHeader.value) {
|
|
148
158
|
tableColumnsConfig.value = getColumnToRowTableConfig(props.configure);
|
|
149
159
|
}
|
|
150
|
-
|
|
160
|
+
tmpTableData2 = colDataToRow(tmpTableData2, props.configure);
|
|
151
161
|
}
|
|
152
162
|
if (props.configure.props.dataOrigin.dataFormatting) {
|
|
153
163
|
const func = getCustomFunc(props.pageContext, props.configure.props.dataOrigin.dataFormatting);
|
|
154
164
|
if (func) {
|
|
155
|
-
const resultValue = func.apply(func, [{ tableData:
|
|
165
|
+
const resultValue = func.apply(func, [{ tableData: tmpTableData2 }]);
|
|
156
166
|
if (resultValue) {
|
|
157
|
-
|
|
167
|
+
tmpTableData2 = resultValue;
|
|
158
168
|
}
|
|
159
169
|
}
|
|
170
|
+
}
|
|
171
|
+
if (Object.keys(dataFormulaMapping.value).length > 0 && tmpTableData2 && tmpTableData2.length > 0) {
|
|
172
|
+
tmpTableData2.forEach((item) => {
|
|
173
|
+
Object.keys(dataFormulaMapping.value).forEach((key) => {
|
|
174
|
+
const formula = dataFormulaMapping.value[key];
|
|
175
|
+
item[key] = computeFormula(item, formula);
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
if ((_a2 = props.configure.pageination) == null ? void 0 : _a2.enable) {
|
|
180
|
+
tableDataPageination(resultData);
|
|
160
181
|
} else {
|
|
161
|
-
tableData.value =
|
|
182
|
+
tableData.value = tmpTableData2;
|
|
162
183
|
}
|
|
163
184
|
if (props.configure.props.highOrder.groupField && props.configure.props.highOrder.groupField.length > 0) {
|
|
164
185
|
const groupField = props.configure.props.highOrder.groupField;
|
|
@@ -172,7 +193,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
172
193
|
function getHeaderCellStyle(data) {
|
|
173
194
|
const cellTitleStyle = columnStyleSourceConfig.value[data.column.property] ? columnStyleSourceConfig.value[data.column.property].titleStyle : null;
|
|
174
195
|
const rowTitleStyle = runtimeStyle == null ? void 0 : runtimeStyle.titleStyle;
|
|
175
|
-
return getHeaderCellStyleUtil(
|
|
196
|
+
return getHeaderCellStyleUtil(
|
|
197
|
+
data,
|
|
198
|
+
{ cellTitleStyle, titleStyle: rowTitleStyle },
|
|
199
|
+
props
|
|
200
|
+
);
|
|
176
201
|
}
|
|
177
202
|
function getRowStyle(data) {
|
|
178
203
|
return getRowStyleUtil(data, groupSummaryDataRowIndex, props);
|
|
@@ -310,18 +335,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
310
335
|
const groupResult = Object.values(groupedData);
|
|
311
336
|
for (let i = 0; i < groupResult.length; i++) {
|
|
312
337
|
const group = groupResult[i];
|
|
313
|
-
const
|
|
338
|
+
const total2 = {};
|
|
314
339
|
summaryColumns == null ? void 0 : summaryColumns.forEach((column) => {
|
|
315
340
|
const prop = column.props.base.prop;
|
|
316
341
|
const res = summaryStatistics(groupSummaryColumns.value[prop], group, prop, props.pageContext);
|
|
317
|
-
|
|
342
|
+
total2[prop] = res;
|
|
318
343
|
});
|
|
319
344
|
result.push(...group);
|
|
320
345
|
groupColumns == null ? void 0 : groupColumns.forEach((column) => {
|
|
321
346
|
const prop = column.props.base.prop;
|
|
322
|
-
|
|
347
|
+
total2[prop] = replacePlaceholders(column.props.base.summaryTitle, group[0]);
|
|
323
348
|
});
|
|
324
|
-
result.push(
|
|
349
|
+
result.push(total2);
|
|
325
350
|
groupSummaryDataRowIndex.push(result.length - 1);
|
|
326
351
|
}
|
|
327
352
|
return result;
|
|
@@ -334,6 +359,53 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
334
359
|
}
|
|
335
360
|
}
|
|
336
361
|
}
|
|
362
|
+
function tableDataPageination(resultData) {
|
|
363
|
+
if (props.configure.pageination.type === "frontend") {
|
|
364
|
+
total.value = tmpTableData.length;
|
|
365
|
+
frontendPageination(1, props.configure.pageination.pageSize);
|
|
366
|
+
} else if (props.configure.pageination.type === "backend") {
|
|
367
|
+
tableData.value = tmpTableData;
|
|
368
|
+
if (props.configure.pageination.totalFrom) {
|
|
369
|
+
total.value = resultData.result[props.configure.pageination.totalFrom];
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
function pageChange(currentPage, pageSize) {
|
|
374
|
+
if (props.configure.pageination.type === "frontend") {
|
|
375
|
+
frontendPageination(currentPage, pageSize);
|
|
376
|
+
} else {
|
|
377
|
+
backendPageination(currentPage, pageSize);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
function pageSizeChange(currentPage, pageSize) {
|
|
381
|
+
if (props.configure.pageination.type === "frontend") {
|
|
382
|
+
frontendPageination(currentPage, pageSize);
|
|
383
|
+
} else {
|
|
384
|
+
backendPageination(currentPage, pageSize);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
function frontendPageination(currentPage, pageSize) {
|
|
388
|
+
if (tmpTableData) {
|
|
389
|
+
tableData.value = tmpTableData.slice((currentPage - 1) * pageSize, currentPage * pageSize);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
function backendPageination(currentPage, pageSize) {
|
|
393
|
+
if (props.configure.pageination.currentPageSet) {
|
|
394
|
+
setValueForVariableName(
|
|
395
|
+
props.pageContext.entity,
|
|
396
|
+
props.configure.pageination.currentPageSet,
|
|
397
|
+
currentPage
|
|
398
|
+
);
|
|
399
|
+
}
|
|
400
|
+
if (props.configure.pageination.pageSizeSet) {
|
|
401
|
+
setValueForVariableName(
|
|
402
|
+
props.pageContext.entity,
|
|
403
|
+
props.configure.pageination.pageSizeSet,
|
|
404
|
+
pageSize
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
updateChartDatasourcesByComponent(props.pageContext, props.configure.uuid);
|
|
408
|
+
}
|
|
337
409
|
function exportChart() {
|
|
338
410
|
}
|
|
339
411
|
__expose({
|
|
@@ -391,7 +463,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
391
463
|
}), 128))
|
|
392
464
|
]),
|
|
393
465
|
_: 1
|
|
394
|
-
}, 8, ["data", "show-summary", "stripe"])
|
|
466
|
+
}, 8, ["data", "show-summary", "stripe"]),
|
|
467
|
+
__props.configure.pageination && __props.configure.pageination.enable ? (openBlock(), createBlock(_sfc_main$4, {
|
|
468
|
+
key: 0,
|
|
469
|
+
configure: __props.configure,
|
|
470
|
+
"table-data": tableData.value,
|
|
471
|
+
total: total.value,
|
|
472
|
+
onPageChange: pageChange,
|
|
473
|
+
onPageSizeChange: pageSizeChange
|
|
474
|
+
}, null, 8, ["configure", "table-data", "total"])) : createCommentVNode("", true)
|
|
395
475
|
], 6);
|
|
396
476
|
};
|
|
397
477
|
}
|
|
@@ -15,6 +15,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
15
15
|
const runtimeStyle = ref(runtimeInfo.style ? runtimeInfo.style : {});
|
|
16
16
|
const runtimeClass = runtimeInfo.class;
|
|
17
17
|
onMounted(() => {
|
|
18
|
+
console.log("tools-runtime.vue-onMounted");
|
|
18
19
|
if (thisRef.value && thisRef.value.parentNode) {
|
|
19
20
|
const resizeObserver2 = new ResizeObserver((entries) => {
|
|
20
21
|
for (let entry of entries) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, ref, onMounted, watch, onUnmounted, resolveComponent, openBlock, createElementBlock, createVNode, unref } from "vue";
|
|
2
2
|
import "agilebuilder-ui";
|
|
3
3
|
import { setTableEvents, canExecuteButton, doAfterClickEvent, getEventNameByType, doBeforeClickEvent, getHandleEvent, gridSelectRecord, gridSelectAllRecords, gridSelectionChange, cellClick, cellDblClick, rowClick, rowDblClick, headerClick } from "../../../../utils/events/event-util.js";
|
|
4
|
-
import { getBaseUrl, getListCode, getRealRestApiPath } from "../../../../utils/common-util.js";
|
|
4
|
+
import { getBaseUrl, getListCode, getRealRestApiPath, isVariableInvalidValue } 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
7
|
import { getDataTypeMapRequest, popupToPage } from "../../../../utils/table-utils.js";
|
|
@@ -9,6 +9,7 @@ import eventBus from "../../../../utils/eventBus.js";
|
|
|
9
9
|
import { getPermissionCodes, getDefaultValue } from "../../../../utils/page-init-util.js";
|
|
10
10
|
import { decomposeVariable, getSizeConfig } from "../../../../utils/page-helper-util.js";
|
|
11
11
|
import { getRowStyleUtil, getCellStyleUtil, getHeaderCellStyleUtil } from "../../chart/table/chart-table-util.js";
|
|
12
|
+
import "../../../../utils/global-refs.js";
|
|
12
13
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
14
|
__name: "main-table-runtime",
|
|
14
15
|
props: {
|
|
@@ -40,7 +41,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
40
41
|
const operationButtonObj = ref({});
|
|
41
42
|
const listOptions = ref({});
|
|
42
43
|
listOptions.value = getOptions();
|
|
43
|
-
const gridRef = ref(
|
|
44
|
+
const gridRef = ref();
|
|
44
45
|
const urlToListData = getUrlToListData();
|
|
45
46
|
const listCode = getListCode(pageContext.code, pageContext.version, configure.uuid);
|
|
46
47
|
const myPageCode = pageContext.code;
|
|
@@ -52,6 +53,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
52
53
|
const superGridSetting = superGridItems ? superGridItems[configure.uuid] : null;
|
|
53
54
|
console.log("superGridSetting1111===", superGridItems, superGridSetting);
|
|
54
55
|
const isCanShowMobileSearch = ref(false);
|
|
56
|
+
const linkageVariable = [];
|
|
55
57
|
onMounted(() => {
|
|
56
58
|
window.addEventListener("message", recieveMessage);
|
|
57
59
|
eventBus.$on(
|
|
@@ -89,26 +91,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
89
91
|
searchGridData(props.pageContext.entity.data);
|
|
90
92
|
}
|
|
91
93
|
);
|
|
92
|
-
const linkageVariable = [];
|
|
93
|
-
if (configure.props.linkages && configure.props.linkages.length > 0) {
|
|
94
|
-
configure.props.linkages.forEach((linkage) => {
|
|
95
|
-
const variablePath = decomposeVariable(linkage.fieldName);
|
|
96
|
-
if (variablePath && variablePath.length > 1) {
|
|
97
|
-
linkageVariable.push(variablePath[1]);
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
if (linkageVariable.length > 0) {
|
|
101
|
-
linkageVariable.forEach((variable) => {
|
|
102
|
-
watch(
|
|
103
|
-
() => props.pageContext.entity.page[variable],
|
|
104
|
-
() => {
|
|
105
|
-
const values = getLinkageVariableValues();
|
|
106
|
-
searchGridData(values);
|
|
107
|
-
}
|
|
108
|
-
);
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
94
|
onUnmounted(() => {
|
|
113
95
|
eventBus.$off(eventPageInfo + "-close-component-page-dialog");
|
|
114
96
|
eventBus.$off(eventPageInfo + "_close-dialog-get-entity");
|
|
@@ -148,7 +130,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
148
130
|
esc: escRestorRow
|
|
149
131
|
},
|
|
150
132
|
indexContinuous: configure.props && configure.props.otherSettings ? configure.props.otherSettings.serialNumberContinuous : false,
|
|
151
|
-
initSearch: configure.props && configure.props.
|
|
133
|
+
initSearch: configure.props && configure.props.dataOrigin.initializationQuery === false ? false : true,
|
|
152
134
|
// 初始化时是否查询,默认是查询
|
|
153
135
|
resizeHeight: resizeListHeight,
|
|
154
136
|
pageCode: pageContext.code,
|
|
@@ -174,7 +156,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
174
156
|
};
|
|
175
157
|
setOperationButtons(options);
|
|
176
158
|
setSortInfo(options);
|
|
177
|
-
myGetDataTypeMap();
|
|
159
|
+
const getDataTypeMap = myGetDataTypeMap();
|
|
160
|
+
if (getDataTypeMap) {
|
|
161
|
+
getDataTypeMap.then(() => {
|
|
162
|
+
if (configure.props.linkages && configure.props.linkages.length > 0) {
|
|
163
|
+
configure.props.linkages.forEach((linkage) => {
|
|
164
|
+
const variablePath = decomposeVariable(linkage.fieldName);
|
|
165
|
+
if (variablePath && variablePath.length > 1) {
|
|
166
|
+
linkageVariable.push(variablePath[1]);
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
if (linkageVariable.length > 0) {
|
|
170
|
+
addLinkageWatch();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
178
175
|
setTreeSetting(options);
|
|
179
176
|
setGridEvents(options);
|
|
180
177
|
return options;
|
|
@@ -195,7 +192,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
195
192
|
if (!backendUrl && !tableName) {
|
|
196
193
|
return;
|
|
197
194
|
}
|
|
198
|
-
getDataTypeMapRequest(backendUrl, tableName, pageContext.isTest).then((result) => {
|
|
195
|
+
return getDataTypeMapRequest(backendUrl, tableName, pageContext.isTest).then((result) => {
|
|
199
196
|
if (!pageContext["dataTypeMaps"]) {
|
|
200
197
|
pageContext["dataTypeMaps"] = {};
|
|
201
198
|
}
|
|
@@ -504,6 +501,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
504
501
|
}
|
|
505
502
|
function searchGridData(data) {
|
|
506
503
|
if (!pageContext["dataTypeMaps"] || !pageContext["dataTypeMaps"][tableName]) {
|
|
504
|
+
console.log("!pageContext['dataTypeMaps'] || !pageContext['dataTypeMaps'][tableName]");
|
|
507
505
|
return;
|
|
508
506
|
}
|
|
509
507
|
const dataTypeObj = pageContext["dataTypeMaps"][tableName];
|
|
@@ -553,6 +551,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
553
551
|
}
|
|
554
552
|
}
|
|
555
553
|
}
|
|
554
|
+
console.log("toolbarRefresh");
|
|
556
555
|
gridRef.value.toolbarRefresh(null, null, toolbarFieldParam);
|
|
557
556
|
}
|
|
558
557
|
function resizeListHeight(params) {
|
|
@@ -599,7 +598,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
599
598
|
rowIndex,
|
|
600
599
|
button
|
|
601
600
|
};
|
|
602
|
-
debugger;
|
|
603
601
|
const buttonConfigure = operationButtonObj.value[button.sourceButton.uuid];
|
|
604
602
|
const tableConfigure = configure;
|
|
605
603
|
buttonConfigure.props.base.tableUuid = tableConfigure.uuid;
|
|
@@ -712,6 +710,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
712
710
|
function canShowMobileSearch(listCode2) {
|
|
713
711
|
isCanShowMobileSearch.value = true;
|
|
714
712
|
}
|
|
713
|
+
function getRowStyle(data) {
|
|
714
|
+
return getRowStyleUtil(data, [], props);
|
|
715
|
+
}
|
|
716
|
+
function getCellStyle(data) {
|
|
717
|
+
return getCellStyleUtil(data, data.cellStyle, props);
|
|
718
|
+
}
|
|
719
|
+
function getTitleStyle(data) {
|
|
720
|
+
const cellTitleStyle = data.titleStyle;
|
|
721
|
+
const rowTitleStyle = props.configure.style.titleStyle;
|
|
722
|
+
return getHeaderCellStyleUtil(
|
|
723
|
+
data,
|
|
724
|
+
{ cellTitleStyle, titleStyle: rowTitleStyle },
|
|
725
|
+
props
|
|
726
|
+
);
|
|
727
|
+
}
|
|
715
728
|
function getLinkageVariableValues() {
|
|
716
729
|
const values = {};
|
|
717
730
|
linkageVariable.forEach((variable) => {
|
|
@@ -719,16 +732,69 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
719
732
|
});
|
|
720
733
|
return values;
|
|
721
734
|
}
|
|
722
|
-
function
|
|
723
|
-
|
|
735
|
+
function addLinkageWatch() {
|
|
736
|
+
if (props.pageContext.toolsInputComponents && props.pageContext.toolsInputComponents.length > 0) {
|
|
737
|
+
let waitComponentRenderProps = [];
|
|
738
|
+
props.pageContext.toolsInputComponents.forEach((componentItem) => {
|
|
739
|
+
const isLinkComponent = configure.props.linkages.some(
|
|
740
|
+
(linkage) => linkage.fieldName === componentItem.prop
|
|
741
|
+
);
|
|
742
|
+
if (isLinkComponent && componentItem.defaultValue) {
|
|
743
|
+
const variablePath = decomposeVariable(componentItem.prop);
|
|
744
|
+
if (variablePath && variablePath.length > 1) {
|
|
745
|
+
waitComponentRenderProps.push(variablePath[1]);
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
});
|
|
749
|
+
if (waitComponentRenderProps.length === 0) {
|
|
750
|
+
linkageVariableWatch();
|
|
751
|
+
} else {
|
|
752
|
+
const values = getLinkageVariableValues();
|
|
753
|
+
waitComponentRenderProps = waitComponentRenderProps.filter((unsetVariable) => {
|
|
754
|
+
return isVariableInvalidValue(values, unsetVariable);
|
|
755
|
+
});
|
|
756
|
+
if (waitComponentRenderProps.length === 0) {
|
|
757
|
+
searchGridData(values);
|
|
758
|
+
linkageVariableWatch();
|
|
759
|
+
} else {
|
|
760
|
+
linkageVariable.forEach((variable) => {
|
|
761
|
+
watch(
|
|
762
|
+
() => props.pageContext.entity.page[variable],
|
|
763
|
+
() => {
|
|
764
|
+
const values2 = getLinkageVariableValues();
|
|
765
|
+
if (waitComponentRenderProps.length === 0) {
|
|
766
|
+
searchGridData(values2);
|
|
767
|
+
} else {
|
|
768
|
+
waitComponentRenderProps = waitComponentRenderProps.filter((unsetVariable) => {
|
|
769
|
+
return isVariableInvalidValue(values2, unsetVariable);
|
|
770
|
+
});
|
|
771
|
+
if (waitComponentRenderProps.length === 0) {
|
|
772
|
+
searchGridData(values2);
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
},
|
|
776
|
+
{ immediate: true }
|
|
777
|
+
);
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}
|
|
724
782
|
}
|
|
725
|
-
function
|
|
726
|
-
|
|
783
|
+
function linkageVariableWatch() {
|
|
784
|
+
linkageVariable.forEach((variable) => {
|
|
785
|
+
watch(
|
|
786
|
+
() => props.pageContext.entity.page[variable],
|
|
787
|
+
() => {
|
|
788
|
+
const values = getLinkageVariableValues();
|
|
789
|
+
searchGridData(values);
|
|
790
|
+
}
|
|
791
|
+
);
|
|
792
|
+
});
|
|
727
793
|
}
|
|
728
|
-
function
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
794
|
+
function getTableSelectOptions() {
|
|
795
|
+
if (gridRef.value) {
|
|
796
|
+
return gridRef.value.getTableSelectOptions(listCode);
|
|
797
|
+
}
|
|
732
798
|
}
|
|
733
799
|
__expose({
|
|
734
800
|
refresh,
|
|
@@ -739,7 +805,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
739
805
|
getTableConfigure,
|
|
740
806
|
isDeleteChange,
|
|
741
807
|
validatorSunTableListData,
|
|
742
|
-
showMobileSearch
|
|
808
|
+
showMobileSearch,
|
|
809
|
+
getTableSelectOptions
|
|
743
810
|
});
|
|
744
811
|
return (_ctx, _cache) => {
|
|
745
812
|
const _component_super_grid = resolveComponent("super-grid");
|
|
@@ -507,6 +507,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
507
507
|
const rowTitleStyle = props.configure.style.titleStyle;
|
|
508
508
|
return getHeaderCellStyleUtil(data, { cellTitleStyle, titleStyle: rowTitleStyle }, props);
|
|
509
509
|
}
|
|
510
|
+
function getTableSelectOptions() {
|
|
511
|
+
if (gridRef.value) {
|
|
512
|
+
return gridRef.value.getTableSelectOptions(listCode);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
510
515
|
__expose({
|
|
511
516
|
createRow,
|
|
512
517
|
getSelections,
|
|
@@ -515,7 +520,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
515
520
|
getTableConfigure,
|
|
516
521
|
validatorSunTableListData,
|
|
517
522
|
getValue,
|
|
518
|
-
setValue
|
|
523
|
+
setValue,
|
|
524
|
+
getTableSelectOptions
|
|
519
525
|
});
|
|
520
526
|
return (_ctx, _cache) => {
|
|
521
527
|
const _component_super_grid = resolveComponent("super-grid");
|
|
@@ -57,6 +57,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
57
57
|
function showMobileSearch() {
|
|
58
58
|
gridRef.value.showMobileSearch();
|
|
59
59
|
}
|
|
60
|
+
function getTableSelectOptions() {
|
|
61
|
+
if (gridRef.value) {
|
|
62
|
+
return gridRef.value.getTableSelectOptions();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
60
65
|
__expose({
|
|
61
66
|
refresh,
|
|
62
67
|
createRow,
|
|
@@ -66,7 +71,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
66
71
|
getTableConfigure,
|
|
67
72
|
isDeleteChange,
|
|
68
73
|
validatorSunTableListData,
|
|
69
|
-
showMobileSearch
|
|
74
|
+
showMobileSearch,
|
|
75
|
+
getTableSelectOptions
|
|
70
76
|
});
|
|
71
77
|
return (_ctx, _cache) => {
|
|
72
78
|
return openBlock(), createElementBlock("div", null, [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, watch, onMounted, onBeforeUnmount, resolveComponent, openBlock, createBlock, normalizeClass, unref, normalizeStyle, withCtx,
|
|
1
|
+
import { defineComponent, ref, watch, onMounted, onBeforeUnmount, resolveComponent, openBlock, createElementBlock, Fragment, createBlock, normalizeClass, unref, normalizeStyle, withCtx, toDisplayString, createCommentVNode, createElementVNode } from "vue";
|
|
2
2
|
import { getFormModelFields } from "../../../../utils/page-init-util.js";
|
|
3
3
|
import { formatVariableValue, setVariableValue } from "../../../../utils/page-helper-util.js";
|
|
4
4
|
import Quill from "quill";
|
|
@@ -6,6 +6,7 @@ import "quill/dist/quill.snow.css";
|
|
|
6
6
|
import { handleFormEvent } from "../../../../utils/events/event-util.js";
|
|
7
7
|
import http from "agilebuilder-ui/src/utils/request";
|
|
8
8
|
import { $t } from "../../../../utils/i18n-util.js";
|
|
9
|
+
import { getToken } from "agilebuilder-ui/src/utils/auth";
|
|
9
10
|
const _hoisted_1 = { style: { "width": "100%", "height": "100%" } };
|
|
10
11
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
12
|
__name: "richtext-runtime",
|
|
@@ -104,6 +105,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
104
105
|
quill.container.style.height = newHeight + "px";
|
|
105
106
|
}
|
|
106
107
|
}
|
|
108
|
+
const previewList = ref([]);
|
|
109
|
+
const showViewer = ref(false);
|
|
107
110
|
onMounted(() => {
|
|
108
111
|
var _a;
|
|
109
112
|
quill = new Quill(quillEditorRef.value, option.value);
|
|
@@ -129,7 +132,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
129
132
|
for (let i2 = 0; i2 < images.length; i2++) {
|
|
130
133
|
const img = images[i2];
|
|
131
134
|
if (img.src === dataurl) {
|
|
132
|
-
img.src = res.url;
|
|
135
|
+
img.src = res.url + "&jwt=" + getToken();
|
|
133
136
|
}
|
|
134
137
|
}
|
|
135
138
|
}
|
|
@@ -141,6 +144,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
141
144
|
}
|
|
142
145
|
setVariableValue(entity, dynamicFields, quill.root.innerHTML);
|
|
143
146
|
});
|
|
147
|
+
const editorContainer = quill.container;
|
|
148
|
+
editorContainer.addEventListener("click", function(event) {
|
|
149
|
+
if (event.target.localName === "img") {
|
|
150
|
+
previewList.value = [];
|
|
151
|
+
let imgSrc = event.target.src;
|
|
152
|
+
previewList.value.push(imgSrc);
|
|
153
|
+
showViewer.value = true;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
144
156
|
updateEditorHeight();
|
|
145
157
|
});
|
|
146
158
|
onBeforeUnmount(() => {
|
|
@@ -181,30 +193,41 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
181
193
|
}
|
|
182
194
|
return (_ctx, _cache) => {
|
|
183
195
|
const _component_el_form_item = resolveComponent("el-form-item");
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
196
|
+
const _component_el_image_viewer = resolveComponent("el-image-viewer");
|
|
197
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
198
|
+
designProperty.value.tittleShow ? (openBlock(), createBlock(_component_el_form_item, {
|
|
199
|
+
key: 0,
|
|
200
|
+
required: designProperty.value.required,
|
|
201
|
+
class: normalizeClass(unref(runtimeClass)),
|
|
202
|
+
"label-width": designProperty.value.labelWidth,
|
|
203
|
+
style: normalizeStyle(unref(runtimeStyle))
|
|
204
|
+
}, {
|
|
205
|
+
label: withCtx(() => [
|
|
206
|
+
designProperty.value.tittleShow ? (openBlock(), createElementBlock("div", {
|
|
207
|
+
key: 0,
|
|
208
|
+
style: normalizeStyle({ ...unref(headerStyle), ...unref(titleExceedStyle) })
|
|
209
|
+
}, toDisplayString(unref($t)(designProperty.value.title)), 5)) : createCommentVNode("", true)
|
|
210
|
+
]),
|
|
211
|
+
default: withCtx(() => [
|
|
212
|
+
createElementVNode("div", _hoisted_1, [
|
|
213
|
+
createElementVNode("div", {
|
|
214
|
+
ref_key: "quillEditorRef",
|
|
215
|
+
ref: quillEditorRef,
|
|
216
|
+
style: { "width": "100%" }
|
|
217
|
+
}, null, 512)
|
|
218
|
+
])
|
|
219
|
+
]),
|
|
220
|
+
_: 1
|
|
221
|
+
}, 8, ["required", "class", "label-width", "style"])) : createCommentVNode("", true),
|
|
222
|
+
showViewer.value ? (openBlock(), createBlock(_component_el_image_viewer, {
|
|
223
|
+
key: 1,
|
|
224
|
+
"hide-on-click-modal": "",
|
|
225
|
+
onClose: _cache[0] || (_cache[0] = () => {
|
|
226
|
+
showViewer.value = false;
|
|
227
|
+
}),
|
|
228
|
+
"url-list": previewList.value
|
|
229
|
+
}, null, 8, ["url-list"])) : createCommentVNode("", true)
|
|
230
|
+
], 64);
|
|
208
231
|
};
|
|
209
232
|
}
|
|
210
233
|
});
|