mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-14 10:57:16 +08:00
feat: 优化 GiTable(同步 GiDemo 更新)
This commit is contained in:
4
src/components/GiTable/index.ts
Normal file
4
src/components/GiTable/index.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import GiTable from './src/GiTable.vue'
|
||||||
|
|
||||||
|
export { GiTable }
|
||||||
|
export default GiTable
|
@@ -17,18 +17,18 @@
|
|||||||
<a-space wrap class="gi-table__toolbar-right" :size="[8, 8]">
|
<a-space wrap class="gi-table__toolbar-right" :size="[8, 8]">
|
||||||
<slot name="toolbar-right"></slot>
|
<slot name="toolbar-right"></slot>
|
||||||
<a-tooltip content="刷新">
|
<a-tooltip content="刷新">
|
||||||
<a-button v-if="showRefreshBtn" @click="refresh">
|
<a-button v-if="showRefreshBtn" @click="handleRefresh">
|
||||||
<template #icon><icon-refresh /></template>
|
<template #icon><icon-refresh /></template>
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
<a-dropdown v-if="showSizeBtn" @select="handleSelect">
|
<a-dropdown v-if="showSizeBtn" @select="handleSizeChange">
|
||||||
<a-tooltip content="尺寸">
|
<a-tooltip content="尺寸">
|
||||||
<a-button>
|
<a-button>
|
||||||
<template #icon><icon-table-size style="width: 14px; height: 14px" /></template>
|
<template #icon><icon-table-size style="width: 14px; height: 14px" /></template>
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
<template #content>
|
<template #content>
|
||||||
<a-doption v-for="item in sizeList" :key="item.value" :value="item.value" :active="item.value === size">
|
<a-doption v-for="item in TABLE_SIZE_OPTIONS" :key="item.value" :value="item.value" :active="item.value === size">
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
</a-doption>
|
</a-doption>
|
||||||
</template>
|
</template>
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</a-popover>
|
</a-popover>
|
||||||
<a-tooltip content="全屏">
|
<a-tooltip content="全屏">
|
||||||
<a-button v-if="showFullscreenBtn" @click="isFullscreen = !isFullscreen">
|
<a-button v-if="showFullscreenBtn" @click="toggleFullscreen">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<icon-fullscreen v-if="!isFullscreen" />
|
<icon-fullscreen v-if="!isFullscreen" />
|
||||||
<icon-fullscreen-exit v-else />
|
<icon-fullscreen-exit v-else />
|
||||||
@@ -75,20 +75,21 @@
|
|||||||
<a-row class="gi-table__toolbar-bottom">
|
<a-row class="gi-table__toolbar-bottom">
|
||||||
<slot name="toolbar-bottom"></slot>
|
<slot name="toolbar-bottom"></slot>
|
||||||
</a-row>
|
</a-row>
|
||||||
<div class="gi-table__body" :class="`gi-table__body-pagination-${attrs['page-position']}`">
|
<div class="gi-table__body" :class="`gi-table__body-pagination-${tableProps['page-position']}`">
|
||||||
<div class="gi-table__container">
|
<div class="gi-table__container">
|
||||||
<a-table
|
<a-table
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
|
v-bind="tableProps"
|
||||||
:stripe="stripe"
|
:stripe="stripe"
|
||||||
:size="size"
|
:size="size"
|
||||||
column-resizable
|
|
||||||
:bordered="{ cell: isBordered }"
|
:bordered="{ cell: isBordered }"
|
||||||
v-bind="{ ...attrs, columns: _columns }"
|
:columns="visibleColumns"
|
||||||
:scrollbar="true"
|
:scrollbar="true"
|
||||||
:data="data"
|
:data="data"
|
||||||
|
column-resizable
|
||||||
>
|
>
|
||||||
<template v-for="key in Object.keys(slots)" :key="key" #[key]="scoped">
|
<template v-for="key in Object.keys(slots)" :key="key" #[key]="scope">
|
||||||
<slot :key="key" :name="key" v-bind="scoped"></slot>
|
<slot :key="key" :name="key" v-bind="scope" />
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
</div>
|
</div>
|
||||||
@@ -97,21 +98,27 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" generic="T extends TableData">
|
<script setup lang="ts" generic="T extends TableData">
|
||||||
|
import { computed, ref, watch } from 'vue'
|
||||||
import type { DropdownInstance, TableColumnData, TableData, TableInstance } from '@arco-design/web-vue'
|
import type { DropdownInstance, TableColumnData, TableData, TableInstance } from '@arco-design/web-vue'
|
||||||
import { VueDraggable } from 'vue-draggable-plus'
|
import { VueDraggable } from 'vue-draggable-plus'
|
||||||
|
import { omit } from 'lodash-es'
|
||||||
|
import type { TableProps } from './type'
|
||||||
|
|
||||||
defineOptions({ name: 'GiTable', inheritAttrs: false })
|
defineOptions({ name: 'GiTable' })
|
||||||
|
|
||||||
|
// Props 默认值
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
title: '',
|
title: '',
|
||||||
|
disabledColumnKeys: () => [],
|
||||||
data: () => [],
|
data: () => [],
|
||||||
disabledTools: () => [], // 禁止显示的工具
|
|
||||||
disabledColumnKeys: () => [], // 禁止控制显示隐藏的列
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/** Emits 类型定义 */
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'refresh'): void
|
(e: 'refresh'): void
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
/** Slots 类型定义 */
|
||||||
defineSlots<{
|
defineSlots<{
|
||||||
'th': (props: { column: TableColumnData }) => void
|
'th': (props: { column: TableColumnData }) => void
|
||||||
'thead': () => void
|
'thead': () => void
|
||||||
@@ -135,98 +142,127 @@ defineSlots<{
|
|||||||
[propsName: string]: (props: { key: string, record: T, column: TableColumnData, rowIndex: number }) => void
|
[propsName: string]: (props: { key: string, record: T, column: TableColumnData, rowIndex: number }) => void
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const attrs = useAttrs()
|
/** Props 类型定义 */
|
||||||
const slots = useSlots()
|
interface Props extends TableProps {
|
||||||
|
/** 表格标题 */
|
||||||
interface Props {
|
|
||||||
title?: string
|
title?: string
|
||||||
data: T[]
|
/** 禁止控制显示隐藏的列 */
|
||||||
disabledTools?: string[]
|
|
||||||
disabledColumnKeys?: string[]
|
disabledColumnKeys?: string[]
|
||||||
|
/** 禁止显示的工具 */
|
||||||
|
disabledTools?: string[]
|
||||||
|
/** 表格数据 */
|
||||||
|
data: T[]
|
||||||
}
|
}
|
||||||
|
|
||||||
const tableRef = ref<TableInstance | null>(null)
|
const slots = useSlots()
|
||||||
|
|
||||||
|
/** 表格属性计算 */
|
||||||
|
const tableProps = computed(() => omit(props, ['title', 'disabledColumnKeys']))
|
||||||
|
|
||||||
|
/** 组件状态 */
|
||||||
|
const tableRef = useTemplateRef('tableRef')
|
||||||
const stripe = ref(false)
|
const stripe = ref(false)
|
||||||
const size = ref<TableInstance['size']>('medium')
|
const size = ref<TableInstance['size']>('large')
|
||||||
const isBordered = ref(false)
|
const isBordered = ref(false)
|
||||||
const isFullscreen = ref(false)
|
const isFullscreen = ref(false)
|
||||||
|
|
||||||
interface SizeItem { label: string, value: TableInstance['size'] }
|
/** 表格尺寸选项 */
|
||||||
const sizeList: SizeItem[] = [
|
const TABLE_SIZE_OPTIONS = [
|
||||||
{ label: '紧凑', value: 'small' },
|
{ label: '迷你', value: 'mini' },
|
||||||
{ label: '默认', value: 'medium' },
|
{ label: '小型', value: 'small' },
|
||||||
]
|
{ label: '中等', value: 'medium' },
|
||||||
|
{ label: '大型', value: 'large' },
|
||||||
|
] as const
|
||||||
|
|
||||||
const handleSelect: DropdownInstance['onSelect'] = (value) => {
|
/** 处理表格尺寸变更 */
|
||||||
size.value = value as TableInstance['size']
|
const handleSizeChange: DropdownInstance['onSelect'] = (value) => {
|
||||||
}
|
if (value) {
|
||||||
|
size.value = value as TableInstance['size']
|
||||||
const refresh = () => {
|
|
||||||
emit('refresh')
|
|
||||||
}
|
|
||||||
|
|
||||||
const showRefreshBtn = computed(() => !props.disabledTools.includes('refresh'))
|
|
||||||
const showSizeBtn = computed(() => !props.disabledTools.includes('size'))
|
|
||||||
const showFullscreenBtn = computed(() => !props.disabledTools.includes('fullscreen'))
|
|
||||||
const showSettingColumnBtn = computed(
|
|
||||||
() => !props.disabledTools.includes('setting') && attrs?.columns && (attrs?.columns as TableColumnData[])?.length,
|
|
||||||
)
|
|
||||||
interface SettingColumnItem { title: string, key: string, show: boolean, disabled: boolean }
|
|
||||||
const settingColumnList = ref<SettingColumnItem[]>([])
|
|
||||||
|
|
||||||
// 重置配置列
|
|
||||||
const resetSettingColumns = () => {
|
|
||||||
settingColumnList.value = []
|
|
||||||
if (attrs.columns) {
|
|
||||||
const arr = attrs.columns as TableColumnData[]
|
|
||||||
arr.forEach((item) => {
|
|
||||||
settingColumnList.value.push({
|
|
||||||
key: item.dataIndex || (typeof item.title === 'string' ? item.title : ''),
|
|
||||||
title: typeof item.title === 'string' ? item.title : '',
|
|
||||||
show: item.show ?? true,
|
|
||||||
disabled: props.disabledColumnKeys.includes(
|
|
||||||
item.dataIndex || (typeof item.title === 'string' ? item.title : ''),
|
|
||||||
),
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 处理表格刷新 */
|
||||||
|
const handleRefresh = () => {
|
||||||
|
emit('refresh')
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 切换全屏状态 */
|
||||||
|
const toggleFullscreen = () => {
|
||||||
|
isFullscreen.value = !isFullscreen.value
|
||||||
|
}
|
||||||
|
|
||||||
|
const showRefreshBtn = computed(() => !props.disabledTools?.includes('refresh'))
|
||||||
|
const showSizeBtn = computed(() => !props.disabledTools?.includes('size'))
|
||||||
|
const showFullscreenBtn = computed(() => !props.disabledTools?.includes('fullscreen'))
|
||||||
|
/** 列设置相关逻辑 */
|
||||||
|
const showSettingColumnBtn = computed(() => {
|
||||||
|
const columns = props.columns as TableColumnData[] | undefined
|
||||||
|
return Boolean(columns?.length)
|
||||||
|
})
|
||||||
|
|
||||||
|
/** 列设置项类型 */
|
||||||
|
interface SettingColumnItem {
|
||||||
|
/** 列标题 */
|
||||||
|
title: string
|
||||||
|
/** 列标识 */
|
||||||
|
key: string
|
||||||
|
/** 是否显示 */
|
||||||
|
show: boolean
|
||||||
|
/** 是否禁用 */
|
||||||
|
disabled: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
const settingColumnList = ref<SettingColumnItem[]>([])
|
||||||
|
|
||||||
|
/** 重置列设置 */
|
||||||
|
const resetSettingColumns = () => {
|
||||||
|
if (!props.columns) {
|
||||||
|
settingColumnList.value = []
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const columns = props.columns as TableColumnData[]
|
||||||
|
settingColumnList.value = columns.map((column) => {
|
||||||
|
const key = column.dataIndex || (typeof column.title === 'string' ? column.title : '')
|
||||||
|
return {
|
||||||
|
key,
|
||||||
|
title: typeof column.title === 'string' ? column.title : '',
|
||||||
|
show: column.show ?? true,
|
||||||
|
disabled: props.disabledColumnKeys.includes(key),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 监听属性变化,重置列设置 */
|
||||||
watch(
|
watch(
|
||||||
() => attrs,
|
() => props.columns,
|
||||||
() => {
|
() => resetSettingColumns(),
|
||||||
resetSettingColumns()
|
|
||||||
},
|
|
||||||
{ immediate: true },
|
{ immediate: true },
|
||||||
)
|
)
|
||||||
|
|
||||||
// 排序和过滤可显示的列数据
|
/** 计算显示的列 */
|
||||||
const _columns = computed(() => {
|
const visibleColumns = computed(() => {
|
||||||
if (!attrs.columns) return []
|
if (!props.columns) return []
|
||||||
const arr = attrs.columns as TableColumnData[]
|
|
||||||
// 显示的dataIndex
|
const columns = props.columns as TableColumnData[]
|
||||||
const showDataIndexs = settingColumnList.value
|
const columnMap = new Map(
|
||||||
.filter((i) => i.show)
|
columns.map((col) => [
|
||||||
.map((i) => i.key || (typeof i.title === 'string' ? i.title : ''))
|
col.dataIndex || (typeof col.title === 'string' ? col.title : ''),
|
||||||
// 显示的columns数据
|
col,
|
||||||
const filterColumns = arr.filter((i) =>
|
]),
|
||||||
showDataIndexs.includes(i.dataIndex || (typeof i.title === 'string' ? i.title : '')),
|
|
||||||
)
|
)
|
||||||
const sortedColumns: TableColumnData[] = []
|
|
||||||
settingColumnList.value.forEach((i) => {
|
// 按照设置列表的顺序返回可见列
|
||||||
filterColumns.forEach((j) => {
|
return settingColumnList.value
|
||||||
if (i.key === (j.dataIndex || j.title)) {
|
.filter((item) => item.show)
|
||||||
sortedColumns.push(j)
|
.map((item) => columnMap.get(item.key))
|
||||||
}
|
.filter(Boolean) as TableColumnData[]
|
||||||
})
|
|
||||||
})
|
|
||||||
return sortedColumns
|
|
||||||
})
|
})
|
||||||
|
|
||||||
defineExpose({ tableRef })
|
defineExpose({ tableRef })
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style lang="scss" scoped>
|
||||||
.gi-table {
|
.gi-table {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
41
src/components/GiTable/src/type.ts
Normal file
41
src/components/GiTable/src/type.ts
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
import type { TableInstance } from '@arco-design/web-vue'
|
||||||
|
|
||||||
|
export interface TableProps {
|
||||||
|
columns?: TableInstance['$props']['columns']
|
||||||
|
data?: TableInstance['$props']['data']
|
||||||
|
bordered?: TableInstance['$props']['bordered']
|
||||||
|
hoverable?: TableInstance['$props']['hoverable']
|
||||||
|
stripe?: TableInstance['$props']['stripe']
|
||||||
|
size?: TableInstance['$props']['size']
|
||||||
|
tableLayoutFixed?: TableInstance['$props']['tableLayoutFixed']
|
||||||
|
loading?: TableInstance['$props']['loading']
|
||||||
|
rowSelection?: TableInstance['$props']['rowSelection']
|
||||||
|
expandable?: TableInstance['$props']['expandable']
|
||||||
|
scroll?: TableInstance['$props']['scroll']
|
||||||
|
pagination?: TableInstance['$props']['pagination']
|
||||||
|
pagePosition?: TableInstance['$props']['pagePosition']
|
||||||
|
indentSize?: TableInstance['$props']['indentSize']
|
||||||
|
rowKey?: TableInstance['$props']['rowKey']
|
||||||
|
showHeader?: TableInstance['$props']['showHeader']
|
||||||
|
virtualListProps?: TableInstance['$props']['virtualListProps']
|
||||||
|
spanMethod?: TableInstance['$props']['spanMethod']
|
||||||
|
spanAll?: TableInstance['$props']['spanAll']
|
||||||
|
loadMore?: TableInstance['$props']['loadMore']
|
||||||
|
filterIconAlignLeft?: TableInstance['$props']['filterIconAlignLeft']
|
||||||
|
hideExpandButtonOnEmpty?: TableInstance['$props']['hideExpandButtonOnEmpty']
|
||||||
|
rowClass?: TableInstance['$props']['rowClass']
|
||||||
|
draggable?: TableInstance['$props']['draggable']
|
||||||
|
rowNumber?: TableInstance['$props']['rowNumber']
|
||||||
|
columnResizable?: TableInstance['$props']['columnResizable']
|
||||||
|
summary?: TableInstance['$props']['summary']
|
||||||
|
summaryText?: TableInstance['$props']['summaryText']
|
||||||
|
summarySpanMethod?: TableInstance['$props']['summarySpanMethod']
|
||||||
|
selectedKeys?: TableInstance['$props']['selectedKeys']
|
||||||
|
defaultSelectedKeys?: TableInstance['$props']['defaultSelectedKeys']
|
||||||
|
expandedKeys?: TableInstance['$props']['expandedKeys']
|
||||||
|
defaultExpandedKeys?: TableInstance['$props']['defaultExpandedKeys']
|
||||||
|
defaultExpandAllRows?: TableInstance['$props']['defaultExpandAllRows']
|
||||||
|
stickyHeader?: TableInstance['$props']['stickyHeader']
|
||||||
|
scrollbar?: TableInstance['$props']['scrollbar']
|
||||||
|
showEmptyTree?: TableInstance['$props']['showEmptyTree']
|
||||||
|
}
|
@@ -1,5 +0,0 @@
|
|||||||
import type { TableColumnData } from '@arco-design/web-vue'
|
|
||||||
|
|
||||||
export interface TableInstanceColumns extends TableColumnData {
|
|
||||||
show?: boolean
|
|
||||||
}
|
|
@@ -75,9 +75,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { TreeNodeData } from '@arco-design/web-vue'
|
import type { TableInstance, TreeNodeData } from '@arco-design/web-vue'
|
||||||
|
|
||||||
import { type UserQuery, type UserResp, listAllUser, listUser } from '@/apis'
|
import { type UserQuery, type UserResp, listAllUser, listUser } from '@/apis'
|
||||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
|
||||||
import { type Options, useTable } from '@/hooks'
|
import { type Options, useTable } from '@/hooks'
|
||||||
import { useDept } from '@/hooks/app'
|
import { useDept } from '@/hooks/app'
|
||||||
import { isMobile } from '@/utils'
|
import { isMobile } from '@/utils'
|
||||||
@@ -110,7 +110,7 @@ const { tableData: dataList, loading, pagination, search } = useTable(
|
|||||||
)
|
)
|
||||||
|
|
||||||
// 表格列定义
|
// 表格列定义
|
||||||
const listColumns: TableInstanceColumns[] = [
|
const listColumns: TableInstance['columns'] = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
width: 66,
|
width: 66,
|
||||||
|
2
src/types/components.d.ts
vendored
2
src/types/components.d.ts
vendored
@@ -38,7 +38,7 @@ declare module 'vue' {
|
|||||||
GiSplitPane: typeof import('./../components/GiSplitPane/index.vue')['default']
|
GiSplitPane: typeof import('./../components/GiSplitPane/index.vue')['default']
|
||||||
GiSplitPaneFlexibleBox: typeof import('./../components/GiSplitPane/components/GiSplitPaneFlexibleBox.vue')['default']
|
GiSplitPaneFlexibleBox: typeof import('./../components/GiSplitPane/components/GiSplitPaneFlexibleBox.vue')['default']
|
||||||
GiSvgIcon: typeof import('./../components/GiSvgIcon/index.vue')['default']
|
GiSvgIcon: typeof import('./../components/GiSvgIcon/index.vue')['default']
|
||||||
GiTable: typeof import('./../components/GiTable/index.vue')['default']
|
GiTable: typeof import('./../components/GiTable/src/GiTable.vue')['default']
|
||||||
GiTag: typeof import('./../components/GiTag/index.tsx')['default']
|
GiTag: typeof import('./../components/GiTag/index.tsx')['default']
|
||||||
GiThemeBtn: typeof import('./../components/GiThemeBtn/index.vue')['default']
|
GiThemeBtn: typeof import('./../components/GiThemeBtn/index.vue')['default']
|
||||||
HourForm: typeof import('./../components/GenCron/CronForm/component/hour-form.vue')['default']
|
HourForm: typeof import('./../components/GenCron/CronForm/component/hour-form.vue')['default']
|
||||||
|
@@ -123,7 +123,6 @@ import { Message } from '@arco-design/web-vue'
|
|||||||
import { useWindowSize } from '@vueuse/core'
|
import { useWindowSize } from '@vueuse/core'
|
||||||
import { type FieldConfigResp, type GeneratorConfigResp, getGenConfig, listFieldConfig, listFieldConfigDict, saveGenConfig } from '@/apis/code/generator'
|
import { type FieldConfigResp, type GeneratorConfigResp, getGenConfig, listFieldConfig, listFieldConfigDict, saveGenConfig } from '@/apis/code/generator'
|
||||||
import type { LabelValueState } from '@/types/global'
|
import type { LabelValueState } from '@/types/global'
|
||||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
|
||||||
import { type ColumnItem, GiForm } from '@/components/GiForm'
|
import { type ColumnItem, GiForm } from '@/components/GiForm'
|
||||||
import { useResetReactive } from '@/hooks'
|
import { useResetReactive } from '@/hooks'
|
||||||
import { useDict } from '@/hooks/app'
|
import { useDict } from '@/hooks/app'
|
||||||
@@ -222,7 +221,7 @@ const getDataList = async (tableName: string, requireSync: boolean) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Table 字段配置
|
// Table 字段配置
|
||||||
const columns: TableInstanceColumns[] = [
|
const columns: TableInstance['columns'] = [
|
||||||
{ title: '名称', slotName: 'fieldName' },
|
{ title: '名称', slotName: 'fieldName' },
|
||||||
{ title: '类型', slotName: 'fieldType' },
|
{ title: '类型', slotName: 'fieldType' },
|
||||||
{ title: '描述', slotName: 'comment', width: 170 },
|
{ title: '描述', slotName: 'comment', width: 170 },
|
||||||
|
@@ -61,10 +61,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import type { TableInstance } from '@arco-design/web-vue'
|
||||||
import { Message } from '@arco-design/web-vue'
|
import { Message } from '@arco-design/web-vue'
|
||||||
import GenConfigDrawer from './GenConfigDrawer.vue'
|
import GenConfigDrawer from './GenConfigDrawer.vue'
|
||||||
import { downloadCode, generateCode, listGenConfig } from '@/apis/code/generator'
|
import { downloadCode, generateCode, listGenConfig } from '@/apis/code/generator'
|
||||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
|
||||||
import { useTable } from '@/hooks'
|
import { useTable } from '@/hooks'
|
||||||
import { isMobile } from '@/utils'
|
import { isMobile } from '@/utils'
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ const {
|
|||||||
selectAll,
|
selectAll,
|
||||||
search,
|
search,
|
||||||
} = useTable((page) => listGenConfig({ ...queryForm, ...page }), { immediate: true, formatResult: (data) => data.map((i) => ({ ...i, disabled: !i.createTime })) })
|
} = useTable((page) => listGenConfig({ ...queryForm, ...page }), { immediate: true, formatResult: (data) => data.map((i) => ({ ...i, disabled: !i.createTime })) })
|
||||||
const columns: TableInstanceColumns[] = [
|
const columns: TableInstance['columns'] = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
width: 66,
|
width: 66,
|
||||||
|
@@ -46,8 +46,8 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
|
import type { TableInstance } from '@arco-design/web-vue'
|
||||||
import { type LogQuery, exportLoginLog, listLog } from '@/apis/monitor'
|
import { type LogQuery, exportLoginLog, listLog } from '@/apis/monitor'
|
||||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
|
||||||
import DateRangePicker from '@/components/DateRangePicker/index.vue'
|
import DateRangePicker from '@/components/DateRangePicker/index.vue'
|
||||||
import { useDownload, useTable } from '@/hooks'
|
import { useDownload, useTable } from '@/hooks'
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ const {
|
|||||||
search,
|
search,
|
||||||
} = useTable((page) => listLog({ ...queryForm, ...page }), { immediate: true })
|
} = useTable((page) => listLog({ ...queryForm, ...page }), { immediate: true })
|
||||||
|
|
||||||
const columns: TableInstanceColumns[] = [
|
const columns: TableInstance['columns'] = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
width: 66,
|
width: 66,
|
||||||
|
@@ -57,9 +57,9 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
|
import type { TableInstance } from '@arco-design/web-vue'
|
||||||
import OperationLogDetailDrawer from './OperationLogDetailDrawer.vue'
|
import OperationLogDetailDrawer from './OperationLogDetailDrawer.vue'
|
||||||
import { type LogQuery, type LogResp, exportOperationLog, listLog } from '@/apis/monitor'
|
import { type LogQuery, type LogResp, exportOperationLog, listLog } from '@/apis/monitor'
|
||||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
|
||||||
import DateRangePicker from '@/components/DateRangePicker/index.vue'
|
import DateRangePicker from '@/components/DateRangePicker/index.vue'
|
||||||
import { useDownload, useTable } from '@/hooks'
|
import { useDownload, useTable } from '@/hooks'
|
||||||
import has from '@/utils/has'
|
import has from '@/utils/has'
|
||||||
@@ -80,7 +80,7 @@ const {
|
|||||||
pagination,
|
pagination,
|
||||||
search,
|
search,
|
||||||
} = useTable((page) => listLog({ ...queryForm, ...page }), { immediate: true })
|
} = useTable((page) => listLog({ ...queryForm, ...page }), { immediate: true })
|
||||||
const columns: TableInstanceColumns[] = [
|
const columns: TableInstance['columns'] = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
width: 66,
|
width: 66,
|
||||||
|
@@ -44,9 +44,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import type { TableInstance } from '@arco-design/web-vue'
|
||||||
import { Message } from '@arco-design/web-vue'
|
import { Message } from '@arco-design/web-vue'
|
||||||
import { type OnlineUserQuery, kickout, listOnlineUser } from '@/apis/monitor'
|
import { type OnlineUserQuery, kickout, listOnlineUser } from '@/apis/monitor'
|
||||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
|
||||||
import DateRangePicker from '@/components/DateRangePicker/index.vue'
|
import DateRangePicker from '@/components/DateRangePicker/index.vue'
|
||||||
import { useUserStore } from '@/stores'
|
import { useUserStore } from '@/stores'
|
||||||
import { useTable } from '@/hooks'
|
import { useTable } from '@/hooks'
|
||||||
@@ -68,7 +68,7 @@ const {
|
|||||||
pagination,
|
pagination,
|
||||||
search,
|
search,
|
||||||
} = useTable((page) => listOnlineUser({ ...queryForm, ...page }), { immediate: true })
|
} = useTable((page) => listOnlineUser({ ...queryForm, ...page }), { immediate: true })
|
||||||
const columns: TableInstanceColumns[] = [
|
const columns: TableInstance['columns'] = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
width: 66,
|
width: 66,
|
||||||
|
@@ -86,6 +86,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import type { TableInstance } from '@arco-design/web-vue'
|
||||||
import { Message, Modal } from '@arco-design/web-vue'
|
import { Message, Modal } from '@arco-design/web-vue'
|
||||||
import AppAddModal from './AppAddModal.vue'
|
import AppAddModal from './AppAddModal.vue'
|
||||||
import AppDetailDrawer from './AppDetailDrawer.vue'
|
import AppDetailDrawer from './AppDetailDrawer.vue'
|
||||||
@@ -98,7 +99,6 @@ import {
|
|||||||
listApp,
|
listApp,
|
||||||
resetAppSecret,
|
resetAppSecret,
|
||||||
} from '@/apis/open/app'
|
} from '@/apis/open/app'
|
||||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
|
||||||
import { useDownload, useTable } from '@/hooks'
|
import { useDownload, useTable } from '@/hooks'
|
||||||
import { isMobile } from '@/utils'
|
import { isMobile } from '@/utils'
|
||||||
import has from '@/utils/has'
|
import has from '@/utils/has'
|
||||||
@@ -116,7 +116,7 @@ const {
|
|||||||
search,
|
search,
|
||||||
handleDelete,
|
handleDelete,
|
||||||
} = useTable((page) => listApp({ ...queryForm, ...page }), { immediate: true })
|
} = useTable((page) => listApp({ ...queryForm, ...page }), { immediate: true })
|
||||||
const columns: TableInstanceColumns[] = [
|
const columns: TableInstance['columns'] = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
width: 66,
|
width: 66,
|
||||||
|
@@ -79,12 +79,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import type { TableInstance } from '@arco-design/web-vue'
|
||||||
import { Message } from '@arco-design/web-vue'
|
import { Message } from '@arco-design/web-vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import JobAddModal from './JobAddModal.vue'
|
import JobAddModal from './JobAddModal.vue'
|
||||||
import JobDetailDrawer from './JobDetailDrawer.vue'
|
import JobDetailDrawer from './JobDetailDrawer.vue'
|
||||||
import { type JobQuery, type JobResp, deleteJob, listGroup, listJob, triggerJob, updateJobStatus } from '@/apis/schedule'
|
import { type JobQuery, type JobResp, deleteJob, listGroup, listJob, triggerJob, updateJobStatus } from '@/apis/schedule'
|
||||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
|
||||||
import { useTable } from '@/hooks'
|
import { useTable } from '@/hooks'
|
||||||
import { useDict } from '@/hooks/app'
|
import { useDict } from '@/hooks/app'
|
||||||
import { isMobile, parseCron } from '@/utils'
|
import { isMobile, parseCron } from '@/utils'
|
||||||
@@ -105,7 +105,7 @@ const {
|
|||||||
search,
|
search,
|
||||||
handleDelete,
|
handleDelete,
|
||||||
} = useTable((page) => listJob({ ...queryForm, ...page }), { immediate: false })
|
} = useTable((page) => listJob({ ...queryForm, ...page }), { immediate: false })
|
||||||
const columns: TableInstanceColumns[] = [
|
const columns: TableInstance['columns'] = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
width: 66,
|
width: 66,
|
||||||
|
@@ -65,12 +65,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import type { TableInstance } from '@arco-design/web-vue'
|
||||||
import { Message } from '@arco-design/web-vue'
|
import { Message } from '@arco-design/web-vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import LogDetailDrawer from './LogDetailDrawer.vue'
|
import LogDetailDrawer from './LogDetailDrawer.vue'
|
||||||
import { type JobLogQuery, type JobLogResp, listGroup, listJobLog, retryJob, stopJob } from '@/apis/schedule'
|
import { type JobLogQuery, type JobLogResp, listGroup, listJobLog, retryJob, stopJob } from '@/apis/schedule'
|
||||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
|
||||||
import { useTable } from '@/hooks'
|
import { useTable } from '@/hooks'
|
||||||
import { useDict } from '@/hooks/app'
|
import { useDict } from '@/hooks/app'
|
||||||
import { isMobile } from '@/utils'
|
import { isMobile } from '@/utils'
|
||||||
@@ -93,7 +93,7 @@ const {
|
|||||||
loading,
|
loading,
|
||||||
search,
|
search,
|
||||||
} = useTable((page) => listJobLog({ ...queryForm, ...page }), { immediate: false })
|
} = useTable((page) => listJobLog({ ...queryForm, ...page }), { immediate: false })
|
||||||
const columns: TableInstanceColumns[] = [
|
const columns: TableInstance['columns'] = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
width: 66,
|
width: 66,
|
||||||
|
@@ -63,9 +63,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import type { TableInstance } from '@arco-design/web-vue'
|
||||||
import { Message, Modal } from '@arco-design/web-vue'
|
import { Message, Modal } from '@arco-design/web-vue'
|
||||||
import { type MessageQuery, deleteMessage, listMessage, readMessage } from '@/apis'
|
import { type MessageQuery, deleteMessage, listMessage, readMessage } from '@/apis'
|
||||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
|
||||||
import { useTable } from '@/hooks'
|
import { useTable } from '@/hooks'
|
||||||
import { useDict } from '@/hooks/app'
|
import { useDict } from '@/hooks/app'
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ const {
|
|||||||
handleDelete,
|
handleDelete,
|
||||||
} = useTable((page) => listMessage({ ...queryForm, ...page }), { immediate: true })
|
} = useTable((page) => listMessage({ ...queryForm, ...page }), { immediate: true })
|
||||||
|
|
||||||
const columns: TableInstanceColumns[] = [
|
const columns: TableInstance['columns'] = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
width: 66,
|
width: 66,
|
||||||
|
@@ -63,10 +63,10 @@
|
|||||||
|
|
||||||
<script setup lang="tsx">
|
<script setup lang="tsx">
|
||||||
import type { LabelValue } from '@arco-design/web-vue/es/tree-select/interface'
|
import type { LabelValue } from '@arco-design/web-vue/es/tree-select/interface'
|
||||||
|
import type { TableInstance } from '@arco-design/web-vue'
|
||||||
import ClientAddModal from './ClientAddModal.vue'
|
import ClientAddModal from './ClientAddModal.vue'
|
||||||
import ClientDetailDrawer from './ClientDetailDrawer.vue'
|
import ClientDetailDrawer from './ClientDetailDrawer.vue'
|
||||||
import { type ClientQuery, type ClientResp, deleteClient, listClient } from '@/apis/system/client'
|
import { type ClientQuery, type ClientResp, deleteClient, listClient } from '@/apis/system/client'
|
||||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
|
||||||
import { DisEnableStatusList } from '@/constant/common'
|
import { DisEnableStatusList } from '@/constant/common'
|
||||||
import { useTable } from '@/hooks'
|
import { useTable } from '@/hooks'
|
||||||
import { useDict } from '@/hooks/app'
|
import { useDict } from '@/hooks/app'
|
||||||
@@ -105,7 +105,7 @@ const {
|
|||||||
search,
|
search,
|
||||||
handleDelete,
|
handleDelete,
|
||||||
} = useTable((page) => listClient({ ...queryForm, ...page }), { immediate: true })
|
} = useTable((page) => listClient({ ...queryForm, ...page }), { immediate: true })
|
||||||
const columns: TableInstanceColumns[] = [
|
const columns: TableInstance['columns'] = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
width: 66,
|
width: 66,
|
||||||
|
@@ -95,9 +95,9 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import 'vue3-tree-org/lib/vue3-tree-org.css'
|
import 'vue3-tree-org/lib/vue3-tree-org.css'
|
||||||
import { Vue3TreeOrg } from 'vue3-tree-org'
|
import { Vue3TreeOrg } from 'vue3-tree-org'
|
||||||
|
import type { TableInstance } from '@arco-design/web-vue'
|
||||||
import DeptAddModal from './DeptAddModal.vue'
|
import DeptAddModal from './DeptAddModal.vue'
|
||||||
import { type DeptQuery, type DeptResp, deleteDept, exportDept, listDept } from '@/apis/system/dept'
|
import { type DeptQuery, type DeptResp, deleteDept, exportDept, listDept } from '@/apis/system/dept'
|
||||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
|
||||||
import type GiTable from '@/components/GiTable/index.vue'
|
import type GiTable from '@/components/GiTable/index.vue'
|
||||||
import { useDownload, useTable } from '@/hooks'
|
import { useDownload, useTable } from '@/hooks'
|
||||||
import { isMobile } from '@/utils'
|
import { isMobile } from '@/utils'
|
||||||
@@ -158,7 +158,7 @@ const dataList = computed(() => {
|
|||||||
return searchData(name.value)
|
return searchData(name.value)
|
||||||
})
|
})
|
||||||
|
|
||||||
const columns: TableInstanceColumns[] = [
|
const columns: TableInstance['columns'] = [
|
||||||
{ title: '名称', dataIndex: 'name', minWidth: 170, ellipsis: true, tooltip: true },
|
{ title: '名称', dataIndex: 'name', minWidth: 170, ellipsis: true, tooltip: true },
|
||||||
{ title: '状态', dataIndex: 'status', slotName: 'status', align: 'center' },
|
{ title: '状态', dataIndex: 'status', slotName: 'status', align: 'center' },
|
||||||
{ title: '排序', dataIndex: 'sort', align: 'center', show: false },
|
{ title: '排序', dataIndex: 'sort', align: 'center', show: false },
|
||||||
|
@@ -65,11 +65,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import type { TableInstance } from '@arco-design/web-vue'
|
||||||
import { Message, Modal } from '@arco-design/web-vue'
|
import { Message, Modal } from '@arco-design/web-vue'
|
||||||
import DictTree from './tree/index.vue'
|
import DictTree from './tree/index.vue'
|
||||||
import DictItemAddModal from './DictItemAddModal.vue'
|
import DictItemAddModal from './DictItemAddModal.vue'
|
||||||
import { type DictItemQuery, type DictItemResp, clearDictCache, deleteDictItem, listDictItem } from '@/apis/system/dict'
|
import { type DictItemQuery, type DictItemResp, clearDictCache, deleteDictItem, listDictItem } from '@/apis/system/dict'
|
||||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
|
||||||
import { useTable } from '@/hooks'
|
import { useTable } from '@/hooks'
|
||||||
import { isMobile } from '@/utils'
|
import { isMobile } from '@/utils'
|
||||||
import has from '@/utils/has'
|
import has from '@/utils/has'
|
||||||
@@ -88,7 +88,7 @@ const {
|
|||||||
search,
|
search,
|
||||||
handleDelete,
|
handleDelete,
|
||||||
} = useTable((page) => listDictItem({ ...queryForm, ...page }), { immediate: false })
|
} = useTable((page) => listDictItem({ ...queryForm, ...page }), { immediate: false })
|
||||||
const columns: TableInstanceColumns[] = [
|
const columns: TableInstance['columns'] = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
width: 66,
|
width: 66,
|
||||||
|
@@ -90,10 +90,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import type { TableInstance } from '@arco-design/web-vue'
|
||||||
import { Message, Modal } from '@arco-design/web-vue'
|
import { Message, Modal } from '@arco-design/web-vue'
|
||||||
import MenuAddModal from './MenuAddModal.vue'
|
import MenuAddModal from './MenuAddModal.vue'
|
||||||
import { type MenuQuery, type MenuResp, clearMenuCache, deleteMenu, listMenu } from '@/apis/system/menu'
|
import { type MenuQuery, type MenuResp, clearMenuCache, deleteMenu, listMenu } from '@/apis/system/menu'
|
||||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
|
||||||
import type GiTable from '@/components/GiTable/index.vue'
|
import type GiTable from '@/components/GiTable/index.vue'
|
||||||
import { useTable } from '@/hooks'
|
import { useTable } from '@/hooks'
|
||||||
import { isMobile } from '@/utils'
|
import { isMobile } from '@/utils'
|
||||||
@@ -138,7 +138,7 @@ const dataList = computed(() => {
|
|||||||
return searchData(title.value)
|
return searchData(title.value)
|
||||||
})
|
})
|
||||||
|
|
||||||
const columns: TableInstanceColumns[] = [
|
const columns: TableInstance['columns'] = [
|
||||||
{ title: '菜单标题', dataIndex: 'title', slotName: 'title', width: 170, fixed: !isMobile() ? 'left' : undefined },
|
{ title: '菜单标题', dataIndex: 'title', slotName: 'title', width: 170, fixed: !isMobile() ? 'left' : undefined },
|
||||||
{ title: '类型', dataIndex: 'type', slotName: 'type', align: 'center' },
|
{ title: '类型', dataIndex: 'type', slotName: 'type', align: 'center' },
|
||||||
{ title: '状态', dataIndex: 'status', slotName: 'status', align: 'center' },
|
{ title: '状态', dataIndex: 'status', slotName: 'status', align: 'center' },
|
||||||
|
@@ -51,8 +51,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import type { TableInstance } from '@arco-design/web-vue'
|
||||||
import { type NoticeQuery, type NoticeResp, deleteNotice, listNotice } from '@/apis/system'
|
import { type NoticeQuery, type NoticeResp, deleteNotice, listNotice } from '@/apis/system'
|
||||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
|
||||||
import { useTable } from '@/hooks'
|
import { useTable } from '@/hooks'
|
||||||
import { useDict } from '@/hooks/app'
|
import { useDict } from '@/hooks/app'
|
||||||
import { isMobile } from '@/utils'
|
import { isMobile } from '@/utils'
|
||||||
@@ -74,7 +74,7 @@ const {
|
|||||||
search,
|
search,
|
||||||
handleDelete,
|
handleDelete,
|
||||||
} = useTable((page) => listNotice({ ...queryForm, ...page }), { immediate: true })
|
} = useTable((page) => listNotice({ ...queryForm, ...page }), { immediate: true })
|
||||||
const columns: TableInstanceColumns[] = [
|
const columns: TableInstance['columns'] = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
width: 66,
|
width: 66,
|
||||||
|
@@ -58,7 +58,6 @@
|
|||||||
import { nextTick, ref } from 'vue'
|
import { nextTick, ref } from 'vue'
|
||||||
import { Message, type TableInstance } from '@arco-design/web-vue'
|
import { Message, type TableInstance } from '@arco-design/web-vue'
|
||||||
import { type MenuResp, listMenu } from '@/apis/system/menu'
|
import { type MenuResp, listMenu } from '@/apis/system/menu'
|
||||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
|
||||||
import { isMobile } from '@/utils'
|
import { isMobile } from '@/utils'
|
||||||
import type GiTable from '@/components/GiTable/index.vue'
|
import type GiTable from '@/components/GiTable/index.vue'
|
||||||
import { useTable } from '@/hooks'
|
import { useTable } from '@/hooks'
|
||||||
@@ -166,7 +165,7 @@ const {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const columns: TableInstanceColumns[] = [
|
const columns: TableInstance['columns'] = [
|
||||||
{ title: '菜单', dataIndex: 'title', slotName: 'title', width: 170, fixed: !isMobile() ? 'left' : undefined },
|
{ title: '菜单', dataIndex: 'title', slotName: 'title', width: 170, fixed: !isMobile() ? 'left' : undefined },
|
||||||
{ title: '权限', dataIndex: 'permissions', slotName: 'permissions' },
|
{ title: '权限', dataIndex: 'permissions', slotName: 'permissions' },
|
||||||
]
|
]
|
||||||
|
@@ -61,11 +61,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang='tsx' setup>
|
<script lang='tsx' setup>
|
||||||
|
import type { TableInstance } from '@arco-design/web-vue'
|
||||||
import { Message, Modal } from '@arco-design/web-vue'
|
import { Message, Modal } from '@arco-design/web-vue'
|
||||||
import RoleAssignModal from '../RoleAssignModal.vue'
|
import RoleAssignModal from '../RoleAssignModal.vue'
|
||||||
import { useResetReactive, useTable } from '@/hooks'
|
import { useResetReactive, useTable } from '@/hooks'
|
||||||
import { type RoleUserQuery, type RoleUserResp, listRoleUser, unassignFromUsers } from '@/apis/system/role'
|
import { type RoleUserQuery, type RoleUserResp, listRoleUser, unassignFromUsers } from '@/apis/system/role'
|
||||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
|
||||||
import { isMobile } from '@/utils'
|
import { isMobile } from '@/utils'
|
||||||
import has from '@/utils/has'
|
import has from '@/utils/has'
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ const {
|
|||||||
selectAll,
|
selectAll,
|
||||||
handleDelete,
|
handleDelete,
|
||||||
} = useTable((page) => listRoleUser(props.roleId, { ...queryForm, ...page }), { immediate: false })
|
} = useTable((page) => listRoleUser(props.roleId, { ...queryForm, ...page }), { immediate: false })
|
||||||
const columns: TableInstanceColumns[] = [
|
const columns: TableInstance['columns'] = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
width: 66,
|
width: 66,
|
||||||
|
@@ -90,6 +90,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import type { TableInstance } from '@arco-design/web-vue'
|
||||||
import DeptTree from './dept/index.vue'
|
import DeptTree from './dept/index.vue'
|
||||||
import UserAddDrawer from './UserAddDrawer.vue'
|
import UserAddDrawer from './UserAddDrawer.vue'
|
||||||
import UserImportDrawer from './UserImportDrawer.vue'
|
import UserImportDrawer from './UserImportDrawer.vue'
|
||||||
@@ -97,7 +98,6 @@ import UserDetailDrawer from './UserDetailDrawer.vue'
|
|||||||
import UserResetPwdModal from './UserResetPwdModal.vue'
|
import UserResetPwdModal from './UserResetPwdModal.vue'
|
||||||
import UserUpdateRoleModal from './UserUpdateRoleModal.vue'
|
import UserUpdateRoleModal from './UserUpdateRoleModal.vue'
|
||||||
import { type UserResp, deleteUser, exportUser, listUser } from '@/apis/system/user'
|
import { type UserResp, deleteUser, exportUser, listUser } from '@/apis/system/user'
|
||||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
|
||||||
import { DisEnableStatusList } from '@/constant/common'
|
import { DisEnableStatusList } from '@/constant/common'
|
||||||
import { useDownload, useResetReactive, useTable } from '@/hooks'
|
import { useDownload, useResetReactive, useTable } from '@/hooks'
|
||||||
import { isMobile } from '@/utils'
|
import { isMobile } from '@/utils'
|
||||||
@@ -150,7 +150,7 @@ const {
|
|||||||
search,
|
search,
|
||||||
handleDelete,
|
handleDelete,
|
||||||
} = useTable((page) => listUser({ ...queryForm, ...page }), { immediate: false })
|
} = useTable((page) => listUser({ ...queryForm, ...page }), { immediate: false })
|
||||||
const columns: TableInstanceColumns[] = [
|
const columns: TableInstance['columns'] = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
width: 66,
|
width: 66,
|
||||||
|
Reference in New Issue
Block a user