浏览代码

结构分部、单体模板功能新增生成默认功能,修改个别文字描述

lishihao 3 年之前
父节点
当前提交
ecdf23fe79

+ 1 - 0
web/maintain/monomer_template_lib/html/edit.html

@@ -13,6 +13,7 @@
             <nav class="navbar sticky-top navbar-toggleable-md navbar-light bg-faded tools-bar">
                 <div class="collapse navbar-collapse" id="navbarNav">
                     <div class="tools-btn btn-group align-top">
+                        <a href="javascript:void(0)" class="btn btn-sm lock-btn-control" id="createNormal"><i class="fa fa-list-alt" aria-hidden="true"></i> 生成默认</a>
                         <a href="javascript:void(0)" class="btn btn-sm lock-btn-control" id="format"><i class="fa fa-list-alt" aria-hidden="true"></i> 校验格式</a>
                         <a href="javascript:void(0)" class="btn btn-sm lock-btn-control" id="save"><i class="fa fa-floppy-o" aria-hidden="true"></i> 保存</a>
                     </div>

+ 96 - 1
web/maintain/monomer_template_lib/js/monomer_template_edit.js

@@ -35,7 +35,102 @@ $(document).ready(function () {
             alert("保存失败,请查看输入数据");
         }
     });
-    
+    $("#createNormal").click(()=>{
+        $("#createNormal").click(async function() {
+            let explorer =[
+                {
+                    "dispName": "学校",
+                    "items": [
+                        {
+                            "dispName": "教学楼",
+                            "isHaveStructuralSegment": "true",
+                            "key": "academicBuilding",
+                            "monomerType": "building"
+                        },
+                        {
+                            "dispName": "体育馆",
+                            "isHaveStructuralSegment": "true",
+                            "key": "gymnasium",
+                            "monomerType": "building"
+                        },
+                        {
+                            "dispName": "食堂",
+                            "isHaveStructuralSegment": "true",
+                            "key": "Canteen",
+                            "monomerType": "building"
+                        },
+                        {
+                            "dispName": "集体宿舍",
+                            "isHaveStructuralSegment": "true",
+                            "key": "collectiveDormitory",
+                            "monomerType": "building"
+                        }
+                    ],
+                    "key": "school"
+                },
+                {
+                    "dispName": "医院",
+                    "items": [
+                        {
+                            "dispName": "门诊楼",
+                            "isHaveStructuralSegment": "true",
+                            "key": "outpatientBuilding",
+                            "monomerType": "building"
+                        },
+                        {
+                            "dispName": "住院楼",
+                            "isHaveStructuralSegment": "true",
+                            "key": "inpatientBuilding",
+                            "monomerType": "building"
+                        },
+                        {
+                            "dispName": "集体宿舍",
+                            "isHaveStructuralSegment": "true",
+                            "key": "collectiveDormitory",
+                            "monomerType": "building"
+                        }
+                    ],
+                    "key": "hospital"
+                },
+                {
+                    "dispName": "市政工程",
+                    "items": [
+                        {
+                            "dispName": "新建改建扩建",
+                            "isHaveStructuralSegment": "true",
+                            "key": "newConstruction",
+                            "monomerType": "civil"
+                        },
+                        {
+                            "dispName": "景观提升",
+                            "isHaveStructuralSegment": "true",
+                            "key": "landscapeImprovement",
+                            "monomerType": "civil"
+                        },
+                        {
+                            "dispName": "养护大中修",
+                            "isHaveStructuralSegment": "true",
+                            "key": "curing",
+                            "monomerType": "civil"
+                        },
+                        {
+                            "dispName": "小修保养",
+                            "isHaveStructuralSegment": "true",
+                            "key": "routineMaintenance",
+                            "monomerType": "civil"
+                        }
+                    ],
+                    "key": "municipalConstruction"
+                }
+            ];
+            try {
+                let jsonText =  JSON.stringify(explorer);
+                $("#templateLibs").val(JSON.stringify(JSON.parse(jsonText),null,4));
+            }catch (err){
+                console.log(err);
+            }
+        })
+    })
 
 
 });

+ 2 - 1
web/maintain/structural_segment_lib/html/edit.html

@@ -1,7 +1,7 @@
 <nav class="navbar navbar-toggleable-lg justify-content-between navbar-light p-0 second_header">
     <ul class="nav nav-tabs" role="tablist">
         <li class="nav-item">
-            <a class="nav-link active px-3" href="javascript: void(0);">单体模板</a>
+            <a class="nav-link active px-3" href="javascript: void(0);">结构分部</a>
         </li>
     </ul>
 </nav>
@@ -13,6 +13,7 @@
             <nav class="navbar sticky-top navbar-toggleable-md navbar-light bg-faded tools-bar">
                 <div class="collapse navbar-collapse" id="navbarNav">
                     <div class="tools-btn btn-group align-top">
+                        <a href="javascript:void(0)" class="btn btn-sm lock-btn-control" id="createNormal"><i class="fa fa-list-alt" aria-hidden="true"></i> 生成默认</a>
                         <a href="javascript:void(0)" class="btn btn-sm lock-btn-control" id="format"><i class="fa fa-list-alt" aria-hidden="true"></i> 校验格式</a>
                         <a href="javascript:void(0)" class="btn btn-sm lock-btn-control" id="save"><i class="fa fa-floppy-o" aria-hidden="true"></i> 保存</a>
                     </div>

+ 6 - 6
web/maintain/structural_segment_lib/html/main.html

@@ -21,7 +21,7 @@
                         <table class="table table-hover table-bordered">
                             <thead>
                                 <tr>
-                                    <th>单体模板名称</th>
+                                    <th>结构分部名称</th>
                                     <th width="160">编办</th>
                                     <th width="160">添加时间</th>
                                     <th width="70">操作</th>
@@ -59,7 +59,7 @@
     <div class="modal-dialog" role="document">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title">添加单体模板</h5>
+                <h5 class="modal-title">添加结构分部</h5>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                     <span aria-hidden="true">×</span>
                 </button>
@@ -68,8 +68,8 @@
                 <form id="addLibForm" method="post" action="/structuralSegment/addLib"
                     enctype="application/x-www-form-urlencoded21">
                     <div class="form-group">
-                        <label>单体模板名称</label>
-                        <input id="name" name="name" class="form-control" placeholder="输入单体模板名称" type="text">
+                        <label>结构分部名称</label>
+                        <input id="name" name="name" class="form-control" placeholder="输入结构分部名称" type="text">
                         <small class="form-text text-danger" id="nameError" style="display: none">请输入模板名称。</small>
                     </div>
                     <div class="form-group">
@@ -97,7 +97,7 @@
     <div class="modal-dialog" role="document">
         <div class="modal-content">
             <div class="modal-header">
-                <h5 class="modal-title">编辑单体模板</h5>
+                <h5 class="modal-title">编辑结构分部</h5>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                     <span aria-hidden="true">×</span>
                 </button>
@@ -105,7 +105,7 @@
             <div class="modal-body">
                 <form>
                     <div class="form-group">
-                        <label>单体模板名称</label>
+                        <label>结构分部名称</label>
                         <input id="renameText" class="form-control" placeholder="输入名称" type="text" value="">
                         <small class="form-text text-danger" id="renameError" style="display: none">请输入名称。</small>
                         <input id="libID" type="hidden">

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

@@ -67,7 +67,7 @@ async function getFeatureLib (ID) {
             $("#libID").val(ID);
             $("#edit").modal({show:true});
         }else {
-            alert("没有找到该单体模板");
+            alert("没有找到该结构分部");
         }
     }catch (err){
         console.log(err);

+ 34 - 5
web/maintain/structural_segment_lib/js/structural_segment_edit.js

@@ -35,10 +35,39 @@ $(document).ready(function () {
             alert("保存失败,请查看输入数据");
         }
     });
-    $("#conversion").click(()=>{
-        const orgData=$("#orgData").val();
-        
+    $("#createNormal").click(()=>{
+        $("#createNormal").click(async function() {
+            let explorer = [ 
+                {
+                    "valuationName" : "粤建市[2019]6号",
+                    "monomerType" : "building",
+                    "items" : [ 
+                        {
+                            "type" : "单项工程",
+                            "key" : "basicEngineering",
+                            "dispName" : "基础工程",
+                            "subItems" : [ 
+                                {
+                                    "type" : "单位工程",
+                                    "key" : "foundationTreatment",
+                                    "feeType" : "建筑工程",
+                                    "engineering" : "房屋建筑与装饰工程",
+                                    "dispName" : "基础处理与基坑支护工程",
+                                    "calcProgram" : "计算程序2018一般/简易计税(标准)-粤建市[2019]6号",
+                                    "IndicatorSegment" : "基础工程"
+                                }
+                            ],
+                            
+                        }
+                    ]
+                }
+            ];
+            try {
+                let jsonText =  JSON.stringify(explorer);
+                $("#templateLibs").val(JSON.stringify(JSON.parse(jsonText),null,4));
+            }catch (err){
+                console.log(err);
+            }
+        })
     })
-
-
 });