|
|
@@ -1927,72 +1927,19 @@ var projectObj = {
|
|
|
}
|
|
|
return this.itemCol?!this.itemCol.visible:true;
|
|
|
},
|
|
|
- //综合合价cellType
|
|
|
- getCommonTotalFeeCellType:function () {
|
|
|
- let type = 'bills';
|
|
|
- var ns = GC.Spread.Sheets;
|
|
|
- function CommonTotalFeeCellType() {
|
|
|
- var init=false;
|
|
|
- }
|
|
|
- CommonTotalFeeCellType.prototype = new ns.CellTypes.Text();
|
|
|
- CommonTotalFeeCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
|
|
|
- if(!projectReadOnly && calcBaseView.ifEdit(type, options.row)){
|
|
|
- if(options.sheet.getActiveRowIndex()==options.row&&options.sheet.getActiveColumnIndex()==options.col){
|
|
|
- var image = document.getElementById('f_btn'),imageMagin = 3;
|
|
|
- var imageHeight = 15;
|
|
|
- var imageWidth = 25;
|
|
|
- var imageX = x + w - imageWidth- imageMagin, imageY = y + h / 2 - imageHeight / 2;
|
|
|
- ctx.save();
|
|
|
- ctx.fillStyle = style.backColor;
|
|
|
- ctx.fillRect(x,y,w,h);
|
|
|
- ctx.drawImage(image, imageX, imageY,imageWidth,imageHeight);
|
|
|
- ctx.beginPath();
|
|
|
- ctx.arc(imageX+imageWidth/2,imageY+imageHeight/2,1,0,360,false);
|
|
|
- ctx.arc(imageX+imageWidth/2-4,imageY+imageHeight/2,1,0,360,false);
|
|
|
- ctx.arc(imageX+imageWidth/2+4,imageY+imageHeight/2,1,0,360,false);
|
|
|
- ctx.fillStyle="black";//填充颜色,默认是黑色
|
|
|
- ctx.fill();//画实心圆
|
|
|
- ctx.closePath();
|
|
|
- ctx.restore();
|
|
|
- w = w - imageWidth - imageMagin;
|
|
|
- }
|
|
|
- }
|
|
|
- GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
|
|
|
- };
|
|
|
- CommonTotalFeeCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
|
|
|
- return {
|
|
|
- x: x,
|
|
|
- y: y,
|
|
|
- row: context.row,
|
|
|
- col: context.col,
|
|
|
- cellStyle: cellStyle,
|
|
|
- cellRect: cellRect,
|
|
|
- sheetArea: context.sheetArea
|
|
|
- };
|
|
|
- };
|
|
|
- CommonTotalFeeCellType.prototype.processMouseDown = function (hitinfo) {
|
|
|
- let me = calcBaseView;
|
|
|
- if(hitinfo.sheet.getActiveRowIndex()==hitinfo.row&&hitinfo.sheet.getActiveColumnIndex()==hitinfo.col){
|
|
|
- var offset=hitinfo.cellRect.x+hitinfo.cellRect.width-6;
|
|
|
- var imageWidth = 25;
|
|
|
- if(hitinfo.x<offset&&hitinfo.x>offset-imageWidth){
|
|
|
- if(!projectReadOnly && me.ifEdit(type, hitinfo.row)){
|
|
|
- let node = projectObj.project.mainTree.items[hitinfo.row] ? projectObj.project.mainTree.items[hitinfo.row] : null;
|
|
|
- if(hitinfo.sheet.getParent() === projectObj.mainSpread){
|
|
|
- projectObj.mainController.setTreeSelected(node);
|
|
|
- }
|
|
|
- hitinfo.sheet.setActiveCell(hitinfo.row, hitinfo.col);
|
|
|
- calcBaseView.confirmBtn.attr('toggle', 'commonTotalFee');
|
|
|
- //changeCalcBaseFeeRate('commonTotalFee');//公路上不需要费率选项页
|
|
|
- changeCalcBaseFeeRate('calcBase');
|
|
|
- $('#tabCalcBase').tab('show');
|
|
|
- calcBaseView.initCalctor(type);
|
|
|
- //feeRateObject.showSelectModal(hitinfo);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
- return new CommonTotalFeeCellType();
|
|
|
+ onCommonTotalFeeButtonClick:function(hitinfo){
|
|
|
+ let me = calcBaseView;
|
|
|
+ let node = projectObj.project.mainTree.items[hitinfo.row] ? projectObj.project.mainTree.items[hitinfo.row] : null;
|
|
|
+ if(hitinfo.sheet.getParent() === projectObj.mainSpread){
|
|
|
+ projectObj.mainController.setTreeSelected(node);
|
|
|
+ }
|
|
|
+ hitinfo.sheet.setActiveCell(hitinfo.row, hitinfo.col);
|
|
|
+ calcBaseView.confirmBtn.attr('toggle', 'commonTotalFee');
|
|
|
+ //changeCalcBaseFeeRate('commonTotalFee');//公路上不需要费率选项页
|
|
|
+ changeCalcBaseFeeRate('calcBase');
|
|
|
+ $('#tabCalcBase').tab('show');
|
|
|
+ calcBaseView.initCalctor('bills');
|
|
|
+ //feeRateObject.showSelectModal(hitinfo);
|
|
|
},
|
|
|
selectColAndFocus :function (newNode,field = 'code') {//选中单元格并设置焦点
|
|
|
if(newNode){
|