✨ feat(im): 用户的输入,改成 userselectv2,增强体验。
parent
3cc7ac7f8b
commit
31dc1b1198
|
|
@ -8,39 +8,11 @@
|
|||
:inline="true"
|
||||
label-width="80px"
|
||||
>
|
||||
<!-- TODO DONE @AI:使用 userselectv2 组件(v2 待建,先用 simple-list + filterable 下拉) -->
|
||||
<el-form-item label="用户" prop="userId">
|
||||
<el-select
|
||||
v-model="queryParams.userId"
|
||||
placeholder="请选择用户"
|
||||
clearable
|
||||
filterable
|
||||
class="!w-200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="user in userOptions"
|
||||
:key="user.id"
|
||||
:label="`${user.nickname} (${user.id})`"
|
||||
:value="user.id"
|
||||
/>
|
||||
</el-select>
|
||||
<UserSelectV2 v-model="queryParams.userId" class="!w-200px" />
|
||||
</el-form-item>
|
||||
<!-- TODO DONE @AI:使用 userselectv2 组件(v2 待建,先用 simple-list + filterable 下拉) -->
|
||||
<el-form-item label="好友" prop="friendUserId">
|
||||
<el-select
|
||||
v-model="queryParams.friendUserId"
|
||||
placeholder="请选择好友"
|
||||
clearable
|
||||
filterable
|
||||
class="!w-200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="user in userOptions"
|
||||
:key="user.id"
|
||||
:label="`${user.nickname} (${user.id})`"
|
||||
:value="user.id"
|
||||
/>
|
||||
</el-select>
|
||||
<UserSelectV2 v-model="queryParams.friendUserId" placeholder="请选择好友" class="!w-200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="好友状态" prop="status">
|
||||
<el-select
|
||||
|
|
@ -94,14 +66,12 @@
|
|||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="编号" align="center" prop="id" width="100" />
|
||||
<!-- TODO DONE @AI:宽度调整下 -->
|
||||
<el-table-column label="用户" align="center" min-width="200" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.userNickname || '-' }}</span>
|
||||
<span class="text-gray-400 ml-5px">({{ row.userId }})</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- TODO DONE @AI:宽度调整下 -->
|
||||
<el-table-column label="好友" align="center" min-width="200" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.friendNickname || '-' }}</span>
|
||||
|
|
@ -148,14 +118,13 @@
|
|||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { DICT_TYPE, getIntDictOptions, getBoolDictOptions } from '@/utils/dict'
|
||||
import * as ManagerFriendApi from '@/api/im/manager/friend'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
import UserSelectV2 from '@/views/system/user/components/UserSelectV2.vue'
|
||||
|
||||
defineOptions({ name: 'ImFriend' })
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const total = ref(0) // 列表的总页数
|
||||
const list = ref<ManagerFriendApi.ImManagerFriendVO[]>([]) // 列表的数据
|
||||
const userOptions = ref<UserApi.UserVO[]>([]) // 用户下拉的候选项
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
|
|
@ -192,9 +161,7 @@ const resetQuery = () => {
|
|||
}
|
||||
|
||||
/** 初始化 */
|
||||
onMounted(async () => {
|
||||
// 用户下拉一次性拉简化数据,给 userId / friendUserId 共用
|
||||
userOptions.value = await UserApi.getSimpleUserList()
|
||||
await getList()
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,171 @@
|
|||
<!--
|
||||
群选择器:只读输入框 + 点击弹窗选择
|
||||
|
||||
对齐 UserSelectV2 架构模式
|
||||
|
||||
交互:显示为只读 el-input,点击打开弹窗(单选模式)进行选择
|
||||
Props:
|
||||
modelValue — 绑定的群 ID(v-model)
|
||||
disabled — 是否禁用
|
||||
clearable — 是否允许清空(鼠标悬停时显示清除图标)
|
||||
placeholder — 占位文字
|
||||
Events:
|
||||
update:modelValue — v-model 更新
|
||||
change(item) — 选中群变化时触发,传递完整 ImManagerGroupVO(清空时为 undefined)
|
||||
-->
|
||||
<template>
|
||||
<div
|
||||
v-bind="attrs"
|
||||
class="w-full"
|
||||
:class="disabled ? 'cursor-not-allowed' : 'cursor-pointer'"
|
||||
@click="handleClick"
|
||||
@mouseenter="hovering = true"
|
||||
@mouseleave="hovering = false"
|
||||
>
|
||||
<el-tooltip :disabled="!selectedItem" placement="top" :show-after="500">
|
||||
<template #content>
|
||||
<div v-if="selectedItem" class="leading-6">
|
||||
<div>群名称:{{ selectedItem.name }}</div>
|
||||
<div>群主:{{ selectedItem.ownerNickname || '-' }}</div>
|
||||
<div>成员数:{{ selectedItem.memberCount ?? '-' }}</div>
|
||||
</div>
|
||||
</template>
|
||||
<el-input
|
||||
:model-value="displayLabel"
|
||||
:placeholder="placeholder"
|
||||
:disabled="disabled"
|
||||
readonly
|
||||
:suffix-icon="suffixIcon"
|
||||
:class="disabled ? 'is-select-disabled' : 'is-select-clickable'"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<!-- 弹窗必须放在 div 外部,否则弹窗内的点击事件会冒泡到 div 触发 handleClick -->
|
||||
<GroupSelectDialog ref="dialogRef" :multiple="false" @selected="handleSelected" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import * as ManagerGroupApi from '@/api/im/manager/group'
|
||||
import { Search, CircleClose } from '@element-plus/icons-vue'
|
||||
import GroupSelectDialog from './GroupSelectDialog.vue'
|
||||
|
||||
// 组件有两个根节点(div + Dialog),Vue 不会自动继承 attrs;
|
||||
// 手动透传到外层 div,确保父组件传入的 class / style 等生效
|
||||
const attrs = useAttrs()
|
||||
|
||||
defineOptions({ name: 'GroupSelect', inheritAttrs: false })
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
modelValue?: number // 绑定的群 ID
|
||||
disabled?: boolean // 是否禁用
|
||||
clearable?: boolean // 是否允许清空
|
||||
placeholder?: string // 占位文字
|
||||
}>(),
|
||||
{
|
||||
disabled: false,
|
||||
clearable: true,
|
||||
placeholder: '请选择群'
|
||||
}
|
||||
)
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:modelValue': [value: number | undefined]
|
||||
change: [item: ManagerGroupApi.ImManagerGroupVO | undefined]
|
||||
}>()
|
||||
|
||||
const dialogRef = ref() // 弹窗 Ref
|
||||
const hovering = ref(false) // 鼠标是否悬停
|
||||
|
||||
// ==================== 名称回显 ====================
|
||||
const selectedItem = ref<ManagerGroupApi.ImManagerGroupVO | undefined>() // 当前选中的群对象
|
||||
|
||||
/** 输入框显示文本:展示群名称 */
|
||||
const displayLabel = computed(() => {
|
||||
return selectedItem.value?.name ?? ''
|
||||
})
|
||||
|
||||
/** 是否显示清除图标 */
|
||||
const showClear = computed(() => {
|
||||
return props.clearable && !props.disabled && hovering.value && props.modelValue != null
|
||||
})
|
||||
|
||||
/** 后缀图标:悬停且有值时显示清除,否则显示搜索 */
|
||||
const suffixIcon = computed(() => {
|
||||
return showClear.value ? CircleClose : Search
|
||||
})
|
||||
|
||||
/** 根据 ID 单条查询群信息(用于编辑回显) */
|
||||
const resolveItemById = async (id: number | undefined) => {
|
||||
if (id == null) {
|
||||
selectedItem.value = undefined
|
||||
return
|
||||
}
|
||||
if (selectedItem.value?.id === id) {
|
||||
return
|
||||
}
|
||||
try {
|
||||
selectedItem.value = await ManagerGroupApi.getManagerGroup(id)
|
||||
} catch (e) {
|
||||
console.error('[GroupSelect] resolveItemById failed:', e)
|
||||
}
|
||||
}
|
||||
|
||||
/** 监听 modelValue 变化,触发回显 */
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(val) => {
|
||||
resolveItemById(val)
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
// ==================== 点击交互 ====================
|
||||
|
||||
/** 点击组件:清除或打开弹窗 */
|
||||
const handleClick = (e: MouseEvent) => {
|
||||
if (props.disabled) {
|
||||
return
|
||||
}
|
||||
// 点击清除图标:清空选中
|
||||
const target = e.target as HTMLElement
|
||||
if (showClear.value && target.closest('.el-input__suffix')) {
|
||||
e.stopPropagation()
|
||||
selectedItem.value = undefined
|
||||
emit('update:modelValue', undefined)
|
||||
emit('change', undefined)
|
||||
return
|
||||
}
|
||||
// 打开弹窗,传入当前选中 ID 用于预选高亮
|
||||
const selectedIds = props.modelValue != null ? [props.modelValue] : []
|
||||
dialogRef.value.open(selectedIds)
|
||||
}
|
||||
|
||||
/** 弹窗选中回调 */
|
||||
const handleSelected = (rows: ManagerGroupApi.ImManagerGroupVO[]) => {
|
||||
if (!rows || rows.length === 0) {
|
||||
return
|
||||
}
|
||||
const item = rows[0]
|
||||
selectedItem.value = item
|
||||
emit('update:modelValue', item.id)
|
||||
emit('change', item)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/* :deep 用于穿透 el-input 内部元素的 cursor 样式,UnoCSS 无法直接处理组件内部 DOM */
|
||||
.is-select-clickable {
|
||||
:deep(.el-input__wrapper),
|
||||
:deep(.el-input__inner) {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.is-select-disabled {
|
||||
:deep(.el-input__wrapper),
|
||||
:deep(.el-input__inner) {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,290 @@
|
|||
<!--
|
||||
群弹窗选择器(支持单选/多选)
|
||||
|
||||
对齐 UserSelectDialogV2 架构模式
|
||||
搜索字段 & 展示字段:群名称、群主、成员数、群状态
|
||||
|
||||
Props:
|
||||
multiple — true 多选(checkbox),false 单选(radio);默认 true
|
||||
Events:
|
||||
selected(rows: ImManagerGroupVO[]) — 确认选择后触发,单选时数组长度为 1
|
||||
Expose:
|
||||
open(selectedIds?: number[]) — 打开弹窗,可传入已选 ID 用于预选高亮
|
||||
-->
|
||||
<template>
|
||||
<Dialog title="群选择" v-model="dialogVisible" width="70%">
|
||||
<ContentWrap>
|
||||
<el-form :inline="true" :model="queryParams" label-width="68px">
|
||||
<el-form-item label="群名称">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入群名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-220px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="群状态">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="请选择群状态"
|
||||
clearable
|
||||
class="!w-220px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.IM_GROUP_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery">
|
||||
<Icon icon="ep:search" class="mr-5px" /> 搜索
|
||||
</el-button>
|
||||
<el-button @click="resetQuery">
|
||||
<Icon icon="ep:refresh" class="mr-5px" /> 重置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
<!-- 数据表格:单选 radio / 多选 checkbox 统一在一个 table 内 -->
|
||||
<ContentWrap>
|
||||
<el-table
|
||||
ref="tableRef"
|
||||
v-loading="loading"
|
||||
:data="list"
|
||||
:stripe="true"
|
||||
:show-overflow-tooltip="true"
|
||||
row-key="id"
|
||||
:highlight-current-row="!multiple"
|
||||
@selection-change="handleSelectionChange"
|
||||
@row-click="handleRowClick"
|
||||
@row-dblclick="handleRowDblClick"
|
||||
>
|
||||
<!-- 多选:checkbox(reserve-selection 保证跨页勾选不丢失) -->
|
||||
<el-table-column
|
||||
v-if="multiple"
|
||||
type="selection"
|
||||
:reserve-selection="true"
|
||||
width="50"
|
||||
align="center"
|
||||
/>
|
||||
<!-- 单选:radio -->
|
||||
<el-table-column v-else width="50" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-radio
|
||||
v-model="selectedRadioId"
|
||||
:value="row.id"
|
||||
class="radio-no-label"
|
||||
@change="handleRadioChange(row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="编号" align="center" prop="id" width="100" />
|
||||
<el-table-column label="头像" align="center" width="80">
|
||||
<template #default="{ row }">
|
||||
<el-avatar :src="row.avatar" :size="32">
|
||||
{{ row.name?.charAt(0) ?? '?' }}
|
||||
</el-avatar>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="群名称" align="left" prop="name" min-width="160" />
|
||||
<el-table-column label="群主" align="center" min-width="160">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.ownerNickname || '-' }}</span>
|
||||
<span class="text-gray-400 ml-5px">({{ row.ownerUserId }})</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="成员数" align="center" prop="memberCount" width="90" />
|
||||
<el-table-column label="群状态" align="center" prop="status" width="100">
|
||||
<template #default="{ row }">
|
||||
<dict-tag :type="DICT_TYPE.IM_GROUP_STATUS" :value="row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
<template #footer>
|
||||
<el-button type="primary" @click="confirmSelect">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import * as ManagerGroupApi from '@/api/im/manager/group'
|
||||
|
||||
defineOptions({ name: 'GroupSelectDialog' })
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
multiple?: boolean // true 多选(checkbox),false 单选(radio)
|
||||
}>(),
|
||||
{
|
||||
multiple: true
|
||||
}
|
||||
)
|
||||
|
||||
const message = useMessage()
|
||||
const emit = defineEmits<{
|
||||
selected: [rows: ManagerGroupApi.ImManagerGroupVO[]]
|
||||
}>()
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗是否展示
|
||||
const loading = ref(false) // 列表加载中
|
||||
const list = ref<ManagerGroupApi.ImManagerGroupVO[]>([]) // 群列表
|
||||
const total = ref(0) // 总条数
|
||||
|
||||
// ==================== 选中状态 ====================
|
||||
const tableRef = ref() // 表格 Ref
|
||||
const selectedRows = ref<ManagerGroupApi.ImManagerGroupVO[]>([]) // 多选模式:选中行
|
||||
const selectedRadioId = ref<number>() // 单选模式:选中 ID
|
||||
const currentRadioRow = ref<ManagerGroupApi.ImManagerGroupVO>() // 单选模式:选中行对象
|
||||
const preSelectedIds = ref<number[]>([]) // 打开弹窗时传入的已选 ID
|
||||
|
||||
/** 多选:checkbox 变化 */
|
||||
const handleSelectionChange = (rows: ManagerGroupApi.ImManagerGroupVO[]) => {
|
||||
if (props.multiple) {
|
||||
selectedRows.value = rows
|
||||
}
|
||||
}
|
||||
|
||||
/** 单选:radio 变化 */
|
||||
const handleRadioChange = (row: ManagerGroupApi.ImManagerGroupVO) => {
|
||||
currentRadioRow.value = row
|
||||
}
|
||||
|
||||
/** 单击行:单选模式下点击整行即选中(降低操作成本),多选不处理(避免和 dblclick 冲突) */
|
||||
const handleRowClick = (row: ManagerGroupApi.ImManagerGroupVO) => {
|
||||
if (props.multiple) {
|
||||
return
|
||||
}
|
||||
selectedRadioId.value = row.id
|
||||
currentRadioRow.value = row
|
||||
}
|
||||
|
||||
/** 双击行:多选模式切换勾选,单选模式直接确认 */
|
||||
const handleRowDblClick = (row: ManagerGroupApi.ImManagerGroupVO) => {
|
||||
if (props.multiple) {
|
||||
tableRef.value?.toggleRowSelection(row)
|
||||
return
|
||||
}
|
||||
selectedRadioId.value = row.id
|
||||
currentRadioRow.value = row
|
||||
confirmSelect()
|
||||
}
|
||||
|
||||
// ==================== 群查询 ====================
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
name: undefined as string | undefined,
|
||||
status: undefined as number | undefined
|
||||
})
|
||||
|
||||
/** 查询群列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await ManagerGroupApi.getManagerGroupPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
await nextTick()
|
||||
applyPreSelection()
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 恢复预选状态(当前页可见范围内) */
|
||||
const applyPreSelection = () => {
|
||||
if (preSelectedIds.value.length === 0) {
|
||||
return
|
||||
}
|
||||
if (props.multiple) {
|
||||
const table = tableRef.value
|
||||
if (!table) {
|
||||
return
|
||||
}
|
||||
list.value.forEach((row) => {
|
||||
if (preSelectedIds.value.includes(row.id)) {
|
||||
table.toggleRowSelection(row, true)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const match = list.value.find((row) => preSelectedIds.value.includes(row.id))
|
||||
if (match) {
|
||||
selectedRadioId.value = match.id
|
||||
currentRadioRow.value = match
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置查询条件 */
|
||||
const resetQuery = () => {
|
||||
queryParams.name = undefined
|
||||
queryParams.status = undefined
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 确认选择 */
|
||||
const confirmSelect = () => {
|
||||
if (props.multiple) {
|
||||
if (selectedRows.value.length === 0) {
|
||||
message.warning('请至少选择一条数据')
|
||||
return
|
||||
}
|
||||
emit('selected', selectedRows.value)
|
||||
} else {
|
||||
if (!currentRadioRow.value) {
|
||||
message.warning('请选择一条数据')
|
||||
return
|
||||
}
|
||||
emit('selected', [currentRadioRow.value])
|
||||
}
|
||||
dialogVisible.value = false
|
||||
}
|
||||
|
||||
// ==================== 打开弹窗 ====================
|
||||
|
||||
/** 打开弹窗,可传入已选 ID 用于预选高亮 */
|
||||
const open = async (selectedIds?: number[]) => {
|
||||
dialogVisible.value = true
|
||||
// 二次打开复位查询条件 + 选中状态,避免继承上次上下文
|
||||
queryParams.name = undefined
|
||||
queryParams.status = undefined
|
||||
queryParams.pageNo = 1
|
||||
selectedRows.value = []
|
||||
selectedRadioId.value = undefined
|
||||
currentRadioRow.value = undefined
|
||||
preSelectedIds.value = selectedIds ?? []
|
||||
// 多选模式清空跨页缓存的勾选
|
||||
await nextTick()
|
||||
tableRef.value?.clearSelection()
|
||||
await getList()
|
||||
}
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/* 隐藏 radio 的 label 文字,只保留圆圈 */
|
||||
.radio-no-label {
|
||||
:deep(.el-radio__label) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -17,12 +17,10 @@
|
|||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="群主编号" prop="ownerUserId">
|
||||
<el-input
|
||||
<el-form-item label="群主" prop="ownerUserId">
|
||||
<UserSelectV2
|
||||
v-model="queryParams.ownerUserId"
|
||||
placeholder="请输入群主用户编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
placeholder="请选择群主"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
|
@ -169,6 +167,7 @@
|
|||
import { DICT_TYPE, getIntDictOptions, getBoolDictOptions } from '@/utils/dict'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import * as ManagerGroupApi from '@/api/im/manager/group'
|
||||
import UserSelectV2 from '@/views/system/user/components/UserSelectV2.vue'
|
||||
import GroupDetail from './GroupDetail.vue'
|
||||
import GroupBanForm from './GroupBanForm.vue'
|
||||
|
||||
|
|
|
|||
|
|
@ -8,23 +8,13 @@
|
|||
:inline="true"
|
||||
label-width="88px"
|
||||
>
|
||||
<!-- TODO @AI:groupselect;在 group components 提供一个组件 -->
|
||||
<el-form-item label="群编号" prop="groupId">
|
||||
<el-input
|
||||
v-model="queryParams.groupId"
|
||||
placeholder="请输入群编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
<el-form-item label="群" prop="groupId">
|
||||
<GroupSelect v-model="queryParams.groupId" class="!w-240px" />
|
||||
</el-form-item>
|
||||
<!-- TODO @AI:使用 userselectv2;可以晚点处理; -->
|
||||
<el-form-item label="发送人编号" prop="senderId">
|
||||
<el-input
|
||||
<el-form-item label="发送人" prop="senderId">
|
||||
<UserSelectV2
|
||||
v-model="queryParams.senderId"
|
||||
placeholder="请输入发送人用户编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
placeholder="请选择发送人"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
|
@ -43,21 +33,14 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- TODO @AI:不用消息状态检索;改成内容检索; -->
|
||||
<el-form-item label="消息状态" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="请选择消息状态"
|
||||
<el-form-item label="消息内容" prop="content">
|
||||
<el-input
|
||||
v-model="queryParams.content"
|
||||
placeholder="请输入消息内容"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.IM_GROUP_MESSAGE_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="发送时间" prop="sendTime">
|
||||
<el-date-picker
|
||||
|
|
@ -166,6 +149,8 @@ import { dateFormatter } from '@/utils/formatTime'
|
|||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import { IM_AT_ALL_NICKNAME, IM_AT_ALL_USER_ID } from '@/views/im/utils/constants'
|
||||
import * as ManagerGroupMessageApi from '@/api/im/manager/message/group'
|
||||
import UserSelectV2 from '@/views/system/user/components/UserSelectV2.vue'
|
||||
import GroupSelect from '@/views/im/manager/group/components/GroupSelect.vue'
|
||||
import MessageContentPreview from '../MessageContentPreview.vue'
|
||||
import GroupMessageDetail from './GroupMessageDetail.vue'
|
||||
|
||||
|
|
@ -180,7 +165,7 @@ const queryParams = reactive({
|
|||
groupId: undefined as number | undefined,
|
||||
senderId: undefined as number | undefined,
|
||||
type: undefined as number | undefined,
|
||||
status: undefined as number | undefined,
|
||||
content: undefined as string | undefined,
|
||||
sendTime: [] as string[]
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
|
|
|
|||
|
|
@ -8,23 +8,17 @@
|
|||
:inline="true"
|
||||
label-width="88px"
|
||||
>
|
||||
<!-- TODO @AI:使用 userselectv2;可以晚点处理; -->
|
||||
<el-form-item label="发送人编号" prop="senderId">
|
||||
<el-input
|
||||
<el-form-item label="发送人" prop="senderId">
|
||||
<UserSelectV2
|
||||
v-model="queryParams.senderId"
|
||||
placeholder="请输入发送人用户编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
placeholder="请选择发送人"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- TODO @AI:使用 userselectv2;可以晚点处理; -->
|
||||
<el-form-item label="接收人编号" prop="receiverId">
|
||||
<el-input
|
||||
<el-form-item label="接收人" prop="receiverId">
|
||||
<UserSelectV2
|
||||
v-model="queryParams.receiverId"
|
||||
placeholder="请输入接收人用户编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
placeholder="请选择接收人"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
|
@ -43,21 +37,14 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- TODO @AI:不用消息状态检索;改成内容检索; -->
|
||||
<el-form-item label="消息状态" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="请选择消息状态"
|
||||
<el-form-item label="消息内容" prop="content">
|
||||
<el-input
|
||||
v-model="queryParams.content"
|
||||
placeholder="请输入消息内容"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.IM_PRIVATE_MESSAGE_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="发送时间" prop="sendTime">
|
||||
<el-date-picker
|
||||
|
|
@ -144,6 +131,7 @@
|
|||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import * as ManagerPrivateMessageApi from '@/api/im/manager/message/private'
|
||||
import UserSelectV2 from '@/views/system/user/components/UserSelectV2.vue'
|
||||
import MessageContentPreview from '../MessageContentPreview.vue'
|
||||
import PrivateMessageDetail from './PrivateMessageDetail.vue'
|
||||
|
||||
|
|
@ -158,7 +146,7 @@ const queryParams = reactive({
|
|||
senderId: undefined as number | undefined,
|
||||
receiverId: undefined as number | undefined,
|
||||
type: undefined as number | undefined,
|
||||
status: undefined as number | undefined,
|
||||
content: undefined as string | undefined,
|
||||
sendTime: [] as string[]
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
|
|
|
|||
Loading…
Reference in New Issue