diff --git a/src/api/model/am.js b/src/api/model/am.js index 54414d7d..a035d2db 100644 --- a/src/api/model/am.js +++ b/src/api/model/am.js @@ -5,7 +5,7 @@ export default { area: { list: { - name: "获取", + name: "获取区域列表", req: async function(data){ return await http.get( `${config.API_URL}/am/area/`, @@ -13,8 +13,16 @@ export default { ); } }, + item: { + name: "获取某个区域详情", + req: async function(data){ + return await http.get( + `${config.API_URL}/am/area/${id}/` + ); + } + }, update: { - name: "更新", + name: "更新区域", req: async function(id, data){ return await http.put( `${config.API_URL}/am/area/${id}/`, @@ -22,15 +30,31 @@ export default { } }, create: { - name: "创建", + name: "创建区域", req: async function(data){ return await http.post( `${config.API_URL}/am/area/`, data); } }, + bindRail: { + name: "绑定围栏", + req: async function(id,data){ + return await http.post( + `${config.API_URL}/am/area/${id}/bind_rail/`, + data); + } + }, + deletes: { + name: "批量删除区域", + req: async function(data){ + return await http.post( + `${config.API_URL}/am/area/deletes/`, + data); + } + }, delete: { - name: "删除", + name: "删除区域", req: async function(id){ return await http.delete( `${config.API_URL}/am/area/${id}/`); @@ -41,4 +65,4 @@ export default { -} \ No newline at end of file +} diff --git a/src/views/am/area.vue b/src/views/am/area.vue index e69de29b..0f01ca0a 100644 --- a/src/views/am/area.vue +++ b/src/views/am/area.vue @@ -0,0 +1,205 @@ + + diff --git a/src/views/am/area_form.vue b/src/views/am/area_form.vue new file mode 100644 index 00000000..e10661b7 --- /dev/null +++ b/src/views/am/area_form.vue @@ -0,0 +1,235 @@ + + + + + diff --git a/src/views/am/area_rail_form.vue b/src/views/am/area_rail_form.vue new file mode 100644 index 00000000..bcaef2b4 --- /dev/null +++ b/src/views/am/area_rail_form.vue @@ -0,0 +1,166 @@ + + + + +