Skip to content

Commit 1613401

Browse files
authored
[Refactor][UI] Refactor workflow definition timing using NSpace component. (#11415)
* [Refactor][UI] Refactor workflow definition timing using NSpace component. * [Refactor][UI] Refactor workflow definition timing using NSpace component.
1 parent 496c2d4 commit 1613401

2 files changed

Lines changed: 32 additions & 85 deletions

File tree

dolphinscheduler-ui/src/views/projects/workflow/definition/index.module.scss

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,6 @@
1515
* limitations under the License.
1616
*/
1717

18-
.content {
19-
width: 100%;
20-
21-
.card {
22-
margin-bottom: 8px;
23-
}
24-
25-
.header {
26-
display: flex;
27-
justify-content: space-between;
28-
align-items: center;
29-
margin: 10px 0;
30-
.right {
31-
> .search {
32-
.list {
33-
float: right;
34-
margin: 3px 0 3px 4px;
35-
}
36-
}
37-
}
38-
}
39-
}
40-
4118
.table {
4219
table {
4320
width: 100%;
@@ -79,37 +56,9 @@
7956
}
8057
}
8158

82-
.batch-button {
83-
position: absolute;
84-
bottom: 10px;
85-
left: 10px;
86-
> div {
87-
margin-right: 5px;
88-
}
89-
}
90-
9159
.formItem {
9260
white-space: nowrap;
9361
text-overflow: ellipsis;
9462
overflow: hidden;
9563
word-break: break-all;
9664
}
97-
98-
.workflow-name {
99-
:global {
100-
div:first-child {
101-
width: calc(100% - 32px);
102-
103-
.n-button,
104-
.n-button__content {
105-
width: 100%;
106-
span {
107-
padding-bottom: 1px;
108-
}
109-
}
110-
}
111-
}
112-
}
113-
.width-100 {
114-
width: 100%;
115-
}

dolphinscheduler-ui/src/views/projects/workflow/definition/timing/index.tsx

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@
1515
* limitations under the License.
1616
*/
1717

18-
import Card from '@/components/card'
1918
import { ArrowLeftOutlined } from '@vicons/antd'
20-
import { NButton, NDataTable, NIcon, NPagination } from 'naive-ui'
19+
import { NButton, NDataTable, NIcon, NPagination, NSpace } from 'naive-ui'
2120
import { defineComponent, onMounted, toRefs, watch } from 'vue'
2221
import { useI18n } from 'vue-i18n'
2322
import { useRouter } from 'vue-router'
24-
import type { Router } from 'vue-router'
2523
import { useTable } from './use-table'
24+
import Card from '@/components/card'
2625
import TimingModal from '../components/timing-modal'
27-
import styles from '../index.module.scss'
26+
import type { Router } from 'vue-router'
2827

2928
export default defineComponent({
3029
name: 'WorkflowDefinitionTiming',
@@ -76,46 +75,45 @@ export default defineComponent({
7675
const { loadingRef } = this
7776

7877
return (
79-
<div class={styles.content}>
80-
<Card class={styles.card}>
81-
<div class={styles.header}>
82-
<NButton type='primary' onClick={() => router.go(-1)}>
83-
<NIcon>
84-
<ArrowLeftOutlined />
85-
</NIcon>
86-
</NButton>
87-
</div>
78+
<NSpace vertical>
79+
<Card>
80+
<NButton type='primary' size='small' onClick={() => router.go(-1)}>
81+
<NIcon>
82+
<ArrowLeftOutlined />
83+
</NIcon>
84+
</NButton>
8885
</Card>
8986
<Card title={t('project.workflow.cron_manage')}>
90-
<NDataTable
91-
loading={loadingRef}
92-
columns={this.columns}
93-
data={this.tableData}
94-
striped
95-
size={'small'}
96-
class={styles.table}
97-
scrollX={this.tableWidth}
98-
/>
99-
<div class={styles.pagination}>
100-
<NPagination
101-
v-model:page={this.page}
102-
v-model:page-size={this.pageSize}
103-
page-count={this.totalPage}
104-
show-size-picker
105-
page-sizes={[10, 30, 50]}
106-
show-quick-jumper
107-
onUpdatePage={this.requestData}
108-
onUpdatePageSize={this.handleChangePageSize}
87+
<NSpace vertical>
88+
<NDataTable
89+
loading={loadingRef}
90+
columns={this.columns}
91+
data={this.tableData}
92+
striped
93+
size={'small'}
94+
scrollX={this.tableWidth}
10995
/>
110-
</div>
96+
<NSpace justify='center'>
97+
<NPagination
98+
v-model:page={this.page}
99+
v-model:page-size={this.pageSize}
100+
page-count={this.totalPage}
101+
show-size-picker
102+
page-sizes={[10, 30, 50]}
103+
show-quick-jumper
104+
onUpdatePage={this.requestData}
105+
onUpdatePageSize={this.handleChangePageSize}
106+
/>
107+
</NSpace>
108+
</NSpace>
111109
</Card>
112110
<TimingModal
113111
type={'update'}
114112
v-model:row={this.row}
115113
v-model:show={this.showRef}
116114
onUpdateList={this.handleUpdateList}
117115
/>
118-
</div>
116+
</NSpace>
119117
)
120118
}
121119
})

0 commit comments

Comments
 (0)