|
@@ -0,0 +1,360 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <!-- <headerdiv ref="headerDiv" :currentindexP = currentindexNew></headerdiv> -->
|
|
|
+ <div class="divtitle">
|
|
|
+ <img src="~@/assets/images/icon.png" style="width:1.8rem;height:1.8rem;margin-top:0.3rem"/>
|
|
|
+ <div style="font-size:1.6rem;font-family: Adobe Heiti Std;font-weight: normal;color: #DFEEF3;margin-left:1rem">{{divtitle}}</div>
|
|
|
+ <el-button type="info" icon="el-icon-plus" circle style="margin-left:135rem" @click="handleAdd"></el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-table :data="droneList" stripe
|
|
|
+ class="my_table"
|
|
|
+ :row-class-name="tableRowClassName"
|
|
|
+ max-height = 820
|
|
|
+ :header-cell-style="{background:'#24A3B3 50%',color: '#C5D0D4'}"
|
|
|
+ style="margin-top:2rem">
|
|
|
+ <el-table-column label="序号" align="center" type="index" />
|
|
|
+ <el-table-column label="无人机编号" align="center" prop="no" />
|
|
|
+ <el-table-column label="区域" align="center" prop="area" />
|
|
|
+ <el-table-column label="负责人" align="center" prop="manager" />
|
|
|
+ <el-table-column label="负责人手机号" align="center" prop="phone" />
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ >修改</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="droneDelete(scope)"
|
|
|
+ >删除</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-video-play"
|
|
|
+ @click="handleVideo(scope.row)"
|
|
|
+ >查看</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ title="视频播放ckplayer"
|
|
|
+ :visible.sync="dialogVisibleCk"
|
|
|
+ v-if="dialogVisibleCk"
|
|
|
+ width="50%"
|
|
|
+ :before-close="handleCloseCk"
|
|
|
+ >
|
|
|
+ <div style="width:100%;height:60rem;position:relative">
|
|
|
+ <div class="video" id="video" style="width:100%;height:100%;position:absolute;top:0;left:0"></div>
|
|
|
+ <!-- <videodiv :cameracode="ccode" style="width:100%;height:100%;position:absolute;top:0;left:0"></videodiv> -->
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="handleCloseCk()">关闭</el-button>
|
|
|
+ <!-- <el-button type="primary" @click="dialogVisible = false">确 定</el-button> -->
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="10rem">
|
|
|
+ <el-form-item label="无人机编号" prop="no">
|
|
|
+ <el-input v-model="form.no" placeholder="请输入无人机名称" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="区域" prop="area">
|
|
|
+ <el-input v-model="form.area" placeholder="请输入区域名称" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="负责人" prop="manager">
|
|
|
+ <el-input v-model="form.manager" placeholder="请输入负责人名称" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="负责人手机号" prop="phone">
|
|
|
+ <el-input v-model="form.phone" placeholder="请输入负责人手机号" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="视频地址" prop="video">
|
|
|
+ <el-input v-model="form.video" placeholder="请输入视频地址" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="坐标" prop="fence">
|
|
|
+ <el-input v-model="form.fence" placeholder="请输入坐标" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm()">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ /> -->
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config";
|
|
|
+import { getLineData,getVideoHttp } from "@/api/qdtl/data";
|
|
|
+import headerdiv from '@/components/HeaderDiv/index.vue'
|
|
|
+import mapdiv from "@/components/map/index.vue"
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "Location",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+
|
|
|
+ divtitle:'无人机查看',
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 巡检点管理表格数据
|
|
|
+ locationList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+
|
|
|
+ isEdit:'true',
|
|
|
+
|
|
|
+ configObj:{},
|
|
|
+
|
|
|
+ selectUser:[],
|
|
|
+
|
|
|
+ Base64:require('js-base64').Base64,
|
|
|
+
|
|
|
+ userList:[],
|
|
|
+
|
|
|
+ dateRange:'',
|
|
|
+
|
|
|
+ dateRangeArry:[],
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ },
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+
|
|
|
+ pointArry:{
|
|
|
+ locations:'',
|
|
|
+ type:''
|
|
|
+ },
|
|
|
+ droneList:[],
|
|
|
+
|
|
|
+ form:{},
|
|
|
+
|
|
|
+ dialogVisibleCk:false,
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ components:{
|
|
|
+ mapdiv,
|
|
|
+ headerdiv
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList();
|
|
|
+ // this.getAreaList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handleVideo(data){
|
|
|
+ this.dialogVisibleCk = true;
|
|
|
+ console.log(data.video);
|
|
|
+ var url = 'rtmp://39.104.22.45:30498/rtp/34020001001320000001_34020001001320000001'
|
|
|
+ console.log(url);
|
|
|
+ url = this.Base64.encode(url);
|
|
|
+ console.log(url);
|
|
|
+ getVideoHttp(url).then(data=>{
|
|
|
+ console.log(process.env.NODE_ENV)
|
|
|
+
|
|
|
+ if(process.env.NODE_ENV === "production"){
|
|
|
+
|
|
|
+ data.data = (data.data+"").replaceAll("http://58.221.168.61:9000/",process.env.VUE_APP_BASE_API)
|
|
|
+ }
|
|
|
+ console.log(data.data)
|
|
|
+ var videoObject = {
|
|
|
+ container: '.video', //“#”代表容器的ID,“.”或“”代表容器的class
|
|
|
+ variable: 'player', //播放函数名称,该属性必需设置,值等于下面的new ckplayer()的对象
|
|
|
+ autoplay:true,
|
|
|
+ live:true,
|
|
|
+ overspread:true,//是否让视频铺满播放器
|
|
|
+ html5m3u8:true,//m3u8-hls形式播放视频
|
|
|
+ // video: 'rtmp://58.200.131.2:1935/livetv/cctv1'//视频地址
|
|
|
+ video:data.data//视频地址
|
|
|
+ // video:'http://39.104.22.45:8089/rtp/34020001001320000001_34020001001320000001/hls.m3u8'
|
|
|
+ };
|
|
|
+ console.log(videoObject);
|
|
|
+ window.player = new ckplayer(videoObject);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getList() {
|
|
|
+ getConfig(104).then(response => {
|
|
|
+ this.configObj = response.data
|
|
|
+ var jsonArry = JSON.parse(response.data.configValue);
|
|
|
+ this.droneList = jsonArry
|
|
|
+ console.log(this.droneList);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ addDrone(){
|
|
|
+ this.open = true;
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ getResource(){
|
|
|
+ getResource({date:'2022-03-12'}).then(response =>{
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ console.log(this.queryParams);
|
|
|
+ this.dateRange = this.queryParams.startDate + '至' +this.queryParams.endDate
|
|
|
+ console.log(this.dateRange);
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ handleCloseCk(){
|
|
|
+ this.dialogVisibleCk = false
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ // 多选框选中数据
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.ids = selection.map(item => item.id)
|
|
|
+ this.single = selection.length!==1
|
|
|
+ this.multiple = !selection.length
|
|
|
+ },
|
|
|
+ /** 新增按钮操作 */
|
|
|
+ handleAdd() {
|
|
|
+ // this.reset();
|
|
|
+ this.open = true;
|
|
|
+ this.title = "添加无人机管理";
|
|
|
+ },
|
|
|
+ /** 修改按钮操作 */
|
|
|
+ handleUpdate(row) {
|
|
|
+ this.form = row
|
|
|
+ this.title = "修改无人机管理";
|
|
|
+ this.open = true
|
|
|
+ },
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ console.log(this.form);
|
|
|
+ if(this.form.id != null){
|
|
|
+ for(var index in this.droneList){
|
|
|
+ if(this.droneList[index] == this.form.id){
|
|
|
+ this.droneList[index] = this.form
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.form.id = this.uuid()
|
|
|
+ this.droneList.push(this.form);
|
|
|
+ }
|
|
|
+ console.log(this.droneList);
|
|
|
+ this.configObj.configValue = JSON.stringify(this.droneList);
|
|
|
+ updateConfig(this.configObj).then(response =>{
|
|
|
+ this.reset();
|
|
|
+ this.open = false
|
|
|
+ this.getList();
|
|
|
+ })
|
|
|
+ },
|
|
|
+ droneDelete(data){
|
|
|
+ console.log(data.$index);
|
|
|
+ //var selectUserArry = [];
|
|
|
+ // console.log(data);
|
|
|
+ for(var index in this.droneList){
|
|
|
+ if(index == data.$index){
|
|
|
+ console.log(index);
|
|
|
+ this.droneList.splice(index,1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.configObj.configValue = JSON.stringify(this.droneList);
|
|
|
+ updateConfig(this.configObj).then(response =>{
|
|
|
+ this.getList();
|
|
|
+ })
|
|
|
+ },
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+
|
|
|
+ };
|
|
|
+ },
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDelete(row) {
|
|
|
+ const ids = row.id || this.ids;
|
|
|
+ this.$modal.confirm('是否确认删除巡检点管理编号为"' + ids + '"的数据项?').then(function() {
|
|
|
+ return delLocation(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ this.download('qdtl/location/export', {
|
|
|
+ ...this.queryParams
|
|
|
+ }, `location_${new Date().getTime()}.xlsx`)
|
|
|
+ },
|
|
|
+ tableRowClassName({ row, rowIndex }) {
|
|
|
+ if ((rowIndex + 1) % 2 === 0) {
|
|
|
+ return "warning-row";
|
|
|
+ } else {
|
|
|
+ return "success-row";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deleteLocation(){
|
|
|
+ // this.$refs.mapv.draw.set
|
|
|
+ this.$refs.mapv.vector.getSource().clear()
|
|
|
+ },
|
|
|
+ uuid(){
|
|
|
+ var s = [];
|
|
|
+ var hexDigits = "0123456789abcdef";
|
|
|
+ for (var i = 0; i < 36; i++) {
|
|
|
+ s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
|
|
|
+ }
|
|
|
+ s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
|
|
|
+ s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
|
|
|
+ s[8] = s[13] = s[18] = s[23] = "-";
|
|
|
+
|
|
|
+ var uuid = s.join("");
|
|
|
+ return uuid;
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+ .divtitle{
|
|
|
+ background: url("~@/assets/images/title2@2x.png") no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ width:100%;
|
|
|
+ height:3.9rem;
|
|
|
+ padding-top:0.8rem;
|
|
|
+ padding-left:3rem;
|
|
|
+ display: inline-flex;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+</style>
|