section_tree.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. /**
  2. * Created by Zhong on 2017/12/18.
  3. */
  4. let pageOprObj = {
  5. rationLibName : null,
  6. rationLibId : null,
  7. gljLibId: gljLibId,
  8. rationTreeData: null,
  9. mixedTreeData: null,
  10. mixedGLJData: null,
  11. initPage : function() {
  12. sectionTreeObj.getSectionTree(this.rationTreeData);
  13. //job
  14. jobContentOprObj.radiosChange(jobContentOprObj.radios, jobContentOprObj.tableAll, jobContentOprObj.tablePartial);
  15. $('#addConBtn').click(jobContentOprObj.bindAddConBtn());
  16. $('#updateConBtn').click(jobContentOprObj.bindUpdateConBtn());
  17. jobContentOprObj.bindAllEvents($('#txtareaAll'));
  18. //fz
  19. annotationOprObj.radiosChange(annotationOprObj.radios, annotationOprObj.fzTableAll, annotationOprObj.fzTablePartial);
  20. $('#fzAddConBtn').click(annotationOprObj.bindAddConBtn());
  21. $('#fzUpdateConBtn').click(annotationOprObj.bindUpdateConBtn());
  22. annotationOprObj.bindAllEvents($('#fzTxtareaAll'));
  23. gljSelOprObj.getGljClassTree(this.mixedTreeData);
  24. gljSelOprObj.getSelGljItems(this.mixedGLJData);
  25. },
  26. getRationLibInfo: function (rationLibId, callback) {
  27. CommonAjax.post('api/getRationLib', {rationRepId: rationLibId}, callback);
  28. },
  29. };
  30. let sectionTreeObj = {
  31. cache: null,//ref to tree.items
  32. tree: null,
  33. controller: null,
  34. workBook: null,
  35. sheet: null,
  36. updateType: {new: 'new', update: 'update'},
  37. insertBtn: $('#tree_Insert'),
  38. removeBtn: $('#tree_remove'),
  39. upLevelBtn: $('#tree_upLevel'),
  40. downLevelBtn: $('#tree_downLevel'),
  41. downMoveBtn: $('#tree_downMove'),
  42. upMoveBtn: $('#tree_upMove'),
  43. type: {std: 'std', complementary: 'complementary'},
  44. setting: {
  45. sheet: {
  46. cols:[
  47. {
  48. head: {
  49. titleNames: ['名称'],
  50. spanCols: [1],
  51. spanRows: [2],
  52. vAlign: [1, 1],
  53. hAlign: [1, 1],
  54. font: 'Arial'
  55. },
  56. data: {
  57. field: 'name',
  58. vAlign: 1,
  59. hAlign: 0,
  60. font: 'Arial'
  61. },
  62. width: 400
  63. }
  64. ],
  65. headRows: 1,
  66. headRowHeight: [47],
  67. emptyRows: 0,
  68. treeCol: 0
  69. },
  70. tree: {
  71. id: 'ID',
  72. pid: 'ParentID',
  73. nid: 'NextSiblingID',
  74. rootId: -1
  75. },
  76. options: {
  77. allowContextMenu: false,
  78. tabStripVisible: false,
  79. allowCopyPasteExcelStyle : false,
  80. allowExtendPasteRange: false,
  81. allowUserDragDrop : false,
  82. allowUserDragFill: false,
  83. scrollbarMaxAlign : true
  84. }
  85. },
  86. isDef: function (v) {
  87. return v !== undefined && v !== null;
  88. },
  89. isFunc: function (v) {
  90. return this.isDef(v) && typeof v === 'function';
  91. },
  92. //sheet things
  93. setOptions: function (workbook, opts) {
  94. for(let opt in opts){
  95. workbook.options[opt] = opts[opt];
  96. }
  97. },
  98. renderFunc: function (sheet, func) {
  99. sheet.suspendPaint();
  100. sheet.suspendEvent();
  101. if(this.isFunc(func)){
  102. func();
  103. }
  104. sheet.resumePaint();
  105. sheet.resumeEvent();
  106. },
  107. buildSheet: function () {
  108. if(!this.isDef(this.workBook)){
  109. this.workBook = new GC.Spread.Sheets.Workbook($('#sectionSpread')[0], {sheetCount: 1});
  110. sheetCommonObj.spreadDefaultStyle(this.workBook);
  111. sheetCommonObj.bindEscKey(this.workBook, [{sheet: this.workBook.getSheet(0), editStarting: this.onEditStarting, editEnded: this.onEditEnded}]);
  112. this.sheet = this.workBook.getSheet(0);
  113. this.bindEvents(this.sheet);
  114. this.setOptions(this.workBook, this.setting.options);
  115. this.sheet.options.clipBoardOptions = GC.Spread.Sheets.ClipboardPasteOptions.values;
  116. }
  117. },
  118. bindEvents: function (sheet) {
  119. let me = sectionTreeObj;
  120. const Events = GC.Spread.Sheets.Events;
  121. sheet.bind(Events.SelectionChanging, me.onSelectionChanging);
  122. sheet.bind(Events.EditEnded, me.onEditEnded);
  123. sheet.bind(Events.EditStarting, me.onEditStarting);
  124. sheet.bind(Events.ClipboardPasting, me.onClipboardPasting);
  125. sheet.bind(Events.ClipboardPasted, me.onClipboardPasted);
  126. },
  127. onSelectionChanging: function (sender, info) {
  128. let me = sectionTreeObj;
  129. if(info.oldSelections.length === 0 && info.newSelections.length > 0 || info.oldSelections[0].row !== info.newSelections[0].row){
  130. let row = info.newSelections[0].row;
  131. let section = me.cache[row];
  132. me.initSelection(section);
  133. }
  134. else {
  135. me.refreshBtn(null);
  136. }
  137. },
  138. onEditStarting: function (sender, args) {
  139. },
  140. onEditEnded: function (sender, args) {
  141. let me = sectionTreeObj;
  142. let postData = [];
  143. let v = me.isDef(args.editingText) ? args.editingText.toString().trim() : '';
  144. let node = me.cache[args.row];
  145. if(me.isDef(node) && node.data.name !== v){
  146. let updateObj = me.getUpdateObj(me.updateType.update, {ID: node.getID(), name: v});
  147. postData.push(updateObj);
  148. //ajax
  149. //update
  150. me.sectionTreeAjax(postData, function (rstData) {
  151. node.data.name = v;
  152. }, function () {
  153. args.sheet.setValue(args.row, args.col, node.data.name ? node.data.name : '');
  154. });
  155. }
  156. },
  157. onClipboardPasting: function (sender, info) {
  158. },
  159. onClipboardPasted: function (sender, info) {
  160. let me = sectionTreeObj;
  161. let items = sheetCommonObj.analyzePasteData({header: [{dataCode: 'name'}]}, info);
  162. let postData = [];
  163. let frontData = [];
  164. for(let i = 0, len = items.length; i < len; i++){
  165. let row = info.cellRange.row + i;
  166. let node = me.cache[row];
  167. if(me.isDef(node) && me.isDef(items[i].name) && node.data.name !== items[i].name){
  168. let updateObj = me.getUpdateObj(me.updateType.update, {ID: node.getID(), name: items[i].name});
  169. postData.push(updateObj);
  170. frontData.push({row: row, name: items[i].name});
  171. node.data.name = items[i].name;
  172. }
  173. }
  174. if(postData.length > 0){
  175. //ajax
  176. me.sectionTreeAjax(postData, function (rstData) {
  177. for(let i = 0, len = frontData.length; i < len; i++){
  178. let node = me.cache[frontData[i]['row']];
  179. if(me.isDef(node)){
  180. node.data.name = frontData[i]['name'];
  181. }
  182. }
  183. }, function () {
  184. for(let i = 0, len = frontData.length; i < len; i++){
  185. let node = me.cache[frontData[i]['row']];
  186. me.sheet.setValue(frontData[i]['row'], 0, me.isDef(node) ? node.data.name : '');
  187. }
  188. });
  189. }
  190. },
  191. loadRateWidth: function () {
  192. if (this.workBook) {
  193. sheetCommonObj.setColumnWidthByRate($('#sectionSpread').width() - 65, this.workBook, [{rateWidth: 1}]);//65: 列头宽度和垂直滚动条宽度和
  194. }
  195. },
  196. getSectionTree: function (treeData) {
  197. //init
  198. this.buildSheet();
  199. this.initTree(treeData);
  200. this.cache = this.tree.items;
  201. this.bindBtn();
  202. this.initController(this.tree, this.sheet, this.setting.sheet);
  203. this.controller.showTreeData();
  204. this.setColor(this.cache);
  205. this.sheet.setFormatter(-1, 0, '@');
  206. this.initSelection(this.tree.selected);
  207. this.loadRateWidth();
  208. },
  209. setColor: function (nodes) {
  210. let me = this;
  211. me.renderFunc(me.sheet, function () {
  212. for(let i = 0, len = nodes.length; i < len; i++){
  213. if(nodes[i].data.type === me.type.complementary){
  214. me.sheet.getCell(i, 0).foreColor('gray');
  215. }
  216. }
  217. });
  218. },
  219. initTree: function (datas) {
  220. this.tree = idTree.createNew(this.setting.tree);
  221. this.tree.loadDatas(datas);
  222. this.tree.selected = this.tree.items.length > 0 ? this.tree.items[0] : null;
  223. },
  224. initController: function (tree, sheet, setting) {
  225. this.controller = TREE_SHEET_CONTROLLER.createNew(tree, sheet, setting);
  226. },
  227. refreshBtn: function (selected) {
  228. let me = this;
  229. me.insertBtn.removeClass('disabled');
  230. me.removeBtn.removeClass('disabled');
  231. me.upLevelBtn.removeClass('disabled');
  232. me.downLevelBtn.removeClass('disabled');
  233. me.downMoveBtn.removeClass('disabled');
  234. me.upMoveBtn.removeClass('disabled');
  235. if(!me.isDef(selected)){
  236. me.removeBtn.addClass('disabled');
  237. me.upLevelBtn.addClass('disabled');
  238. me.downLevelBtn.addClass('disabled');
  239. me.downMoveBtn.addClass('disabled');
  240. me.upMoveBtn.addClass('disabled');
  241. }
  242. else {
  243. if(!me.isDef(selected.preSibling)){
  244. me.downLevelBtn.addClass('disabled');
  245. me.upMoveBtn.addClass('disabled');
  246. }
  247. if(!me.isDef(selected.nextSibling)){
  248. me.downMoveBtn.addClass('disabled');
  249. }
  250. if(!me.isDef(selected.parent)){
  251. me.upLevelBtn.addClass('disabled');
  252. }
  253. }
  254. },
  255. bindBtn: function () {
  256. let me = this;
  257. me.insertBtn.click(function () {
  258. me.insert();
  259. });
  260. $('#delConfirm').click(function () {
  261. if(me.canRemoveSection){
  262. me.remove(me.tree.selected);
  263. }
  264. else {
  265. $('#delAlert').modal('hide');
  266. }
  267. });
  268. me.removeBtn.click(function () {
  269. //不可删除有子节点或有定额数据的节点
  270. let section = me.cache[me.workBook.getActiveSheet().getActiveRowIndex()];
  271. if(!section){
  272. return;
  273. }
  274. let sectionName = me.isDef(section.data.name) ? section.data.name : '';
  275. let sectionRations = rationOprObj.currentRations[`_SEC_ID_${section.data.ID}`];
  276. if(section.children.length > 0 || (sectionRations && sectionRations.length > 0)){
  277. me.canRemoveSection = false;
  278. $('#delAlert').find('.modal-body h5').text('当前节点下有数据,不可删除。');
  279. }
  280. else {
  281. me.canRemoveSection = true;
  282. $('#delAlert').find('.modal-body h5').text(`确认要删除章节 “${sectionName}”吗?`);
  283. }
  284. $('#delAlert').modal('show');
  285. });
  286. me.upLevelBtn.click(function () {
  287. me.upLevel(me.tree.selected);
  288. });
  289. me.downLevelBtn.click(function () {
  290. me.downLevel(me.tree.selected);
  291. });
  292. me.downMoveBtn.click(function () {
  293. me.downMove(me.tree.selected);
  294. });
  295. me.upMoveBtn.click(function () {
  296. me.upMove(me.tree.selected);
  297. });
  298. },
  299. insert: function () {
  300. let me = sectionTreeObj;
  301. me.insertBtn.addClass('disabled');
  302. let postData = [],
  303. newID = uuid.v1();
  304. let selected = me.tree.selected;
  305. let insertObj = me.getUpdateObj(me.updateType.new, {ID: newID, NextSiblingID: -1, ParentID: -1, name: ''});
  306. if(me.isDef(selected)) {
  307. let updateObj = me.getUpdateObj(me.updateType.update, {ID: selected.getID(), NextSiblingID: newID});
  308. postData.push(updateObj);
  309. insertObj.updateData.ParentID = selected.getParentID();
  310. if(me.isDef(selected.nextSibling)){
  311. insertObj.updateData.NextSiblingID = selected.getNextSiblingID();
  312. }
  313. }
  314. postData.push(insertObj);
  315. if(postData.length > 0){
  316. //ajax
  317. me.sectionTreeAjax(postData, function (rstData) {
  318. me.controller.insertByID(newID);
  319. me.refreshBtn(me.tree.selected);
  320. //fresh tools
  321. me.initTools(me.tree.selected);
  322. me.workBook.focus();
  323. me.initSelection(me.tree.selected);
  324. });
  325. }
  326. },
  327. remove: function (selected) {
  328. let me = this;
  329. me.removeBtn.addClass('disabled');
  330. let postData = [],
  331. IDs = [],
  332. deleteObj = {
  333. deleted: true,
  334. deleteDateTime: new Date(),
  335. deleteBy: userID
  336. };
  337. if(!selected){
  338. return;
  339. }
  340. getDelIds(selected);
  341. function getDelIds(node){
  342. if(me.isDef(node)){
  343. IDs.push(node.getID());
  344. if(node.children.length > 0){
  345. for(let i = 0, len = node.children.length; i < len; i++){
  346. getDelIds(node.children[i]);
  347. }
  348. }
  349. }
  350. }
  351. if(me.isDef(selected.preSibling)){
  352. let updateObj = me.getUpdateObj(me.updateType.update, {ID: selected.preSibling.getID(), NextSiblingID: selected.getNextSiblingID()});
  353. postData.push(updateObj);
  354. }
  355. if(IDs.length > 0){
  356. for(let i = 0, len = IDs.length; i < len; i++){
  357. let delObj = me.getUpdateObj(me.updateType.update, {ID: IDs[i], deleteInfo: deleteObj});
  358. postData.push(delObj);
  359. }
  360. }
  361. if(postData.length > 0){
  362. //ajax
  363. me.sectionTreeAjax(postData, function (rstData) {
  364. $('#delAlert').modal('hide');
  365. me.removeRationsCodes(rationOprObj.currentRations["_SEC_ID_" + selected.data.ID]);
  366. me.controller.delete();
  367. me.refreshBtn(me.tree.selected);
  368. me.initTools(me.tree.selected);
  369. me.initSelection(me.tree.selected);
  370. me.workBook.focus();
  371. });
  372. }
  373. },
  374. removeRationsCodes: function (rations) {
  375. for(let ration of rations){
  376. rationOprObj.rationsCodes.splice(rationOprObj.rationsCodes.indexOf(ration.code), 1);
  377. }
  378. },
  379. upLevel: function (selected) {
  380. let me = this;
  381. me.upLevelBtn.addClass('disabled');
  382. let postData = [],
  383. parent = selected.parent;
  384. if(!me.isDef(parent)){
  385. return;
  386. }
  387. //更新父节点
  388. postData.push(me.getUpdateObj(me.updateType.update, {ID: parent.getID(), NextSiblingID: selected.getID()}));
  389. //更新前节点
  390. if(me.isDef(selected.preSibling)){
  391. postData.push(me.getUpdateObj(me.updateType.update, {ID: selected.preSibling.getID(), NextSiblingID: -1}));
  392. }
  393. //更新选中节点的后兄弟节点
  394. let nextIDs = [];
  395. getNext(selected);
  396. function getNext(node){
  397. if(me.isDef(node.nextSibling)){
  398. nextIDs.push(node.getNextSiblingID());
  399. getNext(node.nextSibling);
  400. }
  401. }
  402. for(let nextID of nextIDs){
  403. postData.push(me.getUpdateObj(me.updateType.update, {ID: nextID, ParentID: selected.getID()}));
  404. }
  405. //更新选中节点
  406. postData.push(me.getUpdateObj(me.updateType.update,
  407. {ID: selected.getID(), NextSiblingID: parent.getNextSiblingID(), ParentID: parent.getParentID()}));
  408. if(postData.length > 0){
  409. //ajax
  410. me.sectionTreeAjax(postData, function (rstData) {
  411. me.controller.upLevel();
  412. me.refreshBtn(me.tree.selected);
  413. me.workBook.focus();
  414. });
  415. }
  416. },
  417. downLevel: function (selected) {
  418. let me = this;
  419. me.downLevelBtn.addClass('disabled');
  420. let postData = [],
  421. preSibling = selected.preSibling;
  422. if(!me.isDef(preSibling)){
  423. return;
  424. }
  425. //更新前节点
  426. postData.push(me.getUpdateObj(me.updateType.update, {ID: preSibling.getID(), NextSiblingID: selected.getNextSiblingID()}));
  427. //更新前节点最末子节点
  428. if(preSibling.children.length > 0){
  429. postData.push(me.getUpdateObj(me.updateType.update,
  430. {ID: preSibling.children[preSibling.children.length - 1].getID(), NextSiblingID: selected.getID()}));
  431. }
  432. //更新选中节点
  433. postData.push(me.getUpdateObj(me.updateType.update, {ID: selected.getID(), NextSiblingID: -1, ParentID: preSibling.getID()}));
  434. if(postData.length > 0){
  435. //ajax
  436. me.sectionTreeAjax(postData, function (rstData) {
  437. me.controller.downLevel();
  438. me.refreshBtn(me.tree.selected);
  439. me.workBook.focus();
  440. });
  441. }
  442. },
  443. upMove: function (selected) {
  444. let me = this;
  445. me.upMoveBtn.addClass('disabled');
  446. let postData = [];
  447. if(!me.isDef(selected)){
  448. return;
  449. }
  450. if(!me.isDef(selected.preSibling)){
  451. return;
  452. }
  453. let updateObj = me.getUpdateObj(me.updateType.update, {ID: selected.getID(), NextSiblingID: selected.preSibling.getID()});
  454. postData.push(updateObj);
  455. let updatePre = me.getUpdateObj(me.updateType.update, {ID: selected.preSibling.getID(), NextSiblingID: selected.getNextSiblingID()});
  456. postData.push(updatePre);
  457. if(me.isDef(selected.preSibling.preSibling)){
  458. let updatePrepre = me.getUpdateObj(me.updateType.update, {ID: selected.preSibling.preSibling.getID(), NextSiblingID: selected.getID()});
  459. postData.push(updatePrepre);
  460. }
  461. if(postData.length > 0){
  462. //ajax
  463. me.sectionTreeAjax(postData, function (rstData) {
  464. me.controller.upMove();
  465. me.refreshBtn(me.tree.selected);
  466. me.workBook.focus();
  467. });
  468. }
  469. },
  470. downMove: function (selected) {
  471. let me = this;
  472. me.downMoveBtn.addClass('disabled');
  473. let postData = [];
  474. if(!me.isDef(selected)){
  475. return;
  476. }
  477. if(!me.isDef(selected.nextSibling)){
  478. return;
  479. }
  480. if(me.isDef(selected.preSibling)){
  481. let updatePre = me.getUpdateObj(me.updateType.update, {ID: selected.preSibling.getID(), NextSiblingID: selected.getNextSiblingID()});
  482. postData.push(updatePre);
  483. }
  484. let updateObj = me.getUpdateObj(me.updateType.update, {ID: selected.getID(), NextSiblingID: selected.nextSibling.getNextSiblingID()});
  485. postData.push(updateObj);
  486. let updateNext = me.getUpdateObj(me.updateType.update, {ID: selected.getNextSiblingID(), NextSiblingID: selected.getID()});
  487. postData.push(updateNext);
  488. if(postData.length > 0){
  489. //ajax
  490. me.sectionTreeAjax(postData, function (rstData) {
  491. me.controller.downMove();
  492. me.refreshBtn(me.tree.selected);
  493. me.workBook.focus();
  494. });
  495. }
  496. },
  497. getUpdateObj: function (updateType, updateData) {
  498. let updateObj = Object.create(null);
  499. updateObj.updateType = '';
  500. updateObj.updateData = Object.create(null);
  501. updateObj.updateData.rationRepId = pageOprObj.rationLibId;
  502. if(this.isDef(updateType)){
  503. updateObj.updateType = updateType;
  504. }
  505. if(this.isDef(updateData)){
  506. for(let attr in updateData){
  507. updateObj.updateData[attr] = updateData[attr];
  508. }
  509. }
  510. return updateObj;
  511. },
  512. sectionTreeAjax: function (postData, scFunc, errFunc) {
  513. CommonAjax.post('api/updateRationSection', {updateData: postData}, scFunc, errFunc);
  514. },
  515. initTools: function (node) {
  516. if(this.isDef(node)){
  517. explanatoryOprObj.setAttribute(explanatoryOprObj.currentTreeNode ? explanatoryOprObj.currentTreeNode : node, node, node.data.explanation, node.data.ruleText);
  518. explanatoryOprObj.clickUpdate($('#explanationShow'), $('#ruleTextShow'));
  519. explanatoryOprObj.showText($('#explanationShow'), $('#ruleTextShow'), node.data.explanation, node.data.ruleText);
  520. //job
  521. jobContentOprObj.currentSituation = typeof node.data.jobContentSituation !== 'undefined'? node.data.jobContentSituation : jobContentOprObj.situations.NONE;
  522. jobContentOprObj.setAttribute(jobContentOprObj.currentTreeNode ? jobContentOprObj.currentTreeNode : node, node);
  523. jobContentOprObj.clickUpdate($('#txtareaAll'));
  524. //fz
  525. annotationOprObj.currentSituation = typeof node.data.annotationSituation !== 'undefined'? node.data.annotationSituation : annotationOprObj.situations.NONE;
  526. annotationOprObj.clickUpdate($('#fzTxtareaAll'));
  527. }
  528. },
  529. //模仿默认点击
  530. initSelection: function (node) {
  531. node.tree.selected = node ? node : null;
  532. let me = this;
  533. if(!me.isDef(node)){
  534. sheetCommonObj.cleanSheet(rationOprObj.workBook.getActiveSheet(), rationOprObj.setting, -1);
  535. sheetCommonObj.cleanSheet(rationGLJOprObj.sheet, rationGLJOprObj.setting, -1);
  536. sheetCommonObj.cleanSheet(rationCoeOprObj.sheet, rationCoeOprObj.setting, -1);
  537. sheetCommonObj.cleanSheet(rationAssistOprObj.sheet, rationAssistOprObj.setting, -1);
  538. sheetCommonObj.cleanSheet(rationInstObj.sheet, rationInstObj.setting, -1);
  539. return;
  540. }
  541. me.workBook.getActiveSheet().setActiveCell(node.serialNo(), 0);
  542. me.initTools(node);
  543. me.refreshBtn(node);
  544. if(!me.isDef(node.children) || node.children.length === 0){
  545. rationOprObj.canRations = true;
  546. rationOprObj.workBook.getSheet(0).clearSelection();
  547. rationOprObj.getRationItems(node.data.ID, function () {
  548. rationOprObj.workBook.getActiveSheet().setActiveCell(0, 0);
  549. rationOprObj.rationSelInit(0, true);
  550. });
  551. rationOprObj.setCombo(rationOprObj.workBook.getSheet(0), 'dynamic');
  552. }
  553. else {
  554. rationOprObj.canRations = false;
  555. rationOprObj.currentSectionId = node.data.ID;
  556. rationOprObj.workBook.getSheet(0).setRowCount(30);
  557. rationOprObj.setCombo(rationOprObj.workBook.getSheet(0), null);
  558. // jobContentOprObj.setRadiosDisabled(true, jobContentOprObj.radios);
  559. jobContentOprObj.hideTable($('#tableAll'), $('#tablePartial'));
  560. // annotationOprObj.setRadiosDisabled(true, annotationOprObj.radios);
  561. annotationOprObj.hideTable($('#fzTableAll'), $('#fzTablePartial'));
  562. sheetCommonObj.cleanSheet(rationOprObj.workBook.getSheet(0), rationOprObj.setting, -1);
  563. sheetCommonObj.cleanSheet(rationGLJOprObj.sheet, rationGLJOprObj.setting, -1);
  564. sheetCommonObj.cleanSheet(rationCoeOprObj.sheet, rationCoeOprObj.setting, -1);
  565. sheetCommonObj.cleanSheet(rationAssistOprObj.sheet, rationAssistOprObj.setting, -1);
  566. sheetCommonObj.cleanSheet(rationInstObj.sheet, rationInstObj.setting, -1);
  567. }
  568. //rationGLJOprObj.sheet.getParent().focus(false);
  569. me.workBook.focus(true);
  570. }
  571. };