|
|
@@ -41,6 +41,7 @@
|
|
|
<img v-if="baseForm.src" :src="baseForm.src" class="avatar">
|
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
</el-upload>
|
|
|
+ <span style="color:#F56C6C">仅支持上传jpg/jpeg/png且大小不超过5M的图片</span>
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
|
<el-row style="height: 200px;">
|
|
|
@@ -160,23 +161,21 @@ export default {
|
|
|
},
|
|
|
editRow: {
|
|
|
handler(val) {
|
|
|
- console.log(val,'valvlalvalvallva')
|
|
|
this.baseForm = { ...this.editRow }
|
|
|
},
|
|
|
deep: true
|
|
|
},
|
|
|
- baseForm: {
|
|
|
- handler(val) {
|
|
|
- const { src, subsidypolicyContent } = val
|
|
|
- if (src) this.$refs.baseForm.clearValidate(['src'])
|
|
|
- if (!checkEmpty(subsidypolicyContent)) {
|
|
|
- this.$refs.baseForm.clearValidate(['subsidypolicyContent'])
|
|
|
- } else {
|
|
|
- this.$refs.baseForm.validateField('subsidypolicyContent')
|
|
|
- }
|
|
|
- },
|
|
|
- deep: true
|
|
|
- }
|
|
|
+ 'baseForm.src'(val) {
|
|
|
+ console.log(val, 'valvalvlalvalslsdkal12312')
|
|
|
+ if(val) this.$refs.baseForm.clearValidate(['src'])
|
|
|
+ },
|
|
|
+ 'baseForm.subsidypolicyContent'(val) {
|
|
|
+ if (!checkEmpty(val)) {
|
|
|
+ this.$refs?.baseForm?.clearValidate(['subsidypolicyContent'])
|
|
|
+ } else {
|
|
|
+ this.$refs?.baseForm?.validateField('subsidypolicyContent')
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
onCreated(editor) {
|
|
|
@@ -196,11 +195,11 @@ export default {
|
|
|
fileType === '.jpg' ||
|
|
|
fileType === '.png' ||
|
|
|
fileType === '.jpeg';
|
|
|
- const isLt2M = file.size / 1024 / 1024 < 2;
|
|
|
+ const isLt2M = file.size / 1024 / 1024 < 5;
|
|
|
if (!isLt2M) {
|
|
|
Message({
|
|
|
type: 'error',
|
|
|
- message: '上传头像图片大小不能超过 2MB!'
|
|
|
+ message: '上传头像图片大小不能超过 5MB!'
|
|
|
})
|
|
|
}
|
|
|
return isOKType && isLt2M;
|
|
|
@@ -232,7 +231,7 @@ export default {
|
|
|
} else {
|
|
|
const params = {
|
|
|
areaIds: this.areaId,
|
|
|
- resIds: this.editRow.resIds,
|
|
|
+ resIds: this.resId,
|
|
|
subsidypolicyContent: this.baseForm.subsidypolicyContent,
|
|
|
subsidypolicyTitle: this.baseForm.subsidypolicyTitle,
|
|
|
subsidypolicyId: this.baseForm.subsidypolicyId
|