|
|
@@ -69,16 +69,18 @@
|
|
|
this.treeDataSource = res.result
|
|
|
// update-begin- --- author:wangshuai ------ date:20200102 ---- for:去除默认选中第一条数据、默认展开所有第一级
|
|
|
// 默认选中第一条数据、默认展开所有第一级
|
|
|
- // if (res.result.length > 0) {
|
|
|
- // this.expandedKeys = []
|
|
|
- // res.result.forEach((item, index) => {
|
|
|
- // if (index === 0) {
|
|
|
- // this.selectedKeys = [item.id]
|
|
|
- // this.emitInput(item.id)
|
|
|
- // }
|
|
|
- // this.expandedKeys.push(item.id)
|
|
|
- // })
|
|
|
- // }
|
|
|
+ if (res.result.length > 0) {
|
|
|
+ this.expandedKeys = []
|
|
|
+ res.result.forEach((item, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ this.selectedKeys = [item.subcontractorId]
|
|
|
+ let subcontractorId = item.subcontractorId
|
|
|
+ let cpType = item.cpType
|
|
|
+ this.emitInput(subcontractorId, cpType)
|
|
|
+ this.expandedKeys.push(item.subcontractorId)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
// update-end- --- author:wangshuai ------ date:20200102 ---- for:去除默认选中第一条数据、默认展开所有第一级
|
|
|
} else {
|
|
|
this.$message.warn(res.message)
|