From 0f6da07db407988682ae5dafd8d2e6e6273a98e4 Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Mon, 24 Jun 2024 22:05:45 +0800 Subject: [PATCH] fix: missing key modules --- scripts/gen-index.js | 13 +++-- src/components/button/button.ts | 15 ------ src/components/date/DateTimeRangePicker.vue | 2 - src/components/date/RangePicker.vue | 2 - src/components/date/date.ts | 6 --- src/components/ds/DataSourceConnectType.vue | 1 - src/components/ds/DataSourceStatus.vue | 1 - src/components/ds/DataSourceType.vue | 1 - src/components/ds/useDataSource.ts | 6 +-- src/components/filter/FilterCondition.vue | 23 +------- src/components/index.ts | 50 ++++++++++++++++++ src/components/node/CreateEditNodeDialog.vue | 2 +- src/components/node/NodeForm.vue | 2 +- src/components/node/NodeRunners.vue | 1 - src/components/node/{node.ts => useNode.ts} | 3 +- .../project/CreateEditProjectDialog.vue | 2 +- src/components/project/ProjectForm.vue | 2 +- .../project/{project.ts => useProject.ts} | 11 +--- src/components/schedule/ScheduleCron.vue | 1 - src/components/schedule/ScheduleForm.vue | 4 +- src/components/schedule/useSchedule.ts | 14 ++--- .../spider/CreateEditSpiderDialog.vue | 2 +- src/components/spider/RunSpiderDialog.vue | 4 +- src/components/spider/SpiderForm.vue | 6 +-- .../spider/{spider.ts => useSpider.ts} | 7 --- src/components/tag/CheckTag.vue | 1 - src/components/tag/LinkTag.vue | 1 - src/components/tag/Tag.vue | 1 - src/components/tag/tag.ts | 19 ------- src/components/task/TaskCommand.vue | 4 +- src/components/task/TaskForm.vue | 4 +- src/components/task/TaskPriority.vue | 1 - src/components/task/TaskResults.vue | 2 - src/components/task/TaskStatus.vue | 2 - src/components/task/task.ts | 7 --- src/components/task/useTask.ts | 2 +- src/components/user/CreateEditUserDialog.vue | 2 +- src/components/user/UserForm.vue | 2 +- src/components/user/{user.ts => useUser.ts} | 11 ++-- src/directives/index.ts | 8 +-- src/interfaces/components/date/date.d.ts | 22 ++++++++ .../components/filter/FilterCondition.d.ts | 6 ++- src/interfaces/components/tag/tag.d.ts | 20 +++++++ .../components/task/TaskCommand.d.ts | 5 -- src/interfaces/components/task/TaskMode.d.ts | 3 -- .../components/task/TaskPriority.d.ts | 3 -- src/interfaces/models/index.d.ts | 1 - src/interfaces/models/tag.d.ts | 7 --- src/interfaces/views/task.d.ts | 11 +++- src/layouts/content/index.ts | 2 +- .../content/list/{list.ts => useList.ts} | 2 +- src/layouts/index.ts | 8 ++- src/package/make-installer.ts | 3 ++ src/utils/task.ts | 1 - src/views/deps/task/DependencyTaskList.vue | 1 - .../actions/GitDetailActionsSpiders.vue | 2 +- .../git/detail/tabs/GitDetailTabChanges.vue | 8 +-- src/views/index.ts | 52 ++++++++++++++++--- src/views/misc/MySettings.vue | 2 +- src/views/node/list/useNodeList.ts | 2 +- .../notification/list/useNotificationList.ts | 2 +- src/views/project/list/useProjectList.ts | 2 +- src/views/schedule/list/useScheduleList.ts | 6 +-- .../actions/SpiderDetailActionsCommon.vue | 2 +- .../actions/SpiderDetailActionsDataSource.vue | 2 +- .../detail/tabs/SpiderDetailTabData.vue | 2 +- src/views/spider/list/useSpiderList.ts | 4 +- .../detail/actions/TaskDetailActionsData.vue | 2 +- src/views/task/list/useTaskList.ts | 11 ++-- src/views/token/list/useTokenList.ts | 2 +- src/views/user/list/useUserList.ts | 4 +- 71 files changed, 230 insertions(+), 218 deletions(-) delete mode 100644 src/components/button/button.ts rename src/components/node/{node.ts => useNode.ts} (87%) rename src/components/project/{project.ts => useProject.ts} (82%) rename src/components/spider/{spider.ts => useSpider.ts} (88%) delete mode 100644 src/components/tag/tag.ts delete mode 100644 src/components/task/task.ts rename src/components/user/{user.ts => useUser.ts} (91%) create mode 100644 src/interfaces/components/date/date.d.ts create mode 100644 src/interfaces/components/tag/tag.d.ts delete mode 100644 src/interfaces/components/task/TaskCommand.d.ts delete mode 100644 src/interfaces/components/task/TaskMode.d.ts delete mode 100644 src/interfaces/components/task/TaskPriority.d.ts delete mode 100644 src/interfaces/models/tag.d.ts rename src/layouts/content/list/{list.ts => useList.ts} (98%) diff --git a/scripts/gen-index.js b/scripts/gen-index.js index 1babb5ea4cef2..beda406024d2a 100644 --- a/scripts/gen-index.js +++ b/scripts/gen-index.js @@ -49,13 +49,18 @@ function processFile(filePath, moduleName) { return { importLine, exportLine }; } else if ( filePath.endsWith('.ts') && - !['components', 'layouts', 'views'].includes(moduleName) && + // !['components', 'layouts', 'views'].includes(moduleName) && fileName !== INDEX_COMP_NAME ) { let compName = fileName.replace('.ts', ''); compName += compName === 'export' ? '_' : ''; - const importLine = `import ${compName} from '${relPath.replace('.ts', '')}';`; + let importLine; + if (compName.startsWith('use')) { + importLine = `import ${compName} from '${relPath.replace('.ts', '')}';`; + } else { + importLine = `import * as ${compName} from '${relPath.replace('.ts', '')}';`; + } const exportLine = `${compName} as ${compName},`; return { importLine, exportLine }; } @@ -141,9 +146,7 @@ function genRootIndex() { `export * from './src/utils';`, `export * from './src/constants';`, `export * from './src/layouts/content';`, - `export * from './src/components/form';`, - `export { default as useSpider } from './src/components/spider/spider';`, - `export { ClSpiderDetail } from './src/views';`, + `export * from './src/components/useForm';`, `export { installer as default } from './src/package';`, `export { default as useRequest } from './src/services/request';`, ]; diff --git a/src/components/button/button.ts b/src/components/button/button.ts deleted file mode 100644 index e3e719a0d2afa..0000000000000 --- a/src/components/button/button.ts +++ /dev/null @@ -1,15 +0,0 @@ -export interface ButtonProps { - tooltip?: string; - type?: BasicType; - size?: BasicSize; - round?: boolean; - circle?: boolean; - plain?: boolean; - disabled?: boolean; - isIcon?: boolean; - loading?: boolean; - onClick?: () => void; - className?: string; - id?: string; - noMargin?: boolean; -} diff --git a/src/components/date/DateTimeRangePicker.vue b/src/components/date/DateTimeRangePicker.vue index 695f8c6472844..cfdf18585c53e 100644 --- a/src/components/date/DateTimeRangePicker.vue +++ b/src/components/date/DateTimeRangePicker.vue @@ -20,8 +20,6 @@ interface RangeItemOption extends SelectOption { } type RangeItemKey = 'custom' | string; -type RangeItemValue = RangeItemValueFunc | DateRange; -type RangeItemValueFunc = () => DateRange; type RangePickerType = 'daterange' | 'datetimerange'; interface RangePickerProps { diff --git a/src/components/date/RangePicker.vue b/src/components/date/RangePicker.vue index 491e194f460bb..9c32b843b8657 100644 --- a/src/components/date/RangePicker.vue +++ b/src/components/date/RangePicker.vue @@ -18,8 +18,6 @@ interface RangeItemOption extends SelectOption { } type RangeItemKey = 'custom' | string; -type RangeItemValue = RangeItemValueFunc | DateRange; -type RangeItemValueFunc = () => DateRange; type RangePickerType = 'daterange' | 'datetimerange'; interface RangePickerProps { diff --git a/src/components/date/date.ts b/src/components/date/date.ts index 8c0c9b17aa891..50550ec2c5a42 100644 --- a/src/components/date/date.ts +++ b/src/components/date/date.ts @@ -1,9 +1,3 @@ -import { - RangeItemKey, - RangeItemOption, - RangeItemValue, -} from '@/components/date/RangePicker.vue'; - export const getRangeItemOption = ( label: string, key: RangeItemKey, diff --git a/src/components/ds/DataSourceConnectType.vue b/src/components/ds/DataSourceConnectType.vue index e8726ca434108..d3f89597bba68 100644 --- a/src/components/ds/DataSourceConnectType.vue +++ b/src/components/ds/DataSourceConnectType.vue @@ -7,7 +7,6 @@ import { DATA_SOURCE_CONNECT_TYPE_HOSTS, } from '@/constants/ds'; import { useI18n } from 'vue-i18n'; -import { TagProps } from '@/components/tag/tag'; const props = defineProps<{ dataSource?: DataSource; diff --git a/src/components/ds/DataSourceStatus.vue b/src/components/ds/DataSourceStatus.vue index d6969caa9ca56..3bba2696721ac 100644 --- a/src/components/ds/DataSourceStatus.vue +++ b/src/components/ds/DataSourceStatus.vue @@ -6,7 +6,6 @@ import { DATA_SOURCE_STATUS_ONLINE, } from '@/constants/ds'; import { useI18n } from 'vue-i18n'; -import { TagProps } from '@/components/tag/tag'; const props = withDefaults( defineProps<{ diff --git a/src/components/ds/DataSourceType.vue b/src/components/ds/DataSourceType.vue index db839e2fabc8b..2eaf294882da3 100644 --- a/src/components/ds/DataSourceType.vue +++ b/src/components/ds/DataSourceType.vue @@ -12,7 +12,6 @@ import { DATA_SOURCE_TYPE_KAFKA, } from '@/constants/ds'; import { useI18n } from 'vue-i18n'; -import { TagProps } from '@/components/tag/tag'; const props = defineProps<{ dataSource?: DataSource; diff --git a/src/components/ds/useDataSource.ts b/src/components/ds/useDataSource.ts index 54f9556f8face..b823fd4db2303 100644 --- a/src/components/ds/useDataSource.ts +++ b/src/components/ds/useDataSource.ts @@ -28,13 +28,13 @@ const t = translate; // form component data const formComponentData = getDefaultFormComponentData(); -export const useDataSource: any = (store: Store) => { +export const useDataSource = (store: Store) => { // store const ns = 'ds' as ListStoreNamespace; const { ds: state } = store.state as RootStoreState; // form rules - const formRules = readonly({}); + const formRules: FormRules = {}; // type options const typeOptions = readonly([ @@ -77,7 +77,7 @@ export const useDataSource: any = (store: Store) => { ); await store.dispatch(`${ns}/changePassword`, { id, password: value }); - await ElMessage.success(t('common.message.success.save')); + ElMessage.success(t('common.message.success.save')); }; // on connect type change diff --git a/src/components/filter/FilterCondition.vue b/src/components/filter/FilterCondition.vue index 7dc8c24bf9290..261c29ddf7ffd 100644 --- a/src/components/filter/FilterCondition.vue +++ b/src/components/filter/FilterCondition.vue @@ -1,27 +1,8 @@