图片上传
This commit is contained in:
parent
c10f87fe22
commit
ae1dcedd9b
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 1.6 KiB |
BIN
public/favicon_old.ico
Normal file
BIN
public/favicon_old.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 14 KiB |
BIN
src/assets/logo/logo_old.png
Normal file
BIN
src/assets/logo/logo_old.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.4 KiB |
@ -147,7 +147,8 @@ export default {
|
|||||||
handleUploadSuccess(res) {
|
handleUploadSuccess(res) {
|
||||||
this.fileList.push({
|
this.fileList.push({
|
||||||
name: res.fileName,
|
name: res.fileName,
|
||||||
url: process.env.VUE_APP_BASE_API + res.fileName,
|
// url: process.env.VUE_APP_BASE_API + res.fileName,
|
||||||
|
url: res.url,
|
||||||
});
|
});
|
||||||
this.$emit('input', this.listToString(this.fileList));
|
this.$emit('input', this.listToString(this.fileList));
|
||||||
this.$emit('change', this.listToString(this.fileList));
|
this.$emit('change', this.listToString(this.fileList));
|
||||||
@ -185,7 +186,9 @@ export default {
|
|||||||
const isValidSize = await this.checkImageSize(file, this.fileWidth, this.fileHeight);
|
const isValidSize = await this.checkImageSize(file, this.fileWidth, this.fileHeight);
|
||||||
if (!isValidSize) {
|
if (!isValidSize) {
|
||||||
this.$message.error(
|
this.$message.error(
|
||||||
`上传图片不符合要求,尺寸要小于:宽${this.fileWidth ? this.fileWidth + 'px' : '不限制'},高${this.fileHeight ? this.fileHeight + 'px' : '不限制'}`
|
`上传图片不符合要求,尺寸要小于:宽${this.fileWidth ? this.fileWidth + 'px' : '不限制'},高${
|
||||||
|
this.fileHeight ? this.fileHeight + 'px' : '不限制'
|
||||||
|
}`
|
||||||
);
|
);
|
||||||
return Promise.reject();
|
return Promise.reject();
|
||||||
}
|
}
|
||||||
|
@ -53,10 +53,10 @@
|
|||||||
<data-tag :options="userList" :value="scope.row.batchHead" labelName="userName" valueName="userId" type="notag" />
|
<data-tag :options="userList" :value="scope.row.batchHead" labelName="userName" valueName="userId" type="notag" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="种质图片" align="center" prop="introImg" width="180">
|
<el-table-column label="种植图片" align="center" prop="introImg" width="180">
|
||||||
<template v-slot:default="{ row }">
|
<template v-slot:default="{ row }">
|
||||||
<div class="image" @click="previewImage(`${image.baseUrl + row.germplasmImg}`, row)">
|
<div class="image" @click="previewImage(`${row.germplasmImg}`, row)">
|
||||||
<img style="width: 50px; height: 50px" :src="`${image.baseUrl + row.germplasmImg}`" />
|
<img style="width: 50px; height: 50px" :src="`${row.germplasmImg}`" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -32,10 +32,10 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
<el-card class="card-padding-bottom">
|
<el-card class="card-padding-bottom">
|
||||||
<el-table v-loading="loading" :data="germplasmList">
|
<el-table v-loading="loading" :data="germplasmList">
|
||||||
<el-table-column label="种质图片" align="center" prop="germplasmImg" width="180">
|
<el-table-column label="种植图片" align="center" prop="germplasmImg" width="180">
|
||||||
<template v-slot:default="{ row }">
|
<template v-slot:default="{ row }">
|
||||||
<div class="image" @click="previewImage(`${image.baseUrl + row.germplasmImg}`, row)">
|
<div class="image" @click="previewImage(`${row.germplasmImg}`, row)">
|
||||||
<img style="width: 50px; height: 50px" :src="`${image.baseUrl + row.germplasmImg}`" />
|
<img style="width: 50px; height: 50px" :src="`${row.germplasmImg}`" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -101,7 +101,7 @@
|
|||||||
<el-form-item label="种质英文名称" prop="germplasmEnName">
|
<el-form-item label="种质英文名称" prop="germplasmEnName">
|
||||||
<el-input v-model="form.germplasmEnName" placeholder="请输入种质英文名称" />
|
<el-input v-model="form.germplasmEnName" placeholder="请输入种质英文名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="种质图片" prop="germplasmImg">
|
<el-form-item label="种植图片" prop="germplasmImg">
|
||||||
<imageUpload v-model="form.germplasmImg" :limit="1" />
|
<imageUpload v-model="form.germplasmImg" :limit="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="宣传语" prop="germplasmDes">
|
<el-form-item label="宣传语" prop="germplasmDes">
|
||||||
@ -185,7 +185,7 @@ export default {
|
|||||||
cropEnName: [{ required: true, message: '作物英文名称不能为空', trigger: 'blur' }],
|
cropEnName: [{ required: true, message: '作物英文名称不能为空', trigger: 'blur' }],
|
||||||
germplasmName: [{ required: true, message: '种质名称不能为空', trigger: 'blur' }],
|
germplasmName: [{ required: true, message: '种质名称不能为空', trigger: 'blur' }],
|
||||||
germplasmEnName: [{ required: true, message: '种质英文名称不能为空', trigger: 'blur' }],
|
germplasmEnName: [{ required: true, message: '种质英文名称不能为空', trigger: 'blur' }],
|
||||||
germplasmImg: [{ required: true, message: '种质图片不能为空', trigger: 'blur' }],
|
germplasmImg: [{ required: true, message: '种植图片不能为空', trigger: 'blur' }],
|
||||||
germplasmDes: [{ required: true, message: '宣传语不能为空', trigger: 'blur' }],
|
germplasmDes: [{ required: true, message: '宣传语不能为空', trigger: 'blur' }],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user