Преглед изворни кода

研修数据排序和搜索功能

liqk пре 3 година
родитељ
комит
f5d71eb4f5

+ 51 - 6
TEAMModelOS/ClientApp/src/view/statistics/Hour.vue

@@ -145,28 +145,73 @@ export default {
                 },
                 {
                     title: '线上研修',
+                    key:'onlineTime',
                     slot: 'online',
-                    align: 'center'
+                    align: 'center',
+                    sortable: true,
+                    sortMethod: (a, b, type) => {
+                        if (type == 'desc') {
+                            return parseInt(a) > parseInt(b) ? -1 : 1
+                        } else {
+                            return parseInt(a) < parseInt(b) ? -1 : 1
+                        }
+                    }
                 },
                 {
                     title: '校本研修',
+                    key:'offlinelTime',
                     slot: 'offline',
-                    align: 'center'
+                    align: 'center',
+                    sortable: true,
+                    sortMethod: (a, b, type) => {
+                        if (type == 'desc') {
+                            return parseInt(a) > parseInt(b) ? -1 : 1
+                        } else {
+                            return parseInt(a) < parseInt(b) ? -1 : 1
+                        }
+                    }
                 },
                 {
                     title: '认证材料',
+                    key:'schoolScoreTime',
                     slot: 'assessment',
-                    align: 'center'
+                    align: 'center',
+                    sortable: true,
+                    sortMethod: (a, b, type) => {
+                        if (type == 'desc') {
+                            return parseInt(a) > parseInt(b) ? -1 : 1
+                        } else {
+                            return parseInt(a) < parseInt(b) ? -1 : 1
+                        }
+                    }
                 },
                 {
                     title: '课堂实录',
+                    key:'classVideoTime',
                     slot: 'classRecord',
-                    align: 'center'
+                    align: 'center',
+                    sortable: true,
+                    sortMethod: (a, b, type) => {
+                        if (type == 'desc') {
+                            return parseInt(a) > parseInt(b) ? -1 : 1
+                        } else {
+                            return parseInt(a) < parseInt(b) ? -1 : 1
+                        }
+                    }
                 },
                 {
                     title: '总学时',
+                    key:'alltime',
                     slot: 'allHour',
-                    align: 'center'
+                    align: 'center',
+                    sortable: true,
+                    sortMethod: (a, b, type) => {
+                        if (type == 'desc') {
+                            return parseInt(a) > parseInt(b) ? -1 : 1
+                        } else {
+                            return parseInt(a) < parseInt(b) ? -1 : 1
+                        }
+                    }
                 },
                 {
                     title: '完成状态',
@@ -202,7 +247,7 @@ export default {
         },
         serchData() {
             this.hourDataShow = this.hourData.filter(item => {
-                return item.tmdname.includes(this.keyword) || item.groupName.includes(this.keyword)
+                return item.tmdname.includes(this.keyword)
             })
         },
         findTotalData() {

+ 28 - 4
TEAMModelOS/ClientApp/src/view/statistics/Result.vue

@@ -102,17 +102,41 @@ export default {
                 {
                     title: '能力点个数',
                     key: 'thcSubCount',
-                    align: 'center'
+                    align: 'center',
+                    sortable: true,
+                    sortMethod: (a, b, type) => {
+                        if (type == 'desc') {
+                            return parseInt(a) > parseInt(b) ? -1 : 1
+                        } else {
+                            return parseInt(a) < parseInt(b) ? -1 : 1
+                        }
+                    }
                 },
                 {
                     title: '已提交',
                     key: 'tchSubmitCount',
-                    align: 'center'
+                    align: 'center',
+                    sortable: true,
+                    sortMethod: (a, b, type) => {
+                        if (type == 'desc') {
+                            return parseInt(a) > parseInt(b) ? -1 : 1
+                        } else {
+                            return parseInt(a) < parseInt(b) ? -1 : 1
+                        }
+                    }
                 },
                 {
                     title: '未提交',
                     key: 'tchUnSubmitCount',
-                    align: 'center'
+                    align: 'center',
+                    sortable: true,
+                    sortMethod: (a, b, type) => {
+                        if (type == 'desc') {
+                            return parseInt(a) > parseInt(b) ? -1 : 1
+                        } else {
+                            return parseInt(a) < parseInt(b) ? -1 : 1
+                        }
+                    }
                 },
                 {
                     title: '状态',
@@ -146,7 +170,7 @@ export default {
         },
         serchData() {
             this.tableDataShow = this.tableData.filter(item => {
-                return item.tmdname.includes(this.keyword) || item.groupName.includes(this.keyword)
+                return item.tmdname.includes(this.keyword)
             })
         },
         findTotalData() {

+ 9 - 1
TEAMModelOS/ClientApp/src/view/statistics/Training.vue

@@ -58,7 +58,15 @@ export default {
                 {
                     title: '已选人数',
                     key: 'count',
-                    align: 'center'
+                    align: 'center',
+                    sortable: true,
+                    sortMethod: (a, b, type) => {
+                        if (type == 'desc') {
+                            return parseInt(a) > parseInt(b) ? -1 : 1
+                        } else {
+                            return parseInt(a) < parseInt(b) ? -1 : 1
+                        }
+                    }
                 },
                 {
                     title: '所占比例',