scorpioyq 3 年之前
父節點
當前提交
802ee9410e

+ 1 - 1
src/api/index.js

@@ -3,7 +3,7 @@ import system from './system/index.js'
 import project from "./project/index.js";
 
 export default {
-    uploadPath: '/api/blade-file/file/upload', // 上传
+    uploadPath: '/api/wutong-file/minio/file/upload', // 上传
     login,
     system,
     project

+ 25 - 1
src/api/project/index.js

@@ -11,10 +11,34 @@ export default {
     projectInfo(id) { //项目详细信息
         return fetch('/blade-project-manage/project/v1/detail/' + id)
     },
+    proUpdate(params) {//项目信息更新
+        return fetch('/blade-project-manage/project/v1/update', params, 'post', 'json')
+    },
     issuanceDetail(params) { //项目发行明细
         return fetch('/blade-project-manage/projectdetail/v1/list', params)
     },
-    includeStage(params) { //项目包含阶段
+    issueAdd(params) {//新增发行明细
+        return fetch('/blade-project-manage/projectdetail/v1/save', params, 'post', 'json')
+    },
+    userStageList() { //统计用户阶段项目数
+        return fetch('/blade-project-manage/stage/v1/countProjectStagelist')
+    },
+    includeStage(params) { //单个项目包含阶段
         return fetch('/blade-project-manage/projectstage/v1/getProjectStageList', params)
+    },
+    folderList(params) { //阶段包含文件夹列表
+        return fetch('/blade-project-manage/projectstagefilefolder/v1/getProjectStageFileList', params)
+    },
+    folderAdd(params) { //添加文件夹
+        return fetch('/blade-project-manage/filefolder/v1/save', params, 'post', 'json')
+    },
+    fileList(params) { //文件夹里包含文件列表
+        return fetch('/blade-project-manage/bladefile/v1/getListByFolderId', params)
+    },
+    fileAdd(params) { //上传(新增)文件
+        return fetch('/blade-project-manage/bladefile/v1/save', params, 'post', 'json')
+    },
+    fileRemove(params) { //删除文件
+        return fetch('/blade-project-manage/bladefile/v1/remove', params, 'post')
     }
 }

文件差異過大導致無法顯示
+ 0 - 0
src/assets/svg/folder/pdf.svg


+ 1 - 1
src/components/base-button.vue

@@ -3,7 +3,7 @@
     <el-icon color="#E9A956">
       <component :is="icon"></component>
     </el-icon>
-    <div class="ml-10 nowrap"> {{ title }}</div>
+    <div class="ml-5 nowrap"> {{ title }}</div>
   </div>
 </template>
 

+ 1 - 0
src/components/basic-step/index.vue

@@ -63,6 +63,7 @@ export default {
   methods: {
     change(index) {
       this.indicator = index
+      this.$emit('change', index)
     }
   }
 }

+ 1 - 1
src/components/main-button.vue

@@ -3,7 +3,7 @@
     <el-icon v-if="type === '1'" class="mr-5" color="#E9A956">
       <component :is="icon"></component>
     </el-icon>
-    <div class="nowrap font-15"> {{ title }}</div>
+    <div class="nowrap"> {{ title }}</div>
   </div>
 </template>
 

+ 187 - 0
src/components/upload-file.vue

@@ -0,0 +1,187 @@
+<template>
+  <div class='full-width custom'>
+    <el-upload ref='upload'
+               :accept="accept"
+               :action="action"
+               :auto-upload='false'
+               :data='data'
+               :file-list="tmpFileList"
+               :headers="headers"
+               :limit="max"
+               :list-type="listType"
+               :multiple="max > 1"
+               :on-change="handleChange"
+               :on-exceed="maxChange"
+               :on-progress="progress"
+               :on-remove="remove"
+               :on-success="success"
+               :show-file-list="showList"
+               style='width: 100%;'>
+      <div class=' flex flex-col flex-justify-start full-width'>
+        <div class='flex flex-align-center flex-justify-start'>
+          <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
+          <span class='ml-10'>共{{ tmpFileList.length }}个文件,上传速度:{{ speed }}</span>
+        </div>
+        <el-divider/>
+      </div>
+    </el-upload>
+
+    <div class='custom full-width' style='height: 300px'>
+      <el-empty v-if='tmpFileList.length === 0' description='暂无文件'/>
+      <div v-else>
+        <div v-for="item in tmpFileList" :key="item.name"
+             class="flex flex-col full-width border-bottom padding-bottom ">
+          <div class='full-width flex flex-justify-between'>
+            <span class="margin  text-left font-12 " style="flex:3">{{ item.name }}</span>
+            <span class="margin  font-12  text-right" style="flex:1">文件大小:{{ bytesToSize(item.size) }}</span>
+          </div>
+          <el-progress :format='format' :percentage="item.percentage" :show-text='true' :stroke-width='20'
+                       class='margin-left margin-right' text-inside></el-progress>
+        </div>
+      </div>
+    </div>
+    <el-divider/>
+    <div class='full-width flex flex-justify-end'>
+      <el-button plain size="small" @click='close'>取消上传</el-button>
+      <el-button size="small" type="primary" @click='submint'>开始上传</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import {Base64} from 'js-base64'
+import {getToken} from '../utils/auth.js'
+import website from '@/config/website'
+import api from '@/api'
+
+export default {
+  name: 'uploadFile', // 文件上传
+  props: {
+    showBtn: {
+      type: Boolean,
+      default: true
+    },
+    showList: {
+      type: Boolean,
+      default: false
+    },
+    data: Object,
+    loading: {
+      type: Boolean,
+      default: false
+    },
+    accept: {
+      type: String,
+      default: ''
+    },
+    max: {
+      type: Number,
+      default: 1
+    },
+    listType: {
+      type: String,
+      default: ''
+    },
+    btnText: {
+      type: String,
+      default: '上传'
+    },
+    action: {
+      type: String,
+      default: api.uploadPath
+    }
+  },
+  data() {
+    return {
+      fileList: [],
+      tmpFileList: [],
+      oldTimestamp: '',
+      oldLoadsize: 0,
+      speed: '',
+      headers: {
+        'Authorization': `Basic ${Base64.encode(`${website.clientId}:${website.clientSecret}`)}`,
+        'Blade-Auth': 'bearer ' + getToken()
+      }
+    }
+  },
+  methods: {
+    format(percentage) {
+      return percentage.toFixed(2) + "%"
+    },
+    progress(event, file, fileList) {
+      this.speed = this.uploadSpeed(event)
+      this.tmpFileList.map(item => {
+        if (item.uid === file.uid) {
+          item.percentage = event.percentage
+        }
+        return item
+      })
+
+    },
+    uploadSpeed(evt) {
+      let timestamp = new Date().valueOf();
+      let duration = timestamp - this.oldTimestamp; // 间隔时间(毫秒)
+      if (duration > 0) {
+        let size = evt.loaded - this.oldLoadsize;
+        let bitrate = ((size * 8) / duration / 1024) * 1000; // kbps
+        if (bitrate > 1000) {
+          bitrate = (Math.round(bitrate / 1000) * 0.125).toFixed(2) + "M/s";
+        } else {
+          bitrate = (Math.round(bitrate) * 0.125).toFixed(2) + "K/s";
+        }
+        this.oldLoadsize = evt.loaded;
+        this.oldTimestamp = new Date().valueOf()
+        return bitrate;
+      }
+    },
+    bytesToSize(bytes) {
+      const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
+      if (bytes === 0) return 'n/a';
+      const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
+      if (i === 0) return bytes + ' ' + sizes[i];
+      return (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i];
+    },
+    handleChange(file, fileList) {
+      this.tmpFileList = fileList
+    },
+    maxChange() {
+      this.$message.warning(`最多只能上传${this.max}个文件`)
+    },
+    success() {
+      let finishList = this.tmpFileList.filter(sub => sub.status === "success")
+      if (finishList.length === this.tmpFileList.length) {
+        this.$emit('success', {
+          fileList: this.tmpFileList
+        })
+        setTimeout(() => {
+          this.$refs.upload.clearFiles()
+          this.tmpFileList = []
+          this.speed = ''
+        }, 2000)
+      }
+    },
+    close() {
+      this.$refs.upload.abort()
+      this.$refs.upload.clearFiles()
+      this.tmpFileList = []
+      this.$emit('close')
+    },
+    submint() {
+      this.$refs.upload.submit()
+    },
+    remove(file, fileList) {
+      this.$emit('remove', {
+        file: file,
+        fileList: fileList
+      })
+    }
+  }
+}
+</script>
+<style lang='scss' scoped>
+.custom {
+  :deep(.el-upload) {
+    width: 100%;
+  }
+}
+</style>

+ 182 - 0
src/components/uploads.vue

@@ -0,0 +1,182 @@
+<template>
+  <div>
+    <el-upload :accept="accept"
+               :action="action"
+               :before-upload="beforeUpload"
+               :data='data'
+               :drag="drag"
+               :file-list="fileList"
+               :headers="headers"
+               :limit="max"
+               :list-type="listType"
+               :multiple="max > 1"
+               :on-error="onError"
+               :on-exceed="maxChange"
+               :on-progress="progress"
+               :on-remove="remove"
+               :on-success="success"
+               :show-file-list="showList"
+               class='custom-upload flex flex-col'>
+      <div v-if="drag">
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件/图片拖到此处,或<em>点击上传</em></div>
+      </div>
+      <div v-else class='flex flex-justify-start'>
+        <el-button v-if="showBtn" :loading="loading" icon="el-icon-upload2" plain size="mini"
+                   type="primary">{{ btnText }}
+        </el-button>
+      </div>
+      <slot></slot>
+    </el-upload>
+  </div>
+</template>
+
+<script>
+import {Base64} from 'js-base64'
+import {getToken} from '../utils/auth.js'
+import website from '@/config/website'
+import api from '@/api'
+
+export default {
+  name: 'uploadFile', // 文件上传
+  props: {
+    showBtn: {
+      type: Boolean,
+      default: true
+    },
+    drag: {
+      type: Boolean,
+      default: false
+    },
+    showList: {
+      type: Boolean,
+      default: false
+    },
+    data: Object,
+    loading: {
+      type: Boolean,
+      default: false
+    },
+    accept: {
+      type: String,
+      default: ''
+    },
+    max: {
+      type: Number,
+      default: 1
+    },
+    listType: {
+      type: String,
+      default: 'text'
+    },
+    btnText: {
+      type: String,
+      default: '点击上传'
+    },
+    action: {
+      type: String,
+      default: api.uploadPath
+    },
+    files: {
+      type: Array,
+      default() {
+        return null
+      }
+    }
+  },
+  data() {
+    return {
+      fileList: [],
+      headers: {
+        'Authorization': `Basic ${Base64.encode(`${website.clientId}:${website.clientSecret}`)}`,
+        'Blade-Auth': 'bearer ' + getToken()
+      }
+    }
+  },
+  mounted() {
+    this.setFiles(this.files, 'originalFileName')
+  },
+  methods: {
+    setFiles(fileList, name) { // 文件回填 (参数:文件列表,文件名的字段name)
+      if (!fileList || fileList.length === 0) return
+      let files = []
+      fileList.forEach((item, index) => {
+        files.push({
+          name: item[name] || '文件' + index + 1,
+          response: {
+            code: 200,
+            success: true,
+            data: [item]
+          },
+          status: 'success'
+        })
+      })
+      this.fileList = files
+    },
+    progress(event, file, fileList) {
+      // this.$message.info('上传中')
+      console.log(file.percentage)
+      if (file.percentage === 100) {
+        console.log(file)
+      }
+      if (file.status === 'uploading') {
+        this.loading = true
+      } else if (file.status === 'success') {
+        this.loading = false
+      }
+
+      this.$emit('progress')
+    },
+    maxChange() {
+      if (this.max === 1) { // 只有一张图的时候超出进行覆盖
+        this.fileList = []
+      } else {
+        this.$message.warning(`最多只能上传${this.max}个文件`)
+      }
+    },
+    beforeUpload(file) {
+      this.loading = true
+      console.log(file)
+      this.$emit('before', file)
+    },
+    success(response, file, fileList) {
+      let ids = ''
+      if (fileList && fileList.length > 0) {
+        console.log(fileList)
+        ids = fileList.map(e => e.response.data.id)
+      }
+      this.loading = false
+      if (response.code === 200) {
+        this.$message.success('上传完成')
+        this.$emit('success', {
+          file: file,
+          fileList: fileList,
+          ids: ids
+        })
+      } else {
+        this.$message.error(response.msg)
+      }
+
+    },
+    remove(file, fileList) {
+      let ids = fileList.map(e => e.response.data[0].id)
+      this.$emit('remove', {
+        file: file,
+        fileList: fileList,
+        ids: ids
+      })
+    },
+    onError() {
+      this.$message.error('服务器异常,请联系管理员!')
+    }
+  }
+}
+</script>
+<style lang='scss' scoped>
+.custom-upload {
+  ::v-deep .el-upload-list__item-name {
+    white-space: pre-wrap;
+    width: 100%;
+  }
+}
+</style>

+ 5 - 5
src/config/website.js

@@ -2,9 +2,9 @@
  * 全局配置文件
  */
 export default {
-  title: '梧桐树云平台',
-  tenant: '000000',
-  clientId: 'saber', // 客户端id
-  clientSecret: 'saber_secret', // 客户端密钥
-  statusWhiteList: []
+    title: '梧桐树云平台',
+    tenant: '000000',
+    clientId: 'pcapplet', // 客户端id
+    clientSecret: 'pcapplet_secret', // 客户端密钥
+    statusWhiteList: []
 }

+ 7 - 0
src/utils/tools.js

@@ -0,0 +1,7 @@
+export function bytesToSize(bytes) {
+    const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
+    if (bytes === 0) return 'n/a';
+    const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
+    if (i === 0) return bytes + ' ' + sizes[i];
+    return (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i];
+}

+ 53 - 4
src/views/home/component/current.vue

@@ -2,24 +2,73 @@
   <div class="flex flex-col padding">
     <div class="flex flex-center mt-20">
       <div class="bold font-16 grey flex-child-average text-left" style="margin-left: 50px">
-        <span>当前数据(2004)</span>
+        <span>当前数据({{ total }})</span>
       </div>
       <div class="flex flex-center flex-child-average flex-justify-end" style="margin-right: 50px">
         <base-button class="mr-20" icon="User" title="授权查看" type="0"/>
-        <base-button icon="Upload" title="上传文件"/>
+        <base-button icon="Upload" title="上传文件" @click="show = true"/>
       </div>
     </div>
-    <files_list class="mt-20"/>
+    <files_list :data="data" class="mt-20"/>
+    <el-dialog v-model="show"
+               append-to-body
+               center
+               title="附件上传(可批量)">
+      <uploadFile :max='20' accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.ppt,.wps" @close='show = false'
+                  @success='success'/>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import files_list from './files_list.vue'
 import baseButton from '../../../components/base-button.vue'
+import uploadFile from '../../../components/upload-file.vue'
 
 export default {
   name: "current",
-  components: {files_list, baseButton}
+  components: {files_list, baseButton, uploadFile},
+  props: {
+    id: String,
+    data: Array,
+    total: String
+  },
+  data() {
+    return {
+      show: false,
+      fileList: [],
+    }
+  },
+  methods: {
+    success(res) {
+      this.fileList = res.fileList.map(res => {
+        let item = {}
+        item.title = res.response.data.originalFileName
+        item.suffix = res.response.data.suffix
+        item.volume = res.response.data.volume
+        item.fileId = res.response.data.id
+        item.fileFolderId = this.id
+        return item
+      })
+      this.addFile()
+    },
+    addFile() {
+      if (this.fileList.length === 0) {
+        this.$message.error('请先上传相关文件')
+        return
+      }
+      this.$api.project.fileAdd(this.fileList).then(res => {
+        if (res.code === 200) {
+          this.show = false
+          this.$emit('reFolder')
+          this.$message.success(res.msg)
+        } else {
+          this.show = false
+          this.$message.error(res.msg)
+        }
+      })
+    },
+  }
 }
 </script>
 

+ 49 - 14
src/views/home/component/dash.vue

@@ -5,28 +5,23 @@
         <el-icon class="ml-20" color="#ECAB56">
           <WarningFilled/>
         </el-icon>
-        <span class="ml-5">项目总投资额129387847万元</span>
+        <span class="ml-5">项目总投资额87847万元</span>
       </div>
       <div class="flex ml-20">
-        <div v-for=" (item, index) in 8" :class="active === index ? 'total-s' : 'total'"
-             class="flex flex-col flex-align-start flex-center mt-20 bold font-18" @click="choise(index)">
-          <span class="ml-20 sp">全部项目</span>
-          <span class="ml-20 sp1 mt-5">111<span class="grey font-14 ml-5">个</span></span>
+        <div v-for="(item,index) in stage" :class="active === index ? 'total-s' : 'total'"
+             class="flex flex-col flex-align-start flex-center mt-20 bold font-16" @click="choise(index)">
+          <span class="ml-15 sp">{{ item.name }}</span>
+          <span class="ml-15 sp1 mt-5">{{ item.projectNumber }}<span class="grey font-14 ml-5">个</span></span>
         </div>
-        <el-button @click="go">项目详情</el-button>
-        <el-button @click="go1">跟踪审计</el-button>
       </div>
     </div>
     <avue-crud ref="crud"
                v-model="form"
-               v-model:page="page"
                :before-open="beforeOpen"
                :data="data"
                :option="option"
-               :permission="permissionList"
+               :page.sync="page"
                :table-loading="loading"
-               @row-update="rowUpdate"
-               @row-save="rowSave"
                @row-del="rowDel"
                @current-change="currentChange"
                @size-change="sizeChange"
@@ -46,7 +41,7 @@ export default {
       data: [],
       form: {},
       option: {
-        calcHeight: 30,
+        calcHeight: 230,
         refreshBtn: false,
         tip: false,
         columnBtn: false,
@@ -97,12 +92,16 @@ export default {
         ]
       },
       page: {
-        size: 15,
+        size: 10,
         current: 1,
         total: 0
-      }
+      },
+      stage: []
     }
   },
+  created() {
+    this.getStageList()
+  },
   methods: {
     choise(index) {
       this.active = index
@@ -111,6 +110,7 @@ export default {
       this.$api.project.projectList(this.page).then(res => {
         if (res.code === 200) {
           this.data = res.data.content
+          this.page.total = res.data.numberOfElements
           this.loading = false;
         }
       })
@@ -123,6 +123,39 @@ export default {
         })
       }
     },
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage;
+    },
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+    getStageList() {
+      this.$api.project.userStageList().then(res => {
+        if (res.code === 200) {
+          this.stage = res.data
+        }
+      })
+    },
+    rowDel(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+          .then(() => {
+            this.$api.knowledge.removeList({ids: row.id}).then(res => {
+              if (res.code === 200) {
+                this.$message.success(res.msg)
+                this.onLoad()
+              } else {
+                this.$message.error(res.msg)
+              }
+            })
+          })
+    },
     go() {
       this.$router.push('/home/details')
     },
@@ -170,6 +203,8 @@ export default {
 
   .sp {
     color: #707070;
+    white-space: nowrap;
+    margin-right: 20px;
   }
 
   .sp1 {

+ 44 - 9
src/views/home/component/files_list.vue

@@ -10,20 +10,21 @@
         <span class="title">上传人</span>
         <span style="flex: 2;color: #596A8A;">操作</span>
       </div>
-      <div v-for="item in 5" class="flex flex-center border-bottom padding">
+      <div v-for="item in data" class="flex flex-center border-bottom padding">
         <div style="flex: 0.6">
-          <img src="../../../assets/svg/folder/doc.svg" style="width: 80px;height: 66px;">
+          <img v-if="item.suffix === 'docx'" class="icon" src="../../../assets/svg/folder/doc.svg">
+          <img v-else-if="item.suffix === 'pdf'" class="icon" src="../../../assets/svg/folder/pdf.svg">
         </div>
-        <span style="flex: 1.4;color: #707070;">可研报告及批复</span>
-        <span class="title-x">2022-09-09 13:00:00</span>
-        <span class="title-x">202MB</span>
-        <span class="title-x">已同步</span>
-        <span class="title-x">老段</span>
+        <span style="flex: 1.4;color: #707070;">{{ item.title }}</span>
+        <span class="title-x">{{ item.updateTime }}</span>
+        <span class="title-x">{{ item.size }}</span>
+        <span class="title-x">{{ item.status }}</span>
+        <span class="title-x">{{ item.author }}</span>
         <div class="flex flex-center" style="flex: 2">
           <main-button icon="View" title="详情" width="85" @click="View"/>
-          <main-button icon="Download" title="下载" width="85"/>
+          <main-button icon="Download" title="下载" width="85" @click="downFile(item)"/>
           <main-button icon="UploadFilled" title="同步" width="85"/>
-          <main-button icon="Delete" title="删除" width="85"/>
+          <main-button icon="Delete" title="删除" width="85" @click="removeFile(item)"/>
         </div>
       </div>
     </div>
@@ -37,17 +38,46 @@
 
 <script>
 import mainButton from '../../../components/main-button.vue'
+import {bytesToSize} from "../../../utils/tools.js";
 
 export default {
   name: "files_list",
   components: {mainButton},
+  props: {
+    data: Array
+  },
+  watch: {
+    data() {
+      this.data.map(e => {
+        if (e.volume === '') {
+          e.size = 0
+          return
+        }
+        e.size = bytesToSize(e.volume)
+        return e
+      })
+    }
+  },
   data() {
     return {}
   },
   methods: {
     View() {
       // this.$router.push('/home/files')
+    },
+    downFile(item) {
+      window.open('/api/wutong-file/minio/file/downFile/' + item.dowloadFileId, '')
+    },
+    removeFile(item) {
+      this.$api.project.fileRemove({ids: item.id}).then(res => {
+        if (res.code === 200) {
+          this.$message.success(res.msg)
+        } else {
+          this.$message.error(res.msg)
+        }
+      })
     }
+
   }
 }
 </script>
@@ -67,4 +97,9 @@ export default {
   color: #707070;
   flex: 1;
 }
+
+.icon {
+  width: 80px;
+  height: 66px;
+}
 </style>

+ 68 - 7
src/views/home/component/right2.vue → src/views/home/component/folder_info.vue

@@ -12,9 +12,9 @@
             style="width: 100%"
         />
       </div>
-      <div class="flex flex-center" style="flex: 1">
+      <div class="flex flex-center ml-10" style="flex: 1">
         <base-button icon="Delete" title="清空" type="0"/>
-        <base-button class="ml-20"/>
+        <base-button class="ml-10"/>
       </div>
     </div>
     <div style="background-color: #E4E4E4;height: 10px;width: 100%;margin-left: -10px"></div>
@@ -27,14 +27,34 @@
           </div>
         </div>
       </div>
-      <div class="flex flex-center mr-10 " style="flex: 1.2">
-        <base-button icon="Plus" title="添加文件夹" type="0"/>
-        <base-button class="ml-20" icon="User" title="批量授权"/>
+      <div class="flex flex-center mr-5 " style="flex: 1.2">
+        <base-button icon="Plus" title="添加文件夹" type="0" @click="addShow = true"/>
+        <base-button class="ml-10" icon="User" title="批量授权"/>
       </div>
     </div>
     <div class="mt-20">
-      <folder_list/>
+      <folder_list :folder="folderList"/>
     </div>
+    <el-dialog v-model='addShow' append-to-body width='40%'>
+      <div class="flex flex-col">
+        <el-form ref="ruleFormRef"
+                 :model="folderInfo"
+                 class="demo-ruleForm"
+                 label-width="120px"
+                 status-icon>
+          <el-form-item label="文件夹名称">
+            <el-input
+                v-model="folderInfo.title"
+                placeholder="填写文件夹名称"
+                style="width: 100%"
+            />
+          </el-form-item>
+        </el-form>
+        <div class="full-width flex flex-center mt-10">
+          <base-button icon="Lock" title="保存" type="1" @click="folderAdd"/>
+        </div>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -47,8 +67,28 @@ export default {
   name: 'right2',
   // eslint-disable-next-line camelcase
   components: {baseButton, folder_list},
+  props: {
+    data: {
+      type: Object,
+      default: null
+    },
+    projectStageId: String,
+    id: String
+  },
+  watch: {
+    projectStageId() {
+      this.getFolderList()
+    }
+  },
   data() {
     return {
+      addShow: false,
+      folderInfo: {
+        title: '',
+        projectStageId: '',
+        projectId: '',
+        parentId: ''
+      },
       keyWords: '',
       active: 0,
       tab: [
@@ -64,12 +104,33 @@ export default {
         {
           name: '其他文件'
         }
-      ]
+      ],
+      folderList: []
     }
   },
   methods: {
     change(index) {
       this.active = index
+    },
+    getFolderList() {
+      this.$api.project.folderList({projectStageId: this.projectStageId}).then(res => {
+        if (res.code === 200) {
+          this.folderList = res.data.records
+        }
+      })
+    },
+    folderAdd() {
+      this.folderInfo.projectId = this.id
+      this.folderInfo.projectStageId = this.projectStageId
+      this.$api.project.folderAdd(this.folderInfo).then(res => {
+        if (res.code === 200) {
+          this.addShow = false
+          this.$message.success(res.msg)
+          this.getFolderList()
+        } else {
+          this.$message.error(res.msg)
+        }
+      })
     }
   }
 }

+ 16 - 8
src/views/home/component/folder_list.vue

@@ -8,13 +8,15 @@
         <span style="color: #707070;flex: 2">文件数量</span>
         <span style="flex: 1.5;color: #596A8A;">操作</span>
       </div>
-      <div v-for="item in 5" class="flex flex-center border-bottom padding">
+      <!--      <el-empty v-if="folder.length === 0" description="暂无数据"/>-->
+      <div v-for="item in folder" class="flex flex-center border-bottom padding">
         <img class="icon" src="../../../assets/svg/folder/see.svg">
-        <span class="title-x">可研报告及批复</span>
-        <span class="title-x">2022-09-09 13:00:00</span>
-        <span style="color: #707070;flex: 2">202</span>
+        {{ folder.name }}
+        <span class="title-x">{{ item.folderName }}</span>
+        <span class="title-x">{{ item.updateTime }}</span>
+        <span style="color: #707070;flex: 2">{{ item.fileNumber }}</span>
         <div class="flex flex-center" style="flex: 1.5">
-          <main-button icon="View" title="详情" width="85" @click="View"/>
+          <main-button icon="View" title="详情" width="85" @click="fileView(item)"/>
           <main-button icon="Upload" title="上传文件" width="85"/>
           <main-button icon="Pointer" title="授权操作" width="85"/>
           <main-button icon="Delete" title="删除" width="85"/>
@@ -23,7 +25,7 @@
     </div>
     <!-------分页----->
     <div class="mt-20 flex flex-center flex-justify-end" style="margin-right: 50px">
-      <span class="mr-20">共100条</span>
+      <span class="mr-20">共10条</span>
       <el-pagination :total="1000" background layout="prev, pager, next"/>
     </div>
   </div>
@@ -35,12 +37,18 @@ import mainButton from '../../../components/main-button.vue'
 export default {
   name: 'file_list',
   components: {mainButton},
+  props: {
+    folder: Array
+  },
   data() {
     return {}
   },
   methods: {
-    View() {
-      this.$router.push('/home/files')
+    fileView(item) {
+      this.$router.push({
+        path: '/home/files',
+        query: {id: item.id}
+      })
     }
   }
 }

+ 9 - 35
src/views/home/component/left_bar.vue

@@ -2,13 +2,13 @@
   <div>
     <div class="top">
       <div class="flex flex-col padding mt-20 ml-10">
-        <main-button type="0" width="200px"/>
+        <main-button :width="200" type="0"/>
         <el-divider></el-divider>
       </div>
       <div class='full-height' style="margin-left: 20px;text-align: left;">
         <span class="title">项目阶段-文件管理</span>
         <div class='mt-20 full-height' style='overflow-y: scroll;margin-bottom: 200px'>
-          <basic-step :steps='steps'/>
+          <basic-step :steps='stage' @change="change"/>
         </div>
       </div>
     </div>
@@ -17,7 +17,7 @@
         <el-divider></el-divider>
         <div class="flex flex-col flex-center tip">
           <span class="font-16 bold mt-5" style="color:#787C90;">项目总投资额</span>
-          <span class="mt-5 font-16 bold" style="color: #ECAB56">23244555万元</span>
+          <span class="mt-5 font-16 bold" style="color: #ECAB56">{{ data.totalAmount }}万元</span>
         </div>
       </div>
     </div>
@@ -32,42 +32,16 @@ export default {
   name: 'left_bar',
   components: {mainButton, basicStep},
   props: {
-    id: String
+    data: Object,
+    stage: Array
   },
   data() {
-    return {
-      steps: [{
-        title: '全部阶段',
-        count: 12312
-      }, {
-        title: '全部阶段',
-        count: 12312
-      }, {
-        title: '全部阶段',
-        count: 12312
-      }, {
-        title: '全部阶段',
-        count: 12312
-      }
-      ]
-    }
-  },
-  created() {
-    this.getStage()
+    return {}
   },
+
   methods: {
-    getStage() {
-      this.$api.project.includeStage({projectId: this.id}).then(res => {
-        console.log(res)
-        if (res.code === 200) {
-          this.steps = res.data.map(e => {
-            let newItem = {}
-            newItem.title = e.stageName
-            newItem.count = e.fileNumber
-            return newItem
-          })
-        }
-      })
+    change(index) {
+      this.$emit('change', index)
     }
   }
 }

+ 73 - 32
src/views/home/component/proinfo.vue

@@ -2,16 +2,20 @@
   <div class="flex flex-col">
     <div class="flex flex-center flex-justify-between margin">
       <span class="grey font-18 bold">项目详情</span>
-      <base-button :title="btnTips" icon="EditPen" width="60" @click="edit"/>
+      <div class="flex flex-center">
+        <base-button v-if="option.detail === false" :width="60" icon="Close" title="取消编辑" @click="cancel"/>
+        <base-button :title="btnTips" :width="60" icon="EditPen" @click="edit"/>
+      </div>
     </div>
-    <basic-form :data="data" :option="option"/>
+    <basic-form :data="data" :option="option" class="mt-10"/>
     <div class="flex flex-col mt-20">
       <div class="flex flex-center flex-justify-between margin">
         <span class="grey font-18 bold">发行明细</span>
-        <base-button icon="Plus" title="新增" width="60"/>
+        <base-button :width="60" icon="Plus" title="新增" @click="showAdd = true"/>
       </div>
       <!-------发行明细------>
-      <div class="flex flex-col flex-center padding mb-20">
+      <el-empty v-if="issue.length === 0" description="暂无数据"/>
+      <div v-else class="flex flex-col flex-center padding mb-20">
         <div class="flex flex-center grey  bold full-width mr-10 border"
              style="background-color: #FAFAFA;height: 50px;">
           <span class="flex-child-average">发行时间</span>
@@ -19,7 +23,6 @@
           <span class="flex-child-average">发行期限</span>
           <span class="flex-child-average">发行利率</span>
         </div>
-        {{ issue }}
         <div v-for="item in issue"
              class="flex flex-center grey full-width border-bottom border-right border-left mr-10"
              style="height: 50px">
@@ -30,6 +33,37 @@
         </div>
       </div>
     </div>
+    <el-dialog v-model='showAdd' append-to-body width='40%'>
+      <div class="flex flex-col">
+        <el-form ref="ruleFormRef"
+                 :model="issueInfo"
+                 class="demo-ruleForm"
+                 label-width="120px"
+                 status-icon>
+          <el-form-item label="发行时间">
+            <el-date-picker
+                v-model="issueInfo.issueDate"
+                format="YYYY-MM-DD"
+                placeholder="选择发行时间"
+                style="width: 100%"
+                value-format="YYYY-MM-DD"
+            />
+          </el-form-item>
+          <el-form-item label="发行金额">
+            <el-input v-model="issueInfo.issueAmount"/>
+          </el-form-item>
+          <el-form-item label="发行期限">
+            <el-input v-model="issueInfo.issueRate"/>
+          </el-form-item>
+          <el-form-item label="发行利率">
+            <el-input v-model="issueInfo.issueTerm"/>
+          </el-form-item>
+        </el-form>
+        <div class="full-width flex flex-center mt-10">
+          <base-button icon="Lock" title="保存" type="1" @click="issueAdd"/>
+        </div>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -45,6 +79,7 @@ export default {
   },
   data() {
     return {
+      showAdd: false,
       keyWords: '',
       loading: false,
       btnTips: '编辑',
@@ -194,7 +229,7 @@ export default {
             prop: 'introduction',
             type: 'textarea',
             span: 24,
-            rows: 2
+            rows: 4
           },
           {
             type: 'row',
@@ -249,43 +284,49 @@ export default {
           },
         ]
       },
-      info: {
-        name: '',
-        totalAmount: '',
-        provinceCode: '',
-        cityCode: '',
-        districtCode: '',
-        capital: '',
-        dictName: '',
-        implementingAgency: '',
-        portfolioFinancing: '',
-        startDate: '',
-        debtsAsCapital: '',
-        operationStartDate: '',
-        expectedReturn: '',
-        cost: '',
-        sourceIncome: '',
-        introduction: '',
-        projectSubject: '',
-        costIncomePercent: '',
-        lawFirm: '',
-        coverageMultiple: ''
-      },
-      issue: []
+      issueInfo: {
+        issueDate: '',
+        issueAmount: '',
+        issueRate: '',
+        issueTerm: '',
+        projectId: ''
+      }
     }
   },
   methods: {
     edit() {
       if (this.btnTips === '编辑') {
-        console.log('false')
         this.option.detail = false
         this.btnTips = '保存'
       } else {
         this.option.detail = true
-        console.log('true')
+        this.$api.project.proUpdate(this.data).then(res => {
+          if (res.code === 200) {
+            this.$message.success(res.msg)
+            this.$emit('refInfo')
+          } else {
+            this.$message.error(res.msg)
+          }
+        })
         this.btnTips = '编辑'
       }
-    }
+    },
+    cancel() {
+      this.option.detail = true
+      this.btnTips = '编辑'
+    },
+    issueAdd() {
+      this.issueInfo.projectId = this.data.id
+      this.$api.project.issueAdd(this.issueInfo).then(res => {
+        if (res.code === 200) {
+          this.showAdd = false
+          this.$message.success(res.msg)
+          this.$emit('refresh')
+        } else {
+          this.$message.error(res.msg)
+        }
+      })
+    },
   }
 }
 </script>

+ 28 - 8
src/views/home/details.vue

@@ -1,11 +1,11 @@
 <template>
   <div class='flex flex-justify-start full-height'>
     <div class="full-height">
-      <left-bar :id="id"/>
+      <left-bar :data="data" :stage="stage" @change="change"/>
     </div>
     <div class="full-height full-width white-bg padding-left padding-top" style="margin-left: 300px">
-      <proinfo v-if="type === 0" :data="data"/>
-      <right2 v-else/>
+      <proinfo v-if="type === 1" :data="data" :issue="list" @refInfo="proInfo" @refresh="issueList"/>
+      <folder_info v-else :id="id" :projectStageId="projectStageId"/>
     </div>
   </div>
 </template>
@@ -19,23 +19,26 @@ name:'项目详情',
 <script>
 import leftBar from './component/left_bar.vue'
 import proinfo from './component/proinfo.vue'
-import right2 from './component/right2.vue'
+import folder_info from './component/folder_info.vue'
 
 export default {
   name: 'test',
-  components: {leftBar, proinfo, right2},
+  components: {leftBar, proinfo, folder_info},
   data() {
     return {
       type: 0,
       id: '',
       data: {},
-      list: null
+      list: [],
+      stage: [],
+      projectStageId: ''
     }
   },
   created() {
     this.id = this.$route.query.id
     this.proInfo()
     this.issueList()
+    this.getStage()
   },
   methods: {
     proInfo() {
@@ -48,11 +51,28 @@ export default {
     issueList() {
       this.$api.project.issuanceDetail({projectId: this.id}).then(res => {
         if (res.code === 200) {
-          this.list = res.data
-          console.log(this.list)
+          this.list = res.data.records
         }
       })
     },
+    getStage() {
+      this.$api.project.includeStage({projectId: this.id}).then(res => {
+        console.log(res)
+        if (res.code === 200) {
+          this.stage = res.data.map(e => {
+            let newItem = {}
+            newItem.title = e.stageName
+            newItem.count = e.fileNumber
+            newItem.id = e.stageId
+            return newItem
+          })
+        }
+      })
+    },
+    change(res) {
+      console.log(this.stage[res].id)
+      this.projectStageId = this.stage[res].id
+    },
   }
 }
 </script>

+ 23 - 2
src/views/home/files.vue

@@ -1,7 +1,7 @@
 <template>
   <div class='flex flex-col full-height'>
     <div class="full-height white-bg">
-      <current/>
+      <current :id="id" :data="fileList" :total="total" @reFolder="getFileList"/>
     </div>
     <div class="full-height full-width white-bg mt-10">
       <historical/>
@@ -21,7 +21,28 @@ import historical from './component/historical.vue'
 
 export default {
   name: "files",
-  components: {current, historical}
+  components: {current, historical},
+  data() {
+    return {
+      id: '',
+      fileList: [],
+      total: ''
+    }
+  },
+  created() {
+    this.id = this.$route.query.id
+    this.getFileList()
+  },
+  methods: {
+    getFileList() {
+      this.$api.project.fileList({folderId: this.id}).then(res => {
+        if (res.code === 200) {
+          this.fileList = res.data.records
+          this.total = res.data.total
+        }
+      })
+    }
+  }
 }
 </script>
 

+ 6 - 4
src/views/recycle/index.vue

@@ -5,7 +5,7 @@
         <el-button @click='option.detail = !option.detail'>编辑</el-button>
       </div>
       <el-divider/>
-      <basic-form class='mt-20' :option='option' :data='data' @change='change'/>
+      <basic-form :data='data' :option='option' class='mt-20' @change='change'/>
     </basic-container>
   </div>
 </template>
@@ -20,10 +20,11 @@ name: '回收站',
 <script>
 import BasicContainer from '@/components/basic-container/main.vue'
 import basicForm from '@/components/basic-form/index.vue'
+
 export default {
   name: 'index',
-  components: { BasicContainer, basicForm },
-  data () {
+  components: {BasicContainer, basicForm},
+  data() {
     return {
       option: {
         detail: true,
@@ -113,7 +114,8 @@ export default {
     }
   },
   methods: {
-    change (res) {
+    change(res) {
+      this.data = res
       console.log(res)
     }
   }

部分文件因文件數量過多而無法顯示