Commit 3b8d99bf authored by xiexingan's avatar xiexingan

Merge branch 'dev' of gitlab.suntrayoa.com:geqilin/zhxf_vue into dev

parents 542e698d 1b66f9bf
......@@ -12,22 +12,10 @@
el-form-item(label='资源点类型:' prop='type' )
el-select( v-model="dataForm.type" placeholder="请选择资源点类型" disabled)
el-option(v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.id")
//- el-form-item(label='线路:' prop='lineId' )
//- el-select(v-model="dataForm.lineId" placeholder="请选择线路" @change="lineChange" disabled )
//- el-option(v-for="(item,index) in lineList" :key="index" :label="item.name" :value="item.id")
el-form-item(label='线路:' prop='lineId' )
el-input(v-model='dataForm.lineId' placeholder="")
el-form-item(label='站点:' prop='stationId' )
el-select(v-model="dataForm.stationId" placeholder="请选择站点" @change="stationChange" disabled )
el-option(v-for="(item,index) in stationList" :key="index" :label="item.stationName" :value="item.id")
//- el-option(v-for="(item,index) in stationList" :key="index" :label="item.code+'-'+item.stationName" :value="item.id")
el-form-item(label='子系统:' prop='subSystem' )
el-select(v-model="dataForm.subSystem" placeholder="请选择子系统" @change="subSystemChange")
el-option(v-for="(item,index) in systemList" :key="index" :label="item.name" :value="item.value" :code="item.value" :disabled="item.disabled")
el-form-item(label='楼栋:' prop='stationName' )
el-input(v-model='dataForm.stationName' placeholder='' readonly)
el-form-item(label='资源点编码:' prop='code')
el-input(v-model='dataForm.code' placeholder='保存后系统自动生成' readonly)
el-form-item(label='子系统编码:' prop='subCode')
el-input(v-model='dataForm.subCode' placeholder='请填写子系统编码' readonly)
el-form-item(label='地址码:' prop='addressCode')
el-input(v-model='dataForm.addressCode' placeholder='请填写地址码')
el-form-item(label='端口号:' prop='port')
......@@ -36,10 +24,6 @@
el-input(v-model='dataForm.username' placeholder='请填写用户名')
el-form-item(label='密码:' prop='password')
el-input(v-model='dataForm.password' placeholder='请填写密码')
el-form-item(label='父节点名称:' prop='parentName' v-if="dataForm.dicTypeName ==='枪机' && dataForm.subCode ==='04'")
el-select(v-model="dataForm.parentName" placeholder="请选择父节点")
el-option(v-for="(item,index) in parentList" :key="index" :label="item.name" :value="item.id" :code="item.id")
//- el-input(v-model='dataForm.parentName' placeholder='请填写父节点名称')
el-form-item(label='设备品牌:' prop='brand')
el-select(v-model="dataForm.brand" placeholder="请选择设备品牌" )
el-option(v-for="(item,index) in brandList" :key="index" :label="item.name" :value="item.id" :code="item.id")
......@@ -47,8 +31,6 @@
el-input(v-model='dataForm.cameraNames' placeholder='请选择关联摄像头' @click.native="checktable")
el-form-item(label='通道:' prop='byx1' v-if="dataForm.dicTypeName === '枪机' || dataForm.dicTypeName === '球机' || dataForm.dicTypeName === '安检机'")
el-input(v-model='dataForm.byx1' placeholder='请填写通道')
el-form-item(label='输送带端口号:' prop='ajjPort' v-if="dataForm.dicTypeName === '安检机'")
el-input(v-model='dataForm.ajjPort' placeholder='请填写输送带端口号')
el-col(:span="11" style="margin-left: 30px;")
el-row( class='info-block')
div(class='info-title') 位置信息
......@@ -117,7 +99,7 @@ export default {
...mapState('d2admin/user', ['info'])
},
props: ['pList'],
data () {
data() {
// var validatorCamer = (rule, value, callback) => {
// if (this.dataForm.type !== 'b6af764f2a6e454490a6b1b3c9057e57' && this.dataForm.type !== 'ece0b8b2db27411886254e81134988a3') {
// if (this.dataForm.cameraIds === null || this.dataForm.cameraIds === undefined || this.dataForm.cameraIds === '') {
......@@ -144,7 +126,6 @@ export default {
list: [],
sysOrgList: [],
dataListSelections: [],
lineList: [],
stationList: [],
typeList: [],
systemList: [],
......@@ -160,15 +141,11 @@ export default {
id: 0,
name: '',
type: 1,
lineId: '',
lineName: '',
stationId: localStorage.getItem('stationId'),
stationName: '',
tierId: '',
cameraNames: '',
subSystem: '',
code: '',
subCode: '',
addressCode: '',
port: '',
username: '',
......@@ -181,34 +158,25 @@ export default {
{ required: true, message: '资源点名称不能为空', trigger: 'blur' },
{ min: 1, max: 10, message: '长度在 1 到 10 个字符', trigger: 'blur' }
],
type: [{ required: true, message: '资源点类型不能为空', trigger: 'blur' }],
lineId: [{ required: true, message: '线路不能为空', trigger: 'blur' }],
stationId: [{ required: true, message: '站点不能为空', trigger: 'blur' }],
subSystem: [{ required: true, message: '子系统不能为空', trigger: 'blur' }],
//code: [{ required: true, message: '资源点编码不能为空', trigger: 'blur' },
//{ min: 1, max: 64, message: '长度在 1 到 64 个字符', trigger: 'blur' }],
subCode: [{ required: true, message: '子系统编码不能为空', trigger: 'blur' },
{ min: 1, max: 64, message: '长度在 1 到 64 个字符', trigger: 'blur' }],
parentName: [{ required: true, message: '父节点名称不能为空', trigger: 'blur' }],
addressCode: [{ min: 1, max: 64, message: '长度在 1 到 64 个字符', trigger: 'blur' }],
port: [{ message: '请输入端口号', trigger: 'change' },
{ validator(rule, value, callback) {
if (value) {
if (Number.isInteger(Number(value)) && Number(value) < 65536 && Number(value) > 0) {
callback()
} else {
callback(new Error('请输入1到65535之间的正整数'))
}
} else {
callback()
}
},
trigger: 'blur' }
type: [
{ required: true, message: '资源点类型不能为空', trigger: 'blur' }
],
// parentName: [
// { required: true, message: '父节点名称不能为空', trigger: 'blur' }
// ],
addressCode: [
{ min: 1, max: 64, message: '长度在 1 到 64 个字符', trigger: 'blur' }
],
ajjPort: [
{ validator(rule, value, callback) {
port: [
{ message: '请输入端口号', trigger: 'change' },
{
validator(rule, value, callback) {
if (value) {
if (Number.isInteger(Number(value)) && Number(value) < 65536 && Number(value) > 0) {
if (
Number.isInteger(Number(value)) &&
Number(value) < 65536 &&
Number(value) > 0
) {
callback()
} else {
callback(new Error('请输入1到65535之间的正整数'))
......@@ -217,31 +185,70 @@ export default {
callback()
}
},
trigger: 'blur' }
trigger: 'blur'
}
],
username: [
{ min: 1, max: 64, message: '长度在 1 到 64 个字符', trigger: 'blur' }
],
password: [
{ min: 1, max: 64, message: '长度在 1 到 64 个字符', trigger: 'blur' }
],
xlongit: [
{ required: true, message: 'X1坐标不能为空', trigger: 'blur' },
{ min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' }
],
ylat: [
{ required: true, message: 'Y1坐标不能为空', trigger: 'blur' },
{ min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' }
],
xpoint: [
{ required: true, message: 'X1坐标不能为空', trigger: 'blur' },
{ min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' }
],
ypoint: [
{ required: true, message: 'Y1坐标不能为空', trigger: 'blur' },
{ min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' }
],
username: [{ min: 1, max: 64, message: '长度在 1 到 64 个字符', trigger: 'blur' }],
password: [{ min: 1, max: 64, message: '长度在 1 到 64 个字符', trigger: 'blur' }],
xlongit: [{ required: true, message: 'X1坐标不能为空', trigger: 'blur' },
{ min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' }],
ylat: [{ required: true, message: 'Y1坐标不能为空', trigger: 'blur' },
{ min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' }],
xpoint: [{ required: true, message: 'X1坐标不能为空', trigger: 'blur' },
{ min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' }],
ypoint: [{ required: true, message: 'Y1坐标不能为空', trigger: 'blur' },
{ min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' }],
//width: [{ required: true, message: '长度不能为空', trigger: 'blur' }],
tierId: [{ required: true, message: '地图层级不能为空', trigger: 'blur' }],
deployLocation: [{ required: true, message: '部署位置不能为空', trigger: 'blur' },
{ min: 1, max: 64, message: '长度在 1 到 64 个字符', trigger: 'blur' }],
operatorName: [{ required: true, message: '当前操作员不能为空', trigger: 'blur' }],
tierId: [
{ required: true, message: '地图层级不能为空', trigger: 'blur' }
],
deployLocation: [
{ required: true, message: '部署位置不能为空', trigger: 'blur' },
{ min: 1, max: 64, message: '长度在 1 到 64 个字符', trigger: 'blur' }
],
operatorName: [
{ required: true, message: '当前操作员不能为空', trigger: 'blur' }
],
// cameraNames: [{ required: true, validator: validatorCamer, trigger: ['blur', 'change'] }],
brand: [{ required: true, message: '品牌不能为空', trigger: ['blur', 'change'] }],
icon: [{ required: true, message: '资源点图标不能为空', trigger: 'blur' }],
attachedInfo: [{ min: 1, max: 500, message: '长度在 1 到 500 个字符', trigger: 'blur' }],
brand: [
{
required: true,
message: '品牌不能为空',
trigger: ['blur', 'change']
}
],
icon: [
{ required: true, message: '资源点图标不能为空', trigger: 'blur' }
],
attachedInfo: [
{
min: 1,
max: 500,
message: '长度在 1 到 500 个字符',
trigger: 'blur'
}
],
byx1: [
{ validator(rule, value, callback) {
{
validator(rule, value, callback) {
if (value) {
if (Number.isInteger(Number(value)) && Number(value) < 99 && Number(value) > 0) {
if (
Number.isInteger(Number(value)) &&
Number(value) < 99 &&
Number(value) > 0
) {
callback()
} else {
callback(new Error('请输入1到99之间的正整数'))
......@@ -250,16 +257,25 @@ export default {
callback()
}
},
trigger: 'blur' }],
remark: [{ min: 1, max: 500, message: '长度在 1 到 500 个字符', trigger: 'blur' }]
trigger: 'blur'
}
],
remark: [
{
min: 1,
max: 500,
message: '长度在 1 到 500 个字符',
trigger: 'blur'
}
]
}
}
},
created () {
created() {
that = this
},
methods: {
initMap (bean) {
initMap(bean) {
if (this.mapDialog) {
this.mapDialog.removeLayer(this.imgLayer)
this.mapDialog.removeLayer(this.vectorLayer)
......@@ -300,8 +316,10 @@ export default {
})
})
//点击事件
this.mapDialog.on('click', function (evt) {
let feature = evt.map.forEachFeatureAtPixel(evt.pixel, function (feature) {
this.mapDialog.on('click', function(evt) {
let feature = evt.map.forEachFeatureAtPixel(evt.pixel, function(
feature
) {
return feature
})
if (feature) {
......@@ -310,9 +328,16 @@ export default {
that.list[i].active = !that.list[i].active
let style = null
if (that.list[i].active) {
style = that.getPointStyle(that.list[i].imageSrc + '2.png', that.list[i].name, 0.3)
style = that.getPointStyle(
that.list[i].imageSrc + '2.png',
that.list[i].name,
0.3
)
} else {
style = that.getPointStyle(that.list[i].imageSrc + '.png', that.list[i].name)
style = that.getPointStyle(
that.list[i].imageSrc + '.png',
that.list[i].name
)
}
feature.setStyle(style)
}
......@@ -320,8 +345,8 @@ export default {
}
})
},
init (bean) {
//console.log('bean:', bean)
init(bean) {
console.log('bean:', bean)
this.dataForm = {}
this.visible = true
this.clickFlag = false
......@@ -338,22 +363,19 @@ export default {
// }
// }
this.dataForm.operatorName = this.info.name
this.initLineList()
this.initSubSystemDicList()
this.initResourceTypeDicList()
this.initBrandDicList()
this.initStationMapList()
this.initParentNode()
},
initResource (x, y, endx, endy) {
initResource(x, y, endx, endy) {
this.$http({
url: this.$http.adornUrl(`/liResource/getId`),
method: 'get',
params: { id: this.dataForm.id }
}).then(data => {
}).then((data) => {
if (data && data.code === 0) {
this.dataForm = data.bean
this.checkCameraList = data.list.map(e => {
this.checkCameraList = data.list.map((e) => {
return { id: e.cameraId, name: e.cameraName }
})
......@@ -368,177 +390,60 @@ export default {
this.dataForm.cameraNames = cameraNames.join(',')
}
// this.dataForm.lineId = '0ff691b45da01acb6b5e4b6d8b90cfe5'
// this.dataForm.lineName = '成都地铁1号线'
// this.dataForm.stationId = '40bf04d6f2e2ec3bfbb43aa51a7facc8'
// this.dataForm.stationName = '升仙湖站'
// this.dataForm.tierId = 'b70eb21104124e559cb078f3a8c7174e'
// this.dataForm.tierName = '出入口'
this.dataForm.xpoint = x
this.dataForm.ypoint = y
this.initStationList(this.dataForm.lineId)
}
})
},
initParentNode () {
this.$http({
url: this.$http.adornUrl('/liResource/getResourceList'),
method: 'post',
data: {
stationId: this.dataForm.stationId
}
}).then(data => {
if (data && data.code === 0) {
this.parentList = data.list
}
})
},
initLineList () {
this.$http({
url: this.$http.adornUrl('/liLine/listAll'),
method: 'post',
data: {}
}).then(data => {
if (data && data.code === 0) {
this.lineList = data.page.rows
if (this.dataForm.lineId) {
this.initStationList(this.dataForm.lineId)
}
}
})
},
initStationList (lineId) {
this.$http({
url: this.$http.adornUrl('/liStation/listAll'),
method: 'post',
data: {
lineId: lineId
}
}).then(data => {
if (data && data.code === 0) {
this.stationList = data.page.rows
}
})
},
initStationMapList () {
initStationMapList() {
this.$http({
url: this.$http.adornUrl(`/liStation/getId/${this.dataForm.stationId}`),
method: 'get',
params: this.$http.adornParams()
}).then(data => {
}).then((data) => {
if (data && data.code === 0) {
this.tierList = data.bean.mapList
}
})
},
initStMapList () {
initStMapList() {
this.$http({
url: this.$http.adornUrl(`/liStationMap/getId/${this.dataForm.tierId}`),
method: 'get',
params: this.$http.adornParams()
}).then(data => {
})
.then((data) => {
if (data && data.code === 0) {
this.tier = data.bean
this.tier.readPath = this.urlPath + this.tier.filePath
this.initMap(this.tier)
//this.changeImageLayer(this.tier)
}
}).then(() => {
this.showResourceByMapId()
})
},
initSubSystemDicList () {
this.$http({
url: this.$http.adornUrl('/sysDictionary/getSubSystemDicList'),
method: 'get',
params: this.$http.adornParams({
stationId: localStorage.getItem('stationId')
})
}).then(data => {
if (data && data.code === 0) {
this.systemList = data.list
//disabled用于禁用选项,初始值都不禁用
this.systemList.forEach(dic => {
dic.disabled = false
})
// if (!this.dataForm.subCode) {
// this.dataForm.subCode = this.systemList[0].value
// this.dataForm.subSystem = this.systemList[0].name
// }
}
.then(() => {
this.showResourceByMapId()
})
},
initResourceTypeDicList () {
initResourceTypeDicList() {
this.$http({
url: this.$http.adornUrl('/sysDictionary/getResourceTypeDicList'),
method: 'get',
params: this.$http.adornParams({
stationId: localStorage.getItem('stationId')
})
}).then(data => {
}).then((data) => {
if (data && data.code === 0) {
this.typeList = data.list
this.typeList.forEach(e => {
this.typeList.forEach((e) => {
if (e.id === this.dataForm.type) {
this.dataForm.dicTypeName = e.name
}
})
}
}).then(() => {
// 视频监控:枪机和球机
// 出入口控制:门禁
// 入侵报警:照明灯、入侵报警灯、双鉴探测器、振动光纤
// 安全检查:枪机、球机、安检机、安检门、液体探测器、炸探、一键报警
//根据资源点类型禁用子系统选项
this.systemList.forEach(dic => {
if (['枪机', '球机'].indexOf(this.dataForm.dicTypeName) > -1) {
if (dic.value === '01' || dic.value === '04') {
dic.disabled = false
} else {
dic.disabled = true
}
} else if (this.dataForm.dicTypeName === '门禁') {
if (dic.value === '02') {
dic.disabled = false
} else {
dic.disabled = true
}
} else if (['照明灯', '入侵报警灯', '双鉴探测器', '振动光纤'].indexOf(this.dataForm.dicTypeName) > -1) {
if (dic.value === '03') {
dic.disabled = false
} else {
dic.disabled = true
}
} else if (['安检机', '安检门', '液体探测器', '炸探', '一键报警'].indexOf(this.dataForm.dicTypeName) > -1) {
if (dic.value === '04') {
dic.disabled = false
} else {
dic.disabled = true
}
}
})
//给资源点设置初始的子系统编码
if (!this.dataForm.subCode) {
if (['枪机', '球机'].indexOf(this.dataForm.dicTypeName) > -1) {
this.dataForm.subCode = '01'
this.dataForm.subSystem = '视频监控'
} else if (this.dataForm.dicTypeName === '门禁') {
this.dataForm.subCode = '02'
this.dataForm.subSystem = '出入口控制'
} else if (['照明灯', '入侵报警灯', '双鉴探测器', '振动光纤'].indexOf(this.dataForm.dicTypeName) > -1) {
this.dataForm.subCode = '03'
this.dataForm.subSystem = '入侵报警'
} else if (['安检机', '安检门', '液体探测器', '炸探', '一键报警'].indexOf(this.dataForm.dicTypeName) > -1) {
this.dataForm.subCode = '04'
this.dataForm.subSystem = '安全检查'
} else {
this.dataForm.subCode = '01'
this.dataForm.subSystem = '视频监控'
}
}
})
},
initBrandDicList () {
initBrandDicList() {
this.brandList = []
this.$http({
url: this.$http.adornUrl('/sysDictionary/getBrandDicList'),
......@@ -546,79 +451,14 @@ export default {
params: this.$http.adornParams({
stationId: localStorage.getItem('stationId')
})
}).then(data => {
}).then((data) => {
if (data && data.code === 0) {
this.brandList = data.list
// if (data.list !== null && data.list.length > 0) {
// //console.log(this.dataForm.type, '**********')
// data.list.forEach((res, index) => {
// if ((res.id === '6f43d870c0dd4327a38549d947b5cb6f' ||
// res.id === '66eb8a17b56f4ca5a8d422591b42cd36') &&
// (this.dataForm.type === 'b6af764f2a6e454490a6b1b3c9057e57' ||
// this.dataForm.type === 'ece0b8b2db27411886254e81134988a3')) { //大华、海康威视 球机、枪机
// this.brandList.push(res)
// } else if (res.id === '47b0724186c848f481fe0b12681308e8' &&
// (this.dataForm.type === 'f4c840711eae4bcb9536a890cdfda493' ||
// this.dataForm.type === '303310efddb34a2e9bf269bdff8a7dc5')) { //同方威视 炸探、安检机
// this.brandList.push(res)
// } else if (res.id === '518be72e65d1441e8dab676cd2e2db89' &&
// this.dataForm.type === 'b47661ca1d454f9792ba5369f3cb2bc5') { //中泰通 液探
// this.brandList.push(res)
// } else if (res.id === 'b9dbc73e04b94e9294f65b5c2109ff22' &&
// this.dataForm.type === '683393c31cf0497bb0f62d457cb1e81f') { //安天下 安检门
// this.brandList.push(res)
// } else if (res.id === 'ae588516d2094d5d828f39a44d9b2973' &&
// this.dataForm.type === 'b45827c068254695864ee3c1d42573cb') { //爱克信 门禁系统
// this.brandList.push(res)
// } else if (res.id === '52b93b5b105b48bd8679cef6babfb6ba' &&
// this.dataForm.type === 'b45827c068254695864ee3c1d42573cb') { //臻通 入侵检测系统
// this.brandList.push(res)
// } else if (res.id === 'df5999e2d8784e41111110619b0e3bf' &&
// this.dataForm.type === '0a18ad66953647d792e4a28a40050e92') { //安朗杰 门禁 出入口控制
// this.brandList.push(res)
// } else if (res.id === 'bdc14bb5e54f4c7d98d928c6622004e2' &&
// this.dataForm.type !== 'b6af764f2a6e454490a6b1b3c9057e57' &&
// this.dataForm.type !== 'ece0b8b2db27411886254e81134988a3' &&
// this.dataForm.type !== 'f4c840711eae4bcb9536a890cdfda493' &&
// this.dataForm.type !== '303310efddb34a2e9bf269bdff8a7dc5' &&
// this.dataForm.type !== '683393c31cf0497bb0f62d457cb1e81f' &&
// this.dataForm.type !== 'b45827c068254695864ee3c1d42573cb' &&
// this.dataForm.type !== 'b45827c068254695864ee3c1d42573cb') {
// this.brandList.push(res)//国产
// }
// })
// // console.log(this.brandList, '==========')
// }
}
})
},
lineChange (lineId) {
this.initStationList(lineId)
this.stationList.forEach(a => {
if (a.id === lineId) {
this.dataForm.lineName = a.name
}
})
},
stationChange (stationId) {
this.stationList.forEach(a => {
if (a.id === stationId) {
this.dataForm.stationName = a.stationName
}
})
},
subSystemChange (e) {
this.systemList.forEach(a => {
if (a.value === e) {
// Vue.set(this.dataForm, 'subCode', a.value)
// Vue.set(this.dataForm, 'subSystem', a.name)
this.dataForm.subCode = a.value
this.dataForm.subSystem = a.name
}
})
},
tierChange (e) {
this.tierList.forEach(a => {
tierChange(e) {
this.tierList.forEach((a) => {
if (a.name === e) {
this.dataForm.tierId = a.id
this.dataForm.tierName = a.name
......@@ -627,17 +467,17 @@ export default {
})
},
// 图标选中
iconChange (icon) {
iconChange(icon) {
// this.icon = icon
// this.dataForm.icon = icon.path
},
checktable () {
checktable() {
this.addVisible = true
this.cFlag = false
this.initStMapList()
this.oldCheckCameraList = JSON.parse(JSON.stringify(this.checkCameraList))
},
submitCamera () {
submitCamera() {
this.addVisible = false
this.cFlag = true
this.dataForm.cameraIds = null
......@@ -655,11 +495,11 @@ export default {
this.dataForm.cameraIds = cameraIds.join(',')
this.dataForm.cameraNames = cameraNames.join(',')
},
dialogClose () {
dialogClose() {
this.addVisible = false
this.checkCameraList = JSON.parse(JSON.stringify(this.oldCheckCameraList))
},
closeC () {
closeC() {
this.$confirm('确认取消?', '选择摄像头', {
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -667,7 +507,9 @@ export default {
})
.then(() => {
this.addVisible = false
this.checkCameraList = JSON.parse(JSON.stringify(this.oldCheckCameraList))
this.checkCameraList = JSON.parse(
JSON.stringify(this.oldCheckCameraList)
)
})
.catch(() => {
this.$message({
......@@ -676,19 +518,21 @@ export default {
})
})
},
checkC (res) {
checkC(res) {
if (this.dataForm.id === res.id) {
return
}
var a = 0
for (var i = 0; i < this.checkCameraList.length; i++) { //如果原来有,则移除出去,并还原颜色
for (var i = 0; i < this.checkCameraList.length; i++) {
//如果原来有,则移除出去,并还原颜色
if (this.checkCameraList[i].id === res.id) {
a = 1
this.checkCameraList.splice(i, 1)
break
}
}
if (a === 0) { //如果原来没有,则添加进去,并改变颜色
if (a === 0) {
//如果原来没有,则添加进去,并改变颜色
res.active = true
var r = { id: res.id, name: res.name }
this.checkCameraList.push(r)
......@@ -697,7 +541,7 @@ export default {
}
},
//根据层级id查询所有的摄像头
showResourceByMapId () {
showResourceByMapId() {
this.$http({
url: this.$http.adornUrl('/liResource/getStationMapCameraList'),
method: 'post',
......@@ -707,11 +551,13 @@ export default {
tierId: this.dataForm.tierId,
myId: this.dataForm.id
}
}).then(data => {
})
.then((data) => {
if (data && data.code === 0) {
this.list = data.resourceList
}
}).then(() => {
})
.then(() => {
let arr = []
if (this.dataForm.cameraIds) arr = this.dataForm.cameraIds.split(',')
for (let i in this.list) {
......@@ -725,7 +571,7 @@ export default {
this.changeVectorLayer(this.list)
})
},
getCameraByResourceId () {
getCameraByResourceId() {
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl('/liResourceCamera/getByResourceId'),
......@@ -734,12 +580,15 @@ export default {
resourceId: this.dataForm.id,
stationId: this.dataForm.stationId
}
}).then(data => {
}).then((data) => {
if (data && data.code === 0) {
this.checkCameraList = data.list.map(e => {
this.checkCameraList = data.list.map((e) => {
return { id: e.cameraId, name: e.cameraName }
})
if (this.checkCameraList != null && this.checkCameraList.length > 0) {
if (
this.checkCameraList != null &&
this.checkCameraList.length > 0
) {
let cameraIds = []
let cameraNames = []
for (let i = 0; i < this.checkCameraList.length; i++) {
......@@ -759,12 +608,27 @@ export default {
case 'b6af764f2a6e454490a6b1b3c9057e57':
case 'ece0b8b2db27411886254e81134988a3':
case '303310efddb34a2e9bf269bdff8a7dc5':
if (!base.addressCode || !base.port || !base.byx1 || base.deleted === 1) {
if (
!base.addressCode ||
!base.port ||
!base.byx1 ||
base.deleted === 1
) {
break
}
if (base.addressCode === resource.addressCode && base.port === resource.port && base.byx1 === resource.byx1) {
if (
base.addressCode === resource.addressCode &&
base.port === resource.port &&
base.byx1 === resource.byx1
) {
//添加到重复提示
let tip = '地址码:' + base.addressCode + ' 端口:' + base.port + ' 通道号:' + base.byx1
let tip =
'地址码:' +
base.addressCode +
' 端口:' +
base.port +
' 通道号:' +
base.byx1
if (tips && !tips.includes(tip)) {
tips.push(tip)
}
......@@ -774,7 +638,10 @@ export default {
if (!base.addressCode || !base.port || base.deleted === 1) {
break
}
if (base.addressCode === resource.addressCode && base.port === resource.port) {
if (
base.addressCode === resource.addressCode &&
base.port === resource.port
) {
//添加到重复提示
let tip = '地址码:' + base.addressCode + ' 端口:' + base.port
if (tips && !tips.includes(tip)) {
......@@ -784,17 +651,20 @@ export default {
}
},
// 表单提交
dataFormSubmit (id) {
dataFormSubmit(id) {
// if (this.dataForm.type !== 'b6af764f2a6e454490a6b1b3c9057e57' && this.dataForm.type !== 'ece0b8b2db27411886254e81134988a3') {
// if (this.dataForm.cameraIds === null || this.dataForm.cameraIds === undefined || this.dataForm.cameraIds === '') {
// this.$message.error('关联摄像头不能为空')
// return
// }
// }
if (this.dataForm.type !== 'b6af764f2a6e454490a6b1b3c9057e57' || this.dataForm.subCode !== '04') {
if (
this.dataForm.type !== 'b6af764f2a6e454490a6b1b3c9057e57' ||
this.dataForm.subCode !== '04'
) {
this.dataForm.parentName = null
}
this.$refs['dataForm'].validate(valid => {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//校验数据重复
//后台返回的本地是否重复
......@@ -807,7 +677,10 @@ export default {
if (list[h].id === this.dataForm.id) {
continue
}
if (list[h].parentName && list[h].parentName === this.dataForm.parentName) {
if (
list[h].parentName &&
list[h].parentName === this.dataForm.parentName
) {
n++
}
}
......@@ -836,7 +709,7 @@ export default {
data: {
stationId: localStorage.getItem('stationId')
}
}).then(data => {
}).then((data) => {
if (data && data.code === 0) {
let list = data.page.rows
for (let index = 0; index < list.length; index++) {
......@@ -851,8 +724,8 @@ export default {
// console.log('tips', tips)
if (tips.length > 0) {
let message = ''
tips.map(item => {
message += (item + '<br>')
tips.map((item) => {
message += item + '<br>'
})
// console.log(message)
this.$emit('addNotify', message)
......@@ -896,7 +769,7 @@ export default {
// })
},
//关闭前
handleClose () {
handleClose() {
this.visible = false
//this.$emit('refreshBean', this.dataForm)
this.$refs.dataForm.resetFields()
......@@ -950,9 +823,16 @@ export default {
featuresArr.push(this.getFeature(list[i].xlongit, list[i].ylat))
let style = null
if (list[i].active) {
style = this.getPointStyle(list[i].imageSrc + '2.png', this.list[i].name, 0.3)
style = this.getPointStyle(
list[i].imageSrc + '2.png',
this.list[i].name,
0.3
)
} else {
style = this.getPointStyle(list[i].imageSrc + '.png', this.list[i].name)
style = this.getPointStyle(
list[i].imageSrc + '.png',
this.list[i].name
)
}
featuresArr[i].setStyle(style)
featuresArr[i].setId(list[i].id)
......
......@@ -11,16 +11,10 @@
el-input(v-model='dataForm.name' readonly)
el-form-item(label='资源点类型:' prop='type' )
el-input(v-model='dataForm.resourceName' readonly)
el-form-item(label='线路:' prop='lineId' )
el-input(v-model='dataForm.lineName' readonly)
el-form-item(label='站点:' prop='stationId' )
el-form-item(label='楼栋:' prop='stationName' )
el-input(v-model='dataForm.stationName' readonly)
el-form-item(label='子系统:' prop='subSystem' )
el-input(v-model='dataForm.subSystem' readonly)
el-form-item(label='资源点编码:' prop='code')
el-input(v-model='dataForm.code' readonly)
el-form-item(label='子系统编码:' prop='subCode')
el-input(v-model='dataForm.subCode' readonly)
el-form-item(label='地址码:' prop='addressCode')
el-input(v-model='dataForm.addressCode' readonly)
el-form-item(label='端口号:' prop='port')
......@@ -38,8 +32,6 @@
el-input(v-model='dataForm.cameraNames' readonly)
el-form-item(label='通道:' prop='byx1' v-if="dataForm.dicTypeName === '枪机' || dataForm.dicTypeName === '球机' || dataForm.dicTypeName === '安检机'")
el-input(v-model='dataForm.byx1' readonly)
el-form-item(label='输送带端口号:' prop='ajjPort' v-if="dataForm.dicTypeName === '安检机'")
el-input(v-model='dataForm.ajjPort' placeholder='请填写输送带端口号')
el-col(:span="11" style="margin-left: 30px;")
el-row( class='info-block')
......@@ -118,7 +110,7 @@ export default {
computed: {
...mapState('d2admin/user', ['info'])
},
data () {
data() {
return {
mapDialog: null,
vectorLayer: null,
......@@ -147,18 +139,13 @@ export default {
id: 0,
name: '',
type: 1,
lineId: '',
lineName: '',
stationId: localStorage.getItem('stationId'),
stationName: '',
tierId: '',
cameraNames: '',
subSystem: '',
code: '',
subCode: '',
addressCode: '',
port: '',
ajjPort: '',
username: '',
password: '',
remark: '',
......@@ -196,11 +183,11 @@ export default {
}
}
},
created () {
created() {
that = this
},
methods: {
initMap (bean) {
initMap(bean) {
if (this.mapDialog) {
this.mapDialog.removeLayer(this.imgLayer)
this.mapDialog.removeLayer(this.vectorLayer)
......@@ -237,7 +224,7 @@ export default {
zoom: 2.5,
maxZoom: 5,
minZoom: 1.5,
extent: [-1100, -100, 2000, 1000]
extent: [-1100, -100, 2000, 1000]
})
})
},
......@@ -275,7 +262,10 @@ export default {
for (let i in list) {
if (list[i].imageSrc) {
featuresArr.push(this.getFeature(list[i].xlongit, list[i].ylat))
let style = this.getPointStyle(list[i].imageSrc + '.png', this.list[i].name)
let style = this.getPointStyle(
list[i].imageSrc + '.png',
this.list[i].name
)
featuresArr[i].setStyle(style)
featuresArr[i].setId(list[i].id)
}
......@@ -313,17 +303,18 @@ export default {
})
return style
},
init (id) {
init(id) {
this.visible = true
this.initResource(id)
this.dataForm.operatorName = this.info.name
},
initResource (id) {
initResource(id) {
this.$http({
url: this.$http.adornUrl(`/liResource/getId/`),
method: 'get',
params: { id: id }
}).then(data => {
})
.then((data) => {
if (data && data.code === 0) {
// this.dataForm = data.bean
this.dataForm.addressCode = data.bean.addressCode
......@@ -347,8 +338,6 @@ export default {
this.dataForm.iconPath = data.bean.iconPath
this.dataForm.id = data.bean.id
this.dataForm.imageSrc = data.bean.imageSrc
this.dataForm.lineId = data.bean.lineId
this.dataForm.lineName = data.bean.lineName
this.dataForm.name = data.bean.name
this.dataForm.operatorId = data.bean.operatorId
this.dataForm.operatorName = data.bean.operatorName
......@@ -356,7 +345,6 @@ export default {
this.dataForm.parentName = data.bean.parentName
this.dataForm.password = data.bean.password
this.dataForm.port = data.bean.port
this.dataForm.ajjPort = data.bean.ajjPort
this.dataForm.remark = data.bean.remark
this.dataForm.resourceName = data.bean.resourceName
this.dataForm.rotate = data.bean.rotate
......@@ -364,9 +352,6 @@ export default {
this.dataForm.stationName = data.bean.stationName
this.dataForm.status = data.bean.status
this.dataForm.statusName = data.bean.statusName
this.dataForm.subCode = data.bean.subCode
this.dataForm.subSystem = data.bean.subSystem
this.dataForm.sysSign = data.bean.sysSign
this.dataForm.tierId = data.bean.tierId
this.dataForm.tierName = data.bean.tierName
this.dataForm.type = data.bean.type
......@@ -379,11 +364,14 @@ export default {
this.dataForm.ylat = data.bean.ylat
this.dataForm.ypoint = data.bean.ypoint
this.checkCameraList = data.list.map(e => {
this.checkCameraList = data.list.map((e) => {
return { id: e.cameraId, name: e.cameraName }
})
if (this.checkCameraList != null && this.checkCameraList.length > 0) {
if (
this.checkCameraList != null &&
this.checkCameraList.length > 0
) {
var cameraIds = []
var cameraNames = []
for (var i = 0; i < this.checkCameraList.length; i++) {
......@@ -394,111 +382,53 @@ export default {
this.dataForm.cameraNames = cameraNames.join(',')
}
}
}).then(() => {
this.initStationList(this.dataForm.lineId)
this.initLineList()
this.initSubSystemDicList()
})
.then(() => {
this.initResourceTypeDicList()
this.getCameraByResourceId()
this.initBrandDicList()
this.initStationMapList()
this.initParentNode()
})
},
initParentNode () {
this.$http({
url: this.$http.adornUrl('/liResource/getResourceList'),
method: 'post',
data: {
stationId: this.dataForm.stationId
}
}).then(data => {
if (data && data.code === 0) {
this.parentList = data.list
}
})
},
initLineList () {
this.$http({
url: this.$http.adornUrl('/liLine/listAll'),
method: 'post',
data: {}
}).then(data => {
if (data && data.code === 0) {
this.lineList = data.page.rows
if (this.dataForm.lineId) {
this.initStationList(this.dataForm.lineId)
}
}
})
},
initStationList (lineId) {
this.$http({
url: this.$http.adornUrl('/liStation/listAll'),
method: 'post',
data: {
lineId: lineId
}
}).then(data => {
if (data && data.code === 0) {
this.stationList = data.page.rows
}
})
},
initStationMapList () {
initStationMapList() {
this.$http({
url: this.$http.adornUrl(`/liStation/getId/${this.dataForm.stationId}`),
method: 'get',
params: this.$http.adornParams()
}).then(data => {
}).then((data) => {
if (data && data.code === 0) {
this.tierList = data.bean.mapList
}
})
},
initStMapList () {
initStMapList() {
this.$http({
url: this.$http.adornUrl(`/liStationMap/getId/${this.dataForm.tierId}`),
method: 'get',
params: this.$http.adornParams()
}).then(data => {
})
.then((data) => {
if (data && data.code === 0) {
this.tier = data.bean
this.tier.readPath = this.urlPath + this.tier.filePath
this.initMap(this.tier)
}
}).then(() => {
this.showResourceByMapId()
})
},
initSubSystemDicList () {
this.$http({
url: this.$http.adornUrl('/sysDictionary/getSubSystemDicList'),
method: 'get',
params: this.$http.adornParams({
stationId: localStorage.getItem('stationId')
})
}).then(data => {
if (data && data.code === 0) {
this.systemList = data.list
if (!this.dataForm.subCode) {
this.dataForm.subCode = this.systemList[0].value
this.dataForm.subSystem = this.systemList[0].name
}
}
.then(() => {
this.showResourceByMapId()
})
},
initResourceTypeDicList () {
initResourceTypeDicList() {
this.$http({
url: this.$http.adornUrl('/sysDictionary/getResourceTypeDicList'),
method: 'get',
params: this.$http.adornParams({
stationId: localStorage.getItem('stationId')
})
}).then(data => {
}).then((data) => {
if (data && data.code === 0) {
this.typeList = data.list
this.typeList.forEach(e => {
this.typeList.forEach((e) => {
if (e.id === this.dataForm.type) {
this.$nextTick(() => {
this.dataForm.dicTypeName = e.name
......@@ -508,7 +438,7 @@ export default {
}
})
},
initBrandDicList () {
initBrandDicList() {
this.brandList = []
this.$http({
url: this.$http.adornUrl('/sysDictionary/getBrandDicList'),
......@@ -516,42 +446,62 @@ export default {
params: this.$http.adornParams({
stationId: localStorage.getItem('stationId')
})
}).then(data => {
}).then((data) => {
if (data && data.code === 0) {
// this.brandList = data.list
if (data.list !== null && data.list.length > 0) {
// console.log(this.dataForm.type, '**********')
data.list.forEach((res, index) => {
if ((res.id === '6f43d870c0dd4327a38549d947b5cb6f' ||
if (
(res.id === '6f43d870c0dd4327a38549d947b5cb6f' ||
res.id === '66eb8a17b56f4ca5a8d422591b42cd36') &&
(this.dataForm.type === 'b6af764f2a6e454490a6b1b3c9057e57' ||
this.dataForm.type === 'ece0b8b2db27411886254e81134988a3')) { //大华、海康威视 球机、枪机
this.dataForm.type === 'ece0b8b2db27411886254e81134988a3')
) {
//大华、海康威视 球机、枪机
this.brandList.push(res)
} else if (res.id === '47b0724186c848f481fe0b12681308e8' &&
} else if (
res.id === '47b0724186c848f481fe0b12681308e8' &&
(this.dataForm.type === 'f4c840711eae4bcb9536a890cdfda493' ||
this.dataForm.type === '303310efddb34a2e9bf269bdff8a7dc5')) { //同方威视 炸探、安检机
this.dataForm.type === '303310efddb34a2e9bf269bdff8a7dc5')
) {
//同方威视 炸探、安检机
this.brandList.push(res)
} else if (res.id === '518be72e65d1441e8dab676cd2e2db89' &&
this.dataForm.type === 'b47661ca1d454f9792ba5369f3cb2bc5') { //中泰通 液探
} else if (
res.id === '518be72e65d1441e8dab676cd2e2db89' &&
this.dataForm.type === 'b47661ca1d454f9792ba5369f3cb2bc5'
) {
//中泰通 液探
this.brandList.push(res)
} else if (res.id === 'b9dbc73e04b94e9294f65b5c2109ff22' &&
this.dataForm.type === '683393c31cf0497bb0f62d457cb1e81f') { //安天下 安检门
} else if (
res.id === 'b9dbc73e04b94e9294f65b5c2109ff22' &&
this.dataForm.type === '683393c31cf0497bb0f62d457cb1e81f'
) {
//安天下 安检门
this.brandList.push(res)
} else if (res.id === 'ae588516d2094d5d828f39a44d9b2973' &&
this.dataForm.type === 'b45827c068254695864ee3c1d42573cb') { //爱克信 门禁系统
} else if (
res.id === 'ae588516d2094d5d828f39a44d9b2973' &&
this.dataForm.type === 'b45827c068254695864ee3c1d42573cb'
) {
//爱克信 门禁系统
this.brandList.push(res)
} else if (res.id === '52b93b5b105b48bd8679cef6babfb6ba' &&
this.dataForm.type === 'b45827c068254695864ee3c1d42573cb') { //臻通 入侵检测系统
} else if (
res.id === '52b93b5b105b48bd8679cef6babfb6ba' &&
this.dataForm.type === 'b45827c068254695864ee3c1d42573cb'
) {
//臻通 入侵检测系统
this.brandList.push(res)
} else if (res.id === 'bdc14bb5e54f4c7d98d928c6622004e2' &&
} else if (
res.id === 'bdc14bb5e54f4c7d98d928c6622004e2' &&
this.dataForm.type !== 'b6af764f2a6e454490a6b1b3c9057e57' &&
this.dataForm.type !== 'ece0b8b2db27411886254e81134988a3' &&
this.dataForm.type !== 'f4c840711eae4bcb9536a890cdfda493' &&
this.dataForm.type !== '303310efddb34a2e9bf269bdff8a7dc5' &&
this.dataForm.type !== '683393c31cf0497bb0f62d457cb1e81f' &&
this.dataForm.type !== 'b45827c068254695864ee3c1d42573cb' &&
this.dataForm.type !== 'b45827c068254695864ee3c1d42573cb') {
this.brandList.push(res)//国产
this.dataForm.type !== 'b45827c068254695864ee3c1d42573cb'
) {
this.brandList.push(res) //国产
}
})
// console.log(this.brandList, '==========')
......@@ -559,33 +509,8 @@ export default {
}
})
},
lineChange (lineId) {
this.initStationList(lineId)
this.stationList.forEach(a => {
if (a.id === lineId) {
this.dataForm.lineName = a.name
}
})
},
stationChange (stationId) {
this.stationList.forEach(a => {
if (a.id === stationId) {
this.dataForm.stationName = a.stationName
}
})
},
subSystemChange (e) {
this.systemList.forEach(a => {
if (a.value === e) {
// Vue.set(this.dataForm, 'subCode', a.value)
// Vue.set(this.dataForm, 'subSystem', a.name)
this.dataForm.subCode = a.value
this.dataForm.subSystem = a.name
}
})
},
tierChange (e) {
this.tierList.forEach(a => {
tierChange(e) {
this.tierList.forEach((a) => {
if (a.name === e) {
this.dataForm.tierId = a.id
this.dataForm.tierName = a.name
......@@ -593,16 +518,16 @@ export default {
})
},
// 图标选中
iconChange (icon) {
iconChange(icon) {
// this.icon = icon
// this.dataForm.icon = icon.path
},
checktable () {
checktable() {
this.addVisible = true
this.initStMapList()
this.oldCheckCameraList = JSON.parse(JSON.stringify(this.checkCameraList))
},
checkCamera () {
checkCamera() {
this.addVisible = false
this.dataForm.cameraIds = null
this.dataForm.cameraNames = null
......@@ -617,11 +542,11 @@ export default {
this.dataForm.cameraNames = cameraNames.join(',')
}
},
dialogClose () {
dialogClose() {
this.addVisible = false
this.checkCameraList = JSON.parse(JSON.stringify(this.oldCheckCameraList))
},
closeC () {
closeC() {
this.addVisible = false
this.checkCameraList = JSON.parse(JSON.stringify(this.oldCheckCameraList))
},
......@@ -646,7 +571,7 @@ export default {
// }
// },
//根据层级id查询所有的摄像头
showResourceByMapId () {
showResourceByMapId() {
this.$http({
url: this.$http.adornUrl('/liResource/getStationMapCameraList'),
method: 'post',
......@@ -656,7 +581,7 @@ export default {
tierId: this.dataForm.tierId,
myId: this.dataForm.id
}
}).then(data => {
}).then((data) => {
if (data && data.code === 0) {
this.list = data.resourceList
this.changeVectorLayer(this.list)
......@@ -665,8 +590,15 @@ export default {
oldCheckCameraList.forEach((el) => {
this.list.forEach((k) => {
if (el.id == k.id) {
let style2 = this.getPointStyle(k.imageSrc + '2.png', k.name, 0.3)
this.vectorLayer.getSource().getFeatureById(k.id).setStyle(style2)
let style2 = this.getPointStyle(
k.imageSrc + '2.png',
k.name,
0.3
)
this.vectorLayer
.getSource()
.getFeatureById(k.id)
.setStyle(style2)
}
})
})
......@@ -674,7 +606,7 @@ export default {
}
})
},
getCameraByResourceId () {
getCameraByResourceId() {
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl('/liResourceCamera/getByResourceId'),
......@@ -682,12 +614,15 @@ export default {
params: {
resourceId: this.dataForm.id
}
}).then(data => {
}).then((data) => {
if (data && data.code === 0) {
this.checkCameraList = data.list.map(e => {
this.checkCameraList = data.list.map((e) => {
return { id: e.cameraId, name: e.cameraName }
})
if (this.checkCameraList != null && this.checkCameraList.length > 0) {
if (
this.checkCameraList != null &&
this.checkCameraList.length > 0
) {
var cameraIds = []
var cameraNames = []
for (var i = 0; i < this.checkCameraList.length; i++) {
......@@ -702,17 +637,20 @@ export default {
}
},
// 表单提交
dataFormSubmit (id) {
dataFormSubmit(id) {
// if (this.dataForm.type !== 'b6af764f2a6e454490a6b1b3c9057e57' && this.dataForm.type !== 'ece0b8b2db27411886254e81134988a3') {
// if (this.dataForm.cameraIds === null || this.dataForm.cameraIds === undefined || this.dataForm.cameraIds === '') {
// this.$message.error('关联摄像头不能为空')
// return
// }
// }
if (this.dataForm.type !== 'b6af764f2a6e454490a6b1b3c9057e57' || this.dataForm.subCode !== '04') {
if (
this.dataForm.type !== 'b6af764f2a6e454490a6b1b3c9057e57' ||
this.dataForm.subCode !== '04'
) {
this.dataForm.parentName = null
}
this.$refs['dataForm'].validate(valid => {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(
......@@ -720,7 +658,7 @@ export default {
),
method: 'post',
data: this.dataForm
}).then(data => {
}).then((data) => {
console.log(data)
if (data && data.code === 0) {
this.$message({
......@@ -741,7 +679,7 @@ export default {
})
},
//关闭前
handleClose () {
handleClose() {
this.visible = false
this.$refs.dataForm.resetFields()
}
......@@ -942,8 +880,8 @@ export default {
cursor: pointer;
}
}
.videoMap{
/deep/ .el-dialog__body{
.videoMap {
/deep/ .el-dialog__body {
padding: 0;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment