lichao 9 months ago
parent
commit
3b0c6608b3
  1. 5
      src/views/modules/shequzhili/materialcode/add.vue
  2. 177
      src/views/modules/shequzhili/materialcode/icmaterialcode.vue
  3. 554
      src/views/modules/shequzhili/videomonitoring/add.vue
  4. 211
      src/views/modules/shequzhili/videomonitoring/event.vue
  5. 479
      src/views/modules/shequzhili/videomonitoring/index.vue

5
src/views/modules/shequzhili/materialcode/add.vue

@ -126,7 +126,10 @@ export default {
this.startLoading();
if(row!=null){
this.formData = JSON.parse(JSON.stringify(row));
this.fileList.push({fileUrl:this.formData.picture})
if (this.formData.picture){
this.fileList.push({fileUrl:this.formData.picture})
}
console.log(this.formData.picture,'see');
}

177
src/views/modules/shequzhili/materialcode/icmaterialcode.vue

@ -5,7 +5,7 @@
<div>
<el-form-item label="物件名称">
<el-input v-model.trim="formData.title" size="small" class="item_width_1" clearable placeholder="请输入">
<el-input v-model.trim="formData.name" size="small" class="item_width_1" clearable placeholder="请输入">
</el-input>
</el-form-item>
<el-form-item label="物件介绍">
@ -28,8 +28,19 @@
</el-form>
</div>
<div class="m-table">
<div class="div_btn">
<el-button style="" class="diy-button--add" size="small" @click="handleAdd">新增</el-button>
<div class="resi-row-btn">
<el-button style="" class="diy-button--add" size="small" @click="handleAdd">入库</el-button>
<el-button style="" class="diy-button--add" size="small" @click="downloadTem">下载模板</el-button>
<!-- <el-button style="" class="diy-button&#45;&#45;add" size="small" @click="exportData">导入</el-button>-->
<el-button class="diy-button--white" size="small">
<el-upload :headers="$getElUploadHeaders()" ref="upload" class="upload-btn" action="uploadUlr" :limit="1"
:accept="'.xls,.xlsx'" :with-credentials="true" :show-file-list="false" :auto-upload="true"
:on-progress="handleProgress" :on-success="handleExcelSuccess" :before-upload="beforeExcelUpload"
:http-request="uploadHttpRequest">
导入
</el-upload>
</el-button>
</div>
<el-table class="table" :data="tableData" border v-loading="tableLoading" style="width: 100%">
@ -98,9 +109,11 @@
formTitle: '新增活动',
detailShow: false,
formData: {
status:'',
agencyId: '',
name: ""
// status:'',
// agencyId: '',
name: null,
introduce:null,
remark:null
},
pageSize: 20,
pageNo: 1
@ -120,6 +133,146 @@
},
methods: {
async exportData(){
},
async downloadTem(){
let url =
"/actual/base/materialcode/downloadImportTemplate";
let params = {};
await this.$http({
method: "get",
url,
responseType: "blob",
data: params,
})
.then((res) => {
// this.download(res.data, title + '.xls')
if (res.headers["content-disposition"]) {
let fileName = window.decodeURI(
res.headers["content-disposition"].split(";")[1].split("=")[1]
);
console.log("filename", fileName);
let blob = new Blob([res.data], {
type: "application/vnd.ms-excel",
});
var url = window.URL.createObjectURL(blob);
var aLink = document.createElement("a");
aLink.style.display = "none";
aLink.href = url;
aLink.setAttribute("download", fileName);
document.body.appendChild(aLink);
aLink.click();
document.body.removeChild(aLink); //
window.URL.revokeObjectURL(url); //blob
} else this.$message.error("下载失败");
})
.catch((err) => {
console.log("err", err);
return this.$message.error("网络错误");
});
},
handleProgress(event, file, fileList) {
console.log("percentage", file.percentage);
},
handleExcelSuccess(res, file) {
if (!res.code === 0 && !res.msg === 'success') {
this.$message.error(res.msg);
}
},
beforeExcelUpload(file) {
console.log(file,"file1");
debugger
const isType = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
debugger
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
const fileType = isType || isTypeComputer;
debugger
const isLt1M = file.size / 1024 / 1024 < 10;
debugger
if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式!');
}
debugger
if (!isLt1M) {
this.$message.error('上传文件大小不能超过 10MB!');
}
console.log(isLt1M,"isLt1M");
debugger
return fileType && isLt1M;
},
//
async uploadHttpRequest(file) {
debugger
// this.importLoading = true;
console.log(this.importLoading,"this.importLoading");
debugger
// this.importBtnTitle = '...';
this.$message({
showClose: true,
dangerouslyUseHTMLString: true,
message: "导入中,请到系统管理-<a id='clickA' style='cursor: pointer;'>导入记录</a>中查看进度",
duration: 3000
});debugger
let than = this;
console.log(than,"than");
debugger
// document.getElementById('clickA').addEventListener('click', function () {
// than.$router.replace('/main/importRecord-index');
// });
const formData = new FormData(); //FormDataappend('key', value)
formData.append('file', file.file); //
formData.append('code', ''); //
debugger
console.log(formData,"formData");
let url = '/actual/base/materialcode/import'
// if (this.importType == 2) {
// url = '/governance/icEvent/importAwo'
// }
console.log(url)
await this.$http
.post(url, formData)
.then(res => {
log("res", res);
if (res.data.code == 0 && res.data.msg == 'success') {
const data = res.data.data;
this.dataList = [
...Object.keys(data.option.exist).map(k => {
return {
index: k,
srcField: data.option.exist[k],
exist: true,
field: data.option.exist[k]
};
}),
...Object.keys(data.option.notExist).map(k => {
return {
index: k,
srcField: data.option.notExist[k],
exist: false,
field: ''
};
})
];
this.importOption = data.option;
this.importCode = data.code;
this.fileData = file;
} else this.$message.error(res.data.msg);
})
.catch(err => {
console.log('失败', err);
file.onError(); //
});
this.importLoading = false;
this.importBtnTitle = '导入';
this.$refs.upload.clearFiles();
this.getTableData();
},
handleSearch () {
this.loadTable()
},
@ -192,7 +345,15 @@
},
async download(row){
window.open(row.code)
if (row.code!=null){
window.open(row.code)
}else{
this.$message({
type: "error",
message: "无二维码"
});
}
},
async handleDelete (row) {
@ -210,7 +371,7 @@
});
},
async deleteActivity (row) {
const url = "/actual/base/communityPublicity/delete"
const url = "/actual/base/materialcode/delete"
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/delete"
let idArr=[row.id]
const { data, code, msg } = await requestPost(url, idArr)

554
src/views/modules/shequzhili/videomonitoring/add.vue

@ -0,0 +1,554 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form" :inline="true" :model="formData" :rules="dataRule" :disabled="formType === 'detail'"
class="form">
<el-form-item label="所属区划" prop="agencyId" label-width="150px">
<el-cascader class="u-item-width-normal" ref="myCascader" clearable size="small"
v-model.trim="formData.agencyId" :options="orgOptions" :props="orgOptionProps"
@change="handleChangeAgency"></el-cascader>
</el-form-item>
<el-form-item label="设备名称" prop="monitorName" label-width="150px" style="display: block">
<el-input v-model.trim="formData.monitorName" size="small" clearable placeholder="请输入物件名称"
class="u-item-width-normal"></el-input>
</el-form-item>
<el-form-item label="设备类型" prop="monitorType" label-width="150px" style="display: block">
<div class="item_width_1">
<el-input v-if="formType != 'detail'" v-model.trim="formData.monitorType" :row='4'
placeholder="在这里输入文字" />
</div>
</el-form-item>
<el-form-item label="播放视频链接" prop="monitorUrl" label-width="150px" style="display: block">
<div class="item_width_1">
<el-input type = "textarea" v-if="formType != 'detail'" v-model.trim="formData.monitorUrl" :row='4'
placeholder="在这里输入文字" />
</div>
</el-form-item>
<el-form-item label="图片" label-width="140px" prop="imgUrl">
<template>
<upload-image :defaultFileList="fileList" :limit="1" @file-removed="handleFileRemoved"
@change="onChangeFileList"></upload-image>
</template>
</el-form-item>
<el-form-item label="所属公司" prop="monitorCompany" label-width="150px" style="display: block">
<div class="item_width_1">
<el-input type = "textarea" v-if="formType != 'detail'" v-model.trim="formData.monitorCompany" :row='4'
placeholder="在这里输入文字" />
</div>
</el-form-item>
<el-form-item label="负责人" prop="monitorOwnerName" label-width="150px" style="display: block">
<div class="item_width_1">
<el-input type = "textarea" v-if="formType != 'detail'" v-model.trim="formData.monitorOwnerName" :row='4'
placeholder="在这里输入文字" />
</div>
</el-form-item>
<el-form-item label="联系电话" prop="monitorOwnerMobile" label-width="150px" style="display: block">
<div class="item_width_1">
<el-input type = "textarea" v-if="formType != 'detail'" v-model.trim="formData.monitorOwnerMobile" :row='4'
placeholder="在这里输入文字" />
</div>
</el-form-item>
<el-form-item label="备注" prop="reamrk" label-width="150px" style="display: block">
<div class="item_width_1">
<el-input type = "textarea" v-if="formType != 'detail'" v-model.trim="formData.reamrk" :row='4'
placeholder="在这里输入文字" />
</div>
</el-form-item>
<el-form-item label="地图位置" prop="longitude" label-width="150px" style="display: block">
<div style="width: 500px">
<el-form-item prop="location" style="display: block">
<el-select v-model.trim="formData.location" filterable remote :reserve-keyword="true"
placeholder="请输入关键词" :remote-method="remoteMethod" :loading="loading"
@keyup.enter.native="remoteMethod(formData.location)">
<el-option v-for="(item, index) in searchOptions" @click.native="handleClickKey(index)"
:key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<div id="app_event" class="div_map"></div>
</div>
</el-form-item>
<el-form-item label="安装位置" prop="monitorAddress" label-width="150px" style="display: block">
<div class="item_width_1">
<el-input type = "textarea" v-if="formType != 'detail'" v-model.trim="formData.monitorAddress" :row='4'
placeholder="在这里输入文字" />
</div>
</el-form-item>
</el-form>
</div>
<div class="div_btn">
<el-button size="small" @click="handleCancle"> </el-button>
<el-button size="small" type="primary" :disabled="btnDisable" @click="handleComfirm">
</el-button>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import { requestPost } from '@/js/dai/request'
import Tinymce from '@c/tinymce2/index.vue'
import daiMap from "@/utils/dai-map";
import util from '@js/util.js';
// import UploadImage from './upload-image.vue'
import UploadImage from '@/views/modules/plugins/rent/upload-image.vue'
var map
var search
var markers
var infoWindowList
var geocoder //
let loading //
export default {
data() {
return {
adverTagList:[],
//////
orgOptions: [],//
orgOptionProps: {
value: 'agencyId',
label: 'agencyName',
children: 'subAgencyList',
emitPath: false,
multiple: false,
checkStrictly: true
},//
top:false,
fileList: [],//
activityImgs:[],//
formType: 'add', // addedit,records
// records:false,
searchOptions: [],
searchValue: '',
resultList: [],
num: 0,
loading: false,
timeRange: [],
online: false,
btnDisable: false,
keyWords: '',
activityId: '',
formData: {
latitude: "", //
longitude: "", //
location:"",
name: "",//
introduce: "",//
remark: "",//
imgUrl: "",//
sendMsg: false,//
status: 0 //
},
serviceList: [],
// gridList: [],
agencyId: '',
agencyName:"",
releaseTime: '',
demandOptions: [],
uploadUrl: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2',
customerId: localStorage.getItem('customerId'),
}
},
components: { Tinymce, UploadImage },
mounted() {
this.agencyName=this.$store.state.user.agencyName,
this.agencyId=this.$store.state.user.agencyId,
this.getOrgTrreeList()
this.advertisingTag()
this.setDefaultReleaseTime();
let { latitude, longitude } = this.$store.state.user;
if (!latitude || latitude == "" || latitude == "0") {
latitude = 39.9088810666821;
longitude = 116.39743841556731;
}
this.formData.latitude = latitude;
this.formData.longitude = longitude;
this.initMap(this.formData.latitude, this.formData.longitude);
},
methods: {
checkbox1(val){
},
handleFileRemoved(file) {
//
console.log('File removed:', file);
this.formData.imgUrl=""
//
},
//
getOrgTrreeList() {
this.$http
.post("/gov/org/customeragency/agencygridtree", { orgTypeFilter: this.orgTypeFilter })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
this.orgOptions = [];
this.orgOptions.forEach(item => {
item.subAgencyList.forEach(item2 => {
})
})
this.orgOptions.push(res.data);
console.log(this.orgOptions, "this.orgOptions");
}
})
.catch(() => {
return this.$message.error("网络错误");
});
},
async initForm(typeid,row) {
this.startLoading();
if(row!=null){
this.formData = JSON.parse(JSON.stringify(row));
if (this.formData.imgUrl){
this.fileList.push({fileUrl:this.formData.imgUrl})
}
console.log(this.formData.imgUrl,'see');
}
this.formType=typeid
console.log(typeid);
console.log(this.formType,"5164");
this.endLoading();
if(typeid=="add"){
this.setDefaultReleaseTime()
}
},
async advertisingTag () {
const url = "/actual/base/videoMonitoring/page"
let params = {
pageSize: this.pageSize,
pageNo: this.pageNo,
tagName: "",
status: ""
}
const { data, code, msg,internalMsg } = await requestPost(url, params)
if (code === 0) {
this.adverTagList = data.list
} else if(internalMsg !== ''){
this.$message.error(internalMsg)
}else {
this.$message.error(msg)
}
},
handleOnlineRegistration(value) {
console.log(this.fileList);
if( value && this.fileList.length==0){
console.log("51545");
this.$message.error("置顶需上传封面图片")
this.formData.top = false;
}
},
onChangeFileList(e) {
this.fileList = e.length > 0 ? e.map(item => ({
fileType: '0',
fileUrl: item.response.data.url
})) : []; // efileList
if (e.length > 0) {
let item = e[0];
let ob = {
fileType: '0',
fileUrl: item.response.data.url
};
this.fileList = [ob];
this.formData.imgUrl = ob.fileUrl;
}else {
this.formData.imgUrl = '';
}
},
async handleComfirm() {
this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
}, 10000)
this.$refs['ref_form'].validate((valid, messageObj) => {
console.log("this.formData看看里面村的什么",this.formData)
if (!valid) {
app.util.validateRule(messageObj)
this.btnDisable = false
} else {
this.addActivity()
}
})
},
async addActivity() {
if (this.formType === 'edit') {
let url = '/actual/base/videoMonitoring/update'
console.log(this.formData,"formData");
const { data, code, msg } = await requestPost(url, this.formData)
if (code === 0) {
this.$message({
type: 'success',
message: '操作成功'
})
this.resetData()
this.$emit('dialogOk')
this.btnDisable = false
} else {
this.btnDisable = false
this.$message.error(msg)
}
}else{
console.log("this.formData",this.formData)
let url = '/actual/base/videoMonitoring/save'
console.log(this.formData,"formData");
const { data, code, msg } = await requestPost(url, this.formData)
if (code === 0) {
this.$message({
type: 'success',
message: '操作成功'
})
this.resetData()
this.$emit('dialogOk')
this.btnDisable = false
} else {
this.btnDisable = false
this.$message.error(msg)
}
}
},
handleCancle() {
this.resetData()
this.$emit('dialogCancle')
},
resetData() {
this.fileList = []
this.top = 0
this.formType = ''
this.formData = {
}
},
//
startLoading() {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close()
}
},
setDefaultReleaseTime() {
const currentDate = new Date();
const formattedDate = this.formatDate(currentDate, 'yyyy-MM-dd HH:mm:ss');
this.formData.releaseTime = formattedDate;
},
// init
initMap(latitude, longitude) {
this.$nextTick(() => {
map = new daiMap(
document.getElementById("app_event"),
{ latitude, longitude },
{
zoom: 17.2, //
pitch: 43.5, //
rotation: 45, //
}
);
//
/*map.on("dragend", (e) => {
this.handleMoveCenter(e);
});*/
map.on("click", (e) => {
this.handleMoveCenter(e);
});
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
})
},
async handleMoveCenter(e) {
//
// const { lat, lng } = map.getCenter();
const { lat, lng } = e.latLng;
this.formData.latitude = lat;
this.formData.longitude = lng;
map.setMarker(lat, lng);
this.$EventBus.$emit('map', { lat, lng })
let { msg, data } = await map.getAddress(lat, lng);
if (msg == "success") {
this.formData.monitorAddress = data.address
this.searchValue = data.address
this.searchOptions = []
}
},
async remoteMethod(query) {
if (query !== '') {
this.loading = true;
const { msg, data } = await map.searchNearby(query);
this.loading = false;
this.resultList = [];
if (msg == 'success' && data.resultList && data.resultList.length > 0) {
if (data.resultList && data.resultList.length > 0) {
this.resultList = data.resultList;
this.searchOptions = this.resultList.map(item => {
return { value: `${item.id}`, label: `${item.address + item.title}` };
});
}
} else {
this.searchOptions = [
{
value: '0',
label: '未检索到结果'
}
];
}
} else {
this.searchOptions = [];
}
},
handleClickKey(index) {
let selPosition = this.resultList[index]
let lonlat = selPosition.lonlat.split(" ")
map.setCenter(lonlat[1], lonlat[0]);
map.setMarker(lonlat[1], lonlat[0]);
this.formData.latitude = lonlat[1];
this.formData.longitude = lonlat[0];
this.formData.monitorAddress = selPosition.address + selPosition.name
},
formatDate(date, format) {
const pad = (n) => (n < 10 ? '0' + n : n);
const year = date.getFullYear();
const month = pad(date.getMonth() + 1);
const day = pad(date.getDate());
const hours = pad(date.getHours());
const minutes = pad(date.getMinutes());
const seconds = pad(date.getSeconds());
return format
.replace('yyyy', year)
.replace('MM', month)
.replace('dd', day)
.replace('HH', hours)
.replace('mm', minutes)
.replace('ss', seconds);
}
},
computed: {
dataRule() {
return {
monitorName: [
{ required: true, message: '设备名称不能为空', trigger: 'blur' }
]
}
},
},
props: {
// unitList: {
// type: Array,
// default: []
// },
// gridList: {
// type: Array,
// default: []
// },
}
}
</script>
<style lang="scss" scoped>
@import "@/assets/scss/modules/visual/communityManageForm.scss";
</style>
<style lang="scss" scoped>
.item_width_1 {
width: 560px;
/deep/.tox .tox-dialog {
z-index: 20000;
}
}
.tinymce_view {
::v-deep .tox .tox-dialog {
z-index: 2000000000;
}
}
.div_map {
position: relative;
}
.div_searchmap {
z-index: 5000;
position: absolute;
top: 5px;
left: 5px;
}
.tinymce_view {
height: 400px;
overflow: auto;
}
.text_p {
margin: 0;
padding: 0 10px;
border: 1px solid #d9d9d9;
border-radius: 5px;
>p {
margin: 0;
}
}
</style>

211
src/views/modules/shequzhili/videomonitoring/event.vue

@ -0,0 +1,211 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<div v-if="initLoading" class="m-detail-main">
<div class="m-info">
<div style="display: flex;">
<div class="m-info-prop" style="flex: 0 0 50%;">
<span class="u-info-title-2">组织名称: </span>
<span style="margin-right: 10px;">&nbsp;</span>
<span>{{ formData.agencyName || "--" }}</span>
</div>
</div>
<div style="display: flex;">
<div class="m-info-prop" style="flex: 0 0 50%;">
<span class="u-info-title-2">设备名称: </span>
<span style="margin-right: 10px;">&nbsp;</span>
<span>{{ formData.monitorName || "--" }}</span>
</div>
</div>
<div style="display: flex;">
<div class="m-info-prop" style="flex: 0 0 50%;">
<span class="u-info-title-2">设备类型: </span>
<span style="margin-right: 10px;">&nbsp;</span>
<span>{{ formData.monitorType || "--" }}</span>
</div>
</div>
<div style="display: flex;">
<div class="m-info-prop" style="flex: 0 0 50%;">
<span class="u-info-title-2">播放视频链接: </span>
<span style="margin-right: 10px;">&nbsp;</span>
<span>{{ formData.monitorUrl || "--" }}</span>
</div>
</div>
<div style="display: flex;">
<div class="m-info-prop" style="flex: 0 0 50%;">
<span class="u-info-title-2">图片: </span>
<span style="margin-right: 10px;">&nbsp;</span>
<!-- <span>{{ formData.imgUrl || "&#45;&#45;" }}</span>-->
<img :src="formData.imgUrl" height="50"/>
<!-- <template slot-scope="scope">
<img :src="formData.imgUrl" height="50"/>
</template>-->
</div>
</div>
<div style="display: flex;">
<div class="m-info-prop" style="flex: 0 0 50%;">
<span class="u-info-title-2">所属公司: </span>
<span style="margin-right: 10px;">&nbsp;</span>
<span>{{ formData.monitorCompany || "--" }}</span>
</div>
</div>
<div style="display: flex;">
<div class="m-info-prop" style="flex: 0 0 50%;">
<span class="u-info-title-2">负责人: </span>
<span style="margin-right: 10px;">&nbsp;</span>
<span>{{ formData.monitorOwnerName || "--" }}</span>
</div>
</div>
<div style="display: flex;">
<div class="m-info-prop" style="flex: 0 0 50%;">
<span class="u-info-title-2">联系电话: </span>
<span style="margin-right: 10px;">&nbsp;</span>
<span>{{ formData.monitorOwnerMobile || "--" }}</span>
</div>
</div>
<div style="display: flex;">
<div class="m-info-prop" style="flex: 0 0 50%;">
<span class="u-info-title-2">安装位置: </span>
<span style="margin-right: 10px;">&nbsp;</span>
<span>{{ formData.monitorAddress || "--" }}</span>
</div>
</div>
<div style="display: flex;">
<div class="m-info-prop" style="flex: 0 0 50%;">
<span class="u-info-title-2">备注: </span>
<span style="margin-right: 10px;">&nbsp;</span>
<span>{{ formData.reamrk || "--" }}</span>
</div>
</div>
</div>
</div>
</div>
<div class="m-detail-btn">
<el-button size="small" @click="handleCancle"> </el-button>
</div>
</div>
</template>
<script>
import { Loading } from "element-ui"; // Loading
import nextTick from "dai-js/tools/nextTick";
import daiMap from "@/utils/dai-map";
var map;
var search;
var markers;
var infoWindowList;
var geocoder; //
let loading; //
export default {
data() {
return {
formData: {
coordinatePosition: ''
},
initLoading: false,
};
},
components: {},
created() { },
mounted () {
},
methods: {
async activityType () {
const url = "/actual/base/videoMonitoring/page"
let params = {
// agencyId: this.agencyId
pageSize: 20,
pageNo: 1,
typeName: "",
enabled: 0
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.typeList = data.list
} else {
this.$message.error(msg)
}
},
handleCancle() {
// this.diaDestroy();
this.$emit("dialogCancle");
},
diaDestroy() {
if (map) {
// map.destroy()
}
},
async initForm(row) {
this.startLoading();
this.formData = JSON.parse(JSON.stringify(row));
this.initLoading = true;
console.log(this.formData,"sdf ");
this.endLoading();
let { latitude, longitude } = this.$store.state.user;
if (this.formData.latitude && this.formData.longitude) {
latitude = this.formData.latitude
longitude = this.formData.longitude
}
if (!latitude || latitude == "" || latitude == "0") {
latitude = 39.9088810666821;
longitude = 116.39743841556731;
}
if (this.formData.coordinatePosition) {
this.$nextTick(() => {
if (!map) {
this.initMap(latitude, longitude)
} else {
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
}
})
}
},
initMap (latitude, longitude) {
map = new daiMap(
document.getElementById("app_detail_build"),
{ latitude, longitude },
{
zoom: 16.2, //
pitch: 43.5, //
rotation: 45, //
}
);
// //
// map.on("dragend", (e) => {
// this.handleMoveCenter(e);
// });
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
},
//
startLoading() {
loading = Loading.service({
lock: true, //
text: "正在加载……", //
background: "rgba(0,0,0,.7)", //
});
},
//
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close();
}
},
},
computed: {},
props: {},
};
</script>
<style lang="scss" scoped>
@import "@/assets/scss/modules/management/detail-main.scss";
// span {
// white-space: nowrap; /* */
// }
</style>
<style scoped></style>

479
src/views/modules/shequzhili/videomonitoring/index.vue

@ -0,0 +1,479 @@
<template>
<div class="g-main">
<div class="m-search">
<el-form :inline="true" ref="ref_searchform" :label-width="'100px'">
<div>
<el-form-item label="设备名称">
<el-input v-model.trim="formData.monitorName" size="small" class="item_width_1" clearable placeholder="请输入">
</el-input>
</el-form-item>
</div>
<div class="block">
<div style="display: flex; justify-content: flex-end;">
<el-button style="margin-left:10px" class="diy-button--blue" size="small"
@click="handleSearch">查询</el-button>
<el-button style="margin-left:10px" class="diy-button--white" size="small"
@click="resetSearch">重置</el-button>
</div>
</div>
</el-form>
</div>
<div class="m-table">
<div class="resi-row-btn">
<el-button style="" class="diy-button--add" size="small" @click="handleAdd">新增</el-button>
<!-- <el-button style="" class="diy-button&#45;&#45;add" size="small" @click="downloadTem">下载模板</el-button>
&lt;!&ndash; <el-button style="" class="diy-button&#45;&#45;add" size="small" @click="exportData">导入</el-button>&ndash;&gt;
<el-button class="diy-button&#45;&#45;white" size="small">
<el-upload :headers="$getElUploadHeaders()" ref="upload" class="upload-btn" action="uploadUlr" :limit="1"
:accept="'.xls,.xlsx'" :with-credentials="true" :show-file-list="false" :auto-upload="true"
:on-progress="handleProgress" :on-success="handleExcelSuccess" :before-upload="beforeExcelUpload"
:http-request="uploadHttpRequest">
导入
</el-upload>
</el-button>-->
</div>
<el-table class="table" :data="tableData" border v-loading="tableLoading" style="width: 100%">
<el-table-column prop="agencyName" label="组织名称" header-align="center" align="center"></el-table-column>
<el-table-column prop="monitorName" label="设备名称" header-align="center" align="center"></el-table-column>
<el-table-column prop="monitorType" label="设备类型" header-align="center" align="center"></el-table-column>
<el-table-column prop="monitorUrl" label="播放视频链接" header-align="center" align="center"></el-table-column>
<el-table-column prop="imgUrl" label="图片" header-align="center" align="center" >
<template slot-scope="scope">
<img :src="scope.row.imgUrl" height="50"/>
</template>
</el-table-column>
<el-table-column prop="monitorCompany" label="所属公司" header-align="center" align="center"></el-table-column>
<el-table-column prop="monitorOwnerName" label="负责人" header-align="center" align="center"></el-table-column>
<el-table-column prop="monitorOwnerMobile" label="联系电话" header-align="center" align="center"></el-table-column>
<el-table-column prop="monitorAddress" label="安装位置" header-align="center" align="center"></el-table-column>
<!-- <el-table-column prop="latitude" label="位置纬度" header-align="center" align="center"></el-table-column>
<el-table-column prop="longitude" label="位置经度" header-align="center" align="center"></el-table-column>-->
<el-table-column prop="reamrk" label="备注" header-align="center" align="center"></el-table-column>
<el-table-column :show-overflow-tooltip="true" label="操作" fixed="right" width="250" header-align="center"
align="center" class="operate">
<template slot-scope="scope">
<el-button type="text" style="color:#1C6AFD;" size="small" @click="handleDetail(scope.row)">查看</el-button>
<el-button type="text" style="color:#1C6AFD;" size="small"
@click="handleEdit(scope.row)">编辑</el-button>
<el-button type="text" style="color:#1C6AFD;" size="small"
@click="handleDelete(scope.row)">删除</el-button>
<!-- <el-button type="text" style="color:#1C6AFD;" size="small"
@click="download(scope.row)">下载</el-button>-->
</template>
</el-table-column>
</el-table>
<div>
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="pageNo"
:page-sizes="[10, 20, 50]" :page-size="pageSize" layout="sizes, prev, pager, next, total" :total="total">
</el-pagination>
</div>
</div>
<!-- 修改弹出框 -->
<el-dialog :visible.sync="formShow" :close-on-click-modal="false" :close-on-press-escape="false" :title="formTitle"
width="950px" top="5vh" class="dialog-h" @closed="diaClose">
<add ref="ref_form" v-if="formShow" @dialogCancle="addFormCancle" @dialogOk="addFormOk"></add>
</el-dialog>
<el-dialog :visible.sync="detailShow" :close-on-click-modal="false" :close-on-press-escape="false" :title="'活动详情'"
width="950px" top="5vh" class="dialog-h" @closed="eventForm">
<event ref="ref_detail" @dialogCancle="eventForm"></event>
</el-dialog>
</div>
</template>
<script>
import { Loading } from 'element-ui' // Loading
import { requestPost, requestGet } from '@/js/dai/request';
import add from "./add.vue";
import event from "./event.vue";
export default {
data () {
return {
orgOptions: [],//
tableData:[],
unitList:[],
loading: false,
total: 0,
tableLoading: false,
typeName:'',
enabled:'',
//form
formShow: false,
formTitle: '新增活动',
detailShow: false,
formData: {
// agencyId: '',
monitorName: null
},
pageSize: 20,
pageNo: 1
}
},
components: {
add,event
},
// components: {
// typeActivityadd, typeDetails
// },
async created () {
this.loadTable()
},
async mounted () {
this.loadTable()
},
methods: {
async exportData(){
},
async downloadTem(){
let url =
"/actual/base/videoMonitoring/downloadImportTemplate";
let params = {};
await this.$http({
method: "get",
url,
responseType: "blob",
data: params,
})
.then((res) => {
// this.download(res.data, title + '.xls')
if (res.headers["content-disposition"]) {
let fileName = window.decodeURI(
res.headers["content-disposition"].split(";")[1].split("=")[1]
);
console.log("filename", fileName);
let blob = new Blob([res.data], {
type: "application/vnd.ms-excel",
});
var url = window.URL.createObjectURL(blob);
var aLink = document.createElement("a");
aLink.style.display = "none";
aLink.href = url;
aLink.setAttribute("download", fileName);
document.body.appendChild(aLink);
aLink.click();
document.body.removeChild(aLink); //
window.URL.revokeObjectURL(url); //blob
} else this.$message.error("下载失败");
})
.catch((err) => {
console.log("err", err);
return this.$message.error("网络错误");
});
},
handleProgress(event, file, fileList) {
console.log("percentage", file.percentage);
},
handleExcelSuccess(res, file) {
if (!res.code === 0 && !res.msg === 'success') {
this.$message.error(res.msg);
}
},
beforeExcelUpload(file) {
console.log(file,"file1");
debugger
const isType = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
debugger
const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
const fileType = isType || isTypeComputer;
debugger
const isLt1M = file.size / 1024 / 1024 < 10;
debugger
if (!fileType) {
this.$message.error('上传文件只能是xls/xlsx格式!');
}
debugger
if (!isLt1M) {
this.$message.error('上传文件大小不能超过 10MB!');
}
console.log(isLt1M,"isLt1M");
debugger
return fileType && isLt1M;
},
//
async uploadHttpRequest(file) {
debugger
// this.importLoading = true;
console.log(this.importLoading,"this.importLoading");
debugger
// this.importBtnTitle = '...';
this.$message({
showClose: true,
dangerouslyUseHTMLString: true,
message: "导入中,请到系统管理-<a id='clickA' style='cursor: pointer;'>导入记录</a>中查看进度",
duration: 3000
});debugger
let than = this;
console.log(than,"than");
debugger
// document.getElementById('clickA').addEventListener('click', function () {
// than.$router.replace('/main/importRecord-index');
// });
const formData = new FormData(); //FormDataappend('key', value)
formData.append('file', file.file); //
formData.append('code', ''); //
debugger
console.log(formData,"formData");
let url = '/actual/base/videoMonitoring/import'
// if (this.importType == 2) {
// url = '/governance/icEvent/importAwo'
// }
console.log(url)
await this.$http
.post(url, formData)
.then(res => {
log("res", res);
if (res.data.code == 0 && res.data.msg == 'success') {
const data = res.data.data;
this.dataList = [
...Object.keys(data.option.exist).map(k => {
return {
index: k,
srcField: data.option.exist[k],
exist: true,
field: data.option.exist[k]
};
}),
...Object.keys(data.option.notExist).map(k => {
return {
index: k,
srcField: data.option.notExist[k],
exist: false,
field: ''
};
})
];
this.importOption = data.option;
this.importCode = data.code;
this.fileData = file;
} else this.$message.error(res.data.msg);
})
.catch(err => {
console.log('失败', err);
file.onError(); //
});
this.importLoading = false;
this.importBtnTitle = '导入';
this.$refs.upload.clearFiles();
this.getTableData();
},
handleSearch () {
this.loadTable()
},
async loadTable () {
this.tableLoading = false
const url = "/actual/base/videoMonitoring/page"
let params = {
limit: this.pageSize,
page: this.pageNo,
// agencyId: this.agencyId,
...this.formData,
}
const { data, code, msg } = await requestGet(url, params)
if (code === 0) {
this.total = data.total
this.tableData = data.list
this.tableData.forEach((item=>{
this.adverTagList.forEach((item1)=>{
if(item.tagId==item1.id){
item.tagName=item1.tagName
}
})
}))
} else {
this.$message.error(msg)
}
this.tableLoading = false
},
diaClose () {
// this.$refs.ref_form.resetData()
this.formShow = false
},
detailClosed () {
//
// this.$refs.ref_detail.diaDestroy()
this.detailShow = false
},
handleDetail (row) {
this.detailShow = true
this.formTitle = '详情'
this.$nextTick(() => {
this.$refs.ref_detail.initForm(row)
// this.$refs.ref_form.initForm('detail', row.id)
})
},
handleAdd () {
this.formTitle = '新增'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('add',null)
})
},
handleEdit (row) {
this.formTitle = '修改'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm("edit",row)
})
},
addFormCancle () {
this.formShow = false
},
eventForm(){
this.detailShow = false
},
addFormOk () {
this.formShow = false
this.loadTable()
},
async download(row){
if (row.code!=null){
window.open(row.code)
}else{
this.$message({
type: "error",
message: "无二维码"
});
}
},
async handleDelete (row) {
this.$confirm("确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.deleteActivity(row)
})
.catch(err => {
if (err == "cancel") {
}
});
},
async deleteActivity (row) {
const url = "/actual/base/videoMonitoring/delete"
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyactivity/delete"
let idArr=[row.id]
const { data, code, msg } = await requestPost(url, idArr)
if (code === 0) {
this.$message({
type: "success",
message: "删除成功"
});
this.loadTable()
} else {
this.$message.error(msg)
}
},
//
resetSearch () {
this.formData = {
title: ""
},
this.loadTable()
},
handleSizeChange (val) {
this.pageSize = val
this.pageNo = 1
this.loadTable()
},
handleCurrentChange (val) {
this.pageNo = val
this.loadTable()
},
},
/* //获取当前组织
getOrgTrreeList() {
this.$http
.post("/gov/org/customeragency/agencygridtree", { orgTypeFilter: this.orgTypeFilter })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
this.orgOptions = [];
this.orgOptions.forEach(item => {
item.subAgencyList.forEach(item2 => {
})
})
this.orgOptions.push(res.data);
console.log(this.orgOptions, "this.orgOptions");
}
})
.catch(() => {
return this.$message.error("网络错误");
});
},*/
/*async advertisingTag () {
const url = "/actual/base/advertisingTag/page"
let params = {
pageSize: this.pageSize,
pageNo: this.pageNo,
tagName: "",
status: ""
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.adverTagList = data.list
} else {
this.$message.error(msg)
}
},*/
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/management/list-main.scss";
.g-main {
width: 100%;
}
.m-search {
background: #ffffff;
border-radius: 4px;
padding: 30px 20px 5px;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
}
.item_width_1 {
width: 260px;
}
.item_width_2 {
width: 495px;
}
.m-table {
background: #ffffff;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
border-radius: 4px;
margin-top: 15px;
padding: 23px 30px 10px;
.table {
margin-top: 20px;
}
}
.div_btn {
display: flex;
justify-content: space-between;
}
.el-row {
/* margin-bottom: 20px; */
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-right: 50px;
}
</style>
Loading…
Cancel
Save