From a471fecdc118d15bcc3140748c5c6f969dc6f741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E6=88=90=E5=BC=BA?= Date: Tue, 27 Oct 2020 17:59:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/kpi/assessment/stepList/index.vue | 63 ++++++++++++++------- 1 file changed, 43 insertions(+), 20 deletions(-) diff --git a/src/views/kpi/assessment/stepList/index.vue b/src/views/kpi/assessment/stepList/index.vue index 812fca7..485c824 100644 --- a/src/views/kpi/assessment/stepList/index.vue +++ b/src/views/kpi/assessment/stepList/index.vue @@ -3,7 +3,7 @@
- +
@@ -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 },