|
|
@@ -2,31 +2,14 @@
|
|
|
* Created by Zhong on 2017/12/18.
|
|
|
*/
|
|
|
let pageOprObj = {
|
|
|
- refreshAllBooks: function () {
|
|
|
- if (sectionTreeObj.workBook) {
|
|
|
- sectionTreeObj.workBook.refresh();
|
|
|
- }
|
|
|
- if (rationOprObj.workBook) {
|
|
|
- rationOprObj.workBook.refresh();
|
|
|
- }
|
|
|
- if (coeOprObj.workBook) {
|
|
|
- coeOprObj.workBook.refresh();
|
|
|
- } else {
|
|
|
- pageObj.initPage();
|
|
|
- }
|
|
|
- if (gljAdjOprObj.workBook) {
|
|
|
- gljAdjOprObj.workBook.refresh();
|
|
|
- }
|
|
|
- if (rationGLJOprObj.sheet.getParent()) {
|
|
|
- rationGLJOprObj.sheet.getParent().refresh();
|
|
|
- }
|
|
|
- },
|
|
|
rationLibName : null,
|
|
|
rationLibId : null,
|
|
|
gljLibId: gljLibId,
|
|
|
+ rationTreeData: null,
|
|
|
+ mixedTreeData: null,
|
|
|
+ mixedGLJData: null,
|
|
|
initPage : function() {
|
|
|
- let me = this;
|
|
|
- sectionTreeObj.getSectionTree();
|
|
|
+ sectionTreeObj.getSectionTree(this.rationTreeData);
|
|
|
//job
|
|
|
jobContentOprObj.radiosChange(jobContentOprObj.radios, jobContentOprObj.tableAll, jobContentOprObj.tablePartial);
|
|
|
$('#addConBtn').click(jobContentOprObj.bindAddConBtn());
|
|
|
@@ -37,9 +20,8 @@ let pageOprObj = {
|
|
|
$('#fzAddConBtn').click(annotationOprObj.bindAddConBtn());
|
|
|
$('#fzUpdateConBtn').click(annotationOprObj.bindUpdateConBtn());
|
|
|
annotationOprObj.bindAllEvents($('#fzTxtareaAll'));
|
|
|
- gljSelOprObj.getGljClassTree(gljLibId, function () {
|
|
|
- gljSelOprObj.getSelGljItems(gljLibId);
|
|
|
- });
|
|
|
+ gljSelOprObj.getGljClassTree(this.mixedTreeData);
|
|
|
+ gljSelOprObj.getSelGljItems(this.mixedGLJData);
|
|
|
},
|
|
|
getRationLibInfo: function (rationLibId, callback) {
|
|
|
CommonAjax.post('api/getRationLib', {rationRepId: rationLibId}, callback);
|
|
|
@@ -223,32 +205,21 @@ let sectionTreeObj = {
|
|
|
sheetCommonObj.setColumnWidthByRate($('#sectionSpread').width() - 65, this.workBook, [{rateWidth: 1}]);//65: 列头宽度和垂直滚动条宽度和
|
|
|
}
|
|
|
},
|
|
|
- getSectionTree: function () {
|
|
|
- let me = sectionTreeObj;
|
|
|
- let url = 'api/getRationTree';
|
|
|
- //type: 0-补充库 1-标准库
|
|
|
- let postData = {type: 0};
|
|
|
- let sucFunc = function (rstData) {
|
|
|
- if(rstData.length > 0){
|
|
|
- storageUtil.setSessionCache("RationGrp","repositoryID",rstData[0].rationRepId);
|
|
|
- }
|
|
|
- //init
|
|
|
- me.buildSheet();
|
|
|
- me.initTree(rstData);
|
|
|
- me.cache = me.tree.items;
|
|
|
- me.bindBtn();
|
|
|
- me.initController(me.tree, me.sheet, me.setting.sheet);
|
|
|
- me.controller.showTreeData();
|
|
|
- me.setColor(me.cache);
|
|
|
- me.sheet.setFormatter(-1, 0, '@');
|
|
|
- me.initSelection(me.tree.selected);
|
|
|
- me.loadRateWidth();
|
|
|
- //explanatoryOprObj.bindEvents($('#explanationShow'), $('#ruleTextShow'));
|
|
|
- };
|
|
|
- let errFunc = function () {
|
|
|
-
|
|
|
- };
|
|
|
- CommonAjax.post(url, postData, sucFunc, errFunc);
|
|
|
+ getSectionTree: function (treeData) {
|
|
|
+ /*if(rstData.length > 0){
|
|
|
+ storageUtil.setSessionCache("RationGrp","repositoryID",rstData[0].rationRepId);
|
|
|
+ }*/
|
|
|
+ //init
|
|
|
+ this.buildSheet();
|
|
|
+ this.initTree(treeData);
|
|
|
+ this.cache = this.tree.items;
|
|
|
+ this.bindBtn();
|
|
|
+ this.initController(this.tree, this.sheet, this.setting.sheet);
|
|
|
+ this.controller.showTreeData();
|
|
|
+ this.setColor(this.cache);
|
|
|
+ this.sheet.setFormatter(-1, 0, '@');
|
|
|
+ this.initSelection(this.tree.selected);
|
|
|
+ this.loadRateWidth();
|
|
|
},
|
|
|
|
|
|
setColor: function (nodes) {
|
|
|
@@ -578,7 +549,6 @@ let sectionTreeObj = {
|
|
|
},
|
|
|
//模仿默认点击
|
|
|
initSelection: function (node) {
|
|
|
- node.tree.selected = node ? node : null;
|
|
|
let me = this;
|
|
|
if(!me.isDef(node)){
|
|
|
sheetCommonObj.cleanSheet(rationOprObj.workBook.getActiveSheet(), rationOprObj.setting, -1);
|
|
|
@@ -588,6 +558,7 @@ let sectionTreeObj = {
|
|
|
sheetCommonObj.cleanSheet(rationInstObj.sheet, rationInstObj.setting, -1);
|
|
|
return;
|
|
|
}
|
|
|
+ node.tree.selected = node ? node : null
|
|
|
me.workBook.getActiveSheet().setActiveCell(node.serialNo(), 0);
|
|
|
me.initTools(node);
|
|
|
me.refreshBtn(node);
|