|
@@ -6,7 +6,9 @@
|
|
|
<MainBodyTemplate ref="mainBodyTemplate" :type="routerQuery.type" menu="notice" :disabled="disabled" @sendFiles="getFiles"></MainBodyTemplate>
|
|
<MainBodyTemplate ref="mainBodyTemplate" :type="routerQuery.type" menu="notice" :disabled="disabled" @sendFiles="getFiles"></MainBodyTemplate>
|
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="正文" name="2">
|
|
<el-tab-pane label="正文" name="2">
|
|
|
- <tinymce-editor :disabled="disabled" v-model="formData.content" :init="tinymceConfig" />
|
|
|
|
|
|
|
+ <div v-show="tabValue === '2'" style="min-height: 525px;">
|
|
|
|
|
+ <tinymce-editor v-if="tinymceConfig && tabValue === '2'" :disabled="disabled" v-model="formData.content" :init="tinymceConfig" />
|
|
|
|
|
+ </div>
|
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="附件查看" name="3">
|
|
<el-tab-pane label="附件查看" name="3">
|
|
|
<div class="file-container">
|
|
<div class="file-container">
|
|
@@ -79,6 +81,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ drawer: false,
|
|
|
businessId: '',
|
|
businessId: '',
|
|
|
processSubmitDialogFlag: false,
|
|
processSubmitDialogFlag: false,
|
|
|
currentFileUrl: '',
|
|
currentFileUrl: '',
|
|
@@ -93,14 +96,24 @@ export default {
|
|
|
fileList: [],
|
|
fileList: [],
|
|
|
tinymceConfig: {
|
|
tinymceConfig: {
|
|
|
height: 525,
|
|
height: 525,
|
|
|
|
|
+ resize: false,
|
|
|
|
|
+ autoresize_bottom_margin: 0,
|
|
|
|
|
+ auto_focus: false,
|
|
|
|
|
+ scroll_padding: 0,
|
|
|
|
|
+ scroll_padding_bottom: 0,
|
|
|
images_upload_handler: (blobInfo, success, error) => {
|
|
images_upload_handler: (blobInfo, success, error) => {
|
|
|
const file = blobInfo.blob();
|
|
const file = blobInfo.blob();
|
|
|
|
|
+ console.log('file~~~', file);
|
|
|
|
|
+ // 判断 file 是否为有效的文件对象
|
|
|
|
|
+ if (!file || !(file instanceof File) || file.size === 0) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
// 使用 axios 上传,实际开发这段建议写在 api 中再调用 api
|
|
// 使用 axios 上传,实际开发这段建议写在 api 中再调用 api
|
|
|
uploadFile({
|
|
uploadFile({
|
|
|
module: 'main',
|
|
module: 'main',
|
|
|
multiPartFile: file
|
|
multiPartFile: file
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (res.data) {
|
|
if (res.data) {
|
|
|
console.log('images_upload_handler~~~', res);
|
|
console.log('images_upload_handler~~~', res);
|
|
|
success(res.data.url);
|
|
success(res.data.url);
|
|
@@ -110,34 +123,33 @@ export default {
|
|
|
}).catch(error => {
|
|
}).catch(error => {
|
|
|
this.$message.error('文件上传失败');
|
|
this.$message.error('文件上传失败');
|
|
|
});
|
|
});
|
|
|
- // const formData = new FormData();
|
|
|
|
|
- // formData.append('file', file, file.name);
|
|
|
|
|
- // request.post('/file/upload', formData).then(res => {
|
|
|
|
|
- // if (res.data.data.url) {
|
|
|
|
|
- // success(res.data.data.url);
|
|
|
|
|
- // } else {
|
|
|
|
|
- // error(res.data.message);
|
|
|
|
|
- // }
|
|
|
|
|
- // }).catch(e => {
|
|
|
|
|
- // console.error(e);
|
|
|
|
|
- // error(e.message);
|
|
|
|
|
- // });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- this.routerQuery = this.isApprove ? this.query : this.$route.query;
|
|
|
|
|
-
|
|
|
|
|
- this.getDetail();
|
|
|
|
|
|
|
+ // this.routerQuery = this.isApprove ? this.query : this.$route.query;
|
|
|
|
|
+ this.routerQuery = this.query;
|
|
|
|
|
+ this.tabValue = '1';
|
|
|
|
|
+ console.log('this.query~~~', this.query);
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.getDetail();
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
disabled() {
|
|
disabled() {
|
|
|
return this.routerQuery.type == 'detail';
|
|
return this.routerQuery.type == 'detail';
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // openDrawer(query) {
|
|
|
|
|
+ // this.routerQuery = this.isApprove ? this.query : query;
|
|
|
|
|
+ // this.drawer = true;
|
|
|
|
|
+ // this.$nextTick(() => {
|
|
|
|
|
+ // this.getDetail();
|
|
|
|
|
+ // })
|
|
|
|
|
+ // },
|
|
|
filesOpen(item) {
|
|
filesOpen(item) {
|
|
|
this.currentFileUrl = setFileUrl(item);
|
|
this.currentFileUrl = setFileUrl(item);
|
|
|
console.log('currentFileUrl~~~', this.currentFileUrl);
|
|
console.log('currentFileUrl~~~', this.currentFileUrl);
|
|
@@ -224,7 +236,7 @@ export default {
|
|
|
}else {
|
|
}else {
|
|
|
loading.close();
|
|
loading.close();
|
|
|
this.$message.success('保存成功');
|
|
this.$message.success('保存成功');
|
|
|
- this.$router.go(-1);
|
|
|
|
|
|
|
+ this.cancel();
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
.catch((e) => {
|
|
.catch((e) => {
|
|
@@ -260,7 +272,8 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
cancel() {
|
|
cancel() {
|
|
|
- this.$router.go(-1);
|
|
|
|
|
|
|
+ this.tabValue = '1';
|
|
|
|
|
+ this.$emit('done');
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|