邓洁: 修复bug
This commit is contained in:
@@ -93,11 +93,11 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
<div class="pagination">
|
||||
<span>首页</span>
|
||||
<span @click="firstPage" v-if="showFirst">首页</span>
|
||||
<el-pagination background v-model:current-page="pageInfo.pageNum" v-model:page-size="pageInfo.pageSize"
|
||||
:total="total" prev-text="上一页" next-text="下一页" layout="prev, pager, next"
|
||||
@current-change="handleCurrentChange"/>
|
||||
<span>尾页</span>
|
||||
@current-change="handleCurrentChange" :hide-on-single-page="true"/>
|
||||
<span @click="lastPage" v-if="showFirst">尾页</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -146,6 +146,7 @@ const info = ref({
|
||||
})
|
||||
const title = ref('新增站点')
|
||||
const isVisited = ref(false);
|
||||
const showFirst = ref(true)
|
||||
const total = ref(10);
|
||||
const showAddIcon = ref(true)
|
||||
const pageInfo = reactive({
|
||||
@@ -164,11 +165,12 @@ const formRules = ref({
|
||||
const formInstance = ref()
|
||||
const getList = () => {
|
||||
getSiteList({
|
||||
userId:userId,
|
||||
// userId:userId,
|
||||
...pageInfo
|
||||
}).then((res) => {
|
||||
total.value = res.data.total;
|
||||
showAddIcon.value = total.value % 6!==0;
|
||||
showFirst.value = total.value / pageInfo.pageSize >= 1;
|
||||
res.data.rows.map(item => {
|
||||
if (item.tunnelList === null || item.tunnelList.length === 0) {
|
||||
item.info = info.value
|
||||
@@ -234,15 +236,23 @@ const handleSubmit = (instance) => {
|
||||
if (!valid) return
|
||||
if (title.value === '编辑站点') {
|
||||
editSite(form.value).then((res) => {
|
||||
isVisited.value = false
|
||||
getList()
|
||||
ElMessage.success(res.msg)
|
||||
if(res.code===1000){
|
||||
isVisited.value = false
|
||||
getList()
|
||||
ElMessage.success(res.msg)
|
||||
}else {
|
||||
ElMessage.warning(res.msg)
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addSite(form.value).then((res) => {
|
||||
isVisited.value = false
|
||||
getList()
|
||||
ElMessage.success(res.msg)
|
||||
if(res.code===1000){
|
||||
isVisited.value = false
|
||||
getList()
|
||||
ElMessage.success(res.msg)
|
||||
}else {
|
||||
ElMessage.warning(res.msg)
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
@@ -290,7 +300,14 @@ const handleMoreDelete = () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const firstPage=()=>{
|
||||
pageInfo.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
const lastPage=()=>{
|
||||
pageInfo.pageNum = total.value/pageInfo.pageSize
|
||||
getList()
|
||||
}
|
||||
//点击页码进行分页功能
|
||||
const handleCurrentChange = (val) => {
|
||||
pageInfo.pageNum = val
|
||||
|
||||
Reference in New Issue
Block a user