fix: user

This commit is contained in:
xingyu
2022-11-17 00:22:38 +08:00
parent 7455348a6e
commit d677207af1
11 changed files with 47 additions and 49 deletions

View File

@ -83,7 +83,7 @@ const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗
// 列表相关的变量
const xGrid = ref<VxeGridInstance>() // grid Ref
const { gridOptions, reloadList, deleteData } = useVxeGrid<ErrorCodeApi.ErrorCodeVO>({
const { gridOptions, getList, deleteData } = useVxeGrid<ErrorCodeApi.ErrorCodeVO>({
allSchemas: allSchemas,
getListApi: ErrorCodeApi.getErrorCodePageApi,
deleteApi: ErrorCodeApi.deleteErrorCodeApi
@ -150,7 +150,7 @@ const submitForm = async () => {
} finally {
actionLoading.value = false
// 刷新列表
await reloadList(xGrid)
await getList(xGrid)
}
}
})

View File

@ -82,7 +82,7 @@ const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗
// 列表相关的变量
const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
const { gridOptions, reloadList, deleteData } = useVxeGrid<NoticeApi.NoticeVO>({
const { gridOptions, getList, deleteData } = useVxeGrid<NoticeApi.NoticeVO>({
allSchemas: allSchemas,
getListApi: NoticeApi.getNoticePageApi,
deleteApi: NoticeApi.deleteNoticeApi
@ -148,7 +148,7 @@ const submitForm = async () => {
dialogVisible.value = false
} finally {
actionLoading.value = false
await reloadList(xGrid)
await getList(xGrid)
}
}
})

View File

@ -147,7 +147,7 @@ const message = useMessage() // 消息弹窗
// 列表相关的变量
const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
const { gridOptions, reloadList, deleteData } = useVxeGrid<ClientApi.OAuth2ClientVO>({
const { gridOptions, getList, deleteData } = useVxeGrid<ClientApi.OAuth2ClientVO>({
allSchemas: allSchemas,
getListApi: ClientApi.getOAuth2ClientPageApi,
deleteApi: ClientApi.deleteOAuth2ClientApi
@ -213,7 +213,7 @@ const submitForm = async () => {
} finally {
actionLoading.value = false
// 刷新列表
await reloadList(xGrid)
await getList(xGrid)
}
}
})

View File

@ -39,7 +39,7 @@ const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗
// 列表相关的变量
const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
const { gridOptions, reloadList } = useVxeGrid<TokenApi.OAuth2TokenVO>({
const { gridOptions, getList } = useVxeGrid<TokenApi.OAuth2TokenVO>({
allSchemas: allSchemas,
getListApi: TokenApi.getAccessTokenPageApi
})
@ -65,7 +65,7 @@ const handleForceLogout = (rowId: number) => {
})
.finally(async () => {
// 刷新列表
await reloadList(xGrid)
await getList(xGrid)
})
}
</script>

View File

@ -90,7 +90,7 @@ const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗
// 列表相关的变量
const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
const { gridOptions, reloadList, deleteData, exportList } = useVxeGrid<PostApi.PostVO>({
const { gridOptions, getList, deleteData, exportList } = useVxeGrid<PostApi.PostVO>({
allSchemas: allSchemas,
getListApi: PostApi.getPostPageApi,
deleteApi: PostApi.deletePostApi,
@ -167,7 +167,7 @@ const submitForm = async () => {
} finally {
actionLoading.value = false
// 刷新列表
await reloadList(xGrid)
await getList(xGrid)
}
}
})

View File

@ -174,7 +174,7 @@ const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗
// 列表相关的变量
const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
const { gridOptions, reloadList, deleteData } = useVxeGrid<RoleApi.RoleVO>({
const { gridOptions, getList, deleteData } = useVxeGrid<RoleApi.RoleVO>({
allSchemas: allSchemas,
getListApi: RoleApi.getRolePageApi,
deleteApi: RoleApi.deleteRoleApi
@ -242,7 +242,7 @@ const submitForm = async () => {
} finally {
actionLoading.value = false
// 刷新列表
await reloadList(xGrid)
await getList(xGrid)
}
}
})

View File

@ -85,7 +85,7 @@ const message = useMessage() // 消息弹窗
// 列表相关的变量
const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
const { gridOptions, reloadList, deleteData } = useVxeGrid<SmsChannelApi.SmsChannelVO>({
const { gridOptions, getList, deleteData } = useVxeGrid<SmsChannelApi.SmsChannelVO>({
allSchemas: allSchemas,
getListApi: SmsChannelApi.getSmsChannelPageApi,
deleteApi: SmsChannelApi.deleteSmsChannelApi
@ -152,7 +152,7 @@ const submitForm = async () => {
} finally {
actionLoading.value = false
// 刷新列表
await reloadList(xGrid)
await getList(xGrid)
}
}
})

View File

@ -128,7 +128,7 @@ const message = useMessage() // 消息弹窗
// 列表相关的变量
const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
const { gridOptions, reloadList, deleteData } = useVxeGrid<SmsTemplateApi.SmsTemplateVO>({
const { gridOptions, getList, deleteData } = useVxeGrid<SmsTemplateApi.SmsTemplateVO>({
allSchemas: allSchemas,
getListApi: SmsTemplateApi.getSmsTemplatePageApi,
deleteApi: SmsTemplateApi.deleteSmsTemplateApi
@ -196,7 +196,7 @@ const submitForm = async () => {
} finally {
actionLoading.value = false
// 刷新列表
await reloadList(xGrid)
await getList(xGrid)
}
}
})

View File

@ -242,7 +242,7 @@
</XModal>
</template>
<script setup lang="ts">
import { onMounted, reactive, ref, unref, watch } from 'vue'
import { nextTick, onMounted, reactive, ref, unref, watch } from 'vue'
import {
ElTag,
ElInput,
@ -287,18 +287,20 @@ const defaultProps = {
label: 'name',
value: 'id'
}
const queryParams = reactive({
deptId: null
})
// ========== 列表相关 ==========
const tableTitle = ref('用户列表')
// 列表相关的变量
const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
const { gridOptions, reloadList, deleteData, exportList, getSearchData } =
useVxeGrid<UserApi.UserVO>({
allSchemas: allSchemas,
getListApi: UserApi.getUserPageApi,
deleteApi: UserApi.deleteUserApi,
exportListApi: UserApi.exportUserApi
})
const { gridOptions, getList, deleteData, exportList } = useVxeGrid<UserApi.UserVO>({
allSchemas: allSchemas,
queryParams: queryParams,
getListApi: UserApi.getUserPageApi,
deleteApi: UserApi.deleteUserApi,
exportListApi: UserApi.exportUserApi
})
// ========== 创建部门树结构 ==========
const filterText = ref('')
const deptOptions = ref<any[]>([]) // 树形结构
@ -312,13 +314,8 @@ const filterNode = (value: string, data: Tree) => {
return data.name.includes(value)
}
const handleDeptNodeClick = async (row: { [key: string]: any }) => {
tableTitle.value = row.name
console.log(getSearchData(xGrid))
// gridOptions.formConfig?.data.push({
// deptId: row.id
// })
// TODO 查询
await reloadList(xGrid)
queryParams.deptId = row.id
await getList(xGrid)
}
const { push } = useRouter()
const handleDeptEdit = () => {
@ -351,17 +348,16 @@ const setDialogTile = async (type: string) => {
// 新增操作
const handleCreate = async () => {
actionType.value = 'create'
setDialogTile('create')
// 重置表单
deptId.value = null
postIds.value = []
dialogVisible.value = true
dialogTitle.value = t('action.create')
}
// 修改操作
const handleUpdate = async (rowId: number) => {
setDialogTile('update')
await nextTick()
unref(formRef)?.delSchema('username')
unref(formRef)?.delSchema('password')
// 设置数据
@ -400,8 +396,9 @@ const submitForm = async () => {
}
dialogVisible.value = false
} finally {
// unref(formRef)?.setSchema(allSchemas.formSchema)
// 刷新列表
await reloadList(xGrid)
await getList(xGrid)
loading.value = false
}
}
@ -416,7 +413,7 @@ const handleStatusChange = async (row: UserApi.UserVO) => {
await UserApi.updateUserStatusApi(row.id, row.status)
message.success(text + '成功')
// 刷新列表
await reloadList(xGrid)
await getList(xGrid)
})
.catch(() => {
row.status =
@ -516,7 +513,7 @@ const handleFileSuccess = async (response: any): Promise<void> => {
text += '< ' + username + ': ' + data.failureUsernames[username] + ' >'
}
message.alert(text)
await reloadList(xGrid)
await getList(xGrid)
}
// 文件数超出提示
const handleExceed = (): void => {

View File

@ -57,10 +57,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
{
title: '部门',
field: 'deptId',
isTable: false,
search: {
visible: false
}
isTable: false
},
{
title: '岗位',