This is an automated email from the ASF dual-hosted git repository.

songjian pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new b210848  [Fix][UI] Rectify this issue with missing the re-uploading 
file button when the file is under the root directory.
b210848 is described below

commit b2108486ba28dcc04436204347401475e245724f
Author: calvin <[email protected]>
AuthorDate: Mon Feb 14 20:14:24 2022 +0800

    [Fix][UI] Rectify this issue with missing the re-uploading file button when 
the file is under the root directory.
---
 .../pages/file/pages/list/_source/list.vue         | 10 +++++++++-
 .../module/components/fileUpdate/fileReUpload.vue  | 23 ++++++++++++++++------
 2 files changed, 26 insertions(+), 7 deletions(-)

diff --git 
a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue
 
b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue
index 321ee53..eeac67c 100755
--- 
a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue
+++ 
b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue
@@ -51,8 +51,11 @@
             <span>{{scope.row.updateTime | formatDate}}</span>
           </template>
         </el-table-column>
-        <el-table-column :label="$t('Operation')" width="150">
+        <el-table-column :label="$t('Operation')" width="180">
           <template slot-scope="scope">
+            <el-tooltip :content="$t('ReUpload File')" placement="top" 
:enterable="false">
+              <span><el-button type="primary" size="mini" 
icon="el-icon-refresh-right" @click="_reUploadFile(scope.row)" 
v-show="scope.row.directory? false: true" circle></el-button></span>
+            </el-tooltip>
             <el-tooltip :content="$t('Edit')" placement="top">
               <span><el-button id="btnEdit" type="primary" size="mini" 
icon="el-icon-edit-outline" @click="_edit(scope.row)" 
:disabled="_rtDisb(scope.row)" circle></el-button></span>
             </el-tooltip>
@@ -92,7 +95,9 @@
   import { filtTypeArr } from '../../_source/common'
   import { bytesToSize } from '@/module/util/util'
   import { downloadFile } from '@/module/download'
+  import { findComponentDownward } from '@/module/util/'
   import localStore from '@/module/util/localStorage'
+
   export default {
     name: 'file-manage-list',
     data () {
@@ -123,6 +128,9 @@
           this.$router.push({ path: `/resource/file/list/${item.id}` })
         }
       },
+      _reUploadFile (item) {
+        findComponentDownward(this.$root, 'roof-nav')._fileReUpload(item)
+      },
       _downloadFile (item) {
         downloadFile(`resources/${item.id}/download`)
       },
diff --git 
a/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileReUpload.vue 
b/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileReUpload.vue
index 90ffc65..c58f43b 100644
--- a/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileReUpload.vue
+++ b/dolphinscheduler-ui/src/js/module/components/fileUpdate/fileReUpload.vue
@@ -112,6 +112,12 @@
       }
     },
     watch: {
+      originalFileData: {
+        deep: true,
+        handler () {
+          this._init()
+        }
+      }
     },
     props: {
       originalFileData: Object
@@ -244,16 +250,21 @@
         this.file = file
         this.name = file.name
         this.$refs.file.value = null
+      },
+      _init () {
+        if (this.originalFileData) {
+          this.id = this.originalFileData.id
+          this.name = this.originalFileData.fileName
+          if (this.originalFileData.desc) {
+            this.description = this.originalFileData.desc
+          }
+          this.currentDir = this.originalFileData.fullName.substring(0, 
this.originalFileData.fullName.length - this.originalFileData.fileName.length)
+        }
       }
     },
     mounted () {
       this.reset()
-      this.id = this.originalFileData.id
-      this.name = this.originalFileData.fileName
-      if (this.originalFileData.desc) {
-        this.description = this.originalFileData.desc
-      }
-      this.currentDir = this.originalFileData.fullName.substring(0, 
this.originalFileData.fullName.length - this.originalFileData.fileName.length)
+      this._init()
     },
     components: { mPopup, mListBoxF, mProgressBar }
   }

Reply via email to