<template>
  <view class="assign-container">
    <u-popup :show="popShow" @close="close">
      <view class="container-list">
        <view
          class="list-item"
          v-for="(item, index) in statusList"
          :key="index"
          @click="chooseItem(item)"
        >
          {{ item.label }}
        </view>
        <view class="list-item cancel" @click="close"> 取消 </view>
      </view>
    </u-popup>
  </view>
</template>

<script>
import { post, get, postJ } from '@/utils/api.js'
export default {
  data () {
    return {
      popShow: false,
      statusList: [
        { value: 'START', label: '启动' },
        { value: 'RUN', label: '运行' },
        { value: 'STOP', label: '停机' },
        { value: 'IDLE', label: '空闲' },
        { value: 'TOBE_MATERIAL', label: '待料' },
        { value: 'FAULT', label: '故障' },
        { value: 'REPAIR', label: '检修' }
      ]
    }
  },

  created () {},
  methods: {
    //工单id
    open (id) {
      this.popShow = true
    },
    close () {
      this.popShow = false
    },
    chooseItem (item) {
      this.$emit('change', item)
      this.popShow = false
    }
  }
}
</script>

<style lang="scss" scoped>
.assign-container {
  max-height: 70vh;
  background: #e7e7e7;
  .container-list {
    .list-item {
      width: 100%;
      text-align: center;
      line-height: 90rpx;
      height: 90rpx;
      border-bottom: 1rpx solid #e7e7e7;

      &.cancel {
        background-color: rgba(242, 242, 242, 1);
      }
    }
  }
}
</style>
