@dt-frames/ui 1.0.39 → 1.0.40

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 (2) hide show
  1. package/es/index.js +12 -4
  2. package/package.json +1 -1
package/es/index.js CHANGED
@@ -6875,15 +6875,23 @@ function useDownload(exportUrl, exportName) {
6875
6875
  const rowData = columns.map((column) => {
6876
6876
  let value = it[column.dataIndex.toString()];
6877
6877
  if (column.render && isObject(column.render) && value !== void 0) {
6878
- const { dict, date, number, percent } = column.render;
6879
- if (date) {
6878
+ const { dict, date, number, percent, struc } = column.render;
6879
+ if (struc) {
6880
+ const { appConf } = useAppStore();
6881
+ let apiStruc = appConf.structure[struc];
6882
+ if (!apiStruc) {
6883
+ error(`${struc}\u672A\u5728structure\u4E2D\u914D\u7F6E`);
6884
+ } else {
6885
+ return getDictValueByCode(value, apiStruc);
6886
+ }
6887
+ } else if (date) {
6880
6888
  return dayjs(value).format(date);
6881
6889
  } else if (dict) {
6882
6890
  return unref(getDictValueByCode(value, dict));
6883
6891
  } else if (percent) {
6884
- return (value * 100).toFixed(2) + "%";
6892
+ return formatNumber((value || 0) * 100, percent) + "%";
6885
6893
  } else if (number) {
6886
- return (value * 100).toFixed(number || 2);
6894
+ return formatNumber(value, number);
6887
6895
  }
6888
6896
  }
6889
6897
  return value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dt-frames/ui",
3
- "version": "1.0.39",
3
+ "version": "1.0.40",
4
4
  "keywords": [
5
5
  "ui",
6
6
  "dt-ui"