|
@@ -27,8 +27,9 @@ var rationLibObj = {
|
|
|
if (!this.sectionRationsSpread) {
|
|
|
this.sectionRationsSpread = SheetDataHelper.createNewSpread($('#stdSectionRations')[0]);
|
|
|
sheetCommonObj.spreadDefaultStyle(this.sectionRationsSpread);
|
|
|
-
|
|
|
- this.sectionRationsSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, this.onRationSpreadCellDoubleClick);
|
|
|
+ if (!projectReadOnly) {
|
|
|
+ this.sectionRationsSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, this.onRationSpreadCellDoubleClick);
|
|
|
+ }
|
|
|
this.refreshSettingForHint();
|
|
|
}
|
|
|
},
|
|
@@ -280,6 +281,9 @@ var rationLibObj = {
|
|
|
"insertStdRation": {
|
|
|
name: "插入定额",
|
|
|
icon: 'fa-sign-in',
|
|
|
+ disabled: function () {
|
|
|
+ return projectReadOnly;
|
|
|
+ },
|
|
|
callback: function (key, opt) {
|
|
|
let select = $('#stdRationLibSelect'), rationSelect = rationSheet.getSelections();
|
|
|
let rationCode = rationSelect.length > 0 ? rationSheet.getText(rationSelect[0].row, 0) : '';
|
|
@@ -292,6 +296,9 @@ var rationLibObj = {
|
|
|
"replaceStdRation": {
|
|
|
name: "替换定额",
|
|
|
icon: 'fa-sign-in',
|
|
|
+ disabled: function () {
|
|
|
+ return projectReadOnly
|
|
|
+ },
|
|
|
callback: function (key, opt) {
|
|
|
let select = $('#stdRationLibSelect'), rationSelect = rationSheet.getSelections();
|
|
|
let rationCode = rationSelect.length > 0 ? rationSheet.getText(rationSelect[0].row, 0) : '';
|
|
@@ -533,14 +540,12 @@ if($('#stdRationChapter').height() === 0 || $('#stdSectionRations').height() ===
|
|
|
}
|
|
|
|
|
|
$('#stdRationTab').bind('click', function () {
|
|
|
- if(!projectReadOnly){
|
|
|
- var select = $('#stdRationLibSelect');
|
|
|
- rationLibObj.checkSpread();
|
|
|
- if (select[0].options.length === 0) {
|
|
|
- rationLibObj.loadStdRationLibs();
|
|
|
- rationLibObj.loadStdRationContextMenu();
|
|
|
- };
|
|
|
- }
|
|
|
+ var select = $('#stdRationLibSelect');
|
|
|
+ rationLibObj.checkSpread();
|
|
|
+ if (select[0].options.length === 0) {
|
|
|
+ rationLibObj.loadStdRationLibs();
|
|
|
+ rationLibObj.loadStdRationContextMenu();
|
|
|
+ };
|
|
|
});
|
|
|
$('#stdRationLibSelect').change(function () {
|
|
|
var select = $(this);
|
|
@@ -694,7 +699,9 @@ function seachRation(){
|
|
|
rationLibObj.resultSpread = resultSpread;
|
|
|
bindContextmenuOpr(resultSpread.getActiveSheet());
|
|
|
SheetDataHelper.loadSheetHeader(rationLibObj.sectionRationsSetting, resultSpread.getActiveSheet());
|
|
|
- resultSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, rationLibObj.onRationSpreadCellDoubleClick);
|
|
|
+ if (!projectReadOnly) {
|
|
|
+ resultSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, rationLibObj.onRationSpreadCellDoubleClick);
|
|
|
+ }
|
|
|
resultSpread.bind(GC.Spread.Sheets.Events.TopRowChanged, rationLibObj.onRationSpreadTopRowChanged);
|
|
|
}else {
|
|
|
rationLibObj.resultSpread.refresh();
|