<template>
  <div>{{ name }}</div>
</template>

<script>
import { getAction } from '@api/manage'

export default {
  name: 'FlowUserName',
  props: {
    userId: {
      type: String,
      default: ''
    },
    setType: {
      type: Number,
      default: 1
    }
  },
  data() {
    return {
      name: ''
    };
  },
  mounted() {
    if (this.userId) {
      getAction('sys/user/ugetUserInfo',{userId:this.userId, setType:this.setType}).then(res => {
        this.name = res.result.name;
      });
    } else {
      console.warn('userId is required!');
    }
  }
};
</script>

<style scoped lang="less"></style>
