@cloudbase/weda-ui 3.4.10 → 3.4.11
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/dist/configs/components/wd-table.js +1 -1
- package/dist/web/components/calendar/index.js +1 -1
- package/dist/web/components/form/enumSelect/MultipleSelect.js +1 -0
- package/dist/web/components/form/enumSelect/SelectContainer.js +1 -0
- package/dist/web/components/form/input/index.js +11 -5
- package/dist/web/components/form/location/components/LocationPC/Header.js +1 -0
- package/dist/web/components/form/location/index.js +1 -0
- package/dist/web/components/form/select/request.js +14 -2
- package/dist/web/components/form/uploader/uploader.h5.js +1 -1
- package/dist/web/components/form/uploader/uploader.pc.js +3 -2
- package/dist/web/components/form/uploaderFile/index.js +2 -0
- package/dist/web/components/form/userOrgSelect/common/fetch-data-service.js +47 -43
- package/dist/web/components/form/userOrgSelect/common/utils.js +0 -20
- package/dist/web/components/form/userOrgSelect/component/depart-select/depart-select-pc.js +8 -3
- package/dist/web/components/form/userOrgSelect/component/depart-select/index.js +18 -14
- package/dist/web/components/form/userOrgSelect/component/depart-select/org-modal-pc.js +14 -20
- package/dist/web/components/form/userOrgSelect/component/modal-select-h5.js +1 -1
- package/dist/web/components/form/userOrgSelect/component/org-tree.js +1 -3
- package/dist/web/components/form/userOrgSelect/component/user-select-h5/index.js +4 -29
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-model.js +7 -2
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-select-pc.js +4 -6
- package/dist/web/components/form/userOrgSelect/component/userOrgSelect.css +2 -8
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +51 -25
- package/dist/web/components/form-input-hooks/index.js +2 -1
- package/dist/web/components/repeater/index.js +1 -0
- package/dist/web/components/repeater-item/index.js +1 -0
- package/dist/web/components/statusContent/index.js +1 -0
- package/dist/web/components/table/ImportFileModalByApi/uploadCSVFile.js +1 -1
- package/dist/web/components/wd-form/index.js +3 -2
- package/dist/web/components/wd-table/components/FieldRender/index.js +15 -18
- package/dist/web/components/wd-table/wd-table.js +18 -18
- package/dist/web/utils/datasource.js +23 -17
- package/package.json +1 -1
- package/dist/web/components/emptyContent/index.js +0 -46
- package/dist/web/components/flow/components/FlowModuleText/Content.js +0 -6
- package/dist/web/components/flow/components/FlowModuleText/Title.js +0 -16
- package/dist/web/components/flow/components/FlowModuleText/index.js +0 -7
- package/dist/web/components/flow/components/FlowModuleText/utils.js +0 -34
- package/dist/web/components/flow/components/FlowStatusText/index.js +0 -37
- package/dist/web/components/flow/components/HighLightComment/index.js +0 -31
- package/dist/web/components/flow/components/index.js +0 -3
- package/dist/web/components/flow/constants/index.js +0 -65
- package/dist/web/components/flow/frame/getCommonFlowData.js +0 -80
- package/dist/web/components/flow/frame/hooks/index.js +0 -2
- package/dist/web/components/flow/frame/hooks/useCommonFlowRequest.js +0 -148
- package/dist/web/components/flow/frame/hooks/useElementMediaQuery.js +0 -15
- package/dist/web/components/flow/frame/index.js +0 -76
- package/dist/web/components/flow/frame/types.js +0 -277
- package/dist/web/components/flow/frame/utils.js +0 -149
- package/dist/web/components/flow/modules/chart/Chart.js +0 -282
- package/dist/web/components/flow/modules/chart/constants.js +0 -28
- package/dist/web/components/flow/modules/chart/index.css +0 -84
- package/dist/web/components/flow/modules/chart/isString.js +0 -5
- package/dist/web/components/flow/modules/chart/utils.js +0 -111
- package/dist/web/components/flow/modules/operations/controls-items/flow-task-info-modal.js +0 -98
- package/dist/web/components/flow/modules/process/Process.js +0 -73
- package/dist/web/components/flow/modules/process/ProcessMobile.js +0 -81
- package/dist/web/components/flow/modules/process/index.js +0 -14
- package/dist/web/components/flow/modules/process/utils/index.js +0 -32
- package/dist/web/components/flow/services/flow.js +0 -111
- package/dist/web/components/flow/services/ideData/chart.js +0 -88
- package/dist/web/components/flow/services/ideData/index.js +0 -5
- package/dist/web/components/flow/services/ideData/instance.js +0 -23
- package/dist/web/components/flow/services/ideData/pageDetail.js +0 -42
- package/dist/web/components/flow/services/ideData/process.js +0 -27
- package/dist/web/components/flow/services/index.js +0 -2
- package/dist/web/components/flow/services/user.js +0 -23
- package/dist/web/components/flow/services/utils.js +0 -28
- package/dist/web/components/form/userOrgSelect/component/OrgPaths.js +0 -12
- package/dist/web/components/form/userOrgSelect/component/depart-select/departTreeSelect.h5.js +0 -156
|
@@ -986,13 +986,10 @@
|
|
|
986
986
|
|
|
987
987
|
.weda-select-user-dept .weda-select-user-dept__result-list,
|
|
988
988
|
.weda-select-user-dept__dialog .weda-select-user-dept__result-list {
|
|
989
|
-
|
|
989
|
+
flex: 1 1 0px;
|
|
990
990
|
display: flex;
|
|
991
991
|
align-items: center;
|
|
992
|
-
overflow: hidden;
|
|
993
|
-
overflow-x: scroll;
|
|
994
|
-
width: 100%;
|
|
995
|
-
white-space: nowrap;
|
|
992
|
+
overflow: hidden;
|
|
996
993
|
}
|
|
997
994
|
|
|
998
995
|
.weda-select-user-dept .weda-select-user-dept__result-list .wedatea2td-tag,
|
|
@@ -1045,9 +1042,6 @@
|
|
|
1045
1042
|
font-size: 12px;
|
|
1046
1043
|
line-height: 20px;
|
|
1047
1044
|
color: rgba(0, 0, 0, 0.9);
|
|
1048
|
-
position: relative;
|
|
1049
|
-
display: inline-block;
|
|
1050
|
-
margin-left: 6px;
|
|
1051
1045
|
}
|
|
1052
1046
|
|
|
1053
1047
|
.weda-select-user-dept__dialog
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import React, { useState } from 'react';
|
|
2
|
+
import React, { useState, useEffect } from 'react';
|
|
3
3
|
import { renderDecorator } from '../../renderDecorator';
|
|
4
4
|
import { IconFont } from 'tdesign-icons-react';
|
|
5
5
|
import classNames from '../../../../utils/classnames';
|
|
6
|
-
import {
|
|
6
|
+
import { getNode, fetchSearchOrg } from '../common/utils';
|
|
7
7
|
import { Modal, Button, ConfigProvider, Radio, Status, Bubble, } from 'tea-component';
|
|
8
8
|
import { ModalSearchH5 } from '../component/modal-search-h5';
|
|
9
9
|
import { LoadingStatus, ErrorStatus } from '../component/error-tips';
|
|
@@ -23,12 +23,24 @@ export function DepartTreeSelectH5({ id, className, style, label = '部门选择
|
|
|
23
23
|
});
|
|
24
24
|
const [visible, setVisible] = React.useState(false);
|
|
25
25
|
const [isSearch, setIsSearch] = useState(false);
|
|
26
|
+
// const [showTreeData, setShowTreeData] = useState([]);
|
|
26
27
|
const [showTreeData, setShowTreeData] = useState([]);
|
|
27
|
-
|
|
28
|
-
const [
|
|
28
|
+
const [originalOrgData, setOriginalOrgData] = useState([]);
|
|
29
|
+
const [count, setCount] = useState(1); //计数弹窗显示层级
|
|
29
30
|
const [searchValue, setSearchValue] = useState('');
|
|
30
31
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
31
32
|
const [loading, setLoading] = useState({ id: null, status: false });
|
|
33
|
+
const [titleText, setTitleText] = useState('');
|
|
34
|
+
const treeNode = getNode(treeData, 'root', 'id');
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
// 仅执行一次
|
|
37
|
+
if (treeData) {
|
|
38
|
+
setShowTreeData(treeNode);
|
|
39
|
+
setOriginalOrgData([{ index: 1, treeData: treeNode, title: '选择部门' }]);
|
|
40
|
+
setTitleText('选择部门');
|
|
41
|
+
}
|
|
42
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
43
|
+
}, [treeData]);
|
|
32
44
|
const handleFocus = (value) => {
|
|
33
45
|
setIsSearch(value);
|
|
34
46
|
};
|
|
@@ -36,7 +48,8 @@ export function DepartTreeSelectH5({ id, className, style, label = '部门选择
|
|
|
36
48
|
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
37
49
|
handleFocus(false);
|
|
38
50
|
setSearchValue('');
|
|
39
|
-
setShowTreeData(
|
|
51
|
+
setShowTreeData(treeNode);
|
|
52
|
+
// initOrgsData();
|
|
40
53
|
};
|
|
41
54
|
const onSearch = debounce((key) => {
|
|
42
55
|
try {
|
|
@@ -46,7 +59,7 @@ export function DepartTreeSelectH5({ id, className, style, label = '部门选择
|
|
|
46
59
|
setShowTreeData(res);
|
|
47
60
|
}
|
|
48
61
|
else {
|
|
49
|
-
setShowTreeData(
|
|
62
|
+
setShowTreeData(treeNode);
|
|
50
63
|
}
|
|
51
64
|
}
|
|
52
65
|
catch (e) {
|
|
@@ -56,45 +69,58 @@ export function DepartTreeSelectH5({ id, className, style, label = '部门选择
|
|
|
56
69
|
const onFocus = function () {
|
|
57
70
|
setSearchValue('');
|
|
58
71
|
setVisible(true);
|
|
59
|
-
setShowTreeData(
|
|
72
|
+
setShowTreeData(treeNode);
|
|
60
73
|
};
|
|
61
74
|
const onClose = () => {
|
|
62
75
|
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
63
76
|
setVisible(false);
|
|
64
|
-
setShowTreeData(
|
|
77
|
+
setShowTreeData(treeNode);
|
|
78
|
+
setShowTreeData(treeNode);
|
|
65
79
|
};
|
|
66
80
|
const onConfirm = (selectedOrgList = []) => {
|
|
67
81
|
setConfirmOrgList(selectedOrgList);
|
|
68
82
|
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
69
|
-
setShowTreeData(
|
|
83
|
+
setShowTreeData(treeNode);
|
|
70
84
|
setVisible(false);
|
|
71
85
|
};
|
|
72
86
|
// 获取某节点子部门
|
|
73
87
|
const loadItem = (item) => {
|
|
74
88
|
setShowTreeData((item === null || item === void 0 ? void 0 : item.children) ? [].concat(item === null || item === void 0 ? void 0 : item.children) : []);
|
|
75
|
-
|
|
89
|
+
originalOrgData.push({
|
|
90
|
+
index: count + 1,
|
|
91
|
+
treeData: item === null || item === void 0 ? void 0 : item.children,
|
|
92
|
+
title: item === null || item === void 0 ? void 0 : item.content,
|
|
93
|
+
});
|
|
94
|
+
setCount(count + 1);
|
|
95
|
+
setOriginalOrgData(originalOrgData);
|
|
96
|
+
setTitleText(item === null || item === void 0 ? void 0 : item.content);
|
|
76
97
|
};
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
98
|
+
//判断当前页结构为第几层,如首次渲染则添加至orgsTreeData,二次进入刷新index数据
|
|
99
|
+
const retLevel = (count) => {
|
|
100
|
+
const storageOriTreeData = [];
|
|
101
|
+
if (count !== 1) {
|
|
102
|
+
originalOrgData.map((item) => {
|
|
103
|
+
if ((item === null || item === void 0 ? void 0 : item.index) < count) {
|
|
104
|
+
storageOriTreeData.push(item);
|
|
105
|
+
if ((item === null || item === void 0 ? void 0 : item.index) === count - 1) {
|
|
106
|
+
setCount(count - 1);
|
|
107
|
+
setTitleText(item.title);
|
|
108
|
+
setShowTreeData((item === null || item === void 0 ? void 0 : item.treeData) || []);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
setOriginalOrgData(storageOriTreeData);
|
|
86
116
|
}
|
|
87
117
|
else {
|
|
88
|
-
|
|
89
|
-
const parent = getNodeFromTreeByCode(treeData, targetItem.parentcode);
|
|
90
|
-
setShowTreeData((parent === null || parent === void 0 ? void 0 : parent.children) || []);
|
|
91
|
-
// 标记当前是从根节点进到这一层
|
|
92
|
-
setCurrentItem(parent);
|
|
118
|
+
onClose();
|
|
93
119
|
}
|
|
94
120
|
};
|
|
95
121
|
return renderDecorator(_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsxs("div", { className: subCls, children: [_jsx("div", { className: "weui-cell__bd weui-flex", children: _jsx("input", { className: "weui-input", placeholder: placeholder,
|
|
96
122
|
//value={value}
|
|
97
|
-
value: (confirmOrgList || []).map((e) => e === null || e === void 0 ? void 0 : e.content).join(','), disabled: disabled, name: name, autoFocus: autoFocus, onClick: onFocus, readOnly: true, role: "input" }) }), _jsxs(Modal, {
|
|
123
|
+
value: (confirmOrgList || []).map((e) => e === null || e === void 0 ? void 0 : e.content).join(','), disabled: disabled, name: name, autoFocus: autoFocus, onClick: onFocus, readOnly: true, role: "input" }) }), _jsxs(Modal, { visible: visible, onClose: onClose, destroyOnClose: true, className: `weda-ui weda-select-user-dept__dialog`, children: [_jsxs(Modal.Body, { className: ((_a = selectedOrgList[0]) === null || _a === void 0 ? void 0 : _a.id) ? 'is-selected-value' : '', children: [_jsxs("div", { className: "weda-select-user-dept__dialog-header", id: count.toString(), children: [_jsx("div", { className: count == 1 ? '' : 'arrow-left', onClick: () => retLevel(count) }), titleText] }), _jsx(ModalSearchH5, { value: searchValue, onChange: (key) => {
|
|
98
124
|
onSearch(key);
|
|
99
125
|
setSearchValue(key);
|
|
100
126
|
}, onCancel: cancleSearch, isSearch: isSearch, onFocus: () => {
|
|
@@ -35,13 +35,14 @@ export function useParentForm($widget) {
|
|
|
35
35
|
return data;
|
|
36
36
|
}
|
|
37
37
|
export function useFormInputTrait(inputParams) {
|
|
38
|
+
var _a;
|
|
38
39
|
const { value, $widget, inputRef, required, requiredMsg, rules = emptyArray, events, layout: currentLayout, setInnerHandle = noop, onChange: outerOnChange = noop, $node, } = inputParams;
|
|
39
40
|
if (isNil($widget)) {
|
|
40
41
|
throw new Error('$widget 没传入');
|
|
41
42
|
}
|
|
42
43
|
const eventsRef = useSyncedRef(events);
|
|
43
44
|
const [name] = useSyncValue(inputParams.name);
|
|
44
|
-
const [disabled, setDisabled] = useSyncValue(inputParams.disabled);
|
|
45
|
+
const [disabled, setDisabled] = useSyncValue((_a = inputParams.disabled) !== null && _a !== void 0 ? _a : false);
|
|
45
46
|
const [readOnly] = useSyncValue(inputParams.readOnly);
|
|
46
47
|
const [validateState, setValidateState] = useState(inputParams.validateStatus);
|
|
47
48
|
const [validateErrorMsg, setValidateErrorMsg] = useState('');
|
|
@@ -87,5 +87,5 @@ export function UploadCSVFile({ parseFile, fields, datasourceTitle, dbName, setD
|
|
|
87
87
|
setDisableNext(true);
|
|
88
88
|
}, children: "\u5220\u9664" })] }) }), children: isDragging ? ('释放鼠标') : (_jsx(Status, { className: "upload-file", icon: 'blank', size: 's', operation: _jsxs(_Fragment, { children: [_jsx("a", { onClick: open, children: "\u70B9\u51FB\u4E0A\u4F20" }), " /", ' ', _jsx(Text, { theme: "weak", children: "\u62D6\u62FD\u5230\u6B64\u533A\u57DF" })] }) })) })) }) }), _jsx("div", { className: "modal-upload-text-wrap", children: _jsxs("ul", { children: [_jsxs("li", { children: ["1\u3001\u8BF7\u4E0B\u8F7D\u4F7F\u7528", _jsx("span", { onClick: () => {
|
|
89
89
|
getCSVTemplate(fields, datasourceTitle);
|
|
90
|
-
}, children: "\u00A0 \u5BFC\u5165\u6A21\u7248" }), "\uFF0C\u5E76\u6309\u7167\u793A\u4F8B\u586B\u5199\u6570\u636E\uFF0C\u4EE5\u4FDD\u8BC1\u6570\u636E\u5BFC\u5165\u987A\u5229"] }), _jsx("li", { children: "2\u3001\u652F\u6301xlsx\u7C7B\u578B\u6587\u4EF6\uFF0C\u8981\u6C42\u6587\u4EF6\u5927\u5C0F2M\u4EE5\u5185\uFF0C\u4E0D\u80FD\u8D85\u8FC710000\u884C" }), _jsxs("li", { children: [_jsx("div", { children: "3\u3001\u5BFC\u5165\u66F4\u65B0\u8BF4\u660E" }), _jsx("div", { children: "\u00A01\uFF09\u652F\u6301\
|
|
90
|
+
}, children: "\u00A0 \u5BFC\u5165\u6A21\u7248" }), "\uFF0C\u5E76\u6309\u7167\u793A\u4F8B\u586B\u5199\u6570\u636E\uFF0C\u4EE5\u4FDD\u8BC1\u6570\u636E\u5BFC\u5165\u987A\u5229"] }), _jsx("li", { children: "2\u3001\u652F\u6301xlsx\u7C7B\u578B\u6587\u4EF6\uFF0C\u8981\u6C42\u6587\u4EF6\u5927\u5C0F2M\u4EE5\u5185\uFF0C\u4E0D\u80FD\u8D85\u8FC710000\u884C" }), _jsxs("li", { children: [_jsx("div", { children: "3\u3001\u5BFC\u5165\u66F4\u65B0\u8BF4\u660E" }), _jsx("div", { children: "\u00A01\uFF09\u652F\u6301\u9009\u62E9\u5F00\u542F\u552F\u4E00\u5C5E\u6027\u7684\u5B57\u6BB5\uFF0C\u7528\u4E8E\u5339\u914D\u5E76\u66F4\u65B0\u5DF2\u6709\u7684\u6570\u636E\u8BB0\u5F55" }), _jsx("div", { children: "\u00A02\uFF09\u5BFC\u5165\u6A21\u5F0F\u4E3A\u300C\u65B0\u589E\u6216\u66F4\u65B0\u300D\u65F6\uFF0C\u5982\u300C\u6570\u636E\u6807\u8BC6\u300D\u5217\u4E3A\u7A7A\uFF0C\u8BE5\u884C\u6570\u636E\u4F1A\u6267\u884C\u65B0\u589E\u64CD\u4F5C" })] }), _jsxs("li", { children: [_jsx("div", { children: "4\u3001\u6570\u636E\u683C\u5F0F\u8BF4\u660E" }), _jsx("div", { children: "\u00A0 1\uFF09\u679A\u4E3E\u7C7B\u578B\u6570\u636E\uFF1A\u652F\u6301\u9009\u62E9\u9009\u9879\u6807\u8BC6\u6216\u9009\u9879\u503C\u8FDB\u884C\u5BFC\u5165\uFF1A\u9009\u9879\u6807\u8BC6\u4E3A\u8868\u683C\u4E2D\u5C55\u793A\u7684\u4E1A\u52A1\u540D\u79F0\uFF1B\u9009\u9879\u503C\u4E3A\u9009\u9879\u7684\u7CFB\u7EDF\u552F\u4E00\u6807\u8BC6" }), _jsx("div", { children: "\u00A02\uFF09\u5173\u8054\u5173\u7CFB\u3001\u4E3B\u5B50\u660E\u7EC6\u7C7B\u578B\u6570\u636E\uFF1A\u652F\u6301\u9009\u62E9\u4E3B\u5217\u5B57\u6BB5\u6216\u6570\u636E\u6807\u8BC6\u8FDB\u884C\u5BFC\u5165\uFF1A\u4E3B\u5217\u5B57\u6BB5\u4E3A\u8868\u683C\u4E2D\u5C55\u793A\u7684\u5173\u8054\u6570\u636E\u4E1A\u52A1\u540D\u79F0\uFF1B\u6570\u636E\u6807\u8BC6\u4E3A\u5173\u8054\u6570\u636E\u7684\u7CFB\u7EDF\u552F\u4E00\u6807\u8BC6" }), _jsx("div", { children: "\u00A03\uFF09\u5E03\u5C14\u7C7B\u578B\u6570\u636E\uFF1A\u652F\u6301\u5BFC\u5165\u300C\u662F/\u5426\u300D\u6216\u300Ctrue/false\u300D" }), _jsx("div", { children: "\u00A04\uFF09\u56FE\u7247\u7C7B\u578B\u6570\u636E\uFF1A\u652F\u6301\u5BFC\u5165https\u6216cloud\u534F\u8BAE\u7684\u56FE\u7247\u5730\u5740" }), _jsx("div", { children: "\u00A05\uFF09\u6587\u4EF6\u7C7B\u578B\u6570\u636E\uFF1A\u652F\u6301cloud\u534F\u8BAE\u7684\u6587\u4EF6\u5730\u5740" }), _jsx("div", { children: "\u00A06\uFF09\u5730\u7406\u4F4D\u7F6E\u7C7B\u578B\u6570\u636E\uFF1A\u6570\u636E\u683C\u5F0F\u8981\u6C42\u4E3A\u5730\u70B9\u540D\u79F0(\u5750\u6807\u7ECF\u5EA6\uFF0C\u5750\u6807\u7EF4\u5EA6)" })] })] }) })] }));
|
|
91
91
|
}
|
|
@@ -143,7 +143,8 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
|
|
|
143
143
|
}
|
|
144
144
|
else {
|
|
145
145
|
formItemMap.forEach((item) => {
|
|
146
|
-
|
|
146
|
+
var _a;
|
|
147
|
+
item.setReadOnly((_a = item.initialDisabled) !== null && _a !== void 0 ? _a : false);
|
|
147
148
|
});
|
|
148
149
|
}
|
|
149
150
|
});
|
|
@@ -176,7 +177,7 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
|
|
|
176
177
|
setValue(fetchedInitialValues, true);
|
|
177
178
|
}
|
|
178
179
|
}, [fetchedInitialValues, initValueFetchError, isLoadingInitValues, setValue]);
|
|
179
|
-
const { data: dataSourceProfile } = useDataSource();
|
|
180
|
+
const { data: dataSourceProfile } = useDataSource(dataSourceName);
|
|
180
181
|
const authValue = useAuthValue({
|
|
181
182
|
appCloud,
|
|
182
183
|
isDataModel,
|
|
@@ -47,10 +47,7 @@ export function getFieldRender(field = {}, extra = {}) {
|
|
|
47
47
|
}
|
|
48
48
|
// render 方法
|
|
49
49
|
const FieldRender = (val) => {
|
|
50
|
-
|
|
51
|
-
if (isValueEmpty(val) ||
|
|
52
|
-
(type === 'array' && !(val === null || val === void 0 ? void 0 : val.length)) ||
|
|
53
|
-
(type === 'array' && (val === null || val === void 0 ? void 0 : val.length) && !((_a = Object.keys(val[0])) === null || _a === void 0 ? void 0 : _a.length))) {
|
|
50
|
+
if (isValueEmpty(val) || (type === 'array' && !(val === null || val === void 0 ? void 0 : val.length))) {
|
|
54
51
|
return '-';
|
|
55
52
|
}
|
|
56
53
|
// fieldValue 值转换,如布尔/时间/枚举等
|
|
@@ -576,6 +573,19 @@ export const getFieldValue = (name, _record) => {
|
|
|
576
573
|
return record[name];
|
|
577
574
|
};
|
|
578
575
|
export const slotRender = (slot, props = {}) => typeof slot === 'function' ? slot(props) : slot;
|
|
576
|
+
const TableSlotCell = ({ record, rowKey, recordIndex, column, columnIndex, slot, }) => {
|
|
577
|
+
const component = React.useMemo(() => {
|
|
578
|
+
// 计算单元格的值
|
|
579
|
+
return slotRender(slot, {
|
|
580
|
+
record,
|
|
581
|
+
rowKey,
|
|
582
|
+
recordIndex,
|
|
583
|
+
column,
|
|
584
|
+
columnIndex,
|
|
585
|
+
});
|
|
586
|
+
}, [record, rowKey, recordIndex, column, columnIndex]);
|
|
587
|
+
return _jsx(_Fragment, { children: component });
|
|
588
|
+
};
|
|
579
589
|
/**
|
|
580
590
|
* 根据列管理,过滤表格列信息
|
|
581
591
|
* columns: { key, header, width, align, render,fixed }[] Tea Table 的列
|
|
@@ -610,20 +620,7 @@ export const filterCustomColumns = ({ columns, columnSets, slots }) => {
|
|
|
610
620
|
if (genre === 'slot') {
|
|
611
621
|
// 拿到列对应的插槽
|
|
612
622
|
const slot = slots[`${TABLE_SLOT_PREFIX}${(item2 === null || item2 === void 0 ? void 0 : item2.slotKey) || key}`];
|
|
613
|
-
|
|
614
|
-
const component = React.useMemo(() => {
|
|
615
|
-
// 计算单元格的值
|
|
616
|
-
return slotRender(slot, {
|
|
617
|
-
record,
|
|
618
|
-
rowKey,
|
|
619
|
-
recordIndex,
|
|
620
|
-
column,
|
|
621
|
-
columnIndex,
|
|
622
|
-
});
|
|
623
|
-
}, [record, rowKey, recordIndex, column, columnIndex]);
|
|
624
|
-
return _jsx(_Fragment, { children: component });
|
|
625
|
-
};
|
|
626
|
-
customColumn.render = (record, rowKey, recordIndex, column, columnIndex) => (_jsx(TableSlotCell, { record: record, rowKey: rowKey, recordIndex: recordIndex, column: column, columnIndex: columnIndex }));
|
|
623
|
+
customColumn.render = (record, rowKey, recordIndex, column, columnIndex) => (_jsx(TableSlotCell, { record: record, rowKey: rowKey, recordIndex: recordIndex, column: column, columnIndex: columnIndex, slot: slot }));
|
|
627
624
|
}
|
|
628
625
|
return customColumn;
|
|
629
626
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/* eslint-disable max-lines */
|
|
3
|
-
import { useRef, useEffect, useState, useMemo,
|
|
3
|
+
import { useRef, useEffect, useState, useMemo, useImperativeHandle, forwardRef, } from 'react';
|
|
4
4
|
import { ConfigProvider } from 'tea-component';
|
|
5
5
|
import { Table, ExportFileModal, ImportFileModal, InOrOutRecordModal, deleteRecord, importHandleByApi, exportHandleByApi, exportHandle, FilterFieldsPanel, ToolBar, } from './components';
|
|
6
6
|
import classNames from '../../utils/classnames';
|
|
@@ -24,6 +24,22 @@ import Modal from '../modal';
|
|
|
24
24
|
import { WdButton } from '../wd-button';
|
|
25
25
|
const _defaultPageIndex = 1;
|
|
26
26
|
const _defaultPageSize = 10;
|
|
27
|
+
const TableOption = ({ record, rowKey, recordIndex, column, columnIndex, slots, classPrefix, }) => {
|
|
28
|
+
const component = useMemo(() => {
|
|
29
|
+
// 计算单元格的值
|
|
30
|
+
return slotRender(slots[CELL_CUSTOM_OPTION], {
|
|
31
|
+
record,
|
|
32
|
+
rowKey,
|
|
33
|
+
recordIndex,
|
|
34
|
+
column,
|
|
35
|
+
columnIndex,
|
|
36
|
+
});
|
|
37
|
+
}, [column, columnIndex, record, recordIndex, rowKey, slots]);
|
|
38
|
+
return (_jsx("div", { className: `${classPrefix}-pc-table-option-btn-wrap`, children: component }));
|
|
39
|
+
};
|
|
40
|
+
const GlobalButton = function GlobalButtonDom({ classPrefix, slots, }) {
|
|
41
|
+
return _jsx("div", { className: `${classPrefix}-global-btn`, children: slotRender(slots) });
|
|
42
|
+
};
|
|
27
43
|
// eslint-disable-next-line complexity
|
|
28
44
|
export const WdTable = forwardRef(function TableComp({ className, style, dataSourceType, bindConnectMetadata = {
|
|
29
45
|
datasource: { id: '', name: '', title: '' },
|
|
@@ -202,19 +218,6 @@ enableRefreshBtn = true, enableTableHeightSizeBtn = true, emptyText, ...props },
|
|
|
202
218
|
});
|
|
203
219
|
// 操作列
|
|
204
220
|
if (enableCellCustomOption && !isH5) {
|
|
205
|
-
const TableOption = ({ record, rowKey, recordIndex, column, columnIndex, }) => {
|
|
206
|
-
const component = useMemo(() => {
|
|
207
|
-
// 计算单元格的值
|
|
208
|
-
return slotRender(slots[CELL_CUSTOM_OPTION], {
|
|
209
|
-
record,
|
|
210
|
-
rowKey,
|
|
211
|
-
recordIndex,
|
|
212
|
-
column,
|
|
213
|
-
columnIndex,
|
|
214
|
-
});
|
|
215
|
-
}, [column, columnIndex, record, recordIndex, rowKey]);
|
|
216
|
-
return (_jsx("div", { className: `${classPrefix}-pc-table-option-btn-wrap`, children: component }));
|
|
217
|
-
};
|
|
218
221
|
// 展示插槽操作列
|
|
219
222
|
baseColumns.push({
|
|
220
223
|
key: 'button',
|
|
@@ -222,7 +225,7 @@ enableRefreshBtn = true, enableTableHeightSizeBtn = true, emptyText, ...props },
|
|
|
222
225
|
width: 150,
|
|
223
226
|
align: 'left',
|
|
224
227
|
fixed: 'right',
|
|
225
|
-
render: (record, rowKey, recordIndex, column, columnIndex) => (_jsx(TableOption, { record: record, rowKey: rowKey, recordIndex: recordIndex, column: column, columnIndex: columnIndex })),
|
|
228
|
+
render: (record, rowKey, recordIndex, column, columnIndex) => (_jsx(TableOption, { slots: slots, classPrefix: classPrefix, record: record, rowKey: rowKey, recordIndex: recordIndex, column: column, columnIndex: columnIndex })),
|
|
226
229
|
});
|
|
227
230
|
}
|
|
228
231
|
// 选择列
|
|
@@ -401,9 +404,6 @@ enableRefreshBtn = true, enableTableHeightSizeBtn = true, emptyText, ...props },
|
|
|
401
404
|
// 仅当切换小屏的时候重新请求
|
|
402
405
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
403
406
|
}, [isH5]);
|
|
404
|
-
const GlobalButton = memo(function GlobalButtonDom({ classPrefix, slots, }) {
|
|
405
|
-
return (_jsx("div", { className: `${classPrefix}-global-btn`, children: slotRender(slots) }));
|
|
406
|
-
});
|
|
407
407
|
const hasFilterButton = !!filterFieldsData.length;
|
|
408
408
|
const recordKey = isInIde() ? undefined : '_id';
|
|
409
409
|
return (_jsx(ConfigProvider, { classPrefix: classPrefix, children: _jsx(EnumHoc, { fields: authFields, children: _jsxs("div", { className: classNames(wrapClassList, className), style: style, id: id, children: [_jsx(FilterFieldsPanel, { openMobileFilter: openMobileFilter, setOpenMobileFilter: setOpenMobileFilter, filterFields: filterFieldsData, fetchData: (searchValues = []) => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { isInIde, alertErrorMessage, isSystemField } from './platform';
|
|
2
|
-
import { deepClone } from './tool';
|
|
3
2
|
/* **** 数据源相关方法 **** */
|
|
4
3
|
const callWedaApi = (...args) => { var _a, _b; return (_b = (_a = window === null || window === void 0 ? void 0 : window.app) === null || _a === void 0 ? void 0 : _a.cloud) === null || _b === void 0 ? void 0 : _b.callWedaApi(...args); };
|
|
5
4
|
export class DataSource {
|
|
@@ -350,22 +349,29 @@ export const resolveFieldsFromDatasource = async ({ dbName, enabledFieldNames, d
|
|
|
350
349
|
* 获取主列字段标识并展示主列字段
|
|
351
350
|
*/
|
|
352
351
|
export const getPrimaryField = (_data) => {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
if (
|
|
363
|
-
//
|
|
364
|
-
record[
|
|
365
|
-
|
|
366
|
-
|
|
352
|
+
let data = {};
|
|
353
|
+
try {
|
|
354
|
+
data = JSON.parse(JSON.stringify(_data));
|
|
355
|
+
const keys = Object.keys(data).filter((item) => item.includes('@'));
|
|
356
|
+
keys.forEach((item) => {
|
|
357
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
358
|
+
const field = item.replace('@', '');
|
|
359
|
+
const record = (_b = (_a = data[item]) === null || _a === void 0 ? void 0 : _a.v1) === null || _b === void 0 ? void 0 : _b.record;
|
|
360
|
+
const name = (_d = (_c = data[item]) === null || _c === void 0 ? void 0 : _c.v1) === null || _d === void 0 ? void 0 : _d.primaryColumn;
|
|
361
|
+
if (name) {
|
|
362
|
+
// 系统主列字段当record不存在时,默认展示最外层owner、createBy、updateBy字段,与其他列字段逻辑一致
|
|
363
|
+
if (record && record._id === data[field]) {
|
|
364
|
+
// 当record下主列字段没有值时,默认返回主列id
|
|
365
|
+
record[name]
|
|
366
|
+
? (data[field] = record[name])
|
|
367
|
+
: (data[field] = ((_g = (_f = (_e = data[item]) === null || _e === void 0 ? void 0 : _e.v1) === null || _f === void 0 ? void 0 : _f.record) === null || _g === void 0 ? void 0 : _g._id) || '-');
|
|
368
|
+
}
|
|
367
369
|
}
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
catch (error) {
|
|
373
|
+
console.error('主列字段数据转换出错', error);
|
|
374
|
+
return _data;
|
|
375
|
+
}
|
|
370
376
|
return data;
|
|
371
377
|
};
|
package/package.json
CHANGED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './index.css';
|
|
3
|
-
const BLOCK_NAME = 'weda-list-view';
|
|
4
|
-
export default function EmptyContent(props) {
|
|
5
|
-
const { emptyText, component, isH5 } = props;
|
|
6
|
-
return (React.createElement("div", { className: `${BLOCK_NAME}__empty` },
|
|
7
|
-
React.createElement("div", { className: `${BLOCK_NAME}__empty__content test
|
|
8
|
-
${component === 'table' && 'table'}
|
|
9
|
-
${isH5 && 'isH5'}` },
|
|
10
|
-
React.createElement("svg", { width: "120", height: "80", viewBox: "0 0 120 80", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
11
|
-
React.createElement("rect", { x: "14", y: "8", width: "80", height: "50", fill: "url(#paint0_linear_810_13830)" }),
|
|
12
|
-
React.createElement("path", { d: "M28 22H20", stroke: "black", strokeOpacity: "0.9" }),
|
|
13
|
-
React.createElement("path", { d: "M44 27H20", stroke: "black", strokeOpacity: "0.9" }),
|
|
14
|
-
React.createElement("path", { d: "M44 32H20", stroke: "black", strokeOpacity: "0.9" }),
|
|
15
|
-
React.createElement("g", { filter: "url(#filter0_b_810_13830)" },
|
|
16
|
-
React.createElement("path", { d: "M14 8H94V14H14V8Z", fill: "black", fillOpacity: "0.9" })),
|
|
17
|
-
React.createElement("path", { d: "M19 11H18", stroke: "white" }),
|
|
18
|
-
React.createElement("path", { d: "M23 11H22", stroke: "white" }),
|
|
19
|
-
React.createElement("path", { d: "M27 11H26", stroke: "white" }),
|
|
20
|
-
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M78 18H62V34H78V18ZM97 18H81V34H97V18Z", fill: "url(#paint1_linear_810_13830)" }),
|
|
21
|
-
React.createElement("g", { filter: "url(#filter1_b_810_13830)" },
|
|
22
|
-
React.createElement("path", { d: "M50 72H105V32H50V72Z", fill: "url(#paint2_linear_810_13830)", fillOpacity: "0.9" })),
|
|
23
|
-
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M79.5244 57.9636C79.5244 58.483 79.2697 58.9325 78.9038 59.2929C78.5397 59.6516 78.0384 59.9517 77.4594 60.1929C76.2991 60.6764 74.7308 60.9636 73.0244 60.9636C71.318 60.9636 69.7498 60.6764 68.5895 60.1929C68.0104 59.9517 67.5092 59.6516 67.145 59.2929C66.7791 58.9325 66.5244 58.483 66.5244 57.9636V50.9636C66.5244 50.4443 66.7791 49.9948 67.145 49.6343C67.5092 49.2756 68.0104 48.9756 68.5895 48.7343C69.7498 48.2509 71.318 47.9636 73.0244 47.9636C74.7308 47.9636 76.2991 48.2509 77.4594 48.7343C78.0384 48.9756 78.5397 49.2756 78.9038 49.6343C79.2697 49.9948 79.5244 50.4443 79.5244 50.9636V57.9636ZM67.8468 50.3467C67.6055 50.5845 67.5244 50.7926 67.5244 50.9636C67.5244 51.1346 67.6055 51.3428 67.8468 51.5805C68.0899 51.82 68.4674 52.0587 68.9741 52.2699C69.9854 52.6912 71.4171 52.9636 73.0244 52.9636C74.6318 52.9636 76.0635 52.6912 77.0747 52.2699C77.5815 52.0587 77.9589 51.82 78.202 51.5805C78.4434 51.3428 78.5244 51.1346 78.5244 50.9636C78.5244 50.7926 78.4434 50.5845 78.202 50.3467C77.9589 50.1072 77.5815 49.8685 77.0747 49.6574C76.0635 49.236 74.6318 48.9636 73.0244 48.9636C71.4171 48.9636 69.9854 49.236 68.9741 49.6574C68.4674 49.8685 68.0899 50.1072 67.8468 50.3467ZM78.5244 52.6118V54.4636C78.5244 54.6346 78.4434 54.8428 78.202 55.0805C77.9589 55.32 77.5815 55.5587 77.0747 55.7699C76.0635 56.1912 74.6318 56.4636 73.0244 56.4636C71.4171 56.4636 69.9854 56.1912 68.9741 55.7699C68.4674 55.5587 68.0899 55.32 67.8468 55.0805C67.6055 54.8428 67.5244 54.6346 67.5244 54.4636V52.6118C67.8298 52.8333 68.1912 53.027 68.5895 53.1929C69.7498 53.6764 71.318 53.9636 73.0244 53.9636C74.7308 53.9636 76.2991 53.6764 77.4594 53.1929C77.8576 53.027 78.2191 52.8333 78.5244 52.6118ZM78.5244 57.9636V56.1118C78.2191 56.3333 77.8576 56.527 77.4594 56.6929C76.2991 57.1764 74.7308 57.4636 73.0244 57.4636C71.318 57.4636 69.7498 57.1764 68.5895 56.6929C68.1912 56.527 67.8298 56.3333 67.5244 56.1118V57.9636C67.5244 58.1346 67.6055 58.3428 67.8468 58.5805C68.0899 58.82 68.4674 59.0587 68.9741 59.2699C69.9854 59.6912 71.4171 59.9636 73.0244 59.9636C74.6318 59.9636 76.0635 59.6912 77.0747 59.2699C77.5815 59.0587 77.9589 58.82 78.202 58.5805C78.4434 58.3428 78.5244 58.1346 78.5244 57.9636Z", fill: "white" }),
|
|
24
|
-
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M86.9038 53.2932C87.2697 52.9327 87.5244 52.4832 87.5244 51.9639V44.9639C87.5244 44.4445 87.2697 43.995 86.9038 43.6346C86.5397 43.2759 86.0384 42.9758 85.4594 42.7346C84.2991 42.2511 82.7308 41.9639 81.0244 41.9639C79.318 41.9639 77.7498 42.2511 76.5895 42.7346C76.0104 42.9758 75.5092 43.2759 75.145 43.6346C74.7791 43.995 74.5244 44.4445 74.5244 44.9639V48.0786C74.8689 48.1148 75.2032 48.1631 75.5244 48.2225V46.612C75.8298 46.8335 76.1912 47.0272 76.5895 47.1932C77.7498 47.6766 79.318 47.9639 81.0244 47.9639C82.7308 47.9639 84.2991 47.6766 85.4594 47.1932C85.8576 47.0272 86.2191 46.8335 86.5244 46.612V48.4639C86.5244 48.6349 86.4434 48.843 86.202 49.0808C85.9589 49.3203 85.5815 49.559 85.0747 49.7701C84.0635 50.1915 82.6318 50.4639 81.0244 50.4639C80.4454 50.4639 79.8891 50.4285 79.3671 50.3636C79.4517 50.5615 79.4999 50.7741 79.4999 51V51.3853C79.9898 51.4368 80.5006 51.4639 81.0244 51.4639C82.7308 51.4639 84.2991 51.1766 85.4594 50.6932C85.8576 50.5272 86.2191 50.3335 86.5244 50.112V51.9639C86.5244 52.1349 86.4434 52.343 86.202 52.5808C85.9589 52.8203 85.5815 53.059 85.0747 53.2701C84.0635 53.6915 82.6318 53.9639 81.0244 53.9639C80.4942 53.9639 79.9831 53.9342 79.4999 53.8794V54.8853C79.9898 54.9368 80.5006 54.9639 81.0244 54.9639C82.7308 54.9639 84.2991 54.6766 85.4594 54.1932C86.0384 53.9519 86.5397 53.6519 86.9038 53.2932ZM75.5244 44.9639C75.5244 44.7929 75.6055 44.5847 75.8468 44.3469C76.0899 44.1075 76.4674 43.8688 76.9741 43.6576C77.9854 43.2363 79.4171 42.9639 81.0244 42.9639C82.6318 42.9639 84.0635 43.2363 85.0747 43.6576C85.5815 43.8688 85.9589 44.1075 86.202 44.3469C86.4434 44.5847 86.5244 44.7929 86.5244 44.9639C86.5244 45.1349 86.4434 45.343 86.202 45.5808C85.9589 45.8203 85.5815 46.059 85.0747 46.2701C84.0635 46.6915 82.6318 46.9639 81.0244 46.9639C79.4171 46.9639 77.9854 46.6915 76.9741 46.2701C76.4674 46.059 76.0899 45.8203 75.8468 45.5808C75.6055 45.343 75.5244 45.1349 75.5244 44.9639Z", fill: "white" }),
|
|
25
|
-
React.createElement("defs", null,
|
|
26
|
-
React.createElement("filter", { id: "filter0_b_810_13830", x: "10", y: "4", width: "88", height: "14", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" },
|
|
27
|
-
React.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
28
|
-
React.createElement("feGaussianBlur", { in: "BackgroundImageFix", stdDeviation: "2" }),
|
|
29
|
-
React.createElement("feComposite", { in2: "SourceAlpha", operator: "in", result: "effect1_backgroundBlur_810_13830" }),
|
|
30
|
-
React.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_backgroundBlur_810_13830", result: "shape" })),
|
|
31
|
-
React.createElement("filter", { id: "filter1_b_810_13830", x: "44.6667", y: "26.6667", width: "65.6667", height: "50.6667", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" },
|
|
32
|
-
React.createElement("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
33
|
-
React.createElement("feGaussianBlur", { in: "BackgroundImageFix", stdDeviation: "2.66667" }),
|
|
34
|
-
React.createElement("feComposite", { in2: "SourceAlpha", operator: "in", result: "effect1_backgroundBlur_810_13830" }),
|
|
35
|
-
React.createElement("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_backgroundBlur_810_13830", result: "shape" })),
|
|
36
|
-
React.createElement("linearGradient", { id: "paint0_linear_810_13830", x1: "54", y1: "8", x2: "54", y2: "58", gradientUnits: "userSpaceOnUse" },
|
|
37
|
-
React.createElement("stop", { stopColor: "#E7E7E7" }),
|
|
38
|
-
React.createElement("stop", { offset: "1", stopColor: "#DCDCDC" })),
|
|
39
|
-
React.createElement("linearGradient", { id: "paint1_linear_810_13830", x1: "84.6042", y1: "18", x2: "84.6042", y2: "34", gradientUnits: "userSpaceOnUse" },
|
|
40
|
-
React.createElement("stop", { stopColor: "white" }),
|
|
41
|
-
React.createElement("stop", { offset: "1", stopColor: "white", stopOpacity: "0.2" })),
|
|
42
|
-
React.createElement("linearGradient", { id: "paint2_linear_810_13830", x1: "74.8387", y1: "66.7826", x2: "74.8387", y2: "33.6563", gradientUnits: "userSpaceOnUse" },
|
|
43
|
-
React.createElement("stop", { stopColor: "#939393", stopOpacity: "0.7" }),
|
|
44
|
-
React.createElement("stop", { offset: "1", stopColor: "#939393" })))),
|
|
45
|
-
emptyText)));
|
|
46
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { getModuleContentStyle } from './utils';
|
|
3
|
-
export function Content(props) {
|
|
4
|
-
const { className, children } = props;
|
|
5
|
-
return (React.createElement("span", { className: className, style: getModuleContentStyle(props) }, children));
|
|
6
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { getLineHeight } from './utils';
|
|
3
|
-
import './index.css';
|
|
4
|
-
export function Title(props) {
|
|
5
|
-
const { className, moduleTitle, moduleTitleColor, moduleTitleFontSize, moduleTitleFontWeight, moduleTitleLineHeight, moduleTitleVisible, } = props;
|
|
6
|
-
if (moduleTitleVisible) {
|
|
7
|
-
const style = {
|
|
8
|
-
color: moduleTitleColor,
|
|
9
|
-
fontSize: moduleTitleFontSize,
|
|
10
|
-
fontWeight: moduleTitleFontWeight,
|
|
11
|
-
lineHeight: getLineHeight(moduleTitleLineHeight),
|
|
12
|
-
};
|
|
13
|
-
return (React.createElement("div", { className: `model-flow-module-title ${className}`, style: style }, moduleTitle));
|
|
14
|
-
}
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export function getModuleTextProps(props) {
|
|
2
|
-
const moduleProps = {};
|
|
3
|
-
Object.entries(props).forEach(([key, value]) => {
|
|
4
|
-
if (key.startsWith('module')) {
|
|
5
|
-
moduleProps[key] = value;
|
|
6
|
-
}
|
|
7
|
-
});
|
|
8
|
-
return moduleProps;
|
|
9
|
-
}
|
|
10
|
-
export function getLineHeight(lineHeight) {
|
|
11
|
-
const realLineHeight = +lineHeight;
|
|
12
|
-
if (typeof realLineHeight === 'number') {
|
|
13
|
-
return `${realLineHeight}rem`;
|
|
14
|
-
}
|
|
15
|
-
return lineHeight;
|
|
16
|
-
}
|
|
17
|
-
export function getModuleContentStyle(props) {
|
|
18
|
-
const style = {
|
|
19
|
-
color: props.moduleContentColor,
|
|
20
|
-
fontSize: props.moduleContentFontSize,
|
|
21
|
-
fontWeight: props.moduleContentFontWeight,
|
|
22
|
-
lineHeight: getLineHeight(props.moduleContentLineHeight),
|
|
23
|
-
};
|
|
24
|
-
return style;
|
|
25
|
-
}
|
|
26
|
-
export function getModuleTitleStyle(props) {
|
|
27
|
-
const style = {
|
|
28
|
-
color: props.moduleTitleColor,
|
|
29
|
-
fontSize: props.moduleTitleFontSize,
|
|
30
|
-
fontWeight: props.moduleTitleFontWeight,
|
|
31
|
-
lineHeight: getLineHeight(props.moduleTitleLineHeight),
|
|
32
|
-
};
|
|
33
|
-
return style;
|
|
34
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Text } from 'tea-component';
|
|
3
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4
|
-
const omit = (prop, { [prop]: _, ...rest }) => rest;
|
|
5
|
-
export const FlowStatusText = (props) => {
|
|
6
|
-
const { isCompleted, status, userTaskType } = props.flow || {};
|
|
7
|
-
const getTagProps = () => {
|
|
8
|
-
const props = {
|
|
9
|
-
theme: 'warning',
|
|
10
|
-
text: '审批中',
|
|
11
|
-
};
|
|
12
|
-
if (userTaskType === 2) {
|
|
13
|
-
props.text = '处理中';
|
|
14
|
-
}
|
|
15
|
-
if (isCompleted) {
|
|
16
|
-
if (status === 1) {
|
|
17
|
-
props.theme = 'danger';
|
|
18
|
-
props.text = '已终止';
|
|
19
|
-
}
|
|
20
|
-
else if (status === 2) {
|
|
21
|
-
props.theme = 'danger';
|
|
22
|
-
props.text = '已驳回';
|
|
23
|
-
}
|
|
24
|
-
else if (status === 4) {
|
|
25
|
-
props.theme = 'danger';
|
|
26
|
-
props.text = '已作废';
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
props.theme = 'success';
|
|
30
|
-
props.text = userTaskType === 2 ? '已处理' : '审批通过';
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return props;
|
|
34
|
-
};
|
|
35
|
-
const { text, ...rest } = getTagProps();
|
|
36
|
-
return (React.createElement(Text, { ...rest, style: omit('color', props.style) }, text));
|
|
37
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { safeJsonParse } from '../../../../utils/tool';
|
|
3
|
-
export const HighLightComment = ({ details }) => {
|
|
4
|
-
const text = (details === null || details === void 0 ? void 0 : details.operationComment) || '';
|
|
5
|
-
let dom = '';
|
|
6
|
-
const positionMap = (details === null || details === void 0 ? void 0 : details.highlightPositionList) || '{}';
|
|
7
|
-
const obj = safeJsonParse(positionMap);
|
|
8
|
-
let startIndex = 0;
|
|
9
|
-
const arr = Object.entries(obj);
|
|
10
|
-
if (arr.length === 0) {
|
|
11
|
-
return text;
|
|
12
|
-
}
|
|
13
|
-
for (const [start, end] of arr) {
|
|
14
|
-
const name = text.substring(Number(start) + 1, end);
|
|
15
|
-
const domTemp = (React.createElement(React.Fragment, null,
|
|
16
|
-
text.substring(startIndex, Number(start)),
|
|
17
|
-
React.createElement("span", { style: { color: '#2473F2' } },
|
|
18
|
-
"@",
|
|
19
|
-
name)));
|
|
20
|
-
dom = (React.createElement(React.Fragment, null,
|
|
21
|
-
dom,
|
|
22
|
-
domTemp));
|
|
23
|
-
startIndex = end;
|
|
24
|
-
}
|
|
25
|
-
if (startIndex < text.length) {
|
|
26
|
-
dom = (React.createElement(React.Fragment, null,
|
|
27
|
-
dom,
|
|
28
|
-
text.substring(startIndex, text.length)));
|
|
29
|
-
}
|
|
30
|
-
return React.createElement("span", null, dom);
|
|
31
|
-
};
|