648540858
2022-04-18 c1f6401598098a38be7b6cd00d91a7750d7fad20
web_src/src/components/dialog/platformEdit.vue
@@ -77,6 +77,7 @@
                <el-checkbox label="启用" v-model="platform.enable" @change="checkExpires"></el-checkbox>
                <el-checkbox label="云台控制" v-model="platform.ptz"></el-checkbox>
                <el-checkbox label="共享所有直播流" v-model="platform.shareAllLiveStream"></el-checkbox>
                <el-checkbox label="拉起离线推流" v-model="platform.startOfflinePush"></el-checkbox>
              </el-form-item>
              <el-form-item>
                <el-button type="primary" @click="onSubmit">{{
@@ -116,6 +117,7 @@
      showDialog: false,
      isLoging: false,
      onSubmit_text: "立即创建",
      saveUrl: "/api/platform/save",
      platform: {
        id: null,
@@ -137,6 +139,7 @@
        transport: "UDP",
        characterSet: "GB2312",
        shareAllLiveStream: false,
        startOfflinePush: false,
      },
      rules: {
        name: [{ required: true, message: "请输入平台名称", trigger: "blur" }],
@@ -163,6 +166,7 @@
      var that = this;
      if (platform == null) {
        this.onSubmit_text = "立即创建";
        this.saveUrl = "/api/platform/add";
        this.$axios({
          method: 'get',
          url:`/api/platform/server_config`
@@ -197,7 +201,9 @@
        this.platform.characterSet = platform.characterSet;
        this.platform.shareAllLiveStream = platform.shareAllLiveStream;
        this.platform.catalogId = platform.catalogId;
        this.platform.startOfflinePush = platform.startOfflinePush;
        this.onSubmit_text = "保存";
        this.saveUrl = "/api/platform/save";
      }
      this.showDialog = true;
      this.listChangeCallback = callback;
@@ -212,14 +218,13 @@
      this.platform.username = this.platform.deviceGBId ;
    },
    onSubmit: function () {
      console.log("onSubmit");
      var that = this;
      that.$axios({
        method: 'post',
        url:`/api/platform/save`,
        url: this.saveUrl,
        data: that.platform
      }).then(function (res) {
          if (res.data == "success") {
          if (res.data.code === 0) {
            that.$message({
              showClose: true,
              message: "保存成功",
@@ -229,6 +234,12 @@
            if (that.listChangeCallback != null) {
              that.listChangeCallback();
            }
          }else {
            that.$message({
              showClose: true,
              message: res.data.msg,
              type: "error",
            });
          }
        }).catch(function (error) {
          console.log(error);
@@ -258,6 +269,7 @@
        transport: "UDP",
        characterSet: "GB2312",
        shareAllLiveStream: false,
        startOfflinePush: false,
      }
    },
    deviceGBIdExit: async function (deviceGbId) {