|
@@ -469,7 +469,6 @@ var projectObj = {
|
|
|
that.mainSpread.bind(GC.Spread.Sheets.Events.SelectionChanged, that.amountAreaNumber);
|
|
|
that.loadMainSpreadContextMenu();
|
|
|
that.loadFocusLocation();
|
|
|
- that.setRootsStyle();
|
|
|
let endTime = +new Date();
|
|
|
console.log("加载完成-----"+endTime);
|
|
|
}
|
|
@@ -803,29 +802,15 @@ var projectObj = {
|
|
|
}, 200);
|
|
|
};
|
|
|
},
|
|
|
- setRootsStyle: function () {
|
|
|
- let me = this;
|
|
|
- let style = new GC.Spread.Sheets.Style();
|
|
|
- // style.backColor = "#d5e8ee";
|
|
|
- style.font = 'bold 15px Arial';
|
|
|
- let count = me.project.mainTree.items.length;
|
|
|
- for (var i = 0; i < count; i++) {
|
|
|
- if (!me.project.mainTree.items[i].parent)
|
|
|
- me.mainSpread.getActiveSheet().setStyle(i, -1, style, GC.Spread.Sheets.SheetArea.viewport);
|
|
|
- }
|
|
|
-},
|
|
|
+
|
|
|
//根据节点获取行style(颜色、字体加粗)
|
|
|
getNodeColorStyle: function (node) {
|
|
|
- let type, backColor = null, font = null;
|
|
|
+ let type, backColor = null, foreColor = null;
|
|
|
if(!isDef(node)){
|
|
|
return null;
|
|
|
}
|
|
|
//清单大类
|
|
|
if(node.sourceType === this.project.Bills.getSourceType()){
|
|
|
- //大项费用
|
|
|
- if(node.data.type === billType.DXFY){
|
|
|
- type = 0;
|
|
|
- }
|
|
|
//分部
|
|
|
if(node.data.type === billType.FB){
|
|
|
type = 1;
|
|
@@ -855,18 +840,18 @@ var projectObj = {
|
|
|
type = 4;
|
|
|
}
|
|
|
switch (type){
|
|
|
- case 0: font = 'bold 15px "Arial"'; break;
|
|
|
+ //case 0: font = 'bold 13px "Arial"'; break;
|
|
|
case 1: backColor = '#c1d3e3'; break;
|
|
|
case 2: backColor = '#dae5ee'; break;
|
|
|
case 3: backColor = '#e5f3f2'; break;
|
|
|
- case 4: backColor = '#4DBCFB'; break;
|
|
|
+ case 4: foreColor = '#4D7BFF'; break;
|
|
|
}
|
|
|
- if(!font && !backColor){
|
|
|
+ if(!backColor && !foreColor){
|
|
|
return null;
|
|
|
}
|
|
|
let style = new GC.Spread.Sheets.Style();
|
|
|
- if(font){
|
|
|
- style.font = 'bold 15px "Arial"';
|
|
|
+ if(foreColor){
|
|
|
+ style.foreColor = foreColor;
|
|
|
}
|
|
|
if(backColor){
|
|
|
style.backColor = backColor;
|
|
@@ -875,8 +860,35 @@ var projectObj = {
|
|
|
style.borderRight = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
|
|
|
style.borderBottom = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
|
|
|
}
|
|
|
- return style;
|
|
|
-}
|
|
|
+ return style;
|
|
|
+ },
|
|
|
+ //大项费用则字体加粗,String 15px, Number 13px
|
|
|
+ getBoldFontStyle: function (node, colSetting) {
|
|
|
+ if(node.sourceType !== this.project.Bills.getSourceType() || node.data.type !== billType.DXFY){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ let style = new GC.Spread.Sheets.Style();
|
|
|
+ //备注暂无字段
|
|
|
+ let stringFields = [
|
|
|
+ 'code',
|
|
|
+ 'subType',
|
|
|
+ 'name',
|
|
|
+ 'unit',
|
|
|
+ 'itemCharacterText',
|
|
|
+ 'jobContentText',
|
|
|
+ 'adjustState',
|
|
|
+ 'calcBase',
|
|
|
+ 'programID',
|
|
|
+ 'ruleText'
|
|
|
+ ];
|
|
|
+ if(stringFields.indexOf(colSetting.data.field) > 0){
|
|
|
+ style.font = 'bold 15px Arial';
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ style.font = 'bold 13px Arial';
|
|
|
+ }
|
|
|
+ return style;
|
|
|
+ }
|
|
|
};
|
|
|
// 点击合计框中的复制
|
|
|
$("body").on("click", "#total-tips a", function() {
|