From 401524fb5661d57ffb2229d683fe4de85b65fd1c Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期四, 31 八月 2023 17:54:24 +0800
Subject: [PATCH] 生产管理看板+删不需要的文件

---
 src/pages/settings/components/BasicSetting.vue |  640 ++++++++++++++++++++++++++++++---------------------------
 1 files changed, 335 insertions(+), 305 deletions(-)

diff --git a/src/pages/settings/components/BasicSetting.vue b/src/pages/settings/components/BasicSetting.vue
index 604374d..985f4bc 100644
--- a/src/pages/settings/components/BasicSetting.vue
+++ b/src/pages/settings/components/BasicSetting.vue
@@ -14,7 +14,7 @@
           background-color="#fff"
           text-color="#303133"
           active-text-color="#409EFF"
-          style="height: 100%;"
+          style="height: 100%"
           class="menu-css"
           @open="menuOpen"
           @close="menuClose"
@@ -28,8 +28,15 @@
               <el-form :model="sysinfo" :rules="rules" ref="sysinfo" label-width="100px">
                 <el-row>
                   <el-col :span="12">
-                    <el-form-item label="鍚嶇О" prop="server_name">
+                    <el-form-item label="鏈嶅姟鍣ㄥ悕绉�" prop="server_name">
                       <el-input v-model="sysinfo.server_name" placeholder="鏈嶅姟鍣ㄥ悕绉�" size="small"></el-input>
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+                <el-row>
+                  <el-col :span="12">
+                    <el-form-item label="鍩熷悕" prop="server_name">
+                      <el-input v-model="sysinfo.server_domain" placeholder="WEB鏈嶅姟鍩熷悕" size="small"></el-input>
                     </el-form-item>
                   </el-col>
                   <el-col :span="12">
@@ -71,7 +78,6 @@
             </el-menu-item-group>
           </el-submenu>
 
-          <!-- 璇︾粏淇℃伅 -->
           <el-submenu index="1">
             <template slot="title">
               <b class="tree-font">璇︾粏淇℃伅</b>
@@ -80,7 +86,7 @@
               <el-row :gutter="gutter">
                 <el-col :span="12" class="flex-box">
                   <div class="xiangqin-label">璁惧ID</div>
-                  <div class="xiangqing-info">{{sysinfo.server_id}}</div>
+                  <div class="xiangqing-info">{{ sysinfo.server_id }}</div>
                 </el-col>
                 <!-- <el-col :span="12" class="flex-box">
                   <div class="xiangqin-label">璁惧缂栧彿</div>
@@ -88,39 +94,39 @@
                 </el-col>-->
                 <el-col :span="12" class="flex-box">
                   <div class="xiangqin-label">璁惧鍨嬪彿</div>
-                  <div class="xiangqing-info">{{sysinfo.deviceModel}}</div>
+                  <div class="xiangqing-info">{{ sysinfo.deviceModel }}</div>
                 </el-col>
                 <el-col :span="12" class="flex-box">
                   <div class="xiangqin-label">璁惧绫诲瀷</div>
-                  <div class="xiangqing-info">{{sysinfo.deviceDesc}}</div>
+                  <div class="xiangqing-info">{{ sysinfo.deviceDesc }}</div>
                 </el-col>
                 <el-col :span="12" class="flex-box">
                   <div class="xiangqin-label">閫氶亾涓暟</div>
-                  <div class="xiangqing-info">{{sysinfo.channelCount}}</div>
+                  <div class="xiangqing-info">{{ sysinfo.channelCount }}</div>
                 </el-col>
                 <el-col :span="12" class="flex-box">
                   <div class="xiangqin-label">涓绘帶鐗堟湰</div>
-                  <div class="xiangqing-info">{{sysinfo.masterVersion}}</div>
+                  <div class="xiangqing-info">{{ sysinfo.masterVersion }}</div>
                 </el-col>
                 <el-col :span="12" class="flex-box">
                   <div class="xiangqin-label">web鐗堟湰</div>
-                  <div class="xiangqing-info">{{sysinfo.webVersion}}</div>
+                  <div class="xiangqing-info">{{ sysinfo.webVersion }}</div>
                 </el-col>
                 <el-col :span="12" class="flex-box">
                   <div class="xiangqin-label">纭洏淇℃伅</div>
-                  <div class="xiangqing-info">{{sysinfo.disks}}</div>
+                  <div class="xiangqing-info">{{ sysinfo.disks }}</div>
                 </el-col>
                 <el-col :span="12" class="flex-box">
                   <div class="xiangqin-label">CPU</div>
-                  <div class="xiangqing-info">{{sysinfo.cpuInfo}}</div>
+                  <div class="xiangqing-info">{{ sysinfo.cpuInfo }}</div>
                 </el-col>
                 <el-col :span="12" class="flex-box">
                   <div class="xiangqin-label">鍐呭瓨</div>
-                  <div class="xiangqing-info">{{sysinfo.mem}}</div>
+                  <div class="xiangqing-info">{{ sysinfo.mem }}</div>
                 </el-col>
                 <el-col :span="12" class="flex-box">
                   <div class="xiangqin-label">杩愯鏃堕棿</div>
-                  <div class="xiangqing-info">{{sysinfo.uptime}}</div>
+                  <div class="xiangqing-info">{{ sysinfo.uptime }}</div>
                 </el-col>
               </el-row>
             </el-menu-item-group>
@@ -131,38 +137,50 @@
               <b class="tree-font">浜嬩欢褰曞儚鏃堕暱</b>
             </template>
             <el-menu-item-group class="item-group">
-              <el-form
-                label-width="150px"
-                class="alarmSetting"
-                style="padding-left:5px;padding-right:5px;"
-              >
-                <el-form-item label="瑙嗛鎴彇鏈�鐭椂闀�" style="width:724px;">
+              <el-form label-width="150px" class="alarmSetting" style="padding-left: 5px; padding-right: 5px">
+                <el-form-item label="瑙嗛鎴彇鏈�鐭椂闀�" style="width: 724px">
                   <el-slider
                     id="cut_min_duration"
-                    v-model="alarmConf.min_video_len"
-                    :show-tooltip="false"
+                    @input="min_len = min_video_len"
+                    v-model="fakeObj.min"
+                    :min="5 / 1.2"
+                    :max="100"
+                    :step="5 / 1.2"
+                    show-stops
+                    :show-tooltip="true"
+                    :format-tooltip="formatTooltip"
                   ></el-slider>
                   <el-input-number
-                    v-model="alarmConf.min_video_len"
+                    v-model="min_len"
+                    @change="fakeObj.min = +(min_len / 1.2)"
                     controls-position="right"
-                    :min="0"
-                    :max="100"
+                    :min="5"
+                    :max="120"
                     size="small"
-                  ></el-input-number>&nbsp;s
+                  ></el-input-number
+                  >&nbsp;s
                 </el-form-item>
-                <el-form-item label="瑙嗛鎴彇鏈�闀挎椂闀�" style="width:724px">
+                <el-form-item label="瑙嗛鎴彇鏈�闀挎椂闀�" style="width: 724px">
                   <el-slider
                     id="cut_max_duration"
-                    v-model="alarmConf.max_video_len"
-                    :show-tooltip="false"
+                    v-model="fakeObj.max"
+                    :min="5 / 1.2"
+                    @input="max_len = max_video_len"
+                    :max="100"
+                    :step="5 / 1.2"
+                    show-stops
+                    :format-tooltip="formatTooltip"
+                    :show-tooltip="true"
                   ></el-slider>
                   <el-input-number
-                    v-model="alarmConf.max_video_len"
+                    v-model="max_len"
+                    @change="fakeObj.max = +(max_len / 1.2)"
                     controls-position="right"
-                    :min="0"
-                    :max="100"
+                    :min="5"
+                    :max="120"
                     size="small"
-                  ></el-input-number>&nbsp;s
+                  ></el-input-number
+                  >&nbsp;s
                 </el-form-item>
                 <div class="mt15 mb10 save-btn">
                   <el-button type="primary" @click="submitAlarm" size="small">淇濆瓨</el-button>
@@ -180,22 +198,18 @@
           <el-form-item label="璁惧鏃堕棿">
             {{ equipmentTime }}
           </el-form-item>
-          <div style="text-align: left;padding: 10px 0px">
+          <div style="text-align: left; padding: 10px 0px">
             <div class="time-type">NTP鏍℃椂</div>
-            <div style="padding: 10px 0px;">
+            <div style="padding: 10px 0px">
               <el-radio v-model="syncType" label="1">NTP鏍℃椂</el-radio>
             </div>
           </div>
 
           <el-form-item label="鏈嶅姟鍣ㄥ湴鍧�">
-            <ip-input
-              :ip="ntpServer"
-              @on-blur="ntpServer= arguments[0]"
-              :disabled="syncType === '2'"
-            ></ip-input>
+            <ip-input :ip="ntpServer" @on-blur="ntpServer = arguments[0]" :disabled="syncType === '2'"></ip-input>
           </el-form-item>
 
-          <el-form-item label="鏍℃椂鏃堕棿闂撮殧" style="width: 41.3%;">
+          <el-form-item label="鏍℃椂鏃堕棿闂撮殧" style="width: 41.3%">
             <el-input-number
               v-model.number="timeInterval"
               :min="1"
@@ -204,19 +218,21 @@
               size="small"
               :controls="false"
               :disabled="syncType === '2'"
-            ></el-input-number>&nbsp;&nbsp;&nbsp;鍒嗛挓
+            ></el-input-number
+            >&nbsp;&nbsp;&nbsp;鍒嗛挓
             <el-button
               type="text"
-              style="position: absolute; left: 330px;"
+              style="position: absolute; left: 330px"
               :disabled="syncType === '2'"
               @click="testNTP"
               :loading="ntpTestLoading"
-            >娴嬭瘯</el-button>
+              >娴嬭瘯</el-button
+            >
           </el-form-item>
 
-          <div style="text-align: left;padding: 10px 0px">
+          <div style="text-align: left; padding: 10px 0px">
             <div class="time-type">鎵嬪姩鏍℃椂</div>
-            <div style="padding: 10px 0px;">
+            <div style="padding: 10px 0px">
               <el-radio v-model="syncType" label="2">鎵嬪姩鏍℃椂</el-radio>
             </div>
           </div>
@@ -232,13 +248,14 @@
             ></el-date-picker>
             <el-checkbox
               v-model="settimeRadio"
-              style="margin-left: 12px;"
+              style="margin-left: 12px"
               @change="syncBrowser"
               :disabled="syncType === '1'"
-            >鍚屾鏈绠楁満鏃堕棿</el-checkbox>
+              >鍚屾鏈绠楁満鏃堕棿</el-checkbox
+            >
           </el-form-item>
 
-          <el-col :span="12" style="padding-right: 40px;">
+          <el-col :span="12" style="padding-right: 40px">
             <el-form-item>
               <el-button type="primary" @click="submitClock" size="small">淇濆瓨</el-button>
             </el-form-item>
@@ -310,17 +327,17 @@
   saveClockInfo,
   testNTPserver,
   getResourceConfig,
-  saveResourceConfig,
-} from "@/api/system";
+  saveResourceConfig
+} from "@/api/system"
 
-import { isPort, isIPv4 } from "@/scripts/validate";
-import ipInput from "@/components/subComponents/IPInput";
+import { isPort, isIPv4 } from "@/scripts/validate"
+import ipInput from "@/components/subComponents/IPInput"
 import TimeZones from "@/Pool/TimeZones"
 
-import ClusterManagement from "./ClusterManagement";
-import AuthorityManagement from "./AuthorityManagement";
-import RadioSet from "./RadioSet";
-import config from '../../../../package.json'
+import ClusterManagement from "./ClusterManagement"
+import AuthorityManagement from "./AuthorityManagement"
+import RadioSet from "./RadioSet"
+import config from "../../../../package.json"
 
 export default {
   name: "BasicSettings",
@@ -331,31 +348,26 @@
     RadioSet
   },
   computed: {
-    // timeZoneOption() {
-    //   let options = []
-    //   TimeZones.forEach(zone => {
-    //     options = options.concat(zone.utc.map(v => {
-    //       return { value: v, label: v }
-    //     }))
-    //   })
-    //   return options
-    // },
-    isAdmin() {
-      if (
-        sessionStorage.getItem("userInfo") &&
-        sessionStorage.getItem("userInfo") !== ""
-      ) {
-        let loginName = JSON.parse(sessionStorage.getItem("userInfo")).username;
-        return loginName === "superadmin" || loginName === "basic";
-      }
-
-      return false;
+    min_video_len() {
+      // return +(this.fakeObj.min * 1.2).toFixed(0);
+      return Math.round(this.fakeObj.min * 1.2)
     },
+    max_video_len() {
+      return Math.round(this.fakeObj.max * 1.2)
+      // return +(this.fakeObj.max * 1.2).toFixed(0);
+    },
+    isAdmin() {
+      if (sessionStorage.getItem("userInfo") && sessionStorage.getItem("userInfo") !== "") {
+        let loginName = JSON.parse(sessionStorage.getItem("userInfo")).username
+        return loginName === "superadmin" || loginName === "basic"
+      }
+      return false
+    }
   },
   directives: {
     focus: {
-      inserted: function (el) {
-        el.querySelector('input').focus()
+      inserted: function(el) {
+        el.querySelector("input").focus()
       }
     }
   },
@@ -378,6 +390,12 @@
       timestamp: 0,
       sysinfo: {},
       alarmConf: {},
+      min_len: 0,
+      max_len: 0,
+      fakeObj: {
+        min: 0,
+        max: 0
+      },
       originNetConfig: {
         ip: "",
         gw: "",
@@ -433,9 +451,7 @@
           },
           { validator: isIPv4, trigger: "change" }
         ],
-        server_name: [
-          { required: true, message: "璇疯緭鍏ュ悕绉�", trigger: "change" }
-        ],
+        server_name: [{ required: true, message: "璇疯緭鍏ュ悕绉�", trigger: "change" }],
         subMask: [
           {
             required: true,
@@ -450,117 +466,123 @@
         diyOrLocalIP: "1",
         ip: "",
         localhost: "",
-        localFilePort: "",
+        localFilePort: ""
       },
       locationCity: {
-        province: '',
-        city: '',
-        county: '',
+        province: "",
+        city: "",
+        county: "",
         provinceOptions: [],
         cityOptions: [],
         countyOptions: []
       },
       webPort: 0,
       ntpTestLoading: false,
-      buttonAuthority: sessionStorage.getItem("buttonAuthoritys") || [],
-    };
+      buttonAuthority: sessionStorage.getItem("buttonAuthoritys") || []
+    }
   },
   created() {
     if (this.isShow("settings:sysInfo")) {
-      this.activeName = "sysInfo";
+      this.activeName = "sysInfo"
     } else if (this.isShow("settings:timeSet")) {
-      this.activeName = "timeSet";
+      this.activeName = "timeSet"
     } else if (this.isShow("settings:cluster")) {
-      this.activeName = "cluster";
+      this.activeName = "cluster"
     } else if (this.isShow("settings:permission")) {
-      this.activeName = "permission";
+      this.activeName = "permission"
     } else if (this.isShow("settings:broadcast")) {
-      this.activeName = "broadcast";
+      this.activeName = "broadcast"
     }
   },
   mounted() {
     this.$nextTick(() => {
-      this.initSysinfo();
+      this.initSysinfo()
       // this.initAlarmConf();
-      this.initResourceConfig();
-      this.initClockConf();
+      this.initResourceConfig()
+      this.initClockConf()
       //this.markStartTime();
-    });
+    })
   },
   beforeDestroy() {
-    clearTimeout(this.clockTimer);
-    clearInterval(this.browserTimer);
+    clearTimeout(this.clockTimer)
+    clearInterval(this.browserTimer)
   },
   methods: {
+    formatTooltip(v) {
+      return Math.round(v * 1.2)
+    },
     isShow(authority) {
       return this.isAdmin || this.buttonAuthority.indexOf("," + authority + ",") > -1
     },
     initSysinfo() {
-      this.loadingText = "姝e湪鑾峰彇璁惧淇℃伅...";
-      getDevInfo().then(rsp => {
-        if (rsp && rsp.success) {
-          this.sysinfo = rsp.data;
-          this.sysinfo.gateway = this.sysinfo.gateway.trim();
-          this.originNetConfig.ip = this.sysinfo.ip;
-          this.originNetConfig.mask = this.sysinfo.subMask;
-          this.originNetConfig.gw = this.sysinfo.gateway.trim();
-          this.originNetConfig.dns = this.sysinfo.dns ? this.sysinfo.dns : "";
-          this.alarmConf.min_video_len = rsp.data.min_video_len;
-          this.alarmConf.max_video_len = rsp.data.max_video_len;
+      this.loadingText = "姝e湪鑾峰彇璁惧淇℃伅..."
+      getDevInfo()
+        .then((rsp) => {
+          if (rsp && rsp.success) {
+            this.sysinfo = rsp.data
+            this.sysinfo.gateway = this.sysinfo.gateway.trim()
+            this.originNetConfig.ip = this.sysinfo.ip
+            this.originNetConfig.mask = this.sysinfo.subMask
+            this.originNetConfig.gw = this.sysinfo.gateway.trim()
+            this.originNetConfig.dns = this.sysinfo.dns ? this.sysinfo.dns : ""
+            // this.alarmConf.min_video_len = rsp.data.min_video_len;
+            // this.alarmConf.max_video_len = rsp.data.max_video_len;
+            this.fakeObj.min = rsp.data.min_video_len / 1.2
+            this.fakeObj.max = rsp.data.max_video_len / 1.2
+            if (this.sysinfo.deviceInfo) {
+              let devInfo = this.sysinfo.deviceInfo
 
-          if (this.sysinfo.deviceInfo) {
-            let devInfo = this.sysinfo.deviceInfo;
+              this.sysinfo.cpuInfo = devInfo.cpu[0].modelName
+              this.sysinfo.disks = "( " + devInfo.disk + ") "
+              this.sysinfo.mem = (devInfo.mem.total / 1024 / 1024 / 1024).toFixed(2) + "GB"
+              // this.sysinfo.arch = devInfo.host.kernelArch;
+              this.sysinfo.uptime = this.secondsFormat(devInfo.host.uptime)
+            }
 
-            this.sysinfo.cpuInfo = devInfo.cpu[0].modelName;
-            this.sysinfo.disks = "( " + devInfo.disk + ") ";
-            this.sysinfo.mem = (devInfo.mem.total / 1024 / 1024 / 1024).toFixed(2) + "GB";
-            // this.sysinfo.arch = devInfo.host.kernelArch;
-            this.sysinfo.uptime = this.secondsFormat(devInfo.host.uptime);
+            if (!this.sysinfo.server_port) {
+              this.sysinfo.server_port = 7003
+            }
+
+            this.webPort = this.sysinfo.server_port
+
+            this.sysinfo.webVersion = "V" + config.version
           }
 
-          if (!this.sysinfo.server_port) {
-            this.sysinfo.server_port = 7003;
-          }
-
-          this.webPort = this.sysinfo.server_port;
-
-          this.sysinfo.webVersion = 'V' + config.version;
-        }
-
-        this.loading = false;
-      }).catch(err => {
-        this.loading = false;
-      });
+          this.loading = false
+        })
+        .catch((err) => {
+          this.loading = false
+        })
     },
     secondsFormat(s) {
-      var day = Math.floor(s / (24 * 3600)); // Math.floor()鍚戜笅鍙栨暣 
-      var hour = Math.floor((s - day * 24 * 3600) / 3600);
-      var minute = Math.floor((s - day * 24 * 3600 - hour * 3600) / 60);
-      var second = s - day * 24 * 3600 - hour * 3600 - minute * 60;
-      return day + "澶�" + hour + "鏃�" + minute + "鍒�" + second + "绉�";
+      var day = Math.floor(s / (24 * 3600)) // Math.floor()鍚戜笅鍙栨暣
+      var hour = Math.floor((s - day * 24 * 3600) / 3600)
+      var minute = Math.floor((s - day * 24 * 3600 - hour * 3600) / 60)
+      var second = s - day * 24 * 3600 - hour * 3600 - minute * 60
+      return day + "澶�" + hour + "鏃�" + minute + "鍒�" + second + "绉�"
     },
     initClockConf(ntpTest = false) {
-      getClockInfo().then(rsp => {
+      getClockInfo().then((rsp) => {
         if (rsp && rsp.success) {
-          this.timezone = rsp.data.time_zone;
+          this.timezone = rsp.data.time_zone
           if (!ntpTest) {
-            this.syncType = rsp.data.ntp ? "1" : "2";
+            this.syncType = rsp.data.ntp ? "1" : "2"
           }
           if (rsp.data.ntp) {
-            this.ntpServer = rsp.data.ntp_server;
-            this.timeInterval = rsp.data.interval;
+            this.ntpServer = rsp.data.ntp_server
+            this.timeInterval = rsp.data.interval
           }
           this.timestamp = rsp.data.local_time
           if (this.clockTimer === null) {
-            this.runClock();
+            this.runClock()
           }
         }
       })
     },
     runClock() {
-      this.equipmentTime = this.formatTime(++this.timestamp, 'Y-M-D h:m:s');
+      this.equipmentTime = this.formatTime(++this.timestamp, "Y-M-D h:m:s")
       this.clockTimer = setTimeout(() => {
-        this.runClock();
+        this.runClock()
       }, 1000)
     },
     initAlarmConf() {
@@ -571,7 +593,7 @@
       // });
     },
     initResourceConfig() {
-      getResourceConfig().then(rsp => {
+      getResourceConfig().then((rsp) => {
         if (rsp && rsp.success) {
           this.ipServer.diyOrLocalIP = rsp.data.ipType
           this.ipServer.ip = rsp.data.serviceIp
@@ -585,250 +607,258 @@
         clearInterval(this.browserTimer)
       } else {
         this.browserTimer = setInterval(() => {
-          let timestamp = new Date().getTime() / 1000;
-          this.settime = this.formatTime(timestamp, 'Y-M-D h:m:s')
+          let timestamp = new Date().getTime() / 1000
+          this.settime = this.formatTime(timestamp, "Y-M-D h:m:s")
         }, 1000)
       }
     },
     markStartTime() {
-      let timestamp = new Date().getTime() / 1000;
-      this.settime = this.formatTime(timestamp, 'Y-M-D h:m:s')
+      let timestamp = new Date().getTime() / 1000
+      this.settime = this.formatTime(timestamp, "Y-M-D h:m:s")
     },
     submitSysinfo() {
-      this.$refs["sysinfo"].validate(valid => {
+      this.$refs["sysinfo"].validate((valid) => {
         if (valid) {
-          if (this.sysinfo.ip !== this.originNetConfig.ip
-            || this.sysinfo.subMask !== this.originNetConfig.mask
-            || this.sysinfo.dns !== this.originNetConfig.dns
-            || this.sysinfo.gateway !== this.originNetConfig.gw) {
-
+          if (
+            this.sysinfo.ip !== this.originNetConfig.ip ||
+            this.sysinfo.subMask !== this.originNetConfig.mask ||
+            this.sysinfo.dns !== this.originNetConfig.dns ||
+            this.sysinfo.gateway !== this.originNetConfig.gw ||
+            this.sysinfo.server_port !== this.originNetConfig.server_port ||
+            this.sysinfo.server_domain !== this.originNetConfig.server_domain
+          ) {
             if (this.sysinfo.ip !== this.originNetConfig.ip) {
-              let newUri = location.protocol + "//" + this.sysinfo.ip + ":" + this.sysinfo.server_port;
+              let newUri = location.protocol + "//" + this.sysinfo.ip + ":" + this.sysinfo.server_port
               var changeIPTimer = setTimeout(() => {
-                this.$alert('<strong>鎮ㄥ凡淇敼浜嗘湇鍔″櫒ip, 璇烽噸鏂扮櫥褰�</strong><a target="_parent" href="' + newUri + '"> ' + newUri + '<a/>', '鎻愮ず', {
-                  dangerouslyUseHTMLString: true
-                });
+                this.$alert(
+                  '<strong>鎮ㄥ凡淇敼浜嗘湇鍔″櫒閰嶇疆, 璇烽噸鏂扮櫥褰�</strong><a target="_parent" href="' +
+                    newUri +
+                    '"> ' +
+                    newUri +
+                    "<a/>",
+                  "鎻愮ず",
+                  {
+                    dangerouslyUseHTMLString: true
+                  }
+                )
               }, 10000)
             }
 
-            this.$confirm("纭闇�瑕佷慨鏀规湇鍔″櫒缃戠粶閰嶇疆鍚楋紵", {
+            this.$confirm("纭闇�瑕佷慨鏀规湇鍔″櫒閰嶇疆鍚楋紵", {
               center: true,
               cancelButtonClass: "comfirm-class-cancle",
               confirmButtonClass: "comfirm-class-sure"
-            }).then(() => {
-              this.loading = true;
-              this.loadingText = "姝e湪澶勭悊..."
-              saveDevInfo(this.sysinfo).then(rsp => {
-                if (rsp && rsp.success) {
-                  this.$notify({
-                    type: "success",
-                    message: "鏈満淇℃伅淇濆瓨鎴愬姛"
-                  });
-                }
-                this.initSysinfo();
-                this.loading = false;
-              }).catch(err => {
-                this.loading = false;
-                clearTimeout(changeIPTimer)
-                this.$notify({
-                  type: "error",
-                  message: "淇濆瓨澶辫触"
-                });
-              });
-            }).catch(err => {
-            });
+            })
+              .then(() => {
+                this.loading = true
+                this.loadingText = "姝e湪澶勭悊..."
+                saveDevInfo(this.sysinfo)
+                  .then((rsp) => {
+                    if (rsp && rsp.success) {
+                      this.$notify({
+                        type: "success",
+                        message: "鏈嶅姟鍣ㄩ厤缃垚鍔�"
+                      })
+                    }
+                    this.initSysinfo()
+                    this.loading = false
+                  })
+                  .catch((err) => {
+                    this.loading = false
+                    clearTimeout(changeIPTimer)
+                    this.$notify({
+                      type: "error",
+                      message: "淇濆瓨澶辫触"
+                    })
+                  })
+              })
+              .catch((err) => {})
           } else {
-            saveDevInfo(this.sysinfo).then(rsp => {
+            saveDevInfo(this.sysinfo).then((rsp) => {
               if (rsp && rsp.success) {
                 this.$notify({
                   type: "success",
-                  message: "鏈満淇℃伅淇濆瓨鎴愬姛"
-                });
-                this.initSysinfo();
+                  message: "鏈満淇℃伅淇敼鎴愬姛"
+                })
+                this.initSysinfo()
+              } else {
+                this.$notify({
+                  type: "error",
+                  message: "淇濆瓨澶辫触"
+                })
               }
-            });
-
-            if (this.sysinfo.server_port !== this.webPort) {
-              let newUri = location.protocol + "//" + this.sysinfo.ip + ":" + this.sysinfo.server_port;
-              var changeIPTimer = setTimeout(() => {
-                this.$alert('<strong>鎮ㄥ凡淇敼浜嗘湇鍔″櫒绔彛, 璇烽噸鏂扮櫥褰�</strong><a target="_parent" href="' + newUri + '"> ' + newUri + '<a/>', '鎻愮ず', {
-                  dangerouslyUseHTMLString: true
-                });
-              }, 5000)
-            }
+            })
           }
         } else {
-          console.log("error submit!!");
-          return false;
+          console.log("error submit!!")
+          return false
         }
-      });
+      })
     },
-    checkTimeZone(val) {
-
-    },
+    checkTimeZone(val) {},
     submitClock() {
-      if (this.syncType === '1') {
+      if (this.syncType === "1") {
         if (this.ntpServer === "") {
           this.$notify({
             type: "error",
             message: "NTP 鏈嶅姟鍣ㄥ湴鍧�涓嶈兘涓虹┖"
-          });
+          })
           return false
         } else if (this.timeInterval === "") {
-          this.timeInterval = 1;
+          this.timeInterval = 1
         }
       } else {
         if (this.settime === "") {
           this.$notify({
             type: "error",
             message: "璁剧疆鏃堕棿涓嶈兘涓虹┖"
-          });
+          })
           return false
         }
       }
       let requestBody = {
         timeZone: this.timezone,
-        ntp: this.syncType === '1',
+        ntp: this.syncType === "1",
         ntpServer: this.ntpServer,
         interval: this.timeInterval,
         newTime: this.settime
       }
-      saveClockInfo(requestBody).then(rsp => {
+      saveClockInfo(requestBody).then((rsp) => {
         if (rsp && rsp.success) {
           this.$notify({
             type: "success",
             message: "璁剧疆鎴愬姛"
-          });
+          })
         }
-        this.initClockConf();
+        this.initClockConf()
       })
     },
     testNTP() {
-      this.ntpTestLoading = true;
-      testNTPserver({ server: this.ntpServer }).then(rsp => {
-        if (rsp && rsp.success) {
-          this.$notify({
-            type: "success",
-            message: "鏃堕棿鍚屾鎴愬姛"
-          });
-        } else {
+      this.ntpTestLoading = true
+      testNTPserver({ server: this.ntpServer })
+        .then((rsp) => {
+          if (rsp && rsp.success) {
+            this.$notify({
+              type: "success",
+              message: "鏃堕棿鍚屾鎴愬姛"
+            })
+          } else {
+            this.$notify({
+              type: "error",
+              message: "鏃堕棿鍚屾澶辫触"
+            })
+          }
+          this.ntpTestLoading = false
+          this.initClockConf(true)
+        })
+        .catch((err) => {
           this.$notify({
             type: "error",
-            message: "鏃堕棿鍚屾澶辫触"
-          });
-        }
-        this.ntpTestLoading = false;
-        this.initClockConf(true);
-
-      }).catch(err => {
-        this.$notify({
-          type: "error",
-          message: "鏃堕棿鍚屾澶辫触,璇锋鏌ユ湇鍔″櫒ip"
-        });
-        this.ntpTestLoading = false;
-      })
+            message: "鏃堕棿鍚屾澶辫触,璇锋鏌ユ湇鍔″櫒ip"
+          })
+          this.ntpTestLoading = false
+        })
     },
     submitAlarm() {
-      saveAlarmConfig(this.alarmConf).then(rsp => {
+      saveAlarmConfig({
+        min_video_len: this.min_video_len,
+        max_video_len: this.max_video_len
+      }).then((rsp) => {
         if (rsp && rsp.success) {
           this.$notify({
             type: "success",
             message: "淇濆瓨鎴愬姛"
-          });
-        }
-      });
-    },
-    submitResource() {
-      let regNum = /^[0-9]*$/;
-      if (!this.vaildHost(this.ipServer.localhost)) {
-        this.$notify({
-          type: "warning",
-          message: "璇疯緭鍏ユ纭牸寮忓緱鍩熷悕锛�"
-        })
-        return false;
-      }
-      if (!regNum.test(this.ipServer.localFilePort)) {
-        this.$notify({
-          type: 'warning',
-          message: "璇疯緭鍏ユ纭殑绔彛鍙凤紒"
-        })
-        return false;
-      }
-      saveResourceConfig({
-        domain: this.ipServer.localhost,
-        ipType: this.ipServer.diyOrLocalIP,
-        serviceIp: this.ipServer.ip,
-        filePort: Number(this.ipServer.localFilePort)
-      }).then(res => {
-        if (res && res.success) {
-          this.$notify({
-            type: "success",
-            message: "淇濆瓨鎴愬姛"
-          });
-        } else {
-          this.$notify({
-            type: "error",
-            message: "淇濆瓨澶辫触"
-          });
+          })
         }
       })
     },
-    onIpBlur(e, ip) {
-      console.log(e, ip);
-    },
+    // submitResource() {
+    //   let regNum = /^[0-9]*$/;
+    //   if (!this.vaildHost(this.ipServer.localhost)) {
+    //     this.$notify({
+    //       type: "warning",
+    //       message: "璇疯緭鍏ユ纭牸寮忓緱鍩熷悕锛�",
+    //     });
+    //     return false;
+    //   }
+    //   if (!regNum.test(this.ipServer.localFilePort)) {
+    //     this.$notify({
+    //       type: "warning",
+    //       message: "璇疯緭鍏ユ纭殑绔彛鍙凤紒",
+    //     });
+    //     return false;
+    //   }
+    //   saveResourceConfig({
+    //     domain: this.ipServer.localhost,
+    //     ipType: this.ipServer.diyOrLocalIP,
+    //     serviceIp: this.ipServer.ip,
+    //     filePort: Number(this.ipServer.localFilePort),
+    //   }).then((res) => {
+    //     if (res && res.success) {
+    //       this.$notify({
+    //         type: "success",
+    //         message: "淇濆瓨鎴愬姛",
+    //       });
+    //     } else {
+    //       this.$notify({
+    //         type: "error",
+    //         message: "淇濆瓨澶辫触",
+    //       });
+    //     }
+    //   });
+    // },
+    // onIpBlur(e, ip) {
+    //   console.log(e, ip);
+    // },
     formatTime(number, format) {
-      var formateArr = ['Y', 'M', 'D', 'h', 'm', 's'];
-      var returnArr = [];
+      var formateArr = ["Y", "M", "D", "h", "m", "s"]
+      var returnArr = []
 
-      var date = new Date(number * 1000);
-      returnArr.push(date.getFullYear());
-      returnArr.push(this.formatNumber(date.getMonth() + 1));
-      returnArr.push(this.formatNumber(date.getDate()));
+      var date = new Date(number * 1000)
+      returnArr.push(date.getFullYear())
+      returnArr.push(this.formatNumber(date.getMonth() + 1))
+      returnArr.push(this.formatNumber(date.getDate()))
 
-      returnArr.push(this.formatNumber(date.getHours()));
-      returnArr.push(this.formatNumber(date.getMinutes()));
-      returnArr.push(this.formatNumber(date.getSeconds()));
+      returnArr.push(this.formatNumber(date.getHours()))
+      returnArr.push(this.formatNumber(date.getMinutes()))
+      returnArr.push(this.formatNumber(date.getSeconds()))
 
       for (var i in returnArr) {
-        format = format.replace(formateArr[i], returnArr[i]);
+        format = format.replace(formateArr[i], returnArr[i])
       }
-      return format;
+      return format
     },
 
-    //鏁版嵁杞寲  
+    //鏁版嵁杞寲
     formatNumber(n) {
       n = n.toString()
-      return n[1] ? n : '0' + n
+      return n[1] ? n : "0" + n
     },
-    menuOpen(event) {
-
-    },
-    menuClose(event) {
-
-    },
-    handleEdit(row) {
-      console.log(row);
-      row.edit = true;
-    },
-    handleCancel(row) {
-      row.edit = false;
-      console.log(row);
-    },
-    handleSave(row) {
-      console.log(row);
-      row.edit = false;
-      this.$notify({
-        message: "淇濆瓨鎴愬姛",
-        type: "success"
-      });
-    },
+    menuOpen(event) {},
+    menuClose(event) {},
+    // handleEdit(row) {
+    //   console.log(row);
+    //   row.edit = true;
+    // },
+    // handleCancel(row) {
+    //   row.edit = false;
+    //   console.log(row);
+    // },
+    // handleSave(row) {
+    //   console.log(row);
+    //   row.edit = false;
+    //   this.$notify({
+    //     message: "淇濆瓨鎴愬姛",
+    //     type: "success",
+    //   });
+    // },
     //鏍¢獙鍩熷悕
     vaildHost(str) {
       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)
-    },
+    }
   }
-};
+}
 </script>
 <style lang="scss">
 .s-basic-setting {

--
Gitblit v1.8.0