scorpio 2 роки тому
батько
коміт
533bc1a046

+ 3 - 3
src/api/company/index.js

@@ -6,14 +6,14 @@ export default {
    * @returns {Promise | Promise<unknown>}
    */
   list (params) {
-    return fetch('/blade-project-manage-v2/companyfilefolder/v1/page', params)
+    return fetch('/blade-project-manage-v2/companyfilefolder/v2/page', params)
   },
   /**
      * 创建公司文件夹
      * @returns {Promise<unknown>}
      */
   submint (params) {
-    return fetch('/blade-project-manage-v2/companyfilefolder/v1/save', params, 'post', 'json')
+    return fetch('/blade-project-manage-v2/companyfilefolder/v2/save', params, 'post', 'json')
   },
   /**
    *
@@ -21,7 +21,7 @@ export default {
    * @returns {Promise | Promise<unknown>}
    */
   removeList (params) {
-    return fetch('/blade-project-manage-v2/companyfilefolder/v1/remove', params, 'post')
+    return fetch('/blade-project-manage-v2/companyfilefolder/v2/remove', params, 'post')
   }
 
 }

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

@@ -12,7 +12,7 @@ export default {
         return fetch('/blade-project-manage-v2/folder/v2/detail', params)
     },
     fileRemove(params) { // 删除项目
-        return fetch('/blade-project-manage/bladefile/v1/remove', params, 'post')
+        return fetch('/blade-project-manage-v2/bladefile/v2/remove', params, 'post')
     }
 
 }

+ 1 - 0
src/api/index.js

@@ -8,6 +8,7 @@ import task from './task/index.js'
 import company from './company/index.js'
 
 export default {
+  offices: ['pdf', 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'],
   uploadPath: '/api/wutong-file/minio/file/upload', // 上传
   login,
   system,

+ 1 - 1
src/api/login/index.js

@@ -26,7 +26,7 @@ export default {
     return fetch('/blade-auth/oauth/logout')
   },
   getUserInfo () {
-    return fetch('/blade-project-manage-v2/other/v1/getUserInfo')
+    return fetch('/blade-project-manage-v2/other/v2/getUserInfo')
   },
   /**
    * 获取按钮权限

+ 18 - 15
src/api/project/index.js

@@ -16,25 +16,25 @@ export default {
     return fetch('/blade-project-manage-v2/project/v2/save', params, 'post', 'json')
   },
   projectRemove (params) { // 删除项目
-    return fetch('/blade-project-manage/project/v1/remove', params, 'post')
+    return fetch('/blade-project-manage-v2/project/v2/remove', params, 'post')
   },
   typeList (params) { // 项目分类列表
     return fetch('//blade-project-manage-v2/typeAndStage/v2/page', params)
   },
   projectInfo (id) { // 项目详细信息
-    return fetch('/blade-project-manage/project/v1/detail/' + id)
+    return fetch('/blade-project-manage-v2/project/v2/detail/?id=' + id)
   },
   proUpdate (params) { // 项目信息更新
-    return fetch('/blade-project-manage/project/v1/update', params, 'post', 'json')
+    return fetch('/blade-project-manage-v2/project/v2/update', params, 'post', 'json')
   },
   issuanceDetail (params) { // 项目发行明细
-    return fetch('/blade-project-manage/projectdetail/v1/list', params)
+    return fetch('/blade-project-manage-v2/projectdetail/v2/list', params)
   },
   issueAdd (params) { // 新增发行明细
-    return fetch('/blade-project-manage/projectdetail/v1/save', params, 'post', 'json')
+    return fetch('/blade-project-manage-v2/projectdetail/v2/save', params, 'post', 'json')
   },
   userStageList () { // 统计用户阶段项目数
-    return fetch('/blade-project-manage/stage/v1/countProjectStagelist')
+    return fetch('/blade-project-manage-v2/stage/v2/projectCount')
   },
   includeStage (params) { // 单个项目包含阶段
     return fetch('/blade-project-manage-v2/stage/v2/projectStages', params)
@@ -43,22 +43,22 @@ export default {
     return fetch('/blade-project-manage-v2/folder/v2/listByStageId', params)
   },
   sqRecord (params) { // 文件夹授权记录
-    return fetch('/blade-project-manage/qrcode/v1/grantLog', params)
+    return fetch('/blade-project-manage-v2/qrcode/v2/grantLog', params)
   },
   findFiles (params) { // 文件搜索
-    return fetch('/blade-project-manage/bladefile/v1/findFileList', params)
+    return fetch('/blade-project-manage-v2/bladefile/v2/findFileList', params)
   },
   folderListAll (params) { // 历史数据文件夹列表
-    return fetch('/blade-project-manage/filefolder/v1/list', params)
+    return fetch('/blade-project-manage-v2/filefolder/v2/list', params)
   },
   folderRemove (params) { // 删除文件夹
-    return fetch('/blade-project-manage/filefolder/v1/remove', params, 'post')
+    return fetch('/blade-project-manage-v2/filefolder/v2/remove', params, 'post')
   },
   folderAdd (params) { // 添加文件夹
-    return fetch('/blade-project-manage/filefolder/v1/save', params, 'post', 'json')
+    return fetch('/blade-project-manage-v2/filefolder/v2/save', params, 'post', 'json')
   },
   folderUpdate (params) { // 文件夹更新
-    return fetch('/blade-project-manage/filefolder/v1/update', params, 'post', 'json')
+    return fetch('/blade-project-manage-v2/filefolder/v2/update', params, 'post', 'json')
   },
   fileList (params) { // 文件夹里包含文件列表
     return fetch('/blade-project-manage-v2/folder/v2/getListByFolderId', params)
@@ -73,7 +73,7 @@ export default {
     return fetch('/blade-project-manage-v2/folder/v2/saveFile', params, 'post', 'json')
   },
   fileRemove (params) { // 删除文件
-    return fetch('/blade-project-manage/bladefile/v1/remove', params, 'post')
+    return fetch('/blade-project-manage-v2/bladefile/v2/remove', params, 'post')
   },
   /**
      * 业主主动授权
@@ -89,7 +89,7 @@ export default {
      * @returns {Promise | Promise<unknown>}
      */
   send (params) {
-    return fetch('/blade-project-manage/frontMessage/v1/sendMessage', params)
+    return fetch('/blade-project-manage-v2/frontMessage/v2/sendMessage', params)
   },
   /**
      * 服务商主动申请文件授权
@@ -97,7 +97,7 @@ export default {
      * @returns {Promise<unknown>}
      */
   apply (params) {
-    return fetch('/blade-project-manage/grant/v1/applyGrant', params, 'post', 'json')
+    return fetch('/blade-project-manage-v2/grant/v2/applyGrant', params, 'post', 'json')
   },
   folderType (params) {
     return fetch('/blade-project-manage-v2/dict/v2/getDictList', params)
@@ -112,5 +112,8 @@ export default {
   },
   total (params) {
     return fetch('/blade-project-manage-v2/searcher/v2/getTotalByKeyword', params, 'post')
+  },
+  totalAmount (params) {
+    return fetch('/blade-project-manage-v2/project/v2/getTotalAmount', params)
   }
 }

+ 3 - 3
src/api/recycle/index.js

@@ -6,13 +6,13 @@ export default {
      * @returns {Promise<unknown>}
      */
   recycleList (params) { // 回收站列表
-    return fetch('/blade-project-manage/recyclebin/v1/list', params)
+    return fetch('/blade-project-manage-v2/recyclebin/v2/list', params)
   },
   recycleBack (params) { // 恢复文件
-    return fetch('/blade-project-manage/recyclebin/v1/back', params)
+    return fetch('/blade-project-manage-v2/recyclebin/v2/back', params)
   },
   recycleRemove (params) { // 删除
-    return fetch('/blade-project-manage/recyclebin/v1/remove', params, 'post')
+    return fetch('/blade-project-manage-v2/recyclebin/v2/remove', params, 'post')
   }
 
 }

+ 32 - 8
src/api/task/index.js

@@ -1,15 +1,39 @@
 import fetch from '../fetch.js'
 
 export default {
-    /**
+  /**
      * 创建任务
      * @returns {Promise<unknown>}
      */
-    add(params) {
-        return fetch('/blade-project-manage-v2/userTask/v2/createTask', params, 'post', 'json')
-    },
-    taskList(params) {
-        return fetch('/blade-project-manage-v2/userTask/v2/list', params)
-    }
-
+  add (params) {
+    return fetch('/blade-project-manage-v2/userTask/v2/createTask', params, 'post', 'json')
+  },
+  taskList (params) {
+    return fetch('/blade-project-manage-v2/userTask/v2/list', params)
+  },
+  detail (params) {
+    return fetch('/blade-project-manage-v2/userTask/v2/detail', params)
+  },
+  /**
+     * 根据文件夹id 获取下级文件
+     * @param params
+     * @returns {Promise | Promise<unknown>}
+     */
+  fileList (params) {
+    return fetch('/blade-project-manage-v2/userTask/v2/getListByParentId', params)
+  },
+  /**
+   * 上传文件任务
+   */
+  uploadFile (params) {
+    return fetch('/blade-project-manage-v2/userTask/v2/uploadFile', params, 'post', 'json')
+  },
+  /**
+   * 完成任务提交
+   * @param params
+   * @returns {Promise<unknown>}
+   */
+  completeTask (params) {
+    return fetch('/blade-project-manage-v2/userTask/v2/commit', params)
+  }
 }

+ 10 - 8
src/components/basic-curd/index.vue

@@ -2,18 +2,19 @@
   <div class='mt-10'>
     <!--    header-->
     <div class='flex flex-center full-width border-bottom padding-bottom padding-top'>
-      <div class='flex-child-average' v-for='item in option.column' :key='item.label'>{{ item.label }}</div>
+      <div class='flex-child-average  ml-20' v-for='item in option.column' :key='item.label'>{{ item.label }}</div>
     </div>
     <!--    tabel-->
     <el-empty v-if='data && data.length === 0'/>
     <div v-else class='flex flex-center flex-col full-width'>
       <div class='flex-child-average border-bottom flex full-width flex-center' v-for='(item,index) in data'
            :key='item.title'>
-        <div class='full-width  ' v-for='(sub,subIndex) in option.column' :key='sub.label'>
+        <div class='full-width' v-for='(sub,subIndex) in option.column' :key='sub.label'>
           <div v-if='sub.prop!== "action" ' class='flex flex-center'>
-            <div v-if='subIndex === 0' style='width: 100px'>
+<!--            item 说明-->
+            <div v-if='subIndex === 0'>
               <div v-if='[1].includes(item.type)'>
-                <img v-if="item.suffix === 'docx'" class="icon" src="../../assets/svg/folder/doc.svg">
+                <img v-if="item.suffixasdfa === 'docx'" class="icon" src="../../assets/svg/folder/doc.svg">
                 <img v-else-if="item.suffix === 'pdf'" class="icon" src="../../assets/svg/folder/pdf.svg">
                 <img v-else-if="item.suffix === 'xls'" class="icon" src="../../assets/svg/folder/xls.svg">
                 <img v-else class="icon" src="../../assets/svg/folder/other.svg">
@@ -24,13 +25,14 @@
                 <img v-else src="../../assets/svg/folder/invisible.svg" class="icon-1">
               </div>
             </div>
-            <div class='full-width'>{{ item[sub.prop] }}</div>
+            <div class='full-width ml-20' :class='subIndex === 0 ? "text-left":"" '>{{ item[sub.prop] }}</div>
           </div>
           <div v-else>
             <div class='flex flex-center'>
-              <main-button icon="View" title="详情" width="85" @click="rowView(item,index)"/>
-              <main-button icon="Download" v-if='item.type!== 3' title="下载" width="85" @click="View(item)"/>
-              <main-button icon="Delete" title="删除" width="85" @click="rowDel(item,index)"/>
+              <main-button icon="View" title="详情" width="85" v-if='option.viewBtn' @click="rowView(item,index)"/>
+              <main-button icon="Download" v-if='[1].includes(item.type)' title="下载" width="85" @click="View(item)"/>
+              <main-button icon="Delete" title="删除" width="85" v-if='option.delBtn' @click="rowDel(item,index)"/>
+              <slot name='menu' :row="item"></slot>
             </div>
           </div>
         </div>

+ 8 - 0
src/utils/tools.js

@@ -13,3 +13,11 @@ export function vaildData (key, defaultValue = Boolean) {
     return defaultValue
   }
 }
+
+export function objectToParams (objs) {
+  const query = []
+  for (const k in objs) {
+    query.push(k + '=' + objs[k])
+  }
+  return query.join('&')
+}

+ 16 - 8
src/views/company/index.vue

@@ -24,7 +24,7 @@
             <base-button class="ml-20 " icon="Plus" title="上传文件"
                          @click="show = true"/>
             <base-button class="ml-20 " icon="Back" title="返回上一层"
-                         v-if='currentFolder && currentFolder.parentId !== 0'
+                         v-if='currentFolder && currentFolder.parentId !== "0"'
                          @click="backFolder"/>
           </div>
 
@@ -80,6 +80,12 @@
   </el-row>
 </template>
 
+<route>
+{
+name: '公司资料'
+}
+</route>
+
 <script>
 import BasicContainer from '@/components/basic-container/main.vue'
 import baseButton from '@/components/base-button.vue'
@@ -146,7 +152,7 @@ export default {
       this.$api.company.list({ current: 1, size: 100, parentId: '' }).then(res => {
         if (res.code === 200) {
           this.folders = res.data.records
-          if (this.folders.length > 0 && this.currentFolder !== null) {
+          if (this.folders.length > 0) {
             this.currentFolder = this.folders[0]
           }
           this.onLoad()
@@ -225,11 +231,13 @@ export default {
     },
     rowDetail (row, index) {
       if (row.type === 1) {
-        this.imgList = [row.url]
-        this.showImage = true
-      } else if (row.type === 2) {
-        const routeData = this.$router.resolve({ path: '/home/file_detail', query: { id: row.fileId } })
-        window.open(routeData.href, '_blank')
+        if (['pdf', 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'].includes(row.suffix)) {
+          const routeData = this.$router.resolve({ path: '/home/file_detail', query: { id: row.fileId } })
+          window.open(routeData.href, '_blank')
+        } else {
+          this.imgList = [row.url]
+          this.showImage = true
+        }
       } else {
         this.lastParentFolder = this.lastParentFolder.filter(sub => sub.id !== this.currentFolder.id)
         this.lastParentFolder.push(this.currentFolder)
@@ -263,7 +271,7 @@ export default {
         return
       }
       this.fileList.forEach(sub => {
-        if (['pdf', 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'].includes(sub.suffix)) {
+        if (api.offices.includes(sub.suffix)) {
           // save Library
           const data = {
             title: sub.originalFileName,

+ 12 - 3
src/views/home/component/dash.vue

@@ -13,7 +13,7 @@
              class="flex flex-col  flex-center mt-20 bold font-16 pointer" @click='switchTab(item,index)'
              >
           <span class=" sp">{{ item.name }}</span>
-          <span class=" sp1 mt-5">{{ item.projectNumber }}<span class="grey font-14 ml-5">个</span></span>
+          <span class=" sp1 mt-5">{{ item.count }}<span class="grey font-14 ml-5">个</span></span>
         </div>
       </div>
       <div v-if='permissions.permissions?.projectAdd' class='flex flex-center flex-justify-start'>
@@ -129,7 +129,7 @@
                      @close='showImport = false'
                      accept='.xls,.xlsx'
                      :data='{isCovered:0}'
-                     action='/api/blade-project-manage/project/import-project'
+                     action='/api/blade-project-manage-v2/project/import-project'
                      @success='success'>确 定</upload-file>
       </div>
       <el-divider/>
@@ -288,11 +288,11 @@ export default {
         this.loading = false
         if (res.code === 200) {
           this.data = res.data.records
-          this.num = res.msg
           this.page.total = res.data.total
           this.loading = false
         }
         this.getStageList()
+        this.getTotalAmount()
       })
     },
     beforeOpen (done, type) {
@@ -344,6 +344,15 @@ export default {
         }
       })
     },
+    getTotalAmount () {
+      this.$api.project.totalAmount(this.query).then(res => {
+        if (res.code === 200) {
+          this.num = res.data
+        } else {
+          this.$message.error(res.msg)
+        }
+      })
+    },
     getTypeList () {
       this.$api.project.typeList({ type: 1, size: 999, current: 1 }).then(res => {
         this.typeList = res.data.records

+ 7 - 1
src/views/home/component/task.vue

@@ -33,6 +33,7 @@
         <vue-qr :currentLevel='3' :logoCornerRadius='4' :logoScale='0.25'  :text='qrCodeText'
                 size='340'/>
         <span>右键复制二维码,通过微信进行分享</span>
+        <span>{{qrCodeText}}</span>
       </div>
     </el-dialog>
   </div>
@@ -41,6 +42,7 @@
 
 <script>
 import VueQr from 'vue-qr/src/packages/vue-qr.vue'
+import { objectToParams } from '@/utils/tools.js'
 export default {
   name: 'task',
   components: { VueQr },
@@ -82,12 +84,16 @@ export default {
         this.$message.error('请按要求选择时间段')
         return
       }
-      this.form.folderIds = this.folders.map(sub => sub.fileFolderId)
+      this.form.folderIds = this.folders.map(sub => sub.id)
       this.form.taskStartTime = this.form.date[0]
       this.form.taskEndTime = this.form.date[1]
+      this.form.projectId = this.projectId
       this.$api.task.add(this.form).then(res => {
         if (res.code === 200) {
           this.$message.success(res.msg)
+          this.qrCodeShow = true
+          const data = res.data
+          this.qrCodeText = 'https://dev.wutongresearch.club/apply?id=' + data.qrcodeId + '&' + objectToParams(res.data)
         } else {
           this.$message.error(res.msg)
         }

+ 22 - 112
src/views/task/Index.vue

@@ -1,132 +1,42 @@
 <template>
   <basic-container class='margin'>
-    <avue-crud
-        :option="option"
-        :data="data"
-        ref="crud"
-        v-model="form"
-        :before-open="beforeOpen"
-        @row-del="rowDel"
-        @row-save="rowSave"
-        @row-update="rowUpdate"
-        @on-load="onLoad">
-    </avue-crud>
+    <el-tabs type="card" @tab-change='taskChange'>
+      <el-tab-pane label="我的任务">
+      </el-tab-pane>
+      <el-tab-pane label="我下发的任务"/>
+    </el-tabs>
+    <my-task v-if='currentTab === "0"'></my-task>
+    <task v-if='currentTab === "1"'></task>
   </basic-container>
 </template>
 
+<route>
+{
+name: '任务列表'
+}
+</route>
+
 <script>
 import BasicContainer from '@/components/basic-container/main.vue'
+import MyTask from '@/views/task/component/my-task.vue'
+import Task from '@/views/task/component/task.vue'
 
 export default {
   name: 'Index',
-  components: {BasicContainer},
-  data() {
+  components: { Task, MyTask, BasicContainer },
+  data () {
     return {
+      currentTab: '0',
       taskShow: false,
+      showFolder: false,
       form: {},
       data: [],
-      option: {
-        align: 'center',
-        menuAlign: 'center',
-        menuWidth: 380,
-        size: 'mini',
-        addBtn: false,
-        refreshBtn: false,
-        columnBtn: false,
-        labelWidth: 140,
-        border: true,
-        column: [
-          {
-            label: '任务名称',
-            prop: 'noticeType'
-          },
-          {
-            label: '任务要求',
-            prop: 'noticeType'
-          },
-          {
-            label: '所属项目',
-            prop: 'noticeType'
-          },
-          {
-            label: '下发人',
-            prop: 'noticeType'
-          },
-          {
-            label: '下发时间',
-            prop: 'noticeType'
-          },
-          {
-            label: '任务状态',
-            prop: 'noticeType'
-          }
-        ]
-      },
-      page: {
-        pageSize: 10,
-        currentPage: 1,
-        total: 10,
-        type: 1
-      },
+      taskFolder: []
     }
   },
   methods: {
-    onLoad() {
-      this.loading = true
-      this.page.current = this.page.currentPage
-      this.page.size = this.page.pageSize
-      this.$api.task.taskList(this.page).then(res => {
-        this.loading = false
-        if (res.code === 200) {
-          this.data = res.data.records
-          this.page.total = res.data.total
-        }
-      })
-    },
-    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.size = pageSize
-    },
-    refreshChange() {
-      this.onLoad()
-    },
-    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)
-              }
-            })
-          })
+    taskChange (res) {
+      this.currentTab = res
     }
   }
 }

+ 150 - 0
src/views/task/component/my-task.vue

@@ -0,0 +1,150 @@
+<template>
+  <avue-crud
+      :option="option"
+      :data="data"
+      ref="crud"
+      v-model="form"
+      :before-open="beforeOpen"
+      @row-del="rowDel"
+      @row-save="rowSave"
+      @row-update="rowUpdate"
+      @on-load="onLoad">
+    <template #menu-left="{}">
+      <el-button-group>
+        <el-button type='primary' :plain='query.type !== "0" ' @click='changeQueryType("0")'>待完成</el-button>
+        <el-button type='primary' :plain='query.type !== "1" ' @click='changeQueryType("1")'>已完成</el-button>
+        <el-button type='primary' :plain='query.type !== "" ' @click='changeQueryType("")'>全部</el-button>
+      </el-button-group>
+    </template>
+    <template #menu="{row}">
+      <el-button type='primary' text icon='Position' @click='changeQueryType("0")'>提交</el-button>
+    </template>
+  </avue-crud>
+</template>
+
+<script>
+export default {
+  name: 'my-task',
+  data () {
+    return {
+      query: {
+        type: '0'
+      },
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 10
+      },
+      data: [],
+      form: {},
+      option: {
+        align: 'center',
+        menuAlign: 'center',
+        menuWidth: 380,
+        size: 'mini',
+        addBtn: false,
+        viewBtn: true,
+        editBtn: false,
+        delBtn: false,
+        refreshBtn: false,
+        columnBtn: false,
+        labelWidth: 140,
+        border: true,
+        column: [
+          {
+            label: '任务名称',
+            prop: 'title'
+          },
+          {
+            label: '任务要求',
+            prop: 'remark'
+          },
+          {
+            label: '所属项目',
+            prop: 'projectName'
+          },
+          {
+            label: '下发人',
+            prop: 'dispatcherUserName'
+          },
+          {
+            label: '下发时间',
+            prop: 'createTime'
+          },
+          {
+            label: '任务状态',
+            prop: 'isCompleted',
+            type: 'select',
+            dicData: [
+              {
+                label: '待完成',
+                value: 0
+              },
+              {
+                label: '已完成',
+                value: 1
+              }
+            ]
+          }
+        ]
+      }
+    }
+  },
+  methods: {
+    onLoad () {
+      this.loading = true
+      this.page.current = this.page.currentPage
+      this.page.size = this.page.pageSize
+      this.$api.task.taskList(Object.assign(this.page, this.query)).then(res => {
+        this.loading = false
+        if (res.code === 200) {
+          this.data = res.data.records
+          this.page.total = res.data.total
+        }
+      })
+    },
+    beforeOpen (done, type) {
+      if (type === 'view') {
+        this.$router.push({ path: '/task/detail', query: { id: this.form.id, taskId: this.form.taskId } })
+      } else {
+        done()
+      }
+    },
+    currentChange (currentPage) {
+      this.page.currentPage = currentPage
+    },
+    sizeChange (pageSize) {
+      this.page.size = pageSize
+    },
+    refreshChange () {
+      this.onLoad()
+    },
+    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)
+            }
+          })
+        })
+    },
+    changeQueryType (type) {
+      this.query.type = type
+      this.onLoad()
+    }
+
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 150 - 0
src/views/task/component/task.vue

@@ -0,0 +1,150 @@
+<template>
+  <avue-crud
+      :option="option"
+      :data="data"
+      ref="crud"
+      v-model="form"
+      :before-open="beforeOpen"
+      @row-del="rowDel"
+      @row-save="rowSave"
+      @row-update="rowUpdate"
+      @on-load="onLoad">
+    <template #menu-left="{}">
+      <el-button-group>
+        <el-button type='primary' :plain='query.type !== "0" ' @click='changeQueryType("0")'>待完成</el-button>
+        <el-button type='primary' :plain='query.type !== "1" ' @click='changeQueryType("1")'>已完成</el-button>
+        <el-button type='primary' :plain='query.type !== "" ' @click='changeQueryType("")'>全部</el-button>
+      </el-button-group>
+    </template>
+    <template #menu="{row}">
+      <el-button type='primary' text icon='Position' @click='changeQueryType("0")'>提交</el-button>
+    </template>
+  </avue-crud>
+</template>
+
+<script>
+export default {
+  name: 'my-task',
+  data () {
+    return {
+      query: {
+        type: '0'
+      },
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 10
+      },
+      data: [],
+      form: {},
+      option: {
+        align: 'center',
+        menuAlign: 'center',
+        menuWidth: 380,
+        size: 'mini',
+        addBtn: false,
+        viewBtn: true,
+        editBtn: false,
+        delBtn: false,
+        refreshBtn: false,
+        columnBtn: false,
+        labelWidth: 140,
+        border: true,
+        column: [
+          {
+            label: '任务名称',
+            prop: 'title'
+          },
+          {
+            label: '任务要求',
+            prop: 'remark'
+          },
+          {
+            label: '所属项目',
+            prop: 'projectName'
+          },
+          {
+            label: '下发人',
+            prop: 'dispatcherUserName'
+          },
+          {
+            label: '下发时间',
+            prop: 'createTime'
+          },
+          {
+            label: '任务状态',
+            prop: 'isCompleted',
+            type: 'select',
+            dicData: [
+              {
+                label: '待完成',
+                value: 0
+              },
+              {
+                label: '已完成',
+                value: 1
+              }
+            ]
+          }
+        ]
+      }
+    }
+  },
+  methods: {
+    onLoad () {
+      this.loading = true
+      this.page.current = this.page.currentPage
+      this.page.size = this.page.pageSize
+      this.$api.task.taskList(Object.assign(this.page, this.query)).then(res => {
+        this.loading = false
+        if (res.code === 200) {
+          this.data = res.data.records
+          this.page.total = res.data.total
+        }
+      })
+    },
+    beforeOpen (done, type) {
+      if (type === 'view') {
+        this.$router.push({ path: '/task/detail', query: { id: this.form.id, taskId: this.form.taskId } })
+      } else {
+        done()
+      }
+    },
+    currentChange (currentPage) {
+      this.page.currentPage = currentPage
+    },
+    sizeChange (pageSize) {
+      this.page.size = pageSize
+    },
+    refreshChange () {
+      this.onLoad()
+    },
+    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)
+            }
+          })
+        })
+    },
+    changeQueryType (type) {
+      this.query.type = type
+      this.onLoad()
+    }
+
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 281 - 0
src/views/task/detail.vue

@@ -0,0 +1,281 @@
+<template>
+  <basic-container class='mt-10'>
+    <div class='flex flex-align-start flex flex-col'>
+      <span class='bold'>任务基本信息:</span>
+      <el-divider/>
+      <div v-if='taskInfo' class='flex flex-align-start flex-col '>
+        <div>
+          <span class='bold'>任务名称:</span>
+          <span>{{ taskInfo.title }}</span>
+        </div>
+        <div class='mt-10'>
+          <span class='bold'>任务说明:</span>
+          <span>{{ taskInfo.remark }}</span>
+        </div>
+        <div class='mt-10'>
+          <span class='bold'>任务时间:</span>
+          <span>{{ taskInfo.startTime }} - {{ taskInfo.endTime }}</span>
+        </div>
+        <div class='mt-10'>
+          <span class='bold'>任务状态:</span>
+          <el-tag>{{ taskInfo.isCompleted === 0 ? '未完成':'已完成' }}</el-tag>
+        </div>
+      </div>
+    </div>
+  </basic-container>
+  <basic-container>
+    <div class='flex flex-align-start flex flex-col full-width '>
+      <span class='bold'>任务相关文件夹:</span>
+      <el-divider/>
+      <div class='full-width flex flex-justify-between'>
+        <el-button icon='back' type='primary'  @click='back'>
+          返回上一级
+        </el-button>
+        <el-button icon='Check' type='primary' v-if='this.folderList.length === 0 && taskInfo && taskInfo.isCompleted === 0 ' @click='completeTask'>
+          完成任务
+        </el-button>
+      </div>
+      <basic-curd class='full-width' :data='data' :option='taskOption' @row-view='rowDetail'>
+        <template #menu='{row}'>
+          <main-button title='提交文件' v-if='row.type === 2' icon='Position' @click='postFile(row)'/>
+        </template>
+      </basic-curd>
+    </div>
+<!--    upload-->
+    <el-dialog v-model='show' title='上传文件'>
+      <div>
+        <el-upload
+            drag
+            :action="action"
+            multiple
+            accept='.doc,.docx,.pdf,.xls,.xlsx,.png,.jpg,.jpeg,.ppt,pptx'
+            show-file-list
+            :on-success='uploadSuccess'
+        >
+          <el-icon class="el-icon--upload">
+            <upload-filled/>
+          </el-icon>
+          <div class="el-upload__text">
+            拖拽或者 <em>点击上传文件</em>
+          </div>
+        </el-upload>
+        <el-divider/>
+        <div class='flex flex-justify-end'>
+          <el-button @click='show = false'>取 消</el-button>
+          <el-button type='primary' @click='saveFile'>确 定</el-button>
+        </div>
+      </div>
+    </el-dialog>
+    <el-image-viewer
+        v-if='showImage'
+        :url-list="imgList"
+        @close='showImage = false'
+    />
+  </basic-container>
+</template>
+<route>
+{
+name: '任务详情'
+}
+</route>
+
+<script>
+import BasicContainer from '@/components/basic-container/main.vue'
+import basicCurd from '@/components/basic-curd/index.vue'
+import MainButton from '@/components/main-button.vue'
+import api from '@/api/index.js'
+
+export default {
+  name: 'detail',
+  components: { MainButton, BasicContainer, basicCurd },
+  data () {
+    return {
+      showImage: false,
+      imgList: [],
+      show: false,
+      action: api.uploadPath,
+      fileList: [],
+      id: '',
+      taskId: '',
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 10
+      },
+      isAccess: 3,
+      current: null,
+      currentFolder: null,
+      taskInfo: null,
+      folderList: [],
+      resultFile: [],
+      data: [],
+      taskOption: {
+        viewBtn: true,
+        editBtn: false,
+        delBtn: false,
+        column: [
+          {
+            label: '文件夹',
+            prop: 'folderName'
+          },
+          {
+            label: '更新时间',
+            prop: 'updateTime'
+          }
+        ]
+      }
+    }
+  },
+  created () {
+    this.id = this.$route.query.id
+    this.taskId = this.$route.query.taskId
+    this.detail()
+  },
+  methods: {
+    detail () {
+      const data = { taskId: this.taskId }
+      this.$api.task.detail(Object.assign(data, this.page)).then(res => {
+        if (res.code === 200) {
+          this.data = res.data.records.map(sub => {
+            sub.parentId = 0
+            sub.type = 2
+            return sub
+          })
+          this.current = this.data[0]
+          this.isAccess = this.data[0].isAccess
+          this.taskInfo = this.data[0]
+        } else {
+          this.$message.error(res.msg)
+        }
+      })
+    },
+    rowDetail (row, index) {
+      if (row.type === 2) {
+        const data = { folderId: row.folderId }
+        this.folderList.push(row)
+        this.current = row
+        this.current.parentId = row.folderId
+        this.$api.task.fileList(data).then(res => {
+          if (res.code === 200) {
+            this.data = res.data.records.map(sub => {
+              sub.folderName = sub.title
+              // 继承上级的权限
+              sub.isAccess = row.isAccess
+              // rowDetail 需要folderId
+              sub.folderId = sub.id
+              return sub
+            })
+          } else {
+            this.$message.error(res.msg)
+          }
+        })
+      } else {
+        if (api.offices.includes(row.suffix)) {
+          const routeData = this.$router.resolve({ path: '/home/file_detail', query: { id: row.fileId } })
+          window.open(routeData.href, '_blank')
+        } else {
+          this.imgList = [row.url]
+          this.showImage = true
+        }
+      }
+    },
+    back () {
+      if (this.folderList.length === 0) {
+        this.$message.error('已经是最后一级了')
+        return
+      }
+      this.folderList.pop()
+      this.current = this.folderList[this.folderList.length - 1]
+      if (this.folderList.length === 0) {
+        this.detail()
+      } else {
+        const data = { folderId: this.current.folderId }
+        this.$api.task.fileList(data).then(res => {
+          if (res.code === 200) {
+            this.data = res.data.records.map(sub => {
+              sub.folderName = sub.title
+              // 继承上级的权限
+              sub.isAccess = this.isAccess
+              // rowDetail 需要folderId
+              sub.folderId = sub.id
+              return sub
+            })
+          } else {
+            this.$message.error(res.msg)
+          }
+        })
+      }
+    },
+    postFile (row) {
+      console.log(row)
+      this.currentFolder = row
+      this.show = true
+    },
+    completeTask (row) {
+      this.$api.task.completeTask({ taskId: this.taskId }).then(res => {
+        if (res.code === 200) {
+          this.$message.success(res.msg)
+        } else {
+          this.$message.error(res.msg)
+        }
+      })
+    },
+    uploadSuccess (res, file, files) {
+      this.fileList = files.map(sub => sub.response.data)
+    },
+    saveFile () {
+      if (this.fileList.length === 0) {
+        return
+      }
+      this.fileList.forEach(sub => {
+        if (['pdf', 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'].includes(sub.suffix)) {
+          // save Library
+          const data = {
+            title: sub.originalFileName,
+            fileId: sub.id,
+            suffix: sub.suffix,
+            volume: sub.volume,
+            url: sub.filePath,
+            category: 4,
+            content: '',
+            parentId: this.currentFolder.folderId
+          }
+          this.$api.common.submit(data).then(res => {
+            if (res.code === 200) {
+              console.log(res.msg)
+            } else {
+              this.$message.error(res.msg)
+            }
+          })
+        }
+      })
+      this.addFile()
+    },
+    /**
+     * 上传文件
+     */
+    addFile () {
+      this.fileList = this.fileList.map(sub => {
+        sub.parentId = this.currentFolder.folderId
+        sub.projectId = this.currentFolder.projectId
+        sub.title = sub.originalFileName
+        sub.fileId = sub.id
+        sub.url = sub.filePath
+        return sub
+      })
+      const data = { dispatcherUser: this.currentFolder.dispatcherUser, folderId: this.currentFolder.folderId, files: this.fileList }
+      this.$api.task.uploadFile(data).then(res => {
+        if (res.code === 200) {
+          console.log(res)
+        } else {
+          this.$message.error(res.msg)
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>