<template>
  <div class="vehicle_servies_modal" v-if="modalFlag" @mousewheel="mousewheel">
    <div class="modal_content">
      <div class="input">
        <p>车系名称</p>
        <input type="text" v-model="carType" />
      </div>
      <div class="btn">
        <button @click="submit" style="margin: 0">保存</button>
        <button @click="hideModal" style="margin: 0">取消</button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    modalFlag: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      carType: "",
    };
  },
  methods: {
    submit: function () {
      this.$emit("submit", this.carType);
    },
    hideModal: function () {
      this.$emit("hide_modal");
    },
    mousewheel: function (e) {
      e.preventDefault();
    },
  },
};
</script>

<style scoped lang="less">
.vehicle_servies_modal {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 100vw;
  background-color: rgba(127, 127, 127, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  .modal_content {
    width: 600px;
    height: 300px;
    background-color: #fff;
    transform: translateY(-50px);
    .input {
      width: 280px;
      margin: 0 auto;
      margin-top: 80px;
      display: flex;
      height: 28px;
      p {
        width: 80px;
        height: 28px;
        line-height: 28px;
      }
      input {
        width: 200px;
        border: 1px solid #555;
      }
    }
    .btn {
      padding-left: 80px;
      margin: 0 auto;
      width: 200px;
      margin-top: 30px;
      display: flex;
      justify-content: space-between;
      button {
        margin: 0!;
      }
    }
  }
}
</style>
