|
|
@@ -3,19 +3,13 @@
|
|
|
v-model="visible"
|
|
|
closeable
|
|
|
position="left"
|
|
|
- :style="{ height: '100%',width:'80%'}"
|
|
|
+ :style="{ height: '100%', width: '80%' }"
|
|
|
@opened="loadTreeData"
|
|
|
@close="handleClose"
|
|
|
>
|
|
|
- <van-nav-bar
|
|
|
- :title="title"
|
|
|
- fixed
|
|
|
- />
|
|
|
+ <van-nav-bar :title="title" fixed />
|
|
|
<div class="ibps-fixed-navbar ibps-fixed-top">
|
|
|
- <van-loading
|
|
|
- v-if="loading"
|
|
|
- vertical
|
|
|
- >加载中...</van-loading>
|
|
|
+ <van-loading v-if="loading" vertical>加载中...</van-loading>
|
|
|
<ibps-tree
|
|
|
v-else
|
|
|
:tree-data="treeData"
|
|
|
@@ -48,7 +42,6 @@ export default {
|
|
|
categoryKey: {
|
|
|
type: String
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -79,18 +72,27 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
this.loading = true
|
|
|
- findTreeData({ 'categoryKey': this.categoryKey }).then(response => {
|
|
|
- const data = response.data || []
|
|
|
- const treeData = TreeUtils.transformToTreeFormat(data, {
|
|
|
- idKey: 'id',
|
|
|
- parentIdKey: 'parentId',
|
|
|
- childrenKey: 'children'
|
|
|
+ findTreeData({ categoryKey: this.categoryKey })
|
|
|
+ .then(response => {
|
|
|
+ const data = response.data || []
|
|
|
+ const treeData = TreeUtils.transformToTreeFormat(data, {
|
|
|
+ idKey: 'id',
|
|
|
+ parentIdKey: 'parentId',
|
|
|
+ childrenKey: 'children'
|
|
|
+ })
|
|
|
+ const mid = []
|
|
|
+ treeData[0].children.forEach((it, i) => {
|
|
|
+ if (it.name != '待删除' && it.name != '其它') {
|
|
|
+ mid.push(it)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ treeData[0].children = mid
|
|
|
+ this.treeData = treeData
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.loading = false
|
|
|
})
|
|
|
- this.treeData = treeData
|
|
|
- this.loading = false
|
|
|
- }).catch(() => {
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
},
|
|
|
handleClose() {
|
|
|
this.$emit('close', false)
|
|
|
@@ -103,4 +105,3 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
-
|