Cyt928 пре 5 година
родитељ
комит
4a1de8d8a3
3 измењених фајлова са 158 додато и 2 уклоњено
  1. 75 0
      src/components/List.vue
  2. 11 1
      src/element-plus.ts
  3. 72 1
      src/views/Project/BugList.vue

+ 75 - 0
src/components/List.vue

@@ -0,0 +1,75 @@
+<template>
+  <div class="table">
+    <el-table
+      :data="listData"
+      style="width: 100%">
+      <el-table-column
+        v-if="isShowCheckbox"
+        type="selection"
+        width="55">
+      </el-table-column>
+      <el-table-column
+        prop="projectCode"
+        label="编号"
+        width="150">
+      </el-table-column>
+      <el-table-column
+        prop="title"
+        label="标题">
+      </el-table-column>
+      <el-table-column
+        prop="assignment"
+        label="优先级"
+        width="150">
+      </el-table-column>
+      <el-table-column
+        prop="status"
+        label="状态"
+        width="150">
+      </el-table-column>
+      <el-table-column
+        prop="assignment"
+        label="计划时间"
+        width="180">
+      </el-table-column>
+      <el-table-column
+        prop="assignment"
+        label="创建时间"
+        width="180">
+      </el-table-column>
+      <el-table-column
+        prop="assignment"
+        label="经办人"
+        width="180">
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      style="display: flex;flex-direction: row;justify-content: center;margin-top: 20px"
+      background
+      @current-change="handleCurrentChange"
+      page-size="10"
+      layout="prev, pager, next"
+      :total="total">
+    </el-pagination>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'List',
+  props: {
+    listData: Array,
+    total: Number,
+    isShowCheckbox: Boolean,
+  },
+  methods: {
+    handleCurrentChange(currentPage) {
+      console.log(currentPage);
+      this.$emit('current-change', currentPage);
+    },
+  },
+};
+</script>
+
+<style scoped>
+</style>

+ 11 - 1
src/element-plus.ts

@@ -2,7 +2,14 @@ import {
   ElCard,
   ElCard,
   ElCarousel,
   ElCarousel,
   ElCarouselItem,
   ElCarouselItem,
-  ElContainer, ElDivider, ElHeader, ElMain, ElRow,
+  ElContainer,
+  ElDivider,
+  ElHeader,
+  ElMain,
+  ElRow,
+  ElTable,
+  ElTableColumn,
+  ElPagination,
 } from 'element-plus';
 } from 'element-plus';
 
 
 export const Components = [
 export const Components = [
@@ -14,6 +21,9 @@ export const Components = [
   ElCarouselItem,
   ElCarouselItem,
   ElDivider,
   ElDivider,
   ElCard,
   ElCard,
+  ElTable,
+  ElTableColumn,
+  ElPagination,
 ];
 ];
 
 
 export const Plugins = [];
 export const Plugins = [];

+ 72 - 1
src/views/Project/BugList.vue

@@ -1,6 +1,11 @@
 <template>
 <template>
   <div class="container">
   <div class="container">
     <button @click="showRightForm">from test</button>
     <button @click="showRightForm">from test</button>
+    <div></div>
+    <List
+      :listData="bugData"
+      :total="300"
+      :is-show-checkbox="isShowCheckbox"  @current-change="handleCurrentChange"></List>
     <RightForm ref="rightForm">
     <RightForm ref="rightForm">
     </RightForm>
     </RightForm>
   </div>
   </div>
@@ -8,19 +13,85 @@
 
 
 <script>
 <script>
 import RightForm from '../../components/RightForm.vue';
 import RightForm from '../../components/RightForm.vue';
+import List from '../../components/List.vue';
 
 
 export default {
 export default {
-  components: { RightForm },
+  components: { RightForm, List },
+  data() {
+    return {
+      bugData: [
+        {
+          projectCode: 'EXAMPLE-123',
+          title: 'bug1',
+          assignment: '经办人1',
+          status: '进行中',
+        },
+        {
+          projectCode: 'EXAMPLE-124',
+          title: 'bug2',
+          assignment: '经办人2',
+          status: '进行中',
+        },
+        {
+          projectCode: 'EXAMPLE-123',
+          title: 'bug1',
+          assignment: '经办人1',
+          status: '进行中',
+        },
+        {
+          projectCode: 'EXAMPLE-124',
+          title: 'bug2',
+          assignment: '经办人2',
+          status: '进行中',
+        },
+        {
+          projectCode: 'EXAMPLE-123',
+          title: 'bug1',
+          assignment: '经办人1',
+          status: '进行中',
+        },
+        {
+          projectCode: 'EXAMPLE-124',
+          title: 'bug2',
+          assignment: '经办人2',
+          status: '进行中',
+        },
+        {
+          projectCode: 'EXAMPLE-123',
+          title: 'bug1',
+          assignment: '经办人1',
+          status: '进行中',
+        },
+        {
+          projectCode: 'EXAMPLE-124',
+          title: 'bug2',
+          assignment: '经办人2',
+          status: '进行中',
+        }],
+      isShowCheckbox: true,
+    };
+  },
   methods: {
   methods: {
+    /**
+     * @param filterObject 用于数据获取请求的参数对象
+     * @param currentPage  当前页数
+     */
+    getBugData(filterObject, currentPage) {
+      console.log('getBugData');
+    },
     showRightForm() {
     showRightForm() {
       console.log(this.$refs.rightForm);
       console.log(this.$refs.rightForm);
       this.$refs.rightForm.showForm();
       this.$refs.rightForm.showForm();
     },
     },
+    handleCurrentChange(currentPage) {
+      this.getBugData({}, currentPage);
+    },
   },
   },
 };
 };
 </script>
 </script>
 
 
 <style scoped>
 <style scoped>
 .container{
 .container{
+  width: 100%;
 }
 }
 </style>
 </style>