|
|
@@ -123,14 +123,14 @@
|
|
|
<div class="state">
|
|
|
<p
|
|
|
:style="{
|
|
|
- color: scope.row.trap_status == '1' ? '#30A031 ' : 'red'
|
|
|
+ color: scope.row.trap_status == '1' ? '#30A031 ' : 'red',
|
|
|
}"
|
|
|
>
|
|
|
·
|
|
|
</p>
|
|
|
<p
|
|
|
:style="{
|
|
|
- color: scope.row.trap_status == '1' ? '#30A031 ' : 'red'
|
|
|
+ color: scope.row.trap_status == '1' ? '#30A031 ' : 'red',
|
|
|
}"
|
|
|
>
|
|
|
{{ scope.row.trap_status == "1" ? "正常" : "停用" }}
|
|
|
@@ -256,8 +256,11 @@
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="resetForm('ruleForm')" size="mini">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitForm('ruleForm')" size="mini"
|
|
|
- :disabled="releaseTF"
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="submitForm('ruleForm')"
|
|
|
+ size="mini"
|
|
|
+ :disabled="releaseTF"
|
|
|
>{{ releaseTF ? "发布中..." : "确 定" }}</el-button
|
|
|
>
|
|
|
</span>
|
|
|
@@ -295,7 +298,7 @@
|
|
|
<el-button type="primary" @click="downloadtf = false">确 定</el-button>
|
|
|
</span> -->
|
|
|
</el-dialog>
|
|
|
- <el-dialog title="提示" :visible.sync="deriveVisible" width="30%">
|
|
|
+ <el-dialog title="导出数据" :visible.sync="deriveVisible" width="30%">
|
|
|
<div class="derivebox">
|
|
|
<p><span>*</span>文件名称:</p>
|
|
|
<el-input
|
|
|
@@ -307,7 +310,8 @@
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="deriveVisible = false" size="mini">取 消</el-button>
|
|
|
<el-button type="primary" @click="deriveclick" size="mini"
|
|
|
- >确 定</el-button
|
|
|
+ :disabled="deriveTF"
|
|
|
+ >{{deriveTF?"导出中...":"确 定"}}</el-button
|
|
|
>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
@@ -385,7 +389,7 @@ export default {
|
|
|
inoffvalue: "",
|
|
|
inoffoptions: [
|
|
|
{ label: "停用", value: "0" },
|
|
|
- { label: "正常", value: "1" }
|
|
|
+ { label: "正常", value: "1" },
|
|
|
],
|
|
|
versionsvalue: "",
|
|
|
versionsvalue1: "", //组织id
|
|
|
@@ -397,7 +401,7 @@ export default {
|
|
|
value: "id",
|
|
|
children: "childrens",
|
|
|
multiple: true,
|
|
|
- checkStrictly: true
|
|
|
+ checkStrictly: true,
|
|
|
},
|
|
|
trapvalue: "",
|
|
|
traponsoptions: [], //监测点
|
|
|
@@ -407,7 +411,7 @@ export default {
|
|
|
point_id: "", //监测点id
|
|
|
trap_number: "", //设备id
|
|
|
org_id: "", //组织id
|
|
|
- trap_status: "" //状态
|
|
|
+ trap_status: "", //状态
|
|
|
},
|
|
|
tableData: [],
|
|
|
device_id: "",
|
|
|
@@ -422,33 +426,33 @@ export default {
|
|
|
org_id: "", // 必传(string) 所属海关id
|
|
|
inducer_id: "", // 必传(string) 诱剂id
|
|
|
point_id: "", // 必传(string) 所属监测点id
|
|
|
- trap_status: "" // 必传(string) 设备状态0停用 1正常
|
|
|
+ trap_status: "", // 必传(string) 设备状态0停用 1正常
|
|
|
},
|
|
|
rules: {
|
|
|
trap_number: [
|
|
|
{ required: true, message: "请输入诱捕器编号", trigger: "blur" },
|
|
|
- { validator: checkname, trigger: "blur" }
|
|
|
+ { validator: checkname, trigger: "blur" },
|
|
|
],
|
|
|
lng: [
|
|
|
- { required: true, message: "请输入经度", trigger: "blur" }
|
|
|
+ { required: true, message: "请输入经度", trigger: "blur" },
|
|
|
// { validator: checklnglat, trigger: "blur" },
|
|
|
],
|
|
|
lat: [
|
|
|
- { required: true, message: "请输入纬度", trigger: "blur" }
|
|
|
+ { required: true, message: "请输入纬度", trigger: "blur" },
|
|
|
// { validator: checklnglat, trigger: "blur" },
|
|
|
],
|
|
|
org_id: [
|
|
|
- { required: true, message: "请选择隶属海关", trigger: "change" }
|
|
|
+ { required: true, message: "请选择隶属海关", trigger: "change" },
|
|
|
],
|
|
|
point_id: [
|
|
|
- { required: true, message: "请选择所在监测点", trigger: "change" }
|
|
|
+ { required: true, message: "请选择所在监测点", trigger: "change" },
|
|
|
],
|
|
|
inducer_id: [
|
|
|
- { required: true, message: "请选择诱剂名称", trigger: "change" }
|
|
|
+ { required: true, message: "请选择诱剂名称", trigger: "change" },
|
|
|
],
|
|
|
trap_status: [
|
|
|
- { required: true, message: "请选择设备状态", trigger: "change" }
|
|
|
- ]
|
|
|
+ { required: true, message: "请选择设备状态", trigger: "change" },
|
|
|
+ ],
|
|
|
},
|
|
|
parameter: "",
|
|
|
addtitle: "新增诱捕器",
|
|
|
@@ -460,20 +464,21 @@ export default {
|
|
|
addLocationDialogVisible: false,
|
|
|
locationForm: {
|
|
|
lng: "",
|
|
|
- lat: ""
|
|
|
+ lat: "",
|
|
|
},
|
|
|
addr: "", //搜索栏地址
|
|
|
address: "", //地图上标签地址
|
|
|
center: [114.05, 22.55],
|
|
|
content: "", //设备列表组织列表
|
|
|
- releaseTF:false
|
|
|
+ releaseTF: false,
|
|
|
+ deriveTF:false
|
|
|
};
|
|
|
},
|
|
|
//监听属性 类似于data概念
|
|
|
computed: {},
|
|
|
//监控data中的数据变化
|
|
|
watch: {
|
|
|
- parameter: function(e) {
|
|
|
+ parameter: function (e) {
|
|
|
// console.log(e);
|
|
|
if (e == "add") {
|
|
|
// console.log(this.$data.addtitle)
|
|
|
@@ -481,7 +486,7 @@ export default {
|
|
|
} else if (e == "modify") {
|
|
|
this.$data.addtitle = "修改诱捕器";
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
//方法集合
|
|
|
methods: {
|
|
|
@@ -497,9 +502,9 @@ export default {
|
|
|
trap_number: this.queryInfo.trap_number,
|
|
|
point_id: this.queryInfo.point_id,
|
|
|
org_id: this.queryInfo.org_id,
|
|
|
- trap_status: this.queryInfo.trap_status
|
|
|
- })
|
|
|
- }).then(res => {
|
|
|
+ trap_status: this.queryInfo.trap_status,
|
|
|
+ }),
|
|
|
+ }).then((res) => {
|
|
|
this.loading = false;
|
|
|
console.log(res.data.data);
|
|
|
this.total = res.data.data.total_item;
|
|
|
@@ -514,9 +519,9 @@ export default {
|
|
|
this.$axios({
|
|
|
method: "POST",
|
|
|
url: "/api/api_gateway?method=sysmenage.usermanager.org_list",
|
|
|
- data:this.qs.stringify({
|
|
|
+ data: this.qs.stringify({
|
|
|
page_item: "100000000",
|
|
|
- })
|
|
|
+ }),
|
|
|
}).then((res) => {
|
|
|
console.log(res.data.data);
|
|
|
this.versionsoptions = res.data.data.page_list; //组织
|
|
|
@@ -528,9 +533,9 @@ export default {
|
|
|
this.$axios({
|
|
|
method: "POST",
|
|
|
url: "/api/api_gateway?method=monitor_manage.trap_manage.trap_org",
|
|
|
- data:this.qs.stringify({
|
|
|
- page_item:"10000000"
|
|
|
- })
|
|
|
+ data: this.qs.stringify({
|
|
|
+ page_item: "10000000",
|
|
|
+ }),
|
|
|
}).then((res) => {
|
|
|
console.log(res.data.data);
|
|
|
this.versionsoptions2 = res.data.data.org_data; //组织
|
|
|
@@ -571,7 +576,7 @@ export default {
|
|
|
org_id = org_id.join("/");
|
|
|
}
|
|
|
console.log(org_id);
|
|
|
- this.releaseTF = true
|
|
|
+ this.releaseTF = true;
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.$axios({
|
|
|
@@ -586,9 +591,9 @@ export default {
|
|
|
inducer_id: this.ruleForm.inducer_id, // 必传(string) 诱剂id
|
|
|
point_id: this.ruleForm.point_id, // 必传(string) 所属监测点id
|
|
|
trap_status: this.ruleForm.trap_status, // 必传(string) 设备状态0停用 1正常
|
|
|
- parameter: this.parameter
|
|
|
- })
|
|
|
- }).then(res => {
|
|
|
+ parameter: this.parameter,
|
|
|
+ }),
|
|
|
+ }).then((res) => {
|
|
|
console.log(res);
|
|
|
if (res.data.data) {
|
|
|
var message = "";
|
|
|
@@ -601,7 +606,7 @@ export default {
|
|
|
this.$message({
|
|
|
showClose: true,
|
|
|
message: message,
|
|
|
- type: "success"
|
|
|
+ type: "success",
|
|
|
});
|
|
|
this.addtraptf = false;
|
|
|
this.getcbdlist();
|
|
|
@@ -609,16 +614,16 @@ export default {
|
|
|
this.$message({
|
|
|
showClose: true,
|
|
|
message: "添加失败" + res.data.message,
|
|
|
- type: "warning"
|
|
|
+ type: "warning",
|
|
|
});
|
|
|
}
|
|
|
- this.releaseTF = false
|
|
|
+ this.releaseTF = false;
|
|
|
});
|
|
|
} else {
|
|
|
if (document.getElementsByClassName("el-message").length == 0) {
|
|
|
this.$message({
|
|
|
message: "请将信息填写完全",
|
|
|
- type: "warning"
|
|
|
+ type: "warning",
|
|
|
});
|
|
|
}
|
|
|
return false;
|
|
|
@@ -652,12 +657,11 @@ export default {
|
|
|
getmon3(trap_id) {
|
|
|
this.$axios({
|
|
|
method: "POST",
|
|
|
- url:
|
|
|
- "/api/api_gateway?method=sysmenage.usermanager.get_parent_org_list;",
|
|
|
+ url: "/api/api_gateway?method=sysmenage.usermanager.get_parent_org_list;",
|
|
|
data: this.qs.stringify({
|
|
|
- device_id: trap_id
|
|
|
- })
|
|
|
- }).then(res => {
|
|
|
+ device_id: trap_id,
|
|
|
+ }),
|
|
|
+ }).then((res) => {
|
|
|
// console.log(res.data.data);
|
|
|
var orgdatas = res.data.data;
|
|
|
if (orgdatas.length != 0) {
|
|
|
@@ -679,7 +683,7 @@ export default {
|
|
|
var str = "您确定删除编号为<" + events.trap_number + ">的诱捕器吗?";
|
|
|
this.$confirm(str, "删除诱捕器", {
|
|
|
confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消"
|
|
|
+ cancelButtonText: "取消",
|
|
|
})
|
|
|
.then(() => {
|
|
|
this.$axios({
|
|
|
@@ -687,22 +691,22 @@ export default {
|
|
|
url: "/api/api_gateway?method=monitor_manage.trap_manage.add_trap",
|
|
|
data: this.qs.stringify({
|
|
|
trap_id: events.trap_id,
|
|
|
- parameter: "del"
|
|
|
- })
|
|
|
- }).then(res => {
|
|
|
+ parameter: "del",
|
|
|
+ }),
|
|
|
+ }).then((res) => {
|
|
|
console.log(res);
|
|
|
if (res.data.data) {
|
|
|
this.$message({
|
|
|
showClose: true,
|
|
|
message: "删除成功!",
|
|
|
- type: "success"
|
|
|
+ type: "success",
|
|
|
});
|
|
|
this.getcbdlist();
|
|
|
} else {
|
|
|
this.$message({
|
|
|
showClose: true,
|
|
|
message: "删除失败," + res.data.message,
|
|
|
- type: "warning"
|
|
|
+ type: "warning",
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
@@ -710,7 +714,7 @@ export default {
|
|
|
.catch(() => {
|
|
|
this.$message({
|
|
|
type: "info",
|
|
|
- message: "已取消删除"
|
|
|
+ message: "已取消删除",
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
@@ -723,15 +727,15 @@ export default {
|
|
|
method: "POST",
|
|
|
url: "/api/trap_export",
|
|
|
data: datas,
|
|
|
- responseType: "blob"
|
|
|
- }).then(res => {
|
|
|
+ responseType: "blob",
|
|
|
+ }).then((res) => {
|
|
|
console.log(res);
|
|
|
this.downloadFile(res, "allot_result.xls");
|
|
|
});
|
|
|
},
|
|
|
download() {
|
|
|
//下载模板
|
|
|
- console.log(22222)
|
|
|
+ console.log(22222);
|
|
|
window.location.href =
|
|
|
// this.$deriveData +
|
|
|
// "http://192.168.1.77:12345/api/trap_export";1
|
|
|
@@ -746,28 +750,41 @@ export default {
|
|
|
document.body.appendChild(link);
|
|
|
link.click();
|
|
|
document.body.removeChild(link);
|
|
|
+ this.deriveTF = false
|
|
|
},
|
|
|
deriveclick() {
|
|
|
// this.deriveVisible = false;
|
|
|
- this.$axios({
|
|
|
- method: "POST",
|
|
|
- url: "api/trap_list_export",
|
|
|
- data: this.qs.stringify({
|
|
|
- trap_number: this.ruleForm.trap_number,
|
|
|
- point_id: this.ruleForm.point_id,
|
|
|
- org_id: this.ruleForm.org_id,
|
|
|
- trap_status: this.ruleForm.trap_status,
|
|
|
- file_name: this.derivefilename,
|
|
|
- user: localStorage.getItem("usernme")
|
|
|
- }),
|
|
|
- responseType: "blob"
|
|
|
- }).then(res => {
|
|
|
- console.log(res);
|
|
|
- this.downloadFile(res, this.derivefilename + ".xls");
|
|
|
- });
|
|
|
+ if (this.derivefilename == "") {
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: "请输入文件名称",
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.deriveTF = true
|
|
|
+ this.$axios({
|
|
|
+ method: "POST",
|
|
|
+ url: "api/trap_list_export",
|
|
|
+ data: this.qs.stringify({
|
|
|
+ trap_number: this.ruleForm.trap_number,
|
|
|
+ point_id: this.ruleForm.point_id,
|
|
|
+ org_id: this.ruleForm.org_id,
|
|
|
+ trap_status: this.ruleForm.trap_status,
|
|
|
+ file_name: this.derivefilename,
|
|
|
+ user: localStorage.getItem("usernme"),
|
|
|
+ }),
|
|
|
+ responseType: "blob",
|
|
|
+ }).then((res) => {
|
|
|
+ console.log(res);
|
|
|
+ this.downloadFile(res, this.derivefilename + ".xls");
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
reset() {
|
|
|
//重置
|
|
|
+ this.idinput = "";
|
|
|
+ this.trapvalue = "";
|
|
|
+ this.inoffvalue = "";
|
|
|
this.queryInfo.trap_number = "";
|
|
|
this.queryInfo.point_id = "";
|
|
|
this.queryInfo.org_id = "";
|
|
|
@@ -782,18 +799,18 @@ export default {
|
|
|
center: this.center,
|
|
|
resizeEnable: true,
|
|
|
zoom: 10,
|
|
|
- lang: "en"
|
|
|
+ lang: "en",
|
|
|
});
|
|
|
AMap.plugin(["AMap.ToolBar", "AMap.Geocoder"], () => {
|
|
|
map.addControl(new AMap.ToolBar());
|
|
|
this.geocoder = new AMap.Geocoder({
|
|
|
city: "全国",
|
|
|
- radius: 1000
|
|
|
+ radius: 1000,
|
|
|
});
|
|
|
});
|
|
|
setTimeout(() => {
|
|
|
var marker = new AMap.Marker({
|
|
|
- position: this.center
|
|
|
+ position: this.center,
|
|
|
});
|
|
|
console.log(this.center);
|
|
|
marker.setMap(map);
|
|
|
@@ -812,7 +829,7 @@ export default {
|
|
|
this.map.setFitView(marker);
|
|
|
this.locationForm = {
|
|
|
lat: lnglat.lat,
|
|
|
- lng: lnglat.lng
|
|
|
+ lng: lnglat.lng,
|
|
|
};
|
|
|
} else {
|
|
|
this.$message.error("根据地址查询位置失败");
|
|
|
@@ -821,19 +838,19 @@ export default {
|
|
|
},
|
|
|
// 地图点击事件
|
|
|
testevent() {
|
|
|
- this.map.on("click", ev => {
|
|
|
+ this.map.on("click", (ev) => {
|
|
|
var lnglat = [ev.lnglat.lng, ev.lnglat.lat];
|
|
|
this.locationForm = { lng: lnglat[0], lat: lnglat[1] };
|
|
|
this.map.clearMap();
|
|
|
var marker = new AMap.Marker({
|
|
|
- position: lnglat
|
|
|
+ position: lnglat,
|
|
|
});
|
|
|
marker.setMap(this.map);
|
|
|
this.getAddress(lnglat);
|
|
|
setTimeout(() => {
|
|
|
new AMap.InfoWindow({
|
|
|
content: "<h5>" + "当前选中地址" + "</h5>" + this.address,
|
|
|
- offset: new AMap.Pixel(0, -32)
|
|
|
+ offset: new AMap.Pixel(0, -32),
|
|
|
}).open(this.map, lnglat);
|
|
|
}, 100);
|
|
|
});
|
|
|
@@ -863,7 +880,7 @@ export default {
|
|
|
if (this.locationForm.lat && this.locationForm.lng) {
|
|
|
let lnglat = [this.locationForm.lng, this.locationForm.lat];
|
|
|
var marker = new AMap.Marker({
|
|
|
- position: lnglat
|
|
|
+ position: lnglat,
|
|
|
});
|
|
|
marker.setMap(this.map);
|
|
|
} else {
|
|
|
@@ -872,16 +889,16 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
dingwei() {
|
|
|
- console.log(this.ruleForm)
|
|
|
+ console.log(this.ruleForm);
|
|
|
if (this.ruleForm.lng != "" && this.ruleForm.lng != 0) {
|
|
|
this.center[0] = this.ruleForm.lng;
|
|
|
- }else{
|
|
|
- this.center = [114.05, 22.55]
|
|
|
+ } else {
|
|
|
+ this.center = [114.05, 22.55];
|
|
|
}
|
|
|
if (this.ruleForm.lat != "" && this.ruleForm.lat != 0) {
|
|
|
this.center[1] = this.ruleForm.lat;
|
|
|
- }else{
|
|
|
- this.center = [114.05, 22.55]
|
|
|
+ } else {
|
|
|
+ this.center = [114.05, 22.55];
|
|
|
}
|
|
|
this.addLocationDialogVisible = true;
|
|
|
setTimeout(() => {
|
|
|
@@ -959,7 +976,7 @@ export default {
|
|
|
str += `<p>` + e.org_list[i].org_name + `</p>`;
|
|
|
}
|
|
|
this.content = str;
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
beforeCreate() {}, //生命周期 - 创建之前
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
@@ -975,7 +992,7 @@ export default {
|
|
|
updated() {}, //生命周期 - 更新之后
|
|
|
beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
destroyed() {}, //生命周期 - 销毁完成
|
|
|
- activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+ activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
};
|
|
|
</script>
|
|
|
<style scoped lang="less">
|