You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

419 lines
12 KiB
Vue

2 years ago
<template>
<div class="photoGraphicDevice">
<div class="photoBox">
<div class="photoGraphicBtnGroup">
2 years ago
<h4>拍照装置管理</h4>
<el-button type="primary" icon="el-icon-plus" @click="handleAddPhoto()"
>新增</el-button
>
</div>
<div class="photoGraphicTable">
<el-table
ref="multipleTable"
:data="terminalTableData"
2 years ago
stripe
tooltip-effect="dark"
style="width: 100%"
height="calc(100% - 40px)"
@selection-change="handleSelectionChange"
@row-click="handleRowClick"
2 years ago
v-loading="loading"
>
<el-table-column
prop="cmdid"
label="图像监测装置ID(cmdid)"
show-overflow-tooltip
width="160px"
>
</el-table-column>
2 years ago
<el-table-column
prop="displayName"
label="显示名"
show-overflow-tooltip
width="160px"
>
2 years ago
<template slot-scope="scope">
<span v-if="scope.row.hadisplayNamesPan == ''">{{
scope.row.hadisplayNamesPan
}}</span>
<span v-else>{{ scope.row.cmdid }}</span>
</template>
2 years ago
</el-table-column>
2 years ago
<el-table-column prop="linename" label="线路编号"> </el-table-column>
<el-table-column prop="towername" label="杆塔编号"> </el-table-column>
2 years ago
<el-table-column prop="hasPan" label="是否带云台">
<template slot-scope="scope">
<span v-if="scope.row.hasPan == 0"></span>
<span v-if="scope.row.hasPan == 1"></span>
</template>
</el-table-column>
2 years ago
<!-- <el-table-column
2 years ago
prop="updateTime"
label="修改时间"
:show-overflow-tooltip="true"
:formatter="dateFormat"
width="160px"
>
2 years ago
</el-table-column> -->
2 years ago
<el-table-column prop="equipName" label="装置名称"> </el-table-column>
<el-table-column prop="model" label="装置型号"> </el-table-column>
2 years ago
<!-- <el-table-column label="经维度">
2 years ago
<template slot-scope="scope" v-if="scope.row.longitude">
<span>({{ scope.row.longitude }},</span>
<span>{{ scope.row.latitude }})</span>
</template>
2 years ago
</el-table-column> -->
2 years ago
2 years ago
<!-- <el-table-column prop="orgId" label="原始ID"> </el-table-column> -->
<el-table-column
prop="essentialInfoVersion"
label="装置基本信息版本号"
width="140px"
>
</el-table-column>
2 years ago
<!-- <el-table-column label="出厂编号">
<template slot-scope="scope">{{ scope.row.bsIdentifier }}</template>
2 years ago
</el-table-column> -->
<!-- <el-table-column prop="bsManufacturer" label="生产厂家">
</el-table-column> -->
<!-- <el-table-column
prop="bsProductionDate"
label="生产日期"
:show-overflow-tooltip="true"
:formatter="dateFormat"
>
2 years ago
</el-table-column> -->
<el-table-column
prop="createTime"
label="创建时间"
:show-overflow-tooltip="true"
:formatter="dateFormat"
>
</el-table-column>
2 years ago
<el-table-column fixed="right" label="操作" width="400">
<template slot-scope="scope">
<el-button
@click.native.stop="handleRevisePhoto(scope.row)"
type="text"
>修改</el-button
>
2 years ago
<el-button
type="text"
@click.native.stop="handlepicture(scope.row)"
>线缆绘制</el-button
>
2 years ago
<el-button
type="text"
@click.native.stop="handleDeviceReset(scope.row)"
>装置复位</el-button
>
2 years ago
<!-- <el-button type="text">远程升级</el-button> -->
2 years ago
<!-- <el-button
2 years ago
type="text"
@click.native.stop="handleShowGPS(scope.row)"
>获取GPS位置</el-button
>
<el-dropdown
class="dropgps"
trigger="click"
@command="handleCommand"
>
<span class="el-dropdown-link">
GPS开关<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown" class="gpsdropStyle">
<el-dropdown-item command="open">开启GPS</el-dropdown-item>
<el-dropdown-item command="close">关闭GPS</el-dropdown-item>
</el-dropdown-menu>
2 years ago
</el-dropdown> -->
2 years ago
<el-button
type="text"
@click.native.stop="handleImageCapture(scope.row)"
>图像采集装置</el-button
>
<el-button
type="text"
class="deleteText"
@click.native.stop="handleDelete(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
:current-page="page"
:page-size="pageSize"
layout=" prev, pager, next, jumper,total"
:total="total"
background
>
</el-pagination>
</div>
</div>
</div>
<addPhotoDialog
:photoDialogTitle="photoDialogTitle"
2 years ago
ref="addPhotoDialogref"
></addPhotoDialog>
<imageCapture ref="imageCaptureref"></imageCapture>
2 years ago
<pictureTags ref="picturetagsref"></pictureTags>
</div>
2 years ago
</template>
<script>
2 years ago
import {
getTerminalJoggle,
deleteTerminalJoggle,
resetTerminalApi,
2 years ago
getTermGPSJoggle,
setTermGPSJoggle,
2 years ago
} from "@/utils/api/index";
import moment from "moment";
import addPhotoDialog from "./components/addPhotoDialog.vue";
import imageCapture from "./components/imageCapture.vue";
2 years ago
import pictureTags from "./components/pictureTags.vue";
2 years ago
export default {
components: {
addPhotoDialog,
2 years ago
imageCapture,
2 years ago
pictureTags,
},
data() {
return {
terminalTableData: [], //表格数据
photoDialog: false, //新增弹窗
photoDialogTitle: "", //弹窗标题
deleteArr: [], //删除数组
multipleSelection: [], //当前选中数组
formphotoInfo: {}, //弹窗传值
page: 1, // 当前页数
2 years ago
pageSize: 30, // 每页数量
total: 0, //总条数
2 years ago
loading: true,
};
},
methods: {
////获取拍照装置列表数据
2 years ago
terminalList() {
2 years ago
this.loading = true;
getTerminalJoggle({
2 years ago
pageindex: this.page,
pagesize: this.pageSize,
})
.then((res) => {
console.log(res);
this.terminalTableData = res.data.list;
this.total = res.data.total;
2 years ago
this.loading = false;
})
.catch((err) => {
console.log(err); //代码错误、请求失败捕获
});
},
//点击行选中当前行
handleRowClick(row, column, event) {
this.$refs.multipleTable.toggleRowSelection(row);
},
//获取选中的行
handleSelectionChange(val) {
this.multipleSelection = val;
},
//时间转化
dateFormat(row, column) {
var date = row[column.property];
if (date == undefined) {
return "";
}
return moment(date).format("YYYY-MM-DD HH:mm:ss");
},
2 years ago
// 新建弹窗
handleAddPhoto() {
this.photoDialogTitle = "新增";
2 years ago
this.$refs.addPhotoDialogref.display();
this.$refs.addPhotoDialogref.getdataform(null);
},
2 years ago
//handleResive 修改线路数据
handleRevisePhoto(data) {
this.photoDialogTitle = "修改";
2 years ago
this.$refs.addPhotoDialogref.display();
this.$refs.addPhotoDialogref.getdataform(data);
},
//装置复位
2 years ago
handleDeviceReset(data) {
2 years ago
this.$confirm("此操作将复位装置, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
resetTerminalApi({ cmId: data.cmdid })
.then((res) => {
if (res.code == 200) {
this.$message({ message: "装置已复位", type: "success" });
} else {
this.$message({ message: res.msg, type: "error" });
}
})
.catch((err) => {});
2 years ago
})
2 years ago
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
},
2 years ago
//获取GPS位置
handleShowGPS(data) {
console.log(data);
getTermGPSJoggle({ termid: data.id, cmId: data.cmdid })
.then((res) => {
console.log(res);
this.$alert(
"<p><label>经度:</label><span>" +
`${res.data.longitude}` +
"</span></p><p><label>纬度:</label><span>" +
`${res.data.latitude}` +
"</span></p><p><label>半径:</label><span>" +
`${res.data.radius}` +
"</span></p>",
"GPS位置",
{
dangerouslyUseHTMLString: true,
customClass: "messageGps",
}
);
})
.catch((err) => {
console.log(err); //代码错误、请求失败捕获
});
},
//切换gps开启关闭
changeGPS(val) {
console.log(val);
setTermGPSJoggle({ gpsstatus: val, termid: this.channelId })
.then((res) => {
console.log(res);
if (val == 0) {
this.$message("关闭GPS");
} else {
this.$message({
message: "成功开启GPS",
type: "success",
});
}
})
.catch((err) => {
console.log(err); //代码错误、请求失败捕获
});
},
handleCommand(command) {
switch (command) {
case "open": //开启
this.changeGPS(1);
break;
case "close": //关闭
this.changeGPS(0);
break;
}
},
//图像采集参数
2 years ago
handleImageCapture(data) {
this.$refs.imageCaptureref.display();
this.$refs.imageCaptureref.getSingleAccess(data);
this.$refs.imageCaptureref.getRatio();
},
2 years ago
//线缆绘制
handlepicture(data) {
this.$refs.picturetagsref.display(data);
},
2 years ago
// //新建弹窗handleAddPhoto
// handleAddPhoto() {
// this.photoDialog = true;
// this.photoDialogTitle = "新增";
// },
// //修改弹窗handleRevisePhoto
// handleRevisePhoto(data) {
// this.photoDialog = true;
// this.photoDialogTitle = "修改";
// this.formphotoInfo = Object.assign({}, data);
// },
//删除数据
handleDelete(data) {
console.log(data);
this.deleteArr.push({
termid: data.id,
});
console.log(this.deleteArr);
this.$confirm("确定要删除记录吗,同时删除关联关系?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
// 行设置向后台请求删除数据
deleteTerminalJoggle({ list: this.deleteArr }).then((res) => {
console.log(res);
2 years ago
this.terminalList(); //刷新
});
this.$message({
type: "success",
message: "删除成功!",
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
},
//点击分页
handleCurrentChange(val) {
this.page = val;
2 years ago
this.terminalList(); //刷新
},
},
created() {
2 years ago
this.terminalList();
},
2 years ago
};
</script>
<style lang="less">
.photoGraphicDevice {
2 years ago
width: calc(100% - 32px);
height: calc(100% - 32px);
2 years ago
padding: 16px 16px;
background: @color-white;
.photoBox {
border: 1px solid #dddddd;
height: calc(100% - 32px);
padding: 16px;
border-radius: 4px;
}
.photoGraphicBtnGroup {
display: flex;
2 years ago
justify-content: space-between;
align-items: center;
}
.photoGraphicTable {
margin-top: 16px;
height: calc(100% - 48px);
}
2 years ago
.dropgps {
color: #409eff;
margin-left: 16px;
margin-right: 16px;
cursor: pointer;
}
}
</style>