table 添加请求缓存设置
This commit is contained in:
parent
5ee7e6cde5
commit
2389ee0cef
@ -64,7 +64,11 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
handleSearchUpdated(newSearch) {
|
handleSearchUpdated(newSearch) {
|
||||||
this.statloading = true;
|
this.statloading = true;
|
||||||
this.$http.get(this.config.remoteurl || 'stat/admin/get', newSearch, { cache: this.config.cache ? true : false }).then((res) => {
|
var options = {
|
||||||
|
cache: this.config.cache || true,
|
||||||
|
cacheparameters: this.config.cacheparameters || false
|
||||||
|
};
|
||||||
|
this.$http.get(this.config.remoteurl || 'stat/admin/get', newSearch, options).then((res) => {
|
||||||
this.statloading = false;
|
this.statloading = false;
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
Object.assign(this.data, res.data);
|
Object.assign(this.data, res.data);
|
||||||
@ -117,7 +121,13 @@ export default {
|
|||||||
if (typeof this.search.date == 'undefined') {
|
if (typeof this.search.date == 'undefined') {
|
||||||
this.search.date = this.getMonthDates();
|
this.search.date = this.getMonthDates();
|
||||||
}
|
}
|
||||||
this.$http.get(this.config.remoteurl || 'stat/admin/get', this.search, { cache: this.config.cache ? true : false }).then((res) => {
|
|
||||||
|
var options = {
|
||||||
|
cache: this.config.cache || true,
|
||||||
|
cacheparameters: this.config.cacheparameters || false
|
||||||
|
};
|
||||||
|
|
||||||
|
this.$http.get(this.config.remoteurl || 'stat/admin/get', this.search, options).then((res) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
// 更改配置
|
// 更改配置
|
||||||
|
@ -269,10 +269,7 @@ export default {
|
|||||||
delete reqData[config.request.page]
|
delete reqData[config.request.page]
|
||||||
delete reqData[config.request.pageSize]
|
delete reqData[config.request.pageSize]
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.assign(reqData, this.tableParams)
|
Object.assign(reqData, this.tableParams)
|
||||||
|
|
||||||
|
|
||||||
if (scrollto === true) {
|
if (scrollto === true) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
let detailsArea = document.querySelector(".el-main");
|
let detailsArea = document.querySelector(".el-main");
|
||||||
|
@ -121,7 +121,11 @@ export default {
|
|||||||
this.column = data.column || 'column';
|
this.column = data.column || 'column';
|
||||||
},
|
},
|
||||||
getType() {
|
getType() {
|
||||||
this.$http.get('log/admin/types', { type: this.$route.query.type }, { cacheparameters: true }).then((res) => {
|
var options = {
|
||||||
|
cache: this.$route.meta.cache || true,
|
||||||
|
cacheparameters: this.$route.meta.cacheparameters || false
|
||||||
|
};
|
||||||
|
this.$http.get('log/admin/types', { type: this.$route.query.type }, options).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
Object.assign(this.$data, res.data);
|
Object.assign(this.$data, res.data);
|
||||||
// 替换search值
|
// 替换search值
|
||||||
@ -138,7 +142,6 @@ export default {
|
|||||||
if (!this.api) {
|
if (!this.api) {
|
||||||
this.api = 'log/admin/lists'
|
this.api = 'log/admin/lists'
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$refs.table.reload(this.search)
|
this.$refs.table.reload(this.search)
|
||||||
let url = window.location.href;
|
let url = window.location.href;
|
||||||
for (const [key, value] of Object.entries(this.search)) {
|
for (const [key, value] of Object.entries(this.search)) {
|
||||||
@ -167,19 +170,21 @@ export default {
|
|||||||
;
|
;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.el-header{
|
|
||||||
height:50px
|
.el-header {
|
||||||
|
height: 50px
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-aside {
|
.el-aside {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
.x-page-header {
|
|
||||||
border-bottom: 0px solid #ebebebc2;
|
|
||||||
padding: 5px;
|
|
||||||
|
|
||||||
.x-page-header__icon {
|
.x-page-header {
|
||||||
width: 40px;
|
border-bottom: 0px solid #ebebebc2;
|
||||||
}
|
padding: 5px;
|
||||||
|
|
||||||
|
.x-page-header__icon {
|
||||||
|
width: 40px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -84,7 +84,12 @@ export default {
|
|||||||
|
|
||||||
//判断是否开启自定义列
|
//判断是否开启自定义列
|
||||||
if (this.tablename || this.tableurl) {
|
if (this.tablename || this.tableurl) {
|
||||||
var awaitvar = this.tableurl ? this.$http.get(this.tableurl, {}, { cache: true }) : this.$api.system.table.get(this.tablename, { cache: this.$route.meta.tablecache || 0 });
|
|
||||||
|
var options = {
|
||||||
|
cache: this.$route.meta.cache || true,
|
||||||
|
cacheparameters: this.$route.meta.cacheparameters || false
|
||||||
|
};
|
||||||
|
var awaitvar = this.tableurl ? this.$http.get(this.tableurl, {}, options) : this.$api.system.table.get(this.tablename, options);
|
||||||
awaitvar.then((res) => {
|
awaitvar.then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
Object.assign(this.$data, res.data);
|
Object.assign(this.$data, res.data);
|
||||||
|
@ -96,7 +96,12 @@ export default {
|
|||||||
|
|
||||||
//判断是否开启自定义列
|
//判断是否开启自定义列
|
||||||
if (this.tablename || this.tableurl) {
|
if (this.tablename || this.tableurl) {
|
||||||
var awaitvar = this.tableurl ? this.$http.get(this.tableurl, {}, { cache: true }) : this.$api.system.table.get(this.tablename, { cache: this.$route.meta.tablecache || 0 });
|
|
||||||
|
var options = {
|
||||||
|
cache: this.$route.meta.cache || true,
|
||||||
|
cacheparameters: this.$route.meta.cacheparameters || false
|
||||||
|
};
|
||||||
|
var awaitvar = this.tableurl ? this.$http.get(this.tableurl, {}, options) : this.$api.system.table.get(this.tablename, options);
|
||||||
awaitvar.then((res) => {
|
awaitvar.then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
Object.assign(this.$data, res.data);
|
Object.assign(this.$data, res.data);
|
||||||
|
Loading…
Reference in New Issue
Block a user