feat: remove the total filed from query conditions (#93)

This commit is contained in:
Fine0830
2022-05-19 15:49:24 +08:00
committed by GitHub
parent 7e0d716111
commit b953904c71
11 changed files with 67 additions and 43 deletions

View File

@@ -91,7 +91,9 @@ limitations under the License. -->
v-model:currentPage="pageNum"
v-model:page-size="pageSize"
:small="true"
:total="traceStore.traceSpanLogsTotal"
layout="prev, pager, next"
:pager-count="5"
:total="total"
@current-change="turnPage"
/>
<LogTable
@@ -106,7 +108,7 @@ limitations under the License. -->
</el-dialog>
</template>
<script lang="ts" setup>
import { ref } from "vue";
import { ref, computed } from "vue";
import { useI18n } from "vue-i18n";
import type { PropType } from "vue";
import dayjs from "dayjs";
@@ -124,6 +126,11 @@ const traceStore = useTraceStore();
const pageNum = ref<number>(1);
const showRelatedLogs = ref<boolean>(false);
const pageSize = 10;
const total = computed(() =>
traceStore.traceList.length === pageSize
? pageSize * pageNum.value + 1
: pageSize * pageNum.value
);
const dateFormat = (date: number, pattern = "YYYY-MM-DD HH:mm:ss") =>
dayjs(date).format(pattern);
async function getTaceLogs() {
@@ -135,7 +142,7 @@ async function getTaceLogs() {
segmentId: props.currentSpan.segmentId,
spanId: props.currentSpan.spanId,
},
paging: { pageNum: pageNum.value, pageSize, needTotal: true },
paging: { pageNum: pageNum.value, pageSize },
},
});
if (res.errors) {