소스 검색

修改新版上传组件,保存路径问题

zhangdaiscott 5 년 전
부모
커밋
4c0c0945a1
2개의 변경된 파일12개의 추가작업 그리고 4개의 파일을 삭제
  1. 11 3
      ant-design-vue-jeecg/src/components/jeecg/JEditableTable.vue
  2. 1 1
      ant-design-vue-jeecg/src/components/jeecg/JUpload.vue

+ 11 - 3
ant-design-vue-jeecg/src/components/jeecg/JEditableTable.vue

@@ -1268,7 +1268,8 @@
         // 同步更改
         this.rows = rows
         this.$nextTick(() => {
-          this.updateFormValues()
+          this.recalcSortNumber()
+          this.forceUpdateFormValues()
         })
         // 触发 insert 事件
         this.$emit('inserted', {
@@ -1911,12 +1912,19 @@
         sort(this.rows)
         sort(this.inputValues)
 
-        // 重置排序字段
-        this.inputValues.forEach((val, idx) => val[this.dragSortKey] = (idx + 1))
+        this.recalcSortNumber()
 
         this.forceUpdateFormValues()
       },
 
+      /** 重新计算排序字段的数值 */
+      recalcSortNumber() {
+        if (this.dragSort) {
+          // 重置排序字段
+          this.inputValues.forEach((val, idx) => val[this.dragSortKey] = (idx + 1))
+        }
+      },
+
       /** 当前行向上移一位 */
       _handleRowMoveUp(rowIndex) {
         if (rowIndex > 0) {

+ 1 - 1
ant-design-vue-jeecg/src/components/jeecg/JUpload.vue

@@ -221,7 +221,7 @@
             }).map((file) => {
               var fileJson = {
                 fileName:file.name,
-                filePath:file.url,
+                filePath:file.response.message,
                 fileSize:file.size
               };
               this.newFileList.push(fileJson);