<template>
  <div id="app">
    <router-view/>
    <!-- 视频预览 -->
    <el-dialog
      :visible.sync="videoPlayDialog.show"
      width="540px"
      top="50px"
      title="视频预览"
      :append-to-body="true"
      :beforeClose="handlePause"
      :modal-append-to-body="true"
      :close-on-click-modal="true">
      <div>
        <video
          v-if="videoPlayDialog.show"
          id="playVideo"
          :src="videoPlayDialog.src"
          controls
          style="display: block; height: 500px; width: 500px;margin: 0 auto;"></video>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'App',
  computed: {
    videoPlayDialog() {
      return this.$store.state.common.videoPlayDialog
    }
  },
  methods: {
    handlePause() {
      this.$store.commit('common/SET_VIDEOPLAYDIALOG', {
        src: '',
        show: false
      })
    }
  }
}
</script>
<style lang="scss">
* {
  margin: 0;
  padding: 0;
}

.search-box {
  .el-form-item__label {
    width: auto !important;
  }
}

.el-table {
  .el-table__body-wrapper {
    &::-webkit-scrollbar {
      background: #d3dce6;
    }

    &::-webkit-scrollbar-thumb {
      background: #99a9bf;
      border-radius: 10px;
    }
  }
}

@media screen and (max-width: 768px) {
  .el-message {
    min-width: 300px !important;
  }
  .el-message-box {
    width: 300px !important;
  }
  .el-dialog__wrapper .el-dialog {
    width: 95% !important;

    .el-dialog__body {
      padding: 10px 20px !important;
    }
  }
  .el-date-range-picker {
    left: 0 !important;
  }

  .el-form-item__label {
    display: block;
    width: 100% !important;
    text-align: left;
  }
  .el-form-item__content {
    margin-left: 0 !important;
  }
}
</style>
