mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-10-12 10:57:08 +08:00
refactor: 更换 ESLint 配置为 @antfu/eslint-config
This commit is contained in:
@@ -86,12 +86,15 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getRole, addRole, updateRole } from '@/apis'
|
||||
import { Message, type FormInstance, type TreeNodeData } from '@arco-design/web-vue'
|
||||
import { useForm } from '@/hooks'
|
||||
import { useDict, useMenu, useDept } from '@/hooks/app'
|
||||
import { type FormInstance, Message, type TreeNodeData } from '@arco-design/web-vue'
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { addRole, getRole, updateRole } from '@/apis'
|
||||
import { useForm } from '@/hooks'
|
||||
import { useDept, useDict, useMenu } from '@/hooks/app'
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'save-success'): void
|
||||
}>()
|
||||
const { width } = useWindowSize()
|
||||
const { data_scope_enum } = useDict('data_scope_enum')
|
||||
const { deptList, getDeptList } = useDept()
|
||||
@@ -239,10 +242,6 @@ const onCheckAll = (type: string) => {
|
||||
}
|
||||
}
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'save-success'): void
|
||||
}>()
|
||||
|
||||
defineExpose({ onAdd, onUpdate })
|
||||
</script>
|
||||
|
||||
|
@@ -22,7 +22,6 @@
|
||||
>
|
||||
<a-descriptions-item :span="2">
|
||||
<a-tree
|
||||
ref="menuTreeRef"
|
||||
:checked-keys="dataDetail?.menuIds"
|
||||
:data="menuList"
|
||||
default-expand-all
|
||||
@@ -41,7 +40,6 @@
|
||||
>
|
||||
<a-descriptions-item :span="2">
|
||||
<a-tree
|
||||
ref="deptTreeRef"
|
||||
:checked-keys="dataDetail?.deptIds"
|
||||
:data="deptList"
|
||||
default-expand-all
|
||||
@@ -54,9 +52,9 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { getRole, type RoleDetailResp } from '@/apis'
|
||||
import { useDict, useMenu, useDept } from '@/hooks/app'
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { type RoleDetailResp, getRole } from '@/apis'
|
||||
import { useDept, useDict, useMenu } from '@/hooks/app'
|
||||
|
||||
const { width } = useWindowSize()
|
||||
const { data_scope_enum } = useDict('data_scope_enum')
|
||||
|
@@ -8,8 +8,8 @@
|
||||
:loading="loading"
|
||||
:scroll="{ x: '100%', y: '100%', minWidth: 1000 }"
|
||||
:pagination="pagination"
|
||||
:disabledTools="['size']"
|
||||
:disabledColumnKeys="['name']"
|
||||
:disabled-tools="['size']"
|
||||
:disabled-column-keys="['name']"
|
||||
@refresh="search"
|
||||
>
|
||||
<template #custom-left>
|
||||
@@ -57,9 +57,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { listRole, deleteRole, type RoleResp, type RoleQuery } from '@/apis'
|
||||
import RoleAddModal from './RoleAddModal.vue'
|
||||
import RoleDetailDrawer from './RoleDetailDrawer.vue'
|
||||
import { type RoleQuery, type RoleResp, deleteRole, listRole } from '@/apis'
|
||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
||||
import { useTable } from '@/hooks'
|
||||
import { useDict } from '@/hooks/app'
|
||||
@@ -70,6 +70,24 @@ defineOptions({ name: 'SystemRole' })
|
||||
|
||||
const { data_scope_enum } = useDict('data_scope_enum')
|
||||
|
||||
const queryForm = reactive<RoleQuery>({
|
||||
sort: ['createTime,desc']
|
||||
})
|
||||
|
||||
const {
|
||||
tableData: dataList,
|
||||
loading,
|
||||
pagination,
|
||||
search,
|
||||
handleDelete
|
||||
} = useTable((p) => listRole({ ...queryForm, page: p.page, size: p.size }), { immediate: true })
|
||||
|
||||
// 重置
|
||||
const reset = () => {
|
||||
queryForm.description = undefined
|
||||
search()
|
||||
}
|
||||
|
||||
const columns: TableInstanceColumns[] = [
|
||||
{
|
||||
title: '序号',
|
||||
@@ -97,24 +115,6 @@ const columns: TableInstanceColumns[] = [
|
||||
}
|
||||
]
|
||||
|
||||
const queryForm = reactive<RoleQuery>({
|
||||
sort: ['createTime,desc']
|
||||
})
|
||||
|
||||
const {
|
||||
tableData: dataList,
|
||||
loading,
|
||||
pagination,
|
||||
search,
|
||||
handleDelete
|
||||
} = useTable((p) => listRole({ ...queryForm, page: p.page, size: p.size }), { immediate: true })
|
||||
|
||||
// 重置
|
||||
const reset = () => {
|
||||
queryForm.description = undefined
|
||||
search()
|
||||
}
|
||||
|
||||
// 删除
|
||||
const onDelete = (item: RoleResp) => {
|
||||
return handleDelete(() => deleteRole(item.id), { content: `是否确定删除角色 [${item.name}]?`, showModal: true })
|
||||
|
Reference in New Issue
Block a user