|
@@ -215,6 +215,7 @@
|
|
|
layout="prev, pager, next"
|
|
|
:total="totalnum"
|
|
|
class="mt-4"
|
|
|
+ v-model:current-page="currentpage"
|
|
|
@current-change="getnextdata"
|
|
|
/>
|
|
|
</div>
|
|
@@ -434,6 +435,7 @@ import {
|
|
|
import _ from "lodash";
|
|
|
import {useRoute} from "vue-router";
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
+import moment from "moment";
|
|
|
|
|
|
|
|
|
const userroles = useUserStore().roles;
|
|
@@ -481,8 +483,11 @@ const totalnum = ref(0);
|
|
|
|
|
|
const status = ref("0");
|
|
|
|
|
|
+
|
|
|
+
|
|
|
const getnextdata = (page: number) => {
|
|
|
currentpage.value = page;
|
|
|
+ localStorage.setItem("currentpage", page+"_"+moment().unix())
|
|
|
if(route.query.status){
|
|
|
searchForm.value["status"]=route.query.status;
|
|
|
}else{
|
|
@@ -504,7 +509,16 @@ const getnextdata = (page: number) => {
|
|
|
});
|
|
|
};
|
|
|
onMounted(() => {
|
|
|
- getnextdata(1);
|
|
|
+ var tt = localStorage.getItem("currentpage")
|
|
|
+ if(tt!=undefined){
|
|
|
+ if(moment().unix()-parseInt(tt.split("_")[1])>3600){
|
|
|
+ currentpage.value=1;
|
|
|
+ }else{
|
|
|
+ currentpage.value = parseInt(tt.split("_")[0]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(currentpage.value)
|
|
|
+ getnextdata(currentpage.value);
|
|
|
|
|
|
if(route.query.status!=undefined){
|
|
|
status.value = route.query.status+""
|
|
@@ -560,7 +574,7 @@ const savecurrent = () => {
|
|
|
.then((res) => {
|
|
|
dialogVisible.value = false;
|
|
|
ElMessage.success("新增成功");
|
|
|
- getnextdata(1);
|
|
|
+ getnextdata(currentpage.value);
|
|
|
})
|
|
|
.catch((e) => {
|
|
|
// dialogVisible.value = false;
|
|
@@ -572,7 +586,7 @@ const savecurrent = () => {
|
|
|
.then((res) => {
|
|
|
dialogVisible.value = false;
|
|
|
ElMessage.success("编辑成功");
|
|
|
- getnextdata(1);
|
|
|
+ getnextdata(currentpage.value);
|
|
|
})
|
|
|
.catch((e) => {
|
|
|
dialogVisible.value = false;
|