<template>
  <DoPage :label="actionType" :tabs="tabs" />
</template>

<script>
  import DoPage from '../panels/do.vue'

  export default {
    name: 'SplitDo',
    components: { 
      DoPage
    },
    data() {
      return {
        actionType: '分卷',
        tabs: [],
      }
    },
    watch: {
      '$route.query.actionType': {
        handler(newVal) {
          this.actionType = newVal;
          // 根据名字获取默认的查询参数
          const map = {
            '酸连轧工序': [
              {value: '1988150099140866050', label: '酸连轧成品库'}, 
              {value: '1988150263284953089', label: '镀锌原料库'}, 
              {value: '1988150545175736322', label: '脱脂原料库'},
            ],
            '镀锌工序': [
              {value: '1988150263284953089', label: '镀锌原料库'}, 
              {value: '1988150323162836993', label: '镀锌成品库'},
            ],
            '脱脂工序': [
              {value: '1988150545175736322', label: '脱脂原料库'}, 
              {value: '1988150586938421250', label: '脱脂成品库'},
            ],
            '退火工序': [
              {value: '1988150648993148929', label: '罩式退火原料库'}, 
              {value: '1988150704496373761', label: '罩式退火成品库'},
            ],
            '拉矫平整工序': [
              {value: '1988150854442741762', label: '拉矫原料库'}, 
              {value: '1988150915591499777', label: '拉矫成品库'},
            ],
            '双机架工序': [
              {value: '1992873386047643650', label: '双机架原料库'}, 
              {value: '1992873437713080322', label: '双机架成品库'},
            ],
            '镀铬工序': [
              {value: '1988151076996706306', label: '镀铬原料库'}, 
              {value: '1988151132361519105', label: '镀铬成品库'},
            ],
          }
          // 从map中获取默认的查询参数
          const defaultWarehouseIds = map[this.actionType] || []
          console.log(defaultWarehouseIds, 'defaultWarehouseIds')
          this.tabs = defaultWarehouseIds
        },
        immediate: true
      }
    }
  }
</script>