@kmkf-fe-packages/basic-components 0.15.0 → 0.15.1-alpha.1
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/index.esm.js +68 -1
- package/dist/index.js +68 -0
- package/dist/src/common/MsgStatus/index.d.ts +15 -0
- package/dist/src/index.d.ts +1 -0
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -11986,6 +11986,73 @@ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
|
|
|
11986
11986
|
}, "\u5931\u8D25\u539F\u56E0\uFF1A", (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.reason) : null) : null);
|
|
11987
11987
|
};
|
|
11988
11988
|
|
|
11989
|
+
var _excluded$i = ["value", "onChange", "disabled", "failValue", "type"];
|
|
11990
|
+
var msgTypeCh = {
|
|
11991
|
+
'ding': '钉钉',
|
|
11992
|
+
'wechat': '微信',
|
|
11993
|
+
'qq': 'QQ',
|
|
11994
|
+
'qywx': '企业微信'
|
|
11995
|
+
};
|
|
11996
|
+
var MsgStatus = function MsgStatus(props) {
|
|
11997
|
+
var _value$changeIndex, _value$changeIndex2, _value$changeIndex3;
|
|
11998
|
+
var _props$value = props.value,
|
|
11999
|
+
value = _props$value === void 0 ? [] : _props$value,
|
|
12000
|
+
onChange = props.onChange,
|
|
12001
|
+
disabled = props.disabled,
|
|
12002
|
+
failValue = props.failValue,
|
|
12003
|
+
_props$type = props.type,
|
|
12004
|
+
type = _props$type === void 0 ? 1 : _props$type,
|
|
12005
|
+
other = _objectWithoutProperties(props, _excluded$i);
|
|
12006
|
+
var _useState = useState(0),
|
|
12007
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
12008
|
+
changeIndex = _useState2[0],
|
|
12009
|
+
setChangeIndex = _useState2[1]; //选中的包裹
|
|
12010
|
+
var changeHandle = function changeHandle(val, valType) {
|
|
12011
|
+
var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
|
|
12012
|
+
changeOrderInfo[valType] = val;
|
|
12013
|
+
if (val !== failValue) {
|
|
12014
|
+
changeOrderInfo.reason = '';
|
|
12015
|
+
}
|
|
12016
|
+
var newList = _toConsumableArray(value);
|
|
12017
|
+
newList[changeIndex] = changeOrderInfo;
|
|
12018
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newList);
|
|
12019
|
+
};
|
|
12020
|
+
//判断是否是单个且没有商品数据
|
|
12021
|
+
var isSingle = useMemo(function () {
|
|
12022
|
+
return value && value.length === 1;
|
|
12023
|
+
}, [value]);
|
|
12024
|
+
return /*#__PURE__*/React.createElement("div", null, !isSingle ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Space, {
|
|
12025
|
+
wrap: true
|
|
12026
|
+
}, (value || []).map(function (item, index) {
|
|
12027
|
+
var key = item.msgType || 'ding';
|
|
12028
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
12029
|
+
style: {
|
|
12030
|
+
color: changeIndex === index ? '#4569d4' : 'black',
|
|
12031
|
+
cursor: 'pointer'
|
|
12032
|
+
},
|
|
12033
|
+
onClick: function onClick() {
|
|
12034
|
+
return setChangeIndex(index);
|
|
12035
|
+
}
|
|
12036
|
+
}, msgTypeCh[key], item.ruleName);
|
|
12037
|
+
}))) : null, type === 1 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({}, other), {}, {
|
|
12038
|
+
showSearch: true,
|
|
12039
|
+
value: (_value$changeIndex = value[changeIndex]) === null || _value$changeIndex === void 0 ? void 0 : _value$changeIndex.status,
|
|
12040
|
+
filterOption: function filterOption(input, option) {
|
|
12041
|
+
return option.label.includes(input);
|
|
12042
|
+
},
|
|
12043
|
+
style: {
|
|
12044
|
+
width: 200
|
|
12045
|
+
},
|
|
12046
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
12047
|
+
disabled: disabled,
|
|
12048
|
+
onChange: function onChange(val) {
|
|
12049
|
+
return changeHandle(val, 'status');
|
|
12050
|
+
}
|
|
12051
|
+
}))), ((_value$changeIndex2 = value[changeIndex]) === null || _value$changeIndex2 === void 0 ? void 0 : _value$changeIndex2.reason) ? /*#__PURE__*/React.createElement("div", {
|
|
12052
|
+
className: "c-red"
|
|
12053
|
+
}, "\u5931\u8D25\u539F\u56E0\uFF1A", (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.reason) : null) : null);
|
|
12054
|
+
};
|
|
12055
|
+
|
|
11989
12056
|
var CalculationInput = function CalculationInput(props) {
|
|
11990
12057
|
var _props$config = props.config,
|
|
11991
12058
|
config = _props$config === void 0 ? {} : _props$config;
|
|
@@ -12004,4 +12071,4 @@ var CalculationInput = function CalculationInput(props) {
|
|
|
12004
12071
|
}, config === null || config === void 0 ? void 0 : config.unit));
|
|
12005
12072
|
};
|
|
12006
12073
|
|
|
12007
|
-
export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonSystemOrder$1 as CommonMultiStatus, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsTrajectory, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId, WlnGoods };
|
|
12074
|
+
export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonSystemOrder$1 as CommonMultiStatus, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId, WlnGoods };
|
package/dist/index.js
CHANGED
|
@@ -11997,6 +11997,73 @@ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
|
|
|
11997
11997
|
}, "\u5931\u8D25\u539F\u56E0\uFF1A", (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.reason) : null) : null);
|
|
11998
11998
|
};
|
|
11999
11999
|
|
|
12000
|
+
var _excluded$i = ["value", "onChange", "disabled", "failValue", "type"];
|
|
12001
|
+
var msgTypeCh = {
|
|
12002
|
+
'ding': '钉钉',
|
|
12003
|
+
'wechat': '微信',
|
|
12004
|
+
'qq': 'QQ',
|
|
12005
|
+
'qywx': '企业微信'
|
|
12006
|
+
};
|
|
12007
|
+
var MsgStatus = function MsgStatus(props) {
|
|
12008
|
+
var _value$changeIndex, _value$changeIndex2, _value$changeIndex3;
|
|
12009
|
+
var _props$value = props.value,
|
|
12010
|
+
value = _props$value === void 0 ? [] : _props$value,
|
|
12011
|
+
onChange = props.onChange,
|
|
12012
|
+
disabled = props.disabled,
|
|
12013
|
+
failValue = props.failValue,
|
|
12014
|
+
_props$type = props.type,
|
|
12015
|
+
type = _props$type === void 0 ? 1 : _props$type,
|
|
12016
|
+
other = _objectWithoutProperties(props, _excluded$i);
|
|
12017
|
+
var _useState = React.useState(0),
|
|
12018
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
12019
|
+
changeIndex = _useState2[0],
|
|
12020
|
+
setChangeIndex = _useState2[1]; //选中的包裹
|
|
12021
|
+
var changeHandle = function changeHandle(val, valType) {
|
|
12022
|
+
var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
|
|
12023
|
+
changeOrderInfo[valType] = val;
|
|
12024
|
+
if (val !== failValue) {
|
|
12025
|
+
changeOrderInfo.reason = '';
|
|
12026
|
+
}
|
|
12027
|
+
var newList = _toConsumableArray(value);
|
|
12028
|
+
newList[changeIndex] = changeOrderInfo;
|
|
12029
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newList);
|
|
12030
|
+
};
|
|
12031
|
+
//判断是否是单个且没有商品数据
|
|
12032
|
+
var isSingle = React.useMemo(function () {
|
|
12033
|
+
return value && value.length === 1;
|
|
12034
|
+
}, [value]);
|
|
12035
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, !isSingle ? /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Space, {
|
|
12036
|
+
wrap: true
|
|
12037
|
+
}, (value || []).map(function (item, index) {
|
|
12038
|
+
var key = item.msgType || 'ding';
|
|
12039
|
+
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
12040
|
+
style: {
|
|
12041
|
+
color: changeIndex === index ? '#4569d4' : 'black',
|
|
12042
|
+
cursor: 'pointer'
|
|
12043
|
+
},
|
|
12044
|
+
onClick: function onClick() {
|
|
12045
|
+
return setChangeIndex(index);
|
|
12046
|
+
}
|
|
12047
|
+
}, msgTypeCh[key], item.ruleName);
|
|
12048
|
+
}))) : null, type === 1 ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2(_objectSpread2({}, other), {}, {
|
|
12049
|
+
showSearch: true,
|
|
12050
|
+
value: (_value$changeIndex = value[changeIndex]) === null || _value$changeIndex === void 0 ? void 0 : _value$changeIndex.status,
|
|
12051
|
+
filterOption: function filterOption(input, option) {
|
|
12052
|
+
return option.label.includes(input);
|
|
12053
|
+
},
|
|
12054
|
+
style: {
|
|
12055
|
+
width: 200
|
|
12056
|
+
},
|
|
12057
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
12058
|
+
disabled: disabled,
|
|
12059
|
+
onChange: function onChange(val) {
|
|
12060
|
+
return changeHandle(val, 'status');
|
|
12061
|
+
}
|
|
12062
|
+
}))), ((_value$changeIndex2 = value[changeIndex]) === null || _value$changeIndex2 === void 0 ? void 0 : _value$changeIndex2.reason) ? /*#__PURE__*/React__default['default'].createElement("div", {
|
|
12063
|
+
className: "c-red"
|
|
12064
|
+
}, "\u5931\u8D25\u539F\u56E0\uFF1A", (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.reason) : null) : null);
|
|
12065
|
+
};
|
|
12066
|
+
|
|
12000
12067
|
var CalculationInput = function CalculationInput(props) {
|
|
12001
12068
|
var _props$config = props.config,
|
|
12002
12069
|
config = _props$config === void 0 ? {} : _props$config;
|
|
@@ -12055,6 +12122,7 @@ exports.JstGoods = jstGoods;
|
|
|
12055
12122
|
exports.JstItemList = ItemList;
|
|
12056
12123
|
exports.LogisticsInterception = LogisticsInterception;
|
|
12057
12124
|
exports.LogisticsTrajectory = LogisticsTrajectory;
|
|
12125
|
+
exports.MsgStatus = MsgStatus;
|
|
12058
12126
|
exports.ParseLogistics = ParseLogistics;
|
|
12059
12127
|
exports.Payment = Payment;
|
|
12060
12128
|
exports.Remark = RemarkInput;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface StatusProps {
|
|
3
|
+
value: {
|
|
4
|
+
status: string;
|
|
5
|
+
reason?: string;
|
|
6
|
+
systemOrderId?: string;
|
|
7
|
+
}[];
|
|
8
|
+
failValue: string;
|
|
9
|
+
options: any[];
|
|
10
|
+
onChange: (val: any) => void;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
type: number;
|
|
13
|
+
}
|
|
14
|
+
declare const MsgStatus: (props: Partial<StatusProps>) => React.JSX.Element;
|
|
15
|
+
export default MsgStatus;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export { default as GoodsTable } from './common/GoodsTable';
|
|
|
46
46
|
export { default as CommonStatus } from './common/CommonStatus';
|
|
47
47
|
export { default as CommonSystemOrder } from './common/CommonSystemOrder';
|
|
48
48
|
export { default as CommonMultiStatus } from './common/CommonMultiStatus';
|
|
49
|
+
export { default as MsgStatus } from './common/MsgStatus';
|
|
49
50
|
export { default as ParseLogistics } from './common/ParseLogistics';
|
|
50
51
|
export { default as IdentifyAddress } from './common/IdentifyAddress';
|
|
51
52
|
export { default as CalculationInput } from './apaas/CalculationInput';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/basic-components",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.1-alpha.1",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"watch": "nodemon --ignore dist/ --ignore node_modules/ --watch src/ -C -e ts,tsx,less --debug -x 'yarn async'"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@kmkf-fe-packages/kmkf-utils": "^0.15.
|
|
23
|
+
"@kmkf-fe-packages/kmkf-utils": "^0.15.1-alpha.1",
|
|
24
24
|
"lodash": "^4.17.21",
|
|
25
25
|
"pubsub-js": "^1.9.4",
|
|
26
26
|
"react-copy-to-clipboard": "^5.1.0",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "a626bb6ca7496ba70af959c6ff37bb3ef40f6e9d"
|
|
65
65
|
}
|