|  | @@ -17,53 +17,62 @@ $(function () {
 | 
												
													
														
															|  |          let gljLibName = $('#gljLibSels option:selected').text();
 |  |          let gljLibName = $('#gljLibSels option:selected').text();
 | 
												
													
														
															|  |          let gljLibId = $('#gljLibSels option:selected').val();
 |  |          let gljLibId = $('#gljLibSels option:selected').val();
 | 
												
													
														
															|  |          let libName = $('#libNameTxt').val();
 |  |          let libName = $('#libNameTxt').val();
 | 
												
													
														
															|  | -        if(libName.trim().length === 0){
 |  | 
 | 
												
													
														
															|  | 
 |  | +        if (libName.trim().length === 0) {
 | 
												
													
														
															|  |              alert('名称不可为空!');
 |  |              alert('名称不可为空!');
 | 
												
													
														
															|  |              $('#libNameTxt').val('')
 |  |              $('#libNameTxt').val('')
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  | -        else if(allNames.indexOf(libName) !== -1){
 |  | 
 | 
												
													
														
															|  | 
 |  | +        else if (allNames.indexOf(libName) !== -1) {
 | 
												
													
														
															|  |              alert('此定额库已存在!');
 |  |              alert('此定额库已存在!');
 | 
												
													
														
															|  |              $('#libNameTxt').val('')
 |  |              $('#libNameTxt').val('')
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  | -        else if(compilationName.trim().length === 0){
 |  | 
 | 
												
													
														
															|  | 
 |  | +        else if (compilationName.trim().length === 0) {
 | 
												
													
														
															|  |              alert('编办不可为空!');
 |  |              alert('编办不可为空!');
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  | -        else if(gljLibName.trim().length === 0){
 |  | 
 | 
												
													
														
															|  | 
 |  | +        else if (gljLibName.trim().length === 0) {
 | 
												
													
														
															|  |              alert("请选择工料机库!");
 |  |              alert("请选择工料机库!");
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  | -        else{
 |  | 
 | 
												
													
														
															|  | 
 |  | +        else {
 | 
												
													
														
															|  |              let newRationLib = {};
 |  |              let newRationLib = {};
 | 
												
													
														
															|  |              newRationLib.dispName = libName;
 |  |              newRationLib.dispName = libName;
 | 
												
													
														
															|  | 
 |  | +            newRationLib.code = $('#libCodeTxt').val() || '';
 | 
												
													
														
															|  | 
 |  | +            newRationLib.shortName = $('#libShortNameTxt').val() || '';
 | 
												
													
														
															|  |              newRationLib.compilationId = compilationId;
 |  |              newRationLib.compilationId = compilationId;
 | 
												
													
														
															|  |              newRationLib.compilationName = compilationName;
 |  |              newRationLib.compilationName = compilationName;
 | 
												
													
														
															|  |              newRationLib.gljLib = gljLibId;
 |  |              newRationLib.gljLib = gljLibId;
 | 
												
													
														
															|  |              newRationLib.creator = userAccount;
 |  |              newRationLib.creator = userAccount;
 | 
												
													
														
															|  |              newRationLib.appType = "建筑";
 |  |              newRationLib.appType = "建筑";
 | 
												
													
														
															|  |              $('#libNameTxt').val('');
 |  |              $('#libNameTxt').val('');
 | 
												
													
														
															|  | 
 |  | +            $('#libCodeTxt').val('');
 | 
												
													
														
															|  | 
 |  | +            $('#libShortNameTxt').val('');
 | 
												
													
														
															|  |              createRationLib(newRationLib);
 |  |              createRationLib(newRationLib);
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  |      });
 |  |      });
 | 
												
													
														
															|  |      //重命名
 |  |      //重命名
 | 
												
													
														
															|  | -    $("#showArea").on("click", "[data-target = '#edit']", function(){
 |  | 
 | 
												
													
														
															|  | -        let renameId = $(this).parent().parent().attr("id");
 |  | 
 | 
												
													
														
															|  | -        $('#renameText').val($(this).parent().parent().find('td:first-child').text());
 |  | 
 | 
												
													
														
															|  | 
 |  | +    $("#showArea").on("click", "[data-target = '#edit']", function () {
 | 
												
													
														
															|  | 
 |  | +        const $tr = $(this).parent().parent();
 | 
												
													
														
															|  | 
 |  | +        let renameId = $tr.attr("id");
 | 
												
													
														
															|  | 
 |  | +        $('#renameText').val($tr.find('td:first-child').text());
 | 
												
													
														
															|  | 
 |  | +        $('#reCodeText').val($tr.find('td:nth-child(2)').text());
 | 
												
													
														
															|  | 
 |  | +        $('#reShortNameText').val($tr.find('td:nth-child(3)').text());
 | 
												
													
														
															|  |          $("#renameA").attr("renameId", renameId);
 |  |          $("#renameA").attr("renameId", renameId);
 | 
												
													
														
															|  |      });
 |  |      });
 | 
												
													
														
															|  | -    $("#renameA").click(function(){
 |  | 
 | 
												
													
														
															|  | 
 |  | +    $("#renameA").click(function () {
 | 
												
													
														
															|  |          let newName = $("#renameText").val();
 |  |          let newName = $("#renameText").val();
 | 
												
													
														
															|  |          let libId = $(this).attr("renameId");
 |  |          let libId = $(this).attr("renameId");
 | 
												
													
														
															|  |          let jqSel = "#" + libId + " td:first" + " a";
 |  |          let jqSel = "#" + libId + " td:first" + " a";
 | 
												
													
														
															|  |          let orgName = $(jqSel).text();
 |  |          let orgName = $(jqSel).text();
 | 
												
													
														
															|  | -        if(newName.trim().length === 0){
 |  | 
 | 
												
													
														
															|  | 
 |  | +        if (newName.trim().length === 0) {
 | 
												
													
														
															|  |              alert("名称不可为空!");
 |  |              alert("名称不可为空!");
 | 
												
													
														
															|  |              $("#renameText").val('');
 |  |              $("#renameText").val('');
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  | -        else if(allNames.indexOf(newName) !== -1){
 |  | 
 | 
												
													
														
															|  | 
 |  | +        else if (allNames.indexOf(newName) !== -1 && orgName !== newName) {
 | 
												
													
														
															|  |              alert("该定额库已存在!");
 |  |              alert("该定额库已存在!");
 | 
												
													
														
															|  |              $("#renameText").val('');
 |  |              $("#renameText").val('');
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  | -        else{
 |  | 
 | 
												
													
														
															|  | -            renameRationLib({ID: libId, newName: newName, orgName: orgName});
 |  | 
 | 
												
													
														
															|  | 
 |  | +        else {
 | 
												
													
														
															|  | 
 |  | +            const code = $('#reCodeText').val();
 | 
												
													
														
															|  | 
 |  | +            const shortName = $('#reShortNameText').val();
 | 
												
													
														
															|  | 
 |  | +            renameRationLib({ ID: libId, newName: newName, orgName: orgName, code, shortName });
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  |      });
 |  |      });
 | 
												
													
														
															|  |      $('#edit').on('shown.bs.modal', function () {
 |  |      $('#edit').on('shown.bs.modal', function () {
 | 
												
											
												
													
														
															|  | @@ -79,39 +88,41 @@ $(function () {
 | 
												
													
														
															|  |      });
 |  |      });
 | 
												
													
														
															|  |      $('#add').on('hidden.bs.modal', function () {
 |  |      $('#add').on('hidden.bs.modal', function () {
 | 
												
													
														
															|  |          $('#libNameTxt').val('');
 |  |          $('#libNameTxt').val('');
 | 
												
													
														
															|  | 
 |  | +        $('#libCodeTxt').val('');
 | 
												
													
														
															|  | 
 |  | +        $('#libShortNameTxt').val('');
 | 
												
													
														
															|  |      });
 |  |      });
 | 
												
													
														
															|  |      //删除
 |  |      //删除
 | 
												
													
														
															|  | -    $("#showArea").on("click", "[data-target = '#del']", function(){
 |  | 
 | 
												
													
														
															|  | 
 |  | +    $("#showArea").on("click", "[data-target = '#del']", function () {
 | 
												
													
														
															|  |          let deleteId = $(this).parent().parent().attr("id");
 |  |          let deleteId = $(this).parent().parent().attr("id");
 | 
												
													
														
															|  |          $("#deleteA").attr("deleteId", deleteId);
 |  |          $("#deleteA").attr("deleteId", deleteId);
 | 
												
													
														
															|  |          let delLibName = $(`#${deleteId}`).find('td:first').text();
 |  |          let delLibName = $(`#${deleteId}`).find('td:first').text();
 | 
												
													
														
															|  |          $('#del').find('.modal-body h5').text(`准备删除 “${delLibName}”,会导致已引用此库的地方出错,确定要删除吗?`);
 |  |          $('#del').find('.modal-body h5').text(`准备删除 “${delLibName}”,会导致已引用此库的地方出错,确定要删除吗?`);
 | 
												
													
														
															|  |      });
 |  |      });
 | 
												
													
														
															|  | -    $("#deleteA").click(function(){
 |  | 
 | 
												
													
														
															|  | 
 |  | +    $("#deleteA").click(function () {
 | 
												
													
														
															|  |          let deleteId = $(this).attr("deleteId");
 |  |          let deleteId = $(this).attr("deleteId");
 | 
												
													
														
															|  | -        if(preDeleteId && preDeleteId !== deleteId){
 |  | 
 | 
												
													
														
															|  | 
 |  | +        if (preDeleteId && preDeleteId !== deleteId) {
 | 
												
													
														
															|  |              deleteCount = 0;
 |  |              deleteCount = 0;
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  |          preDeleteId = deleteId;
 |  |          preDeleteId = deleteId;
 | 
												
													
														
															|  |          deleteCount++;
 |  |          deleteCount++;
 | 
												
													
														
															|  |          let jqSel = "#" + deleteId + " td:first" + " a";
 |  |          let jqSel = "#" + deleteId + " td:first" + " a";
 | 
												
													
														
															|  |          let libName = $(jqSel).text();
 |  |          let libName = $(jqSel).text();
 | 
												
													
														
															|  | -        if(deleteCount === 3){
 |  | 
 | 
												
													
														
															|  | 
 |  | +        if (deleteCount === 3) {
 | 
												
													
														
															|  |              deleteCount = 0;
 |  |              deleteCount = 0;
 | 
												
													
														
															|  | -            removeRationLib({libId: deleteId, libName: libName});
 |  | 
 | 
												
													
														
															|  | 
 |  | +            removeRationLib({ libId: deleteId, libName: libName });
 | 
												
													
														
															|  |              $('#del').modal('hide');
 |  |              $('#del').modal('hide');
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  |      });
 |  |      });
 | 
												
													
														
															|  |      //全部计算
 |  |      //全部计算
 | 
												
													
														
															|  | -    $("#showArea").on("click", "[data-target = '#reCalcAll']", function(){
 |  | 
 | 
												
													
														
															|  | 
 |  | +    $("#showArea").on("click", "[data-target = '#reCalcAll']", function () {
 | 
												
													
														
															|  |          let recalcId = $(this).parent().parent().attr("id");
 |  |          let recalcId = $(this).parent().parent().attr("id");
 | 
												
													
														
															|  |          $("#reCalcConfirm").attr("recalcId", recalcId);
 |  |          $("#reCalcConfirm").attr("recalcId", recalcId);
 | 
												
													
														
															|  |      });
 |  |      });
 | 
												
													
														
															|  | -    $("#reCalcConfirm").click(function(){
 |  | 
 | 
												
													
														
															|  | 
 |  | +    $("#reCalcConfirm").click(function () {
 | 
												
													
														
															|  |          $('#reCalcConfirm').addClass('disabled');
 |  |          $('#reCalcConfirm').addClass('disabled');
 | 
												
													
														
															|  |          $.bootstrapLoading.start();
 |  |          $.bootstrapLoading.start();
 | 
												
													
														
															|  |          let recalcId = $(this).attr("recalcId");
 |  |          let recalcId = $(this).attr("recalcId");
 | 
												
													
														
															|  | -        CommonAjax.post('/rationRepository/api/reCalcAll', {rationRepId: recalcId}, function (rstData) {
 |  | 
 | 
												
													
														
															|  | 
 |  | +        CommonAjax.post('/rationRepository/api/reCalcAll', { rationRepId: recalcId }, function (rstData) {
 | 
												
													
														
															|  |              $.bootstrapLoading.end();
 |  |              $.bootstrapLoading.end();
 | 
												
													
														
															|  |              $('#reCalcAll').modal('hide');
 |  |              $('#reCalcAll').modal('hide');
 | 
												
													
														
															|  |              $('#reCalcConfirm').removeClass('disabled');
 |  |              $('#reCalcConfirm').removeClass('disabled');
 | 
												
											
												
													
														
															|  | @@ -152,14 +163,14 @@ $(function () {
 | 
												
													
														
															|  |      });
 |  |      });
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |      // 导入原始数据确认
 |  |      // 导入原始数据确认
 | 
												
													
														
															|  | -    $("#source-import,#data-import").click(function() {
 |  | 
 | 
												
													
														
															|  | 
 |  | +    $("#source-import,#data-import").click(function () {
 | 
												
													
														
															|  |          $.bootstrapLoading.start();
 |  |          $.bootstrapLoading.start();
 | 
												
													
														
															|  |          const self = $(this);
 |  |          const self = $(this);
 | 
												
													
														
															|  |          const type = self.is("#source-import") ? 'source_file' : 'import_data';
 |  |          const type = self.is("#source-import") ? 'source_file' : 'import_data';
 | 
												
													
														
															|  |          const dialog = type === 'source_file' ? $("#import") : $("#import2");
 |  |          const dialog = type === 'source_file' ? $("#import") : $("#import2");
 | 
												
													
														
															|  |          try {
 |  |          try {
 | 
												
													
														
															|  |              let formData = new FormData();
 |  |              let formData = new FormData();
 | 
												
													
														
															|  | -            let file = $("input[name='"+ type +"']")[0];
 |  | 
 | 
												
													
														
															|  | 
 |  | +            let file = $("input[name='" + type + "']")[0];
 | 
												
													
														
															|  |              if (file.files.length <= 0) {
 |  |              if (file.files.length <= 0) {
 | 
												
													
														
															|  |                  throw '请选择文件!';
 |  |                  throw '请选择文件!';
 | 
												
													
														
															|  |              }
 |  |              }
 | 
												
											
												
													
														
															|  | @@ -177,11 +188,11 @@ $(function () {
 | 
												
													
														
															|  |                  cache: false,
 |  |                  cache: false,
 | 
												
													
														
															|  |                  contentType: false,
 |  |                  contentType: false,
 | 
												
													
														
															|  |                  processData: false,
 |  |                  processData: false,
 | 
												
													
														
															|  | -                beforeSend: function() {
 |  | 
 | 
												
													
														
															|  | 
 |  | +                beforeSend: function () {
 | 
												
													
														
															|  |                      self.attr('disabled', 'disabled');
 |  |                      self.attr('disabled', 'disabled');
 | 
												
													
														
															|  |                      self.text('上传中...');
 |  |                      self.text('上传中...');
 | 
												
													
														
															|  |                  },
 |  |                  },
 | 
												
													
														
															|  | -                success: function(response){
 |  | 
 | 
												
													
														
															|  | 
 |  | +                success: function (response) {
 | 
												
													
														
															|  |                      self.removeAttr('disabled');
 |  |                      self.removeAttr('disabled');
 | 
												
													
														
															|  |                      self.text('确定导入');
 |  |                      self.text('确定导入');
 | 
												
													
														
															|  |                      if (response.err === 0) {
 |  |                      if (response.err === 0) {
 | 
												
											
												
													
														
															|  | @@ -198,14 +209,14 @@ $(function () {
 | 
												
													
														
															|  |                          alert(message);
 |  |                          alert(message);
 | 
												
													
														
															|  |                      }
 |  |                      }
 | 
												
													
														
															|  |                  },
 |  |                  },
 | 
												
													
														
															|  | -                error: function(){
 |  | 
 | 
												
													
														
															|  | 
 |  | +                error: function () {
 | 
												
													
														
															|  |                      $.bootstrapLoading.end();
 |  |                      $.bootstrapLoading.end();
 | 
												
													
														
															|  |                      alert("与服务器通信发生错误");
 |  |                      alert("与服务器通信发生错误");
 | 
												
													
														
															|  |                      self.removeAttr('disabled');
 |  |                      self.removeAttr('disabled');
 | 
												
													
														
															|  |                      self.text('确定导入');
 |  |                      self.text('确定导入');
 | 
												
													
														
															|  |                  }
 |  |                  }
 | 
												
													
														
															|  |              });
 |  |              });
 | 
												
													
														
															|  | -        } catch(error) {
 |  | 
 | 
												
													
														
															|  | 
 |  | +        } catch (error) {
 | 
												
													
														
															|  |              alert(error);
 |  |              alert(error);
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  |      });
 |  |      });
 | 
												
											
												
													
														
															|  | @@ -251,7 +262,7 @@ $(function () {
 | 
												
													
														
															|  |              return false;
 |  |              return false;
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  |          $.bootstrapLoading.start();
 |  |          $.bootstrapLoading.start();
 | 
												
													
														
															|  | -        CommonAjax.post('/rationRepository/api/initSectionTemplate', {rationLibId: rationRepId, compilationId: selCompilationId}, function () {
 |  | 
 | 
												
													
														
															|  | 
 |  | +        CommonAjax.post('/rationRepository/api/initSectionTemplate', { rationLibId: rationRepId, compilationId: selCompilationId }, function () {
 | 
												
													
														
															|  |              $.bootstrapLoading.end();
 |  |              $.bootstrapLoading.end();
 | 
												
													
														
															|  |              $('#template').modal('hide');
 |  |              $('#template').modal('hide');
 | 
												
													
														
															|  |          }, function () {
 |  |          }, function () {
 | 
												
											
												
													
														
															|  | @@ -261,25 +272,25 @@ $(function () {
 | 
												
													
														
															|  |      });
 |  |      });
 | 
												
													
														
															|  |  });
 |  |  });
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -function getCompilationList(callback){
 |  | 
 | 
												
													
														
															|  | 
 |  | +function getCompilationList(callback) {
 | 
												
													
														
															|  |      $.ajax({
 |  |      $.ajax({
 | 
												
													
														
															|  |          type: 'post',
 |  |          type: 'post',
 | 
												
													
														
															|  |          url: '/rationRepository/api/getCompilationList',
 |  |          url: '/rationRepository/api/getCompilationList',
 | 
												
													
														
															|  |          dataType: 'json',
 |  |          dataType: 'json',
 | 
												
													
														
															|  |          success: function (result) {
 |  |          success: function (result) {
 | 
												
													
														
															|  |              //addoptions
 |  |              //addoptions
 | 
												
													
														
															|  | -            for(let i = 0; i < result.data.compilation.length; i++){
 |  | 
 | 
												
													
														
															|  | -                let $option =  $("<option >"+ result.data.compilation[i].name +"</option>");
 |  | 
 | 
												
													
														
															|  | -                $option.val( result.data.compilation[i]._id);
 |  | 
 | 
												
													
														
															|  | 
 |  | +            for (let i = 0; i < result.data.compilation.length; i++) {
 | 
												
													
														
															|  | 
 |  | +                let $option = $("<option >" + result.data.compilation[i].name + "</option>");
 | 
												
													
														
															|  | 
 |  | +                $option.val(result.data.compilation[i]._id);
 | 
												
													
														
															|  |                  $('#compilationSels').append($option);
 |  |                  $('#compilationSels').append($option);
 | 
												
													
														
															|  |              }
 |  |              }
 | 
												
													
														
															|  |              //初始工料机库选项
 |  |              //初始工料机库选项
 | 
												
													
														
															|  | -            if(result.data.compilation.length > 0 && result.data.gljLibs.length > 0){
 |  | 
 | 
												
													
														
															|  | 
 |  | +            if (result.data.compilation.length > 0 && result.data.gljLibs.length > 0) {
 | 
												
													
														
															|  |                  let compilationId = result.data.compilation[0]._id;
 |  |                  let compilationId = result.data.compilation[0]._id;
 | 
												
													
														
															|  |                  //console.log(compilationId);
 |  |                  //console.log(compilationId);
 | 
												
													
														
															|  |                  let gljLibOps = getGljLibOps(compilationId, result.data.gljLibs);
 |  |                  let gljLibOps = getGljLibOps(compilationId, result.data.gljLibs);
 | 
												
													
														
															|  | -                for(let i = 0; i < gljLibOps.length; i++){
 |  | 
 | 
												
													
														
															|  | -                    let $option =  $("<option >"+ gljLibOps[i].dispName +"</option>");
 |  | 
 | 
												
													
														
															|  | 
 |  | +                for (let i = 0; i < gljLibOps.length; i++) {
 | 
												
													
														
															|  | 
 |  | +                    let $option = $("<option >" + gljLibOps[i].dispName + "</option>");
 | 
												
													
														
															|  |                      $option.val(gljLibOps[i].ID);
 |  |                      $option.val(gljLibOps[i].ID);
 | 
												
													
														
															|  |                      $('#gljLibSels').append($option);
 |  |                      $('#gljLibSels').append($option);
 | 
												
													
														
															|  |                  }
 |  |                  }
 | 
												
											
												
													
														
															|  | @@ -289,8 +300,8 @@ function getCompilationList(callback){
 | 
												
													
														
															|  |                  //刷新工料机库选项
 |  |                  //刷新工料机库选项
 | 
												
													
														
															|  |                  $('#gljLibSels').children().remove();
 |  |                  $('#gljLibSels').children().remove();
 | 
												
													
														
															|  |                  let newGljLibOps = getGljLibOps(this.selectedOptions[0].value, result.data.gljLibs);
 |  |                  let newGljLibOps = getGljLibOps(this.selectedOptions[0].value, result.data.gljLibs);
 | 
												
													
														
															|  | -                for(let i = 0; i < newGljLibOps.length; i++){
 |  | 
 | 
												
													
														
															|  | -                    let $option =  $("<option >"+ newGljLibOps[i].dispName +"</option>");
 |  | 
 | 
												
													
														
															|  | 
 |  | +                for (let i = 0; i < newGljLibOps.length; i++) {
 | 
												
													
														
															|  | 
 |  | +                    let $option = $("<option >" + newGljLibOps[i].dispName + "</option>");
 | 
												
													
														
															|  |                      $option.val(newGljLibOps[i].ID);
 |  |                      $option.val(newGljLibOps[i].ID);
 | 
												
													
														
															|  |                      $('#gljLibSels').append($option);
 |  |                      $('#gljLibSels').append($option);
 | 
												
													
														
															|  |                  }
 |  |                  }
 | 
												
											
												
													
														
															|  | @@ -299,11 +310,11 @@ function getCompilationList(callback){
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  |      });
 |  |      });
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
													
														
															|  | -function getGljLibOps(compilationId, gljLibs){
 |  | 
 | 
												
													
														
															|  | 
 |  | +function getGljLibOps(compilationId, gljLibs) {
 | 
												
													
														
															|  |      let rst = [];
 |  |      let rst = [];
 | 
												
													
														
															|  | -    for(let i = 0; i < gljLibs.length; i++){
 |  | 
 | 
												
													
														
															|  | -        if(gljLibs[i]){
 |  | 
 | 
												
													
														
															|  | -            if(compilationId === gljLibs[i].compilationId){
 |  | 
 | 
												
													
														
															|  | 
 |  | +    for (let i = 0; i < gljLibs.length; i++) {
 | 
												
													
														
															|  | 
 |  | +        if (gljLibs[i]) {
 | 
												
													
														
															|  | 
 |  | +            if (compilationId === gljLibs[i].compilationId) {
 | 
												
													
														
															|  |                  rst.push(gljLibs[i]);
 |  |                  rst.push(gljLibs[i]);
 | 
												
													
														
															|  |              }
 |  |              }
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
											
												
													
														
															|  | @@ -311,27 +322,31 @@ function getGljLibOps(compilationId, gljLibs){
 | 
												
													
														
															|  |      return rst;
 |  |      return rst;
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -function createRationLib(rationObj){
 |  | 
 | 
												
													
														
															|  | 
 |  | +function createRationLib(rationObj) {
 | 
												
													
														
															|  |      $.ajax({
 |  |      $.ajax({
 | 
												
													
														
															|  |          type: 'post',
 |  |          type: 'post',
 | 
												
													
														
															|  |          url: '/rationRepository/api/addRationRepository',
 |  |          url: '/rationRepository/api/addRationRepository',
 | 
												
													
														
															|  | -        data: {rationRepObj: JSON.stringify(rationObj)},
 |  | 
 | 
												
													
														
															|  | 
 |  | +        data: { rationRepObj: JSON.stringify(rationObj) },
 | 
												
													
														
															|  |          dataType: 'json',
 |  |          dataType: 'json',
 | 
												
													
														
															|  |          success: function (result) {
 |  |          success: function (result) {
 | 
												
													
														
															|  |              window.location.href = location.href;
 |  |              window.location.href = location.href;
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  |      })
 |  |      })
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
													
														
															|  | -function renameRationLib(renameObj){
 |  | 
 | 
												
													
														
															|  | 
 |  | +function renameRationLib(renameObj) {
 | 
												
													
														
															|  |      $.ajax({
 |  |      $.ajax({
 | 
												
													
														
															|  |          type: 'post',
 |  |          type: 'post',
 | 
												
													
														
															|  |          url: '/rationRepository/api/editRationLibs',
 |  |          url: '/rationRepository/api/editRationLibs',
 | 
												
													
														
															|  | -        data: {oprtor: userAccount, renameObj: JSON.stringify(renameObj)},
 |  | 
 | 
												
													
														
															|  | 
 |  | +        data: { oprtor: userAccount, renameObj: JSON.stringify(renameObj) },
 | 
												
													
														
															|  |          dataType: 'json',
 |  |          dataType: 'json',
 | 
												
													
														
															|  |          success: function (result) {
 |  |          success: function (result) {
 | 
												
													
														
															|  | -            if(!result.error){
 |  | 
 | 
												
													
														
															|  | 
 |  | +            if (!result.error) {
 | 
												
													
														
															|  |                  let jqSel = "#" + renameObj.ID + " td:first" + " a";
 |  |                  let jqSel = "#" + renameObj.ID + " td:first" + " a";
 | 
												
													
														
															|  |                  $(jqSel).text(renameObj.newName);
 |  |                  $(jqSel).text(renameObj.newName);
 | 
												
													
														
															|  | 
 |  | +                const $code = $(`#${renameObj.ID} td:nth-child(2)`);
 | 
												
													
														
															|  | 
 |  | +                $code.text(renameObj.code);
 | 
												
													
														
															|  | 
 |  | +                const $shortName = $(`#${renameObj.ID} td:nth-child(3)`);
 | 
												
													
														
															|  | 
 |  | +                $shortName.text(renameObj.shortName);
 | 
												
													
														
															|  |                  let index = allNames.indexOf(renameObj.orgName);
 |  |                  let index = allNames.indexOf(renameObj.orgName);
 | 
												
													
														
															|  |                  allNames.splice(index, 1);
 |  |                  allNames.splice(index, 1);
 | 
												
													
														
															|  |                  allNames.splice(index, 0, renameObj.newName);
 |  |                  allNames.splice(index, 0, renameObj.newName);
 | 
												
											
												
													
														
															|  | @@ -341,16 +356,16 @@ function renameRationLib(renameObj){
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  |      })
 |  |      })
 | 
												
													
														
															|  |  }
 |  |  }
 | 
												
													
														
															|  | -function removeRationLib(delObj){
 |  | 
 | 
												
													
														
															|  | 
 |  | +function removeRationLib(delObj) {
 | 
												
													
														
															|  |      $.bootstrapLoading.start();
 |  |      $.bootstrapLoading.start();
 | 
												
													
														
															|  |      $.ajax({
 |  |      $.ajax({
 | 
												
													
														
															|  |          type: 'post',
 |  |          type: 'post',
 | 
												
													
														
															|  |          url: '/rationRepository/api/deleteRationLibs',
 |  |          url: '/rationRepository/api/deleteRationLibs',
 | 
												
													
														
															|  | -        data: {oprtor: userAccount, libId: delObj.libId},
 |  | 
 | 
												
													
														
															|  | 
 |  | +        data: { oprtor: userAccount, libId: delObj.libId },
 | 
												
													
														
															|  |          dataType: 'json',
 |  |          dataType: 'json',
 | 
												
													
														
															|  |          success: function (result) {
 |  |          success: function (result) {
 | 
												
													
														
															|  | -            if(!result.error){
 |  | 
 | 
												
													
														
															|  | -                var jqSel = "#"+ delObj.libId;
 |  | 
 | 
												
													
														
															|  | 
 |  | +            if (!result.error) {
 | 
												
													
														
															|  | 
 |  | +                var jqSel = "#" + delObj.libId;
 | 
												
													
														
															|  |                  $(jqSel).remove();
 |  |                  $(jqSel).remove();
 | 
												
													
														
															|  |                  let index = allNames.indexOf(delObj.libName);
 |  |                  let index = allNames.indexOf(delObj.libName);
 | 
												
													
														
															|  |                  allNames.splice(index, 1);
 |  |                  allNames.splice(index, 1);
 |