Ver código fonte

tab控件代码优化

songxy 1 ano atrás
pai
commit
783291c1b4

+ 0 - 14
zjugis-business/src/main/resources/static/flow/css/formCommon.css

@@ -295,18 +295,4 @@
 
 .form-table-info .table-btn span {
   color: #2e77e6;
-}
-.ow-tab {
-  display: flex;
-  flex-direction: column;
-}
-.ow-tab-item {
-  padding: 5px 15px !important;
-  cursor: pointer;
-}
-.ow-tab>.ow-tab-scroll {
-  height: 0px;
-  flex-grow: 1;
-  overflow-y: auto;
-  margin-top: 15px;
 }

+ 7 - 33
zjugis-business/src/main/resources/templates/FlowContract/apply.ftl

@@ -1,12 +1,10 @@
-<@w.workFlow javascripts=['/FlowContract/js/apply.js','/flow/js/formCommon.js']
-styles=[ '/flow/css/formCommon.css' ]>
-  <div class="z-position form-boss ow-tab" name="flow-form">
-      <div class="oa_tabBox">
-          <ul class="z-tab-bar">
-              <li z-tabindex="0" class="ow-tab-item on" data-name="jbxx">基础信息</li>
-              <li z-tabindex="1" class="ow-tab-item" data-name="yj">审批意见</li>
-          </ul>
-      </div>
+<@w.workFlow javascripts=['/FlowContract/js/apply.js','/flow/js/formCommon.js', '/OwCommon/OwCommon.js']
+styles=[ '/flow/css/formCommon.css', '/OwCommon/OwCommon.css' ]>
+  <div class="z-position form-boss ow-tabs" name="flow-form">
+      <ul class="ow-tab-nav oa_tabBox">
+          <li z-tabindex="0" class="ow-tab-item on" data-name="jbxx">基础信息</li>
+          <li z-tabindex="1" class="ow-tab-item" data-name="yj">审批意见</li>
+      </ul>
 
       <div class="ow-tab-scroll">
           <div class="ow-tab-content" name="jbxx">
@@ -607,31 +605,7 @@ styles=[ '/flow/css/formCommon.css' ]>
       }
   </style>
     <script language="javascript">
-        ;(function(_g){
-            function TabScroll(){
-                if(!$) throw new Error("$未定义,请先引入jQuery库!");
-                $(".ow-tab-content").hide(0);
-                var dataName = $(".ow-tab-item").removeClass('on').eq(0).addClass("on").attr("data-name")
-                $("[name='"+dataName+"']").show();
-                return this;
-            }
-            TabScroll.prototype = {
-                init: function(handle){
-                    $(".ow-tab-item").click(function(){
-                        $(".ow-tab-item").removeClass('on')
-                        var dataName = $(this).addClass("on").attr('data-name');
-                        $(".ow-tab-content").hide(0);
-                        $("[name='"+dataName+"']").show();
-                        if(handle){
-                            handle($(this))
-                        }
-                    })
-                }
-            }
-            _g.tabScroll = TabScroll;
-        })(window);
         setTimeout(function(){
-
             new tabScroll().init(function(dom){
                 console.log(dom)
             })