mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-11-14 04:57:12 +08:00
chore: 优化 apis 导入,随着模块和接口的增加,方便维护
This commit is contained in:
@@ -107,7 +107,7 @@ import {
|
||||
listOption,
|
||||
resetOptionValue,
|
||||
updateOption
|
||||
} from '@/apis'
|
||||
} from '@/apis/system'
|
||||
import { useAppStore } from '@/stores'
|
||||
import { useForm } from '@/hooks'
|
||||
import { fileToBase64 } from '@/utils'
|
||||
|
||||
@@ -61,7 +61,7 @@ import {
|
||||
listOption,
|
||||
resetOptionValue,
|
||||
updateOption
|
||||
} from '@/apis'
|
||||
} from '@/apis/system'
|
||||
import { useForm } from '@/hooks'
|
||||
|
||||
defineOptions({ name: 'MailSetting' })
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<script setup lang="ts">
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { type FormInstance, Message, Modal } from '@arco-design/web-vue'
|
||||
import { type OptionResp, type SecurityConfig, listOption, resetOptionValue, updateOption } from '@/apis'
|
||||
import { type OptionResp, type SecurityConfig, listOption, resetOptionValue, updateOption } from '@/apis/system'
|
||||
import { useForm } from '@/hooks'
|
||||
|
||||
defineOptions({ name: 'SecuritySetting' })
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Message } from '@arco-design/web-vue'
|
||||
import { addDept, getDept, updateDept } from '@/apis'
|
||||
import { addDept, getDept, updateDept } from '@/apis/system'
|
||||
import { type Columns, GiForm } from '@/components/GiForm'
|
||||
import { useForm } from '@/hooks'
|
||||
import { useDept } from '@/hooks/app'
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import DeptAddModal from './DeptAddModal.vue'
|
||||
import { type DeptQuery, type DeptResp, deleteDept, exportDept, listDept } from '@/apis'
|
||||
import { type DeptQuery, type DeptResp, deleteDept, exportDept, listDept } from '@/apis/system'
|
||||
import type GiTable from '@/components/GiTable/index.vue'
|
||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
||||
import { useDownload, useTable } from '@/hooks'
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Message } from '@arco-design/web-vue'
|
||||
import { addDictItem, getDictItem, updateDictItem } from '@/apis'
|
||||
import { addDictItem, getDictItem, updateDictItem } from '@/apis/system'
|
||||
import { type Columns, GiForm } from '@/components/GiForm'
|
||||
import { useForm } from '@/hooks'
|
||||
|
||||
|
||||
@@ -12,15 +12,15 @@
|
||||
<DictTree placeholder="请输入关键词" @node-click="handleSelectDict" />
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="16" :md="17" :lg="18" :xl="19" :xxl="20" flex="1" class="h-full ov-hidden">
|
||||
<GiTable
|
||||
<GiTable
|
||||
row-key="id"
|
||||
:data="dataList"
|
||||
:columns="columns"
|
||||
:data="dataList"
|
||||
:columns="columns"
|
||||
:loading="loading"
|
||||
:scroll="{ x: '100%', y: '100%', minWidth: 600 }"
|
||||
:pagination="pagination"
|
||||
:scroll="{ x: '100%', y: '100%', minWidth: 600 }"
|
||||
:pagination="pagination"
|
||||
:disabled-tools="['size']"
|
||||
:disabled-column-keys="['label']"
|
||||
:disabled-column-keys="['label']"
|
||||
@refresh="search"
|
||||
>
|
||||
<template #custom-left>
|
||||
@@ -44,9 +44,9 @@
|
||||
<template #action="{ record }">
|
||||
<a-space>
|
||||
<a-link v-permission="['system:dict:item:update']" @click="onUpdate(record)">修改</a-link>
|
||||
<a-link
|
||||
v-permission="['system:dict:item:delete']"
|
||||
status="danger"
|
||||
<a-link
|
||||
v-permission="['system:dict:item:delete']"
|
||||
status="danger"
|
||||
@click="onDelete(record)"
|
||||
>
|
||||
删除
|
||||
@@ -64,7 +64,7 @@
|
||||
<script setup lang="ts">
|
||||
import DictTree from './tree/index.vue'
|
||||
import DictItemAddModal from './DictItemAddModal.vue'
|
||||
import { type DictItemQuery, type DictItemResp, deleteDictItem, listDictItem } from '@/apis'
|
||||
import { type DictItemQuery, type DictItemResp, deleteDictItem, listDictItem } from '@/apis/system'
|
||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
||||
import { useTable } from '@/hooks'
|
||||
import { isMobile } from '@/utils'
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Message } from '@arco-design/web-vue'
|
||||
import { addDict, getDict, updateDict } from '@/apis'
|
||||
import { addDict, getDict, updateDict } from '@/apis/system'
|
||||
import { type Columns, GiForm } from '@/components/GiForm'
|
||||
import { useForm } from '@/hooks'
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { DictResp } from '@/apis'
|
||||
import type { DictResp } from '@/apis/system'
|
||||
|
||||
interface Props {
|
||||
data: DictResp
|
||||
|
||||
@@ -42,7 +42,7 @@ import type { TreeNodeData } from '@arco-design/web-vue'
|
||||
import { mapTree } from 'xe-utils'
|
||||
import DictAddModal from './DictAddModal.vue'
|
||||
import RightMenu from './RightMenu.vue'
|
||||
import { type DictQuery, type DictResp, deleteDict, listDict } from '@/apis'
|
||||
import { type DictQuery, type DictResp, deleteDict, listDict } from '@/apis/system'
|
||||
import has from '@/utils/has'
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useDraggable, useElementSize, useWindowSize } from '@vueuse/core'
|
||||
import type { FileItem } from '@/apis'
|
||||
import type { FileItem } from '@/apis/system'
|
||||
|
||||
interface Props {
|
||||
data: FileItem
|
||||
|
||||
@@ -3,7 +3,7 @@ import { createApp } from 'vue'
|
||||
import ArcoVueIcon from '@arco-design/web-vue/es/icon'
|
||||
import ArcoVue from '@arco-design/web-vue'
|
||||
import ModalContent from './ModalContent.vue'
|
||||
import type { FileItem } from '@/apis'
|
||||
import type { FileItem } from '@/apis/system'
|
||||
|
||||
function createModal<T extends { callback?: () => void }>(component: Component, options?: T) {
|
||||
// 创建一个挂载容器
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import FileImage from '../../main/FileMain/FileImage.vue'
|
||||
import type { FileItem } from '@/apis'
|
||||
import type { FileItem } from '@/apis/system'
|
||||
import { formatFileSize } from '@/utils'
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { h } from 'vue'
|
||||
import { Modal } from '@arco-design/web-vue'
|
||||
import ModalContent from './ModalContent.vue'
|
||||
import type { FileItem } from '@/apis'
|
||||
import type { FileItem } from '@/apis/system'
|
||||
|
||||
/** 打开 详情 弹窗 */
|
||||
export function openFileDetailModal(fileItem: FileItem) {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { FormInstance } from '@arco-design/web-vue'
|
||||
import type { FileItem } from '@/apis'
|
||||
import type { FileItem } from '@/apis/system'
|
||||
|
||||
interface Props {
|
||||
data: FileItem
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { h, ref } from 'vue'
|
||||
import { Message, Modal } from '@arco-design/web-vue'
|
||||
import ModalContent from './ModalContent.vue'
|
||||
import { type FileItem, updateFile } from '@/apis'
|
||||
import { type FileItem, updateFile } from '@/apis/system'
|
||||
|
||||
export function openFileRenameModal(data: FileItem, callback?: () => void) {
|
||||
const ModalContentRef = ref<InstanceType<typeof ModalContent>>()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import Player from 'xgplayer'
|
||||
import type { FileItem } from '@/apis'
|
||||
import type { FileItem } from '@/apis/system'
|
||||
|
||||
interface Props {
|
||||
data: FileItem
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { h } from 'vue'
|
||||
import { Modal } from '@arco-design/web-vue'
|
||||
import ModalContent from './ModalContent.vue'
|
||||
import type { FileItem } from '@/apis'
|
||||
import type { FileItem } from '@/apis/system'
|
||||
|
||||
export function previewFileVideoModal(data: FileItem) {
|
||||
return Modal.open({
|
||||
|
||||
@@ -24,7 +24,7 @@ import { LegendComponent, TitleComponent, TooltipComponent } from 'echarts/compo
|
||||
import { CanvasRenderer } from 'echarts/renderers'
|
||||
import { FileTypeList } from '@/constant/file'
|
||||
import { useChart } from '@/hooks'
|
||||
import { type FileStatisticsResp, getFileStatistics } from '@/apis'
|
||||
import { type FileStatisticsResp, getFileStatistics } from '@/apis/system'
|
||||
import { formatFileSize } from '@/utils'
|
||||
|
||||
use([TitleComponent, TooltipComponent, LegendComponent, PieChart, CanvasRenderer])
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<script setup lang="ts">
|
||||
import FileImage from './FileImage.vue'
|
||||
import FileRightMenu from './FileRightMenu.vue'
|
||||
import type { FileItem } from '@/apis'
|
||||
import type { FileItem } from '@/apis/system'
|
||||
|
||||
interface Props {
|
||||
data?: FileItem[]
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { FileIcon, ImageTypes } from '@/constant/file'
|
||||
import type { FileItem } from '@/apis'
|
||||
import type { FileItem } from '@/apis/system'
|
||||
|
||||
interface Props {
|
||||
data: FileItem
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
import type { TableInstance, TableRowSelection } from '@arco-design/web-vue'
|
||||
import FileImage from './FileImage.vue'
|
||||
import FileRightMenu from './FileRightMenu.vue'
|
||||
import type { FileItem } from '@/apis'
|
||||
import type { FileItem } from '@/apis/system'
|
||||
import { formatFileSize } from '@/utils'
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import type { FileItem } from '@/apis'
|
||||
import type { FileItem } from '@/apis/system'
|
||||
import { encodeByBase64 } from '@/utils/encrypt'
|
||||
|
||||
const emit = defineEmits(['download'])
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<script setup lang="ts">
|
||||
import GiOption from '@/components/GiOption/index.vue'
|
||||
import GiOptionItem from '@/components/GiOptionItem/index.vue'
|
||||
import type { FileItem } from '@/apis'
|
||||
import type { FileItem } from '@/apis/system'
|
||||
|
||||
interface Props {
|
||||
data?: FileItem
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { computed, ref } from 'vue'
|
||||
import type { FileItem } from '@/apis'
|
||||
import type { FileItem } from '@/apis/system'
|
||||
|
||||
type Mode = 'grid' | 'list'
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
<script setup lang="ts">
|
||||
import { type FormInstance, Message } from '@arco-design/web-vue'
|
||||
import { mapTree } from 'xe-utils'
|
||||
import { type MenuResp, addMenu, getMenu, updateMenu } from '@/apis'
|
||||
import { type MenuResp, addMenu, getMenu, updateMenu } from '@/apis/system'
|
||||
import { useForm } from '@/hooks'
|
||||
import { filterTree, transformPathToName } from '@/utils'
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import MenuAddModal from './MenuAddModal.vue'
|
||||
import { type MenuQuery, type MenuResp, deleteMenu, listMenu } from '@/apis'
|
||||
import { type MenuQuery, type MenuResp, deleteMenu, listMenu } from '@/apis/system'
|
||||
import type GiTable from '@/components/GiTable/index.vue'
|
||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
||||
import { DisEnableStatusList } from '@/constant/common'
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
import { type FormInstance, Message } from '@arco-design/web-vue'
|
||||
import { MdEditor } from 'md-editor-v3'
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { addNotice, getNotice, updateNotice } from '@/apis'
|
||||
import { addNotice, getNotice, updateNotice } from '@/apis/system'
|
||||
import { useForm } from '@/hooks'
|
||||
import { useDict } from '@/hooks/app'
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<script setup lang="ts">
|
||||
import { MdPreview } from 'md-editor-v3'
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { type NoticeResp, getNotice } from '@/apis'
|
||||
import { type NoticeResp, getNotice } from '@/apis/system'
|
||||
|
||||
const { width } = useWindowSize()
|
||||
const dataDetail = ref<NoticeResp>()
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<script lang="ts" setup>
|
||||
import NoticeAddModal from './NoticeAddModal.vue'
|
||||
import NoticeDetailModal from './NoticeDetailModal.vue'
|
||||
import { type NoticeQuery, type NoticeResp, deleteNotice, listNotice } from '@/apis'
|
||||
import { type NoticeQuery, type NoticeResp, deleteNotice, listNotice } from '@/apis/system'
|
||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
||||
import { useTable } from '@/hooks'
|
||||
import { useDict } from '@/hooks/app'
|
||||
|
||||
@@ -23,7 +23,7 @@ import { Message } from '@arco-design/web-vue'
|
||||
import AiEditor from '../components/edit/index.vue'
|
||||
import { useTabsStore } from '@/stores'
|
||||
import { type Columns, GiForm, type Options } from '@/components/GiForm'
|
||||
import { addNotice, getNotice, updateNotice } from '@/apis'
|
||||
import { addNotice, getNotice, updateNotice } from '@/apis/system'
|
||||
import { useForm } from '@/hooks'
|
||||
import { useDict } from '@/hooks/app'
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<script setup lang="tsx">
|
||||
import AiEditor from '../components/detail/index.vue'
|
||||
import { useTabsStore } from '@/stores'
|
||||
import { getNotice } from '@/apis'
|
||||
import { getNotice } from '@/apis/system'
|
||||
import { useForm } from '@/hooks'
|
||||
|
||||
const containerRef = ref<HTMLElement | null>()
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
<script setup lang="ts">
|
||||
import { type FormInstance, Message, type TreeNodeData } from '@arco-design/web-vue'
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { addRole, getRole, updateRole } from '@/apis'
|
||||
import { addRole, getRole, updateRole } from '@/apis/system'
|
||||
import { useForm } from '@/hooks'
|
||||
import { useDept, useDict, useMenu } from '@/hooks/app'
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { type RoleDetailResp, getRole } from '@/apis'
|
||||
import { type RoleDetailResp, getRole } from '@/apis/system'
|
||||
import { useDept, useDict, useMenu } from '@/hooks/app'
|
||||
|
||||
const { width } = useWindowSize()
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<script setup lang="ts">
|
||||
import { type FormInstance, Message, type TreeNodeData } from '@arco-design/web-vue'
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { addRole, getRole, updateRole } from '@/apis'
|
||||
import { addRole, getRole, updateRole } from '@/apis/system'
|
||||
import { useForm } from '@/hooks'
|
||||
import { useDept, useDict, useMenu } from '@/hooks/app'
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
import RoleUpdateDrawer from './RoleUpdateDrawer.vue'
|
||||
import RoleDetailDrawer from './RoleDetailDrawer.vue'
|
||||
import RoleAddModal from './RoleAddModal.vue'
|
||||
import { type RoleQuery, type RoleResp, deleteRole, listRole } from '@/apis'
|
||||
import { type RoleQuery, type RoleResp, deleteRole, listRole } from '@/apis/system'
|
||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
||||
import { useTable } from '@/hooks'
|
||||
import { useDict } from '@/hooks/app'
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
<script setup lang="ts">
|
||||
import { type FormInstance, Message } from '@arco-design/web-vue'
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { addStorage, getStorage, updateStorage } from '@/apis'
|
||||
import { addStorage, getStorage, updateStorage } from '@/apis/system'
|
||||
import { useForm } from '@/hooks'
|
||||
import { useDict } from '@/hooks/app'
|
||||
import { encryptByRsa } from '@/utils/encrypt'
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import StorageAddDrawer from './StorageAddDrawer.vue'
|
||||
import { type StorageQuery, type StorageResp, deleteStorage, listStorage } from '@/apis'
|
||||
import { type StorageQuery, type StorageResp, deleteStorage, listStorage } from '@/apis/system'
|
||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
||||
import { useTable } from '@/hooks'
|
||||
import { useDict } from '@/hooks/app'
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
<script setup lang="ts">
|
||||
import { type FormInstance, Message, type TreeNodeData } from '@arco-design/web-vue'
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { addUser, getUser, updateUser } from '@/apis'
|
||||
import { addUser, getUser, updateUser } from '@/apis/system'
|
||||
import type { Gender, Status } from '@/types/global'
|
||||
import { useForm } from '@/hooks'
|
||||
import { useDept, useRole } from '@/hooks/app'
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { type UserDetailResp, getUser } from '@/apis'
|
||||
import { type UserDetailResp, getUser } from '@/apis/system'
|
||||
|
||||
const { width } = useWindowSize()
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<script setup lang="ts">
|
||||
import { type FormInstance, Message, type RequestOption } from '@arco-design/web-vue'
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { type UserImportResp, downloadImportUserTemplate, importUser, parseImportUser } from '@/apis'
|
||||
import { type UserImportResp, downloadImportUserTemplate, importUser, parseImportUser } from '@/apis/system'
|
||||
import { useDownload, useForm } from '@/hooks'
|
||||
|
||||
const emit = defineEmits<{
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Message } from '@arco-design/web-vue'
|
||||
import { resetUserPwd } from '@/apis'
|
||||
import { resetUserPwd } from '@/apis/system'
|
||||
import { type Columns, GiForm } from '@/components/GiForm'
|
||||
import { useForm } from '@/hooks'
|
||||
import { encryptByRsa } from '@/utils/encrypt'
|
||||
|
||||
@@ -96,7 +96,7 @@ import UserAddDrawer from './UserAddDrawer.vue'
|
||||
import UserImportDrawer from './UserImportDrawer.vue'
|
||||
import UserDetailDrawer from './UserDetailDrawer.vue'
|
||||
import UserResetPwdModal from './UserResetPwdModal.vue'
|
||||
import { type UserQuery, type UserResp, deleteUser, exportUser, listUser } from '@/apis'
|
||||
import { type UserQuery, type UserResp, deleteUser, exportUser, listUser } from '@/apis/system'
|
||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
||||
import { useDownload, useTable } from '@/hooks'
|
||||
import { isMobile } from '@/utils'
|
||||
|
||||
Reference in New Issue
Block a user