区域管理,景区查询对接
This commit is contained in:
parent
55431028c2
commit
5abfccd598
34
src/api/system/scenic.js
Normal file
34
src/api/system/scenic.js
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: 'aerocraftAdminApi/emScenic',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(id) {
|
||||||
|
return request({
|
||||||
|
url: `aerocraftAdminApi/emScenic/${id}`,
|
||||||
|
method: 'delete',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function edit(data) {
|
||||||
|
return request({
|
||||||
|
url: 'aerocraftAdminApi/emScenic',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function list(params) {
|
||||||
|
return request({
|
||||||
|
url: 'aerocraftAdminApi/emScenic',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del, list }
|
@ -6,7 +6,7 @@
|
|||||||
<span>区域架构</span>
|
<span>区域架构</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="al-tree" v-loading="lamLoading">
|
<div class="al-tree" v-loading="lamLoading">
|
||||||
<div class="boxShadow" @click="active = list[0].id; crud.title = '区域'" />
|
<div class="boxShadow" @click="handleSourceClick" />
|
||||||
<el-tree default-expand-all :data="list" :indent="20" icon-class="#"
|
<el-tree default-expand-all :data="list" :indent="20" icon-class="#"
|
||||||
:props="{ children: 'sons', label: 'name' }" @node-click="handleNodeClick">
|
:props="{ children: 'sons', label: 'name' }" @node-click="handleNodeClick">
|
||||||
<template slot-scope="{node,data}">
|
<template slot-scope="{node,data}">
|
||||||
@ -74,6 +74,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import crudArea from '@/api/system/area'
|
import crudArea from '@/api/system/area'
|
||||||
|
import crudScenic from '@/api/system/scenic'
|
||||||
import udOperation from '@crud/UD.operation'
|
import udOperation from '@crud/UD.operation'
|
||||||
import pagination from '@crud/Pagination'
|
import pagination from '@crud/Pagination'
|
||||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||||
@ -130,7 +131,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 节点点击
|
// 节点点击
|
||||||
handleNodeClick(data) {
|
handleNodeClick(data) {
|
||||||
console.log(data)
|
// console.log('data',data)
|
||||||
},
|
},
|
||||||
handleTool(node, data) {
|
handleTool(node, data) {
|
||||||
const id = node.level === 4 ? data.parentId : data.id
|
const id = node.level === 4 ? data.parentId : data.id
|
||||||
@ -143,8 +144,27 @@ export default {
|
|||||||
const type = node.level === 1
|
const type = node.level === 1
|
||||||
this.crud.title = type ? '区域' : '景区'
|
this.crud.title = type ? '区域' : '景区'
|
||||||
this.form.type = type ? 'area' : 'spot'
|
this.form.type = type ? 'area' : 'spot'
|
||||||
// console.log(this.parentArr, 'parentArr')
|
this.getList(id,data)
|
||||||
// this.getList(id)
|
},
|
||||||
|
handleSourceClick(){
|
||||||
|
this.active = this.list[0].id;
|
||||||
|
this.crud.title = '区域';
|
||||||
|
this.getList(this.list[0].id,{type:'source'})
|
||||||
|
},
|
||||||
|
// 查询景区
|
||||||
|
getList(id,{type}){
|
||||||
|
if(type === 'area'){
|
||||||
|
this.crud.url = '/aerocraftAdminApi/emScenic'
|
||||||
|
this.crud.query.areaId = id;
|
||||||
|
this.crud.form.areaId = id;
|
||||||
|
this.crud.crudMethod = {...crudScenic};
|
||||||
|
this.crud.refresh();
|
||||||
|
}else if(type === 'source'){
|
||||||
|
this.crud.url = '/aerocraftAdminApi/emArea';
|
||||||
|
delete this.crud.query.areaId;
|
||||||
|
this.crud.crudMethod = {...crudArea};
|
||||||
|
this.crud.refresh();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
[CRUD.HOOK.beforeRefresh](crud, form) {
|
[CRUD.HOOK.beforeRefresh](crud, form) {
|
||||||
crud.query.current = crud.page.page;
|
crud.query.current = crud.page.page;
|
||||||
@ -152,6 +172,9 @@ export default {
|
|||||||
[CRUD.HOOK.afterSubmit](crud, form) {
|
[CRUD.HOOK.afterSubmit](crud, form) {
|
||||||
this.getTrees();
|
this.getTrees();
|
||||||
},
|
},
|
||||||
|
[CRUD.HOOK.afterDelete](crud, form) {
|
||||||
|
this.getTrees();
|
||||||
|
},
|
||||||
getTree() {
|
getTree() {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
// tree().then(res => {
|
// tree().then(res => {
|
||||||
|
Loading…
Reference in New Issue
Block a user