Browse Source

[Refactor][UI] Refactor function manage using NSpace component. (#11124)

3.1.0-release
songjianet 2 years ago committed by GitHub
parent
commit
7ed1e7cd74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 30
      dolphinscheduler-ui/src/views/resource/udf/function/index.module.scss
  2. 42
      dolphinscheduler-ui/src/views/resource/udf/function/index.tsx

30
dolphinscheduler-ui/src/views/resource/udf/function/index.module.scss

@ -15,28 +15,6 @@
* limitations under the License. * limitations under the License.
*/ */
.content {
width: 100%;
.card {
margin-bottom: 8px;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin: 10px 0;
.right {
> .search {
.list {
float: right;
margin: 3px 0 3px 4px;
}
}
}
}
.table { .table {
table { table {
width: 100%; width: 100%;
@ -63,11 +41,3 @@
} }
} }
} }
.pagination {
display: flex;
justify-content: center;
align-items: center;
margin-top: 20px;
}
}

42
dolphinscheduler-ui/src/views/resource/udf/function/index.tsx

@ -26,9 +26,9 @@ import {
} from 'naive-ui' } from 'naive-ui'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { SearchOutlined } from '@vicons/antd' import { SearchOutlined } from '@vicons/antd'
import { useTable } from './use-table'
import Card from '@/components/card' import Card from '@/components/card'
import FolderModal from './components/function-modal' import FolderModal from './components/function-modal'
import { useTable } from './use-table'
import styles from './index.module.scss' import styles from './index.module.scss'
export default defineComponent({ export default defineComponent({
@ -94,39 +94,34 @@ export default defineComponent({
const { loadingRef } = this const { loadingRef } = this
return ( return (
<div class={styles.content}> <NSpace vertical>
<Card class={styles.card}> <Card>
<div class={styles.header}> <NSpace justify='space-between'>
<NSpace>
<NButton <NButton
type='primary' type='primary'
size='small'
onClick={this.handleCreateFolder} onClick={this.handleCreateFolder}
class='btn-create-udf-function' class='btn-create-udf-function'
> >
{t('resource.function.create_udf_function')} {t('resource.function.create_udf_function')}
</NButton> </NButton>
</NSpace> <NSpace>
<div class={styles.right}>
<div class={styles.search}>
<div class={styles.list}>
<NButton type='primary' onClick={this.handleSearch}>
<NIcon>
<SearchOutlined />
</NIcon>
</NButton>
</div>
<div class={styles.list}>
<NInput <NInput
allowInput={this.trim} allowInput={this.trim}
size='small'
placeholder={t('resource.function.enter_keyword_tips')} placeholder={t('resource.function.enter_keyword_tips')}
v-model={[this.searchVal, 'value']} v-model={[this.searchVal, 'value']}
/> />
</div> <NButton type='primary' size='small' onClick={this.handleSearch}>
</div> <NIcon>
</div> <SearchOutlined/>
</div> </NIcon>
</NButton>
</NSpace>
</NSpace>
</Card> </Card>
<Card title={t('resource.function.udf_function')}> <Card title={t('resource.function.udf_function')}>
<NSpace vertical>
<NDataTable <NDataTable
loading={loadingRef} loading={loadingRef}
columns={this.columns} columns={this.columns}
@ -137,7 +132,7 @@ export default defineComponent({
row-class-name='items' row-class-name='items'
scrollX={this.tableWidth} scrollX={this.tableWidth}
/> />
<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}
@ -148,14 +143,15 @@ export default defineComponent({
onUpdatePage={this.requestData} onUpdatePage={this.requestData}
onUpdatePageSize={this.handleChangePageSize} onUpdatePageSize={this.handleChangePageSize}
/> />
</div> </NSpace>
</NSpace>
</Card> </Card>
<FolderModal <FolderModal
v-model:row={this.row} v-model:row={this.row}
v-model:show={this.showRef} v-model:show={this.showRef}
onUpdateList={this.handleUpdateList} onUpdateList={this.handleUpdateList}
/> />
</div> </NSpace>
) )
} }
}) })

Loading…
Cancel
Save