first commit
This commit is contained in:
50
pgweb/src/mixins/search.js
Normal file
50
pgweb/src/mixins/search.js
Normal file
@@ -0,0 +1,50 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user