|
@@ -1,5 +1,5 @@
|
|
|
import { debounce } from "lodash";
|
|
import { debounce } from "lodash";
|
|
|
-
|
|
|
|
|
|
|
+import * as api from "@/api/pageSearch.js";
|
|
|
//
|
|
//
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
@@ -13,6 +13,10 @@ export default {
|
|
|
props: {
|
|
props: {
|
|
|
//请求地址
|
|
//请求地址
|
|
|
url: {},
|
|
url: {},
|
|
|
|
|
+ method: {
|
|
|
|
|
+ type: String,
|
|
|
|
|
+ default: "post",
|
|
|
|
|
+ },
|
|
|
urlExport: {},
|
|
urlExport: {},
|
|
|
//请求参数
|
|
//请求参数
|
|
|
searchData: {},
|
|
searchData: {},
|
|
@@ -28,7 +32,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
beforeSearchCheck: {
|
|
beforeSearchCheck: {
|
|
|
type: Function,
|
|
type: Function,
|
|
|
- default: function(callback) {
|
|
|
|
|
|
|
+ default: function (callback) {
|
|
|
// console.info("beforeSearchCheck default function")
|
|
// console.info("beforeSearchCheck default function")
|
|
|
return true;
|
|
return true;
|
|
|
},
|
|
},
|
|
@@ -40,7 +44,7 @@ export default {
|
|
|
searchData: {
|
|
searchData: {
|
|
|
deep: true,
|
|
deep: true,
|
|
|
handler: debounce(
|
|
handler: debounce(
|
|
|
- function() {
|
|
|
|
|
|
|
+ function () {
|
|
|
this.search();
|
|
this.search();
|
|
|
},
|
|
},
|
|
|
300,
|
|
300,
|
|
@@ -76,7 +80,13 @@ export default {
|
|
|
params.page = this.pageIndex >= 1 ? this.pageIndex - 1 : this.pageIndex;
|
|
params.page = this.pageIndex >= 1 ? this.pageIndex - 1 : this.pageIndex;
|
|
|
params.size = this.pageSize;
|
|
params.size = this.pageSize;
|
|
|
console.log(params);
|
|
console.log(params);
|
|
|
- const data = await this.$api.post(this.url, params);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ let data;
|
|
|
|
|
+ if (this.method === "post") {
|
|
|
|
|
+ data = await api.post(this.url, params);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ data = await api.get(this.url, params);
|
|
|
|
|
+ }
|
|
|
// this.selectItemList=[];
|
|
// this.selectItemList=[];
|
|
|
// this.selectItemList=[];
|
|
// this.selectItemList=[];
|
|
|
// this.$emit("select", []);
|
|
// this.$emit("select", []);
|
|
@@ -87,7 +97,7 @@ export default {
|
|
|
this.dataList = this.checkSelect(data);
|
|
this.dataList = this.checkSelect(data);
|
|
|
this.total = data.length;
|
|
this.total = data.length;
|
|
|
} else {
|
|
} else {
|
|
|
- this.dataList = this.checkSelect(data.content);
|
|
|
|
|
|
|
+ this.dataList = this.checkSelect(data.rows);
|
|
|
this.total = data.totalElements;
|
|
this.total = data.totalElements;
|
|
|
}
|
|
}
|
|
|
this.$emit("totalCount", this.total);
|
|
this.$emit("totalCount", this.total);
|