|
@@ -49,7 +49,10 @@
|
|
|
|
|
|
<el-table
|
|
|
class="view-table"
|
|
|
+ v-loading="loading"
|
|
|
:data="tableData"
|
|
|
+ v-el-table-infinite-scroll="loadData"
|
|
|
+ :infinite-scroll-disabled="disabled"
|
|
|
size="mini"
|
|
|
@cell-mouse-enter="cellMouseEnter"
|
|
|
@cell-mouse-leave="cellMouseLeave"
|
|
@@ -57,7 +60,7 @@
|
|
|
@cell-click="cellClick"
|
|
|
@cell-dblclick="cellDbClick"
|
|
|
@row-click="rowClick"
|
|
|
- height="calc(100vh - 140px)"
|
|
|
+ height="calc(100vh - 110px)"
|
|
|
border>
|
|
|
<el-table-column fixed prop="id" label="编号" align="center" width="50"/>
|
|
|
<el-table-column fixed prop="taskName" label="任务名称" align="center" class="task-name-cell" width="180"/>
|
|
@@ -74,10 +77,10 @@
|
|
|
<el-tag v-if="scope.row.priority==='1'" color="#fa8888" effect="dark" :hit="false">
|
|
|
{{ getTaskPriority(scope.row.priority) }}
|
|
|
</el-tag>
|
|
|
- <el-tag v-if="scope.row.priority==='2'" color="#fb7fb7" effect="dark" :hit="false">
|
|
|
+ <el-tag v-else-if="scope.row.priority==='2'" color="#fb7fb7" effect="dark" :hit="false">
|
|
|
{{ getTaskPriority(scope.row.priority) }}
|
|
|
</el-tag>
|
|
|
- <el-tag v-if="scope.row.priority==='3'" color="#40e0c3" effect="dark" :hit="false">
|
|
|
+ <el-tag v-else-if="scope.row.priority==='3'" color="#40e0c3" effect="dark" :hit="false">
|
|
|
{{ getTaskPriority(scope.row.priority) }}
|
|
|
</el-tag>
|
|
|
<el-tag v-else color="#5dcfff" effect="dark" :hit="false">{{ getTaskPriority(scope.row.priority) }}</el-tag>
|
|
@@ -203,6 +206,7 @@ import DeptUserTree from "@/components/DeptUserTree"
|
|
|
import RichTextEditor from "@/components/RichTextEditor"
|
|
|
import {getDeptUserTree} from "@/api/system/user";
|
|
|
import task from "@/views/mixins/task";
|
|
|
+import elTableInfiniteScroll from 'el-table-infinite-scroll'
|
|
|
|
|
|
const statusMap = {
|
|
|
'0': {name: '待查看', type: 'info'},
|
|
@@ -217,6 +221,9 @@ const statusMap = {
|
|
|
export default {
|
|
|
components: {TaskDetail, FileUpload, DeptUserTree, RichTextEditor},
|
|
|
dicts: ['task_status', 'task_priority'],
|
|
|
+ directives: {
|
|
|
+ 'el-table-infinite-scroll': elTableInfiniteScroll
|
|
|
+ },
|
|
|
mixins: [task],
|
|
|
data() {
|
|
|
return {
|
|
@@ -226,10 +233,16 @@ export default {
|
|
|
endDate: undefined,
|
|
|
status: '0'
|
|
|
},
|
|
|
+ loading: true,
|
|
|
projectTree: [],
|
|
|
userList: [],
|
|
|
tableHeaders: [],
|
|
|
+ totalData: [],
|
|
|
+ disabled: false,
|
|
|
tableData: [],
|
|
|
+ page: 0,
|
|
|
+ total: 0,
|
|
|
+
|
|
|
open: false,
|
|
|
form: {},
|
|
|
feedbacks: [],
|
|
@@ -277,11 +290,28 @@ export default {
|
|
|
this.$message.warning("时间跨度不可超过一年")
|
|
|
return
|
|
|
}
|
|
|
+ this.loading = true
|
|
|
listView(this.queryParams).then(res => {
|
|
|
+ this.tableData = []
|
|
|
+ this.page = 0
|
|
|
+ this.disabled = false
|
|
|
this.tableHeaders = res.data.headers
|
|
|
- this.tableData = res.data.data
|
|
|
+ this.totalData = res.data.data
|
|
|
+ this.total = Number.parseInt(this.totalData.length / 15) + 1
|
|
|
+ this.loading = false
|
|
|
})
|
|
|
},
|
|
|
+ loadData() {
|
|
|
+ if (this.disabled) return;
|
|
|
+ if (this.page < this.total) {
|
|
|
+ let temp = this.totalData.slice(this.page * 15, (this.page + 1) * 15)
|
|
|
+ this.tableData = this.tableData.concat(temp);
|
|
|
+ }
|
|
|
+ this.page++;
|
|
|
+ if (this.page === this.total) {
|
|
|
+ this.disabled = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
cellMouseEnter(row, column, cell, event) {
|
|
|
if (column.property != 'taskName') {
|