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>
<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" />
<Editor
style="overflow-y: hidden"
@ -24,23 +24,59 @@
<script setup>
import { shallowRef, onBeforeUnmount, watch, ref } from 'vue';
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 { Editor, Toolbar } from '@wangeditor/editor-for-vue';
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;
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 = {
async customUpload(file, insertFn) {
try {
const formData = new FormData();
formData.append('file', file);
let res = await fileApi.uploadFile(formData, FILE_FOLDER_TYPE_ENUM.COMMON.value);
let data = res.data;
insertFn(data.fileUrl);
SmartLoading.show();
// const formData = new FormData();
// formData.append('file', file);
// let res = await fileApi.uploadFile(formData, FILE_FOLDER_TYPE_ENUM.COMMON.value);
// let data = res.data;
getImg(file).then((data) => {
console.log(data);
insertFn(data);
});
//insertFn(data.fileUrl);
} catch (error) {
smartSentry.captureError(error);
}
@ -117,4 +153,8 @@
.w-e-full-screen-container {
z-index: 9999 !important;
}
.myeditor >>> button[data-tooltip="编辑图片"]{
display: none !important;
}
</style>

View File

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

View File

@ -3,7 +3,9 @@
<div class="mask"></div>
<div class="tool">
<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>
<img class="viewimg" :src="src" alt="" />
@ -42,6 +44,7 @@ const props = defineProps({
default: 0,
},
});
const emits = defineEmits(['openEditor']);
const visible = ref(false);
const priviewImg = (value) => {

View File

@ -21,7 +21,7 @@
<a-card class="employee-container" style="border-radius: 10px;">
<div class="header">
<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-space>
<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;">
<div class="header">
<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-space>
<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 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 = {
@ -113,7 +113,7 @@ const dealToolbarConfig = {
}
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({
@ -233,4 +233,5 @@ onMounted(()=>{
.fform{
width: 30vw;
}
</style>