浏览代码

report time

scorpio 2 年之前
父节点
当前提交
a095c5a291
共有 2 个文件被更改,包括 41 次插入18 次删除
  1. 19 0
      src/views/task/component/task.vue
  2. 22 18
      src/views/task/index.vue

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

@@ -15,6 +15,18 @@
         class="font-16 bold"
         placeholder="请输入任务名称(最大20个字符)"
       ></el-input>
+      <div
+        class="full-width flex flex-justify-between flex-center padding-top mt-10"
+        @click="goProject"
+        v-if="task && task.projectId"
+      >
+        <span class="flex-center flex-justify-start title"
+          >所属项目:{{ task.projectName }}</span
+        >
+        <el-icon>
+          <ArrowRight />
+        </el-icon>
+      </div>
       <div class="mt-20">
         <div class="flex flex-center flex-justify-start">
           <span class="mr-10 title flex flex-justify-start">状态:</span>
@@ -452,6 +464,13 @@ export default {
      */
     moveSucc() {
       this.isMove = true
+    },
+    goProject() {
+      const routeData = this.$router.resolve({
+        path: '/home/pro_detail',
+        query: { id: this.task.projectId }
+      })
+      window.open(routeData.href, '_blank')
     }
   }
 }

+ 22 - 18
src/views/task/index.vue

@@ -42,24 +42,27 @@
           </template>
         </el-dropdown>
       </div>
-      <div class="full-width">
-        <task-table
-          :option="option"
-          :data="data"
-          :total="total"
-          @rowClick="rowClick"
-          @refresh="getTaskList"
-        ></task-table>
-      </div>
-      <el-divider />
-      <div class="flex flex-center flex-justify-end full-width">
-        <el-pagination
-          background
-          layout="prev, pager, next"
-          :total="total"
-          v-model:current-page="page.curren"
-          @current-change="pageChange"
-        />
+      <el-empty description="暂无数据" v-if="data.length === 0"></el-empty>
+      <div class="full-width" v-else>
+        <div class="full-width">
+          <task-table
+            :option="option"
+            :data="data"
+            :total="total"
+            @rowClick="rowClick"
+            @refresh="getTaskList"
+          ></task-table>
+        </div>
+        <el-divider />
+        <div class="flex flex-center flex-justify-end full-width">
+          <el-pagination
+            background
+            layout="prev, pager, next"
+            :total="total"
+            v-model:current-page="page.curren"
+            @current-change="pageChange"
+          />
+        </div>
       </div>
       <task type="view" ref="task" :task="task"></task>
     </div>
@@ -127,6 +130,7 @@ export default {
   methods: {
     changeType(type) {
       this.type = type
+      this.page.current = 1
       this.getTaskList()
     },
     getTaskList() {