Commit 58c1133e by 张杰

v1.6.0版本需求

1 parent 62cd1a97
import request from './request' import request from './request'
import store from "@/vuex/store";
console.log('store',store)
// 新增围栏 // 新增围栏
export const SAVE_ELECFENCE_INFO = params => { export const SAVE_ELECFENCE_INFO = params => {
...@@ -31,4 +33,9 @@ export const REMOVE_ELECFENCE_LINKEDDEVICES = params => { ...@@ -31,4 +33,9 @@ export const REMOVE_ELECFENCE_LINKEDDEVICES = params => {
} }
//新增、编辑围栏-批量导入关联设备 //新增、编辑围栏-批量导入关联设备
export const IMPORT_ELECFENCE_LINKEDDEVICES = '/trialdrive/elecfence/batchImport'
\ No newline at end of file \ No newline at end of file
export const IMPORT_ELECFENCE_LINKEDDEVICES = `${store.getters.baseURL}/trialdrive/elecfence/batchImport`
//新增、编辑围栏-批量导入模板下载
export const DOWN_ELECFENCE_EXCELTEMPLATE = params => {
return request(params, '/publiccenter/dict/data/type/excelTemplate/batchLinkFenceSns')
}
\ No newline at end of file \ No newline at end of file
import request from './request'
// 轨迹回放-获取轨迹回放位置点
export const GET_DEVICE_LISTTRACKPOINT = params => {
return request(params, '/devicemonitor/monitor/listtrackpoint')
}
\ No newline at end of file \ No newline at end of file
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<div></div> <div></div>
<div> <div>
<el-button v-if="!readonlyStatus" type="primary" @click="userDate" size="small" :loading="submitting">关联用户</el-button> <el-button v-if="!readonlyStatus" type="primary" @click="userDate" size="small" :loading="submitting">关联用户</el-button>
<el-button size="small">批量删除</el-button> <el-button size="small" :disabled="!selectedIds || selectedIds.length<=0" @click="batchRemove">批量删除</el-button>
</div> </div>
</div> </div>
<el-table class="el_table" :data="tableData" border height="300" size="small" v-loading="loading" @selection-change="selectChange" style="width: 100%;margin-bottom:40px"> <el-table class="el_table" :data="tableData" border height="300" size="small" v-loading="loading" @selection-change="selectChange" style="width: 100%;margin-bottom:40px">
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
<el-button v-if="!readonlyStatus" type="primary" @click="saveFence" size="small" :loading="submitting">保存</el-button> <el-button v-if="!readonlyStatus" type="primary" @click="saveFence" size="small" :loading="submitting">保存</el-button>
<el-button @click="cancel" size="small">取消</el-button> <el-button @click="cancel" size="small">取消</el-button>
</div> </div>
<user-list :init="userListInit" @onUserListInit="(res)=>userListInit=res" :userData="tableData" @onUpdateUserData="updateUserData" :userListModalVisible="userListModalVisible" :shopId="form.specialShopId" @onUserListModalChange="userListModalChange" ref="userList"> <user-list :init="userListInit" v-if="userListModalVisible" @onUserListInit="(res)=>userListInit=res" :userData="tableData" @onUpdateUserData="updateUserData" :userListModalVisible="userListModalVisible" :shopId="form.specialShopId" @onUserListModalChange="userListModalChange" ref="userList">
</user-list> </user-list>
</div> </div>
</template> </template>
...@@ -98,7 +98,7 @@ import userList from "./fence_userlist.vue"; ...@@ -98,7 +98,7 @@ import userList from "./fence_userlist.vue";
import InfiniteLoading from "vue-infinite-loading"; import InfiniteLoading from "vue-infinite-loading";
import CitySelect from "@/components/area"; import CitySelect from "@/components/area";
const MONITOR_SERVICE = services.monitor; const MONITOR_SERVICE = services.monitor;
import { deepClone, showToast } from "@/utils/utils"; import { deepClone, showToast,showModal } from "@/utils/utils";
import { import {
GET_ELECFENCE_LINKEDDEVICES, GET_ELECFENCE_LINKEDDEVICES,
GET_ELECFENCE_INFO, GET_ELECFENCE_INFO,
...@@ -301,7 +301,7 @@ export default { ...@@ -301,7 +301,7 @@ export default {
if (data.lng && data.lat) { if (data.lng && data.lat) {
this.form.lng = data.lng; this.form.lng = data.lng;
this.form.lat = data.lat; this.form.lat = data.lat;
this.transfer(); //this.transfer();
} }
if (data.polygonPath && data.polygonPath.length) { if (data.polygonPath && data.polygonPath.length) {
...@@ -547,6 +547,19 @@ export default { ...@@ -547,6 +547,19 @@ export default {
_this.$refs.fenceMap.initFence(mapData); _this.$refs.fenceMap.initFence(mapData);
}); });
}, },
// 批量删除
batchRemove(){
showModal({
message:'确认删除选择的关联用户吗?',
showCancelButton:true,
type:'warning',
success:function(){
}
})
}
}, },
}; };
</script> </script>
......
...@@ -98,6 +98,7 @@ import { exportExcel } from "utils"; ...@@ -98,6 +98,7 @@ import { exportExcel } from "utils";
import { CONSTANT } from "../../constant"; import { CONSTANT } from "../../constant";
import InfiniteLoading from "vue-infinite-loading"; import InfiniteLoading from "vue-infinite-loading";
import MapControll from "./MapControll.vue"; import MapControll from "./MapControll.vue";
import { GET_ELECFENCE_INFO } from "@/api/services/fence";
export default { export default {
data() { data() {
...@@ -239,8 +240,12 @@ export default { ...@@ -239,8 +240,12 @@ export default {
//this.bindEvent(); //this.bindEvent();
_this.isInitMap = true; _this.isInitMap = true;
//_this.drawPoi(); //_this.drawPoi();
console.log(_this.fenceId != 'undefined') console.log(_this.fenceId != "undefined");
if (_this.isInitFence && _this.fenceId && _this.fenceId != 'undefined') { if (
_this.isInitFence &&
_this.fenceId &&
_this.fenceId != "undefined"
) {
//_this.drawFence(); //_this.drawFence();
_this.getFence(); _this.getFence();
} }
...@@ -483,8 +488,8 @@ export default { ...@@ -483,8 +488,8 @@ export default {
if (data.length) { if (data.length) {
data.forEach((item, idx) => { data.forEach((item, idx) => {
item.idx = idx; item.idx = idx;
item.standno = _this.standno item.standno = _this.standno;
item.name = _this.name item.name = _this.name;
}); });
this.resultList = data; this.resultList = data;
} }
...@@ -603,6 +608,8 @@ export default { ...@@ -603,6 +608,8 @@ export default {
} }
}); });
}, },
// 行政区域围栏
drawDistrict(areaCode) { drawDistrict(areaCode) {
this._drawDistrictTimeoutId && clearTimeout(this._drawDistrictTimeoutId); this._drawDistrictTimeoutId && clearTimeout(this._drawDistrictTimeoutId);
...@@ -610,6 +617,8 @@ export default { ...@@ -610,6 +617,8 @@ export default {
EventBus.$emit("uiMap.fence.drawDistrict", areaCode); EventBus.$emit("uiMap.fence.drawDistrict", areaCode);
}, 500); }, 500);
}, },
// 多边形围栏
drawPolygon(path) { drawPolygon(path) {
console.log("path"); console.log("path");
EventBus.$emit("uiMap.fence.drawPolygon", { EventBus.$emit("uiMap.fence.drawPolygon", {
...@@ -620,56 +629,38 @@ export default { ...@@ -620,56 +629,38 @@ export default {
// 获取围栏信息-并画围栏 // 获取围栏信息-并画围栏
getFence() { getFence() {
MONITOR_SERVICE.getFenceInfo({ GET_ELECFENCE_INFO({
sn: this.sn, //sn: this.sn,
fenceId: this.fenceId, fenceId: this.fenceId,
}).then((res) => { }).then((res) => {
console.log(res); console.log(res);
let list = res.data || []; let list = res.data || [];
if (res.code != 200) { if (res.code != 200) {
return false; return false;
// const data = res.data || []; }
// if (data) { let obj = res.data || {};
// if (data.shapeType === 2) { // 圆形围栏
// EventBus.$emit("uiMap.fence.createFenceCircle", { if (obj.shapeType == 1) {
// lng: data.lng, EventBus.$emit("uiMap.fence.createFenceCircle", {
// lat: data.lat, lng: obj.lnglat.split(",")[0],
// radius: data.radius, lat: obj.lnglat.split(",")[1],
// isEdit: false, radius: obj.radius,
// }); isEdit: false,
// } else if (data.shapeType === 3) { });
// this.drawDistrict(data.areaCode);
// } else if (data.shapeType === 5) {
// if (data.lnglat) {
// let polygonPath = data.lnglat.split("|").map((item) => {
// return [item.split(",")[0], item.split(",")[1]];
// });
// this.drawPolygon(polygonPath);
// }
// }
// }
} }
// 循环画围栏 // 多边形围栏
list.map((k) => { if (obj.shapeType == 3) {
// 圆形围栏 let polygonPath = obj.lnglat.split("|").map((item) => {
if (k.shapeType == 1) { return [item.split(",")[0], item.split(",")[1]];
EventBus.$emit("uiMap.fence.createFenceCircle", { });
lng: k.lnglat.split(",")[0], this.drawPolygon(polygonPath);
lat: k.lnglat.split(",")[1], }
radius: k.radius,
isEdit: false,
});
}
// 多边形围栏 // 行政区域围栏
if (k.shapeType == 3) { if (obj.shapeType == 4) {
let polygonPath = k.lnglat.split("|").map((item) => { this.drawDistrict([obj.areaCode]);
return [item.split(",")[0], item.split(",")[1]]; }
});
this.drawPolygon(polygonPath);
}
});
}); });
}, },
}, },
......
...@@ -256,6 +256,20 @@ export const Util = { ...@@ -256,6 +256,20 @@ export const Util = {
}, },
} }
// 通过url下载文件
export const downFileByPath = function(url){
if (!url) {
return false;
};
// let link = document.createElement('a')
// link.style.display = 'none'
// link.src = url
// link.target = '_blank'
// document.body.appendChild(link);
// link.click();
window.location.href = url
}
export const showModal = Util.msg export const showModal = Util.msg
export const showToast = Util.Info export const showToast = Util.Info
export const showLoading = Util.loading export const showLoading = Util.loading
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!