From 14003b98053b2b48076d0a7ab08723f9ead88000 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期一, 23 十一月 2020 18:17:20 +0800
Subject: [PATCH] [UI] 完成国标级联的CURD

---
 web_src/src/components/platformEdit.vue                                               |  382 +++++++++++++++++++++++++++++++
 src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java                  |   14 +
 web_src/src/components/ParentPlatformList.vue                                         |  243 ++++++--------------
 web_src/src/router/index.js                                                           |    2 
 src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java         |   42 +++
 web_src/src/components/UiHeader.vue                                                   |    3 
 src/main/java/com/genersoft/iot/vmp/storager/redis/VideoManagerRedisStoragerImpl.java |    2 
 src/main/resources/application.yml                                                    |   12 
 README.md                                                                             |    1 
 9 files changed, 519 insertions(+), 182 deletions(-)

diff --git a/README.md b/README.md
index 50ca236..232b5c5 100644
--- a/README.md
+++ b/README.md
@@ -42,6 +42,7 @@
     - [ ] 閫氶亾閫夋嫨
     - [ ] 閫氶亾鎺ㄩ��
     - [ ] 鐐规挱
+    - [ ] 浜戝彴鎺у埗
 - [ ] 娣诲姞RTSP瑙嗛  
 - [ ] 娣诲姞ONVIF鎺㈡祴灞�鍩熺綉鍐呯殑璁惧  
 - [ ] 娣诲姞RTMP瑙嗛  
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java
index d6a97cf..ddd964b 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java
@@ -85,8 +85,14 @@
 
     /**
      * RTCP娴佷繚娲�
+     * TODO 棰勭暀, 鏆備笉瀹炵幇
      */
     private boolean rtcp;
+
+    /**
+     * 鍦ㄧ嚎鐘舵��
+     */
+    private boolean status;
 
 
     public boolean isEnable() {
@@ -224,4 +230,12 @@
     public void setRtcp(boolean rtcp) {
         this.rtcp = rtcp;
     }
+
+    public boolean isStatus() {
+        return status;
+    }
+
+    public void setStatus(boolean status) {
+        this.status = status;
+    }
 }
diff --git a/src/main/java/com/genersoft/iot/vmp/storager/redis/VideoManagerRedisStoragerImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/redis/VideoManagerRedisStoragerImpl.java
index f704d56..0e21167 100644
--- a/src/main/java/com/genersoft/iot/vmp/storager/redis/VideoManagerRedisStoragerImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/redis/VideoManagerRedisStoragerImpl.java
@@ -567,7 +567,7 @@
 
 	@Override
 	public boolean deleteParentPlatform(ParentPlatform parentPlatform) {
-		return false;
+		return redis.del(VideoManagerConstants.PLATFORM_PREFIX + parentPlatform.getDeviceGBId());
 	}
 
 	@Override
diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java
index 9f35dd8..27dbdd4 100644
--- a/src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java
@@ -11,6 +11,7 @@
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
+import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
 
 @CrossOrigin
@@ -23,8 +24,8 @@
     @Autowired
     private IVideoManagerStorager storager;
 
-    @GetMapping("/platforms")
-    public PageResult<ParentPlatform> platforms(int page, int count){
+    @GetMapping("/platforms/{count}/{page}")
+    public PageResult<ParentPlatform> platforms(@PathVariable int page, @PathVariable int count){
 
         if (logger.isDebugEnabled()) {
             logger.debug("鏌ヨ鎵�鏈変笂绾ц澶嘇PI璋冪敤");
@@ -32,12 +33,26 @@
         return storager.queryParentPlatformList(page, count);
     }
 
-    @PostMapping("/platforms/add")
-    public ResponseEntity<String> addPlatform(ParentPlatform parentPlatform){
+    @RequestMapping("/platforms/save")
+    @ResponseBody
+    public ResponseEntity<String> savePlatform(@RequestBody ParentPlatform parentPlatform){
 
         if (logger.isDebugEnabled()) {
             logger.debug("鏌ヨ鎵�鏈変笂绾ц澶嘇PI璋冪敤");
         }
+        if (StringUtils.isEmpty(parentPlatform.getName())
+                ||StringUtils.isEmpty(parentPlatform.getServerGBId())
+                ||StringUtils.isEmpty(parentPlatform.getServerGBDomain())
+                ||StringUtils.isEmpty(parentPlatform.getServerIP())
+                ||StringUtils.isEmpty(parentPlatform.getServerPort())
+                ||StringUtils.isEmpty(parentPlatform.getDeviceGBId())
+                ||StringUtils.isEmpty(parentPlatform.getExpires())
+                ||StringUtils.isEmpty(parentPlatform.getKeepTimeout())
+                ||StringUtils.isEmpty(parentPlatform.getTransport())
+                ||StringUtils.isEmpty(parentPlatform.getCharacterSet())
+        ){
+            return new ResponseEntity<>("missing parameters", HttpStatus.BAD_REQUEST);
+        }
         boolean updateResult = storager.updateParentPlatform(parentPlatform);
         if (updateResult) {
             return new ResponseEntity<>("success", HttpStatus.OK);
@@ -45,4 +60,23 @@
             return new ResponseEntity<>("fail", HttpStatus.OK);
         }
     }
+
+    @RequestMapping("/platforms/delete")
+    @ResponseBody
+    public ResponseEntity<String> deletePlatform(@RequestBody ParentPlatform parentPlatform){
+
+        if (logger.isDebugEnabled()) {
+            logger.debug("鏌ヨ鎵�鏈変笂绾ц澶嘇PI璋冪敤");
+        }
+        if (StringUtils.isEmpty(parentPlatform.getDeviceGBId())
+        ){
+            return new ResponseEntity<>("missing parameters", HttpStatus.BAD_REQUEST);
+        }
+        boolean deleteResult = storager.deleteParentPlatform(parentPlatform);
+        if (deleteResult) {
+            return new ResponseEntity<>("success", HttpStatus.OK);
+        }else {
+            return new ResponseEntity<>("fail", HttpStatus.OK);
+        }
+    }
 }
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 463548a..fd7509e 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -7,12 +7,12 @@
         communicate: http
     redis:
         # Redis鏈嶅姟鍣↖P
-        host: 127.0.0.1
+        host: 192.168.1.141
         #绔彛鍙�
         port: 6379
         database: 6
         #璁块棶瀵嗙爜,鑻ヤ綘鐨剅edis鏈嶅姟鍣ㄦ病鏈夎缃瘑鐮侊紝灏变笉闇�瑕佺敤瀵嗙爜鍘昏繛鎺�
-        password:
+        password: 4767cb971b40a1300fa09b7f87b09d1c
         #瓒呮椂鏃堕棿
         timeout: 10000
     datasource: 
@@ -25,7 +25,7 @@
 server:
     port: 18080
 sip:
-    ip: 192.168.1.44
+    ip: 192.168.1.20
     port: 5060
     # 鏍规嵁鍥芥爣6.1.2涓瀹氾紝domain瀹滈噰鐢↖D缁熶竴缂栫爜鐨勫墠鍗佷綅缂栫爜銆傚浗鏍囬檮褰旸涓畾涔夊墠8浣嶄负涓績缂栫爜锛堢敱鐪佺骇銆佸競绾с�佸尯绾с�佸熀灞傜紪鍙风粍鎴愶紝鍙傜収GB/T 2260-2007锛�
     # 鍚庝袱浣嶄负琛屼笟缂栫爜锛屽畾涔夊弬鐓ч檮褰旸.3
@@ -40,9 +40,9 @@
     password: 21232f297a57a5a743894a0e4a801fc3
 
 media: #zlm鏈嶅姟鍣ㄧ殑ip涓巋ttp绔彛, 閲嶇偣: 杩欐槸http绔彛
-    ip: 192.168.1.44
-    wanIp:
-    port: 80
+    ip: 127.0.0.1
+    wanIp: 192.168.1.20
+    port: 6080
     secret: 035c73f7-bb6b-4889-a715-d9eb2d1925cc
     streamNoneReaderDelayMS:  600000  # 鏃犱汉瑙傜湅澶氫箙鑷姩鍏抽棴娴�
     # 鍏抽棴绛夊緟鏀跺埌娴佺紪鐮佷俊鎭悗鍦ㄨ繑鍥�,
diff --git a/web_src/src/components/ParentPlatformList.vue b/web_src/src/components/ParentPlatformList.vue
index 947adec..98b0b41 100644
--- a/web_src/src/components/ParentPlatformList.vue
+++ b/web_src/src/components/ParentPlatformList.vue
@@ -8,49 +8,45 @@
         <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;">
           <span style="font-size: 1rem; font-weight: bold;">涓婄骇骞冲彴鍒楄〃</span>
         </div>
-        <devicePlayer ref="devicePlayer"></devicePlayer>
+        <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;font-size: 14px;">
+            <el-button icon="el-icon-plus" size="mini" style="margin-right: 1rem;" type="primary" @click="addParentPlatform">娣诲姞</el-button>
+        </div>
         <!--璁惧鍒楄〃-->
-        <el-table :data="deviceList" border style="width: 100%" :height="winHeight">
-          <el-table-column prop="name" label="鍚嶇О" width="180" align="center">
-          </el-table-column>
-          <el-table-column prop="deviceId" label="骞冲彴缂栧彿" width="240" align="center">
-          </el-table-column>
-          <el-table-column prop="deviceId" label="鏄惁鍚敤" width="50" align="center">
-          </el-table-column>
-          <el-table-column label="鐘舵��" width="180" align="center">
+        <el-table :data="platformList" border style="width: 100%" :height="winHeight">
+          <el-table-column prop="name" label="鍚嶇О" width="240" align="center"></el-table-column>
+          <el-table-column prop="serverGBId" label="骞冲彴缂栧彿" width="180" align="center"></el-table-column>
+          <el-table-column label="鏄惁鍚敤" width="120" align="center">
             <template slot-scope="scope">
               <div slot="reference" class="name-wrapper">
-                <el-tag size="medium" v-if="scope.row.online == 1">鍦ㄧ嚎</el-tag>
-                <el-tag size="medium" type="info" v-if="scope.row.online == 0">绂荤嚎</el-tag>
+                <el-tag size="medium" v-if="scope.row.enable">宸插惎鐢�</el-tag>
+                <el-tag size="medium" v-if="!scope.row.enable">鏈惎鐢�</el-tag>
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column label="鐘舵��" width="120" align="center">
+            <template slot-scope="scope">
+              <div slot="reference" class="name-wrapper">
+                <el-tag size="medium" v-if="scope.row.status">鍦ㄧ嚎</el-tag>
+                <el-tag size="medium" type="info" v-if="!scope.row.status">绂荤嚎</el-tag>
               </div>
             </template>
           </el-table-column>
           <el-table-column label="鍦板潃" width="180" align="center">
             <template slot-scope="scope">
               <div slot="reference" class="name-wrapper">
-                <el-tag size="medium">{{ scope.row.host.address }}</el-tag>
+                <el-tag size="medium">{{ scope.row.serverIP}}:{{scope.row.serverPort }}</el-tag>
               </div>
             </template>
-            <el-table-column prop="deviceId" label="璁惧鍥芥爣缂栧彿" width="240" align="center">
-            </el-table-column>
           </el-table-column>
-
-          <el-table-column label="娴佷紶杈撴ā寮�" align="center" width="160">
+          <el-table-column prop="deviceGBId" label="璁惧鍥芥爣缂栧彿" width="240" align="center"></el-table-column>
+          <el-table-column prop="transport" label="娴佷紶杈撴ā寮�" width="120" align="center"></el-table-column>
+          <el-table-column prop="channelCount" label="閫氶亾鏁�" align="center"></el-table-column>
+          
+          <el-table-column label="鎿嶄綔" width="300" align="center" fixed="right">
             <template slot-scope="scope">
-              <el-select size="mini" @change="transportChange(scope.row)" v-model="scope.row.streamMode" placeholder="璇烽�夋嫨">
-                <el-option key="UDP" label="UDP" value="UDP"></el-option>
-                <el-option key="TCP-ACTIVE" label="TCP涓诲姩妯″紡" :disabled="true" value="TCP-ACTIVE"></el-option>
-                <el-option key="TCP-PASSIVE" label="TCP琚姩妯″紡"  value="TCP-PASSIVE"></el-option>
-              </el-select>
-            </template>
-          </el-table-column>
-          <el-table-column prop="channelCount" label="閫氶亾鏁�" align="center">
-          </el-table-column>
-
-          <el-table-column label="鎿嶄綔" width="240" align="center" fixed="right">
-            <template slot-scope="scope">
-              <el-button size="mini" icon="el-icon-refresh"  @click="refDevice(scope.row)">鍒锋柊閫氶亾</el-button>
-              <el-button size="mini" icon="el-icon-s-open"  type="primary" @click="showChannelList(scope.row)">鏌ョ湅閫氶亾</el-button>
+              <el-button size="mini" icon="el-icon-edit" @click="editPlatform(scope.row)">缂栬緫</el-button>
+              <el-button size="mini" icon="el-icon-share"  type="primary"  @click="chooseChannel(scope.row)">閫夋嫨閫氶亾</el-button>
+              <el-button size="mini" icon="el-icon-delete"  type="danger" @click="deletePlatform(scope.row)">鍒犻櫎</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -64,30 +60,26 @@
           layout="total, sizes, prev, pager, next"
           :total="total">
         </el-pagination>
-
+      <platformEdit ref="platformEdit" ></platformEdit>
       </el-main>
     </el-container>
   </div>
 </template>
 
 <script>
-import devicePlayer from './gb28181/devicePlayer.vue'
+import platformEdit from './platformEdit.vue'
 import uiHeader from './UiHeader.vue'
 export default {
   name: 'app',
   components: {
-    devicePlayer,
+    platformEdit,
     uiHeader
   },
   data() {
     return {
-      deviceList: [], //璁惧鍒楄〃
-      currentDevice: {}, //褰撳墠鎿嶄綔璁惧瀵硅薄
+      platformList: [], //璁惧鍒楄〃
 
-      videoComponentList: [],
-      updateLooper: 0, //鏁版嵁鍒锋柊杞鏍囧織
-      currentDeviceChannelsLenth:0,
-      winHeight: window.innerHeight - 200,
+      winHeight: window.innerHeight - 260,
       currentPage:1,
       count:15,
       total:0
@@ -95,17 +87,7 @@
   },
   computed: {
     getcurrentDeviceChannels: function() {
-      let data = this.currentDevice['channelMap'];
-      let channels = null;
-      if (data) {
-        channels = Object.keys(data).map(key => {
-          return data[key];
-        });
-        this.currentDeviceChannelsLenth = channels.length;
-      }
-
-      console.log("鏁版嵁锛�" + JSON.stringify(channels));
-      return channels;
+      
     }
   },
   mounted() {
@@ -113,146 +95,71 @@
     this.updateLooper = setInterval(this.initData, 10000);
   },
   destroyed() {
-    this.$destroy('videojs');
     clearTimeout(this.updateLooper);
   },
   methods: {
+    addParentPlatform: function() {
+      this.$refs.platformEdit.openDialog(null, this.initData)
+    },
+    editPlatform: function(platform) {
+      console.log(platform)
+      this.$refs.platformEdit.openDialog(platform, this.initData)
+    },
+    deletePlatform: function(platform) {
+        var that = this;
+        that.$confirm('纭鍒犻櫎?', '鎻愮ず', {
+              confirmButtonText: '纭畾',
+              cancelButtonText: '鍙栨秷',
+              type: 'warning'
+            }).then(() => {
+                that.deletePlatformCommit(platform)
+            })
+    },
+    deletePlatformCommit: function(platform) {
+        var that = this;
+        that.$axios.post(`/api/platforms/delete`, platform)
+            .then(function (res) {
+                if (res.data == "success") {
+                    that.$message({
+                        showClose: true,
+                        message: '鍒犻櫎鎴愬姛',
+                        type: 'success'
+                    });
+                    that.initData()
+                }
+            })
+            .catch(function (error) {
+                console.log(error);
+            });
+    },
+    chooseChannel: function(platform) {
+
+    },
     initData: function() {
-      this.getDeviceList();
+      this.getPlatformList();
     },
     currentChange: function(val){
       this.currentPage = val;
-      this.getDeviceList();
+      this.getPlatformList();
     },
     handleSizeChange: function(val){
       this.count = val;
-      this.getDeviceList();
+      this.getPlatformList();
     },
-    getDeviceList: function() {
+    getPlatformList: function() {
       let that = this;
 
-      this.$axios.get(`/api/devices`,{
-        params: {
-          page: that.currentPage - 1,
-          count: that.count
-        }
-      } )
+      this.$axios.get(`/api/platforms/${that.count}/${that.currentPage - 1}`)
         .then(function (res) {
-          console.log(res);
           that.total = res.data.total;
-          that.deviceList = res.data.data;
+          that.platformList = res.data.data;
         })
         .catch(function (error) {
           console.log(error);
         });
 
-    },
-    showChannelList: function(row) {
-      console.log(JSON.stringify(row))
-      this.$router.push(`/channelList/${row.deviceId}/0/15/1`);
-    },
-
-
-    //gb28181骞冲彴瀵规帴
-    //鍒锋柊璁惧淇℃伅
-    refDevice: function(itemData) {
-      ///api/devices/{deviceId}/sync
-      console.log("鍒锋柊瀵瑰簲璁惧:" + itemData.deviceId);
-      this.$axios({
-        method: 'post',
-        url: '/api/devices/' + itemData.deviceId + '/sync'
-      }).then(function(res) {
-        // console.log("鍒锋柊璁惧缁撴灉锛�"+JSON.stringify(res));
-      }).catch(function(e) {
-        that.$message({
-          showClose: true,
-          message: '璇锋眰鎴愬姛',
-          type: 'success'
-        });
-      });;
-    },
-    //閫氱煡璁惧涓婁紶濯掍綋娴�
-    sendDevicePush: function(itemData) {
-      let deviceId = this.currentDevice.deviceId;
-      let channelId = itemData.channelId;
-      console.log("閫氱煡璁惧鎺ㄦ祦1锛�" + deviceId + " : " + channelId);
-      let that = this;
-      this.$axios({
-        method: 'get',
-        url: '/api/play/' + deviceId + '/' + channelId
-      }).then(function(res) {
-        let ssrc = res.data.ssrc;
-        that.$refs.devicePlayer.play(ssrc,deviceId,channelId);
-      }).catch(function(e) {
-      });
-    },
-    transportChange: function (row) {
-      console.log(row);
-      console.log(`淇敼浼犺緭鏂瑰紡涓� ${row.streamMode}锛�${row.deviceId} `);
-      let that = this;
-      this.$axios({
-        method: 'get',
-        url: '/api/devices/' + row.deviceId + '/transport/' + row.streamMode
-      }).then(function(res) {
-
-      }).catch(function(e) {
-      });
     }
 
   }
 };
 </script>
-
-<style>
-.videoList {
-  display: flex;
-  flex-wrap: wrap;
-  align-content: flex-start;
-}
-
-.video-item {
-  position: relative;
-  width: 15rem;
-  height: 10rem;
-  margin-right: 1rem;
-  background-color: #000000;
-}
-
-.video-item-img {
-  position: absolute;
-  top: 0;
-  bottom: 0;
-  left: 0;
-  right: 0;
-  margin: auto;
-  width: 100%;
-  height: 100%;
-}
-
-.video-item-img:after {
-  content: "";
-  display: inline-block;
-  position: absolute;
-  z-index: 2;
-  top: 0;
-  bottom: 0;
-  left: 0;
-  right: 0;
-  margin: auto;
-  width: 3rem;
-  height: 3rem;
-  background-image: url("../assets/loading.png");
-  background-size: cover;
-  background-color: #000000;
-}
-
-.video-item-title {
-  position: absolute;
-  bottom: 0;
-  color: #000000;
-  background-color: #ffffff;
-  line-height: 1.5rem;
-  padding: 0.3rem;
-  width: 14.4rem;
-}
-</style>
diff --git a/web_src/src/components/UiHeader.vue b/web_src/src/components/UiHeader.vue
index 3c264cd..fa57b26 100644
--- a/web_src/src/components/UiHeader.vue
+++ b/web_src/src/components/UiHeader.vue
@@ -3,8 +3,7 @@
 		<el-menu router :default-active="this.$route.path" background-color="#545c64" text-color="#fff" active-text-color="#ffd04b" mode="horizontal">
             <el-menu-item index="/">鎺у埗鍙�</el-menu-item>
             <el-menu-item index="/videoList">璁惧鍒楄〃</el-menu-item>
-             <el-menu-item index="/parentPlatformList">鍥芥爣绾ц仈</el-menu-item>
-            <!-- <el-menu-item index="/videoReplay">褰曞儚鍥炵湅</el-menu-item> -->
+             <el-menu-item index="/parentPlatformList/15/1">鍥芥爣绾ц仈</el-menu-item>
             <el-menu-item style="float: right;" @click="loginout">閫�鍑�</el-menu-item>
         </el-menu>
 	</div>
diff --git a/web_src/src/components/platformEdit.vue b/web_src/src/components/platformEdit.vue
new file mode 100644
index 0000000..faacdde
--- /dev/null
+++ b/web_src/src/components/platformEdit.vue
@@ -0,0 +1,382 @@
+<template>
+<div id="addlatform" v-loading="isLoging">
+    <el-dialog title="娣诲姞骞冲彴" width="70%" top="2rem" :close-on-click-modal="false" :visible.sync="showDialog" :destroy-on-close="true" @close="close()">
+        <div id="shared" style="text-align: right; margin-top: 1rem;">
+
+            <el-row :gutter="24">
+                <el-col :span="11">
+                    <el-form ref="platform1" :rules="rules" :model="platform" label-width="160px" >
+                        <el-form-item label="鍚嶇О" prop="name">
+                            <el-input v-model="platform.name"></el-input>
+                        </el-form-item>
+                        <el-form-item label="SIP鏈嶅姟鍥芥爣缂栫爜" prop="serverGBId">
+                            <el-input v-model="platform.serverGBId" clearable></el-input>
+                        </el-form-item>
+                        <el-form-item label="SIP鏈嶅姟鍥芥爣鍩�" prop="serverGBDomain">
+                            <el-input v-model="platform.serverGBDomain" clearable></el-input>
+                        </el-form-item>
+                        <el-form-item label="SIP鏈嶅姟IP" prop="serverIP">
+                            <el-input v-model="platform.serverIP" clearable></el-input>
+                        </el-form-item>
+                        <el-form-item label="SIP鏈嶅姟绔彛" prop="serverPort">
+                            <el-input v-model="platform.serverPort" clearable></el-input>
+                        </el-form-item>
+                        <el-form-item label="璁惧鍥芥爣缂栧彿" prop="deviceGBId">
+                            <el-input v-model="platform.deviceGBId" clearable></el-input>
+                        </el-form-item>
+                        <el-form-item label="鏈湴IP" prop="deviceIp">
+                            <el-input v-model="platform.deviceIp" :disabled="true"></el-input>
+                        </el-form-item>
+                        <el-form-item label="鏈湴绔彛" prop="devicePort">
+                            <el-input v-model="platform.devicePort" :disabled="true"></el-input>
+                        </el-form-item>
+                        
+                    </el-form>
+                </el-col>
+                <el-col :span="12">
+                    <el-form ref="platform2" :rules="rules" :model="platform" label-width="160px">
+                        <el-form-item label="SIP璁よ瘉鐢ㄦ埛鍚�" prop="username">
+                            <el-input v-model="platform.username"></el-input>
+                        </el-form-item>
+                        <el-form-item label="SIP璁よ瘉瀵嗙爜" prop="password">
+                            <el-input v-model="platform.password" type="password"></el-input>
+                        </el-form-item>
+                        <el-form-item label="娉ㄥ唽鍛ㄦ湡(绉�)" prop="expires">
+                            <el-input v-model="platform.expires"></el-input>
+                        </el-form-item>
+                        <el-form-item label="蹇冭烦鍛ㄦ湡(绉�)" prop="keepTimeout">
+                            <el-input v-model="platform.keepTimeout"></el-input>
+                        </el-form-item>
+                        <el-form-item label="淇′护浼犺緭" prop="transport">
+                            <el-select  v-model="platform.transport" style="width:100%" placeholder="璇烽�夋嫨淇′护浼犺緭鏂瑰紡">
+                                <el-option label="UDP" value="UDP"></el-option>
+                                <el-option label="TCP" value="TCP"></el-option>
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item  label="瀛楃闆�"  prop="characterSet">
+                            <el-select v-model="platform.characterSet" style="width:100%" placeholder="璇烽�夋嫨瀛楃闆�">
+                                <el-option label="GB2312" value="GB2312"></el-option>
+                                <el-option label="UTF-8" value="UTF-8"></el-option>
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item label="鍏朵粬閫夐」" >
+                            <el-checkbox label="鍚敤" v-model="platform.enable" ></el-checkbox>
+                            <el-checkbox label="鍏佽浜戝彴鎺у埗" v-model="platform.PTZEnable"></el-checkbox>
+                            <el-checkbox label="鍚敤RTCP淇濇椿" v-model="platform.rtcp"></el-checkbox>
+                        </el-form-item>
+                        <el-form-item>
+                            <el-button type="primary" @click="onSubmit">{{onSubmit_text}}</el-button>
+                            <el-button @click="close">鍙栨秷</el-button>
+                        </el-form-item>
+                    </el-form>
+                </el-col>
+            </el-row>
+        </div>
+    </el-dialog>
+</div>
+</template>
+
+<script>
+export default {
+    name: 'platformEdit',
+    props: {},
+    computed: {
+        
+    },
+    created() {},
+    data() {
+        return {
+            listChangeCallback: null,
+            showDialog: false,
+            isLoging: false,
+            onSubmit_text:"绔嬪嵆鍒涘缓",
+            // platform: {
+            //     enable: false,
+            //     PTZEnable: true,
+            //     rtcp: false,
+            //     name: null,
+            //     serverGBId: null,
+            //     serverGBDomain: null,
+            //     serverIP: null,
+            //     serverPort: null,
+            //     deviceGBId: null,
+            //     deviceIp: null,
+            //     devicePort: null,
+            //     username: null,
+            //     password: null,
+            //     expires: 300,
+            //     keepTimeout: 60,
+            //     transport: "UDP",
+            //     characterSet: "GB2312",
+            // },
+            platform: {
+                enable: true,
+                PTZEnable: true,
+                rtcp: false,
+                name: "娴嬭瘯001",
+                serverGBId: "34020000002000000001",
+                serverGBDomain: "3402000000",
+                serverIP: "192.168.1.141",
+                serverPort: "5060",
+                deviceGBId: "34020000001320001101",
+                deviceIp: "192.168.1.20",
+                devicePort: "5060",
+                username: "34020000001320001101",
+                password: "12345678",
+                expires: 300,
+                keepTimeout: 60,
+                transport: "UDP",
+                characterSet: "GB2312",
+            },
+            rules: {
+                name: [
+                    { required: true, message:"璇疯緭鍏ュ钩鍙板悕绉�", trigger: 'blur' }
+                ],
+                serverGBId: [
+                    { required: true, message:"璇疯緭鍏IP鏈嶅姟鍥芥爣缂栫爜",  trigger: 'blur' }
+                ],
+                serverGBDomain: [
+                    { required: true, message:"璇疯緭鍏IP鏈嶅姟鍥芥爣鍩�",   trigger: 'blur' }
+                ],
+                serverIP: [
+                    { required: true, message:"璇疯緭鍏IP鏈嶅姟IP",   trigger: 'blur' }
+                ],
+                serverPort: [
+                    { required: true, message:"璇疯緭鍏IP鏈嶅姟绔彛",   trigger: 'blur' }
+                ],
+                deviceGBId: [
+                    { required: true, message:"璇疯緭鍏ヨ澶囧浗鏍囩紪鍙�",   trigger: 'blur' }
+                ],
+                username: [
+                    { required: false, message:"璇疯緭鍏IP璁よ瘉鐢ㄦ埛鍚�",   trigger: 'blur' }
+                ],
+                password: [
+                    { required: false, message:"璇疯緭鍏IP璁よ瘉瀵嗙爜",   trigger: 'blur' }
+                ],
+                expires: [
+                    { required: true, message:"璇疯緭鍏ユ敞鍐屽懆鏈�",   trigger: 'blur' }
+                ],
+                keepTimeout: [
+                    { required: true, message:"璇疯緭鍏ュ績璺冲懆鏈�",   trigger: 'blur' }
+                ],
+                transport: [
+                    { required: true, message:"璇烽�夋嫨淇′护浼犺緭",   trigger: 'blur' }
+                ],
+                characterSet: [
+                    { required: true, message:"璇烽�夋嫨缂栫爜瀛楃闆�",   trigger: 'blur' }
+                ]
+                }
+        };
+    },
+    methods: {
+        openDialog: function (platform, callback) {
+            this.showDialog = true;
+            this.listChangeCallback = callback;
+            if (platform != null) {
+                this.platform = platform;
+                this.onSubmit_text = "淇濆瓨"
+            }
+            
+        },
+        onSubmit: function () {
+            console.log('onSubmit');
+            var that = this;
+            that.$axios.post(`/api/platforms/save`, that.platform)
+                .then(function (res) {
+                    console.log(res)
+                    console.log(res.data == "success")
+                    if (res.data == "success") {
+                        that.$message({
+                            showClose: true,
+                            message: '淇濆瓨鎴愬姛',
+                            type: 'success'
+                        });
+                        that.showDialog = false;
+                        if (that.listChangeCallback != null) {
+                            that.listChangeCallback()
+                        }
+                    }
+                })
+                .catch(function (error) {
+                    console.log(error);
+                });
+        },
+        close: function () {
+            console.log('鍏抽棴娣诲姞瑙嗛骞冲彴');
+            this.showDialog = false;
+            this.$refs.platform1.resetFields();
+            this.$refs.platform2.resetFields();
+            
+        }
+
+    }
+};
+</script>
+
+<style>
+.control-wrapper {
+    position: relative;
+    width: 6.25rem;
+    height: 6.25rem;
+    max-width: 6.25rem;
+    max-height: 6.25rem;
+    border-radius: 100%;
+    margin-top: 2.5rem;
+    margin-left: 0.5rem;
+    float: left;
+}
+
+.control-panel {
+    position: relative;
+    top: 0;
+    left: 5rem;
+    height: 11rem;
+    max-height: 11rem;
+}
+
+.control-btn {
+    display: flex;
+    justify-content: center;
+    position: absolute;
+    width: 44%;
+    height: 44%;
+    border-radius: 5px;
+    border: 1px solid #78aee4;
+    box-sizing: border-box;
+    transition: all 0.3s linear;
+}
+
+.control-btn i {
+    font-size: 20px;
+    color: #78aee4;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+}
+
+.control-round {
+    position: absolute;
+    top: 21%;
+    left: 21%;
+    width: 58%;
+    height: 58%;
+    background: #fff;
+    border-radius: 100%;
+}
+
+.control-round-inner {
+    position: absolute;
+    left: 13%;
+    top: 13%;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    width: 70%;
+    height: 70%;
+    font-size: 40px;
+    color: #78aee4;
+    border: 1px solid #78aee4;
+    border-radius: 100%;
+    transition: all 0.3s linear;
+}
+
+.control-inner-btn {
+    position: absolute;
+    width: 60%;
+    height: 60%;
+    background: #fafafa;
+}
+
+.control-top {
+    top: -8%;
+    left: 27%;
+    transform: rotate(-45deg);
+    border-radius: 5px 100% 5px 0;
+}
+
+.control-top i {
+    transform: rotate(45deg);
+    border-radius: 5px 100% 5px 0;
+}
+
+.control-top .control-inner {
+    left: -1px;
+    bottom: 0;
+    border-top: 1px solid #78aee4;
+    border-right: 1px solid #78aee4;
+    border-radius: 0 100% 0 0;
+}
+
+.control-top .fa {
+    transform: rotate(45deg) translateY(-7px);
+}
+
+.control-left {
+    top: 27%;
+    left: -8%;
+    transform: rotate(45deg);
+    border-radius: 5px 0 5px 100%;
+}
+
+.control-left i {
+    transform: rotate(-45deg);
+}
+
+.control-left .control-inner {
+    right: -1px;
+    top: -1px;
+    border-bottom: 1px solid #78aee4;
+    border-left: 1px solid #78aee4;
+    border-radius: 0 0 0 100%;
+}
+
+.control-left .fa {
+    transform: rotate(-45deg) translateX(-7px);
+}
+
+.control-right {
+    top: 27%;
+    right: -8%;
+    transform: rotate(45deg);
+    border-radius: 5px 100% 5px 0;
+}
+
+.control-right i {
+    transform: rotate(-45deg);
+}
+
+.control-right .control-inner {
+    left: -1px;
+    bottom: -1px;
+    border-top: 1px solid #78aee4;
+    border-right: 1px solid #78aee4;
+    border-radius: 0 100% 0 0;
+}
+
+.control-right .fa {
+    transform: rotate(-45deg) translateX(7px);
+}
+
+.control-bottom {
+    left: 27%;
+    bottom: -8%;
+    transform: rotate(45deg);
+    border-radius: 0 5px 100% 5px;
+}
+
+.control-bottom i {
+    transform: rotate(-45deg);
+}
+
+.control-bottom .control-inner {
+    top: -1px;
+    left: -1px;
+    border-bottom: 1px solid #78aee4;
+    border-right: 1px solid #78aee4;
+    border-radius: 0 0 100% 0;
+}
+
+.control-bottom .fa {
+    transform: rotate(-45deg) translateY(7px);
+}
+</style>
diff --git a/web_src/src/router/index.js b/web_src/src/router/index.js
index fa4df8c..73a5781 100644
--- a/web_src/src/router/index.js
+++ b/web_src/src/router/index.js
@@ -37,7 +37,7 @@
       component: channelList,
     },,
     {
-      path: '/parentPlatformList/:platformId/:count/:page',
+      path: '/parentPlatformList/:count/:page',
       name: 'parentPlatformList',
       component: parentPlatformList,
     },

--
Gitblit v1.8.0