|
@@ -78,12 +78,12 @@ let rationOprObj = {
|
|
|
let me = rationOprObj,
|
|
|
sheetGLJ = rationGLJOprObj.sheet, settingGLJ = rationGLJOprObj.setting,
|
|
|
sheetCoe = rationCoeOprObj.sheet, settingCoe = rationCoeOprObj.setting,
|
|
|
- sheetAss = rationAssistOprObj.sheet, settingAss = rationAssistOprObj.setting,
|
|
|
- sheetInst = rationInstObj.sheet, settingInst = rationInstObj.setting;
|
|
|
+ sheetAss = rationAssistOprObj.sheet, settingAss = rationAssistOprObj.setting;
|
|
|
+ //sheetInst = rationInstObj.sheet, settingInst = rationInstObj.setting;
|
|
|
sheetCommonObj.cleanData(sheetGLJ, settingGLJ, -1);
|
|
|
sheetCommonObj.cleanData(sheetCoe, settingCoe, -1);
|
|
|
sheetCommonObj.cleanData(sheetAss, settingAss, -1);
|
|
|
- sheetCommonObj.cleanData(sheetInst, settingInst, -1);
|
|
|
+ //sheetCommonObj.cleanData(sheetInst, settingInst, -1);
|
|
|
let cacheSection = me.getCache();
|
|
|
if (cacheSection && row < cacheSection.length) {
|
|
|
rationGLJOprObj.getGljItems(cacheSection[row], function () {
|
|
@@ -101,13 +101,13 @@ let rationOprObj = {
|
|
|
}
|
|
|
});
|
|
|
rationAssistOprObj.getAssItems(cacheSection[row]);
|
|
|
- rationInstObj.getInstItems(cacheSection[row], function () {
|
|
|
+ /*rationInstObj.getInstItems(cacheSection[row], function () {
|
|
|
if (focusOnSection){
|
|
|
sectionTreeObj.workBook.focus(true);
|
|
|
} else {
|
|
|
me.workBook.focus(true);
|
|
|
}
|
|
|
- });
|
|
|
+ });*/
|
|
|
}
|
|
|
else {
|
|
|
rationGLJOprObj.currentRationItem = null;
|
|
@@ -149,7 +149,7 @@ let rationOprObj = {
|
|
|
cacheSection[j]["rationGljList"] = rstData.ops[i]["rationGljList"];
|
|
|
cacheSection[j]["rationCoeList"] = rstData.ops[i]["rationCoeList"];
|
|
|
cacheSection[j]["rationAssList"] = rstData.ops[i]["rationAssList"];
|
|
|
- cacheSection[j]["rationInstList"] = rstData.ops[i]["rationInstList"];
|
|
|
+ //cacheSection[j]["rationInstList"] = rstData.ops[i]["rationInstList"];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -164,7 +164,7 @@ let rationOprObj = {
|
|
|
cacheSection[j]['rationGljList'] : [];
|
|
|
updateArr[i]['rationCoeList'] = cacheSection[j]['rationCoeList'] ? cacheSection[j]['rationCoeList'] : [];
|
|
|
updateArr[i]['rationAssList'] = cacheSection[j]['rationAssList'];
|
|
|
- updateArr[i]['rationInstList'] = cacheSection[j]['rationInstList'];
|
|
|
+ //updateArr[i]['rationInstList'] = cacheSection[j]['rationInstList'];
|
|
|
cacheSection[j] = updateArr[i];
|
|
|
}
|
|
|
} else {
|
|
@@ -175,7 +175,7 @@ let rationOprObj = {
|
|
|
cacheSection[j]['rationGljList'] : [];
|
|
|
updateArr[i]['rationCoeList'] = cacheSection[j]['rationCoeList'] ? cacheSection[j]['rationCoeList'] : [];
|
|
|
updateArr[i]['rationAssList'] = cacheSection[j]['rationAssList'];
|
|
|
- updateArr[i]['rationInstList'] = cacheSection[j]['rationInstList'];
|
|
|
+ //updateArr[i]['rationInstList'] = cacheSection[j]['rationInstList'];
|
|
|
cacheSection[j] = updateArr[i];
|
|
|
}
|
|
|
}
|
|
@@ -664,8 +664,8 @@ let rationOprObj = {
|
|
|
let me = rationOprObj,
|
|
|
sheetGLJ = rationGLJOprObj.sheet, settingGLJ = rationGLJOprObj.setting,
|
|
|
sheetCoe = rationCoeOprObj.sheet, settingCoe = rationCoeOprObj.setting,
|
|
|
- sheetAss = rationAssistOprObj.sheet, settingAss = rationAssistOprObj.setting,
|
|
|
- sheetInst = rationInstObj.sheet, settingInst = rationInstObj.setting;
|
|
|
+ sheetAss = rationAssistOprObj.sheet, settingAss = rationAssistOprObj.setting;
|
|
|
+ //sheetInst = rationInstObj.sheet, settingInst = rationInstObj.setting;
|
|
|
if (me.workBook) {
|
|
|
if (me.currentRations && me.currentRations["_SEC_ID_" + sectionID] && me.currentRations["_SEC_ID_" + sectionID].length > 0) {
|
|
|
let cacheSection = me.currentRations["_SEC_ID_" + sectionID];
|
|
@@ -680,18 +680,18 @@ let rationOprObj = {
|
|
|
sheetCommonObj.cleanData(sheetGLJ, settingGLJ, -1);
|
|
|
sheetCommonObj.cleanData(sheetCoe, settingCoe, -1);
|
|
|
sheetCommonObj.cleanData(sheetAss, settingAss, -1);
|
|
|
- sheetCommonObj.cleanData(sheetInst, settingInst, -1);
|
|
|
+ //sheetCommonObj.cleanData(sheetInst, settingInst, -1);
|
|
|
rationGLJOprObj.getGljItems(cacheSection[row]);
|
|
|
rationCoeOprObj.getCoeItems(cacheSection[row]);
|
|
|
rationAssistOprObj.getAssItems(cacheSection[row]);
|
|
|
- rationInstObj.getInstItems(cacheSection[row]);
|
|
|
+ //rationInstObj.getInstItems(cacheSection[row]);
|
|
|
}
|
|
|
else {
|
|
|
rationGLJOprObj.currentRationItem = null;
|
|
|
sheetCommonObj.cleanData(sheetGLJ, settingGLJ, -1);
|
|
|
sheetCommonObj.cleanData(sheetCoe, settingCoe, -1);
|
|
|
sheetCommonObj.cleanData(sheetAss, settingAss, -1);
|
|
|
- sheetCommonObj.cleanData(sheetInst, settingInst, -1);
|
|
|
+ //sheetCommonObj.cleanData(sheetInst, settingInst, -1);
|
|
|
sheetCommonObj.setDynamicCombo(sheetAss, 0, 5, sheetAss.getRowCount(), rationAssistOprObj.setting.comboItems, false, false);
|
|
|
}
|
|
|
}
|
|
@@ -705,36 +705,39 @@ let rationOprObj = {
|
|
|
sheetCommonObj.cleanSheet(sheetGLJ, settingGLJ, -1);
|
|
|
sheetCommonObj.cleanSheet(sheetCoe, settingCoe, -1);
|
|
|
sheetCommonObj.cleanSheet(sheetAss, settingAss, -1);
|
|
|
- sheetCommonObj.cleanSheet(sheetInst, settingInst, -1);
|
|
|
+ //sheetCommonObj.cleanSheet(sheetInst, settingInst, -1);
|
|
|
}
|
|
|
//--- me.workBook.focus(true);
|
|
|
}
|
|
|
sectionTreeObj.workBook.focus(true);
|
|
|
},
|
|
|
sortByCode: function(arr){
|
|
|
- arr.sort(function (a, b) {
|
|
|
- let rst = 0;
|
|
|
- let splitA = a.code.split('-'),
|
|
|
- splitB = b.code.split('-');
|
|
|
- if(splitA[0] > splitB[0]){
|
|
|
- rst = 1;
|
|
|
- }
|
|
|
- else if(splitA[0] < splitB[0]){
|
|
|
- rst = -1;
|
|
|
- }
|
|
|
- else {
|
|
|
- if(splitA[1] && splitB[1]){
|
|
|
- let floatA = parseFloat(splitA[1]),
|
|
|
- floatB = parseFloat(splitB[1]);
|
|
|
- if(floatA > floatB){
|
|
|
- rst = 1;
|
|
|
- }
|
|
|
- else if(floatA < floatB){
|
|
|
- rst = -1;
|
|
|
- }
|
|
|
+ function recurCompare(a, b, index){
|
|
|
+ if (a[index] && !b[index]) {
|
|
|
+ return 1;
|
|
|
+ } else if (!a[index] && b[index]) {
|
|
|
+ return -1;
|
|
|
+ } else if (a[index] && b[index]) {
|
|
|
+ let aV = a[index],
|
|
|
+ bV = b[index];
|
|
|
+ if (!isNaN(aV) && !isNaN(bV)) {
|
|
|
+ aV = parseFloat(a[index]);
|
|
|
+ bV = parseFloat(b[index]);
|
|
|
+ }
|
|
|
+ if (aV > bV) {
|
|
|
+ return 1;
|
|
|
+ } else if (aV < bV) {
|
|
|
+ return -1;
|
|
|
+ } else {
|
|
|
+ return recurCompare(a, b, index + 1);
|
|
|
}
|
|
|
}
|
|
|
- return rst;
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ arr.sort(function (a, b) {
|
|
|
+ let aArr = a.code.split('-'),
|
|
|
+ bArr = b.code.split('-');
|
|
|
+ return recurCompare(aArr, bArr, 0);
|
|
|
});
|
|
|
},
|
|
|
saveInString(datas){
|