|
@@ -584,6 +584,7 @@ var projectObj = {
|
|
|
this.mainSpread = SheetDataHelper.createNewSpread($('#billsSpread')[0]);
|
|
|
this.mainSpread.getActiveSheet().selectionPolicy(GC.Spread.Sheets.SelectionPolicy.muliRange);
|
|
|
this.mainSpread.getActiveSheet().name('mainSheet');
|
|
|
+ this.mainSpread.getActiveSheet().options.isProtected = true;
|
|
|
}
|
|
|
},
|
|
|
refreshMainSpread: function () {
|
|
@@ -680,7 +681,9 @@ var projectObj = {
|
|
|
that.mainSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, that.onCellDoubleClick);
|
|
|
|
|
|
//let loadOtherStartTime = +new Date();
|
|
|
- that.loadMainSpreadContextMenu();
|
|
|
+ if(!projectReadOnly){
|
|
|
+ that.loadMainSpreadContextMenu();
|
|
|
+ }
|
|
|
that.loadFocusLocation();
|
|
|
socketObject.connect();//连接socket服务器
|
|
|
let endTime = +new Date();
|
|
@@ -694,6 +697,9 @@ var projectObj = {
|
|
|
//定位到会话中的选项
|
|
|
let mainTabFocus = sessionStorage.getItem('mainTab') ? sessionStorage.getItem('mainTab') : '#tab_zaojiashu';
|
|
|
$(`${mainTabFocus}`).click();
|
|
|
+ if(projectReadOnly){
|
|
|
+ disableSpread(that.mainSpread);
|
|
|
+ }
|
|
|
$.bootstrapLoading.end();
|
|
|
}
|
|
|
else {
|
|
@@ -1498,7 +1504,9 @@ $("a[name='lockBills']").click(function () {//
|
|
|
controller.refreshTreeNode(nodes);
|
|
|
projectObj.mainController.setTreeSelected(selected);//触发树节点选中事件
|
|
|
projectObj.loadLockBillsButton();
|
|
|
- pageCCOprObj.refreshRuleTools(lockBills);
|
|
|
+ if(!projectReadOnly){
|
|
|
+ pageCCOprObj.refreshRuleTools(lockBills);
|
|
|
+ }
|
|
|
});
|
|
|
});
|
|
|
$('#ZLFB_btn').click(function () {
|
|
@@ -2139,4 +2147,95 @@ $(function () {
|
|
|
spread?spread.focus():'';
|
|
|
}
|
|
|
}
|
|
|
-});
|
|
|
+ //项目为只读
|
|
|
+ if(projectReadOnly){
|
|
|
+ disableTools();
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+//项目只读,处理不可操作的工具栏
|
|
|
+function disableTools(){
|
|
|
+ //造价书按钮
|
|
|
+ $('#delete').remove();
|
|
|
+ $('#upLevel').remove();
|
|
|
+ $('#downLevel').remove();
|
|
|
+ $('#upMove').remove();
|
|
|
+ $('#downMove').remove();
|
|
|
+ $('#ZLFB_btn').remove();
|
|
|
+ $('a[name="lockBills"]').remove();
|
|
|
+ //关于计算
|
|
|
+ $('#poj-settings-4').find('input').prop('disabled', 'disabled');
|
|
|
+ //小数位数
|
|
|
+ $('#poj-settings-decimal').find('input').prop('disabled', 'disabled');
|
|
|
+ //人工单价调整
|
|
|
+ $('#std_labour_coe_files').prop('disabled', 'disabled');
|
|
|
+ //呈现选项
|
|
|
+ $('#display-setting').find('input').prop('disabled', 'disabled');
|
|
|
+ //项目属性确定
|
|
|
+ $('#property_ok').addClass('disabled');
|
|
|
+ //特征及内容
|
|
|
+ $('#add-rule').find('select').prop('disabled', 'disabled');
|
|
|
+ $('#use-to-current').addClass('disabled');
|
|
|
+ $('#use-to-all').addClass('disabled');
|
|
|
+ $('.bottom-tools').remove();
|
|
|
+ //导入
|
|
|
+ $('#uploadConfirm').addClass('disabled');
|
|
|
+ //选项
|
|
|
+ $('#generalOpts1').prop('disabled', 'disabled');
|
|
|
+ $('#generalOpts2').prop('disabled', 'disabled');
|
|
|
+ //补充库编辑器
|
|
|
+ $('#compleRationLib').addClass('disabled');
|
|
|
+ $('#compleGljLib').addClass('disabled')
|
|
|
+ //库
|
|
|
+ $('#stdBillsGuidanceTab').addClass('disabled');
|
|
|
+ $('#stdBillsTab').addClass('disabled');
|
|
|
+ $('#stdRationTab').addClass('disabled');
|
|
|
+ //人材机汇总,选择其他、另存使用
|
|
|
+ $('a[data-target="#change-unitFile"]').remove();
|
|
|
+ $('a[data-target="#unitFile-save-as"]').remove();
|
|
|
+ //费率,选择其他、另存使用、重选标准、统一设置相同参数
|
|
|
+ $('a[data-target="#change-lv"]').remove();
|
|
|
+ $('a[data-target="#copy-lv"]').remove();
|
|
|
+ $('#standardSelect').prop('disabled', 'disabled');
|
|
|
+ $('#cascadeSet').prop('disabled', 'disabled');
|
|
|
+ //计算程序标准
|
|
|
+ $('#calcProgramFileSelect').prop('disabled', 'disabled');
|
|
|
+ //调价
|
|
|
+ $('#calcPriceOption').prop('disabled', 'disabled');
|
|
|
+ $('#gljPriceTenderCoe').prop('disabled', 'disabled');
|
|
|
+ $('#tenderGLJQuantity').prop('disabled', 'disabled');
|
|
|
+ $('#tenderRationQuantity').prop('disabled', 'disabled');
|
|
|
+ $('#tenderPrice').prop('disabled', 'disabled');
|
|
|
+ $('#cleanTender').prop('disabled', 'disabled');
|
|
|
+}
|
|
|
+//项目只读,表格只读
|
|
|
+function disableSpread(spread){
|
|
|
+ spread.unbind(GC.Spread.Sheets.Events.ButtonClicked);
|
|
|
+ let sheetCount = spread.getSheetCount();
|
|
|
+ console.log(sheetCount);
|
|
|
+ for(let i = 0; i < sheetCount; i++){
|
|
|
+ let sheet = spread.getSheet(i);
|
|
|
+ sheet.unbind(GC.Spread.Sheets.Events.ButtonClicked);
|
|
|
+ sheet.unbind(GC.Spread.Sheets.Events.EditStarting);
|
|
|
+ sheet.unbind(GC.Spread.Sheets.Events.EditEnded);
|
|
|
+ sheet.unbind(GC.Spread.Sheets.Events.RangeChanged);
|
|
|
+ sheet.unbind(GC.Spread.Sheets.Events.ClipboardChanging);
|
|
|
+ sheet.unbind(GC.Spread.Sheets.Events.ClipboardChanged);
|
|
|
+ sheet.unbind(GC.Spread.Sheets.Events.CellDoubleClick);
|
|
|
+ sheet.unbind(GC.Spread.Sheets.Events.CellClick);
|
|
|
+ sheet.unbind(GC.Spread.Sheets.Events.ValueChanged);
|
|
|
+ console.log(sheet.name());
|
|
|
+ sheet.suspendPaint();
|
|
|
+ sheet.suspendEvent();
|
|
|
+ sheet.options.isProtected = true;
|
|
|
+ let rowCount = sheet.getRowCount();
|
|
|
+ let colCount = sheet.getColumnCount();
|
|
|
+ for(let row = 0; row < rowCount; row++){
|
|
|
+ for(let col = 0; col < colCount; col++){
|
|
|
+ sheet.getCell(row, col).locked(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sheet.resumePaint();
|
|
|
+ sheet.resumeEvent();
|
|
|
+ }
|
|
|
+}
|