@teamias/rex-pro 0.0.16 → 0.0.17
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.
|
@@ -157,6 +157,16 @@ export default (function () {
|
|
|
157
157
|
props: {
|
|
158
158
|
value: '0 / 0'
|
|
159
159
|
}
|
|
160
|
+
}, {
|
|
161
|
+
type: 'link',
|
|
162
|
+
props: {
|
|
163
|
+
label: 'lz20251215001',
|
|
164
|
+
action: 'custom',
|
|
165
|
+
urlMode: 'custom',
|
|
166
|
+
url: '/query/demand/regular-detail/859029010458562561',
|
|
167
|
+
urlTarget: '_self',
|
|
168
|
+
actionType: 'url'
|
|
169
|
+
}
|
|
160
170
|
}],
|
|
161
171
|
goods_sales: [{
|
|
162
172
|
type: 'text',
|
|
@@ -19,6 +19,7 @@ import { BaseListTable, BaseTable, useRequestFieldsConfig, useRexProConfigProvid
|
|
|
19
19
|
import { Card, Pagination, Skeleton, Space } from 'antd';
|
|
20
20
|
import { cloneDeep } from 'lodash';
|
|
21
21
|
import React, { useImperativeHandle, useRef } from 'react';
|
|
22
|
+
import { Navigate } from 'react-router';
|
|
22
23
|
import { ActionButtons } from "./components/ActionButtons";
|
|
23
24
|
import { TableActionButtonGroup, ToolbarBox, Wrapper } from "./style";
|
|
24
25
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -416,6 +417,48 @@ export var RexProTable = function RexProTable(props) {
|
|
|
416
417
|
});
|
|
417
418
|
}
|
|
418
419
|
return /*#__PURE__*/_jsx(InlineRexProTable, _objectSpread(_objectSpread({}, props), {}, {
|
|
420
|
+
tableProps: _objectSpread(_objectSpread({}, props.tableProps), {}, {
|
|
421
|
+
onDataCellClickV2: function onDataCellClickV2(topConfig) {
|
|
422
|
+
var _props$tableProps, _props$tableProps$onD;
|
|
423
|
+
// 主要兼容 来自低代码的数据源
|
|
424
|
+
var item = topConfig.item,
|
|
425
|
+
subItem = topConfig.subItem;
|
|
426
|
+
var handleLink = function handleLink(target, url) {
|
|
427
|
+
if (target === '_blank') {
|
|
428
|
+
window.open(url, target);
|
|
429
|
+
} else {
|
|
430
|
+
try {
|
|
431
|
+
Navigate({
|
|
432
|
+
to: url,
|
|
433
|
+
replace: false
|
|
434
|
+
});
|
|
435
|
+
} catch (error) {
|
|
436
|
+
window.location.href = url;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
if (item.type === 'link' || item.type === 'icon') {
|
|
441
|
+
var itemProps = item.props;
|
|
442
|
+
var urlTarget = (itemProps === null || itemProps === void 0 ? void 0 : itemProps.urlTarget) || '_blank';
|
|
443
|
+
var lowCodeActionType = itemProps.actionType;
|
|
444
|
+
var lowCodeUrl = itemProps.url;
|
|
445
|
+
if (lowCodeActionType === 'url' && lowCodeUrl) {
|
|
446
|
+
handleLink(urlTarget, lowCodeUrl);
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
if (subItem && 'action' in subItem) {
|
|
451
|
+
var _urlTarget = (subItem === null || subItem === void 0 ? void 0 : subItem.urlTarget) || '_blank';
|
|
452
|
+
var url = subItem.url;
|
|
453
|
+
var _lowCodeActionType = subItem.actionType;
|
|
454
|
+
if (_lowCodeActionType === 'url' && url) {
|
|
455
|
+
handleLink(_urlTarget, url);
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
(_props$tableProps = props.tableProps) === null || _props$tableProps === void 0 || (_props$tableProps$onD = _props$tableProps.onDataCellClickV2) === null || _props$tableProps$onD === void 0 || _props$tableProps$onD.call(_props$tableProps, topConfig);
|
|
460
|
+
}
|
|
461
|
+
}),
|
|
419
462
|
reload: reload
|
|
420
463
|
}));
|
|
421
464
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamias/rex-pro",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"description": "A react library developed with dumi",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"lodash": "^4.17.21",
|
|
60
60
|
"radash": "^12.1.1",
|
|
61
61
|
"react-intl": "^7.1.11",
|
|
62
|
+
"react-router": "6",
|
|
62
63
|
"styled-components": "^6.1.19"
|
|
63
64
|
},
|
|
64
65
|
"devDependencies": {
|
|
@@ -90,7 +91,8 @@
|
|
|
90
91
|
"antd": ">=5.0.0",
|
|
91
92
|
"react": ">=16.9.0",
|
|
92
93
|
"react-dom": ">=16.9.0",
|
|
93
|
-
"react-intl": ">=3.0.0"
|
|
94
|
+
"react-intl": ">=3.0.0",
|
|
95
|
+
"react-router": ">=6"
|
|
94
96
|
},
|
|
95
97
|
"packageManager": "pnpm@9.15.9",
|
|
96
98
|
"publishConfig": {
|