This commit is contained in:
熊成强 2020-10-27 17:59:08 +08:00
parent a5a2d9b78a
commit a471fecdc1

View File

@ -3,7 +3,7 @@
<div class="step"> <div class="step">
<small-nav :showTitle='false'> <small-nav :showTitle='false'>
<div slot="content"> <div slot="content">
<el-cascader size="small" :props="props"></el-cascader> <el-cascader size="mini" :props="props" :options="timeOptions" @change="handleChange"></el-cascader>
</div> </div>
</small-nav> </small-nav>
<div class="step-content boderAndRadius"> <div class="step-content boderAndRadius">
@ -75,6 +75,7 @@ import SmallNav from '@/components/kpi-layout/SmallNav'
import getPersonnel from '@/components/getPersonnel' import getPersonnel from '@/components/getPersonnel'
import PopupRight from '@/components/PopupRight' import PopupRight from '@/components/PopupRight'
import { apiManagerDetail, apiChartList } from '@/api/assessment' import { apiManagerDetail, apiChartList } from '@/api/assessment'
import { getStartsData } from '@/api/report'
let id = 0 let id = 0
export default { export default {
data () { data () {
@ -97,6 +98,20 @@ export default {
// 'staffName': '', // 'staffName': '',
'startId': 10 'startId': 10
}, },
timeOptions: [{
startId: 0,
time: '月底',
children: []
}, {
startId: 1,
time: '自定义',
children: []
}],
//
props: {
value: 'startId',
label: 'time'
},
tableData: [{ tableData: [{
date: '2016-05-02', date: '2016-05-02',
name: '王小虎', name: '王小虎',
@ -115,25 +130,7 @@ export default {
address: '上海市普陀区金沙江路 1516 弄' address: '上海市普陀区金沙江路 1516 弄'
}], }],
formInline: {}, formInline: {},
titleList: [], 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)
}
}
} }
}, },
components: { components: {
@ -149,8 +146,34 @@ export default {
beforeMount () {}, beforeMount () {},
mounted () { mounted () {
this.handleGetChartList() this.handleGetChartList()
this.handleStartsReq()
}, },
methods: { 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 () { handleSubmit () {
this.kaopingFrom.showRight = false this.kaopingFrom.showRight = false
}, },