Merge branch 'wyfMain-dev'
This commit is contained in:
commit
62f5b458a5
@ -77,6 +77,11 @@ export const ServeEditGroupNotice = (data) => {
|
|||||||
return post('/api/v1/group/notice/edit', data)
|
return post('/api/v1/group/notice/edit', data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 删除群公告
|
||||||
|
export const ServeDeleteGroupNotice = (data) => {
|
||||||
|
return post('/api/v1/group/notice/delete', data)
|
||||||
|
}
|
||||||
|
|
||||||
export const ServeGetGroupApplyList = (data) => {
|
export const ServeGetGroupApplyList = (data) => {
|
||||||
return get('/api/v1/group/apply/list', data)
|
return get('/api/v1/group/apply/list', data)
|
||||||
}
|
}
|
||||||
|
@ -10,28 +10,32 @@
|
|||||||
{{ title }}
|
{{ title }}
|
||||||
</template>
|
</template>
|
||||||
<div class="custom-close-btn" v-if="customCloseBtn">
|
<div class="custom-close-btn" v-if="customCloseBtn">
|
||||||
<img src="@/assets/image/icon/close-btn-grey.png" alt="" @click="handleCloseModal"/>
|
<img src="@/assets/image/icon/close-btn-grey.png" alt="" @click="handleCloseModal" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<slot name="content"></slot>
|
<slot name="content"></slot>
|
||||||
<template #footer v-if="actionBtns.cancelBtn || actionBtns.confirmBtn">
|
<template #footer v-if="actionBtns?.cancelBtn || actionBtns?.confirmBtn">
|
||||||
<div class="custom-modal-btns">
|
<div
|
||||||
|
class="custom-modal-btns"
|
||||||
|
:style="props?.customModalBtnsStyle ? props.customModalBtnsStyle : ''"
|
||||||
|
>
|
||||||
<customBtn
|
<customBtn
|
||||||
color="#C7C7C9"
|
color="#C7C7C9"
|
||||||
style="width: 161px; height: 34px;"
|
style="width: 161px; height: 34px;"
|
||||||
@click="handleCancel"
|
@click="handleCancel"
|
||||||
v-if="actionBtns.cancelBtn"
|
v-if="actionBtns?.cancelBtn"
|
||||||
>取消</customBtn
|
>{{ actionBtns?.cancelBtn?.text || '取消' }}</customBtn
|
||||||
>
|
>
|
||||||
<customBtn
|
<customBtn
|
||||||
color="#46299D"
|
color="#46299D"
|
||||||
style="width: 161px; height: 34px;"
|
style="width: 161px; height: 34px;"
|
||||||
@click="handleConfirm"
|
@click="handleConfirm"
|
||||||
:loading="state.confirmBtnLoading"
|
:disabled="actionBtns?.confirmBtn?.disabled"
|
||||||
v-if="actionBtns.confirmBtn"
|
:loading="state.confirmBtnLoading && actionBtns?.confirmBtn?.doLoading"
|
||||||
>确定</customBtn
|
v-if="actionBtns?.confirmBtn"
|
||||||
|
>{{ actionBtns?.confirmBtn?.text || '确定' }}</customBtn
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -63,6 +67,16 @@ const props = defineProps({
|
|||||||
// 是否显示自定义关闭按钮
|
// 是否显示自定义关闭按钮
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
customModalBtnsStyle: {
|
||||||
|
// 自定义按钮样式
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
customCloseEvent: {
|
||||||
|
// 是否自定义关闭事件
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -74,12 +88,16 @@ const show = computed({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
show.value = false
|
if (props.actionBtns?.cancelBtn?.hideModal) {
|
||||||
|
show.value = false
|
||||||
|
}
|
||||||
emit('cancel')
|
emit('cancel')
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleConfirm = () => {
|
const handleConfirm = () => {
|
||||||
state.confirmBtnLoading = true
|
if (props.actionBtns?.confirmBtn?.doLoading) {
|
||||||
|
state.confirmBtnLoading = true
|
||||||
|
}
|
||||||
emit('confirm', closeLoading)
|
emit('confirm', closeLoading)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +110,11 @@ const state = reactive({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const handleCloseModal = () => {
|
const handleCloseModal = () => {
|
||||||
show.value = false
|
if (props.customCloseEvent) {
|
||||||
|
emit('closeModal')
|
||||||
|
} else {
|
||||||
|
show.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -9,7 +9,8 @@ import {
|
|||||||
ServeGroupDetail,
|
ServeGroupDetail,
|
||||||
ServeGetGroupMembers,
|
ServeGetGroupMembers,
|
||||||
ServeSecedeGroup,
|
ServeSecedeGroup,
|
||||||
ServeUpdateGroupCard
|
ServeUpdateGroupCard,
|
||||||
|
ServeGetGroupNotices
|
||||||
} from '@/api/group'
|
} from '@/api/group'
|
||||||
import { useInject } from '@/hooks'
|
import { useInject } from '@/hooks'
|
||||||
import customModal from '@/components/common/customModal.vue'
|
import customModal from '@/components/common/customModal.vue'
|
||||||
@ -19,7 +20,12 @@ import UserCardModal from '@/components/user/UserCardModal.vue'
|
|||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const { showUserInfoModal } = useInject()
|
const { showUserInfoModal } = useInject()
|
||||||
|
|
||||||
const emit = defineEmits(['close', 'to-talk', 'handleSearchRecordByConditionModalShow'])
|
const emit = defineEmits([
|
||||||
|
'close',
|
||||||
|
'to-talk',
|
||||||
|
'handleSearchRecordByConditionModalShow',
|
||||||
|
'handleGroupNoticeModalShow'
|
||||||
|
])
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
gid: {
|
gid: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@ -29,12 +35,18 @@ const props = defineProps({
|
|||||||
// 1: 单聊, 2: 群聊
|
// 1: 单聊, 2: 群聊
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0
|
default: 0
|
||||||
|
},
|
||||||
|
groupNoticeContentChange: {
|
||||||
|
// 群公告内容变化
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(props, () => {
|
watch(props, () => {
|
||||||
loadDetail()
|
loadDetail()
|
||||||
loadMembers()
|
loadMembers()
|
||||||
|
getGroupNotices()
|
||||||
})
|
})
|
||||||
|
|
||||||
const editCardPopover = ref(false)
|
const editCardPopover = ref(false)
|
||||||
@ -59,13 +71,24 @@ const state = reactive({
|
|||||||
chatSettingOperateHint: '', // 提示信息
|
chatSettingOperateHint: '', // 提示信息
|
||||||
chatSettingOperateSubHint: '', // 次要提示信息
|
chatSettingOperateSubHint: '', // 次要提示信息
|
||||||
actionBtns: {
|
actionBtns: {
|
||||||
confirmBtn: true,
|
confirmBtn: {
|
||||||
cancelBtn: true
|
doLoading: true
|
||||||
|
},
|
||||||
|
cancelBtn: {
|
||||||
|
hideModal: true
|
||||||
|
}
|
||||||
}, // 操作按钮
|
}, // 操作按钮
|
||||||
showAllMember: false, // 是否显示全部成员
|
showAllMember: false, // 是否显示全部成员
|
||||||
openGroupMemberSearch: false, //是否开启群成员搜索
|
openGroupMemberSearch: false, //是否开启群成员搜索
|
||||||
isShowUserCardModal: false, //是否显示成员信息模态框
|
isShowUserCardModal: false, //是否显示成员信息模态框
|
||||||
userInfo: {} //当前打开的成员信息卡信息
|
userInfo: {}, //当前打开的成员信息卡信息
|
||||||
|
groupNoticeInfo: {
|
||||||
|
id: 0,
|
||||||
|
avatar: '',
|
||||||
|
updater_name: '',
|
||||||
|
updated_at: '',
|
||||||
|
content: ''
|
||||||
|
} //群公告信息
|
||||||
})
|
})
|
||||||
|
|
||||||
const members = ref<any[]>([])
|
const members = ref<any[]>([])
|
||||||
@ -192,9 +215,11 @@ const showChatSettingOperateModal = (type: string) => {
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case 'clear':
|
case 'clear':
|
||||||
state.chatSettingOperateHint = '确定清空聊天记录'
|
state.chatSettingOperateHint = '确定清空聊天记录'
|
||||||
|
state.chatSettingOperateSubHint = ''
|
||||||
break
|
break
|
||||||
case 'dismiss':
|
case 'dismiss':
|
||||||
state.chatSettingOperateHint = '确定解散本群'
|
state.chatSettingOperateHint = '确定解散本群'
|
||||||
|
state.chatSettingOperateSubHint = ''
|
||||||
break
|
break
|
||||||
case 'quit':
|
case 'quit':
|
||||||
state.chatSettingOperateHint = '确定退出群聊'
|
state.chatSettingOperateHint = '确定退出群聊'
|
||||||
@ -209,6 +234,7 @@ const showChatSettingOperateModal = (type: string) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//点击显示查找聊天记录模态框
|
||||||
const showSearchRecordByConditionModal = () => {
|
const showSearchRecordByConditionModal = () => {
|
||||||
emit('handleSearchRecordByConditionModalShow', true)
|
emit('handleSearchRecordByConditionModalShow', true)
|
||||||
}
|
}
|
||||||
@ -243,6 +269,36 @@ const showMemberInfo = (memberItem: any) => {
|
|||||||
state.userInfo = memberItem
|
state.userInfo = memberItem
|
||||||
state.isShowUserCardModal = true
|
state.isShowUserCardModal = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//点击显示群公告模态框
|
||||||
|
const showGroupNoticeModal = () => {
|
||||||
|
emit('handleGroupNoticeModalShow', isAdmin.value || isLeader.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取群公告列表
|
||||||
|
const getGroupNotices = () => {
|
||||||
|
ServeGetGroupNotices({
|
||||||
|
group_id: props.gid
|
||||||
|
}).then((res) => {
|
||||||
|
console.log(res)
|
||||||
|
if (res.code == 200) {
|
||||||
|
if (res?.data?.items[0]?.id) {
|
||||||
|
state.groupNoticeInfo = res.data.items[0]
|
||||||
|
} else {
|
||||||
|
state.groupNoticeInfo = {
|
||||||
|
id: 0,
|
||||||
|
avatar: '',
|
||||||
|
updater_name: '',
|
||||||
|
updated_at: '',
|
||||||
|
content: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
window['$message'].warning(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getGroupNotices()
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<section class="el-container is-vertical section">
|
<section class="el-container is-vertical section">
|
||||||
@ -402,24 +458,20 @@ const showMemberInfo = (memberItem: any) => {
|
|||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<div class="b-box b-box-bottomBorder" style="padding: 0 0 12px;">
|
<div class="b-box b-box-bottomBorder" style="padding: 0 0 12px;">
|
||||||
<div class="block">
|
<div class="block" @click="showGroupNoticeModal" style="cursor: pointer;">
|
||||||
<div class="title">群公告</div>
|
<div class="title">群公告</div>
|
||||||
<!-- <div class="text"> -->
|
<!-- <div class="text"> -->
|
||||||
<!-- <n-button type="primary" text> 更多 </n-button> -->
|
<!-- <n-button type="primary" text> 更多 </n-button> -->
|
||||||
<img class="icon-right" src="@/assets/image/icon/arrow-right-grey.png" alt="" />
|
<img class="icon-right" src="@/assets/image/icon/arrow-right-grey.png" alt="" />
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="describe">管理员未设置</div>
|
<div class="describe">{{ state.groupNoticeInfo?.content || '管理员未设置' }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="info-box">
|
<div class="info-box">
|
||||||
<div
|
<div class="b-box b-box-bottomBorder">
|
||||||
class="b-box b-box-bottomBorder"
|
<div class="block" @click="showSearchRecordByConditionModal" style="cursor: pointer;">
|
||||||
@click="showSearchRecordByConditionModal"
|
|
||||||
style="cursor: pointer;"
|
|
||||||
>
|
|
||||||
<div class="block">
|
|
||||||
<div class="title">查找聊天记录</div>
|
<div class="title">查找聊天记录</div>
|
||||||
<img class="icon-right" src="@/assets/image/icon/arrow-right-grey.png" alt="" />
|
<img class="icon-right" src="@/assets/image/icon/arrow-right-grey.png" alt="" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -10,6 +10,8 @@ import GroupNotice from '@/components/group/GroupNotice.vue'
|
|||||||
import UploadsModal from '@/components/base/UploadsModal.vue'
|
import UploadsModal from '@/components/base/UploadsModal.vue'
|
||||||
import customModal from '@/components/common/customModal.vue'
|
import customModal from '@/components/common/customModal.vue'
|
||||||
import historyRecord from '@/components/search/searchByCondition.vue'
|
import historyRecord from '@/components/search/searchByCondition.vue'
|
||||||
|
import { ServeEditGroupNotice, ServeGetGroupNotices, ServeDeleteGroupNotice } from '@/api/group'
|
||||||
|
import avatarModule from '@/components/avatar-module/index.vue'
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const dialogueStore = useDialogueStore()
|
const dialogueStore = useDialogueStore()
|
||||||
@ -44,7 +46,41 @@ const state = reactive({
|
|||||||
}, //按条件搜索记录弹窗样式
|
}, //按条件搜索记录弹窗样式
|
||||||
searchRecordByConditionText: '', //按条件搜索记录文本
|
searchRecordByConditionText: '', //按条件搜索记录文本
|
||||||
conditionTag: '', //当前条件标签
|
conditionTag: '', //当前条件标签
|
||||||
conditionType: '' //当前条件类型
|
conditionType: '', //当前条件类型
|
||||||
|
isShowGroupNoticeModal: false, //是否显示群公告模态框
|
||||||
|
customGroupNoticeModalStyle: {
|
||||||
|
width: '997px',
|
||||||
|
height: '740px'
|
||||||
|
}, //群公告模态框样式
|
||||||
|
groupNoticeModalActionBtns: {
|
||||||
|
confirmBtn: {
|
||||||
|
text: '编辑',
|
||||||
|
doLoading: false,
|
||||||
|
disabled: false
|
||||||
|
},
|
||||||
|
cancelBtn: false
|
||||||
|
}, //群公告模态框操作按钮
|
||||||
|
groupNoticeModalActionBtnsStyle: 'padding: 20px 0;', //群公告模态框操作按钮样式
|
||||||
|
groupNoticeInEdit: '', //编辑中的公告
|
||||||
|
groupNoticeEditMode: 3, //群公告编辑模式:2=编辑;3=查看
|
||||||
|
groupNoticeModalConfirmBtnEvent: 'edit', //群公告模态框确认按钮事件:edit=编辑;fillIn=输入
|
||||||
|
isShowNoticeHintModal: false, //是否显示群公告提示模态框
|
||||||
|
customNoticeHintModalStyle: {
|
||||||
|
width: '724px',
|
||||||
|
height: '314px'
|
||||||
|
}, //群公告提示模态框样式
|
||||||
|
noticeHintModalActionBtns: {}, //群公告提示模态框操作按钮
|
||||||
|
noticeHintModalContent: '', //群公告提示模态框内容
|
||||||
|
noticeHintMode: 'publish', //群公告提示模式:publish=发布;cancel=取消
|
||||||
|
groupNoticeInfo: {
|
||||||
|
id: 0,
|
||||||
|
avatar: '',
|
||||||
|
updater_name: '',
|
||||||
|
updated_at: '',
|
||||||
|
content: ''
|
||||||
|
}, //群公告信息
|
||||||
|
isAdmin: false, //当前登录用户是否是该群管理员
|
||||||
|
groupNoticeContentChange: '' //群公告内容变化
|
||||||
})
|
})
|
||||||
|
|
||||||
const events = {
|
const events = {
|
||||||
@ -84,6 +120,255 @@ const changeConditionTag = (tag) => {
|
|||||||
state.conditionTag = ''
|
state.conditionTag = ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//取消群公告编辑并返回查看
|
||||||
|
const cancelEditGroupNotice = () => {
|
||||||
|
//切换群公告编辑模式为查看
|
||||||
|
state.groupNoticeEditMode = 3
|
||||||
|
state.groupNoticeModalActionBtns = {
|
||||||
|
confirmBtn: {
|
||||||
|
text: '编辑',
|
||||||
|
doLoading: false,
|
||||||
|
disabled: false
|
||||||
|
},
|
||||||
|
cancelBtn: false
|
||||||
|
}
|
||||||
|
//切换确定按钮事件为编辑
|
||||||
|
state.groupNoticeModalConfirmBtnEvent = 'edit'
|
||||||
|
}
|
||||||
|
|
||||||
|
// 群公告模态框确定按钮事件
|
||||||
|
const handleGroupNoticeModalConfirm = () => {
|
||||||
|
if (state.groupNoticeModalConfirmBtnEvent === 'edit') {
|
||||||
|
//点击切换群公告编辑模式为编辑
|
||||||
|
state.groupNoticeEditMode = 2
|
||||||
|
state.groupNoticeModalActionBtns = {
|
||||||
|
confirmBtn: {
|
||||||
|
text: '完成',
|
||||||
|
doLoading: false,
|
||||||
|
disabled: true
|
||||||
|
},
|
||||||
|
cancelBtn: true
|
||||||
|
}
|
||||||
|
//切换确定按钮事件为输入
|
||||||
|
state.groupNoticeModalConfirmBtnEvent = 'fillIn'
|
||||||
|
if (state.groupNoticeInfo?.id) {
|
||||||
|
state.groupNoticeInEdit = state.groupNoticeInfo.content
|
||||||
|
state.groupNoticeModalActionBtns.confirmBtn.disabled = false
|
||||||
|
}
|
||||||
|
} else if (state.groupNoticeModalConfirmBtnEvent === 'fillIn') {
|
||||||
|
//点击显示发布提示
|
||||||
|
state.isShowNoticeHintModal = true
|
||||||
|
if (state?.groupNoticeInfo?.id && !state.groupNoticeInEdit) {
|
||||||
|
//如果是在编辑中,但是没有输入内容,此时点击完成即为删除群公告
|
||||||
|
state.noticeHintModalContent = '确定清空群公告吗?'
|
||||||
|
state.noticeHintModalActionBtns = {
|
||||||
|
confirmBtn: {
|
||||||
|
text: '清空',
|
||||||
|
doLoading: true
|
||||||
|
},
|
||||||
|
cancelBtn: true
|
||||||
|
}
|
||||||
|
//切换公告提示模式为清空
|
||||||
|
state.noticeHintMode = 'clear'
|
||||||
|
} else {
|
||||||
|
state.noticeHintModalContent = '发布该公告会通知全部群成员'
|
||||||
|
state.noticeHintModalActionBtns = {
|
||||||
|
confirmBtn: {
|
||||||
|
text: '发布',
|
||||||
|
doLoading: true
|
||||||
|
},
|
||||||
|
cancelBtn: true
|
||||||
|
}
|
||||||
|
//切换公告提示模式为发布
|
||||||
|
state.noticeHintMode = 'publish'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 群公告模态框取消按钮事件
|
||||||
|
const handleGroupNoticeModalCancel = () => {
|
||||||
|
if (state.groupNoticeModalConfirmBtnEvent === 'fillIn') {
|
||||||
|
if (state.groupNoticeInEdit || (state.groupNoticeInfo?.id && !state.groupNoticeInEdit)) {
|
||||||
|
//如果有正在编辑中的公告或者编辑已发布的公告内容为空,显示确认取消编辑弹窗
|
||||||
|
state.isShowNoticeHintModal = true
|
||||||
|
state.noticeHintModalContent = '退出本次编辑'
|
||||||
|
state.noticeHintModalActionBtns = {
|
||||||
|
confirmBtn: {
|
||||||
|
text: '继续编辑',
|
||||||
|
doLoading: false
|
||||||
|
},
|
||||||
|
cancelBtn: {
|
||||||
|
text: '退出'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//切换公告提示模式为取消
|
||||||
|
state.noticeHintMode = 'cancel'
|
||||||
|
} else {
|
||||||
|
//没有正在编辑中的公告,退出编辑
|
||||||
|
cancelEditGroupNotice()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 群公告模态框关闭事件
|
||||||
|
const handleGroupNoticeModalClose = () => {
|
||||||
|
//关闭应与取消事件一致
|
||||||
|
handleGroupNoticeModalCancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 群公告提示模态框确认按钮事件
|
||||||
|
const handleNoticeHintModalConfirm = (closeLoading) => {
|
||||||
|
console.log('handleNoticeHintModalConfirm')
|
||||||
|
if (state.noticeHintMode === 'cancel') {
|
||||||
|
//不退出,回到编辑
|
||||||
|
state.isShowNoticeHintModal = false
|
||||||
|
} else if (state.noticeHintMode === 'publish') {
|
||||||
|
//发布
|
||||||
|
doPublishGroupNotice(closeLoading)
|
||||||
|
} else if (state.noticeHintMode === 'clear') {
|
||||||
|
//清空
|
||||||
|
doClearGroupNotice(closeLoading)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 群公告提示模态框取消按钮事件
|
||||||
|
const handleNoticeHintModalCancel = () => {
|
||||||
|
console.log('handleNoticeHintModalCancel')
|
||||||
|
if (state.noticeHintMode === 'publish') {
|
||||||
|
//取消发布,回到编辑
|
||||||
|
state.isShowNoticeHintModal = false
|
||||||
|
} else if (state.noticeHintMode === 'cancel') {
|
||||||
|
//清除正在编辑中的公告并退出编辑
|
||||||
|
state.groupNoticeInEdit = ''
|
||||||
|
state.isShowNoticeHintModal = false
|
||||||
|
cancelEditGroupNotice()
|
||||||
|
} else if (state.noticeHintMode === 'clear') {
|
||||||
|
//不清空,继续编辑
|
||||||
|
state.isShowNoticeHintModal = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 群公告模态框输入事件
|
||||||
|
const handleGroupNoticeModalInput = (value) => {
|
||||||
|
console.log(value)
|
||||||
|
if (value.trim()) {
|
||||||
|
state.groupNoticeModalActionBtns.confirmBtn.disabled = false
|
||||||
|
} else {
|
||||||
|
if (!state.groupNoticeInfo?.id) {
|
||||||
|
state.groupNoticeModalActionBtns.confirmBtn.disabled = true
|
||||||
|
} else {
|
||||||
|
state.groupNoticeModalActionBtns.confirmBtn.disabled = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 发布群公告
|
||||||
|
const doPublishGroupNotice = (closeLoading) => {
|
||||||
|
let params = {
|
||||||
|
notice_id: state?.groupNoticeInfo?.id || 0,
|
||||||
|
group_id: talkParams.receiver_id,
|
||||||
|
title: '',
|
||||||
|
content: state.groupNoticeInEdit,
|
||||||
|
is_top: 0,
|
||||||
|
is_confirm: 0
|
||||||
|
}
|
||||||
|
console.log(params)
|
||||||
|
const resp = ServeEditGroupNotice(params)
|
||||||
|
resp
|
||||||
|
.then((res) => {
|
||||||
|
closeLoading()
|
||||||
|
if (res.code == 200) {
|
||||||
|
// 发布成功,关闭群公告模态框
|
||||||
|
state.isShowGroupNoticeModal = false
|
||||||
|
state.isShowNoticeHintModal = false
|
||||||
|
state.groupNoticeContentChange = state.groupNoticeInEdit
|
||||||
|
state.groupNoticeInEdit = ''
|
||||||
|
cancelEditGroupNotice()
|
||||||
|
window['$message'].success(res.msg)
|
||||||
|
} else {
|
||||||
|
window['$message'].warning(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
closeLoading()
|
||||||
|
window['$message'].warning(err.msg)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取群公告列表
|
||||||
|
const getGroupNotices = () => {
|
||||||
|
ServeGetGroupNotices({
|
||||||
|
group_id: talkParams.receiver_id
|
||||||
|
}).then((res) => {
|
||||||
|
console.log(res)
|
||||||
|
if (res.code == 200) {
|
||||||
|
if (res?.data?.items[0]?.id) {
|
||||||
|
state.groupNoticeInfo = res.data.items[0]
|
||||||
|
} else {
|
||||||
|
state.groupNoticeInfo = {
|
||||||
|
id: 0,
|
||||||
|
avatar: '',
|
||||||
|
updater_name: '',
|
||||||
|
updated_at: '',
|
||||||
|
content: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
window['$message'].warning(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清空群公告
|
||||||
|
const doClearGroupNotice = (closeLoading) => {
|
||||||
|
ServeDeleteGroupNotice({
|
||||||
|
notice_id: state.groupNoticeInfo.id,
|
||||||
|
group_id: talkParams.receiver_id
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
closeLoading()
|
||||||
|
if (res.code == 200) {
|
||||||
|
// 清空成功,关闭群公告模态框并恢复群公告模态框初始状态
|
||||||
|
state.groupNoticeInfo = {
|
||||||
|
id: 0,
|
||||||
|
avatar: '',
|
||||||
|
updater_name: '',
|
||||||
|
updated_at: '',
|
||||||
|
content: ''
|
||||||
|
}
|
||||||
|
state.isShowGroupNoticeModal = false
|
||||||
|
state.isShowNoticeHintModal = false
|
||||||
|
state.groupNoticeContentChange = ''
|
||||||
|
cancelEditGroupNotice()
|
||||||
|
window['$message'].success(res.msg)
|
||||||
|
} else {
|
||||||
|
window['$message'].warning(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
closeLoading()
|
||||||
|
window['$message'].warning(err.msg)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 群公告模态框显示事件
|
||||||
|
const handleGroupNoticeModalShow = (isAdmin) => {
|
||||||
|
state.isAdmin = isAdmin
|
||||||
|
if (isAdmin) {
|
||||||
|
state.groupNoticeModalActionBtns = {
|
||||||
|
confirmBtn: {
|
||||||
|
text: '编辑',
|
||||||
|
doLoading: false,
|
||||||
|
disabled: false
|
||||||
|
},
|
||||||
|
cancelBtn: false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
;(state.groupNoticeModalActionBtns.confirmBtn as any) = false
|
||||||
|
}
|
||||||
|
state.isShowGroupNoticeModal = true
|
||||||
|
getGroupNotices()
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -168,12 +453,16 @@ const changeConditionTag = (tag) => {
|
|||||||
@close="state.isShowGroupAside = false"
|
@close="state.isShowGroupAside = false"
|
||||||
:talkType="talkParams.type"
|
:talkType="talkParams.type"
|
||||||
@handleSearchRecordByConditionModalShow="state.isShowSearchRecordByConditionModal = true"
|
@handleSearchRecordByConditionModalShow="state.isShowSearchRecordByConditionModal = true"
|
||||||
|
@handleGroupNoticeModalShow="handleGroupNoticeModalShow"
|
||||||
|
:groupNoticeContentChange="state.groupNoticeContentChange"
|
||||||
/>
|
/>
|
||||||
</n-drawer>
|
</n-drawer>
|
||||||
|
|
||||||
<customModal
|
<customModal
|
||||||
v-model:show="state.isShowSearchRecordByConditionModal"
|
v-model:show="state.isShowSearchRecordByConditionModal"
|
||||||
:title="`${talkParams.type === 1 ? '与' : ''}"${talkParams.username}"的聊天记录`"
|
:title="`${talkParams.type === 1 ? '与' : ''} "${
|
||||||
|
talkParams.username
|
||||||
|
}" 的聊天记录`"
|
||||||
:style="state.customSearchRecordByConditionModalStyle"
|
:style="state.customSearchRecordByConditionModalStyle"
|
||||||
:customCloseBtn="true"
|
:customCloseBtn="true"
|
||||||
:closable="false"
|
:closable="false"
|
||||||
@ -243,6 +532,95 @@ const changeConditionTag = (tag) => {
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</customModal>
|
</customModal>
|
||||||
|
|
||||||
|
<customModal
|
||||||
|
v-model:show="state.isShowGroupNoticeModal"
|
||||||
|
:title="`"${talkParams.username}" 的群公告`"
|
||||||
|
:style="state.customGroupNoticeModalStyle"
|
||||||
|
:customCloseBtn="true"
|
||||||
|
:closable="false"
|
||||||
|
:actionBtns="state.groupNoticeModalActionBtns"
|
||||||
|
:customModalBtnsStyle="state.groupNoticeModalActionBtnsStyle"
|
||||||
|
@confirm="handleGroupNoticeModalConfirm"
|
||||||
|
@cancel="handleGroupNoticeModalCancel"
|
||||||
|
:customCloseEvent="state.groupNoticeEditMode === 2 ? true : false"
|
||||||
|
@closeModal="handleGroupNoticeModalClose"
|
||||||
|
>
|
||||||
|
<template #content>
|
||||||
|
<div class="group-notice-modal-content">
|
||||||
|
<div class="group-notice-text-area" v-if="state.groupNoticeEditMode === 2">
|
||||||
|
<n-input
|
||||||
|
v-model:value="state.groupNoticeInEdit"
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{
|
||||||
|
minRows: 22,
|
||||||
|
maxRows: 22
|
||||||
|
}"
|
||||||
|
placeholder="请输入"
|
||||||
|
:maxlength="500"
|
||||||
|
:show-count="true"
|
||||||
|
@input="handleGroupNoticeModalInput"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="group-notice-info"
|
||||||
|
v-if="state.groupNoticeEditMode === 3 && state.groupNoticeInfo?.id"
|
||||||
|
>
|
||||||
|
<div class="group-notice-header">
|
||||||
|
<avatarModule
|
||||||
|
:mode="1"
|
||||||
|
:avatar="state.groupNoticeInfo.avatar"
|
||||||
|
:userName="state.groupNoticeInfo.updater_name"
|
||||||
|
:groupType="0"
|
||||||
|
:customStyle="{
|
||||||
|
width: '42px',
|
||||||
|
height: '42px'
|
||||||
|
}"
|
||||||
|
:customTextStyle="{
|
||||||
|
fontSize: '14px',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
color: '#fff',
|
||||||
|
lineHeight: '20px'
|
||||||
|
}"
|
||||||
|
></avatarModule>
|
||||||
|
<div class="group-notice-header-userInfo">
|
||||||
|
<span style="color: #1b1b1b; font-weight: 600; line-height: 20px;">{{
|
||||||
|
state.groupNoticeInfo.updater_name
|
||||||
|
}}</span>
|
||||||
|
<span>{{ state.groupNoticeInfo.updated_at }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="group-notice-content">
|
||||||
|
<span>{{ state.groupNoticeInfo.content }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="group-notice-empty"
|
||||||
|
v-if="state.groupNoticeEditMode === 3 && !state.groupNoticeInfo?.id"
|
||||||
|
>
|
||||||
|
<img src="@/assets/image/chatList/search-empty.png" alt="" />
|
||||||
|
<span>暂无公告</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</customModal>
|
||||||
|
|
||||||
|
<customModal
|
||||||
|
v-model:show="state.isShowNoticeHintModal"
|
||||||
|
title="提示"
|
||||||
|
:style="state.customNoticeHintModalStyle"
|
||||||
|
:closable="false"
|
||||||
|
:actionBtns="state.noticeHintModalActionBtns"
|
||||||
|
customModalBtnsStyle="padding: 0 0 30px;"
|
||||||
|
@confirm="handleNoticeHintModalConfirm"
|
||||||
|
@cancel="handleNoticeHintModalCancel"
|
||||||
|
>
|
||||||
|
<template #content>
|
||||||
|
<div class="notice-hint-modal-content">
|
||||||
|
<text>{{ state.noticeHintModalContent }}</text>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</customModal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
@ -316,4 +694,80 @@ const changeConditionTag = (tag) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.group-notice-modal-content {
|
||||||
|
.group-notice-text-area {
|
||||||
|
:deep(.n-input-wrapper) {
|
||||||
|
padding: 20px 23px 15px;
|
||||||
|
}
|
||||||
|
:deep(.n-input-word-count) {
|
||||||
|
right: 23px;
|
||||||
|
bottom: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.group-notice-info {
|
||||||
|
.group-notice-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
padding: 20px 0;
|
||||||
|
margin: 0 12px;
|
||||||
|
border-bottom: 1px solid #e5e5e5;
|
||||||
|
.group-notice-header-userInfo {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 0 0 0 10px;
|
||||||
|
span {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #adadad;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 17px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.group-notice-content {
|
||||||
|
padding: 20px 0;
|
||||||
|
margin: 0 12px;
|
||||||
|
span {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.group-notice-empty {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 552px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
img {
|
||||||
|
width: 160px;
|
||||||
|
height: 104px;
|
||||||
|
}
|
||||||
|
span {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #999;
|
||||||
|
font-weight: 400;
|
||||||
|
margin: 14px 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.notice-hint-modal-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100%;
|
||||||
|
text {
|
||||||
|
font-size: 20px;
|
||||||
|
line-height: 28px;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #1f2225;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user