scorpio 3 年之前
父节点
当前提交
61bbd02f9e

+ 1 - 1
README.md

@@ -11,7 +11,7 @@
 <script>
 
 export default {
-  name: '设置', // 需要设置页面name 和 rotue 中的name 一致
+  name: '设置', // 需要设置页面name 和 rotue 中的name 一致,keepAlive 才有效
   data () {
     return {
       data: { }

+ 3 - 0
src/api/project/index.js

@@ -88,5 +88,8 @@ export default {
      */
   apply (params) {
     return fetch('/blade-project-manage/grant/v1/applyGrant', params, 'post', 'json')
+  },
+  folderType (params) {
+    return fetch('/blade-project-manage/filefolder/v1/getFileTypeList', params)
   }
 }

+ 0 - 1
src/layout/index.vue

@@ -33,7 +33,6 @@ export default {
     return { keepAlive }
   },
   created () {
-    console.log(this.keepAlive.list)
     this.keepAlive.$subscribe((res) => {
       console.log(this.keepAlive.list)
     })

+ 9 - 15
src/layout/left.vue

@@ -38,27 +38,21 @@ export default {
           img: new URL('../assets/svg/icon3.svg', import.meta.url).href,
           path: '/recycle'
         }
-      ]
+      ],
+      currentPage: ''
     }
   },
   created () {
+    this.currentPage = window.location.href
+    this.init()
   },
   methods: {
     init () {
-      this.$api.system.getMenus().then(res => {
-        if (res.code === 200) {
-          if (res.msg === '暂无承载数据') {
-            this.$router.push('/login')
-          } else {
-            this.data = res.data.map(sub => {
-              sub.checked = false
-              return sub
-            })
-            this.$router.push(this.data[0].path)
-            this.data[0].checked = true
-          }
-        }
-      })
+      if (this.currentPage.indexOf('/database') > -1) {
+        this.active = 1
+      } else if (this.currentPage.indexOf('/recycle') > -1) {
+        this.active = 2
+      }
     },
     navClick (item, index) {
       this.active = index

+ 1 - 1
src/layout/top.vue

@@ -5,7 +5,7 @@
            <img class="ml-10" src="../assets/svg/top.svg"/>
             <el-breadcrumb class='ml-10' separator="/">
               <el-breadcrumb-item v-for='item in nav.menus' :key='item.id'>
-                <a :href="item.path">{{ item.name }}</a>
+                <a :href="item.fullPath">{{ item.name }}</a>
               </el-breadcrumb-item>
             </el-breadcrumb>
           </div>

+ 12 - 2
src/page/404.vue

@@ -1,6 +1,11 @@
 <template>
   <div class='full-screen flex flex-center'>
-    <el-empty description='404 页面丢失'/>
+    <img src='https://wutong-1302848345.cos.ap-chengdu.myqcloud.com/wtzx/4e993b2d27a544a893ddbc8f60cc2a65.svg'/>
+    <div class='ml-20'>
+      <h1 style='font-size: 82px' class='bold'>404</h1>
+      <div class='mt-10 bold'>抱歉,你访问的页面不存在</div>
+      <el-button type='primary' class='mt-20' @click='goHome'>返回首页</el-button>
+    </div>
   </div>
 </template>
 
@@ -14,7 +19,12 @@
 
 <script>
 export default {
-  name: '404'
+  name: '404',
+  methods: {
+    goHome () {
+      this.$router.push('/')
+    }
+  }
 }
 </script>
 

+ 1 - 1
src/page/login.vue

@@ -165,7 +165,7 @@ export default {
   },
   created () {
     this.permission.cleanPermission()
-    this.dev = window.location.href.toString().indexOf('localhost') > -1
+    this.dev = window.location.href.toString().indexOf('localhost') > -1 || window.location.href.toString().indexOf('dev') > -1
     removeToken()
     this.init()
   },

+ 0 - 1
src/router/index.js

@@ -19,7 +19,6 @@ router.beforeEach((to, from, next) => {
     nav.updateMenu(to)
   }
   if (to.meta.keepAlive) {
-    console.log(to.name)
     const keepAlive = keepAliveStore()
     keepAlive.add(to.name) // 将路由名称添加到 keepAlive 集合中
   }

+ 37 - 36
src/views/database/component/list.vue

@@ -16,7 +16,7 @@
     </div>
     <avue-crud ref="crud"
                v-model="form"
-               v-model:page="page"
+               :page="page"
                :before-open="beforeOpen"
                :data="data"
                :option="option"
@@ -28,18 +28,18 @@
                @on-load="onLoad">
     </avue-crud>
     <el-dialog v-model="showInfo" append-to-body width="45%">
-      <dialog_info :id="id"/>
+      <dialog-info :id="id"/>
     </el-dialog>
   </div>
 </template>
 
 <script>
-import dialog_info from './dialog_info.vue'
+import dialogInfo from './dialog_info.vue'
 
 export default {
   name: 'list',
-  components: {dialog_info},
-  data() {
+  components: { dialogInfo },
+  data () {
     return {
       showInfo: false,
       keyWords: '',
@@ -65,7 +65,7 @@ export default {
           {
             label: '文件名称',
             prop: 'title',
-            width: 380,
+            width: 380
           },
           {
             label: '所属项目',
@@ -77,7 +77,7 @@ export default {
           },
           {
             label: '上传人',
-            prop: 'createUserName',
+            prop: 'createUserName'
           },
           {
             label: '上传时间',
@@ -85,39 +85,40 @@ export default {
           }]
       },
       page: {
-        pageSize: 20,
-        currentPage: 1,
+        size: 10,
+        current: 1,
         total: 0
       },
       id: ''
     }
   },
-  created() {
+  created () {
     this.$bus.on('serachFile', (res) => {
       this.onLoad(res)
     })
   },
   methods: {
-    onLoad(query = {}) {
-      let data = {...query, ...this.page}
+    onLoad (query = {}) {
+      const data = { ...query, ...this.page }
+      this.loading = true
       this.$api.database.fileList(data).then(res => {
+        this.loading = false
         if (res.code === 200) {
           this.data = res.data.records
           this.page.total = res.data.total
-          this.loading = false;
         }
       })
     },
-    currentChange(currentPage) {
-      this.page.currentPage = currentPage;
+    currentChange (currentPage) {
+      this.page.current = currentPage
     },
-    sizeChange(pageSize) {
-      this.page.pageSize = pageSize;
+    sizeChange (pageSize) {
+      this.page.size = pageSize
     },
-    refreshChange() {
-      this.onLoad(this.page, this.query);
+    refreshChange () {
+      this.onLoad(this.page, this.query)
     },
-    beforeOpen(done, type) {
+    beforeOpen (done, type) {
       if (['view'].includes(type)) {
         this.showInfo = true
         console.log(this.showInfo)
@@ -125,28 +126,28 @@ export default {
       } else if (type === 'edit') {
         this.$router.push({
           path: '/home/details',
-          query: {id: this.form.id, type: '1'}
+          query: { id: this.form.id, type: '1' }
         })
       }
     },
-    rowDel(row) {
-      this.$confirm("确定删除选择的项目?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
+    rowDel (row) {
+      this.$confirm('确定删除选择的项目?', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
       })
-          .then(() => {
-            this.$api.database.fileRemove({ids: row.id}).then(res => {
-              if (res.code === 200) {
-                this.$message.success(res.msg)
-                this.onLoad()
-              } else {
-                this.$message.error(res.msg)
-              }
-            })
+        .then(() => {
+          this.$api.database.fileRemove({ ids: row.id }).then(res => {
+            if (res.code === 200) {
+              this.$message.success(res.msg)
+              this.onLoad()
+            } else {
+              this.$message.error(res.msg)
+            }
           })
+        })
     },
-    choise(index) {
+    choise (index) {
       this.active = index
     }
   }

+ 6 - 2
src/views/home/component/current.vue

@@ -2,7 +2,7 @@
   <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>当前数据({{ data.total }})</span>
+        <span>{{folderName}}({{ folderNumber }})</span>
       </div>
       <div class="flex flex-center flex-child-average flex-justify-end" style="margin-right: 50px">
         <base-button v-if='permissions.permissions.home_folder_authorize' class="mr-5" icon="User" title="授权"
@@ -95,7 +95,9 @@ export default {
         ownerId: '',
         projectId: ''
       },
-      isAccess: ''
+      isAccess: '',
+      folderName: '',
+      folderNumber: 0
     }
   },
   setup () {
@@ -104,6 +106,8 @@ export default {
     return { permissions, user }
   },
   created () {
+    this.folderName = this.$route.query.folderName
+    this.folderNumber = this.$route.query.folderNumber
     this.isAccess = this.$route.query.isAccess
     this.projectId = this.$route.query.projectId
     this.folderInfo.dictKey = this.$route.query.dictKey

+ 2 - 0
src/views/home/component/dash.vue

@@ -261,8 +261,10 @@ export default {
     //   })
     // },
     onLoad (query = {}) {
+      this.loading = true
       const data = { ...query, ...this.page }
       this.$api.project.projectList(data).then(res => {
+        this.loading = false
         if (res.code === 200) {
           this.data = res.data.content
           this.num = res.msg

+ 7 - 4
src/views/home/component/files_list.vue

@@ -5,7 +5,7 @@
         <span class="flex-1"></span>
         <span style="flex: 2;text-align: left">文件/文件夹名称</span>
         <span style="flex: 1">更新(上传)时间</span>
-        <span class="flex-1">文件大小</span>
+        <span class="flex-1">文件大小(数量)</span>
         <span class="flex-1">是否同步</span>
         <span class="flex-1">上传人</span>
         <span style="flex: 3">操作</span>
@@ -27,7 +27,7 @@
         <span style="flex: 2;text-align: left">{{ item.title }}</span>
         <span style="flex: 1">{{ item.createTime.substring(0, 10) }}</span>
         <span v-if="item.type === '1'" class="flex-1">{{ item.size }}</span>
-        <span v-if="item.type === '2'" class="flex-1">-</span>
+        <span v-if="item.type === '2'" class="flex-1">{{item.fileChildrenNumber}}个</span>
         <span v-if="item.type === '1'" class="flex-1">{{ item.status }}</span>
         <span v-if="item.type === '2'" class="flex-1">-</span>
         <span v-if="item.type === '1'" class="flex-1">{{ item.createUserName }}</span>
@@ -168,7 +168,8 @@ export default {
           this.imgList.push(item.url)
           return
         }
-        this.$router.push('/home/file_detail?id=' + item.fileId)
+        const routeData = this.$router.resolve({ path: '/home/file_detail', query: { id: item.fileId } })
+        window.open(routeData.href, '_blank')
       } else if (item.type === '2') {
         this.query.id = item.id
         console.log(item)
@@ -181,7 +182,9 @@ export default {
             dictKey: this.query.dictKey,
             parentId: item.id,
             isAccess: item.isAccess,
-            ownerId: this.query.ownerId
+            ownerId: this.query.ownerId,
+            folderName: item.title,
+            folderNumber: item.fileChildrenNumber
           }
         })
       }

+ 1 - 1
src/views/home/component/folder_info.vue

@@ -127,7 +127,7 @@ export default {
   },
   methods: {
     getDict () {
-      this.$api.common.dicList({ code: 'pc-folder-type' }).then(res => {
+      this.$api.project.folderType({ projectStageId: this.projectStageId }).then(res => {
         if (res.code === 200) {
           this.folderType = res.data
           this.change(0, this.folderType[0].dictKey)

+ 4 - 1
src/views/home/component/folder_list.vue

@@ -189,6 +189,7 @@ export default {
   methods: {
     fileView (item) {
       if (this.type === 0) {
+        console.log(item)
         this.$router.push({
           path: '/home/files',
           query: {
@@ -197,7 +198,9 @@ export default {
             ownerId: this.ownerId,
             dictKey: this.dictKey,
             projectStageId: item.projectStageId,
-            isAccess: item.isAccess
+            isAccess: item.isAccess,
+            folderName: item.folderName,
+            folderNumber: item.fileNumber
           }
         })
       } else {

+ 5 - 4
src/views/home/component/left_bar.vue

@@ -1,14 +1,15 @@
 <template>
   <div>
     <div class="top">
-      <div class="flex flex-col padding mt-20 ml-10">
+      <div class="flex flex-col flex-center padding mt-20  ">
+        <span class='font-16 bold  mb-10'>{{data.name}}</span>
         <main-button :width="200" type="0" @click="proInfo"/>
         <el-divider></el-divider>
       </div>
     </div>
-    <div class='middle ' style="margin-left: 20px;text-align: left;">
+    <div class='middle full-height' style="margin-left: 20px;text-align: left;">
       <span class="title">项目阶段-文件管理</span>
-      <el-empty v-if="stage &&  stage.length === 0 "/>
+      <el-empty style='margin-top: 200px' v-if="stage &&  stage.length === 0 "/>
       <basic-step class='mt-5' :active="active" :steps='stage'/>
     </div>
     <div class="down">
@@ -88,7 +89,7 @@ export default {
   width: 270px;
   position: fixed;
   bottom: 175px;
-  top: 160px;
+  top: 220px;
 }
 
 .title {

+ 31 - 8
src/views/home/component/proinfo.vue

@@ -33,14 +33,15 @@
         </div>
       </div>
     </div>
-    <el-dialog v-model='showAdd' append-to-body width='40%'>
+    <el-dialog v-model='showAdd' append-to-body width='40%' title='新增发行明细'>
       <div class="flex flex-col">
         <el-form ref="ruleFormRef"
                  :model="issueInfo"
                  class="demo-ruleForm"
                  label-width="120px"
+                 :rules='rules'
                  status-icon>
-          <el-form-item label="发行时间">
+          <el-form-item label="发行时间" prop='issueDate'>
             <el-date-picker
                 v-model="issueInfo.issueDate"
                 format="YYYY-MM-DD"
@@ -49,14 +50,22 @@
                 value-format="YYYY-MM-DD"
             />
           </el-form-item>
-          <el-form-item label="发行金额">
-            <el-input v-model="issueInfo.issueAmount"/>
+          <el-form-item label="发行金额" prop='issueAmount' class='full-width '>
+            <div class='full-width light-purple-bg'>
+              <el-input  v-model="issueInfo.issueAmount" placeholder="选择发行金额">
+                <template #append>万元</template>
+              </el-input>
+            </div>
           </el-form-item>
-          <el-form-item label="发行期限">
-            <el-input v-model="issueInfo.issueRate"/>
+          <el-form-item label="发行期限" prop='issueRate'>
+            <el-input v-model="issueInfo.issueRate" placeholder="选择发行期限">
+              <template #append>年</template>
+            </el-input>
           </el-form-item>
-          <el-form-item label="发行利率">
-            <el-input v-model="issueInfo.issueTerm"/>
+          <el-form-item label="发行利率" prop='issueTerm'>
+            <el-input v-model="issueInfo.issueTerm" placeholder="选择发行利率">
+              <template #append>%</template>
+            </el-input>
           </el-form-item>
         </el-form>
         <div class="full-width flex flex-center mt-10">
@@ -114,6 +123,20 @@ export default {
         issueRate: '',
         issueTerm: '',
         projectId: ''
+      },
+      rules: {
+        issueDate: [
+          { required: true, message: '请选择发行时间', trigger: 'blur' }
+        ],
+        issueAmount: [
+          { required: true, message: '请输入发行金额', trigger: 'blur' }
+        ],
+        issueRate: [
+          { required: true, message: '请输入发行期限', trigger: 'blur' }
+        ],
+        issueTerm: [
+          { required: true, message: '请输入发行利率', trigger: 'blur' }
+        ]
       }
     }
   },

+ 11 - 11
src/views/home/file_detail.vue

@@ -1,6 +1,5 @@
 <template>
-  <div>
-    <div class="full-width flex flex-center grey-f-bg">
+    <div class="full-width flex flex-center grey-f-bg" style='width: 100vw;height: 100vh'>
       <el-card class="flex flex-col flex-center mt-20 white-bg ">
         <div class="font-24">{{ data.title }}</div>
         <div class="flex flex-center mt-20 grey-6">
@@ -16,40 +15,41 @@
         </div>
       </el-card>
     </div>
-
-  </div>
 </template>
 
 <route>
 {
 name: '文件详情',
+meta: {
+layout: 'empty',
+}
 }
 </route>
 
 <script>
 export default {
-  name: "fileDetail",
-  data() {
+  name: 'fileDetail',
+  data () {
     return {
       id: '',
       data: {},
-      imgList: [],
+      imgList: []
     }
   },
-  created() {
+  created () {
     this.id = this.$route.query.id
     this.getFileDetail()
   },
   methods: {
-    getFileDetail() {
+    getFileDetail () {
       this.$api.project.articleDetailByFile(this.id).then(res => {
         if (res.code === 200) {
           this.data = res.data
           if (this.data.category === 4) {
             // this.imgList = this.data.imgs.map(sub => sub.filePath);
-            let content = "";
+            let content = ''
             this.data.imgs.forEach(sub => {
-              let img = "<img src='" + sub.filePath + "'/>"
+              const img = "<img src='" + sub.filePath + "'/>"
               content = content + img
             })
             this.data.content = content

+ 49 - 49
src/views/recycle/index.vue

@@ -2,7 +2,7 @@
   <div class="full-height full-width flex flex-col">
     <avue-crud ref="crud"
                v-model="form"
-               v-model:page="page"
+               :page="page"
                :before-open="beforeOpen"
                :data="data"
                :option="option"
@@ -27,7 +27,7 @@ name: '回收站',
 
 export default {
   name: 'index',
-  data() {
+  data () {
     return {
       keyWords: '',
       loading: false,
@@ -62,23 +62,23 @@ export default {
             type: 'select',
             dicData: [
               {
-                label: "文件夹",
+                label: '文件夹',
                 value: 1
               },
               {
-                label: "文件",
+                label: '文件',
                 value: 2
               },
               {
-                label: "项目",
+                label: '项目',
                 value: 3
               },
               {
-                label: "阶段",
+                label: '阶段',
                 value: 4
               },
               {
-                label: "专债明细",
+                label: '专债明细',
                 value: 5
               }
             ]
@@ -89,64 +89,37 @@ export default {
           },
           {
             label: '删除人',
-            prop: 'createUser'
-          },]
+            prop: 'createUserName'
+          }]
       },
       page: {
-        pageSize: 15,
-        currentPage: 1,
+        size: 10,
+        current: 1,
         total: 0
       }
     }
   },
   methods: {
-    onLoad() {
+    onLoad () {
+      this.loading = true
       this.$api.recycle.recycleList().then(res => {
+        this.loading = false
         if (res.code === 200) {
           this.data = res.data.records
           this.page.total = res.data.total
-          this.loading = false;
+          this.loading = false
         }
       })
     },
-    beforeOpen(done, type) {
-      if (['view'].includes(type)) {
-
-      } else if (type === 'edit') {
-        this.$confirm("确定恢复所选择的文件?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
+    beforeOpen (done, type) {
+      if (type === 'edit') {
+        this.$confirm('确定恢复所选择的文件?', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
         })
-            .then(() => {
-              this.$api.recycle.recycleBack({recycleBinId: this.form.id}).then(res => {
-                if (res.code === 200) {
-                  this.$message.success(res.msg)
-                  this.onLoad()
-                } else {
-                  this.$message.error(res.msg)
-                }
-              })
-            })
-      }
-    },
-    currentChange(currentPage) {
-      this.page.currentPage = currentPage;
-    },
-    sizeChange(pageSize) {
-      this.page.pageSize = pageSize;
-    },
-    refreshChange() {
-      this.onLoad(this.page, this.query);
-    },
-    rowDel(row) {
-      this.$confirm("确定彻底删除所选择的文件?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      })
           .then(() => {
-            this.$api.recycle.recycleRemove({ids: row.id}).then(res => {
+            this.$api.recycle.recycleBack({ recycleBinId: this.form.id }).then(res => {
               if (res.code === 200) {
                 this.$message.success(res.msg)
                 this.onLoad()
@@ -155,7 +128,34 @@ export default {
               }
             })
           })
+      }
+    },
+    currentChange (currentPage) {
+      this.page.currentPage = currentPage
+    },
+    sizeChange (pageSize) {
+      this.page.pageSize = pageSize
+    },
+    refreshChange () {
+      this.onLoad(this.page, this.query)
     },
+    rowDel (row) {
+      this.$confirm('确定彻底删除所选择的文件?', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          this.$api.recycle.recycleRemove({ ids: row.id }).then(res => {
+            if (res.code === 200) {
+              this.$message.success(res.msg)
+              this.onLoad()
+            } else {
+              this.$message.error(res.msg)
+            }
+          })
+        })
+    }
   }
 }
 </script>