mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-11-12 02:58:39 +08:00
refactor: 更换 ESLint 配置为 @antfu/eslint-config
This commit is contained in:
@@ -76,21 +76,24 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getUser, addUser, updateUser } from '@/apis'
|
||||
import { type FormInstance, Message, type TreeNodeData } from '@arco-design/web-vue'
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { addUser, getUser, updateUser } from '@/apis'
|
||||
import type { Gender, Status } from '@/types/global'
|
||||
import { Message, type FormInstance, type TreeNodeData } from '@arco-design/web-vue'
|
||||
import { useForm } from '@/hooks'
|
||||
import { useDept, useRole } from '@/hooks/app'
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { encryptByRsa } from '@/utils/encrypt'
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'save-success'): void
|
||||
}>()
|
||||
const { width } = useWindowSize()
|
||||
const { roleList, getRoleList } = useRole()
|
||||
const { deptList, getDeptList } = useDept()
|
||||
// 过滤部门
|
||||
const filterDeptOptions = (searchKey: string, nodeData: TreeNodeData) => {
|
||||
if (nodeData.title) {
|
||||
return nodeData.title.toLowerCase().indexOf(searchKey.toLowerCase()) > -1
|
||||
return nodeData.title.toLowerCase().includes(searchKey.toLowerCase())
|
||||
}
|
||||
return false
|
||||
}
|
||||
@@ -182,9 +185,5 @@ const save = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'save-success'): void
|
||||
}>()
|
||||
|
||||
defineExpose({ onAdd, onUpdate })
|
||||
</script>
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { getUser, type UserDetailResp } from '@/apis'
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { type UserDetailResp, getUser } from '@/apis'
|
||||
|
||||
const { width } = useWindowSize()
|
||||
|
||||
|
||||
@@ -14,12 +14,15 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { resetUserPwd } from '@/apis'
|
||||
import { Message } from '@arco-design/web-vue'
|
||||
import { GiForm, type Columns } from '@/components/GiForm'
|
||||
import { resetUserPwd } from '@/apis'
|
||||
import { type Columns, GiForm } from '@/components/GiForm'
|
||||
import { useForm } from '@/hooks'
|
||||
import { encryptByRsa } from '@/utils/encrypt'
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'save-success'): void
|
||||
}>()
|
||||
const dataId = ref('')
|
||||
const formRef = ref<InstanceType<typeof GiForm>>()
|
||||
|
||||
@@ -65,9 +68,5 @@ const save = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'save-success'): void
|
||||
}>()
|
||||
|
||||
defineExpose({ onReset })
|
||||
</script>
|
||||
|
||||
@@ -19,15 +19,14 @@
|
||||
</a-col>
|
||||
<a-col :xs="24" :md="20" :lg="20" :xl="20" :xxl="20">
|
||||
<GiTable
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
:data="dataList"
|
||||
:columns="columns"
|
||||
:loading="loading"
|
||||
:scroll="{ x: '100%', y: '100%', minWidth: 1500 }"
|
||||
:pagination="pagination"
|
||||
:disabledTools="['size']"
|
||||
:disabledColumnKeys="['username']"
|
||||
:disabled-tools="['size']"
|
||||
:disabled-column-keys="['username']"
|
||||
@refresh="search"
|
||||
>
|
||||
<template #custom-left>
|
||||
@@ -107,13 +106,13 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { listUser, deleteUser, exportUser, type UserResp, type UserQuery } from '@/apis'
|
||||
import type { TreeInstance } from '@arco-design/web-vue'
|
||||
import UserAddModal from './UserAddModal.vue'
|
||||
import UserDetailDrawer from './UserDetailDrawer.vue'
|
||||
import UserResetPwdModal from './UserResetPwdModal.vue'
|
||||
import type { TreeInstance } from '@arco-design/web-vue'
|
||||
import { type UserQuery, type UserResp, deleteUser, exportUser, listUser } from '@/apis'
|
||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
||||
import { useTable, useDownload } from '@/hooks'
|
||||
import { useDownload, useTable } from '@/hooks'
|
||||
import { useDept } from '@/hooks/app'
|
||||
import { isMobile } from '@/utils'
|
||||
import getAvatar from '@/utils/avatar'
|
||||
@@ -122,6 +121,25 @@ import { DisEnableStatusList } from '@/constant/common'
|
||||
|
||||
defineOptions({ name: 'SystemUser' })
|
||||
|
||||
const queryForm = reactive<UserQuery>({
|
||||
sort: ['createTime,desc']
|
||||
})
|
||||
|
||||
const {
|
||||
tableData: dataList,
|
||||
loading,
|
||||
pagination,
|
||||
search,
|
||||
handleDelete
|
||||
} = useTable((p) => listUser({ ...queryForm, page: p.page, size: p.size }), { immediate: false })
|
||||
|
||||
// 重置
|
||||
const reset = () => {
|
||||
queryForm.description = undefined
|
||||
queryForm.status = undefined
|
||||
search()
|
||||
}
|
||||
|
||||
const columns: TableInstanceColumns[] = [
|
||||
{
|
||||
title: '序号',
|
||||
@@ -160,25 +178,6 @@ const columns: TableInstanceColumns[] = [
|
||||
}
|
||||
]
|
||||
|
||||
const queryForm = reactive<UserQuery>({
|
||||
sort: ['createTime,desc']
|
||||
})
|
||||
|
||||
const {
|
||||
tableData: dataList,
|
||||
loading,
|
||||
pagination,
|
||||
search,
|
||||
handleDelete
|
||||
} = useTable((p) => listUser({ ...queryForm, page: p.page, size: p.size }), { immediate: false })
|
||||
|
||||
// 重置
|
||||
const reset = () => {
|
||||
queryForm.description = undefined
|
||||
queryForm.status = undefined
|
||||
search()
|
||||
}
|
||||
|
||||
// 删除
|
||||
const onDelete = (item: UserResp) => {
|
||||
return handleDelete(() => deleteUser(item.id), {
|
||||
|
||||
Reference in New Issue
Block a user