@ztocwst/rc-pro-materials 0.2.26 → 0.2.27
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.js +2 -2
- package/dist/SCM_Comps.js +2 -2
- package/dist/SCM_Comps.js.map +1 -1
- package/es/components/z-data-table/components/link-renderer/index.js +2 -1
- package/es/components/z-data-table/components/table-renderer/index.js +5 -4
- package/es/components/z-data-table/components/table-renderer/table-renderer.helper.d.ts +1 -14
- package/es/components/z-data-table/components/table-renderer/table-renderer.helper.js +26 -35
- package/es/components/z-data-table/data-table.d.ts +2 -1
- package/es/components/z-data-table/data-table.helper.d.ts +1 -0
- package/es/components/z-data-table/data-table.helper.js +2 -1
- package/lib/components/z-data-table/components/link-renderer/index.js +2 -1
- package/lib/components/z-data-table/components/table-renderer/index.js +5 -4
- package/lib/components/z-data-table/components/table-renderer/table-renderer.helper.d.ts +1 -14
- package/lib/components/z-data-table/components/table-renderer/table-renderer.helper.js +26 -34
- package/lib/components/z-data-table/data-table.d.ts +2 -1
- package/lib/components/z-data-table/data-table.helper.d.ts +1 -0
- package/lib/components/z-data-table/data-table.helper.js +2 -1
- package/package.json +4 -3
|
@@ -195,9 +195,10 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
195
195
|
for (var _iterator = _createForOfIteratorHelperLoose(targets.indexSource), _step; !(_step = _iterator()).done;) {
|
|
196
196
|
var cur = _step.value;
|
|
197
197
|
if (cur !== null && cur !== void 0 && cur.sorted) {
|
|
198
|
+
var _cur$defaultSorted;
|
|
198
199
|
orderBys.push({
|
|
199
200
|
name: cur.name,
|
|
200
|
-
sort: defaultSort
|
|
201
|
+
sort: cur.defaultSorted ? (_cur$defaultSorted = cur.defaultSorted) === null || _cur$defaultSorted === void 0 ? void 0 : _cur$defaultSorted.slice(0, -3) : defaultSort
|
|
201
202
|
});
|
|
202
203
|
}
|
|
203
204
|
}
|
|
@@ -27,7 +27,6 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
27
27
|
dimJson = props.dimJson,
|
|
28
28
|
indexJson = props.indexJson,
|
|
29
29
|
actionJson = props.actionJson,
|
|
30
|
-
expressions = props.expressions,
|
|
31
30
|
linkPageTitle = props.linkPageTitle,
|
|
32
31
|
linkPage = props.linkPage,
|
|
33
32
|
queryBind = props.queryBind,
|
|
@@ -160,7 +159,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
160
159
|
var _tableRef$current;
|
|
161
160
|
var columns = handleColumns(_extends({}, option, {
|
|
162
161
|
actionJson: actionJson
|
|
163
|
-
}),
|
|
162
|
+
}), linkPage, onLink);
|
|
164
163
|
(_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.updateColumns(columns);
|
|
165
164
|
};
|
|
166
165
|
var getBigDataBody = function getBigDataBody(params) {
|
|
@@ -223,9 +222,10 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
223
222
|
description: cur.description
|
|
224
223
|
});
|
|
225
224
|
if (cur !== null && cur !== void 0 && cur.sorted) {
|
|
225
|
+
var _cur$defaultSorted;
|
|
226
226
|
orderBys.push({
|
|
227
227
|
name: cur.description,
|
|
228
|
-
sort: defaultSort
|
|
228
|
+
sort: cur.defaultSorted ? (_cur$defaultSorted = cur.defaultSorted) === null || _cur$defaultSorted === void 0 ? void 0 : _cur$defaultSorted.slice(0, -3) : defaultSort
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
231
|
}
|
|
@@ -240,9 +240,10 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
240
240
|
description: _cur.name
|
|
241
241
|
});
|
|
242
242
|
if (_cur !== null && _cur !== void 0 && _cur.sorted) {
|
|
243
|
+
var _cur$defaultSorted2;
|
|
243
244
|
orderBys.push({
|
|
244
245
|
name: _cur.name,
|
|
245
|
-
sort: defaultSort
|
|
246
|
+
sort: _cur.defaultSorted ? (_cur$defaultSorted2 = _cur.defaultSorted) === null || _cur$defaultSorted2 === void 0 ? void 0 : _cur$defaultSorted2.slice(0, -3) : defaultSort
|
|
246
247
|
});
|
|
247
248
|
}
|
|
248
249
|
}
|
|
@@ -47,20 +47,7 @@ export declare const getDimTargetData: (rcProContext: any, params: Record<string
|
|
|
47
47
|
* 数据渲染格式处理
|
|
48
48
|
*/
|
|
49
49
|
export declare const handleValueFormat: (value: valueType, record: Record<string, any>, config?: Record<string, any>, condition?: any[], onLink?: () => void) => any;
|
|
50
|
-
/**
|
|
51
|
-
* 条件格式
|
|
52
|
-
*/
|
|
53
|
-
export type ExpressionsType = any[] | [];
|
|
54
50
|
/**
|
|
55
51
|
* 根据维度指标获取表格列
|
|
56
52
|
*/
|
|
57
|
-
export declare const handleColumns: (option: DimTargetChangeOptionType & Pick<TypeZDataTableProps, 'actionJson'>,
|
|
58
|
-
title: import("antd/es/checkbox/Group").CheckboxValueType;
|
|
59
|
-
dataIndex: string;
|
|
60
|
-
ellipsis: boolean;
|
|
61
|
-
defaultSortOrder: string;
|
|
62
|
-
sorter: any;
|
|
63
|
-
width: any;
|
|
64
|
-
fixed: any;
|
|
65
|
-
render: (value: valueType, record: Record<string, any>) => any;
|
|
66
|
-
}[];
|
|
53
|
+
export declare const handleColumns: (option: DimTargetChangeOptionType & Pick<TypeZDataTableProps, 'actionJson'>, linkPage?: TypeZDataTableProps[], onLink?: (v: linkParamsType) => void) => any[];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
4
|
var _excluded = ["isFixed", "fixed", "render"];
|
|
5
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
7
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
8
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
-
import { separator, defaultSort, computeWidth, handleDecimal, handleThousand, handlePercent, handleLink, handleCondition, getDimTarget } from "../../data-table.helper";
|
|
9
|
+
import { separator, defaultSort, computeWidth, getType, handleDecimal, handleThousand, handlePercent, handleLink, handleCondition, getDimTarget } from "../../data-table.helper";
|
|
10
10
|
export var stringTrim = function stringTrim(str) {
|
|
11
11
|
if (!str) return '';
|
|
12
12
|
return str.replace(/`|'|"/g, '');
|
|
@@ -167,71 +167,62 @@ export var handleValueFormat = function handleValueFormat(value, record, config,
|
|
|
167
167
|
return (_val = val) !== null && _val !== void 0 ? _val : "-";
|
|
168
168
|
};
|
|
169
169
|
|
|
170
|
-
/**
|
|
171
|
-
* 条件格式
|
|
172
|
-
*/
|
|
173
|
-
|
|
174
170
|
/**
|
|
175
171
|
* 根据维度指标获取表格列
|
|
176
172
|
*/
|
|
177
|
-
export var handleColumns = function handleColumns(option,
|
|
173
|
+
export var handleColumns = function handleColumns(option, linkPage, onLink) {
|
|
178
174
|
var _option$actionJson;
|
|
179
|
-
|
|
175
|
+
// let isFirst = true
|
|
180
176
|
var dimTarget = [].concat(option.dimension, option.index);
|
|
181
177
|
var columns = dimTarget.map(function (title) {
|
|
182
|
-
var
|
|
178
|
+
var _config3, _config3$link, _config4, _config5, _config6, _config6$otherProps, _config7, _config8, _config9, _config10, _config11, _title$toString, _config12, _config13, _config14;
|
|
183
179
|
var config;
|
|
184
180
|
var dataIndex;
|
|
185
|
-
var defaultSortOrder;
|
|
186
181
|
var condition;
|
|
187
182
|
if (!config) {
|
|
188
|
-
var _option$dimensionSour, _config
|
|
183
|
+
var _option$dimensionSour, _config;
|
|
189
184
|
/* 通过别名或名称 查找当前维度的配置 */
|
|
190
185
|
config = (_option$dimensionSour = option.dimensionSource) === null || _option$dimensionSour === void 0 ? void 0 : _option$dimensionSour.find(function (item) {
|
|
191
186
|
return item.alias === title || item.description === title;
|
|
192
187
|
});
|
|
193
188
|
dataIndex = (_config = config) === null || _config === void 0 ? void 0 : _config.description;
|
|
194
|
-
if
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}
|
|
189
|
+
// if(config?.sorted && isFirst){
|
|
190
|
+
// isFirst = false
|
|
191
|
+
// }
|
|
198
192
|
}
|
|
193
|
+
|
|
199
194
|
if (!config) {
|
|
200
|
-
var _option$indexSource,
|
|
195
|
+
var _option$indexSource, _config2;
|
|
201
196
|
/* 通过别名或名称 查找当前指标的配置 */
|
|
202
197
|
config = (_option$indexSource = option.indexSource) === null || _option$indexSource === void 0 ? void 0 : _option$indexSource.find(function (item) {
|
|
203
198
|
return item.alias === title || item.name === title;
|
|
204
199
|
});
|
|
205
|
-
dataIndex = (
|
|
206
|
-
if
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}
|
|
200
|
+
dataIndex = (_config2 = config) === null || _config2 === void 0 ? void 0 : _config2.name;
|
|
201
|
+
// if(config?.sorted && isFirst){
|
|
202
|
+
// isFirst = false
|
|
203
|
+
// }
|
|
210
204
|
}
|
|
211
|
-
/* 条件格式设置 */
|
|
212
|
-
// if (expressions?.length) {
|
|
213
|
-
// condition = expressions?.filter((item) => item?.index?.includes(config?.name));
|
|
214
|
-
// }
|
|
215
205
|
|
|
216
|
-
var _ref4 = ((
|
|
206
|
+
var _ref4 = ((_config3 = config) === null || _config3 === void 0 ? void 0 : (_config3$link = _config3.link) === null || _config3$link === void 0 ? void 0 : _config3$link.split(separator)) || [],
|
|
217
207
|
dataSetName = _ref4[0];
|
|
218
208
|
var index;
|
|
219
|
-
if ((
|
|
209
|
+
if ((_config4 = config) !== null && _config4 !== void 0 && _config4.link && linkPage !== null && linkPage !== void 0 && linkPage.length) {
|
|
220
210
|
index = linkPage.findIndex(function (link) {
|
|
221
211
|
return "" + link.dataSetName + separator + link.title === config.link;
|
|
222
212
|
});
|
|
223
213
|
}
|
|
224
|
-
|
|
214
|
+
var other = _extends({}, getType((_config5 = config) === null || _config5 === void 0 ? void 0 : _config5.otherProps) === 'function' ? (_config6 = config) === null || _config6 === void 0 ? void 0 : (_config6$otherProps = _config6.otherProps) === null || _config6$otherProps === void 0 ? void 0 : _config6$otherProps.call(_config6) : (_config7 = config) === null || _config7 === void 0 ? void 0 : _config7.otherProps);
|
|
215
|
+
return _extends({}, other, {
|
|
225
216
|
title: title,
|
|
226
217
|
dataIndex: dataIndex,
|
|
227
218
|
ellipsis: true,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
width: ((
|
|
231
|
-
fixed: (
|
|
219
|
+
sorter: (_config8 = config) === null || _config8 === void 0 ? void 0 : _config8.sorted,
|
|
220
|
+
defaultSortOrder: (_config9 = config) !== null && _config9 !== void 0 && _config9.sorted ? ((_config10 = config) === null || _config10 === void 0 ? void 0 : _config10.defaultSorted) || defaultSort + "end" : undefined,
|
|
221
|
+
width: ((_config11 = config) === null || _config11 === void 0 ? void 0 : _config11.width) || computeWidth(title === null || title === void 0 ? void 0 : (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.length),
|
|
222
|
+
fixed: (_config12 = config) !== null && _config12 !== void 0 && _config12.isFixed ? ((_config13 = config) === null || _config13 === void 0 ? void 0 : _config13.fixed) || ((_config14 = config) === null || _config14 === void 0 ? void 0 : _config14.isFixed) : false,
|
|
232
223
|
render: function render(value, record) {
|
|
233
|
-
var _config$render,
|
|
234
|
-
return config.custom ? (_config$render = (
|
|
224
|
+
var _config$render, _config15;
|
|
225
|
+
return config.custom ? (_config$render = (_config15 = config).render) === null || _config$render === void 0 ? void 0 : _config$render.call(_config15, value, record, config, condition) : handleValueFormat(value, record, config, condition, function () {
|
|
235
226
|
return onLink({
|
|
236
227
|
dataSetName: dataSetName,
|
|
237
228
|
index: index,
|
|
@@ -239,7 +230,7 @@ export var handleColumns = function handleColumns(option, expressions, linkPage,
|
|
|
239
230
|
});
|
|
240
231
|
});
|
|
241
232
|
}
|
|
242
|
-
};
|
|
233
|
+
});
|
|
243
234
|
});
|
|
244
235
|
if (option !== null && option !== void 0 && (_option$actionJson = option.actionJson) !== null && _option$actionJson !== void 0 && _option$actionJson.custom) {
|
|
245
236
|
var _columns$fn;
|
|
@@ -20,6 +20,8 @@ export interface TypeTargetProps {
|
|
|
20
20
|
percent: boolean;
|
|
21
21
|
/** 是否允许排序 */
|
|
22
22
|
sorted: boolean;
|
|
23
|
+
/** 默认排序 */
|
|
24
|
+
defaultSorted?: string;
|
|
23
25
|
/** 宽度 */
|
|
24
26
|
width: number;
|
|
25
27
|
/** 是否合计 */
|
|
@@ -91,7 +93,6 @@ export interface TypeZDataTableProps {
|
|
|
91
93
|
menuId: string;
|
|
92
94
|
};
|
|
93
95
|
/** 条件格式设置 */
|
|
94
|
-
expressions?: any[] | [];
|
|
95
96
|
linkPageTitle?: string;
|
|
96
97
|
/** 下钻二级页设置 */
|
|
97
98
|
linkPage?: TypeZDataTableProps[];
|
|
@@ -10,6 +10,7 @@ import rcProRequest from "../../utils/rcProRequest";
|
|
|
10
10
|
export var tableConfigDefault = {
|
|
11
11
|
manual: true,
|
|
12
12
|
toolBars: false,
|
|
13
|
+
resizable: false,
|
|
13
14
|
hideDefRowSelection: true,
|
|
14
15
|
columns: []
|
|
15
16
|
};
|
|
@@ -175,7 +176,7 @@ export var handleCondition = function handleCondition(value, handledValue, condi
|
|
|
175
176
|
};
|
|
176
177
|
|
|
177
178
|
// mock
|
|
178
|
-
var token = 'scm:tenant:token:2:104:
|
|
179
|
+
var token = 'scm:tenant:token:2:104:9e53d7bb-7dac-4e2e-a371-060007dc9f76';
|
|
179
180
|
|
|
180
181
|
/** 获取维度指标 */
|
|
181
182
|
export var getDimTarget = /*#__PURE__*/function () {
|
|
@@ -200,9 +200,10 @@ var LinkRenderer = function LinkRenderer(props) {
|
|
|
200
200
|
for (var _iterator = _createForOfIteratorHelperLoose(targets.indexSource), _step; !(_step = _iterator()).done;) {
|
|
201
201
|
var cur = _step.value;
|
|
202
202
|
if (cur !== null && cur !== void 0 && cur.sorted) {
|
|
203
|
+
var _cur$defaultSorted;
|
|
203
204
|
orderBys.push({
|
|
204
205
|
name: cur.name,
|
|
205
|
-
sort: _dataTable.defaultSort
|
|
206
|
+
sort: cur.defaultSorted ? (_cur$defaultSorted = cur.defaultSorted) === null || _cur$defaultSorted === void 0 ? void 0 : _cur$defaultSorted.slice(0, -3) : _dataTable.defaultSort
|
|
206
207
|
});
|
|
207
208
|
}
|
|
208
209
|
}
|
|
@@ -32,7 +32,6 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
32
32
|
dimJson = props.dimJson,
|
|
33
33
|
indexJson = props.indexJson,
|
|
34
34
|
actionJson = props.actionJson,
|
|
35
|
-
expressions = props.expressions,
|
|
36
35
|
linkPageTitle = props.linkPageTitle,
|
|
37
36
|
linkPage = props.linkPage,
|
|
38
37
|
queryBind = props.queryBind,
|
|
@@ -165,7 +164,7 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
165
164
|
var _tableRef$current;
|
|
166
165
|
var columns = (0, _tableRenderer.handleColumns)((0, _extends2["default"])({}, option, {
|
|
167
166
|
actionJson: actionJson
|
|
168
|
-
}),
|
|
167
|
+
}), linkPage, onLink);
|
|
169
168
|
(_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.updateColumns(columns);
|
|
170
169
|
};
|
|
171
170
|
var getBigDataBody = function getBigDataBody(params) {
|
|
@@ -228,9 +227,10 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
228
227
|
description: cur.description
|
|
229
228
|
});
|
|
230
229
|
if (cur !== null && cur !== void 0 && cur.sorted) {
|
|
230
|
+
var _cur$defaultSorted;
|
|
231
231
|
orderBys.push({
|
|
232
232
|
name: cur.description,
|
|
233
|
-
sort: _dataTable.defaultSort
|
|
233
|
+
sort: cur.defaultSorted ? (_cur$defaultSorted = cur.defaultSorted) === null || _cur$defaultSorted === void 0 ? void 0 : _cur$defaultSorted.slice(0, -3) : _dataTable.defaultSort
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
236
|
}
|
|
@@ -245,9 +245,10 @@ var TableRenderer = function TableRenderer(props) {
|
|
|
245
245
|
description: _cur.name
|
|
246
246
|
});
|
|
247
247
|
if (_cur !== null && _cur !== void 0 && _cur.sorted) {
|
|
248
|
+
var _cur$defaultSorted2;
|
|
248
249
|
orderBys.push({
|
|
249
250
|
name: _cur.name,
|
|
250
|
-
sort: _dataTable.defaultSort
|
|
251
|
+
sort: _cur.defaultSorted ? (_cur$defaultSorted2 = _cur.defaultSorted) === null || _cur$defaultSorted2 === void 0 ? void 0 : _cur$defaultSorted2.slice(0, -3) : _dataTable.defaultSort
|
|
251
252
|
});
|
|
252
253
|
}
|
|
253
254
|
}
|
|
@@ -47,20 +47,7 @@ export declare const getDimTargetData: (rcProContext: any, params: Record<string
|
|
|
47
47
|
* 数据渲染格式处理
|
|
48
48
|
*/
|
|
49
49
|
export declare const handleValueFormat: (value: valueType, record: Record<string, any>, config?: Record<string, any>, condition?: any[], onLink?: () => void) => any;
|
|
50
|
-
/**
|
|
51
|
-
* 条件格式
|
|
52
|
-
*/
|
|
53
|
-
export type ExpressionsType = any[] | [];
|
|
54
50
|
/**
|
|
55
51
|
* 根据维度指标获取表格列
|
|
56
52
|
*/
|
|
57
|
-
export declare const handleColumns: (option: DimTargetChangeOptionType & Pick<TypeZDataTableProps, 'actionJson'>,
|
|
58
|
-
title: import("antd/es/checkbox/Group").CheckboxValueType;
|
|
59
|
-
dataIndex: string;
|
|
60
|
-
ellipsis: boolean;
|
|
61
|
-
defaultSortOrder: string;
|
|
62
|
-
sorter: any;
|
|
63
|
-
width: any;
|
|
64
|
-
fixed: any;
|
|
65
|
-
render: (value: valueType, record: Record<string, any>) => any;
|
|
66
|
-
}[];
|
|
53
|
+
export declare const handleColumns: (option: DimTargetChangeOptionType & Pick<TypeZDataTableProps, 'actionJson'>, linkPage?: TypeZDataTableProps[], onLink?: (v: linkParamsType) => void) => any[];
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports.stringTrim = exports.handleValueFormat = exports.handleDimTargetFormat = exports.handleColumns = exports.getDimTargetData = void 0;
|
|
6
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
6
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
8
7
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _dataTable = require("../../data-table.helper");
|
|
11
11
|
var _excluded = ["isFixed", "fixed", "render"];
|
|
@@ -175,71 +175,63 @@ var handleValueFormat = function handleValueFormat(value, record, config, condit
|
|
|
175
175
|
return (_val = val) !== null && _val !== void 0 ? _val : "-";
|
|
176
176
|
};
|
|
177
177
|
|
|
178
|
-
/**
|
|
179
|
-
* 条件格式
|
|
180
|
-
*/
|
|
181
|
-
exports.handleValueFormat = handleValueFormat;
|
|
182
178
|
/**
|
|
183
179
|
* 根据维度指标获取表格列
|
|
184
180
|
*/
|
|
185
|
-
|
|
181
|
+
exports.handleValueFormat = handleValueFormat;
|
|
182
|
+
var handleColumns = function handleColumns(option, linkPage, onLink) {
|
|
186
183
|
var _option$actionJson;
|
|
187
|
-
|
|
184
|
+
// let isFirst = true
|
|
188
185
|
var dimTarget = [].concat(option.dimension, option.index);
|
|
189
186
|
var columns = dimTarget.map(function (title) {
|
|
190
|
-
var
|
|
187
|
+
var _config3, _config3$link, _config4, _config5, _config6, _config6$otherProps, _config7, _config8, _config9, _config10, _config11, _title$toString, _config12, _config13, _config14;
|
|
191
188
|
var config;
|
|
192
189
|
var dataIndex;
|
|
193
|
-
var defaultSortOrder;
|
|
194
190
|
var condition;
|
|
195
191
|
if (!config) {
|
|
196
|
-
var _option$dimensionSour, _config
|
|
192
|
+
var _option$dimensionSour, _config;
|
|
197
193
|
/* 通过别名或名称 查找当前维度的配置 */
|
|
198
194
|
config = (_option$dimensionSour = option.dimensionSource) === null || _option$dimensionSour === void 0 ? void 0 : _option$dimensionSour.find(function (item) {
|
|
199
195
|
return item.alias === title || item.description === title;
|
|
200
196
|
});
|
|
201
197
|
dataIndex = (_config = config) === null || _config === void 0 ? void 0 : _config.description;
|
|
202
|
-
if
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
198
|
+
// if(config?.sorted && isFirst){
|
|
199
|
+
// isFirst = false
|
|
200
|
+
// }
|
|
206
201
|
}
|
|
202
|
+
|
|
207
203
|
if (!config) {
|
|
208
|
-
var _option$indexSource,
|
|
204
|
+
var _option$indexSource, _config2;
|
|
209
205
|
/* 通过别名或名称 查找当前指标的配置 */
|
|
210
206
|
config = (_option$indexSource = option.indexSource) === null || _option$indexSource === void 0 ? void 0 : _option$indexSource.find(function (item) {
|
|
211
207
|
return item.alias === title || item.name === title;
|
|
212
208
|
});
|
|
213
|
-
dataIndex = (
|
|
214
|
-
if
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}
|
|
209
|
+
dataIndex = (_config2 = config) === null || _config2 === void 0 ? void 0 : _config2.name;
|
|
210
|
+
// if(config?.sorted && isFirst){
|
|
211
|
+
// isFirst = false
|
|
212
|
+
// }
|
|
218
213
|
}
|
|
219
|
-
/* 条件格式设置 */
|
|
220
|
-
// if (expressions?.length) {
|
|
221
|
-
// condition = expressions?.filter((item) => item?.index?.includes(config?.name));
|
|
222
|
-
// }
|
|
223
214
|
|
|
224
|
-
var _ref4 = ((
|
|
215
|
+
var _ref4 = ((_config3 = config) === null || _config3 === void 0 ? void 0 : (_config3$link = _config3.link) === null || _config3$link === void 0 ? void 0 : _config3$link.split(_dataTable.separator)) || [],
|
|
225
216
|
dataSetName = _ref4[0];
|
|
226
217
|
var index;
|
|
227
|
-
if ((
|
|
218
|
+
if ((_config4 = config) !== null && _config4 !== void 0 && _config4.link && linkPage !== null && linkPage !== void 0 && linkPage.length) {
|
|
228
219
|
index = linkPage.findIndex(function (link) {
|
|
229
220
|
return "" + link.dataSetName + _dataTable.separator + link.title === config.link;
|
|
230
221
|
});
|
|
231
222
|
}
|
|
232
|
-
|
|
223
|
+
var other = (0, _extends2["default"])({}, (0, _dataTable.getType)((_config5 = config) === null || _config5 === void 0 ? void 0 : _config5.otherProps) === 'function' ? (_config6 = config) === null || _config6 === void 0 ? void 0 : (_config6$otherProps = _config6.otherProps) === null || _config6$otherProps === void 0 ? void 0 : _config6$otherProps.call(_config6) : (_config7 = config) === null || _config7 === void 0 ? void 0 : _config7.otherProps);
|
|
224
|
+
return (0, _extends2["default"])({}, other, {
|
|
233
225
|
title: title,
|
|
234
226
|
dataIndex: dataIndex,
|
|
235
227
|
ellipsis: true,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
width: ((
|
|
239
|
-
fixed: (
|
|
228
|
+
sorter: (_config8 = config) === null || _config8 === void 0 ? void 0 : _config8.sorted,
|
|
229
|
+
defaultSortOrder: (_config9 = config) !== null && _config9 !== void 0 && _config9.sorted ? ((_config10 = config) === null || _config10 === void 0 ? void 0 : _config10.defaultSorted) || _dataTable.defaultSort + "end" : undefined,
|
|
230
|
+
width: ((_config11 = config) === null || _config11 === void 0 ? void 0 : _config11.width) || (0, _dataTable.computeWidth)(title === null || title === void 0 ? void 0 : (_title$toString = title.toString()) === null || _title$toString === void 0 ? void 0 : _title$toString.length),
|
|
231
|
+
fixed: (_config12 = config) !== null && _config12 !== void 0 && _config12.isFixed ? ((_config13 = config) === null || _config13 === void 0 ? void 0 : _config13.fixed) || ((_config14 = config) === null || _config14 === void 0 ? void 0 : _config14.isFixed) : false,
|
|
240
232
|
render: function render(value, record) {
|
|
241
|
-
var _config$render,
|
|
242
|
-
return config.custom ? (_config$render = (
|
|
233
|
+
var _config$render, _config15;
|
|
234
|
+
return config.custom ? (_config$render = (_config15 = config).render) === null || _config$render === void 0 ? void 0 : _config$render.call(_config15, value, record, config, condition) : handleValueFormat(value, record, config, condition, function () {
|
|
243
235
|
return onLink({
|
|
244
236
|
dataSetName: dataSetName,
|
|
245
237
|
index: index,
|
|
@@ -247,7 +239,7 @@ var handleColumns = function handleColumns(option, expressions, linkPage, onLink
|
|
|
247
239
|
});
|
|
248
240
|
});
|
|
249
241
|
}
|
|
250
|
-
};
|
|
242
|
+
});
|
|
251
243
|
});
|
|
252
244
|
if (option !== null && option !== void 0 && (_option$actionJson = option.actionJson) !== null && _option$actionJson !== void 0 && _option$actionJson.custom) {
|
|
253
245
|
var _columns$fn;
|
|
@@ -20,6 +20,8 @@ export interface TypeTargetProps {
|
|
|
20
20
|
percent: boolean;
|
|
21
21
|
/** 是否允许排序 */
|
|
22
22
|
sorted: boolean;
|
|
23
|
+
/** 默认排序 */
|
|
24
|
+
defaultSorted?: string;
|
|
23
25
|
/** 宽度 */
|
|
24
26
|
width: number;
|
|
25
27
|
/** 是否合计 */
|
|
@@ -91,7 +93,6 @@ export interface TypeZDataTableProps {
|
|
|
91
93
|
menuId: string;
|
|
92
94
|
};
|
|
93
95
|
/** 条件格式设置 */
|
|
94
|
-
expressions?: any[] | [];
|
|
95
96
|
linkPageTitle?: string;
|
|
96
97
|
/** 下钻二级页设置 */
|
|
97
98
|
linkPage?: TypeZDataTableProps[];
|
|
@@ -14,6 +14,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
14
14
|
var tableConfigDefault = {
|
|
15
15
|
manual: true,
|
|
16
16
|
toolBars: false,
|
|
17
|
+
resizable: false,
|
|
17
18
|
hideDefRowSelection: true,
|
|
18
19
|
columns: []
|
|
19
20
|
};
|
|
@@ -193,7 +194,7 @@ var handleCondition = function handleCondition(value, handledValue, conditions)
|
|
|
193
194
|
|
|
194
195
|
// mock
|
|
195
196
|
exports.handleCondition = handleCondition;
|
|
196
|
-
var token = 'scm:tenant:token:2:104:
|
|
197
|
+
var token = 'scm:tenant:token:2:104:9e53d7bb-7dac-4e2e-a371-060007dc9f76';
|
|
197
198
|
|
|
198
199
|
/** 获取维度指标 */
|
|
199
200
|
var getDimTarget = /*#__PURE__*/function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ztocwst/rc-pro-materials",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.27",
|
|
4
4
|
"description": "@ztocwst/rc-pro-materials",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"f2elint-fix": "f2elint fix",
|
|
23
23
|
"dumi": "cross-env APP_ROOT=docs dumi dev",
|
|
24
24
|
"dumi:build": "cross-env APP_ROOT=docs dumi build",
|
|
25
|
+
"-prepublishOnly": "npm run build && npm run lowcode:build",
|
|
25
26
|
"ding": "node ./scripts/notify",
|
|
26
27
|
"postpublish": "npm run ding"
|
|
27
28
|
},
|
|
@@ -85,9 +86,9 @@
|
|
|
85
86
|
},
|
|
86
87
|
"componentConfig": {
|
|
87
88
|
"isComponentLibrary": true,
|
|
88
|
-
"materialSchema": "https://npm.ztocwst.com/@ztocwst/rc-pro-materials@0.2.
|
|
89
|
+
"materialSchema": "https://npm.ztocwst.com/@ztocwst/rc-pro-materials@0.2.27/build/lowcode/assets-prod.json"
|
|
89
90
|
},
|
|
90
|
-
"homepage": "https://unpkg.com/@ztocwst/rc-pro-materials@0.2.
|
|
91
|
+
"homepage": "https://unpkg.com/@ztocwst/rc-pro-materials@0.2.27/build/index.html",
|
|
91
92
|
"publishConfig": {
|
|
92
93
|
"registry": "https://registry.npmjs.org/",
|
|
93
94
|
"access": "public"
|