zmdms-webui 2.7.3 → 2.7.4
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/es/_virtual/localforage.js +3 -0
- package/dist/es/applayoutheader/setting/userInfoModal.js +6 -6
- package/dist/es/applayoutheader/setting/userPwdModal.js +4 -4
- package/dist/es/applayoutsider/menu/SearchInput.js +2 -2
- package/dist/es/button/button.js +1 -0
- package/dist/es/button/buttonDownload.js +1 -0
- package/dist/es/button/buttonPreview.js +1 -0
- package/dist/es/button/index.css +1 -1
- package/dist/es/chatroom/chat-room.js +2 -2
- package/dist/es/config/MyStorage.js +91 -0
- package/dist/es/config/ZtxkContext.d.ts +4 -0
- package/dist/es/config/ZtxkContext.js +4 -0
- package/dist/es/config/index.js +1 -0
- package/dist/es/electronsignatures/filecomponents/file-upload.js +1 -0
- package/dist/es/electronsignatures/index.js +1 -0
- package/dist/es/electronsignatures/qunjcomponents/code-modal.js +4 -4
- package/dist/es/enhanceselect/list-query.js +1 -0
- package/dist/es/enhanceselect/page-query.js +1 -0
- package/dist/es/form/common-search-list.js +58 -0
- package/dist/es/form/form.d.ts +1 -0
- package/dist/es/form/form.js +27 -10
- package/dist/es/form/hooks.js +3 -2
- package/dist/es/form/index.css +1 -1
- package/dist/es/form/interface.d.ts +4 -0
- package/dist/es/form/useCommonSearch.js +309 -0
- package/dist/es/formitem/formItem.d.ts +10 -1
- package/dist/es/formitem/formItem.js +19 -5
- package/dist/es/input/index.js +2 -2
- package/dist/es/input/input.js +9 -8
- package/dist/es/login/forget-password.js +6 -6
- package/dist/es/login/index.js +4 -4
- package/dist/es/node_modules/@ant-design/icons/es/icons/DeleteOutlined.js +18 -0
- package/dist/es/node_modules/@ant-design/icons-svg/es/asn/DeleteOutlined.js +5 -0
- package/dist/es/node_modules/localforage/dist/localforage.js +2824 -0
- package/dist/es/sortable/sortable-item.d.ts +1 -0
- package/dist/es/sortable/sortable-item.js +9 -1
- package/dist/es/table/components/EnhanceBodyCell.js +4 -3
- package/dist/es/table/components/FilterDropdown.js +2 -2
- package/dist/es/table/hooks.js +2 -2
- package/dist/es/tree/tree.js +2 -2
- package/dist/es/uploadlist/uploadList.js +1 -0
- package/dist/es/zttransfer/SelectContainer.js +2 -2
- package/dist/index.dark.css +1 -1
- package/dist/index.default.css +1 -1
- package/dist/less/components/Button/style/index.less +5 -0
- package/dist/less/components/Form/style/index.less +45 -5
- package/package.json +3 -2
package/dist/es/form/form.d.ts
CHANGED
package/dist/es/form/form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __awaiter, __rest, __assign, __generator } from '../_virtual/_tslib.js';
|
|
2
|
-
import {
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { createContext, memo, forwardRef, useMemo, useCallback, useRef, useImperativeHandle } from 'react';
|
|
4
4
|
import { Form as Form$1 } from 'antd';
|
|
5
5
|
import classNames from '../node_modules/classnames/index.js';
|
|
@@ -9,6 +9,11 @@ import ResetButton from './resetButton.js';
|
|
|
9
9
|
import DefaultDom from './detaultDom.js';
|
|
10
10
|
import ItemTipDom from './itemTipDom.js';
|
|
11
11
|
import Toggle from './toggle.js';
|
|
12
|
+
import '../config/ZtxkContext.js';
|
|
13
|
+
import useBaseContext from '../config/useBaseContext.js';
|
|
14
|
+
import '../config/MyStorage.js';
|
|
15
|
+
import CommonSearchList from './common-search-list.js';
|
|
16
|
+
import { COMMON_SEARCH_KEY, useCommonSearch, useCommonSearchModal } from './useCommonSearch.js';
|
|
12
17
|
import DynamicSetting from '../dynamicsetting/dynamicSetting.js';
|
|
13
18
|
import ButtonCom from '../button/button.js';
|
|
14
19
|
|
|
@@ -22,15 +27,26 @@ var FormContext = createContext({});
|
|
|
22
27
|
// 用户配置优先,先从远端获取到 表单配置信息。
|
|
23
28
|
// 给子元素设置好了表单配置信息后 接下来的内容 交给动态列配置接管
|
|
24
29
|
var Form = function (props, ref) {
|
|
25
|
-
var form = props.form, bottomBorder = props.bottomBorder, _a = props.isFlex, isFlex = _a === void 0 ? true : _a, wrapClassName = props.wrapClassName, leftClassName = props.leftClassName; props.itemClassName; var rightWrapVisible = props.rightWrapVisible, rightClassName = props.rightClassName, children = props.children, dynamicKey = props.dynamicKey, dynamicVersion = props.dynamicVersion, formPreferences = props.formPreferences, items = props.items, outsideState = props.outsideState, onValuesChange = props.onValuesChange, isResetAndClear = props.isResetAndClear, onResetHandle = props.onResetHandle, onSearchHandle = props.onSearchHandle, type = props.type, directionColumn = props.directionColumn, isToggle = props.isToggle, toggleNum = props.toggleNum, defaultToggle = props.defaultToggle, restProps = __rest(props, ["form", "bottomBorder", "isFlex", "wrapClassName", "leftClassName", "itemClassName", "rightWrapVisible", "rightClassName", "children", "dynamicKey", "dynamicVersion", "formPreferences", "items", "outsideState", "onValuesChange", "isResetAndClear", "onResetHandle", "onSearchHandle", "type", "directionColumn", "isToggle", "toggleNum", "defaultToggle"]);
|
|
30
|
+
var form = props.form, bottomBorder = props.bottomBorder, _a = props.isFlex, isFlex = _a === void 0 ? true : _a, wrapClassName = props.wrapClassName, leftClassName = props.leftClassName; props.itemClassName; var rightWrapVisible = props.rightWrapVisible, rightClassName = props.rightClassName, children = props.children, dynamicKey = props.dynamicKey, dynamicVersion = props.dynamicVersion, formPreferences = props.formPreferences, items = props.items, outsideState = props.outsideState, onValuesChange = props.onValuesChange, isResetAndClear = props.isResetAndClear, onResetHandle = props.onResetHandle, onSearchHandle = props.onSearchHandle, type = props.type, directionColumn = props.directionColumn, isToggle = props.isToggle, toggleNum = props.toggleNum, defaultToggle = props.defaultToggle, _b = props.isCommonSearch, isCommonSearch = _b === void 0 ? true : _b, restProps = __rest(props, ["form", "bottomBorder", "isFlex", "wrapClassName", "leftClassName", "itemClassName", "rightWrapVisible", "rightClassName", "children", "dynamicKey", "dynamicVersion", "formPreferences", "items", "outsideState", "onValuesChange", "isResetAndClear", "onResetHandle", "onSearchHandle", "type", "directionColumn", "isToggle", "toggleNum", "defaultToggle", "isCommonSearch"]);
|
|
31
|
+
var enableCommonSearch = useBaseContext().enableCommonSearch;
|
|
32
|
+
// 常用搜索hooks
|
|
33
|
+
var _c = useCommonSearch({
|
|
34
|
+
commonSearchKey: dynamicKey || window.location.pathname,
|
|
35
|
+
}), commonSearchList = _c.commonSearchList, setCommonSearchList = _c.setCommonSearchList, currentCommonSearchKey = _c.currentCommonSearchKey, setCurrentCommonSearchKey = _c.setCurrentCommonSearchKey, setData = _c.setData, deleteData = _c.deleteData, setReplaceData = _c.setReplaceData, reTransformData = _c.reTransformData, updateServerData = _c.updateServerData;
|
|
36
|
+
var onCommonSearchHandle = useCommonSearchModal({
|
|
37
|
+
commonSearchList: commonSearchList,
|
|
38
|
+
currentCommonSearchKey: currentCommonSearchKey,
|
|
39
|
+
form: form,
|
|
40
|
+
setData: setData,
|
|
41
|
+
}).onCommonSearchHandle;
|
|
26
42
|
// 获取新的items 如果传入了配置项的话,配置项优先
|
|
27
43
|
var configInfoItems = useFormPreferencesCreateNewItems(formPreferences, items).configInfoItems;
|
|
28
44
|
// 根据items 和 dynamicKey 获取到动态列配置信息
|
|
29
|
-
var
|
|
45
|
+
var _d = useDynamicListByItems(configInfoItems, {
|
|
30
46
|
dynamicKey: dynamicKey,
|
|
31
47
|
formPreferences: formPreferences,
|
|
32
48
|
dynamicVersion: dynamicVersion,
|
|
33
|
-
}), dynamicList =
|
|
49
|
+
}), dynamicList = _d.dynamicList, onCurrentListChange = _d.onCurrentListChange, newItems = _d.newItems, dynamicSettingRef = _d.dynamicSettingRef;
|
|
34
50
|
// 主容器类名
|
|
35
51
|
var wrapClasses = classNames("ztxk-form", wrapClassName, {
|
|
36
52
|
"ztxk-form--bottom-border": bottomBorder,
|
|
@@ -102,22 +118,22 @@ var Form = function (props, ref) {
|
|
|
102
118
|
}
|
|
103
119
|
onValuesChange && onValuesChange(changedValues, allValues);
|
|
104
120
|
}, [onValuesChange, itemsShouldUpdate, form]);
|
|
105
|
-
var
|
|
121
|
+
var _e = useBtnHandle(form, {
|
|
106
122
|
onSearchHandle: onSearchHandle,
|
|
107
123
|
onResetHandle: onResetHandle,
|
|
108
|
-
}), onSearchHandleInner =
|
|
124
|
+
}), onSearchHandleInner = _e.onSearchHandleInner, onResetHandleInner = _e.onResetHandleInner, onDropdownResetHandleInner = _e.onDropdownResetHandleInner;
|
|
109
125
|
var leftWrapRef = useRef(null);
|
|
110
|
-
var
|
|
126
|
+
var _f = useToggle(leftWrapRef, {
|
|
111
127
|
isToggle: isToggle,
|
|
112
128
|
toggleNum: toggleNum,
|
|
113
129
|
defaultToggle: defaultToggle,
|
|
114
|
-
}), toggle =
|
|
130
|
+
}), toggle = _f.toggle, onToggleChange = _f.onToggleChange, setToggleHandle = _f.setToggleHandle;
|
|
115
131
|
useImperativeHandle(ref, function () {
|
|
116
132
|
return {
|
|
117
133
|
setToggleHandle: setToggleHandle,
|
|
118
134
|
};
|
|
119
135
|
});
|
|
120
|
-
return (
|
|
136
|
+
return (jsxs(FormContext.Provider, __assign({ value: { onSearch: onSearchHandleInner } }, { children: [jsxs(Form$1, __assign({ form: form, onValuesChange: onValuesChangeHandle }, restProps, { className: wrapClasses }, { children: [jsx("div", __assign({ className: leftClasses, ref: leftWrapRef }, { children: items ? (jsx(FormItems, { items: dynamicKey ? newItems : configInfoItems, outsideState: outsideState })) : (children) })), jsxs("div", __assign({ className: "ztxk-form--operation" }, { children: [dynamicKey ? (jsx(DynamicSetting, { dynamicKey: dynamicKey, parentDynamicKey: FORM_DYNAMIC_KEY, defaultList: dynamicList, onCurrentListChange: onCurrentListChange, ref: dynamicSettingRef })) : null, isToggle ? (jsx(Toggle, { toggle: toggle, onClick: onToggleChange })) : null] })), rightWrapVisible ? (jsxs("div", __assign({ className: rightClasses }, { children: [jsxs("div", __assign({ className: "ztxk-form__right--common-left" }, { children: [isResetAndClear ? (jsx(ResetButton, { onClick: onDropdownResetHandleInner })) : (jsx(ButtonCom, __assign({ type: "default", onClick: onResetHandleInner }, { children: "\u91CD\u7F6E" }))), jsx(ButtonCom, __assign({ type: "primary", onClick: onSearchHandleInner }, { children: "\u67E5\u8BE2" }))] })), enableCommonSearch && isCommonSearch ? (jsx("div", __assign({ className: "ztxk-form__right--common-right" }, { children: jsx(ButtonCom, __assign({ style: { width: "100%" }, onClick: onCommonSearchHandle }, { children: currentCommonSearchKey ? "更新常用搜索" : "保存为常用搜索" })) }))) : null] }))) : null] })), enableCommonSearch && isCommonSearch && rightWrapVisible ? (jsx(CommonSearchList, { commonSearchList: commonSearchList, setCommonSearchList: setCommonSearchList, currentCommonSearchKey: currentCommonSearchKey, setCurrentCommonSearchKey: setCurrentCommonSearchKey, form: form, reTransformData: reTransformData, deleteData: deleteData, setReplaceData: setReplaceData, updateServerData: updateServerData, onSearchHandle: onSearchHandleInner })) : null] })));
|
|
121
137
|
};
|
|
122
138
|
var MemoForm = memo(forwardRef(Form));
|
|
123
139
|
MemoForm.displayName = "ZTXK_WEBUI_Form";
|
|
@@ -150,6 +166,7 @@ MemoForm.Provider = Form$1.Provider;
|
|
|
150
166
|
MemoForm.useFormInstance = Form$1.useFormInstance;
|
|
151
167
|
MemoForm.useWatch = Form$1.useWatch;
|
|
152
168
|
MemoForm.DefaultDom = DefaultDom;
|
|
153
|
-
MemoForm.ItemTipDom = ItemTipDom;
|
|
169
|
+
MemoForm.ItemTipDom = ItemTipDom;
|
|
170
|
+
MemoForm.CommonSearchKey = COMMON_SEARCH_KEY;
|
|
154
171
|
|
|
155
172
|
export { FORM_DYNAMIC_KEY, FormContext, MemoForm as default };
|
package/dist/es/form/hooks.js
CHANGED
|
@@ -29,13 +29,14 @@ function useDynamicListByItems(items, options) {
|
|
|
29
29
|
var result = [];
|
|
30
30
|
if (dynamicKey && items) {
|
|
31
31
|
result = items.map(function (item, index) {
|
|
32
|
-
var name = item.name, configName = item.configName, key = item.key, label = item.label, dynamicDisabled = item.dynamicDisabled, isDisplay = item.isDisplay;
|
|
32
|
+
var name = item.name, configName = item.configName, key = item.key, label = item.label, labelString = item.labelString, dynamicDisabled = item.dynamicDisabled, isDisplay = item.isDisplay;
|
|
33
|
+
var newLabel = labelString || (typeof label === "function" ? label() : label);
|
|
33
34
|
return {
|
|
34
35
|
key: configName ||
|
|
35
36
|
name ||
|
|
36
37
|
key ||
|
|
37
38
|
"".concat(Date.now(), "-").concat(index),
|
|
38
|
-
label:
|
|
39
|
+
label: newLabel,
|
|
39
40
|
disabled: dynamicDisabled === true ? true : false,
|
|
40
41
|
// 如果用户传入了 isDisplay
|
|
41
42
|
// 如果缓存中有值,还是以缓存为主
|
package/dist/es/form/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ant-form-item .ant-input-number+.ant-form-text{margin-left:8px}.ant-form-inline{display:flex;flex-wrap:wrap}.ant-form-inline .ant-form-item{flex:none;flex-wrap:nowrap;margin-bottom:0;margin-right:16px}.ant-form-inline .ant-form-item-with-help{margin-bottom:24px}.ant-form-inline .ant-form-item>.ant-form-item-control,.ant-form-inline .ant-form-item>.ant-form-item-label{display:inline-block;vertical-align:top}.ant-form-inline .ant-form-item>.ant-form-item-label{flex:none}.ant-form-inline .ant-form-item .ant-form-item-has-feedback,.ant-form-inline .ant-form-item .ant-form-text{display:inline-block}.ant-form-horizontal .ant-form-item-label{flex-grow:0}.ant-form-horizontal .ant-form-item-control{flex:1 1 0;min-width:0}.ant-form-horizontal .ant-form-item-label[class$="-24"]+.ant-form-item-control,.ant-form-horizontal .ant-form-item-label[class*="-24 "]+.ant-form-item-control{min-width:unset}.ant-form-vertical .ant-form-item-row{flex-direction:column}.ant-form-vertical .ant-form-item-label>label{height:auto}.ant-form-vertical .ant-form-item .ant-form-item-control{width:100%}.ant-col-24.ant-form-item-label,.ant-col-xl-24.ant-form-item-label,.ant-form-vertical .ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-24.ant-form-item-label>label,.ant-col-xl-24.ant-form-item-label>label,.ant-form-vertical .ant-form-item-label>label{margin:0}.ant-col-24.ant-form-item-label>label:after,.ant-col-xl-24.ant-form-item-label>label:after,.ant-form-vertical .ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-24.ant-form-item-label,.ant-form-rtl.ant-col-xl-24.ant-form-item-label,.ant-form-rtl.ant-form-vertical .ant-form-item-label{text-align:right}@media (max-width:575px){.ant-form-item .ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-form-item .ant-form-item-label>label{margin:0}.ant-form-item .ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-form-item .ant-form-item-label{text-align:right}.ant-form .ant-form-item{flex-wrap:wrap}.ant-form .ant-form-item .ant-form-item-control,.ant-form .ant-form-item .ant-form-item-label{flex:0 0 100%;max-width:100%}.ant-col-xs-24.ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-xs-24.ant-form-item-label>label{margin:0}.ant-col-xs-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-xs-24.ant-form-item-label{text-align:right}}@media (max-width:767px){.ant-col-sm-24.ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-sm-24.ant-form-item-label>label{margin:0}.ant-col-sm-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-sm-24.ant-form-item-label{text-align:right}}@media (max-width:991px){.ant-col-md-24.ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-md-24.ant-form-item-label>label{margin:0}.ant-col-md-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-md-24.ant-form-item-label{text-align:right}}@media (max-width:1199px){.ant-col-lg-24.ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-lg-24.ant-form-item-label>label{margin:0}.ant-col-lg-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-lg-24.ant-form-item-label{text-align:right}}@media (max-width:1599px){.ant-col-xl-24.ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-xl-24.ant-form-item-label>label{margin:0}.ant-col-xl-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-xl-24.ant-form-item-label{text-align:right}}.ant-form-item-explain-error{color:#ff4d4f}.ant-form-item-explain-warning{color:#faad14}.ant-form-item-has-feedback .ant-switch{margin:2px 0 4px}.ant-form-item-has-warning .ant-form-item-split{color:#faad14}.ant-form-item-has-error .ant-form-item-split{color:#ff4d4f}.ant-form{font-feature-settings:"tnum";box-sizing:border-box;color:#000000a6;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-form legend{border:0;border-bottom:1px solid #d9d9d9;color:#00000073;display:block;font-size:16px;line-height:inherit;margin-bottom:20px;padding:0;width:100%}.ant-form label{font-size:14px}.ant-form input[type=search]{box-sizing:border-box}.ant-form input[type=checkbox],.ant-form input[type=radio]{line-height:normal}.ant-form input[type=file]{display:block}.ant-form input[type=range]{display:block;width:100%}.ant-form select[multiple],.ant-form select[size]{height:auto}.ant-form input[type=checkbox]:focus,.ant-form input[type=file]:focus,.ant-form input[type=radio]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.ant-form output{color:#000000a6;display:block;font-size:14px;line-height:1.5715;padding-top:15px}.ant-form .ant-form-text{display:inline-block;padding-right:8px}.ant-form-small .ant-form-item-label>label{height:24px}.ant-form-small .ant-form-item-control-input{min-height:24px}.ant-form-large .ant-form-item-label>label{height:40px}.ant-form-large .ant-form-item-control-input{min-height:40px}.ant-form-item{font-feature-settings:"tnum";box-sizing:border-box;color:#000000a6;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0 0 24px;padding:0;vertical-align:top}.ant-form-item-with-help{transition:none}.ant-form-item-hidden,.ant-form-item-hidden.ant-row{display:none}.ant-form-item-label{display:inline-block;flex-grow:0;overflow:hidden;text-align:right;vertical-align:middle;white-space:nowrap}.ant-form-item-label-left{text-align:left}.ant-form-item-label-wrap{line-height:1.3215em;overflow:unset;white-space:unset}.ant-form-item-label>label{align-items:center;color:#000000d9;display:inline-flex;font-size:14px;height:32px;max-width:100%;position:relative}.ant-form-item-label>label>.anticon{font-size:14px;vertical-align:top}.ant-form-item-label>label.ant-form-item-required:not(.ant-form-item-required-mark-optional):before{color:#ff4d4f;content:"*";display:inline-block;font-family:SimSun,sans-serif;font-size:14px;line-height:1;margin-right:4px}.ant-form-hide-required-mark .ant-form-item-label>label.ant-form-item-required:not(.ant-form-item-required-mark-optional):before{display:none}.ant-form-item-label>label .ant-form-item-optional{color:#00000073;display:inline-block;margin-left:4px}.ant-form-hide-required-mark .ant-form-item-label>label .ant-form-item-optional{display:none}.ant-form-item-label>label .ant-form-item-tooltip{color:#00000073;cursor:help;margin-inline-start:4px;writing-mode:horizontal-tb}.ant-form-item-label>label:after{content:":";margin:0 8px 0 2px;position:relative;top:-.5px}.ant-form-item-label>label.ant-form-item-no-colon:after{content:" "}.ant-form-item-control{display:flex;flex-direction:column;flex-grow:1}.ant-form-item-control:first-child:not([class^=ant-col-]):not([class*=" ant-col-"]){width:100%}.ant-form-item-control-input{align-items:center;display:flex;min-height:32px;position:relative}.ant-form-item-control-input-content{flex:auto;max-width:100%}.ant-form-item-explain,.ant-form-item-extra{clear:both;color:#00000073;font-size:14px;line-height:1.5715;transition:color .3s cubic-bezier(.215,.61,.355,1)}.ant-form-item-explain-connected{width:100%}.ant-form-item-extra{min-height:24px}.ant-form-item-with-help .ant-form-item-explain{height:auto;opacity:1}.ant-form-item-feedback-icon{animation:zoomIn .3s cubic-bezier(.12,.4,.29,1.46);font-size:14px;pointer-events:none;text-align:center;visibility:visible}.ant-form-item-feedback-icon-success{color:#52c41a}.ant-form-item-feedback-icon-error{color:#ff4d4f}.ant-form-item-feedback-icon-warning{color:#faad14}.ant-form-item-feedback-icon-validating{color:#5b76f6}.ant-show-help{transition:opacity .3s cubic-bezier(.645,.045,.355,1)}.ant-show-help-appear,.ant-show-help-enter{opacity:0}.ant-show-help-appear-active,.ant-show-help-enter-active,.ant-show-help-leave{opacity:1}.ant-show-help-leave-active{opacity:0}.ant-show-help-item{overflow:hidden;transition:height .3s cubic-bezier(.645,.045,.355,1),opacity .3s cubic-bezier(.645,.045,.355,1),transform .3s cubic-bezier(.645,.045,.355,1)!important}.ant-show-help-item-appear,.ant-show-help-item-enter{opacity:0;transform:translateY(-5px)}.ant-show-help-item-appear-active,.ant-show-help-item-enter-active{opacity:1;transform:translateY(0)}.ant-show-help-item-leave{transition:height .2s cubic-bezier(.645,.045,.355,1),opacity .2s cubic-bezier(.645,.045,.355,1),transform .2s cubic-bezier(.645,.045,.355,1)!important}.ant-show-help-item-leave-active{transform:translateY(-5px)}@keyframes diffZoomIn1{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes diffZoomIn2{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes diffZoomIn3{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}.ant-form-rtl{direction:rtl}.ant-form-rtl .ant-form-item-label{text-align:left}.ant-form-rtl .ant-form-item-label>label.ant-form-item-required:before{margin-left:4px;margin-right:0}.ant-form-rtl .ant-form-item-label>label:after{margin:0 2px 0 8px}.ant-form-rtl .ant-form-item-label>label .ant-form-item-optional{margin-left:0;margin-right:4px}.ant-col-rtl .ant-form-item-control:first-child{width:100%}.ant-form-rtl .ant-form-item-has-feedback .ant-input{padding-left:24px;padding-right:11px}.ant-form-rtl .ant-form-item-has-feedback .ant-input-affix-wrapper .ant-input-suffix{padding-left:18px;padding-right:11px}.ant-form-rtl .ant-form-item-has-feedback .ant-input-affix-wrapper .ant-input,.ant-form-rtl .ant-form-item-has-feedback .ant-input-number-affix-wrapper .ant-input-number{padding:0}.ant-form-rtl .ant-form-item-has-feedback .ant-input-search:not(.ant-input-search-enter-button) .ant-input-suffix{left:28px;right:auto}.ant-form-rtl .ant-form-item-has-feedback .ant-input-number{padding-left:18px}.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-arrow,.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-clear,.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-number-group-addon)>.ant-select .ant-select-arrow,.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-number-group-addon)>.ant-select .ant-select-clear,.ant-form-rtl .ant-form-item-has-feedback>.ant-select .ant-select-arrow,.ant-form-rtl .ant-form-item-has-feedback>.ant-select .ant-select-clear{left:32px;right:auto}.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-selection-selected-value,.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-number-group-addon)>.ant-select .ant-select-selection-selected-value,.ant-form-rtl .ant-form-item-has-feedback>.ant-select .ant-select-selection-selected-value{padding-left:42px;padding-right:0}.ant-form-rtl .ant-form-item-has-feedback .ant-cascader-picker-arrow{margin-left:19px;margin-right:0}.ant-form-rtl .ant-form-item-has-feedback .ant-cascader-picker-clear{left:32px;right:auto}.ant-form-rtl .ant-form-item-has-feedback .ant-picker,.ant-form-rtl .ant-form-item-has-feedback .ant-picker-large{padding-left:29.2px;padding-right:11px}.ant-form-rtl .ant-form-item-has-feedback .ant-picker-small{padding-left:25.2px;padding-right:7px}.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-has-error .ant-form-item-children-icon,.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-has-success .ant-form-item-children-icon,.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-has-warning .ant-form-item-children-icon,.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-is-validating .ant-form-item-children-icon{left:0;right:auto}.ant-form-rtl.ant-form-inline .ant-form-item{margin-left:16px;margin-right:0}.ztxk-form{background:#fff;display:flex;justify-content:space-between;padding:0}.ztxk-form .ztxk-form--detault-dom{border:1px solid #d9d9d9;border-left:none;border-radius:0 4px 4px 0}.ztxk-form .ztxk-form--detault-dom,.ztxk-form .ztxk-form--tip-dom{align-items:center;display:flex;min-height:32px;padding:4px 11px;transition:all .3s}.ztxk-form .ztxk-form--tip-dom{border-radius:0 4px 4px 0}.ztxk-form.ztxk-form--bottom-border{border-bottom:1px solid #ebf3fe}.ztxk-form .ztxk-form__left{flex:1;position:relative;transition:max-height .3s ease-out}.ztxk-form .ztxk-form__left.ztxk-form__left--toggle{overflow:hidden}.ztxk-form .ztxk-form__left.ztxk-form__left--flex{display:flex;flex-grow:1;flex-wrap:wrap}.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error .ant-checkbox-group,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error .ant-form-item-label,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error .ant-form-item-label label,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error .ant-input,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error .ant-input-affix-wrapper,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error .ant-picker,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error .ant-radio-group,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error .ant-select-selector,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error .city-picker-span,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error.ztxk-form__item--direction-column,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error:hover .ant-form-item-label,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error:hover .ant-form-item-label label,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error:hover .ant-input,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error:hover .ant-input-affix-wrapper,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error:hover .ant-picker,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error:hover .ant-select-selector,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error:hover .city-picker-span,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error:hover .ztxk-form--detault-dom{border-color:#f88!important}.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error .ant-form-item-margin-offset{margin-bottom:0!important}.ztxk-form .ztxk-form__left.ztxk-form__left--flex-direction{flex-direction:column}.ztxk-form .ztxk-form__left.ztxk-form__left--flex-direction>div{flex:none}.ztxk-form .ztxk-form--operation{align-items:center;display:flex;flex-direction:column;margin-right:10px}.ztxk-form .ztxk-form--operation .ztxk-dynamic-setting{cursor:pointer;margin-top:6px;position:relative}.ztxk-form .ztxk-form--operation .ztxk-from--toggle{cursor:pointer;margin-top:4px}.ztxk-form .ztxk-form--operation .ztxk-from--toggle>span{transition:transform .4s ease 0s}.ztxk-form .ztxk-form__right{display:flex}.ztxk-form .ztxk-form__right>button.ant-btn{margin-left:10px;margin-right:0}.ztxk-form .ztxk-form__right>button.ant-btn:first-child{margin-left:0}
|
|
1
|
+
.ant-form-item .ant-input-number+.ant-form-text{margin-left:8px}.ant-form-inline{display:flex;flex-wrap:wrap}.ant-form-inline .ant-form-item{flex:none;flex-wrap:nowrap;margin-bottom:0;margin-right:16px}.ant-form-inline .ant-form-item-with-help{margin-bottom:24px}.ant-form-inline .ant-form-item>.ant-form-item-control,.ant-form-inline .ant-form-item>.ant-form-item-label{display:inline-block;vertical-align:top}.ant-form-inline .ant-form-item>.ant-form-item-label{flex:none}.ant-form-inline .ant-form-item .ant-form-item-has-feedback,.ant-form-inline .ant-form-item .ant-form-text{display:inline-block}.ant-form-horizontal .ant-form-item-label{flex-grow:0}.ant-form-horizontal .ant-form-item-control{flex:1 1 0;min-width:0}.ant-form-horizontal .ant-form-item-label[class$="-24"]+.ant-form-item-control,.ant-form-horizontal .ant-form-item-label[class*="-24 "]+.ant-form-item-control{min-width:unset}.ant-form-vertical .ant-form-item-row{flex-direction:column}.ant-form-vertical .ant-form-item-label>label{height:auto}.ant-form-vertical .ant-form-item .ant-form-item-control{width:100%}.ant-col-24.ant-form-item-label,.ant-col-xl-24.ant-form-item-label,.ant-form-vertical .ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-24.ant-form-item-label>label,.ant-col-xl-24.ant-form-item-label>label,.ant-form-vertical .ant-form-item-label>label{margin:0}.ant-col-24.ant-form-item-label>label:after,.ant-col-xl-24.ant-form-item-label>label:after,.ant-form-vertical .ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-24.ant-form-item-label,.ant-form-rtl.ant-col-xl-24.ant-form-item-label,.ant-form-rtl.ant-form-vertical .ant-form-item-label{text-align:right}@media (max-width:575px){.ant-form-item .ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-form-item .ant-form-item-label>label{margin:0}.ant-form-item .ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-form-item .ant-form-item-label{text-align:right}.ant-form .ant-form-item{flex-wrap:wrap}.ant-form .ant-form-item .ant-form-item-control,.ant-form .ant-form-item .ant-form-item-label{flex:0 0 100%;max-width:100%}.ant-col-xs-24.ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-xs-24.ant-form-item-label>label{margin:0}.ant-col-xs-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-xs-24.ant-form-item-label{text-align:right}}@media (max-width:767px){.ant-col-sm-24.ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-sm-24.ant-form-item-label>label{margin:0}.ant-col-sm-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-sm-24.ant-form-item-label{text-align:right}}@media (max-width:991px){.ant-col-md-24.ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-md-24.ant-form-item-label>label{margin:0}.ant-col-md-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-md-24.ant-form-item-label{text-align:right}}@media (max-width:1199px){.ant-col-lg-24.ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-lg-24.ant-form-item-label>label{margin:0}.ant-col-lg-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-lg-24.ant-form-item-label{text-align:right}}@media (max-width:1599px){.ant-col-xl-24.ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-xl-24.ant-form-item-label>label{margin:0}.ant-col-xl-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-xl-24.ant-form-item-label{text-align:right}}.ant-form-item-explain-error{color:#ff4d4f}.ant-form-item-explain-warning{color:#faad14}.ant-form-item-has-feedback .ant-switch{margin:2px 0 4px}.ant-form-item-has-warning .ant-form-item-split{color:#faad14}.ant-form-item-has-error .ant-form-item-split{color:#ff4d4f}.ant-form{font-feature-settings:"tnum";box-sizing:border-box;color:#000000a6;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-form legend{border:0;border-bottom:1px solid #d9d9d9;color:#00000073;display:block;font-size:16px;line-height:inherit;margin-bottom:20px;padding:0;width:100%}.ant-form label{font-size:14px}.ant-form input[type=search]{box-sizing:border-box}.ant-form input[type=checkbox],.ant-form input[type=radio]{line-height:normal}.ant-form input[type=file]{display:block}.ant-form input[type=range]{display:block;width:100%}.ant-form select[multiple],.ant-form select[size]{height:auto}.ant-form input[type=checkbox]:focus,.ant-form input[type=file]:focus,.ant-form input[type=radio]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.ant-form output{color:#000000a6;display:block;font-size:14px;line-height:1.5715;padding-top:15px}.ant-form .ant-form-text{display:inline-block;padding-right:8px}.ant-form-small .ant-form-item-label>label{height:24px}.ant-form-small .ant-form-item-control-input{min-height:24px}.ant-form-large .ant-form-item-label>label{height:40px}.ant-form-large .ant-form-item-control-input{min-height:40px}.ant-form-item{font-feature-settings:"tnum";box-sizing:border-box;color:#000000a6;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0 0 24px;padding:0;vertical-align:top}.ant-form-item-with-help{transition:none}.ant-form-item-hidden,.ant-form-item-hidden.ant-row{display:none}.ant-form-item-label{display:inline-block;flex-grow:0;overflow:hidden;text-align:right;vertical-align:middle;white-space:nowrap}.ant-form-item-label-left{text-align:left}.ant-form-item-label-wrap{line-height:1.3215em;overflow:unset;white-space:unset}.ant-form-item-label>label{align-items:center;color:#000000d9;display:inline-flex;font-size:14px;height:32px;max-width:100%;position:relative}.ant-form-item-label>label>.anticon{font-size:14px;vertical-align:top}.ant-form-item-label>label.ant-form-item-required:not(.ant-form-item-required-mark-optional):before{color:#ff4d4f;content:"*";display:inline-block;font-family:SimSun,sans-serif;font-size:14px;line-height:1;margin-right:4px}.ant-form-hide-required-mark .ant-form-item-label>label.ant-form-item-required:not(.ant-form-item-required-mark-optional):before{display:none}.ant-form-item-label>label .ant-form-item-optional{color:#00000073;display:inline-block;margin-left:4px}.ant-form-hide-required-mark .ant-form-item-label>label .ant-form-item-optional{display:none}.ant-form-item-label>label .ant-form-item-tooltip{color:#00000073;cursor:help;margin-inline-start:4px;writing-mode:horizontal-tb}.ant-form-item-label>label:after{content:":";margin:0 8px 0 2px;position:relative;top:-.5px}.ant-form-item-label>label.ant-form-item-no-colon:after{content:" "}.ant-form-item-control{display:flex;flex-direction:column;flex-grow:1}.ant-form-item-control:first-child:not([class^=ant-col-]):not([class*=" ant-col-"]){width:100%}.ant-form-item-control-input{align-items:center;display:flex;min-height:32px;position:relative}.ant-form-item-control-input-content{flex:auto;max-width:100%}.ant-form-item-explain,.ant-form-item-extra{clear:both;color:#00000073;font-size:14px;line-height:1.5715;transition:color .3s cubic-bezier(.215,.61,.355,1)}.ant-form-item-explain-connected{width:100%}.ant-form-item-extra{min-height:24px}.ant-form-item-with-help .ant-form-item-explain{height:auto;opacity:1}.ant-form-item-feedback-icon{animation:zoomIn .3s cubic-bezier(.12,.4,.29,1.46);font-size:14px;pointer-events:none;text-align:center;visibility:visible}.ant-form-item-feedback-icon-success{color:#52c41a}.ant-form-item-feedback-icon-error{color:#ff4d4f}.ant-form-item-feedback-icon-warning{color:#faad14}.ant-form-item-feedback-icon-validating{color:#5b76f6}.ant-show-help{transition:opacity .3s cubic-bezier(.645,.045,.355,1)}.ant-show-help-appear,.ant-show-help-enter{opacity:0}.ant-show-help-appear-active,.ant-show-help-enter-active,.ant-show-help-leave{opacity:1}.ant-show-help-leave-active{opacity:0}.ant-show-help-item{overflow:hidden;transition:height .3s cubic-bezier(.645,.045,.355,1),opacity .3s cubic-bezier(.645,.045,.355,1),transform .3s cubic-bezier(.645,.045,.355,1)!important}.ant-show-help-item-appear,.ant-show-help-item-enter{opacity:0;transform:translateY(-5px)}.ant-show-help-item-appear-active,.ant-show-help-item-enter-active{opacity:1;transform:translateY(0)}.ant-show-help-item-leave{transition:height .2s cubic-bezier(.645,.045,.355,1),opacity .2s cubic-bezier(.645,.045,.355,1),transform .2s cubic-bezier(.645,.045,.355,1)!important}.ant-show-help-item-leave-active{transform:translateY(-5px)}@keyframes diffZoomIn1{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes diffZoomIn2{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes diffZoomIn3{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}.ant-form-rtl{direction:rtl}.ant-form-rtl .ant-form-item-label{text-align:left}.ant-form-rtl .ant-form-item-label>label.ant-form-item-required:before{margin-left:4px;margin-right:0}.ant-form-rtl .ant-form-item-label>label:after{margin:0 2px 0 8px}.ant-form-rtl .ant-form-item-label>label .ant-form-item-optional{margin-left:0;margin-right:4px}.ant-col-rtl .ant-form-item-control:first-child{width:100%}.ant-form-rtl .ant-form-item-has-feedback .ant-input{padding-left:24px;padding-right:11px}.ant-form-rtl .ant-form-item-has-feedback .ant-input-affix-wrapper .ant-input-suffix{padding-left:18px;padding-right:11px}.ant-form-rtl .ant-form-item-has-feedback .ant-input-affix-wrapper .ant-input,.ant-form-rtl .ant-form-item-has-feedback .ant-input-number-affix-wrapper .ant-input-number{padding:0}.ant-form-rtl .ant-form-item-has-feedback .ant-input-search:not(.ant-input-search-enter-button) .ant-input-suffix{left:28px;right:auto}.ant-form-rtl .ant-form-item-has-feedback .ant-input-number{padding-left:18px}.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-arrow,.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-clear,.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-number-group-addon)>.ant-select .ant-select-arrow,.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-number-group-addon)>.ant-select .ant-select-clear,.ant-form-rtl .ant-form-item-has-feedback>.ant-select .ant-select-arrow,.ant-form-rtl .ant-form-item-has-feedback>.ant-select .ant-select-clear{left:32px;right:auto}.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-selection-selected-value,.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-number-group-addon)>.ant-select .ant-select-selection-selected-value,.ant-form-rtl .ant-form-item-has-feedback>.ant-select .ant-select-selection-selected-value{padding-left:42px;padding-right:0}.ant-form-rtl .ant-form-item-has-feedback .ant-cascader-picker-arrow{margin-left:19px;margin-right:0}.ant-form-rtl .ant-form-item-has-feedback .ant-cascader-picker-clear{left:32px;right:auto}.ant-form-rtl .ant-form-item-has-feedback .ant-picker,.ant-form-rtl .ant-form-item-has-feedback .ant-picker-large{padding-left:29.2px;padding-right:11px}.ant-form-rtl .ant-form-item-has-feedback .ant-picker-small{padding-left:25.2px;padding-right:7px}.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-has-error .ant-form-item-children-icon,.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-has-success .ant-form-item-children-icon,.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-has-warning .ant-form-item-children-icon,.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-is-validating .ant-form-item-children-icon{left:0;right:auto}.ant-form-rtl.ant-form-inline .ant-form-item{margin-left:16px;margin-right:0}.ztxk-form{background:#fff;display:flex;justify-content:space-between;padding:0}.ztxk-form .ztxk-form--detault-dom{border:1px solid #d9d9d9;border-left:none;border-radius:0 4px 4px 0}.ztxk-form .ztxk-form--detault-dom,.ztxk-form .ztxk-form--tip-dom{align-items:center;display:flex;min-height:32px;padding:4px 11px;transition:all .3s}.ztxk-form .ztxk-form--tip-dom{border-radius:0 4px 4px 0}.ztxk-form.ztxk-form--bottom-border{border-bottom:1px solid #ebf3fe}.ztxk-form .ztxk-form__left{flex:1;position:relative;transition:max-height .3s ease-out}.ztxk-form .ztxk-form__left.ztxk-form__left--toggle{overflow:hidden}.ztxk-form .ztxk-form__left.ztxk-form__left--flex{display:flex;flex-grow:1;flex-wrap:wrap}.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error .ant-checkbox-group,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error .ant-form-item-label,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error .ant-form-item-label label,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error .ant-input,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error .ant-input-affix-wrapper,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error .ant-picker,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error .ant-radio-group,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error .ant-select-selector,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error .city-picker-span,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error.ztxk-form__item--direction-column,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error:hover .ant-form-item-label,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error:hover .ant-form-item-label label,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error:hover .ant-input,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error:hover .ant-input-affix-wrapper,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error:hover .ant-picker,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error:hover .ant-select-selector,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error:hover .city-picker-span,.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error:hover .ztxk-form--detault-dom{border-color:#f88!important}.ztxk-form .ztxk-form__left.ztxk-form__left--flex .ant-form-item-has-error .ant-form-item-margin-offset{margin-bottom:0!important}.ztxk-form .ztxk-form__left.ztxk-form__left--flex-direction{flex-direction:column}.ztxk-form .ztxk-form__left.ztxk-form__left--flex-direction>div{flex:none}.ztxk-form .ztxk-form--operation{align-items:center;display:flex;flex-direction:column;margin-right:10px}.ztxk-form .ztxk-form--operation .ztxk-dynamic-setting{cursor:pointer;margin-top:6px;position:relative}.ztxk-form .ztxk-form--operation .ztxk-from--toggle{cursor:pointer;margin-top:4px}.ztxk-form .ztxk-form--operation .ztxk-from--toggle>span{transition:transform .4s ease 0s}.ztxk-form .ztxk-form__right{display:flex;flex-direction:column}.ztxk-form .ztxk-form__right .ztxk-form__right--common-left{display:flex}.ztxk-form .ztxk-form__right .ztxk-form__right--common-left>button.ant-btn{margin-left:10px;margin-right:0}.ztxk-form .ztxk-form__right .ztxk-form__right--common-left>button.ant-btn:first-child{margin-left:0}.ztxk-form .ztxk-form__right .ztxk-form__right--common-right{margin-top:13px}.common-search-list--container{display:flex;flex-direction:row;line-height:26px;margin-bottom:10px}.common-search-list--container .common-search-list--title{color:#999}.common-search-list--container .common-search-list--content{display:flex;flex:1;flex-wrap:wrap;margin-left:10px;max-height:76px;overflow-y:auto}.common-search-list--container .common-search-list--content>div{padding-right:10px}.common-search-list--container .common-search-list--content>div:last-child{padding-right:0}.common-search-list--container .common-search-list--content>div .ant-btn{height:26px;margin-bottom:10px;padding:4px 8px}.common-search-list--container .common-search-list--content>div .ant-btn>.anticon{margin-left:4px;margin-top:2px}
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef, useState, useImperativeHandle, useRef, useEffect } from 'react';
|
|
4
|
+
import '../config/ZtxkContext.js';
|
|
5
|
+
import useBaseContext from '../config/useBaseContext.js';
|
|
6
|
+
import MyStorage from '../config/MyStorage.js';
|
|
7
|
+
import { useMount } from 'ahooks';
|
|
8
|
+
import dayjs from 'dayjs';
|
|
9
|
+
import Input from '../input/input.js';
|
|
10
|
+
import myMessage from '../message/index.js';
|
|
11
|
+
import ModalComponent from '../modal/modal.js';
|
|
12
|
+
|
|
13
|
+
var COMMON_SEARCH_KEY = "__zmdms-ui--common-search-key__";
|
|
14
|
+
// 常用搜索hooks
|
|
15
|
+
function useCommonSearch(options) {
|
|
16
|
+
var _this = this;
|
|
17
|
+
var commonSearchKey = options.commonSearchKey;
|
|
18
|
+
var customConfigFetch = useBaseContext().customConfigFetch;
|
|
19
|
+
// 常用搜索列表存储实例
|
|
20
|
+
var storageRef = useRef(new MyStorage({ tableKey: COMMON_SEARCH_KEY }));
|
|
21
|
+
// 常用搜索列表
|
|
22
|
+
var _a = useState([]), commonSearchList = _a[0], setCommonSearchList = _a[1];
|
|
23
|
+
// 当前选中的常用搜索key值
|
|
24
|
+
var _b = useState(""), currentCommonSearchKey = _b[0], setCurrentCommonSearchKey = _b[1];
|
|
25
|
+
// 初始化常用搜索列表
|
|
26
|
+
useMount(function () {
|
|
27
|
+
if (commonSearchKey) {
|
|
28
|
+
storageRef.current
|
|
29
|
+
.getItem(commonSearchKey)
|
|
30
|
+
.then(function (res) { return setCommonSearchList(res || []); });
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* description: 数据转换。主要是将时间对象转成字符串
|
|
35
|
+
*/
|
|
36
|
+
var transformData = function (data) {
|
|
37
|
+
// 处理数据,将数据中的时间对象做一下转换
|
|
38
|
+
var dataValue = data;
|
|
39
|
+
var newDataValue = {}; // 为了不影响之前的数据
|
|
40
|
+
var timeKeys = [];
|
|
41
|
+
if (dataValue) {
|
|
42
|
+
Object.keys(dataValue).forEach(function (key) {
|
|
43
|
+
var value = dataValue[key];
|
|
44
|
+
if (Array.isArray(value)) {
|
|
45
|
+
newDataValue[key] = [];
|
|
46
|
+
value.forEach(function (item) {
|
|
47
|
+
if (dayjs.isDayjs(item)) {
|
|
48
|
+
timeKeys.push(key);
|
|
49
|
+
newDataValue[key].push(dayjs(item).format("YYYY-MM-DD HH:mm:ss"));
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
newDataValue[key].push(item);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
var itemIsDayjs = dayjs.isDayjs(value);
|
|
58
|
+
if (itemIsDayjs) {
|
|
59
|
+
timeKeys.push(key);
|
|
60
|
+
}
|
|
61
|
+
newDataValue[key] = itemIsDayjs
|
|
62
|
+
? dayjs(value).format("YYYY-MM-DD HH:mm:ss")
|
|
63
|
+
: value;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
newDataValue: newDataValue,
|
|
69
|
+
timeKeys: timeKeys,
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* @description: 数据转换。主要是将时间字符串转成时间对象。
|
|
74
|
+
*/
|
|
75
|
+
var reTransformData = function (data, timeKeys) {
|
|
76
|
+
if (timeKeys === void 0) { timeKeys = []; }
|
|
77
|
+
// 处理数据,将数据中的时间对象做一下转换
|
|
78
|
+
var dataValue = data;
|
|
79
|
+
var newDataValue = {}; // 为了不影响之前的数据
|
|
80
|
+
if (dataValue) {
|
|
81
|
+
Object.keys(dataValue).forEach(function (key) {
|
|
82
|
+
var value = dataValue[key];
|
|
83
|
+
if (Array.isArray(value)) {
|
|
84
|
+
newDataValue[key] = [];
|
|
85
|
+
value.forEach(function (item) {
|
|
86
|
+
if (timeKeys.includes(key)) {
|
|
87
|
+
newDataValue[key].push(dayjs(item));
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
newDataValue[key].push(item);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
newDataValue[key] = timeKeys.includes(key) ? dayjs(value) : value;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return newDataValue;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* description: 存储数据
|
|
103
|
+
* @param {*} data 常用搜索数据
|
|
104
|
+
* @param {*} localIndex 本地存储索引 如果传了索引 就是修改
|
|
105
|
+
*/
|
|
106
|
+
var setData = function (data) { return __awaiter(_this, void 0, void 0, function () {
|
|
107
|
+
var localKey, _a, newDataValue, timeKeys, saveData;
|
|
108
|
+
var _b;
|
|
109
|
+
return __generator(this, function (_c) {
|
|
110
|
+
localKey = commonSearchKey;
|
|
111
|
+
_a = transformData(data.value), newDataValue = _a.newDataValue, timeKeys = _a.timeKeys;
|
|
112
|
+
saveData = __assign(__assign({}, data), { value: newDataValue, timeKeys: timeKeys });
|
|
113
|
+
return [2 /*return*/, (_b = storageRef === null || storageRef === void 0 ? void 0 : storageRef.current) === null || _b === void 0 ? void 0 : _b.getItem(localKey).then(function (res) {
|
|
114
|
+
var _a, _b;
|
|
115
|
+
// 处理数据,将数据中的时间对象做一下转换
|
|
116
|
+
var result = res;
|
|
117
|
+
if (!result) {
|
|
118
|
+
result = [saveData];
|
|
119
|
+
}
|
|
120
|
+
else if (Array.isArray(result)) {
|
|
121
|
+
var index = result.findIndex(function (item) { return item.key === saveData.key; });
|
|
122
|
+
if (index !== -1) {
|
|
123
|
+
result[index] = saveData;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
result.push(saveData);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
setCommonSearchList(result);
|
|
130
|
+
return (_b = (_a = storageRef === null || storageRef === void 0 ? void 0 : storageRef.current) === null || _a === void 0 ? void 0 : _a.setItem(localKey, result)) === null || _b === void 0 ? void 0 : _b.then(function () {
|
|
131
|
+
return updateServerData();
|
|
132
|
+
});
|
|
133
|
+
})];
|
|
134
|
+
});
|
|
135
|
+
}); };
|
|
136
|
+
/**
|
|
137
|
+
* description: 删除数据
|
|
138
|
+
* @param {*} localIndex 本地存储索引
|
|
139
|
+
*/
|
|
140
|
+
var deleteData = function (localIndex) { return __awaiter(_this, void 0, void 0, function () {
|
|
141
|
+
var localKey;
|
|
142
|
+
var _a;
|
|
143
|
+
return __generator(this, function (_b) {
|
|
144
|
+
localKey = commonSearchKey;
|
|
145
|
+
return [2 /*return*/, (_a = storageRef === null || storageRef === void 0 ? void 0 : storageRef.current) === null || _a === void 0 ? void 0 : _a.getItem(localKey).then(function (res) {
|
|
146
|
+
var _a, _b;
|
|
147
|
+
if (Array.isArray(res)) {
|
|
148
|
+
res.splice(localIndex, 1);
|
|
149
|
+
(_b = (_a = storageRef === null || storageRef === void 0 ? void 0 : storageRef.current) === null || _a === void 0 ? void 0 : _a.setItem(localKey, res)) === null || _b === void 0 ? void 0 : _b.then(function () {
|
|
150
|
+
return updateServerData();
|
|
151
|
+
});
|
|
152
|
+
setCommonSearchList(res);
|
|
153
|
+
}
|
|
154
|
+
})];
|
|
155
|
+
});
|
|
156
|
+
}); };
|
|
157
|
+
/**
|
|
158
|
+
* description: 直接替换原有数据
|
|
159
|
+
* @param {*} data 常用搜索数据
|
|
160
|
+
*/
|
|
161
|
+
var setReplaceData = function (data) { return __awaiter(_this, void 0, void 0, function () {
|
|
162
|
+
var localKey;
|
|
163
|
+
var _a;
|
|
164
|
+
return __generator(this, function (_b) {
|
|
165
|
+
localKey = commonSearchKey;
|
|
166
|
+
setCommonSearchList(data);
|
|
167
|
+
return [2 /*return*/, (_a = storageRef === null || storageRef === void 0 ? void 0 : storageRef.current) === null || _a === void 0 ? void 0 : _a.setItem(localKey, data)];
|
|
168
|
+
});
|
|
169
|
+
}); };
|
|
170
|
+
/**
|
|
171
|
+
* 直接更新服务器数据
|
|
172
|
+
*/
|
|
173
|
+
var updateServerData = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
174
|
+
var _this = this;
|
|
175
|
+
var _a, _b;
|
|
176
|
+
return __generator(this, function (_c) {
|
|
177
|
+
return [2 /*return*/, (_b = (_a = storageRef.current) === null || _a === void 0 ? void 0 : _a.getAllItems()) === null || _b === void 0 ? void 0 : _b.then(function (res) { return __awaiter(_this, void 0, void 0, function () {
|
|
178
|
+
var error_1;
|
|
179
|
+
return __generator(this, function (_a) {
|
|
180
|
+
switch (_a.label) {
|
|
181
|
+
case 0:
|
|
182
|
+
console.log("开始更新服务器数据!", res);
|
|
183
|
+
_a.label = 1;
|
|
184
|
+
case 1:
|
|
185
|
+
_a.trys.push([1, 3, , 4]);
|
|
186
|
+
return [4 /*yield*/, (customConfigFetch === null || customConfigFetch === void 0 ? void 0 : customConfigFetch({
|
|
187
|
+
customKey: COMMON_SEARCH_KEY,
|
|
188
|
+
customValue: JSON.stringify(res),
|
|
189
|
+
mark: "常用搜索用户配置",
|
|
190
|
+
}))];
|
|
191
|
+
case 2:
|
|
192
|
+
_a.sent();
|
|
193
|
+
return [3 /*break*/, 4];
|
|
194
|
+
case 3:
|
|
195
|
+
error_1 = _a.sent();
|
|
196
|
+
console.error("更新服务器数据失败!", error_1);
|
|
197
|
+
return [3 /*break*/, 4];
|
|
198
|
+
case 4: return [2 /*return*/];
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}); })];
|
|
202
|
+
});
|
|
203
|
+
}); };
|
|
204
|
+
return {
|
|
205
|
+
commonSearchList: commonSearchList,
|
|
206
|
+
setCommonSearchList: setCommonSearchList,
|
|
207
|
+
currentCommonSearchKey: currentCommonSearchKey,
|
|
208
|
+
setCurrentCommonSearchKey: setCurrentCommonSearchKey,
|
|
209
|
+
reTransformData: reTransformData,
|
|
210
|
+
setData: setData,
|
|
211
|
+
deleteData: deleteData,
|
|
212
|
+
setReplaceData: setReplaceData,
|
|
213
|
+
updateServerData: updateServerData,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
function useCommonSearchModal(options) {
|
|
217
|
+
var commonSearchList = options.commonSearchList, currentCommonSearchKey = options.currentCommonSearchKey, form = options.form, setData = options.setData;
|
|
218
|
+
var iptRef = useRef(null);
|
|
219
|
+
useEffect(function () {
|
|
220
|
+
var _a;
|
|
221
|
+
if (!(commonSearchList === null || commonSearchList === void 0 ? void 0 : commonSearchList.length)) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
var currentCommon = commonSearchList.find(function (item) { return item.key === currentCommonSearchKey; });
|
|
225
|
+
if (currentCommon) {
|
|
226
|
+
(_a = iptRef.current) === null || _a === void 0 ? void 0 : _a.setValue(currentCommon.title);
|
|
227
|
+
}
|
|
228
|
+
}, [currentCommonSearchKey, commonSearchList]);
|
|
229
|
+
/**
|
|
230
|
+
* 保存为常用搜索事件
|
|
231
|
+
*/
|
|
232
|
+
var onCommonSearchHandle = function () {
|
|
233
|
+
if (!form) {
|
|
234
|
+
myMessage.info("组件需要接受表单实例form");
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
ModalComponent.confirm({
|
|
238
|
+
icon: null,
|
|
239
|
+
title: currentCommonSearchKey ? "更新常用搜索" : "保存为常用搜索",
|
|
240
|
+
content: jsx(MyInput, { ref: iptRef }),
|
|
241
|
+
onOk: function () {
|
|
242
|
+
var _a, _b;
|
|
243
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
244
|
+
var currentCommonName, currentData, data;
|
|
245
|
+
return __generator(this, function (_c) {
|
|
246
|
+
switch (_c.label) {
|
|
247
|
+
case 0:
|
|
248
|
+
currentCommonName = (_a = iptRef.current) === null || _a === void 0 ? void 0 : _a.getValue();
|
|
249
|
+
if (!currentCommonName) {
|
|
250
|
+
myMessage.info("请输入常用搜索名称!");
|
|
251
|
+
return [2 /*return*/, Promise.reject(new Error("请输入常用搜索名称!"))];
|
|
252
|
+
}
|
|
253
|
+
currentData = form.getFieldsValue();
|
|
254
|
+
console.log("当前表单数据", currentData);
|
|
255
|
+
data = {
|
|
256
|
+
title: currentCommonName,
|
|
257
|
+
value: currentData,
|
|
258
|
+
key: currentCommonSearchKey || Date.now(),
|
|
259
|
+
};
|
|
260
|
+
_c.label = 1;
|
|
261
|
+
case 1:
|
|
262
|
+
_c.trys.push([1, 3, , 4]);
|
|
263
|
+
return [4 /*yield*/, (setData === null || setData === void 0 ? void 0 : setData(data))];
|
|
264
|
+
case 2:
|
|
265
|
+
_c.sent();
|
|
266
|
+
myMessage.info("保存成功!");
|
|
267
|
+
(_b = iptRef.current) === null || _b === void 0 ? void 0 : _b.setValue("");
|
|
268
|
+
return [3 /*break*/, 4];
|
|
269
|
+
case 3:
|
|
270
|
+
_c.sent();
|
|
271
|
+
myMessage.info("保存常用搜索失败!");
|
|
272
|
+
return [2 /*return*/, Promise.reject(new Error("保存常用搜索失败!"))];
|
|
273
|
+
case 4: return [2 /*return*/];
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
});
|
|
277
|
+
},
|
|
278
|
+
onCancel: function () {
|
|
279
|
+
console.log("Cancel");
|
|
280
|
+
},
|
|
281
|
+
});
|
|
282
|
+
setTimeout(function () {
|
|
283
|
+
var _a;
|
|
284
|
+
if (!(commonSearchList === null || commonSearchList === void 0 ? void 0 : commonSearchList.length)) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
var currentCommon = commonSearchList.find(function (item) { return item.key === currentCommonSearchKey; });
|
|
288
|
+
if (currentCommon) {
|
|
289
|
+
(_a = iptRef.current) === null || _a === void 0 ? void 0 : _a.setValue(currentCommon.title);
|
|
290
|
+
}
|
|
291
|
+
}, 0);
|
|
292
|
+
};
|
|
293
|
+
return {
|
|
294
|
+
onCommonSearchHandle: onCommonSearchHandle,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
var MyInput = forwardRef(function (props, ref) {
|
|
298
|
+
var _a = useState(""), value = _a[0], setValue = _a[1];
|
|
299
|
+
var onChange = function (e) {
|
|
300
|
+
setValue(e.target.value);
|
|
301
|
+
};
|
|
302
|
+
useImperativeHandle(ref, function () { return ({
|
|
303
|
+
getValue: function () { return value; },
|
|
304
|
+
setValue: setValue,
|
|
305
|
+
}); });
|
|
306
|
+
return (jsx(Input, { placeholder: "\u8BF7\u8F93\u5165\u5E38\u7528\u641C\u7D22\u540D\u79F0\uFF01", value: value, onChange: onChange }));
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
export { COMMON_SEARCH_KEY, useCommonSearch, useCommonSearchModal };
|
|
@@ -2,7 +2,7 @@ import React__default from 'react';
|
|
|
2
2
|
import { FormItemProps, FormInstance } from 'antd/lib/form';
|
|
3
3
|
|
|
4
4
|
type IWidth = "half" | "double" | "all" | "halfAll" | number;
|
|
5
|
-
interface IFormItem extends FormItemProps {
|
|
5
|
+
interface IFormItem extends Omit<FormItemProps, "label"> {
|
|
6
6
|
/**
|
|
7
7
|
* 是否显示
|
|
8
8
|
*/
|
|
@@ -107,6 +107,15 @@ interface IFormItem extends FormItemProps {
|
|
|
107
107
|
* 布局
|
|
108
108
|
*/
|
|
109
109
|
directionColumn?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* 自定义label
|
|
112
|
+
*/
|
|
113
|
+
label?: React__default.ReactNode | ((formInstance?: FormInstance<any>) => React__default.ReactNode);
|
|
114
|
+
/**
|
|
115
|
+
* 当label是一个函数,或者返回一个ReactNode节点时,提供一个纯字符串的label
|
|
116
|
+
* 作为一些提示词使用
|
|
117
|
+
*/
|
|
118
|
+
labelString?: string;
|
|
110
119
|
}
|
|
111
120
|
declare const _default: React__default.NamedExoticComponent<IFormItem & {
|
|
112
121
|
outsideState: any;
|
|
@@ -5,12 +5,16 @@ import { Form, Col, Tooltip } from 'antd';
|
|
|
5
5
|
import classNames from '../node_modules/classnames/index.js';
|
|
6
6
|
import '../config/ZtxkContext.js';
|
|
7
7
|
import isEqual from '../config/isEqual.js';
|
|
8
|
+
import '../config/MyStorage.js';
|
|
8
9
|
import QuestionCircleOutlined from '../node_modules/@ant-design/icons/es/icons/QuestionCircleOutlined.js';
|
|
9
10
|
|
|
10
11
|
var hiddenLabelCol = { span: 0 };
|
|
11
12
|
var FormItem = function (props) {
|
|
12
|
-
var children = props.children, isDisplay = props.isDisplay, isRequired = props.isRequired, isChangeable = props.isChangeable, isStress = props.isStress, preNode = props.preNode, nextNode = props.nextNode; props.dynamicDisabled; var hiddenBorder = props.hiddenBorder, singleSelectShowBorder = props.singleSelectShowBorder, singleSelect = props.singleSelect, hiddenLabel = props.hiddenLabel, width = props.width, className = props.className, itemClassName = props.itemClassName, render = props.render, shouldUpdateNames = props.shouldUpdateNames; props.shouldUpdateClear; var dependencies = props.dependencies, shouldUpdate = props.shouldUpdate; props.index; props.outsideState; props.shouldUpdateBeOutsideState; props.nonForm; var isCustomItem = props.isCustomItem, customStyle = props.customStyle, tipString = props.tipString, directionColumn = props.directionColumn, divider = props.divider, resetProps = __rest(props, ["children", "isDisplay", "isRequired", "isChangeable", "isStress", "preNode", "nextNode", "dynamicDisabled", "hiddenBorder", "singleSelectShowBorder", "singleSelect", "hiddenLabel", "width", "className", "itemClassName", "render", "shouldUpdateNames", "shouldUpdateClear", "dependencies", "shouldUpdate", "index", "outsideState", "shouldUpdateBeOutsideState", "nonForm", "isCustomItem", "customStyle", "tipString", "directionColumn", "divider"]);
|
|
13
|
+
var children = props.children, isDisplay = props.isDisplay, isRequired = props.isRequired, isChangeable = props.isChangeable, isStress = props.isStress, preNode = props.preNode, nextNode = props.nextNode; props.dynamicDisabled; var hiddenBorder = props.hiddenBorder, singleSelectShowBorder = props.singleSelectShowBorder, singleSelect = props.singleSelect, hiddenLabel = props.hiddenLabel, width = props.width, className = props.className, itemClassName = props.itemClassName, render = props.render, shouldUpdateNames = props.shouldUpdateNames; props.shouldUpdateClear; var dependencies = props.dependencies, shouldUpdate = props.shouldUpdate; props.index; props.outsideState; props.shouldUpdateBeOutsideState; props.nonForm; var isCustomItem = props.isCustomItem, customStyle = props.customStyle, tipString = props.tipString, directionColumn = props.directionColumn, divider = props.divider, label = props.label; props.labelString; var resetProps = __rest(props, ["children", "isDisplay", "isRequired", "isChangeable", "isStress", "preNode", "nextNode", "dynamicDisabled", "hiddenBorder", "singleSelectShowBorder", "singleSelect", "hiddenLabel", "width", "className", "itemClassName", "render", "shouldUpdateNames", "shouldUpdateClear", "dependencies", "shouldUpdate", "index", "outsideState", "shouldUpdateBeOutsideState", "nonForm", "isCustomItem", "customStyle", "tipString", "directionColumn", "divider", "label", "labelString"]);
|
|
13
14
|
var form = Form.useFormInstance();
|
|
15
|
+
var getLabel = function (formInstance) {
|
|
16
|
+
return typeof label === "function" ? label(formInstance) : label;
|
|
17
|
+
};
|
|
14
18
|
// 根据配置属性,判断是否渲染表单项
|
|
15
19
|
// 是否显示表单项
|
|
16
20
|
if (isDisplay === false || isDisplay === "0") {
|
|
@@ -34,15 +38,22 @@ var FormItem = function (props) {
|
|
|
34
38
|
// 如果找到了 直接替换之前的规则
|
|
35
39
|
if (requiredIndex !== -1) {
|
|
36
40
|
var message = (_a = rules[requiredIndex]) === null || _a === void 0 ? void 0 : _a.message;
|
|
41
|
+
if (typeof label === "function") {
|
|
42
|
+
var newLabel = getLabel(form);
|
|
43
|
+
message =
|
|
44
|
+
typeof newLabel === "string" ? ("".concat(newLabel, " \u672A\u586B!")) : (jsxs("span", __assign({ style: { display: "inline-flex" } }, { children: [newLabel, " \u672A\u586B!"] })));
|
|
45
|
+
}
|
|
37
46
|
rules.splice(requiredIndex, 1, {
|
|
38
47
|
required: isRequireBoolean,
|
|
39
48
|
message: message,
|
|
40
49
|
});
|
|
41
50
|
}
|
|
42
51
|
else {
|
|
52
|
+
var newLabel = getLabel(form);
|
|
53
|
+
var newMessage = typeof newLabel === "string" ? ("".concat(newLabel, " \u672A\u586B!")) : (jsxs("span", __assign({ style: { display: "inline-flex" } }, { children: [newLabel, " \u672A\u586B!"] })));
|
|
43
54
|
rules.unshift({
|
|
44
55
|
required: isRequireBoolean,
|
|
45
|
-
message:
|
|
56
|
+
message: newMessage,
|
|
46
57
|
});
|
|
47
58
|
}
|
|
48
59
|
resetProps.rules = rules;
|
|
@@ -74,7 +85,7 @@ var FormItem = function (props) {
|
|
|
74
85
|
}
|
|
75
86
|
if (dependencies) {
|
|
76
87
|
return (jsxs(ItemWrap, __assign({ width: width, className: className, tipString: tipString }, { children: [preNode ? preNode : null, jsx(Form.Item, __assign({ dependencies: dependencies, noStyle: true }, { children: function (formInstance) {
|
|
77
|
-
return (jsx(Form.Item, __assign({}, resetProps, { className: itemClasses }, { children: render && render(itemProps, formInstance) })));
|
|
88
|
+
return (jsx(Form.Item, __assign({ label: getLabel(formInstance) }, resetProps, { className: itemClasses }, { children: render && render(itemProps, formInstance) })));
|
|
78
89
|
} })), nextNode ? nextNode : null] })));
|
|
79
90
|
}
|
|
80
91
|
if (shouldUpdate !== undefined || shouldUpdateNames) {
|
|
@@ -106,6 +117,9 @@ var FormItem = function (props) {
|
|
|
106
117
|
var isR = isRequired(form);
|
|
107
118
|
updateIsRequired(isR);
|
|
108
119
|
}
|
|
120
|
+
else if (typeof label === "function" && isRequired === true) {
|
|
121
|
+
updateIsRequired(true);
|
|
122
|
+
}
|
|
109
123
|
if (typeof isChangeable === "function") {
|
|
110
124
|
var isC = isChangeable(form);
|
|
111
125
|
itemProps.disabled = !isC;
|
|
@@ -117,10 +131,10 @@ var FormItem = function (props) {
|
|
|
117
131
|
itemClasses = itemClasses.replace(" ztxk-form__item--disabled", "");
|
|
118
132
|
}
|
|
119
133
|
}
|
|
120
|
-
return resetProps.name ? (jsxs(ItemWrap, __assign({ width: width, className: className, tipString: tipString }, { children: [preNode ? preNode : null, jsx(Form.Item, __assign({}, resetProps, { className: itemClasses }, { children: render && render(itemProps, formInstance) })), nextNode ? nextNode : null] }))) : (jsxs(ItemWrap, __assign({ width: width, className: className, tipString: tipString }, { children: [preNode ? preNode : null, render && render(itemProps, formInstance), nextNode ? nextNode : null] })));
|
|
134
|
+
return resetProps.name ? (jsxs(ItemWrap, __assign({ width: width, className: className, tipString: tipString }, { children: [preNode ? preNode : null, jsx(Form.Item, __assign({ label: getLabel(formInstance) }, resetProps, { className: itemClasses }, { children: render && render(itemProps, formInstance) })), nextNode ? nextNode : null] }))) : (jsxs(ItemWrap, __assign({ width: width, className: className, tipString: tipString }, { children: [preNode ? preNode : null, render && render(itemProps, formInstance), nextNode ? nextNode : null] })));
|
|
121
135
|
} })));
|
|
122
136
|
}
|
|
123
|
-
return (jsxs(ItemWrap, __assign({ width: width, className: className, tipString: tipString }, { children: [preNode ? preNode : null, jsx(Form.Item, __assign({}, resetProps, { className: itemClasses }, { children: render ? render(itemProps, form) : children })), nextNode ? nextNode : null] })));
|
|
137
|
+
return (jsxs(ItemWrap, __assign({ width: width, className: className, tipString: tipString }, { children: [preNode ? preNode : null, jsx(Form.Item, __assign({ label: getLabel(form) }, resetProps, { className: itemClasses }, { children: render ? render(itemProps, form) : children })), nextNode ? nextNode : null] })));
|
|
124
138
|
};
|
|
125
139
|
function getWidthNum(width) {
|
|
126
140
|
if (typeof width === "number") {
|
package/dist/es/input/index.js
CHANGED