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

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

export default {
  name: 'FlowFileName',
  props: {
    fileId: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      name: ''
    };
  },
  mounted() {
    if (this.fileId) {
      getAction('/sys/oss/file/queryById',{id:this.fileId}).then(res => {
        if(res.code ===200)
          this.name = res.result.fileName;
      });
    } else {
      console.warn('fileId is required!');
    }
  }
};
</script>

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