|
|
var $ = require('jquery'),
|
|
|
common = require('../common/common');
|
|
|
require('../common/umeditor.config');
|
|
|
require('../common/umeditor');
|
|
|
require('../common/zh-cn');
|
|
|
|
|
|
var baidu;
|
|
|
|
|
|
|
|
|
/*获取数据ViewModel*/
|
...
|
...
|
@@ -104,6 +109,9 @@ var Bll = { |
|
|
button: [{
|
|
|
value: "保存",
|
|
|
callback: function () {
|
|
|
if(module.contentData.dialog=="template_dialog_text"){
|
|
|
module.contentData.data.text=baidu.getContent();
|
|
|
}
|
|
|
if (components.validate()) {
|
|
|
//TODO
|
|
|
!!~index ? Bll.contentDatas[index] = module : Bll.contentDatas.push(module);
|
...
|
...
|
@@ -116,6 +124,13 @@ var Bll = { |
|
|
}]
|
|
|
});
|
|
|
Bll.__editRender();
|
|
|
if(module.contentData.dialog=="template_dialog_text"){
|
|
|
baidu&&baidu.destroy();
|
|
|
baidu=UM.getEditor('baidueditor');
|
|
|
baidu.setContent(module.contentData.data.text);
|
|
|
}
|
|
|
|
|
|
|
|
|
},
|
|
|
renderDialog: function (templater) {
|
|
|
Bll.__render(".modal-body", templater, Bll.module);
|
...
|
...
|
@@ -412,7 +427,11 @@ var goodsgird = new common.grid({ |
|
|
if (common.util.__input('endPrice')) {
|
|
|
endPrice = common.util.__input('endPrice')
|
|
|
}
|
|
|
return {
|
|
|
return {//status=1&sales=Y&stocknumber=1&attribute_not=2
|
|
|
status:1,
|
|
|
sales:"Y",
|
|
|
stocknumber:"1",
|
|
|
attribute_not:"2",
|
|
|
query: common.util.__input('skns'),
|
|
|
price: beginPrice + "," + endPrice
|
|
|
};
|
...
|
...
|
@@ -656,6 +675,19 @@ $(document).on("change", "#maxSortId", function () { |
|
|
});
|
|
|
});
|
|
|
|
|
|
|
|
|
var Unique = function(Array) {
|
|
|
var res = [], hash = {};
|
|
|
for(var i=0, elem; (elem = Array[i]) != null; i++) {
|
|
|
if (!hash[elem.id])
|
|
|
{
|
|
|
res.push(elem);
|
|
|
hash[elem.id] = true;
|
|
|
}
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
$(document).on("click", "#brandAutoBtn", function () {
|
|
|
var product_skc = [];
|
|
|
Bll.contentDatas.forEach(function (item, index) {
|
...
|
...
|
@@ -700,7 +732,9 @@ $(document).on("click", "#brandAutoBtn", function () { |
|
|
b.push(map[item]);
|
|
|
}
|
|
|
});
|
|
|
Bll.Brdata = (ViewModel.brandList || []).concat(b);
|
|
|
Bll.Brdata = (Bll.Brdata||ViewModel.brandList || []).concat(b);
|
|
|
Bll.Brdata=Unique(Bll.Brdata);
|
|
|
// Bll.Brdata=Bll.Brdata.unique5()
|
|
|
// var map2={};
|
|
|
// Bll.Brdata.forEach(function(item){
|
|
|
// map2[item.id]=item;
|
...
|
...
|
|