Commit 58c1133e by 张杰

v1.6.0版本需求

1 parent 62cd1a97
import request from './request'
import store from "@/vuex/store";
console.log('store',store)
// 新增围栏
export const SAVE_ELECFENCE_INFO = 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
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
import request from './request'
// 轨迹回放-获取轨迹回放位置点
export const GET_DEVICE_LISTTRACKPOINT = params => {
return request(params, '/devicemonitor/monitor/listtrackpoint')
}
\ No newline at end of file
......@@ -68,7 +68,7 @@
<div></div>
<div>
<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>
<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 @@
<el-button v-if="!readonlyStatus" type="primary" @click="saveFence" size="small" :loading="submitting">保存</el-button>
<el-button @click="cancel" size="small">取消</el-button>
</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>
</div>
</template>
......@@ -98,7 +98,7 @@ import userList from "./fence_userlist.vue";
import InfiniteLoading from "vue-infinite-loading";
import CitySelect from "@/components/area";
const MONITOR_SERVICE = services.monitor;
import { deepClone, showToast } from "@/utils/utils";
import { deepClone, showToast,showModal } from "@/utils/utils";
import {
GET_ELECFENCE_LINKEDDEVICES,
GET_ELECFENCE_INFO,
......@@ -301,7 +301,7 @@ export default {
if (data.lng && data.lat) {
this.form.lng = data.lng;
this.form.lat = data.lat;
this.transfer();
//this.transfer();
}
if (data.polygonPath && data.polygonPath.length) {
......@@ -547,6 +547,19 @@ export default {
_this.$refs.fenceMap.initFence(mapData);
});
},
// 批量删除
batchRemove(){
showModal({
message:'确认删除选择的关联用户吗?',
showCancelButton:true,
type:'warning',
success:function(){
}
})
}
},
};
</script>
......
......@@ -98,6 +98,7 @@ import { exportExcel } from "utils";
import { CONSTANT } from "../../constant";
import InfiniteLoading from "vue-infinite-loading";
import MapControll from "./MapControll.vue";
import { GET_ELECFENCE_INFO } from "@/api/services/fence";
export default {
data() {
......@@ -239,8 +240,12 @@ export default {
//this.bindEvent();
_this.isInitMap = true;
//_this.drawPoi();
console.log(_this.fenceId != 'undefined')
if (_this.isInitFence && _this.fenceId && _this.fenceId != 'undefined') {
console.log(_this.fenceId != "undefined");
if (
_this.isInitFence &&
_this.fenceId &&
_this.fenceId != "undefined"
) {
//_this.drawFence();
_this.getFence();
}
......@@ -483,8 +488,8 @@ export default {
if (data.length) {
data.forEach((item, idx) => {
item.idx = idx;
item.standno = _this.standno
item.name = _this.name
item.standno = _this.standno;
item.name = _this.name;
});
this.resultList = data;
}
......@@ -603,6 +608,8 @@ export default {
}
});
},
// 行政区域围栏
drawDistrict(areaCode) {
this._drawDistrictTimeoutId && clearTimeout(this._drawDistrictTimeoutId);
......@@ -610,6 +617,8 @@ export default {
EventBus.$emit("uiMap.fence.drawDistrict", areaCode);
}, 500);
},
// 多边形围栏
drawPolygon(path) {
console.log("path");
EventBus.$emit("uiMap.fence.drawPolygon", {
......@@ -620,56 +629,38 @@ export default {
// 获取围栏信息-并画围栏
getFence() {
MONITOR_SERVICE.getFenceInfo({
sn: this.sn,
GET_ELECFENCE_INFO({
//sn: this.sn,
fenceId: this.fenceId,
}).then((res) => {
console.log(res);
let list = res.data || [];
if (res.code != 200) {
return false;
// const data = res.data || [];
// if (data) {
// if (data.shapeType === 2) {
// EventBus.$emit("uiMap.fence.createFenceCircle", {
// lng: data.lng,
// lat: data.lat,
// radius: data.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);
// }
// }
// }
}
let obj = res.data || {};
// 圆形围栏
if (obj.shapeType == 1) {
EventBus.$emit("uiMap.fence.createFenceCircle", {
lng: obj.lnglat.split(",")[0],
lat: obj.lnglat.split(",")[1],
radius: obj.radius,
isEdit: false,
});
}
// 循环画围栏
list.map((k) => {
// 圆形围栏
if (k.shapeType == 1) {
EventBus.$emit("uiMap.fence.createFenceCircle", {
lng: k.lnglat.split(",")[0],
lat: k.lnglat.split(",")[1],
radius: k.radius,
isEdit: false,
});
}
// 多边形围栏
if (obj.shapeType == 3) {
let polygonPath = obj.lnglat.split("|").map((item) => {
return [item.split(",")[0], item.split(",")[1]];
});
this.drawPolygon(polygonPath);
}
// 多边形围栏
if (k.shapeType == 3) {
let polygonPath = k.lnglat.split("|").map((item) => {
return [item.split(",")[0], item.split(",")[1]];
});
this.drawPolygon(polygonPath);
}
});
// 行政区域围栏
if (obj.shapeType == 4) {
this.drawDistrict([obj.areaCode]);
}
});
},
},
......
......@@ -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 showToast = Util.Info
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!