Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stage=>dev #1898

Merged
merged 11 commits into from
Feb 6, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -140,24 +140,17 @@ input.largerCheckbox {
<tool-tips infoMessage="Banner image (Maximum size 400kb)"></tool-tips><label for="logoUrl" class="col-form-label">Banner<span style="color: red">*</span>: </label>
</div>
<div class="col-lg-9 col-md-9 px-0" style="display: flex">
<div
v-model="project.logoUrl"
type="text"
placeholder=""
id="logoUrl"
:disabled="true"
class="form-control w-100"
>
<input class="form-control w-100" type="text" disabled :placeholder="project.logoUrl? project.logoUrl :'Image of aspect ratio 16:9 or 4:3'">
<input
type="file"
id="file"
ref="file"
@change="fileUploadForBanner"
accept="image/jpeg, image/png"
hidden
/>
<span style="float: right">Image of aspect ratio 16:9 or 4:3</span>
</div>
</div>

<hf-buttons name="" iconClass="fa fa-upload" @executeAction="uploadBtn"
customClass="btn button-theme slight-left-margin-5"></hf-buttons>
</div>
</div>


Expand Down Expand Up @@ -326,8 +319,11 @@ export default {

},
methods: {
uploadBtn(){
this.$refs.file.click();
},
fileUploadForBanner(e) {
let file;
let file = this.$refs.file.files;
if ((file = e.target.files[0])) {
if (file.size > config.banner.bannersize) {
return this.notifyErr("File size is more than 400kb");
Expand Down
32 changes: 19 additions & 13 deletions src/views/admin/setting/OrgSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,17 @@
<div class="row g-3 align-items-center w-100 mt-4">
<div class="text-left col-lg-8 col-md-8 text-left">
<tool-tips infoMessage="Logo (Maximum size 400kb)"></tool-tips><label for="name"
class="col-form-label">Logo:
class="col-form-label pb-4">Logo:
</label>
</div>
<div class="col-lg-4 col-md-4 px-0">
<div style="display:flex;">
<div placeholder="Maximum size 400kb" id="name" class="form-control w-100">
<input type="file" id="file" accept="image/jpeg, image/png" @change="fileUpload">
</div>
</div>
<a href="#" style="float:right;color:#495057" @click.prevent="preview">Preview</a>
<div style="display:flex;">
<input type="file" ref="file" id="file" accept="image/jpeg, image/png" @change="fileUpload" hidden>
<input type="text" class="form-control w-100" :placeholder="fileName!==''?fileName : 'Maximum size 400kb'" :disabled="true">
<hf-buttons name="" iconClass="fa fa-upload" @executeAction="uploadBtn"
customClass="btn button-theme slight-left-margin-5"></hf-buttons>
</div>
<a href="#" style="float:right;color:#495057" @click.prevent="preview">Preview</a>
</div>
</div>
<div class="row g-3 align-items-center w-100 mt-4" style="float:right; padding-right: 1.5%">
Expand Down Expand Up @@ -105,6 +106,7 @@ export default {
},
data(){
return{
fileName:"",
orgSetting: {
buttonBGColor: "#f1b319",
buttonTextColor: "#000000",
Expand Down Expand Up @@ -228,9 +230,13 @@ export default {

}
},
methods: {
fileUpload(e) {
var file
methods: {
uploadBtn(){
this.$refs.file.click();
},
fileUpload(e) {
this.fileName =""
let file = this.$refs.file.files;
if((file = e.target.files[0])) {
if(file.size>config.banner.bannersize)
{
Expand All @@ -241,10 +247,9 @@ export default {
// let dataUrl
reader.onload=e=>{
this.orgSetting.logoPath= e.target.result
this.fileName = file.name
}
}


}
},
preview(){
this.$swal.fire({
Expand Down Expand Up @@ -329,6 +334,7 @@ export default {
this.notifyErr(e)
} finally {
this.isLoading = false;
this.fileName = ""
}
}
},
Expand Down