From 929cf4c7be11bfd1e134d0cb0d7cbbe94772ebdf Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@iotlink.com>
Date: 星期一, 07 九月 2020 15:35:14 +0800
Subject: [PATCH] 摄像机树增加导入功能

---
 src/pages/settings/components/BasicSetting.vue |  461 ++++++++-------------------------------------------------
 1 files changed, 66 insertions(+), 395 deletions(-)

diff --git a/src/pages/settings/components/BasicSetting.vue b/src/pages/settings/components/BasicSetting.vue
index 5806be8..34573a2 100644
--- a/src/pages/settings/components/BasicSetting.vue
+++ b/src/pages/settings/components/BasicSetting.vue
@@ -5,6 +5,7 @@
       v-model="activeName"
       v-loading="loading"
       :element-loading-text="loadingText"
+      type="border-card"
     >
       <!-- 鏈満淇℃伅 -->
       <el-tab-pane label="鏈満淇℃伅" name="first">
@@ -75,7 +76,7 @@
             <template slot="title">
               <b class="tree-font">璇︾粏淇℃伅</b>
             </template>
-            <el-menu-item-group class="item-group">
+            <el-menu-item-group class="item-group desc-info">
               <el-row :gutter="gutter">
                 <el-col :span="12" class="flex-box">
                   <div class="xiangqin-label">ID</div>
@@ -158,102 +159,7 @@
             </el-menu-item-group>
           </el-submenu>
           <!-- 瀵瑰鏈嶅姟IP 鏀瑰悕涓哄閮ㄧ綉缁�(鏂皌ab)-->
-          
-          <!-- 鏂囦欢闊宠棰� -->
-          <!-- <el-submenu index="4">
-            <template slot="title">
-              <b class="tree-font">鏂囦欢闊宠棰�</b>
-            </template>
-            <el-menu-item-group class="item-group">
-              <el-row :gutter="20">
-                <el-col :span="8">
-                  <div class="p5">
-                    <span class="iconfont iconpicture" style="margin-right: 5px;"></span>
-                    <span class="mr10">鍥剧墖绔彛</span>
-                    <el-input v-model="localFile.picPort" style="width:300px;" placeholder="璇疯緭鍏ュ唴瀹�"></el-input>
-                  </div>
-                  <div class="p5">
-                    <span class="iconfont iconshipin" style="margin-right: 5px;"></span>
-                    <span class="mr10">瑙嗛绔彛</span>
-                    <el-input v-model="localFile.videoPort" style="width:300px;" placeholder="璇疯緭鍏ュ唴瀹�"></el-input>
-                  </div>
-                  <div class="p5">
-                    <span class="iconfont iconyinpinx" style="margin-right: 5px;"></span>
-                    <span class="mr10">闊抽绔彛</span>
-                    <el-input v-model="localFile.audioPort" style="width:300px;" placeholder="璇疯緭鍏ュ唴瀹�"></el-input>
-                  </div>
-                </el-col>
-                <el-col :span="16">
-                  <el-table
-                    :data="localFile.fileTable"
-                    border
-                    style="width: 100%">
-                    <el-table-column
-                      type="index"
-                      label="搴忓彿"
-                      align="center"
-                      width="50">
-                    </el-table-column>
-                    <el-table-column
-                      prop="date"
-                      label="鍚嶇О"
-                      align="center"
-                      width="180">
-                    </el-table-column>
-                    <el-table-column
-                      prop="name"
-                      label="ID"
-                      align="center"
-                      width="180">
-                    </el-table-column>
-                    <el-table-column
-                      prop="name"
-                      label="IP"
-                      align="center"
-                      width="180">
-                    </el-table-column>
-                    <el-table-column
-                      prop="name"
-                      label="鍦ㄧ嚎鐘舵��"
-                      align="center"
-                      width="80">
-                    </el-table-column>
-                    <el-table-column
-                      label="绫诲埆"
-                      align="center"
-                      width="100">
-                      <template>
-                        <span class="iconfont iconpicture" style="margin-right: 5px;"></span>
-                        <span class="iconfont iconshipin" style="margin-right: 5px;"></span>
-                        <span class="iconfont iconyinpinx" style="margin-right: 5px;"></span>
-                      </template>
-                    </el-table-column>
-                    <el-table-column
-                      prop="address"
-                      align="center"
-                      label="澶囨敞">
-                      <template slot-scope="{row}">
-                        <div v-if="row.edit">
-                          <el-input :autofocus="row.edit" v-focus v-model="row.address" size="small" />
-                          <el-button size="mini" type="info" @click="handleCancel(row)">鍙栨秷</el-button>
-                          <el-button size="mini" type="primary" @click="handleSave(row)">淇濆瓨</el-button>
-                        </div>
-                        <div v-else>
-                          <span>{{ row.address }}</span>
-                          <el-button
-                            type="text"
-                            style="color: black;font-size:16px"
-                            @click="handleEdit(row)"
-                            icon="iconfont iconbianji"
-                          ></el-button>
-                        </div>
-                      </template>
-                    </el-table-column>
-                  </el-table>
-                </el-col>
-              </el-row>
-            </el-menu-item-group>
-          </el-submenu>-->
+
         </el-menu>
       </el-tab-pane>
 
@@ -350,181 +256,52 @@
       <el-tab-pane label="闆嗙兢绠$悊" name="third">
         <cluster-management></cluster-management>
       </el-tab-pane>
-      <el-tab-pane label="澶栭儴缃戠粶" name="fourth">
-        <el-row :gutter="20">
-          <el-col :span="10">
-            <div>
-              <div class="flex-box">
-                <div style="line-height:32px;">
-                  <el-radio v-model="ipServer.diyOrLocalIP" :label="1">璁剧疆澶栭儴IP</el-radio>
-                  <el-radio v-model="ipServer.diyOrLocalIP" :label="0">閫夌敤鏈満IP</el-radio>
+      <el-tab-pane label="澶栭儴璁块棶" name="fourth">
+        <el-menu
+          :default-openeds="openeds"
+          background-color="#fff"
+          text-color="#303133"
+          active-text-color="#409EFF"
+          style="height: 100%;"
+          class="menu-css"
+          @open="menuOpen"
+          @close="menuClose"
+        >
+          <el-submenu index="0">
+            <template slot="title">
+              <b class="tree-font">澶栭儴璁块棶璁剧疆</b>
+            </template>
+            <el-menu-item-group class="item-group">
+              <el-form :model="sysinfo" :rules="rules" ref="sysinfo" label-width="100px">
+                <div class="flex-box">
+                  <label>璁剧疆澶栭儴IP</label>
+                  <div style="width:300px;">
+                    <ip-input :ip="ipServer.ip" @on-blur="ipServer.ip = arguments[0]"></ip-input>
+                  </div>
+                  <el-checkbox label="閫夌敤鏈満IP" size="small" style="margin-left: 20px"></el-checkbox>
                 </div>
-                <div class="ml10" style="width:205px;">
-                  <ip-input :ip="ipServer.ip" @on-blur="ipServer.ip = arguments[0]"></ip-input>
+                <div class="flex-box">
+                  <label>鍩熷悕</label>
+                  <el-input size="small" v-model="ipServer.localhost"></el-input>
                 </div>
-              </div>
-              <div class="flex-box p5" >
-                <span style="line-height:32px;">鍩熷悕</span>
-                <div style="margin-left:14px;width:205px;">
-                  <el-input size="small" style v-model="ipServer.localhost"></el-input>
+                <div class="flex-box">
+                  <label>鏈湴鏂囦欢绔彛</label>
+                  <el-input size="small" v-model="ipServer.localFilePort"></el-input>
                 </div>
-              </div>
-              <div class="flex-box" >
-                <span style="line-height:32px;">鏈湴鏂囦欢绔彛</span>
-                <div style="margin-left:14px;width:205px;">
-                  <el-input size="small" style v-model="ipServer.localFilePort"></el-input>
+                <div class="mt15 mb10 save-btn">
+                  <el-button type="primary" @click="submitSysinfo" size="small">淇濆瓨</el-button>
                 </div>
-              </div>
-            </div>
-          </el-col>
-          <!-- <el-col :span="14">
-            <div>
-              <el-table
-                :data="ipServer.fileTable"
-                border
-                fit
-                style="width: 100%">
-                <el-table-column
-                  type="index"
-                  label="搴忓彿"
-                  align="center"
-                  width="50">
-                </el-table-column>
-                <el-table-column
-                  prop="date"
-                  label="鍚嶇О"
-                  align="center"
-                  >
-                </el-table-column>
-                <el-table-column
-                  prop="name"
-                  label="ID"
-                  align="center"
-                  >
-                </el-table-column>
-                <el-table-column
-                  prop="name"
-                  label="IP"
-                  align="center"
-                  >
-                </el-table-column>
-                <el-table-column
-                  prop="name"
-                  label="鍦ㄧ嚎鐘舵��"
-                  align="center"
-                  >
-                </el-table-column>
-              </el-table>
-            </div>
-          </el-col>-->
-        </el-row>
-        <div class="mt15 save-btn" style="width:1000px;float:left;">
-          <el-button type="primary" @click="submitResource" size="small">淇濆瓨</el-button>
-        </div>
+              </el-form>
+            </el-menu-item-group>
+          </el-submenu>
+        
+        </el-menu>
       </el-tab-pane>
-      <el-tab-pane label="鏉冮檺绠$悊" name="user" >
+      <el-tab-pane label="鏉冮檺绠$悊" name="user">
         <authority-management v-if="activeName === 'user'"></authority-management>
       </el-tab-pane>
-      <el-tab-pane label="骞挎挱璁剧疆" name="radio" >
+      <el-tab-pane label="骞挎挱璁剧疆" name="radio">
         <radio-set v-if="activeName === 'radio'"></radio-set>
-      </el-tab-pane>
-      <!-- GB28181璁剧疆 -->
-      <el-tab-pane label="GB28181璁剧疆" name="fifth">
-        <el-form
-          :model="gb28181"
-          :rules="rules"
-          label-width="140px"
-          class="alarmSetting"
-          ref="gb28181"
-        >
-          <!-- <el-form-item label="鍥介檯鏈嶅姟鍣↖P" prop="ServerIp">
-            <ip-input :ip="gb28181.ServerIp" @on-blur="gb28181.ServerIp = arguments[0]"></ip-input>
-          </el-form-item>-->
-
-          <div style="text-align: left;margin-bottom: 22px;">
-            <el-radio-group v-model="gb28181.idType">
-              <el-radio :label="0">杈撳叆宸叉湁ID</el-radio>
-              <el-radio :label="1">鐢熸垚鏂扮殑ID</el-radio>
-            </el-radio-group>
-          </div>
-
-          <el-form-item label="鎵�鍦ㄥ湴">
-            <el-select
-              v-model="locationCity.province"
-              @change="changeProvince"
-              size="small"
-              placeholder="璇烽�夋嫨鐪佷唤"
-            >
-              <el-option
-                v-for="item in locationCity.provinceOptions"
-                :key="item.id"
-                :label="item.name"
-                size="small"
-                :value="item.id"
-              ></el-option>
-            </el-select>
-            <el-select
-              class="ml10 mr10"
-              v-model="locationCity.city"
-              :disabled="!locationCity.province"
-              @change="changeCity"
-              size="small"
-              placeholder="璇烽�夋嫨鍩庡競"
-            >
-              <el-option
-                v-for="item in locationCity.cityOptions"
-                :key="item.id"
-                :label="item.name"
-                :value="item.id"
-              ></el-option>
-            </el-select>
-            <el-select
-              v-model="locationCity.county"
-              :disabled="!locationCity.city"
-              size="small"
-              placeholder="璇烽�夋嫨鍖哄幙"
-            >
-              <el-option
-                v-for="item in locationCity.countyOptions"
-                :key="item.id"
-                :label="item.name"
-                :value="item.id"
-              ></el-option>
-            </el-select>
-            <el-button
-              type="text"
-              style="position: absolute"
-              v-show="gb28181.idType === 1"
-              @click="newGBID"
-            >鐢熸垚ID</el-button>
-          </el-form-item>
-
-          <!-- <el-form-item label="鍥介檯鏈嶅姟鍣ㄧ鍙�" prop="GbServerPort">
-            <el-input v-model.number="gb28181.ServerPort" placeholder="璇疯緭鍏�" size="small"></el-input>
-          </el-form-item>-->
-
-          <el-form-item label="鍥芥爣ID">
-            <el-input v-model="gb28181.PublicId" placeholder="璇疯緭鍏�" size="small"></el-input>
-          </el-form-item>
-
-          <el-form-item label="鍥芥爣绔彛" prop="ServerPort">
-            <el-input v-model.number="gb28181.GbServerPort" placeholder="璇疯緭鍏�" size="small"></el-input>
-          </el-form-item>
-
-          <el-form-item label="寮�鍚壌鏉�">
-            <el-switch v-model="gb28181.IsAuth"></el-switch>
-          </el-form-item>
-
-          <el-form-item label="閴存潈瀵嗙爜" v-show="gb28181.IsAuth">
-            <el-input v-model="gb28181.Password" placeholder="璇疯緭鍏�" size="small"></el-input>
-          </el-form-item>
-
-          <el-col :span="12">
-            <el-form-item>
-              <el-button type="primary" @click="submitGB28281" size="small">淇濆瓨</el-button>
-            </el-form-item>
-          </el-col>
-        </el-form>
       </el-tab-pane>
     </el-tabs>
   </div>
@@ -534,17 +311,13 @@
 import {
   getDevInfo,
   getAlarmConfig,
-  getGB28181Config,
   saveDevInfo,
   saveAlarmConfig,
-  saveGB28181Config,
   getClockInfo,
   saveClockInfo,
   testNTPserver,
   getResourceConfig,
   saveResourceConfig,
-  getGb28181AreaList,
-  newGb28181ID
 } from "@/api/system";
 
 import { isPort, isIPv4 } from "@/scripts/validate";
@@ -600,7 +373,6 @@
       timestamp: 0,
       sysinfo: {},
       alarmConf: {},
-      gb28181: {},
       originNetConfig: {
         ip: "",
         gw: "",
@@ -674,29 +446,6 @@
         ip: "",
         localhost: "",
         localFilePort: "",
-        fileTable: [
-          {
-            date: '2016-05-02',
-            name: '鐜嬪皬铏�',
-            address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1518 寮�',
-            edit: false
-          }, {
-            date: '2016-05-04',
-            name: '鐜嬪皬铏�',
-            address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1517 寮�',
-            edit: false
-          }, {
-            date: '2016-05-01',
-            name: '鐜嬪皬铏�',
-            address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�',
-            edit: false
-          }, {
-            date: '2016-05-03',
-            name: '鐜嬪皬铏�',
-            address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1516 寮�',
-            edit: false
-          }
-        ]
       },
       locationCity: {
         province: '',
@@ -714,7 +463,6 @@
       this.initSysinfo();
       // this.initAlarmConf();
       this.initResourceConfig();
-      this.initGB28181Conf();
       this.initClockConf();
     });
   },
@@ -785,19 +533,6 @@
           this.ipServer.ip = rsp.data.serviceIp
           this.ipServer.localhost = rsp.data.domain
           this.ipServer.localFilePort = rsp.data.filePort
-        }
-      })
-    },
-    initGB28181Conf() {
-      getGB28181Config().then(rsp => {
-        if (rsp && rsp.success) {
-          this.gb28181 = rsp.data;
-          this.gb28181.idType = 0;
-        }
-      });
-      getGb28181AreaList().then(rsp => {
-        if (rsp && rsp.success) {
-          this.locationCity.provinceOptions = rsp.data;
         }
       })
     },
@@ -981,23 +716,6 @@
         }
       })
     },
-    submitGB28281() {
-      this.$refs["gb28181"].validate(valid => {
-        if (valid) {
-          saveGB28181Config(this.gb28181).then(rsp => {
-            if (rsp && rsp.success) {
-              this.$notify({
-                type: "success",
-                message: "GB28181璁剧疆淇濆瓨鎴愬姛"
-              });
-            }
-          });
-        } else {
-          console.log("error submit!!");
-          return false;
-        }
-      });
-    },
     onIpBlur(e, ip) {
       console.log(e, ip);
     },
@@ -1052,33 +770,6 @@
       let re = /^(?=^.{3,255}$)(http(s)?:\/\/)?(www\.)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\d+)*(\/\w+\.\w+)*$/
       return re.test(str)
     },
-    changeProvince() {
-      let pid = this.locationCity.province;
-      getGb28181AreaList({ parentId: pid }).then(rsp => {
-        if (rsp && rsp.success) {
-          this.locationCity.cityOptions = rsp.data;
-          this.locationCity.city = this.locationCity.cityOptions[0].id;
-          this.changeCity();
-        }
-      })
-    },
-    changeCity() {
-      let pid = this.locationCity.city;
-      getGb28181AreaList({ parentId: pid }).then(rsp => {
-        if (rsp && rsp.success) {
-          this.locationCity.countyOptions = rsp.data;
-          this.locationCity.county = this.locationCity.countyOptions[0].id;
-        }
-      })
-    },
-    newGBID() {
-      let cCode = this.locationCity.county + "";
-      newGb28181ID({ code: cCode }).then(rsp => {
-        if (rsp && rsp.success) {
-          this.gb28181.PublicId = rsp.data;
-        }
-      })
-    }
   }
 };
 </script>
@@ -1088,10 +779,13 @@
   height: 100%;
   .el-form {
     width: 1000px;
-    margin-top: 30px;
+
     // margin-left: -80px;
     .el-form-item {
       text-align: left;
+      &.is-required:not(.is-no-asterisk)>.el-form-item__label:before{
+        margin-left:-8px;
+      }
       .el-button {
         float: right;
       }
@@ -1148,49 +842,6 @@
     font-weight: 600;
     background-color: #e4e6ed;
   }
-  #e-basic-setting {
-    .el-tabs__header {
-      border: 0px solid #dcdfe6;
-      .el-tabs__item {
-        padding: 5px 50px;
-        height: 50px;
-        font-family: PingFangSC-Regular;
-        font-size: 14px;
-        color: #222222;
-        text-align: center;
-        border: 0px solid transparent;
-      }
-      .el-tabs__item:nth-child(2) {
-        padding-left: 50px;
-      }
-      .el-tabs__item:last-child {
-        padding-right: 50px;
-      }
-      .el-tabs__item.is-active {
-        color: #ff7733;
-        font-weight: bold;
-        // border-right-color: #fff;
-        // border-left-color: #fff;
-      }
-      .el-tabs__item:not(.is-disabled):hover {
-        color: #ff7733;
-      }
-    }
-    .el-tabs__active-bar {
-      background-color: #ff7733;
-    }
-    .xiangqin-label {
-      text-align: left;
-      width: 85px;
-      font-size: 14px;
-      line-height: 30px;
-    }
-    .xiangqing-info {
-      text-align: left;
-      font-size: 14px;
-      line-height: 30px;
-    }
-  }
 
   #cut_min_duration {
     .el-slider__bar {
@@ -1219,7 +870,7 @@
     list-style: none;
     position: relative;
     margin: 0;
-    padding-left: 0;
+    padding-left: 10px;
     background-color: #ffffff;
     .el-submenu__title {
       height: 35px;
@@ -1272,6 +923,26 @@
 }
 </style>
 <style lang="scss" scoped>
+.flex-box {
+  display: flex;
+  height: 50px;
+  label {
+    width: 120px;
+  }
+  .el-input {
+    width: 300px;
+  }
+}
+.desc-info{
+  margin-bottom: 14px;
+  .flex-box{
+    height: 40px;
+    line-height: 40px;
+    .xiangqin-label{
+      width: 80px;
+    }
+  }
+}
 .menu-css,
 .el-menu {
   border-right: none;

--
Gitblit v1.8.0