|
|
@@ -13,12 +13,12 @@
|
|
|
<a-space>
|
|
|
<slot name="operation"></slot>
|
|
|
<a-button v-if="delParam && utils.hasPermission('delete')" type="primary" :disabled="disable" @click="delData" danger>删除</a-button>
|
|
|
- <a-button @click="previous">
|
|
|
+ <a-button v-if="router.currentRoute.value.query.listqueryid" @click="previous">
|
|
|
<template #icon>
|
|
|
<left-outlined />
|
|
|
</template>
|
|
|
</a-button>
|
|
|
- <a-button @click="next">
|
|
|
+ <a-button v-if="router.currentRoute.value.query.listqueryid" @click="next">
|
|
|
<template #icon>
|
|
|
<right-outlined />
|
|
|
</template>
|
|
|
@@ -52,7 +52,7 @@
|
|
|
import {defineProps,ref,createVNode,computed,defineEmits,onMounted,onActivated} from 'vue'
|
|
|
import { LeftOutlined,RightOutlined,ExclamationCircleOutlined,ArrowLeftOutlined} from '@ant-design/icons-vue'
|
|
|
import { useRouter } from "vue-router"
|
|
|
- import { Modal } from 'ant-design-vue'
|
|
|
+ import { Modal,message } from 'ant-design-vue'
|
|
|
import { useRouteTabsStore } from '@/stores/modules/routeTabs'
|
|
|
import { storeToRefs } from 'pinia'
|
|
|
const rotTabs = useRouteTabsStore()
|
|
|
@@ -65,7 +65,6 @@
|
|
|
delParam:Object,
|
|
|
disable:Boolean,
|
|
|
notabs:Boolean,
|
|
|
- pageUp:Function
|
|
|
})
|
|
|
const activeKey = ref(0)
|
|
|
|
|
|
@@ -95,17 +94,46 @@
|
|
|
const onTabChange = (key)=>{
|
|
|
activeKey.value = key
|
|
|
}
|
|
|
+ const time = ref(null)
|
|
|
const previous = ()=>{
|
|
|
let rowindex = Number(router.currentRoute.value.query.rowindex) - 1
|
|
|
- props.pageUp(rowindex,(id)=>{
|
|
|
- router.replace({path:router.currentRoute.value.path,query:{id:id,rowindex:rowindex,pageUp:1}})
|
|
|
- })
|
|
|
+ let listqueryid = router.currentRoute.value.query.listqueryid
|
|
|
+ if (rowindex >= 1) {
|
|
|
+ if (time.value !== null) {
|
|
|
+ clearTimeout(time.value)
|
|
|
+ }
|
|
|
+ time.value = setTimeout(() => {
|
|
|
+ upPageData(rowindex,listqueryid)
|
|
|
+ }, 0);
|
|
|
+ } else {
|
|
|
+ message.warn('已经是第一条了!')
|
|
|
+ }
|
|
|
}
|
|
|
const next = ()=>{
|
|
|
let rowindex = Number(router.currentRoute.value.query.rowindex) + 1
|
|
|
- props.pageUp(rowindex,(id)=>{
|
|
|
- router.replace({path:router.currentRoute.value.path,query:{id:id,rowindex:rowindex,pageUp:1}})
|
|
|
+ let listqueryid = router.currentRoute.value.query.listqueryid
|
|
|
+ if (time.value !== null) {
|
|
|
+ clearTimeout(time.value)
|
|
|
+ }
|
|
|
+ time.value = setTimeout(() => {
|
|
|
+ upPageData(rowindex,listqueryid)
|
|
|
+ }, 0);
|
|
|
+ }
|
|
|
+ const upPageData = async (rowindex,listqueryid)=> {
|
|
|
+ const res = await Api.requested({
|
|
|
+ "classname": "system.tools",
|
|
|
+ "method":"querylistdatabyrowindex",
|
|
|
+ "content": {
|
|
|
+ "rowindex": rowindex,
|
|
|
+ "listqueryid": listqueryid,
|
|
|
+ "fieldname":''
|
|
|
+ }
|
|
|
})
|
|
|
+ if (res.data.data) {
|
|
|
+ router.replace({path:router.currentRoute.value.path,query:{id:res.data.data,rowindex:rowindex,listqueryid:listqueryid}})
|
|
|
+ } else {
|
|
|
+ message.warn('已经是最后一条了!')
|
|
|
+ }
|
|
|
}
|
|
|
onActivated (()=>{
|
|
|
if(!props.tabs || props.tabs.length == 0) {
|