panlinlin
2021-04-14 cb5849d8a14f55241c44bdf6724b18de7950564d
web_src/src/components/dialog/platformEdit.vue
@@ -75,7 +75,7 @@
              </el-form-item>
              <el-form-item label="其他选项">
                <el-checkbox label="启用" v-model="platform.enable" @change="checkExpires"></el-checkbox>
                <el-checkbox label="云台控制" v-model="platform.PTZEnable"></el-checkbox>
                <el-checkbox label="云台控制" v-model="platform.ptz"></el-checkbox>
                <el-checkbox label="RTCP保活" v-model="platform.rtcp"></el-checkbox>
              </el-form-item>
              <el-form-item>
@@ -120,28 +120,10 @@
      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,
        ptz: true,
        rtcp: false,
        name: "测试001",
        serverGBId: "34020000002000000001",
@@ -181,17 +163,17 @@
  methods: {
    openDialog: function (platform, callback) {
      var that = this;
      this.$axios
        .get(`/api/platforms/serverconfig`)
        .then(function (res) {
      this.$axios({
                method: 'get',
                url:`/api/platform/server_config`
      }).then(function (res) {
          console.log(res);
          that.platform.deviceGBId = res.data.username;
          that.platform.deviceIp = res.data.deviceIp;
          that.platform.devicePort = res.data.devicePort;
          that.platform.username = res.data.username;
          that.platform.password = res.data.password;
        })
        .catch(function (error) {
      }).catch(function (error) {
          console.log(error);
        });
      this.showDialog = true;
@@ -206,11 +188,11 @@
    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");
      that.$axios({
        method: 'post',
        url:`/api/platform/save`,
        data: that.platform
      }).then(function (res) {
          if (res.data == "success") {
            that.$message({
              showClose: true,
@@ -222,8 +204,7 @@
              that.listChangeCallback();
            }
          }
        })
        .catch(function (error) {
        }).catch(function (error) {
          console.log(error);
        });
    },
@@ -236,8 +217,9 @@
    deviceGBIdExit: async function (deviceGbId) {
      var result = false;
      var that = this;
      await that.$axios
        .post(`/api/platforms/exit/${deviceGbId}`)
      await that.$axios({
                method: 'post',
                url:`/api/platform/exit/${deviceGbId}`})
        .then(function (res) {
          result = res.data;
        })