You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
479 lines
17 KiB
479 lines
17 KiB
<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--add" size="small" @click="downloadTem">下载模板</el-button>-->
|
|
<!-- <el-button style="" class="diy-button--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%">
|
|
|
|
<el-table-column prop="orgNamePath" 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(); //FormData对象,添加参数只能通过append('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>
|
|
|