From 713d0e75501f714e35189a33e8cee67926f7bd9e Mon Sep 17 00:00:00 2001 From: Devosend Date: Thu, 13 Jan 2022 18:04:45 +0800 Subject: [PATCH] [Feature][UI Next] Delete Conditions Component (#7999) * delete condition component * rename file manage route --- .../components/conditions/index.module.scss | 31 --------- .../src/components/conditions/index.tsx | 67 ------------------ .../src/router/modules/resources.ts | 6 +- .../src/views/resource/file/index.module.scss | 17 ++++- .../src/views/resource/file/index.tsx | 68 ++++++++++++++----- 5 files changed, 69 insertions(+), 120 deletions(-) delete mode 100644 dolphinscheduler-ui-next/src/components/conditions/index.module.scss delete mode 100644 dolphinscheduler-ui-next/src/components/conditions/index.tsx diff --git a/dolphinscheduler-ui-next/src/components/conditions/index.module.scss b/dolphinscheduler-ui-next/src/components/conditions/index.module.scss deleted file mode 100644 index 2e59ac9260..0000000000 --- a/dolphinscheduler-ui-next/src/components/conditions/index.module.scss +++ /dev/null @@ -1,31 +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. - */ - - .conditions-model { - display: flex; - justify-content: space-between; - align-items: center; - margin: 10px 0; - .right { - > .form-box { - .list { - float: right; - margin: 3px 0 3px 4px; - } - } - } -} diff --git a/dolphinscheduler-ui-next/src/components/conditions/index.tsx b/dolphinscheduler-ui-next/src/components/conditions/index.tsx deleted file mode 100644 index d193f74bdc..0000000000 --- a/dolphinscheduler-ui-next/src/components/conditions/index.tsx +++ /dev/null @@ -1,67 +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. - */ - -import _ from 'lodash' -import { useI18n } from 'vue-i18n' -import { defineComponent, ref } from 'vue' -import { SearchOutlined } from '@vicons/antd' -import { NButton, NIcon, NInput, NSpace } from 'naive-ui' -import Card from '@/components/card' -import styles from './index.module.scss' - -const Conditions = defineComponent({ - name: 'Conditions', - emits: ['conditions'], - setup(props, ctx) { - const searchVal = ref() - const handleConditions = () => { - ctx.emit('conditions', _.trim(searchVal.value)) - } - - return { searchVal, handleConditions } - }, - render() { - const { t } = useI18n() - const { $slots, handleConditions } = this - return ( - -
- {$slots} -
-
-
- - - - - -
-
- -
-
-
-
-
- ) - }, -}) - -export default Conditions diff --git a/dolphinscheduler-ui-next/src/router/modules/resources.ts b/dolphinscheduler-ui-next/src/router/modules/resources.ts index 24fc461b75..cfa6e14cfa 100644 --- a/dolphinscheduler-ui-next/src/router/modules/resources.ts +++ b/dolphinscheduler-ui-next/src/router/modules/resources.ts @@ -25,13 +25,13 @@ const components: { [key: string]: Component } = utils.mapping(modules) export default { path: '/resource', name: 'resource', - redirect: { name: 'file' }, + redirect: { name: 'file-manage' }, meta: { title: '资源中心' }, component: () => import('@/layouts/content'), children: [ { - path: '/resource/file', - name: 'file', + path: '/resource/file-manage', + name: 'file-manage', component: components['file'], meta: { title: '文件管理', diff --git a/dolphinscheduler-ui-next/src/views/resource/file/index.module.scss b/dolphinscheduler-ui-next/src/views/resource/file/index.module.scss index a6c089e897..d990390fc9 100644 --- a/dolphinscheduler-ui-next/src/views/resource/file/index.module.scss +++ b/dolphinscheduler-ui-next/src/views/resource/file/index.module.scss @@ -68,4 +68,19 @@ } } } -} \ No newline at end of file +} + +.conditions-model { + display: flex; + justify-content: space-between; + align-items: center; + margin: 10px 0; + .right { + > .form-box { + .list { + float: right; + margin: 3px 0 3px 4px; + } + } + } +} diff --git a/dolphinscheduler-ui-next/src/views/resource/file/index.tsx b/dolphinscheduler-ui-next/src/views/resource/file/index.tsx index f61aac2184..1c803f0691 100644 --- a/dolphinscheduler-ui-next/src/views/resource/file/index.tsx +++ b/dolphinscheduler-ui-next/src/views/resource/file/index.tsx @@ -25,10 +25,18 @@ import { watch, inject, } from 'vue' -import { NDataTable, NButtonGroup, NButton, NPagination } from 'naive-ui' +import { + NIcon, + NSpace, + NDataTable, + NButtonGroup, + NButton, + NPagination, + NInput, +} from 'naive-ui' import { useI18n } from 'vue-i18n' +import { SearchOutlined } from '@vicons/antd' import Card from '@/components/card' -import Conditions from '@/components/conditions' import { useTable } from './table/use-table' import { useFileState } from './use-file' import ResourceFolderModal from './folder' @@ -96,9 +104,11 @@ export default defineComponent({ const { getResourceListState } = useFileState(setPagination) - const handleConditions = (val: string) => { - serachRef.value = val - resourceListRef.value = getResourceListState(fileId.value, val) + const handleConditions = () => { + resourceListRef.value = getResourceListState( + fileId.value, + serachRef.value, + ) } const handleCreateFolder = () => { @@ -144,6 +154,7 @@ export default defineComponent({ return { fileId, + serachRef, folderShowRef, uploadShowRef, renameShowRef, @@ -172,19 +183,40 @@ export default defineComponent({ } = this return (
- - - - {t('resource.file.create_folder')} - - - {t('resource.file.create_file')} - - - {t('resource.file.upload_files')} - - - + +
+ + + + {t('resource.file.create_folder')} + + + {t('resource.file.create_file')} + + + {t('resource.file.upload_files')} + + + +
+
+
+ + + + + +
+
+ +
+
+
+
+