section_tree.js 23 KB

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