super-page-runtime 2.1.50-temp1 → 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 +7 -0
- 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 +5 -2
- package/dist/es/components/runtime/utils/events/validator-util.js +25 -5
- 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 +25 -5
- package/dist/es/components/runtime/utils/page-init-util.js +5 -2
- package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +1 -1
- package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +2 -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 +83 -20
- package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +1 -1
- 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/placeholder/placeholder-runtime.vue.js +1 -1
- package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue3.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 +18 -8
- package/dist/es/components/runtime/views/super-page.vue.js +2 -1
- package/package.json +2 -2
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { setValueForVariableName } from "../page-helper-util.js";
|
|
2
|
-
import { getComponentRefByCode } from "../global-refs.js";
|
|
1
|
+
import { setValueForVariableName, getOptionDatasSourceMap, getComponentOptionDatasFromPage, getVariableValue, setVariableValue } from "../page-helper-util.js";
|
|
2
|
+
import { getComponentRefByCode, getComponentRef } from "../global-refs.js";
|
|
3
3
|
import eventBus from "../eventBus.js";
|
|
4
4
|
import http from "agilebuilder-ui/src/utils/request";
|
|
5
5
|
import { getAdditionalParamMap, refreshPage } from "../events/standard-event.js";
|
|
6
6
|
import { updateFormItemEditState, dsiabledAllFields } from "../events/validator-util.js";
|
|
7
|
-
import { getBaseUrl } from "../common-util.js";
|
|
7
|
+
import { getBaseUrl, deepCopy } from "../common-util.js";
|
|
8
8
|
import { isMobileBrowser } from "agilebuilder-ui/src/utils/common-util";
|
|
9
|
+
import { getFormModelFields, getModelFields } from "../page-init-util.js";
|
|
9
10
|
const functions = {
|
|
10
11
|
/**
|
|
11
12
|
* 展示页面中的某个组件元素
|
|
@@ -319,8 +320,114 @@ const functions = {
|
|
|
319
320
|
// 根据编码获取组件引用对象
|
|
320
321
|
getComponentRefByCode(pageContext, code) {
|
|
321
322
|
return getComponentRefByCode(pageContext, code);
|
|
323
|
+
},
|
|
324
|
+
// 获得表单数据查看信息,例如:下拉框选项名等
|
|
325
|
+
getFormViewData(pageContext) {
|
|
326
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
327
|
+
const entity = pageContext.entity ? pageContext.entity : {};
|
|
328
|
+
const viewEntity = deepCopy(entity);
|
|
329
|
+
const optionSourceMap = getOptionDatasSourceMap(pageContext);
|
|
330
|
+
for (let uuid in optionSourceMap) {
|
|
331
|
+
const cacheOptions = getComponentOptionDatasFromPage(pageContext, uuid);
|
|
332
|
+
const componentRef = getComponentRef(pageContext, uuid);
|
|
333
|
+
if (componentRef) {
|
|
334
|
+
const componentConfigure = componentRef.getConfigure();
|
|
335
|
+
if (componentConfigure) {
|
|
336
|
+
if (((_b = (_a = componentConfigure.props) == null ? void 0 : _a.dataOrigin) == null ? void 0 : _b.optionValueSetType) && (((_d = (_c = componentConfigure.props) == null ? void 0 : _c.dataOrigin) == null ? void 0 : _d.optionValueSetType) === "static" || ((_f = (_e = componentConfigure.props) == null ? void 0 : _e.dataOrigin) == null ? void 0 : _f.optionValueSetType) === "optionGroup")) {
|
|
337
|
+
if (componentConfigure.name && (componentConfigure.name === "select" && ((_h = (_g = componentConfigure.props) == null ? void 0 : _g.base) == null ? void 0 : _h.multiple) || componentConfigure.name === "checkbox")) {
|
|
338
|
+
let dynamicFields = getFormModelFields(pageContext, componentConfigure);
|
|
339
|
+
const propValue = getVariableValue(viewEntity, dynamicFields);
|
|
340
|
+
if (propValue) {
|
|
341
|
+
const propValues = propValue.split(",");
|
|
342
|
+
const label = getSelectShowLable(propValues, cacheOptions);
|
|
343
|
+
setVariableValue(viewEntity, dynamicFields, label);
|
|
344
|
+
}
|
|
345
|
+
} else {
|
|
346
|
+
let dynamicFields = getFormModelFields(pageContext, componentConfigure);
|
|
347
|
+
const propValue = getVariableValue(viewEntity, dynamicFields);
|
|
348
|
+
const label = getSelectShowLable(propValue, cacheOptions);
|
|
349
|
+
setVariableValue(viewEntity, dynamicFields, label);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
const listCodesMap = pageContext.listCodesMap;
|
|
356
|
+
for (let listCode in listCodesMap) {
|
|
357
|
+
let tableUuid;
|
|
358
|
+
if (listCode.indexOf("__") > 0) {
|
|
359
|
+
tableUuid = listCode.substring(listCode.lastIndexOf("__") + "__".length);
|
|
360
|
+
}
|
|
361
|
+
if (tableUuid) {
|
|
362
|
+
const componentRef = getComponentRef(pageContext, tableUuid);
|
|
363
|
+
if (componentRef) {
|
|
364
|
+
const componentConfigure = componentRef.getConfigure();
|
|
365
|
+
const prop = componentConfigure.code ? componentConfigure.code : listCode;
|
|
366
|
+
let dynamicFields = getModelFields(componentConfigure, prop);
|
|
367
|
+
const gridData = getVariableValue(viewEntity, dynamicFields);
|
|
368
|
+
const subTableOptions = componentRef.getTableSelectOptions(listCode);
|
|
369
|
+
packageSubTableShowLable(subTableOptions, gridData);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
return viewEntity.data;
|
|
322
374
|
}
|
|
323
375
|
};
|
|
376
|
+
function packageSubTableShowLable(subTableOptions, subData) {
|
|
377
|
+
if (subTableOptions && subData) {
|
|
378
|
+
subData.forEach((rowData) => {
|
|
379
|
+
const props = Object.keys(subTableOptions);
|
|
380
|
+
props.forEach((prop) => {
|
|
381
|
+
const propValue = rowData[prop];
|
|
382
|
+
const values = subTableOptions[prop];
|
|
383
|
+
const propSelectOptions = values.options;
|
|
384
|
+
const column = values.column;
|
|
385
|
+
let propLabel;
|
|
386
|
+
if (column && column.componentType && (column.componentType === "multiselect" || column.componentType === "checkbox")) {
|
|
387
|
+
if (propValue) {
|
|
388
|
+
const propValues = propValue.split(",");
|
|
389
|
+
propLabel = getSelectShowLable(propValues, propSelectOptions);
|
|
390
|
+
}
|
|
391
|
+
} else {
|
|
392
|
+
propLabel = getSelectShowLable(propValue, propSelectOptions);
|
|
393
|
+
}
|
|
394
|
+
rowData[prop] = propLabel;
|
|
395
|
+
});
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
function getSelectShowLable(propValue, propSelectOptions) {
|
|
400
|
+
let showLabel;
|
|
401
|
+
if (propValue !== void 0 && propValue !== null && propSelectOptions) {
|
|
402
|
+
if (Array.isArray(propValue)) {
|
|
403
|
+
showLabel = "";
|
|
404
|
+
propValue.forEach((val) => {
|
|
405
|
+
showLabel = showLabel + getSingleSelectShowLable(propValue, propSelectOptions) + ",";
|
|
406
|
+
});
|
|
407
|
+
if (showLabel.indexOf(",") > 0) {
|
|
408
|
+
showLabel = showLabel.substring(0, showLabel.lastIndexOf(","));
|
|
409
|
+
}
|
|
410
|
+
} else {
|
|
411
|
+
showLabel = propValue;
|
|
412
|
+
showLabel = getSingleSelectShowLable(propValue, propSelectOptions);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
return showLabel;
|
|
416
|
+
}
|
|
417
|
+
function getSingleSelectShowLable(propValue, propSelectOptions) {
|
|
418
|
+
let showLabel = propValue;
|
|
419
|
+
if (propValue !== void 0 && propValue !== null && propSelectOptions) {
|
|
420
|
+
for (let i = 0; i < propSelectOptions.length; i++) {
|
|
421
|
+
const optValue = propSelectOptions[i].value;
|
|
422
|
+
const optLabel = propSelectOptions[i].label ? propSelectOptions[i].label : propSelectOptions[i].name;
|
|
423
|
+
if (propValue + "" === optValue + "" && (optLabel !== void 0 && optLabel !== null)) {
|
|
424
|
+
showLabel = optLabel;
|
|
425
|
+
break;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
return showLabel;
|
|
430
|
+
}
|
|
324
431
|
function packageInitInfo(pageContext, type, settings) {
|
|
325
432
|
if (!pageContext.initInfo) {
|
|
326
433
|
pageContext.initInfo = {};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { setValueForVariableName, getValueFromSource, formatVariableValue } from "../page-helper-util.js";
|
|
2
2
|
import { deepCopy } from "../common-util.js";
|
|
3
3
|
import { CommonName, caculateFormulaValue, sortDatas, limitDatas, executeChartFormula } from "./chart-util.js";
|
|
4
|
+
import { handleChartEvent } from "../events/event-util.js";
|
|
4
5
|
function updateChartOption(pageContext, configure, chartOption, resultData) {
|
|
5
6
|
var _a;
|
|
6
7
|
if (!resultData || !resultData.result) {
|
|
7
8
|
return;
|
|
8
9
|
}
|
|
10
|
+
handleChartEvent(pageContext, configure, "beforeUpdateChart", chartOption, {
|
|
11
|
+
resultData
|
|
12
|
+
});
|
|
9
13
|
const result = resultData && resultData.result ? resultData.result : {};
|
|
10
14
|
let groupValue = resultData && resultData.groupValue ? resultData.groupValue : void 0;
|
|
11
15
|
const dataSetField = configure.serviceDataField;
|
|
@@ -312,6 +316,9 @@ function updateChartOption(pageContext, configure, chartOption, resultData) {
|
|
|
312
316
|
configure.highlightInfos = [];
|
|
313
317
|
setValueForVariableName(pageContext.entity, selGroupVariable, null);
|
|
314
318
|
}
|
|
319
|
+
handleChartEvent(pageContext, configure, "afterUpdateChart", chartOption, {
|
|
320
|
+
resultData
|
|
321
|
+
});
|
|
315
322
|
configure.groupFields = realGroupFilds;
|
|
316
323
|
configure.cacheDatas = datas;
|
|
317
324
|
configure.rawResult = resultData;
|
|
@@ -127,6 +127,20 @@ function initChartOption(configure, chartOption) {
|
|
|
127
127
|
if (yAxis.data) {
|
|
128
128
|
yAxis.data = [];
|
|
129
129
|
}
|
|
130
|
+
if (yAxis._dataMin === "auto") {
|
|
131
|
+
yAxis.min = function(value) {
|
|
132
|
+
if (value.min) {
|
|
133
|
+
return Math.floor(value.min / 10) * 10;
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
if (yAxis._dataMax === "auto") {
|
|
138
|
+
yAxis.max = function(value) {
|
|
139
|
+
if (value.max) {
|
|
140
|
+
return Math.ceil(value.max / 10) * 10;
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
}
|
|
130
144
|
}
|
|
131
145
|
}
|
|
132
146
|
configure.defaultYaxis = defaultYaxis;
|
|
@@ -26,3 +26,4 @@ export declare function getPropClassName(configure: Component): any;
|
|
|
26
26
|
export declare function isNumber(numStr: any): boolean;
|
|
27
27
|
export declare function isWorkflowPage(pageContext: PageContext): boolean;
|
|
28
28
|
export declare function refreshMobileDialogType(jumpPageSetting: any, isMobile: boolean): void;
|
|
29
|
+
export declare function isVariableInvalidValue(values: any, variable: string): boolean;
|
|
@@ -162,6 +162,9 @@ function refreshMobileDialogType(jumpPageSetting, isMobile) {
|
|
|
162
162
|
jumpPageSetting.jumpPageMobileOpenMode = openMode;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
+
function isVariableInvalidValue(values, variable) {
|
|
166
|
+
return values[variable] === null || values[variable] === void 0 || values[variable] === "";
|
|
167
|
+
}
|
|
165
168
|
export {
|
|
166
169
|
deepCopy,
|
|
167
170
|
getBaseUrl,
|
|
@@ -171,6 +174,7 @@ export {
|
|
|
171
174
|
getWorkflowId,
|
|
172
175
|
isArrayFn,
|
|
173
176
|
isNumber,
|
|
177
|
+
isVariableInvalidValue,
|
|
174
178
|
isWorkflowPage,
|
|
175
179
|
packageTemplateFiles,
|
|
176
180
|
refreshMobileDialogType,
|
|
@@ -86,3 +86,4 @@ export declare function fileUploadDeleted(pageContext: any, configureObj: any, p
|
|
|
86
86
|
* @param configure 组件配置
|
|
87
87
|
*/
|
|
88
88
|
export declare function isShowComponent(configure: Component): boolean;
|
|
89
|
+
export declare function handleChartEvent(pageContext: PageContext, configure: Component, eventType: string, chartOption: object, otherParams?: object): any;
|
|
@@ -674,7 +674,9 @@ function isShowComponent(configure) {
|
|
|
674
674
|
if (!isMobile) {
|
|
675
675
|
const events = configure && configure.events ? configure.events : [];
|
|
676
676
|
if (events) {
|
|
677
|
-
const eventArr = events.filter(
|
|
677
|
+
const eventArr = events.filter(
|
|
678
|
+
(item) => item.name === "click" && item.isStandard && item.eventName && item.eventName === "showSearch"
|
|
679
|
+
);
|
|
678
680
|
if (eventArr && eventArr.length > 0) {
|
|
679
681
|
isShow = false;
|
|
680
682
|
}
|
|
@@ -682,6 +684,16 @@ function isShowComponent(configure) {
|
|
|
682
684
|
}
|
|
683
685
|
return isShow;
|
|
684
686
|
}
|
|
687
|
+
function handleChartEvent(pageContext, configure, eventType, chartOption, otherParams) {
|
|
688
|
+
const events = configure && configure.runtime && configure.runtime.events ? configure.runtime.events : [];
|
|
689
|
+
const eventFun = getEventFuncByType(pageContext, events, eventType);
|
|
690
|
+
return callItemEvent(pageContext, configure, eventFun, {
|
|
691
|
+
configure,
|
|
692
|
+
pageContext,
|
|
693
|
+
chartOption,
|
|
694
|
+
...otherParams
|
|
695
|
+
});
|
|
696
|
+
}
|
|
685
697
|
export {
|
|
686
698
|
appendDefaultMethods,
|
|
687
699
|
canExecuteButton,
|
|
@@ -700,6 +712,7 @@ export {
|
|
|
700
712
|
gridSelectAllRecords,
|
|
701
713
|
gridSelectRecord,
|
|
702
714
|
gridSelectionChange,
|
|
715
|
+
handleChartEvent,
|
|
703
716
|
handleEvent,
|
|
704
717
|
handleFormEvent,
|
|
705
718
|
headerClick,
|
|
@@ -13,6 +13,7 @@ import { updateChartDatasources, getVariableValue, setVariableValue } from "../p
|
|
|
13
13
|
import printLabelUtil from "./print-label.js";
|
|
14
14
|
import { getTableNameByTableUuid } from "../table-utils.js";
|
|
15
15
|
import { packageCustomRules, getWorkflowRules } from "./validator-util.js";
|
|
16
|
+
import { functions } from "../api/page-expose-util.js";
|
|
16
17
|
const standardEvents = {
|
|
17
18
|
// 表单标准事件保存save
|
|
18
19
|
save: function(params) {
|
|
@@ -338,7 +339,8 @@ function exportFormReport(pageContext, configureObj, templateFile, isPdf) {
|
|
|
338
339
|
const button = configureObj.props.base;
|
|
339
340
|
const tableName = configureObj.tableName ? configureObj.tableName : pageContext.tableName;
|
|
340
341
|
const backendUrl = pageContext.backendUrl;
|
|
341
|
-
const viewModels = pageContext
|
|
342
|
+
const viewModels = functions.getFormViewData(pageContext);
|
|
343
|
+
console.log("exportFormReport----viewModels=", viewModels);
|
|
342
344
|
const isPermission = button.isPermission === void 0 || button.isPermission === "true" || button.isPermission;
|
|
343
345
|
const functionCodes = getPermissionCodes(configureObj, pageContext);
|
|
344
346
|
const param = {
|
|
@@ -2162,7 +2164,8 @@ function formatAdditionalParamMapIds(ids2) {
|
|
|
2162
2164
|
ids2 = ids2.split(",");
|
|
2163
2165
|
} else if (typeof ids2 === "number") {
|
|
2164
2166
|
ids2 = [ids2];
|
|
2165
|
-
} else
|
|
2167
|
+
} else
|
|
2168
|
+
;
|
|
2166
2169
|
}
|
|
2167
2170
|
return ids2;
|
|
2168
2171
|
}
|
|
@@ -75,10 +75,25 @@ function getEndObjectRule(rule, props, currentProp) {
|
|
|
75
75
|
}
|
|
76
76
|
function getValidator(columns) {
|
|
77
77
|
const rules = {};
|
|
78
|
+
if (columns) {
|
|
79
|
+
columns.forEach((editField) => {
|
|
80
|
+
const prop = editField.model;
|
|
81
|
+
if (prop && editField.validations) {
|
|
82
|
+
const validations = editField.validations;
|
|
83
|
+
if (prop.indexOf(".") > 0) {
|
|
84
|
+
setObjectPropRule(editField.prop, rules, validations);
|
|
85
|
+
} else {
|
|
86
|
+
if (validations && validations.length > 0) {
|
|
87
|
+
rules[prop] = [...validations];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
78
93
|
return rules;
|
|
79
94
|
}
|
|
80
95
|
function validator(entity, rules, columns, rowIndex, isSql) {
|
|
81
|
-
return validatorEntity(entity, rules, columns, rowIndex, true);
|
|
96
|
+
return validatorEntity(entity, rules, columns, rowIndex, true, isSql);
|
|
82
97
|
}
|
|
83
98
|
function sublistVerify(rules) {
|
|
84
99
|
if (!rules) {
|
|
@@ -104,7 +119,7 @@ function sublistVerify(rules) {
|
|
|
104
119
|
function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdate, isSql) {
|
|
105
120
|
let validateRules = sublistVerify(rules);
|
|
106
121
|
if ((!rules || rules === null) && columns) {
|
|
107
|
-
validateRules = getValidator();
|
|
122
|
+
validateRules = getValidator(columns);
|
|
108
123
|
}
|
|
109
124
|
if (!validateRules || Object.keys(validateRules).length === 0) {
|
|
110
125
|
entity["validateErrorField"] = "";
|
|
@@ -122,6 +137,11 @@ function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdat
|
|
|
122
137
|
if (errors) {
|
|
123
138
|
result = errors[0].message;
|
|
124
139
|
fieldName = errors[0]["field"];
|
|
140
|
+
if (typeof rowIndex !== "undefined" && rowIndex !== null) {
|
|
141
|
+
result = getI18n().t("superPageRuntimeMessage.recordLine", {
|
|
142
|
+
row: rowIndex + 1
|
|
143
|
+
}) + "," + result;
|
|
144
|
+
}
|
|
125
145
|
ElMessage({
|
|
126
146
|
message: result,
|
|
127
147
|
showClose: true,
|
|
@@ -134,11 +154,11 @@ function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdat
|
|
|
134
154
|
}
|
|
135
155
|
if (fieldName && isShouldRepeateValdate === true) {
|
|
136
156
|
const reg1 = /[A-Z]+/;
|
|
137
|
-
if (reg1.test(fieldName) && entity[fieldName.toLowerCase()] !== void 0) {
|
|
157
|
+
if (isSql !== void 0 && isSql === true && reg1.test(fieldName) && entity[fieldName.toLowerCase()] !== void 0) {
|
|
138
158
|
const copyEntity = JSON.parse(JSON.stringify(entity));
|
|
139
159
|
copyEntity[fieldName.toUpperCase()] = entity[fieldName.toLowerCase()];
|
|
140
160
|
delete copyEntity[fieldName.toLowerCase()];
|
|
141
|
-
result = validatorEntity(copyEntity, rules, columns, rowIndex, false);
|
|
161
|
+
result = validatorEntity(copyEntity, rules, columns, rowIndex, false, isSql);
|
|
142
162
|
}
|
|
143
163
|
}
|
|
144
164
|
}
|
|
@@ -251,7 +271,7 @@ function validateCommon(dataModel, pageContext, rules) {
|
|
|
251
271
|
if (!rules || Object.keys(rules).length === 0) {
|
|
252
272
|
resolve(true);
|
|
253
273
|
} else {
|
|
254
|
-
const validateEntityResult = validator(handleModels, rules, null, null);
|
|
274
|
+
const validateEntityResult = validator(handleModels, rules, null, null, true);
|
|
255
275
|
if (validateEntityResult === true) {
|
|
256
276
|
const validateResult = validateSubTables(pageContext);
|
|
257
277
|
if (validateResult === true) {
|
|
@@ -20,6 +20,12 @@ export declare function initComponentDataSources(component: Component, pageConte
|
|
|
20
20
|
* @param dataSourceConfs 初始化数据配置参数
|
|
21
21
|
*/
|
|
22
22
|
export declare function updateChartDatasources(pageContext: PageContext, dataSourceConfs: Array<any>, appendParams: any, isInit?: boolean): Promise<any>;
|
|
23
|
+
/**
|
|
24
|
+
* 更新指定uuid图表的数据
|
|
25
|
+
* @param pageContext 页面上下文
|
|
26
|
+
* @param componentUuid 组件uuid
|
|
27
|
+
*/
|
|
28
|
+
export declare function updateChartDatasourcesByComponent(pageContext: PageContext, componentUuid: string): void;
|
|
23
29
|
/**
|
|
24
30
|
* 初始化数据源
|
|
25
31
|
* @param pageContext 页面上下文
|
|
@@ -32,6 +38,18 @@ export declare function updateOptionDatasources(pageContext: PageContext, dataSo
|
|
|
32
38
|
* @param configure
|
|
33
39
|
*/
|
|
34
40
|
export declare function getOptionDatasFromPage(pageContext: PageContext, configure: Component): any;
|
|
41
|
+
/**
|
|
42
|
+
* 从页面缓存中获取查询到的选项组数据
|
|
43
|
+
* @param pageContext
|
|
44
|
+
* @param configure
|
|
45
|
+
*/
|
|
46
|
+
export declare function getComponentOptionDatasFromPage(pageContext: PageContext, configureUuid: string): any;
|
|
47
|
+
/**
|
|
48
|
+
* 从页面缓存中获取查询到的选项组数据
|
|
49
|
+
* @param pageContext
|
|
50
|
+
* @param configure
|
|
51
|
+
*/
|
|
52
|
+
export declare function getOptionDatasSourceMap(pageContext: PageContext): any;
|
|
35
53
|
/**
|
|
36
54
|
* 从页面缓存中获取查询到的统计图数据
|
|
37
55
|
* @param pageContext
|
|
@@ -80,7 +80,8 @@ function getTableQueryInfo(dataOriginInfo, pageContext2) {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
if (f.propValue)
|
|
83
|
+
if (f.propValue)
|
|
84
|
+
;
|
|
84
85
|
searchForm.push(tempObj);
|
|
85
86
|
}
|
|
86
87
|
infoObj.props.searchForm = searchForm;
|
|
@@ -187,6 +188,14 @@ function updateChartDatasources(pageContext2, dataSourceConfs, appendParams, isI
|
|
|
187
188
|
});
|
|
188
189
|
});
|
|
189
190
|
}
|
|
191
|
+
function updateChartDatasourcesByComponent(pageContext2, componentUuid) {
|
|
192
|
+
const chartDataSource = pageContext2.initChartServiceConfigs.find(
|
|
193
|
+
(item) => item.uuid === componentUuid
|
|
194
|
+
);
|
|
195
|
+
if (chartDataSource) {
|
|
196
|
+
updateChartDatasources(pageContext2, [chartDataSource], null, false);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
190
199
|
function updateOptionDatasources(pageContext2, dataSourceConfs, query) {
|
|
191
200
|
return new Promise((resolve, reject) => {
|
|
192
201
|
if (!dataSourceConfs || dataSourceConfs.length == 0) {
|
|
@@ -234,12 +243,20 @@ function updateOptionDatasources(pageContext2, dataSourceConfs, query) {
|
|
|
234
243
|
});
|
|
235
244
|
}
|
|
236
245
|
function getOptionDatasFromPage(pageContext2, configure2) {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
const
|
|
246
|
+
return getComponentOptionDatasFromPage(pageContext2, configure2.uuid);
|
|
247
|
+
}
|
|
248
|
+
function getComponentOptionDatasFromPage(pageContext2, configureUuid) {
|
|
249
|
+
const optionSourceMap = getOptionDatasSourceMap(pageContext2);
|
|
250
|
+
const cacheOptions = optionSourceMap[configureUuid];
|
|
241
251
|
return cacheOptions ? cacheOptions : [];
|
|
242
252
|
}
|
|
253
|
+
function getOptionDatasSourceMap(pageContext2) {
|
|
254
|
+
if (!pageContext2 || !pageContext2.optionSourceMap) {
|
|
255
|
+
return {};
|
|
256
|
+
}
|
|
257
|
+
const cacheOptions = pageContext2.optionSourceMap;
|
|
258
|
+
return cacheOptions ? cacheOptions : {};
|
|
259
|
+
}
|
|
243
260
|
function getChartDatasFromPage(pageContext2, configure2) {
|
|
244
261
|
if (!pageContext2 || !pageContext2.chartDataSourceMap || !configure2) {
|
|
245
262
|
return null;
|
|
@@ -661,8 +678,10 @@ export {
|
|
|
661
678
|
formatVariableValue,
|
|
662
679
|
getChartDatasFromPage,
|
|
663
680
|
getComponentOptionConfigs,
|
|
681
|
+
getComponentOptionDatasFromPage,
|
|
664
682
|
getFormPropName,
|
|
665
683
|
getOptionDatasFromPage,
|
|
684
|
+
getOptionDatasSourceMap,
|
|
666
685
|
getParamNames,
|
|
667
686
|
getSizeConfig,
|
|
668
687
|
getValueFromSource,
|
|
@@ -675,5 +694,6 @@ export {
|
|
|
675
694
|
setVariableValue,
|
|
676
695
|
setVariableValueWithProp,
|
|
677
696
|
updateChartDatasources,
|
|
697
|
+
updateChartDatasourcesByComponent,
|
|
678
698
|
updateOptionDatasources
|
|
679
699
|
};
|
|
@@ -56,7 +56,7 @@ function convertToPageContext(pageDesign, pageRequest) {
|
|
|
56
56
|
//初始化request对象
|
|
57
57
|
page: {},
|
|
58
58
|
context: pageDesign.contextParam,
|
|
59
|
-
system:
|
|
59
|
+
system: pageDesign.systemParam
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
if (pageDesign.props && pageDesign.props.notIdInitializationList) {
|
|
@@ -74,6 +74,8 @@ function convertToPageContext(pageDesign, pageRequest) {
|
|
|
74
74
|
if (variable.name) {
|
|
75
75
|
if (variable.isArrayElement) {
|
|
76
76
|
pageObj[variable.name] = [];
|
|
77
|
+
} else if (variable.defaultValue) {
|
|
78
|
+
pageObj[variable.name] = variable.defaultValue;
|
|
77
79
|
} else {
|
|
78
80
|
pageObj[variable.name] = void 0;
|
|
79
81
|
}
|
|
@@ -138,7 +140,8 @@ function getRequestObject(pageRequest) {
|
|
|
138
140
|
requestObj[paramStrs[0]] = paramStrs.length > 1 ? paramStrs[1] : "";
|
|
139
141
|
}
|
|
140
142
|
}
|
|
141
|
-
if (requestObj["_t_"])
|
|
143
|
+
if (requestObj["_t_"])
|
|
144
|
+
;
|
|
142
145
|
return requestObj;
|
|
143
146
|
}
|
|
144
147
|
function packageAdditionalMapWithRoute(route, requestObj) {
|
|
@@ -22,7 +22,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
22
22
|
return props.pageContext.canClick !== void 0 && props.pageContext.clickUuid !== void 0 ? !props.pageContext.canClick && props.pageContext.clickUuid === props.configure.uuid : false;
|
|
23
23
|
}
|
|
24
24
|
onMounted(() => {
|
|
25
|
-
console.log("
|
|
25
|
+
console.log("button-----onMounted");
|
|
26
26
|
});
|
|
27
27
|
return (_ctx, _cache) => {
|
|
28
28
|
const _component_el_button = resolveComponent("el-button");
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { defineComponent, ref, resolveComponent, openBlock, createElementBlock, createVNode } from "vue";
|
|
2
|
+
const _hoisted_1 = { style: { "padding": "5px", "text-align": "center" } };
|
|
3
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
+
__name: "table-pageination",
|
|
5
|
+
props: {
|
|
6
|
+
configure: {
|
|
7
|
+
type: Object,
|
|
8
|
+
default: () => {
|
|
9
|
+
return {};
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
pageContext: {
|
|
13
|
+
type: Object,
|
|
14
|
+
default: () => {
|
|
15
|
+
return {};
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
column: {
|
|
19
|
+
type: Object,
|
|
20
|
+
default: () => {
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
total: {
|
|
25
|
+
type: Number,
|
|
26
|
+
default: 0
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
emits: ["pageChange", "pageSizeChange"],
|
|
30
|
+
setup(__props, { emit: __emit }) {
|
|
31
|
+
const props = __props;
|
|
32
|
+
const emits = __emit;
|
|
33
|
+
const currentPage = ref(1);
|
|
34
|
+
const pageSize = ref(props.configure.pageination.pageSize);
|
|
35
|
+
const handleCurrentChange = (val) => {
|
|
36
|
+
currentPage.value = val;
|
|
37
|
+
emits("pageChange", currentPage.value, pageSize.value);
|
|
38
|
+
};
|
|
39
|
+
const handleSizeChange = (val) => {
|
|
40
|
+
pageSize.value = val;
|
|
41
|
+
emits("pageSizeChange", currentPage.value, pageSize.value);
|
|
42
|
+
};
|
|
43
|
+
return (_ctx, _cache) => {
|
|
44
|
+
const _component_el_pagination = resolveComponent("el-pagination");
|
|
45
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
46
|
+
createVNode(_component_el_pagination, {
|
|
47
|
+
"current-page": currentPage.value,
|
|
48
|
+
"onUpdate:currentPage": _cache[0] || (_cache[0] = ($event) => currentPage.value = $event),
|
|
49
|
+
"page-size": pageSize.value,
|
|
50
|
+
"onUpdate:pageSize": _cache[1] || (_cache[1] = ($event) => pageSize.value = $event),
|
|
51
|
+
"page-sizes": [10, 30, 50, 100],
|
|
52
|
+
size: "small",
|
|
53
|
+
layout: "total, sizes, prev, pager, next, jumper",
|
|
54
|
+
total: __props.total,
|
|
55
|
+
onCurrentChange: handleCurrentChange,
|
|
56
|
+
onSizeChange: handleSizeChange
|
|
57
|
+
}, null, 8, ["current-page", "page-size", "total"])
|
|
58
|
+
]);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
export {
|
|
63
|
+
_sfc_main as default
|
|
64
|
+
};
|