Merge branch 'xingyy' into dev
This commit is contained in:
commit
f876ee7bbe
File diff suppressed because it is too large
Load Diff
@ -62,6 +62,15 @@ const fileInfo = computed(() => {
|
|||||||
return fileTypes[extension] || fileTypes.DEFAULT
|
return fileTypes[extension] || fileTypes.DEFAULT
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 判断文件是否可以预览
|
||||||
|
const canPreview = computed(() => {
|
||||||
|
const extension = getFileExtension(props.extra.path)
|
||||||
|
return extension === 'PDF' ||
|
||||||
|
EXCEL_EXTENSIONS.includes(extension) ||
|
||||||
|
WORD_EXTENSIONS.includes(extension) ||
|
||||||
|
PPT_EXTENSIONS.includes(extension)
|
||||||
|
})
|
||||||
|
|
||||||
// 获取文件扩展名
|
// 获取文件扩展名
|
||||||
function getFileExtension(filepath) {
|
function getFileExtension(filepath) {
|
||||||
const parts = filepath?.split('.')
|
const parts = filepath?.split('.')
|
||||||
@ -86,14 +95,19 @@ const strokeDashoffset = computed(() =>
|
|||||||
|
|
||||||
// 处理文件点击事件
|
// 处理文件点击事件
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
if(!props.extra.is_uploading){
|
// 只有在不上传中且文件类型支持预览时才打开预览窗口
|
||||||
window.open(
|
if(!props.extra.is_uploading) {
|
||||||
`${import.meta.env.VITE_PAGE_URL}/office?url=${props.extra.path}`,
|
if(canPreview.value){
|
||||||
'_blank',
|
window.open(
|
||||||
'width=1200,height=900,left=200,top=200,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no'
|
`${import.meta.env.VITE_PAGE_URL}/office?url=${props.extra.path}`,
|
||||||
);
|
'_blank',
|
||||||
|
'width=1200,height=900,left=200,top=200,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no'
|
||||||
|
);
|
||||||
|
}else{
|
||||||
|
window['$message'].warning('暂不支持在线预览该类型文件')
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function downloadFileWithProgress(resourceUrl, filename) {
|
function downloadFileWithProgress(resourceUrl, filename) {
|
||||||
@ -114,7 +128,7 @@ const handleDownload = () => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="file-message flex flex-col" @click="handleClick">
|
<div class="file-message flex flex-col can-preview" @click="handleClick">
|
||||||
<!-- 文件头部信息 -->
|
<!-- 文件头部信息 -->
|
||||||
<div class="file-header">
|
<div class="file-header">
|
||||||
<!-- 文件名 -->
|
<!-- 文件名 -->
|
||||||
@ -184,7 +198,14 @@ const handleDownload = () => {
|
|||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||||
padding: 0 14px;
|
padding: 0 14px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.can-preview {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
&:hover {
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-header {
|
.file-header {
|
||||||
|
@ -38,23 +38,23 @@ export function useSessionMenu() {
|
|||||||
|
|
||||||
const options: any[] = []
|
const options: any[] = []
|
||||||
|
|
||||||
if (item.talk_type == 1) {
|
// if (item.talk_type == 1) {
|
||||||
options.push({
|
// options.push({
|
||||||
|
|
||||||
label: '好友信息',
|
// label: '好友信息',
|
||||||
key: 'info'
|
// key: 'info'
|
||||||
})
|
// })
|
||||||
|
|
||||||
options.push({
|
// options.push({
|
||||||
|
|
||||||
label: '修改备注',
|
// label: '修改备注',
|
||||||
key: 'remark'
|
// key: 'remark'
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
|
|
||||||
options.push({
|
options.push({
|
||||||
|
|
||||||
label: item.is_top ? '取消置顶' : '会话置顶',
|
label: item.is_top ? '取消置顶' : '置顶',
|
||||||
key: 'top'
|
key: 'top'
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ export function useSessionMenu() {
|
|||||||
|
|
||||||
options.push({
|
options.push({
|
||||||
|
|
||||||
label: '移除会话',
|
label: '删除聊天',
|
||||||
key: 'remove'
|
key: 'remove'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ export function isLoggedIn() {
|
|||||||
*/
|
*/
|
||||||
export function getAccessToken() {
|
export function getAccessToken() {
|
||||||
// return storage.get(AccessToken) || ''
|
// return storage.get(AccessToken) || ''
|
||||||
return JSON.parse(localStorage.getItem('token'))||'79b5c732d96d2b27a48a99dfd4a5566c43aaa5796242e854ebe3ffc198d6876b9628e7b764d9af65ab5dbb2d517ced88170491b74b048c0ba827c0d3741462cb89dc59ed46653a449af837a8262941caaef1334d640773710f8cd96473bacfb190cba595a5d6a9c87d70f0999a3ebb41147213b31b4bdccffca66a56acf3baab5af0154f0dce360079f37709f78e13711036899344bddb0fb4cf0f2890287cb62c3fcbe33368caa5e213624577be8b8420ab75b1f50775ee16142a4321c5d56995f37354a66a969da98d95ba6e65d142ed097e04b411c1ebad2f62866d0ec7e1838420530a9941dbbcd00490199f8b8993ebccf0349a53e3197efc45b9dbe3f2bf1dc0dddce6787811964e76efefec3b3fd39fce15d43989c156413f12de3f0c74c1ff1d3c5da214d3bcefef7546498e37fa73453c749a56ea66777488bd3550'
|
return JSON.parse(localStorage.getItem('token'))||'46d71a72d8d845ad7ed23eba9bdde260e635407190c2ce1bf7fd22088e41682ea07773ec65cae8946d2003f264d55961f96e0fc5da10eb96d3a348c1664e9644ce2108c311309f398ae8ea1b8200bfd490e5cb6e8c52c9e5d493cbabb163368f8351420451a631dbfa749829ee4cda49b77b5ed2d3dced5d0f2b7dd9ee76ba5465c84a17c23af040cd92b6b2a4ea48befbb5c729dcdad0a9c9668befe84074cc24f78899c1d947f8e7f94c7eda5325b8ed698df729e76febb98549ef3482ae942fb4f4a1c92d21836fa784728f0c5483aab2760a991b6b36e6b10c84f840a6433a6ecc31dee36e8f1c6158818bc89d2222dd6882c9bea84c2a8463737b8c2ebff9ca7c6d060fb963530bd14a2520dd9f2da63d38ec62765f787ba4ecad169369e97555f4f32b390f4cff376e30e2cb64f992f0f42a75cf0a559462e6c4e9cffe'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -31,7 +31,8 @@ const onSingleForward = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const onMultiDelete = () => {
|
const onMultiDelete = () => {
|
||||||
confirmBox({
|
if(dialogueStore.selectItems.length>0){
|
||||||
|
confirmBox({
|
||||||
content:'确定删除聊天记录',
|
content:'确定删除聊天记录',
|
||||||
confirmText:'删除'
|
confirmText:'删除'
|
||||||
}).then(()=>{
|
}).then(()=>{
|
||||||
@ -42,6 +43,10 @@ if (!msgIds.length) return
|
|||||||
dialogueStore.ApiDeleteRecord(msgIds)
|
dialogueStore.ApiDeleteRecord(msgIds)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
}else{
|
||||||
|
window['$message'].warning('请选择聊天记录')
|
||||||
|
}
|
||||||
|
|
||||||
// 批量删除
|
// 批量删除
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,6 @@ const config = {
|
|||||||
},
|
},
|
||||||
documentType,
|
documentType,
|
||||||
editorConfig: {
|
editorConfig: {
|
||||||
|
|
||||||
mode: 'view',
|
mode: 'view',
|
||||||
lang: 'zh-CN',
|
lang: 'zh-CN',
|
||||||
user: {
|
user: {
|
||||||
|
Loading…
Reference in New Issue
Block a user