Skip to content

Commit 25ded1e

Browse files
authored
[Refactor][UI] Refactor rule manage using NSpace component. (#11069)
1 parent 28b40da commit 25ded1e

File tree

2 files changed

+28
-60
lines changed

2 files changed

+28
-60
lines changed

dolphinscheduler-ui/src/views/data-quality/rule/index.module.scss

Lines changed: 0 additions & 26 deletions
This file was deleted.

dolphinscheduler-ui/src/views/data-quality/rule/index.tsx

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,18 @@ import {
2222
NButton,
2323
NIcon,
2424
NDataTable,
25-
NPagination,
26-
NCard
25+
NPagination
2726
} from 'naive-ui'
2827
import { SearchOutlined } from '@vicons/antd'
2928
import { useTable } from './use-table'
3029
import Card from '@/components/card'
31-
import styles from './index.module.scss'
3230
import RuleModal from './components/rule-modal'
3331

3432
const TaskResult = defineComponent({
3533
name: 'rule',
3634
setup() {
3735
const { t, variables, getTableData } = useTable()
38-
3936
const showModalRef = ref(false)
40-
4137
const ruleEntryData = ref('')
4238

4339
const requestTableData = () => {
@@ -110,45 +106,43 @@ const TaskResult = defineComponent({
110106
const { columns } = useTable(viewRuleEntry)
111107

112108
return (
113-
<div>
114-
<NCard>
109+
<NSpace vertical>
110+
<Card>
115111
<NSpace justify='end'>
116112
<NInput
117-
allowInput={this.trim}
113+
allowInput={this.trim}
118114
v-model={[this.searchVal, 'value']}
119115
size='small'
120116
placeholder={t('data_quality.rule.name')}
121117
clearable
122118
/>
123119
<NButton size='small' type='primary' onClick={onSearch}>
124-
{{
125-
icon: () => (
126-
<NIcon>
127-
<SearchOutlined />
128-
</NIcon>
129-
)
130-
}}
120+
<NIcon>
121+
<SearchOutlined />
122+
</NIcon>
131123
</NButton>
132124
</NSpace>
133-
</NCard>
134-
<Card class={styles['table-card']}>
135-
<NDataTable
136-
loading={loadingRef}
137-
columns={columns}
138-
data={this.tableData}
139-
/>
140-
<div class={styles.pagination}>
141-
<NPagination
142-
v-model:page={this.page}
143-
v-model:page-size={this.pageSize}
144-
page-count={this.totalPage}
145-
show-size-picker
146-
page-sizes={[10, 30, 50]}
147-
show-quick-jumper
148-
onUpdatePage={requestTableData}
149-
onUpdatePageSize={onUpdatePageSize}
125+
</Card>
126+
<Card title={t('menu.rule')}>
127+
<NSpace vertical>
128+
<NDataTable
129+
loading={loadingRef}
130+
columns={columns}
131+
data={this.tableData}
150132
/>
151-
</div>
133+
<NSpace justify='center'>
134+
<NPagination
135+
v-model:page={this.page}
136+
v-model:page-size={this.pageSize}
137+
page-count={this.totalPage}
138+
show-size-picker
139+
page-sizes={[10, 30, 50]}
140+
show-quick-jumper
141+
onUpdatePage={requestTableData}
142+
onUpdatePageSize={onUpdatePageSize}
143+
/>
144+
</NSpace>
145+
</NSpace>
152146
</Card>
153147
{showModalRef && (
154148
<RuleModal
@@ -158,7 +152,7 @@ const TaskResult = defineComponent({
158152
data={ruleEntryData}
159153
/>
160154
)}
161-
</div>
155+
</NSpace>
162156
)
163157
}
164158
})

0 commit comments

Comments
 (0)