上传之前格式校验,修正因水印导致无法触发uploadBefore问题,注释掉水印

main
xuechunyuan 3 years ago
parent 1a1671cdff
commit 279ce51e89
  1. BIN
      dist.zip
  2. 30
      src/option/user/info.js
  3. 26
      src/views/system/dept.vue
  4. 7
      src/views/system/userinfo.vue

Binary file not shown.

@ -1,4 +1,5 @@
import website from "../../config/website"
import website from "../../config/website";
import { Message } from 'element-ui';
export default {
tabs: true,
tabsActive: 1,
@ -8,6 +9,7 @@ export default {
prop: 'info',
column: [{
label: '头像',
prop: 'avatar',
type: 'upload',
listType: 'picture-img',
propsHttp: {
@ -15,15 +17,31 @@ export default {
res: 'data',
url: 'link',
},
canvasOption: {
text: ' ',
ratio: 0.1
},
// canvasOption: {
// text: ' ',
// ratio: 0.1
// },
fileType: 'img',//img/video/audio,
accept: 'image/png, image/jpeg',
action: '/api/blade-resource/oss/endpoint/put-file',
tip: '只能上传jpg/png用户头像,且不超过500kb',
span: 12,
row: true,
prop: 'avatar'
prop: 'avatar',
tip: '只能上传jpg/png用户头像,且不超过500kb',
action: '/api/blade-resource/oss/endpoint/put-file',
uploadBefore: (file, done, loading) => {
if (['image/png', 'image/jpeg'].indexOf(file.type) == -1) {
Message({
message: '只能上传jpg/png用户头像',
type: 'error'
});
loading();
}
else {
done();
}
}
}, {
label: '姓名',
span: 12,

@ -16,8 +16,8 @@
</el-button>
</template>
<template slot-scope="{row}" slot="imgUrl2">
<img v-if="row.imgUrl" :src="website.filePrex + row.imgUrl" style="width:30px;height:30px;"/>
<img v-else src="@/assets/image/hospital_logo.png" style="width:30px;height:30px;"/>
<img v-if="row.imgUrl" :src="website.filePrex + row.imgUrl" style="width:30px;height:30px;" />
<img v-else src="@/assets/image/hospital_logo.png" style="width:30px;height:30px;" />
</template>
<template slot-scope="{row}" slot="deptCategory">
{{ row.deptCategoryName }}
@ -37,6 +37,7 @@ import {
} from "@/api/system/dept";
import { mapGetters } from "vuex";
// import website from '@/config/website';
import { Message } from 'element-ui';
export default {
data() {
@ -90,15 +91,28 @@ export default {
type: 'upload',
listType: 'picture-img',
span: 24,
fileType: 'img',//img/video/audio
fileType: 'img',//img/video/audio,
accept: 'image/png, image/jpeg',
propsHttp: {
home: this.website.filePrex,
res: 'data',
url: "link",
},
tip: '只能上传jpg/png用户头像,且不超过500kb',
tip: '只能上传jpg/png格式文件,且不超过500kb',
action: '/api/blade-resource/oss/endpoint/put-file',
hide: true,
uploadBefore: (file, done, loading) => {
if (['image/png', 'image/jpeg'].indexOf(file.type) == -1) {
Message({
message: '只能上传jpg/png格式文件',
type: 'error'
});
loading();
}
else {
done();
}
}
},
{
label: "机构全称",
@ -343,6 +357,4 @@ export default {
};
</script>
<style>
</style>
<style></style>

@ -1,7 +1,8 @@
<template>
<div>
<basic-container>
<avue-form :option="option" v-model="form" @tab-click="handleTabClick" @submit="handleSubmit"></avue-form>
<avue-form :option="option" v-model="form" @tab-click="handleTabClick"
@submit="handleSubmit"></avue-form>
</basic-container>
</div>
</template>
@ -87,6 +88,4 @@ export default {
};
</script>
<style>
</style>
<style></style>

Loading…
Cancel
Save