diff --git a/components.d.ts b/components.d.ts index c5aef78..7e123e7 100644 --- a/components.d.ts +++ b/components.d.ts @@ -51,6 +51,7 @@ declare module 'vue' { SysGroupMemberRemovedMessage: typeof import('./src/components/talk/message/system/SysGroupMemberRemovedMessage.vue')['default'] SysGroupMutedMessage: typeof import('./src/components/talk/message/system/SysGroupMutedMessage.vue')['default'] SysGroupTransferMessage: typeof import('./src/components/talk/message/system/SysGroupTransferMessage.vue')['default'] + SysPushMessage: typeof import('./src/components/talk/message/system/sysPushMessage.vue')['default'] SysTextMessage: typeof import('./src/components/talk/message/system/SysTextMessage.vue')['default'] TabbarItem: typeof import('./src/components/x-tabbar/components/tabbar-item/index.vue')['default'] TextMessage: typeof import('./src/components/talk/message/TextMessage.vue')['default'] diff --git a/env/.env.dev b/env/.env.dev index 1de5297..ab6d813 100644 --- a/env/.env.dev +++ b/env/.env.dev @@ -5,8 +5,10 @@ VITE_SHOW_CONSOLE = true # 是否开启sourcemap VITE_SHOW_SOURCEMAP = true # baseUrl -VITE_BASEURL = 'http://172.16.100.93:8503' +# VITE_BASEURL = 'http://172.16.100.93:8503' +VITE_BASEURL = 'http://192.168.88.47:9503' #VITE_SOCKET_API -VITE_SOCKET_API = 'ws://172.16.100.93:8504' +# VITE_SOCKET_API = 'ws://172.16.100.93:8504' +VITE_SOCKET_API = 'ws://192.168.88.47:9504' # EPRAPI baseUrl VITE_EPR_BASEURL = 'http://114.218.158.24:9020' diff --git a/package.json b/package.json index 53e6624..83c1d2f 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "packageManager": "pnpm@8.14.1", "license": "MIT", "scripts": { + "dev:h5": "uni --mode dev --port 2468", "test:h5": "uni --mode test --port 2468", "prod:h5": "uni --mode prod", "build:h5:test": "uni build --mode test", diff --git a/src/components/deep-bubble/deep-bubble.vue b/src/components/deep-bubble/deep-bubble.vue index fc9572c..4d2685a 100644 --- a/src/components/deep-bubble/deep-bubble.vue +++ b/src/components/deep-bubble/deep-bubble.vue @@ -36,6 +36,7 @@
转文字
@@ -47,7 +48,7 @@
多选
@@ -63,6 +64,7 @@
撤回
@@ -110,14 +112,17 @@ const bubbleRef = ref(null) const props = defineProps({ isShowCopy: { + //是否显示复制 type: Boolean, default: true, }, isShowCite: { + //是否显示引用 type: Boolean, default: true, }, isShowWithdraw: { + //是否显示撤回 type: Boolean, default: true, }, @@ -126,6 +131,16 @@ const props = defineProps({ type: Boolean, default: false, }, + isShowMultipleChoose: { + //是否显示多选 + type: Boolean, + default: true, + }, + isChatRobot: { + //是否是智能助手 + type: Boolean, + default: false, + } }) const emits = defineEmits(['clickMenu']) diff --git a/src/components/talk/message/system/sysPushMessage.vue b/src/components/talk/message/system/sysPushMessage.vue new file mode 100644 index 0000000..dbf3320 --- /dev/null +++ b/src/components/talk/message/system/sysPushMessage.vue @@ -0,0 +1,133 @@ + + + + + diff --git a/src/constant/message.ts b/src/constant/message.ts index cc50fce..784de46 100644 --- a/src/constant/message.ts +++ b/src/constant/message.ts @@ -29,6 +29,14 @@ export const ChatMsgSysGroupTransfer = 1113 // 变更群主 export const ChatMsgSysGroupAdmin = 1114 // 设置管理员 export const ChatMsgSysGroupMemberRemoved = 1115 // 移出群成员消息(部门群、公司群自动移出) export const ChatMsgSysGroupInfoChange = 1116 // 管理员更新了群信息 +export const ChatMsgSysPush_PromptReminder = 1117 // 系统推送消息-催办提醒 +export const ChatMsgSysPush_NoClockReminderBeforeWork = 1118 // 系统推送消息-上班未打卡 +export const ChatMsgSysPush_NoClockReminderAfterWork = 1119 // 系统推送消息-下班未打卡 +export const ChatMsgSysPush_ApprovalReminder = 1120 // 系统推送消息-待审批提醒 +export const ChatMsgSysPush_CopyReminder = 1121 // 系统推送消息-抄送提醒 +export const ChatMsgSysPush_AbsentReminder = 1122 // 系统推送消息-缺卡提醒 +export const ChatMsgSysPush_LateReminder = 1123 // 系统推送消息-迟到提醒 +export const ChatMsgSysPush_EarlyReminder = 1124 // 系统推送消息-早退提醒 export const ChatMsgTypeMapping = { [ChatMsgTypeText]: '[文本消息]', @@ -60,7 +68,15 @@ export const ChatMsgTypeMapping = { [ChatMsgSysGroupTransfer]: '[转让群主]', [ChatMsgSysGroupAdmin]: '[设置管理员]', [ChatMsgSysGroupMemberRemoved]: '[移出群成员消息]', - [ChatMsgSysGroupInfoChange]: '[群信息更新]' + [ChatMsgSysGroupInfoChange]: '[群信息更新]', + [ChatMsgSysPush_PromptReminder]: '[催办提醒]', + [ChatMsgSysPush_NoClockReminderBeforeWork]: '[未打卡提醒]', + [ChatMsgSysPush_NoClockReminderAfterWork]: '[未打卡提醒]', + [ChatMsgSysPush_ApprovalReminder]: '[审批提醒]', + [ChatMsgSysPush_CopyReminder]: '[抄送提醒]', + [ChatMsgSysPush_AbsentReminder]: '[异常卡提醒]', + [ChatMsgSysPush_LateReminder]: '[异常卡提醒]', + [ChatMsgSysPush_EarlyReminder]: '[异常卡提醒]' } // 消息类型 - 消息组件 映射关系 @@ -93,7 +109,16 @@ export const MessageComponents = { [ChatMsgSysGroupTransfer]: 'sys-group-transfer-message', [ChatMsgSysGroupAdmin]:'sys-group-admin-message', [ChatMsgSysGroupMemberRemoved]:'sys-group-member-removed-message', - [ChatMsgSysGroupInfoChange]:'sys-group-info-change-message' + [ChatMsgSysGroupInfoChange]:'sys-group-info-change-message', + // 智能助手推送的系统消息采用相同的模版 + [ChatMsgSysPush_PromptReminder]:'sys-push-message', + [ChatMsgSysPush_NoClockReminderBeforeWork]:'sys-push-message', + [ChatMsgSysPush_NoClockReminderAfterWork]:'sys-push-message', + [ChatMsgSysPush_ApprovalReminder]:'sys-push-message', + [ChatMsgSysPush_CopyReminder]:'sys-push-message', + [ChatMsgSysPush_AbsentReminder]:'sys-push-message', + [ChatMsgSysPush_LateReminder]:'sys-push-message', + [ChatMsgSysPush_EarlyReminder]:'sys-push-message' } // 可转发的消息类型 diff --git a/src/event/talk.js b/src/event/talk.js index 4cfc957..c699906 100644 --- a/src/event/talk.js +++ b/src/event/talk.js @@ -94,7 +94,11 @@ class Talk extends Base { */ getTalkText() { let text = '' - if (this.resource.msg_type != message.ChatMsgTypeText) { + if ( + this.resource.msg_type != message.ChatMsgTypeText && + //智能助手发送的系统消息,也直接显示内容 + this.resource.user_id !== 2 + ) { text = message.ChatMsgTypeMapping[this.resource.msg_type] } else { text = this.resource.extra.content.replace(//g, '') diff --git a/src/pages/chatSettings/index.vue b/src/pages/chatSettings/index.vue index 8ec0b4c..cc60e5a 100644 --- a/src/pages/chatSettings/index.vue +++ b/src/pages/chatSettings/index.vue @@ -58,7 +58,7 @@ :isManager="groupParams?.groupInfo?.is_manager">
- -
+
diff --git a/src/pages/dialog/index.vue b/src/pages/dialog/index.vue index 8b09807..d1b3afa 100644 --- a/src/pages/dialog/index.vue +++ b/src/pages/dialog/index.vue @@ -84,7 +84,14 @@ " > -
+ +
{{ item.nickname }} + + + + {{ '智能助手' || item?.extra?.title }} + {{ parseTime(item.created_at, '{m}/{d} {h}:{i}') }} @@ -197,6 +212,7 @@ :isShowCopy="isShowCopy(item)" :isShowWithdraw="isRevoke(talkParams.uid, item) || isLeader" :isShowConvertText="isShowConvertText(item)" + :isChatRobot="item.user_id === 2" >
{ //点击跳转到用户详情页面 const toUserDetailPage = (userItem) => { + //智能助手不可以查看详细信息 + if (userItem?.user_id === 2) { + return + } uni.navigateTo({ url: '/pages/dialog/dialogDetail/userDetail?erpUserId=' + userItem.erp_user_id, @@ -2073,15 +2100,17 @@ const queryRecordsByMsgInfo = async (msgInfo) => { }) .exec() const footBoxAreaQuery = uni.createSelectorQuery() - footBoxAreaQuery - .select('#footBoxArea') - .boundingClientRect((res) => { - if (res) { - // console.log('元素高度:', res.height) - offset = offset - res.height - } - }) - .exec() + const footBoxArea = footBoxAreaQuery.select('#footBoxArea') + if (footBoxArea) { + footBoxArea + .boundingClientRect((res) => { + if (res) { + // console.log('元素高度:', res.height) + offset = offset - res.height + } + }) + .exec() + } setTimeout(() => { zpagingRef.value.scrollIntoViewById( 'zp-id-' + msgInfo.msg_id, @@ -2192,6 +2221,10 @@ let avatarPressTimer = null let currentPressItem = null const handleAvatarTouchStart = (item) => { + //智能助手不可以长按@ + if (item?.user_id === 2) { + return + } currentPressItem = item avatarPressTimer = setTimeout(() => { if (!state.value.canUseQuillEditor) { @@ -2202,7 +2235,11 @@ const handleAvatarTouchStart = (item) => { }, 500) } -const handleAvatarTouchEnd = () => { +const handleAvatarTouchEnd = (item) => { + //智能助手不可以长按@ + if (item?.user_id === 2) { + return + } if (avatarPressTimer) { clearTimeout(avatarPressTimer) avatarPressTimer = null @@ -2788,16 +2825,18 @@ const convertText = (msgItem) => { msgId: msgItem.msg_id, }) // console.log(resp, 'resp') - resp.then(({ code, data }) => { - msgItem.isVoiceToTexting = false - // console.log(code, data, 'data') - if (code === 200) { - console.log(data.convText, 'convText') - msgItem.voiceContent = data.convText - } - }).catch(() => { - msgItem.isVoiceToTexting = false - }) + resp + .then(({ code, data }) => { + msgItem.isVoiceToTexting = false + // console.log(code, data, 'data') + if (code === 200) { + console.log(data.convText, 'convText') + msgItem.voiceContent = data.convText + } + }) + .catch(() => { + msgItem.isVoiceToTexting = false + }) } //语音输入框高度 const chatInputHeight = computed(() => { diff --git a/src/static/image/chatBotMessageCard/copy.png b/src/static/image/chatBotMessageCard/copy.png new file mode 100644 index 0000000..b1bfe69 Binary files /dev/null and b/src/static/image/chatBotMessageCard/copy.png differ diff --git a/src/static/image/chatBotMessageCard/errorClock.png b/src/static/image/chatBotMessageCard/errorClock.png new file mode 100644 index 0000000..e2ab0af Binary files /dev/null and b/src/static/image/chatBotMessageCard/errorClock.png differ diff --git a/src/static/image/chatBotMessageCard/noClockAfterWork.png b/src/static/image/chatBotMessageCard/noClockAfterWork.png new file mode 100644 index 0000000..7379c25 Binary files /dev/null and b/src/static/image/chatBotMessageCard/noClockAfterWork.png differ diff --git a/src/static/image/chatBotMessageCard/noClockBeforeWork.png b/src/static/image/chatBotMessageCard/noClockBeforeWork.png new file mode 100644 index 0000000..a48e9c2 Binary files /dev/null and b/src/static/image/chatBotMessageCard/noClockBeforeWork.png differ diff --git a/src/static/image/chatBotMessageCard/prompt.png b/src/static/image/chatBotMessageCard/prompt.png new file mode 100644 index 0000000..d223c12 Binary files /dev/null and b/src/static/image/chatBotMessageCard/prompt.png differ