|
@@ -52,6 +52,12 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
export default {
|
|
|
+ beforeRouteLeave(to, from, next) {
|
|
|
+ if(to.name!='LocalGuideOperation'){
|
|
|
+ localStorage.removeItem('dydjval');
|
|
|
+ }
|
|
|
+ next()
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
loading: false,
|
|
@@ -112,9 +118,32 @@ export default {
|
|
|
that.currentPage = that.currentPage - 1;
|
|
|
}
|
|
|
}
|
|
|
+ if(JSON.parse(localStorage.getItem('dydjval'))){
|
|
|
+ that.currentPage=JSON.parse(localStorage.getItem('dydjval')).currentPage;
|
|
|
+ that.input=JSON.parse(localStorage.getItem('dydjval')).input;
|
|
|
+ var newarr = [];
|
|
|
+ if (that.input == "") {
|
|
|
+ newarr = that.tableData;
|
|
|
+ } else {
|
|
|
+ console.log(that.tableData);
|
|
|
+ for (var i = 0; i < that.tableData.length; i++) {
|
|
|
+ if (that.tableData[i].unitArea.indexOf(that.input) != -1) {
|
|
|
+ newarr.push(that.tableData[i]);
|
|
|
+ } else if (that.tableData[i].unitName.indexOf(that.input) != -1) {
|
|
|
+ newarr.push(that.tableData[i]);
|
|
|
+ } else if (that.tableData[i].contact.indexOf(that.input) != -1) {
|
|
|
+ newarr.push(that.tableData[i]);
|
|
|
+ } else if (that.tableData[i].contactTel.indexOf(that.input) != -1) {
|
|
|
+ newarr.push(that.tableData[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ that.tableDatas = newarr;
|
|
|
+ }
|
|
|
}
|
|
|
that.loading = false
|
|
|
}).catch(function (error) {
|
|
|
+ console.log(error);
|
|
|
that.loading = false
|
|
|
that.$message.error("网络错误,请稍后重试");
|
|
|
});
|
|
@@ -142,6 +171,11 @@ export default {
|
|
|
},
|
|
|
|
|
|
upDate(index, row) {
|
|
|
+ var dydjval={
|
|
|
+ currentPage:this.currentPage,
|
|
|
+ input:this.input,
|
|
|
+ }
|
|
|
+ localStorage.setItem('dydjval', JSON.stringify(dydjval));
|
|
|
this.$router.push({
|
|
|
path: "/home/LocalGuideOperation",
|
|
|
query: { id: row.id }
|