super-page-runtime 2.0.43-beta7 → 2.0.44

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.
@@ -41,7 +41,16 @@ export declare function initChartOption(configure: Component, chartOption: any):
41
41
  * @param chart
42
42
  * @param variable
43
43
  */
44
- export declare function monitorChartClickToVariable(pageContext: PageContext, configure: Component, chart: any, variable: string): void;
44
+ export declare function monitorChartClickToVariable(pageContext: PageContext, configure: Component, chart: any): void;
45
+ /**
46
+ * 清除统计图的选中
47
+ * @param pageContext
48
+ * @param configure
49
+ * @param chart
50
+ * @returns
51
+ */
52
+ export declare function clearChartSelected(pageContext: PageContext, configure: Component, chart: any): void;
53
+ export declare function updateClickVariablesForSelected(pageContext: PageContext, configure: Component): void;
45
54
  export declare function sortDatas(pageContext: PageContext, configure: Component, datas: Array<any>): void;
46
55
  /**
47
56
  * 限制显示数量
@@ -83,7 +83,6 @@ function initChartOption(configure, chartOption) {
83
83
  }
84
84
  if (chartOption.series) {
85
85
  const enableDrill = configure.props ? configure.props.enableDrill : null;
86
- const selGroupVariable = configure.props ? configure.props.selGroupVariable : null;
87
86
  for (const s of chartOption.series) {
88
87
  if (!chartOption.radar) {
89
88
  s.data = [];
@@ -94,11 +93,20 @@ function initChartOption(configure, chartOption) {
94
93
  }
95
94
  s.label.formatter = getNumFormatter.apply(s, s.labelFormatterArgs);
96
95
  }
97
- if (!enableDrill && selGroupVariable) {
96
+ if (!enableDrill && configure.clickSet && configure.clickSet.selected) {
98
97
  if (s.emphasis) {
99
98
  s.emphasis.disabled = false;
100
99
  }
101
100
  }
101
+ if (s.type === "pie" && configure.clickSet) {
102
+ if (configure.clickSet.selected) {
103
+ if (configure.clickSet.multiple) {
104
+ s.selectedMode = "multiple";
105
+ } else {
106
+ s.selectedMode = "single";
107
+ }
108
+ }
109
+ }
102
110
  }
103
111
  }
104
112
  if (chartOption.radar) {
@@ -123,51 +131,118 @@ function initChartOption(configure, chartOption) {
123
131
  }
124
132
  configure.defaultYaxis = defaultYaxis;
125
133
  }
126
- function monitorChartClickToVariable(pageContext, configure, chart, variable) {
127
- if (!chart || !variable || !configure || !pageContext) {
134
+ function monitorChartClickToVariable(pageContext, configure, chart) {
135
+ if (!chart || !configure || !configure.clickSet || !pageContext) {
128
136
  return;
129
137
  }
138
+ const clickSet = configure.clickSet;
130
139
  chart.on("click", function(params) {
131
- let highlightInfos = configure.highlightInfos;
132
- let hasSelect = false;
133
- let selGroupValue = null;
140
+ let highlightInfos = configure.highlightInfos ? configure.highlightInfos : [];
141
+ console.log("highlightInfos", highlightInfos, params);
142
+ let hisSelectIndex = -1;
134
143
  if (highlightInfos) {
144
+ const newInfos = [];
135
145
  for (let i = 0; i < highlightInfos.length; i++) {
136
146
  const info = highlightInfos[i];
137
- chart.dispatchAction({
138
- type: "downplay",
139
- seriesIndex: info.seriesIndex,
140
- dataIndex: info.dataIndex
141
- });
142
- if (info.seriesIndex == params.seriesIndex && info.dataIndex == params.dataIndex) {
143
- hasSelect = true;
147
+ const hisSelected = info.seriesIndex === params.seriesIndex && info.dataIndex === params.dataIndex;
148
+ if (hisSelected || !clickSet.multiple) {
149
+ if (clickSet.selected) {
150
+ const typeName = configure.name === "chart-pie" ? "unselect" : "downplay";
151
+ chart.dispatchAction({
152
+ type: typeName,
153
+ seriesIndex: info.seriesIndex,
154
+ dataIndex: info.dataIndex
155
+ });
156
+ }
157
+ } else {
158
+ newInfos.push(info);
159
+ }
160
+ if (hisSelected) {
161
+ hisSelectIndex = i;
144
162
  }
145
163
  }
164
+ highlightInfos = newInfos;
146
165
  }
147
- highlightInfos = [];
148
- if (!hasSelect) {
149
- chart.dispatchAction({
150
- type: "highlight",
151
- seriesIndex: params.seriesIndex,
152
- dataIndex: params.dataIndex
153
- });
166
+ if (hisSelectIndex === -1) {
167
+ if (clickSet.selected) {
168
+ const typeName = configure.name === "chart-pie" ? "select" : "highlight";
169
+ chart.dispatchAction({
170
+ type: typeName,
171
+ seriesIndex: params.seriesIndex,
172
+ dataIndex: params.dataIndex
173
+ });
174
+ }
154
175
  highlightInfos.push({
155
176
  seriesIndex: params.seriesIndex,
156
177
  dataIndex: params.dataIndex
157
178
  });
158
- const caheDatas = configure.cacheDatas;
159
- const groupFields = configure.groupFields;
160
- console.log("selsssss", caheDatas, groupFields);
161
- if (caheDatas && params.dataIndex < caheDatas.length && groupFields && configure.groupFields.length > 0) {
162
- const data = caheDatas[params.dataIndex];
163
- selGroupValue = getValueFromSource(data, groupFields[0], void 0);
164
- }
165
179
  }
166
180
  configure.highlightInfos = highlightInfos;
167
- setValueForVariableName(pageContext.entity, variable, selGroupValue);
168
- console.log("variable params", params);
181
+ updateClickVariablesForSelected(pageContext, configure);
169
182
  });
170
183
  }
184
+ function clearChartSelected(pageContext, configure, chart) {
185
+ if (!chart || !configure || !pageContext) {
186
+ return;
187
+ }
188
+ const highlightInfos = configure.highlightInfos ? configure.highlightInfos : [];
189
+ for (let i = 0; i < highlightInfos.length; i++) {
190
+ const info = highlightInfos[i];
191
+ const typeName = configure.name === "chart-pie" ? "unselect" : "downplay";
192
+ chart.dispatchAction({
193
+ type: typeName,
194
+ seriesIndex: info.seriesIndex,
195
+ dataIndex: info.dataIndex
196
+ });
197
+ }
198
+ configure.highlightInfos = [];
199
+ updateClickVariablesForSelected(pageContext, configure);
200
+ }
201
+ function updateClickVariablesForSelected(pageContext, configure) {
202
+ if (!configure.clickSet) {
203
+ return;
204
+ }
205
+ const clickSet = configure.clickSet;
206
+ const variables = clickSet.variables;
207
+ if (!variables || variables.length == 0) {
208
+ return;
209
+ }
210
+ const highlightInfos = configure.highlightInfos ? configure.highlightInfos : [];
211
+ const caheDatas = configure.cacheDatas ? configure.cacheDatas : [];
212
+ const selDatas = [];
213
+ const existIndexs = [];
214
+ for (const highlightInfo of highlightInfos) {
215
+ if (existIndexs.includes(highlightInfo.dataIndex)) {
216
+ continue;
217
+ }
218
+ existIndexs.push(highlightInfo.dataIndex);
219
+ if (highlightInfo.dataIndex < caheDatas.length) {
220
+ selDatas.push(caheDatas[highlightInfo.dataIndex]);
221
+ }
222
+ }
223
+ for (const v of variables) {
224
+ if (!v.fieldName || !v.variable) {
225
+ continue;
226
+ }
227
+ const values = [];
228
+ for (const data of selDatas) {
229
+ const value = getValueFromSource(data, v.fieldName, void 0);
230
+ if (value == void 0) {
231
+ continue;
232
+ }
233
+ values.push(value);
234
+ }
235
+ if (clickSet.multiple) {
236
+ setValueForVariableName(pageContext.entity, v.variable, values);
237
+ } else {
238
+ setValueForVariableName(
239
+ pageContext.entity,
240
+ v.variable,
241
+ values.length > 0 ? values[0] : void 0
242
+ );
243
+ }
244
+ }
245
+ }
171
246
  function sortDatas(pageContext, configure, datas) {
172
247
  const itemConfs = configure.items ? configure.items : [];
173
248
  const orderByTarget = configure.props ? configure.props.orderByTarget : "";
@@ -410,6 +485,7 @@ function executeChartFormula(formulaStr, accumulateMap, rowData, pageContext) {
410
485
  export {
411
486
  CommonName,
412
487
  caculateFormulaValue,
488
+ clearChartSelected,
413
489
  executeChartFormula,
414
490
  getCustomTheme,
415
491
  getCustomThemeOptions,
@@ -417,5 +493,6 @@ export {
417
493
  initChartOption,
418
494
  limitDatas,
419
495
  monitorChartClickToVariable,
420
- sortDatas
496
+ sortDatas,
497
+ updateClickVariablesForSelected
421
498
  };
@@ -29,6 +29,14 @@ export declare function getHandleEvent($event: any, pageContext: PageContext, co
29
29
  export declare function getTableUuid(pageContext: PageContext, configure: Component): any;
30
30
  export declare function handleEventByEventName(pageContext: PageContext, configure: Component, eventName: string, otherParams?: object): any;
31
31
  export declare function doBeforeClickEvent(pageContext: PageContext, configure: Component, otherParams?: object): any;
32
+ /**
33
+ * TODO: 跳转页面功能
34
+ * 跳转页面功能
35
+ * @param $event
36
+ * @param pageContext
37
+ * @param configure
38
+ */
39
+ export declare function doClickJumpPageEvent(pageContext: PageContext, configure: Component, eventParams: object): void;
32
40
  export declare function doAfterClickEvent(pageContext: PageContext, configure: Component, otherParams?: object): void;
33
41
  /**
34
42
  * 获得事件Function对象
@@ -127,7 +127,6 @@ function handleEventUtil($event, pageContext, configure, eventType, isExecute, o
127
127
  const eventParams = packageEventParams(pageContext, configure, $event, otherParams);
128
128
  buttonClickEvent(pageContext, configure, eventParams);
129
129
  } else {
130
- debugger;
131
130
  eventFun = getEventFuncByType(pageContext, events, eventType);
132
131
  if (isExecute) {
133
132
  const eventParams = packageEventParams(pageContext, configure, $event, otherParams);
@@ -619,6 +618,7 @@ export {
619
618
  cellDblClick,
620
619
  doAfterClickEvent,
621
620
  doBeforeClickEvent,
621
+ doClickJumpPageEvent,
622
622
  fileUploadBeforeUpload,
623
623
  getClickEventFuncByType,
624
624
  getCustomFunc,
@@ -1,4 +1,4 @@
1
- import { getBaseUrl, getRealRestApiPath, upperFirstCase, packageTemplateFiles, isArrayFn } from "../common-util.js";
1
+ import { getBaseUrl, getRealRestApiPath, upperFirstCase, packageTemplateFiles, deepCopy, 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";
@@ -275,7 +275,9 @@ function exportFormReport(pageContext, configureObj, templateFile, isPdf) {
275
275
  const additionalParamMap = getAdditionalParamMap(pageContext);
276
276
  param["additionalParamMap"] = additionalParamMap;
277
277
  let exportResult;
278
- {
278
+ if (isPdf) {
279
+ exportResult = exportFormPdf(fileName, backendUrl, param);
280
+ } else {
279
281
  exportResult = exportFormReportSuccess(fileName, backendUrl, param);
280
282
  }
281
283
  if (exportResult) {
@@ -316,6 +318,34 @@ function exportFormReportSuccess(fileName, backendUrl, param) {
316
318
  });
317
319
  });
318
320
  }
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
+ }
319
349
  function saveFunc(params, isListButton) {
320
350
  return new Promise((resolve, reject) => {
321
351
  const pageContext = params.pageContext;
@@ -1287,7 +1317,7 @@ function getTransactTaskParam(params) {
1287
1317
  }
1288
1318
  function getAdditionalParamMap(pageContext) {
1289
1319
  if (pageContext.entity) {
1290
- let additionalParamMap = pageContext.entity.page;
1320
+ let additionalParamMap = deepCopy(pageContext.entity.page);
1291
1321
  if (!additionalParamMap) {
1292
1322
  additionalParamMap = {};
1293
1323
  }
@@ -74,10 +74,25 @@ 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
+ }
77
92
  return rules;
78
93
  }
79
94
  function validator(entity, rules, columns, rowIndex, isSql) {
80
- return validatorEntity(entity, rules, columns, rowIndex, true);
95
+ return validatorEntity(entity, rules, columns, rowIndex, true, isSql);
81
96
  }
82
97
  function sublistVerify(rules) {
83
98
  if (!rules) {
@@ -103,7 +118,7 @@ function sublistVerify(rules) {
103
118
  function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdate, isSql) {
104
119
  let validateRules = sublistVerify(rules);
105
120
  if ((!rules || rules === null) && columns) {
106
- validateRules = getValidator();
121
+ validateRules = getValidator(columns);
107
122
  }
108
123
  if (!validateRules || Object.keys(validateRules).length === 0) {
109
124
  entity["validateErrorField"] = "";
@@ -121,6 +136,11 @@ function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdat
121
136
  if (errors) {
122
137
  result = errors[0].message;
123
138
  fieldName = errors[0]["field"];
139
+ if (typeof rowIndex !== "undefined" && rowIndex !== null) {
140
+ result = getI18n().t("superPageRuntimeMessage.recordLine", {
141
+ row: rowIndex + 1
142
+ }) + "," + result;
143
+ }
124
144
  ElMessage({
125
145
  message: result,
126
146
  showClose: true,
@@ -133,11 +153,11 @@ function validatorEntity(entity, rules, columns, rowIndex, isShouldRepeateValdat
133
153
  }
134
154
  if (fieldName && isShouldRepeateValdate === true) {
135
155
  const reg1 = /[A-Z]+/;
136
- if (reg1.test(fieldName) && entity[fieldName.toLowerCase()] !== void 0) {
156
+ if (isSql !== void 0 && isSql === true && reg1.test(fieldName) && entity[fieldName.toLowerCase()] !== void 0) {
137
157
  const copyEntity = JSON.parse(JSON.stringify(entity));
138
158
  copyEntity[fieldName.toUpperCase()] = entity[fieldName.toLowerCase()];
139
159
  delete copyEntity[fieldName.toLowerCase()];
140
- result = validatorEntity(copyEntity, rules, columns, rowIndex, false);
160
+ result = validatorEntity(copyEntity, rules, columns, rowIndex, false, isSql);
141
161
  }
142
162
  }
143
163
  }
@@ -185,7 +205,7 @@ function validateWorkflowFormDataModel(dataModel, pageContext) {
185
205
  if (!rules || Object.keys(rules).length === 0) {
186
206
  result = true;
187
207
  } else {
188
- result = validator(handleModels, rules, null, null);
208
+ result = validator(handleModels, rules, null, null, true);
189
209
  }
190
210
  if (result === true) {
191
211
  const workflowFieldPermissionRules = pageContext.workflowRules;
@@ -249,7 +269,7 @@ function validateCommonFormDataModel(dataModel, pageContext, rules) {
249
269
  if (!rules || Object.keys(rules).length === 0) {
250
270
  resolve(handleModels);
251
271
  } else {
252
- const validateEntityResult = validator(handleModels, rules, null, null);
272
+ const validateEntityResult = validator(handleModels, rules, null, null, true);
253
273
  if (validateEntityResult === true) {
254
274
  const validateResult = validateSubTables(pageContext);
255
275
  if (validateResult === true) {
@@ -77,7 +77,8 @@ function getTableQueryInfo(dataOriginInfo, pageContext2) {
77
77
  }
78
78
  }
79
79
  }
80
- if (f.propValue) ;
80
+ if (f.propValue)
81
+ ;
81
82
  searchForm.push(tempObj);
82
83
  }
83
84
  infoObj.props.searchForm = searchForm;
@@ -355,6 +356,13 @@ function setVariableValue(entity, fields, newValue) {
355
356
  }
356
357
  }
357
358
  }
359
+ function setVariableValueWithProp(entity, prop, newValue) {
360
+ if (!entity || !prop) {
361
+ return;
362
+ }
363
+ const fields = prop.split(".");
364
+ setVariableValue(entity, fields, newValue);
365
+ }
358
366
  function formatVariableValue(pageContext2, variable) {
359
367
  if (!pageContext2 || variable == "" || variable == null || variable == void 0) {
360
368
  return variable;
@@ -664,6 +672,7 @@ export {
664
672
  queryOptions,
665
673
  setValueForVariableName,
666
674
  setVariableValue,
675
+ setVariableValueWithProp,
667
676
  updateChartDatasources,
668
677
  updateOptionDatasources
669
678
  };
@@ -109,7 +109,8 @@ function getRequestObject(pageRequest) {
109
109
  Object.assign(requestObj, route.query);
110
110
  }
111
111
  }
112
- if (requestObj["_t_"]) ;
112
+ if (requestObj["_t_"])
113
+ ;
113
114
  return requestObj;
114
115
  }
115
116
  function getModelFields(pageContext, formItemConfigure, prop) {
@@ -169,7 +170,7 @@ function getFormModelFields(pageContext, formItemConfigure, prop) {
169
170
  return fields;
170
171
  }
171
172
  function getPermissionCodes(configure, pageContext) {
172
- if (!pageContext || !configure) {
173
+ if (!pageContext || !configure || pageContext.isTest) {
173
174
  return "true";
174
175
  }
175
176
  const codes = [];
@@ -238,10 +239,12 @@ function packageFormRules(pageContext, configure) {
238
239
  if (!pageContext.rules) {
239
240
  pageContext.rules = {};
240
241
  }
241
- if (!pageContext.rules[propName]) {
242
- pageContext.rules[propName] = [];
242
+ if (configure.props.rules && configure.props.rules.length > 0) {
243
+ if (!pageContext.rules[propName]) {
244
+ pageContext.rules[propName] = [];
245
+ }
246
+ pageContext.rules[propName] = configure.props.rules;
243
247
  }
244
- pageContext.rules[propName] = configure.props.rules;
245
248
  if (configure.name !== "button-detail" && pageContext.fieldPermissionMap) {
246
249
  const propEditPermission = pageContext.fieldPermissionMap.get(propName);
247
250
  if (propEditPermission) {
@@ -1,7 +1,8 @@
1
1
  import { defineComponent, ref, onMounted, watch, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, withDirectives, createVNode, vShow } from "vue";
2
- import { getCustomTheme, initChartOption, monitorChartClickToVariable } from "../../../../utils/charts/chart-util.js";
2
+ import { getCustomTheme, initChartOption, monitorChartClickToVariable, clearChartSelected } 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
+ import { doClickJumpPageEvent } from "../../../../utils/events/event-util.js";
5
6
  import _sfc_main$1 from "../common/common-chart-header.vue.js";
6
7
  import { use } from "echarts/core";
7
8
  import { CanvasRenderer } from "echarts/renderers";
@@ -32,7 +33,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
32
33
  const headerRef = ref(null);
33
34
  const enableDrill = props.configure.props ? props.configure.props.enableDrill : null;
34
35
  const drillEndTrigger = props.configure.props ? props.configure.props.drillEndTrigger : null;
35
- const selGroupVariable = props.configure.props ? props.configure.props.selGroupVariable : null;
36
+ const linkPage = props.configure.props ? props.configure.props.linkPage : null;
36
37
  const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
37
38
  const runtimeStyle = runtimeInfo.style;
38
39
  const runtimeClass = runtimeInfo.class;
@@ -47,20 +48,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
47
48
  if (resultData) {
48
49
  updateChartDatas(resultData);
49
50
  }
50
- if (enableDrill && chartRef.value) {
51
+ if (chartRef.value && (enableDrill || linkPage && linkPage.jumpPageUrl)) {
51
52
  chartRef.value.chart.on("click", function(params) {
52
- if (headerRef.value && headerRef.value.drill) {
53
- headerRef.value.drill(params, props.configure.cacheDatas);
53
+ if (enableDrill) {
54
+ if (headerRef.value && headerRef.value.drill) {
55
+ headerRef.value.drill(params, props.configure.cacheDatas);
56
+ }
57
+ } else {
58
+ clickToLink();
54
59
  }
55
60
  });
56
61
  }
57
- if (!enableDrill && selGroupVariable && chartRef.value) {
58
- monitorChartClickToVariable(
59
- props.pageContext,
60
- props.configure,
61
- chartRef.value.chart,
62
- selGroupVariable
63
- );
62
+ if (!enableDrill && props.configure.clickSet && chartRef.value) {
63
+ monitorChartClickToVariable(props.pageContext, props.configure, chartRef.value.chart);
64
64
  }
65
65
  });
66
66
  function onDrillEnd(params) {
@@ -68,8 +68,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
68
68
  if (headerRef.value && headerRef.value.closeDrill) {
69
69
  headerRef.value.closeDrill(0);
70
70
  }
71
+ } else if (drillEndTrigger === "clickEvent") {
72
+ clickToLink();
71
73
  }
72
74
  }
75
+ function clickToLink() {
76
+ if (!linkPage || !linkPage.jumpPageUrl) {
77
+ return;
78
+ }
79
+ doClickJumpPageEvent(props.pageContext, props.configure, void 0);
80
+ }
73
81
  let hisGroupValue = headerInfo.groupValue;
74
82
  watch(headerInfo, () => {
75
83
  if (hisGroupValue == headerInfo.groupValue) {
@@ -84,6 +92,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
84
92
  return;
85
93
  }
86
94
  dataConfig.services[0].groupValue = headerInfo.groupValue;
95
+ dataConfig.isRefresh = true;
87
96
  updateChartDatasources(props.pageContext, [dataConfig], headerInfo.drillParams);
88
97
  }
89
98
  const monitorFields = headerInfo.monitorFields;
@@ -102,8 +111,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
102
111
  return;
103
112
  }
104
113
  resultData.hasRender = true;
114
+ if (!dataConfig.isRefresh) {
115
+ hisGroupValue = resultData.groupValue;
116
+ if (hisGroupValue && headerInfo.groupComponent !== "checkbox") {
117
+ hisGroupValue = hisGroupValue.join(",");
118
+ }
119
+ headerInfo.groupValue = hisGroupValue;
120
+ }
121
+ if (!dataConfig.isRefresh || !enableDrill) {
122
+ clearChartSelected(props.pageContext, props.configure, chartRef.value.chart);
123
+ }
124
+ dataConfig.isRefresh = false;
105
125
  updateChartOption(props.pageContext, props.configure, chartOption, resultData);
106
- console.log("chartOption", chartOption);
107
126
  }
108
127
  __expose({
109
128
  updateChartDatas
@@ -119,8 +138,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
119
138
  ref_key: "headerRef",
120
139
  ref: headerRef,
121
140
  headerInfo: unref(headerInfo),
141
+ configure: _ctx.configure,
142
+ pageContext: _ctx.pageContext,
122
143
  onDrillEnd
123
- }, null, 8, ["headerInfo"]), [
144
+ }, null, 8, ["headerInfo", "configure", "pageContext"]), [
124
145
  [vShow, unref(headerInfo).showHeader]
125
146
  ]),
126
147
  createVNode(unref(VChart), {
@@ -1,6 +1,7 @@
1
1
  import { defineComponent, ref, openBlock, createElementBlock, createElementVNode, withDirectives, normalizeStyle, toDisplayString, vShow, createBlock, createCommentVNode } from "vue";
2
2
  import _sfc_main$2 from "./common-chart-header-group.vue.js";
3
3
  import _sfc_main$1 from "./common-chart-header-breadcrumb.vue.js";
4
+ import { setVariableValueWithProp, getValueFromSource, setValueForVariableName } from "../../../../utils/page-helper-util.js";
4
5
  const _hoisted_1 = { class: "amb-widget-chart-header" };
5
6
  const _hoisted_2 = { class: "amb-widget-chart-header-item" };
6
7
  const _hoisted_3 = { class: "amb-widget-chart-header-item amb-widget-chart-header-center" };
@@ -11,6 +12,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
11
12
  headerInfo: {
12
13
  type: Object,
13
14
  required: true
15
+ },
16
+ configure: {
17
+ type: Object,
18
+ required: true
19
+ },
20
+ pageContext: {
21
+ type: Object,
22
+ required: true
14
23
  }
15
24
  },
16
25
  emits: ["drill-end"],
@@ -35,16 +44,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
35
44
  function drill(params, datas) {
36
45
  const currentIndex = props.headerInfo.drillOptions.length;
37
46
  if (currentIndex + 1 >= props.headerInfo.options.length) {
47
+ const data2 = datas && params.dataIndex < datas.length ? datas[params.dataIndex] : void 0;
48
+ updateClickVariables(data2);
38
49
  console.log("钻取到最底层了!");
39
50
  $emits("drill-end", params);
40
51
  return;
41
52
  }
42
53
  console.log("props.headerInfo.options", currentIndex, props.headerInfo.options);
43
54
  const targetGroup = props.headerInfo.options[currentIndex];
55
+ const data = datas && params.dataIndex < datas.length ? datas[params.dataIndex] : null;
44
56
  const drillOption = {
45
57
  fieldName: targetGroup.target ? targetGroup.target.replace(".", "_") : "",
58
+ rawFieldName: targetGroup.target ? targetGroup.target : "",
46
59
  label: params.name,
47
- value: params.name
60
+ value: params.name,
61
+ data
48
62
  };
49
63
  props.headerInfo.drillOptions.push(drillOption);
50
64
  toDrillLevel(currentIndex + 1);
@@ -58,6 +72,39 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
58
72
  }
59
73
  props.headerInfo.drillParams = drillParams;
60
74
  props.headerInfo.groupValue = props.headerInfo.options[drillIndex].value;
75
+ updateClickVariables();
76
+ }
77
+ function updateClickVariables(endData) {
78
+ const clickSet = props.configure.clickSet;
79
+ if (!clickSet || !clickSet.variables || clickSet.variables.length === 0) {
80
+ return;
81
+ }
82
+ const data = {};
83
+ if (endData) {
84
+ Object.assign(data, endData);
85
+ }
86
+ const drillOptions = props.headerInfo.drillOptions;
87
+ if (drillOptions.length > 0) {
88
+ if (!endData) {
89
+ const endOption = drillOptions[drillOptions.length - 1];
90
+ if (endOption.data) {
91
+ Object.assign(data, endOption.data);
92
+ }
93
+ }
94
+ for (let o of drillOptions) {
95
+ if (!o.rawFieldName) {
96
+ continue;
97
+ }
98
+ setVariableValueWithProp(data, o.rawFieldName, o.value);
99
+ }
100
+ }
101
+ for (let v of clickSet.variables) {
102
+ if (!v.fieldName || !v.variable) {
103
+ continue;
104
+ }
105
+ const value = getValueFromSource(data, v.fieldName, void 0);
106
+ setValueForVariableName(props.pageContext.entity, v.variable, value);
107
+ }
61
108
  }
62
109
  __expose({
63
110
  drill,
@@ -1,6 +1,7 @@
1
1
  import { defineComponent, ref, onMounted, watch, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, withDirectives, createVNode, vShow } from "vue";
2
- import { getCustomTheme, initChartOption, monitorChartClickToVariable } from "../../../../utils/charts/chart-util.js";
2
+ import { getCustomTheme, initChartOption, monitorChartClickToVariable, clearChartSelected } from "../../../../utils/charts/chart-util.js";
3
3
  import { updateChartOption } from "../../../../utils/charts/chart-pie-util.js";
4
+ import { doClickJumpPageEvent } from "../../../../utils/events/event-util.js";
4
5
  import { getChartDatasFromPage, updateChartDatasources, monitorFieldChange } from "../../../../utils/page-helper-util.js";
5
6
  import _sfc_main$1 from "../common/common-chart-header.vue.js";
6
7
  import { use } from "echarts/core";
@@ -30,7 +31,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
30
31
  const headerRef = ref(null);
31
32
  const enableDrill = props.configure.props ? props.configure.props.enableDrill : null;
32
33
  const drillEndTrigger = props.configure.props ? props.configure.props.drillEndTrigger : null;
33
- const selGroupVariable = props.configure.props ? props.configure.props.selGroupVariable : null;
34
+ const linkPage = props.configure.props ? props.configure.props.linkPage : null;
34
35
  const runtimeInfo = props.configure.runtime ? props.configure.runtime : {};
35
36
  const runtimeStyle = runtimeInfo.style;
36
37
  const runtimeClass = runtimeInfo.class;
@@ -45,20 +46,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
45
46
  if (resultData) {
46
47
  updateChartDatas(resultData);
47
48
  }
48
- if (enableDrill && chartRef.value) {
49
+ if (chartRef.value && (enableDrill || linkPage && linkPage.jumpPageUrl)) {
49
50
  chartRef.value.chart.on("click", function(params) {
50
- if (headerRef.value && headerRef.value.drill) {
51
- headerRef.value.drill(params, props.configure.cacheDatas);
51
+ if (enableDrill) {
52
+ if (headerRef.value && headerRef.value.drill) {
53
+ headerRef.value.drill(params, props.configure.cacheDatas);
54
+ }
55
+ } else {
56
+ clickToLink();
52
57
  }
53
58
  });
54
59
  }
55
- if (!enableDrill && selGroupVariable && chartRef.value) {
56
- monitorChartClickToVariable(
57
- props.pageContext,
58
- props.configure,
59
- chartRef.value.chart,
60
- selGroupVariable
61
- );
60
+ if (!enableDrill && props.configure.clickSet && chartRef.value) {
61
+ monitorChartClickToVariable(props.pageContext, props.configure, chartRef.value.chart);
62
62
  }
63
63
  });
64
64
  function onDrillEnd(params) {
@@ -66,8 +66,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
66
66
  if (headerRef.value && headerRef.value.closeDrill) {
67
67
  headerRef.value.closeDrill(0);
68
68
  }
69
+ } else if (drillEndTrigger == "clickEvent") {
70
+ clickToLink();
69
71
  }
70
72
  }
73
+ function clickToLink() {
74
+ if (!linkPage || !linkPage.jumpPageUrl) {
75
+ return;
76
+ }
77
+ doClickJumpPageEvent(props.pageContext, props.configure, void 0);
78
+ }
71
79
  let hisGroupValue = headerInfo.groupValue;
72
80
  watch(headerInfo, () => {
73
81
  if (hisGroupValue == headerInfo.groupValue) {
@@ -82,6 +90,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
82
90
  return;
83
91
  }
84
92
  dataConfig.services[0].groupValue = headerInfo.groupValue;
93
+ dataConfig.isRefresh = true;
85
94
  updateChartDatasources(props.pageContext, [dataConfig], headerInfo.drillParams);
86
95
  }
87
96
  const monitorFields = headerInfo.monitorFields;
@@ -100,9 +109,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
100
109
  return;
101
110
  }
102
111
  resultData.hasRender = true;
103
- console.log("pie resultData", resultData);
112
+ if (!dataConfig.isRefresh) {
113
+ hisGroupValue = resultData.groupValue;
114
+ if (hisGroupValue && headerInfo.groupComponent !== "checkbox") {
115
+ hisGroupValue = hisGroupValue.join(",");
116
+ }
117
+ headerInfo.groupValue = hisGroupValue;
118
+ }
119
+ if (!dataConfig.isRefresh || !enableDrill) {
120
+ clearChartSelected(props.pageContext, props.configure, chartRef.value.chart);
121
+ }
122
+ dataConfig.isRefresh = false;
104
123
  updateChartOption(props.pageContext, props.configure, chartOption, resultData);
105
- console.log("chartOption", chartOption);
124
+ console.log("chartOption--pie", chartOption);
106
125
  }
107
126
  __expose({
108
127
  updateChartDatas
@@ -307,10 +307,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
307
307
  buttonParams.value = null;
308
308
  }
309
309
  function doExportFormReport(templateFile) {
310
+ const isPdf = false;
310
311
  exportFormReport(
311
312
  buttonParams.value.pageContext,
312
313
  buttonParams.value.configureObj,
313
- templateFile
314
+ templateFile,
315
+ isPdf
314
316
  );
315
317
  }
316
318
  const _selectFile_ = ref(null);
@@ -322,7 +324,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
322
324
  if (!_selectFile_.value) {
323
325
  return;
324
326
  }
325
- if (_selectFile_.value.value === "" || _selectFile_.value.value === null) return;
327
+ if (_selectFile_.value.value === "" || _selectFile_.value.value === null)
328
+ return;
326
329
  const fileObj = _selectFile_.value.files[0];
327
330
  if (fileObj) {
328
331
  _selectFile_.value.value = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-page-runtime",
3
- "version": "2.0.43-beta7",
3
+ "version": "2.0.44",
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.28",
51
+ "agilebuilder-ui": "1.0.34",
52
52
  "axios": "^1.6.8",
53
53
  "cypress": "^13.6.6",
54
54
  "element-plus": "^2.6.1",