Browse Source

[Refactor][UI] Refactor workflow definition version using NSpace component. (#11420)

3.1.0-release
songjianet 2 years ago committed by GitHub
parent
commit
20b87ee761
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      dolphinscheduler-ui/src/views/projects/workflow/definition/components/use-table.ts
  2. 10
      dolphinscheduler-ui/src/views/projects/workflow/definition/components/version-modal.tsx
  3. 34
      dolphinscheduler-ui/src/views/projects/workflow/definition/index.module.scss

4
dolphinscheduler-ui/src/views/projects/workflow/definition/components/use-table.ts

@ -107,7 +107,7 @@ export function useTable(
{ {
circle: true, circle: true,
type: 'info', type: 'info',
size: 'tiny', size: 'small',
disabled: _row.version === variables.row.version disabled: _row.version === variables.row.version
}, },
{ {
@ -139,7 +139,7 @@ export function useTable(
{ {
circle: true, circle: true,
type: 'error', type: 'error',
size: 'tiny', size: 'small',
disabled: _row.version === variables.row.version disabled: _row.version === variables.row.version
}, },
{ {

10
dolphinscheduler-ui/src/views/projects/workflow/definition/components/version-modal.tsx

@ -20,9 +20,8 @@ import { useI18n } from 'vue-i18n'
import { useForm } from './use-form' import { useForm } from './use-form'
import { useModal } from './use-modal' import { useModal } from './use-modal'
import { useTable } from './use-table' import { useTable } from './use-table'
import { NDataTable, NPagination } from 'naive-ui' import { NDataTable, NPagination, NSpace } from 'naive-ui'
import Modal from '@/components/modal' import Modal from '@/components/modal'
import styles from '../index.module.scss'
import type { IDefinitionData } from '../types' import type { IDefinitionData } from '../types'
const props = { const props = {
@ -100,22 +99,23 @@ export default defineComponent({
onCancel={this.hideModal} onCancel={this.hideModal}
onConfirm={this.hideModal} onConfirm={this.hideModal}
> >
<NSpace vertical>
<NDataTable <NDataTable
loading={loadingRef} loading={loadingRef}
columns={this.columns} columns={this.columns}
data={this.tableData} data={this.tableData}
striped striped
size={'small'} size={'small'}
class={styles.table}
/> />
<div class={styles.pagination}> <NSpace justify='center'>
<NPagination <NPagination
v-model:page={this.page} v-model:page={this.page}
v-model:page-size={this.pageSize} v-model:page-size={this.pageSize}
page-count={this.totalPage} page-count={this.totalPage}
onUpdatePage={requestData} onUpdatePage={requestData}
/> />
</div> </NSpace>
</NSpace>
</Modal> </Modal>
) )
} }

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

@ -15,40 +15,6 @@
* limitations under the License. * limitations under the License.
*/ */
.table {
table {
width: 100%;
tr {
height: 40px;
font-size: 12px;
th,
td {
&:nth-child(1) {
width: 50px;
text-align: center;
}
}
th {
&:nth-child(1) {
width: 60px;
text-align: center;
}
> span {
font-size: 12px;
color: #555;
}
}
}
}
}
.pagination {
display: flex;
justify-content: center;
align-items: center;
margin-top: 20px;
}
.startup { .startup {
align-items: center; align-items: center;
> div:first-child { > div:first-child {

Loading…
Cancel
Save