表格优化

This commit is contained in:
仲么了
2023-12-27 15:06:57 +08:00
parent d42936398e
commit b456881e6e
17 changed files with 115 additions and 74 deletions

View File

@@ -17,7 +17,7 @@ const loadingInstance: LoadingInstance = {
* 根据运行环境获取基础请求URL
*/
export const getUrl = (): string => {
if (import.meta.env.MODE == 'development') return '/api'
if (import.meta.env.MODE == 'development' || location.hostname === 'localhost') return '/api'
return window.location.protocol + '//' + window.location.host
}

View File

@@ -52,7 +52,9 @@ export default class TableStore {
requestPayload(this.method, this.table.params)
)
).then((res: any) => {
this.table.data = res.data.records || res.data
console.log(this.table.data)
this.table.total = res.data.total || res.data.length
this.table.loading = false
})