Selaa lähdekoodia

结构分部、单体模板功能新增、重命名无效的问题

lishihao 3 vuotta sitten
vanhempi
commit
d15c0d1f49

+ 1 - 1
modules/monomer_template_lib/facade/monomer_template_facade.js

@@ -20,7 +20,7 @@ let monomerTemplateLib = {
         let now = new Date().getTime();
         let dateStr = moment(now).format('YYYY-MM-DD HH:mm:ss');
         //取编办信息
-        let compilation = await compilationModel.findOne({_id:data.compilationID});
+        let compilation = await compilationModel.findOne({_id:data.compilationId});
         if(compilation){
             let newLib = {
                 creator: data.userAccount,

+ 3 - 3
modules/structural_segment_lib/facade/structural_segment_facade.js

@@ -8,7 +8,7 @@ let structuralSegmentModel = mongoose.model('std_structural_segment');
 let compilationModel = mongoose.model('compilation');
 
 
-let monomerTemplateLib = {
+let structuralSegmentLib = {
     findByCondition:async function(conditions,options,single=true){
         if(single == true){
             return await structuralSegmentModel.findOne(conditions,options);
@@ -20,7 +20,7 @@ let monomerTemplateLib = {
         let now = new Date().getTime();
         let dateStr = moment(now).format('YYYY-MM-DD HH:mm:ss');
         //取编办信息
-        let compilation = await compilationModel.findOne({_id:data.compilationID});
+        let compilation = await compilationModel.findOne({_id:data.compilationId});
         if(compilation){
             let newLib = {
                 creator: data.userAccount,
@@ -44,4 +44,4 @@ let monomerTemplateLib = {
     },
 };
 
-export default monomerTemplateLib
+export default structuralSegmentLib

+ 1 - 1
web/maintain/monomer_template_lib/js/monomer_template.js

@@ -24,7 +24,7 @@ $(document).ready(function() {
             }else {
                 try {
                     let newFeature = await ajaxPost("/monomerTemplate/saveLib",{query:{ID:libID},data:{name:name}});
-                    $("#"+libID).children("a").text(newFeature.name);
+                    $("#"+libID).children("a").text(name);
                     $("#edit").modal('hide');
                 }catch(err) {
                     console.log(err);

+ 2 - 2
web/maintain/structural_segment_lib/js/structural_segment.js

@@ -23,8 +23,8 @@ $(document).ready(function() {
                 return;
             }else {
                 try {
-                    let newFeature = await ajaxPost("/structuralSegment/saveLib",{query:{ID:libID},data:{name:name}});
-                    $("#"+libID).children("a").text(newFeature.name);
+                    await ajaxPost("/structuralSegment/saveLib",{query:{ID:libID},data:{name:name}});
+                    $("#"+libID).children("a").text(name);
                     $("#edit").modal('hide');
                 }catch(err) {
                     console.log(err);