648540858
2022-01-14 ac1a4a027a7bd88efb32e9da666bdba4b5fa166f
web_src/src/components/MediaServerManger.vue
@@ -18,13 +18,17 @@
              <div class="card-img-zlm"></div>
              <div style="padding: 14px;text-align: left">
                <span style="font-size: 16px">{{item.id}}</span>
                <el-button v-if="!item.defaultServer" icon="el-icon-edit" style="padding: 0;float: right;" type="text" @click="edit(item)">编辑</el-button>
                <el-button v-if="item.defaultServer" icon="el-icon-edit" style="padding: 0;float: right;" type="text" @click="edit(item)">查看</el-button>
                <el-button icon="el-icon-delete" style="margin-right: 10px;padding: 0;float: right;" type="text" @click="del(item)">移除</el-button>
                <div style="margin-top: 13px; line-height: 12px; ">
                  <span style="font-size: 14px; color: #999; margin-top: 5px">创建时间:  {{item.createTime}}</span>
                  <el-button icon="el-icon-edit" style="padding: 0;float: right;" type="text" @click="edit(item)">编辑</el-button>
                  <span style="font-size: 14px; color: #999; margin-top: 5px; ">{{item.ip}}</span>
                  <span style="font-size: 14px; color: #999; margin-top: 5px; float: right;">{{item.createTime}}</span>
                </div>
              </div>
              <i v-if="item.status" class="iconfont icon-online server-card-status-online" title="在线"></i>
              <i v-if="!item.status" class="iconfont icon-online server-card-status-offline" title="离线"></i>
              <i v-if="item.defaultServer" class="server-card-default" >默认</i>
            </el-card>
          </el-col>
        </el-row>
@@ -88,6 +92,25 @@
      edit: function (row){
        this.$refs.mediaServerEdit.openDialog(row, this.initData)
      },
      del: function (row){
        this.$confirm('确认删除此节点?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.mediaServerObj.delete(row.id, (data)=>{
            if (data.code === 0) {
              this.$message({
                type: 'success',
                message: '删除成功!'
              });
            }
          })
        }).catch(() => {
        });
      },
      getNumberByWidth(){
        let candidateNums = [1, 2, 3, 4, 6, 8, 12, 24]
        let clientWidth = window.innerWidth - 30;
@@ -106,7 +129,6 @@
          }
        }
        console.log("aadada:    "+ resultVal)
        return resultVal;
      },
         dateFormat: function(/** timestamp=0 **/) {
@@ -153,6 +175,13 @@
    color: #808080;
    font-size: 18px;
  }
  .server-card-default{
    position: absolute;
    left: 20px;
    top: 20px;
    color: #808080;
    font-size: 18px;
  }
   .server-card:hover {
    border: 1px solid #adadad;
  }