Browse Source

查重订单列表

pull/88/head
rainbro 4 days ago
parent
commit
82d1c6470d
  1. 238
      src/components/Page.vue
  2. 62
      src/views/agent/checkOrderList.vue

238
src/components/Page.vue

@ -0,0 +1,238 @@
<template>
<div class="pagination">
<!-- 首页按钮 -->
<button
v-if="showHome"
@click="goToFirstPage"
class="pagination-button"
>
首页
</button>
<!-- 上一页按钮 -->
<button
v-if="showPrev"
@click="goToPrevPage"
class="pagination-button"
>
上一页
</button>
<!-- 当前页码显示 -->
<span v-if="showCurrent" class="current-page">{{ currentPage }}</span>
<!-- 下一页按钮 -->
<button
v-if="showNext"
@click="goToNextPage"
class="pagination-button"
>
下一页
</button>
<!-- 尾页按钮/状态 -->
<button
v-if="showLastButton"
@click="goToLastPage"
class="pagination-button"
>
尾页
</button>
<span v-if="showLastText" class="last-page">尾页</span>
<!-- 尾页时的页码显示 -->
<span v-if="endPageFlag" class="last-page-number">{{ totalPages }}</span>
<!-- 跳转控件 -->
<div class="page-jump">
<input
type="number"
v-model="jumpPage"
min="1"
class="jump-input"
>
<button @click="handleJump" class="jump-button">跳转</button>
</div>
<!-- 尾页时的总记录数 -->
<span v-if="endPageFlag" class="total-records">{{ totalRecords }}条记录</span>
</div>
</template>
<script>
export default {
name: 'Pagination',
props: {
//
totalRecords: {
type: [Number,String],
required: true,
default: 0
},
//
totalPages: {
type: [Number,String],
required: true,
default: 1
},
//
currentPage: {
type: [Number,String],
required: true,
default: 1
},
// minid
nextMinId: {
type: [Number,String],
default: null
},
// maxid
prevMaxId: {
type: [Number,String],
default: null
}
},
data() {
return {
endPageFlag: false, //
jumpPage: null //
};
},
computed: {
//
showHome() {
return this.currentPage > 1;
},
//
showPrev() {
return this.currentPage > 1;
},
//
showCurrent() {
return !this.endPageFlag;
},
//
showNext() {
return !this.endPageFlag;
},
//
showLastButton() {
return !this.endPageFlag;
},
//
showLastText() {
return this.endPageFlag;
}
},
methods: {
//
goToFirstPage() {
this.endPageFlag = false;
this.$emit('page-change', {
page: 1,
isFirst: true
});
},
//
goToPrevPage() {
this.endPageFlag = false;
this.$emit('page-change', {
page: this.currentPage - 1,
maxid: this.prevMaxId,
isPrev: true
});
},
//
goToNextPage() {
this.endPageFlag = false;
this.$emit('page-change', {
page: this.currentPage + 1,
minid: this.nextMinId,
isNext: true
});
},
//
goToLastPage() {
this.endPageFlag = true;
this.$emit('page-change', {
page: this.totalPages,
isLast: true
});
},
//
handleJump() {
if (!this.jumpPage || this.jumpPage < 1) {
return;
}
if (this.totalPages > 0 && this.jumpPage > this.totalPages) {
return;
}
this.endPageFlag = this.jumpPage === this.totalPages;
this.$emit('page-change', {
page: this.jumpPage,
isJump: true
});
this.jumpPage = null;
}
}
};
</script>
<style scoped>
.pagination {
display: flex;
align-items: center;
gap: 8px;
margin-top: 20px;
flex-wrap: wrap;
}
.pagination-button {
padding: 6px 12px;
border: 1px solid #ddd;
background: #f8f8f8;
border-radius: 4px;
cursor: pointer;
}
.pagination-button:hover {
background: #e8e8e8;
}
.current-page, .last-page, .last-page-number, .total-records {
padding: 0 8px;
font-size: 14px;
}
.page-jump {
display: flex;
gap: 4px;
}
.jump-input {
width: 50px;
padding: 4px;
border: 1px solid #ddd;
border-radius: 4px;
text-align: center;
}
.jump-button {
padding: 4px 8px;
border: 1px solid #ddd;
background: #f0f0f0;
border-radius: 4px;
cursor: pointer;
}
.jump-button:hover {
background: #e0e0e0;
}
</style>

62
src/views/agent/checkOrderList.vue

@ -50,7 +50,7 @@
<template slot-scope="scope">
<div class="flex" v-if="scope.row.status==1">
<GuipToolTip :content="'下载报告 作者:'+scope.row.author + ' 标题:' + scope.row.title">
<a href="/agentnew/report/tid/" target="_blank" v-for="tid in scope.row.tids" :key="tid">{{ tid }}</a>
<a :href="'http://'+scope.row.domain+'/report/tid/'+tid+'/sid/'+scope.row.sale_id" target="_blank" v-for="tid in scope.row.tids" :key="tid">{{ tid }}</a>
</GuipToolTip>
</div>
<div class="" v-else>
@ -88,7 +88,7 @@
<el-table-column prop="similarity" label="相似度">
<template slot-scope="scope">
<div class="flex">
<p v-if="scope.row.similarity>0">{{ formatSimilarity(scope.row.similarity) }}</p>
<p v-if="scope.row.similarity>0">{{ scope.row.similarity }}%</p>
<p v-else>-</p>
</div>
</template>
@ -127,17 +127,16 @@
<template slot-scope="scope">
<div class="flex">
<el-button v-if="scope.row.status==1" @click="showConfirmDelReport(scope.row)" type="text">删报告</el-button>
<el-button @click="paySetting(scope.row)" type="text">标红</el-button>
</div>
</template>
</el-table-column>
</GuipTable>
<!-- <el-pagination background @size-change='handleSizeChange' @current-change='handleCurrentChange'
<Page :total-records="orderListTotal"
:total-pages="orderListPageSize"
:current-page="orderListCurrentPage"
:page-size="orderListPageSize"
:total="orderListTotal"
layout="prev, pager, next,jumper">
</el-pagination> -->
:next-min-id="orderListNextMinId"
:prev-max-id="orderListPrevMaxId"
@page-change="handlePageChange"></Page>
</el-form>
</div>
<GuipDialog :dialogVisible="dialogVisibleDelReport" title="删除报告" confirmText="删除" cancelText="取消" :show-close-button="false"
@ -157,6 +156,7 @@ import GuipSelect from '@/components/GuipSelect.vue';
import GuipInput from '@/components/GuipInput.vue';
import GuipToolTip from '@/components/GuipToolTip.vue';
import GuipDialog from '@/components/GuipDialog.vue';
import Page from '@/components/Page.vue';
export default {
name: 'siteList',
@ -166,6 +166,7 @@ export default {
GuipInput,
GuipToolTip,
GuipDialog,
Page,
},
data() {
return {
@ -178,6 +179,11 @@ export default {
orderListTotal: 0,
orderListCurrentPage: 1,
orderListPageSize: 100,
endPageFlag: false,
orderListNextMinId: 0,
orderListPrevMaxId: 0,
orderListEndPage: 0,
orderListJumpToPage: 0,
siteList: [],
@ -199,6 +205,10 @@ export default {
this.$http('POST', '/agentnew/ajax_get_check_order_list', {
page: this.orderListCurrentPage,
pagesize: this.orderListPageSize,
minid: this.orderListNextMinId,
maxid: this.orderListPrevMaxId,
end_page: this.orderListEndPage,
jump_to_page: this.orderListJumpToPage,
},{
headers:{
'Auth': this.token
@ -207,6 +217,9 @@ export default {
this.tableLoading = false
this.$nextTick(() => {
that.orderList = response.data.list
this.orderListTotal = response.data.total
this.orderListNextMinId = response.data.minid
this.orderListPrevMaxId = response.data.maxid
})
}).catch(error => {
console.error(error, 'error')
@ -218,14 +231,6 @@ export default {
getChannelImg(src) {
return require('@/assets/channel_'+src+'.svg');
},
handleSizeChange(val) {
this.orderListPageSize = val
this.getOrderList()
},
handleCurrentChange(val) {
this.orderListCurrentPage = val
this.getOrderList()
},
changeSearchSite() {
console.log(this.searchUid)
this.getOrderList()
@ -272,13 +277,28 @@ export default {
console.log(data, 'data098908090');
},
// ---end
},
computed: {
formatSimilarity(similarity) {
var similar = similarity.toFixed(2);
return similar * 100 + '%';
handlePageChange(params) {
// API
console.log('分页参数:', params);
//
this.orderListCurrentPage = params.page;
// minid/maxidAPI
if (params.isNext) {
// APIorderListNextMinId
this.orderListNextMinId = params.minid;
}
if (params.isPrev) {
// APIorderListPrevMaxId
this.orderListPrevMaxId = params.maxid;
}
this.getOrderList()
}
},
computed: {
},
}
</script>

Loading…
Cancel
Save