Skip to content

Commit

Permalink
修复后台列表点击查询时没有重置页码
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurunsoft committed Dec 15, 2023
1 parent 71335b1 commit 5372212
Show file tree
Hide file tree
Showing 16 changed files with 76 additions and 28 deletions.
7 changes: 5 additions & 2 deletions admin/src/views/card/details/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<NDatePicker v-model:value="listParams.timeRange" class="pr-2 flex-1" type="daterange" clearable />
</n-form-item>
<n-form-item>
<n-button attr-type="submit" type="primary" @click="getTableData">
<n-button attr-type="submit" type="primary" @click="getTableData(1)">
<n-icon :component="SearchSharp" size="20" />
查询
</n-button>
Expand Down Expand Up @@ -80,8 +80,11 @@ function setTableData(response: Card.CardDetailListResponse) {
pagination.itemCount = response.total;
}
async function getTableData() {
async function getTableData(page: number | null = null) {
startLoading();
if (page !== null) {
pagination.page = page;
}
try {
const { data } = await fetchCardDetails(
listParams.value.cardId,
Expand Down
7 changes: 5 additions & 2 deletions admin/src/views/card/list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
/>
</n-form-item>
<n-form-item>
<n-button attr-type="submit" type="primary" @click="getTableData">
<n-button attr-type="submit" type="primary" @click="getTableData(1)">
<n-icon :component="SearchSharp" size="20" />
查询
</n-button>
Expand Down Expand Up @@ -156,8 +156,11 @@ function setTableData(response: Card.CardListResponse) {
pagination.itemCount = response.total;
}
async function getTableData() {
async function getTableData(page: number | null = null) {
startLoading();
if (page !== null) {
pagination.page = page;
}
try {
const { data } = await fetchCardList(
listParams.value.memberId,
Expand Down
7 changes: 5 additions & 2 deletions admin/src/views/card/memberCardDetails/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<NDatePicker v-model:value="listParams.timeRange" class="pr-2 flex-1" type="daterange" clearable />
</n-form-item>
<n-form-item>
<n-button attr-type="submit" type="primary" @click="getTableData">
<n-button attr-type="submit" type="primary" @click="getTableData(1)">
<n-icon :component="SearchSharp" size="20" />
查询
</n-button>
Expand Down Expand Up @@ -80,8 +80,11 @@ function setTableData(response: Card.MemberCardOrderListResponse) {
pagination.itemCount = response.total;
}
async function getTableData() {
async function getTableData(page: number | null = null) {
startLoading();
if (page !== null) {
pagination.page = page;
}
try {
const { data } = await fetchMemberCardDetails(
memberId,
Expand Down
7 changes: 5 additions & 2 deletions admin/src/views/card/type_list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/>
</n-form-item>
<n-form-item>
<n-button attr-type="submit" type="primary" @click="getTableData">
<n-button attr-type="submit" type="primary" @click="getTableData(1)">
<n-icon :component="SearchSharp" size="20" />
查询
</n-button>
Expand Down Expand Up @@ -95,8 +95,11 @@ function setTableData(response: Card.CardTypeListResponse) {
pagination.itemCount = response.total;
}
async function getTableData() {
async function getTableData(page: number | null = null) {
startLoading();
if (page !== null) {
pagination.page = page;
}
try {
const { data } = await fetchCardTypeList(
undefined === listParams.value.enable ? undefined : Boolean(listParams.value.enable),
Expand Down
7 changes: 5 additions & 2 deletions admin/src/views/chat/list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<n-input v-model:value="listParams.memberSearch" clearable placeholder="ID/用户搜索" />
</n-form-item>
<n-form-item>
<n-button attr-type="submit" type="primary" @click="getTableData">
<n-button attr-type="submit" type="primary" @click="getTableData(1)">
<n-icon :component="SearchSharp" size="20" />
查询
</n-button>
Expand Down Expand Up @@ -70,8 +70,11 @@ function setTableData(response: Chat.SessionListResponse) {
pagination.itemCount = response.total;
}
async function getTableData() {
async function getTableData(page: number | null = null) {
startLoading();
if (page !== null) {
pagination.page = page;
}
try {
const { data } = await fetchChatSessionList(
listParams.value.memberSearch,
Expand Down
5 changes: 4 additions & 1 deletion admin/src/views/chat/message_list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ function setTableData(response: Chat.MessageListResponse) {
pagination.itemCount = response.total;
}
async function getTableData() {
async function getTableData(page: number | null = null) {
startLoading();
if (page !== null) {
pagination.page = page;
}
try {
const { data } = await fetchChatMessageList(sessionId, pagination.page, pagination.pageSize);
if (data) {
Expand Down
7 changes: 5 additions & 2 deletions admin/src/views/config/email_black_list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<n-input v-model:value="listParams.search" clearable placeholder="关键词搜索" />
</n-form-item>
<n-form-item>
<n-button attr-type="submit" type="primary" @click="getTableData">
<n-button attr-type="submit" type="primary" @click="getTableData(1)">
<n-icon :component="SearchSharp" size="20" />
查询
</n-button>
Expand Down Expand Up @@ -87,8 +87,11 @@ function setTableData(response: Email.EmailBlackListResponse) {
}
}
async function getTableData() {
async function getTableData(page: number | null = null) {
startLoading();
if (page !== null) {
pagination.page = page;
}
try {
const { data } = await fetchEmailBlackList(listParams.value.search, pagination.page, pagination.pageSize);
if (data) {
Expand Down
5 changes: 4 additions & 1 deletion admin/src/views/embedding/file_list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,11 @@ function setTableData(response: Embedding.FileListResponse) {
pagination.itemCount = response.list.length;
}
async function getTableData() {
async function getTableData(page: number | null = null) {
startLoading();
if (page !== null) {
pagination.page = page;
}
try {
const { data } = await fetchEmbeddingFileList(projectId);
if (data) {
Expand Down
7 changes: 5 additions & 2 deletions admin/src/views/embedding/list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<n-input v-model:value="listParams.memberSearch" clearable placeholder="ID/用户搜索" />
</n-form-item>
<n-form-item>
<n-button attr-type="submit" type="primary" @click="getTableData">
<n-button attr-type="submit" type="primary" @click="getTableData(1)">
<n-icon :component="SearchSharp" size="20" />
查询
</n-button>
Expand Down Expand Up @@ -59,8 +59,11 @@ function setTableData(response: Embedding.ProjectListResponse) {
pagination.itemCount = response.total;
}
async function getTableData() {
async function getTableData(page: number | null = null) {
startLoading();
if (page !== null) {
pagination.page = page;
}
try {
const { data } = await fetchEmbeddingProjectList(
listParams.value.memberSearch,
Expand Down
7 changes: 5 additions & 2 deletions admin/src/views/embedding/public_list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/>
</n-form-item>
<n-form-item>
<n-button attr-type="submit" type="primary" @click="getTableData">
<n-button attr-type="submit" type="primary" @click="getTableData(1)">
<n-icon :component="SearchSharp" size="20" />
查询
</n-button>
Expand Down Expand Up @@ -65,8 +65,11 @@ function setTableData(response: Embedding.PublicProjectListResponse) {
pagination.itemCount = response.total;
}
async function getTableData() {
async function getTableData(page: number | null = null) {
startLoading();
if (page !== null) {
pagination.page = page;
}
try {
const { data } = await fetchEmbeddingPublicProjectList(
listParams.value.status,
Expand Down
5 changes: 4 additions & 1 deletion admin/src/views/embedding/qa_list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ function setTableData(response: Embedding.QAListResponse) {
pagination.itemCount = response.total;
}
async function getTableData() {
async function getTableData(page: number | null = null) {
startLoading();
if (page !== null) {
pagination.page = page;
}
try {
const { data } = await fetchEmbeddingQAList(projectId, pagination.page, pagination.pageSize);
if (data) {
Expand Down
7 changes: 5 additions & 2 deletions admin/src/views/management/admin_member/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<n-input v-model:value="listParams.search" clearable placeholder="关键词搜索" />
</n-form-item>
<n-form-item>
<n-button attr-type="submit" type="primary" @click="getTableData">
<n-button attr-type="submit" type="primary" @click="getTableData(1)">
<n-icon :component="SearchSharp" size="20" />
查询
</n-button>
Expand Down Expand Up @@ -84,8 +84,11 @@ function setTableData(response: Admin.AdminMemberListResponse) {
pagination.itemCount = response.total;
}
async function getTableData() {
async function getTableData(page: number | null = null) {
startLoading();
if (page !== null) {
pagination.page = page;
}
try {
const { data } = await fetchAdminMemberList(
listParams.value.search,
Expand Down
7 changes: 5 additions & 2 deletions admin/src/views/management/operation_log/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<NDatePicker v-model:value="listParams.timeRange" class="pr-2 flex-1" type="daterange" clearable />
</n-form-item>
<n-form-item>
<n-button attr-type="submit" type="primary" @click="getTableData">
<n-button attr-type="submit" type="primary" @click="getTableData(1)">
<n-icon :component="SearchSharp" size="20" />
查询
</n-button>
Expand Down Expand Up @@ -80,8 +80,11 @@ function setTableData(response: AdminOperationLog.LogListResponse) {
pagination.itemCount = response.total;
}
async function getTableData() {
async function getTableData(page: number | null = null) {
startLoading();
if (page !== null) {
pagination.page = page;
}
try {
const { data } = await fetchAdminOperationLogList(
listParams.value.memberId,
Expand Down
7 changes: 5 additions & 2 deletions admin/src/views/member/list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<n-input v-model:value="listParams.search" clearable placeholder="关键词搜索" />
</n-form-item>
<n-form-item>
<n-button attr-type="submit" type="primary" @click="getTableData">
<n-button attr-type="submit" type="primary" @click="getTableData(1)">
<n-icon :component="SearchSharp" size="20" />
查询
</n-button>
Expand Down Expand Up @@ -81,8 +81,11 @@ function setTableData(response: Member.MemberListResponse) {
getCardMemberInfos();
}
async function getTableData() {
async function getTableData(page: number | null = null) {
startLoading();
if (page !== null) {
pagination.page = page;
}
try {
const { data } = await fetchMemberList(
listParams.value.search,
Expand Down
5 changes: 4 additions & 1 deletion admin/src/views/prompt/category_list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ function setTableData(response: Prompt.PromptCategoryListResponse) {
tableData.value = response.list;
}
async function getTableData() {
async function getTableData(page: number | null = null) {
startLoading();
if (page !== null) {
pagination.page = page;
}
try {
const { data } = await fetchPromptCategoryList();
if (data) {
Expand Down
7 changes: 5 additions & 2 deletions admin/src/views/prompt/list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<n-input v-model:value="listParams.search" clearable placeholder="搜索内容" />
</n-form-item>
<n-form-item>
<n-button attr-type="submit" type="primary" @click="getTableData">
<n-button attr-type="submit" type="primary" @click="getTableData(1)">
<n-icon :component="SearchSharp" size="20" />
查询
</n-button>
Expand Down Expand Up @@ -105,8 +105,11 @@ function setTableData(response: Prompt.PromptListResponse) {
pagination.itemCount = response.total;
}
async function getTableData() {
async function getTableData(page: number | null = null) {
startLoading();
if (page !== null) {
pagination.page = page;
}
try {
const { data } = await fetchPromptList(
listParams.value.type,
Expand Down

0 comments on commit 5372212

Please sign in to comment.