@cloudbase/weda-ui 3.4.11 → 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/customer-service.js +3 -0
- 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/form-user-tree-select.js +13 -0
- 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-button.js +3 -0
- 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 +8 -56
- package/dist/configs/components/wd-textarea.js +82 -0
- package/dist/configs/components/wd-tree.js +443 -0
- package/dist/configs/components/web-view.js +3 -0
- package/dist/configs/index.js +24 -1
- package/dist/configs/type-utils/type-form.js +681 -0
- package/dist/docs/common/components/json-schema-view.js +1 -1
- 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/actions/showMessage/index.js +4 -1
- package/dist/web/components/carousel/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 +90 -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/select/dropdown-select/index.js +7 -1
- package/dist/web/components/form/select/h5.js +18 -8
- 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 +60 -62
- package/dist/web/components/form/uploader/uploader.pc.js +48 -41
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +8 -33
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +8 -37
- package/dist/web/components/form/userOrgSelect/common/fetch-data-service.js +76 -50
- package/dist/web/components/form/userOrgSelect/common/utils.js +24 -8
- package/dist/web/components/form/userOrgSelect/component/depart-select/depart-select-pc.js +3 -8
- package/dist/web/components/form/userOrgSelect/component/depart-select/index.js +14 -18
- package/dist/web/components/form/userOrgSelect/component/depart-select/org-modal-pc.js +20 -14
- package/dist/web/components/form/userOrgSelect/component/modal-select-h5.js +1 -1
- package/dist/web/components/form/userOrgSelect/component/org-tree.js +21 -9
- package/dist/web/components/form/userOrgSelect/component/user-select-h5/index.js +57 -10
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-model.js +2 -7
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-select-pc.js +6 -4
- package/dist/web/components/form/userOrgSelect/component/userOrgSelect.css +8 -2
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +25 -51
- package/dist/web/components/form/userOrgSelect/hooks/use-depart-data.js +3 -3
- 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/form-user-tree-select/index.js +2 -2
- 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/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/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/FieldRender/index.js +5 -4
- 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/date.js +3 -3
- 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
|
@@ -64,9 +64,9 @@ const isNoOrgList = {
|
|
|
64
64
|
icon: Icon,
|
|
65
65
|
};
|
|
66
66
|
export const useDepartData = (props) => {
|
|
67
|
-
const { request } = props;
|
|
68
|
-
const { data: treeData, error } = useSWR(
|
|
69
|
-
const tempList = await DescribeOrgs(request);
|
|
67
|
+
const { request, params } = props;
|
|
68
|
+
const { data: treeData, error } = useSWR(`${DescribeOrgs}_${JSON.stringify(params)}`, async () => {
|
|
69
|
+
const tempList = await DescribeOrgs(request, params);
|
|
70
70
|
const orgsData = destr(tempList);
|
|
71
71
|
const { res: tempTreeData, tempOrgList } = buildTreeData(orgsData);
|
|
72
72
|
//是否展示非组织节点
|
|
@@ -9,6 +9,7 @@ import { getParentForm, useWedaAppContext } from '../../utils/widget-api';
|
|
|
9
9
|
import { validType } from './validator';
|
|
10
10
|
import { emptyArray, noop } from '../../utils/constant';
|
|
11
11
|
import { useRerender, useSyncedRef, useUnmountEffect } from '@react-hookz/web';
|
|
12
|
+
import { useStatus, convertMethodParam } from '../../utils/hooks/useFormLegacy';
|
|
12
13
|
const logger = debug('wd-form-item');
|
|
13
14
|
export function useParentForm($widget) {
|
|
14
15
|
const { ready } = useWedaAppContext();
|
|
@@ -42,8 +43,9 @@ export function useFormInputTrait(inputParams) {
|
|
|
42
43
|
}
|
|
43
44
|
const eventsRef = useSyncedRef(events);
|
|
44
45
|
const [name] = useSyncValue(inputParams.name);
|
|
45
|
-
const
|
|
46
|
-
const [
|
|
46
|
+
const statusParams = useStatus(inputParams);
|
|
47
|
+
const [disabled, setDisabled] = useSyncValue((_a = statusParams.disabled) !== null && _a !== void 0 ? _a : false);
|
|
48
|
+
const [readOnly, setReadOnly] = useSyncValue(statusParams.readOnly);
|
|
47
49
|
const [validateState, setValidateState] = useState(inputParams.validateStatus);
|
|
48
50
|
const [validateErrorMsg, setValidateErrorMsg] = useState('');
|
|
49
51
|
const [visible, setVisible] = useState(true);
|
|
@@ -90,23 +92,27 @@ export function useFormInputTrait(inputParams) {
|
|
|
90
92
|
}, [setValidateErrorMsg, setValidateState]);
|
|
91
93
|
// 挂在setValue方法到 $widget上
|
|
92
94
|
React.useImperativeHandle(inputRef, () => {
|
|
95
|
+
logger.debug('useImperativeHandle', { name, syncValue });
|
|
93
96
|
const result = {
|
|
94
97
|
setValue(val) {
|
|
95
|
-
|
|
98
|
+
const value = convertMethodParam(val);
|
|
99
|
+
setSyncedValue(value);
|
|
96
100
|
},
|
|
97
101
|
setVisible(val) {
|
|
98
|
-
|
|
102
|
+
const value = convertMethodParam(val);
|
|
103
|
+
if (typeof value !== 'boolean') {
|
|
99
104
|
console.warn('参数需要为boolean');
|
|
100
105
|
return;
|
|
101
106
|
}
|
|
102
|
-
setVisible(
|
|
107
|
+
setVisible(value);
|
|
103
108
|
},
|
|
104
109
|
setHidden() {
|
|
105
110
|
setVisible(false);
|
|
106
111
|
},
|
|
107
112
|
initialDisabled: inputParams.disabled,
|
|
108
|
-
setDisable(
|
|
113
|
+
setDisable(val) {
|
|
109
114
|
const originalValue = disabled;
|
|
115
|
+
const value = convertMethodParam(val);
|
|
110
116
|
setDisabled(value);
|
|
111
117
|
return () => {
|
|
112
118
|
setDisabled(originalValue);
|
|
@@ -115,12 +121,14 @@ export function useFormInputTrait(inputParams) {
|
|
|
115
121
|
clearValue() {
|
|
116
122
|
setSyncedValue(null);
|
|
117
123
|
},
|
|
118
|
-
setReadOnly(
|
|
119
|
-
const
|
|
120
|
-
|
|
124
|
+
setReadOnly(val) {
|
|
125
|
+
const [originalReadOnly, originalDisabled] = [readOnly, disabled];
|
|
126
|
+
const value = convertMethodParam(val);
|
|
127
|
+
setReadOnly(value);
|
|
121
128
|
setDisabled(value);
|
|
122
129
|
return () => {
|
|
123
|
-
|
|
130
|
+
setReadOnly(originalReadOnly);
|
|
131
|
+
setDisabled(originalDisabled);
|
|
124
132
|
};
|
|
125
133
|
},
|
|
126
134
|
async handleValidate() {
|
|
@@ -163,11 +171,27 @@ export function useFormInputTrait(inputParams) {
|
|
|
163
171
|
if (item.pattern) {
|
|
164
172
|
// 正则校验
|
|
165
173
|
// console.log("pattern 校验>>>>")
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
174
|
+
try {
|
|
175
|
+
let reg;
|
|
176
|
+
if (typeof item.pattern === 'string') {
|
|
177
|
+
const m = item.pattern.match(/(\/?)(.+)\1([a-z]*)/i);
|
|
178
|
+
if (m[3] &&
|
|
179
|
+
!/^(?!.*?(.).*?\1)[gmixXsuUAJ]+$/.test(m[3])) {
|
|
180
|
+
reg = RegExp(item.pattern);
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
reg = new RegExp(m[2], m[3]);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
reg = new RegExp(item.pattern);
|
|
188
|
+
}
|
|
189
|
+
if (!reg.test(String(finalValue))) {
|
|
190
|
+
validPromise.push(Promise.resolve(item));
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
170
193
|
}
|
|
194
|
+
catch (e) { }
|
|
171
195
|
}
|
|
172
196
|
}
|
|
173
197
|
});
|
|
@@ -209,6 +233,7 @@ export function useFormInputTrait(inputParams) {
|
|
|
209
233
|
setSyncedValue,
|
|
210
234
|
disabled,
|
|
211
235
|
setDisabled,
|
|
236
|
+
setReadOnly,
|
|
212
237
|
required,
|
|
213
238
|
rules,
|
|
214
239
|
requiredMsg,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { FormItemWrapper } from '../common/form-item-wrapper';
|
|
4
|
+
import SelectMultiple from '../form/selectMultiple';
|
|
5
|
+
import Tips from '../form/tips';
|
|
6
|
+
import { useFormInputTrait } from '../form-input-hooks';
|
|
7
|
+
const FormSelectMultiple = React.forwardRef(function FormSelectMultiple(props, inputRef) {
|
|
8
|
+
const { className, id, style, events, required, requiredFlag, label, labelVisible, dataSourceName, enumName, format, placeholder, primaryField, range, size, tipBlock, viewId,
|
|
9
|
+
// where,
|
|
10
|
+
...restProps } = props;
|
|
11
|
+
const { value, name, onChange, disabled, layout,
|
|
12
|
+
// readOnly,
|
|
13
|
+
validateErrorMsg, validateState, visible, } = useFormInputTrait({
|
|
14
|
+
name: restProps.name,
|
|
15
|
+
inputRef,
|
|
16
|
+
required,
|
|
17
|
+
...restProps,
|
|
18
|
+
});
|
|
19
|
+
if (!visible) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return (_jsxs(FormItemWrapper, { children: [_jsx(SelectMultiple, { id: id, style: style, className: className, events: events, name: name, onChange: onChange, disabled: disabled, label: label, labelVisible: labelVisible, layout: layout, requiredFlag: required && requiredFlag, defaultValue: value, enumName: enumName, format: format, placeholder: placeholder, primaryField: primaryField, range: range, size: size, tipBlock: tipBlock, viewId: viewId,
|
|
23
|
+
// where={where}
|
|
24
|
+
dataSourceName: dataSourceName, mode: "selector" }), (validateState === 'error' || validateState === 'warn') && (_jsx(Tips, { tips: validateErrorMsg, type: "warn" }))] }));
|
|
25
|
+
});
|
|
26
|
+
export default FormSelectMultiple;
|
|
@@ -5,7 +5,7 @@ import Tips from '../form/tips';
|
|
|
5
5
|
import { useFormInputTrait } from '../form-input-hooks';
|
|
6
6
|
import { FormItemWrapper } from '../common/form-item-wrapper';
|
|
7
7
|
const FormUserTreeSelect = React.forwardRef(function FormUserTreeSelect(props, inputRef) {
|
|
8
|
-
const { className, id, style, events, required, requiredFlag, label, labelVisible, confirmValue, defaultValueType, multiple, size, where, secondDisplay, ...restProps } = props;
|
|
8
|
+
const { className, id, style, events, required, requiredFlag, label, labelVisible, confirmValue, defaultValueType, multiple, size, where, secondDisplay, corpScope, ...restProps } = props;
|
|
9
9
|
const { value, name,
|
|
10
10
|
// onChange,
|
|
11
11
|
disabled, layout,
|
|
@@ -19,6 +19,6 @@ const FormUserTreeSelect = React.forwardRef(function FormUserTreeSelect(props, i
|
|
|
19
19
|
if (!visible) {
|
|
20
20
|
return null;
|
|
21
21
|
}
|
|
22
|
-
return (_jsxs(FormItemWrapper, { children: [_jsx(UserTreeSelect, { id: id, style: style, className: className, events: events, name: name, checked: value, disabled: disabled, label: label, labelVisible: labelVisible, layout: layout, requiredFlag: required && requiredFlag, confirmValue: confirmValue, defaultValueType: defaultValueType, defaultValue: value, size: size, multiple: multiple, where: where, secondDisplay: secondDisplay }), (validateState === 'error' || validateState === 'warn') && (_jsx(Tips, { tips: validateErrorMsg, type: "warn" }))] }));
|
|
22
|
+
return (_jsxs(FormItemWrapper, { children: [_jsx(UserTreeSelect, { id: id, style: style, className: className, events: events, name: name, checked: value, disabled: disabled, label: label, labelVisible: labelVisible, layout: layout, requiredFlag: required && requiredFlag, confirmValue: confirmValue, defaultValueType: defaultValueType, defaultValue: value, size: size, multiple: multiple, where: where, secondDisplay: secondDisplay, corpScope: corpScope }), (validateState === 'error' || validateState === 'warn') && (_jsx(Tips, { tips: validateErrorMsg, type: "warn" }))] }));
|
|
23
23
|
});
|
|
24
24
|
export default FormUserTreeSelect;
|
|
@@ -228,6 +228,30 @@
|
|
|
228
228
|
float: unset;
|
|
229
229
|
width: 100%;
|
|
230
230
|
}
|
|
231
|
+
|
|
232
|
+
.wd-form--vertical-left
|
|
233
|
+
.form-detail-wrap.pc-form-detail-wrap
|
|
234
|
+
.form-detail-group-parent-container,
|
|
235
|
+
.wd-form--vertical-right
|
|
236
|
+
.form-detail-wrap.pc-form-detail-wrap
|
|
237
|
+
.form-detail-group-parent-container {
|
|
238
|
+
float: unset;
|
|
239
|
+
width: 100%;
|
|
240
|
+
}
|
|
241
|
+
.wd-form--vertical-left
|
|
242
|
+
.form-detail-wrap.pc-form-detail-wrap
|
|
243
|
+
.form-detail-group-label-container {
|
|
244
|
+
float: unset;
|
|
245
|
+
width: 100%;
|
|
246
|
+
}
|
|
247
|
+
.wd-form--vertical-right
|
|
248
|
+
.form-detail-wrap.pc-form-detail-wrap
|
|
249
|
+
.form-detail-group-label-container {
|
|
250
|
+
float: unset;
|
|
251
|
+
width: 100%;
|
|
252
|
+
text-align: right;
|
|
253
|
+
}
|
|
254
|
+
|
|
231
255
|
/* 升级后组件样式兼容 */
|
|
232
256
|
.form-detail-wrap .form-detail-add-button .wd-typography,
|
|
233
257
|
.form-detail-wrap .form-detail-delete-button .wd-typography {
|
|
@@ -400,10 +424,12 @@
|
|
|
400
424
|
}
|
|
401
425
|
.form-detail-table .tableHeaderCellContainer {
|
|
402
426
|
display: flex;
|
|
427
|
+
position: relative;
|
|
403
428
|
}
|
|
404
429
|
.form-detail-table .tableHeaderCellContainer .tableFieldRequired {
|
|
405
430
|
color: #e34d59;
|
|
406
|
-
|
|
431
|
+
position: absolute;
|
|
432
|
+
left: -10px;
|
|
407
433
|
}
|
|
408
434
|
.form-detail-table .wd-grid-col.form-detail-table-option-container {
|
|
409
435
|
background-color: #f3f3f3;
|
|
@@ -442,3 +468,7 @@
|
|
|
442
468
|
.form-detail-wrap .wd-grid-row > div {
|
|
443
469
|
margin: 0;
|
|
444
470
|
}
|
|
471
|
+
|
|
472
|
+
.form-detail-wrap.form-detail-table .weda-ui.gsd-h5-react-formitem > .weda-ui {
|
|
473
|
+
padding: 0;
|
|
474
|
+
}
|
|
@@ -10,6 +10,28 @@ import { useFormInputTrait, useParentForm } from '../form-input-hooks';
|
|
|
10
10
|
import { debug } from '../../utils/console';
|
|
11
11
|
import { noop } from '../../utils/constant';
|
|
12
12
|
import { WdText } from '../wd-text';
|
|
13
|
+
// 获取明细组件子项初始值
|
|
14
|
+
const getChildFormItem = (isPureArray, name, parent) => {
|
|
15
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
16
|
+
let childFormItem = [];
|
|
17
|
+
let fieldSchema = null;
|
|
18
|
+
if ('model' === (parent === null || parent === void 0 ? void 0 : parent.datasourceType)) {
|
|
19
|
+
fieldSchema = (_c = (_b = (_a = parent === null || parent === void 0 ? void 0 : parent.dataSourceProfile) === null || _a === void 0 ? void 0 : _a.schema) === null || _b === void 0 ? void 0 : _b.properties) === null || _c === void 0 ? void 0 : _c[name];
|
|
20
|
+
}
|
|
21
|
+
else if (['connector', 'custom-connector'].includes(parent === null || parent === void 0 ? void 0 : parent.datasourceType)) {
|
|
22
|
+
const method = (parent === null || parent === void 0 ? void 0 : parent.methodCreate) || (parent === null || parent === void 0 ? void 0 : parent.methodUpdate) || (parent === null || parent === void 0 ? void 0 : parent.methodGetItem);
|
|
23
|
+
const inParams = (_f = (_e = (_d = parent === null || parent === void 0 ? void 0 : parent.dataSourceProfile) === null || _d === void 0 ? void 0 : _d.methods) === null || _e === void 0 ? void 0 : _e.find((i) => i.name === method)) === null || _f === void 0 ? void 0 : _f.inParams;
|
|
24
|
+
fieldSchema = (_g = inParams === null || inParams === void 0 ? void 0 : inParams.properties) === null || _g === void 0 ? void 0 : _g[name];
|
|
25
|
+
}
|
|
26
|
+
childFormItem = ((_h = fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.items) === null || _h === void 0 ? void 0 : _h.properties)
|
|
27
|
+
? Object.keys((_j = fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.items) === null || _j === void 0 ? void 0 : _j.properties)
|
|
28
|
+
: [];
|
|
29
|
+
// 纯数组,默认key值为'arrayItem'
|
|
30
|
+
if (isPureArray) {
|
|
31
|
+
childFormItem = ['arrayItem'];
|
|
32
|
+
}
|
|
33
|
+
return childFormItem;
|
|
34
|
+
};
|
|
13
35
|
const logger = debug('form-detail');
|
|
14
36
|
export const reorderContext = (data, name, isPureArray) => data.map((i, index) => {
|
|
15
37
|
const item = { ...i };
|
|
@@ -66,6 +88,7 @@ export const changeHandle = ({ type, name, data, childFormItem, isPureArray, par
|
|
|
66
88
|
return data;
|
|
67
89
|
};
|
|
68
90
|
const FormDetailCom = forwardRef(function FormDetail(props, ref) {
|
|
91
|
+
var _a;
|
|
69
92
|
const { className, id, style, children, events, name, isPureArray, fieldAuth = 'rw', $widget, hasInitValue = false, isWdFormDetail, viewType = 'table', label, } = props;
|
|
70
93
|
const [innerHandle, setInnerHandle] = useState({});
|
|
71
94
|
const inputRef = useRef({});
|
|
@@ -144,6 +167,13 @@ const FormDetailCom = forwardRef(function FormDetail(props, ref) {
|
|
|
144
167
|
setHasScroll(bodyHasScroll);
|
|
145
168
|
}
|
|
146
169
|
}, []);
|
|
170
|
+
// 初始化明细组件子项初始值
|
|
171
|
+
useEffect(() => {
|
|
172
|
+
if ((parent === null || parent === void 0 ? void 0 : parent.dataSourceProfile) && name) {
|
|
173
|
+
const childFormItem = getChildFormItem(isPureArray, name, parent);
|
|
174
|
+
setChildFormItem(childFormItem);
|
|
175
|
+
}
|
|
176
|
+
}, [isPureArray, name, (_a = parent === null || parent === void 0 ? void 0 : parent.dataSourceProfile) === null || _a === void 0 ? void 0 : _a.name]);
|
|
147
177
|
// 初始化context的值
|
|
148
178
|
useEffect(() => {
|
|
149
179
|
logger.debug('initDetailValue', initDetailValue);
|
|
@@ -70,6 +70,7 @@ export { default as Checkbox } from './form/checkbox';
|
|
|
70
70
|
export { default as Radio } from './form/radio';
|
|
71
71
|
export { default as Switch } from './form/switch';
|
|
72
72
|
export { default as Select } from './form/select';
|
|
73
|
+
export { default as SelectMultiple } from './form/selectMultiple';
|
|
73
74
|
// export const Select = loadable(() => import('./form/select'), { fallback });
|
|
74
75
|
export { default as Uploader } from './form/uploader';
|
|
75
76
|
export { default as UploaderFile } from './form/uploaderFile';
|
|
@@ -132,7 +133,6 @@ export { default as Grid } from './grid/grid';
|
|
|
132
133
|
export { default as Repeater } from './repeater';
|
|
133
134
|
export { default as RepeaterItem } from './repeater-item';
|
|
134
135
|
export { default as WebView } from './web-view';
|
|
135
|
-
export { default as WdForm } from './wd-form';
|
|
136
136
|
export { default as FormInput } from './form-input';
|
|
137
137
|
export { default as FormTextArea } from './form-text-area';
|
|
138
138
|
export { default as FormRadio } from './form-radio';
|
|
@@ -153,12 +153,14 @@ export { default as FormImageUploader } from './form-image-uploader';
|
|
|
153
153
|
export { default as FormUploadFile } from './form-upload-file';
|
|
154
154
|
export { default as FormMultiRegion } from './form-multi-region';
|
|
155
155
|
export { default as FormSelect } from './form-select';
|
|
156
|
+
export { default as FormSelectMultiple } from './form-select-multiple';
|
|
156
157
|
export { default as FormDate } from './form-date';
|
|
157
158
|
export { default as FormRegion } from './form-region';
|
|
158
159
|
export { default as FormTime } from './form-time';
|
|
159
160
|
export { default as WdFormDetail } from './formdetail';
|
|
160
161
|
export { default as QrCode } from './qrcode';
|
|
161
162
|
export { default as CustomerService } from './customer-service';
|
|
163
|
+
export { default as WdOfficialAccount } from './wd-official-account';
|
|
162
164
|
import 'weui/dist/style/weui.css';
|
|
163
165
|
import '../weda-ui.css';
|
|
164
166
|
// 组件标准化
|
|
@@ -171,3 +173,17 @@ export { default as WdText } from './wd-text';
|
|
|
171
173
|
export { default as WdImage } from './wd-image';
|
|
172
174
|
export { default as WdBubble } from './wd-bubble';
|
|
173
175
|
export { default as WdIcon } from './wd-icon';
|
|
176
|
+
export { default as WdTree } from './wd-tree';
|
|
177
|
+
export { default as WdForm } from './wd-form';
|
|
178
|
+
export { default as WdTextarea } from './wd-textarea';
|
|
179
|
+
export { default as WdInput } from './wd-input';
|
|
180
|
+
export { default as WdInputEmail } from './wd-input-email';
|
|
181
|
+
export { default as WdInputUrl } from './wd-input-url';
|
|
182
|
+
export { default as WdInputGroup } from './wd-input-group';
|
|
183
|
+
export { default as WdInputPhone } from './wd-input-phone';
|
|
184
|
+
export { default as WdInputWrap } from './wd-input-wrap';
|
|
185
|
+
export { default as WdSwitch } from './wd-switch';
|
|
186
|
+
export { default as WdRadioList } from './wd-radio-list';
|
|
187
|
+
export { default as WdRadio } from './wd-radio';
|
|
188
|
+
export { default as WdCheckboxList } from './wd-checkbox-list';
|
|
189
|
+
export { default as WdCheckbox } from './wd-checkbox';
|
|
@@ -381,13 +381,28 @@ export default React.forwardRef(function ListView(props, ref) {
|
|
|
381
381
|
alertErrorMessage({ message: LISTVIEW_MESSAGE.deleteOne_fail });
|
|
382
382
|
}
|
|
383
383
|
}, [appCloud, isModel, methodRefreshKeepPage]);
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
384
|
+
const { total, pageNo, pageSize: statePageSize } = getContextState();
|
|
385
|
+
// widget api
|
|
386
|
+
useImperativeHandle(ref, () => {
|
|
387
|
+
return {
|
|
388
|
+
// 当前页数据
|
|
389
|
+
records: dataRef.current.records,
|
|
390
|
+
// 当前总数
|
|
391
|
+
total,
|
|
392
|
+
pageNo,
|
|
393
|
+
pageSize: statePageSize,
|
|
394
|
+
// 组件方法
|
|
387
395
|
deleteOne: methodDeleteOne,
|
|
388
396
|
refresh: methodRefresh,
|
|
389
|
-
}
|
|
390
|
-
}
|
|
397
|
+
};
|
|
398
|
+
}, [
|
|
399
|
+
total,
|
|
400
|
+
pageNo,
|
|
401
|
+
statePageSize,
|
|
402
|
+
methodDeleteOne,
|
|
403
|
+
methodRefresh,
|
|
404
|
+
dataRef.current.records,
|
|
405
|
+
]);
|
|
391
406
|
/**
|
|
392
407
|
* 分页,加载更多
|
|
393
408
|
*/
|
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* @Date: 2023-04-12 16:43:55
|
|
4
|
+
* @LastEditTime: 2023-05-04 12:09:27
|
|
5
|
+
* @Description:
|
|
6
|
+
*/
|
|
7
|
+
import * as React from 'react';
|
|
2
8
|
import Button from '../../components/button';
|
|
3
9
|
import { Bubble, ConfigProvider } from 'tea-component';
|
|
4
|
-
|
|
10
|
+
// @ts-ignore忽略ts交验
|
|
11
|
+
// eslint-disable-next-line rulesdir/no-phantom-deps,import/no-unresolved
|
|
12
|
+
import { autorun } from 'mobx';
|
|
13
|
+
const Phone = (props) => {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
const [editorPlatforms, setEditorPlatforms] = React.useState([]);
|
|
16
|
+
const dispose = React.useMemo(() => {
|
|
17
|
+
return autorun(() => {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
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);
|
|
20
|
+
});
|
|
21
|
+
}, []);
|
|
22
|
+
React.useEffect(() => {
|
|
23
|
+
return () => {
|
|
24
|
+
dispose();
|
|
25
|
+
};
|
|
26
|
+
}, [dispose]);
|
|
27
|
+
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) ||
|
|
28
|
+
(editorPlatforms === null || editorPlatforms === void 0 ? void 0 : editorPlatforms.includes('MP')) ? (_jsx(Bubble, { content: "\u8BE5\u7EC4\u4EF6\u5FC5\u987B\u5728\u5C0F\u7A0B\u5E8F\u771F\u5B9E\u73AF\u5883\u4F7F\u7528\u624D\u80FD\u591F\u770B\u5230\u5B9E\u9645\u6548\u679C, \u5E76\u4E14\u5C0F\u7A0B\u5E8F\u5FC5\u987B\u4E3A\u4F01\u4E1A\u4E3B\u4F53\u3002", children: _jsx(Button, { ...props }) })) : null }));
|
|
29
|
+
};
|
|
5
30
|
export default Phone;
|
|
@@ -2,5 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import Button from '../../components/button';
|
|
3
3
|
import { Bubble, ConfigProvider } from 'tea-component';
|
|
4
4
|
// export type PhoneCodeProps =
|
|
5
|
-
const PhoneCode = (props) =>
|
|
5
|
+
const PhoneCode = (props) => {
|
|
6
|
+
return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsx(Bubble, { content: "\u8BE5\u7EC4\u4EF6\u5FC5\u987B\u5728\u5C0F\u7A0B\u5E8F\u771F\u5B9E\u73AF\u5883\u4F7F\u7528\u624D\u80FD\u591F\u770B\u5230\u5B9E\u9645\u6548\u679C, \u5E76\u4E14\u5C0F\u7A0B\u5E8F\u5FC5\u987B\u4E3A\u4F01\u4E1A\u4E3B\u4F53\u3002", children: _jsx(Button, { ...props }) }) }));
|
|
7
|
+
};
|
|
6
8
|
export default PhoneCode;
|
|
@@ -1,112 +1,115 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
margin-bottom: 20px;
|
|
1
|
+
.weda-richtext-toolbar {
|
|
2
|
+
position: sticky;
|
|
3
|
+
z-index: 2;
|
|
4
|
+
border-bottom: 1px solid #d1d1d1;
|
|
6
5
|
}
|
|
7
6
|
|
|
8
|
-
.
|
|
9
|
-
|
|
7
|
+
.weda-richtext-toolbar .exeditor-toolbar {
|
|
8
|
+
padding: 5px;
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
exeditor-toolbar-fold,
|
|
12
|
+
exeditor-toolbar-button,
|
|
13
|
+
exeditor-toolbar-select {
|
|
14
|
+
--button-width: 26px;
|
|
15
|
+
--button-height: 26px;
|
|
16
|
+
font-size: 13px !important;
|
|
14
17
|
}
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
exeditor-toolbar-select > span > span {
|
|
20
|
+
font-size: 12px !important;
|
|
18
21
|
}
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
exeditor-toolbar-option,
|
|
24
|
+
exeditor-color-palette,
|
|
25
|
+
exeditor-toolbar-table-panel {
|
|
26
|
+
padding: 4px 10px !important;
|
|
27
|
+
font-size: 12px !important;
|
|
23
28
|
}
|
|
24
29
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
margin: 5PX 0PX 5PX 0PX !important;
|
|
30
|
+
.weda-richtext-editor {
|
|
31
|
+
position: relative;
|
|
28
32
|
}
|
|
29
33
|
|
|
30
|
-
.weda-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
.weda-richText .bf-controlbar .control-item[data-alignment='center'],
|
|
34
|
-
.weda-richText .bf-controlbar .control-item[data-alignment='right'],
|
|
35
|
-
.weda-richText .bf-controlbar .control-item[data-alignment='justify'],
|
|
36
|
-
.weda-richText .bf-controlbar .control-item.link-editor-dropdown,
|
|
37
|
-
.weda-richText .bf-controlbar .control-item[data-title='清除链接'] {
|
|
38
|
-
margin-top: 0 !important;
|
|
34
|
+
.weda-richtext-editor .tableWrapper {
|
|
35
|
+
display: flex;
|
|
36
|
+
justify-content: center;
|
|
39
37
|
}
|
|
40
38
|
|
|
41
|
-
.weda-
|
|
42
|
-
|
|
39
|
+
.weda-richtext-editor .tableWrapper table th {
|
|
40
|
+
background-color: #f5f7fa;
|
|
41
|
+
border: 1px solid #e1e6f0;
|
|
43
42
|
}
|
|
44
43
|
|
|
45
|
-
.weda-
|
|
46
|
-
|
|
44
|
+
.weda-richtext-editor .tableWrapper table td {
|
|
45
|
+
border: 1px solid #e1e6f0;
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
height: 26PX !important;
|
|
48
|
+
.weda-richtext-editor i {
|
|
49
|
+
font-style: italic;
|
|
52
50
|
}
|
|
53
51
|
|
|
54
|
-
.
|
|
55
|
-
|
|
52
|
+
.ExEditor-basic {
|
|
53
|
+
height: 100%;
|
|
54
|
+
overflow-y: auto;
|
|
55
|
+
padding-top: 30px;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
.
|
|
59
|
-
|
|
58
|
+
.ExEditor-basic p,
|
|
59
|
+
.ExEditor-basic pre {
|
|
60
|
+
margin-top: 0px !important;
|
|
61
|
+
margin-bottom: 0px !important;
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
.
|
|
63
|
-
|
|
64
|
+
.ExEditor-basic ol,
|
|
65
|
+
.ExEditor-basic ul {
|
|
66
|
+
padding-inline-start: 32px;
|
|
67
|
+
padding-left: 32px;
|
|
64
68
|
}
|
|
65
69
|
|
|
66
|
-
.weda-
|
|
67
|
-
|
|
70
|
+
.weda-richtext-container {
|
|
71
|
+
z-index: 2 !important;
|
|
72
|
+
height: 100%;
|
|
68
73
|
}
|
|
69
74
|
|
|
70
|
-
.weda-
|
|
71
|
-
|
|
75
|
+
.weda-richtext-container.ex-fullscreen {
|
|
76
|
+
z-index: 1001 !important;
|
|
72
77
|
}
|
|
73
78
|
|
|
74
|
-
.weda-richText
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
font-size: 1em;
|
|
79
|
+
.weda-richText .weda-formcells__content.weui-flex__item {
|
|
80
|
+
padding-top: 17px;
|
|
81
|
+
padding-bottom: 17px;
|
|
82
|
+
margin-top: 0px !important;
|
|
83
|
+
margin-bottom: 0px !important;
|
|
80
84
|
}
|
|
81
85
|
|
|
82
|
-
.weda-richText
|
|
83
|
-
|
|
86
|
+
.weda-richText .weui-cell_active:active {
|
|
87
|
+
background-color: unset !important;
|
|
84
88
|
}
|
|
85
89
|
|
|
86
|
-
.weda-richText
|
|
87
|
-
|
|
90
|
+
.weda-richText {
|
|
91
|
+
width: 100%;
|
|
88
92
|
}
|
|
89
93
|
|
|
90
|
-
.weda-richText .
|
|
91
|
-
|
|
92
|
-
|
|
94
|
+
.weda-richText .weda-formcells__content .weui-cell_form {
|
|
95
|
+
padding-top: 0;
|
|
96
|
+
height: 100%;
|
|
93
97
|
}
|
|
94
98
|
|
|
95
|
-
.weda-richText .
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
background: transparent;
|
|
99
|
+
.weda-richText .weui-cells_forms {
|
|
100
|
+
height: 100%;
|
|
101
|
+
overflow: unset;
|
|
99
102
|
}
|
|
100
103
|
|
|
101
|
-
.weda-richText
|
|
102
|
-
|
|
103
|
-
margin-bottom: 16px;
|
|
104
|
+
.weda-richText > div {
|
|
105
|
+
height: inherit;
|
|
104
106
|
}
|
|
105
107
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
exeditor-link-modal {
|
|
109
|
+
z-index: 1005;
|
|
110
|
+
position: relative;
|
|
108
111
|
}
|
|
109
112
|
|
|
110
|
-
.
|
|
111
|
-
|
|
113
|
+
.exeditor-toolbar {
|
|
114
|
+
z-index: 1005 !important;
|
|
112
115
|
}
|