Commit 899456e5 by 胡悦

提交

1 parent 28f5db39
<template> <template>
<div class="config-employee"> <div class="config-employee">
<div class="container" style="margin-top: 0;"> <div class="container" style="margin-top: 0">
<p class="edit-title">{{ title }}</p> <p class="edit-title">{{ title }}</p>
</div> </div>
<div class="container"> <div class="container">
...@@ -163,7 +163,7 @@ export default { ...@@ -163,7 +163,7 @@ export default {
maxPhotoNum: 1, maxPhotoNum: 1,
// wdithLt: 800, // wdithLt: 800,
// heightLt: 640, // heightLt: 640,
noPixel: true, hasPixel: false,
handleUpload: (e, file, targetItem) => { handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1] const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
...@@ -198,7 +198,7 @@ export default { ...@@ -198,7 +198,7 @@ export default {
merchantTree: [], merchantTree: [],
roleList: [] roleList: []
} }
}; }
}, },
watch: { watch: {
...@@ -366,7 +366,7 @@ export default { ...@@ -366,7 +366,7 @@ export default {
this.getAllMerchantList() this.getAllMerchantList()
this.routeInfo.addOrEdit != 1 ? this.getInfo() : '' this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
} }
}; }
</script> </script>
<style> <style>
......
...@@ -57,7 +57,7 @@ ...@@ -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 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> <div class="add">+</div>
<span class="number">{{ formObj[item.name].length }} / {{ item.maxPhotoNum }}</span> <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>
</div> </div>
<template> <template>
...@@ -189,7 +189,7 @@ export default { ...@@ -189,7 +189,7 @@ export default {
image.onload = () => { image.onload = () => {
var imgWidth = image.width var imgWidth = image.width
var imgHeight = image.height var imgHeight = image.height
if (!targetItem.noPixel && ( imgWidth > wdithLt || imgHeight > heightLt)) { if (targetItem.hasPixel && (imgWidth > wdithLt || imgHeight > heightLt)) {
this.$message.error('图片尺寸最大为' + wdithLt + '像素*' + heightLt + '像素') this.$message.error('图片尺寸最大为' + wdithLt + '像素*' + heightLt + '像素')
} else { } else {
targetItem.handleUpload(e, file, targetItem) 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!