feat: 统一IM后台商户文案和默认选择

This commit is contained in:
richjohnrambo
2026-09-09 14:28:44 +08:00
parent da60b52be2
commit 27a368b386
76 changed files with 272 additions and 186 deletions
+18 -5
View File
@@ -1,7 +1,7 @@
<template>
<div>
<div class="n-layout-page-header">
<n-card :bordered="false" title="IM Kafka死信"></n-card>
<n-card :bordered="false" title="IM Kafka死信" />
</div>
<n-card :bordered="false" class="proCard">
<BasicForm
@@ -30,7 +30,7 @@
import { BasicTable, TableAction } from '@/components/Table';
import { BasicForm, useForm } from '@/components/Form/index';
import { List } from '@/api/imDeadLetter';
import { columns, loadOptions, loadTenantOptions, schemas, State } from './model';
import { columns, loadOptions, loadTenantOptions, schemas, State, tenantOptions } from './model';
import { adaTableScrollX } from '@/utils/hotgo';
import ViewModal from './view.vue';
@@ -48,7 +48,13 @@
render(record: State) {
return h(TableAction as any, {
style: 'button',
actions: [{ label: '详情', onClick: () => viewRef.value.openModal(record, currentTenantId.value), auth: ['/imDeadLetter/view'] }],
actions: [
{
label: '详情',
onClick: () => viewRef.value.openModal(record, currentTenantId.value),
auth: ['/imDeadLetter/view'],
},
],
});
},
});
@@ -56,7 +62,7 @@
const scrollX = computed(() => adaTableScrollX(columns, actionColumn.width));
const currentTenantId = computed(() => searchFormRef.value?.formModel?.tenantId || 0);
const [register] = useForm({
const [register, { setFieldsValue }] = useForm({
gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' },
labelWidth: 90,
schemas,
@@ -66,7 +72,11 @@
if (!currentTenantId.value) {
return { list: [], totalCount: 0 };
}
const params = { ...searchFormRef.value?.formModel, limit: res.pageSize || res.perPage || 50, cursor: cursor.value };
const params = {
...searchFormRef.value?.formModel,
limit: res.pageSize || res.perPage || 50,
cursor: cursor.value,
};
const data = await List(params);
hasMore.value = !!data?.hasMore;
cursor.value = data?.nextCursor || '';
@@ -82,6 +92,9 @@
onMounted(async () => {
loadOptions();
await loadTenantOptions();
if (tenantOptions.value.length > 0) {
await setFieldsValue({ tenantId: tenantOptions.value[0].value });
}
});
</script>