技术监督新增查看功能
This commit is contained in:
@@ -22,8 +22,9 @@ const { push, options, currentRoute } = useRouter()
|
||||
// const url = 'http://192.168.1.22:9009/excelreport' + currentRoute.value.href?.split('?')[1]
|
||||
|
||||
const url = '/api-docx/excelreport' + currentRoute.value?.href?.split('?')[1]
|
||||
console.log("🚀 ~ url:", url)
|
||||
const excelOptions = ref({
|
||||
xls: currentRoute.value.href?.split('?')[1].split('.')[1] == 'xls' ? true : false
|
||||
xls: currentRoute.value.href?.split('?')[1].split('.')[1] == 'xls' ? true : true
|
||||
})
|
||||
onMounted(() => {
|
||||
console.log()
|
||||
|
||||
@@ -12,8 +12,24 @@ import { getAccessToken, getTenantId } from '@/utils/auth'
|
||||
import { onBeforeUnmount, ref, shallowRef, onMounted } from 'vue'
|
||||
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import { Boot, IEditorConfig, IToolbarConfig } from '@wangeditor/editor'
|
||||
import formulaModule from '@wangeditor/plugin-formula'
|
||||
|
||||
let isFormulaModuleLoaded = false;
|
||||
// 注册。要在创建编辑器之前注册,且只能注册一次,不可重复注册。
|
||||
if (!isFormulaModuleLoaded) {
|
||||
isFormulaModuleLoaded = true;
|
||||
|
||||
}
|
||||
try {
|
||||
Boot.registerModule(formulaModule)
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
|
||||
// 编辑器实例,必须用 shallowRef
|
||||
const editorRef = shallowRef()
|
||||
|
||||
const adminInfo = useAdminInfo()
|
||||
// 内容 HTML
|
||||
const valueHtml = ref('<p>hello</p>')
|
||||
@@ -25,8 +41,16 @@ onMounted(() => {
|
||||
}, 1500)
|
||||
})
|
||||
|
||||
const toolbarConfig = {
|
||||
excludeKeys: ['fullScreen', 'emotion','insertFormula']
|
||||
|
||||
const toolbarConfig: Partial<IToolbarConfig> = {
|
||||
// excludeKeys: ['fullScreen', 'emotion']
|
||||
insertKeys: {
|
||||
index: 0,
|
||||
keys: [
|
||||
'insertFormula', // “插入公式”菜单
|
||||
// 'editFormula' // “编辑公式”菜单
|
||||
],
|
||||
},
|
||||
}
|
||||
let sever = '/api/system-boot/file/upload'
|
||||
// 本地加api
|
||||
@@ -34,7 +58,7 @@ let sever = '/api/system-boot/file/upload'
|
||||
// sever = '/api' + sever
|
||||
// }
|
||||
type InsertFnType = (url: string, alt: string, href: string) => void
|
||||
const editorConfig = {
|
||||
const editorConfig: Partial<IEditorConfig> = {
|
||||
placeholder: '请输入内容...',
|
||||
MENU_CONF: {
|
||||
uploadImage: {
|
||||
@@ -44,11 +68,11 @@ const editorConfig = {
|
||||
compress: true,
|
||||
uploadFileName: 'file',
|
||||
withCredentials: true,
|
||||
|
||||
|
||||
headers: {
|
||||
Accept: '*',
|
||||
Authorization: adminInfo.getToken(),
|
||||
|
||||
Authorization: adminInfo.getToken(),
|
||||
|
||||
},
|
||||
meta: { path: '/supervision/' },
|
||||
timeout: 0,
|
||||
@@ -58,16 +82,17 @@ const editorConfig = {
|
||||
}
|
||||
},
|
||||
hoverbarKeys: {
|
||||
formula: {
|
||||
menuKeys: ['editFormula'], // “编辑公式”菜单
|
||||
formula: {
|
||||
menuKeys: ['editFormula'], // “编辑公式”菜单
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
// 组件销毁时,也及时销毁编辑器
|
||||
onBeforeUnmount(() => {
|
||||
const editor = editorRef.value
|
||||
if (editor == null) return
|
||||
|
||||
editor.destroy()
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user