[Refactor][UI] Refactor task group option using NSpace component. (#11209)
This commit is contained in:
parent
e5cca0e79b
commit
163df5f1a3
|
|
@ -1,55 +0,0 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
.toolbar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 0 0 0;
|
||||
.left {
|
||||
align-items: center;
|
||||
}
|
||||
.right {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
button {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.table-card {
|
||||
margin-top: 2px;
|
||||
|
||||
.table-action {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
button {
|
||||
margin: 0 2px 0 0;
|
||||
}
|
||||
div {
|
||||
margin: 0 2px 0 0;
|
||||
}
|
||||
}
|
||||
.pagination {
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
|
@ -20,14 +20,13 @@ import {
|
|||
NButton,
|
||||
NIcon,
|
||||
NInput,
|
||||
NCard,
|
||||
NDataTable,
|
||||
NPagination
|
||||
NPagination,
|
||||
NSpace
|
||||
} from 'naive-ui'
|
||||
import Card from '@/components/card'
|
||||
import { SearchOutlined } from '@vicons/antd'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import styles from './index.module.scss'
|
||||
import { useTable } from './use-table'
|
||||
import FormModal from './components/form-modal'
|
||||
|
||||
|
|
@ -146,21 +145,19 @@ const taskGroupOption = defineComponent({
|
|||
const { columns } = useTable(updateItem, resetTableData)
|
||||
|
||||
return (
|
||||
<div>
|
||||
<NCard>
|
||||
<div class={styles.toolbar}>
|
||||
<div class={styles.left}>
|
||||
<NButton
|
||||
size='small'
|
||||
type={'primary'}
|
||||
onClick={() => this.onCreate()}
|
||||
>
|
||||
{t('resource.task_group_option.create')}
|
||||
</NButton>
|
||||
</div>
|
||||
<div class={styles.right}>
|
||||
<NSpace vertical>
|
||||
<Card>
|
||||
<NSpace justify='space-between'>
|
||||
<NButton
|
||||
size='small'
|
||||
type={'primary'}
|
||||
onClick={() => this.onCreate()}
|
||||
>
|
||||
{t('resource.task_group_option.create')}
|
||||
</NButton>
|
||||
<NSpace>
|
||||
<NInput
|
||||
allowInput={this.trim}
|
||||
allowInput={this.trim}
|
||||
size='small'
|
||||
v-model={[this.name, 'value']}
|
||||
placeholder={t(
|
||||
|
|
@ -172,14 +169,11 @@ const taskGroupOption = defineComponent({
|
|||
<SearchOutlined />
|
||||
</NIcon>
|
||||
</NButton>
|
||||
</div>
|
||||
</div>
|
||||
</NCard>
|
||||
<Card
|
||||
class={styles['table-card']}
|
||||
title={t('resource.task_group_option.option')}
|
||||
>
|
||||
<div>
|
||||
</NSpace>
|
||||
</NSpace>
|
||||
</Card>
|
||||
<Card title={t('resource.task_group_option.option')}>
|
||||
<NSpace vertical>
|
||||
<NDataTable
|
||||
loading={loadingRef}
|
||||
columns={columns}
|
||||
|
|
@ -188,7 +182,7 @@ const taskGroupOption = defineComponent({
|
|||
striped
|
||||
scrollX={this.tableWidth}
|
||||
/>
|
||||
<div class={styles.pagination}>
|
||||
<NSpace justify='center'>
|
||||
<NPagination
|
||||
v-model:page={this.page}
|
||||
v-model:page-size={this.pageSize}
|
||||
|
|
@ -199,8 +193,8 @@ const taskGroupOption = defineComponent({
|
|||
onUpdatePage={resetTableData}
|
||||
onUpdatePageSize={onUpdatePageSize}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</NSpace>
|
||||
</NSpace>
|
||||
</Card>
|
||||
{showModalRef && (
|
||||
<FormModal
|
||||
|
|
@ -211,7 +205,7 @@ const taskGroupOption = defineComponent({
|
|||
status={modelStatusRef}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</NSpace>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue