scorpioyq 2 years ago
parent
commit
6fa98b104a

+ 10 - 10
src/api/database/index.js

@@ -1,18 +1,18 @@
 import fetch from '../fetch.js'
 
 export default {
-  /**
+    /**
      * 资料库相关借口
      * @returns {Promise<unknown>}
      */
-  fileList (params) { // 项目资料列表
-    return fetch('/blade-project-manage/bladefile/v1/getAllList', params)
-  },
-  fileInfo (params) {
-    return fetch('/blade-project-manage/bladefile/v1/detail', params)
-  },
-  fileRemove (params) { // 删除项目
-    return fetch('/blade-project-manage/bladefile/v1/remove', params, 'post')
-  }
+    fileList(params) { // 项目资料列表
+        return fetch('/blade-project-manage-v2/folder/v2/getDataList', params)
+    },
+    fileInfo(params) {
+        return fetch('/blade-project-manage-v2/folder/v2/detail', params)
+    },
+    fileRemove(params) { // 删除项目
+        return fetch('/blade-project-manage/bladefile/v1/remove', params, 'post')
+    }
 
 }

+ 14 - 13
src/views/database/component/dialog_info.vue

@@ -6,13 +6,14 @@
       <img v-else-if="info.suffix === 'xlsx'" class="icon-1" src="../../../assets/svg/folder/xls.svg">
       <img v-else class="icon-1" src="../../../assets/svg/folder/other.svg">
     </div>
+    <div class="mb-10 font-16 bold" style="color: #AB7630">{{ info.title }}</div>
     <!------1----->
     <div class="flex flex-center full-width flex-justify-between mt-10">
       <div class="flex flex-col flex-align-start bg-1">
         <img class="icon-2" src="../../../assets/svg/1.svg">
         <span class="grey-6 bold mt-10">当前文件所在项目进度</span>
         <span class="mt-10 font-15 bold sp">{{
-            info.projectStageName ? info.projectStageName : '-'
+            info.stageName ? info.stageName : '-'
           }}</span>
       </div>
       <div class="flex flex-col bg-1">
@@ -24,7 +25,7 @@
         <img class="icon-2" src="../../../assets/svg/3.svg">
         <span class="grey-6 bold mt-10">当前文件所属类型</span>
         <span class="mt-10 font-15 bold sp">{{
-            info.folderTypeName ? info.folderTypeName : '-'
+            info.fileType ? info.fileType : '-'
           }}</span>
       </div>
     </div>
@@ -63,7 +64,7 @@
       <div class="flex flex-col grey-6-bg bg-3">
         <span class="grey-6 margin ml-20">{{ info.projectName ? info.projectName : '项目名称' }}</span>
         <div class="border-1"></div>
-        <span class="grey-6 margin ml-20">{{ info.projectDeptName ? info.projectDeptName : '主管部门' }}</span>
+        <span class="grey-6 margin ml-20">{{ info.chargeDeptName ? info.chargeDeptName : '主管部门' }}</span>
         <div class="border-1"></div>
         <span class="grey-6 margin ml-20">{{ info.totalAmount ? info.totalAmount : '-' }}万元</span>
       </div>
@@ -79,47 +80,47 @@
 
 <script>
 import baseButton from '../../../components/base-button.vue'
-import { bytesToSize } from '@/utils/tools.js'
+import {bytesToSize} from '@/utils/tools.js'
 
 export default {
   name: 'dialog_info',
-  components: { baseButton },
+  components: {baseButton},
   props: {
     id: String
   },
   watch: {
     id: {
-      handler () {
+      handler() {
         this.getFileInfo()
       },
       immediate: true
     }
   },
-  data () {
+  data() {
     return {
       size: '',
       info: {}
     }
   },
-  created () {
+  created() {
     this.getFileInfo()
   },
   methods: {
-    getFileInfo () {
-      this.$api.database.fileInfo({ id: this.id }).then(res => {
+    getFileInfo() {
+      this.$api.database.fileInfo({id: this.id}).then(res => {
         if (res.code === 200) {
           this.info = res.data
           this.toSize()
         }
       })
     },
-    toSize () {
+    toSize() {
       this.size = bytesToSize(this.info.volume)
     },
-    download () {
+    download() {
       window.open(this.info.url)
     },
-    showMsg () {
+    showMsg() {
       this.$alert('功能建设中,尽情期待...', '消息提醒', {
         confirmButtonText: 'OK'
       })

+ 23 - 23
src/views/database/component/list.vue

@@ -40,8 +40,8 @@ import dialogInfo from './dialog_info.vue'
 
 export default {
   name: 'list',
-  components: { dialogInfo },
-  data () {
+  components: {dialogInfo},
+  data() {
     return {
       showInfo: false,
       keyWords: '',
@@ -87,23 +87,23 @@ export default {
           }]
       },
       page: {
-        currentSize: 10,
-        currentPage: 1,
+        current: 1,
+        size: 10,
         total: 0
       },
       id: ''
     }
   },
-  created () {
+  created() {
     this.$bus.on('serachFile', (res) => {
       this.onLoad(res)
     })
   },
   methods: {
-    onLoad (query = {}) {
+    onLoad(query = {}) {
       this.page.current = this.page.currentPage
       this.page.size = this.page.pageSize
-      const data = { ...query, ...this.page }
+      const data = {...query, ...this.page}
       this.loading = true
       this.$api.database.fileList(data).then(res => {
         this.loading = false
@@ -113,16 +113,16 @@ export default {
         }
       })
     },
-    currentChange (currentPage) {
+    currentChange(currentPage) {
       this.page.current = currentPage
     },
-    sizeChange (pageSize) {
+    sizeChange(pageSize) {
       this.page.size = pageSize
     },
-    refreshChange () {
+    refreshChange() {
       this.onLoad(this.page, this.query)
     },
-    beforeOpen (done, type) {
+    beforeOpen(done, type) {
       if (['view'].includes(type)) {
         this.showInfo = true
         console.log(this.showInfo)
@@ -130,28 +130,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) {
+    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
     }
   }

+ 15 - 18
src/views/database/component/serach.vue

@@ -2,27 +2,26 @@
   <div class="flex flex-col flex-justify-between padding white-bg">
     <el-form v-model="form" class="lab mt-20" label-width="120px">
       <el-col :span="24" class="flex flex-center">
-        <el-col :span="8">
+        <el-col :span="12">
           <el-form-item class="full-width" label="搜索文件">
             <el-input
-                v-model="form.fileKeyWords"
-                clearable
+                v-model="form.keyword"
                 placeholder="输入文件关键字"
                 prefix-icon="Search"
             />
           </el-form-item>
         </el-col>
-        <el-col :span="8">
-          <el-form-item class="full-width" label="搜索项目">
-            <el-input
-                v-model="form.projectKeyWords"
-                clearable
-                placeholder="输入项目关键字"
-                prefix-icon="Search"
-            />
-          </el-form-item>
-        </el-col>
-        <el-col :span="8" class="flex flex-center">
+        <!--        <el-col :span="8">-->
+        <!--          <el-form-item class="full-width" label="搜索项目">-->
+        <!--            <el-input-->
+        <!--                v-model="form.projectKeyWords"-->
+        <!--                clearable-->
+        <!--                placeholder="输入项目关键字"-->
+        <!--                prefix-icon="Search"-->
+        <!--            />-->
+        <!--          </el-form-item>-->
+        <!--        </el-col>-->
+        <el-col :span="12" class="flex flex-center">
           <!----时间区间间选择---->
           <el-form-item class="full-width" label="上传时间">
             <el-col :span="11">
@@ -84,8 +83,7 @@ export default {
   data() {
     return {
       form: {
-        projectKeyWords: '',
-        fileKeyWords: '',
+        keyword: '',
         startTime: '',
         endTime: ''
       }
@@ -97,8 +95,7 @@ export default {
     },
     clear() {
       this.form = {
-        projectKeyWords: '',
-        fileKeyWords: '',
+        keyword: '',
         startTime: '',
         endTime: ''
       }