|
@@ -8,6 +8,9 @@ var rationLibObj = {
|
|
|
rationChapterSpread: null,
|
|
|
sectionRationsSpread: null,
|
|
|
rationChapterTreeController: null,
|
|
|
+ refreshSettingForHint: function () {
|
|
|
+ TREE_SHEET_HELPER.initSetting($('#stdSectionRations')[0], rationLibObj.sectionRationsSetting);
|
|
|
+ },
|
|
|
checkSpread: function () {
|
|
|
if (!this.rationChapterSpread) {
|
|
|
this.rationChapterSpread = SheetDataHelper.createNewSpread($('#stdRationChapter')[0]);
|
|
@@ -16,6 +19,7 @@ var rationLibObj = {
|
|
|
this.sectionRationsSpread = SheetDataHelper.createNewSpread($('#stdSectionRations')[0]);
|
|
|
|
|
|
this.sectionRationsSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, this.onRationSpreadCellDoubleClick);
|
|
|
+ this.refreshSettingForHint();
|
|
|
}
|
|
|
},
|
|
|
refreshSpread: function () {
|
|
@@ -63,13 +67,27 @@ var rationLibObj = {
|
|
|
showRationChapterTree([]);
|
|
|
});
|
|
|
},
|
|
|
+ setTagForHint: function (datas) {
|
|
|
+ let sheet = this.sectionRationsSpread.getActiveSheet();
|
|
|
+ sheet.suspendPaint();
|
|
|
+ sheet.suspendEvent();
|
|
|
+ for(let i = 0, len = sheet.getRowCount(); i < len; i++){
|
|
|
+ sheet.setTag(i, 1, '');
|
|
|
+ }
|
|
|
+ for(let i = 0, len = datas.length; i < len; i++){
|
|
|
+ sheet.setTag(i, 1, datas[i].hint ? datas[i].hint : '');
|
|
|
+ }
|
|
|
+ sheet.resumePaint();
|
|
|
+ sheet.resumeEvent();
|
|
|
+ },
|
|
|
loadSectionRations: function (sectionID) {
|
|
|
var showDatas = function (datas, setting) {
|
|
|
SheetDataHelper.loadSheetHeader(setting, rationLibObj.sectionRationsSpread.getActiveSheet());
|
|
|
SheetDataHelper.loadSheetData(setting, rationLibObj.sectionRationsSpread.getActiveSheet(), datas);
|
|
|
+ rationLibObj.setTagForHint(datas);
|
|
|
};
|
|
|
if (sectionID) {
|
|
|
- CommonAjax.postRationLib('/rationRepository/api/getRationItems', {userId: userID, sectionID: sectionID}, function (datas) {
|
|
|
+ CommonAjax.postRationLib('/rationRepository/api/getRationGljItems', {userId: userID, sectionID: sectionID}, function (datas) {
|
|
|
showDatas(datas, rationLibObj.sectionRationsSetting);
|
|
|
}, function () {
|
|
|
showDatas([], rationLibObj.sectionRationsSetting);
|
|
@@ -174,6 +192,7 @@ var rationLibObj = {
|
|
|
}, {
|
|
|
"width":220,
|
|
|
"readOnly": true,
|
|
|
+ "showHint": true,
|
|
|
"head":{
|
|
|
"titleNames":["名称"],
|
|
|
"spanCols":[1],
|
|
@@ -225,6 +244,8 @@ var rationLibObj = {
|
|
|
}]
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
+addEventOnResize(rationLibObj.refreshSettingForHint);
|
|
|
$('#stdRationTab').bind('click', function () {
|
|
|
refreshSubSpread();//subSpread、jobSpread、itemSpread显示问题
|
|
|
var select = $('#stdRationLibSelect');
|