parent
477f14ac57
commit
326f2538ad
8 changed files with 913 additions and 800 deletions
@ -0,0 +1,42 @@ |
|||||||
|
import request from '@/router/axios'; |
||||||
|
|
||||||
|
export const getList = (current, size, params) => { |
||||||
|
return request({ |
||||||
|
url: '/alarmInformation/list', |
||||||
|
method: 'get', |
||||||
|
params: { |
||||||
|
...params, |
||||||
|
current, |
||||||
|
size, |
||||||
|
} |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
export const getDetail = (code) => { |
||||||
|
return request({ |
||||||
|
url: '/api/blade-system/region/detail', |
||||||
|
method: 'get', |
||||||
|
params: { |
||||||
|
code |
||||||
|
} |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
export const remove = (id) => { |
||||||
|
return request({ |
||||||
|
url: '/api/blade-system/region/remove', |
||||||
|
method: 'post', |
||||||
|
params: { |
||||||
|
id, |
||||||
|
} |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
export const submit = (row) => { |
||||||
|
return request({ |
||||||
|
url: '/api/blade-system/region/submit', |
||||||
|
method: 'post', |
||||||
|
data: row |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
After Width: | Height: | Size: 26 KiB |
@ -1,33 +1,70 @@ |
|||||||
<template> |
<template> |
||||||
<div> |
<div> |
||||||
<div id='mapContainer' style="widht:1000px;height:1000px;background:red;"></div> |
<div id='mapContainer' style="widht:1000px;height:1000px;"></div> |
||||||
</div> |
</div> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
|
import Img from "@/assets/image/position_icon.png"; |
||||||
|
export default { |
||||||
|
name: "map", |
||||||
|
data() { |
||||||
|
return { |
||||||
|
}; |
||||||
|
}, |
||||||
|
destroyed() { |
||||||
|
window.map.destroy(); |
||||||
|
window.map = null; |
||||||
|
}, |
||||||
|
mounted() { |
||||||
|
window.map = new jsmapbase.JSMap({ |
||||||
|
container: 'mapContainer', |
||||||
|
mapServerURL: 'data/map' |
||||||
|
}); |
||||||
|
window.map.openMapById('0001'); |
||||||
|
window.map.on("loadComplete", e => { |
||||||
|
var floorControl = new jsmapbase.JSFloorControl({ |
||||||
|
position: jsmapbase.JSControlPosition.LEFT_TOP,//控件在容器中的位置 |
||||||
|
showBtnCount: 3,//默认显示楼层的个数 TODO |
||||||
|
allLayers: false, //初始是否是多层显示,默认单层显示 |
||||||
|
needAllLayerBtn: true, // 是否显示多层/单层切换按钮 |
||||||
|
offset: { |
||||||
|
x: 20, |
||||||
|
y: 10 |
||||||
|
}//位置x,y的偏移量 |
||||||
|
}); |
||||||
|
window.map.addControl(floorControl); |
||||||
|
console.log('点位标注') |
||||||
|
//点位标注 |
||||||
|
var imagerMarker = new jsmapbase.JSImageMarker({ |
||||||
|
id: 'iamgeMareker1',//id |
||||||
|
image: Img,//图片路径 |
||||||
|
position: new jsmapbase.JSPoint(120.61988850529002, 31.37531834395683, 0),//坐标位置 |
||||||
|
width: 55,//尺寸-宽 |
||||||
|
height: 55,//尺寸-高 |
||||||
|
floorId: 1,//楼层id |
||||||
|
offset: jsmapbase.JSControlPosition.RIGHT_BOTTOM,//偏移位置 |
||||||
|
depthTest: false,//是否开启深度检测 |
||||||
|
show: true, //是否显示 |
||||||
|
properties: { |
||||||
|
name: 'test' |
||||||
|
},//属性设置 |
||||||
|
callback: (node) => { |
||||||
|
console.log(node); |
||||||
|
}//回调 |
||||||
|
}); |
||||||
|
window.map.addMarker(imagerMarker); |
||||||
|
}); |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
|
||||||
export default { |
}, |
||||||
name: "map", |
}; |
||||||
data() { |
|
||||||
return { |
|
||||||
}; |
|
||||||
}, |
|
||||||
mounted() { |
|
||||||
window.map = new jsmapbase.JSMap({ |
|
||||||
container:'mapContainer', |
|
||||||
mapServerURL:'data/map' |
|
||||||
}); |
|
||||||
window.map.openMapById('0001'); |
|
||||||
}, |
|
||||||
methods: { |
|
||||||
|
|
||||||
}, |
|
||||||
}; |
|
||||||
</script> |
</script> |
||||||
|
|
||||||
<style> |
<style> |
||||||
.el-font-size { |
.el-font-size { |
||||||
font-size: 14px; |
font-size: 14px; |
||||||
} |
} |
||||||
</style> |
</style> |
||||||
|
|
||||||
|
|||||||
@ -1,470 +1,555 @@ |
|||||||
<template> |
<template> |
||||||
<basic-container> |
<basic-container> |
||||||
<avue-crud :option="option" |
<avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" v-model="form" |
||||||
:table-loading="loading" |
:permission="permissionList" :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset" |
||||||
:data="data" |
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
||||||
:page.sync="page" |
@refresh-change="refreshChange" @on-load="onLoad" :selecttable="selectable1"> |
||||||
ref="crud" |
|
||||||
v-model="form" |
|
||||||
:permission="permissionList" |
|
||||||
:before-open="beforeOpen" |
|
||||||
@search-change="searchChange" |
|
||||||
@search-reset="searchReset" |
|
||||||
@selection-change="selectionChange" |
|
||||||
@current-change="currentChange" |
|
||||||
@size-change="sizeChange" |
|
||||||
@refresh-change="refreshChange" |
|
||||||
@on-load="onLoad"> |
|
||||||
<template slot="menuLeft"> |
<template slot="menuLeft"> |
||||||
<el-button |
<el-button type="primary" icon="el-icon-plus" size="small" @click="handleAdd"> |
||||||
size="small" |
新 增 |
||||||
@click="handleAddPre"> |
|
||||||
<i class="add_item"></i> |
|
||||||
一键布防 |
|
||||||
</el-button> |
</el-button> |
||||||
<el-button |
<el-button type="danger" icon="el-icon-delete" size="small" plain @click="handleDelete"> |
||||||
type="primary" |
删 除 |
||||||
size="small" |
|
||||||
@click="handleCancel"> |
|
||||||
<i class="cancel_item"></i> |
|
||||||
一键撤防 |
|
||||||
</el-button> |
|
||||||
<el-button |
|
||||||
type="primary" |
|
||||||
size="small" |
|
||||||
@click="handleAdd"> |
|
||||||
新增 |
|
||||||
</el-button> |
</el-button> |
||||||
</template> |
</template> |
||||||
<template slot-scope="{row}" |
<template slot-scope="{row}" slot="status"> |
||||||
slot="status"> |
|
||||||
<el-tag type="danger" v-show="row.status == 0">关闭</el-tag> |
<el-tag type="danger" v-show="row.status == 0">关闭</el-tag> |
||||||
<el-tag type="success" v-show="row.status == 1">开启</el-tag> |
<el-tag type="success" v-show="row.status == 1">开启</el-tag> |
||||||
</template> |
</template> |
||||||
<template #menu="{size:row,index}"> |
<template #menu="{ size, row, index }"> |
||||||
<el-button size="small" @click="handleDetail(row,index)">详情</el-button> |
<el-button type="text" icon="el-icon-view" size="small" @click="handleDetail(row, index)">详情</el-button> |
||||||
<el-button size="small" @click="handleEdit(row,index)">编辑</el-button> |
<el-button type="text" icon="el-icon-edit" size="small" @click="handleEdit(row, index)">编辑</el-button> |
||||||
<el-button size="small" @click="handleDelete(row,index)">删除</el-button> |
<el-button type="text" icon="el-icon-delete" size="small" @click="handleDeleteRow(row, index)">删除</el-button> |
||||||
</template> |
</template> |
||||||
</avue-crud> |
</avue-crud> |
||||||
<el-dialog |
<el-dialog title="布/撤防设置" :visible.sync="dialogVisible" v-if="dialogVisible" :append-to-body="true" :close-on-click-modal="false" |
||||||
title="布防设置" |
:close-on-press-escape="false" custom-class="dia_box" width="950px"> |
||||||
:visible.sync="dialogVisible" |
<el-form :model="addForm" ref="addform" :rules="addRules" label-width="100px"> |
||||||
:append-to-body="true" |
<el-row :gutter="20"> |
||||||
:close-on-click-modal="false" |
<el-col :span="12"> |
||||||
:close-on-press-escape="false" |
<el-form-item label="任务标题:" prop="taskTitle"> |
||||||
custom-class="dia_box" |
<el-input v-model="addForm.taskTitle" placeholder="请输入任务标题" :disabled="isDetail ? true : false" |
||||||
> |
maxlength="30" clearable> |
||||||
<el-form v-model="addForm"> |
</el-input> |
||||||
<el-form-item label="布防时间:" prop="preTime"> |
</el-form-item> |
||||||
<el-time-picker |
<el-form-item label="任务时间:" prop="executeTime"> |
||||||
v-model="addForm.preTime" |
<el-time-picker v-model="addForm.executeTime" placeholder="请选择任务时间" :disabled="isDetail ? true : false" |
||||||
placeholder="请选择布防时间" |
value-format="HH:mm:ss" style="width:100%;"> |
||||||
:readonly="isDetail ? true : false" |
</el-time-picker> |
||||||
value-format="HH:mm:ss"> |
</el-form-item> |
||||||
</el-time-picker> |
</el-col> |
||||||
</el-form-item> |
<el-col :span="12"> |
||||||
|
<el-form-item label="任务类型:" prop="type"> |
||||||
|
<el-radio-group v-model="addForm.type" :disabled="isDetail ? true : false"> |
||||||
|
<el-radio :label="1">布防</el-radio> |
||||||
|
<el-radio :label="2">撤防</el-radio> |
||||||
|
</el-radio-group> |
||||||
|
</el-form-item> |
||||||
|
<el-form-item label="是否启用:" prop="status"> |
||||||
|
<el-switch v-model="addForm.status" active-value="1" inactive-value="0" :disabled="isDetail ? true : false"> |
||||||
|
</el-switch> |
||||||
|
</el-form-item> |
||||||
|
</el-col> |
||||||
|
</el-row> |
||||||
<el-form-item label="选择设备:"> |
<el-form-item label="选择设备:"> |
||||||
<el-table |
<el-table class="table_box" ref="multipleTable" row-key="id" :data="tableData" tooltip-effect="dark" |
||||||
class="table_box" |
style="width: 100%" @selection-change="handleSelectionChange" size="small"> |
||||||
ref="multipleTable" |
<el-table-column type="selection" width="55" align="center" reserve-selection :selectable="selectable"> |
||||||
:data="tableData" |
</el-table-column> |
||||||
tooltip-effect="dark" |
<el-table-column prop="name" label="设备名称"> |
||||||
style="width: 100%" |
<template slot-scope="scope"> |
||||||
@selection-change="handleSelectionChange"> |
{{ scope.row.name }}/{{ scope.row.remark }} |
||||||
<el-table-column |
</template> |
||||||
type="selection" |
|
||||||
width="55" |
|
||||||
align="center" |
|
||||||
:reserve-selection="true" |
|
||||||
:selectable="selectable" |
|
||||||
> |
|
||||||
</el-table-column> |
</el-table-column> |
||||||
<el-table-column |
<el-table-column prop="productName" label="设备所属产品"> |
||||||
prop="deviceName" |
|
||||||
label="设备名称"> |
|
||||||
</el-table-column> |
</el-table-column> |
||||||
<el-table-column |
<el-table-column prop="nodeLabel" label="节点类型"> |
||||||
prop="deviceNo" |
|
||||||
label="设备编号"> |
|
||||||
</el-table-column> |
</el-table-column> |
||||||
<el-table-column |
<el-table-column prop="gateway" label="网关信息"> |
||||||
prop="deviceType" |
|
||||||
label="设备大类"> |
|
||||||
</el-table-column> |
</el-table-column> |
||||||
<el-table-column |
<el-table-column prop="statusLabel" label="设备状态"> |
||||||
prop="deviceArea" |
|
||||||
label="所在区域"> |
|
||||||
</el-table-column> |
</el-table-column> |
||||||
<el-table-column |
<el-table-column prop="createTime" label="创建时间" width="160px"> |
||||||
prop="position" |
|
||||||
label="安装位置"> |
|
||||||
</el-table-column> |
</el-table-column> |
||||||
</el-table> |
</el-table> |
||||||
<div class="page_box"> |
<div class="page_box"> |
||||||
<el-pagination |
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" |
||||||
@size-change="handleSizeChange" |
:current-page="diaPage.currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="diaPage.pageSize" background |
||||||
@current-change="handleCurrentChange" |
layout="total, sizes, prev, pager, next, jumper" :total="diaPage.total"> |
||||||
:current-page="diaPage.currentPage" |
|
||||||
:page-sizes="[10, 20, 30, 40]" |
|
||||||
:page-size="diaPage.pageSize" |
|
||||||
background |
|
||||||
layout="total, sizes, prev, pager, next, jumper" |
|
||||||
:total="diaPage.total"> |
|
||||||
</el-pagination> |
</el-pagination> |
||||||
</div> |
</div> |
||||||
</el-form-item> |
</el-form-item> |
||||||
<el-form-item label="是否启用:" prop="isOpen"> |
<el-form-item label="任务描述:" prop="taskDescribe"> |
||||||
<el-switch |
<el-input type="textarea" v-model="addForm.taskDescribe" placeholder="请输入任务描述" |
||||||
v-model="addForm.isOpen" |
:disabled="isDetail ? true : false" maxlength="200" show-word-limit> |
||||||
active-text="禁用" |
</el-input> |
||||||
inactive-text="启用" |
|
||||||
:readonly="isDetail ? true : false"> |
|
||||||
</el-switch> |
|
||||||
</el-form-item> |
</el-form-item> |
||||||
</el-form> |
</el-form> |
||||||
<div slot="footer" class="dialog-footer"> |
<div slot="footer" class="dialog-footer"> |
||||||
<el-button @click="dialogVisible = false">取 消</el-button> |
<el-button @click="dialogVisible = false">取 消</el-button> |
||||||
<el-button type="primary" @click="submitForm">确认布防</el-button> |
<el-button type="primary" @click="submitForm" v-if="!isDetail">确 认</el-button> |
||||||
</div> |
</div> |
||||||
</el-dialog> |
</el-dialog> |
||||||
</basic-container> |
</basic-container> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
import {mapGetters} from "vuex"; |
import { mapGetters } from "vuex"; |
||||||
|
import { bizLogin, bizDeviceList, bizDeviceStatus, bizNodeType, cornJobList, cornJobSave, cornJobUpdate, cornJobRemove } from "@/api/wirelessintrusion/wirelessintrusion"; |
||||||
|
|
||||||
export default { |
export default { |
||||||
data() { |
data() { |
||||||
return { |
return { |
||||||
form: {}, |
form: {}, |
||||||
query: {}, |
query: {}, |
||||||
dialogVisible:false, |
dialogVisible: false, |
||||||
loading: true, |
loading: true, |
||||||
page: { |
page: { |
||||||
pageSize: 10, |
pageSize: 10, |
||||||
currentPage: 1, |
currentPage: 1, |
||||||
total: 0 |
total: 0 |
||||||
}, |
}, |
||||||
diaPage:{ |
diaPage: { |
||||||
pageSize:10, |
pageSize: 10, |
||||||
currentPage:1, |
currentPage: 1, |
||||||
total:10, |
total: 10, |
||||||
}, |
}, |
||||||
addForm:{}, |
addForm: {}, |
||||||
selectionList: [], |
addRules: { |
||||||
option: { |
taskTitle: [ |
||||||
height: 'auto', |
{ required: true, message: "请输入任务标题", trigger: "blur,change" }, |
||||||
menuWidth:300, |
|
||||||
calcHeight: 30, |
|
||||||
dialogWidth: 950, |
|
||||||
tip: false, |
|
||||||
searchShow: true, |
|
||||||
searchMenuSpan: 6, |
|
||||||
border: true, |
|
||||||
addBtn:false, |
|
||||||
viewBtn: false, |
|
||||||
editBtn:false, |
|
||||||
delBtn:false, |
|
||||||
selection: true, |
|
||||||
excelBtn: true, |
|
||||||
dialogClickModal: false, |
|
||||||
column: [ |
|
||||||
{ |
|
||||||
label: "布防时间", |
|
||||||
prop: "time", |
|
||||||
span: 12, |
|
||||||
// search: true, |
|
||||||
addDisplay: false, |
|
||||||
editDisplay: false, |
|
||||||
viewDisplay: false, |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: "关联设备", |
|
||||||
prop: "device", |
|
||||||
type: 'textarea', |
|
||||||
span: 12, |
|
||||||
overHidden: true, |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: "布防状态", |
|
||||||
type: "select", |
|
||||||
prop: "brandCode", |
|
||||||
span: 12, |
|
||||||
hide: true, |
|
||||||
search: true, |
|
||||||
addDisplay: false, |
|
||||||
editDisplay: false, |
|
||||||
viewDisplay: false, |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: "是否启用", |
|
||||||
prop: "status", |
|
||||||
span: 24, |
|
||||||
width: 80, |
|
||||||
align: "center", |
|
||||||
slot: true, |
|
||||||
addDisplay: false, |
|
||||||
editDisplay: false, |
|
||||||
viewDisplay: false, |
|
||||||
}, |
|
||||||
] |
|
||||||
}, |
|
||||||
tableData:[], |
|
||||||
data: [ |
|
||||||
{time:'09:00:00',device:'空调1、空调2、消防1、消防2、消防3、消防4、消防5...',status:'0'}, |
|
||||||
{time:'09:00:00',device:'空调1、空调2、消防1、消防2、消防3、消防4、消防5...',status:'1'}, |
|
||||||
], |
], |
||||||
multipleSelection:[], |
executeTime: [ |
||||||
selectedArr:[], |
{ required: true, message: "请选择任务时间", trigger: "change" }, |
||||||
isDetail:false |
], |
||||||
|
}, |
||||||
|
selectionList: [], |
||||||
|
option: { |
||||||
|
height: 'auto', |
||||||
|
menuWidth: 200, |
||||||
|
calcHeight: 30, |
||||||
|
dialogWidth: 950, |
||||||
|
tip: false, |
||||||
|
searchShow: true, |
||||||
|
searchMenuSpan: 6, |
||||||
|
searchLabelWidth: 100, |
||||||
|
border: true, |
||||||
|
addBtn: false, |
||||||
|
viewBtn: false, |
||||||
|
editBtn: false, |
||||||
|
delBtn: false, |
||||||
|
selection: true, |
||||||
|
excelBtn: false, |
||||||
|
dialogClickModal: false, |
||||||
|
column: [ |
||||||
|
{ |
||||||
|
label: "任务标题", |
||||||
|
prop: "taskTitle", |
||||||
|
minWidth: 200, |
||||||
|
overHidden: true, |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: "布/撤防时间", |
||||||
|
prop: "executeTime", |
||||||
|
addDisplay: false, |
||||||
|
editDisplay: false, |
||||||
|
viewDisplay: false, |
||||||
|
}, |
||||||
|
// { |
||||||
|
// label: "关联设备", |
||||||
|
// prop: "deviceId", |
||||||
|
// overHidden: true, |
||||||
|
// }, |
||||||
|
{ |
||||||
|
label: "任务类型", |
||||||
|
type: "select", |
||||||
|
prop: "type", |
||||||
|
dicData: [ |
||||||
|
{ value: 1, label: '布防' }, { value: 2, label: '撤防' } |
||||||
|
], |
||||||
|
search: true, |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: "是否启用", |
||||||
|
prop: "status", |
||||||
|
align: "center", |
||||||
|
slot: true, |
||||||
|
}, |
||||||
|
] |
||||||
|
}, |
||||||
|
tableData: [], |
||||||
|
data: [], |
||||||
|
multipleSelection: [], |
||||||
|
selectedArr: [], |
||||||
|
isDetail: false |
||||||
|
}; |
||||||
|
}, |
||||||
|
computed: { |
||||||
|
...mapGetters(["permission"]), |
||||||
|
permissionList() { |
||||||
|
return { |
||||||
|
addBtn: this.vaildData(this.permission.notice_add, false), |
||||||
|
viewBtn: this.vaildData(this.permission.notice_view, false), |
||||||
|
delBtn: this.vaildData(this.permission.notice_delete, false), |
||||||
|
editBtn: this.vaildData(this.permission.notice_edit, false) |
||||||
}; |
}; |
||||||
}, |
}, |
||||||
computed: { |
|
||||||
...mapGetters(["permission"]), |
ids() { |
||||||
permissionList() { |
let ids = []; |
||||||
return { |
this.selectionList.forEach(ele => { |
||||||
addBtn: this.vaildData(this.permission.notice_add, false), |
ids.push(ele.id); |
||||||
viewBtn: this.vaildData(this.permission.notice_view, false), |
}); |
||||||
delBtn: this.vaildData(this.permission.notice_delete, false), |
return ids.join(","); |
||||||
editBtn: this.vaildData(this.permission.notice_edit, false) |
} |
||||||
}; |
}, |
||||||
}, |
mounted() { |
||||||
|
this.loadDict(); |
||||||
ids() { |
}, |
||||||
let ids = []; |
methods: { |
||||||
this.selectionList.forEach(ele => { |
//字典加载 |
||||||
ids.push(ele.id); |
loadDict() { |
||||||
}); |
let token = window.sessionStorage.getItem('bizToken'); |
||||||
return ids.join(","); |
if (token == 'undefined' || !token) { |
||||||
|
bizLogin({ appKey: 'Arf7bd4f26', appSecret: 'kb207044c8' }).then(res => { |
||||||
|
window.sessionStorage.setItem('bizToken', res.data.data.token); |
||||||
|
bizDeviceStatus(res.data.data.token).then(res => { |
||||||
|
this.bizDeviceStatus = res.data.data; |
||||||
|
}) |
||||||
|
bizNodeType(res.data.data.token).then(res => { |
||||||
|
this.bizNodeType = res.data.data; |
||||||
|
}) |
||||||
|
}) |
||||||
|
} else { |
||||||
|
bizDeviceStatus(token).then(res => { |
||||||
|
if (res.data.code == 401) { |
||||||
|
window.sessionStorage.removeItem('bizToken'); |
||||||
|
this.loadDict(); |
||||||
|
} |
||||||
|
else if (res.data.code == 200) { |
||||||
|
this.bizDeviceStatus = res.data.data; |
||||||
|
} |
||||||
|
}) |
||||||
|
bizNodeType(token).then(res => { |
||||||
|
this.bizNodeType = res.data.data; |
||||||
|
}) |
||||||
} |
} |
||||||
}, |
}, |
||||||
methods: { |
//节点类型转换 |
||||||
//多选框禁选 |
renderLabel(node, col) { |
||||||
selectable(row, index) { |
const dicData = this[col]; |
||||||
//row 就是每行的数据 |
let idx = dicData.findIndex(item => item.dictValue == node); |
||||||
let data = this.selectedArr //这是多选按钮保存的数据 |
return idx > -1 ? dicData[idx].dictLabel : ''; |
||||||
//return : false 就是禁用 |
}, |
||||||
//return : true 不禁用 |
//设备列表多选框禁选 |
||||||
return data.findIndex(item => item == row.id) === -1 |
selectable() { |
||||||
}, |
return this.isDetail ? false : true; |
||||||
//点击新增按钮 |
}, |
||||||
handleAdd(){ |
//任务列表多选框禁选 |
||||||
this.dialogVisible = true; |
selectable1(row, index) { |
||||||
this.isDetail = false; |
return row.status == 1 ? false : true; |
||||||
this.tableData = [ |
}, |
||||||
{id:'001',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
//点击新增按钮 |
||||||
{id:'002',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
handleAdd() { |
||||||
{id:'003',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
this.addForm = { |
||||||
{id:'004',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
taskTitle: '', |
||||||
{id:'005',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
taskDescribe: '', |
||||||
{id:'006',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
type: 1, |
||||||
{id:'007',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
executeTime: null, |
||||||
{id:'008',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
deviceId: '', |
||||||
{id:'009',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
status: '1' |
||||||
{id:'010',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
} |
||||||
] |
this.multipleSelection = []; |
||||||
this.selectedArr = ['001','003','005'] |
this.dialogVisible = true; |
||||||
}, |
this.isDetail = false; |
||||||
// 弹窗表格多选 |
this.diaPage.currentPage = 1; |
||||||
handleSelectionChange(val){ |
this.$nextTick(() => { |
||||||
this.multipleSelection = val |
this.queryDeviceList(this.diaPage); |
||||||
}, |
}) |
||||||
// 弹窗确认按钮 |
}, |
||||||
submitForm(){ |
// 弹窗表格多选 |
||||||
console.log(this.addForm) |
handleSelectionChange(val) { |
||||||
}, |
this.multipleSelection = val.map(item => item.id); |
||||||
// 一键布防 |
console.log(this.multipleSelection) |
||||||
handleAddPre(){ |
}, |
||||||
if (this.selectionList.length === 0) { |
// 弹窗确认按钮 |
||||||
this.$message.warning("请选择至少一条数据"); |
submitForm() { |
||||||
return; |
this.$refs.addform.validate((valid) => { |
||||||
} |
if (valid) { |
||||||
}, |
if (this.multipleSelection.length === 0) { |
||||||
// 一键撤防 |
this.$message({ |
||||||
handleCancel(){ |
type: "warning", |
||||||
if (this.selectionList.length === 0) { |
message: "请选择关联设备" |
||||||
this.$message.warning("请选择至少一条数据"); |
}) |
||||||
return; |
return; |
||||||
} |
} |
||||||
}, |
let ids = this.multipleSelection.join(","); |
||||||
searchReset() { |
console.log(ids) |
||||||
this.query = {}; |
this.submitLoading = true; |
||||||
this.onLoad(this.page); |
if (this.addForm.id > 0) { |
||||||
}, |
cornJobUpdate({ ...this.addForm, deviceId: ids }).then((res) => { |
||||||
searchChange(params, done) { |
this.submitLoading = false; |
||||||
this.query = params; |
this.dialogVisible = false; |
||||||
this.page.currentPage = 1; |
this.onLoad(this.page); |
||||||
this.onLoad(this.page, params); |
this.$message({ |
||||||
done(); |
type: "success", |
||||||
}, |
message: "操作成功!" |
||||||
selectionChange(list) { |
}); |
||||||
console.log(list) |
}, () => { |
||||||
this.selectionList = list; |
this.submitLoading = false; |
||||||
}, |
}) |
||||||
selectionClear() { |
} else { |
||||||
this.selectionList = []; |
cornJobSave({ ...this.addForm, deviceId: ids }).then(res => { |
||||||
this.$refs.crud.toggleSelection(); |
this.submitLoading = false; |
||||||
}, |
this.dialogVisible = false; |
||||||
//查看详情 |
this.onLoad(this.page); |
||||||
handleDetail(row){ |
this.$message({ |
||||||
this.dialogVisible = true; |
type: "success", |
||||||
this.isDetail = true; |
message: "操作成功!" |
||||||
this.tableData = [ |
}); |
||||||
{id:'001',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
}, () => { |
||||||
{id:'002',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
this.submitLoading = false; |
||||||
]; |
}) |
||||||
this.addForm = { |
} |
||||||
preTime:'09:00:00', |
|
||||||
isOpen:Boolean(1) |
|
||||||
} |
} |
||||||
}, |
}) |
||||||
//点击编辑按钮 |
}, |
||||||
handleEdit(){ |
searchReset() { |
||||||
this.dialogVisible = true; |
this.query = {}; |
||||||
this.isDetail = false; |
this.onLoad(this.page); |
||||||
this.tableData = [ |
}, |
||||||
{id:'001',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
searchChange(params, done) { |
||||||
{id:'002',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
this.query = params; |
||||||
{id:'003',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
this.page.currentPage = 1; |
||||||
{id:'004',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
this.onLoad(this.page, params); |
||||||
{id:'005',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
done(); |
||||||
{id:'006',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
}, |
||||||
{id:'007',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
selectionChange(list) { |
||||||
{id:'008',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
console.log(list) |
||||||
{id:'009',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
this.selectionList = list; |
||||||
{id:'010',deviceName:'空调',deviceNo:"A101",deviceType:'空调设备',deviceArea:'1号楼一层北',position:'120.51,36.12'}, |
}, |
||||||
] |
selectionClear() { |
||||||
this.selectedArr = ['001','003','005'] |
this.selectionList = []; |
||||||
let selectArr = ['002','004'] |
this.$refs.crud.toggleSelection(); |
||||||
let map = new Map(); |
}, |
||||||
for (let item of this.tableData) { |
//查看详情 |
||||||
if (!map.has(item.id)) { |
handleDetail(row) { |
||||||
map.set(item.id, item); |
row.status = row.status + ''; |
||||||
}; |
this.addForm = row; |
||||||
}; |
this.dialogVisible = true; |
||||||
this.multipleSelection = [...map.values()].filter(item => selectArr.includes(item.id)); |
this.isDetail = true; |
||||||
this.$nextTick(() =>{ |
this.$nextTick(() => { |
||||||
this.multipleSelection.forEach((row) => { |
this.queryDeviceList(this.diaPage); |
||||||
this.$refs.multipleTable.toggleRowSelection(row, true) //选中已经选择的 |
}) |
||||||
}) |
}, |
||||||
|
//点击编辑按钮 |
||||||
|
handleEdit(row, index) { |
||||||
|
row.status = row.status + ''; |
||||||
|
this.addForm = row; |
||||||
|
this.dialogVisible = true; |
||||||
|
this.isDetail = false; |
||||||
|
this.$nextTick(() => { |
||||||
|
this.queryDeviceList(this.diaPage); |
||||||
|
}) |
||||||
|
}, |
||||||
|
handleDelete() { |
||||||
|
if (this.selectionList.length === 0) { |
||||||
|
this.$message.warning("请选择至少一条数据"); |
||||||
|
return; |
||||||
|
} |
||||||
|
this.$confirm("确定将选择数据删除?", { |
||||||
|
confirmButtonText: "确定", |
||||||
|
cancelButtonText: "取消", |
||||||
|
type: "warning" |
||||||
|
}) |
||||||
|
.then(() => { |
||||||
|
return cornJobRemove({ ids: this.ids.join(",") }); |
||||||
}) |
}) |
||||||
|
.then(() => { |
||||||
}, |
this.onLoad(this.page); |
||||||
handleDelete() { |
this.selectionClear(); |
||||||
this.$confirm("确定将选择数据删除?", { |
this.$message({ |
||||||
confirmButtonText: "确定", |
type: "success", |
||||||
cancelButtonText: "取消", |
message: "操作成功!" |
||||||
type: "warning" |
}); |
||||||
|
}); |
||||||
|
}, |
||||||
|
handleDeleteRow(row) { |
||||||
|
this.$confirm("确定将选择数据删除?", { |
||||||
|
confirmButtonText: "确定", |
||||||
|
cancelButtonText: "取消", |
||||||
|
type: "warning" |
||||||
|
}) |
||||||
|
.then(() => { |
||||||
|
return cornJobRemove({ ids: row.id }); |
||||||
}) |
}) |
||||||
.then(() => { |
.then(() => { |
||||||
|
this.onLoad(this.page); |
||||||
}) |
this.$message({ |
||||||
.then(() => { |
type: "success", |
||||||
// this.onLoad(this.page); |
message: "操作成功!" |
||||||
// this.$message({ |
|
||||||
// type: "success", |
|
||||||
// message: "操作成功!" |
|
||||||
// }); |
|
||||||
// this.$refs.crud.toggleSelection(); |
|
||||||
}); |
}); |
||||||
}, |
}); |
||||||
currentChange(currentPage) { |
}, |
||||||
this.page.currentPage = currentPage; |
currentChange(currentPage) { |
||||||
}, |
this.page.currentPage = currentPage; |
||||||
sizeChange(pageSize) { |
}, |
||||||
this.page.pageSize = pageSize; |
sizeChange(pageSize) { |
||||||
}, |
this.page.pageSize = pageSize; |
||||||
refreshChange() { |
}, |
||||||
this.onLoad(this.page, this.query); |
refreshChange() { |
||||||
}, |
this.onLoad(this.page, this.query); |
||||||
onLoad(page, params = {}) { |
}, |
||||||
// const {releaseTimeRange} = this.query; |
onLoad(page, params = {}) { |
||||||
// let values = { |
let values = { |
||||||
// ...params, |
...params, |
||||||
// ...this.query |
...this.query |
||||||
// }; |
}; |
||||||
// if (releaseTimeRange) { |
this.loading = true; |
||||||
// values = { |
cornJobList({ current: page.currentPage, size: page.pageSize, ...values }).then(res => { |
||||||
// ...values, |
const data = res.data.data; |
||||||
// releaseTime_datege: releaseTimeRange[0], |
this.page.total = data.total; |
||||||
// releaseTime_datelt: releaseTimeRange[1], |
this.data = data.records; |
||||||
// }; |
this.loading = false; |
||||||
// values.releaseTimeRange = null; |
this.selectionClear(); |
||||||
// } |
}, err => { |
||||||
// this.loading = true; |
|
||||||
// getList(page.currentPage, page.pageSize, values).then(res => { |
|
||||||
// const data = res.data.data; |
|
||||||
// this.page.total = data.total; |
|
||||||
// this.data = data.records; |
|
||||||
// this.loading = false; |
|
||||||
// this.selectionClear(); |
|
||||||
// }); |
|
||||||
this.data = [ |
|
||||||
{time:'09:00:00',device:'空调1、空调2、消防1、消防2、消防3、消防4、消防5...',status:0}, |
|
||||||
{time:'09:00:00',device:'空调1、空调2、消防1、消防2、消防3、消防4、消防5...',status:1}, |
|
||||||
]; |
|
||||||
this.loading = false; |
this.loading = false; |
||||||
this.page.total = this.data.length; |
this.selectionClear(); |
||||||
|
}); |
||||||
|
}, |
||||||
|
//设备列表 |
||||||
|
queryDeviceList(page, params = {}) { |
||||||
|
let values = { |
||||||
|
...params, |
||||||
|
pid: 100 |
||||||
|
}; |
||||||
|
let token = window.sessionStorage.getItem('bizToken'); |
||||||
|
if (token == 'undefined' || !token) { |
||||||
|
bizLogin({ appKey: 'Arf7bd4f26', appSecret: 'kb207044c8' }).then(res => { |
||||||
|
window.sessionStorage.setItem('bizToken', res.data.data.token); |
||||||
|
bizDeviceList(res.data.data.token, { ...values, pageSize: page.pageSize, pageNum: page.currentPage }).then(res2 => { |
||||||
|
const data = res2.data; |
||||||
|
this.diaPage.total = data.total; |
||||||
|
data.rows.map(item => { |
||||||
|
item.node = item.bizProduct.node; |
||||||
|
item.nodeLabel = this.renderLabel(item.node, 'bizNodeType'); |
||||||
|
item.statusLabel = this.renderLabel(item.status, 'bizDeviceStatus') |
||||||
|
item.productName = item.bizProduct.name; |
||||||
|
}) |
||||||
|
this.tableData = data.records; |
||||||
|
this.$refs.multipleTable.clearSelection(); |
||||||
|
this.multipleSelection = this.addForm.deviceId ? this.addForm.deviceId.split(",") : []; |
||||||
|
if (this.multipleSelection.length > 0) { // 判断是否存在勾选过的数据 |
||||||
|
this.$nextTick(() => { |
||||||
|
this.tableData.forEach(row => { // 获取数据列表接口请求到的数据 |
||||||
|
this.multipleSelection.forEach(item => { // 勾选到的数据 |
||||||
|
if (row.id === parseInt(item)) { |
||||||
|
this.$refs.multipleTable.toggleRowSelection(row, true); // 若有重合,则回显该条数据 |
||||||
|
} |
||||||
|
}); |
||||||
|
}) |
||||||
|
}) |
||||||
|
|
||||||
|
} |
||||||
|
}); |
||||||
|
}) |
||||||
|
} else { |
||||||
|
bizDeviceList(token, { ...values, pageSize: page.pageSize, pageNum: page.currentPage, pid: 100 }).then(res2 => { |
||||||
|
if (res2.data.code == 401) { |
||||||
|
window.sessionStorage.removeItem('bizToken'); |
||||||
|
this.queryDeviceList(); |
||||||
|
} |
||||||
|
else if (res2.data.code == 200) { |
||||||
|
const data = res2.data; |
||||||
|
this.diaPage.total = data.total; |
||||||
|
data.rows.map(item => { |
||||||
|
item.node = item.bizProduct.node; |
||||||
|
item.nodeLabel = this.renderLabel(item.node, 'bizNodeType'); |
||||||
|
item.statusLabel = this.renderLabel(item.status, 'bizDeviceStatus') |
||||||
|
item.productName = item.bizProduct.name; |
||||||
|
}) |
||||||
|
this.tableData = data.rows; |
||||||
|
this.$refs.multipleTable.clearSelection(); |
||||||
|
this.multipleSelection = this.addForm.deviceId ? this.addForm.deviceId.split(",") : []; |
||||||
|
if (this.multipleSelection.length > 0) { // 判断是否存在勾选过的数据 |
||||||
|
this.$nextTick(() => { |
||||||
|
this.tableData.forEach(row => { // 获取数据列表接口请求到的数据 |
||||||
|
this.multipleSelection.forEach(item => { // 勾选到的数据 |
||||||
|
if (row.id === parseInt(item)) { |
||||||
|
this.$refs.multipleTable.toggleRowSelection(row, true); // 若有重合,则回显该条数据 |
||||||
|
} |
||||||
|
}); |
||||||
|
}) |
||||||
|
}) |
||||||
|
} |
||||||
|
} |
||||||
|
}, err => { |
||||||
|
}); |
||||||
} |
} |
||||||
} |
} |
||||||
}; |
} |
||||||
|
}; |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style lang="scss" scoped> |
<style lang="scss" scoped> |
||||||
::v-deep .cancel_item { |
::v-deep .cancel_item { |
||||||
background: url('~@/assets/image/cancel_iten.png') center no-repeat; // 注意此处的url,在这里引入自己的图片 |
background: url('~@/assets/image/cancel_iten.png') center no-repeat; // 注意此处的url,在这里引入自己的图片 |
||||||
font-size: 12px; |
font-size: 12px; |
||||||
background-size: cover; |
background-size: cover; |
||||||
} |
} |
||||||
|
|
||||||
::v-deep .cancel_item:before { |
::v-deep .cancel_item:before { |
||||||
content: "替"; |
content: "替"; |
||||||
font-size: 12px; |
font-size: 12px; |
||||||
visibility: hidden; |
visibility: hidden; |
||||||
} |
} |
||||||
|
|
||||||
::v-deep .add_item { |
::v-deep .add_item { |
||||||
background: url('~@/assets/image/add.png') center no-repeat; // 注意此处的url,在这里引入自己的图片 |
background: url('~@/assets/image/add.png') center no-repeat; // 注意此处的url,在这里引入自己的图片 |
||||||
font-size: 12px; |
font-size: 12px; |
||||||
background-size: cover; |
background-size: cover; |
||||||
} |
} |
||||||
|
|
||||||
::v-deep .add_item:before { |
::v-deep .add_item:before { |
||||||
content: "替"; |
content: "替"; |
||||||
font-size: 12px; |
font-size: 12px; |
||||||
visibility: hidden; |
visibility: hidden; |
||||||
} |
} |
||||||
.table_box{ |
|
||||||
th.el-table__cell{ |
.table_box { |
||||||
|
th.el-table__cell { |
||||||
background: #F7F8FA; |
background: #F7F8FA; |
||||||
} |
} |
||||||
} |
} |
||||||
</style> |
|
||||||
<style lang="scss"> |
|
||||||
.dia_box{ |
|
||||||
height: 700px; |
|
||||||
overflow: auto; |
|
||||||
|
|
||||||
.el-table{ |
.dia_box { |
||||||
width: 90% !important; |
height: 700px; |
||||||
border: 1px solid #D6D8DF; |
overflow: auto; |
||||||
} |
|
||||||
.el-table th.el-table__cell{ |
|
||||||
background: #F7F8FA; |
|
||||||
} |
|
||||||
.dialog-footer{ |
|
||||||
width: 100%; |
|
||||||
height: 100%; |
|
||||||
display: flex; |
|
||||||
align-items: center; |
|
||||||
justify-content: center; |
|
||||||
} |
|
||||||
|
|
||||||
.page_box{ |
.el-table { |
||||||
width: 90%; |
width: 100% !important; |
||||||
margin-left: 9%; |
border: 1px solid #D6D8DF; |
||||||
display: flex; |
} |
||||||
align-items: center; |
|
||||||
justify-content: center; |
.el-table th.el-table__cell { |
||||||
margin-top: 15px; |
background: #F7F8FA; |
||||||
} |
|
||||||
} |
} |
||||||
|
|
||||||
|
.dialog-footer { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
justify-content: center; |
||||||
|
} |
||||||
|
|
||||||
|
.page_box { |
||||||
|
width: 90%; |
||||||
|
margin-left: 9%; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
justify-content: center; |
||||||
|
margin-top: 15px; |
||||||
|
} |
||||||
|
} |
||||||
</style> |
</style> |
||||||
|
|||||||
Loading…
Reference in new issue