feat: 优化群聊消息手动查询
This commit is contained in:
@@ -108,6 +108,7 @@
|
||||
const showDetail = ref(false);
|
||||
const showAction = ref(false);
|
||||
const submitting = ref(false);
|
||||
const hasQueried = ref(!props.group);
|
||||
const current = ref<Recordable>({});
|
||||
const reason = ref('');
|
||||
const actionType = ref<'hide' | 'delete'>('hide');
|
||||
@@ -148,21 +149,28 @@
|
||||
schemas,
|
||||
});
|
||||
const loadDataTable = async (res) => {
|
||||
if (props.group && !hasQueried.value) return { list: [], page: 1, pageCount: 0, totalCount: 0 };
|
||||
const params = { ...searchFormRef.value?.formModel, ...res };
|
||||
if (isPlatformAdmin.value && !params.tenantId)
|
||||
return { list: [], page: 1, pageCount: 0, totalCount: 0 };
|
||||
return api.List(params);
|
||||
};
|
||||
function reloadTable() {
|
||||
hasQueried.value = true;
|
||||
actionRef.value?.reload();
|
||||
}
|
||||
async function handleReset() {
|
||||
const defaults: Recordable = {};
|
||||
if (isPlatformAdmin.value) defaults.tenantId = imQueryTenantOptions.value[0]?.value;
|
||||
await setFieldsValue(defaults);
|
||||
reloadTable();
|
||||
if (props.group) hasQueried.value = false;
|
||||
actionRef.value?.reload();
|
||||
}
|
||||
function handleExport() {
|
||||
if (props.group && !hasQueried.value) {
|
||||
message.warning('请先查询群聊消息');
|
||||
return;
|
||||
}
|
||||
const params = { ...searchFormRef.value?.formModel };
|
||||
if (isPlatformAdmin.value && !params.tenantId) {
|
||||
message.warning('请选择租户');
|
||||
@@ -213,7 +221,7 @@
|
||||
await setFieldsValue({ tenantId: imQueryTenantOptions.value[0].value });
|
||||
else message.warning('暂无可用租户');
|
||||
}
|
||||
reloadTable();
|
||||
if (!props.group) reloadTable();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user