Commit db133702 by halweg

inc to cm

parent 8254912a
......@@ -427,11 +427,45 @@ define([
label += currentItem[i]+" : ";
continue;
}
/*单位转换代码,预留待用
if (typeof(currentItem[i]) == "string") {
label += dealLabel(option[i], currentItem[i]);
} else {
label += option[i] + ' ' + currentItem[i] +"("+getCurrentType()+") ";
}*/
label += option[i] + ' ' + currentItem[i] +"(inc) ";
if (i < labelLen - 1) {
label +=", ";
}
}
function getCurrentType()
{
var type = $(".chart-size-switch-item.-active").data("size-type");
return type;
}
function dealLabel(option, current)
{
var percent = 2.54;
var data = current.split("-");
if (data.length == 0) {
return " ";
}
var currentType = getCurrentType();
if (currentType == 'inc') {
return option + ' ' + currentItem +"(inc) ";
}
let tmp = [];
for(let i=0; i < data.length; i++) {
var res = (data[i] * percent - 0).toFixed(2);
tmp.push(res);
}
if (tmp instanceof Array) {
tmp = tmp.join('-');
}
return option + ' ' + tmp +"(cm) ";
}
return label;
},
......@@ -568,7 +602,7 @@ define([
listLabel = '',
label = '';
if (item.code == "size") {
if (item.code == "size" ) {
var options = $widget._RenderSwatchWithCustomerOptions(item, controlLabelId);
} else {
var options = $widget._RenderSwatchOptions(item, controlLabelId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment