Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas3-fe
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas3-fe
Commits
8baf5fa5
Commit
8baf5fa5
authored
Jan 04, 2022
by
guxukai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip: 分页demo
parent
354ba0fa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
19 deletions
+43
-19
index.vue
...ges/system/views/fixed/settings/user-management/index.vue
+26
-0
index.vue
src/shared/components/global/g-query-wrapper/index.vue
+6
-1
UserUserPage.ts
src/shared/models/user-service/UserUserPage.ts
+8
-7
shims-vue.d.ts
src/shims-vue.d.ts
+3
-11
No files found.
src/pages/system/views/fixed/settings/user-management/index.vue
View file @
8baf5fa5
<
template
>
<
template
>
<div></div>
<div></div>
</
template
>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
usePagination
}
from
'vue-request'
import
{
UserUserPage
,
UserUserPagePostReq
}
from
'@shared/models/user-service/UserUserPage'
import
{
useAuth
}
from
'@shared/store/modules/auth'
import
{
useUser
}
from
'@shared/store/modules/user'
import
{
reactive
}
from
'vue'
const
authStore
=
useAuth
()
const
userStore
=
useUser
()
const
userUserPagePostReq
=
reactive
(
new
UserUserPagePostReq
({
objectId
:
authStore
.
consoleInfo
.
consoleObjectId
,
param
:
''
,
pageIndex
:
1
,
pageSize
:
10
,
userId
:
userStore
.
userInfo
.
id
,
}),
)
const
{
data
,
current
,
totalPage
,
loading
,
pageSize
}
=
usePagination
(()
=>
UserUserPage
.
post
(
userUserPagePostReq
),
{
defaultParams
:
[],
pagination
:
{
currentKey
:
'currPage'
,
pageSizeKey
:
'pageSize'
,
totalKey
:
'totalCount'
,
},
})
</
script
>
src/shared/components/global/g-query-wrapper/index.vue
View file @
8baf5fa5
...
@@ -10,7 +10,8 @@
...
@@ -10,7 +10,8 @@
{{
data
.
message
}}
{{
data
.
message
}}
</div>
</div>
<div
v-if=
"error || hasError"
>
<div
v-if=
"error || hasError"
>
<el-button
@
click=
"run()"
>
重新请求
</el-button>
<el-button
v-if=
"hasTokenInvalid"
@
click=
"handleLogout"
>
重新登录
</el-button>
<el-button
v-else
@
click=
"run()"
>
重新请求
</el-button>
</div>
</div>
</
template
>
</
template
>
</div>
</div>
...
@@ -38,4 +39,8 @@ const props = defineProps({
...
@@ -38,4 +39,8 @@ const props = defineProps({
},
},
})
})
const
hasError
=
computed
(()
=>
(
props
.
data
?
props
.
data
?.
code
!==
GATEWAY_CODE
.
success
:
false
))
const
hasError
=
computed
(()
=>
(
props
.
data
?
props
.
data
?.
code
!==
GATEWAY_CODE
.
success
:
false
))
const
hasTokenInvalid
=
computed
(()
=>
(
props
.
data
?
props
.
data
?.
code
===
'baas.err.auth.token.sign.invalid'
:
false
))
const
handleLogout
=
()
=>
{
window
.
location
.
replace
(
window
.
location
.
origin
+
'/login'
)
}
</
script
>
</
script
>
src/shared/models/user-service/UserUserPage.ts
View file @
8baf5fa5
import
{
JsonProperty
,
Serializable
}
from
'typescript-json-serializer'
import
{
JsonProperty
,
Serializable
}
from
'typescript-json-serializer'
import
{
api
}
from
'@shared/http/axios'
import
{
api
}
from
'@shared/http/axios'
import
{
HttpResponse
}
from
'@shared/http/HttpResponse'
import
{
HttpResponse
}
from
'@shared/http/HttpResponse'
import
{
Model
}
from
'@shared/models/Model'
import
{
Pagination
}
from
'@shared/models/Pagination'
import
{
UserToken
}
from
'@shared/models/user-service/UserToken'
import
{
PaginationParams
}
from
'@shared/models/PaginationParams'
@
Serializable
()
@
Serializable
()
export
class
UserUserPage
extends
Model
<
UserUserPage
>
{
export
class
UserUserPage
extends
Pagination
<
UserToken
>
{
@
JsonProperty
({
type
:
UserToken
})
data
:
UserToken
[]
/**
/**
* 分页查看平台注册用户信息列表
* 分页查看平台注册用户信息列表
* @param payload
* @param payload
*/
*/
static
async
post
(
payload
:
UserUserPagePostReq
)
{
static
async
post
(
payload
:
UserUserPagePostReq
)
{
return
await
api
.
post
<
HttpResponse
>
(
'/services/user-service/user/page'
,
{
data
:
payload
})
return
await
api
.
post
<
HttpResponse
<
UserUserPage
>
>
(
'/services/user-service/user/page'
,
{
data
:
payload
})
}
}
}
}
@
Serializable
()
@
Serializable
()
export
class
UserUserPagePostReq
extends
Model
<
UserUserPagePostReq
>
{
export
class
UserUserPagePostReq
extends
PaginationParams
<
UserUserPagePostReq
>
{
@
JsonProperty
()
objectId
:
string
@
JsonProperty
()
objectId
:
string
@
JsonProperty
()
orgName
:
string
@
JsonProperty
()
orgName
:
string
@
JsonProperty
()
pageIndex
:
number
@
JsonProperty
()
pageSize
:
number
@
JsonProperty
()
param
:
string
@
JsonProperty
()
param
:
string
@
JsonProperty
()
status
:
number
@
JsonProperty
()
status
:
number
@
JsonProperty
()
userId
:
number
@
JsonProperty
()
userId
:
string
}
}
src/shims-vue.d.ts
View file @
8baf5fa5
/* eslint-disable */
declare
module
'*.vue'
{
declare
module
'*.vue'
{
import
type
{
DefineComponent
}
from
'vue'
import
type
{
DefineComponent
}
from
'vue'
const
component
:
DefineComponent
<
{},
{},
any
>
const
component
:
DefineComponent
<
{},
{},
any
>
export
default
component
export
default
component
}
}
declare
module
'*.svg'
{
declare
module
'*.svg'
{
import
type
{
DefineComponent
}
from
'vue'
;
import
type
{
DefineComponent
}
from
'vue'
const
component
:
DefineComponent
;
const
component
:
DefineComponent
export
default
component
;
export
default
component
}
declare
module
'@vue/runtime-core'
{
import
{
hasBtnPermission
}
from
"@shared/utils/permission-utils"
;
interface
ComponentCustomProperties
{
hasPerm
:
typeof
hasBtnPermission
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment