2019-10-29 06:46:44 +00:00
|
|
|
const Vue = require('vue');
|
2019-10-31 11:43:04 +00:00
|
|
|
const config = require('../config');
|
|
|
|
|
2019-10-29 06:46:44 +00:00
|
|
|
const imageSrc = {
|
|
|
|
methods: {
|
2019-10-31 11:43:04 +00:00
|
|
|
getEmailSrc(image) {
|
2019-10-29 06:46:44 +00:00
|
|
|
let src = `cid:${image}`;
|
|
|
|
|
2021-04-06 11:46:38 +00:00
|
|
|
if (this.isPreview)
|
2019-11-07 10:19:05 +00:00
|
|
|
src = `/api/${this.$options.name}/assets/images/${image}`;
|
2019-10-29 06:46:44 +00:00
|
|
|
|
|
|
|
return src;
|
2019-10-31 11:43:04 +00:00
|
|
|
},
|
|
|
|
getReportSrc(image) {
|
2019-11-07 10:19:05 +00:00
|
|
|
const assetsPath = `${config.app.host}/api/${this.$options.name}`;
|
|
|
|
const imagePath = `${assetsPath}/assets/images/${image}`;
|
2019-11-04 07:54:21 +00:00
|
|
|
|
2019-10-31 11:43:04 +00:00
|
|
|
return imagePath;
|
2019-10-29 06:46:44 +00:00
|
|
|
}
|
2019-11-07 10:19:05 +00:00
|
|
|
}
|
2019-10-29 06:46:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Vue.mixin(imageSrc);
|