diff --git a/src/assets/css/naive-ui-adjust.less b/src/assets/css/naive-ui-adjust.less index 6a7276b..e3685d7 100644 --- a/src/assets/css/naive-ui-adjust.less +++ b/src/assets/css/naive-ui-adjust.less @@ -4,6 +4,9 @@ color: #fff!important; } +.n-checkbox-box-wrapper .n-checkbox-box{ + border-radius: 50%; +} /*表格头多选框颜色调整避免和表头颜色冲突*/ .n-data-table-thead .n-data-table-tr .n-checkbox-box{ background: #fff; diff --git a/src/assets/image/zu6146@2x.png b/src/assets/image/zu6146@2x.png new file mode 100644 index 0000000..c155e51 Binary files /dev/null and b/src/assets/image/zu6146@2x.png differ diff --git a/src/components/talk/message/FileMessage.vue b/src/components/talk/message/FileMessage.vue index 0a3670f..7a91918 100644 --- a/src/components/talk/message/FileMessage.vue +++ b/src/components/talk/message/FileMessage.vue @@ -87,61 +87,28 @@ const strokeDashoffset = computed(() => // 处理文件点击事件 const handleClick = () => { + console.log('handleClick') window.open( `${window.location.origin}/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' ); } -/** - * 触发浏览器下载文件,通常会显示下载进度。 - * @param {string} resourceUrl 文件的URL地址。 - * @param {string} [filename] 可选参数,指定下载文件的名称。如果未提供,浏览器会尝试从URL或响应头中推断。 - */ + function downloadFileWithProgress(resourceUrl, filename) { - // 1. 创建一个 元素 - const link = document.createElement('a'); - - // 2. 设置 href 属性为资源 URL - link.href = resourceUrl; - - // 3. 设置 download 属性 - // 如果提供了 filename,则使用它;否则,让浏览器自行决定文件名。 - // 设置 download 属性会提示浏览器下载链接指向的资源,而不是导航到它。 - if (filename) { - link.download = filename; - } else { - // 你也可以选择不设置 download,或者尝试从 resourceUrl 中提取文件名 - // 例如: link.download = resourceUrl.substring(resourceUrl.lastIndexOf('/') + 1); - // 但最可靠的方式是服务器在 Content-Disposition 响应头中指定文件名 - link.download = ''; // 设置为空字符串也通常会触发下载行为 - } - - // 4. 将 元素添加到文档中(某些浏览器需要这样才能触发点击) - document.body.appendChild(link); - - // 5. 编程方式点击链接以开始下载 - link.click(); - - // 6. 从文档中移除 元素(完成任务后清理) - document.body.removeChild(link); - - console.log(`已为 "${resourceUrl}" 发起下载请求。`); + const iframe = document.createElement('iframe'); + iframe.style.display = 'none'; + iframe.src = resourceUrl; + document.body.appendChild(iframe); + setTimeout(() => { + document.body.removeChild(iframe); + }, 60000); } // 处理下载事件 const handleDownload = () => { downloadFileWithProgress(props.extra.path,props.extra.name) - // const url = props.extra.path; - // if (!url) return; - // const a = document.createElement('a'); - // a.href = url; - // a.download = url.split('/').pop() || 'download'; - // document.body.appendChild(a); - // a.click(); - // document.body.removeChild(a); - console.log('data',props.data) } diff --git a/src/store/modules/dialogue.js b/src/store/modules/dialogue.js index 78526b7..6f22f40 100644 --- a/src/store/modules/dialogue.js +++ b/src/store/modules/dialogue.js @@ -5,9 +5,8 @@ import { ServePublishMessage, ServeCollectEmoticon } from '@/api/chat' -import { ServeGetGroupMembers } from '@/api/group' +import { ServeGetGroupMembers,ServeGroupDetail } from '@/api/group.js' import { useEditorStore } from './editor' - // 键盘消息事件定时器 let keyboardTimeout = null @@ -46,7 +45,7 @@ export const useDialogueStore = defineStore('dialogue', { // 是否显示会话列表 isShowSessionList: true, - + groupInfo: {} , // 群成员列表 members: [], @@ -75,8 +74,6 @@ export const useDialogueStore = defineStore('dialogue', { // 更新对话信息 setDialogue(data = {}) { - - console.log('data',data) this.online = data.is_online == 1 this.talk = { username: data.remark || data.name, @@ -94,6 +91,8 @@ export const useDialogueStore = defineStore('dialogue', { this.members = [] if (data.talk_type == 2) { this.updateGroupMembers() + this.getGroupInfo() + } }, @@ -126,7 +125,14 @@ export const useDialogueStore = defineStore('dialogue', { unshiftDialogueRecord(records) { this.records.unshift(...records) }, - + async getGroupInfo(){ + const { code, data } = await ServeGroupDetail({ + group_id: this.talk.receiver_id + }) + if(code == 200){ + this.groupInfo = data + } + }, // 推送对话记录 addDialogueRecord(record) { // TOOD 需要通过 sequence 排序,保证消息一致性 diff --git a/src/types/chat.ts b/src/types/chat.ts index f19ef95..caef493 100644 --- a/src/types/chat.ts +++ b/src/types/chat.ts @@ -130,3 +130,22 @@ export interface ITalkRecordExtraImage { width: number height: number } +export interface GroupInfo { + avatar: string; + created_at: string; + deptInfos: any[]; // 如果有具体结构可以进一步细化 + group_id: number; + group_name: string; + group_num: number; + group_type: number; + is_disturb: number; + is_last_manager: boolean; + is_manager: boolean; + is_mute: number; + is_overt: number; + latest_notice_content: string; + latest_notice_title: string; + positionInfos: any[]; // 如果有具体结构可以进一步细化 + profile: string; + visit_card: string; +}; \ No newline at end of file diff --git a/src/views/message/inner/IndexAmicable.vue b/src/views/message/inner/IndexAmicable.vue index f37bd95..cc0ed8f 100644 --- a/src/views/message/inner/IndexAmicable.vue +++ b/src/views/message/inner/IndexAmicable.vue @@ -1,8 +1,8 @@ @@ -13,8 +13,8 @@ width: 100%; -webkit-app-region: drag; .content { - width: 400px; - height: 300px; + width: 181px; + height: 149px; text-align: center; color: #ccc; margin-top: -10%; diff --git a/src/views/message/inner/panel/PanelContent.vue b/src/views/message/inner/panel/PanelContent.vue index 79ff0bb..342b4d1 100644 --- a/src/views/message/inner/panel/PanelContent.vue +++ b/src/views/message/inner/panel/PanelContent.vue @@ -227,6 +227,7 @@ const onClickNickname = (data: ITalkRecord) => { // 会话列表右键显示菜单 const onContextMenu = (e: any, item: ITalkRecord) => { + console.log('item',item) if (!dialogueStore.isShowEditor || dialogueStore.isOpenMultiSelect) { return e.preventDefault() } diff --git a/src/views/message/inner/panel/menu.ts b/src/views/message/inner/panel/menu.ts index 3a24248..28c171c 100644 --- a/src/views/message/inner/panel/menu.ts +++ b/src/views/message/inner/panel/menu.ts @@ -1,4 +1,5 @@ import { reactive } from 'vue' +import { useDialogueStore } from '@/store/modules/dialogue.js' interface IDropdown { options: any[] @@ -19,7 +20,7 @@ const isRevoke = (uid: any, item: any): boolean => { return Math.floor(time / 1000 / 60) <= 2 } - +const dialogueStore = useDialogueStore() export function useMenu() { const dropdown: IDropdown = reactive({ options: [], @@ -47,20 +48,20 @@ export function useMenu() { dropdown.options.push({ label: '多选', key: 'multiSelect' }) dropdown.options.push({ label: '引用', key: 'quote' }) - if (isRevoke(uid, item)) { + if (isRevoke(uid, item)|| (dialogueStore.groupInfo as any).is_manager) { dropdown.options.push({ label: `撤回`, key: 'revoke' }) } dropdown.options.push({ label: '删除', key: 'delete' }) - if ([3, 4, 5].includes(item.msg_type)) { - dropdown.options.push({ label: '下载', key: 'download' }) - } + // if ([3, 4, 5].includes(item.msg_type)) { + // dropdown.options.push({ label: '下载', key: 'download' }) + // } - if ([3].includes(item.msg_type)) { - dropdown.options.push({ label: '收藏', key: 'collect' }) - } + // if ([3].includes(item.msg_type)) { + // dropdown.options.push({ label: '收藏', key: 'collect' }) + // } dropdown.x = e.clientX diff --git a/src/views/office/index.vue b/src/views/office/index.vue index 8a953c4..9edc0a5 100644 --- a/src/views/office/index.vue +++ b/src/views/office/index.vue @@ -57,6 +57,7 @@ const config = { }, documentType, editorConfig: { + mode: 'view', lang: 'zh-CN', user: { @@ -64,6 +65,9 @@ const config = { name: '访客用户' }, customization: { + hideRightMenu: true, // 隐藏右侧菜单 + about: false, // 不显示“关于”页面 + help: false, // 不显示帮助菜单 chat: false, commentAuthorOnly: false, compactToolbar: true, diff --git a/tsconfig.json b/tsconfig.json index 7163544..064866f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -39,5 +39,5 @@ "src/**/*.tsx", "src/**/*.vue", "assets/**/*.jpg" - ], +, "src/store/modules/dialogue.js" ], } \ No newline at end of file