super-page-runtime 2.1.21 → 2.1.23

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.
Files changed (20) hide show
  1. package/dist/es/components/runtime/utils/api/api-util.js +3 -2
  2. package/dist/es/components/runtime/utils/api/page-expose-util.js +13 -0
  3. package/dist/es/components/runtime/utils/charts/chart-util.d.ts +10 -0
  4. package/dist/es/components/runtime/utils/charts/chart-util.js +9 -0
  5. package/dist/es/components/runtime/utils/common-util.js +1 -1
  6. package/dist/es/components/runtime/utils/events/standard-event.d.ts +2 -0
  7. package/dist/es/components/runtime/utils/events/standard-event.js +106 -24
  8. package/dist/es/components/runtime/utils/events/validator-util.js +26 -6
  9. package/dist/es/components/runtime/utils/page-helper-util.d.ts +1 -1
  10. package/dist/es/components/runtime/utils/page-helper-util.js +10 -4
  11. package/dist/es/components/runtime/utils/page-init-util.js +2 -1
  12. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +6 -2
  13. package/dist/es/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue2.js +6 -2
  14. package/dist/es/components/runtime/views/assemblys/chart/pie/pie-runtime.vue2.js +6 -2
  15. package/dist/es/components/runtime/views/assemblys/chart/radar/radar-runtime.vue2.js +6 -2
  16. package/dist/es/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue2.js +6 -2
  17. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue.js +1 -1
  18. package/dist/es/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue3.js +1 -0
  19. package/dist/es/components/runtime/views/super-page.vue.js +20 -10
  20. package/package.json +2 -2
@@ -68,7 +68,7 @@ function getCommonFormData(pageContext, id) {
68
68
  param["taskId"] = taskId;
69
69
  }
70
70
  console.log("getCommonFormData---listCodesMap=", pageContext.listCodesMap);
71
- if (!pageContext.listCodesMap && pageContext.tableUuids) {
71
+ if ((!pageContext.listCodesMap || Object.keys(pageContext.listCodesMap).length === 0) && pageContext.tableUuids) {
72
72
  const listCodesMap = {};
73
73
  pageContext.tableUuids.forEach((tableUuid) => {
74
74
  const listCode = getListCode(pageCode, pageVersion, tableUuid);
@@ -292,7 +292,8 @@ function formatAdditionalParamMapIds(ids) {
292
292
  ids = ids.split(",");
293
293
  } else if (typeof ids === "number") {
294
294
  ids = [ids];
295
- } else ;
295
+ } else
296
+ ;
296
297
  }
297
298
  return ids;
298
299
  }
@@ -4,6 +4,7 @@ import eventBus from "../eventBus.js";
4
4
  import http from "agilebuilder-ui/src/utils/request";
5
5
  import { getAdditionalParamMap } from "../events/standard-event.js";
6
6
  import { i18nValidatePropRulesMessage } from "../events/validator-util.js";
7
+ import { getBaseUrl } from "../common-util.js";
7
8
  const functions = {
8
9
  /**
9
10
  * 展示页面中的某个组件元素
@@ -266,6 +267,18 @@ const functions = {
266
267
  } else {
267
268
  console.error("tableUUid is undefined");
268
269
  }
270
+ },
271
+ // 根据key获得serverConfig中配置的信息
272
+ getServerConfigValue(key) {
273
+ return window["$vueApp"].config.globalProperties[key];
274
+ },
275
+ // 获得当前系统的后端访问路径
276
+ getBackendUrl(pageContext) {
277
+ return getBaseUrl(pageContext.backendUrl, false);
278
+ },
279
+ // 获得平台后端访问路径
280
+ getPlateBackendUrl() {
281
+ return window["$vueApp"].config.globalProperties.baseAPI;
269
282
  }
270
283
  };
271
284
  function packageAllFeildsRules(pageContext, item) {
@@ -75,3 +75,13 @@ export declare function caculateFormulaValue(itemConfs: any, datas: any, accumul
75
75
  * @param pageContext 页面对象
76
76
  */
77
77
  export declare function executeChartFormula(formulaStr: string, accumulateMap: any, rowData: any, pageContext: PageContext): any;
78
+ /**
79
+ * 导出图表工具方法
80
+ * @param chartDom
81
+ * @returns
82
+ */
83
+ export declare function exportCommonChart(chartDom: any): {
84
+ isTable: boolean;
85
+ fileContent: any;
86
+ fileSize: string;
87
+ };
@@ -482,11 +482,20 @@ function executeChartFormula(formulaStr, accumulateMap, rowData, pageContext) {
482
482
  row: rowData
483
483
  });
484
484
  }
485
+ function exportCommonChart(chartDom) {
486
+ const fileSize = chartDom.getAttribute("width") + ":" + chartDom.getAttribute("height");
487
+ return {
488
+ isTable: false,
489
+ fileContent: chartDom.getAttribute("base64Url"),
490
+ fileSize
491
+ };
492
+ }
485
493
  export {
486
494
  CommonName,
487
495
  caculateFormulaValue,
488
496
  clearChartSelected,
489
497
  executeChartFormula,
498
+ exportCommonChart,
490
499
  getCustomTheme,
491
500
  getCustomThemeOptions,
492
501
  getNumFormatter,
@@ -76,7 +76,7 @@ function getListCode(pageCode, pageVersion, tableUuid) {
76
76
  return "V" + pageVersion + "__" + pageCode + "__" + tableUuid;
77
77
  }
78
78
  function deepCopy(srcObj) {
79
- if (typeof srcObj !== "object" || srcObj === null) {
79
+ if (typeof srcObj !== "object" || srcObj === null || srcObj === void 0) {
80
80
  return srcObj;
81
81
  }
82
82
  const copyObj = Array.isArray(srcObj) ? [] : {};
@@ -40,6 +40,8 @@ export declare const standardEvents: {
40
40
  lineEditCreate: (params: any) => void;
41
41
  printLabel: (params: any) => void;
42
42
  queryCharts: (params: any) => void;
43
+ resetCharts: (params: any) => void;
44
+ exportCharts: (params: any) => void;
43
45
  };
44
46
  export declare function exportFormReport(pageContext: any, configureObj: any, templateFile: any, isPdf: any): void;
45
47
  export declare function getSaveFormRequestWithRow(pageContext: PageContext, configureObj: any, url: string, isUnControlVersion: boolean, mainDefaultValueColumns: any, dynamicColumnInfo: any, row: any, otherParams: any): any;
@@ -1,4 +1,4 @@
1
- import { getBaseUrl, getRealRestApiPath, upperFirstCase, isWorkflowPage, packageTemplateFiles, deepCopy, isArrayFn } from "../common-util.js";
1
+ import { deepCopy, getBaseUrl, getRealRestApiPath, upperFirstCase, isWorkflowPage, packageTemplateFiles, isArrayFn } from "../common-util.js";
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";
@@ -216,32 +216,114 @@ const standardEvents = {
216
216
  },
217
217
  queryCharts: function(params) {
218
218
  console.log("查询统计图--params=", params);
219
- const pageContext = params.pageContext;
220
- const chartConfigs = pageContext.initChartServiceConfigs;
221
- if (!chartConfigs || chartConfigs.length == 0) {
222
- console.log("无需要查询的统计图数据");
223
- return;
224
- }
225
- const configure = params.configureObj;
226
- let runtimeProps = null;
227
- if (configure && configure.runtime) {
228
- runtimeProps = configure.runtime.props;
219
+ queryPageCharts(params);
220
+ },
221
+ resetCharts: function(params) {
222
+ var _a, _b;
223
+ console.log("重置统计图--params=", params);
224
+ let pageContext = params.pageContext;
225
+ pageContext.entity.data = deepCopy((_a = pageContext.initChartData) == null ? void 0 : _a.data);
226
+ pageContext.entity.page = deepCopy((_b = pageContext.initChartData) == null ? void 0 : _b.page);
227
+ params.isInitChart = true;
228
+ queryPageCharts(params);
229
+ },
230
+ exportCharts: function(params) {
231
+ console.log("导出统计图--params=", params);
232
+ exportPageCharts(params);
233
+ }
234
+ };
235
+ function queryPageCharts(params) {
236
+ const pageContext = params.pageContext;
237
+ const chartConfigs = pageContext.initChartServiceConfigs;
238
+ if (!chartConfigs || chartConfigs.length == 0) {
239
+ console.log("无需要查询的统计图数据");
240
+ return;
241
+ }
242
+ const configure = params.configureObj;
243
+ let runtimeProps = null;
244
+ if (configure && configure.runtime) {
245
+ runtimeProps = configure.runtime.props;
246
+ }
247
+ const hisState = runtimeProps ? runtimeProps.state : void 0;
248
+ if (runtimeProps) {
249
+ runtimeProps.state = "disabled";
250
+ }
251
+ updateChartDatasources(pageContext, chartConfigs, void 0, params.isInitChart).then(() => {
252
+ if (runtimeProps) {
253
+ runtimeProps.state = hisState;
229
254
  }
230
- const hisState = runtimeProps ? runtimeProps.state : void 0;
255
+ }).catch(() => {
231
256
  if (runtimeProps) {
232
- runtimeProps.state = "disabled";
257
+ runtimeProps.state = hisState;
233
258
  }
234
- updateChartDatasources(pageContext, chartConfigs, void 0).then(() => {
235
- if (runtimeProps) {
236
- runtimeProps.state = hisState;
237
- }
238
- }).catch(() => {
239
- if (runtimeProps) {
240
- runtimeProps.state = hisState;
259
+ });
260
+ }
261
+ function exportPageCharts(params) {
262
+ const pageContext = params.pageContext;
263
+ const chartConfigs = pageContext.initChartServiceConfigs;
264
+ if (!chartConfigs || chartConfigs.length == 0) {
265
+ console.log("无需要导出的统计图数据");
266
+ return;
267
+ }
268
+ const configure = params.configureObj;
269
+ let runtimeProps = null;
270
+ if (configure && configure.runtime) {
271
+ runtimeProps = configure.runtime.props;
272
+ }
273
+ const hisState = runtimeProps ? runtimeProps.state : void 0;
274
+ if (runtimeProps) {
275
+ runtimeProps.state = "disabled";
276
+ }
277
+ let exportChartList = [];
278
+ for (let i = 0; i < chartConfigs.length; i++) {
279
+ const chartDataSourceConfig = chartConfigs[i];
280
+ const chartUuid = chartDataSourceConfig.uuid;
281
+ const componentObj = getComponentRef(pageContext, chartUuid);
282
+ if (componentObj) {
283
+ const chartConfig = componentObj.getConfigure();
284
+ if (chartConfig && chartConfig.exportable && componentObj.exportChart) {
285
+ exportChartList.push(componentObj.exportChart());
241
286
  }
242
- });
287
+ }
243
288
  }
244
- };
289
+ if (!exportChartList || exportChartList.length == 0) {
290
+ console.log("无需要导出的统计图数据");
291
+ return;
292
+ }
293
+ let exportFileName;
294
+ let pageName = pageContext.label;
295
+ if (!pageName) {
296
+ pageName = pageContext.code;
297
+ }
298
+ exportFileName = pageName;
299
+ const param = {
300
+ reportDataList: exportChartList,
301
+ beanName: pageContext.beanName
302
+ };
303
+ const backendUrl = pageContext.backendUrl;
304
+ let request;
305
+ const baseUrl = getBaseUrl(backendUrl, pageContext.isTest);
306
+ const path = baseUrl + "/dsc/commons/exportChart";
307
+ axios.defaults.headers.common.Authorization = getToken();
308
+ request = axios.post(
309
+ path,
310
+ param,
311
+ { responseType: "blob" }
312
+ );
313
+ request.then((res) => {
314
+ const link = document.createElement("a");
315
+ link.style.display = "none";
316
+ link.href = URL.createObjectURL(res.data);
317
+ link.setAttribute("download", exportFileName + ".xlsx");
318
+ document.body.appendChild(link);
319
+ link.click();
320
+ document.body.removeChild(link);
321
+ }).finally(() => {
322
+ if (runtimeProps) {
323
+ runtimeProps.state = hisState;
324
+ }
325
+ });
326
+ }
245
327
  function exportFormReport(pageContext, configureObj, templateFile, isPdf) {
246
328
  var _a;
247
329
  const templateUUID = templateFile.templateUuid;
@@ -801,8 +883,8 @@ function deleteFunc(params) {
801
883
  pageCode: pageContext.code,
802
884
  pageVersion: pageContext.version
803
885
  };
804
- if (configureBase.beanName) {
805
- param["beanName"] = configureBase.beanName;
886
+ if (pageContext.beanName) {
887
+ param["beanName"] = pageContext.beanName;
806
888
  }
807
889
  const deleteLogicSetting = configureObj.props.deleteLogicSetting;
808
890
  if (deleteLogicSetting) {
@@ -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
  }
@@ -186,7 +206,7 @@ function validateWorkflowFormDataModel(dataModel, pageContext) {
186
206
  if (!rules || Object.keys(rules).length === 0) {
187
207
  result = true;
188
208
  } else {
189
- result = validator(handleModels, rules, null, null);
209
+ result = validator(handleModels, rules, null, null, true);
190
210
  }
191
211
  if (result === true) {
192
212
  const workflowFieldPermissionRules = pageContext.workflowRules;
@@ -250,7 +270,7 @@ function validateCommonFormDataModel(dataModel, pageContext, rules) {
250
270
  if (!rules || Object.keys(rules).length === 0) {
251
271
  resolve(handleModels);
252
272
  } else {
253
- const validateEntityResult = validator(handleModels, rules, null, null);
273
+ const validateEntityResult = validator(handleModels, rules, null, null, true);
254
274
  if (validateEntityResult === true) {
255
275
  const validateResult = validateSubTables(pageContext);
256
276
  if (validateResult === true) {
@@ -19,7 +19,7 @@ export declare function initComponentDataSources(component: Component, pageConte
19
19
  * @param pageContext 页面上下文
20
20
  * @param dataSourceConfs 初始化数据配置参数
21
21
  */
22
- export declare function updateChartDatasources(pageContext: PageContext, dataSourceConfs: Array<any>, appendParams: any): Promise<any>;
22
+ export declare function updateChartDatasources(pageContext: PageContext, dataSourceConfs: Array<any>, appendParams: any, isInit?: boolean): Promise<any>;
23
23
  /**
24
24
  * 初始化数据源
25
25
  * @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;
@@ -129,7 +130,7 @@ function getServiceQueryInfo(dataOriginInfo, pageContext2) {
129
130
  infoObj.props.labelField = dataOriginInfo.serviceLabelField;
130
131
  return infoObj;
131
132
  }
132
- function updateChartDatasources(pageContext2, dataSourceConfs, appendParams) {
133
+ function updateChartDatasources(pageContext2, dataSourceConfs, appendParams, isInit) {
133
134
  return new Promise((resolve, reject) => {
134
135
  if (!dataSourceConfs || dataSourceConfs.length == 0) {
135
136
  reject(new Error("无需查询的统计图配置!"));
@@ -170,8 +171,13 @@ function updateChartDatasources(pageContext2, dataSourceConfs, appendParams) {
170
171
  for (const uuid in result) {
171
172
  pageContext2.chartDataSourceMap[uuid] = result[uuid];
172
173
  const componentObj = getComponentRef(pageContext2, uuid);
173
- if (componentObj && componentObj.updateChartDatas) {
174
- componentObj.updateChartDatas(result[uuid]);
174
+ if (componentObj) {
175
+ const chartConfig = componentObj.getConfigure();
176
+ if (!isInit || chartConfig && chartConfig.initializationQuery) {
177
+ if (componentObj.updateChartDatas) {
178
+ componentObj.updateChartDatas(result[uuid]);
179
+ }
180
+ }
175
181
  }
176
182
  }
177
183
  console.log("查询统计图数据完成", result);
@@ -138,7 +138,8 @@ function getRequestObject(pageRequest) {
138
138
  requestObj[paramStrs[0]] = paramStrs.length > 1 ? paramStrs[1] : "";
139
139
  }
140
140
  }
141
- if (requestObj["_t_"]) ;
141
+ if (requestObj["_t_"])
142
+ ;
142
143
  return requestObj;
143
144
  }
144
145
  function packageAdditionalMapWithRoute(route, requestObj) {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, ref, onMounted, watch, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, withDirectives, createVNode, vShow } from "vue";
2
- import { getCustomTheme, initChartOption, monitorChartClickToVariable, clearChartSelected } from "../../../../utils/charts/chart-util.js";
2
+ import { getCustomTheme, initChartOption, monitorChartClickToVariable, clearChartSelected, exportCommonChart } from "../../../../utils/charts/chart-util.js";
3
3
  import { getChartDatasFromPage, updateChartDatasources, monitorFieldChange } from "../../../../utils/page-helper-util.js";
4
4
  import { updateChartOption } from "../../../../utils/charts/chart-columnline-util.js";
5
5
  import { doClickJumpPageEvent } from "../../../../utils/events/event-util.js";
@@ -128,8 +128,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
128
128
  dataConfig.autoRefresh = false;
129
129
  updateChartOption(props.pageContext, props.configure, chartOption, resultData);
130
130
  }
131
+ function exportChart() {
132
+ exportCommonChart(chartRef.value);
133
+ }
131
134
  __expose({
132
- updateChartDatas
135
+ updateChartDatas,
136
+ exportChart
133
137
  });
134
138
  return (_ctx, _cache) => {
135
139
  return openBlock(), createElementBlock("div", {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, ref, onMounted, watch, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, withDirectives, createVNode, vShow } from "vue";
2
- import { getCustomTheme, initChartOption } from "../../../../utils/charts/chart-util.js";
2
+ import { getCustomTheme, initChartOption, exportCommonChart } from "../../../../utils/charts/chart-util.js";
3
3
  import { getChartDatasFromPage, updateChartDatasources, monitorFieldChange } from "../../../../utils/page-helper-util.js";
4
4
  import { updateChartOption } from "../../../../utils/charts/chart-gauge-util.js";
5
5
  import _sfc_main$1 from "../common/common-chart-header.vue.js";
@@ -71,8 +71,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
71
71
  updateChartOption(props.pageContext, props.configure, chartOption, resultData);
72
72
  console.log("chartOption", chartOption);
73
73
  }
74
+ function exportChart() {
75
+ exportCommonChart(chartRef.value);
76
+ }
74
77
  __expose({
75
- updateChartDatas
78
+ updateChartDatas,
79
+ exportChart
76
80
  });
77
81
  return (_ctx, _cache) => {
78
82
  return openBlock(), createElementBlock("div", {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, ref, onMounted, watch, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, withDirectives, createVNode, vShow } from "vue";
2
- import { getCustomTheme, initChartOption, monitorChartClickToVariable, clearChartSelected } from "../../../../utils/charts/chart-util.js";
2
+ import { getCustomTheme, initChartOption, monitorChartClickToVariable, clearChartSelected, exportCommonChart } from "../../../../utils/charts/chart-util.js";
3
3
  import { updateChartOption } from "../../../../utils/charts/chart-pie-util.js";
4
4
  import { doClickJumpPageEvent } from "../../../../utils/events/event-util.js";
5
5
  import { getChartDatasFromPage, updateChartDatasources, monitorFieldChange } from "../../../../utils/page-helper-util.js";
@@ -127,8 +127,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
127
127
  updateChartOption(props.pageContext, props.configure, chartOption, resultData);
128
128
  console.log("chartOption--pie", chartOption);
129
129
  }
130
+ function exportChart() {
131
+ exportCommonChart(chartRef.value);
132
+ }
130
133
  __expose({
131
- updateChartDatas
134
+ updateChartDatas,
135
+ exportChart
132
136
  });
133
137
  return (_ctx, _cache) => {
134
138
  return openBlock(), createElementBlock("div", {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, ref, onMounted, watch, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, withDirectives, createVNode, vShow } from "vue";
2
- import { getCustomTheme, initChartOption } from "../../../../utils/charts/chart-util.js";
2
+ import { getCustomTheme, initChartOption, exportCommonChart } from "../../../../utils/charts/chart-util.js";
3
3
  import { getChartDatasFromPage, updateChartDatasources, monitorFieldChange } from "../../../../utils/page-helper-util.js";
4
4
  import { updateChartOption } from "../../../../utils/charts/chart-radar-util.js";
5
5
  import _sfc_main$1 from "../common/common-chart-header.vue.js";
@@ -79,8 +79,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
79
79
  updateChartOption(props.pageContext, props.configure, chartOption, resultData);
80
80
  console.log("chartOption", chartOption);
81
81
  }
82
+ function exportChart() {
83
+ exportCommonChart(chartRef.value);
84
+ }
82
85
  __expose({
83
- updateChartDatas
86
+ updateChartDatas,
87
+ exportChart
84
88
  });
85
89
  return (_ctx, _cache) => {
86
90
  return openBlock(), createElementBlock("div", {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, ref, onMounted, watch, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, withDirectives, createVNode, vShow } from "vue";
2
- import { getCustomTheme, initChartOption } from "../../../../utils/charts/chart-util.js";
2
+ import { getCustomTheme, initChartOption, exportCommonChart } from "../../../../utils/charts/chart-util.js";
3
3
  import { getChartDatasFromPage, updateChartDatasources, monitorFieldChange } from "../../../../utils/page-helper-util.js";
4
4
  import { updateChartOption } from "../../../../utils/charts/chart-scatter-util.js";
5
5
  import _sfc_main$1 from "../common/common-chart-header.vue.js";
@@ -80,8 +80,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
80
80
  updateChartOption(props.pageContext, props.configure, chartOption, resultData);
81
81
  console.log("chartOption scatter", chartOption);
82
82
  }
83
+ function exportChart() {
84
+ exportCommonChart(chartRef.value);
85
+ }
83
86
  __expose({
84
- updateChartDatas
87
+ updateChartDatas,
88
+ exportChart
85
89
  });
86
90
  return (_ctx, _cache) => {
87
91
  return openBlock(), createElementBlock("div", {
@@ -1,5 +1,5 @@
1
1
  import _sfc_main from "./placeholder-runtime.vue2.js";
2
- /* empty css */
2
+ import "./placeholder-runtime.vue3.js";
3
3
  import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.js";
4
4
  const placeholderRuntime = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a0860ff0"]]);
5
5
  export {
@@ -18,7 +18,7 @@ import _sfc_main$5 from "./super-page-dialog.vue.js";
18
18
  import { useRoute, useRouter } from "vue-router";
19
19
  import { jumpToPage } from "agilebuilder-ui/src/utils/jump-page-utils";
20
20
  import { setSessionCache } from "agilebuilder-ui/src/utils/auth";
21
- import { isNumber, deepCopy } from "../utils/common-util.js";
21
+ import { deepCopy, isNumber } from "../utils/common-util.js";
22
22
  const _hoisted_1 = { class: "app-container" };
23
23
  const _sfc_main = /* @__PURE__ */ defineComponent({
24
24
  __name: "super-page",
@@ -228,9 +228,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
228
228
  console.log("无需要初始化的选项组数据");
229
229
  return;
230
230
  }
231
+ pageContext2.initChartData = {};
232
+ pageContext2.initChartData.data = deepCopy(pageContext2.entity.data);
233
+ pageContext2.initChartData.page = deepCopy(pageContext2.entity.page);
231
234
  console.log("pageContext.chartConfigs:", chartConfigs);
232
235
  if (chartConfigs && chartConfigs.length > 0) {
233
- updateChartDatasources(pageContext2, chartConfigs);
236
+ updateChartDatasources(pageContext2, chartConfigs, null, true);
234
237
  }
235
238
  }
236
239
  onMounted(() => {
@@ -346,7 +349,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
346
349
  if (!_selectFile_.value) {
347
350
  return;
348
351
  }
349
- if (_selectFile_.value.value === "" || _selectFile_.value.value === null) return;
352
+ if (_selectFile_.value.value === "" || _selectFile_.value.value === null)
353
+ return;
350
354
  const fileObj = _selectFile_.value.files[0];
351
355
  if (fileObj) {
352
356
  _selectFile_.value.value = null;
@@ -394,14 +398,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
394
398
  const additionalParamMap = getAdditionalParamMap(pageContext);
395
399
  let dataId = eventParams ? eventParams.id : null;
396
400
  let ids = eventParams ? eventParams.ids : null;
397
- const dataModel = pageContext.value.entity.data;
398
- const pageModel = pageContext.value.entity.page;
401
+ let selections = eventParams ? eventParams.selections : [];
402
+ console.log("getPopPageSetting---selections=", selections, "parentPageContext.value=", parentPageContext.value);
399
403
  let entity = {};
400
- if (pageModel) {
401
- Object.assign(entity, pageModel);
402
- }
403
- if (dataModel) {
404
- Object.assign(entity, dataModel);
404
+ if (selections && selections.length > 0) {
405
+ entity = selections[0];
406
+ } else {
407
+ const dataModel = parentPageContext.value.entity.data;
408
+ const pageModel = parentPageContext.value.entity.page;
409
+ if (pageModel) {
410
+ Object.assign(entity, pageModel);
411
+ }
412
+ if (dataModel) {
413
+ Object.assign(entity, dataModel);
414
+ }
405
415
  }
406
416
  jumpToPage(myJumpPageSetting, null, dataId, entity, additionalParamMap, ids).then(
407
417
  (openPageParams) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-page-runtime",
3
- "version": "2.1.21",
3
+ "version": "2.1.23",
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.63",
51
+ "agilebuilder-ui": "1.0.64",
52
52
  "axios": "^1.6.8",
53
53
  "cypress": "^13.6.6",
54
54
  "element-plus": "^2.6.1",