Commit 1b66f9bf authored by co_dengxiongwen's avatar co_dengxiongwen

tj

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