<template>
  <div><a  @click="routerTo">{{ params.value }}</a></div>
</template>

<script>
  export default {
    props: {
      params: {        
        type: Object,         
        default: () => ({})   
      }, 
    },
    data() {
      return {
        ORDERTYPE: {
          1: {
            label: '订单编辑',
            type: 'C',
            url: '/CUSTOMIZED/ORDERMANAGEMENTEDITOR/'
          },
          2: {
            label: '唯品会时效订单编辑',
            type: 'S',
            url: '/SYSTEM/TABLE_DETAIL/V/T_V_OMSVIPCOMORDER/10602/'
          },
          3: {
            type: 'S',
            label: 'JIT配货单编辑',
            url: '/SYSTEM/TABLE_DETAIL/V/T_V_OMSJITDISTRIBUTION/10640/'
          }
        }
      };
    },
    methods: {
      // getSessionObject(key) {
      //   let data = window.R3.getSessionObject('routeMapRecordForHideBackButton');
      //   data[key] = this.$route.path;
      //   window.sessionStorage.setItem('routeMapRecordForHideBackButton', JSON.stringify(data));
      // },
      routerTo() {
        let { refobjval } = this.params.data.ORDERTYPE;
        let url = this.ORDERTYPE[refobjval].url + this.params.value;
        // this.getSessionObject(url);
        this.$store.commit('global/tabOpen', {
          label: this.ORDERTYPE[refobjval].label, 
          type: this.ORDERTYPE[refobjval].type,
          url
        });
      }

    },
    mounted() {
    }

  };
</script>

<style lang="less" scoped>
 a{
  text-decoration: underline
 }
</style>
