Merge pull request #2770 from dataease/pr@dev@fix_email_task

fix(系统管理-定时报告): 视图附件名称乱码
This commit is contained in:
fit2cloud-chenyw 2022-08-03 13:31:03 +08:00 committed by GitHub
commit 982e8b44ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 16 deletions

View File

@ -132,15 +132,16 @@ public class EmailService {
} }
private MimeMultipart addFiles(MimeMultipart multipart, List<File> files) throws Exception{ private MimeMultipart addFiles(MimeMultipart multipart, List<File> files) throws Exception{
for (int i = 0; i < files.size(); i++) { for (int i = 0; i < files.size(); i++) {
File file = files.get(i); File file = files.get(i);
MimeBodyPart attach = new MimeBodyPart(); MimeBodyPart attach = new MimeBodyPart();
FileDataSource fileDataSource = new FileDataSource(file); FileDataSource fileDataSource = new FileDataSource(file);
attach.setDataHandler(new DataHandler(fileDataSource)); attach.setDataHandler(new DataHandler(fileDataSource));
attach.setFileName(MimeUtility.encodeText(file.getName())); attach.setFileName(MimeUtility.encodeText(file.getName(), "gb2312", null));
multipart.addBodyPart(attach); multipart.addBodyPart(attach);
} }
System.getProperties().setProperty("mail.mime.splitlongparameters", "false");
multipart.setSubType("related"); multipart.setSubType("related");
return multipart; return multipart;
} }
@ -170,6 +171,7 @@ public class EmailService {
} }
public MailInfo mailInfo() { public MailInfo mailInfo() {
System.getProperties().setProperty("mail.mime.splitlongparameters", "false");
String type = ParamConstants.Classify.MAIL.getValue(); String type = ParamConstants.Classify.MAIL.getValue();
List<SystemParameter> paramList = getParamList(type); List<SystemParameter> paramList = getParamList(type);
MailInfo mailInfo = new MailInfo(); MailInfo mailInfo = new MailInfo();

View File

@ -19,16 +19,13 @@
/> />
</el-select> </el-select>
<el-dialog <el-dialog
:visible="dialogShow" :visible="dialogShow"
:show-close="false" :show-close="false"
class="dialog-css" class="dialog-css"
:fullscreen="true" :fullscreen="true"
> >
<div ref="contaninerDiv" :style="{'height': panelHeight + 'px'}" v-if="dialogShow && viewLoaded"> <div v-if="dialogShow && viewLoaded" ref="contaninerDiv" :style="{'height': panelHeight + 'px'}">
<Preview <Preview
:component-data="componentData" :component-data="componentData"
:canvas-style-data="canvasStyleData" :canvas-style-data="canvasStyleData"
@ -42,7 +39,7 @@
选择视图 选择视图
</span> </span>
<span style="float: right;"> <span style="float: right;">
<el-button type="primary" size="mini" @click="closeDialog()">{{ $t('commons.confirm') }}</el-button> <el-button type="primary" size="mini" @click="sureDialog()">{{ $t('commons.confirm') }}</el-button>
<el-button size="mini" @click="cancelDialog()">{{ $t('commons.cancel') }}</el-button> <el-button size="mini" @click="cancelDialog()">{{ $t('commons.cancel') }}</el-button>
</span> </span>
</div> </div>
@ -124,11 +121,9 @@ export default {
}, },
mounted() { mounted() {
this._updateH() this._updateH()
}, },
beforeDestroy() { beforeDestroy() {
this._selectClearFun() this._selectClearFun()
}, },
created() { created() {
this.loadView() this.loadView()
@ -168,11 +163,10 @@ export default {
}, },
_updateH() { _updateH() {
this.$nextTick(() => { this.$nextTick(() => {
if(this.$refs.contaninerDiv) { if (this.$refs.contaninerDiv) {
this.width = this.$refs.contaninerDiv.clientWidth this.width = this.$refs.contaninerDiv.clientWidth
this.panelHeight = this.width * 9 / 16 this.panelHeight = this.width * 9 / 16
} }
}) })
}, },
_popoverShowFun(val) { _popoverShowFun(val) {
@ -181,9 +175,8 @@ export default {
this.$emit('onFoucs') this.$emit('onFoucs')
}, },
_selectRemoveTag(viewId) { _selectRemoveTag(viewId) {
this.selectedViews.forEach(item => { this.$store.getters.panelViews[this.panelId].forEach(item => {
if (item === viewId) { if (item === viewId) {
this.$store.dispatch('task/delView', { 'panelId': this.panelId, 'viewId': item }) this.$store.dispatch('task/delView', { 'panelId': this.panelId, 'viewId': item })
} }
@ -200,13 +193,17 @@ export default {
}, },
openDialog() { openDialog() {
if (this.value && this.value.length) { if (this.value && this.value.length) {
this.idsBeforeOpen = JSON.parse(JSON.stringify(this.value)) this.idsBeforeOpen = JSON.parse(JSON.stringify(this.value))
} }
this.dialogShow = true this.dialogShow = true
}, },
closeDialog() { closeDialog() {
this.dialogShow = false this.dialogShow = false
}, },
sureDialog() {
this.innerValues = JSON.parse(JSON.stringify(this.$store.getters.panelViews[this.panelId]))
this.closeDialog()
},
cancelDialog() { cancelDialog() {
this.innerValues = JSON.parse(JSON.stringify(this.idsBeforeOpen)) this.innerValues = JSON.parse(JSON.stringify(this.idsBeforeOpen))
const viewIds = JSON.parse(JSON.stringify(this.innerValues)) const viewIds = JSON.parse(JSON.stringify(this.innerValues))