@cloudbase/weda-ui 3.4.11-alpha.1 → 3.4.12
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/common/form-input-required.js +3 -3
- package/dist/configs/components/dataView.js +20 -10
- package/dist/configs/components/form-checkbox.js +15 -2
- package/dist/configs/components/form-email.js +17 -2
- package/dist/configs/components/form-input.js +17 -2
- package/dist/configs/components/form-phone.js +17 -2
- package/dist/configs/components/form-radio.js +15 -2
- package/dist/configs/components/form-select-multiple.js +362 -0
- package/dist/configs/components/form-switch.js +15 -2
- package/dist/configs/components/form-text-area.js +15 -2
- package/dist/configs/components/form-url.js +17 -2
- package/dist/configs/components/listView.js +32 -49
- package/dist/configs/components/table.json +1 -54
- package/dist/configs/components/wd-bubble.js +46 -8
- package/dist/configs/components/wd-checkbox.js +464 -0
- package/dist/configs/components/wd-form.js +66 -10
- package/dist/configs/components/wd-input-email.js +37 -0
- package/dist/configs/components/wd-input-phone.js +43 -0
- package/dist/configs/components/wd-input-url.js +37 -0
- package/dist/configs/components/wd-input.js +94 -0
- package/dist/configs/components/wd-official-account.js +87 -0
- package/dist/configs/components/wd-radio.js +443 -0
- package/dist/configs/components/wd-switch.js +315 -0
- package/dist/configs/components/wd-table.js +1 -54
- package/dist/configs/components/wd-textarea.js +82 -0
- package/dist/configs/components/wd-tree.js +443 -0
- package/dist/configs/index.js +24 -1
- package/dist/configs/type-utils/type-form.js +681 -0
- package/dist/docs/common/components/methods-view.js +1 -1
- package/dist/docs/common/components/properties-view.js +3 -1
- package/dist/docs/common/format.js +7 -7
- package/dist/docs/common/tableView.js +3 -1
- package/dist/enum/index.js +196 -0
- package/dist/style/index.scss +1 -1
- package/dist/web/components/calendar/index.js +1 -1
- package/dist/web/components/customer-service/customer-service.js +19 -2
- package/dist/web/components/dataView/index.js +16 -3
- package/dist/web/components/flow/common/hooks/useCommonFlowData/flow-get.js +5 -1
- package/dist/web/components/flow/common/request.js +5 -5
- package/dist/web/components/flow/modules/operations/controls-items/flow-task-info-modal.js +8 -16
- 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/formcell/index.css +13 -1
- package/dist/web/components/form/formcell/index.js +1 -1
- package/dist/web/components/form/location/components/LocationH5/location.h5.js +1 -1
- 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/h5.js +8 -7
- package/dist/web/components/form/select/index.js +9 -9
- package/dist/web/components/form/select/region/index.js +1 -1
- package/dist/web/components/form/selectMultiple/dropdown-select/h5.js +111 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/index.css +270 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/index.js +206 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/pc.js +115 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/ui.js +113 -0
- package/dist/web/components/form/selectMultiple/h5.js +40 -0
- package/dist/web/components/form/selectMultiple/index.js +94 -0
- package/dist/web/components/form/selectMultiple/request.js +76 -0
- package/dist/web/components/form/selectMultiple/status/allEmpty.js +5 -0
- package/dist/web/components/form/selectMultiple/status/empty.js +19 -0
- package/dist/web/components/form/selectMultiple/status/index.css +63 -0
- package/dist/web/components/form/selectMultiple/status/index.js +7 -0
- package/dist/web/components/form/selectMultiple/status/loading.js +19 -0
- package/dist/web/components/form/selectMultiple/status/propsType.js +1 -0
- package/dist/web/components/form/selectMultiple/status/retry.js +19 -0
- package/dist/web/components/form/tips/index.css +9 -3
- package/dist/web/components/form/uploader/index.css +10 -0
- package/dist/web/components/form/uploader/uploader.h5.js +6 -6
- package/dist/web/components/form/uploader/uploader.pc.js +1 -1
- package/dist/web/components/form/uploaderFile/index.js +2 -0
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +0 -19
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +3 -24
- package/dist/web/components/form/userOrgSelect/common/fetch-data-service.js +7 -4
- package/dist/web/components/form/userOrgSelect/common/utils.js +1 -0
- package/dist/web/components/form/userOrgSelect/component/user-select-h5/index.js +15 -5
- package/dist/web/components/form-input-hooks/index.js +39 -14
- package/dist/web/components/form-select-multiple/index.js +26 -0
- package/dist/web/components/formdetail/index.css +31 -1
- package/dist/web/components/formdetail/index.js +30 -0
- package/dist/web/components/index.js +17 -1
- package/dist/web/components/listView/index.js +20 -5
- package/dist/web/components/phone/index.js +26 -1
- package/dist/web/components/phoneCode/index.js +3 -1
- package/dist/web/components/repeater/index.js +1 -0
- package/dist/web/components/repeater-item/index.js +1 -0
- package/dist/web/components/richText/index.css +70 -67
- package/dist/web/components/richText/index.js +311 -251
- package/dist/web/components/richText/richtext.module.css +1 -0
- package/dist/web/components/richTextView/index.css +39 -0
- package/dist/web/components/richTextView/index.js +1 -1
- package/dist/web/components/share/index.js +26 -1
- package/dist/web/components/statusContent/index.js +1 -0
- package/dist/web/components/wd-checkbox/checkbox.js +34 -0
- package/dist/web/components/wd-checkbox/index.js +3 -0
- package/dist/web/components/wd-checkbox-list/checkboxList.js +140 -0
- package/dist/web/components/wd-checkbox-list/index.js +3 -0
- package/dist/web/components/wd-form/index.js +25 -12
- package/dist/web/components/wd-form/wd-form.js +42 -0
- package/dist/web/components/wd-form-cell/index.js +3 -0
- package/dist/web/components/wd-form-cell/wd-form-cell.js +42 -0
- package/dist/web/components/wd-form-item/index.js +4 -0
- package/dist/web/components/wd-form-item/wd-form-item.js +55 -0
- package/dist/web/components/wd-form-item/wd-input-group.js +24 -0
- package/dist/web/components/wd-input/index.js +3 -0
- package/dist/web/components/wd-input/wd-input.js +155 -0
- package/dist/web/components/wd-input-email/index.js +3 -0
- package/dist/web/components/wd-input-email/wd-input-email.js +13 -0
- package/dist/web/components/wd-input-group/index.js +3 -0
- package/dist/web/components/wd-input-group/wd-input-group.js +10 -0
- package/dist/web/components/wd-input-phone/index.js +3 -0
- package/dist/web/components/wd-input-phone/wd-input-phone.js +14 -0
- package/dist/web/components/wd-input-url/index.js +3 -0
- package/dist/web/components/wd-input-url/wd-input-url.js +13 -0
- package/dist/web/components/wd-input-wrap/index.js +3 -0
- package/dist/web/components/wd-input-wrap/wd-input-wrap.js +18 -0
- package/dist/web/components/wd-official-account/index.css +29 -0
- package/dist/web/components/wd-official-account/index.js +36 -0
- package/dist/web/components/wd-radio/index.js +3 -0
- package/dist/web/components/wd-radio/wd-radio.js +30 -0
- package/dist/web/components/wd-radio-list/index.js +3 -0
- package/dist/web/components/wd-radio-list/wd-radio-list.js +104 -0
- package/dist/web/components/wd-switch/index.js +3 -0
- package/dist/web/components/wd-switch/wd-switch.js +52 -0
- package/dist/web/components/wd-table/components/Table/index.js +12 -2
- package/dist/web/components/wd-table/hooks/useQueryParams.js +4 -1
- package/dist/web/components/wd-table/utils/index.js +6 -2
- package/dist/web/components/wd-table/wd-table.js +70 -57
- package/dist/web/components/wd-textarea/index.js +3 -0
- package/dist/web/components/wd-textarea/wd-textarea.js +78 -0
- package/dist/web/components/wd-tree/index.js +3 -0
- package/dist/web/components/wd-tree/utils.js +291 -0
- package/dist/web/components/wd-tree/wd-tree.js +193 -0
- package/dist/web/utils/constant.js +16 -0
- package/dist/web/utils/datasource.js +2 -2
- package/dist/web/utils/hooks/useFormLegacy.js +111 -0
- package/dist/web/utils/tool.js +12 -2
- package/dist/web/weda-ui.css +193 -3
- package/package.json +6 -5
- 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/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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect, useMemo } from 'react';
|
|
2
|
+
import React, { useState, useEffect, useMemo } from 'react';
|
|
3
3
|
import { usePlatform } from '../../utils/platform';
|
|
4
4
|
import { ConfigProvider, Select } from 'tea-component';
|
|
5
5
|
import * as PropTypes from 'prop-types';
|
|
@@ -1,13 +1,30 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
3
|
import { Bubble, ConfigProvider } from 'tea-component';
|
|
4
4
|
import { emptyObject } from '../../utils/constant';
|
|
5
|
+
// @ts-ignore忽略ts交验
|
|
6
|
+
// eslint-disable-next-line rulesdir/no-phantom-deps,import/no-unresolved
|
|
7
|
+
import { autorun } from 'mobx';
|
|
5
8
|
export const CustomerService = forwardRef(function CustomerService(props, ref) {
|
|
9
|
+
var _a, _b;
|
|
6
10
|
const { id, className, style, events = emptyObject, } = props;
|
|
11
|
+
const [editorPlatforms, setEditorPlatforms] = React.useState([]);
|
|
12
|
+
const dispose = React.useMemo(() => {
|
|
13
|
+
return autorun(() => {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
setEditorPlatforms((_b = (_a = window === null || window === void 0 ? void 0 : window.$w) === null || _a === void 0 ? void 0 : _a.wedaContext) === null || _b === void 0 ? void 0 : _b.editorPlatforms);
|
|
16
|
+
});
|
|
17
|
+
}, []);
|
|
18
|
+
React.useEffect(() => {
|
|
19
|
+
return () => {
|
|
20
|
+
dispose();
|
|
21
|
+
};
|
|
22
|
+
}, [dispose]);
|
|
7
23
|
// 方法
|
|
8
24
|
const onClick = (e) => {
|
|
9
25
|
var _a;
|
|
10
26
|
(_a = events === null || events === void 0 ? void 0 : events.tap) === null || _a === void 0 ? void 0 : _a.call(events, {}, { originEvent: e });
|
|
11
27
|
};
|
|
12
|
-
return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children:
|
|
28
|
+
return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: ((_b = (_a = window.$w) === null || _a === void 0 ? void 0 : _a.wedaContext) === null || _b === void 0 ? void 0 : _b.isEditorMode) ||
|
|
29
|
+
(editorPlatforms === null || editorPlatforms === void 0 ? void 0 : editorPlatforms.includes('MP')) ? (_jsx(Bubble, { placement: "auto", openDelay: 300, content: "\u7F16\u8F91\u5668\u6682\u4E0D\u652F\u6301\u6253\u5F00\u5BA2\u670D\u4F1A\u8BDD\uFF0C\u8BF7\u53D1\u5E03\u5C0F\u7A0B\u5E8F\u540E\u4F7F\u7528\u771F\u673A\u8C03\u8BD5\u3002PC/H5\u7AEF\u5C06\u9690\u85CF\u8BE5\u7EC4\u4EF6\uFF0C\u8BF7\u6CE8\u610F\u9875\u9762\u5E03\u5C40\u3002", children: _jsx("div", { id: id, className: className, style: style, onClick: onClick, "data-role": "wd-customer-service", ref: ref, children: props.children }) })) : null }));
|
|
13
30
|
});
|
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useCallback, useImperativeHandle, useState, useRef, } from 'react';
|
|
3
3
|
import ListView from '../listView';
|
|
4
4
|
import { useLoopRenderDetect } from '../common/use-loop-render-detect';
|
|
5
|
-
const beforeDataChange = (values) => (values === null || values === void 0 ? void 0 : values[0]) || {};
|
|
6
5
|
/**
|
|
7
6
|
* 数据容器-列表视图
|
|
8
7
|
*/
|
|
9
8
|
export default React.forwardRef(function DataView(props, ref) {
|
|
10
9
|
useLoopRenderDetect({ limit: 600 });
|
|
11
|
-
|
|
10
|
+
const listViewRef = useRef(null);
|
|
11
|
+
const [record, setRecord] = useState();
|
|
12
|
+
const beforeDataChange = useCallback((values) => {
|
|
13
|
+
const record = (values === null || values === void 0 ? void 0 : values[0]) || {};
|
|
14
|
+
setRecord(record);
|
|
15
|
+
return record;
|
|
16
|
+
}, []);
|
|
17
|
+
const refresh = useCallback(() => { var _a, _b; return (_b = (_a = listViewRef.current) === null || _a === void 0 ? void 0 : _a.refresh) === null || _b === void 0 ? void 0 : _b.call(_a); }, [listViewRef.current]);
|
|
18
|
+
const deleteOne = useCallback((params) => { var _a, _b; return (_b = (_a = listViewRef.current) === null || _a === void 0 ? void 0 : _a.deleteOne) === null || _b === void 0 ? void 0 : _b.call(_a, params); }, [listViewRef.current]);
|
|
19
|
+
useImperativeHandle(ref, () => ({ record, refresh, deleteOne }), [
|
|
20
|
+
record,
|
|
21
|
+
refresh,
|
|
22
|
+
deleteOne,
|
|
23
|
+
]);
|
|
24
|
+
return (_jsx(ListView, { ...props, ref: listViewRef, isRecords: false, orderBy: undefined, orderType: undefined, template: "none", pageSize: 1, pagination: "none", beforeDataChange: beforeDataChange }));
|
|
12
25
|
});
|
|
@@ -44,7 +44,11 @@ async function getApprovalPageDetail(processInstance, pageType) {
|
|
|
44
44
|
pageType,
|
|
45
45
|
taskId: processInstance === null || processInstance === void 0 ? void 0 : processInstance.taskId,
|
|
46
46
|
},
|
|
47
|
-
}, {
|
|
47
|
+
}, {
|
|
48
|
+
previewData: getApprovalPageDetailPreviewData,
|
|
49
|
+
// 这两个内部数据是动态的业务数据,不能进行首字母小写转换
|
|
50
|
+
lowerResultCaseIgnoreKeys: ['FieldValueMap', 'FieldValueMapList'],
|
|
51
|
+
});
|
|
48
52
|
const { objectMap, objectListMap } = translateObjectLikeMap(result);
|
|
49
53
|
return {
|
|
50
54
|
approvalPageDetail: result,
|
|
@@ -5,28 +5,28 @@ import { isInIde } from './utils';
|
|
|
5
5
|
* @description 基于callWedaApi 封装,主要是处理出入参大小写,以及预览数据
|
|
6
6
|
*/
|
|
7
7
|
export async function flowRequest(params, config) {
|
|
8
|
-
const { previewData, upperCaseData = true, upperCaseIgnoreKeys, lowerCaseResult = true, } = config || {};
|
|
8
|
+
const { previewData, upperCaseData = true, upperCaseIgnoreKeys, lowerCaseResult = true, lowerResultCaseIgnoreKeys, } = config || {};
|
|
9
9
|
if (isInIde()) {
|
|
10
|
-
return toTransKeyCase(previewData || {}, lowerCaseResult ? 'toLowerCase' : 'toUpperCase');
|
|
10
|
+
return toTransKeyCase(previewData || {}, lowerCaseResult ? 'toLowerCase' : 'toUpperCase', lowerResultCaseIgnoreKeys);
|
|
11
11
|
}
|
|
12
12
|
const result = await callWedaApi({
|
|
13
13
|
...params,
|
|
14
14
|
data: toTransKeyCase(params.data, upperCaseData ? 'toUpperCase' : 'toLowerCase', upperCaseIgnoreKeys),
|
|
15
15
|
});
|
|
16
|
-
return toTransKeyCase(result, lowerCaseResult ? 'toLowerCase' : 'toUpperCase');
|
|
16
|
+
return toTransKeyCase(result, lowerCaseResult ? 'toLowerCase' : 'toUpperCase', lowerResultCaseIgnoreKeys);
|
|
17
17
|
}
|
|
18
18
|
/** 转换具体参数的首字母大小写 */
|
|
19
19
|
function toTransKeyCase(target, method, ignoreKeyValues) {
|
|
20
20
|
const result = {};
|
|
21
21
|
if (isArray(target)) {
|
|
22
|
-
return target === null || target === void 0 ? void 0 : target.map((item) => toTransKeyCase(item, method));
|
|
22
|
+
return target === null || target === void 0 ? void 0 : target.map((item) => toTransKeyCase(item, method, ignoreKeyValues));
|
|
23
23
|
}
|
|
24
24
|
if (isObject(target)) {
|
|
25
25
|
return Object.keys(target).reduce((acc, key) => {
|
|
26
26
|
const finalKey = transKey(key, method);
|
|
27
27
|
acc[finalKey] = (ignoreKeyValues === null || ignoreKeyValues === void 0 ? void 0 : ignoreKeyValues.includes(key))
|
|
28
28
|
? target[key]
|
|
29
|
-
: toTransKeyCase(target[key], method);
|
|
29
|
+
: toTransKeyCase(target[key], method, ignoreKeyValues);
|
|
30
30
|
return acc;
|
|
31
31
|
}, result);
|
|
32
32
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect, useState } from 'react';
|
|
2
3
|
import { Modal, SelectMultiple, Button, Form, Checkbox } from 'tea-component';
|
|
4
|
+
import { flowRequest } from '../../../common';
|
|
3
5
|
import { FlowCheckListPopup } from './check-list-popup';
|
|
4
6
|
/**
|
|
5
7
|
* 选择下一节点审批人弹窗
|
|
@@ -11,29 +13,19 @@ export const FlowTaskInfoModal = (props) => {
|
|
|
11
13
|
value: item === null || item === void 0 ? void 0 : item.waitFlowTaskId,
|
|
12
14
|
}));
|
|
13
15
|
const renderModal = () => {
|
|
14
|
-
return (
|
|
15
|
-
React.createElement(Modal.Body, null,
|
|
16
|
-
React.createElement(Form, { style: { marginBottom: '5px' } },
|
|
17
|
-
React.createElement(Form.Item, { label: "\u9009\u62E9\u5904\u7406\u4EBA" },
|
|
18
|
-
React.createElement(SelectMultiple, { searchable: true, matchButtonWidth: true, appearance: "button", size: "full", style: { width: 300 }, staging: false, options: options, value: selectedTaskIds, onChange: (value) => setSelectedTaskIds(value) })))),
|
|
19
|
-
React.createElement(Modal.Footer, null,
|
|
20
|
-
React.createElement(Button, { type: "primary", onClick: () => onSubmitTaskIds(false), disabled: !selectedTaskIds.length }, "\u786E\u5B9A"),
|
|
21
|
-
React.createElement(Button, { type: "weak", onClick: () => onSubmitTaskIds() }, "\u53D6\u6D88"))));
|
|
16
|
+
return (_jsxs(Modal, { visible: visible, caption: props.label, onClose: () => onSubmitTaskIds(), size: "auto", children: [_jsx(Modal.Body, { children: _jsx(Form, { style: { marginBottom: '5px' }, children: _jsx(Form.Item, { label: "\u9009\u62E9\u5904\u7406\u4EBA", children: _jsx(SelectMultiple, { searchable: true, matchButtonWidth: true, appearance: "button", size: "full", style: { width: 300 }, staging: false, options: options, value: selectedTaskIds, onChange: (value) => setSelectedTaskIds(value) }) }) }) }), _jsxs(Modal.Footer, { children: [_jsx(Button, { type: "primary", onClick: () => onSubmitTaskIds(false), disabled: !selectedTaskIds.length, children: "\u786E\u5B9A" }), _jsx(Button, { type: "weak", onClick: () => onSubmitTaskIds(), children: "\u53D6\u6D88" })] })] }));
|
|
22
17
|
};
|
|
23
18
|
const renderPopup = () => {
|
|
24
|
-
return (
|
|
19
|
+
return (_jsx(FlowCheckListPopup, { visible: visible, onClose: () => onSubmitTaskIds(), title: props.label, overlayStyle: { zIndex: 998 }, height: 550, confirmButtonProps: {
|
|
25
20
|
disabled: !selectedTaskIds.length,
|
|
26
21
|
onClick: () => onSubmitTaskIds(false),
|
|
27
|
-
} },
|
|
28
|
-
React.createElement(Checkbox.Group, { value: selectedTaskIds, onChange: (value) => setSelectedTaskIds(value), layout: "column" }, options.map((option) => (React.createElement(Checkbox, { name: option.value, key: option.value }, option.text))))));
|
|
22
|
+
}, children: _jsx(Checkbox.Group, { value: selectedTaskIds, onChange: (value) => setSelectedTaskIds(value), layout: "column", children: options.map((option) => (_jsx(Checkbox, { name: option.value, children: option.text }, option.value))) }) }));
|
|
29
23
|
};
|
|
30
|
-
return
|
|
31
|
-
" ",
|
|
32
|
-
isH5 ? renderPopup() : renderModal());
|
|
24
|
+
return _jsxs(_Fragment, { children: [" ", isH5 ? renderPopup() : renderModal()] });
|
|
33
25
|
};
|
|
34
26
|
/** 下一节点审批人model */
|
|
35
27
|
function useFlowTaskInfoModel(params) {
|
|
36
|
-
const {
|
|
28
|
+
const { isH5 } = params.flowModulesProps;
|
|
37
29
|
const { onAfterFinishFlowAction } = params.flowControlModel;
|
|
38
30
|
/** 弹框是否可见 */
|
|
39
31
|
const [visible, setVisible] = useState(false);
|
|
@@ -35,7 +35,9 @@
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/* formcell 在 form container 外部兼容 and 独立 layout 适配 */
|
|
38
|
-
|
|
38
|
+
.weda-formcells__pc.weda-formcells__full-width.vertical {
|
|
39
|
+
display: block;
|
|
40
|
+
}
|
|
39
41
|
.weda-formcells__pc.vertical .wedatea2td-form__controls,
|
|
40
42
|
.weda-formcells__pc.vertical .wedatea2td-form__label {
|
|
41
43
|
display: block;
|
|
@@ -90,6 +92,16 @@
|
|
|
90
92
|
width: 98px;
|
|
91
93
|
}
|
|
92
94
|
|
|
95
|
+
.weda-formcells__pc.horizontal .wedatea2td-form__label.is-required label:after,
|
|
96
|
+
.weda-formcells__pc.vertical .wedatea2td-form__label.is-required label:after {
|
|
97
|
+
display: inline-block;
|
|
98
|
+
content: '*';
|
|
99
|
+
color: #e54545;
|
|
100
|
+
line-height: 1;
|
|
101
|
+
position: relative;
|
|
102
|
+
margin: 3px 0 0 3px;
|
|
103
|
+
}
|
|
104
|
+
|
|
93
105
|
/*formcell*/
|
|
94
106
|
|
|
95
107
|
.weda-formcells__full-width .wedatea2td-form__controls {
|
|
@@ -27,7 +27,7 @@ export default function FormCell({ className, style, label, layout, children, mu
|
|
|
27
27
|
'weda-formcells__label': true,
|
|
28
28
|
// 标题也采用使用weui-cell的样式
|
|
29
29
|
'weui-cell': true,
|
|
30
|
-
}), children: [
|
|
30
|
+
}), children: [requiredFlag ? (_jsx("label", { className: "weda-formcells__flag", children: "*" })) : null, _jsx("label", { children: label })] })) : null, _jsx("div", { className: classNames({
|
|
31
31
|
'weda-formcells__content': true,
|
|
32
32
|
'weui-flex__item': isFlex,
|
|
33
33
|
}), children: children })] }) }));
|
|
@@ -293,7 +293,7 @@ export default function LocationH5(props) {
|
|
|
293
293
|
}
|
|
294
294
|
return status;
|
|
295
295
|
};
|
|
296
|
-
const LocationEl = (_jsxs("div", { className: "form-location weda-ui_form-location", "data-testid": "form-location", children: [_jsxs("div", { className: `form-location-warp ${styles.locationDisabled}`, style: { display: layout === 'vertical' ? 'block' : 'flex' }, children: [labelVisible && (_jsxs("div", { className: "form-location-label", children: [_jsx("
|
|
296
|
+
const LocationEl = (_jsxs("div", { className: "form-location weda-ui_form-location", "data-testid": "form-location", children: [_jsxs("div", { className: `form-location-warp ${styles.locationDisabled}`, style: { display: layout === 'vertical' ? 'block' : 'flex' }, children: [labelVisible && (_jsxs("div", { className: "form-location-label weda-formcells__label weui-cell", children: [requiredFlag && _jsx("span", { className: "weda-formcells__flag", children: "*" }), _jsx("label", { children: label })] })), _jsxs("div", { className: classNames({
|
|
297
297
|
'form-location-con': true,
|
|
298
298
|
[styles.locationContent]: true,
|
|
299
299
|
'form-location-con_vertical': layout === 'vertical',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
2
3
|
import { Button } from 'tea-component';
|
|
3
4
|
import classNames from '../../../../../utils/classnames';
|
|
4
5
|
const Header = ({ onClick, isEdit, info, disabled, showLngLat, locationType, dataSourceStatus, apiKeyStatus, currentLocStatus, }) => {
|
|
@@ -101,17 +101,18 @@ defaultRegion, defaultMutiRegion, separator, regionType, onChange, }) {
|
|
|
101
101
|
if (mode == 'region' || mode == 'mutiRegion') {
|
|
102
102
|
if (regionData.length < 1) {
|
|
103
103
|
getAreaCode().then((value) => {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
var _a;
|
|
105
|
+
if (((_a = value === null || value === void 0 ? void 0 : value.length) !== null && _a !== void 0 ? _a : 0) > 0) {
|
|
106
|
+
defaultMutiRegionChange(value, defaultMutiRegion);
|
|
107
|
+
setRegionData(value);
|
|
108
|
+
const tree = getRegionTree(value, regionType, mode);
|
|
107
109
|
setRegionTree(tree);
|
|
108
|
-
}
|
|
110
|
+
}
|
|
109
111
|
});
|
|
110
112
|
}
|
|
111
113
|
else {
|
|
112
|
-
getRegionTree(regionData, regionType, mode)
|
|
113
|
-
|
|
114
|
-
});
|
|
114
|
+
const tree = getRegionTree(regionData, regionType, mode);
|
|
115
|
+
setRegionTree(tree);
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
118
|
switch (regionType) {
|
|
@@ -138,21 +138,21 @@ function SelectPc({ name, where, dataSourceName, viewId, format, primaryField, e
|
|
|
138
138
|
if (mode == 'region' || mode == 'mutiRegion') {
|
|
139
139
|
if (regionData.length < 1) {
|
|
140
140
|
getAreaCode().then((value) => {
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
var _a;
|
|
142
|
+
if (((_a = value === null || value === void 0 ? void 0 : value.length) !== null && _a !== void 0 ? _a : 0) > 0) {
|
|
143
|
+
setRegionData(value);
|
|
144
|
+
const tree = getRegionTree(value, regionType, mode);
|
|
143
145
|
setRegionTree(tree);
|
|
144
|
-
}
|
|
146
|
+
}
|
|
145
147
|
});
|
|
146
148
|
}
|
|
147
149
|
else {
|
|
148
|
-
getRegionTree(regionData, regionType, mode)
|
|
149
|
-
|
|
150
|
-
});
|
|
150
|
+
const tree = getRegionTree(regionData, regionType, mode);
|
|
151
|
+
setRegionTree(tree);
|
|
151
152
|
}
|
|
152
153
|
}
|
|
153
|
-
getRegionTree(regionData, regionType, mode)
|
|
154
|
-
|
|
155
|
-
});
|
|
154
|
+
const value = getRegionTree(regionData, regionType, mode);
|
|
155
|
+
setRegionTree(value);
|
|
156
156
|
}, [regionType, mode, regionData]);
|
|
157
157
|
const onDataChange = (value) => {
|
|
158
158
|
var _a;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import weui from '../../../../utils/weui';
|
|
2
2
|
import { callWedaApi } from '../../../../utils/tcb';
|
|
3
3
|
let tree;
|
|
4
|
-
export
|
|
4
|
+
export function getRegionTree(regionData, regionType, regionMode) {
|
|
5
5
|
tree = [];
|
|
6
6
|
tree = formatTreeData(regionData, regionType, regionMode);
|
|
7
7
|
return tree;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { Portal } from '../../../common/portal';
|
|
4
|
+
import './index.css';
|
|
5
|
+
import { Status } from '../status';
|
|
6
|
+
import Loading from '../status/loading';
|
|
7
|
+
import Retry from '../status/retry';
|
|
8
|
+
import Empty from '../status/empty';
|
|
9
|
+
import AllEmpty from '../status/allEmpty';
|
|
10
|
+
import { PAGE_SIZE } from '../request';
|
|
11
|
+
import { alertErrorMessage } from '../../../../utils/platform';
|
|
12
|
+
export function SelectPickerH5({ updateValue, selectedValue, options, isTurnPages, loadMore, onSearchValue, reTry, status, isShow, getIsShow, }) {
|
|
13
|
+
const focusRef = useRef();
|
|
14
|
+
const contentRef = useRef();
|
|
15
|
+
const heightRef = useRef(0);
|
|
16
|
+
const indexRef = useRef(1);
|
|
17
|
+
const [inputFocus, setInputFocus] = useState(false);
|
|
18
|
+
const [searchValue, setSearchValue] = useState('');
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20
|
+
const [ind, setInd] = useState(0);
|
|
21
|
+
const checkIndex = (param) => {
|
|
22
|
+
if (selectedValue) {
|
|
23
|
+
const check = selectedValue.find((item) => item === param.value);
|
|
24
|
+
return !!check;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (isShow) {
|
|
32
|
+
onSearchValue(searchValue);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
onSearchValue('');
|
|
36
|
+
}
|
|
37
|
+
}, [searchValue, isShow]);
|
|
38
|
+
const clear = () => {
|
|
39
|
+
setInputFocus(false);
|
|
40
|
+
setSearchValue('');
|
|
41
|
+
updateValue(undefined);
|
|
42
|
+
getIsShow();
|
|
43
|
+
};
|
|
44
|
+
const confirm = () => {
|
|
45
|
+
getIsShow();
|
|
46
|
+
};
|
|
47
|
+
const contentScroll = () => {
|
|
48
|
+
if (status !== Status.LOADING || !isTurnPages) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const item = contentRef.current.children.item(0);
|
|
52
|
+
if (!item) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (heightRef.current === 0) {
|
|
56
|
+
const length = options.length + (status === Status.FINISH ? 0 : 1);
|
|
57
|
+
heightRef.current = item.scrollHeight / length;
|
|
58
|
+
}
|
|
59
|
+
const index = Math.ceil((item.scrollTop + item.clientHeight) / heightRef.current);
|
|
60
|
+
// 过滤重复数据
|
|
61
|
+
if (indexRef.current === index) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
indexRef.current = index;
|
|
65
|
+
// 到底了,加载更多
|
|
66
|
+
// -20标识提前20条数据加载,||后面条件为保底条件,防止前面触发不了
|
|
67
|
+
if (options.length >= PAGE_SIZE &&
|
|
68
|
+
((index + 20) % PAGE_SIZE === 0 || options.length + 1 <= index) &&
|
|
69
|
+
status === Status.LOADING) {
|
|
70
|
+
loadMore();
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
return isShow ? (_jsx(Portal, { type: "div", children: _jsxs("div", { className: "weda-ui-custom-picker", children: [_jsx("div", { className: "weda-ui-custom-backdrop", onClick: () => {
|
|
74
|
+
setInputFocus(false);
|
|
75
|
+
setSearchValue('');
|
|
76
|
+
// confirm();
|
|
77
|
+
} }), _jsxs("div", { className: "weda-ui-custom-picker__inner", style: inputFocus ? { height: 'calc(100vh - 96px)' } : null, children: [!inputFocus && (_jsxs("div", { className: "weda-ui-custom-picker__header", children: [_jsx("div", { className: "weda-ui-custom-picker__header-cancle", onClick: clear, children: "\u6E05\u7A7A" }), _jsx("div", { className: "weda-ui-custom-picker__header-confirm", onClick: confirm, children: "\u786E\u5B9A" })] })), _jsxs("div", { className: "weda-ui-custom-picker__body", children: [_jsxs("div", { style: { margin: inputFocus ? '16px 16px 8px 16px' : '8px 16px' }, className: `weda-ui-custom-search
|
|
78
|
+
${inputFocus ? 'is-focused' : ''}`, children: [_jsxs("div", { className: "weda-ui-custom-search-box ", onClick: () => {
|
|
79
|
+
setInputFocus(true);
|
|
80
|
+
}, children: [inputFocus ? (_jsx("input", { className: "weda-ui-input", ref: focusRef, value: searchValue, autoFocus: true, onChange: (e) => setSearchValue(e.target.value) })) : (
|
|
81
|
+
// 此处主要为了兼容 iOS
|
|
82
|
+
_jsx("div", { className: "weda-ui-input" })), _jsxs("div", { className: `weda-ui-custom-search-box__label multiple`, children: [_jsx("span", { className: "weda-ui-custom-search-box__search-icon " }), _jsx("span", { className: "weda-ui-custom-search-box__search-placeholder", children: "\u641C\u7D22" })] }), inputFocus && searchValue !== '' && (_jsx("span", { className: "weda-ui-custom-search-box__dismiss-icon", onClick: () => setSearchValue('') }))] }), _jsx("button", { className: "weda-ui-custom-search__btn-cancle", onClick: () => {
|
|
83
|
+
setInputFocus(false);
|
|
84
|
+
setSearchValue('');
|
|
85
|
+
}, children: "\u53D6\u6D88" })] }), status === Status.ALl_EMPTY ? (_jsx(AllEmpty, { height: inputFocus ? 'calc(100vh - 160px)' : '280px' })) : (_jsx("div", { className: "weda-ui-custom-picker__cloumns weda-ui-custom-picker__cloumns--select-multiple ", style: {
|
|
86
|
+
height: inputFocus ? 'calc(100vh - 160px)' : '280px',
|
|
87
|
+
}, onScroll: contentScroll, ref: contentRef, children: _jsxs("ul", { className: "weda-ui-custom-picker__cloumn", style: {
|
|
88
|
+
height: inputFocus ? 'calc(100vh - 190px)' : '250px',
|
|
89
|
+
}, children: [options === null || options === void 0 ? void 0 : options.map((item, index) => {
|
|
90
|
+
return (_jsx("li", {
|
|
91
|
+
// is-selected 选中态
|
|
92
|
+
// is-disabled 禁用态
|
|
93
|
+
className: `weda-ui-custom-picker__cloumn-item ${checkIndex(item) ? 'is-selected' : ''} ${index === -1 ? 'is-disabled' : ''}`, onClick: () => {
|
|
94
|
+
if (selectedValue && selectedValue.length > 49) {
|
|
95
|
+
if (selectedValue.indexOf(item.value) !== -1) {
|
|
96
|
+
updateValue(item);
|
|
97
|
+
setInd(Math.random());
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
alertErrorMessage({
|
|
101
|
+
message: '最多选择50条数据',
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
updateValue(item);
|
|
107
|
+
setInd(Math.random());
|
|
108
|
+
}
|
|
109
|
+
}, children: _jsx("p", { className: 'weda-ui-custom-picker__cloumn-item-text-multiple', children: item.label }) }, index));
|
|
110
|
+
}), status === Status.LOADING && (_jsx("li", { children: _jsx(Loading, {}) }, 'loading')), status === Status.ERROR && (_jsx("li", { children: _jsx(Retry, { reTry: reTry }) }, 'retry')), status === Status.EMPTY && (_jsx("li", { children: _jsx(Empty, {}) }, 'empty'))] }) }))] })] })] }) })) : null;
|
|
111
|
+
}
|