mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-08 22:57:11 +08:00
refactor: 优化 GiTable 列类型使用
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
<template>
|
||||
<section class="system-logo" :class="{ collapsed: props.collapsed }" @click="toHome">
|
||||
<img v-if="webLogo" class="logo" :src="webLogo" alt="logo"/>
|
||||
<img v-else class="logo" src="@/assets/images/logo.svg" alt="logo"/>
|
||||
<img v-if="webLogo" class="logo" :src="webLogo" alt="logo" />
|
||||
<img v-else class="logo" src="@/assets/images/logo.svg" alt="logo" />
|
||||
<span class="system-name">{{ webTitle }}</span>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {useAppStore} from "@/stores";
|
||||
import { useAppStore } from '@/stores'
|
||||
|
||||
const appStore= useAppStore();
|
||||
const appStore = useAppStore()
|
||||
appStore.initWebConfig()
|
||||
|
||||
const webTitle = computed(() => appStore.getTitle());
|
||||
const webLogo = computed(() => appStore.getLogo());
|
||||
const webTitle = computed(() => appStore.getTitle())
|
||||
const webLogo = computed(() => appStore.getLogo())
|
||||
|
||||
interface Props {
|
||||
collapsed?: boolean
|
||||
|
@@ -19,8 +19,8 @@
|
||||
@submit="handleLogin"
|
||||
>
|
||||
<h3 class="login-right__title">
|
||||
<img v-if="webLogo" class="logo" :src="webLogo" alt="logo" height="33"/>
|
||||
<img v-else class="logo" src="@/assets/images/logo.svg" alt="logo"/>
|
||||
<img v-if="webLogo" class="logo" :src="webLogo" alt="logo" height="33" />
|
||||
<img v-else class="logo" src="@/assets/images/logo.svg" alt="logo" />
|
||||
<span>{{ appStore.getTitle() }}</span>
|
||||
</h3>
|
||||
<a-form-item field="username">
|
||||
@@ -78,8 +78,8 @@ import { encryptByRsa } from '@/utils/encrypt'
|
||||
const appStore = useAppStore()
|
||||
appStore.initWebConfig()
|
||||
|
||||
const webTitle = computed(() => appStore.getTitle());
|
||||
const webLogo = computed(() => appStore.getLogo());
|
||||
computed(() => appStore.getTitle())
|
||||
const webLogo = computed(() => appStore.getLogo())
|
||||
|
||||
defineOptions({ name: 'Login' })
|
||||
|
||||
|
@@ -46,13 +46,13 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { exportLoginLog, listLog } from '@/apis'
|
||||
import type { TableInstance } from '@arco-design/web-vue'
|
||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index.vue'
|
||||
import { useTable, useDownload } from '@/hooks'
|
||||
|
||||
defineOptions({ name: 'LoginLog' })
|
||||
|
||||
const columns: TableInstance['columns'] = [
|
||||
const columns: TableInstanceColumns[] = [
|
||||
{
|
||||
title: '序号',
|
||||
width: 66,
|
||||
|
@@ -57,14 +57,14 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { listLog, exportOperationLog, type LogResp } from '@/apis'
|
||||
import type { TableInstance } from '@arco-design/web-vue'
|
||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index.vue'
|
||||
import OperationLogDetailDrawer from './OperationLogDetailDrawer.vue'
|
||||
import { useTable, useDownload } from '@/hooks'
|
||||
|
||||
defineOptions({ name: 'OperationLog' })
|
||||
|
||||
const columns: TableInstance['columns'] = [
|
||||
const columns: TableInstanceColumns[] = [
|
||||
{
|
||||
title: '序号',
|
||||
width: 66,
|
||||
|
@@ -44,7 +44,8 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { listOnlineUser, kickout } from '@/apis'
|
||||
import { Message, type TableInstance } from '@arco-design/web-vue'
|
||||
import { Message } from '@arco-design/web-vue'
|
||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index.vue'
|
||||
import { useUserStore } from '@/stores'
|
||||
import { useTable } from '@/hooks'
|
||||
@@ -52,7 +53,7 @@ import { isMobile } from '@/utils'
|
||||
|
||||
defineOptions({ name: 'OnlineUser' })
|
||||
|
||||
const columns: TableInstance['columns'] = [
|
||||
const columns: TableInstanceColumns[] = [
|
||||
{
|
||||
title: '序号',
|
||||
width: 66,
|
||||
|
@@ -82,8 +82,9 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { listDept, deleteDept, exportDept, type DeptResp, type DeptQuery } from '@/apis'
|
||||
import { Message, type TableInstance } from '@arco-design/web-vue'
|
||||
import { Message } from '@arco-design/web-vue'
|
||||
import type GiTable from '@/components/GiTable/index.vue'
|
||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
||||
import AddDeptModal from './AddDeptModal.vue'
|
||||
import { DisEnableStatusList } from '@/constant/common'
|
||||
import { useDownload } from '@/hooks'
|
||||
@@ -91,7 +92,7 @@ import { isMobile } from '@/utils'
|
||||
|
||||
defineOptions({ name: 'Dept' })
|
||||
|
||||
const columns: TableInstance['columns'] = [
|
||||
const columns: TableInstanceColumns[] = [
|
||||
{ title: '名称', dataIndex: 'name', width: 170, ellipsis: true, tooltip: true },
|
||||
{ title: '状态', slotName: 'status', align: 'center' },
|
||||
{ title: '排序', dataIndex: 'sort', align: 'center', show: false },
|
||||
|
@@ -55,15 +55,15 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { listDict, deleteDict, type DictResp } from '@/apis'
|
||||
import type { TableInstance } from '@arco-design/web-vue'
|
||||
import AddDictModal from './AddDictModal.vue'
|
||||
import DictItemModal from '@/views/system/dict/item/index.vue'
|
||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
||||
import { useTable } from '@/hooks'
|
||||
import { isMobile } from '@/utils'
|
||||
|
||||
defineOptions({ name: 'Dict' })
|
||||
|
||||
const columns: TableInstance['columns'] = [
|
||||
const columns: TableInstanceColumns[] = [
|
||||
{
|
||||
title: '序号',
|
||||
width: 66,
|
||||
|
@@ -63,12 +63,12 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { listDictItem, deleteDictItem, type DictItemResp } from '@/apis'
|
||||
import type { TableInstance } from '@arco-design/web-vue'
|
||||
import AddDictItemModal from './AddDictItemModal.vue'
|
||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
||||
import { useTable } from '@/hooks'
|
||||
import { isMobile } from '@/utils'
|
||||
|
||||
const columns: TableInstance['columns'] = [
|
||||
const columns: TableInstanceColumns[] = [
|
||||
{
|
||||
title: '序号',
|
||||
width: 66,
|
||||
|
@@ -94,15 +94,16 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { listMenu, deleteMenu, type MenuResp, type MenuQuery } from '@/apis'
|
||||
import { Message, type TableInstance } from '@arco-design/web-vue'
|
||||
import { Message } from '@arco-design/web-vue'
|
||||
import type GiTable from '@/components/GiTable/index.vue'
|
||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
||||
import AddMenuModal from './AddMenuModal.vue'
|
||||
import { DisEnableStatusList } from '@/constant/common'
|
||||
import { isMobile } from '@/utils'
|
||||
|
||||
defineOptions({ name: 'Menu' })
|
||||
|
||||
const columns: TableInstance['columns'] = [
|
||||
const columns: TableInstanceColumns[] = [
|
||||
{ title: '菜单标题', dataIndex: 'title', slotName: 'title', width: 170, fixed: !isMobile() ? 'left' : undefined },
|
||||
{ title: '类型', slotName: 'type', align: 'center' },
|
||||
{ title: '状态', slotName: 'status', align: 'center' },
|
||||
|
@@ -70,9 +70,9 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { listRole, deleteRole, type RoleResp } from '@/apis'
|
||||
import type { TableInstance } from '@arco-design/web-vue'
|
||||
import AddRoleModal from './AddRoleModal.vue'
|
||||
import RoleDetailDrawer from './RoleDetailDrawer.vue'
|
||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
||||
import { useTable } from '@/hooks'
|
||||
import { useDict } from '@/hooks/app'
|
||||
import { isMobile } from '@/utils'
|
||||
@@ -82,7 +82,7 @@ defineOptions({ name: 'Role' })
|
||||
|
||||
const { data_scope_enum } = useDict('data_scope_enum')
|
||||
|
||||
const columns: TableInstance['columns'] = [
|
||||
const columns: TableInstanceColumns[] = [
|
||||
{
|
||||
title: '序号',
|
||||
width: 66,
|
||||
|
@@ -102,10 +102,11 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { listUser, deleteUser, exportUser, type UserResp } from '@/apis'
|
||||
import type { TableInstance, 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 { TableInstanceColumns } from '@/components/GiTable/type'
|
||||
import { useTable, useDownload } from '@/hooks'
|
||||
import { useDept } from '@/hooks/app'
|
||||
import { isMobile } from '@/utils'
|
||||
@@ -114,7 +115,7 @@ import { DisEnableStatusList } from '@/constant/common'
|
||||
|
||||
defineOptions({ name: 'User' })
|
||||
|
||||
const columns: TableInstance['columns'] = [
|
||||
const columns: TableInstanceColumns[] = [
|
||||
{
|
||||
title: '序号',
|
||||
width: 66,
|
||||
|
Reference in New Issue
Block a user