|
@@ -147,10 +147,22 @@
|
|
center
|
|
center
|
|
is-link
|
|
is-link
|
|
title="群公告"
|
|
title="群公告"
|
|
- :value="setData?.groupNotice ? '' : '未设置'"
|
|
|
|
|
|
+ :value="setData?.groupNotice?.messageContent ? '' : '未设置'"
|
|
></van-cell>
|
|
></van-cell>
|
|
|
|
|
|
- <van-cell @click="handleDescription" size="large" center>
|
|
|
|
|
|
+ <van-cell
|
|
|
|
+ @click="
|
|
|
|
+ handleDescription({
|
|
|
|
+ title: '群介绍',
|
|
|
|
+ value: setData?.description,
|
|
|
|
+ placeholder: '请输入群介绍的内容',
|
|
|
|
+ isRemark: 3,
|
|
|
|
+ subTitle: '群介绍最多可输入200字'
|
|
|
|
+ })
|
|
|
|
+ "
|
|
|
|
+ size="large"
|
|
|
|
+ center
|
|
|
|
+ >
|
|
<template #title>
|
|
<template #title>
|
|
<p class="w-full line-clamp-1">群介绍:{{ setData?.description }}</p>
|
|
<p class="w-full line-clamp-1">群介绍:{{ setData?.description }}</p>
|
|
</template>
|
|
</template>
|
|
@@ -359,7 +371,7 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<ChatDialog
|
|
<ChatDialog
|
|
- v-model:show="showDialog"
|
|
|
|
|
|
+ v-model:show="showDialogs"
|
|
v-model:title="dialogTitle"
|
|
v-model:title="dialogTitle"
|
|
@confirm="confirm"
|
|
@confirm="confirm"
|
|
@cancel="cancel"
|
|
@cancel="cancel"
|
|
@@ -368,7 +380,18 @@
|
|
<p class="mx-auto w-[80%] text-sm text-black-9 mb-16">{{ dialogSubTitle }}</p>
|
|
<p class="mx-auto w-[80%] text-sm text-black-9 mb-16">{{ dialogSubTitle }}</p>
|
|
|
|
|
|
<van-field
|
|
<van-field
|
|
- class=""
|
|
|
|
|
|
+ v-if="isRemark == 3"
|
|
|
|
+ style="background: #f5f5f5; border-radius: 8px; margin-bottom: 30px"
|
|
|
|
+ clearable
|
|
|
|
+ rows="2"
|
|
|
|
+ autosize
|
|
|
|
+ type="textarea"
|
|
|
|
+ :placeholder="dialogPlaceholder"
|
|
|
|
+ v-model="groupName"
|
|
|
|
+ maxlength="200"
|
|
|
|
+ />
|
|
|
|
+ <van-field
|
|
|
|
+ v-else
|
|
style="height: 40px; background: #f5f5f5; border-radius: 8px; margin-bottom: 30px"
|
|
style="height: 40px; background: #f5f5f5; border-radius: 8px; margin-bottom: 30px"
|
|
clearable
|
|
clearable
|
|
:placeholder="dialogPlaceholder"
|
|
:placeholder="dialogPlaceholder"
|
|
@@ -504,15 +527,15 @@ const isNotDisturb = ref(0)
|
|
const isTop = ref(0)
|
|
const isTop = ref(0)
|
|
|
|
|
|
// 弹出窗
|
|
// 弹出窗
|
|
-const showDialog = ref(false)
|
|
|
|
-const isRemark = ref(0) //0 群名称 1备注 2 我在群里的昵称
|
|
|
|
|
|
+const showDialogs = ref(false)
|
|
|
|
+const isRemark = ref(0) //0 群名称 1备注 2 我在群里的昵称 3 修改群介绍
|
|
const dialogTitle = ref('')
|
|
const dialogTitle = ref('')
|
|
const dialogPlaceholder = ref('')
|
|
const dialogPlaceholder = ref('')
|
|
const dialogSubTitle = ref('')
|
|
const dialogSubTitle = ref('')
|
|
|
|
|
|
// 弹窗的方法
|
|
// 弹窗的方法
|
|
const openDialog = (item) => {
|
|
const openDialog = (item) => {
|
|
- showDialog.value = true
|
|
|
|
|
|
+ showDialogs.value = true
|
|
dialogTitle.value = item?.title
|
|
dialogTitle.value = item?.title
|
|
isRemark.value = item.isRemark
|
|
isRemark.value = item.isRemark
|
|
groupName.value = item?.value
|
|
groupName.value = item?.value
|
|
@@ -521,17 +544,21 @@ const openDialog = (item) => {
|
|
}
|
|
}
|
|
// 弹窗确认的事件
|
|
// 弹窗确认的事件
|
|
const confirm = () => {
|
|
const confirm = () => {
|
|
|
|
+ // 修改群名称
|
|
if (userGroupData.value?.groupRole == 1 && isRemark.value == 0)
|
|
if (userGroupData.value?.groupRole == 1 && isRemark.value == 0)
|
|
changeGroupName({ groupName: groupName.value })
|
|
changeGroupName({ groupName: groupName.value })
|
|
|
|
+ // 修改群介绍
|
|
|
|
+ if (userGroupData.value?.groupRole == 1 && isRemark.value == 3)
|
|
|
|
+ changeGroupName({ groupId: setData.id, description: groupName.value })
|
|
|
|
|
|
|
|
+ // 修群备注
|
|
if (isRemark.value == 1) changeTourMember({ groupId: setData.id, remark: groupName.value })
|
|
if (isRemark.value == 1) changeTourMember({ groupId: setData.id, remark: groupName.value })
|
|
|
|
|
|
|
|
+ // 修改群昵称
|
|
if (isRemark.value == 2)
|
|
if (isRemark.value == 2)
|
|
changeGroupName({
|
|
changeGroupName({
|
|
groupNickname: groupName.value
|
|
groupNickname: groupName.value
|
|
})
|
|
})
|
|
-
|
|
|
|
- // showDialog.value = false
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// groupName 修改群名称
|
|
// groupName 修改群名称
|
|
@@ -552,7 +579,8 @@ const changeGroupName = async (body) => {
|
|
})
|
|
})
|
|
|
|
|
|
if (data) {
|
|
if (data) {
|
|
- userGroupData.value[Object.keys(body)[0]] = groupName.value
|
|
|
|
|
|
+ getGroupSetData()
|
|
|
|
+ // userGroupData.value[Object.keys(body)[0]] = groupName.value
|
|
|
|
|
|
// showSuccessToast('修改成功')
|
|
// showSuccessToast('修改成功')
|
|
} else {
|
|
} else {
|
|
@@ -586,6 +614,13 @@ const handleTypeClick = (item) => {
|
|
} else {
|
|
} else {
|
|
showIndex.value = item.id
|
|
showIndex.value = item.id
|
|
subTypeList.value = item.children
|
|
subTypeList.value = item.children
|
|
|
|
+ if (item.children == 0) {
|
|
|
|
+ childrenIndex.value = item.id
|
|
|
|
+ groupTypeName.value = item.typeName
|
|
|
|
+ } else {
|
|
|
|
+ childrenIndex.value = null
|
|
|
|
+ groupTypeName.value = ''
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 选中群类型子集的方法
|
|
// 选中群类型子集的方法
|
|
@@ -623,12 +658,21 @@ async function getTreeType() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-// 群聊类型
|
|
|
|
-const changeBelongTypeId = async () => {
|
|
|
|
- if (childrenIndex.value != setData.belongTypeId) {
|
|
|
|
- changeGroupBelongTypeIdIsNeedConfirm({ belongTypeId: childrenIndex.value })
|
|
|
|
|
|
+// 确认群聊类型
|
|
|
|
+const changeBelongTypeId = () => {
|
|
|
|
+ if (groupTypeName.value && childrenIndex.value) {
|
|
|
|
+ if (childrenIndex.value != setData.belongTypeId) {
|
|
|
|
+ changeGroupBelongTypeIdIsNeedConfirm({ belongTypeId: childrenIndex.value })
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ showDialog({
|
|
|
|
+ width: 260,
|
|
|
|
+ message: '请选择群类型',
|
|
|
|
+ confirmButtonColor: '#FF9400'
|
|
|
|
+ })
|
|
|
|
+ .then(() => {})
|
|
|
|
+ .catch(() => {})
|
|
}
|
|
}
|
|
- showBelongTypeId = false
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// 修改 群聊类型 是否开启群验证
|
|
// 修改 群聊类型 是否开启群验证
|
|
@@ -642,10 +686,13 @@ async function changeGroupBelongTypeIdIsNeedConfirm(body) {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
if (data) {
|
|
if (data) {
|
|
- if ((userGroupData.value[Object.keys(body)[0]] = 'belongTypeId')) {
|
|
|
|
- setData.belongTypeIdDictMap.name = groupTypeName.value
|
|
|
|
- }
|
|
|
|
- // showSuccessToast('修改成功')
|
|
|
|
|
|
+ // if ((userGroupData.value[Object.keys(body)[0]] = 'belongTypeId')) {
|
|
|
|
+ // setData.belongTypeIdDictMap.name = groupTypeName.value
|
|
|
|
+
|
|
|
|
+ // }
|
|
|
|
+ getGroupSetData()
|
|
|
|
+ showBelongTypeId.value = false
|
|
|
|
+ showSuccessToast('修改成功')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
} catch (error) {}
|
|
} catch (error) {}
|
|
@@ -662,11 +709,12 @@ const changeTourMember = async (body) => {
|
|
|
|
|
|
if (data) {
|
|
if (data) {
|
|
//修改成功
|
|
//修改成功
|
|
- if ((Object.keys(body)[1] = 'remark')) {
|
|
|
|
- userGroupData.value.groupRemark = groupName.value
|
|
|
|
- } else {
|
|
|
|
- userGroupData.value[Object.keys(body)[1]] = groupName.value
|
|
|
|
- }
|
|
|
|
|
|
+ getGroupSetData()
|
|
|
|
+ // if ((Object.keys(body)[1] = 'remark')) {
|
|
|
|
+ // userGroupData.value.groupRemark = groupName.value
|
|
|
|
+ // } else {
|
|
|
|
+ // userGroupData.value[Object.keys(body)[1]] = groupName.value
|
|
|
|
+ // }
|
|
showSuccessToast('操作成功')
|
|
showSuccessToast('操作成功')
|
|
} else {
|
|
} else {
|
|
// showSuccessToast('操作失败')
|
|
// showSuccessToast('操作失败')
|
|
@@ -676,7 +724,7 @@ const changeTourMember = async (body) => {
|
|
|
|
|
|
// 弹窗的取消
|
|
// 弹窗的取消
|
|
const cancel = () => {
|
|
const cancel = () => {
|
|
- showDialog.value = false
|
|
|
|
|
|
+ showDialogs.value = false
|
|
}
|
|
}
|
|
|
|
|
|
// 数字转换成布尔值
|
|
// 数字转换成布尔值
|
|
@@ -789,21 +837,19 @@ const handleAnnouncement = () => {
|
|
}
|
|
}
|
|
|
|
|
|
// 修改群介绍
|
|
// 修改群介绍
|
|
-const handleDescription = () => {
|
|
|
|
|
|
+const handleDescription = (item) => {
|
|
if (isRankAndFiler(userGroupData.value?.groupRole)) {
|
|
if (isRankAndFiler(userGroupData.value?.groupRole)) {
|
|
- showDialog({
|
|
|
|
- width: 260,
|
|
|
|
- title: '群介绍',
|
|
|
|
- message: setData.description,
|
|
|
|
- confirmButtonColor: '#FF9400'
|
|
|
|
- }).then(() => {
|
|
|
|
- // on close
|
|
|
|
- })
|
|
|
|
|
|
+ showDialogs.value = true
|
|
|
|
+ dialogTitle.value = item.title
|
|
|
|
+ isRemark.value = item.isRemark
|
|
|
|
+ groupName.value = item?.value
|
|
|
|
+ dialogPlaceholder.value = item?.placeholder
|
|
|
|
+ dialogSubTitle.value = item?.subTitle
|
|
} else {
|
|
} else {
|
|
showDialog({
|
|
showDialog({
|
|
width: 260,
|
|
width: 260,
|
|
title: '群介绍',
|
|
title: '群介绍',
|
|
- message: setData.description,
|
|
|
|
|
|
+ message: setData?.description ? setData?.description : '暂无群介绍',
|
|
confirmButtonColor: '#FF9400'
|
|
confirmButtonColor: '#FF9400'
|
|
}).then(() => {
|
|
}).then(() => {
|
|
// on close
|
|
// on close
|