shengxuefei 4 gadi atpakaļ
vecāks
revīzija
81b9af1b53

+ 2 - 1
build/utils.js

@@ -47,7 +47,8 @@ exports.cssLoaders = function (options) {
     if (options.extract) {
       return ExtractTextPlugin.extract({
         use: loaders,
-        fallback: 'vue-style-loader'
+        fallback: 'vue-style-loader',
+        publicPath: '../../'   // 作用是设置打包过程中提取css的方法
       })
     } else {
       return ['vue-style-loader'].concat(loaders)

+ 3 - 3
config/index.js

@@ -11,8 +11,8 @@ module.exports = {
     assetsSubDirectory: 'static',
     assetsPublicPath: '/',
     proxyTable: {
-        '/api': {
-          target: 'http://222.223.237.11:8189/WorkFlowWebService60NodeJS/query.asmx',
+        '/api': {   
+          target: 'http://222.223.237.11:8189/WorkFlowWebService60NodeJS/query.asmx',    //东龙webservice
           //target: 'http://1.193.162.246:18402/WorkFlowWebService60NodeJS/query.asmx',
           changeOrigin: true,
           pathRewrite: {
@@ -59,7 +59,7 @@ module.exports = {
     // Paths
     assetsRoot: path.resolve(__dirname, '../dist'),
     assetsSubDirectory: 'static',
-    assetsPublicPath: '/',
+    assetsPublicPath: './',
 
     /**
      * Source Maps

+ 22 - 0
package-lock.json

@@ -3626,6 +3626,14 @@
         }
       }
     },
+    "dom7": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/dom7/-/dom7-3.0.0.tgz",
+      "integrity": "sha512-oNlcUdHsC4zb7Msx7JN3K0Nro1dzJ48knvBOnDPKJ2GV9wl1i5vydJZUSyOfrkKFDZEud/jBsTk92S/VGSAe/g==",
+      "requires": {
+        "ssr-window": "^3.0.0-alpha.1"
+      }
+    },
     "domain-browser": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz",
@@ -9191,6 +9199,11 @@
       "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
       "dev": true
     },
+    "ssr-window": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/ssr-window/-/ssr-window-3.0.0.tgz",
+      "integrity": "sha512-q+8UfWDg9Itrg0yWK7oe5p/XRCJpJF9OBtXfOPgSJl+u3Xd5KI328RUEvUqSMVM9CiQUEf1QdBzJMkYGErj9QA=="
+    },
     "ssri": {
       "version": "5.3.0",
       "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.3.0.tgz",
@@ -9508,6 +9521,15 @@
         "has-flag": "^3.0.0"
       }
     },
+    "swiper": {
+      "version": "6.6.1",
+      "resolved": "https://registry.npmjs.org/swiper/-/swiper-6.6.1.tgz",
+      "integrity": "sha512-vQ2f/zr9mux+EwYlJhObG1c2Vt6U9++YzgqTpTtdzc8K7HOB7AWpQJGXoeEJmfYlcoS9b4Oy8BM6JD70hHX9eA==",
+      "requires": {
+        "dom7": "^3.0.0",
+        "ssr-window": "^3.0.0"
+      }
+    },
     "table": {
       "version": "4.0.2",
       "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz",

+ 1 - 0
package.json

@@ -15,6 +15,7 @@
     "better-scroll": "^2.2.1",
     "css-loader": "^3.2.0",
     "decimal.js": "^10.2.1",
+    "swiper": "^6.6.1",
     "vant": "^2.12.9",
     "vue": "^2.5.2",
     "vue-router": "^3.0.1",

+ 107 - 0
src/assets/css/swiper_table.less

@@ -0,0 +1,107 @@
+.flex {
+  display: -webkit-box;
+  display: -webkit-flex;
+  display: -ms-flexbox;
+  display: flex;
+}
+.flex-center-h {
+  .flex;
+  -webkit-box-align: center;
+  -webkit-align-items: center;
+  -ms-flex-align: center;
+  align-items: center;
+}
+.flex-center-all {
+  .flex;
+  justify-content: center;
+  -webkit-box-align: center;
+  -webkit-align-items: center;
+  -ms-flex-align: center;
+  align-items: center;
+}
+@nav_height:90px;
+.topNav_all{
+  .flex;
+  justify-content: flex-start;
+  align-items: flex-start;
+  flex-direction: row;
+  font-size: 12px;
+  // color:#2c3e50;
+  color:black;
+  .topNav_left{
+    background: white;
+    width:114px;
+    .flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    .topNav_title{
+      .flex;
+      flex-direction: column;
+      justify-content: center;
+      align-items: center;
+    }
+    .fix-active{
+      width:113px;
+      height: 35px;
+      line-height: 35px;
+      border-right: 1px solid #ccc;
+      background: white;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+    }
+    .fix-active:nth-of-type(1){
+      border-top:1px solid #ccc;
+      border-right: 1px solid  #ccc;
+    }
+    .topNav_title:last-child{
+      border-bottom: 1px solid  #ccc;
+    }
+  }
+  #topNav {
+    width: 100%;
+    .swiper-wrapper{
+      .swiper-slide {
+        padding: 0 5px;
+        /*letter-spacing:2px;*/
+        width:@nav_height;
+        height: 35px;
+        line-height: 35px;
+        text-align:center;
+        border-top: 1px solid #ccc;
+        border-bottom: 1px solid #ccc;
+        background: white;
+        span{
+          transition:width .3s ease;
+          display:block;
+        }
+      }
+      .swiper-slide1 {
+        padding: 0 5px;
+        /*letter-spacing:2px;*/
+        width:@nav_height;
+        text-align:center;
+        height: 35px;
+        line-height: 35px;
+        border-bottom: 1px solid #ccc;
+        flex-shrink: 0;
+        span{
+          transition:width .3s ease;
+          display:block;
+        }
+      }
+    }
+  }
+}
+
+/*#topNav .swiper-slide:nth-of-type(1){
+  z-index: 10;
+}
+#topNav .swiper-slide1{
+  z-index: 1;
+}
+#topNav .swiper-slide1:nth-of-type(1){
+  z-index: 10;
+}*/
+

+ 46 - 25
src/components/getsabuildingstruct.vue

@@ -36,13 +36,19 @@
           <tr>
             <td rowspan="2" class="width">楼层</td>
             <td class="width">单元</td>
-            <td></td>
+            <td>
+              <template v-if="data!=null&&data.Chambers!=null&&data.Chambers.length>1">
+                <van-col  class="border3"  :span="span" v-for="item in data.Chambers" :key="item.cName" >{{item.cName}}</van-col>
+              </template>
+            </td>
           </tr>
            <tr> 
             <td>室号</td>
             <td >
-              <template v-if="data!=null&&data.Floors!=null">
-                <van-col    class="height25_1" v-for="item in data.Chambers[0].SubChambers" :key="item.subcName">{{item.subcName}}</van-col>
+              <template v-if="data!=null&&data.Chambers!=null">                
+                <van-col  class="border3"  :span="span" v-for="item in data.Chambers" :key="item.cName" >
+                    <div  :style="'width:'+CountSpan(data.Chambers.length,item.SubChambers.length)+'px;display:inline-block;'"   class="border3"  v-for="item1 in item.SubChambers" :key="item1.subcName">{{item1.subcName}}</div>
+                </van-col>
               </template>
             </td>
           </tr>
@@ -50,10 +56,10 @@
           <tr v-for="item1 in data.Floors" :key="item1.fName">
             <td colspan="2">{{item1.fName}}</td>
             <td >
-              <template v-if="data!=null&&data.Rooms!=null">
-                <van-col  class="height25_1" v-for="item in filterArray(data.Rooms,item1.fName)"  :key="item.rID" :style="'background:'+item.rColor+';'">
-                  <router-link :to="{path:'/getsaroominfo',query:{id:item.rID}}"  class="blackColor">{{item.rName}}</router-link> 
-                </van-col>
+              <template v-if="data!=null&&data.Rooms!=null">                
+                    <van-col  class="border3"  :span="span2" v-for="item in filterArray(data.Rooms,item1.fName)"  :key="item.rID" :style="'background:'+item.rColor+';'">
+                      <router-link :to="{path:'/getsaroominfo',query:{id:item.rID}}"  class="blackColor">{{item.rName}}</router-link> 
+                    </van-col>                
               </template>
             </td>
           </tr>
@@ -67,7 +73,8 @@
 <script>
 import { GetSaBuildingStruct } from "@/common/api/loginApi.js";
 import BetterScroll from 'better-scroll'
-
+import Swiper from 'swiper';
+  import 'swiper/swiper.min.css';
 
 export default {
   name: "login",
@@ -77,7 +84,10 @@ export default {
       keyId:0,
       keyValue:'',
       width:'',
-      
+      width1:"",
+      span:"24",
+      span2:"",
+      span3:""
     };
   },
   created: function () {
@@ -100,16 +110,23 @@ export default {
     getWidth:function(){
       if(this.data!=null&&this.data.Chambers!=null){
         if(this.data.Chambers[0].SubChambers.length>0){
-        return this.data.Chambers[0].SubChambers.length*40+70;
+          let width=this.data.Chambers[0].SubChambers.length*40+70;
+          if(this.width>width){
+            return this.width;
+          }
+          else{
+             return width; 
+          }
+        
         }
       }
-      return 400;
+      return this.width;
     }
     
   },
     mounted() {
       this.$nextTick(() => {
-        this.scroll = new BetterScroll(this.$refs.wrapper, {scrollX: true,scrollY:false})
+        this.scroll = new BetterScroll(this.$refs.wrapper, {scrollX: true,scrollY:false,click:true})
       })
     },
   methods: {
@@ -129,9 +146,17 @@ export default {
         }
         //console.info('data.Chambers',res.data.Chambers[0].SubChambers)
         that.data=res.data;
-        
+        if(that.data.Chambers.length>=1){
+          this.span=24/that.data.Chambers.length;
+        }
       });
     },
+    CountSpan:function(chlen,col){   //计算行宽
+       let count=chlen*col;
+       let width2=this.width/count;
+       console.info('width2',width2);
+       return width2;
+    },
     // 单选按钮点击事件
     click1: function (event, id) {
       //console.info("click1 event", event);
@@ -151,18 +176,10 @@ export default {
       //console.info('filterArray',arr);
       //console.info('filterArray name',name);
       var r=arr.filter(function(item,index,self){
-        if(name.length==1&&name!='1'){
-          return item.rName.substr(0,1)==name&&item.rName.length>=3;
-        }
-        else if(name.length==1&&name=='1'){
-          return item.rName.length<3||item.rName.substr(0,1)==name&&item.rName.length>=3;
-        }
-        else{
-          return item.rName.substr(0,2)==name&&item.rName.length>=3;
-        }
-         
+          return item.rCoordinateY==name;
       });
-      console.info('filterArray r',r);
+      this.span2=24/r.length;
+      //console.info('filterArray r',r);
       return r;
     }
   },
@@ -170,8 +187,9 @@ export default {
 </script>
 
 <!-- Add "scoped" attribute to limit CSS to this component only -->
-<style scoped>
+<style lang="less"  scoped>
 @import 'vue-easytable/libs/themes-base/index.css';
+@import "../assets/css/swiper_table.less";
 .title1 {
   color: #1989fa;
   text-align: left;
@@ -214,6 +232,9 @@ export default {
   border:#999 solid 1px;
   padding:0;
 }
+.border3{
+  border:#999 solid 1px;
+}
 .blackColor{
   color: #000;
 }

+ 2 - 0
src/main.js

@@ -5,6 +5,7 @@ import App from './App'
 import router from './router'
 import store from './store'
 import * as util from './common/util.js'
+import less from 'less'
 import {
   Button,
   Toast,
@@ -60,6 +61,7 @@ Vue.use(Button)
   .use(Search)
   .use(VTable)   //vue easytable
   .use(VPagination)
+  .use(less)
   
 
 /* eslint-disable no-new */

+ 4 - 1
src/router/index.js

@@ -32,9 +32,12 @@ import filterclient from '@/components/filterclient'
 import getsaclientlist1 from '@/components/getsaclientlist1'
 
 Vue.use(Router)
-
+//console.info("获取根目录", window.location.pathname);
+let baseUrl='/'   //base默认值是/ ,若要支持二级虚拟目录。需要设置为 /h5/这种形式。表示该vue项目放入h5虚拟目录下
+//console.info("base", Router.base);
 export default new Router({
   mode:'history',
+  base:baseUrl,
   routes: [
     {    //登录页
       path: '/',