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.
Files changed (27) hide show
  1. package/dist/es/components/runtime/utils/api/page-expose-util.js +110 -3
  2. package/dist/es/components/runtime/utils/charts/chart-columnline-util.js +12 -2
  3. package/dist/es/components/runtime/utils/charts/chart-util.js +14 -0
  4. package/dist/es/components/runtime/utils/common-util.d.ts +1 -0
  5. package/dist/es/components/runtime/utils/common-util.js +4 -0
  6. package/dist/es/components/runtime/utils/events/event-util.d.ts +1 -0
  7. package/dist/es/components/runtime/utils/events/event-util.js +14 -1
  8. package/dist/es/components/runtime/utils/events/standard-event.js +3 -1
  9. package/dist/es/components/runtime/utils/interfaces/page-design-types.d.ts +1 -0
  10. package/dist/es/components/runtime/utils/page-helper-util.d.ts +18 -0
  11. package/dist/es/components/runtime/utils/page-helper-util.js +23 -4
  12. package/dist/es/components/runtime/utils/page-init-util.js +3 -1
  13. package/dist/es/components/runtime/views/assemblys/button/button/button-runtime.vue2.js +4 -1
  14. package/dist/es/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue2.js +5 -3
  15. package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +13 -2
  16. package/dist/es/components/runtime/views/assemblys/chart/table/normal-column.vue.js +6 -1
  17. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue.js +64 -0
  18. package/dist/es/components/runtime/views/assemblys/chart/table/table-pageination.vue2.js +4 -0
  19. package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +100 -20
  20. package/dist/es/components/runtime/views/assemblys/container/tools/tools-runtime.vue2.js +1 -0
  21. package/dist/es/components/runtime/views/assemblys/data/table/main-table-runtime.vue.js +102 -35
  22. package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +7 -1
  23. package/dist/es/components/runtime/views/assemblys/data/table/table-runtime.vue2.js +7 -1
  24. package/dist/es/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue2.js +1 -0
  25. package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +49 -26
  26. package/dist/es/components/runtime/views/assemblys/form/select/select-runtime.vue2.js +20 -7
  27. 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,13 +1,17 @@
1
- import { getValueFromSource, formatVariableValue, setValueForVariableName } from "../page-helper-util.js";
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) {
6
+ var _a;
5
7
  if (!resultData || !resultData.result) {
6
8
  return;
7
9
  }
10
+ handleChartEvent(pageContext, configure, "beforeUpdateChart", chartOption, {
11
+ resultData
12
+ });
8
13
  const result = resultData && resultData.result ? resultData.result : {};
9
14
  let groupValue = resultData && resultData.groupValue ? resultData.groupValue : void 0;
10
- debugger;
11
15
  const dataSetField = configure.serviceDataField;
12
16
  let datas = null;
13
17
  if (dataSetField) {
@@ -24,6 +28,9 @@ function updateChartOption(pageContext, configure, chartOption, resultData) {
24
28
  if (!datas) {
25
29
  datas = [];
26
30
  }
31
+ if ((_a = configure.runtime.dataConfig) == null ? void 0 : _a.resultSet) {
32
+ setValueForVariableName(pageContext.entity, configure.runtime.dataConfig.resultSet, datas);
33
+ }
27
34
  let confGroups = configure.props ? configure.props.groups : null;
28
35
  if (!confGroups) {
29
36
  confGroups = [];
@@ -309,6 +316,9 @@ function updateChartOption(pageContext, configure, chartOption, resultData) {
309
316
  configure.highlightInfos = [];
310
317
  setValueForVariableName(pageContext.entity, selGroupVariable, null);
311
318
  }
319
+ handleChartEvent(pageContext, configure, "afterUpdateChart", chartOption, {
320
+ resultData
321
+ });
312
322
  configure.groupFields = realGroupFilds;
313
323
  configure.cacheDatas = datas;
314
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((item) => item.name === "click" && item.isStandard && item.eventName && item.eventName === "showSearch");
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.entity.data;
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 = {
@@ -69,6 +69,7 @@ export interface PageDesign extends Component {
69
69
  subTablePageInfo?: object;
70
70
  customEvents?: Array<any>;
71
71
  contextParam?: object;
72
+ systemtParam?: object;
72
73
  subTableWatchProps?: object;
73
74
  }
74
75
  /**
@@ -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
@@ -188,6 +188,14 @@ function updateChartDatasources(pageContext2, dataSourceConfs, appendParams, isI
188
188
  });
189
189
  });
190
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
+ }
191
199
  function updateOptionDatasources(pageContext2, dataSourceConfs, query) {
192
200
  return new Promise((resolve, reject) => {
193
201
  if (!dataSourceConfs || dataSourceConfs.length == 0) {
@@ -235,12 +243,20 @@ function updateOptionDatasources(pageContext2, dataSourceConfs, query) {
235
243
  });
236
244
  }
237
245
  function getOptionDatasFromPage(pageContext2, configure2) {
238
- if (!pageContext2 || !pageContext2.optionSourceMap || !configure2) {
239
- return [];
240
- }
241
- const cacheOptions = pageContext2.optionSourceMap[configure2.uuid];
246
+ return getComponentOptionDatasFromPage(pageContext2, configure2.uuid);
247
+ }
248
+ function getComponentOptionDatasFromPage(pageContext2, configureUuid) {
249
+ const optionSourceMap = getOptionDatasSourceMap(pageContext2);
250
+ const cacheOptions = optionSourceMap[configureUuid];
242
251
  return cacheOptions ? cacheOptions : [];
243
252
  }
253
+ function getOptionDatasSourceMap(pageContext2) {
254
+ if (!pageContext2 || !pageContext2.optionSourceMap) {
255
+ return {};
256
+ }
257
+ const cacheOptions = pageContext2.optionSourceMap;
258
+ return cacheOptions ? cacheOptions : {};
259
+ }
244
260
  function getChartDatasFromPage(pageContext2, configure2) {
245
261
  if (!pageContext2 || !pageContext2.chartDataSourceMap || !configure2) {
246
262
  return null;
@@ -662,8 +678,10 @@ export {
662
678
  formatVariableValue,
663
679
  getChartDatasFromPage,
664
680
  getComponentOptionConfigs,
681
+ getComponentOptionDatasFromPage,
665
682
  getFormPropName,
666
683
  getOptionDatasFromPage,
684
+ getOptionDatasSourceMap,
667
685
  getParamNames,
668
686
  getSizeConfig,
669
687
  getValueFromSource,
@@ -676,5 +694,6 @@ export {
676
694
  setVariableValue,
677
695
  setVariableValueWithProp,
678
696
  updateChartDatasources,
697
+ updateChartDatasourcesByComponent,
679
698
  updateOptionDatasources
680
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
  }
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, resolveComponent, openBlock, createElementBlock, createVNode, normalizeClass, unref, normalizeStyle, withCtx, Fragment, createTextVNode, toDisplayString, createCommentVNode, createBlock } from "vue";
1
+ import { defineComponent, ref, onMounted, resolveComponent, openBlock, createElementBlock, createVNode, normalizeClass, unref, normalizeStyle, withCtx, Fragment, createTextVNode, toDisplayString, createCommentVNode, createBlock } from "vue";
2
2
  import { SuperIcon } from "agilebuilder-ui";
3
3
  import { handleEvent } from "../../../../utils/events/event-util.js";
4
4
  import { $t } from "../../../../utils/i18n-util.js";
@@ -21,6 +21,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
21
21
  function isButtongLoading() {
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
+ onMounted(() => {
25
+ console.log("button-----onMounted");
26
+ });
24
27
  return (_ctx, _cache) => {
25
28
  const _component_el_button = resolveComponent("el-button");
26
29
  return openBlock(), createElementBlock("span", _hoisted_1, [
@@ -29,7 +29,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
29
29
  ]);
30
30
  const props = __props;
31
31
  const thisRef = ref(null);
32
- const chartRef = ref(null);
32
+ const chartRef = ref();
33
33
  const headerRef = ref(null);
34
34
  const enableDrill = props.configure.props ? props.configure.props.enableDrill : null;
35
35
  const drillEndTrigger = props.configure.props ? props.configure.props.drillEndTrigger : null;
@@ -123,6 +123,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
123
123
  refresh(true);
124
124
  });
125
125
  function updateChartDatas(resultData) {
126
+ var _a;
126
127
  if (!resultData) {
127
128
  resultData = [];
128
129
  }
@@ -144,7 +145,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
144
145
  headerInfo.groupValue = hisGroupValue;
145
146
  }
146
147
  if (!dataConfig.autoRefresh || !enableDrill) {
147
- clearChartSelected(props.pageContext, props.configure, chartRef.value.chart);
148
+ clearChartSelected(props.pageContext, props.configure, (_a = chartRef.value) == null ? void 0 : _a.chart);
148
149
  }
149
150
  dataConfig.autoRefresh = false;
150
151
  updateChartOption(props.pageContext, props.configure, chartOption, resultData);
@@ -154,7 +155,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
154
155
  }
155
156
  __expose({
156
157
  updateChartDatas,
157
- exportChart
158
+ exportChart,
159
+ chartOption
158
160
  });
159
161
  return (_ctx, _cache) => {
160
162
  return openBlock(), createElementBlock("div", {
@@ -13,7 +13,7 @@ class ExpressionEvaluator {
13
13
  if (!propName || propName === "") {
14
14
  return "";
15
15
  }
16
- let value = getValueFromVariable(pageContext.entity, propName, data);
16
+ const value = getValueFromVariable(pageContext.entity, propName, data);
17
17
  let expression2 = `${leftBracket} ${this.getComparisonExpression(value, operator, getValueFromVariable(pageContext.entity, propValue, data), dataType)} ${rightBracket}`;
18
18
  if (joinSign) {
19
19
  if (joinSign === "and" || joinSign === "AND") {
@@ -196,7 +196,6 @@ function getRowStyleUtil(data, groupSummaryDataRowIndex, props) {
196
196
  if (props.configure.style.rowStyle) {
197
197
  for (let i = 0; i < props.configure.style.rowStyle.length; i++) {
198
198
  const rowStyle = props.configure.style.rowStyle[i];
199
- debugger;
200
199
  if (rowStyle.scopeFunc) {
201
200
  const func = getCustomFunc(props.pageContext, rowStyle.scopeFunc);
202
201
  if (func) {
@@ -464,9 +463,21 @@ function getIndexColumn() {
464
463
  }
465
464
  };
466
465
  }
466
+ function computeFormula(row, formula) {
467
+ try {
468
+ return new Function(
469
+ "row",
470
+ `return ${formula.replace(/\$\{row\.(\w+)\}/g, (_, key) => `row.${key}`)}`
471
+ )(row);
472
+ } catch (error) {
473
+ console.error("数据公式解析错误:", error);
474
+ return 0;
475
+ }
476
+ }
467
477
  export {
468
478
  ExpressionEvaluator,
469
479
  colDataToRow,
480
+ computeFormula,
470
481
  getCellStyleUtil,
471
482
  getColumnToRowTableConfig,
472
483
  getHeaderCellStyleUtil,
@@ -35,6 +35,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
35
35
  if (props.column.linkPage && props.column.linkPage.length > 0) {
36
36
  resloveLinkText.value = true;
37
37
  }
38
+ function formatter(row, column, cellValue, index) {
39
+ console.log("formatter", row);
40
+ }
38
41
  function showLink(row) {
39
42
  var _a;
40
43
  const show = (_a = props.column.linkPage) == null ? void 0 : _a.some((item) => {
@@ -88,6 +91,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
88
91
  }
89
92
  }
90
93
  function formatContent(row, format) {
94
+ console.log("formatContent", row, format);
91
95
  const value = row[props.column.props.base.prop];
92
96
  switch (format.type) {
93
97
  case "number":
@@ -177,7 +181,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
177
181
  label: __props.column.props.base.name,
178
182
  "header-align": __props.column.props.base.headerAlign,
179
183
  align: __props.column.props.base.align,
180
- fixed: __props.column.props.base.fixed ? __props.column.props.base.fixed : false
184
+ fixed: __props.column.props.base.fixed ? __props.column.props.base.fixed : false,
185
+ formatter
181
186
  }, {
182
187
  default: withCtx((scope) => [
183
188
  __props.column.props.format && __props.column.props.format.type ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
@@ -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
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./table-pageination.vue.js";
2
+ export {
3
+ _sfc_main as default
4
+ };