|
|
@ -8,11 +8,13 @@
|
|
|
|
action="#"
|
|
|
|
action="#"
|
|
|
|
class="avatar-uploader"
|
|
|
|
class="avatar-uploader"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<img v-if="imageUrl" :src="imageUrl" class="avatar"/>
|
|
|
|
<el-icon class="avatar-uploader-icon">
|
|
|
|
<el-icon v-else class="avatar-uploader-icon">
|
|
|
|
|
|
|
|
<Plus/>
|
|
|
|
<Plus/>
|
|
|
|
</el-icon>
|
|
|
|
</el-icon>
|
|
|
|
</el-upload>
|
|
|
|
</el-upload>
|
|
|
|
|
|
|
|
<div v-for="item in imageUrl" style="margin: 0 12px">
|
|
|
|
|
|
|
|
<img v-if="item" :src="item" class="avatar"/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-button type="primary" @click="onSubmit">Create</el-button>
|
|
|
|
<el-button type="primary" @click="onSubmit">Create</el-button>
|
|
|
@ -35,23 +37,22 @@ const {t} = useI18n();
|
|
|
|
const locale = (Cookies.get('language') || 'zhCn') === 'zhCn'
|
|
|
|
const locale = (Cookies.get('language') || 'zhCn') === 'zhCn'
|
|
|
|
const {proxy} = getCurrentInstance();
|
|
|
|
const {proxy} = getCurrentInstance();
|
|
|
|
const {sys_normal_disable} = proxy.useDict("sys_normal_disable");
|
|
|
|
const {sys_normal_disable} = proxy.useDict("sys_normal_disable");
|
|
|
|
const imageUrl = ref('')
|
|
|
|
const imageUrl = ref([''])
|
|
|
|
|
|
|
|
|
|
|
|
const form = reactive({
|
|
|
|
const form = ref({
|
|
|
|
imgUrl: '',
|
|
|
|
imgUrl: [''],
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const onSubmit = () => {
|
|
|
|
const onSubmit = () => {
|
|
|
|
console.log('submit!')
|
|
|
|
console.log('submit!')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const requestUpload = (e) => {
|
|
|
|
const requestUpload = (e) => {
|
|
|
|
console.log(e)
|
|
|
|
|
|
|
|
let formData = new FormData();
|
|
|
|
let formData = new FormData();
|
|
|
|
formData.append("avatarfile", e.file);
|
|
|
|
formData.append("avatarfile", e.file);
|
|
|
|
uploadImg(formData).then(response => {
|
|
|
|
uploadImg(formData).then(response => {
|
|
|
|
console.log(response)
|
|
|
|
console.log(response)
|
|
|
|
form.value.imgUrl = response.imgUrl
|
|
|
|
form.value.imgUrl.push(response.imgUrl)
|
|
|
|
imageUrl.value = import.meta.env.VITE_APP_BASE_API+response.imgUrl
|
|
|
|
imageUrl.value.push(import.meta.env.VITE_APP_BASE_API + response.imgUrl)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|