import Vue from "vue";

export default Vue.extend({
    template: `
        <span>
            <span v-if="subTotalRow"></span>
            <span v-else :title="params.value">{{dict[params.value]?dict[params.value]:params.value}}</span>
        </span>
    `,
    name: 'translate-cell',
    data() {
        return {};
    },
    computed: {
        translated() {
            if ( this.dict ){
                return this.dict[this.params.value];
            }
        },
        dict(){
            let column = this.params.colDef;
            let gridDicts = this.params.context.gridDicts;
            return gridDicts[column.colId]?gridDicts[column.colId]:{}
        },
        subTotalRow(){
            return this.params.data._subTotal_row
        }
    },
    methods: {

    }
});