/**
* @Description:  获取当前用户
* @author xioln
* @date 2023-09-04
* @FilePath: applications/dee-mes/src/privateComponents/components/Creator/index.vue
*/
<template>
  <div class="creator">
    <el-select v-model="creatorId" :disabled="disabledVal">
      <el-option
        :label="option.name"
        :value="option.id"
      />
    </el-select>
  </div>
</template>
<script>
export default {
  componentName: '创建人',
  name: 'Creator',
  components: {},
  props: {
    basicData: {
      type: Object,
      default: () => null
    },
    itemObj: {
      type: Object,
      default: null
    },
    form: {
      type: Object
    }
  },
  data() {
    return {
      creatorId: localStorage.getItem('userId'),
      disabledVal: false,
      option: {
        id: localStorage.getItem('userId'),
        name: localStorage.getItem('user')
      }
    }
  },
  computed: {},
  watch: {
    itemObj: {
      immediate: true,
      deep: true,
      handler(v) {
        if (v.component.hasOwnProperty('disabled')) {
          this.disabledVal = v.component.disabled
        }
      }
    }
  },
  created() {
    // 初始化数据
  },
  mounted() {
    this.$nextTick(() => {
      if (this.form.creatorId) {
        this.creatorId = this.form.creator.id
      }
      this.$emit('input', this.creatorId)
    })
  },
  methods: {
  }
}
</script>
<style lang='scss'>
</style>