vue2 XixunPlayer 查询设备磁盘空间

vue yekong

使用vue开发实现XixunPlayer的功能.

XixunPlayer 查询设备磁盘空间

/**
* @Author: 858834013@qq.com
* @Name: getDiskSpace
* @Date: 2022-04-26
* @Desc: XixunPlayer 查询设备磁盘空间
*/
<template>
  <div>
    <el-button class="mb20" @click="getdata" size="mini" type="primary">查询设备磁盘空间</el-button>
    <el-dialog
      title="查询设备磁盘空间"
      :visible.sync="dialogVisible"
      width="30%">
      <div class="screenshots">
        <p>外部空闲:{{ externalFree }}</p>
        <p>外部总用:{{ externalTotal }}</p>
        <p>内部空闲:{{ internalFree }}</p>
        <p>内部总用:{{ internalTotal }}</p>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { getdata } from '@/api/led/led'

export default {
  name: 'pop',
  components: {},
  data () {
    return {
      dialogVisible: false,
      img: '',
      externalFree: 0,
      externalTotal: 0,
      internalFree: 0,
      internalTotal: 0,
    }
  },
  props: {
    id: {
      type: String,
      default () {
        return ''
      }
    }
  },
  methods: {
    getdata () {
      var that = this
      getdata(that.id, {
        type: 'getDiskSpace'
      }).then(function (res) {
        that.externalFree = res.externalFree
        that.externalTotal = res.externalTotal
        that.internalFree = res.internalFree
        that.internalTotal = res.internalTotal
        that.dialogVisible = true
      })
    },
  }
}
</script>

喜欢