diff --git a/frontend/__test__/components/footer.spec.ts b/frontend/__test__/components/footer.spec.ts index c8c5a43eaf..fbbb3f81f2 100644 --- a/frontend/__test__/components/footer.spec.ts +++ b/frontend/__test__/components/footer.spec.ts @@ -1,6 +1,6 @@ import { mount } from '@vue/test-utils'; import { describe, expect, test } from 'vitest'; -import Footer from '@/components/footer/index.vue'; +import Footer from '@/components/pure/footer/index.vue'; describe('Footer', () => { test('renders the correct text', () => { diff --git a/frontend/src/__test__/table.spec.ts b/frontend/__test__/components/table.spec.ts similarity index 86% rename from frontend/src/__test__/table.spec.ts rename to frontend/__test__/components/table.spec.ts index 1670df1918..7335f7ef59 100644 --- a/frontend/src/__test__/table.spec.ts +++ b/frontend/__test__/components/table.spec.ts @@ -1,9 +1,9 @@ import { mount } from '@vue/test-utils'; import { describe, expect, test } from 'vitest'; -import MsBaseTable from '@/components/ms-table/base-table.vue'; +import MsBaseTable from '@/components/pure/ms-table/base-table.vue'; import { nextTick } from 'vue'; -import { MsTableColumn } from '@/components/ms-table/type'; -import useTable from '@/components/ms-table/useTable'; +import { MsTableColumn } from '@/components/pure/ms-table/type'; +import useTable from '@/components/pure/ms-table/useTable'; import { getTableList } from '@/api/modules/api-test/index'; const columns: MsTableColumn = [ @@ -71,7 +71,6 @@ describe('MS-Table', () => { test('init table with useTable', async () => { const { propsRes, propsEvent, loadList, setProps } = useTable(getTableList, { columns, - pagination: { current: 1, pageSize: 1 }, }); const wrapper = mount(MsBaseTable, { @@ -85,7 +84,7 @@ describe('MS-Table', () => { expect(propsRes.value.data.length).toBe(2); expect(content).toBe('e7bd7179-d63a-43a5-1a65-218473ee69ca'); - setProps({ pagination: { current: 2, pageSize: 1 } }); + setProps({}); loadList(); await nextTick(); diff --git a/frontend/components.d.ts b/frontend/components.d.ts index 0c52a8c177..e126c83e40 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -5,57 +5,57 @@ // Read more: https://github.com/vuejs/core/pull/3399 import '@vue/runtime-core' -export {}; +export {} declare module '@vue/runtime-core' { export interface GlobalComponents { - AAffix: typeof import('@arco-design/web-vue')['Affix']; - AAlert: typeof import('@arco-design/web-vue')['Alert']; - AAvatar: typeof import('@arco-design/web-vue')['Avatar']; - ABadge: typeof import('@arco-design/web-vue')['Badge']; - ABreadcrumb: typeof import('@arco-design/web-vue')['Breadcrumb']; - ABreadcrumbItem: typeof import('@arco-design/web-vue')['BreadcrumbItem']; - AButton: typeof import('@arco-design/web-vue')['Button']; - ACard: typeof import('@arco-design/web-vue')['Card']; - ACardMeta: typeof import('@arco-design/web-vue')['CardMeta']; - ACol: typeof import('@arco-design/web-vue')['Col']; - AConfigProvider: typeof import('@arco-design/web-vue')['ConfigProvider']; - ADivider: typeof import('@arco-design/web-vue')['Divider']; - ADoption: typeof import('@arco-design/web-vue')['Doption']; - ADrawer: typeof import('@arco-design/web-vue')['Drawer']; - ADropdown: typeof import('@arco-design/web-vue')['Dropdown']; - AInputNumber: typeof import('@arco-design/web-vue')['InputNumber']; - ALayout: typeof import('@arco-design/web-vue')['Layout']; - ALayoutContent: typeof import('@arco-design/web-vue')['LayoutContent']; - ALayoutFooter: typeof import('@arco-design/web-vue')['LayoutFooter']; - ALayoutSider: typeof import('@arco-design/web-vue')['LayoutSider']; - ALink: typeof import('@arco-design/web-vue')['Link']; - AList: typeof import('@arco-design/web-vue')['List']; - AListItem: typeof import('@arco-design/web-vue')['ListItem']; - AListItemMeta: typeof import('@arco-design/web-vue')['ListItemMeta']; - AMenu: typeof import('@arco-design/web-vue')['Menu']; - AMenuItem: typeof import('@arco-design/web-vue')['MenuItem']; - AModal: typeof import('@arco-design/web-vue')['Modal']; - AOption: typeof import('@arco-design/web-vue')['Option']; - APagination: typeof import('@arco-design/web-vue')['Pagination']; - APopover: typeof import('@arco-design/web-vue')['Popover']; - AResult: typeof import('@arco-design/web-vue')['Result']; - ARow: typeof import('@arco-design/web-vue')['Row']; - ASelect: typeof import('@arco-design/web-vue')['Select']; - ASkeleton: typeof import('@arco-design/web-vue')['Skeleton']; - ASkeletonLine: typeof import('@arco-design/web-vue')['SkeletonLine']; - ASkeletonShape: typeof import('@arco-design/web-vue')['SkeletonShape']; - ASpace: typeof import('@arco-design/web-vue')['Space']; - ASpin: typeof import('@arco-design/web-vue')['Spin']; - ASubMenu: typeof import('@arco-design/web-vue')['SubMenu']; - ASwitch: typeof import('@arco-design/web-vue')['Switch']; - ATabPane: typeof import('@arco-design/web-vue')['TabPane']; - ATabs: typeof import('@arco-design/web-vue')['Tabs']; - ATag: typeof import('@arco-design/web-vue')['Tag']; - ATooltip: typeof import('@arco-design/web-vue')['Tooltip']; - ATypographyParagraph: typeof import('@arco-design/web-vue')['TypographyParagraph']; - ATypographyText: typeof import('@arco-design/web-vue')['TypographyText']; - RouterLink: typeof import('vue-router')['RouterLink']; - RouterView: typeof import('vue-router')['RouterView']; + AAffix: typeof import('@arco-design/web-vue')['Affix'] + AAlert: typeof import('@arco-design/web-vue')['Alert'] + AAvatar: typeof import('@arco-design/web-vue')['Avatar'] + ABadge: typeof import('@arco-design/web-vue')['Badge'] + ABreadcrumb: typeof import('@arco-design/web-vue')['Breadcrumb'] + ABreadcrumbItem: typeof import('@arco-design/web-vue')['BreadcrumbItem'] + AButton: typeof import('@arco-design/web-vue')['Button'] + ACard: typeof import('@arco-design/web-vue')['Card'] + ACardMeta: typeof import('@arco-design/web-vue')['CardMeta'] + ACol: typeof import('@arco-design/web-vue')['Col'] + AConfigProvider: typeof import('@arco-design/web-vue')['ConfigProvider'] + ADivider: typeof import('@arco-design/web-vue')['Divider'] + ADoption: typeof import('@arco-design/web-vue')['Doption'] + ADrawer: typeof import('@arco-design/web-vue')['Drawer'] + ADropdown: typeof import('@arco-design/web-vue')['Dropdown'] + AInputNumber: typeof import('@arco-design/web-vue')['InputNumber'] + ALayout: typeof import('@arco-design/web-vue')['Layout'] + ALayoutContent: typeof import('@arco-design/web-vue')['LayoutContent'] + ALayoutFooter: typeof import('@arco-design/web-vue')['LayoutFooter'] + ALayoutSider: typeof import('@arco-design/web-vue')['LayoutSider'] + ALink: typeof import('@arco-design/web-vue')['Link'] + AList: typeof import('@arco-design/web-vue')['List'] + AListItem: typeof import('@arco-design/web-vue')['ListItem'] + AListItemMeta: typeof import('@arco-design/web-vue')['ListItemMeta'] + AMenu: typeof import('@arco-design/web-vue')['Menu'] + AMenuItem: typeof import('@arco-design/web-vue')['MenuItem'] + AModal: typeof import('@arco-design/web-vue')['Modal'] + AOption: typeof import('@arco-design/web-vue')['Option'] + APagination: typeof import('@arco-design/web-vue')['Pagination'] + APopover: typeof import('@arco-design/web-vue')['Popover'] + AResult: typeof import('@arco-design/web-vue')['Result'] + ARow: typeof import('@arco-design/web-vue')['Row'] + ASelect: typeof import('@arco-design/web-vue')['Select'] + ASkeleton: typeof import('@arco-design/web-vue')['Skeleton'] + ASkeletonLine: typeof import('@arco-design/web-vue')['SkeletonLine'] + ASkeletonShape: typeof import('@arco-design/web-vue')['SkeletonShape'] + ASpace: typeof import('@arco-design/web-vue')['Space'] + ASpin: typeof import('@arco-design/web-vue')['Spin'] + ASubMenu: typeof import('@arco-design/web-vue')['SubMenu'] + ASwitch: typeof import('@arco-design/web-vue')['Switch'] + ATabPane: typeof import('@arco-design/web-vue')['TabPane'] + ATabs: typeof import('@arco-design/web-vue')['Tabs'] + ATag: typeof import('@arco-design/web-vue')['Tag'] + ATooltip: typeof import('@arco-design/web-vue')['Tooltip'] + ATypographyParagraph: typeof import('@arco-design/web-vue')['TypographyParagraph'] + ATypographyText: typeof import('@arco-design/web-vue')['TypographyText'] + RouterLink: typeof import('vue-router')['RouterLink'] + RouterView: typeof import('vue-router')['RouterView'] } } diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 716fc6304e..01e71a01ae 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -2,7 +2,6 @@ - @@ -10,9 +9,8 @@ import { computed } from 'vue'; import enUS from '@arco-design/web-vue/es/locale/lang/en-us'; import zhCN from '@arco-design/web-vue/es/locale/lang/zh-cn'; - import GlobalSetting from '@/components/global-setting/index.vue'; + import GlobalSetting from '@/components/pure/global-setting/index.vue'; import useLocale from '@/locale/useLocale'; - import ThemeBox from '@/components/theme-box/index.vue'; const { currentLocale } = useLocale(); const locale = computed(() => { diff --git a/frontend/src/api/modules/api-test/index.ts b/frontend/src/api/modules/api-test/index.ts index 16465d66a5..442566745c 100644 --- a/frontend/src/api/modules/api-test/index.ts +++ b/frontend/src/api/modules/api-test/index.ts @@ -1,13 +1,13 @@ import MSR from '@/api/http/index'; import { GetApiTestList, GetApiTestListUrl } from '@/api/requrls/api-test'; -import { QueryParams } from '@/components/ms-table/useTable'; +import { QueryParams } from '@/models/common'; import { ApiTestListI } from '@/models/api-test'; export function getTableList(params: QueryParams) { - const { current, pageSize } = params; + const { current, pageSize, sort, filter, keyword } = params; return MSR.post({ url: GetApiTestList, - data: { current, pageSize, projectId: 'test-project-id' }, + data: { current, pageSize, sort, filter, keyword, projectId: 'test-project-id' }, }); } diff --git a/frontend/src/components/ms-table/base-table.vue b/frontend/src/components/ms-table/base-table.vue deleted file mode 100644 index d5c5e7915e..0000000000 --- a/frontend/src/components/ms-table/base-table.vue +++ /dev/null @@ -1,15 +0,0 @@ - - - diff --git a/frontend/src/components/ms-table/locale/en-US.ts b/frontend/src/components/ms-table/locale/en-US.ts deleted file mode 100644 index 0dbf930a82..0000000000 --- a/frontend/src/components/ms-table/locale/en-US.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default { - msTable: {}, -}; diff --git a/frontend/src/components/ms-table/locale/zh-CN.ts b/frontend/src/components/ms-table/locale/zh-CN.ts deleted file mode 100644 index 0dbf930a82..0000000000 --- a/frontend/src/components/ms-table/locale/zh-CN.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default { - msTable: {}, -}; diff --git a/frontend/src/components/ace-editor/index.vue b/frontend/src/components/pure/ace-editor/index.vue similarity index 100% rename from frontend/src/components/ace-editor/index.vue rename to frontend/src/components/pure/ace-editor/index.vue diff --git a/frontend/src/components/breadcrumb/index.vue b/frontend/src/components/pure/breadcrumb/index.vue similarity index 100% rename from frontend/src/components/breadcrumb/index.vue rename to frontend/src/components/pure/breadcrumb/index.vue diff --git a/frontend/src/components/chart/index.vue b/frontend/src/components/pure/chart/index.vue similarity index 100% rename from frontend/src/components/chart/index.vue rename to frontend/src/components/pure/chart/index.vue diff --git a/frontend/src/components/flow-editor/index.vue b/frontend/src/components/pure/flow-editor/index.vue similarity index 100% rename from frontend/src/components/flow-editor/index.vue rename to frontend/src/components/pure/flow-editor/index.vue diff --git a/frontend/src/components/footer/index.vue b/frontend/src/components/pure/footer/index.vue similarity index 100% rename from frontend/src/components/footer/index.vue rename to frontend/src/components/pure/footer/index.vue diff --git a/frontend/src/components/global-setting/block.vue b/frontend/src/components/pure/global-setting/block.vue similarity index 100% rename from frontend/src/components/global-setting/block.vue rename to frontend/src/components/pure/global-setting/block.vue diff --git a/frontend/src/components/global-setting/form-wrapper.vue b/frontend/src/components/pure/global-setting/form-wrapper.vue similarity index 100% rename from frontend/src/components/global-setting/form-wrapper.vue rename to frontend/src/components/pure/global-setting/form-wrapper.vue diff --git a/frontend/src/components/global-setting/index.vue b/frontend/src/components/pure/global-setting/index.vue similarity index 100% rename from frontend/src/components/global-setting/index.vue rename to frontend/src/components/pure/global-setting/index.vue diff --git a/frontend/src/components/jsonpath-picker/index.vue b/frontend/src/components/pure/jsonpath-picker/index.vue similarity index 100% rename from frontend/src/components/jsonpath-picker/index.vue rename to frontend/src/components/pure/jsonpath-picker/index.vue diff --git a/frontend/src/components/menu/index.vue b/frontend/src/components/pure/menu/index.vue similarity index 100% rename from frontend/src/components/menu/index.vue rename to frontend/src/components/pure/menu/index.vue diff --git a/frontend/src/components/menu/use-menu-tree.ts b/frontend/src/components/pure/menu/use-menu-tree.ts similarity index 100% rename from frontend/src/components/menu/use-menu-tree.ts rename to frontend/src/components/pure/menu/use-menu-tree.ts diff --git a/frontend/src/components/message-box/index.vue b/frontend/src/components/pure/message-box/index.vue similarity index 100% rename from frontend/src/components/message-box/index.vue rename to frontend/src/components/pure/message-box/index.vue diff --git a/frontend/src/components/message-box/list.vue b/frontend/src/components/pure/message-box/list.vue similarity index 100% rename from frontend/src/components/message-box/list.vue rename to frontend/src/components/pure/message-box/list.vue diff --git a/frontend/src/components/message-box/locale/en-US.ts b/frontend/src/components/pure/message-box/locale/en-US.ts similarity index 100% rename from frontend/src/components/message-box/locale/en-US.ts rename to frontend/src/components/pure/message-box/locale/en-US.ts diff --git a/frontend/src/components/message-box/locale/zh-CN.ts b/frontend/src/components/pure/message-box/locale/zh-CN.ts similarity index 100% rename from frontend/src/components/message-box/locale/zh-CN.ts rename to frontend/src/components/pure/message-box/locale/zh-CN.ts diff --git a/frontend/src/components/minder-editor/locale/en-US.ts b/frontend/src/components/pure/minder-editor/locale/en-US.ts similarity index 100% rename from frontend/src/components/minder-editor/locale/en-US.ts rename to frontend/src/components/pure/minder-editor/locale/en-US.ts diff --git a/frontend/src/components/minder-editor/locale/zh-CN.ts b/frontend/src/components/pure/minder-editor/locale/zh-CN.ts similarity index 100% rename from frontend/src/components/minder-editor/locale/zh-CN.ts rename to frontend/src/components/pure/minder-editor/locale/zh-CN.ts diff --git a/frontend/src/components/minder-editor/main/header.vue b/frontend/src/components/pure/minder-editor/main/header.vue similarity index 100% rename from frontend/src/components/minder-editor/main/header.vue rename to frontend/src/components/pure/minder-editor/main/header.vue diff --git a/frontend/src/components/minder-editor/main/mainEditor.vue b/frontend/src/components/pure/minder-editor/main/mainEditor.vue similarity index 100% rename from frontend/src/components/minder-editor/main/mainEditor.vue rename to frontend/src/components/pure/minder-editor/main/mainEditor.vue diff --git a/frontend/src/components/minder-editor/main/navigator.vue b/frontend/src/components/pure/minder-editor/main/navigator.vue similarity index 100% rename from frontend/src/components/minder-editor/main/navigator.vue rename to frontend/src/components/pure/minder-editor/main/navigator.vue diff --git a/frontend/src/components/minder-editor/menu/edit/editDel.vue b/frontend/src/components/pure/minder-editor/menu/edit/editDel.vue similarity index 100% rename from frontend/src/components/minder-editor/menu/edit/editDel.vue rename to frontend/src/components/pure/minder-editor/menu/edit/editDel.vue diff --git a/frontend/src/components/minder-editor/menu/edit/editMenu.vue b/frontend/src/components/pure/minder-editor/menu/edit/editMenu.vue similarity index 100% rename from frontend/src/components/minder-editor/menu/edit/editMenu.vue rename to frontend/src/components/pure/minder-editor/menu/edit/editMenu.vue diff --git a/frontend/src/components/minder-editor/menu/edit/expand.vue b/frontend/src/components/pure/minder-editor/menu/edit/expand.vue similarity index 100% rename from frontend/src/components/minder-editor/menu/edit/expand.vue rename to frontend/src/components/pure/minder-editor/menu/edit/expand.vue diff --git a/frontend/src/components/minder-editor/menu/edit/insertBox.vue b/frontend/src/components/pure/minder-editor/menu/edit/insertBox.vue similarity index 100% rename from frontend/src/components/minder-editor/menu/edit/insertBox.vue rename to frontend/src/components/pure/minder-editor/menu/edit/insertBox.vue diff --git a/frontend/src/components/minder-editor/menu/edit/moveBox.vue b/frontend/src/components/pure/minder-editor/menu/edit/moveBox.vue similarity index 100% rename from frontend/src/components/minder-editor/menu/edit/moveBox.vue rename to frontend/src/components/pure/minder-editor/menu/edit/moveBox.vue diff --git a/frontend/src/components/minder-editor/menu/edit/progressBox.vue b/frontend/src/components/pure/minder-editor/menu/edit/progressBox.vue similarity index 100% rename from frontend/src/components/minder-editor/menu/edit/progressBox.vue rename to frontend/src/components/pure/minder-editor/menu/edit/progressBox.vue diff --git a/frontend/src/components/minder-editor/menu/edit/selection.vue b/frontend/src/components/pure/minder-editor/menu/edit/selection.vue similarity index 100% rename from frontend/src/components/minder-editor/menu/edit/selection.vue rename to frontend/src/components/pure/minder-editor/menu/edit/selection.vue diff --git a/frontend/src/components/minder-editor/menu/edit/sequenceBox.vue b/frontend/src/components/pure/minder-editor/menu/edit/sequenceBox.vue similarity index 100% rename from frontend/src/components/minder-editor/menu/edit/sequenceBox.vue rename to frontend/src/components/pure/minder-editor/menu/edit/sequenceBox.vue diff --git a/frontend/src/components/minder-editor/menu/edit/tagBox.vue b/frontend/src/components/pure/minder-editor/menu/edit/tagBox.vue similarity index 100% rename from frontend/src/components/minder-editor/menu/edit/tagBox.vue rename to frontend/src/components/pure/minder-editor/menu/edit/tagBox.vue diff --git a/frontend/src/components/minder-editor/menu/view/arrange.vue b/frontend/src/components/pure/minder-editor/menu/view/arrange.vue similarity index 100% rename from frontend/src/components/minder-editor/menu/view/arrange.vue rename to frontend/src/components/pure/minder-editor/menu/view/arrange.vue diff --git a/frontend/src/components/minder-editor/menu/view/fontOperation.vue b/frontend/src/components/pure/minder-editor/menu/view/fontOperation.vue similarity index 100% rename from frontend/src/components/minder-editor/menu/view/fontOperation.vue rename to frontend/src/components/pure/minder-editor/menu/view/fontOperation.vue diff --git a/frontend/src/components/minder-editor/menu/view/mold.vue b/frontend/src/components/pure/minder-editor/menu/view/mold.vue similarity index 100% rename from frontend/src/components/minder-editor/menu/view/mold.vue rename to frontend/src/components/pure/minder-editor/menu/view/mold.vue diff --git a/frontend/src/components/minder-editor/menu/view/styleOperation.vue b/frontend/src/components/pure/minder-editor/menu/view/styleOperation.vue similarity index 100% rename from frontend/src/components/minder-editor/menu/view/styleOperation.vue rename to frontend/src/components/pure/minder-editor/menu/view/styleOperation.vue diff --git a/frontend/src/components/minder-editor/menu/view/viewMenu.vue b/frontend/src/components/pure/minder-editor/menu/view/viewMenu.vue similarity index 100% rename from frontend/src/components/minder-editor/menu/view/viewMenu.vue rename to frontend/src/components/pure/minder-editor/menu/view/viewMenu.vue diff --git a/frontend/src/components/minder-editor/minderEditor.vue b/frontend/src/components/pure/minder-editor/minderEditor.vue similarity index 100% rename from frontend/src/components/minder-editor/minderEditor.vue rename to frontend/src/components/pure/minder-editor/minderEditor.vue diff --git a/frontend/src/components/minder-editor/props.ts b/frontend/src/components/pure/minder-editor/props.ts similarity index 100% rename from frontend/src/components/minder-editor/props.ts rename to frontend/src/components/pure/minder-editor/props.ts diff --git a/frontend/src/components/minder-editor/script/editor.ts b/frontend/src/components/pure/minder-editor/script/editor.ts similarity index 100% rename from frontend/src/components/minder-editor/script/editor.ts rename to frontend/src/components/pure/minder-editor/script/editor.ts diff --git a/frontend/src/components/minder-editor/script/expose-editor.ts b/frontend/src/components/pure/minder-editor/script/expose-editor.ts similarity index 100% rename from frontend/src/components/minder-editor/script/expose-editor.ts rename to frontend/src/components/pure/minder-editor/script/expose-editor.ts diff --git a/frontend/src/components/minder-editor/script/protocol/freemind.ts b/frontend/src/components/pure/minder-editor/script/protocol/freemind.ts similarity index 100% rename from frontend/src/components/minder-editor/script/protocol/freemind.ts rename to frontend/src/components/pure/minder-editor/script/protocol/freemind.ts diff --git a/frontend/src/components/minder-editor/script/protocol/json.ts b/frontend/src/components/pure/minder-editor/script/protocol/json.ts similarity index 100% rename from frontend/src/components/minder-editor/script/protocol/json.ts rename to frontend/src/components/pure/minder-editor/script/protocol/json.ts diff --git a/frontend/src/components/minder-editor/script/protocol/markdown.ts b/frontend/src/components/pure/minder-editor/script/protocol/markdown.ts similarity index 100% rename from frontend/src/components/minder-editor/script/protocol/markdown.ts rename to frontend/src/components/pure/minder-editor/script/protocol/markdown.ts diff --git a/frontend/src/components/minder-editor/script/protocol/plain.ts b/frontend/src/components/pure/minder-editor/script/protocol/plain.ts similarity index 100% rename from frontend/src/components/minder-editor/script/protocol/plain.ts rename to frontend/src/components/pure/minder-editor/script/protocol/plain.ts diff --git a/frontend/src/components/minder-editor/script/protocol/png.ts b/frontend/src/components/pure/minder-editor/script/protocol/png.ts similarity index 100% rename from frontend/src/components/minder-editor/script/protocol/png.ts rename to frontend/src/components/pure/minder-editor/script/protocol/png.ts diff --git a/frontend/src/components/minder-editor/script/protocol/svg.ts b/frontend/src/components/pure/minder-editor/script/protocol/svg.ts similarity index 100% rename from frontend/src/components/minder-editor/script/protocol/svg.ts rename to frontend/src/components/pure/minder-editor/script/protocol/svg.ts diff --git a/frontend/src/components/minder-editor/script/runtime/clipboard-mimetype.ts b/frontend/src/components/pure/minder-editor/script/runtime/clipboard-mimetype.ts similarity index 100% rename from frontend/src/components/minder-editor/script/runtime/clipboard-mimetype.ts rename to frontend/src/components/pure/minder-editor/script/runtime/clipboard-mimetype.ts diff --git a/frontend/src/components/minder-editor/script/runtime/clipboard.ts b/frontend/src/components/pure/minder-editor/script/runtime/clipboard.ts similarity index 100% rename from frontend/src/components/minder-editor/script/runtime/clipboard.ts rename to frontend/src/components/pure/minder-editor/script/runtime/clipboard.ts diff --git a/frontend/src/components/minder-editor/script/runtime/container.ts b/frontend/src/components/pure/minder-editor/script/runtime/container.ts similarity index 100% rename from frontend/src/components/minder-editor/script/runtime/container.ts rename to frontend/src/components/pure/minder-editor/script/runtime/container.ts diff --git a/frontend/src/components/minder-editor/script/runtime/drag.ts b/frontend/src/components/pure/minder-editor/script/runtime/drag.ts similarity index 100% rename from frontend/src/components/minder-editor/script/runtime/drag.ts rename to frontend/src/components/pure/minder-editor/script/runtime/drag.ts diff --git a/frontend/src/components/minder-editor/script/runtime/exports.ts b/frontend/src/components/pure/minder-editor/script/runtime/exports.ts similarity index 100% rename from frontend/src/components/minder-editor/script/runtime/exports.ts rename to frontend/src/components/pure/minder-editor/script/runtime/exports.ts diff --git a/frontend/src/components/minder-editor/script/runtime/fsm.ts b/frontend/src/components/pure/minder-editor/script/runtime/fsm.ts similarity index 100% rename from frontend/src/components/minder-editor/script/runtime/fsm.ts rename to frontend/src/components/pure/minder-editor/script/runtime/fsm.ts diff --git a/frontend/src/components/minder-editor/script/runtime/history.ts b/frontend/src/components/pure/minder-editor/script/runtime/history.ts similarity index 100% rename from frontend/src/components/minder-editor/script/runtime/history.ts rename to frontend/src/components/pure/minder-editor/script/runtime/history.ts diff --git a/frontend/src/components/minder-editor/script/runtime/hotbox.ts b/frontend/src/components/pure/minder-editor/script/runtime/hotbox.ts similarity index 100% rename from frontend/src/components/minder-editor/script/runtime/hotbox.ts rename to frontend/src/components/pure/minder-editor/script/runtime/hotbox.ts diff --git a/frontend/src/components/minder-editor/script/runtime/input.ts b/frontend/src/components/pure/minder-editor/script/runtime/input.ts similarity index 100% rename from frontend/src/components/minder-editor/script/runtime/input.ts rename to frontend/src/components/pure/minder-editor/script/runtime/input.ts diff --git a/frontend/src/components/minder-editor/script/runtime/jumping.ts b/frontend/src/components/pure/minder-editor/script/runtime/jumping.ts similarity index 100% rename from frontend/src/components/minder-editor/script/runtime/jumping.ts rename to frontend/src/components/pure/minder-editor/script/runtime/jumping.ts diff --git a/frontend/src/components/minder-editor/script/runtime/minder.ts b/frontend/src/components/pure/minder-editor/script/runtime/minder.ts similarity index 100% rename from frontend/src/components/minder-editor/script/runtime/minder.ts rename to frontend/src/components/pure/minder-editor/script/runtime/minder.ts diff --git a/frontend/src/components/minder-editor/script/runtime/node.ts b/frontend/src/components/pure/minder-editor/script/runtime/node.ts similarity index 100% rename from frontend/src/components/minder-editor/script/runtime/node.ts rename to frontend/src/components/pure/minder-editor/script/runtime/node.ts diff --git a/frontend/src/components/minder-editor/script/runtime/priority.ts b/frontend/src/components/pure/minder-editor/script/runtime/priority.ts similarity index 100% rename from frontend/src/components/minder-editor/script/runtime/priority.ts rename to frontend/src/components/pure/minder-editor/script/runtime/priority.ts diff --git a/frontend/src/components/minder-editor/script/runtime/progress.ts b/frontend/src/components/pure/minder-editor/script/runtime/progress.ts similarity index 100% rename from frontend/src/components/minder-editor/script/runtime/progress.ts rename to frontend/src/components/pure/minder-editor/script/runtime/progress.ts diff --git a/frontend/src/components/minder-editor/script/runtime/receiver.ts b/frontend/src/components/pure/minder-editor/script/runtime/receiver.ts similarity index 100% rename from frontend/src/components/minder-editor/script/runtime/receiver.ts rename to frontend/src/components/pure/minder-editor/script/runtime/receiver.ts diff --git a/frontend/src/components/minder-editor/script/runtime/tag.ts b/frontend/src/components/pure/minder-editor/script/runtime/tag.ts similarity index 100% rename from frontend/src/components/minder-editor/script/runtime/tag.ts rename to frontend/src/components/pure/minder-editor/script/runtime/tag.ts diff --git a/frontend/src/components/minder-editor/script/store.ts b/frontend/src/components/pure/minder-editor/script/store.ts similarity index 100% rename from frontend/src/components/minder-editor/script/store.ts rename to frontend/src/components/pure/minder-editor/script/store.ts diff --git a/frontend/src/components/minder-editor/script/tool/debug.ts b/frontend/src/components/pure/minder-editor/script/tool/debug.ts similarity index 100% rename from frontend/src/components/minder-editor/script/tool/debug.ts rename to frontend/src/components/pure/minder-editor/script/tool/debug.ts diff --git a/frontend/src/components/minder-editor/script/tool/format.ts b/frontend/src/components/pure/minder-editor/script/tool/format.ts similarity index 100% rename from frontend/src/components/minder-editor/script/tool/format.ts rename to frontend/src/components/pure/minder-editor/script/tool/format.ts diff --git a/frontend/src/components/minder-editor/script/tool/key.ts b/frontend/src/components/pure/minder-editor/script/tool/key.ts similarity index 100% rename from frontend/src/components/minder-editor/script/tool/key.ts rename to frontend/src/components/pure/minder-editor/script/tool/key.ts diff --git a/frontend/src/components/minder-editor/script/tool/keymap.ts b/frontend/src/components/pure/minder-editor/script/tool/keymap.ts similarity index 100% rename from frontend/src/components/minder-editor/script/tool/keymap.ts rename to frontend/src/components/pure/minder-editor/script/tool/keymap.ts diff --git a/frontend/src/components/minder-editor/script/tool/useLocaleNotVue.ts b/frontend/src/components/pure/minder-editor/script/tool/useLocaleNotVue.ts similarity index 100% rename from frontend/src/components/minder-editor/script/tool/useLocaleNotVue.ts rename to frontend/src/components/pure/minder-editor/script/tool/useLocaleNotVue.ts diff --git a/frontend/src/components/minder-editor/script/tool/utils.ts b/frontend/src/components/pure/minder-editor/script/tool/utils.ts similarity index 100% rename from frontend/src/components/minder-editor/script/tool/utils.ts rename to frontend/src/components/pure/minder-editor/script/tool/utils.ts diff --git a/frontend/src/components/minder-editor/style/dropdown-list.less b/frontend/src/components/pure/minder-editor/style/dropdown-list.less similarity index 100% rename from frontend/src/components/minder-editor/style/dropdown-list.less rename to frontend/src/components/pure/minder-editor/style/dropdown-list.less diff --git a/frontend/src/components/minder-editor/style/editor.less b/frontend/src/components/pure/minder-editor/style/editor.less similarity index 100% rename from frontend/src/components/minder-editor/style/editor.less rename to frontend/src/components/pure/minder-editor/style/editor.less diff --git a/frontend/src/components/minder-editor/style/header.less b/frontend/src/components/pure/minder-editor/style/header.less similarity index 100% rename from frontend/src/components/minder-editor/style/header.less rename to frontend/src/components/pure/minder-editor/style/header.less diff --git a/frontend/src/components/minder-editor/style/hotbox.less b/frontend/src/components/pure/minder-editor/style/hotbox.less similarity index 100% rename from frontend/src/components/minder-editor/style/hotbox.less rename to frontend/src/components/pure/minder-editor/style/hotbox.less diff --git a/frontend/src/components/minder-editor/style/navigator.less b/frontend/src/components/pure/minder-editor/style/navigator.less similarity index 100% rename from frontend/src/components/minder-editor/style/navigator.less rename to frontend/src/components/pure/minder-editor/style/navigator.less diff --git a/frontend/src/components/pure/ms-table/base-table.vue b/frontend/src/components/pure/ms-table/base-table.vue new file mode 100644 index 0000000000..809c03abe5 --- /dev/null +++ b/frontend/src/components/pure/ms-table/base-table.vue @@ -0,0 +1,134 @@ + + + + + diff --git a/frontend/src/components/pure/ms-table/batchAction.vue b/frontend/src/components/pure/ms-table/batchAction.vue new file mode 100644 index 0000000000..1d02ec9ef6 --- /dev/null +++ b/frontend/src/components/pure/ms-table/batchAction.vue @@ -0,0 +1,31 @@ + + + diff --git a/frontend/src/components/ms-table/edit-table.vue b/frontend/src/components/pure/ms-table/edit-table.vue similarity index 100% rename from frontend/src/components/ms-table/edit-table.vue rename to frontend/src/components/pure/ms-table/edit-table.vue diff --git a/frontend/src/components/pure/ms-table/locale/en-US.ts b/frontend/src/components/pure/ms-table/locale/en-US.ts new file mode 100644 index 0000000000..27899e7ae3 --- /dev/null +++ b/frontend/src/components/pure/ms-table/locale/en-US.ts @@ -0,0 +1,19 @@ +export default { + msTable: { + current: 'Select Current Page', + all: 'Select All Pages', + batch: { + title: '批量操作', + selected: '已选择 {count} 项', + export: '导出', + edit: '编辑', + delete: '删除', + moveTo: '移动到', + copyTo: '复制到', + related: '关联需求', + generate: '生成依赖关系', + add: '添加到公用用例库', + clear: 'clear', + }, + }, +}; diff --git a/frontend/src/components/pure/ms-table/locale/zh-CN.ts b/frontend/src/components/pure/ms-table/locale/zh-CN.ts new file mode 100644 index 0000000000..9c2954455f --- /dev/null +++ b/frontend/src/components/pure/ms-table/locale/zh-CN.ts @@ -0,0 +1,19 @@ +export default { + msTable: { + current: '全选当前页', + all: '全选所有页', + batch: { + title: '批量操作', + selected: '已选择 {count} 项', + export: '导出', + edit: '编辑', + delete: '删除', + moveTo: '移动到', + copyTo: '复制到', + related: '关联需求', + generate: '生成依赖关系', + add: '添加到公用用例库', + clear: '清空', + }, + }, +}; diff --git a/frontend/src/components/pure/ms-table/select-all.vue b/frontend/src/components/pure/ms-table/select-all.vue new file mode 100644 index 0000000000..dddee40f8b --- /dev/null +++ b/frontend/src/components/pure/ms-table/select-all.vue @@ -0,0 +1,75 @@ + + + + + diff --git a/frontend/src/components/ms-table/type.ts b/frontend/src/components/pure/ms-table/type.ts similarity index 61% rename from frontend/src/components/ms-table/type.ts rename to frontend/src/components/pure/ms-table/type.ts index f02e1e8213..03895a3356 100644 --- a/frontend/src/components/ms-table/type.ts +++ b/frontend/src/components/pure/ms-table/type.ts @@ -1,13 +1,14 @@ -import { TableColumnData, TableData, TableDraggable } from '@arco-design/web-vue'; +import { TableColumnData, TableData, TableDraggable, TableChangeExtra } from '@arco-design/web-vue'; export interface MsPaginationI { - pageSize?: number; - total?: number; - current?: number; + current: number; + pageSize: number; + total: number; + showPageSize: boolean; } // 表格属性 -export interface MsTabelProps extends MsPaginationI { +export interface MsTabelProps { // 表格列 - 详见 TableColumn https://arco.design/web-vue/components/table-column; columns: TableColumnData[]; // 表格数据 - 详见 TableData https://arco.design/web-vue/components/table-data; @@ -20,6 +21,7 @@ export interface MsTabelProps extends MsPaginationI { y?: number | string; }; // 表格是否可拖拽 + enableDrag?: boolean; draggable?: TableDraggable; // 表格是否可编辑 editable?: boolean; @@ -29,6 +31,8 @@ export interface MsTabelProps extends MsPaginationI { sortable?: boolean; // 表格是否可选中 selectable?: boolean; + // 展示自定义全选 + showSelectAll?: boolean; // 表格是否可展开 expandable?: boolean; // 表格是否可固定表头 @@ -41,9 +45,28 @@ export interface MsTabelProps extends MsPaginationI { loading?: boolean; bordered?: boolean; // pagination - pagination?: MsPaginationI; + pagination: MsPaginationI | boolean; [key: string]: any; } +export interface MsTableSelectAll { + value: boolean; + total: number; + current: number; + type: 'all' | 'page'; +} + export type MsTableData = TableData[]; export type MsTableColumn = TableColumnData[]; +export type MSTableChangeExtra = TableChangeExtra; + +// eslint-disable-next-line no-shadow +export enum SelectAllEnum { + ALL = 'all', + CURRENT = 'current', + NONE = 'none', +} + +export interface SortItem { + [key: string]: string; +} diff --git a/frontend/src/components/ms-table/useTable.ts b/frontend/src/components/pure/ms-table/useTable.ts similarity index 55% rename from frontend/src/components/ms-table/useTable.ts rename to frontend/src/components/pure/ms-table/useTable.ts index fc3a24e043..07f58f2930 100644 --- a/frontend/src/components/ms-table/useTable.ts +++ b/frontend/src/components/pure/ms-table/useTable.ts @@ -1,9 +1,12 @@ // 核心的封装方法,详细参数看文档 https://arco.design/vue/component/table // hook/table-props.ts -import { ref, reactive } from 'vue'; +import { ref } from 'vue'; import { MsTabelProps, MsTableData, MsTableColumn } from './type'; import { ApiTestListI } from '@/models/api-test'; +import { TableData } from '@arco-design/web-vue'; +import dayjs from 'dayjs'; +import { QueryParams } from '@/models/common'; export interface Pagination { current: number; @@ -12,47 +15,62 @@ export interface Pagination { showPageSize: boolean; } -export interface QueryParams { - current: number; - pageSize: number; - [key: string]: any; -} - type GetListFunc = (v: QueryParams) => Promise; export default function useTbleProps(loadListFunc: GetListFunc, props?: Partial) { // 行选择 - const rowSelection = reactive({ + const rowSelection = { type: 'checkbox', - showCheckedAll: true, - onlyCurrent: false, - }); + showCheckedAll: false, + }; const defaultProps: MsTabelProps = { - 'bordered': true, - 'size': 'small', - 'scroll': { y: '550px', x: '1400px' }, - 'checkable': true, - 'expandable': false, - 'loading': true, - 'data': [] as MsTableData, - 'columns': [] as MsTableColumn, - 'pagination': { + bordered: true, + showPagination: true, + size: 'small', + scroll: { y: '550px', x: '1400px' }, + checkable: true, + loading: true, + data: [] as MsTableData, + columns: [] as MsTableColumn, + pagination: { current: 1, pageSize: 20, total: 0, showPageSize: true, } as Pagination, - 'draggable': { type: 'handle' }, - 'row-key': 'id', + rowKey: 'id', + selectedKeys: [], + selectedAll: false, + enableDrag: false, + showSelectAll: true, ...props, }; // 属性组 const propsRes = ref(defaultProps); + // 排序 + const sortItem = ref({}); + + // 筛选 + const filterItem = ref({}); + + // keyword + const keyword = ref(''); + + // 是否分页 + if (!propsRes.value.showPagination) { + propsRes.value.pagination = false; + } + // 是否可选中 if (propsRes.value.selectable) { - propsRes.value['row-selection'] = rowSelection; + propsRes.value.rowSelection = rowSelection; + } + + // 是否可拖拽 + if (propsRes.value.enableDrag) { + propsRes.value.draggable = { type: 'handle' }; } // 加载效果 @@ -72,9 +90,11 @@ export default function useTbleProps(loadListFunc: GetListFunc, props?: Partial< } const setPagination = ({ current, total }: SetPaginationPrams) => { - if (propsRes.value.pagination) { + if (propsRes.value.pagination && typeof propsRes.value.pagination === 'object') { propsRes.value.pagination.current = current; - if (total) propsRes.value.pagination.total = total; + if (total) { + propsRes.value.pagination.total = total; + } } }; @@ -93,6 +113,10 @@ export default function useTbleProps(loadListFunc: GetListFunc, props?: Partial< loadListParams.value = params || {}; }; + const setKeyword = (v: string) => { + keyword.value = v; + }; + // 加载分页列表数据 const loadList = async () => { const { current, pageSize } = propsRes.value.pagination as Pagination; @@ -100,9 +124,20 @@ export default function useTbleProps(loadListFunc: GetListFunc, props?: Partial< const data = await loadListFunc({ current, pageSize, - ...loadListParams.value, + sort: sortItem.value, + filter: filterItem.value, + keyword: keyword.value, + }); + const tmpArr = data.list as unknown as MsTableData; + propsRes.value.data = tmpArr.map((item: TableData) => { + if (item.updateTime) { + item.updateTime = dayjs(item.updateTime).format('YYYY-MM-DD HH:mm:ss'); + } + if (item.createTime) { + item.createTime = dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss'); + } + return item; }); - propsRes.value.data = data.list as unknown as MsTableData; setPagination({ current: data.current, total: data.total }); setLoading(false); return data; @@ -113,7 +148,14 @@ export default function useTbleProps(loadListFunc: GetListFunc, props?: Partial< // 排序触发 sorterChange: (dataIndex: string, direction: string) => { // eslint-disable-next-line no-console - console.log(dataIndex, direction); + sortItem.value = { [dataIndex]: direction }; + loadList(); + }, + + // 筛选触发 + filterChange: (dataIndex: string, filteredValues: string[]) => { + filterItem.value = { [dataIndex]: filteredValues }; + loadList(); }, // 分页触发 pageChange: (current: number) => { @@ -122,13 +164,23 @@ export default function useTbleProps(loadListFunc: GetListFunc, props?: Partial< }, // 修改每页显示条数 pageSizeChange: (pageSize: number) => { - if (propsRes.value.pagination) { + if (propsRes.value.pagination && typeof propsRes.value.pagination === 'object') { propsRes.value.pagination.pageSize = pageSize; } loadList(); }, + // 选择触发 + selectedChange: (arr: (string | number)[]) => { + if (arr.length === 0) { + propsRes.value.pagination = defaultProps.pagination; + } else { + propsRes.value.pagination = false; + } + + propsRes.value.selectedKeys = arr; + }, change: (_data: MsTableData) => { - if (propsRes.value.draggable) { + if (propsRes.value.draggable && _data instanceof Array) { // eslint-disable-next-line vue/require-explicit-emits propsRes.value.data = _data; } @@ -143,5 +195,6 @@ export default function useTbleProps(loadListFunc: GetListFunc, props?: Partial< loadList, setPagination, setLoadListParams, + setKeyword, }; } diff --git a/frontend/src/components/navbar/index.vue b/frontend/src/components/pure/navbar/index.vue similarity index 98% rename from frontend/src/components/navbar/index.vue rename to frontend/src/components/pure/navbar/index.vue index ce4d383629..f490c2b3bc 100644 --- a/frontend/src/components/navbar/index.vue +++ b/frontend/src/components/pure/navbar/index.vue @@ -142,9 +142,9 @@ import { LOCALE_OPTIONS } from '@/locale'; import useLocale from '@/locale/useLocale'; import useUser from '@/hooks/useUser'; - import Menu from '@/components/menu/index.vue'; + import Menu from '@/components/pure/menu/index.vue'; import MessageBox from '../message-box/index.vue'; - import ProjcetSelection from '@/components/project-selection/index.vue'; + import ProjcetSelection from '@/components/pure/project-selection/index.vue'; const appStore = useAppStore(); const userStore = useUserStore(); diff --git a/frontend/src/components/project-selection/index.vue b/frontend/src/components/pure/project-selection/index.vue similarity index 100% rename from frontend/src/components/project-selection/index.vue rename to frontend/src/components/pure/project-selection/index.vue diff --git a/frontend/src/components/svg-icon/index.vue b/frontend/src/components/pure/svg-icon/index.vue similarity index 100% rename from frontend/src/components/svg-icon/index.vue rename to frontend/src/components/pure/svg-icon/index.vue diff --git a/frontend/src/components/tab-bar/index.vue b/frontend/src/components/pure/tab-bar/index.vue similarity index 100% rename from frontend/src/components/tab-bar/index.vue rename to frontend/src/components/pure/tab-bar/index.vue diff --git a/frontend/src/components/tab-bar/readme.md b/frontend/src/components/pure/tab-bar/readme.md similarity index 100% rename from frontend/src/components/tab-bar/readme.md rename to frontend/src/components/pure/tab-bar/readme.md diff --git a/frontend/src/components/tab-bar/tab-item.vue b/frontend/src/components/pure/tab-bar/tab-item.vue similarity index 100% rename from frontend/src/components/tab-bar/tab-item.vue rename to frontend/src/components/pure/tab-bar/tab-item.vue diff --git a/frontend/src/components/theme-box/index.vue b/frontend/src/components/theme-box/index.vue deleted file mode 100644 index afe569fefa..0000000000 --- a/frontend/src/components/theme-box/index.vue +++ /dev/null @@ -1,275 +0,0 @@ - - - - - diff --git a/frontend/src/components/theme-box/interface.ts b/frontend/src/components/theme-box/interface.ts deleted file mode 100644 index 680635c81f..0000000000 --- a/frontend/src/components/theme-box/interface.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface ThemeData { - themeId: number; - themeName: string; - cover: string; - packageName: string; - unpkgHost: string; -} diff --git a/frontend/src/components/theme-box/locale/en-US.ts b/frontend/src/components/theme-box/locale/en-US.ts deleted file mode 100644 index 6a269f1e49..0000000000 --- a/frontend/src/components/theme-box/locale/en-US.ts +++ /dev/null @@ -1,17 +0,0 @@ -export default { - themeBox: { - currentTheme: 'Current theme', - autoUseTheme: 'Automatically use theme', - install: 'Install', - installTheme: 'Install theme', - search: 'Search', - installingTheme: 'Installing theme...', - installThemeSuccess: 'Install theme successfully! ', - installThemeError: 'Install theme failed, please try again! ', - resetTheme: 'Reset theme', - resetThemeSuccess: 'Reset theme successfully! ', - openInDesignLab: 'Open in the Design Lab', - noResult: 'No related themes', - createTheme: 'Go to the Design Lab to create', - }, -}; diff --git a/frontend/src/components/theme-box/locale/zh-CN.ts b/frontend/src/components/theme-box/locale/zh-CN.ts deleted file mode 100644 index 855c6df665..0000000000 --- a/frontend/src/components/theme-box/locale/zh-CN.ts +++ /dev/null @@ -1,17 +0,0 @@ -export default { - themeBox: { - currentTheme: '当前主题', - autoUseTheme: '自动应用主题', - install: '安装', - installTheme: '安装主题', - search: '搜索', - installingTheme: '正在安装主题...', - installThemeSuccess: '主题安装成功!', - installThemeError: '主题安装失败,请重试!', - resetTheme: '重置主题', - resetThemeSuccess: '重置主题成功!', - openInDesignLab: '在主题商店打开', - noResult: '没有相关主题', - createTheme: '前往主题商店创建', - }, -}; diff --git a/frontend/src/layout/default-layout.vue b/frontend/src/layout/default-layout.vue index 949fe91e6a..c6684957d4 100644 --- a/frontend/src/layout/default-layout.vue +++ b/frontend/src/layout/default-layout.vue @@ -48,10 +48,10 @@ import { ref, computed, watch, provide, onMounted } from 'vue'; import { useRouter, useRoute } from 'vue-router'; import { useAppStore, useUserStore } from '@/store'; - import NavBar from '@/components/navbar/index.vue'; - import Menu from '@/components/menu/index.vue'; - import Footer from '@/components/footer/index.vue'; - import TabBar from '@/components/tab-bar/index.vue'; + import NavBar from '@/components/pure/navbar/index.vue'; + import Menu from '@/components/pure/menu/index.vue'; + import Footer from '@/components/pure/footer/index.vue'; + import TabBar from '@/components/pure/tab-bar/index.vue'; import usePermission from '@/hooks/usePermission'; import useResponsive from '@/hooks/useResponsive'; import PageLayout from './page-layout.vue'; diff --git a/frontend/src/locale/en-US/index.ts b/frontend/src/locale/en-US/index.ts index 91a00ff7cf..ce6b29535c 100644 --- a/frontend/src/locale/en-US/index.ts +++ b/frontend/src/locale/en-US/index.ts @@ -1,38 +1,22 @@ import dayjsLocale from 'dayjs/locale/en'; import localeSettings from './settings'; import sys from './sys'; -import localeMessageBox from '@/components/message-box/locale/en-US'; -import minder from '@/components/minder-editor/locale/en-US'; +import localeMessageBox from '@/components/pure/message-box/locale/en-US'; +import minder from '@/components/pure/minder-editor/locale/en-US'; import localeLogin from '@/views/login/locale/en-US'; -import localeWorkplace from '@/views/dashboard/workplace/locale/en-US'; -import localeThemebox from '@/components/theme-box/locale/en-US'; +import localeTable from '@/components/pure/ms-table/locale/en-US'; import localeApiTest from '@/views/api-test/locale/en-US'; export default { message: { - 'menu.component': 'component hub', - 'menu.component.demo': 'component demo', - 'menu.apitest': 'Api Test', - 'menu.dashboard': 'Dashboard', - 'menu.minder': 'Minder', - 'menu.server.dashboard': 'Dashboard-Server', - 'menu.server.workplace': 'Workplace-Server', - 'menu.server.monitor': 'Monitor-Server', - 'menu.list': 'List', - 'menu.result': 'Result', - 'menu.exception': 'Exception', - 'menu.form': 'Form', - 'menu.profile': 'Profile', - 'menu.visualization': 'Data Visualization', - 'menu.user': 'User Center', + 'menu.apiTest': 'Api Test', 'navbar.action.locale': 'Switch to English', ...sys, ...localeSettings, ...localeMessageBox, ...localeLogin, - ...localeWorkplace, ...minder, - ...localeThemebox, + ...localeTable, ...localeApiTest, }, dayjsLocale, diff --git a/frontend/src/locale/zh-CN/index.ts b/frontend/src/locale/zh-CN/index.ts index 7a9bc1d1d5..4604f2522d 100644 --- a/frontend/src/locale/zh-CN/index.ts +++ b/frontend/src/locale/zh-CN/index.ts @@ -1,11 +1,10 @@ import dayjsLocale from 'dayjs/locale/zh-cn'; import localeSettings from './settings'; import sys from './sys'; -import localeMessageBox from '@/components/message-box/locale/zh-CN'; -import minder from '@/components/minder-editor/locale/zh-CN'; +import localeMessageBox from '@/components/pure/message-box/locale/zh-CN'; +import minder from '@/components/pure/minder-editor/locale/zh-CN'; import localeLogin from '@/views/login/locale/zh-CN'; -import localeWorkplace from '@/views/dashboard/workplace/locale/zh-CN'; -import localeThemebox from '@/components/theme-box/locale/zh-CN'; +import localeTable from '@/components/pure/ms-table/locale/zh-CN'; import localeApiTest from '@/views/api-test/locale/zh-CN'; export default { @@ -30,9 +29,8 @@ export default { ...localeSettings, ...localeMessageBox, ...localeLogin, - ...localeWorkplace, ...minder, - ...localeThemebox, + ...localeTable, ...localeApiTest, }, dayjsLocale, diff --git a/frontend/src/main.ts b/frontend/src/main.ts index e8d51542a1..d68392654e 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -1,8 +1,8 @@ import { createApp } from 'vue'; import FormCreate from '@form-create/arco-design'; import ArcoVueIcon from '@arco-design/web-vue/es/icon'; -import SvgIcon from '@/components/svg-icon/index.vue'; -import Breadcrumb from '@/components/breadcrumb/index.vue'; +import SvgIcon from '@/components/pure/svg-icon/index.vue'; +import Breadcrumb from '@/components/pure/breadcrumb/index.vue'; import router from './router'; import store from './store'; import { setupI18n } from './locale'; diff --git a/frontend/src/mock/index.ts b/frontend/src/mock/index.ts index d889ac6675..f398564034 100644 --- a/frontend/src/mock/index.ts +++ b/frontend/src/mock/index.ts @@ -4,8 +4,6 @@ import './user'; import './message-box'; import './api-test'; -import '@/views/dashboard/workplace/mock'; - Mock.setup({ timeout: '600-1000', }); diff --git a/frontend/src/mock/user.ts b/frontend/src/mock/user.ts index 11240698ad..8f733b7f84 100644 --- a/frontend/src/mock/user.ts +++ b/frontend/src/mock/user.ts @@ -65,59 +65,20 @@ setupMock({ Mock.mock(new RegExp('/api/user/menu'), () => { const menuList = [ { - path: '/dashboard', - name: 'dashboard', + path: '/api-test', + name: 'apiTest', meta: { - locale: 'menu.server.dashboard', - icon: 'icon-dashboard', - order: 1, - }, - children: [ - { - path: 'workplace', - name: 'Workplace', - meta: { - locale: 'menu.server.workplace', - }, - }, - ], - }, - { - path: '/minder', - name: 'minder', - redirect: '/minder/index', - meta: { - locale: 'menu.minder', + locale: 'menu.apiTest', icon: 'icon-dashboard', order: 0, - hideChildrenInMenu: true, }, children: [ { - path: 'index', - name: 'minder', + path: 'list', + name: 'apiTest', + component: () => import('@/views/api-test/index.vue'), meta: { - locale: 'menu.minder', - roles: ['*'], - }, - }, - ], - }, - { - path: '/component', - name: 'component', - meta: { - locale: 'menu.component', - roles: ['*'], - order: 1, - icon: 'icon-common', - }, - children: [ - { - path: 'form-create', - name: 'form-create', - meta: { - locale: 'menu.component.demo', + locale: 'menu.apiTest', roles: ['*'], icon: 'icon-computer', }, diff --git a/frontend/src/models/api-test.ts b/frontend/src/models/api-test.ts index d9308fffe6..85e7d899d6 100644 --- a/frontend/src/models/api-test.ts +++ b/frontend/src/models/api-test.ts @@ -13,6 +13,12 @@ export interface ListItemI { content: string; } +export interface SortItem { + [key: string]: string; +} +export interface FilterItem { + [key: string]: any; +} export interface ApiTestListI { [x: string]: any; pageSize: number; diff --git a/frontend/src/models/common.ts b/frontend/src/models/common.ts index 84ecd77b0a..6b5c68216b 100644 --- a/frontend/src/models/common.ts +++ b/frontend/src/models/common.ts @@ -5,3 +5,18 @@ export default interface CommonReponse { messageDetail: string; data: T; } + +// 表格查询 +export interface QueryParams { + // 当前页 + current: number; + // 每页条数 + pageSize: number; + // 排序仅针对单个字段 + sort?: object; + // 表头筛选 + filter?: object; + // 查询条件 + keyword?: string; + [key: string]: any; +} diff --git a/frontend/src/router/routes/modules/dashboard.ts b/frontend/src/router/routes/modules/api-test.ts similarity index 60% rename from frontend/src/router/routes/modules/dashboard.ts rename to frontend/src/router/routes/modules/api-test.ts index b5c1430f1a..93a48baf54 100644 --- a/frontend/src/router/routes/modules/dashboard.ts +++ b/frontend/src/router/routes/modules/api-test.ts @@ -1,22 +1,22 @@ import { DEFAULT_LAYOUT } from '../base'; import { AppRouteRecordRaw } from '../types'; -const DASHBOARD: AppRouteRecordRaw = { - path: '/dashboard', - name: 'dashboard', +const ApiTest: AppRouteRecordRaw = { + path: '/api-test', + name: 'apiTest', component: DEFAULT_LAYOUT, meta: { - locale: 'menu.dashboard', + locale: 'menu.apiTest', icon: 'icon-dashboard', order: 0, }, children: [ { - path: 'workplace', - name: 'Workplace', + path: 'list', + name: 'apiTest', component: () => import('@/views/api-test/index.vue'), meta: { - locale: 'menu.dashboard.workplace', + locale: 'menu.apiTest', roles: ['*'], icon: 'icon-computer', }, @@ -24,4 +24,4 @@ const DASHBOARD: AppRouteRecordRaw = { ], }; -export default DASHBOARD; +export default ApiTest; diff --git a/frontend/src/router/routes/modules/components.ts b/frontend/src/router/routes/modules/components.ts deleted file mode 100644 index bf1b1fc63c..0000000000 --- a/frontend/src/router/routes/modules/components.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { DEFAULT_LAYOUT } from '../base'; -import { AppRouteRecordRaw } from '../types'; - -const components: AppRouteRecordRaw = { - path: '/component', - name: 'component', - component: DEFAULT_LAYOUT, - redirect: '/component/index', - meta: { - locale: 'menu.component.demo', - icon: 'icon-computer', - order: 1, - hideChildrenInMenu: true, - }, - children: [ - { - path: 'index', - name: 'component', - component: () => import('@/views/component/index.vue'), - meta: { - locale: 'menu.component.demo', - roles: ['*'], - }, - }, - ], -}; -export default components; diff --git a/frontend/src/views/api-test/index.vue b/frontend/src/views/api-test/index.vue index 3664604841..b0d7c3cc66 100644 --- a/frontend/src/views/api-test/index.vue +++ b/frontend/src/views/api-test/index.vue @@ -1,27 +1,38 @@ diff --git a/frontend/src/views/component/index.vue b/frontend/src/views/component/index.vue deleted file mode 100644 index 03404d1501..0000000000 --- a/frontend/src/views/component/index.vue +++ /dev/null @@ -1,42 +0,0 @@ - - - diff --git a/frontend/src/views/dashboard/workplace/components/announcement.vue b/frontend/src/views/dashboard/workplace/components/announcement.vue deleted file mode 100644 index fed5f9053f..0000000000 --- a/frontend/src/views/dashboard/workplace/components/announcement.vue +++ /dev/null @@ -1,71 +0,0 @@ - - - - - diff --git a/frontend/src/views/dashboard/workplace/components/banner.vue b/frontend/src/views/dashboard/workplace/components/banner.vue deleted file mode 100644 index 2dbfde7ec1..0000000000 --- a/frontend/src/views/dashboard/workplace/components/banner.vue +++ /dev/null @@ -1,34 +0,0 @@ - - - - - diff --git a/frontend/src/views/dashboard/workplace/components/carousel.vue b/frontend/src/views/dashboard/workplace/components/carousel.vue deleted file mode 100644 index 8d2319a082..0000000000 --- a/frontend/src/views/dashboard/workplace/components/carousel.vue +++ /dev/null @@ -1,24 +0,0 @@ - - - diff --git a/frontend/src/views/dashboard/workplace/components/categories-percent.vue b/frontend/src/views/dashboard/workplace/components/categories-percent.vue deleted file mode 100644 index 19ec8bad89..0000000000 --- a/frontend/src/views/dashboard/workplace/components/categories-percent.vue +++ /dev/null @@ -1,112 +0,0 @@ - - - diff --git a/frontend/src/views/dashboard/workplace/components/content-chart.vue b/frontend/src/views/dashboard/workplace/components/content-chart.vue deleted file mode 100644 index 12af918f36..0000000000 --- a/frontend/src/views/dashboard/workplace/components/content-chart.vue +++ /dev/null @@ -1,196 +0,0 @@ - - - diff --git a/frontend/src/views/dashboard/workplace/components/data-panel.vue b/frontend/src/views/dashboard/workplace/components/data-panel.vue deleted file mode 100644 index 6779a94b76..0000000000 --- a/frontend/src/views/dashboard/workplace/components/data-panel.vue +++ /dev/null @@ -1,104 +0,0 @@ - - - - - diff --git a/frontend/src/views/dashboard/workplace/components/docs.vue b/frontend/src/views/dashboard/workplace/components/docs.vue deleted file mode 100644 index 506fae25e7..0000000000 --- a/frontend/src/views/dashboard/workplace/components/docs.vue +++ /dev/null @@ -1,42 +0,0 @@ - - - diff --git a/frontend/src/views/dashboard/workplace/components/popular-content.vue b/frontend/src/views/dashboard/workplace/components/popular-content.vue deleted file mode 100644 index ebb8dfdc6c..0000000000 --- a/frontend/src/views/dashboard/workplace/components/popular-content.vue +++ /dev/null @@ -1,105 +0,0 @@ - - - - - diff --git a/frontend/src/views/dashboard/workplace/components/quick-operation.vue b/frontend/src/views/dashboard/workplace/components/quick-operation.vue deleted file mode 100644 index 93d014ab09..0000000000 --- a/frontend/src/views/dashboard/workplace/components/quick-operation.vue +++ /dev/null @@ -1,33 +0,0 @@ - - - diff --git a/frontend/src/views/dashboard/workplace/components/recently-visited.vue b/frontend/src/views/dashboard/workplace/components/recently-visited.vue deleted file mode 100644 index 805c4f7b23..0000000000 --- a/frontend/src/views/dashboard/workplace/components/recently-visited.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - - - diff --git a/frontend/src/views/dashboard/workplace/index.vue b/frontend/src/views/dashboard/workplace/index.vue deleted file mode 100644 index 6a2d310fd6..0000000000 --- a/frontend/src/views/dashboard/workplace/index.vue +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - diff --git a/frontend/src/views/dashboard/workplace/locale/en-US.ts b/frontend/src/views/dashboard/workplace/locale/en-US.ts deleted file mode 100644 index 5eef6ade5b..0000000000 --- a/frontend/src/views/dashboard/workplace/locale/en-US.ts +++ /dev/null @@ -1,38 +0,0 @@ -export default { - 'menu.dashboard.workplace': 'Workplace', - 'workplace.welcome': 'Welcome!', - 'workplace.balance': 'Balance (CNY)', - 'workplace.order.pending': 'Pending', - 'workplace.order.pendingRenewal': 'Renewal Order', - 'workplace.onlineContent': 'Online Content', - 'workplace.putIn': 'Put In', - 'workplace.newDay': 'Daily Additional Comments', - 'workplace.newFromYesterday': 'New From Yesterday', - 'workplace.minute': 'Min', - 'workplace.docs': 'Documents', - 'workplace.docs.productOverview': 'Product Overview', - 'workplace.docs.userGuide': 'User Guide', - 'workplace.docs.workflow': 'Workflow', - 'workplace.docs.interfaceDocs': 'Interface Docs', - // - 'workplace.contentManagement': 'Content Management', - 'workplace.contentStatistical': 'Content Statistical', - 'workplace.advanced': 'Advanced', - 'workplace.onlinePromotion': 'Online Promotion', - 'workplace.contentPutIn': 'Put In', - 'workplace.announcement': 'Announcement', - 'workplace.recently.visited': 'Recently Visited', - 'workplace.record.nodata': 'No data', - 'workplace.quick.operation': 'Quick Operation', - 'workplace.quickOperation.setup': 'Setup', - 'workplace.allProject': 'All', - 'workplace.loadMore': 'More', - 'workplace.viewMore': 'More', - 'workplace.contentData': 'Content Data', - 'workplace.popularContent': 'Popular Content', - 'workplace.popularContent.text': 'text', - 'workplace.popularContent.image': 'image', - 'workplace.popularContent.video': 'video', - 'workplace.categoriesPercent': 'Categories Percent', - 'workplace.pecs': 'pecs', -}; diff --git a/frontend/src/views/dashboard/workplace/locale/zh-CN.ts b/frontend/src/views/dashboard/workplace/locale/zh-CN.ts deleted file mode 100644 index 4eebcc815e..0000000000 --- a/frontend/src/views/dashboard/workplace/locale/zh-CN.ts +++ /dev/null @@ -1,37 +0,0 @@ -export default { - 'menu.dashboard.workplace': '工作台', - 'workplace.welcome': '欢迎回来!', - 'workplace.balance': '余额(元)', - 'workplace.order.pending': '待支付', - 'workplace.order.pendingRenewal': '待续费订单', - 'workplace.onlineContent': '线上总内容', - 'workplace.putIn': '投放中内容', - 'workplace.newDay': '日新增评论', - 'workplace.newFromYesterday': '较昨日新增', - 'workplace.minute': '分钟', - 'workplace.docs': '帮助文档', - 'workplace.docs.productOverview': '产品概要', - 'workplace.docs.userGuide': '使用指南', - 'workplace.docs.workflow': '接入流程', - 'workplace.docs.interfaceDocs': '接口文档', - 'workplace.contentManagement': '内容管理', - 'workplace.contentStatistical': '内容分析', - 'workplace.advanced': '高级管理', - 'workplace.onlinePromotion': '线上推广', - 'workplace.contentPutIn': '内容投放', - 'workplace.announcement': '公告', - 'workplace.recently.visited': '最近访问', - 'workplace.record.nodata': '暂无数据', - 'workplace.quick.operation': '快捷操作', - 'workplace.quickOperation.setup': '管理', - 'workplace.allProject': '所有项目', - 'workplace.loadMore': '加载更多', - 'workplace.viewMore': '查看更多', - 'workplace.contentData': '内容数据', - 'workplace.popularContent': '线上热门内容', - 'workplace.popularContent.text': '文本', - 'workplace.popularContent.image': '图片', - 'workplace.popularContent.video': '视频', - 'workplace.categoriesPercent': '内容类型占比', - 'workplace.pecs': '个', -}; diff --git a/frontend/src/views/dashboard/workplace/mock.ts b/frontend/src/views/dashboard/workplace/mock.ts deleted file mode 100644 index bbf1c5dd15..0000000000 --- a/frontend/src/views/dashboard/workplace/mock.ts +++ /dev/null @@ -1,129 +0,0 @@ -import Mock from 'mockjs'; -import qs from 'query-string'; -import dayjs from 'dayjs'; -import { GetParams } from '#/global'; -import setupMock, { successResponseWrap } from '@/utils/setup-mock'; - -const textList = [ - { - key: 1, - clickNumber: '346.3w+', - title: '经济日报:财政政策要精准提升…', - increases: 35, - }, - { - key: 2, - clickNumber: '324.2w+', - title: '双12遇冷,消费者厌倦了电商平…', - increases: 22, - }, - { - key: 3, - clickNumber: '318.9w+', - title: '致敬坚守战“疫”一线的社区工作…', - increases: 9, - }, - { - key: 4, - clickNumber: '257.9w+', - title: '普高还是职高?家长们陷入选择…', - increases: 17, - }, - { - key: 5, - clickNumber: '124.2w+', - title: '人民快评:没想到“浓眉大眼”的…', - increases: 37, - }, -]; -const imageList = [ - { - key: 1, - clickNumber: '15.3w+', - title: '杨涛接替陆慷出任外交部美大司…', - increases: 15, - }, - { - key: 2, - clickNumber: '12.2w+', - title: '图集:龙卷风袭击美国多州房屋…', - increases: 26, - }, - { - key: 3, - clickNumber: '18.9w+', - title: '52岁大姐贴钱照顾自闭症儿童八…', - increases: 9, - }, - { - key: 4, - clickNumber: '7.9w+', - title: '杭州一家三口公园宿营取暖中毒', - increases: 0, - }, - { - key: 5, - clickNumber: '5.2w+', - title: '派出所副所长威胁市民?警方调…', - increases: 4, - }, -]; -const videoList = [ - { - key: 1, - clickNumber: '367.6w+', - title: '这是今日10点的南京', - increases: 5, - }, - { - key: 2, - clickNumber: '352.2w+', - title: '立陶宛不断挑衅致经济受损民众…', - increases: 17, - }, - { - key: 3, - clickNumber: '348.9w+', - title: '韩国艺人刘在石确诊新冠', - increases: 30, - }, - { - key: 4, - clickNumber: '346.3w+', - title: '关于北京冬奥会,文在寅表态', - increases: 12, - }, - { - key: 5, - clickNumber: '271.2w+', - title: '95后现役军人荣立一等功', - increases: 2, - }, -]; -setupMock({ - setup() { - Mock.mock(new RegExp('/api/content-data'), () => { - const presetData = [58, 81, 53, 90, 64, 88, 49, 79]; - const getLineData = () => { - const count = 8; - return new Array(count).fill(0).map((el, idx) => ({ - x: dayjs() - .day(idx - 2) - .format('YYYY-MM-DD'), - y: presetData[idx], - })); - }; - return successResponseWrap([...getLineData()]); - }); - Mock.mock(new RegExp('/api/popular/list'), (params: GetParams) => { - const { type = 'text' } = qs.parseUrl(params.url).query; - if (type === 'image') { - return successResponseWrap([...videoList]); - } - if (type === 'video') { - return successResponseWrap([...imageList]); - } - return successResponseWrap([...textList]); - }); - }, -}); diff --git a/frontend/src/views/login/components/login-form.vue b/frontend/src/views/login/components/login-form.vue index ce2af14868..a48e19a145 100644 --- a/frontend/src/views/login/components/login-form.vue +++ b/frontend/src/views/login/components/login-form.vue @@ -103,7 +103,7 @@ await userStore.login(values as LoginData); const { redirect, ...othersQuery } = router.currentRoute.value.query; router.push({ - name: (redirect as string) || 'Workplace', + name: (redirect as string) || 'apiTest', query: { ...othersQuery, }, diff --git a/frontend/src/views/minder/index.vue b/frontend/src/views/minder/index.vue deleted file mode 100644 index 23867e8cb2..0000000000 --- a/frontend/src/views/minder/index.vue +++ /dev/null @@ -1,87 +0,0 @@ - - -