diff --git a/.env.production b/.env.production index 6f8ae33..3198248 100644 --- a/.env.production +++ b/.env.production @@ -5,15 +5,15 @@ NODE_ENV = production VUE_APP_TITLE = 象纬云科 # 测试环境 - VUE_APP_API_BASEURL = https://dev.api.linkwing.com/api/v1 - VUE_APP_API_DEV = https://dev.api.linkwing.com/api/v1 - VUE_APP_WS_URL = wss://dev.api.linkwing.com/wss - VUE_APP_WSS_URL = wss://dev.api.linkwing.com/wss +# VUE_APP_API_BASEURL = https://dev.api.linkwing.com/api/v1 +# VUE_APP_API_DEV = https://dev.api.linkwing.com/api/v1 +# VUE_APP_WS_URL = wss://dev.api.linkwing.com/wss +# VUE_APP_WSS_URL = wss://dev.api.linkwing.com/wss # 线上环境 # 接口地址 # WS地址 -# VUE_APP_API_BASEURL = https://prod.api.linkwing.com/api/v1 -# VUE_APP_API_DEV = https://prod.api.linkwing.com/api/v1 -# VUE_APP_WS_URL = wss://prod.api.linkwing.com/wss -# VUE_APP_WSS_URL = wss://prod.api.linkwing.com/wss + VUE_APP_API_BASEURL = https://prod.api.linkwing.com/api/v1 + VUE_APP_API_DEV = https://prod.api.linkwing.com/api/v1 + VUE_APP_WS_URL = wss://prod.api.linkwing.com/wss + VUE_APP_WSS_URL = wss://prod.api.linkwing.com/wss diff --git a/src/components/scTable/column.js b/src/components/scTable/column.js index af5ab1f..95a3019 100644 --- a/src/components/scTable/column.js +++ b/src/components/scTable/column.js @@ -1,23 +1,38 @@ import { h, resolveComponent } from 'vue' export default { + props: { + currentPage: { + type: Number, + required: true + }, + pageSize: { + type: Number, + required: true + } + }, render() { return h ( resolveComponent("el-table-column"), { - index: this.index, + index:this.index, ...this.$attrs }, this.$slots ) }, methods: { - index(index){ - if(this.$attrs.type=="index"){ - let page = this.$parent.$parent.currentPage - let pageSize = this.$parent.$parent.pageSize - return (page - 1) * pageSize + index + 1 + index(index) { + if (this.$attrs.type === "index") { + if(this.currentPage && this.pageSize){ + return (this.currentPage - 1) * this.pageSize + index + 1; + }else{ + let page = this.$parent.$parent.currentPage + let pageSize = this.$parent.$parent.pageSize + return (page - 1) * pageSize + index + 1 + } } + return index } } } diff --git a/src/components/scTable/index.vue b/src/components/scTable/index.vue index b3b36d9..cf8be8e 100644 --- a/src/components/scTable/index.vue +++ b/src/components/scTable/index.vue @@ -20,6 +20,7 @@
+