forked from element-plus/element-plus
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Refactor code to enhance maintainability and readability
- Loading branch information
Showing
332 changed files
with
836 additions
and
506 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...ponents/ds/CreateEditDataSourceDialog.vue β ...ts/core/ds/CreateEditDataSourceDialog.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/components/ds/DataSourceForm.vue β src/components/core/ds/DataSourceForm.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...vironment/CreateEditEnvironmentDialog.vue β ...vironment/CreateEditEnvironmentDialog.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...omponents/environment/EnvironmentForm.vue β ...ents/core/environment/EnvironmentForm.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/components/environment/useEnvironment.ts β ...onents/core/environment/useEnvironment.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/components/git/CreateEditGitDialog.vue β ...mponents/core/git/CreateEditGitDialog.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/components/git/useGit.ts β src/components/core/git/useGit.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/components/node/CreateEditNodeDialog.vue β ...onents/core/node/CreateEditNodeDialog.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/components/node/NodeForm.vue β src/components/core/node/NodeForm.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/components/node/useNode.ts β src/components/core/node/useNode.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/components/core/notification/channel/CreateEditNotificationChannelDialog.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<script setup lang="ts"> | ||
import { useStore } from 'vuex'; | ||
import useNotificationChannel from '@/components/core/notification/channel/useNotificationChannel'; | ||
// store | ||
const store = useStore(); | ||
const { | ||
actionFunctions, | ||
activeDialogKey, | ||
confirmDisabled, | ||
confirmLoading, | ||
createEditDialogVisible, | ||
} = useNotificationChannel(store); | ||
defineOptions({ name: 'ClCreateEditNotificationChannelDialog' }); | ||
</script> | ||
|
||
<template> | ||
<cl-create-edit-dialog | ||
:type="activeDialogKey" | ||
:visible="createEditDialogVisible" | ||
:action-functions="actionFunctions" | ||
:confirm-disabled="confirmDisabled" | ||
:confirm-loading="confirmLoading" | ||
> | ||
<template #default> | ||
<cl-notification-channel-form /> | ||
</template> | ||
</cl-create-edit-dialog> | ||
</template> | ||
|
||
<style lang="scss" scoped></style> |
54 changes: 54 additions & 0 deletions
54
src/components/core/notification/channel/NotificationChannelForm.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<script setup lang="ts"> | ||
import { useI18n } from 'vue-i18n'; | ||
import { useStore } from 'vuex'; | ||
import useNotificationChannel from '@/components/core/notification/channel/useNotificationChannel'; | ||
defineProps<{ | ||
readonly?: boolean; | ||
}>(); | ||
// i18n | ||
const { t } = useI18n(); | ||
// store | ||
const store = useStore(); | ||
const { form, formRef, isSelectiveForm } = useNotificationChannel(store); | ||
defineOptions({ name: 'ClNotificationChannelForm' }); | ||
</script> | ||
|
||
<template> | ||
<cl-form v-if="form" ref="formRef" :model="form" :selective="isSelectiveForm"> | ||
<cl-form-item | ||
:span="2" | ||
:label="t('views.notification.channels.form.name')" | ||
prop="name" | ||
required | ||
> | ||
<el-input | ||
v-model="form.name" | ||
:placeholder="t('views.notification.channels.form.name')" | ||
/> | ||
</cl-form-item> | ||
<cl-form-item | ||
:span="2" | ||
:label="t('views.notification.channels.form.enabled')" | ||
prop="enabled" | ||
> | ||
<cl-switch v-model="form.enabled" /> | ||
</cl-form-item> | ||
<cl-form-item | ||
:span="4" | ||
:label="t('views.notification.channels.form.description')" | ||
prop="description" | ||
> | ||
<el-input | ||
v-model="form.description" | ||
type="textarea" | ||
:placeholder="t('views.notification.channels.form.description')" | ||
/> | ||
</cl-form-item> | ||
</cl-form> | ||
</template> | ||
|
||
<style scoped></style> |
33 changes: 33 additions & 0 deletions
33
src/components/core/notification/channel/useNotificationChannel.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { useRoute } from 'vue-router'; | ||
import { computed } from 'vue'; | ||
import { Store } from 'vuex'; | ||
import useForm from '@/components/ui/form/useForm'; | ||
import useNotificationChannelService from '@/services/notification/useNotificationChannelService'; | ||
import { getDefaultFormComponentData } from '@/utils/form'; | ||
|
||
// form component data | ||
const formComponentData = getDefaultFormComponentData<NotificationChannel>(); | ||
|
||
const useNotificationChannel = (store: Store<RootStoreState>) => { | ||
const { notificationChannel: state } = store.state as RootStoreState; | ||
// route | ||
const route = useRoute(); | ||
|
||
// notification id | ||
const id = computed(() => route.params.id); | ||
|
||
const form = computed(() => state.form); | ||
|
||
return { | ||
...useForm( | ||
'notificationChannel', | ||
store, | ||
useNotificationChannelService(store), | ||
formComponentData | ||
), | ||
id, | ||
form, | ||
}; | ||
}; | ||
|
||
export default useNotificationChannel; |
2 changes: 1 addition & 1 deletion
2
...n/CreateEditNotificationSettingDialog.vue β ...g/CreateEditNotificationSettingDialog.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../notification/NotificationSettingForm.vue β ...ation/setting/NotificationSettingForm.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ts/notification/useNotificationSetting.ts β ...ication/setting/useNotificationSetting.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...nents/project/CreateEditProjectDialog.vue β .../core/project/CreateEditProjectDialog.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/components/project/ProjectForm.vue β src/components/core/project/ProjectForm.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/components/project/useProject.ts β src/components/core/project/useProject.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...nts/schedule/CreateEditScheduleDialog.vue β ...ore/schedule/CreateEditScheduleDialog.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
src/components/schedule/ScheduleForm.vue β ...components/core/schedule/ScheduleForm.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/components/schedule/useSchedule.ts β src/components/core/schedule/useSchedule.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ponents/spider/CreateEditSpiderDialog.vue β ...ts/core/spider/CreateEditSpiderDialog.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/components/spider/RunSpiderDialog.vue β ...omponents/core/spider/RunSpiderDialog.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletions
9
src/components/spider/SpiderForm.vue β src/components/core/spider/SpiderForm.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/components/spider/useSpider.ts β src/components/core/spider/useSpider.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/components/task/CreateTaskDialog.vue β ...components/core/task/CreateTaskDialog.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.