Commit 123f282c authored by xioln's avatar xioln

创建人自动带入

parent afe533db
/**
* @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: null,
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 = localStorage.getItem('userId')
} else {
this.creatorId = this.form.creator.userName
}
})
this.$emit('input', this.creatorId)
},
methods: {
}
}
</script>
<style lang='scss'>
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment