<template>
    <span class="paas-enum-show-container">
      {{showData}}
    </span>
</template>

<script>
    export default {
      data(){
        return {
          showData: ''
        }
      },
      props: {
        enumGroupCode: String,
        enumCode: String,
        value: String
      },
      created: function() {
        let enums = this.$store.state.enums[this.enumGroupCode+"-"+this.enumCode];
        let show = '';
        if(this.value !== '' && this.value != null && this.value !== 'null') {
          if(!enums || enums.length === 0) {
            return ;
          }
          let flag = 0;
          let vals = this.value.split(",");
          for(let n = 0; n < vals.length; n++) {
            for(let i = 0; i < enums.length; i++) {
              if(vals[n] === enums[i].sysEnmuDataValue) {
                if(flag > 0) {
                  show += ", ";
                }
                show += enums[i].sysEnmuDataKey;
                flag++;
                break;
              }
            }
          }
        }
        this.showData = show;
      }
    }
</script>

<style scoped>

</style>
