修改图片

This commit is contained in:
陈红丽 2024-10-10 12:58:10 +08:00
parent c9d6e466db
commit b47aa3f145
5 changed files with 12 additions and 9 deletions

View File

@ -12,7 +12,7 @@ VITE_DROP_CONSOLE = true
# 跨域代理,可以配置多个,请注意不要换行 # 跨域代理,可以配置多个,请注意不要换行
#VITE_PROXY = [["/appApi","http://localhost:8001"],["/upload","http://localhost:8001/upload"]] #VITE_PROXY = [["/appApi","http://localhost:8001"],["/upload","http://localhost:8001/upload"]]
VITE_PROXY=[["/api","http://127.0.0.1:8081/api"]] VITE_PROXY=[["/api","http://192.168.124.203:8081/api"]]
# API 接口地址 # API 接口地址
VITE_GLOB_API_URL = VITE_GLOB_API_URL =

View File

@ -56,7 +56,7 @@
title: { type: String, default: '图片上传' }, title: { type: String, default: '图片上传' },
src: { type: String, required: true }, src: { type: String, required: true },
circled: { type: Boolean, default: false }, circled: { type: Boolean, default: false },
width: { type: [String, Number], default: 150 }, width: { type: [String, Number], default: 120 },
uploadApi: { uploadApi: {
type: Function as PropType<(params) => Promise<any>>, type: Function as PropType<(params) => Promise<any>>,
}, },

View File

@ -296,6 +296,7 @@
background-color: transparent; background-color: transparent;
border: 1px dashed var(--el-border-color-darker); border: 1px dashed var(--el-border-color-darker);
border-radius: v-bind(borderRadius); border-radius: v-bind(borderRadius);
padding:5px;
&:hover { &:hover {
border: 1px dashed var(--el-color-primary); border: 1px dashed var(--el-color-primary);
} }
@ -305,8 +306,8 @@
border: 2px dashed var(--el-color-primary) !important; border: 2px dashed var(--el-color-primary) !important;
} }
.upload-image { .upload-image {
width: 90%; width: 100%;
height: 90%; height: 100%;
object-fit: contain; object-fit: contain;
} }
.upload-empty { .upload-empty {

View File

@ -75,11 +75,11 @@
}, },
width: { width: {
type: String, type: String,
default: '150px', default: '120px',
}, },
height: { height: {
type: String, type: String,
default: '150px', default: '120px',
}, },
borderRadius: { borderRadius: {
type: String, type: String,
@ -279,6 +279,7 @@
height: v-bind(height); height: v-bind(height);
border: 1px dashed var(--el-border-color-darker); border: 1px dashed var(--el-border-color-darker);
border-radius: v-bind(borderRadius); border-radius: v-bind(borderRadius);
padding: 5px;
} }
&:hover { &:hover {
@ -293,7 +294,9 @@
height: 100%; height: 100%;
object-fit: contain; object-fit: contain;
} }
:deep(.el-upload--picture-card) {
--el-upload-picture-card-size: v-bind(width);
}
.upload-handle { .upload-handle {
position: absolute; position: absolute;
top: 0; top: 0;

View File

@ -156,8 +156,7 @@
class="flex-1" class="flex-1"
:rules="[ :rules="[
{ required: true, message: '请输入手机号码', trigger: 'blur' }, { required: true, message: '请输入手机号码', trigger: 'blur' },
{ validator: rule.validatePhone, trigger: 'blur' }, { validator: rule.validatePhone, trigger: 'blur' }]"
]"
> >
<el-input v-model="formData.mobile" placeholder="请输入手机号码" clearable /> <el-input v-model="formData.mobile" placeholder="请输入手机号码" clearable />
</el-form-item> </el-form-item>