Commit 899456e5 by 胡悦

提交

1 parent 28f5db39
<template>
<div class="config-employee">
<div class="container" style="margin-top: 0;">
<div class="container" style="margin-top: 0">
<p class="edit-title">{{ title }}</p>
</div>
<div class="container">
......@@ -163,7 +163,7 @@ export default {
maxPhotoNum: 1,
// wdithLt: 800,
// heightLt: 640,
noPixel: true,
hasPixel: false,
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
......@@ -198,7 +198,7 @@ export default {
merchantTree: [],
roleList: []
}
};
}
},
watch: {
......@@ -366,7 +366,7 @@ export default {
this.getAllMerchantList()
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
}
};
}
</script>
<style>
......
......@@ -57,7 +57,7 @@
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length < item.maxPhotoNum : !formObj[item.name]" class="activity-img img-w-h">
<div class="add">+</div>
<span class="number">{{ formObj[item.name].length }} / {{ item.maxPhotoNum }}</span>
<input type="file" style="opacity: 0;" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleImgChange(e, item)" />
<input type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleImgChange(e, item)" />
</div>
</div>
<template>
......@@ -189,7 +189,7 @@ export default {
image.onload = () => {
var imgWidth = image.width
var imgHeight = image.height
if (!targetItem.noPixel && ( imgWidth > wdithLt || imgHeight > heightLt)) {
if (targetItem.hasPixel && (imgWidth > wdithLt || imgHeight > heightLt)) {
this.$message.error('图片尺寸最大为' + wdithLt + '像素*' + heightLt + '像素')
} else {
targetItem.handleUpload(e, file, targetItem)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!