2213980799@qq.com 1 yıl önce
ebeveyn
işleme
4caa99e3f2

+ 31 - 1
src/views/doc/components/file-table-list.vue

@@ -212,6 +212,9 @@
         >
         >
           下载
           下载
         </el-button>
         </el-button>
+        <el-button   :disabled="selection.length > 1" type="primary" v-if="fileType == 1" @click.native="move">
+          移动
+        </el-button>
       </template>
       </template>
 
 
       <!-- 操作列 -->
       <!-- 操作列 -->
@@ -326,6 +329,13 @@
       :lcyStatus="lcyStatus"
       :lcyStatus="lcyStatus"
       :fileType="fileType"
       :fileType="fileType"
     />
     />
+    <move
+      ref="moveRef"
+    
+      @done="reload"
+
+    />
+    
     <file-editAll
     <file-editAll
       ref="fileEditAllRef"
       ref="fileEditAllRef"
       :parentId="parentData?.id"
       :parentId="parentData?.id"
@@ -346,6 +356,8 @@
 import fileSearch from './file-search.vue';
 import fileSearch from './file-search.vue';
 import fileEdit from './file-edit.vue';
 import fileEdit from './file-edit.vue';
 import fileEditAll from './file-editAll.vue';
 import fileEditAll from './file-editAll.vue';
+import move from './move.vue';
+
 import Info from './info.vue';
 import Info from './info.vue';
 import folderInfo from './folderInfo.vue';
 import folderInfo from './folderInfo.vue';
 import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
 import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
@@ -388,7 +400,7 @@ export default {
     fileEditAll,
     fileEditAll,
     bpm,
     bpm,
     sendEdit,
     sendEdit,
-    browse
+    browse,move
   },
   },
   props: {
   props: {
     // 上级
     // 上级
@@ -874,6 +886,24 @@ export default {
       }
       }
       this.$refs.sendEditRef.open('add', '', this.selection, this.fileType);
       this.$refs.sendEditRef.open('add', '', this.selection, this.fileType);
     },
     },
+    //移动
+    move(){
+      if (this.selection.length == 0) {
+        this.$message.warning('请选择一条数据');
+        return;
+      }
+      if (this.selection[0].checkOutUserName) {
+        this.$message.warning(
+          this.selection[0].name +
+            '已被' +
+            this.selection[0].checkOutUserName +
+            '检出 无法移动'
+        );
+        return;
+      }
+      this.$refs.moveRef.open(this.selection[0])
+      
+    },
     getTableList() {
     getTableList() {
       return JSON.parse(JSON.stringify(this.selection));
       return JSON.parse(JSON.stringify(this.selection));
     }
     }

+ 185 - 0
src/views/doc/components/move.vue

@@ -0,0 +1,185 @@
+<!-- 用户编辑弹窗 -->
+<template>
+  <ele-modal
+    width="500px"
+    :visible.sync="showEditFlag"
+    :close-on-click-modal="false"
+    custom-class="ele-dialog-form"
+    append-to-body
+    @close="cancel"
+    :title="title"
+    ref="Emodal"
+  >
+    <el-form ref="form" :model="form" :rules="rules" label-width="82px">
+      <el-row :gutter="15">
+        <el-col :span="24">
+          <el-form-item label="编码" prop="code">
+            <el-input v-model="form.code" placeholder="请申请编码" disabled>
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="24">
+          <el-form-item label="文档类型" prop="type">
+            <DictSelection
+              dictName="文档类型"
+              v-model="form.type"
+              :disabled="true"
+            ></DictSelection>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="24">
+          <el-form-item label="文档名称" prop="name">
+            <el-input v-model="form.name" disabled></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="24">
+          <el-form-item label="目标位置" prop="directoryId">
+            <el-cascader
+              style="width: 100%"
+              v-model="form.directoryId"
+              :options="folderList"
+              :props="{
+                value: 'id',
+                label: 'name',
+                children: 'sonDirectoryList',
+                emitPath: false,
+                checkStrictly: true
+              }"
+            ></el-cascader>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <template v-slot:footer>
+      <el-button @click="cancel">取消</el-button>
+      <el-button
+        type="primary"
+        v-loading.fullscreen.lock="loading"
+        @click="save"
+      >
+        确认
+      </el-button>
+    </template>
+  </ele-modal>
+</template>
+
+<script>
+import {
+  fileUpdateAPI,
+  fileGetByIdAPI,
+  getDocTreeListAPI
+} from '@/api/doc-manage';
+import { setFolderList } from '../util.js';
+import { mapGetters } from 'vuex';
+
+export default {
+  data() {
+    const defaultForm = {
+      name: '', //名称
+      type: '', //类型
+      sizeUnit: '', //大小,
+      unit: '', //单位
+      remark: '', //备注
+      status: '', //状态
+      storagePathId: '',
+      directoryId: '',
+      storagePath: [],
+      id: '',
+      secretLevel: 1
+      
+    };
+    return {
+      rules: {
+        directoryId: [{ required: true, message: '请选择', trigger: 'blur' }]
+      },
+      folderList: [],
+      defaultForm,
+      // 表单数据
+      form: { ...defaultForm },
+
+      // 提交状态
+      loading: false,
+      showEditFlag: false,
+      title: '',
+      type: ''
+    };
+  },
+  computed: {
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
+    },
+    ...mapGetters(['user'])
+  },
+  created() {
+    getDocTreeListAPI({
+      type: 0,
+      currentUserId: this.user.info.userId
+    }).then((res) => {
+      this.folderList = res;
+      setFolderList(this.folderList); //权限过滤
+    });
+  },
+  methods: {
+    async open(row) {
+      this.title = '移动文档';
+      this.showEditFlag = true;
+      this.form = await fileGetByIdAPI(row.id);
+      this.form.type = this.form.type + '';
+    },
+
+    /* 保存编辑 */
+    save() {
+      this.$refs.form.validate(async (valid) => {
+        if (!valid) {
+          return false;
+        }
+
+        this.form.fileType = 0;
+     
+        this.loading = true;
+        fileUpdateAPI(this.form)
+          .then(async (msg) => {
+            this.loading = false;
+            this.cancel();
+            this.$emit('done');
+          })
+          .catch((e) => {
+            this.loading = false;
+          });
+      });
+    },
+    cancel() {
+      this.form = { ...this.defaultForm };
+      this.$refs.form.clearValidate();
+      this.showEditFlag = false;
+    }
+  }
+};
+</script>
+<style scoped lang="scss">
+.aaa {
+  width: 100%;
+
+  ::v-deep .upload-demo {
+    width: 100%;
+
+    .el-upload--text {
+      width: 100%;
+
+      button {
+        width: 100%;
+        background: #ffffff;
+        border: 1px solid #dbdbdb;
+        border-radius: 5px;
+      }
+    }
+
+    .el-upload-list {
+      transform: translate(10px, -39px);
+      position: absolute;
+    }
+  }
+}
+</style>