refactor: 用户列表与仪表板分享用户接口分离

This commit is contained in:
fit2cloud-chenyw
2022-03-01 15:09:47 +08:00
parent 0ba4fe7dd7
commit 9e625e21bd
3 changed files with 40 additions and 30 deletions

View File

@@ -4,6 +4,7 @@ const pathMap = {
personInfoPath: '/api/user/personInfo/',
piupdatePath: '/api/user/updatePersonInfo/',
queryPath: '/api/user/userGrid/',
queryWithOutPagePath: '/api/user/userLists',
deletePath: '/api/user/delete/',
createPath: '/api/user/create',
updatePath: '/api/user/update',
@@ -19,6 +20,15 @@ export function userLists(page, size, data) {
})
}
export function userListsWithOutPage(data) {
return request({
url: pathMap.queryWithOutPagePath,
method: 'post',
data,
loading: true
})
}
export const addUser = (data) => {
return request({
url: pathMap.createPath,

View File

@@ -24,7 +24,7 @@
</template>
<script>
import { userLists } from '@/api/system/user'
import { userListsWithOutPage } from '@/api/system/user'
import { formatCondition } from '@/utils/index'
import { loadShares } from '@/api/panel/share'
/* import { saveShare, loadShares } from '@/api/panel/share' */
@@ -69,10 +69,10 @@ export default {
search(condition) {
const temp = formatCondition(condition)
const param = temp || {}
userLists(1, 0, param).then(response => {
userListsWithOutPage(param).then(response => {
const data = response.data
this.data = data.listObject.filter(ele => ele.id !== this.$store.getters.user.userId)
this.tableData = data.listObject.filter(ele => ele.id !== this.$store.getters.user.userId)
this.data = data.filter(ele => ele.id !== this.$store.getters.user.userId)
this.tableData = data.filter(ele => ele.id !== this.$store.getters.user.userId)
this.queryShareNodeIds()
})
},