优化
This commit is contained in:
parent
a5a2d9b78a
commit
a471fecdc1
@ -3,7 +3,7 @@
|
||||
<div class="step">
|
||||
<small-nav :showTitle='false'>
|
||||
<div slot="content">
|
||||
<el-cascader size="small" :props="props"></el-cascader>
|
||||
<el-cascader size="mini" :props="props" :options="timeOptions" @change="handleChange"></el-cascader>
|
||||
</div>
|
||||
</small-nav>
|
||||
<div class="step-content boderAndRadius">
|
||||
@ -75,6 +75,7 @@ import SmallNav from '@/components/kpi-layout/SmallNav'
|
||||
import getPersonnel from '@/components/getPersonnel'
|
||||
import PopupRight from '@/components/PopupRight'
|
||||
import { apiManagerDetail, apiChartList } from '@/api/assessment'
|
||||
import { getStartsData } from '@/api/report'
|
||||
let id = 0
|
||||
export default {
|
||||
data () {
|
||||
@ -97,6 +98,20 @@ export default {
|
||||
// 'staffName': '',
|
||||
'startId': 10
|
||||
},
|
||||
timeOptions: [{
|
||||
startId: 0,
|
||||
time: '月底',
|
||||
children: []
|
||||
}, {
|
||||
startId: 1,
|
||||
time: '自定义',
|
||||
children: []
|
||||
}],
|
||||
//
|
||||
props: {
|
||||
value: 'startId',
|
||||
label: 'time'
|
||||
},
|
||||
tableData: [{
|
||||
date: '2016-05-02',
|
||||
name: '王小虎',
|
||||
@ -115,25 +130,7 @@ export default {
|
||||
address: '上海市普陀区金沙江路 1516 弄'
|
||||
}],
|
||||
formInline: {},
|
||||
titleList: [],
|
||||
props: {
|
||||
lazy: true,
|
||||
lazyLoad: (node, resolve) => {
|
||||
console.log(this)
|
||||
console.log('node: ', node)
|
||||
const { level } = node
|
||||
setTimeout(() => {
|
||||
const nodes = Array.from({ length: level + 1 })
|
||||
.map(item => ({
|
||||
value: ++id,
|
||||
label: `选项${id}`,
|
||||
leaf: level >= 2
|
||||
}))
|
||||
// 通过调用resolve将子节点数据返回,通知组件数据加载完成
|
||||
resolve(nodes)
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
titleList: []
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@ -149,8 +146,34 @@ export default {
|
||||
beforeMount () {},
|
||||
mounted () {
|
||||
this.handleGetChartList()
|
||||
this.handleStartsReq()
|
||||
},
|
||||
methods: {
|
||||
// 为了不分页直接传999
|
||||
async handleStartsReq (type, handleNode) {
|
||||
let params = {
|
||||
currentPage: 1,
|
||||
cycleType: type,
|
||||
pageSize: 999
|
||||
}
|
||||
for (let j in this.timeOptions) {
|
||||
try {
|
||||
let res = await getStartsData({
|
||||
currentPage: 1,
|
||||
cycleType: this.timeOptions[j].startId,
|
||||
pageSize: 999
|
||||
})
|
||||
res = res.data
|
||||
console.log('res: ', res)
|
||||
this.timeOptions[j].children = res.list
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
},
|
||||
handleChange (item) {
|
||||
console.log('item: ', item)
|
||||
},
|
||||
handleSubmit () {
|
||||
this.kaopingFrom.showRight = false
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user