This commit is contained in:
zoujiandong 2025-07-15 10:35:27 +08:00
parent 8637d3f96c
commit 301840eab7
4 changed files with 59 additions and 15 deletions

View File

@ -9,7 +9,7 @@
* *
--> -->
<template> <template>
<div style="border: 1px solid #ccc"> <div style="border: 1px solid #ccc" class="myeditor">
<Toolbar style="border-bottom: 1px solid #ccc" :editor="editorRef" :defaultConfig="toolbarConfig" /> <Toolbar style="border-bottom: 1px solid #ccc" :editor="editorRef" :defaultConfig="toolbarConfig" />
<Editor <Editor
style="overflow-y: hidden" style="overflow-y: hidden"
@ -24,23 +24,59 @@
<script setup> <script setup>
import { shallowRef, onBeforeUnmount, watch, ref } from 'vue'; import { shallowRef, onBeforeUnmount, watch, ref } from 'vue';
import { FILE_FOLDER_TYPE_ENUM } from '/@/constants/support/file-const'; import { FILE_FOLDER_TYPE_ENUM } from '/@/constants/support/file-const';
import { fileApi } from '/@/api/support/file/file-api'; import { caseplatformCaseApi } from '/@/api/business/case/caseplatform-case-api';
import '@wangeditor/editor/dist/css/style.css'; import '@wangeditor/editor/dist/css/style.css';
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'; import { Editor, Toolbar } from '@wangeditor/editor-for-vue';
import { smartSentry } from '/@/lib/smart-sentry'; import { smartSentry } from '/@/lib/smart-sentry';
import { SmartLoading } from '/@/components/framework/smart-loading';
// //
import dayjs from 'dayjs';
import { FileUtil } from '/@/utils/fileutil';
const editorConfig = props.editorConfig; const editorConfig = props.editorConfig;
console.log(editorConfig);
const getImg = (file) => {
return new Promise((resolve, reject) => {
caseplatformCaseApi.getOssSign(1).then((res) => {
console.log(res.data);
let { accessid, dir, policy, signature, host } = res.data;
let filename = dayjs().format('YYYYMMDDHHmmss') + FileUtil.UUID() + '.' + 'png';
let formData = new FormData();
formData.append('OSSAccessKeyId', accessid);
formData.append('policy', policy);
formData.append('signature', signature);
formData.append('key', dir + filename);
formData.append('file', file, filename);
formData.append('success_action_status', 200);
caseplatformCaseApi
.ossUpload(host, formData)
.then((res) => {
console.log(host + dir + filename);
resolve(host + dir + filename);
SmartLoading.hide();
})
.catch((err) => {
alert('上传失败');
SmartLoading.hide();
});
});
});
};
// //
let customUpload = { let customUpload = {
async customUpload(file, insertFn) { async customUpload(file, insertFn) {
try { try {
const formData = new FormData(); SmartLoading.show();
formData.append('file', file); // const formData = new FormData();
let res = await fileApi.uploadFile(formData, FILE_FOLDER_TYPE_ENUM.COMMON.value); // formData.append('file', file);
let data = res.data; // let res = await fileApi.uploadFile(formData, FILE_FOLDER_TYPE_ENUM.COMMON.value);
insertFn(data.fileUrl); // let data = res.data;
getImg(file).then((data) => {
console.log(data);
insertFn(data);
});
//insertFn(data.fileUrl);
} catch (error) { } catch (error) {
smartSentry.captureError(error); smartSentry.captureError(error);
} }
@ -117,4 +153,8 @@
.w-e-full-screen-container { .w-e-full-screen-container {
z-index: 9999 !important; z-index: 9999 !important;
} }
.myeditor >>> button[data-tooltip="编辑图片"]{
display: none !important;
}
</style> </style>

View File

@ -313,8 +313,8 @@
</a-tabs> </a-tabs>
<template #footer> <template #footer>
<a-space v-if="caseVO.status == 0"> <a-space v-if="caseVO.status == 0">
<a-button @click="cancelExamine">审核拒绝</a-button> <a-button @click="cancelExamine" v-privilege="'case-system:case:examine'">审核拒绝</a-button>
<a-button type="primary" @click="examine">审核通过</a-button> <a-button type="primary" @click="examine" v-privilege="'case-system:case:examine'">审核通过</a-button>
</a-space> </a-space>
</template> </template>
</a-drawer> </a-drawer>

View File

@ -3,7 +3,9 @@
<div class="mask"></div> <div class="mask"></div>
<div class="tool"> <div class="tool">
<eye-outlined style="color: #fff; font-size: 16px; cursor: pointer" @click="priviewImg" /> <eye-outlined style="color: #fff; font-size: 16px; cursor: pointer" @click="priviewImg" />
<form-outlined style="color: #fff; font-size: 16px; margin-left: 10px; cursor: pointer" @click="showeditor" /> <form-outlined style="color: #fff; font-size: 16px; margin-left: 10px; cursor: pointer" @click="showeditor" v-privilege="'case-system:case:mainDiagnose'" v-if="type=='mainDiagnose'"/>
<form-outlined style="color: #fff; font-size: 16px; margin-left: 10px; cursor: pointer" @click="showeditor" v-privilege="'case-system:case:checkPermission'" v-else-if="type=='dpmas'"/>
<form-outlined style="color: #fff; font-size: 16px; margin-left: 10px; cursor: pointer" @click="showeditor" v-privilege="'case-system:case:checkdataImg'" v-else/>
</div> </div>
<img class="viewimg" :src="src" alt="" /> <img class="viewimg" :src="src" alt="" />
@ -42,6 +44,7 @@ const props = defineProps({
default: 0, default: 0,
}, },
}); });
const emits = defineEmits(['openEditor']); const emits = defineEmits(['openEditor']);
const visible = ref(false); const visible = ref(false);
const priviewImg = (value) => { const priviewImg = (value) => {

View File

@ -21,7 +21,7 @@
<a-card class="employee-container" style="border-radius: 10px;"> <a-card class="employee-container" style="border-radius: 10px;">
<div class="header"> <div class="header">
<a-row justify="space-around"> <a-row justify="space-around">
<a-col :span="12"><a-typography-title :level="5">投稿说明</a-typography-title></a-col> <a-col :span="12"><a-typography-title :level="5">操作说明</a-typography-title></a-col>
<a-col :span="12" style="justify-content: end; display: flex;"> <a-col :span="12" style="justify-content: end; display: flex;">
<a-space> <a-space>
<a-button type="primary" @click="save(2)" v-privilege="'case-support:config:update'">保存</a-button> <a-button type="primary" @click="save(2)" v-privilege="'case-support:config:update'">保存</a-button>
@ -51,7 +51,7 @@
<a-card class="employee-container" style="border-radius: 10px;"> <a-card class="employee-container" style="border-radius: 10px;">
<div class="header"> <div class="header">
<a-row justify="space-around"> <a-row justify="space-around">
<a-col :span="12"><a-typography-title :level="5">隐私协议</a-typography-title></a-col> <a-col :span="12"><a-typography-title :level="5">认证说明</a-typography-title></a-col>
<a-col :span="12" style="justify-content: end; display: flex;"> <a-col :span="12" style="justify-content: end; display: flex;">
<a-space> <a-space>
<a-button type="primary" @click="save(4)" v-privilege="'case-support:config:update'">保存</a-button> <a-button type="primary" @click="save(4)" v-privilege="'case-support:config:update'">保存</a-button>
@ -105,7 +105,7 @@ const dealRef = ref();
const privacyRef = ref(); const privacyRef = ref();
const rubricToolbarConfig = { const rubricToolbarConfig = {
toolbarKeys : ['bold', 'underline', 'italic', 'through', 'code', 'sub', 'sup', 'clearStyle', 'color', 'bgColor', 'fontSize', 'fontFamily', 'indent', 'delIndent', 'justifyLeft', 'justifyRight', 'justifyCenter', 'justifyJustify', 'lineHeight', 'insertImage', 'deleteImage', 'editImage', 'divider', 'insertLink', 'editLink', 'unLink', 'viewLink', 'codeBlock', 'blockquote', 'headerSelect', 'redo', 'undo', 'fullScreen', 'enter', 'bulletedList', 'numberedList' ] toolbarKeys : ['bold', 'underline', 'italic', 'through', 'code', 'sub', 'sup', 'clearStyle', 'color', 'bgColor', 'fontSize', 'fontFamily', 'indent', 'delIndent', 'justifyLeft', 'justifyRight', 'justifyCenter', 'justifyJustify', 'lineHeight', 'insertImage', 'deleteImage', 'editImage', 'divider', 'insertLink', 'editLink', 'unLink', 'viewLink', 'codeBlock', 'blockquote', 'headerSelect', 'redo', 'undo', 'fullScreen', 'enter', 'bulletedList', 'numberedList','uploadImage' ]
} }
const dealToolbarConfig = { const dealToolbarConfig = {
@ -113,7 +113,7 @@ const dealToolbarConfig = {
} }
const privacyToolbarConfig = { const privacyToolbarConfig = {
toolbarKeys : ['bold', 'underline', 'italic', 'through', 'code', 'sub', 'sup', 'clearStyle', 'color', 'bgColor', 'fontSize', 'fontFamily', 'indent', 'delIndent', 'justifyLeft', 'justifyRight', 'justifyCenter', 'justifyJustify', 'lineHeight', 'insertImage', 'deleteImage', 'editImage', 'divider', 'insertLink', 'editLink', 'unLink', 'viewLink', 'codeBlock', 'blockquote', 'headerSelect', 'redo', 'undo', 'fullScreen', 'enter', 'bulletedList', 'numberedList' ] toolbarKeys : ['bold', 'underline', 'italic', 'through', 'code', 'sub', 'sup', 'clearStyle', 'color', 'bgColor', 'fontSize', 'fontFamily', 'indent', 'delIndent', 'justifyLeft', 'justifyRight', 'justifyCenter', 'justifyJustify', 'lineHeight', 'insertImage', 'deleteImage', 'editImage', 'divider', 'insertLink', 'editLink', 'unLink', 'viewLink', 'codeBlock', 'blockquote', 'headerSelect', 'redo', 'undo', 'fullScreen', 'enter', 'bulletedList', 'numberedList']
} }
const rubricForm = reactive({ const rubricForm = reactive({
@ -233,4 +233,5 @@ onMounted(()=>{
.fform{ .fform{
width: 30vw; width: 30vw;
} }
</style> </style>