Merge branch 'dev-yjl' into 'shenzhen-dev'
项目版-人员定位-(点位配置)基站、楼栋 See merge request !54
This commit is contained in:
commit
1b0e9df1e2
@ -3,10 +3,21 @@
|
||||
*/
|
||||
import {post,get} from '../http'
|
||||
|
||||
|
||||
//点位配置-基站页面接口
|
||||
export const addPersonnelLocationnApi = data => post('xmgl/personnelLocationBaseStation/addPersonnelLocationBaseStation', data);//新增人员定位-基站
|
||||
export const deletePersonnelLocationDeleteByIdApi = data => get('xmgl/personnelLocationBaseStation/deleteById', data);//根据id删除人员定位-基站
|
||||
export const getPersonnelLocationBaseStationGetByIdApi = data => get('xmgl/personnelLocationBaseStation/getById', data);//根据id查询人员定位-基站
|
||||
export const editPersonnelLocationBaseStationUpdateApi = data => post('personnelLocationBaseStation/updatePersonnelLocationBaseStation', data);//修改人员定位-基站
|
||||
export const editPersonnelStationUpdateApi = data => post('xmgl/personnelLocationBaseStation/updatePersonnelLocationBaseStation', data);//修改人员定位-基站
|
||||
export const getPersonnelLocationBaseStationListApi = data => get('xmgl/personnelLocationBaseStation/list', data);//所有人员定位-基站
|
||||
export const getPersonnelLocationBaseStationApi = data => get('xmgl/personnelLocationBaseStation/selectPage', data);//分页查询人员定位-基站
|
||||
|
||||
//点位配置-楼栋页面接口
|
||||
export const addBeaconDataApi = data => post('xmgl/personnelLocationBuilding/addBeaconData', data);//新增楼栋信标数据
|
||||
export const addPersonnelLocationBuildingApi = data => post('xmgl/personnelLocationBuilding/addPersonnelLocationBuilding', data);//新增人员定位-楼栋
|
||||
export const deletePersonnelLocationApi = data => get('xmgl/personnelLocationBuilding/deleteById', data);//根据id删除人员定位-楼栋
|
||||
export const getBeaconDataApi = data => get('xmgl/personnelLocationBuilding/getBeaconData', data);//通过id获取信标数据
|
||||
export const getLocationBuildingGetByIdApi = data => get('xmgl/personnelLocationBuilding/getById', data);//根据id查询人员定位-楼栋
|
||||
export const getLocationBuildingApi = data => get('xmgl/personnelLocationBuilding/list', data);//所有人员定位-楼栋
|
||||
export const getLocationBuildingSelectPageApi = data => get('xmgl/personnelLocationBuilding/selectPage', data);//分页查询人员定位-楼栋
|
||||
export const editPersonnelLocationBuildingUpdateApi = data => post('xmgl/personnelLocationBuilding/updatePersonnelLocationBuilding', data);//修改人员定位-楼栋
|
||||
|
||||
|
||||
@ -6,7 +6,12 @@
|
||||
<!-- 基站地图列表 -->
|
||||
<div class="dialog-content map-box">
|
||||
<div class="map-left">
|
||||
<vue-scroll style="800px">
|
||||
<vue-scroll >
|
||||
<div class="add-btn" >
|
||||
<i class="el-icon-circle-plus-outline"></i>
|
||||
<!-- 添加平面图 -->
|
||||
<div class="addText">添加平面图</div>
|
||||
</div>
|
||||
<ul>
|
||||
<li v-for="(item, index) in 4" :key="index">
|
||||
<img src="@/assets/images/login/p5.jpg" />
|
||||
@ -32,26 +37,23 @@
|
||||
</div>
|
||||
|
||||
<div class="team_list whiteBlock flex2">
|
||||
<el-button type="primary" plain icon="el-icon-plus" class="team_addBtn">新增楼栋</el-button>
|
||||
<div class="flex2 list_wrap" :class="showTeamList ? 'show_teamList' : 'height_79'">
|
||||
<div class="list" :class="checkedTeamId == 0 && 'checkedTeam'">
|
||||
<div>全部楼栋</div>
|
||||
<div style="margin:4px 0">4</div>
|
||||
<el-button type="primary" plain icon="el-icon-plus" class="team_addBtn" @click="addBuildBtn">新增楼栋</el-button>
|
||||
<div class="flex2 list_wrap">
|
||||
<!-- <div class="list" :class="checkedTeamId == 0 && 'checkedTeam'">
|
||||
<div>全部基站</div>
|
||||
<div style="margin:4px 0">{{baseList.}}</div>
|
||||
<i class="el-icon-arrow-down" style="font-size:17px"></i>
|
||||
</div>
|
||||
<div class="list">
|
||||
<el-popover placement="top" min-width="80" trigger="hover">
|
||||
1
|
||||
<div slot="reference">楼栋1</div>
|
||||
</el-popover>
|
||||
<div style="margin:4px 0">1</div>
|
||||
</div> -->
|
||||
<div class="list" v-for="item in bulidList" :key="item.id">
|
||||
<div slot="reference">{{ item.name }}</div>
|
||||
<!-- <div style="margin:4px 0">1</div> -->
|
||||
<el-popover placement="bottom" min-width="80" trigger="hover">
|
||||
<div style=" margin: 0; text-align:center;">
|
||||
<div style=" cursor: pointer; margin-bottom:5px">
|
||||
<div style=" cursor: pointer; margin-bottom:5px" @click="editBuild(item)">
|
||||
<img src="@/assets/images/icon-edit.png" style="margin-right:5px" />
|
||||
<span>编辑</span>
|
||||
</div>
|
||||
<div style="cursor: pointer;">
|
||||
<div style="cursor: pointer;" @click="deletBuild(item)">
|
||||
<img src="@/assets/images/icon-delete.png" style="margin-right:5px" />
|
||||
<span>删除</span>
|
||||
</div>
|
||||
@ -62,7 +64,7 @@
|
||||
</el-popover>
|
||||
</div>
|
||||
</div>
|
||||
<i class="el-icon-more-outline" style="font-size: 26px;cursor: pointer;color: #999;"></i>
|
||||
<!-- <i class="el-icon-more-outline" style="font-size: 26px;cursor: pointer;color: #999;"></i> -->
|
||||
</div>
|
||||
<div class="baseShow whiteBlock ">
|
||||
<!-- 右边展示 -->
|
||||
@ -95,10 +97,40 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 新增楼栋弹窗 -->
|
||||
<el-dialog
|
||||
:modal-append-to-body="false"
|
||||
:title="teamDialogTitle"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="addBuildDialog"
|
||||
width="740px"
|
||||
>
|
||||
<div class="dialog_content">
|
||||
<el-form size="small" ref="bulidForm" :model="bulidForm" :rules="buildFormRules">
|
||||
<el-form-item label="楼栋名称" prop="name">
|
||||
<el-input v-model="bulidForm.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="dialog-footer">
|
||||
<el-button class="cancleBtn" @click="addBuildDialog = false" icon="el-icon-circle-close" size="medium">取消</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-check" size="medium" @click="saveBatchMove">确定 </el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
addBeaconDataApi,
|
||||
addPersonnelLocationBuildingApi,
|
||||
deletePersonnelLocationApi,
|
||||
getBeaconDataApi,
|
||||
getLocationBuildingGetByIdApi,
|
||||
getLocationBuildingApi,
|
||||
getLocationBuildingSelectPageApi,
|
||||
editPersonnelLocationBuildingUpdateApi
|
||||
} from '@/assets/js/api/personnelPositioning.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -112,16 +144,108 @@ export default {
|
||||
imgZoom: 1,
|
||||
isEditPoint: false,
|
||||
activeImgUrl: '',
|
||||
|
||||
checkedTeamId: 0 //选中的班组id
|
||||
checkedTeamId: 0, //选中的班组id
|
||||
//------------
|
||||
projectSn: '', //项目Sn
|
||||
teamDialogTitle: '', //新增/编辑弹框title
|
||||
addBuildDialog: false, // 新增/编辑楼栋 弹窗
|
||||
bulidList: [], //楼栋列表
|
||||
bulidForm: {
|
||||
name: '', //楼栋名称
|
||||
projectSn: ''
|
||||
},
|
||||
buildFormRules: {
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入楼栋名称',
|
||||
trigger: 'change'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.projectSn = this.$store.state.projectSn
|
||||
this.getPersonnelLocationBuild()
|
||||
this.imgGet()
|
||||
},
|
||||
mounted() {},
|
||||
computed: {},
|
||||
methods: {
|
||||
//获取所有楼栋信息
|
||||
getPersonnelLocationBuild() {
|
||||
getLocationBuildingApi({ projectSn: this.$store.state.projectSn }).then(res => {
|
||||
console.log('楼栋信息列表', res)
|
||||
this.bulidList = res.result
|
||||
})
|
||||
},
|
||||
//新增楼栋按钮
|
||||
addBuildBtn() {
|
||||
this.teamDialogTitle = '新增楼栋'
|
||||
this.addBuildDialog = true
|
||||
this.bulidForm = {
|
||||
name: '', //楼栋名称
|
||||
projectSn: ''
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.$refs.bulidForm.clearValidate()
|
||||
}, 120)
|
||||
},
|
||||
|
||||
//编辑楼栋按钮
|
||||
editBuild(item) {
|
||||
this.teamDialogTitle = '编辑楼栋'
|
||||
this.addBuildDialog = true
|
||||
this.bulidForm = JSON.parse(JSON.stringify(item))
|
||||
},
|
||||
//新增/编辑楼栋确认提交
|
||||
saveBatchMove() {
|
||||
this.$refs.bulidForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.bulidForm.projectSn = this.projectSn
|
||||
if (this.teamDialogTitle == '新增楼栋') {
|
||||
addPersonnelLocationBuildingApi(this.bulidForm).then(res => {
|
||||
console.log('新增楼栋', res)
|
||||
this.$message.success(res.message)
|
||||
this.addBuildDialog = false
|
||||
this.getPersonnelLocationBuild()
|
||||
})
|
||||
} else if (this.teamDialogTitle == '编辑楼栋') {
|
||||
editPersonnelLocationBuildingUpdateApi(this.bulidForm).then(res => {
|
||||
this.$message.success(res.message)
|
||||
this.addBuildDialog = false
|
||||
this.getPersonnelLocationBuild()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//删除楼栋
|
||||
deletBuild(item){
|
||||
this.$confirm('此操作将永久删除, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
deletePersonnelLocationApi({ id: item.id }).then(res => {
|
||||
this.getPersonnelLocationBuild()
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
})
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
imgGet() {
|
||||
this.activeImgUrl = '@/assets/images/login/p5.jpg'
|
||||
}
|
||||
@ -159,8 +283,41 @@ export default {
|
||||
position: absolute;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .right2 .team_list .list_wrap {
|
||||
margin-top: 12px;
|
||||
}
|
||||
::v-deep .right2 .team_list .list_wrap .list div {
|
||||
padding: 6px 5px;
|
||||
}
|
||||
//----------分割
|
||||
.add-btn {
|
||||
width: 285px;
|
||||
height: 120px;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 19px;
|
||||
margin-left: 33px;
|
||||
background-color: skyblue;
|
||||
::v-deep .el-button {
|
||||
background: rgba(#5181f6, 0.1);
|
||||
border: 0;
|
||||
color: #262d48;
|
||||
width: 280px;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
padding: 0;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
.el-icon-circle-plus-outline {
|
||||
color: #5181f6;
|
||||
}
|
||||
}
|
||||
.addText{
|
||||
line-height: 60px;
|
||||
}
|
||||
.el-icon-circle-plus-outline{
|
||||
line-height: 70px;
|
||||
}
|
||||
}
|
||||
.map-right {
|
||||
// flex: 1;
|
||||
width: calc(98%);
|
||||
|
||||
@ -35,24 +35,21 @@
|
||||
<div class="team_list whiteBlock flex2">
|
||||
<el-button type="primary" plain icon="el-icon-plus" class="team_addBtn" @click="addBaseBtn">新增基站</el-button>
|
||||
<div class="flex2 list_wrap">
|
||||
<div class="list" :class="checkedTeamId == 0 && 'checkedTeam'">
|
||||
<!-- <div class="list" :class="checkedTeamId == 0 && 'checkedTeam'">
|
||||
<div>全部基站</div>
|
||||
<div style="margin:4px 0">4</div>
|
||||
<div style="margin:4px 0">{{baseList.}}</div>
|
||||
<i class="el-icon-arrow-down" style="font-size:17px"></i>
|
||||
</div>
|
||||
<div class="list">
|
||||
<el-popover placement="top" min-width="80" trigger="hover">
|
||||
1
|
||||
<div slot="reference">基站1</div>
|
||||
</el-popover>
|
||||
<div style="margin:4px 0">1</div>
|
||||
</div> -->
|
||||
<div class="list" v-for="item in baseList" :key="item.id">
|
||||
<div slot="reference">{{ item.name }}</div>
|
||||
<!-- <div style="margin:4px 0">1</div> -->
|
||||
<el-popover placement="bottom" min-width="80" trigger="hover">
|
||||
<div style=" margin: 0; text-align:center;">
|
||||
<div style=" cursor: pointer; margin-bottom:5px">
|
||||
<div style=" cursor: pointer; margin-bottom:5px" @click="editBase(item)">
|
||||
<img src="@/assets/images/icon-edit.png" style="margin-right:5px" />
|
||||
<span>编辑</span>
|
||||
</div>
|
||||
<div style="cursor: pointer;">
|
||||
<div style="cursor: pointer;" @click="deletBase(item)">
|
||||
<img src="@/assets/images/icon-delete.png" style="margin-right:5px" />
|
||||
<span>删除</span>
|
||||
</div>
|
||||
@ -63,7 +60,7 @@
|
||||
</el-popover>
|
||||
</div>
|
||||
</div>
|
||||
<i class="el-icon-more-outline" style="font-size: 26px;cursor: pointer;color: #999;"></i>
|
||||
<!-- <i class="el-icon-more-outline" style="font-size: 26px;cursor: pointer;color: #999;"></i> -->
|
||||
</div>
|
||||
<div class="baseShow whiteBlock ">
|
||||
<!-- 右边展示 -->
|
||||
@ -114,15 +111,15 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="设备状态" prop="deviceState">
|
||||
<el-select v-model="baseForm.deviceState" style="width: 100%">
|
||||
<el-option label="在线" value="在线"></el-option>
|
||||
<el-option label="离线" value="离线"></el-option>
|
||||
<el-option label="在线" value="1"></el-option>
|
||||
<el-option label="离线" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="基站类型" prop="locationType">
|
||||
<el-select v-model="baseForm.locationType" style="width: 100%">
|
||||
<el-option label="外置" value="外置"></el-option>
|
||||
<el-option label="内置" value="内置"></el-option>
|
||||
<el-option label="无" value="无"></el-option>
|
||||
<el-option label="外置" value="1"></el-option>
|
||||
<el-option label="内置" value="2"></el-option>
|
||||
<el-option label="无" value="3"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="范围设置" prop="range">
|
||||
@ -130,14 +127,14 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="关联基站" prop="relationStationId">
|
||||
<el-select v-model="baseForm.relationStationId" style="width: 100%">
|
||||
<el-option label="基站" value="基站"></el-option>
|
||||
<!-- <el-option v-for="item in associatedBase " :key="item.id" :label="item.relationStationId" :value="item.id"></el-option> -->
|
||||
<!-- <el-option label="基站" value="1"></el-option> -->
|
||||
<el-option v-for="item in relationIdList" :key="item.id" :label="item.relationStationId" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关联楼栋" prop="buildingId">
|
||||
<el-select v-model="baseForm.buildingId" style="width: 100%">
|
||||
<el-option label="楼栋" value="楼栋"></el-option>
|
||||
<!-- <el-option v-for="item in associatedBase " :key="item.id" :label="item.buildingId" :value="item.id"></el-option> -->
|
||||
<!-- <el-option label="楼栋" value="1"></el-option> -->
|
||||
<el-option v-for="item in buildingIdList" :key="item.id" :label="item.buildingId" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -155,7 +152,7 @@ import {
|
||||
addPersonnelLocationnApi,
|
||||
deletePersonnelLocationDeleteByIdApi,
|
||||
getPersonnelLocationBaseStationGetByIdApi,
|
||||
editPersonnelLocationBaseStationUpdateApi,
|
||||
editPersonnelStationUpdateApi,
|
||||
getPersonnelLocationBaseStationListApi,
|
||||
getPersonnelLocationBaseStationApi
|
||||
} from '@/assets/js/api/personnelPositioning.js'
|
||||
@ -176,16 +173,18 @@ export default {
|
||||
// --------
|
||||
projectSn: '', //项目Sn
|
||||
teamDialogTitle: '', //新增/编辑弹框title
|
||||
addBaseDialog: false, // 新增基站 弹窗
|
||||
associatedBase: [], //关联基站/楼栋下拉
|
||||
addBaseDialog: false, // 新增/编辑基站 弹窗
|
||||
baseList: [], //基站列表
|
||||
relationIdList: [], //关联基站
|
||||
buildingIdList: [], //关联楼栋
|
||||
baseForm: {
|
||||
name: '', //基站名称
|
||||
baseStationSn: '', //基站编号
|
||||
deviceState: '', //设备状态,1在线,2离线
|
||||
locationType: '', // 基站类型 1:外 2:内 3:无
|
||||
range: '', //范围设置 米数 单位:m
|
||||
relationStationId: '', //关联基站id
|
||||
buildingId: '', //关联楼栋id
|
||||
deviceState: 0, //设备状态,1在线,2离线
|
||||
locationType: 0, // 基站类型 1:外 2:内 3:无
|
||||
range: 0, //范围设置 米数 单位:m
|
||||
relationStationId: 0, //关联基站id
|
||||
buildingId: 0, //关联楼栋id
|
||||
projectSn: ''
|
||||
},
|
||||
baseFormRules: {
|
||||
@ -249,13 +248,14 @@ export default {
|
||||
mounted() {},
|
||||
computed: {},
|
||||
methods: {
|
||||
//查询人员定位基站
|
||||
async getPersonnelLocationBase() {
|
||||
let data = await getPersonnelLocationBaseStationListApi(this.baseForm)
|
||||
console.log('人员定位列表', data)
|
||||
if ((res.code = 200)) {
|
||||
this.associatedBase = data.result
|
||||
}
|
||||
//获取人员定位基站
|
||||
getPersonnelLocationBase() {
|
||||
getPersonnelLocationBaseStationListApi({ projectSn: this.$store.state.projectSn }).then(res => {
|
||||
console.log('基站列表111', res)
|
||||
this.baseList = res.result
|
||||
this.relationIdList = res.result
|
||||
this.buildingIdList = res.result
|
||||
})
|
||||
},
|
||||
//新增基站按钮
|
||||
addBaseBtn() {
|
||||
@ -274,24 +274,59 @@ export default {
|
||||
this.$refs.baseForm.clearValidate()
|
||||
}, 120)
|
||||
},
|
||||
//新增基站确认提交
|
||||
//编辑基站按钮
|
||||
editBase(item) {
|
||||
this.addBaseDialog = true
|
||||
this.teamDialogTitle = '编辑基站'
|
||||
this.baseForm = JSON.parse(JSON.stringify(item))
|
||||
},
|
||||
//新增/编辑基站确认提交
|
||||
saveBatchMove() {
|
||||
this.$refs.baseForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.baseForm.projectSn = this.projectSn
|
||||
// let json=JSON.parse(JSON.stringify(this.baseForm))
|
||||
if ((this.teamDialogTitle = '新增基站')) {
|
||||
if (this.teamDialogTitle == '新增基站') {
|
||||
addPersonnelLocationnApi(this.baseForm).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$message.success(res.message)
|
||||
this.addBaseDialog = false
|
||||
this.getPersonnelLocationBase()
|
||||
}
|
||||
console.log('新增基站', res)
|
||||
this.$message.success(res.message)
|
||||
this.addBaseDialog = false
|
||||
this.getPersonnelLocationBase()
|
||||
})
|
||||
}else if( this.teamDialogTitle == '编辑基站'){
|
||||
console.log('编辑进来了吗');
|
||||
editPersonnelStationUpdateApi(this.baseForm).then((res)=>{
|
||||
this.$message.success(res.message)
|
||||
this.addBaseDialog = false
|
||||
this.getPersonnelLocationBase()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//删除基站
|
||||
deletBase(item) {
|
||||
this.$confirm('此操作将永久删除, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
deletePersonnelLocationDeleteByIdApi({ id: item.id }).then(res => {
|
||||
this.getPersonnelLocationBase()
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
})
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
//测试图片
|
||||
imgGet() {
|
||||
this.activeImgUrl = '@/assets/images/login/p5.jpg'
|
||||
@ -334,6 +369,9 @@ export default {
|
||||
::v-deep .right2 .team_list .list_wrap {
|
||||
margin-top: 12px;
|
||||
}
|
||||
::v-deep .right2 .team_list .list_wrap .list div {
|
||||
padding: 6px 5px;
|
||||
}
|
||||
|
||||
//----------分割
|
||||
.map-right {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user