1033 5 ماه پیش
والد
کامیت
0bfbf5aeb1

+ 94 - 0
src/pages/data/allocation/allocation.vue

@@ -0,0 +1,94 @@
+<template>
+  <div class="allocation">
+      <el-descriptions class="margin-top" title="场景管理" :column="3" size="small">
+        <template slot="extra">
+          <el-button type="primary" size="small" @click="scene">添加</el-button>
+          <el-button type="primary" size="small" @click="back">返回</el-button>
+        </template>
+      </el-descriptions>
+
+      <el-table
+          :data="tableData"
+          border
+          size="small"
+          style="width: 100%">
+          <el-table-column
+            fixed
+            prop="name"
+            label="场景名字">
+          </el-table-column>
+          <el-table-column
+            prop="url"
+            label="地图">
+          </el-table-column>
+          <el-table-column
+            prop="site_list"
+            label="基站">
+          </el-table-column>
+          <el-table-column
+            prop="card_list"
+            show-overflow-tooltip
+            label="卡id">
+          </el-table-column>
+          <el-table-column
+            fixed="right"
+            label="操作"
+            width="100">
+            <template slot-scope="scope">
+              <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
+              <el-button type="text" size="small">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+  </div>
+</template>
+
+<script>
+  import map from '@/store/modules/map'
+  export default {
+      mounted() {
+        this.goChang()
+      },
+      methods: {
+        handleClick(row) {
+          console.log(row);
+
+          this.$router.push({
+            path:'/scene',//页面路劲 和上面名字任意一个都可以
+            query: {flight: JSON.stringify(row)} // 参数传值
+          });
+        },
+        back(){
+          this.$router.go(-1)
+        },
+        scene(){
+          this.$router.push('/scene');
+        },
+        goChang(){
+          for(var item of map.state.ZRmapData){
+            this.tableData.push(item[1])
+          }
+          // console.log(this.tableData)
+        }
+      },
+      data() {
+        return {
+          tableData: [
+            {
+              name:'北航',
+              url:'http://121.42.8.157:19800/geoserver/cite/wms',
+              site_list:'30001,30002,30003,3006',
+              card_list:'1222,1223,1224,1225'
+            }
+          ]
+        }
+      }
+    }
+</script>
+
+<style scoped lang="scss">
+  .allocation{
+    width: 90%;
+    margin: 0 auto 50px;
+  }
+</style>

+ 114 - 0
src/pages/data/scene/scene.vue

@@ -0,0 +1,114 @@
+<template>
+  <div class="scene">
+      <el-form ref="form" :model="form" label-width="80px" size="small">
+        <el-form-item label="场景名字">
+          <el-input v-model="form.name"></el-input>
+        </el-form-item>
+        <el-form-item label="地图">
+          <el-input v-model="form.url"></el-input>
+        </el-form-item>
+        <el-form-item label="基站">
+          <el-button  style="margin-bottom: 10px;" type="primary" icon="el-icon-plus" size="small" @click="addBase"></el-button>
+          <div class="base" v-for="(item,index) in base_list" :key="index">
+              <el-input v-model="item.id" placeholder="基站id" size="small"></el-input>
+              <el-button class="btn" type="primary" icon="el-icon-plus" size="small" @click="addBase"></el-button>
+              <el-button class="btn" type="primary" icon="el-icon-delete" size="small"  @click="removeBase(index)"></el-button>
+          </div>
+        </el-form-item>
+        <el-form-item label="卡id">
+          <el-button style="margin-bottom: 10px;" type="primary" icon="el-icon-plus" size="small" @click="addCard"></el-button>
+          <div class="base" v-for="(item,index) in card_list" :key="index">
+              <el-input v-model="item.id" placeholder="卡id" size="small"></el-input>
+              <el-button class="btn" type="primary" icon="el-icon-plus" size="small" @click="addCard"></el-button>
+              <el-button class="btn" type="primary" icon="el-icon-delete" size="small" @click="removeCard(index)"></el-button>
+          </div>
+        </el-form-item>
+        <el-form-item>
+          <el-button v-if="bite" type="primary" @click="onSubmit">立即创建</el-button>
+          <el-button v-if="!bite" type="primary" @click="onSubmit">保存编辑</el-button>
+          <el-button  @click="back">取消</el-button>
+        </el-form-item>
+      </el-form>
+  </div>
+</template>
+
+<script>
+  export default {
+      data() {
+        return {
+          base_list:[],
+          card_list:[],
+          form: {
+            name: '',
+            url: '',
+            date1: '',
+            date2: '',
+            delivery: false,
+            type: [],
+            resource: '',
+            desc: ''
+          },
+          bite:true
+        }
+      },
+      methods: {
+        onSubmit() {
+          console.log('submit!');
+        },
+        back(){
+          this.$router.go(-1)
+        },
+        addBase(){
+          this.base_list.push({id:''})
+        },
+        removeBase(e){
+          this.base_list.splice(e,1)
+        },
+        addCard(){
+          this.card_list.push({id:''})
+        },
+        removeCard(e){
+          this.card_list.splice(e,1)
+        }
+      },
+      mounted() {
+
+        console.log(this.$route.query.flight)
+        var flight = JSON.parse(this.$route.query.flight);
+        console.log(typeof flight)
+        if(typeof flight != undefined){
+            this.bite = false;
+            this.form.name = flight.name;
+            this.form.url = flight.url;
+            var arr=[];
+             arr = flight.card_list.split(',')
+             for(var card of arr){
+               console.log(card)
+               this.card_list.push({id:card})
+             }
+             console.log(this.card_list)
+             var brr=[];
+              brr = flight.site_list.split(',')
+              for(var base of brr){
+                this.base_list.push({id:base})
+              }
+        }
+
+
+      },
+    }
+</script>
+
+<style scoped lang="scss">
+  .scene{
+    width:500px;
+    margin: 0 auto 50px;
+    .base{
+      display: flex;
+      margin-bottom: 20px;
+      .btn{
+        margin-left: 10px;
+      }
+    }
+  }
+</style>

+ 12 - 5
src/pages/data/summary/SummaryCopy.vue

@@ -270,7 +270,6 @@
           <Card
             style="position: relative;width: 300px;margin: auto;display: flex;flex-direction: column;justify-content: space-around;">
             <template slot="title">
-              <!--<span>二维实时位置</span>-->
               <span>二维实时位置</span>
             </template>
             <template slot="content">
@@ -287,14 +286,14 @@
                     <div><a color="white">选择场地:</a></div>
                   </el-col>
                   <el-col :span="16">
-                    <el-select style="font-size:18px;" v-model="trueTimeMapName" placeholder="请选择" @change="openCard">
+                    <el-select style="font-size:18px;" v-model="trueTimeMapName" placeholder="请选择">
                       <el-option style="font-size:18px;" v-for="item in mapInfo" :key="item.value" :label="item.label"
                         :value="item.value">
                       </el-option>
                     </el-select>
                   </el-col>
                 </el-row>
-                <el-row style="display: flex;margin-bottom:15px;margin-top:15px;flex-wrap:wrap;font-size:18px;">
+                <el-row v-if="false" style="display: flex;margin-bottom:15px;margin-top:15px;flex-wrap:wrap;font-size:18px;">
                   <el-col :span="8" style="display:flex;margin-top:10px;flex-wrap:wrap;">
                     <div><a color="white">选择人卡:</a></div>
                   </el-col>
@@ -353,6 +352,8 @@
                   <el-col :span="24" style="display:flex;margin-left:125px;flex-wrap:wrap;">
                     <div><el-button type="primary" @click="B8Megrs()" size="small" style="font-size:18px"
                         round>查看</el-button></div>
+                    <div style="margin-left: 10px;"><el-button type="primary" @click="AddScene()" size="small" style="font-size:18px"
+                        round>场景管理</el-button></div>
                   </el-col>
                 </el-row>
                 <t-map v-if="TMapVisible" ref="t_map"></t-map>
@@ -5378,7 +5379,6 @@ export default {
       map.state.historynum = this.historynum
       map.state.axis_show = this.trueTimeMapBase
       map.state.axis_list = this.coord_list
-      map.state.person_list = this.MapCardvalue
       if (this.$refs.cell_size.value !== '') {
         map.state.cellSize = this.$refs.cell_size && this.$refs.cell_size.value
       }
@@ -5567,8 +5567,11 @@ export default {
         console.log(arr)
         for(var item2 of arr){
           item2 = item2.substring(9)
-          this.cardArr.push({ value: item2, label: item2 })
+          this.cardArr.push({ value: item2, show: true })
         }
+        map.state.person_list = this.cardArr;
+
+        console.log(map.state.person_list)
     },
     initSolution() {
       let message = {
@@ -5689,6 +5692,10 @@ export default {
       this.$nextTick(() => {
         this.$refs.building.init()
       })
+    },
+    // 添加场景
+    AddScene(){
+      this.$router.push('/allocation');
     }
   }
 }

+ 10 - 0
src/router/index.js

@@ -8,6 +8,8 @@ const Summary = () => import('../pages/data/summary/Summary.vue')
 const SummaryMap = () => import('../pages/data/summary/SummaryCopy.vue')
 const Public = () => import('../pages/data/public/Public.vue')
 const Union = () => import('../pages/data/union/Union.vue')
+const Allocation = () => import('../pages/data/allocation/allocation.vue')
+const Scene = () => import('../pages/data/scene/scene.vue')
 // const Map = () => import('../pages/data/map/Map')
 
 Vue.use(BinUI)
@@ -36,6 +38,14 @@ const router = new VueRouter({
       path: '/union',
       component: Union
     },
+    {
+      path: '/allocation',
+      component: Allocation
+    },
+    {
+      path: '/scene',
+      component: Scene
+    },
     {
       path: '/map',
       component: SummaryMap

+ 16 - 21
src/store/algo/LocAlgo2.js

@@ -186,16 +186,11 @@ export default {
         },
 
         LocAlgo2Calc(stateTmp, state) {
-            let data = state.dataParam
-            if(state.person_list.length==0){
-              this.commit('LocAlgo2Person',state);
-            }else{
-              for(var personCard of state.person_list){
-                // 判断是否是要显示的人卡
-                if(personCard == data.data[0][0].substring(9)){
-                    console.log(personCard)
-                   this.commit('LocAlgo2Person',state);
-                }
+            for(var personCard of state.person_list){
+              // 判断是否是要显示的人卡
+              if(personCard.show){
+                  console.log(personCard)
+                 this.commit('LocAlgo2Person',state);
               }
             }
         },
@@ -1263,19 +1258,19 @@ export default {
                   if(state.person_list.length!=0){
                       for(var card2 of state.person_list){
                         // 判断是否是要显示的人卡
-                        if(card2 != data.data[0][0].substring(9)){
+                        if(!card2.show){
                           console.log(card2)
                           console.log(data.data[0][0].substring(9))
-                          // this.LBresuleX = undefined
-                          // this.LBresuleY = undefined
-                          // this.LBresuleXN = undefined
-                          // this.LBresuleYN = undefined
-                          // this.preBoxX = undefined
-                          //   this.preBoxY = undefined
-                          //   this.nowBox1 = undefined
-                          //   this.nowBox2 = undefined
-                          //   this.nowBox3 = undefined
-                          //   this.countlhy = 0
+                          this.LBresuleX = undefined
+                          this.LBresuleY = undefined
+                          this.LBresuleXN = undefined
+                          this.LBresuleYN = undefined
+                          this.preBoxX = undefined
+                          this.preBoxY = undefined
+                          this.nowBox1 = undefined
+                          this.nowBox2 = undefined
+                          this.nowBox3 = undefined
+                          this.countlhy = 0
                         }
                       }
                   }

+ 19 - 6
src/views/tmap/t-map.vue

@@ -51,10 +51,6 @@
           <el-switch style="zoom:1.2" v-model="value2" active-text="显示栅格" inactive-text="">
           </el-switch>
         </el-col>
-        <el-col style="display:none" :span="6">
-          <el-switch v-model="value4" active-text="显示三维" inactive-text="显示二维">
-          </el-switch>
-        </el-col>
         <!--<el-col :span="2">
           <el-button type="primary" size="small" style="font-size:18px" @click="showCell()" round>网格显示</el-button>
         </el-col>-->
@@ -68,11 +64,21 @@
         </el-col>
       </el-row>
       <el-row
+        style="display:flex;flex-wrap:wrap;margin: auto;margin-top:10px;overflow: auto;flex-direction: row;width:640px;justify-content: space-around;">
+          <el-col :span="2">
+            <span style="color:#303133;font-size: 16px;font-weight:500;">人卡ID</span>
+          </el-col>
+        <el-col :span="5" v-for="card in card_list" :key="card.value">
+          <el-switch style="zoom:1.2" v-model="card.show" :active-text="card.value" inactive-text="" @change="changer">
+          </el-switch>
+        </el-col>
+      </el-row>
+      <el-row v-if="false"
         style="display:flex;flex-wrap:wrap;margin: auto;margin-top:10px;overflow: auto;flex-direction: row;width:540px;justify-content: space-around;">
         <el-col :span="2">
           <el-button type="primary" size="small" style="font-size:18px" @click="listTable()" round>查看基站数据</el-button>
         </el-col>
-        <el-col :span="2" v-if="false">
+        <el-col :span="2" >
           <el-button type="primary" size="small" style="font-size:18px" @click="listTableCard()" round>查看终端数据</el-button>
         </el-col>
       </el-row>
@@ -171,7 +177,8 @@ export default {
       x: 0,
       y: 0,
 
-      line_show:true
+      line_show:true,
+      card_list:[]
     }
   },
   computed: {},
@@ -207,6 +214,9 @@ export default {
       console.log(trueTimeMapName, map.state.ZRmapData)
       this.mapInfo = map.state.ZRmapData.get(trueTimeMapName)
       console.log(this.mapInfo)
+
+      this.card_list = map.state.person_list
+      console.log(map.state.person_list)
       this.initMap()
       this.showtime()
       this.controlDraw()
@@ -561,6 +571,9 @@ export default {
         // this.algocolor = algoColor
       }, 1000)
     },
+    changer(){
+        map.state.person_list = this.card_list
+    },
     changeSolution() {
       map.state.solutionConfig = this.checkedSolution
     },