From 2389ee0cef8cabefdd5a4ed7b52c99cbf24e1dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=99=8C?= Date: Tue, 9 Jan 2024 14:42:39 +0800 Subject: [PATCH] =?UTF-8?q?table=20=E6=B7=BB=E5=8A=A0=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/xStat/index.vue | 14 ++++++++++++-- src/components/xTable/index.vue | 3 --- src/views/system/log/index.vue | 25 +++++++++++++++---------- src/views/table/1/index.vue | 7 ++++++- src/views/table/2/index.vue | 7 ++++++- 5 files changed, 39 insertions(+), 17 deletions(-) diff --git a/src/components/xStat/index.vue b/src/components/xStat/index.vue index d103841..2862f1d 100644 --- a/src/components/xStat/index.vue +++ b/src/components/xStat/index.vue @@ -64,7 +64,11 @@ export default { methods: { handleSearchUpdated(newSearch) { 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; if (res.code == 200) { Object.assign(this.data, res.data); @@ -117,7 +121,13 @@ export default { if (typeof this.search.date == 'undefined') { 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; if (res.code == 200) { // 更改配置 diff --git a/src/components/xTable/index.vue b/src/components/xTable/index.vue index 54369d5..2703f3e 100644 --- a/src/components/xTable/index.vue +++ b/src/components/xTable/index.vue @@ -269,10 +269,7 @@ export default { delete reqData[config.request.page] delete reqData[config.request.pageSize] } - Object.assign(reqData, this.tableParams) - - if (scrollto === true) { this.loading = true; let detailsArea = document.querySelector(".el-main"); diff --git a/src/views/system/log/index.vue b/src/views/system/log/index.vue index 83d6d69..86f2765 100644 --- a/src/views/system/log/index.vue +++ b/src/views/system/log/index.vue @@ -121,7 +121,11 @@ export default { this.column = data.column || 'column'; }, 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) { Object.assign(this.$data, res.data); // 替换search值 @@ -138,7 +142,6 @@ export default { if (!this.api) { this.api = 'log/admin/lists' } - this.$refs.table.reload(this.search) let url = window.location.href; for (const [key, value] of Object.entries(this.search)) { @@ -167,19 +170,21 @@ export default { ; overflow: hidden; } -.el-header{ - height:50px + +.el-header { + height: 50px } .el-aside { background-color: white; } -.x-page-header { - border-bottom: 0px solid #ebebebc2; - padding: 5px; - .x-page-header__icon { - width: 40px; - } +.x-page-header { + border-bottom: 0px solid #ebebebc2; + padding: 5px; + + .x-page-header__icon { + width: 40px; + } } diff --git a/src/views/table/1/index.vue b/src/views/table/1/index.vue index 1406587..fabf9be 100644 --- a/src/views/table/1/index.vue +++ b/src/views/table/1/index.vue @@ -84,7 +84,12 @@ export default { //判断是否开启自定义列 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) => { if (res.code == 200) { Object.assign(this.$data, res.data); diff --git a/src/views/table/2/index.vue b/src/views/table/2/index.vue index 39dd5cb..1ef2241 100644 --- a/src/views/table/2/index.vue +++ b/src/views/table/2/index.vue @@ -96,7 +96,12 @@ export default { //判断是否开启自定义列 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) => { if (res.code == 200) { Object.assign(this.$data, res.data);