This commit is contained in:
57
src/components/Region/index.vue
Normal file
57
src/components/Region/index.vue
Normal file
@ -0,0 +1,57 @@
|
||||
<template>
|
||||
<section>
|
||||
<el-tree :data="list" :props="defaultProps" :expand-on-click-node="false" ref="tree"
|
||||
default-expand-all />
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// todo 大区组件
|
||||
import { list } from "@/api/hardware/area";
|
||||
export default {
|
||||
name: 'Region',
|
||||
data () {
|
||||
return {
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'areaName'
|
||||
},
|
||||
list: [
|
||||
{
|
||||
"id": 4, "areaName": "中原地区", "areaCode": "17", "ordinal": null, "provinceIds": null, children: [
|
||||
{ "id": 1, "areaName": "安徽省", "areaCode": "001", "ordinal": 1, "provinceIds": null },
|
||||
{ "id": 1, "areaName": "河南省", "areaCode": "001", "ordinal": 1, "provinceIds": null },
|
||||
]
|
||||
},
|
||||
{ "id": 1, "areaName": "华北地区", "areaCode": "001", "ordinal": 1, "provinceIds": null },
|
||||
{
|
||||
"id": 2, "areaName": "华南地区", "areaCode": "002", "ordinal": 2, "provinceIds": null, children: [
|
||||
{ "id": 1, "areaName": "江苏省", "areaCode": "001", "ordinal": 1, "provinceIds": null },
|
||||
{ "id": 1, "areaName": "浙江省", "areaCode": "001", "ordinal": 1, "provinceIds": null },
|
||||
{ "id": 1, "areaName": "湖南省", "areaCode": "001", "ordinal": 1, "provinceIds": null },
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
// list: [
|
||||
// {
|
||||
// label: '一级 1',
|
||||
// children: [{
|
||||
// label: '二级 1-1',
|
||||
// children: [{
|
||||
// label: '三级 1-1-1'
|
||||
// }]
|
||||
// }]
|
||||
// }
|
||||
// ]
|
||||
}
|
||||
|
||||
},
|
||||
created () {
|
||||
list()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
Reference in New Issue
Block a user