cloud-business 0.1.124-1 → 0.1.124-2
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/cloud-business.css +135 -150
- package/cloud-business.js +1490 -1471
- package/cloud-business.min.css +1 -1
- package/cloud-business.min.js +17 -17
- package/package.json +1 -1
package/cloud-business.js
CHANGED
|
@@ -3717,638 +3717,6 @@
|
|
|
3717
3717
|
showPage: true
|
|
3718
3718
|
};
|
|
3719
3719
|
|
|
3720
|
-
var Store = /*#__PURE__*/function () {
|
|
3721
|
-
function Store() {
|
|
3722
|
-
_classCallCheck(this, Store);
|
|
3723
|
-
this.queryCondition = [];
|
|
3724
|
-
this.originCondition = [];
|
|
3725
|
-
this.settingQuery = [];
|
|
3726
|
-
}
|
|
3727
|
-
_createClass(Store, [{
|
|
3728
|
-
key: "getGoodsCategory",
|
|
3729
|
-
value:
|
|
3730
|
-
/**
|
|
3731
|
-
* 查询标准类目
|
|
3732
|
-
*/
|
|
3733
|
-
function () {
|
|
3734
|
-
var _getGoodsCategory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(server, extraQuery, platCode) {
|
|
3735
|
-
var url;
|
|
3736
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3737
|
-
while (1) switch (_context.prev = _context.next) {
|
|
3738
|
-
case 0:
|
|
3739
|
-
url = "".concat(server, "/product-selector/2.0/cate/std_cate?tenant=").concat(extraQuery);
|
|
3740
|
-
return _context.abrupt("return", http.post(url, platCode));
|
|
3741
|
-
case 2:
|
|
3742
|
-
case "end":
|
|
3743
|
-
return _context.stop();
|
|
3744
|
-
}
|
|
3745
|
-
}, _callee);
|
|
3746
|
-
}));
|
|
3747
|
-
function getGoodsCategory(_x, _x2, _x3) {
|
|
3748
|
-
return _getGoodsCategory.apply(this, arguments);
|
|
3749
|
-
}
|
|
3750
|
-
return getGoodsCategory;
|
|
3751
|
-
}()
|
|
3752
|
-
/**
|
|
3753
|
-
* 埋点
|
|
3754
|
-
*/
|
|
3755
|
-
}, {
|
|
3756
|
-
key: "bury",
|
|
3757
|
-
value: function bury(server, param) {
|
|
3758
|
-
var url = "".concat(server, "/product-selector/2.0/statistic/tenant/use");
|
|
3759
|
-
return http.post(url, param);
|
|
3760
|
-
}
|
|
3761
|
-
|
|
3762
|
-
/**
|
|
3763
|
-
* 查询店铺自定义类目
|
|
3764
|
-
*/
|
|
3765
|
-
}, {
|
|
3766
|
-
key: "getGoodsDefaultCategory",
|
|
3767
|
-
value: function () {
|
|
3768
|
-
var _getGoodsDefaultCategory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(server, extraQuery, platCode) {
|
|
3769
|
-
var url;
|
|
3770
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
3771
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
3772
|
-
case 0:
|
|
3773
|
-
url = "".concat(server, "/product-selector/2.0/cate/user_defined_cate?tenant=").concat(extraQuery);
|
|
3774
|
-
return _context2.abrupt("return", http.post(url, platCode));
|
|
3775
|
-
case 2:
|
|
3776
|
-
case "end":
|
|
3777
|
-
return _context2.stop();
|
|
3778
|
-
}
|
|
3779
|
-
}, _callee2);
|
|
3780
|
-
}));
|
|
3781
|
-
function getGoodsDefaultCategory(_x4, _x5, _x6) {
|
|
3782
|
-
return _getGoodsDefaultCategory.apply(this, arguments);
|
|
3783
|
-
}
|
|
3784
|
-
return getGoodsDefaultCategory;
|
|
3785
|
-
}()
|
|
3786
|
-
}, {
|
|
3787
|
-
key: "configBizzKey",
|
|
3788
|
-
value: function configBizzKey(bizzKey, supportSku, _url) {
|
|
3789
|
-
if (bizzKey) {
|
|
3790
|
-
return "".concat(_url, "&bizzKey=").concat(bizzKey);
|
|
3791
|
-
}
|
|
3792
|
-
return supportSku ? "".concat(_url, "&bizzKey=10001") : _url;
|
|
3793
|
-
}
|
|
3794
|
-
|
|
3795
|
-
/**
|
|
3796
|
-
* 全部商品条件保存
|
|
3797
|
-
* @param {*} server
|
|
3798
|
-
* @param {*} extraQuery
|
|
3799
|
-
* @returns
|
|
3800
|
-
*/
|
|
3801
|
-
}, {
|
|
3802
|
-
key: "saveQueryCondition",
|
|
3803
|
-
value: function () {
|
|
3804
|
-
var _saveQueryCondition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(server, extraQuery, params, bizzKey, supportSku) {
|
|
3805
|
-
var _url, url;
|
|
3806
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
3807
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
3808
|
-
case 0:
|
|
3809
|
-
_url = "".concat(server, "/product-selector/2.0/custom/saveUserCustom?tenant=").concat(extraQuery);
|
|
3810
|
-
url = this.configBizzKey(bizzKey, supportSku, _url);
|
|
3811
|
-
return _context3.abrupt("return", http.post(url, params));
|
|
3812
|
-
case 3:
|
|
3813
|
-
case "end":
|
|
3814
|
-
return _context3.stop();
|
|
3815
|
-
}
|
|
3816
|
-
}, _callee3, this);
|
|
3817
|
-
}));
|
|
3818
|
-
function saveQueryCondition(_x7, _x8, _x9, _x10, _x11) {
|
|
3819
|
-
return _saveQueryCondition.apply(this, arguments);
|
|
3820
|
-
}
|
|
3821
|
-
return saveQueryCondition;
|
|
3822
|
-
}()
|
|
3823
|
-
/**
|
|
3824
|
-
* 全部商品条件查询
|
|
3825
|
-
*/
|
|
3826
|
-
}, {
|
|
3827
|
-
key: "fetchAllquery",
|
|
3828
|
-
value: function () {
|
|
3829
|
-
var _fetchAllquery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(supportSku, server, extraQuery, supportTags, bizzKey) {
|
|
3830
|
-
var _url, url, list, _queryCondition;
|
|
3831
|
-
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
3832
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
3833
|
-
case 0:
|
|
3834
|
-
_url = "".concat(server, "/product-selector/2.0/custom/getCustom?tenant=").concat(extraQuery);
|
|
3835
|
-
url = this.configBizzKey(bizzKey, supportSku, _url);
|
|
3836
|
-
_context4.next = 4;
|
|
3837
|
-
return http.get(url);
|
|
3838
|
-
case 4:
|
|
3839
|
-
list = _context4.sent;
|
|
3840
|
-
_queryCondition = list.data.data;
|
|
3841
|
-
this.originCondition = list.data.data;
|
|
3842
|
-
if (!supportSku) {
|
|
3843
|
-
_queryCondition = _queryCondition.filter(function (item) {
|
|
3844
|
-
return ['sku_sku_id', 'sku_specification', 'sku_outer_id', 'sku_flag'].includes(item.itemId) === false;
|
|
3845
|
-
});
|
|
3846
|
-
}
|
|
3847
|
-
if (!supportTags) {
|
|
3848
|
-
_queryCondition = _queryCondition.filter(function (item) {
|
|
3849
|
-
return !item.groupName;
|
|
3850
|
-
});
|
|
3851
|
-
}
|
|
3852
|
-
this.queryCondition = _queryCondition.map(function (el) {
|
|
3853
|
-
return _objectSpread2(_objectSpread2({}, el), {}, {
|
|
3854
|
-
value: el.itemId,
|
|
3855
|
-
label: el.itemName,
|
|
3856
|
-
status: el.status === 3 ? 4 : el.status
|
|
3857
|
-
});
|
|
3858
|
-
});
|
|
3859
|
-
return _context4.abrupt("return", this.queryCondition);
|
|
3860
|
-
case 11:
|
|
3861
|
-
case "end":
|
|
3862
|
-
return _context4.stop();
|
|
3863
|
-
}
|
|
3864
|
-
}, _callee4, this);
|
|
3865
|
-
}));
|
|
3866
|
-
function fetchAllquery(_x12, _x13, _x14, _x15, _x16) {
|
|
3867
|
-
return _fetchAllquery.apply(this, arguments);
|
|
3868
|
-
}
|
|
3869
|
-
return fetchAllquery;
|
|
3870
|
-
}()
|
|
3871
|
-
/**
|
|
3872
|
-
* 设置查询条件查询
|
|
3873
|
-
* @returns
|
|
3874
|
-
*/
|
|
3875
|
-
}, {
|
|
3876
|
-
key: "fetchSettingQuery",
|
|
3877
|
-
value: function () {
|
|
3878
|
-
var _fetchSettingQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(supportSku, server, extraQuery, supportTags) {
|
|
3879
|
-
var url, list, settingList;
|
|
3880
|
-
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
3881
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
3882
|
-
case 0:
|
|
3883
|
-
url = "".concat(server, "/product-selector/2.0/condition/setting?tenant=").concat(extraQuery);
|
|
3884
|
-
_context5.next = 3;
|
|
3885
|
-
return http.get(url);
|
|
3886
|
-
case 3:
|
|
3887
|
-
list = _context5.sent;
|
|
3888
|
-
settingList = list.data.data;
|
|
3889
|
-
if (!supportTags) {
|
|
3890
|
-
settingList = list.data.data.filter(function (item) {
|
|
3891
|
-
return !item.groupName;
|
|
3892
|
-
});
|
|
3893
|
-
}
|
|
3894
|
-
this.settingQuery = settingList;
|
|
3895
|
-
return _context5.abrupt("return", this.settingQuery || []);
|
|
3896
|
-
case 8:
|
|
3897
|
-
case "end":
|
|
3898
|
-
return _context5.stop();
|
|
3899
|
-
}
|
|
3900
|
-
}, _callee5, this);
|
|
3901
|
-
}));
|
|
3902
|
-
function fetchSettingQuery(_x17, _x18, _x19, _x20) {
|
|
3903
|
-
return _fetchSettingQuery.apply(this, arguments);
|
|
3904
|
-
}
|
|
3905
|
-
return fetchSettingQuery;
|
|
3906
|
-
}()
|
|
3907
|
-
/**
|
|
3908
|
-
* 根据条件查询商品
|
|
3909
|
-
* @param {*} server 服务地址
|
|
3910
|
-
* @param {*} extraQuery 租户信息
|
|
3911
|
-
* @param {*} query 查询条件
|
|
3912
|
-
* @param {*} platShopList 平台&店铺列表
|
|
3913
|
-
* @param {*} history 需要标记为默认选中状态的商品数组(空对象)
|
|
3914
|
-
*/
|
|
3915
|
-
}, {
|
|
3916
|
-
key: "getGoods",
|
|
3917
|
-
value: function () {
|
|
3918
|
-
var _getGoods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(server, extraQuery, query, platShopList) {
|
|
3919
|
-
var history,
|
|
3920
|
-
url,
|
|
3921
|
-
result,
|
|
3922
|
-
mapList,
|
|
3923
|
-
_args6 = arguments;
|
|
3924
|
-
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
3925
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
3926
|
-
case 0:
|
|
3927
|
-
history = _args6.length > 4 && _args6[4] !== undefined ? _args6[4] : {};
|
|
3928
|
-
url = "".concat(server, "/product-selector/2.0/items/base?tenant=").concat(extraQuery, "&pageNo=").concat(query.page.pageNo, "&pageSize=").concat(query.page.pageSize);
|
|
3929
|
-
_context6.next = 4;
|
|
3930
|
-
return http.post(url, query.parameter);
|
|
3931
|
-
case 4:
|
|
3932
|
-
result = _context6.sent;
|
|
3933
|
-
if (result.data.success) {
|
|
3934
|
-
_context6.next = 8;
|
|
3935
|
-
break;
|
|
3936
|
-
}
|
|
3937
|
-
cloudReact.Message.error('服务出错');
|
|
3938
|
-
return _context6.abrupt("return", {
|
|
3939
|
-
data: {},
|
|
3940
|
-
pageNum: query.page.pageNo,
|
|
3941
|
-
pageSize: query.page.pageSize,
|
|
3942
|
-
total: 0
|
|
3943
|
-
});
|
|
3944
|
-
case 8:
|
|
3945
|
-
mapList = {};
|
|
3946
|
-
result.data.data.data.forEach(function (item) {
|
|
3947
|
-
Object.assign(item, {
|
|
3948
|
-
rowExpandable: false
|
|
3949
|
-
}); // 默认添加一个收起状态
|
|
3950
|
-
platShopList.forEach(function (shop) {
|
|
3951
|
-
if (item.shopId === shop.shopId) {
|
|
3952
|
-
Object.assign(item, {
|
|
3953
|
-
shopName: shop.shopName
|
|
3954
|
-
});
|
|
3955
|
-
}
|
|
3956
|
-
});
|
|
3957
|
-
if (history[item.uniProductId]) {
|
|
3958
|
-
// 假如已选中有该商品信息
|
|
3959
|
-
if (history[item.uniProductId].skus.length) {
|
|
3960
|
-
// 假如该商品下已经有被选中的sku时,则默认展开
|
|
3961
|
-
Object.assign(item, {
|
|
3962
|
-
rowExpandable: true
|
|
3963
|
-
});
|
|
3964
|
-
}
|
|
3965
|
-
// item.skus.forEach((sku) => {
|
|
3966
|
-
// history[item.uniProductId].skus.forEach((selectSku) => {
|
|
3967
|
-
// if(sku.skuId === selectSku.skuId) {
|
|
3968
|
-
// Object.assign(item, { rowExpandable: true })
|
|
3969
|
-
// }
|
|
3970
|
-
// })
|
|
3971
|
-
// })
|
|
3972
|
-
}
|
|
3973
|
-
|
|
3974
|
-
mapList[item.uniProductId] = item;
|
|
3975
|
-
});
|
|
3976
|
-
result.data.data.data = mapList;
|
|
3977
|
-
return _context6.abrupt("return", result.data.data);
|
|
3978
|
-
case 12:
|
|
3979
|
-
case "end":
|
|
3980
|
-
return _context6.stop();
|
|
3981
|
-
}
|
|
3982
|
-
}, _callee6);
|
|
3983
|
-
}));
|
|
3984
|
-
function getGoods(_x21, _x22, _x23, _x24) {
|
|
3985
|
-
return _getGoods.apply(this, arguments);
|
|
3986
|
-
}
|
|
3987
|
-
return getGoods;
|
|
3988
|
-
}()
|
|
3989
|
-
/**
|
|
3990
|
-
* 批量导入
|
|
3991
|
-
*/
|
|
3992
|
-
}, {
|
|
3993
|
-
key: "batchImport",
|
|
3994
|
-
value: function () {
|
|
3995
|
-
var _batchImport = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(server, extraQuery, data, platShopList) {
|
|
3996
|
-
var url, result;
|
|
3997
|
-
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
3998
|
-
while (1) switch (_context7.prev = _context7.next) {
|
|
3999
|
-
case 0:
|
|
4000
|
-
url = "".concat(server, "/product-selector/2.0/batch/import?tenant=").concat(extraQuery);
|
|
4001
|
-
_context7.next = 3;
|
|
4002
|
-
return http.post(url, data);
|
|
4003
|
-
case 3:
|
|
4004
|
-
result = _context7.sent;
|
|
4005
|
-
if (result.data.success) {
|
|
4006
|
-
result.data.data.data.forEach(function (item) {
|
|
4007
|
-
Object.assign(item, {
|
|
4008
|
-
rowExpandable: Boolean(data['sku.outer_ids']),
|
|
4009
|
-
checked: !data['sku.outer_ids']
|
|
4010
|
-
});
|
|
4011
|
-
item.skus.forEach(function (sku) {
|
|
4012
|
-
Object.assign(sku, {
|
|
4013
|
-
checked: Boolean(data['sku.outer_ids'])
|
|
4014
|
-
});
|
|
4015
|
-
});
|
|
4016
|
-
platShopList.forEach(function (shop) {
|
|
4017
|
-
if (item.shopId === shop.shopId) {
|
|
4018
|
-
Object.assign(item, {
|
|
4019
|
-
shopName: shop.shopName
|
|
4020
|
-
});
|
|
4021
|
-
}
|
|
4022
|
-
});
|
|
4023
|
-
});
|
|
4024
|
-
}
|
|
4025
|
-
return _context7.abrupt("return", result.data);
|
|
4026
|
-
case 6:
|
|
4027
|
-
case "end":
|
|
4028
|
-
return _context7.stop();
|
|
4029
|
-
}
|
|
4030
|
-
}, _callee7);
|
|
4031
|
-
}));
|
|
4032
|
-
function batchImport(_x25, _x26, _x27, _x28) {
|
|
4033
|
-
return _batchImport.apply(this, arguments);
|
|
4034
|
-
}
|
|
4035
|
-
return batchImport;
|
|
4036
|
-
}()
|
|
4037
|
-
/**
|
|
4038
|
-
* 根据条件查询全部商品数据
|
|
4039
|
-
*/
|
|
4040
|
-
}, {
|
|
4041
|
-
key: "queryAllGoods",
|
|
4042
|
-
value: function () {
|
|
4043
|
-
var _queryAllGoods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(server, extraQuery, data, limit, type, platShopList) {
|
|
4044
|
-
var url, result, arr;
|
|
4045
|
-
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
4046
|
-
while (1) switch (_context8.prev = _context8.next) {
|
|
4047
|
-
case 0:
|
|
4048
|
-
url = "".concat(server, "/product-selector/2.0/items/all?tenant=").concat(extraQuery, "&limit=").concat(limit);
|
|
4049
|
-
_context8.next = 3;
|
|
4050
|
-
return http.post(url, data);
|
|
4051
|
-
case 3:
|
|
4052
|
-
result = _context8.sent;
|
|
4053
|
-
if (result.data.success) {
|
|
4054
|
-
_context8.next = 7;
|
|
4055
|
-
break;
|
|
4056
|
-
}
|
|
4057
|
-
result.data.data = [];
|
|
4058
|
-
return _context8.abrupt("return", result.data);
|
|
4059
|
-
case 7:
|
|
4060
|
-
arr = [];
|
|
4061
|
-
if (result.data.data.length) {
|
|
4062
|
-
if (type === 'goods') {
|
|
4063
|
-
result.data.data.forEach(function (item) {
|
|
4064
|
-
platShopList.forEach(function (shop) {
|
|
4065
|
-
if (item.shopId === shop.shopId) {
|
|
4066
|
-
Object.assign(item, {
|
|
4067
|
-
shopName: shop.shopName
|
|
4068
|
-
});
|
|
4069
|
-
}
|
|
4070
|
-
});
|
|
4071
|
-
Object.assign(item, {
|
|
4072
|
-
rowExpandable: false
|
|
4073
|
-
});
|
|
4074
|
-
arr.push(item);
|
|
4075
|
-
});
|
|
4076
|
-
} else if (type === 'skus') {
|
|
4077
|
-
result.data.data.forEach(function (item) {
|
|
4078
|
-
if (item.skus.length) {
|
|
4079
|
-
Object.assign(item, {
|
|
4080
|
-
rowExpandable: true
|
|
4081
|
-
});
|
|
4082
|
-
arr.push(item);
|
|
4083
|
-
}
|
|
4084
|
-
});
|
|
4085
|
-
}
|
|
4086
|
-
}
|
|
4087
|
-
result.data.data = arr;
|
|
4088
|
-
return _context8.abrupt("return", result.data);
|
|
4089
|
-
case 11:
|
|
4090
|
-
case "end":
|
|
4091
|
-
return _context8.stop();
|
|
4092
|
-
}
|
|
4093
|
-
}, _callee8);
|
|
4094
|
-
}));
|
|
4095
|
-
function queryAllGoods(_x29, _x30, _x31, _x32, _x33, _x34) {
|
|
4096
|
-
return _queryAllGoods.apply(this, arguments);
|
|
4097
|
-
}
|
|
4098
|
-
return queryAllGoods;
|
|
4099
|
-
}()
|
|
4100
|
-
/**
|
|
4101
|
-
* 查询用户已保存的查询条件
|
|
4102
|
-
* @param {*} server 服务地址
|
|
4103
|
-
* @param {*} extraQuery 租户信息
|
|
4104
|
-
*/
|
|
4105
|
-
}, {
|
|
4106
|
-
key: "conditionFindAll",
|
|
4107
|
-
value: function () {
|
|
4108
|
-
var _conditionFindAll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(server, extraQuery) {
|
|
4109
|
-
var url, result;
|
|
4110
|
-
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
4111
|
-
while (1) switch (_context9.prev = _context9.next) {
|
|
4112
|
-
case 0:
|
|
4113
|
-
url = "".concat(server, "/product-selector/2.0/condition/findAll?tenant=").concat(extraQuery);
|
|
4114
|
-
_context9.next = 3;
|
|
4115
|
-
return http.post(url, {});
|
|
4116
|
-
case 3:
|
|
4117
|
-
result = _context9.sent;
|
|
4118
|
-
return _context9.abrupt("return", result.data);
|
|
4119
|
-
case 5:
|
|
4120
|
-
case "end":
|
|
4121
|
-
return _context9.stop();
|
|
4122
|
-
}
|
|
4123
|
-
}, _callee9);
|
|
4124
|
-
}));
|
|
4125
|
-
function conditionFindAll(_x35, _x36) {
|
|
4126
|
-
return _conditionFindAll.apply(this, arguments);
|
|
4127
|
-
}
|
|
4128
|
-
return conditionFindAll;
|
|
4129
|
-
}()
|
|
4130
|
-
/**
|
|
4131
|
-
* 验证条件名称是否存在
|
|
4132
|
-
* @param {*} server 服务地址
|
|
4133
|
-
* @param {*} extraQuery 租户信息
|
|
4134
|
-
* @param {*} name 条件名称
|
|
4135
|
-
*/
|
|
4136
|
-
}, {
|
|
4137
|
-
key: "validationConditionName",
|
|
4138
|
-
value: function () {
|
|
4139
|
-
var _validationConditionName = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(server, extraQuery, name) {
|
|
4140
|
-
var url, result;
|
|
4141
|
-
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
4142
|
-
while (1) switch (_context10.prev = _context10.next) {
|
|
4143
|
-
case 0:
|
|
4144
|
-
url = "".concat(server, "/product-selector/2.0/condition/name/check?tenant=").concat(extraQuery);
|
|
4145
|
-
_context10.next = 3;
|
|
4146
|
-
return http.post(url, {
|
|
4147
|
-
conditionName: name
|
|
4148
|
-
});
|
|
4149
|
-
case 3:
|
|
4150
|
-
result = _context10.sent;
|
|
4151
|
-
return _context10.abrupt("return", result.data);
|
|
4152
|
-
case 5:
|
|
4153
|
-
case "end":
|
|
4154
|
-
return _context10.stop();
|
|
4155
|
-
}
|
|
4156
|
-
}, _callee10);
|
|
4157
|
-
}));
|
|
4158
|
-
function validationConditionName(_x37, _x38, _x39) {
|
|
4159
|
-
return _validationConditionName.apply(this, arguments);
|
|
4160
|
-
}
|
|
4161
|
-
return validationConditionName;
|
|
4162
|
-
}()
|
|
4163
|
-
/**
|
|
4164
|
-
* 手动创建新的查询条件
|
|
4165
|
-
* @param {*} server 服务地址
|
|
4166
|
-
* @param {*} extraQuery 租户信息
|
|
4167
|
-
* @param {*} data
|
|
4168
|
-
*/
|
|
4169
|
-
}, {
|
|
4170
|
-
key: "saveCondition",
|
|
4171
|
-
value: function () {
|
|
4172
|
-
var _saveCondition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(server, extraQuery, data) {
|
|
4173
|
-
var url, result;
|
|
4174
|
-
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
4175
|
-
while (1) switch (_context11.prev = _context11.next) {
|
|
4176
|
-
case 0:
|
|
4177
|
-
url = "".concat(server, "/product-selector/2.0/condition/save/manual?tenant=").concat(extraQuery);
|
|
4178
|
-
_context11.next = 3;
|
|
4179
|
-
return http.post(url, data);
|
|
4180
|
-
case 3:
|
|
4181
|
-
result = _context11.sent;
|
|
4182
|
-
return _context11.abrupt("return", result.data);
|
|
4183
|
-
case 5:
|
|
4184
|
-
case "end":
|
|
4185
|
-
return _context11.stop();
|
|
4186
|
-
}
|
|
4187
|
-
}, _callee11);
|
|
4188
|
-
}));
|
|
4189
|
-
function saveCondition(_x40, _x41, _x42) {
|
|
4190
|
-
return _saveCondition.apply(this, arguments);
|
|
4191
|
-
}
|
|
4192
|
-
return saveCondition;
|
|
4193
|
-
}()
|
|
4194
|
-
/**
|
|
4195
|
-
* 删除已经保存的查询条件
|
|
4196
|
-
* @param {*} server 服务地址
|
|
4197
|
-
* @param {*} extraQuery 租户信息
|
|
4198
|
-
* @param {*} id 条件id
|
|
4199
|
-
* @returns
|
|
4200
|
-
*/
|
|
4201
|
-
}, {
|
|
4202
|
-
key: "deleteCondition",
|
|
4203
|
-
value: function () {
|
|
4204
|
-
var _deleteCondition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(server, extraQuery, id) {
|
|
4205
|
-
var url, result;
|
|
4206
|
-
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
4207
|
-
while (1) switch (_context12.prev = _context12.next) {
|
|
4208
|
-
case 0:
|
|
4209
|
-
url = "".concat(server, "/product-selector/2.0/condition/delete?tenant=").concat(extraQuery);
|
|
4210
|
-
_context12.next = 3;
|
|
4211
|
-
return http.post(url, {
|
|
4212
|
-
id: id
|
|
4213
|
-
});
|
|
4214
|
-
case 3:
|
|
4215
|
-
result = _context12.sent;
|
|
4216
|
-
return _context12.abrupt("return", result.data);
|
|
4217
|
-
case 5:
|
|
4218
|
-
case "end":
|
|
4219
|
-
return _context12.stop();
|
|
4220
|
-
}
|
|
4221
|
-
}, _callee12);
|
|
4222
|
-
}));
|
|
4223
|
-
function deleteCondition(_x43, _x44, _x45) {
|
|
4224
|
-
return _deleteCondition.apply(this, arguments);
|
|
4225
|
-
}
|
|
4226
|
-
return deleteCondition;
|
|
4227
|
-
}()
|
|
4228
|
-
/**
|
|
4229
|
-
* 重命名条件名称
|
|
4230
|
-
* @param {*} server 服务地址
|
|
4231
|
-
* @param {*} extraQuery 租户信息
|
|
4232
|
-
* @param {*} data
|
|
4233
|
-
*/
|
|
4234
|
-
}, {
|
|
4235
|
-
key: "renameCondition",
|
|
4236
|
-
value: function () {
|
|
4237
|
-
var _renameCondition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(server, extraQuery, data) {
|
|
4238
|
-
var url, result;
|
|
4239
|
-
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
4240
|
-
while (1) switch (_context13.prev = _context13.next) {
|
|
4241
|
-
case 0:
|
|
4242
|
-
url = "".concat(server, "/product-selector/2.0/condition/rename?tenant=").concat(extraQuery);
|
|
4243
|
-
_context13.next = 3;
|
|
4244
|
-
return http.post(url, data);
|
|
4245
|
-
case 3:
|
|
4246
|
-
result = _context13.sent;
|
|
4247
|
-
return _context13.abrupt("return", result.data);
|
|
4248
|
-
case 5:
|
|
4249
|
-
case "end":
|
|
4250
|
-
return _context13.stop();
|
|
4251
|
-
}
|
|
4252
|
-
}, _callee13);
|
|
4253
|
-
}));
|
|
4254
|
-
function renameCondition(_x46, _x47, _x48) {
|
|
4255
|
-
return _renameCondition.apply(this, arguments);
|
|
4256
|
-
}
|
|
4257
|
-
return renameCondition;
|
|
4258
|
-
}()
|
|
4259
|
-
/**
|
|
4260
|
-
* 自动保存查用查询条件
|
|
4261
|
-
* @param {*} server 服务地址
|
|
4262
|
-
* @param {*} extraQuery 租户信息
|
|
4263
|
-
* @param {*} data
|
|
4264
|
-
*/
|
|
4265
|
-
}, {
|
|
4266
|
-
key: "autoSaveCondition",
|
|
4267
|
-
value: function () {
|
|
4268
|
-
var _autoSaveCondition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(server, extraQuery, data) {
|
|
4269
|
-
var url, result;
|
|
4270
|
-
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
4271
|
-
while (1) switch (_context14.prev = _context14.next) {
|
|
4272
|
-
case 0:
|
|
4273
|
-
url = "".concat(server, "/product-selector/2.0/condition/save/auto?tenant=").concat(extraQuery);
|
|
4274
|
-
_context14.next = 3;
|
|
4275
|
-
return http.post(url, data);
|
|
4276
|
-
case 3:
|
|
4277
|
-
result = _context14.sent;
|
|
4278
|
-
return _context14.abrupt("return", result.data);
|
|
4279
|
-
case 5:
|
|
4280
|
-
case "end":
|
|
4281
|
-
return _context14.stop();
|
|
4282
|
-
}
|
|
4283
|
-
}, _callee14);
|
|
4284
|
-
}));
|
|
4285
|
-
function autoSaveCondition(_x49, _x50, _x51) {
|
|
4286
|
-
return _autoSaveCondition.apply(this, arguments);
|
|
4287
|
-
}
|
|
4288
|
-
return autoSaveCondition;
|
|
4289
|
-
}()
|
|
4290
|
-
/**
|
|
4291
|
-
* 用户已存储条件总条数
|
|
4292
|
-
* @param {*} server
|
|
4293
|
-
* @param {*} extraQuery
|
|
4294
|
-
*/
|
|
4295
|
-
}, {
|
|
4296
|
-
key: "findConditionCount",
|
|
4297
|
-
value: function () {
|
|
4298
|
-
var _findConditionCount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(server, extraQuery) {
|
|
4299
|
-
var url, result;
|
|
4300
|
-
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
4301
|
-
while (1) switch (_context15.prev = _context15.next) {
|
|
4302
|
-
case 0:
|
|
4303
|
-
url = "".concat(server, "/product-selector/2.0/condition/count?tenant=").concat(extraQuery);
|
|
4304
|
-
_context15.next = 3;
|
|
4305
|
-
return http.post(url, {});
|
|
4306
|
-
case 3:
|
|
4307
|
-
result = _context15.sent;
|
|
4308
|
-
return _context15.abrupt("return", result.data);
|
|
4309
|
-
case 5:
|
|
4310
|
-
case "end":
|
|
4311
|
-
return _context15.stop();
|
|
4312
|
-
}
|
|
4313
|
-
}, _callee15);
|
|
4314
|
-
}));
|
|
4315
|
-
function findConditionCount(_x52, _x53) {
|
|
4316
|
-
return _findConditionCount.apply(this, arguments);
|
|
4317
|
-
}
|
|
4318
|
-
return findConditionCount;
|
|
4319
|
-
}()
|
|
4320
|
-
/**
|
|
4321
|
-
* 根据平台code,店铺ID获取购物金类目ID
|
|
4322
|
-
* @param {*} server
|
|
4323
|
-
* @param {*} extraQuery
|
|
4324
|
-
* @param {*} data
|
|
4325
|
-
*/
|
|
4326
|
-
}, {
|
|
4327
|
-
key: "getShoppingGold",
|
|
4328
|
-
value: function () {
|
|
4329
|
-
var _getShoppingGold = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(server, extraQuery, data) {
|
|
4330
|
-
var url;
|
|
4331
|
-
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
4332
|
-
while (1) switch (_context16.prev = _context16.next) {
|
|
4333
|
-
case 0:
|
|
4334
|
-
url = "".concat(server, "/product-selector/2.0/cate/std_cate_card?tenant=").concat(extraQuery);
|
|
4335
|
-
return _context16.abrupt("return", http.post(url, data));
|
|
4336
|
-
case 2:
|
|
4337
|
-
case "end":
|
|
4338
|
-
return _context16.stop();
|
|
4339
|
-
}
|
|
4340
|
-
}, _callee16);
|
|
4341
|
-
}));
|
|
4342
|
-
function getShoppingGold(_x54, _x55, _x56) {
|
|
4343
|
-
return _getShoppingGold.apply(this, arguments);
|
|
4344
|
-
}
|
|
4345
|
-
return getShoppingGold;
|
|
4346
|
-
}()
|
|
4347
|
-
}]);
|
|
4348
|
-
return Store;
|
|
4349
|
-
}();
|
|
4350
|
-
var Store$1 = new Store();
|
|
4351
|
-
|
|
4352
3720
|
var shuyunUtils = createCommonjsModule(function (module, exports) {
|
|
4353
3721
|
(function () {var b={};function p(o){return (p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o})(o)}var c=function(o,t){return JSON.stringify(o)===JSON.stringify(t)};var q=function(o,t){var e=-1;return o.some(function(o,r){return c(o,t)&&(e=r),c(o,t)}),e};var u=function(o){return JSON.parse(JSON.stringify(o))};var v=function(o){var t=!0;for(var e in o)o.hasOwnProperty(e)&&(t=!1);return t};var d=function(o){return {"[object String]":"string","[object Boolean]":"boolean","[object Undefined]":"undefined","[object Number]":"number","[object Object]":"object","[object Error]":"error","[object Function]":"function","[object Date]":"date","[object Array]":"array","[object RegExp]":"regexp","[object Null]":"null","[object NodeList]":"nodeList","[object Arguments]":"arguments","[object Window]":"window","[object HTMLDocument]":"document"}[Object.prototype.toString.call(o)]||(o instanceof Element?"element":"")};var w=function(o){return "string"==typeof o?o.trim():Object.keys(o).reduce(function(t,e){var r=o[e];return "undefined"===d(r)||"null"===d(r)?t:(t[e]=r,t)},{})};var x=function(o){var t="";for(var e in o){var r=o[e];r="object"===p(r)?JSON.stringify(r):r,t="".concat(t,"&").concat(e,"=").concat(r);}return t.replace("&","")};function f(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),t.push.apply(t,o);}return t}function g(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?f(Object(t),!0).forEach(function(e){h(r,e,t[e]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e));});}return r}function h(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function y(r,e){return C(r)||B(r,e)||A(r,e)||z()}function z(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function A(r,e){if(r){if("string"==typeof r)return j(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return "Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?j(r,e):void 0}}function j(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,o=new Array(e);t<e;t++)o[t]=r[t];return o}function B(r,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r)){var t=[],o=!0,n=!1,a=void 0;try{for(var $,s=r[Symbol.iterator]();!(o=($=s.next()).done)&&(t.push($.value),!e||t.length!==e);o=!0);}catch(i){n=!0,a=i;}finally{try{o||null==s.return||s.return();}finally{if(n)throw a}}return t}}function C(r){if(Array.isArray(r))return r}var D=function(r){return r.replace(/-\w/g,function(r){return r.split("-")[1].toUpperCase()})};var E=function(r){return r.replace(/([A-Z])/g,"-$1").toLowerCase()};var F=function(r){return r.replace(/^\?/,"").split("&").reduce(function(r,e){var t=y(e.split("="),2),o=t[0],n=t[1],a=void 0===n?"":n;return g(g({},r),{},h({},o,a))},{})};var k=function(e,t,r,n){var o={percentile:{digits:100,sign:"%"},thousands:{digits:1e3,sign:"\u2030"}}[e],s=Math.pow(10,r),$=parseInt(t*o.digits*s,10)/s;return n?Number($).toFixed(r)+o.sign:$+o.sign},G=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return k("percentile",e,t,r)};var H=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return k("thousands",e,t,r)};var I=function(e){var t=document.createElement("input");t.style.cssText="position:absolute;top:0;z-index: -999;",t.value=e,document.body.appendChild(t),t.select();var o=document.execCommand("copy");return t.remove(),o};var J=function(e){var t=document.createElement("div");t.style.display="inline-block",t.style.opacity="0",t.innerText=e,document.body.appendChild(t);var o=window.getComputedStyle(t).width;return document.body.removeChild(t),parseInt(o,10)};var K=function(t,e){var o=Blob.prototype,n=null;if(Object.getPrototypeOf(t)===o&&(n=t),t.data&&Object.getPrototypeOf(t.data)===o&&(n=t.data),!n||Object.getPrototypeOf(n)!==o)return !1;var r=document.createElement("a");r.addEventListener("click",function(){r.download=e,r.href=Window.URL.createObjectURL(n);});var a=document.createEvent("MouseEvents");return a.initEvent("click",!1,!1),r.dispatchEvent(a),!0};function L(t){return (L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function M(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a);}}function N(t,e,r){return e&&l(t.prototype,e),r&&l(t,r),t}var O=function(){function t(e){switch(M(this,t),L(e)){case"number":if(13===e.toString().length)return void this.parseDate(new Date(e));this.parseStr(e.toString());break;case"string":this.parseStr(e);break;case"object":this.parseDate(e.constructor===Date?e:new Date);break;default:this.parseDate(new Date);}}return N(t,[{key:"parseStr",value:function(t){var e=t.replace(/\D/g,""),r={fullYear_str:e.substr(0,4),year_str:e.substr(2,4),month_str:e.substr(4,2),date_str:e.substr(6,2),hour_str:e.substr(8,2),minute_str:e.substr(10,2),second_str:e.substr(12,2)};if(r.fullYear_str&&r.month_str&&r.date_str){var a="".concat(r.fullYear_str,"/").concat(r.month_str,"/").concat(r.date_str," ").concat(r.hour_str||"00",":").concat(r.minute_str||"00",":").concat(r.second_str||"00");this.parseDate(new Date(a));}else this.parseDate(new Date);}},{key:"parseDate",value:function(t){this.fullYear=t.getFullYear(),this.year=parseInt(t.getFullYear().toString().substr(2,2)),this.month=t.getMonth()+1,this.date=t.getDate(),this.hour=t.getHours(),this.minute=t.getMinutes(),this.second=t.getSeconds(),this.day=t.getDay();}},{key:"format",value:function(t){return t.replace(/YYYY/i,this.fullYear).replace(/YY/i,this.year<10?"0".concat(this.year):this.year).replace(/MM/,this.month<10?"0".concat(this.month):this.month).replace(/DD/i,this.date<10?"0".concat(this.date):this.date).replace(/HH/i,this.hour<10?"0".concat(this.hour):this.hour).replace(/mm/,this.minute<10?"0".concat(this.minute):this.minute).replace(/ss/i,this.second<10?"0".concat(this.second):this.second)}}]),t}(),P=function(t){return new O(t)};var m={copyText:I,getTextWidth:J,moment:P,equal:c,index:q,clone:u,isEmpty:v,type:d,trim:w,toQueryString:x,toHump:D,toHyphen:E,toFormData:F,toPercentile:G,toThousands:H,download:K};b.default=m,b=m;{module.exports=b;}})();
|
|
4354
3722
|
});
|
|
@@ -4451,6 +3819,20 @@
|
|
|
4451
3819
|
return obj;
|
|
4452
3820
|
}
|
|
4453
3821
|
|
|
3822
|
+
/**
|
|
3823
|
+
* 过滤对象中空属性
|
|
3824
|
+
* @param {*} obj
|
|
3825
|
+
* @returns
|
|
3826
|
+
*/
|
|
3827
|
+
function filterNullValueObject(obj) {
|
|
3828
|
+
for (var i in obj) {
|
|
3829
|
+
if (obj[i] === '' || obj[i] === null || obj[i] === 'null') {
|
|
3830
|
+
delete obj[i];
|
|
3831
|
+
}
|
|
3832
|
+
}
|
|
3833
|
+
return obj;
|
|
3834
|
+
}
|
|
3835
|
+
|
|
4454
3836
|
/**
|
|
4455
3837
|
* 数组去重
|
|
4456
3838
|
*/
|
|
@@ -4983,6 +4365,638 @@
|
|
|
4983
4365
|
return len;
|
|
4984
4366
|
}
|
|
4985
4367
|
|
|
4368
|
+
var Store = /*#__PURE__*/function () {
|
|
4369
|
+
function Store() {
|
|
4370
|
+
_classCallCheck(this, Store);
|
|
4371
|
+
this.queryCondition = [];
|
|
4372
|
+
this.originCondition = [];
|
|
4373
|
+
this.settingQuery = [];
|
|
4374
|
+
}
|
|
4375
|
+
_createClass(Store, [{
|
|
4376
|
+
key: "getGoodsCategory",
|
|
4377
|
+
value:
|
|
4378
|
+
/**
|
|
4379
|
+
* 查询标准类目
|
|
4380
|
+
*/
|
|
4381
|
+
function () {
|
|
4382
|
+
var _getGoodsCategory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(server, extraQuery, platCode) {
|
|
4383
|
+
var url;
|
|
4384
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
4385
|
+
while (1) switch (_context.prev = _context.next) {
|
|
4386
|
+
case 0:
|
|
4387
|
+
url = "".concat(server, "/product-selector/2.0/cate/std_cate?tenant=").concat(extraQuery);
|
|
4388
|
+
return _context.abrupt("return", http.post(url, platCode));
|
|
4389
|
+
case 2:
|
|
4390
|
+
case "end":
|
|
4391
|
+
return _context.stop();
|
|
4392
|
+
}
|
|
4393
|
+
}, _callee);
|
|
4394
|
+
}));
|
|
4395
|
+
function getGoodsCategory(_x, _x2, _x3) {
|
|
4396
|
+
return _getGoodsCategory.apply(this, arguments);
|
|
4397
|
+
}
|
|
4398
|
+
return getGoodsCategory;
|
|
4399
|
+
}()
|
|
4400
|
+
/**
|
|
4401
|
+
* 埋点
|
|
4402
|
+
*/
|
|
4403
|
+
}, {
|
|
4404
|
+
key: "bury",
|
|
4405
|
+
value: function bury(server, param) {
|
|
4406
|
+
var url = "".concat(server, "/product-selector/2.0/statistic/tenant/use");
|
|
4407
|
+
return http.post(url, param);
|
|
4408
|
+
}
|
|
4409
|
+
|
|
4410
|
+
/**
|
|
4411
|
+
* 查询店铺自定义类目
|
|
4412
|
+
*/
|
|
4413
|
+
}, {
|
|
4414
|
+
key: "getGoodsDefaultCategory",
|
|
4415
|
+
value: function () {
|
|
4416
|
+
var _getGoodsDefaultCategory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(server, extraQuery, platCode) {
|
|
4417
|
+
var url;
|
|
4418
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
4419
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
4420
|
+
case 0:
|
|
4421
|
+
url = "".concat(server, "/product-selector/2.0/cate/user_defined_cate?tenant=").concat(extraQuery);
|
|
4422
|
+
return _context2.abrupt("return", http.post(url, platCode));
|
|
4423
|
+
case 2:
|
|
4424
|
+
case "end":
|
|
4425
|
+
return _context2.stop();
|
|
4426
|
+
}
|
|
4427
|
+
}, _callee2);
|
|
4428
|
+
}));
|
|
4429
|
+
function getGoodsDefaultCategory(_x4, _x5, _x6) {
|
|
4430
|
+
return _getGoodsDefaultCategory.apply(this, arguments);
|
|
4431
|
+
}
|
|
4432
|
+
return getGoodsDefaultCategory;
|
|
4433
|
+
}()
|
|
4434
|
+
}, {
|
|
4435
|
+
key: "configBizzKey",
|
|
4436
|
+
value: function configBizzKey(bizzKey, supportSku, _url) {
|
|
4437
|
+
if (bizzKey) {
|
|
4438
|
+
return "".concat(_url, "&bizzKey=").concat(bizzKey);
|
|
4439
|
+
}
|
|
4440
|
+
return supportSku ? "".concat(_url, "&bizzKey=10001") : _url;
|
|
4441
|
+
}
|
|
4442
|
+
|
|
4443
|
+
/**
|
|
4444
|
+
* 全部商品条件保存
|
|
4445
|
+
* @param {*} server
|
|
4446
|
+
* @param {*} extraQuery
|
|
4447
|
+
* @returns
|
|
4448
|
+
*/
|
|
4449
|
+
}, {
|
|
4450
|
+
key: "saveQueryCondition",
|
|
4451
|
+
value: function () {
|
|
4452
|
+
var _saveQueryCondition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(server, extraQuery, params, bizzKey, supportSku) {
|
|
4453
|
+
var _url, url;
|
|
4454
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
4455
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
4456
|
+
case 0:
|
|
4457
|
+
_url = "".concat(server, "/product-selector/2.0/custom/saveUserCustom?tenant=").concat(extraQuery);
|
|
4458
|
+
url = this.configBizzKey(bizzKey, supportSku, _url);
|
|
4459
|
+
return _context3.abrupt("return", http.post(url, params));
|
|
4460
|
+
case 3:
|
|
4461
|
+
case "end":
|
|
4462
|
+
return _context3.stop();
|
|
4463
|
+
}
|
|
4464
|
+
}, _callee3, this);
|
|
4465
|
+
}));
|
|
4466
|
+
function saveQueryCondition(_x7, _x8, _x9, _x10, _x11) {
|
|
4467
|
+
return _saveQueryCondition.apply(this, arguments);
|
|
4468
|
+
}
|
|
4469
|
+
return saveQueryCondition;
|
|
4470
|
+
}()
|
|
4471
|
+
/**
|
|
4472
|
+
* 全部商品条件查询
|
|
4473
|
+
*/
|
|
4474
|
+
}, {
|
|
4475
|
+
key: "fetchAllquery",
|
|
4476
|
+
value: function () {
|
|
4477
|
+
var _fetchAllquery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(supportSku, server, extraQuery, supportTags, bizzKey) {
|
|
4478
|
+
var _url, url, list, _queryCondition;
|
|
4479
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
4480
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
4481
|
+
case 0:
|
|
4482
|
+
_url = "".concat(server, "/product-selector/2.0/custom/getCustom?tenant=").concat(extraQuery);
|
|
4483
|
+
url = this.configBizzKey(bizzKey, supportSku, _url);
|
|
4484
|
+
_context4.next = 4;
|
|
4485
|
+
return http.get(url);
|
|
4486
|
+
case 4:
|
|
4487
|
+
list = _context4.sent;
|
|
4488
|
+
_queryCondition = list.data.data;
|
|
4489
|
+
this.originCondition = list.data.data;
|
|
4490
|
+
if (!supportSku) {
|
|
4491
|
+
_queryCondition = _queryCondition.filter(function (item) {
|
|
4492
|
+
return ['sku_sku_id', 'sku_specification', 'sku_outer_id', 'sku_flag'].includes(item.itemId) === false;
|
|
4493
|
+
});
|
|
4494
|
+
}
|
|
4495
|
+
if (!supportTags) {
|
|
4496
|
+
_queryCondition = _queryCondition.filter(function (item) {
|
|
4497
|
+
return !item.groupName;
|
|
4498
|
+
});
|
|
4499
|
+
}
|
|
4500
|
+
this.queryCondition = _queryCondition.map(function (el) {
|
|
4501
|
+
return _objectSpread2(_objectSpread2({}, el), {}, {
|
|
4502
|
+
value: el.itemId,
|
|
4503
|
+
label: el.itemName,
|
|
4504
|
+
status: el.status === 3 ? 4 : el.status
|
|
4505
|
+
});
|
|
4506
|
+
});
|
|
4507
|
+
return _context4.abrupt("return", this.queryCondition);
|
|
4508
|
+
case 11:
|
|
4509
|
+
case "end":
|
|
4510
|
+
return _context4.stop();
|
|
4511
|
+
}
|
|
4512
|
+
}, _callee4, this);
|
|
4513
|
+
}));
|
|
4514
|
+
function fetchAllquery(_x12, _x13, _x14, _x15, _x16) {
|
|
4515
|
+
return _fetchAllquery.apply(this, arguments);
|
|
4516
|
+
}
|
|
4517
|
+
return fetchAllquery;
|
|
4518
|
+
}()
|
|
4519
|
+
/**
|
|
4520
|
+
* 设置查询条件查询
|
|
4521
|
+
* @returns
|
|
4522
|
+
*/
|
|
4523
|
+
}, {
|
|
4524
|
+
key: "fetchSettingQuery",
|
|
4525
|
+
value: function () {
|
|
4526
|
+
var _fetchSettingQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(supportSku, server, extraQuery, supportTags) {
|
|
4527
|
+
var url, list, settingList;
|
|
4528
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
4529
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
4530
|
+
case 0:
|
|
4531
|
+
url = "".concat(server, "/product-selector/2.0/condition/setting?tenant=").concat(extraQuery);
|
|
4532
|
+
_context5.next = 3;
|
|
4533
|
+
return http.get(url);
|
|
4534
|
+
case 3:
|
|
4535
|
+
list = _context5.sent;
|
|
4536
|
+
settingList = list.data.data;
|
|
4537
|
+
if (!supportTags) {
|
|
4538
|
+
settingList = list.data.data.filter(function (item) {
|
|
4539
|
+
return !item.groupName;
|
|
4540
|
+
});
|
|
4541
|
+
}
|
|
4542
|
+
this.settingQuery = settingList;
|
|
4543
|
+
return _context5.abrupt("return", this.settingQuery || []);
|
|
4544
|
+
case 8:
|
|
4545
|
+
case "end":
|
|
4546
|
+
return _context5.stop();
|
|
4547
|
+
}
|
|
4548
|
+
}, _callee5, this);
|
|
4549
|
+
}));
|
|
4550
|
+
function fetchSettingQuery(_x17, _x18, _x19, _x20) {
|
|
4551
|
+
return _fetchSettingQuery.apply(this, arguments);
|
|
4552
|
+
}
|
|
4553
|
+
return fetchSettingQuery;
|
|
4554
|
+
}()
|
|
4555
|
+
/**
|
|
4556
|
+
* 根据条件查询商品
|
|
4557
|
+
* @param {*} server 服务地址
|
|
4558
|
+
* @param {*} extraQuery 租户信息
|
|
4559
|
+
* @param {*} query 查询条件
|
|
4560
|
+
* @param {*} platShopList 平台&店铺列表
|
|
4561
|
+
* @param {*} history 需要标记为默认选中状态的商品数组(空对象)
|
|
4562
|
+
*/
|
|
4563
|
+
}, {
|
|
4564
|
+
key: "getGoods",
|
|
4565
|
+
value: function () {
|
|
4566
|
+
var _getGoods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(server, extraQuery, query, platShopList) {
|
|
4567
|
+
var history,
|
|
4568
|
+
url,
|
|
4569
|
+
result,
|
|
4570
|
+
mapList,
|
|
4571
|
+
_args6 = arguments;
|
|
4572
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
4573
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
4574
|
+
case 0:
|
|
4575
|
+
history = _args6.length > 4 && _args6[4] !== undefined ? _args6[4] : {};
|
|
4576
|
+
url = "".concat(server, "/product-selector/2.0/items/base?tenant=").concat(extraQuery, "&pageNo=").concat(query.page.pageNo, "&pageSize=").concat(query.page.pageSize);
|
|
4577
|
+
_context6.next = 4;
|
|
4578
|
+
return http.post(url, query.parameter);
|
|
4579
|
+
case 4:
|
|
4580
|
+
result = _context6.sent;
|
|
4581
|
+
if (result.data.success) {
|
|
4582
|
+
_context6.next = 8;
|
|
4583
|
+
break;
|
|
4584
|
+
}
|
|
4585
|
+
cloudReact.Message.error('服务出错');
|
|
4586
|
+
return _context6.abrupt("return", {
|
|
4587
|
+
data: {},
|
|
4588
|
+
pageNum: query.page.pageNo,
|
|
4589
|
+
pageSize: query.page.pageSize,
|
|
4590
|
+
total: 0
|
|
4591
|
+
});
|
|
4592
|
+
case 8:
|
|
4593
|
+
mapList = {};
|
|
4594
|
+
result.data.data.data.forEach(function (item) {
|
|
4595
|
+
Object.assign(item, {
|
|
4596
|
+
rowExpandable: false
|
|
4597
|
+
}); // 默认添加一个收起状态
|
|
4598
|
+
platShopList.forEach(function (shop) {
|
|
4599
|
+
if (item.shopId === shop.shopId) {
|
|
4600
|
+
Object.assign(item, {
|
|
4601
|
+
shopName: shop.shopName
|
|
4602
|
+
});
|
|
4603
|
+
}
|
|
4604
|
+
});
|
|
4605
|
+
if (history[item.uniProductId]) {
|
|
4606
|
+
// 假如已选中有该商品信息
|
|
4607
|
+
if (history[item.uniProductId].skus.length) {
|
|
4608
|
+
// 假如该商品下已经有被选中的sku时,则默认展开
|
|
4609
|
+
Object.assign(item, {
|
|
4610
|
+
rowExpandable: true
|
|
4611
|
+
});
|
|
4612
|
+
}
|
|
4613
|
+
// item.skus.forEach((sku) => {
|
|
4614
|
+
// history[item.uniProductId].skus.forEach((selectSku) => {
|
|
4615
|
+
// if(sku.skuId === selectSku.skuId) {
|
|
4616
|
+
// Object.assign(item, { rowExpandable: true })
|
|
4617
|
+
// }
|
|
4618
|
+
// })
|
|
4619
|
+
// })
|
|
4620
|
+
}
|
|
4621
|
+
|
|
4622
|
+
mapList[item.uniProductId] = item;
|
|
4623
|
+
});
|
|
4624
|
+
result.data.data.data = mapList;
|
|
4625
|
+
return _context6.abrupt("return", result.data.data);
|
|
4626
|
+
case 12:
|
|
4627
|
+
case "end":
|
|
4628
|
+
return _context6.stop();
|
|
4629
|
+
}
|
|
4630
|
+
}, _callee6);
|
|
4631
|
+
}));
|
|
4632
|
+
function getGoods(_x21, _x22, _x23, _x24) {
|
|
4633
|
+
return _getGoods.apply(this, arguments);
|
|
4634
|
+
}
|
|
4635
|
+
return getGoods;
|
|
4636
|
+
}()
|
|
4637
|
+
/**
|
|
4638
|
+
* 批量导入
|
|
4639
|
+
*/
|
|
4640
|
+
}, {
|
|
4641
|
+
key: "batchImport",
|
|
4642
|
+
value: function () {
|
|
4643
|
+
var _batchImport = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(server, extraQuery, data, platShopList) {
|
|
4644
|
+
var url, result;
|
|
4645
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
4646
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
4647
|
+
case 0:
|
|
4648
|
+
url = "".concat(server, "/product-selector/2.0/batch/import?tenant=").concat(extraQuery);
|
|
4649
|
+
_context7.next = 3;
|
|
4650
|
+
return http.post(url, filterNullValueObject(data));
|
|
4651
|
+
case 3:
|
|
4652
|
+
result = _context7.sent;
|
|
4653
|
+
if (result.data.success) {
|
|
4654
|
+
result.data.data.data.forEach(function (item) {
|
|
4655
|
+
Object.assign(item, {
|
|
4656
|
+
rowExpandable: Boolean(data['sku.outer_ids']),
|
|
4657
|
+
checked: !data['sku.outer_ids']
|
|
4658
|
+
});
|
|
4659
|
+
item.skus.forEach(function (sku) {
|
|
4660
|
+
Object.assign(sku, {
|
|
4661
|
+
checked: Boolean(data['sku.outer_ids'])
|
|
4662
|
+
});
|
|
4663
|
+
});
|
|
4664
|
+
platShopList.forEach(function (shop) {
|
|
4665
|
+
if (item.shopId === shop.shopId) {
|
|
4666
|
+
Object.assign(item, {
|
|
4667
|
+
shopName: shop.shopName
|
|
4668
|
+
});
|
|
4669
|
+
}
|
|
4670
|
+
});
|
|
4671
|
+
});
|
|
4672
|
+
}
|
|
4673
|
+
return _context7.abrupt("return", result.data);
|
|
4674
|
+
case 6:
|
|
4675
|
+
case "end":
|
|
4676
|
+
return _context7.stop();
|
|
4677
|
+
}
|
|
4678
|
+
}, _callee7);
|
|
4679
|
+
}));
|
|
4680
|
+
function batchImport(_x25, _x26, _x27, _x28) {
|
|
4681
|
+
return _batchImport.apply(this, arguments);
|
|
4682
|
+
}
|
|
4683
|
+
return batchImport;
|
|
4684
|
+
}()
|
|
4685
|
+
/**
|
|
4686
|
+
* 根据条件查询全部商品数据
|
|
4687
|
+
*/
|
|
4688
|
+
}, {
|
|
4689
|
+
key: "queryAllGoods",
|
|
4690
|
+
value: function () {
|
|
4691
|
+
var _queryAllGoods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(server, extraQuery, data, limit, type, platShopList) {
|
|
4692
|
+
var url, result, arr;
|
|
4693
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
4694
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
4695
|
+
case 0:
|
|
4696
|
+
url = "".concat(server, "/product-selector/2.0/items/all?tenant=").concat(extraQuery, "&limit=").concat(limit);
|
|
4697
|
+
_context8.next = 3;
|
|
4698
|
+
return http.post(url, data);
|
|
4699
|
+
case 3:
|
|
4700
|
+
result = _context8.sent;
|
|
4701
|
+
if (result.data.success) {
|
|
4702
|
+
_context8.next = 7;
|
|
4703
|
+
break;
|
|
4704
|
+
}
|
|
4705
|
+
result.data.data = [];
|
|
4706
|
+
return _context8.abrupt("return", result.data);
|
|
4707
|
+
case 7:
|
|
4708
|
+
arr = [];
|
|
4709
|
+
if (result.data.data.length) {
|
|
4710
|
+
if (type === 'goods') {
|
|
4711
|
+
result.data.data.forEach(function (item) {
|
|
4712
|
+
platShopList.forEach(function (shop) {
|
|
4713
|
+
if (item.shopId === shop.shopId) {
|
|
4714
|
+
Object.assign(item, {
|
|
4715
|
+
shopName: shop.shopName
|
|
4716
|
+
});
|
|
4717
|
+
}
|
|
4718
|
+
});
|
|
4719
|
+
Object.assign(item, {
|
|
4720
|
+
rowExpandable: false
|
|
4721
|
+
});
|
|
4722
|
+
arr.push(item);
|
|
4723
|
+
});
|
|
4724
|
+
} else if (type === 'skus') {
|
|
4725
|
+
result.data.data.forEach(function (item) {
|
|
4726
|
+
if (item.skus.length) {
|
|
4727
|
+
Object.assign(item, {
|
|
4728
|
+
rowExpandable: true
|
|
4729
|
+
});
|
|
4730
|
+
arr.push(item);
|
|
4731
|
+
}
|
|
4732
|
+
});
|
|
4733
|
+
}
|
|
4734
|
+
}
|
|
4735
|
+
result.data.data = arr;
|
|
4736
|
+
return _context8.abrupt("return", result.data);
|
|
4737
|
+
case 11:
|
|
4738
|
+
case "end":
|
|
4739
|
+
return _context8.stop();
|
|
4740
|
+
}
|
|
4741
|
+
}, _callee8);
|
|
4742
|
+
}));
|
|
4743
|
+
function queryAllGoods(_x29, _x30, _x31, _x32, _x33, _x34) {
|
|
4744
|
+
return _queryAllGoods.apply(this, arguments);
|
|
4745
|
+
}
|
|
4746
|
+
return queryAllGoods;
|
|
4747
|
+
}()
|
|
4748
|
+
/**
|
|
4749
|
+
* 查询用户已保存的查询条件
|
|
4750
|
+
* @param {*} server 服务地址
|
|
4751
|
+
* @param {*} extraQuery 租户信息
|
|
4752
|
+
*/
|
|
4753
|
+
}, {
|
|
4754
|
+
key: "conditionFindAll",
|
|
4755
|
+
value: function () {
|
|
4756
|
+
var _conditionFindAll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(server, extraQuery) {
|
|
4757
|
+
var url, result;
|
|
4758
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
4759
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
4760
|
+
case 0:
|
|
4761
|
+
url = "".concat(server, "/product-selector/2.0/condition/findAll?tenant=").concat(extraQuery);
|
|
4762
|
+
_context9.next = 3;
|
|
4763
|
+
return http.post(url, {});
|
|
4764
|
+
case 3:
|
|
4765
|
+
result = _context9.sent;
|
|
4766
|
+
return _context9.abrupt("return", result.data);
|
|
4767
|
+
case 5:
|
|
4768
|
+
case "end":
|
|
4769
|
+
return _context9.stop();
|
|
4770
|
+
}
|
|
4771
|
+
}, _callee9);
|
|
4772
|
+
}));
|
|
4773
|
+
function conditionFindAll(_x35, _x36) {
|
|
4774
|
+
return _conditionFindAll.apply(this, arguments);
|
|
4775
|
+
}
|
|
4776
|
+
return conditionFindAll;
|
|
4777
|
+
}()
|
|
4778
|
+
/**
|
|
4779
|
+
* 验证条件名称是否存在
|
|
4780
|
+
* @param {*} server 服务地址
|
|
4781
|
+
* @param {*} extraQuery 租户信息
|
|
4782
|
+
* @param {*} name 条件名称
|
|
4783
|
+
*/
|
|
4784
|
+
}, {
|
|
4785
|
+
key: "validationConditionName",
|
|
4786
|
+
value: function () {
|
|
4787
|
+
var _validationConditionName = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(server, extraQuery, name) {
|
|
4788
|
+
var url, result;
|
|
4789
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
4790
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
4791
|
+
case 0:
|
|
4792
|
+
url = "".concat(server, "/product-selector/2.0/condition/name/check?tenant=").concat(extraQuery);
|
|
4793
|
+
_context10.next = 3;
|
|
4794
|
+
return http.post(url, {
|
|
4795
|
+
conditionName: name
|
|
4796
|
+
});
|
|
4797
|
+
case 3:
|
|
4798
|
+
result = _context10.sent;
|
|
4799
|
+
return _context10.abrupt("return", result.data);
|
|
4800
|
+
case 5:
|
|
4801
|
+
case "end":
|
|
4802
|
+
return _context10.stop();
|
|
4803
|
+
}
|
|
4804
|
+
}, _callee10);
|
|
4805
|
+
}));
|
|
4806
|
+
function validationConditionName(_x37, _x38, _x39) {
|
|
4807
|
+
return _validationConditionName.apply(this, arguments);
|
|
4808
|
+
}
|
|
4809
|
+
return validationConditionName;
|
|
4810
|
+
}()
|
|
4811
|
+
/**
|
|
4812
|
+
* 手动创建新的查询条件
|
|
4813
|
+
* @param {*} server 服务地址
|
|
4814
|
+
* @param {*} extraQuery 租户信息
|
|
4815
|
+
* @param {*} data
|
|
4816
|
+
*/
|
|
4817
|
+
}, {
|
|
4818
|
+
key: "saveCondition",
|
|
4819
|
+
value: function () {
|
|
4820
|
+
var _saveCondition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(server, extraQuery, data) {
|
|
4821
|
+
var url, result;
|
|
4822
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
4823
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
4824
|
+
case 0:
|
|
4825
|
+
url = "".concat(server, "/product-selector/2.0/condition/save/manual?tenant=").concat(extraQuery);
|
|
4826
|
+
_context11.next = 3;
|
|
4827
|
+
return http.post(url, data);
|
|
4828
|
+
case 3:
|
|
4829
|
+
result = _context11.sent;
|
|
4830
|
+
return _context11.abrupt("return", result.data);
|
|
4831
|
+
case 5:
|
|
4832
|
+
case "end":
|
|
4833
|
+
return _context11.stop();
|
|
4834
|
+
}
|
|
4835
|
+
}, _callee11);
|
|
4836
|
+
}));
|
|
4837
|
+
function saveCondition(_x40, _x41, _x42) {
|
|
4838
|
+
return _saveCondition.apply(this, arguments);
|
|
4839
|
+
}
|
|
4840
|
+
return saveCondition;
|
|
4841
|
+
}()
|
|
4842
|
+
/**
|
|
4843
|
+
* 删除已经保存的查询条件
|
|
4844
|
+
* @param {*} server 服务地址
|
|
4845
|
+
* @param {*} extraQuery 租户信息
|
|
4846
|
+
* @param {*} id 条件id
|
|
4847
|
+
* @returns
|
|
4848
|
+
*/
|
|
4849
|
+
}, {
|
|
4850
|
+
key: "deleteCondition",
|
|
4851
|
+
value: function () {
|
|
4852
|
+
var _deleteCondition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(server, extraQuery, id) {
|
|
4853
|
+
var url, result;
|
|
4854
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
4855
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
4856
|
+
case 0:
|
|
4857
|
+
url = "".concat(server, "/product-selector/2.0/condition/delete?tenant=").concat(extraQuery);
|
|
4858
|
+
_context12.next = 3;
|
|
4859
|
+
return http.post(url, {
|
|
4860
|
+
id: id
|
|
4861
|
+
});
|
|
4862
|
+
case 3:
|
|
4863
|
+
result = _context12.sent;
|
|
4864
|
+
return _context12.abrupt("return", result.data);
|
|
4865
|
+
case 5:
|
|
4866
|
+
case "end":
|
|
4867
|
+
return _context12.stop();
|
|
4868
|
+
}
|
|
4869
|
+
}, _callee12);
|
|
4870
|
+
}));
|
|
4871
|
+
function deleteCondition(_x43, _x44, _x45) {
|
|
4872
|
+
return _deleteCondition.apply(this, arguments);
|
|
4873
|
+
}
|
|
4874
|
+
return deleteCondition;
|
|
4875
|
+
}()
|
|
4876
|
+
/**
|
|
4877
|
+
* 重命名条件名称
|
|
4878
|
+
* @param {*} server 服务地址
|
|
4879
|
+
* @param {*} extraQuery 租户信息
|
|
4880
|
+
* @param {*} data
|
|
4881
|
+
*/
|
|
4882
|
+
}, {
|
|
4883
|
+
key: "renameCondition",
|
|
4884
|
+
value: function () {
|
|
4885
|
+
var _renameCondition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(server, extraQuery, data) {
|
|
4886
|
+
var url, result;
|
|
4887
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
4888
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
4889
|
+
case 0:
|
|
4890
|
+
url = "".concat(server, "/product-selector/2.0/condition/rename?tenant=").concat(extraQuery);
|
|
4891
|
+
_context13.next = 3;
|
|
4892
|
+
return http.post(url, data);
|
|
4893
|
+
case 3:
|
|
4894
|
+
result = _context13.sent;
|
|
4895
|
+
return _context13.abrupt("return", result.data);
|
|
4896
|
+
case 5:
|
|
4897
|
+
case "end":
|
|
4898
|
+
return _context13.stop();
|
|
4899
|
+
}
|
|
4900
|
+
}, _callee13);
|
|
4901
|
+
}));
|
|
4902
|
+
function renameCondition(_x46, _x47, _x48) {
|
|
4903
|
+
return _renameCondition.apply(this, arguments);
|
|
4904
|
+
}
|
|
4905
|
+
return renameCondition;
|
|
4906
|
+
}()
|
|
4907
|
+
/**
|
|
4908
|
+
* 自动保存查用查询条件
|
|
4909
|
+
* @param {*} server 服务地址
|
|
4910
|
+
* @param {*} extraQuery 租户信息
|
|
4911
|
+
* @param {*} data
|
|
4912
|
+
*/
|
|
4913
|
+
}, {
|
|
4914
|
+
key: "autoSaveCondition",
|
|
4915
|
+
value: function () {
|
|
4916
|
+
var _autoSaveCondition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(server, extraQuery, data) {
|
|
4917
|
+
var url, result;
|
|
4918
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
4919
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
4920
|
+
case 0:
|
|
4921
|
+
url = "".concat(server, "/product-selector/2.0/condition/save/auto?tenant=").concat(extraQuery);
|
|
4922
|
+
_context14.next = 3;
|
|
4923
|
+
return http.post(url, data);
|
|
4924
|
+
case 3:
|
|
4925
|
+
result = _context14.sent;
|
|
4926
|
+
return _context14.abrupt("return", result.data);
|
|
4927
|
+
case 5:
|
|
4928
|
+
case "end":
|
|
4929
|
+
return _context14.stop();
|
|
4930
|
+
}
|
|
4931
|
+
}, _callee14);
|
|
4932
|
+
}));
|
|
4933
|
+
function autoSaveCondition(_x49, _x50, _x51) {
|
|
4934
|
+
return _autoSaveCondition.apply(this, arguments);
|
|
4935
|
+
}
|
|
4936
|
+
return autoSaveCondition;
|
|
4937
|
+
}()
|
|
4938
|
+
/**
|
|
4939
|
+
* 用户已存储条件总条数
|
|
4940
|
+
* @param {*} server
|
|
4941
|
+
* @param {*} extraQuery
|
|
4942
|
+
*/
|
|
4943
|
+
}, {
|
|
4944
|
+
key: "findConditionCount",
|
|
4945
|
+
value: function () {
|
|
4946
|
+
var _findConditionCount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(server, extraQuery) {
|
|
4947
|
+
var url, result;
|
|
4948
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
4949
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
4950
|
+
case 0:
|
|
4951
|
+
url = "".concat(server, "/product-selector/2.0/condition/count?tenant=").concat(extraQuery);
|
|
4952
|
+
_context15.next = 3;
|
|
4953
|
+
return http.post(url, {});
|
|
4954
|
+
case 3:
|
|
4955
|
+
result = _context15.sent;
|
|
4956
|
+
return _context15.abrupt("return", result.data);
|
|
4957
|
+
case 5:
|
|
4958
|
+
case "end":
|
|
4959
|
+
return _context15.stop();
|
|
4960
|
+
}
|
|
4961
|
+
}, _callee15);
|
|
4962
|
+
}));
|
|
4963
|
+
function findConditionCount(_x52, _x53) {
|
|
4964
|
+
return _findConditionCount.apply(this, arguments);
|
|
4965
|
+
}
|
|
4966
|
+
return findConditionCount;
|
|
4967
|
+
}()
|
|
4968
|
+
/**
|
|
4969
|
+
* 根据平台code,店铺ID获取购物金类目ID
|
|
4970
|
+
* @param {*} server
|
|
4971
|
+
* @param {*} extraQuery
|
|
4972
|
+
* @param {*} data
|
|
4973
|
+
*/
|
|
4974
|
+
}, {
|
|
4975
|
+
key: "getShoppingGold",
|
|
4976
|
+
value: function () {
|
|
4977
|
+
var _getShoppingGold = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(server, extraQuery, data) {
|
|
4978
|
+
var url;
|
|
4979
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
4980
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
4981
|
+
case 0:
|
|
4982
|
+
url = "".concat(server, "/product-selector/2.0/cate/std_cate_card?tenant=").concat(extraQuery);
|
|
4983
|
+
return _context16.abrupt("return", http.post(url, data));
|
|
4984
|
+
case 2:
|
|
4985
|
+
case "end":
|
|
4986
|
+
return _context16.stop();
|
|
4987
|
+
}
|
|
4988
|
+
}, _callee16);
|
|
4989
|
+
}));
|
|
4990
|
+
function getShoppingGold(_x54, _x55, _x56) {
|
|
4991
|
+
return _getShoppingGold.apply(this, arguments);
|
|
4992
|
+
}
|
|
4993
|
+
return getShoppingGold;
|
|
4994
|
+
}()
|
|
4995
|
+
}]);
|
|
4996
|
+
return Store;
|
|
4997
|
+
}();
|
|
4998
|
+
var Store$1 = new Store();
|
|
4999
|
+
|
|
4986
5000
|
/**
|
|
4987
5001
|
* 全部商品查询条件
|
|
4988
5002
|
* @param {*} platShopList 平台&店铺列表
|
|
@@ -43665,6 +43679,824 @@
|
|
|
43665
43679
|
visible: false
|
|
43666
43680
|
};
|
|
43667
43681
|
|
|
43682
|
+
/**
|
|
43683
|
+
* 此文件记录一些通用 & 默认配置项
|
|
43684
|
+
*/
|
|
43685
|
+
var DEFAULT_TABLE_SKU_ROW = ['productName', 'productId', 'outerId', 'price', 'stock', 'onlineTime', 'status', 'platName', 'shopName', 'showCategoryName', 'showSellerCategoryName', 'skuTotal', 'sku'];
|
|
43686
|
+
var DEFAULT_TABLE_ROW$1 = ['productName', 'productId', 'outerId', 'price', 'stock', 'onlineTime', 'status', 'platName', 'shopName', 'showCategoryName', 'showSellerCategoryName'];
|
|
43687
|
+
var IS_STANDARD_CATE$1 = ['YDH', 'PDD', 'REDBOOK', 'WEIMOB', 'VIP']; // 区分哪些平台不具有标准类目
|
|
43688
|
+
// export const IS_STANDARD_CATE = ['TAOBAO', 'YOUZAN', 'JOS', 'SUNING', 'DOUYIN', 'OFFLINE', 'DANGDANG', 'MOGUJIE', 'WEIXIN'] // 区分哪些平台具有标准类目
|
|
43689
|
+
// export const IS_CUSTOM_CATE = ['YHD', 'SUNING', 'MGJ', 'OFFLINE', 'DD', 'WEIXIN', 'PDD', 'REDBOOK', 'WEIMOB', 'DOUYIN', 'VIP'] // 区分哪些平台不具有自定义类目
|
|
43690
|
+
var IS_CUSTOM_CATE$1 = ['TAOBAO', 'JOS', 'YOUZAN']; // 区分哪些平台有自定义类目
|
|
43691
|
+
var SKU_STATUS_MAP = {
|
|
43692
|
+
'SY_ONLINE': '在架',
|
|
43693
|
+
'SY_OFFLINE': '下架',
|
|
43694
|
+
'SY_SAIL_OVER': '售罄',
|
|
43695
|
+
'': '不限'
|
|
43696
|
+
};
|
|
43697
|
+
var QUERY_MAP$1 = {
|
|
43698
|
+
// 全部商品tab窗口与查询条件枚举关系
|
|
43699
|
+
platCode: {
|
|
43700
|
+
field: 'platCode',
|
|
43701
|
+
// 接口对应字段
|
|
43702
|
+
operator: 'EQ',
|
|
43703
|
+
// 查询条件
|
|
43704
|
+
operatorName: '等于',
|
|
43705
|
+
desc: '平台名称',
|
|
43706
|
+
// 描述
|
|
43707
|
+
rules: 'defalut' // 对应字段解析规则
|
|
43708
|
+
},
|
|
43709
|
+
|
|
43710
|
+
shopId: {
|
|
43711
|
+
field: 'shopId',
|
|
43712
|
+
operator: 'EQ',
|
|
43713
|
+
operatorName: '等于',
|
|
43714
|
+
desc: '店铺名称',
|
|
43715
|
+
rules: 'defalut'
|
|
43716
|
+
},
|
|
43717
|
+
prod_product_id: {
|
|
43718
|
+
field: 'prod.product_id',
|
|
43719
|
+
operator: 'EQ',
|
|
43720
|
+
operatorName: '等于',
|
|
43721
|
+
desc: '商品ID',
|
|
43722
|
+
rules: 'defalut'
|
|
43723
|
+
},
|
|
43724
|
+
prod_product_name: {
|
|
43725
|
+
field: 'prod.product_name',
|
|
43726
|
+
operator: 'LIKE',
|
|
43727
|
+
operatorName: '内容包含',
|
|
43728
|
+
desc: '商品名称',
|
|
43729
|
+
rules: 'split'
|
|
43730
|
+
},
|
|
43731
|
+
prod_category_tree: {
|
|
43732
|
+
field: 'prod.category_id',
|
|
43733
|
+
operator: 'EQ',
|
|
43734
|
+
operatorName: '等于',
|
|
43735
|
+
desc: '标准类目',
|
|
43736
|
+
rules: 'normal'
|
|
43737
|
+
},
|
|
43738
|
+
prod_seller_tree: {
|
|
43739
|
+
field: 'prod.seller_cid',
|
|
43740
|
+
operator: 'EQ',
|
|
43741
|
+
operatorName: '等于',
|
|
43742
|
+
desc: '自定义类目',
|
|
43743
|
+
rules: 'normal'
|
|
43744
|
+
},
|
|
43745
|
+
prod_status: {
|
|
43746
|
+
field: 'prod.status',
|
|
43747
|
+
operator: 'EQ',
|
|
43748
|
+
operatorName: '等于',
|
|
43749
|
+
desc: '商品状态',
|
|
43750
|
+
rules: 'defalut'
|
|
43751
|
+
},
|
|
43752
|
+
prod_stock: {
|
|
43753
|
+
field: 'prod.stock',
|
|
43754
|
+
operator: 'BETWEEN_CLOSE',
|
|
43755
|
+
operatorName: '介于(闭区间)',
|
|
43756
|
+
desc: '库存',
|
|
43757
|
+
rules: 'between'
|
|
43758
|
+
},
|
|
43759
|
+
prod_outer_id: {
|
|
43760
|
+
field: 'prod.outer_id',
|
|
43761
|
+
operator: 'SUB_PATTERN',
|
|
43762
|
+
operatorName: '符合模式(截断)',
|
|
43763
|
+
desc: '商品商家编码',
|
|
43764
|
+
rules: 'sub_pattern'
|
|
43765
|
+
},
|
|
43766
|
+
prod_price: {
|
|
43767
|
+
field: 'prod.price',
|
|
43768
|
+
operator: 'BETWEEN_CLOSE',
|
|
43769
|
+
operatorName: '介于(闭区间)',
|
|
43770
|
+
desc: '价格',
|
|
43771
|
+
rules: 'between'
|
|
43772
|
+
},
|
|
43773
|
+
prod_online_time: {
|
|
43774
|
+
field: 'prod.online_time',
|
|
43775
|
+
operator: 'BETWEEN_CLOSE',
|
|
43776
|
+
operatorName: '介于(闭区间)',
|
|
43777
|
+
desc: '上架时间',
|
|
43778
|
+
rules: 'between'
|
|
43779
|
+
},
|
|
43780
|
+
sku_flag: {
|
|
43781
|
+
field: 'sku_flag',
|
|
43782
|
+
operator: 'EQ',
|
|
43783
|
+
operatorName: '等于',
|
|
43784
|
+
desc: '是否有SKU',
|
|
43785
|
+
rules: 'default'
|
|
43786
|
+
},
|
|
43787
|
+
sku_sku_id: {
|
|
43788
|
+
field: 'sku.sku_id',
|
|
43789
|
+
operator: 'EQ',
|
|
43790
|
+
operatorName: '等于',
|
|
43791
|
+
desc: 'SKU ID',
|
|
43792
|
+
rules: 'default'
|
|
43793
|
+
},
|
|
43794
|
+
sku_outer_id: {
|
|
43795
|
+
field: 'sku.outer_id',
|
|
43796
|
+
operator: 'SUB_PATTERN',
|
|
43797
|
+
operatorName: '符合模式(截断)',
|
|
43798
|
+
desc: 'SKU商家编码',
|
|
43799
|
+
rules: 'sub_pattern'
|
|
43800
|
+
},
|
|
43801
|
+
sku_specification: {
|
|
43802
|
+
field: 'sku.specification',
|
|
43803
|
+
operator: 'LIKE',
|
|
43804
|
+
operatorName: '内容包含',
|
|
43805
|
+
desc: 'SKU名称',
|
|
43806
|
+
rules: 'default'
|
|
43807
|
+
}
|
|
43808
|
+
};
|
|
43809
|
+
var SELECTED_TAB_GOODS_TYPE$1 = [
|
|
43810
|
+
// 已选择商品tab窗口,下拉选择配置
|
|
43811
|
+
{
|
|
43812
|
+
labelKey: '商品标题',
|
|
43813
|
+
valueKey: 'productName',
|
|
43814
|
+
isSku: false
|
|
43815
|
+
}, {
|
|
43816
|
+
labelKey: '商品ID',
|
|
43817
|
+
valueKey: 'productId',
|
|
43818
|
+
isSku: false
|
|
43819
|
+
}, {
|
|
43820
|
+
labelKey: '商品商家编码',
|
|
43821
|
+
valueKey: 'outerId',
|
|
43822
|
+
isSku: false
|
|
43823
|
+
}, {
|
|
43824
|
+
labelKey: 'SKU ID',
|
|
43825
|
+
valueKey: 'skuId',
|
|
43826
|
+
isSku: true
|
|
43827
|
+
}, {
|
|
43828
|
+
labelKey: 'SKU商家编码',
|
|
43829
|
+
valueKey: 'outerSkuId',
|
|
43830
|
+
isSku: true
|
|
43831
|
+
}, {
|
|
43832
|
+
labelKey: 'SKU名称',
|
|
43833
|
+
valueKey: 'skuDetail',
|
|
43834
|
+
isSku: true
|
|
43835
|
+
}];
|
|
43836
|
+
var FIELD_STACKS$1 = {
|
|
43837
|
+
SHOP_ID: 'shopId',
|
|
43838
|
+
// 上架店铺
|
|
43839
|
+
PLAT_CODE: 'platCode',
|
|
43840
|
+
// 平台
|
|
43841
|
+
PROD_PRICE: 'prod.price',
|
|
43842
|
+
// 价格
|
|
43843
|
+
PROD_STOCK: 'prod.stock',
|
|
43844
|
+
// 库存
|
|
43845
|
+
PROD_STATUS: 'prod.status',
|
|
43846
|
+
// 商品状态
|
|
43847
|
+
PROD_OUTER_ID: 'prod.outer_id',
|
|
43848
|
+
// 商品商家编码
|
|
43849
|
+
PROD_SELLER_ID: 'prod.seller_cid',
|
|
43850
|
+
// 自定义类目
|
|
43851
|
+
PROD_PRODUCT_ID: 'prod.product_id',
|
|
43852
|
+
// 商品ID
|
|
43853
|
+
PROD_CATEGORY_ID: 'prod.category_id',
|
|
43854
|
+
// 标准类目
|
|
43855
|
+
PROD_ONLINE_TIME: 'prod.online_time',
|
|
43856
|
+
// 上架时间
|
|
43857
|
+
PROD_PRODUCT_NAME: 'prod.product_name',
|
|
43858
|
+
// 商品名称
|
|
43859
|
+
|
|
43860
|
+
SKU_FLAG: 'sku_flag',
|
|
43861
|
+
// 是否有SKU
|
|
43862
|
+
SKU_PRICE: 'sku.price',
|
|
43863
|
+
// SKU属性 > SKU价格
|
|
43864
|
+
SKU_STOCK: 'sku.stock',
|
|
43865
|
+
// SKU属性 > SKU库存
|
|
43866
|
+
SKU_SKU_ID: 'sku.sku_id',
|
|
43867
|
+
// SKU属性 > SKU ID
|
|
43868
|
+
SKU_STATUS: 'sku.status',
|
|
43869
|
+
// SKU属性 > SKU在架状态
|
|
43870
|
+
SKU_OUTER_ID: 'sku.outer_id',
|
|
43871
|
+
// SKU属性 > SKU 商家编码
|
|
43872
|
+
SKU_SPECIFICATION: 'sku.specification' // SKU属性 > SKU名称
|
|
43873
|
+
};
|
|
43874
|
+
|
|
43875
|
+
var OPERATOR_STACKS$1 = {
|
|
43876
|
+
EQ: 'EQ',
|
|
43877
|
+
LT: 'LT',
|
|
43878
|
+
GT: 'GT',
|
|
43879
|
+
LIKE: 'LIKE',
|
|
43880
|
+
END_LIKE: 'END_LIKE',
|
|
43881
|
+
BEGIN_LIKE: 'BEGIN_LIKE',
|
|
43882
|
+
SUB_PATTERN: 'SUB_PATTERN',
|
|
43883
|
+
BETWEEN_OPEN: 'BETWEEN_OPEN',
|
|
43884
|
+
BETWEEN_CLOSE: 'BETWEEN_CLOSE',
|
|
43885
|
+
ISNULL: 'ISNULL',
|
|
43886
|
+
NONULL: 'NONULL',
|
|
43887
|
+
NOT_EQ: 'NOT_EQ',
|
|
43888
|
+
TAG_ISNULL: 'TAG_ISNULL',
|
|
43889
|
+
TAG_NONULL: 'TAG_NONULL',
|
|
43890
|
+
BETWEEN_RELATIVE: 'BETWEEN_RELATIVE'
|
|
43891
|
+
};
|
|
43892
|
+
|
|
43893
|
+
var NULL_MAP$1 = {
|
|
43894
|
+
ISNULL: {
|
|
43895
|
+
label: '为空',
|
|
43896
|
+
value: 'ISNULL'
|
|
43897
|
+
},
|
|
43898
|
+
NONULL: {
|
|
43899
|
+
label: '不为空',
|
|
43900
|
+
value: 'NONULL'
|
|
43901
|
+
}
|
|
43902
|
+
};
|
|
43903
|
+
var TAG_NULL_MAP$1 = {
|
|
43904
|
+
TAG_ISNULL: {
|
|
43905
|
+
label: '为空',
|
|
43906
|
+
value: 'TAG_ISNULL'
|
|
43907
|
+
},
|
|
43908
|
+
TAG_NONULL: {
|
|
43909
|
+
label: '不为空',
|
|
43910
|
+
value: 'TAG_NONULL'
|
|
43911
|
+
}
|
|
43912
|
+
};
|
|
43913
|
+
var reg$1 = new RegExp('\'', 'g');
|
|
43914
|
+
var nullList$1 = ['ISNULL', 'NONULL'];
|
|
43915
|
+
function queryTypeMap$1(moduleType, type) {
|
|
43916
|
+
switch (moduleType) {
|
|
43917
|
+
case 'SELECT':
|
|
43918
|
+
return {
|
|
43919
|
+
operator: 'EQ',
|
|
43920
|
+
operatorName: '等于',
|
|
43921
|
+
rules: 'defalut'
|
|
43922
|
+
};
|
|
43923
|
+
case 'INPUT':
|
|
43924
|
+
return {
|
|
43925
|
+
operator: type === 'SINGLE' ? 'EQ' : 'LIKE',
|
|
43926
|
+
operatorName: type === 'SINGLE' ? '等于' : '内容包含',
|
|
43927
|
+
rules: type === 'SINGLE' ? 'defalut' : 'split'
|
|
43928
|
+
};
|
|
43929
|
+
case 'SELECT_TREE':
|
|
43930
|
+
return {
|
|
43931
|
+
operator: 'EQ',
|
|
43932
|
+
operatorName: '等于',
|
|
43933
|
+
rules: 'normal'
|
|
43934
|
+
};
|
|
43935
|
+
case 'SELECT_INPUT':
|
|
43936
|
+
return {
|
|
43937
|
+
operator: 'SUB_PATTERN',
|
|
43938
|
+
operatorName: '符合模式(截断)',
|
|
43939
|
+
rules: 'sub_pattern'
|
|
43940
|
+
};
|
|
43941
|
+
case 'NUMBER':
|
|
43942
|
+
return {
|
|
43943
|
+
operator: 'BETWEEN_CLOSE',
|
|
43944
|
+
operatorName: '介于(闭区间)',
|
|
43945
|
+
rules: 'between'
|
|
43946
|
+
};
|
|
43947
|
+
case 'DATE':
|
|
43948
|
+
return {
|
|
43949
|
+
operator: type === 'DATE_M' ? 'EQ' : 'BETWEEN_CLOSE',
|
|
43950
|
+
operatorName: type === 'DATE_M' ? '等于' : '介于(闭区间)',
|
|
43951
|
+
rules: type === 'DATE_M' ? 'defalut' : 'between'
|
|
43952
|
+
};
|
|
43953
|
+
}
|
|
43954
|
+
return null;
|
|
43955
|
+
}
|
|
43956
|
+
function configQueryMap$1(data, query) {
|
|
43957
|
+
var obj = {};
|
|
43958
|
+
data.forEach(function (item) {
|
|
43959
|
+
if (!item.groupName || item.groupName === '商品基本属性' || item.groupName === '商品 SKU 属性') {
|
|
43960
|
+
obj = _objectSpread2(_objectSpread2({}, obj), {}, _defineProperty({}, item.itemId, _objectSpread2(_objectSpread2({}, QUERY_MAP$1[item.itemId]), {}, {
|
|
43961
|
+
type: item.type,
|
|
43962
|
+
moduleType: item.moduleType,
|
|
43963
|
+
dataSource: item.configs,
|
|
43964
|
+
newStatus: item.newStatus,
|
|
43965
|
+
// status: item.newStatus,
|
|
43966
|
+
tagsFlag: null
|
|
43967
|
+
})));
|
|
43968
|
+
} else {
|
|
43969
|
+
var optObj = {};
|
|
43970
|
+
if (item.moduleType !== 'NO_VALUE') {
|
|
43971
|
+
optObj = queryTypeMap$1(item.moduleType, item.type);
|
|
43972
|
+
} else if (query[item.itemId]) {
|
|
43973
|
+
var id = query[item.itemId];
|
|
43974
|
+
optObj.operator = TAG_NULL_MAP$1[id].value;
|
|
43975
|
+
optObj.operatorName = TAG_NULL_MAP$1[id].label;
|
|
43976
|
+
optObj.rules = 'noValue';
|
|
43977
|
+
}
|
|
43978
|
+
obj = _objectSpread2(_objectSpread2({}, obj), {}, _defineProperty({}, item.itemId, _objectSpread2({
|
|
43979
|
+
field: item.itemId,
|
|
43980
|
+
desc: item.itemName,
|
|
43981
|
+
tagsFlag: 'tags',
|
|
43982
|
+
type: item.type,
|
|
43983
|
+
moduleType: item.moduleType,
|
|
43984
|
+
dataSource: item.configs,
|
|
43985
|
+
newStatus: item.newStatus
|
|
43986
|
+
}, optObj)));
|
|
43987
|
+
}
|
|
43988
|
+
});
|
|
43989
|
+
return obj;
|
|
43990
|
+
}
|
|
43991
|
+
|
|
43992
|
+
/**
|
|
43993
|
+
* 数组去重
|
|
43994
|
+
*/
|
|
43995
|
+
function unique$1(array) {
|
|
43996
|
+
var keyFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (item) {
|
|
43997
|
+
return item;
|
|
43998
|
+
};
|
|
43999
|
+
var hash = {};
|
|
44000
|
+
var result = [];
|
|
44001
|
+
array.forEach(function (item) {
|
|
44002
|
+
var key = keyFn(item);
|
|
44003
|
+
if (key in hash) return;
|
|
44004
|
+
result.push(item);
|
|
44005
|
+
hash[key] = null;
|
|
44006
|
+
});
|
|
44007
|
+
return result;
|
|
44008
|
+
}
|
|
44009
|
+
function genPlatShopValue$1(platList, shopList, platShop) {
|
|
44010
|
+
var _platCode = platShop.platCode,
|
|
44011
|
+
_shopId = platShop.shopId;
|
|
44012
|
+
var defaultPlat = platList[0] && platList[0].platCode;
|
|
44013
|
+
var platCode = platList.find(function (plat) {
|
|
44014
|
+
return plat.platCode === _platCode;
|
|
44015
|
+
}) ? _platCode : defaultPlat;
|
|
44016
|
+
var defaultShop = (shopList.find(function (shop) {
|
|
44017
|
+
return shop.platCode === platCode;
|
|
44018
|
+
}) || {}).shopId;
|
|
44019
|
+
var shopId = shopList.find(function (shop) {
|
|
44020
|
+
return shop.shopId === _shopId;
|
|
44021
|
+
}) ? _shopId : defaultShop;
|
|
44022
|
+
return {
|
|
44023
|
+
shopId: shopId,
|
|
44024
|
+
platCode: platCode
|
|
44025
|
+
};
|
|
44026
|
+
}
|
|
44027
|
+
|
|
44028
|
+
/**
|
|
44029
|
+
* 全部商品tab-请求参数转化
|
|
44030
|
+
* @param {*} data 需要转化的数据
|
|
44031
|
+
* @param {*} config 配置项枚举信息
|
|
44032
|
+
*/
|
|
44033
|
+
function allTabFormatting$1(config, data) {
|
|
44034
|
+
var arr = [];
|
|
44035
|
+
Object.keys(data).forEach(function (item) {
|
|
44036
|
+
if (config[item]) {
|
|
44037
|
+
var obj = {
|
|
44038
|
+
field: config[item].field,
|
|
44039
|
+
fieldName: config[item].desc,
|
|
44040
|
+
configName: item,
|
|
44041
|
+
tagsFlag: config[item].tagsFlag,
|
|
44042
|
+
operator: config[item].operator,
|
|
44043
|
+
operatorName: config[item].operatorName
|
|
44044
|
+
};
|
|
44045
|
+
switch (config[item].rules) {
|
|
44046
|
+
case 'normal':
|
|
44047
|
+
if (data[item]) {
|
|
44048
|
+
if (config[item].type === 'SINGLE') {
|
|
44049
|
+
obj.value = [data[item].value];
|
|
44050
|
+
obj.semantic = [data[item].label];
|
|
44051
|
+
} else {
|
|
44052
|
+
var ids = [];
|
|
44053
|
+
var names = [];
|
|
44054
|
+
data[item].forEach(function (str) {
|
|
44055
|
+
ids.push(str.id);
|
|
44056
|
+
names.push(str.name);
|
|
44057
|
+
});
|
|
44058
|
+
obj.semantic = names;
|
|
44059
|
+
obj.value = config[item].tagsFlag ? names : ids;
|
|
44060
|
+
}
|
|
44061
|
+
}
|
|
44062
|
+
break;
|
|
44063
|
+
case 'between':
|
|
44064
|
+
data[item].start = "".concat(data[item].start);
|
|
44065
|
+
data[item].end = "".concat(data[item].end);
|
|
44066
|
+
if (data[item].datetype) {
|
|
44067
|
+
obj.relative = data[item].datetype;
|
|
44068
|
+
}
|
|
44069
|
+
if (data[item].dateUnit) {
|
|
44070
|
+
obj.timeUnit = data[item].dateUnit;
|
|
44071
|
+
}
|
|
44072
|
+
if (data[item].start || data[item].end) {
|
|
44073
|
+
obj.value = [data[item].start, data[item].end];
|
|
44074
|
+
obj.semantic = [data[item].start, data[item].end];
|
|
44075
|
+
}
|
|
44076
|
+
break;
|
|
44077
|
+
case 'split':
|
|
44078
|
+
if (data[item]) {
|
|
44079
|
+
var _value = data[item].replace(reg$1, '\\\'');
|
|
44080
|
+
obj.value = _value.split(',');
|
|
44081
|
+
obj.semantic = data[item].split(',');
|
|
44082
|
+
}
|
|
44083
|
+
break;
|
|
44084
|
+
case 'sub_pattern':
|
|
44085
|
+
if (data[item]) {
|
|
44086
|
+
if (typeof data[item] === 'string') {
|
|
44087
|
+
var _value2 = data[item].replace(reg$1, '\\\'');
|
|
44088
|
+
obj.value = [_value2];
|
|
44089
|
+
var val = data[item].split(':');
|
|
44090
|
+
if (val.length > 1) {
|
|
44091
|
+
obj.semantic = ["\u622A\u53D6".concat(val[0], "\u81F3").concat(val[1], "\u4F4D\uFF0C\u5B57\u7B26\u662F").concat(val[2])];
|
|
44092
|
+
} else {
|
|
44093
|
+
obj.operatorName = '等于';
|
|
44094
|
+
obj.semantic = [data[item]];
|
|
44095
|
+
}
|
|
44096
|
+
}
|
|
44097
|
+
}
|
|
44098
|
+
break;
|
|
44099
|
+
default:
|
|
44100
|
+
if (data[item]) {
|
|
44101
|
+
if (config[item].field === 'platCode') {
|
|
44102
|
+
// 假如平台code标识,需要找出平台名称
|
|
44103
|
+
data.platList.forEach(function (val) {
|
|
44104
|
+
if (val.platCode === data[item]) {
|
|
44105
|
+
obj.semantic = [val.platName];
|
|
44106
|
+
obj.value = [data[item]];
|
|
44107
|
+
}
|
|
44108
|
+
});
|
|
44109
|
+
} else if (config[item].field === 'shopId') {
|
|
44110
|
+
// 假如是店铺ID标识,需要找出店铺名称
|
|
44111
|
+
data.shopList.forEach(function (val) {
|
|
44112
|
+
if (val.shopId === data[item]) {
|
|
44113
|
+
obj.semantic = [val.shopName];
|
|
44114
|
+
obj.value = [data[item]];
|
|
44115
|
+
}
|
|
44116
|
+
});
|
|
44117
|
+
} else if (config[item].moduleType === 'SELECT' || config[item].moduleType === 'DATE') {
|
|
44118
|
+
if (config[item].type === 'SINGLE') {
|
|
44119
|
+
var _list = config[item].dataSource.filter(function (el) {
|
|
44120
|
+
return el.value === data[item];
|
|
44121
|
+
});
|
|
44122
|
+
obj.semantic = [_list[0].label];
|
|
44123
|
+
obj.value = config[item].tagsFlag ? [_list[0].label] : [_list[0].value];
|
|
44124
|
+
} else if (config[item].type === 'MULTIPLE' || config[item].type === 'DATE_M') {
|
|
44125
|
+
var values = data[item] && data[item].map(function (el) {
|
|
44126
|
+
var findTemp = config[item].dataSource.find(function (innerItem) {
|
|
44127
|
+
return innerItem.value === el;
|
|
44128
|
+
});
|
|
44129
|
+
return (findTemp || {}).label;
|
|
44130
|
+
});
|
|
44131
|
+
obj.value = values;
|
|
44132
|
+
obj.semantic = values;
|
|
44133
|
+
} else if (config[item].moduleType === 'N0_VALUE') {
|
|
44134
|
+
obj.semantic = NULL_MAP$1[data[item]].label;
|
|
44135
|
+
obj.value = [data[item]];
|
|
44136
|
+
obj.operator = NULL_MAP$1[data[item]].value;
|
|
44137
|
+
obj.operatorName = NULL_MAP$1[data[item]].label;
|
|
44138
|
+
} else {
|
|
44139
|
+
obj.semantic = [data[item]];
|
|
44140
|
+
obj.value = [data[item]];
|
|
44141
|
+
}
|
|
44142
|
+
} else {
|
|
44143
|
+
obj.semantic = [data[item]];
|
|
44144
|
+
var _value3 = data[item].replace(reg$1, '\\\'');
|
|
44145
|
+
obj.value = [_value3];
|
|
44146
|
+
}
|
|
44147
|
+
}
|
|
44148
|
+
}
|
|
44149
|
+
arr.push(obj);
|
|
44150
|
+
}
|
|
44151
|
+
});
|
|
44152
|
+
/**
|
|
44153
|
+
*
|
|
44154
|
+
*/
|
|
44155
|
+
return arr.filter(function (item) {
|
|
44156
|
+
return item.value && item.value.length >= 1;
|
|
44157
|
+
});
|
|
44158
|
+
}
|
|
44159
|
+
|
|
44160
|
+
/**
|
|
44161
|
+
* 过滤对象中空属性
|
|
44162
|
+
* @param {*} obj
|
|
44163
|
+
* @returns
|
|
44164
|
+
*/
|
|
44165
|
+
function filterNullValueObject$1(obj) {
|
|
44166
|
+
for (var i in obj) {
|
|
44167
|
+
if (obj[i] === '' || obj[i] === null || obj[i] === 'null') {
|
|
44168
|
+
delete obj[i];
|
|
44169
|
+
}
|
|
44170
|
+
}
|
|
44171
|
+
return obj;
|
|
44172
|
+
}
|
|
44173
|
+
|
|
44174
|
+
/**
|
|
44175
|
+
* 商品选择tab窗口,根据筛选条件格式化数据
|
|
44176
|
+
* @param {*} data
|
|
44177
|
+
*/
|
|
44178
|
+
function parsingNewCondition(data) {
|
|
44179
|
+
var arr = [];
|
|
44180
|
+
var list = ['shopId', 'prod.outer_id', 'sku.outer_id', 'prod.product_id', 'sku.sku_id', 'prod.online_time', 'prod.status'];
|
|
44181
|
+
data.forEach(function (item) {
|
|
44182
|
+
var obj = {
|
|
44183
|
+
field: '',
|
|
44184
|
+
fieldName: '',
|
|
44185
|
+
operator: '',
|
|
44186
|
+
operatorName: '',
|
|
44187
|
+
semantic: [],
|
|
44188
|
+
value: []
|
|
44189
|
+
};
|
|
44190
|
+
obj.tagsFlag = item.field.groupName ? 'tags' : null;
|
|
44191
|
+
obj.field = item.field.field;
|
|
44192
|
+
obj.fieldName = item.field.desc;
|
|
44193
|
+
obj.operator = item.operator.value;
|
|
44194
|
+
obj.operatorName = item.operator.label;
|
|
44195
|
+
if (list.includes(item.field.field)) {
|
|
44196
|
+
switch (item.field.field) {
|
|
44197
|
+
case 'shopId':
|
|
44198
|
+
// 上架店铺(需要解析出平台code)
|
|
44199
|
+
if (item.value) {
|
|
44200
|
+
arr.push({
|
|
44201
|
+
field: 'platCode',
|
|
44202
|
+
fieldName: '平台名称',
|
|
44203
|
+
operator: item.operator.value,
|
|
44204
|
+
operatorName: '等于',
|
|
44205
|
+
semantic: [item.value.plat.label],
|
|
44206
|
+
value: [item.value.plat.value]
|
|
44207
|
+
});
|
|
44208
|
+
obj.semantic = item.value.shops.map(function (shop) {
|
|
44209
|
+
return shop.label;
|
|
44210
|
+
});
|
|
44211
|
+
obj.value = item.value.shops.map(function (shop) {
|
|
44212
|
+
return shop.value;
|
|
44213
|
+
});
|
|
44214
|
+
}
|
|
44215
|
+
break;
|
|
44216
|
+
case 'prod.outer_id': // 商品商家编码
|
|
44217
|
+
case 'sku.outer_id':
|
|
44218
|
+
// sku商家编码
|
|
44219
|
+
if (item.value) {
|
|
44220
|
+
if (item.operator.value === 'SUB_PATTERN') {
|
|
44221
|
+
// 如果是截断模式
|
|
44222
|
+
obj.value = ["".concat(item.value.begin, ":").concat(item.value.end, ":").concat(item.value.value.replace(reg$1, '\\\''))];
|
|
44223
|
+
obj.semantic = ["\u622A\u53D6".concat(item.value.begin, "\u81F3").concat(item.value.end, "\u4F4D,\u5B57\u7B26\u662F").concat(item.value.value)];
|
|
44224
|
+
} else if (Array.isArray(item.value)) {
|
|
44225
|
+
obj.semantic = item.value.filter(function (val) {
|
|
44226
|
+
return val !== '';
|
|
44227
|
+
});
|
|
44228
|
+
obj.value = item.value.filter(function (val) {
|
|
44229
|
+
return val !== '';
|
|
44230
|
+
}).map(function (val) {
|
|
44231
|
+
return val.replace(reg$1, '\\\'');
|
|
44232
|
+
});
|
|
44233
|
+
} else {
|
|
44234
|
+
obj.semantic = [item.value];
|
|
44235
|
+
obj.value = [item.value.replace(reg$1, '\\\'')];
|
|
44236
|
+
}
|
|
44237
|
+
} else if (nullList$1.includes(item.operator.value)) {
|
|
44238
|
+
obj.value = [NULL_MAP$1[item.operator.value].value];
|
|
44239
|
+
obj.semantic = [NULL_MAP$1[item.operator.value].label];
|
|
44240
|
+
}
|
|
44241
|
+
break;
|
|
44242
|
+
case 'prod.product_id':
|
|
44243
|
+
case 'sku.sku_id':
|
|
44244
|
+
if (item.value) {
|
|
44245
|
+
if (Array.isArray(item.value)) {
|
|
44246
|
+
obj.semantic = item.value.filter(function (val) {
|
|
44247
|
+
return val !== '';
|
|
44248
|
+
});
|
|
44249
|
+
obj.value = item.value.filter(function (val) {
|
|
44250
|
+
return val !== '';
|
|
44251
|
+
}).map(function (val) {
|
|
44252
|
+
return val.replace(reg$1, '\\\'');
|
|
44253
|
+
});
|
|
44254
|
+
} else {
|
|
44255
|
+
obj.semantic = [item.value];
|
|
44256
|
+
obj.value = [item.value.replace(reg$1, '\\\'')];
|
|
44257
|
+
}
|
|
44258
|
+
}
|
|
44259
|
+
break;
|
|
44260
|
+
case 'prod.online_time':
|
|
44261
|
+
if (item.operator.value === 'BETWEEN_RELATIVE') {
|
|
44262
|
+
obj.relative = 'relative';
|
|
44263
|
+
obj.operator = 'BETWEEN_CLOSE';
|
|
44264
|
+
obj.operatorName = '介于(闭区间)';
|
|
44265
|
+
if (item.value) {
|
|
44266
|
+
if (item.value.value) {
|
|
44267
|
+
obj.value = item.value.value;
|
|
44268
|
+
obj.semantic = item.value.value;
|
|
44269
|
+
}
|
|
44270
|
+
if (item.value.timeUnit) {
|
|
44271
|
+
obj.timeUnit = item.value.timeUnit;
|
|
44272
|
+
}
|
|
44273
|
+
}
|
|
44274
|
+
}
|
|
44275
|
+
break;
|
|
44276
|
+
case 'prod.status':
|
|
44277
|
+
obj.value = item.value;
|
|
44278
|
+
var values = item.value.map(function (el) {
|
|
44279
|
+
var findTemp = item.field.dataSource.find(function (innerItem) {
|
|
44280
|
+
return innerItem.value === el;
|
|
44281
|
+
});
|
|
44282
|
+
return (findTemp || {
|
|
44283
|
+
label: el
|
|
44284
|
+
}).label;
|
|
44285
|
+
});
|
|
44286
|
+
obj.semantic = values;
|
|
44287
|
+
break;
|
|
44288
|
+
}
|
|
44289
|
+
} else {
|
|
44290
|
+
switch (item.field.type) {
|
|
44291
|
+
case 'NO_VALUE':
|
|
44292
|
+
// 无值类
|
|
44293
|
+
obj.semantic = [item.operator.label];
|
|
44294
|
+
obj.value = [item.operator.value];
|
|
44295
|
+
break;
|
|
44296
|
+
case 'DATE_YMD': // 年月日
|
|
44297
|
+
case 'DATE_MD':
|
|
44298
|
+
// 月日
|
|
44299
|
+
if (item.value) {
|
|
44300
|
+
if (item.operator.value === 'BETWEEN_CLOSE' || item.operator.value === 'BETWEEN_OPEN') {
|
|
44301
|
+
// 假如是区间类型
|
|
44302
|
+
obj.value = item.value ? [item.value.start || '', item.value.end || ''] : [item.value];
|
|
44303
|
+
obj.semantic = item.value ? [item.value.start || '', item.value.end || ''] : [item.value];
|
|
44304
|
+
} else if (nullList$1.includes(item.operator.value)) {
|
|
44305
|
+
obj.value = [NULL_MAP$1[item.operator.value].value];
|
|
44306
|
+
obj.semantic = [NULL_MAP$1[item.operator.value].label];
|
|
44307
|
+
} else {
|
|
44308
|
+
obj.value = item.value ? [item.value] : [''];
|
|
44309
|
+
obj.semantic = item.value ? [item.value] : [''];
|
|
44310
|
+
}
|
|
44311
|
+
} else if (nullList$1.includes(item.operator.value)) {
|
|
44312
|
+
obj.value = [NULL_MAP$1[item.operator.value].value];
|
|
44313
|
+
obj.semantic = [NULL_MAP$1[item.operator.value].label];
|
|
44314
|
+
}
|
|
44315
|
+
break;
|
|
44316
|
+
case 'DATE_M':
|
|
44317
|
+
// 月
|
|
44318
|
+
if (item.value) {
|
|
44319
|
+
obj.value = item.value;
|
|
44320
|
+
obj.semantic = item.value.map(function (el) {
|
|
44321
|
+
var findTemp = item.field.dataSource.find(function (innerItem) {
|
|
44322
|
+
return Number(innerItem.value) === Number(el);
|
|
44323
|
+
});
|
|
44324
|
+
return (findTemp || {
|
|
44325
|
+
label: el
|
|
44326
|
+
}).label;
|
|
44327
|
+
});
|
|
44328
|
+
} else if (nullList$1.includes(item.operator.value)) {
|
|
44329
|
+
obj.value = [NULL_MAP$1[item.operator.value].value];
|
|
44330
|
+
obj.semantic = [NULL_MAP$1[item.operator.value].label];
|
|
44331
|
+
}
|
|
44332
|
+
break;
|
|
44333
|
+
case 'CATEGORY_SELECT_TREE':
|
|
44334
|
+
obj.field = item.field.field;
|
|
44335
|
+
obj.fieldName = item.field.desc;
|
|
44336
|
+
obj.operator = item.operator.value;
|
|
44337
|
+
obj.operatorName = item.operator.label;
|
|
44338
|
+
if (item.value) {
|
|
44339
|
+
var categoriesIds = [];
|
|
44340
|
+
var categoriesName = [];
|
|
44341
|
+
item.value.categories.forEach(function (str) {
|
|
44342
|
+
categoriesIds.push(str.id);
|
|
44343
|
+
categoriesName.push(str.name);
|
|
44344
|
+
});
|
|
44345
|
+
obj.semantic = categoriesName;
|
|
44346
|
+
obj.value = categoriesIds;
|
|
44347
|
+
} else if (item.operator.value === 'ISNULL') {
|
|
44348
|
+
obj.semantic = ['为空'];
|
|
44349
|
+
obj.value = ['ISNULL'];
|
|
44350
|
+
} else if (item.operator.value === 'NONULL') {
|
|
44351
|
+
obj.semantic = ['不为空'];
|
|
44352
|
+
obj.value = ['NONULL'];
|
|
44353
|
+
}
|
|
44354
|
+
break;
|
|
44355
|
+
case 'SELECT_MULTIPLE_TREE':
|
|
44356
|
+
// 下拉树多选
|
|
44357
|
+
if (item.value) {
|
|
44358
|
+
var ids = [];
|
|
44359
|
+
var names = [];
|
|
44360
|
+
var _list = item.value;
|
|
44361
|
+
_list.forEach(function (str) {
|
|
44362
|
+
ids.push(str.id);
|
|
44363
|
+
names.push(str.name);
|
|
44364
|
+
});
|
|
44365
|
+
obj.semantic = names;
|
|
44366
|
+
obj.value = names;
|
|
44367
|
+
} else if (nullList$1.includes(item.operator.value)) {
|
|
44368
|
+
obj.value = [NULL_MAP$1[item.operator.value].label];
|
|
44369
|
+
obj.semantic = [NULL_MAP$1[item.operator.value].label];
|
|
44370
|
+
}
|
|
44371
|
+
break;
|
|
44372
|
+
case 'SELECT_TREE':
|
|
44373
|
+
// 下拉树单选
|
|
44374
|
+
if (item.value) {
|
|
44375
|
+
obj.semantic = [item.field.label];
|
|
44376
|
+
obj.value = [item.field.label];
|
|
44377
|
+
} else if (nullList$1.includes(item.operator.value)) {
|
|
44378
|
+
obj.value = [NULL_MAP$1[item.operator.value].value];
|
|
44379
|
+
obj.semantic = [NULL_MAP$1[item.operator.value].label];
|
|
44380
|
+
}
|
|
44381
|
+
break;
|
|
44382
|
+
case 'MULTIPLE_SELECT':
|
|
44383
|
+
// 下拉多选
|
|
44384
|
+
if (item.value) {
|
|
44385
|
+
var _item$value;
|
|
44386
|
+
var _values = (_item$value = item.value) === null || _item$value === void 0 ? void 0 : _item$value.map(function (el) {
|
|
44387
|
+
var findTemp = item.field.dataSource.find(function (innerItem) {
|
|
44388
|
+
return innerItem.value === el;
|
|
44389
|
+
});
|
|
44390
|
+
return (findTemp || {
|
|
44391
|
+
label: el
|
|
44392
|
+
}).label;
|
|
44393
|
+
});
|
|
44394
|
+
obj.value = _values;
|
|
44395
|
+
obj.semantic = _values;
|
|
44396
|
+
} else if (nullList$1.includes(item.operator.value)) {
|
|
44397
|
+
obj.value = [NULL_MAP$1[item.operator.value].value];
|
|
44398
|
+
obj.semantic = [NULL_MAP$1[item.operator.value].label];
|
|
44399
|
+
}
|
|
44400
|
+
break;
|
|
44401
|
+
case 'SELECT':
|
|
44402
|
+
// 下拉单选
|
|
44403
|
+
if (item.value !== undefined) {
|
|
44404
|
+
obj.value = [item.value];
|
|
44405
|
+
var _list3 = item.field.dataSource.filter(function (el) {
|
|
44406
|
+
return el.value === item.value;
|
|
44407
|
+
});
|
|
44408
|
+
obj.semantic = [_list3[0].label];
|
|
44409
|
+
} else if (nullList$1.includes(item.operator.value)) {
|
|
44410
|
+
obj.value = [NULL_MAP$1[item.operator.value].value];
|
|
44411
|
+
obj.semantic = [NULL_MAP$1[item.operator.value].label];
|
|
44412
|
+
}
|
|
44413
|
+
break;
|
|
44414
|
+
case 'NUMBER_INT': // 整数
|
|
44415
|
+
case 'NUMBER_DECIMAL':
|
|
44416
|
+
// 小数
|
|
44417
|
+
if (item.value || item.value === 0) {
|
|
44418
|
+
obj.semantic = Array.isArray(item.value) ? item.value : [item.value];
|
|
44419
|
+
obj.value = Array.isArray(item.value) ? item.value : [item.value];
|
|
44420
|
+
} else if (nullList$1.includes(item.operator.value)) {
|
|
44421
|
+
obj.value = [NULL_MAP$1[item.operator.value].value];
|
|
44422
|
+
obj.semantic = [NULL_MAP$1[item.operator.value].label];
|
|
44423
|
+
}
|
|
44424
|
+
break;
|
|
44425
|
+
case 'STRING':
|
|
44426
|
+
// 字符
|
|
44427
|
+
if (item.value) {
|
|
44428
|
+
if (item.operator.value === 'LIKE') {
|
|
44429
|
+
// 假如是like操作还需要区分出或者还是并且的关系
|
|
44430
|
+
obj.value = item.value.value.map(function (val) {
|
|
44431
|
+
return val.replace(reg$1, '\\\'');
|
|
44432
|
+
});
|
|
44433
|
+
obj.multiText = item.value.relation ? 'AND' : 'OR';
|
|
44434
|
+
obj.semantic = item.value;
|
|
44435
|
+
} else if (Array.isArray(item.value)) {
|
|
44436
|
+
obj.semantic = item.value.filter(function (val) {
|
|
44437
|
+
return val !== '';
|
|
44438
|
+
});
|
|
44439
|
+
obj.value = item.value.filter(function (val) {
|
|
44440
|
+
return val !== '';
|
|
44441
|
+
}).map(function (val) {
|
|
44442
|
+
return val.replace(reg$1, '\\\'');
|
|
44443
|
+
});
|
|
44444
|
+
} else {
|
|
44445
|
+
obj.semantic = [item.value];
|
|
44446
|
+
obj.value = [item.value.replace(reg$1, '\\\'')];
|
|
44447
|
+
}
|
|
44448
|
+
} else if (nullList$1.includes(item.operator.value)) {
|
|
44449
|
+
obj.value = [NULL_MAP$1[item.operator.value].value];
|
|
44450
|
+
obj.semantic = [NULL_MAP$1[item.operator.value].label];
|
|
44451
|
+
}
|
|
44452
|
+
break;
|
|
44453
|
+
}
|
|
44454
|
+
}
|
|
44455
|
+
arr.push(obj);
|
|
44456
|
+
});
|
|
44457
|
+
return arr;
|
|
44458
|
+
}
|
|
44459
|
+
function queryConditionToStringNew(array) {
|
|
44460
|
+
var obj = {
|
|
44461
|
+
str: [],
|
|
44462
|
+
title: [],
|
|
44463
|
+
value: parsingNewCondition(array).filter(function (item) {
|
|
44464
|
+
return item.value.length || item.operator === "ISNULL" || item.operator === "NONULL";
|
|
44465
|
+
})
|
|
44466
|
+
};
|
|
44467
|
+
return obj;
|
|
44468
|
+
}
|
|
44469
|
+
|
|
44470
|
+
/**
|
|
44471
|
+
* 计算已选商品和sku的数量
|
|
44472
|
+
* @param {*} Object || Array
|
|
44473
|
+
*/
|
|
44474
|
+
function resultGoodsLength$1(obj) {
|
|
44475
|
+
// TODO SELECT
|
|
44476
|
+
var len = 0;
|
|
44477
|
+
if (Array.isArray(obj)) {
|
|
44478
|
+
if (obj.length) {
|
|
44479
|
+
obj.forEach(function (item) {
|
|
44480
|
+
if (item.rowExpandable) {
|
|
44481
|
+
len += item.skus.length;
|
|
44482
|
+
} else {
|
|
44483
|
+
len += 1;
|
|
44484
|
+
}
|
|
44485
|
+
});
|
|
44486
|
+
}
|
|
44487
|
+
} else {
|
|
44488
|
+
Object.keys(obj).forEach(function (item) {
|
|
44489
|
+
if (obj[item].rowExpandable) {
|
|
44490
|
+
// 假如是sku展开状态则商品数量以sku数量为准
|
|
44491
|
+
len += obj[item].skus.length;
|
|
44492
|
+
} else {
|
|
44493
|
+
len += 1;
|
|
44494
|
+
}
|
|
44495
|
+
});
|
|
44496
|
+
}
|
|
44497
|
+
return len;
|
|
44498
|
+
}
|
|
44499
|
+
|
|
43668
44500
|
var skuConditionQueryList = ['sku.sku_id', 'sku.outer_id', 'sku.specification', 'sku.status', 'sku.price', 'sku.stock'];
|
|
43669
44501
|
var Store$f = /*#__PURE__*/function () {
|
|
43670
44502
|
function Store() {
|
|
@@ -44157,7 +44989,7 @@
|
|
|
44157
44989
|
case 0:
|
|
44158
44990
|
url = "".concat(server, "/product-selector/2.0/batch/import?tenant=").concat(extraQuery);
|
|
44159
44991
|
_context10.next = 3;
|
|
44160
|
-
return http.post(url, data);
|
|
44992
|
+
return http.post(url, filterNullValueObject$1(data));
|
|
44161
44993
|
case 3:
|
|
44162
44994
|
result = _context10.sent;
|
|
44163
44995
|
if (result.data.success) {
|
|
@@ -44803,217 +45635,6 @@
|
|
|
44803
45635
|
return React.useContext(Context$4);
|
|
44804
45636
|
}
|
|
44805
45637
|
|
|
44806
|
-
/**
|
|
44807
|
-
* 此文件记录一些通用 & 默认配置项
|
|
44808
|
-
*/
|
|
44809
|
-
var DEFAULT_TABLE_SKU_ROW = ['productName', 'productId', 'outerId', 'price', 'stock', 'onlineTime', 'status', 'platName', 'shopName', 'showCategoryName', 'showSellerCategoryName', 'skuTotal', 'sku'];
|
|
44810
|
-
var DEFAULT_TABLE_ROW$1 = ['productName', 'productId', 'outerId', 'price', 'stock', 'onlineTime', 'status', 'platName', 'shopName', 'showCategoryName', 'showSellerCategoryName'];
|
|
44811
|
-
var IS_STANDARD_CATE$1 = ['YDH', 'PDD', 'REDBOOK', 'WEIMOB', 'VIP']; // 区分哪些平台不具有标准类目
|
|
44812
|
-
// export const IS_STANDARD_CATE = ['TAOBAO', 'YOUZAN', 'JOS', 'SUNING', 'DOUYIN', 'OFFLINE', 'DANGDANG', 'MOGUJIE', 'WEIXIN'] // 区分哪些平台具有标准类目
|
|
44813
|
-
// export const IS_CUSTOM_CATE = ['YHD', 'SUNING', 'MGJ', 'OFFLINE', 'DD', 'WEIXIN', 'PDD', 'REDBOOK', 'WEIMOB', 'DOUYIN', 'VIP'] // 区分哪些平台不具有自定义类目
|
|
44814
|
-
var IS_CUSTOM_CATE$1 = ['TAOBAO', 'JOS', 'YOUZAN']; // 区分哪些平台有自定义类目
|
|
44815
|
-
var SKU_STATUS_MAP = {
|
|
44816
|
-
'SY_ONLINE': '在架',
|
|
44817
|
-
'SY_OFFLINE': '下架',
|
|
44818
|
-
'SY_SAIL_OVER': '售罄',
|
|
44819
|
-
'': '不限'
|
|
44820
|
-
};
|
|
44821
|
-
var QUERY_MAP$1 = {
|
|
44822
|
-
// 全部商品tab窗口与查询条件枚举关系
|
|
44823
|
-
platCode: {
|
|
44824
|
-
field: 'platCode',
|
|
44825
|
-
// 接口对应字段
|
|
44826
|
-
operator: 'EQ',
|
|
44827
|
-
// 查询条件
|
|
44828
|
-
operatorName: '等于',
|
|
44829
|
-
desc: '平台名称',
|
|
44830
|
-
// 描述
|
|
44831
|
-
rules: 'defalut' // 对应字段解析规则
|
|
44832
|
-
},
|
|
44833
|
-
|
|
44834
|
-
shopId: {
|
|
44835
|
-
field: 'shopId',
|
|
44836
|
-
operator: 'EQ',
|
|
44837
|
-
operatorName: '等于',
|
|
44838
|
-
desc: '店铺名称',
|
|
44839
|
-
rules: 'defalut'
|
|
44840
|
-
},
|
|
44841
|
-
prod_product_id: {
|
|
44842
|
-
field: 'prod.product_id',
|
|
44843
|
-
operator: 'EQ',
|
|
44844
|
-
operatorName: '等于',
|
|
44845
|
-
desc: '商品ID',
|
|
44846
|
-
rules: 'defalut'
|
|
44847
|
-
},
|
|
44848
|
-
prod_product_name: {
|
|
44849
|
-
field: 'prod.product_name',
|
|
44850
|
-
operator: 'LIKE',
|
|
44851
|
-
operatorName: '内容包含',
|
|
44852
|
-
desc: '商品名称',
|
|
44853
|
-
rules: 'split'
|
|
44854
|
-
},
|
|
44855
|
-
prod_category_tree: {
|
|
44856
|
-
field: 'prod.category_id',
|
|
44857
|
-
operator: 'EQ',
|
|
44858
|
-
operatorName: '等于',
|
|
44859
|
-
desc: '标准类目',
|
|
44860
|
-
rules: 'normal'
|
|
44861
|
-
},
|
|
44862
|
-
prod_seller_tree: {
|
|
44863
|
-
field: 'prod.seller_cid',
|
|
44864
|
-
operator: 'EQ',
|
|
44865
|
-
operatorName: '等于',
|
|
44866
|
-
desc: '自定义类目',
|
|
44867
|
-
rules: 'normal'
|
|
44868
|
-
},
|
|
44869
|
-
prod_status: {
|
|
44870
|
-
field: 'prod.status',
|
|
44871
|
-
operator: 'EQ',
|
|
44872
|
-
operatorName: '等于',
|
|
44873
|
-
desc: '商品状态',
|
|
44874
|
-
rules: 'defalut'
|
|
44875
|
-
},
|
|
44876
|
-
prod_stock: {
|
|
44877
|
-
field: 'prod.stock',
|
|
44878
|
-
operator: 'BETWEEN_CLOSE',
|
|
44879
|
-
operatorName: '介于(闭区间)',
|
|
44880
|
-
desc: '库存',
|
|
44881
|
-
rules: 'between'
|
|
44882
|
-
},
|
|
44883
|
-
prod_outer_id: {
|
|
44884
|
-
field: 'prod.outer_id',
|
|
44885
|
-
operator: 'SUB_PATTERN',
|
|
44886
|
-
operatorName: '符合模式(截断)',
|
|
44887
|
-
desc: '商品商家编码',
|
|
44888
|
-
rules: 'sub_pattern'
|
|
44889
|
-
},
|
|
44890
|
-
prod_price: {
|
|
44891
|
-
field: 'prod.price',
|
|
44892
|
-
operator: 'BETWEEN_CLOSE',
|
|
44893
|
-
operatorName: '介于(闭区间)',
|
|
44894
|
-
desc: '价格',
|
|
44895
|
-
rules: 'between'
|
|
44896
|
-
},
|
|
44897
|
-
prod_online_time: {
|
|
44898
|
-
field: 'prod.online_time',
|
|
44899
|
-
operator: 'BETWEEN_CLOSE',
|
|
44900
|
-
operatorName: '介于(闭区间)',
|
|
44901
|
-
desc: '上架时间',
|
|
44902
|
-
rules: 'between'
|
|
44903
|
-
},
|
|
44904
|
-
sku_flag: {
|
|
44905
|
-
field: 'sku_flag',
|
|
44906
|
-
operator: 'EQ',
|
|
44907
|
-
operatorName: '等于',
|
|
44908
|
-
desc: '是否有SKU',
|
|
44909
|
-
rules: 'default'
|
|
44910
|
-
},
|
|
44911
|
-
sku_sku_id: {
|
|
44912
|
-
field: 'sku.sku_id',
|
|
44913
|
-
operator: 'EQ',
|
|
44914
|
-
operatorName: '等于',
|
|
44915
|
-
desc: 'SKU ID',
|
|
44916
|
-
rules: 'default'
|
|
44917
|
-
},
|
|
44918
|
-
sku_outer_id: {
|
|
44919
|
-
field: 'sku.outer_id',
|
|
44920
|
-
operator: 'SUB_PATTERN',
|
|
44921
|
-
operatorName: '符合模式(截断)',
|
|
44922
|
-
desc: 'SKU商家编码',
|
|
44923
|
-
rules: 'sub_pattern'
|
|
44924
|
-
},
|
|
44925
|
-
sku_specification: {
|
|
44926
|
-
field: 'sku.specification',
|
|
44927
|
-
operator: 'LIKE',
|
|
44928
|
-
operatorName: '内容包含',
|
|
44929
|
-
desc: 'SKU名称',
|
|
44930
|
-
rules: 'default'
|
|
44931
|
-
}
|
|
44932
|
-
};
|
|
44933
|
-
var SELECTED_TAB_GOODS_TYPE$1 = [
|
|
44934
|
-
// 已选择商品tab窗口,下拉选择配置
|
|
44935
|
-
{
|
|
44936
|
-
labelKey: '商品标题',
|
|
44937
|
-
valueKey: 'productName',
|
|
44938
|
-
isSku: false
|
|
44939
|
-
}, {
|
|
44940
|
-
labelKey: '商品ID',
|
|
44941
|
-
valueKey: 'productId',
|
|
44942
|
-
isSku: false
|
|
44943
|
-
}, {
|
|
44944
|
-
labelKey: '商品商家编码',
|
|
44945
|
-
valueKey: 'outerId',
|
|
44946
|
-
isSku: false
|
|
44947
|
-
}, {
|
|
44948
|
-
labelKey: 'SKU ID',
|
|
44949
|
-
valueKey: 'skuId',
|
|
44950
|
-
isSku: true
|
|
44951
|
-
}, {
|
|
44952
|
-
labelKey: 'SKU商家编码',
|
|
44953
|
-
valueKey: 'outerSkuId',
|
|
44954
|
-
isSku: true
|
|
44955
|
-
}, {
|
|
44956
|
-
labelKey: 'SKU名称',
|
|
44957
|
-
valueKey: 'skuDetail',
|
|
44958
|
-
isSku: true
|
|
44959
|
-
}];
|
|
44960
|
-
var FIELD_STACKS$1 = {
|
|
44961
|
-
SHOP_ID: 'shopId',
|
|
44962
|
-
// 上架店铺
|
|
44963
|
-
PLAT_CODE: 'platCode',
|
|
44964
|
-
// 平台
|
|
44965
|
-
PROD_PRICE: 'prod.price',
|
|
44966
|
-
// 价格
|
|
44967
|
-
PROD_STOCK: 'prod.stock',
|
|
44968
|
-
// 库存
|
|
44969
|
-
PROD_STATUS: 'prod.status',
|
|
44970
|
-
// 商品状态
|
|
44971
|
-
PROD_OUTER_ID: 'prod.outer_id',
|
|
44972
|
-
// 商品商家编码
|
|
44973
|
-
PROD_SELLER_ID: 'prod.seller_cid',
|
|
44974
|
-
// 自定义类目
|
|
44975
|
-
PROD_PRODUCT_ID: 'prod.product_id',
|
|
44976
|
-
// 商品ID
|
|
44977
|
-
PROD_CATEGORY_ID: 'prod.category_id',
|
|
44978
|
-
// 标准类目
|
|
44979
|
-
PROD_ONLINE_TIME: 'prod.online_time',
|
|
44980
|
-
// 上架时间
|
|
44981
|
-
PROD_PRODUCT_NAME: 'prod.product_name',
|
|
44982
|
-
// 商品名称
|
|
44983
|
-
|
|
44984
|
-
SKU_FLAG: 'sku_flag',
|
|
44985
|
-
// 是否有SKU
|
|
44986
|
-
SKU_PRICE: 'sku.price',
|
|
44987
|
-
// SKU属性 > SKU价格
|
|
44988
|
-
SKU_STOCK: 'sku.stock',
|
|
44989
|
-
// SKU属性 > SKU库存
|
|
44990
|
-
SKU_SKU_ID: 'sku.sku_id',
|
|
44991
|
-
// SKU属性 > SKU ID
|
|
44992
|
-
SKU_STATUS: 'sku.status',
|
|
44993
|
-
// SKU属性 > SKU在架状态
|
|
44994
|
-
SKU_OUTER_ID: 'sku.outer_id',
|
|
44995
|
-
// SKU属性 > SKU 商家编码
|
|
44996
|
-
SKU_SPECIFICATION: 'sku.specification' // SKU属性 > SKU名称
|
|
44997
|
-
};
|
|
44998
|
-
|
|
44999
|
-
var OPERATOR_STACKS$1 = {
|
|
45000
|
-
EQ: 'EQ',
|
|
45001
|
-
LT: 'LT',
|
|
45002
|
-
GT: 'GT',
|
|
45003
|
-
LIKE: 'LIKE',
|
|
45004
|
-
END_LIKE: 'END_LIKE',
|
|
45005
|
-
BEGIN_LIKE: 'BEGIN_LIKE',
|
|
45006
|
-
SUB_PATTERN: 'SUB_PATTERN',
|
|
45007
|
-
BETWEEN_OPEN: 'BETWEEN_OPEN',
|
|
45008
|
-
BETWEEN_CLOSE: 'BETWEEN_CLOSE',
|
|
45009
|
-
ISNULL: 'ISNULL',
|
|
45010
|
-
NONULL: 'NONULL',
|
|
45011
|
-
NOT_EQ: 'NOT_EQ',
|
|
45012
|
-
TAG_ISNULL: 'TAG_ISNULL',
|
|
45013
|
-
TAG_NONULL: 'TAG_NONULL',
|
|
45014
|
-
BETWEEN_RELATIVE: 'BETWEEN_RELATIVE'
|
|
45015
|
-
};
|
|
45016
|
-
|
|
45017
45638
|
function WidgetBox$1(_ref) {
|
|
45018
45639
|
var _ref$help = _ref.help,
|
|
45019
45640
|
help = _ref$help === void 0 ? '' : _ref$help,
|
|
@@ -50107,599 +50728,6 @@
|
|
|
50107
50728
|
return data;
|
|
50108
50729
|
}
|
|
50109
50730
|
|
|
50110
|
-
var NULL_MAP$1 = {
|
|
50111
|
-
ISNULL: {
|
|
50112
|
-
label: '为空',
|
|
50113
|
-
value: 'ISNULL'
|
|
50114
|
-
},
|
|
50115
|
-
NONULL: {
|
|
50116
|
-
label: '不为空',
|
|
50117
|
-
value: 'NONULL'
|
|
50118
|
-
}
|
|
50119
|
-
};
|
|
50120
|
-
var TAG_NULL_MAP$1 = {
|
|
50121
|
-
TAG_ISNULL: {
|
|
50122
|
-
label: '为空',
|
|
50123
|
-
value: 'TAG_ISNULL'
|
|
50124
|
-
},
|
|
50125
|
-
TAG_NONULL: {
|
|
50126
|
-
label: '不为空',
|
|
50127
|
-
value: 'TAG_NONULL'
|
|
50128
|
-
}
|
|
50129
|
-
};
|
|
50130
|
-
var reg$1 = new RegExp('\'', 'g');
|
|
50131
|
-
var nullList$1 = ['ISNULL', 'NONULL'];
|
|
50132
|
-
function queryTypeMap$1(moduleType, type) {
|
|
50133
|
-
switch (moduleType) {
|
|
50134
|
-
case 'SELECT':
|
|
50135
|
-
return {
|
|
50136
|
-
operator: 'EQ',
|
|
50137
|
-
operatorName: '等于',
|
|
50138
|
-
rules: 'defalut'
|
|
50139
|
-
};
|
|
50140
|
-
case 'INPUT':
|
|
50141
|
-
return {
|
|
50142
|
-
operator: type === 'SINGLE' ? 'EQ' : 'LIKE',
|
|
50143
|
-
operatorName: type === 'SINGLE' ? '等于' : '内容包含',
|
|
50144
|
-
rules: type === 'SINGLE' ? 'defalut' : 'split'
|
|
50145
|
-
};
|
|
50146
|
-
case 'SELECT_TREE':
|
|
50147
|
-
return {
|
|
50148
|
-
operator: 'EQ',
|
|
50149
|
-
operatorName: '等于',
|
|
50150
|
-
rules: 'normal'
|
|
50151
|
-
};
|
|
50152
|
-
case 'SELECT_INPUT':
|
|
50153
|
-
return {
|
|
50154
|
-
operator: 'SUB_PATTERN',
|
|
50155
|
-
operatorName: '符合模式(截断)',
|
|
50156
|
-
rules: 'sub_pattern'
|
|
50157
|
-
};
|
|
50158
|
-
case 'NUMBER':
|
|
50159
|
-
return {
|
|
50160
|
-
operator: 'BETWEEN_CLOSE',
|
|
50161
|
-
operatorName: '介于(闭区间)',
|
|
50162
|
-
rules: 'between'
|
|
50163
|
-
};
|
|
50164
|
-
case 'DATE':
|
|
50165
|
-
return {
|
|
50166
|
-
operator: type === 'DATE_M' ? 'EQ' : 'BETWEEN_CLOSE',
|
|
50167
|
-
operatorName: type === 'DATE_M' ? '等于' : '介于(闭区间)',
|
|
50168
|
-
rules: type === 'DATE_M' ? 'defalut' : 'between'
|
|
50169
|
-
};
|
|
50170
|
-
}
|
|
50171
|
-
return null;
|
|
50172
|
-
}
|
|
50173
|
-
function configQueryMap$1(data, query) {
|
|
50174
|
-
var obj = {};
|
|
50175
|
-
data.forEach(function (item) {
|
|
50176
|
-
if (!item.groupName || item.groupName === '商品基本属性' || item.groupName === '商品 SKU 属性') {
|
|
50177
|
-
obj = _objectSpread2(_objectSpread2({}, obj), {}, _defineProperty({}, item.itemId, _objectSpread2(_objectSpread2({}, QUERY_MAP$1[item.itemId]), {}, {
|
|
50178
|
-
type: item.type,
|
|
50179
|
-
moduleType: item.moduleType,
|
|
50180
|
-
dataSource: item.configs,
|
|
50181
|
-
newStatus: item.newStatus,
|
|
50182
|
-
// status: item.newStatus,
|
|
50183
|
-
tagsFlag: null
|
|
50184
|
-
})));
|
|
50185
|
-
} else {
|
|
50186
|
-
var optObj = {};
|
|
50187
|
-
if (item.moduleType !== 'NO_VALUE') {
|
|
50188
|
-
optObj = queryTypeMap$1(item.moduleType, item.type);
|
|
50189
|
-
} else if (query[item.itemId]) {
|
|
50190
|
-
var id = query[item.itemId];
|
|
50191
|
-
optObj.operator = TAG_NULL_MAP$1[id].value;
|
|
50192
|
-
optObj.operatorName = TAG_NULL_MAP$1[id].label;
|
|
50193
|
-
optObj.rules = 'noValue';
|
|
50194
|
-
}
|
|
50195
|
-
obj = _objectSpread2(_objectSpread2({}, obj), {}, _defineProperty({}, item.itemId, _objectSpread2({
|
|
50196
|
-
field: item.itemId,
|
|
50197
|
-
desc: item.itemName,
|
|
50198
|
-
tagsFlag: 'tags',
|
|
50199
|
-
type: item.type,
|
|
50200
|
-
moduleType: item.moduleType,
|
|
50201
|
-
dataSource: item.configs,
|
|
50202
|
-
newStatus: item.newStatus
|
|
50203
|
-
}, optObj)));
|
|
50204
|
-
}
|
|
50205
|
-
});
|
|
50206
|
-
return obj;
|
|
50207
|
-
}
|
|
50208
|
-
|
|
50209
|
-
/**
|
|
50210
|
-
* 数组去重
|
|
50211
|
-
*/
|
|
50212
|
-
function unique$1(array) {
|
|
50213
|
-
var keyFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (item) {
|
|
50214
|
-
return item;
|
|
50215
|
-
};
|
|
50216
|
-
var hash = {};
|
|
50217
|
-
var result = [];
|
|
50218
|
-
array.forEach(function (item) {
|
|
50219
|
-
var key = keyFn(item);
|
|
50220
|
-
if (key in hash) return;
|
|
50221
|
-
result.push(item);
|
|
50222
|
-
hash[key] = null;
|
|
50223
|
-
});
|
|
50224
|
-
return result;
|
|
50225
|
-
}
|
|
50226
|
-
function genPlatShopValue$1(platList, shopList, platShop) {
|
|
50227
|
-
var _platCode = platShop.platCode,
|
|
50228
|
-
_shopId = platShop.shopId;
|
|
50229
|
-
var defaultPlat = platList[0] && platList[0].platCode;
|
|
50230
|
-
var platCode = platList.find(function (plat) {
|
|
50231
|
-
return plat.platCode === _platCode;
|
|
50232
|
-
}) ? _platCode : defaultPlat;
|
|
50233
|
-
var defaultShop = (shopList.find(function (shop) {
|
|
50234
|
-
return shop.platCode === platCode;
|
|
50235
|
-
}) || {}).shopId;
|
|
50236
|
-
var shopId = shopList.find(function (shop) {
|
|
50237
|
-
return shop.shopId === _shopId;
|
|
50238
|
-
}) ? _shopId : defaultShop;
|
|
50239
|
-
return {
|
|
50240
|
-
shopId: shopId,
|
|
50241
|
-
platCode: platCode
|
|
50242
|
-
};
|
|
50243
|
-
}
|
|
50244
|
-
|
|
50245
|
-
/**
|
|
50246
|
-
* 全部商品tab-请求参数转化
|
|
50247
|
-
* @param {*} data 需要转化的数据
|
|
50248
|
-
* @param {*} config 配置项枚举信息
|
|
50249
|
-
*/
|
|
50250
|
-
function allTabFormatting$1(config, data) {
|
|
50251
|
-
var arr = [];
|
|
50252
|
-
Object.keys(data).forEach(function (item) {
|
|
50253
|
-
if (config[item]) {
|
|
50254
|
-
var obj = {
|
|
50255
|
-
field: config[item].field,
|
|
50256
|
-
fieldName: config[item].desc,
|
|
50257
|
-
configName: item,
|
|
50258
|
-
tagsFlag: config[item].tagsFlag,
|
|
50259
|
-
operator: config[item].operator,
|
|
50260
|
-
operatorName: config[item].operatorName
|
|
50261
|
-
};
|
|
50262
|
-
switch (config[item].rules) {
|
|
50263
|
-
case 'normal':
|
|
50264
|
-
if (data[item]) {
|
|
50265
|
-
if (config[item].type === 'SINGLE') {
|
|
50266
|
-
obj.value = [data[item].value];
|
|
50267
|
-
obj.semantic = [data[item].label];
|
|
50268
|
-
} else {
|
|
50269
|
-
var ids = [];
|
|
50270
|
-
var names = [];
|
|
50271
|
-
data[item].forEach(function (str) {
|
|
50272
|
-
ids.push(str.id);
|
|
50273
|
-
names.push(str.name);
|
|
50274
|
-
});
|
|
50275
|
-
obj.semantic = names;
|
|
50276
|
-
obj.value = config[item].tagsFlag ? names : ids;
|
|
50277
|
-
}
|
|
50278
|
-
}
|
|
50279
|
-
break;
|
|
50280
|
-
case 'between':
|
|
50281
|
-
data[item].start = "".concat(data[item].start);
|
|
50282
|
-
data[item].end = "".concat(data[item].end);
|
|
50283
|
-
if (data[item].datetype) {
|
|
50284
|
-
obj.relative = data[item].datetype;
|
|
50285
|
-
}
|
|
50286
|
-
if (data[item].dateUnit) {
|
|
50287
|
-
obj.timeUnit = data[item].dateUnit;
|
|
50288
|
-
}
|
|
50289
|
-
if (data[item].start || data[item].end) {
|
|
50290
|
-
obj.value = [data[item].start, data[item].end];
|
|
50291
|
-
obj.semantic = [data[item].start, data[item].end];
|
|
50292
|
-
}
|
|
50293
|
-
break;
|
|
50294
|
-
case 'split':
|
|
50295
|
-
if (data[item]) {
|
|
50296
|
-
var _value = data[item].replace(reg$1, '\\\'');
|
|
50297
|
-
obj.value = _value.split(',');
|
|
50298
|
-
obj.semantic = data[item].split(',');
|
|
50299
|
-
}
|
|
50300
|
-
break;
|
|
50301
|
-
case 'sub_pattern':
|
|
50302
|
-
if (data[item]) {
|
|
50303
|
-
if (typeof data[item] === 'string') {
|
|
50304
|
-
var _value2 = data[item].replace(reg$1, '\\\'');
|
|
50305
|
-
obj.value = [_value2];
|
|
50306
|
-
var val = data[item].split(':');
|
|
50307
|
-
if (val.length > 1) {
|
|
50308
|
-
obj.semantic = ["\u622A\u53D6".concat(val[0], "\u81F3").concat(val[1], "\u4F4D\uFF0C\u5B57\u7B26\u662F").concat(val[2])];
|
|
50309
|
-
} else {
|
|
50310
|
-
obj.operatorName = '等于';
|
|
50311
|
-
obj.semantic = [data[item]];
|
|
50312
|
-
}
|
|
50313
|
-
}
|
|
50314
|
-
}
|
|
50315
|
-
break;
|
|
50316
|
-
default:
|
|
50317
|
-
if (data[item]) {
|
|
50318
|
-
if (config[item].field === 'platCode') {
|
|
50319
|
-
// 假如平台code标识,需要找出平台名称
|
|
50320
|
-
data.platList.forEach(function (val) {
|
|
50321
|
-
if (val.platCode === data[item]) {
|
|
50322
|
-
obj.semantic = [val.platName];
|
|
50323
|
-
obj.value = [data[item]];
|
|
50324
|
-
}
|
|
50325
|
-
});
|
|
50326
|
-
} else if (config[item].field === 'shopId') {
|
|
50327
|
-
// 假如是店铺ID标识,需要找出店铺名称
|
|
50328
|
-
data.shopList.forEach(function (val) {
|
|
50329
|
-
if (val.shopId === data[item]) {
|
|
50330
|
-
obj.semantic = [val.shopName];
|
|
50331
|
-
obj.value = [data[item]];
|
|
50332
|
-
}
|
|
50333
|
-
});
|
|
50334
|
-
} else if (config[item].moduleType === 'SELECT' || config[item].moduleType === 'DATE') {
|
|
50335
|
-
if (config[item].type === 'SINGLE') {
|
|
50336
|
-
var _list = config[item].dataSource.filter(function (el) {
|
|
50337
|
-
return el.value === data[item];
|
|
50338
|
-
});
|
|
50339
|
-
obj.semantic = [_list[0].label];
|
|
50340
|
-
obj.value = config[item].tagsFlag ? [_list[0].label] : [_list[0].value];
|
|
50341
|
-
} else if (config[item].type === 'MULTIPLE' || config[item].type === 'DATE_M') {
|
|
50342
|
-
var values = data[item] && data[item].map(function (el) {
|
|
50343
|
-
var findTemp = config[item].dataSource.find(function (innerItem) {
|
|
50344
|
-
return innerItem.value === el;
|
|
50345
|
-
});
|
|
50346
|
-
return (findTemp || {}).label;
|
|
50347
|
-
});
|
|
50348
|
-
obj.value = values;
|
|
50349
|
-
obj.semantic = values;
|
|
50350
|
-
} else if (config[item].moduleType === 'N0_VALUE') {
|
|
50351
|
-
obj.semantic = NULL_MAP$1[data[item]].label;
|
|
50352
|
-
obj.value = [data[item]];
|
|
50353
|
-
obj.operator = NULL_MAP$1[data[item]].value;
|
|
50354
|
-
obj.operatorName = NULL_MAP$1[data[item]].label;
|
|
50355
|
-
} else {
|
|
50356
|
-
obj.semantic = [data[item]];
|
|
50357
|
-
obj.value = [data[item]];
|
|
50358
|
-
}
|
|
50359
|
-
} else {
|
|
50360
|
-
obj.semantic = [data[item]];
|
|
50361
|
-
var _value3 = data[item].replace(reg$1, '\\\'');
|
|
50362
|
-
obj.value = [_value3];
|
|
50363
|
-
}
|
|
50364
|
-
}
|
|
50365
|
-
}
|
|
50366
|
-
arr.push(obj);
|
|
50367
|
-
}
|
|
50368
|
-
});
|
|
50369
|
-
/**
|
|
50370
|
-
*
|
|
50371
|
-
*/
|
|
50372
|
-
return arr.filter(function (item) {
|
|
50373
|
-
return item.value && item.value.length >= 1;
|
|
50374
|
-
});
|
|
50375
|
-
}
|
|
50376
|
-
|
|
50377
|
-
/**
|
|
50378
|
-
* 商品选择tab窗口,根据筛选条件格式化数据
|
|
50379
|
-
* @param {*} data
|
|
50380
|
-
*/
|
|
50381
|
-
function parsingNewCondition(data) {
|
|
50382
|
-
var arr = [];
|
|
50383
|
-
var list = ['shopId', 'prod.outer_id', 'sku.outer_id', 'prod.product_id', 'sku.sku_id', 'prod.online_time', 'prod.status'];
|
|
50384
|
-
data.forEach(function (item) {
|
|
50385
|
-
var obj = {
|
|
50386
|
-
field: '',
|
|
50387
|
-
fieldName: '',
|
|
50388
|
-
operator: '',
|
|
50389
|
-
operatorName: '',
|
|
50390
|
-
semantic: [],
|
|
50391
|
-
value: []
|
|
50392
|
-
};
|
|
50393
|
-
obj.tagsFlag = item.field.groupName ? 'tags' : null;
|
|
50394
|
-
obj.field = item.field.field;
|
|
50395
|
-
obj.fieldName = item.field.desc;
|
|
50396
|
-
obj.operator = item.operator.value;
|
|
50397
|
-
obj.operatorName = item.operator.label;
|
|
50398
|
-
if (list.includes(item.field.field)) {
|
|
50399
|
-
switch (item.field.field) {
|
|
50400
|
-
case 'shopId':
|
|
50401
|
-
// 上架店铺(需要解析出平台code)
|
|
50402
|
-
if (item.value) {
|
|
50403
|
-
arr.push({
|
|
50404
|
-
field: 'platCode',
|
|
50405
|
-
fieldName: '平台名称',
|
|
50406
|
-
operator: item.operator.value,
|
|
50407
|
-
operatorName: '等于',
|
|
50408
|
-
semantic: [item.value.plat.label],
|
|
50409
|
-
value: [item.value.plat.value]
|
|
50410
|
-
});
|
|
50411
|
-
obj.semantic = item.value.shops.map(function (shop) {
|
|
50412
|
-
return shop.label;
|
|
50413
|
-
});
|
|
50414
|
-
obj.value = item.value.shops.map(function (shop) {
|
|
50415
|
-
return shop.value;
|
|
50416
|
-
});
|
|
50417
|
-
}
|
|
50418
|
-
break;
|
|
50419
|
-
case 'prod.outer_id': // 商品商家编码
|
|
50420
|
-
case 'sku.outer_id':
|
|
50421
|
-
// sku商家编码
|
|
50422
|
-
if (item.value) {
|
|
50423
|
-
if (item.operator.value === 'SUB_PATTERN') {
|
|
50424
|
-
// 如果是截断模式
|
|
50425
|
-
obj.value = ["".concat(item.value.begin, ":").concat(item.value.end, ":").concat(item.value.value.replace(reg$1, '\\\''))];
|
|
50426
|
-
obj.semantic = ["\u622A\u53D6".concat(item.value.begin, "\u81F3").concat(item.value.end, "\u4F4D,\u5B57\u7B26\u662F").concat(item.value.value)];
|
|
50427
|
-
} else if (Array.isArray(item.value)) {
|
|
50428
|
-
obj.semantic = item.value.filter(function (val) {
|
|
50429
|
-
return val !== '';
|
|
50430
|
-
});
|
|
50431
|
-
obj.value = item.value.filter(function (val) {
|
|
50432
|
-
return val !== '';
|
|
50433
|
-
}).map(function (val) {
|
|
50434
|
-
return val.replace(reg$1, '\\\'');
|
|
50435
|
-
});
|
|
50436
|
-
} else {
|
|
50437
|
-
obj.semantic = [item.value];
|
|
50438
|
-
obj.value = [item.value.replace(reg$1, '\\\'')];
|
|
50439
|
-
}
|
|
50440
|
-
} else if (nullList$1.includes(item.operator.value)) {
|
|
50441
|
-
obj.value = [NULL_MAP$1[item.operator.value].value];
|
|
50442
|
-
obj.semantic = [NULL_MAP$1[item.operator.value].label];
|
|
50443
|
-
}
|
|
50444
|
-
break;
|
|
50445
|
-
case 'prod.product_id':
|
|
50446
|
-
case 'sku.sku_id':
|
|
50447
|
-
if (item.value) {
|
|
50448
|
-
if (Array.isArray(item.value)) {
|
|
50449
|
-
obj.semantic = item.value.filter(function (val) {
|
|
50450
|
-
return val !== '';
|
|
50451
|
-
});
|
|
50452
|
-
obj.value = item.value.filter(function (val) {
|
|
50453
|
-
return val !== '';
|
|
50454
|
-
}).map(function (val) {
|
|
50455
|
-
return val.replace(reg$1, '\\\'');
|
|
50456
|
-
});
|
|
50457
|
-
} else {
|
|
50458
|
-
obj.semantic = [item.value];
|
|
50459
|
-
obj.value = [item.value.replace(reg$1, '\\\'')];
|
|
50460
|
-
}
|
|
50461
|
-
}
|
|
50462
|
-
break;
|
|
50463
|
-
case 'prod.online_time':
|
|
50464
|
-
if (item.operator.value === 'BETWEEN_RELATIVE') {
|
|
50465
|
-
obj.relative = 'relative';
|
|
50466
|
-
obj.operator = 'BETWEEN_CLOSE';
|
|
50467
|
-
obj.operatorName = '介于(闭区间)';
|
|
50468
|
-
if (item.value) {
|
|
50469
|
-
if (item.value.value) {
|
|
50470
|
-
obj.value = item.value.value;
|
|
50471
|
-
obj.semantic = item.value.value;
|
|
50472
|
-
}
|
|
50473
|
-
if (item.value.timeUnit) {
|
|
50474
|
-
obj.timeUnit = item.value.timeUnit;
|
|
50475
|
-
}
|
|
50476
|
-
}
|
|
50477
|
-
}
|
|
50478
|
-
break;
|
|
50479
|
-
case 'prod.status':
|
|
50480
|
-
obj.value = item.value;
|
|
50481
|
-
var values = item.value.map(function (el) {
|
|
50482
|
-
var findTemp = item.field.dataSource.find(function (innerItem) {
|
|
50483
|
-
return innerItem.value === el;
|
|
50484
|
-
});
|
|
50485
|
-
return (findTemp || {
|
|
50486
|
-
label: el
|
|
50487
|
-
}).label;
|
|
50488
|
-
});
|
|
50489
|
-
obj.semantic = values;
|
|
50490
|
-
break;
|
|
50491
|
-
}
|
|
50492
|
-
} else {
|
|
50493
|
-
switch (item.field.type) {
|
|
50494
|
-
case 'NO_VALUE':
|
|
50495
|
-
// 无值类
|
|
50496
|
-
obj.semantic = [item.operator.label];
|
|
50497
|
-
obj.value = [item.operator.value];
|
|
50498
|
-
break;
|
|
50499
|
-
case 'DATE_YMD': // 年月日
|
|
50500
|
-
case 'DATE_MD':
|
|
50501
|
-
// 月日
|
|
50502
|
-
if (item.value) {
|
|
50503
|
-
if (item.operator.value === 'BETWEEN_CLOSE' || item.operator.value === 'BETWEEN_OPEN') {
|
|
50504
|
-
// 假如是区间类型
|
|
50505
|
-
obj.value = item.value ? [item.value.start || '', item.value.end || ''] : [item.value];
|
|
50506
|
-
obj.semantic = item.value ? [item.value.start || '', item.value.end || ''] : [item.value];
|
|
50507
|
-
} else if (nullList$1.includes(item.operator.value)) {
|
|
50508
|
-
obj.value = [NULL_MAP$1[item.operator.value].value];
|
|
50509
|
-
obj.semantic = [NULL_MAP$1[item.operator.value].label];
|
|
50510
|
-
} else {
|
|
50511
|
-
obj.value = item.value ? [item.value] : [''];
|
|
50512
|
-
obj.semantic = item.value ? [item.value] : [''];
|
|
50513
|
-
}
|
|
50514
|
-
} else if (nullList$1.includes(item.operator.value)) {
|
|
50515
|
-
obj.value = [NULL_MAP$1[item.operator.value].value];
|
|
50516
|
-
obj.semantic = [NULL_MAP$1[item.operator.value].label];
|
|
50517
|
-
}
|
|
50518
|
-
break;
|
|
50519
|
-
case 'DATE_M':
|
|
50520
|
-
// 月
|
|
50521
|
-
if (item.value) {
|
|
50522
|
-
obj.value = item.value;
|
|
50523
|
-
obj.semantic = item.value.map(function (el) {
|
|
50524
|
-
var findTemp = item.field.dataSource.find(function (innerItem) {
|
|
50525
|
-
return Number(innerItem.value) === Number(el);
|
|
50526
|
-
});
|
|
50527
|
-
return (findTemp || {
|
|
50528
|
-
label: el
|
|
50529
|
-
}).label;
|
|
50530
|
-
});
|
|
50531
|
-
} else if (nullList$1.includes(item.operator.value)) {
|
|
50532
|
-
obj.value = [NULL_MAP$1[item.operator.value].value];
|
|
50533
|
-
obj.semantic = [NULL_MAP$1[item.operator.value].label];
|
|
50534
|
-
}
|
|
50535
|
-
break;
|
|
50536
|
-
case 'CATEGORY_SELECT_TREE':
|
|
50537
|
-
obj.field = item.field.field;
|
|
50538
|
-
obj.fieldName = item.field.desc;
|
|
50539
|
-
obj.operator = item.operator.value;
|
|
50540
|
-
obj.operatorName = item.operator.label;
|
|
50541
|
-
if (item.value) {
|
|
50542
|
-
var categoriesIds = [];
|
|
50543
|
-
var categoriesName = [];
|
|
50544
|
-
item.value.categories.forEach(function (str) {
|
|
50545
|
-
categoriesIds.push(str.id);
|
|
50546
|
-
categoriesName.push(str.name);
|
|
50547
|
-
});
|
|
50548
|
-
obj.semantic = categoriesName;
|
|
50549
|
-
obj.value = categoriesIds;
|
|
50550
|
-
} else if (item.operator.value === 'ISNULL') {
|
|
50551
|
-
obj.semantic = ['为空'];
|
|
50552
|
-
obj.value = ['ISNULL'];
|
|
50553
|
-
} else if (item.operator.value === 'NONULL') {
|
|
50554
|
-
obj.semantic = ['不为空'];
|
|
50555
|
-
obj.value = ['NONULL'];
|
|
50556
|
-
}
|
|
50557
|
-
break;
|
|
50558
|
-
case 'SELECT_MULTIPLE_TREE':
|
|
50559
|
-
// 下拉树多选
|
|
50560
|
-
if (item.value) {
|
|
50561
|
-
var ids = [];
|
|
50562
|
-
var names = [];
|
|
50563
|
-
var _list = item.value;
|
|
50564
|
-
_list.forEach(function (str) {
|
|
50565
|
-
ids.push(str.id);
|
|
50566
|
-
names.push(str.name);
|
|
50567
|
-
});
|
|
50568
|
-
obj.semantic = names;
|
|
50569
|
-
obj.value = names;
|
|
50570
|
-
} else if (nullList$1.includes(item.operator.value)) {
|
|
50571
|
-
obj.value = [NULL_MAP$1[item.operator.value].label];
|
|
50572
|
-
obj.semantic = [NULL_MAP$1[item.operator.value].label];
|
|
50573
|
-
}
|
|
50574
|
-
break;
|
|
50575
|
-
case 'SELECT_TREE':
|
|
50576
|
-
// 下拉树单选
|
|
50577
|
-
if (item.value) {
|
|
50578
|
-
obj.semantic = [item.field.label];
|
|
50579
|
-
obj.value = [item.field.label];
|
|
50580
|
-
} else if (nullList$1.includes(item.operator.value)) {
|
|
50581
|
-
obj.value = [NULL_MAP$1[item.operator.value].value];
|
|
50582
|
-
obj.semantic = [NULL_MAP$1[item.operator.value].label];
|
|
50583
|
-
}
|
|
50584
|
-
break;
|
|
50585
|
-
case 'MULTIPLE_SELECT':
|
|
50586
|
-
// 下拉多选
|
|
50587
|
-
if (item.value) {
|
|
50588
|
-
var _item$value;
|
|
50589
|
-
var _values = (_item$value = item.value) === null || _item$value === void 0 ? void 0 : _item$value.map(function (el) {
|
|
50590
|
-
var findTemp = item.field.dataSource.find(function (innerItem) {
|
|
50591
|
-
return innerItem.value === el;
|
|
50592
|
-
});
|
|
50593
|
-
return (findTemp || {
|
|
50594
|
-
label: el
|
|
50595
|
-
}).label;
|
|
50596
|
-
});
|
|
50597
|
-
obj.value = _values;
|
|
50598
|
-
obj.semantic = _values;
|
|
50599
|
-
} else if (nullList$1.includes(item.operator.value)) {
|
|
50600
|
-
obj.value = [NULL_MAP$1[item.operator.value].value];
|
|
50601
|
-
obj.semantic = [NULL_MAP$1[item.operator.value].label];
|
|
50602
|
-
}
|
|
50603
|
-
break;
|
|
50604
|
-
case 'SELECT':
|
|
50605
|
-
// 下拉单选
|
|
50606
|
-
if (item.value !== undefined) {
|
|
50607
|
-
obj.value = [item.value];
|
|
50608
|
-
var _list3 = item.field.dataSource.filter(function (el) {
|
|
50609
|
-
return el.value === item.value;
|
|
50610
|
-
});
|
|
50611
|
-
obj.semantic = [_list3[0].label];
|
|
50612
|
-
} else if (nullList$1.includes(item.operator.value)) {
|
|
50613
|
-
obj.value = [NULL_MAP$1[item.operator.value].value];
|
|
50614
|
-
obj.semantic = [NULL_MAP$1[item.operator.value].label];
|
|
50615
|
-
}
|
|
50616
|
-
break;
|
|
50617
|
-
case 'NUMBER_INT': // 整数
|
|
50618
|
-
case 'NUMBER_DECIMAL':
|
|
50619
|
-
// 小数
|
|
50620
|
-
if (item.value || item.value === 0) {
|
|
50621
|
-
obj.semantic = Array.isArray(item.value) ? item.value : [item.value];
|
|
50622
|
-
obj.value = Array.isArray(item.value) ? item.value : [item.value];
|
|
50623
|
-
} else if (nullList$1.includes(item.operator.value)) {
|
|
50624
|
-
obj.value = [NULL_MAP$1[item.operator.value].value];
|
|
50625
|
-
obj.semantic = [NULL_MAP$1[item.operator.value].label];
|
|
50626
|
-
}
|
|
50627
|
-
break;
|
|
50628
|
-
case 'STRING':
|
|
50629
|
-
// 字符
|
|
50630
|
-
if (item.value) {
|
|
50631
|
-
if (item.operator.value === 'LIKE') {
|
|
50632
|
-
// 假如是like操作还需要区分出或者还是并且的关系
|
|
50633
|
-
obj.value = item.value.value.map(function (val) {
|
|
50634
|
-
return val.replace(reg$1, '\\\'');
|
|
50635
|
-
});
|
|
50636
|
-
obj.multiText = item.value.relation ? 'AND' : 'OR';
|
|
50637
|
-
obj.semantic = item.value;
|
|
50638
|
-
} else if (Array.isArray(item.value)) {
|
|
50639
|
-
obj.semantic = item.value.filter(function (val) {
|
|
50640
|
-
return val !== '';
|
|
50641
|
-
});
|
|
50642
|
-
obj.value = item.value.filter(function (val) {
|
|
50643
|
-
return val !== '';
|
|
50644
|
-
}).map(function (val) {
|
|
50645
|
-
return val.replace(reg$1, '\\\'');
|
|
50646
|
-
});
|
|
50647
|
-
} else {
|
|
50648
|
-
obj.semantic = [item.value];
|
|
50649
|
-
obj.value = [item.value.replace(reg$1, '\\\'')];
|
|
50650
|
-
}
|
|
50651
|
-
} else if (nullList$1.includes(item.operator.value)) {
|
|
50652
|
-
obj.value = [NULL_MAP$1[item.operator.value].value];
|
|
50653
|
-
obj.semantic = [NULL_MAP$1[item.operator.value].label];
|
|
50654
|
-
}
|
|
50655
|
-
break;
|
|
50656
|
-
}
|
|
50657
|
-
}
|
|
50658
|
-
arr.push(obj);
|
|
50659
|
-
});
|
|
50660
|
-
return arr;
|
|
50661
|
-
}
|
|
50662
|
-
function queryConditionToStringNew(array) {
|
|
50663
|
-
var obj = {
|
|
50664
|
-
str: [],
|
|
50665
|
-
title: [],
|
|
50666
|
-
value: parsingNewCondition(array).filter(function (item) {
|
|
50667
|
-
return item.value.length || item.operator === "ISNULL" || item.operator === "NONULL";
|
|
50668
|
-
})
|
|
50669
|
-
};
|
|
50670
|
-
return obj;
|
|
50671
|
-
}
|
|
50672
|
-
|
|
50673
|
-
/**
|
|
50674
|
-
* 计算已选商品和sku的数量
|
|
50675
|
-
* @param {*} Object || Array
|
|
50676
|
-
*/
|
|
50677
|
-
function resultGoodsLength$1(obj) {
|
|
50678
|
-
// TODO SELECT
|
|
50679
|
-
var len = 0;
|
|
50680
|
-
if (Array.isArray(obj)) {
|
|
50681
|
-
if (obj.length) {
|
|
50682
|
-
obj.forEach(function (item) {
|
|
50683
|
-
if (item.rowExpandable) {
|
|
50684
|
-
len += item.skus.length;
|
|
50685
|
-
} else {
|
|
50686
|
-
len += 1;
|
|
50687
|
-
}
|
|
50688
|
-
});
|
|
50689
|
-
}
|
|
50690
|
-
} else {
|
|
50691
|
-
Object.keys(obj).forEach(function (item) {
|
|
50692
|
-
if (obj[item].rowExpandable) {
|
|
50693
|
-
// 假如是sku展开状态则商品数量以sku数量为准
|
|
50694
|
-
len += obj[item].skus.length;
|
|
50695
|
-
} else {
|
|
50696
|
-
len += 1;
|
|
50697
|
-
}
|
|
50698
|
-
});
|
|
50699
|
-
}
|
|
50700
|
-
return len;
|
|
50701
|
-
}
|
|
50702
|
-
|
|
50703
50731
|
// 动态条件
|
|
50704
50732
|
function DynamicCondition(props) {
|
|
50705
50733
|
var _useState = React.useState([]),
|
|
@@ -50846,7 +50874,7 @@
|
|
|
50846
50874
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
50847
50875
|
className: "".concat(prefixCls, "-rule-group")
|
|
50848
50876
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
50849
|
-
className: "".concat(prefixCls, "-rule-group-title
|
|
50877
|
+
className: "".concat(prefixCls, "-rule-group-title")
|
|
50850
50878
|
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
50851
50879
|
style: {
|
|
50852
50880
|
display: 'flex'
|
|
@@ -50872,7 +50900,7 @@
|
|
|
50872
50900
|
currentRule: props.currentRule,
|
|
50873
50901
|
setCurrentRule: props.setDynamicCondition
|
|
50874
50902
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
50875
|
-
className: "condition-
|
|
50903
|
+
className: "edit-condition ".concat(prefixCls, "-goods-selector-new-goods-table-wrap")
|
|
50876
50904
|
}, /*#__PURE__*/React__default['default'].createElement(Conditions$1.Form, null))) : /*#__PURE__*/React__default['default'].createElement(cloudReactV2.Loading, null));
|
|
50877
50905
|
}
|
|
50878
50906
|
|
|
@@ -51136,7 +51164,7 @@
|
|
|
51136
51164
|
maxWidth: "570px"
|
|
51137
51165
|
}
|
|
51138
51166
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
51139
|
-
className: "".concat(prefixCls, "-goods-selector-
|
|
51167
|
+
className: "".concat(prefixCls, "-goods-selector-new-create-condition")
|
|
51140
51168
|
}, /*#__PURE__*/React__default['default'].createElement(cloudReactV2.Tips, {
|
|
51141
51169
|
icon: "info-circle1",
|
|
51142
51170
|
msg: "<div><div>1. \u53EF\u521B\u5EFA\u548C\u4FDD\u5B58\u6700\u8FD1\u768430\u4E2A\u5546\u54C1\u67E5\u8BE2\u6761\u4EF6\uFF1B\u8D85\u8FC730\u4E2A\u65F6\uFF0C\u7CFB\u7EDF\u5C06\u6309\u4ECE\u65E9\u53CA\u665A\u89C4\u5219\u5220\u9664\u3002</div><div>2. \u4FDD\u5B58\u6210\u529F\u540E\uFF0C\u53EF\u70B9\u51FB\u3010\u5E38\u7528\u67E5\u8BE2\u6761\u4EF6\u3011\u627E\u5230\u4FDD\u5B58\u8FC7\u7684\u67E5\u8BE2\u6761\u4EF6\u3002</div></div>",
|
|
@@ -51607,7 +51635,7 @@
|
|
|
51607
51635
|
initData();
|
|
51608
51636
|
};
|
|
51609
51637
|
var footer = /*#__PURE__*/React__default['default'].createElement("div", {
|
|
51610
|
-
className: "goods-selector-
|
|
51638
|
+
className: "".concat(prefixCls, "-goods-selector-new-footer")
|
|
51611
51639
|
}, !props.readonly ? /*#__PURE__*/React__default['default'].createElement(cloudReactV2.Button, {
|
|
51612
51640
|
className: "cancel",
|
|
51613
51641
|
onClick: closePop
|
|
@@ -52690,7 +52718,7 @@
|
|
|
52690
52718
|
}
|
|
52691
52719
|
}), "\u53EF\u5C06\u5E38\u7528\u7684\u67E5\u8BE2\u6761\u4EF6\u8BBE\u4E3A\u9ED8\u8BA4\uFF0C\u9ED8\u8BA4\u7684\u67E5\u8BE2\u6761\u4EF6\u5C06\u88AB\u56FA\u5B9A\u5728\u5546\u54C1\u641C\u7D22\u6761\u4EF6\u7684\u754C\u9762\u4E0A\u3002");
|
|
52692
52720
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
52693
|
-
className: "
|
|
52721
|
+
className: "add-condition-new"
|
|
52694
52722
|
}, /*#__PURE__*/React__default['default'].createElement(cloudReactV2.Tips, {
|
|
52695
52723
|
msg: tipNode
|
|
52696
52724
|
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -53785,7 +53813,7 @@
|
|
|
53785
53813
|
// const hiddenDisplayQuery = usedQuery.slice(6);
|
|
53786
53814
|
|
|
53787
53815
|
var footer = /*#__PURE__*/React__default['default'].createElement("div", {
|
|
53788
|
-
className: "goods-selector-
|
|
53816
|
+
className: "".concat(prefixCls, "-goods-selector-new-footer")
|
|
53789
53817
|
}, !props.readonly ? /*#__PURE__*/React__default['default'].createElement(cloudReactV2.Button, {
|
|
53790
53818
|
className: "cancel",
|
|
53791
53819
|
onClick: handleClose
|
|
@@ -53798,7 +53826,7 @@
|
|
|
53798
53826
|
onClick: handleOk
|
|
53799
53827
|
}, "\u786E\u5B9A"));
|
|
53800
53828
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
53801
|
-
className: "goods-selector-
|
|
53829
|
+
className: "".concat(prefixCls, "-goods-selector-new-goods-form")
|
|
53802
53830
|
}, dropDown && usedQuery.length ? usedQuery.map(function (item) {
|
|
53803
53831
|
var itemId = item.itemId,
|
|
53804
53832
|
itemName = item.itemName,
|
|
@@ -54632,7 +54660,7 @@
|
|
|
54632
54660
|
setColumns(ctxValue.globalSelectColumn);
|
|
54633
54661
|
}, [ctxValue.globalSelectColumn]);
|
|
54634
54662
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
54635
|
-
className: "
|
|
54663
|
+
className: "".concat(prefixCls, "-goods-selector-new-goods-table-wrap")
|
|
54636
54664
|
}, allQuery.length ? /*#__PURE__*/React__default['default'].createElement(GoodsForm$1, {
|
|
54637
54665
|
platShop: platShop,
|
|
54638
54666
|
platShopList: platShopList,
|
|
@@ -54948,7 +54976,7 @@
|
|
|
54948
54976
|
setColumns(ctxValue.globalSelectColumn);
|
|
54949
54977
|
}, [ctxValue.globalSelectColumn]);
|
|
54950
54978
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
54951
|
-
className: "
|
|
54979
|
+
className: "".concat(prefixCls, "-goods-selector-new-selected-tab ").concat(prefixCls, "-goods-selector-new-goods-table-wrap")
|
|
54952
54980
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
54953
54981
|
className: "justify-between"
|
|
54954
54982
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -55131,18 +55159,9 @@
|
|
|
55131
55159
|
}();
|
|
55132
55160
|
var onClose = function onClose() {
|
|
55133
55161
|
props.onClose(globalSelect);
|
|
55134
|
-
// setCurrentPageNum(1),
|
|
55135
|
-
// setCurrentPageSize(10)
|
|
55136
55162
|
};
|
|
55137
|
-
|
|
55138
|
-
// const footer = <>
|
|
55139
|
-
// {!props.readonly ? <Button style={{ marginRight: 16 }} className="cancel-btn" onClick={onCancel}>取消</Button> : null}
|
|
55140
|
-
// <Button type="primary" onClick={onOk}>确定</Button>
|
|
55141
|
-
|
|
55142
|
-
// </>;
|
|
55143
|
-
|
|
55144
55163
|
var footer = /*#__PURE__*/React__default['default'].createElement("div", {
|
|
55145
|
-
className: "goods-selector-
|
|
55164
|
+
className: "".concat(prefixCls, "-goods-selector-new-footer")
|
|
55146
55165
|
}, !props.readonly ? /*#__PURE__*/React__default['default'].createElement(cloudReactV2.Button, {
|
|
55147
55166
|
className: "cancel",
|
|
55148
55167
|
onClick: onCancel
|
|
@@ -55165,7 +55184,7 @@
|
|
|
55165
55184
|
}, /*#__PURE__*/React__default['default'].createElement(GoodsProvider$1, {
|
|
55166
55185
|
value: props.ctxContext
|
|
55167
55186
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
55168
|
-
className: "".concat(prefixCls, "-goods-selector-
|
|
55187
|
+
className: "".concat(prefixCls, "-goods-selector-new-goods-modal"),
|
|
55169
55188
|
style: {
|
|
55170
55189
|
position: 'relative'
|
|
55171
55190
|
}
|
|
@@ -55178,7 +55197,7 @@
|
|
|
55178
55197
|
})
|
|
55179
55198
|
}) : null, /*#__PURE__*/React__default['default'].createElement(cloudReactV2.Tabs, {
|
|
55180
55199
|
defaultActiveKey: "all",
|
|
55181
|
-
className: "".concat(prefixCls, "-goods-selector-
|
|
55200
|
+
className: "".concat(prefixCls, "-goods-selector-new-goods-modal-tabs"),
|
|
55182
55201
|
activeKey: nowActive,
|
|
55183
55202
|
mode: "remain",
|
|
55184
55203
|
type: "line",
|
|
@@ -55186,7 +55205,7 @@
|
|
|
55186
55205
|
}, tabList.includes('all') && !readonly && /*#__PURE__*/React__default['default'].createElement(cloudReactV2.Tabs.Panel, {
|
|
55187
55206
|
tab: "\u5168\u90E8\u5546\u54C1",
|
|
55188
55207
|
key: "all",
|
|
55189
|
-
className: "".concat(prefixCls, "-goods-selector-
|
|
55208
|
+
className: "".concat(prefixCls, "-goods-selector-new-goods-modal-tabs-panel")
|
|
55190
55209
|
}, /*#__PURE__*/React__default['default'].createElement(AllGoods$1, _extends({
|
|
55191
55210
|
tabActive: nowActive
|
|
55192
55211
|
}, props, {
|
|
@@ -55195,7 +55214,7 @@
|
|
|
55195
55214
|
}))), tabList.includes('selected') && /*#__PURE__*/React__default['default'].createElement(cloudReactV2.Tabs.Panel, {
|
|
55196
55215
|
tab: "\u5DF2\u9009\u5546\u54C1",
|
|
55197
55216
|
key: "selected",
|
|
55198
|
-
className: "".concat(prefixCls, "-goods-selector-
|
|
55217
|
+
className: "".concat(prefixCls, "-goods-selector-new-goods-modal-tabs-panel")
|
|
55199
55218
|
}, /*#__PURE__*/React__default['default'].createElement(SelectGoods$2, {
|
|
55200
55219
|
server: server,
|
|
55201
55220
|
extraQuery: extraQuery,
|
|
@@ -55455,7 +55474,7 @@
|
|
|
55455
55474
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
55456
55475
|
className: "".concat(prefixCls, "-rule-group")
|
|
55457
55476
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
55458
|
-
className: "".concat(prefixCls, "-rule-group-title
|
|
55477
|
+
className: "".concat(prefixCls, "-rule-group-title")
|
|
55459
55478
|
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
55460
55479
|
style: {
|
|
55461
55480
|
display: 'flex'
|
|
@@ -56254,9 +56273,9 @@
|
|
|
56254
56273
|
supportSku: props.supportSku,
|
|
56255
56274
|
showPage: showPage
|
|
56256
56275
|
})))), tabList.includes('find') ? /*#__PURE__*/React__default['default'].createElement("div", {
|
|
56257
|
-
className: "".concat(prefixCls, "-goods-selector-
|
|
56276
|
+
className: "".concat(prefixCls, "-goods-selector-new-goods-modal")
|
|
56258
56277
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
56259
|
-
className: "".concat(prefixCls, "-
|
|
56278
|
+
className: "".concat(prefixCls, "-goods-selector-new-rules-container")
|
|
56260
56279
|
}, !props.supportConditionsOnlyGoods && /*#__PURE__*/React__default['default'].createElement(cloudReactV2.Tips, {
|
|
56261
56280
|
icon: "info-circle1",
|
|
56262
56281
|
msg: "\u540C\u65F6\u4FDD\u5B58\u5546\u54C1\u67E5\u8BE2\u548C\u6761\u4EF6\u67E5\u8BE2\uFF0C\u67E5\u8BE2\u7ED3\u679C\u4E3A\u4E24\u8005\u7684\u5E76\u96C6\u3002",
|
|
@@ -56361,7 +56380,7 @@
|
|
|
56361
56380
|
renameData: renameData,
|
|
56362
56381
|
ctxValue: ctxValue
|
|
56363
56382
|
}))) : /*#__PURE__*/React__default['default'].createElement("div", {
|
|
56364
|
-
className: "".concat(prefixCls, "-goods-selector-
|
|
56383
|
+
className: "".concat(prefixCls, "-goods-selector-new-goods-modal"),
|
|
56365
56384
|
style: {
|
|
56366
56385
|
position: 'relative'
|
|
56367
56386
|
}
|
|
@@ -56374,7 +56393,7 @@
|
|
|
56374
56393
|
})
|
|
56375
56394
|
}) : null, /*#__PURE__*/React__default['default'].createElement(cloudReactV2.Tabs, {
|
|
56376
56395
|
defaultActiveKey: "1",
|
|
56377
|
-
className: "".concat(prefixCls, "-goods-selector-
|
|
56396
|
+
className: "".concat(prefixCls, "-goods-selector-new-goods-modal-tabs"),
|
|
56378
56397
|
activeKey: nowActive,
|
|
56379
56398
|
mode: "remain",
|
|
56380
56399
|
type: "line",
|
|
@@ -56382,7 +56401,7 @@
|
|
|
56382
56401
|
}, tabList.includes('all') && !props.readonly && /*#__PURE__*/React__default['default'].createElement(cloudReactV2.Tabs.Panel, {
|
|
56383
56402
|
tab: "\u5168\u90E8\u5546\u54C1",
|
|
56384
56403
|
key: "all",
|
|
56385
|
-
className: "".concat(prefixCls, "-goods-selector-
|
|
56404
|
+
className: "".concat(prefixCls, "-goods-selector-new-goods-modal-tab-panel")
|
|
56386
56405
|
}, /*#__PURE__*/React__default['default'].createElement(AllGoods$1, _extends({}, props, {
|
|
56387
56406
|
tabActive: nowActive,
|
|
56388
56407
|
changeCondition: changeCondition,
|
|
@@ -56390,7 +56409,7 @@
|
|
|
56390
56409
|
}))), tabList.includes('selected') && /*#__PURE__*/React__default['default'].createElement(cloudReactV2.Tabs.Panel, {
|
|
56391
56410
|
tab: "\u5DF2\u9009\u5546\u54C1",
|
|
56392
56411
|
key: "selected",
|
|
56393
|
-
className: "".concat(prefixCls, "-goods-selector-
|
|
56412
|
+
className: "".concat(prefixCls, "-goods-selector-new-goods-modal-tabs-panel")
|
|
56394
56413
|
}, /*#__PURE__*/React__default['default'].createElement(SelectGoods$2, {
|
|
56395
56414
|
server: server,
|
|
56396
56415
|
extraQuery: extraQuery,
|
|
@@ -56591,7 +56610,7 @@
|
|
|
56591
56610
|
setModalVisible(visible);
|
|
56592
56611
|
}, [visible]);
|
|
56593
56612
|
var footer = /*#__PURE__*/React__default['default'].createElement("div", {
|
|
56594
|
-
className: "goods-selector-
|
|
56613
|
+
className: "".concat(prefixCls, "-goods-selector-new-footer")
|
|
56595
56614
|
}, /*#__PURE__*/React__default['default'].createElement(cloudReactV2.Button, {
|
|
56596
56615
|
className: "cancel",
|
|
56597
56616
|
onClick: onCancel
|
|
@@ -56676,7 +56695,7 @@
|
|
|
56676
56695
|
onClose: onClose
|
|
56677
56696
|
// onCancel={onCancel}
|
|
56678
56697
|
,
|
|
56679
|
-
className: "goods-selector-
|
|
56698
|
+
className: "".concat(prefixCls, "-goods-selector-new")
|
|
56680
56699
|
}, visible && rulesVisible && /*#__PURE__*/React__default['default'].createElement(Rules, _extends({
|
|
56681
56700
|
modalRef: modalRef,
|
|
56682
56701
|
forwardRef: ref
|
|
@@ -146405,7 +146424,7 @@
|
|
|
146405
146424
|
}
|
|
146406
146425
|
// 检验当前运行环境
|
|
146407
146426
|
if (typeof window === 'undefined') {
|
|
146408
|
-
console.warn('cloud-business@0.1.124-
|
|
146427
|
+
console.warn('cloud-business@0.1.124-2 仅支持在浏览器环境进行使用!');
|
|
146409
146428
|
}
|
|
146410
146429
|
var bodys = document.getElementsByTagName('body')[0];
|
|
146411
146430
|
var colors = [1, 2, 3, 4, 5, 6, 7];
|
|
@@ -146415,7 +146434,7 @@
|
|
|
146415
146434
|
bodys.style.setProperty("--shuyunBlue".concat(i$2 + 1), color);
|
|
146416
146435
|
}
|
|
146417
146436
|
}
|
|
146418
|
-
var version = '0.1.124-
|
|
146437
|
+
var version = '0.1.124-2';
|
|
146419
146438
|
|
|
146420
146439
|
exports.AreaSelector = AreaSelector;
|
|
146421
146440
|
exports.AreaSelectorNew = AreaSelector$1;
|