2019-11-16 10:21:14 +03:00
|
|
|
/**
|
|
|
|
* First we will load all of this project's JavaScript dependencies which
|
|
|
|
* includes Vue and other libraries. It is a great starting point when
|
|
|
|
* building robust, powerful web applications using Vue and Laravel.
|
|
|
|
*/
|
|
|
|
|
|
|
|
require('./../../bootstrap');
|
|
|
|
|
|
|
|
import Vue from 'vue';
|
|
|
|
|
|
|
|
import Global from './../../mixins/global';
|
|
|
|
|
|
|
|
import Form from './../../plugins/form';
|
|
|
|
import BulkAction from './../../plugins/bulk-action';
|
2019-11-22 15:16:57 +03:00
|
|
|
import HtmlEditor from './../../components/Inputs/HtmlEditor';
|
2019-11-16 10:21:14 +03:00
|
|
|
|
|
|
|
const app = new Vue({
|
|
|
|
el: '#app',
|
2019-11-22 15:16:57 +03:00
|
|
|
|
2019-11-16 10:21:14 +03:00
|
|
|
mixins: [
|
|
|
|
Global
|
|
|
|
],
|
2019-11-22 15:16:57 +03:00
|
|
|
|
|
|
|
components: {
|
|
|
|
HtmlEditor
|
|
|
|
},
|
|
|
|
|
2019-11-16 10:21:14 +03:00
|
|
|
data: function () {
|
|
|
|
return {
|
|
|
|
form: new Form('setting'),
|
2019-12-20 20:12:43 +03:00
|
|
|
bulk_action: new BulkAction('settings'),
|
|
|
|
email:{
|
|
|
|
sendmailPath:true,
|
|
|
|
smtpHost:true,
|
|
|
|
smtpPort:true,
|
|
|
|
smtpUsername:true,
|
|
|
|
smtpPassword:true,
|
|
|
|
smtpEncryption:true,
|
2019-12-25 19:09:04 +03:00
|
|
|
},
|
|
|
|
invoice_form: new Form('template'),
|
|
|
|
template: {
|
|
|
|
modal: false,
|
|
|
|
title: '',
|
|
|
|
message: '',
|
|
|
|
html: '',
|
|
|
|
errors: new Error()
|
2019-12-20 20:12:43 +03:00
|
|
|
}
|
2019-11-16 10:21:14 +03:00
|
|
|
}
|
2019-12-05 18:47:42 +08:00
|
|
|
},
|
|
|
|
|
2019-12-20 20:12:43 +03:00
|
|
|
mounted(){
|
|
|
|
this.onChangeProtocol(this.form.protocol);
|
|
|
|
},
|
|
|
|
|
|
|
|
methods:{
|
|
|
|
onChangeProtocol(protocol){
|
|
|
|
switch(protocol){
|
|
|
|
case "smtp":
|
|
|
|
this.email.sendmailPath = true;
|
|
|
|
this.email.smtpHost = false;
|
|
|
|
this.email.smtpPort = false;
|
|
|
|
this.email.smtpUsername = false;
|
|
|
|
this.email.smtpPassword = false;
|
|
|
|
this.email.smtpEncryption = false;
|
|
|
|
break;
|
|
|
|
case "sendmail":
|
|
|
|
this.email.sendmailPath = false;
|
|
|
|
this.email.smtpHost = true;
|
|
|
|
this.email.smtpPort = true;
|
|
|
|
this.email.smtpUsername = true;
|
|
|
|
this.email.smtpPassword = true;
|
|
|
|
this.email.smtpEncryption = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
this.email.sendmailPath = true;
|
|
|
|
this.email.smtpHost = true;
|
|
|
|
this.email.smtpPort = true;
|
|
|
|
this.email.smtpUsername = true;
|
|
|
|
this.email.smtpPassword = true;
|
|
|
|
this.email.smtpEncryption = true;
|
|
|
|
break;
|
2019-12-05 18:47:42 +08:00
|
|
|
}
|
2019-12-25 19:09:04 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
onTemplate() {
|
|
|
|
this.template.modal = true;
|
|
|
|
|
|
|
|
this.invoice_form = new Form('template');
|
|
|
|
|
|
|
|
this.invoice_form.template = this.invoice_form._template;
|
|
|
|
},
|
|
|
|
|
|
|
|
addTemplate() {
|
|
|
|
if (this.invoice_form.template != 1) {
|
|
|
|
this.invoice_form.submit();
|
|
|
|
|
|
|
|
this.template.errors = this.invoice_form.errors;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
closeTemplate() {
|
|
|
|
this.template = {
|
|
|
|
modal: false,
|
|
|
|
title: '',
|
|
|
|
message: '',
|
|
|
|
errors: this.invoice_form.errors
|
|
|
|
};
|
|
|
|
},
|
2019-11-16 10:21:14 +03:00
|
|
|
}
|
|
|
|
});
|