Commit b42ad3ea authored by zhang's avatar zhang

feat: (首页/信息管理/检验内容库)页面数据按章节排序

parent f7d8846e
...@@ -215,11 +215,12 @@ import { mapGetters } from 'vuex' ...@@ -215,11 +215,12 @@ import { mapGetters } from 'vuex'
import vehicleModelDialog from './components/vehicleModelDialog' import vehicleModelDialog from './components/vehicleModelDialog'
import documentReviewDialog from './components/documentReviewDialog' import documentReviewDialog from './components/documentReviewDialog'
import request from '../../../utils/request' import request from '../../../utils/request'
import { Change, RowHeight } from '@icon-park/vue' import { Change, Float, RowHeight } from '@icon-park/vue'
import { forEach } from 'lodash' import { forEach } from 'lodash'
import { listInspection } from '../../../api/setting/standardTerms' import { listInspection } from '../../../api/setting/standardTerms'
import detailModel from './components/detailModel.vue' import detailModel from './components/detailModel.vue'
import standard from '../../../store/modules/standard' import standard from '../../../store/modules/standard'
import { parse } from 'postcss'
export default { export default {
// 绑定组件 // 绑定组件
components: { components: {
...@@ -408,11 +409,13 @@ export default { ...@@ -408,11 +409,13 @@ export default {
this.chapterOptions = tempOptions this.chapterOptions = tempOptions
} }
let count = 0
// 继续加工数据,对page容器中的每条数据pageItem处理 // 继续加工数据,对page容器中的每条数据pageItem处理
forEach(tempData,async (tempDataItem)=>{ // 对临时数据tempData中每条数据tempDataItem处理 forEach(tempData,async (tempDataItem)=>{ // 对临时数据tempData中每条数据tempDataItem处理
// 当pageItem和tempDataItem章节属性匹配时,将tempDataItem数据进行模板化并储存到page容器中 // 当pageItem和tempDataItem章节属性匹配时,将tempDataItem数据进行模板化并储存到page容器中
count++
let obj = { let obj = {
index:count,
id:tempDataItem.id, id:tempDataItem.id,
label:'标准要求', label:'标准要求',
chapter:tempDataItem.chapter, chapter:tempDataItem.chapter,
...@@ -436,10 +439,19 @@ export default { ...@@ -436,10 +439,19 @@ export default {
this.loading = false // 加载动画结束 this.loading = false // 加载动画结束
} }
page.push(obj) page.push(obj)
page = page.sort(function(a,b){
return a.index - b.index
})
}) })
// page=page.sort(function(a,b){
// return a.index - b.index
// })
}) })
this.tableData = page // 将临时数据容器赋给结果数据容器 this.tableData = page // 将临时数据容器赋给结果数据容器
//this.tableData = res.rows //this.tableData = res.rows
this.total = res.total this.total = res.total
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment