@kmkf-fe-packages/basic-components 0.6.3-alpha.26 → 0.6.3-alpha.29
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/README.md +1 -1
- package/dist/index.esm.js +38 -19
- package/dist/index.js +38 -19
- package/package.json +2 -2
package/README.md
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -3121,28 +3121,29 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3121
3121
|
_props$isEditing = props.isEditing,
|
|
3122
3122
|
isEditing = _props$isEditing === void 0 ? false : _props$isEditing,
|
|
3123
3123
|
logisticsInterceptHandleStatus = props.logisticsInterceptHandleStatus;
|
|
3124
|
-
var _useState = useState(
|
|
3124
|
+
var _useState = useState(''),
|
|
3125
3125
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3126
|
-
|
|
3127
|
-
|
|
3126
|
+
initCompany = _useState2[0],
|
|
3127
|
+
setInitCompany = _useState2[1];
|
|
3128
3128
|
var _useState3 = useState([]),
|
|
3129
3129
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
var _useState5 = useState(
|
|
3130
|
+
typeOptions = _useState4[0],
|
|
3131
|
+
setTypeOptions = _useState4[1];
|
|
3132
|
+
var _useState5 = useState([]),
|
|
3133
3133
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
var
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
//已对接公司在拦截中可以修改
|
|
3142
|
-
var INTERCEPTING = !logisticsInterceptHandleStatus || logisticsInterceptHandleStatus === 'INTERCEPTING';
|
|
3143
|
-
return isEditing ? INTERCEPTING : true;
|
|
3144
|
-
}, [value === null || value === void 0 ? void 0 : value.interceptCompany, statusOptions, isInterface, isEditing]);
|
|
3134
|
+
statusOptions = _useState6[0],
|
|
3135
|
+
setStatusOptions = _useState6[1];
|
|
3136
|
+
var _useState7 = useState(false),
|
|
3137
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
3138
|
+
isInterface = _useState8[0],
|
|
3139
|
+
setIsInterface = _useState8[1];
|
|
3140
|
+
var firstIn = useRef(true);
|
|
3145
3141
|
useEffect(function () {
|
|
3142
|
+
//存入第一次的物流地址,防止非对接物流切换成对接物流后无法编辑
|
|
3143
|
+
if (firstIn.current && (value === null || value === void 0 ? void 0 : value.interceptCompany)) {
|
|
3144
|
+
setInitCompany(value === null || value === void 0 ? void 0 : value.interceptCompany);
|
|
3145
|
+
firstIn.current = false;
|
|
3146
|
+
}
|
|
3146
3147
|
if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) {
|
|
3147
3148
|
setTypeOptions([]);
|
|
3148
3149
|
setStatusOptions([]);
|
|
@@ -3156,6 +3157,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3156
3157
|
setStatusOptions((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionStatusList) || []);
|
|
3157
3158
|
setIsInterface(interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.isInterface);
|
|
3158
3159
|
}, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
|
|
3160
|
+
//拦截类型切换 需要清空新派送地
|
|
3159
3161
|
useEffect(function () {
|
|
3160
3162
|
if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) return;
|
|
3161
3163
|
var interceptCompany = expressInterceptData.find(function (item) {
|
|
@@ -3181,6 +3183,23 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3181
3183
|
return item.value === (value === null || value === void 0 ? void 0 : value.interceptType);
|
|
3182
3184
|
})) === null || _find === void 0 ? void 0 : (_find$config = _find.config) === null || _find$config === void 0 ? void 0 : _find$config.showAddress;
|
|
3183
3185
|
}, [value === null || value === void 0 ? void 0 : value.interceptType, typeOptions, value === null || value === void 0 ? void 0 : value.interceptCompany]);
|
|
3186
|
+
//判断是否能修改信息
|
|
3187
|
+
var canEdit = useMemo(function () {
|
|
3188
|
+
// 已对接公司如果拦截状态为【拦截中】,可以修改物流拦截组件信息,否则该组件不能修改;
|
|
3189
|
+
// 非对接公司可以修改组件
|
|
3190
|
+
// 修改后把工单信息重新提交给快递公司,清空拦截状态的值
|
|
3191
|
+
if (!isInterface) return true;
|
|
3192
|
+
//已对接公司在拦截中可以修改
|
|
3193
|
+
var INTERCEPTING = !logisticsInterceptHandleStatus || logisticsInterceptHandleStatus === 'INTERCEPTING';
|
|
3194
|
+
return isEditing ? INTERCEPTING : true;
|
|
3195
|
+
}, [value === null || value === void 0 ? void 0 : value.interceptCompany, statusOptions, isInterface, isEditing]);
|
|
3196
|
+
//判断是否能修改物流信息
|
|
3197
|
+
var canEditCompany = useMemo(function () {
|
|
3198
|
+
var company = expressInterceptData.find(function (item) {
|
|
3199
|
+
return item.value === initCompany;
|
|
3200
|
+
});
|
|
3201
|
+
return isEditing && !!(company === null || company === void 0 ? void 0 : company.isInterface);
|
|
3202
|
+
}, [isEditing, initCompany]);
|
|
3184
3203
|
var changeHandle = function changeHandle(val, type) {
|
|
3185
3204
|
var newValue = _objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, val));
|
|
3186
3205
|
if (type === 'interceptCompany') {
|
|
@@ -3208,7 +3227,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3208
3227
|
required: required,
|
|
3209
3228
|
key: 'logistics'
|
|
3210
3229
|
}, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Select, {
|
|
3211
|
-
disabled: disabled ||
|
|
3230
|
+
disabled: disabled || canEditCompany,
|
|
3212
3231
|
placeholder: "\u7269\u6D41\u516C\u53F8",
|
|
3213
3232
|
style: {
|
|
3214
3233
|
width: '200px'
|
|
@@ -3223,7 +3242,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3223
3242
|
return option.label.includes(input);
|
|
3224
3243
|
}
|
|
3225
3244
|
}), /*#__PURE__*/React.createElement(Input, {
|
|
3226
|
-
disabled: disabled ||
|
|
3245
|
+
disabled: disabled || canEditCompany,
|
|
3227
3246
|
placeholder: "\u7269\u6D41\u5355\u53F7",
|
|
3228
3247
|
onChange: function onChange(e) {
|
|
3229
3248
|
return changeHandle(e.target.value, 'interceptCode');
|
package/dist/index.js
CHANGED
|
@@ -3131,28 +3131,29 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3131
3131
|
_props$isEditing = props.isEditing,
|
|
3132
3132
|
isEditing = _props$isEditing === void 0 ? false : _props$isEditing,
|
|
3133
3133
|
logisticsInterceptHandleStatus = props.logisticsInterceptHandleStatus;
|
|
3134
|
-
var _useState = React.useState(
|
|
3134
|
+
var _useState = React.useState(''),
|
|
3135
3135
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3136
|
-
|
|
3137
|
-
|
|
3136
|
+
initCompany = _useState2[0],
|
|
3137
|
+
setInitCompany = _useState2[1];
|
|
3138
3138
|
var _useState3 = React.useState([]),
|
|
3139
3139
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
var _useState5 = React.useState(
|
|
3140
|
+
typeOptions = _useState4[0],
|
|
3141
|
+
setTypeOptions = _useState4[1];
|
|
3142
|
+
var _useState5 = React.useState([]),
|
|
3143
3143
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
var
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
//已对接公司在拦截中可以修改
|
|
3152
|
-
var INTERCEPTING = !logisticsInterceptHandleStatus || logisticsInterceptHandleStatus === 'INTERCEPTING';
|
|
3153
|
-
return isEditing ? INTERCEPTING : true;
|
|
3154
|
-
}, [value === null || value === void 0 ? void 0 : value.interceptCompany, statusOptions, isInterface, isEditing]);
|
|
3144
|
+
statusOptions = _useState6[0],
|
|
3145
|
+
setStatusOptions = _useState6[1];
|
|
3146
|
+
var _useState7 = React.useState(false),
|
|
3147
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
3148
|
+
isInterface = _useState8[0],
|
|
3149
|
+
setIsInterface = _useState8[1];
|
|
3150
|
+
var firstIn = React.useRef(true);
|
|
3155
3151
|
React.useEffect(function () {
|
|
3152
|
+
//存入第一次的物流地址,防止非对接物流切换成对接物流后无法编辑
|
|
3153
|
+
if (firstIn.current && (value === null || value === void 0 ? void 0 : value.interceptCompany)) {
|
|
3154
|
+
setInitCompany(value === null || value === void 0 ? void 0 : value.interceptCompany);
|
|
3155
|
+
firstIn.current = false;
|
|
3156
|
+
}
|
|
3156
3157
|
if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) {
|
|
3157
3158
|
setTypeOptions([]);
|
|
3158
3159
|
setStatusOptions([]);
|
|
@@ -3166,6 +3167,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3166
3167
|
setStatusOptions((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionStatusList) || []);
|
|
3167
3168
|
setIsInterface(interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.isInterface);
|
|
3168
3169
|
}, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
|
|
3170
|
+
//拦截类型切换 需要清空新派送地
|
|
3169
3171
|
React.useEffect(function () {
|
|
3170
3172
|
if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) return;
|
|
3171
3173
|
var interceptCompany = expressInterceptData.find(function (item) {
|
|
@@ -3191,6 +3193,23 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3191
3193
|
return item.value === (value === null || value === void 0 ? void 0 : value.interceptType);
|
|
3192
3194
|
})) === null || _find === void 0 ? void 0 : (_find$config = _find.config) === null || _find$config === void 0 ? void 0 : _find$config.showAddress;
|
|
3193
3195
|
}, [value === null || value === void 0 ? void 0 : value.interceptType, typeOptions, value === null || value === void 0 ? void 0 : value.interceptCompany]);
|
|
3196
|
+
//判断是否能修改信息
|
|
3197
|
+
var canEdit = React.useMemo(function () {
|
|
3198
|
+
// 已对接公司如果拦截状态为【拦截中】,可以修改物流拦截组件信息,否则该组件不能修改;
|
|
3199
|
+
// 非对接公司可以修改组件
|
|
3200
|
+
// 修改后把工单信息重新提交给快递公司,清空拦截状态的值
|
|
3201
|
+
if (!isInterface) return true;
|
|
3202
|
+
//已对接公司在拦截中可以修改
|
|
3203
|
+
var INTERCEPTING = !logisticsInterceptHandleStatus || logisticsInterceptHandleStatus === 'INTERCEPTING';
|
|
3204
|
+
return isEditing ? INTERCEPTING : true;
|
|
3205
|
+
}, [value === null || value === void 0 ? void 0 : value.interceptCompany, statusOptions, isInterface, isEditing]);
|
|
3206
|
+
//判断是否能修改物流信息
|
|
3207
|
+
var canEditCompany = React.useMemo(function () {
|
|
3208
|
+
var company = expressInterceptData.find(function (item) {
|
|
3209
|
+
return item.value === initCompany;
|
|
3210
|
+
});
|
|
3211
|
+
return isEditing && !!(company === null || company === void 0 ? void 0 : company.isInterface);
|
|
3212
|
+
}, [isEditing, initCompany]);
|
|
3194
3213
|
var changeHandle = function changeHandle(val, type) {
|
|
3195
3214
|
var newValue = _objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, val));
|
|
3196
3215
|
if (type === 'interceptCompany') {
|
|
@@ -3218,7 +3237,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3218
3237
|
required: required,
|
|
3219
3238
|
key: 'logistics'
|
|
3220
3239
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
|
|
3221
|
-
disabled: disabled ||
|
|
3240
|
+
disabled: disabled || canEditCompany,
|
|
3222
3241
|
placeholder: "\u7269\u6D41\u516C\u53F8",
|
|
3223
3242
|
style: {
|
|
3224
3243
|
width: '200px'
|
|
@@ -3233,7 +3252,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3233
3252
|
return option.label.includes(input);
|
|
3234
3253
|
}
|
|
3235
3254
|
}), /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
3236
|
-
disabled: disabled ||
|
|
3255
|
+
disabled: disabled || canEditCompany,
|
|
3237
3256
|
placeholder: "\u7269\u6D41\u5355\u53F7",
|
|
3238
3257
|
onChange: function onChange(e) {
|
|
3239
3258
|
return changeHandle(e.target.value, 'interceptCode');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/basic-components",
|
|
3
|
-
"version": "0.6.3-alpha.
|
|
3
|
+
"version": "0.6.3-alpha.29",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "020b26377a517873ce2ec5f4575996cef737cba8"
|
|
46
46
|
}
|