51 lines
1.1 KiB
JavaScript
51 lines
1.1 KiB
JavaScript
import SearchForm from '@/components/search-form'
|
|
import Pagination from '@/components/pagination'
|
|
export default {
|
|
components: {
|
|
Pagination,
|
|
SearchForm
|
|
},
|
|
data () {
|
|
return {
|
|
total: 0, // 总页数
|
|
isCreated: false,
|
|
loading: false, // 表格loading
|
|
tableData: [],
|
|
searchParam: {
|
|
page: 1,
|
|
limit: 10
|
|
} // 分页
|
|
}
|
|
},
|
|
methods: {
|
|
// 数据字典转换为{label:'',value:''}
|
|
filterStageCode (list) {
|
|
const result = list.map(item => {
|
|
return {
|
|
label: item.name,
|
|
value: item.value
|
|
}
|
|
})
|
|
return result
|
|
},
|
|
// 数据字典转换为{label:'',value:''}
|
|
filterDictionariesCode (list) {
|
|
const result = list.map(item => {
|
|
return {
|
|
label: item.valname,
|
|
value: item.code
|
|
}
|
|
})
|
|
return result
|
|
},
|
|
// 获取搜索参数
|
|
getSearchForm (list) {
|
|
let data = {}
|
|
list.forEach(item => {
|
|
data[item.name] = item.value
|
|
})
|
|
return Object.assign({}, this.searchParam, data)
|
|
}
|
|
}
|
|
}
|