Compare commits

...

22 Commits

Author SHA1 Message Date
liujun f667d9e206 一公司人员定位bug修复。 2024-04-17 18:31:54 +08:00
liujun 8a9fa7a548 Merge remote-tracking branch 'origin/liujun-2024-04-12-一公司人员定位' into pet 2024-04-17 18:16:54 +08:00
liujun 06672de43b 一公司人员定位地图功能完善 2024-04-17 08:57:43 +08:00
liujun f50fdae435 一公司人员定位地图功能完善 2024-04-16 17:22:43 +08:00
LiuJiaNan c912472911 人员轨迹、报警信息 2024-04-16 16:25:19 +08:00
liujun 35500daad3 一公司人员定位地图功能完善 2024-04-16 16:09:16 +08:00
liujun 384b1e27b7 查询bug修复 2024-04-13 17:11:13 +08:00
limingyu 830e2d2f48 一公司人员定位 报警列表3 2024-04-13 16:48:21 +08:00
limingyu ffc9dcf5fe 一公司人员定位 报警列表2 2024-04-13 16:22:26 +08:00
limingyu b5aaa3d6d1 Merge remote-tracking branch 'origin/liujun-2024-04-12-一公司人员定位' into liujun-2024-04-12-一公司人员定位 2024-04-13 16:21:58 +08:00
liujun 3d03d27b90 映射保存功能 2024-04-13 16:12:37 +08:00
liujun 83714b2115 映射保存功能 2024-04-13 15:16:58 +08:00
limingyu 12195ddd0b Merge remote-tracking branch 'origin/liujun-2024-04-12-一公司人员定位' into liujun-2024-04-12-一公司人员定位 2024-04-13 14:47:25 +08:00
liujun 5b145195c8 未分页bug修复 2024-04-13 14:44:16 +08:00
liujun 03a1881fa6 返回正确状态码 2024-04-13 12:40:04 +08:00
liujun 419c30bc45 添加分页功能 2024-04-13 12:33:30 +08:00
limingyu e2b3dbd5ef 一公司人员定位 报警列表 2024-04-13 11:12:25 +08:00
liujun 6a802fc163 添加分页功能 2024-04-13 10:59:29 +08:00
liujun df67a534da 删除无用代码 2024-04-13 10:45:56 +08:00
liujun ac31e38b1a 人员定位新模块 2024-04-13 10:27:29 +08:00
liujun 0d4a5a36bf 人员定位新模块 2024-04-13 10:09:00 +08:00
liujun 07e27d1bfb 人员定位新模块 2024-04-13 10:01:11 +08:00
9 changed files with 975 additions and 45 deletions

View File

@ -25,4 +25,7 @@ export default {
font-size: 14px !important; font-size: 14px !important;
font-weight: 500; font-weight: 500;
} }
.el-loading-mask{
z-index: 9999 !important;
}
</style> </style>

View File

@ -49,7 +49,7 @@
<!--曹妃甸东 八项作业 曹实业详细页面 end--> <!--曹妃甸东 八项作业 曹实业详细页面 end-->
<peoplePositionNine v-if="type === 'peoplePositionNine'" :id="id" :type="type" :infoname="infoname"/> <peoplePositionNine v-if="type === 'peoplePositionNine'" :id="id" :type="type" :infoname="infoname"/>
<peoplePositionOne v-if="type === 'peoplePositionOne' && corpInfoId !== '035958e685cf4850bc40151c5e0617a6'" :id="id" :type="type" /> <peoplePositionOne v-if="type === 'peoplePositionOne' && corpInfoId !== '035958e685cf4850bc40151c5e0617a6'" :id="id" :type="type" />
<peoplePositionYGS v-if="type === 'peoplePositionOne' && corpInfoId === '035958e685cf4850bc40151c5e0617a6'" :id="id" :type="type" /> <peoplePositionYGS v-if="type === 'peoplePositionOne' && corpInfoId === '035958e685cf4850bc40151c5e0617a6'" :id="id" :type="type" corp-id="035958e685cf4850bc40151c5e0617a6" />
<!-- 重点工程 start --> <!-- 重点工程 start -->
<outSourceInfo v-if="type === 'PROJECT'" :id="id" :type="type" /> <outSourceInfo v-if="type === 'PROJECT'" :id="id" :type="type" />
<outSourceVideoInfo v-if="type === 'VIDEO'" :id="id" :type="type" /> <outSourceVideoInfo v-if="type === 'VIDEO'" :id="id" :type="type" />

View File

@ -1052,6 +1052,7 @@ export default {
}, },
subscription: { subscription: {
topic: '+/UwbBQ/+/prop', topic: '+/UwbBQ/+/prop',
topic1: '+/+/+/alarm',
qos: 0 qos: 0
}, },
@ -1072,7 +1073,8 @@ export default {
CORP_INFO_ID: '', CORP_INFO_ID: '',
longitude: '', longitude: '',
latitude: '' latitude: ''
} },
trajectoryEntityCollection: {}
} }
}, },
mounted() { mounted() {
@ -1183,6 +1185,58 @@ export default {
this.closeBubbles() this.closeBubbles()
} }
}, Cesium.ScreenSpaceEventType.LEFT_CLICK) }, Cesium.ScreenSpaceEventType.LEFT_CLICK)
viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_DOUBLE_CLICK)
viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK)
document.addEventListener('contextmenu', function(event) {
event.preventDefault()
})
this.handler.setInputAction(movement => {
const pick = viewer.scene.pick(movement.position)
if (Cesium.defined(pick) && (pick.id.id)) {
if (!pick.id._monitoItems) {
this.removeTrajectory()
return
}
const point_type = pick.id._monitoItems.data.point_type
const point_id = pick.id._monitoItems.data.id
const corpInfoId = pick.id._monitoItems.data.corpInfoId
if (point_type === '标记点peoplePositionOne') {
this.removeTrajectory()
this.addTrajectory(point_id, corpInfoId)
}
} else {
this.removeTrajectory()
}
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK)
},
addTrajectory(point_id, corpInfoId) {
requestFN(
'/map/getPersonTrace',
{
id: point_id,
corpId: corpInfoId
}
).then((data) => {
if (data.list) {
const positions = []
for (let i = 0; i < data.list.length; i++) {
positions.push(Cesium.Cartesian3.fromDegrees(data.list[i].XAxis, data.list[i].YAxis))
}
const entity = new Cesium.Entity({
id: 'trajectory',
polyline: { positions, width: 5.0, material: Cesium.Color.RED }
})
const collection = new Cesium.CustomDataSource('trajectoryEntityCollection')
collection.entities.add(entity)
viewer.dataSources.add(collection)
this.trajectoryEntityCollection = collection
}
})
},
removeTrajectory() {
if (Object.keys(this.trajectoryEntityCollection).length === 0) return
viewer.dataSources.remove(this.trajectoryEntityCollection)
this.trajectoryEntityCollection = {}
}, },
getCatesian3FromPX: function(px) { getCatesian3FromPX: function(px) {
@ -1520,6 +1574,7 @@ export default {
this.destroyConnection() this.destroyConnection()
this.clearAllBottomOptionsItemsCheck() this.clearAllBottomOptionsItemsCheck()
this.clearAllBottomOptionsItemsEntityCollection() this.clearAllBottomOptionsItemsEntityCollection()
this.removeTrajectory()
this.onePerLocArr = [] this.onePerLocArr = []
this.perLocArr = [] this.perLocArr = []
this.clearMqttPoint() this.clearMqttPoint()
@ -1562,6 +1617,7 @@ export default {
this.addBranchPoint() this.addBranchPoint()
this.clearAllBottomOptionsItemsCheck() this.clearAllBottomOptionsItemsCheck()
this.clearAllBottomOptionsItemsEntityCollection() this.clearAllBottomOptionsItemsEntityCollection()
this.removeTrajectory()
}, },
bottomOptionsClick(index) { bottomOptionsClick(index) {
if (this.bottomClickDisable) return if (this.bottomClickDisable) return
@ -1631,6 +1687,7 @@ export default {
} else if (this.CORP_INFO_ID) { } else if (this.CORP_INFO_ID) {
this.CORP_INFO_ID = '' this.CORP_INFO_ID = ''
this.clearAllBottomOptionsItemsEntityCollection() this.clearAllBottomOptionsItemsEntityCollection()
this.removeTrajectory()
this.dragAreaEntity(this.branchPoint) this.dragAreaEntity(this.branchPoint)
this.toCenter(this.parentCenter) this.toCenter(this.parentCenter)
this.destroyConnection() this.destroyConnection()
@ -1675,7 +1732,8 @@ export default {
} }
if (this.gangkouActive === '00003' && this.CORP_INFO_ID === '035958e685cf4850bc40151c5e0617a6' && urlType === 'peoplePosition') { if (this.gangkouActive === '00003' && this.CORP_INFO_ID === '035958e685cf4850bc40151c5e0617a6' && urlType === 'peoplePosition') {
this.doUnSubscribe() this.doUnSubscribe()
this.clearMqttPoint('1698584148364034050/UwbBQ/') this.clearMqttPoint('+/UwbBQ/')
this.removeTrajectory()
} }
this.bottomOptionsList[pindex].list[index].check = false this.bottomOptionsList[pindex].list[index].check = false
if (this.gangkouActive === '00004') { if (this.gangkouActive === '00004') {
@ -1997,48 +2055,58 @@ export default {
}, },
mqttMessage(CORP_INFO_ID) { mqttMessage(CORP_INFO_ID) {
this.client.on('message', (topic, message) => { this.client.on('message', (topic, message) => {
if (topic.indexOf('UwbBQ') !== -1 && topic.indexOf('prop') !== -1) {
// created by liu jun mqtt // created by liu jun mqtt
let peopleList = JSON.parse(message) let peopleList = JSON.parse(message)
if (!Array.isArray(peopleList)) { if (!Array.isArray(peopleList)) {
peopleList = [peopleList] peopleList = [peopleList]
}
for (let i = 0; i < peopleList.length; i++) {
const item = peopleList[i]
//
// UwbBQidUwbJiZhanid
if (item.productKey !== 'UwbBQ') {
continue
} }
// for (let i = 0; i < peopleList.length; i++) {
const index = this.onePerLocArr.findIndex(item1 => { const item = peopleList[i]
return item1.id.toString() === item.deviceCode.toString() //
}) // UwbBQidUwbJiZhanid
const x = item.properties[2].value if (item.productKey !== 'UwbBQ') {
const y = item.properties[3].value continue
const pointColor = this.isPointxyWithinTheArea(this.pointBox, x, y) }
if (index !== -1) { //
this.onePerLocArr[index].x = x const index = this.onePerLocArr.findIndex(item1 => {
this.onePerLocArr[index].y = y return item1.id.toString() === item.deviceCode.toString()
this.onePerLocArr[index].icon_type = 'img4_0' + pointColor })
ry_drag.getPosition(this.onePerLocArr[index]) const x = item.properties[2].value
} else { const y = item.properties[3].value
// const id = '4_0_' +item.deviceCode const pointColor = this.isPointxyWithinTheArea(this.pointBox, x, y)
const perLoc = { if (index !== -1) {
id: item.deviceCode, this.onePerLocArr[index].x = x
// name: item.realName, this.onePerLocArr[index].y = y
x: x, this.onePerLocArr[index].icon_type = 'img4_0' + pointColor
y: y, ry_drag.getPosition(this.onePerLocArr[index])
icon_type: 'img4_0' + pointColor, } else {
// infoname: item.realName, // const id = '4_0_' +item.deviceCode
data_id: item.deviceCode, const perLoc = {
point_type: '标记点peoplePositionOne', id: item.deviceCode,
label: '人员定位', // name: item.realName,
corpInfoId: CORP_INFO_ID x: x,
y: y,
icon_type: 'img4_0' + pointColor,
// infoname: item.realName,
data_id: item.deviceCode,
point_type: '标记点peoplePositionOne',
label: '人员定位',
corpInfoId: CORP_INFO_ID
}
this.onePerLocArr.push(perLoc)
ry_drag.addEntity(perLoc)
this.mqttPoint[this.subscription.topic.substring(0, this.subscription.topic.lastIndexOf('+')) + item.deviceCode] = item.deviceCode
} }
this.onePerLocArr.push(perLoc)
ry_drag.addEntity(perLoc)
this.mqttPoint[this.subscription.topic.substring(0, this.subscription.topic.lastIndexOf('+')) + item.deviceCode] = item.deviceCode
} }
} else if (topic.indexOf('alarm') !== -1) {
const formatMessage = JSON.parse(message)
this.$notify({
title: '报警信息',
dangerouslyUseHTMLString: true,
message: `部门:${formatMessage.deptName}<br/>类型:${formatMessage.identifierName}`,
type: 'error'
})
} }
}) })
}, },
@ -2052,8 +2120,8 @@ export default {
}, },
// //
doSubscribe() { doSubscribe() {
const { topic, qos } = this.subscription const { topic, topic1, qos } = this.subscription
this.client.subscribe(topic, { qos }, (error, res) => { this.client.subscribe([topic, topic1], { qos }, (error, res) => {
if (error) { if (error) {
console.log('Subscribe to topics error', error) console.log('Subscribe to topics error', error)
return return
@ -2064,8 +2132,8 @@ export default {
}, },
// //
doUnSubscribe() { doUnSubscribe() {
const { topic } = this.subscription const { topic, topic1 } = this.subscription
this.client.unsubscribe(topic, error => { this.client.unsubscribe([topic, topic1], error => {
if (error) { if (error) {
console.log('Subscribe to topics error', error) console.log('Subscribe to topics error', error)
} }

View File

@ -0,0 +1,240 @@
<template>
<div class="app-container">
<el-form ref="searchForm" :model="searchForm" label-width="80px">
<el-row>
<el-col :span="4">
<el-form-item label="报警状态" prop="status">
<el-select v-model="searchForm.status" style="width: 100%;">
<el-option v-for="item in alarmStatusList" :key="item.value" :value="item.value" :label="item.name"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4" label-width="10px" style="margin-left: 20px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getList">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="resetSearchForm">
重置
</el-button>
</el-col>
</el-row>
</el-form>
<el-table v-loading="listLoading" ref="multipleTable" :data="varList" :row-key="getRowKey" :header-cell-style="{'font-weight': 'bold','color': '#000'}" tooltip-effect="dark" border fit highlight-current-row>
<el-table-column :reserve-selection="true" type="selection" width="55" align="center" />
<el-table-column fixed="left" type="index" label="序号" width="50" align="center" />
<el-table-column prop="alarmName" label="报警名称" width="100"/>
<el-table-column prop="alarmMessage" label="报警信息" />
<el-table-column prop="relatedFunctions" label="相关功能" />
<el-table-column prop="typeName" label="类型名称" />
<el-table-column prop="message" label="报警信息" width="200"/>
<!-- <el-table-column prop="id" label="其他系统id" width="200"/>-->
<el-table-column prop="idRemak" label="其他系统备注" />
<el-table-column prop="remark" label="备注" />
<el-table-column prop="corpName" label="企业名称" width="150"/>
<el-table-column prop="departmentName" label="部门名称" />
<el-table-column prop="equipmentName" label="报警来源" width="100"/>
<el-table-column prop="createdTime" label="创建时间" width="150"/>
<el-table-column prop="level" label="报警等级" />
<el-table-column prop="address" label="报警地址" />
<el-table-column prop="statusName" label="状态名称" />
<el-table-column prop="opinion" label="处理意见" width="200"/>
<el-table-column fixed="right" label="操作" align="center" width="200">
<template slot-scope="{row}">
<el-button v-if="row.status == null || row.status == '0'" icon="el-icon-view" type="danger" size="mini" @click="goInfo(row.dwAlarmId,'ignore')"></el-button>
<el-button v-if="row.status == null || row.status == '0'" icon="el-icon-view" type="primary" size="mini" @click="goInfo(row.dwAlarmId,'confirm')"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<!-- <el-button v-show="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>-->
<!-- <el-button v-show="del" type="danger" icon="el-icon-delete" plain @click="batchDel"></el-button>-->
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<el-dialog :visible.sync="dialogManageAlarm" :title="dialogType === 'ignore' ? '忽略报警' : '确认报警'" width="650px">
<el-form ref="form" :model="manageAlarmForm" :rules="manageAlarmRules" label-width="110px" style="width: 500px;">
<el-form-item label="处理意见" prop="opinion">
<el-input v-model="manageAlarmForm.opinion" :rows="4" type="textarea" placeholder="这里输入处理意见..." />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="closeManageAlarm()"> </el-button>
<el-button type="primary" @click="manageAlarm()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 20
},
total: 0,
KEYWORDS: '',
varList: [],
pd: [],
multipleSelectionAll: [], //
multipleSelection: [], //
treeData: [], //
dialogType: 'ignore',
replyListQuery: {
page: 1,
limit: 20
},
defaultProps: {
value: 'id',
children: 'nodes',
label: 'name'
},
loginUserID: '',
loginRoleNumber: JSON.parse(sessionStorage.getItem('user')).RNUMBER,
dialogManageAlarm: false,
manageAlarmForm: {
opinion: '', //
DW_ALARM_ID: '',
status: ''
},
manageAlarmRules: {
opinion: [{ required: true, message: '处理意见不能为空', trigger: 'blur' }]
},
searchForm: {
status: ''
},
alarmStatusList: []
}
},
created() {
this.getList()
this.getEditMyInfo()
this.getDictTreeData()
this.getDictionary()
},
methods: {
getRowKey(row) {
return row.dwAlarmId
},
//
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
//
getEditMyInfo() {
requestFN(
'/user/goEditMyInfo',
{}
).then((data) => {
this.loginUserID = data.pd.USER_ID // ID
}).catch((e) => {
})
},
resetSearchForm() {
this.searchForm = {
status: ''
}
this.getList()
},
//
getList() {
this.listLoading = true
requestFN(
'/dingWei/getAlarmList?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
status: this.searchForm.status
}
).then((data) => {
this.listLoading = false
this.varList = data.list
this.total = data.page.total
}).catch((e) => {
this.listLoading = false
})
},
getDictionary() {
requestFN(
'/dingWei/getDictionary',
{}
).then((data) => {
if (data.code === 200) {
var alarmStatusList = JSON.parse(data.AlarmStatus)
this.alarmStatusList = alarmStatusList
}
}).catch((e) => {
})
},
goInfo(id, type) {
this.dialogManageAlarm = true
this.dialogType = type
this.manageAlarmForm.DW_ALARM_ID = id
if (type === 'ignore') {
this.manageAlarmForm.status = '2'
} else {
this.manageAlarmForm.status = '1'
}
},
manageAlarm() {
this.$refs.form.validate(valid => {
if (valid) {
this.listLoading = true
requestFN(
'/dingWei/manageAlarm',
this.manageAlarmForm
).then((data) => {
if (data.code === 200) {
this.closeManageAlarm()
this.getList()
this.$message({
message: '操作成功',
type: 'success'
})
} else {
this.$message.error(data.message)
}
})
}
})
},
closeManageAlarm() {
this.dialogManageAlarm = false
this.resetForm()
},
resetForm() {
this.manageAlarmForm = {
opinion: '', //
DW_ALARM_ID: '',
status: ''
}
},
getDictTreeData() {
return new Promise((resolve) => {
requestFN(
'/department/listTreeCorpDept',
{}
).then((data) => {
this.treeData = this.listTransTree(JSON.parse(data.zTreeNodes), 'id', 'pId', 'nodes')
resolve('ok')
}).catch((e) => {
})
})
}
}
}
</script>

View File

@ -0,0 +1,29 @@
<template>
<div>
<List v-show="activeName=='List'" ref="list" />
</div>
</template>
<script>
import List from './components/list'
export default {
components: {
List: List
},
data() {
return {
activeName: 'List'
}
},
watch: {
activeName(val) {
if (val == 'List') {
this.$refs.list.getList()
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,372 @@
<template>
<div>
<el-dialog
:visible.sync="visible"
:append-to-body="appendToBody"
:before-close="beforeClose"
title="审批"
width="1200px"
destroy-on-close>
<el-form ref="form" :model="material" :rules="rules" label-width="200px" label-position="right" type="flex">
<el-row :gutter="12">
<el-col :span="12">
<el-form-item prop="typeInfo" label="映射类型: ">
<el-select v-model="material.typeInfo" filterable style="width:300px" placeholder="请选择" @change="saveInfo">
<el-option v-for="item in dic.mapType" :key="item.value" :label="item.name" :value="JSON.stringify(item)"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注:" prop="remark">
<el-input v-model="material.remark" style="width: 300px" placeholder="请输入内容"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-col :span="12">
<el-form-item label="负责部门:" prop="departmentId" style="width:300px">
<Treeselect
:options="dic.deptList"
:normalizer="normalizer"
v-model="material.departmentId"
placeholder="请选择部门"
no-options-text="暂无数据"
no-children-text="暂无数据"
style="width: 300px"
@select="getPeopleList($event)"
/>
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-form-item label="负责人员:" prop="userInfo" >
<el-select v-model="material.userInfo" style="width:300px" placeholder="请选择" @change="chooseUser">
<el-option
v-for="item in dic.userList"
:key="item.USER_ID"
:value="JSON.stringify(item)"
:label="item.NAME"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="负责人手机号:" prop="userPhone">
<el-input v-model="material.userPhone" style="width: 300px" placeholder="请输入内容"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="负责人身份证:" prop="userCardId">
<el-input v-model="material.userCardId" style="width: 300px" placeholder="请输入内容"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="设备编号:" prop="deviceId">
<el-input v-model="material.deviceId" style="width: 300px" placeholder="请输入内容"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备名称:" prop="deviceName">
<el-input v-model="material.deviceName" style="width: 300px" placeholder="请输入内容"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="其他系统编号:" prop="id">
<el-input v-model="material.id" style="width: 300px" placeholder="请输入内容"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="其他系统编号备注:" prop="idRemark">
<el-input v-model="material.idRemark" style="width: 300px" placeholder="请输入内容"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="sendMessage('1')"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import vueQr from 'vue-qr'
import Treeselect from '@riophae/vue-treeselect'
import { requestFN } from '@/utils/request'
import uploadFile from '../../../util/uploadFile/index.vue'
import UploadImg from '../../../util/uploadImg/index.vue'
export default {
components: { UploadImg, uploadFile, Treeselect, vueQr },
props: {
appendToBody: {
type: Boolean,
default: false
}
},
data() {
return {
visible: false,
loading: false,
material: {
typeInfo: '',
type: '',
typeName: '',
deptInfo: '',
departmentId: null,
departmentName: '',
userInfo: '',
userId: '',
userName: '',
deviceId: '',
deviceName: '',
id: '',
idRemark: '',
remark: '',
userCardId: '',
userPhone: '',
photo: []
},
form: {
required: {
type: '',
typeName: '',
departmentId: '',
departmentName: '',
userId: '',
userName: '',
deviceId: '',
deviceName: '',
id: '',
userCardId: '',
userPhone: ''
},
remark: '',
idRemark: ''
},
normalizer(node) {
return {
id: node.id,
label: node.name,
children: node.nodes
}
},
rules: {
typeInfo: [
{ required: true, message: '请选择映射类型', trigger: 'change' }
],
userInfo: [
{ required: true, message: '请选择映射人', trigger: 'change' }
],
departmentId: [
{ required: true, message: '请选择部门', trigger: 'change' }
],
deviceId: [
{ required: true, message: '请填写其他系统编号', trigger: 'change' }
],
deviceName: [
{ required: true, message: '请填写其他系统名称', trigger: 'change' }
],
id: [
{ required: true, message: '请填写其他系统编号', trigger: 'change' }
],
idRemark: [
{ required: true, message: '请填写其他系统编号备注', trigger: 'change' }
],
userPhone: [
{ required: true, message: '请填写负责人手机号', trigger: 'change' }
],
userCardId: [
{ required: true, message: '请填写负责人身份证', trigger: 'change' }
]
},
heirloom: {},
departmentTree: [],
peopleList: [],
dic: {
alarmStatus: [],
logType: [],
mapType: [],
deptList: [],
userList: []
}
}
},
methods: {
async init(e) {
this.visible = true
await this.getDepartmentTree()
await this.getDict()
await this.getPeopleList({ id: e.departmentId })
if (e) {
await this.initInfo(e)
}
},
initInfo(e) {
return new Promise(resolve => {
this.heirloom = e
this.material.type = e.type
this.material.typeName = e.typeName
this.material.typeInfo = JSON.stringify({ name: e.typeName, value: e.type })
this.material.userId = e.userId
this.material.userName = e.userName
this.material.departmentId = e.departmentId
this.material.departmentName = e.departmentName
this.material.userPhone = e.userPhone
this.material.userCardId = e.userCardId
this.material.deviceId = e.deviceId
this.material.deviceName = e.deviceName
this.material.id = e.id
this.material.idRemark = e.idRemark
this.material.userInfo = e.userName
this.material.dwUserMapId = e.dwUserMapId
this.material.remark = e.remark
})
},
sendMessage(e) {
console.log(this.material)
this.$refs.form.validate((valid) => {
if (!valid) {
this.$message.error('请填写完整信息')
} else {
this.form.required.type = this.material.type
this.form.required.typeName = this.material.typeName
this.form.required.departmentId = this.material.departmentId
this.form.required.departmentName = this.material.departmentName
this.form.required.userId = this.material.userId
this.form.required.userName = this.material.userName
this.form.required.deviceId = this.material.deviceId
this.form.required.deviceName = this.material.deviceName
this.form.required.id = this.material.id
this.form.required.userCardId = this.material.userCardId
this.form.required.userPhone = this.material.userPhone
this.form.idRemark = this.material.idRemark
this.form.remark = this.material.remark
this.form.dwUserMapId = this.material.dwUserMapId
requestFN(
'/dingWei/saveOrUpdateMap', { data: JSON.stringify(this.form) }
).then((data) => {
if (data.code === 200) {
this.$message.success('操作成功')
this.handleClose()
this.$emit('flush')
this.visible = false
} else {
this.$message.error(data.msg)
}
}).catch((e) => {
console.log(e)
})
}
})
},
getPeopleList(e) {
return new Promise(resolve => {
this.material.departmentName = e.name
requestFN(
'/user/listAll',
{
DEPARTMENT_ID: e.id
}
).then((data) => {
this.dic.userList = data.userList
this.material.userInfo = ''
resolve(true)
}).catch((e) => {
console.log(e)
resolve(true)
})
})
},
chooseUser(e) {
const entity = JSON.parse(e)
this.material.userId = entity.USER_ID
this.material.userName = entity.NAME
},
handleClose() {
this.beforeClose()
},
beforeClose() {
this.visible = false
this.form = {
required: {
type: '',
typeName: '',
departmentId: '',
departmentName: '',
userId: '',
userName: '',
deviceId: '',
deviceName: '',
id: '',
userCardId: '',
userPhone: ''
},
remark: '',
idRemark: ''
}
this.material = {
typeInfo: '',
type: '',
typeName: '',
deptInfo: '',
departmentId: null,
departmentName: '',
userInfo: '',
userId: '',
userName: '',
deviceId: '',
deviceName: '',
id: '',
idRemark: '',
remark: '',
userCardId: '',
userPhone: ''
}
this.$emit('flush')
},
saveInfo(e) {
const info = JSON.parse(e)
this.material.type = info.value
this.material.typeName = info.name
},
getDict() {
return new Promise(resolve => {
requestFN('dingWei/getDictionary').then((data) => {
this.dic.alarmStatus = JSON.parse(data.AlarmStatus)
this.dic.logType = JSON.parse(data.LogType)
this.dic.mapType = JSON.parse(data.MapType)
resolve(true)
}).catch((e) => {
this.listLoading = false
resolve(true)
})
})
},
getDepartmentTree() {
return new Promise(resolve => {
requestFN(
'/department/listTree',
).then((data) => {
this.dic.deptList = this.removeEmptyChildren(JSON.parse(data.zTreeNodes))
resolve(true)
}).catch((e) => {
})
})
}
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,197 @@
<template>
<div class="app-container">
<el-form label-width="130px">
<el-row>
<el-col :span="6">
<el-form-item label="姓名">
<el-input v-model="condition.userName" placeholder="请输入姓名"/>
</el-form-item>
</el-col>
<el-col v-if="false" :span="6">
<el-form-item label="培训状态">
<el-select v-model="STATUS" placeholder="请选择培训状态" style="width: 100%;" clearable>
<el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table
ref="multipleTable"
:data="varList"
:header-cell-style="{'font-weight': 'bold','color': '#000'}"
tooltip-effect="dark"
border
fit
highlight-current-row>
<el-table-column :selectable="handleSelectWithDifferentStatus" type="selection" width="55" align="center"/>
<el-table-column type="index" label="序号" width="50" align="center"/>
<el-table-column prop="typeName" label="映射类型" align="center"/>
<el-table-column prop="userName" label="姓名" align="center"/>
<el-table-column prop="departmentName" label="部门名称" align="center"/>
<el-table-column prop="userPhone" label="用户手机号" align="center"/>
<el-table-column prop="deviceId" label="设备id" align="center"/>
<el-table-column prop="deviceName" label="设备名称" align="center"/>
<el-table-column prop="id" label="其他系统编号" align="center"/>
<el-table-column prop="idRemark" label="其他系统备注" align="center"/>
<el-table-column prop="createdTime" label="创建时间" align="center"/>
<el-table-column label="操作" align="center" width="200">
<template slot-scope="{row}">
<el-button type="danger" icon="el-icon-edit" size="mini" @click="handleDelete(row)"></el-button>
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
</div>
<pagination :total="listQuery.total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList"/>
</div>
<info ref="info" @flush="getList"/>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import info from './info.vue'
import vueQr from 'vue-qr'
export default {
components: { Pagination, vueQr, info },
directives: { waves },
data() {
return {
condition: {
userName: ''
},
config: config,
listQuery: {
page: 0,
limit: 10,
total: 0
},
listLoading: false,
KEYWORDS: '',
varList: [],
add: false, //
del: false, //
edit: false //
}
},
created() {
this.getList()
this.hasButton()
},
methods: {
handleSelectWithDifferentStatus(row, rowIndex) {
return true
},
getQuery() {
if (this.$refs.multipleTable) {
this.$refs.multipleTable.clearSelection()
}
this.listQuery = {
page: 1,
limit: 10
}
this.getList()
},
goKeyReset() {
this.condition = {
userName: ''
}
this.getQuery()
},
getList() {
this.listLoading = true
requestFN(
'/dingWei/getMapList?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
this.condition
).then((data) => {
this.listLoading = false
this.varList = data.list
this.listQuery.total = Number(data.page.total)
}).catch((e) => {
this.listLoading = false
})
},
handleAdd() {
this.$refs.info.init()
},
hasButton() {
var keys = 'trainingbatch:add,trainingbatch:del,trainingbatch:edit,fhSms,email,fromExcel,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys, tm: new Date().getTime()
}
).then((data) => {
if (data.result == 'success') {
this.add = data.trainingbatchfhadminadd //
this.del = data.trainingbatchfhadmindel //
this.edit = data.trainingbatchfhadminedit //
this.fromExcel = data.fromExcel // excel
this.toExcel = data.toExcel // excel
} else if (data.result == 'exception') {
// showException('', data.exception)//
console.info('按钮权限:', data.exception)
}
})
.catch((e) => {
this.listLoading = false
})
},
getDict: function() {
requestFN('dingWei/getDictionary').then((data) => {
this.wenhuachengduList = data.list
}).catch((e) => {
this.listLoading = false
})
},
handleDelete(row) {
this.$confirm('是否删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/dingWei/deleteMap', { id: row.dwUserMapId }
).then((data) => {
this.listLoading = false
this.$message({
type: 'success',
message: '删除成功!'
})
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
handleEdit(row) {
this.$refs.info.init(row)
}
}
}
</script>

View File

@ -0,0 +1,21 @@
<template>
<component :is="activeName" />
</template>
<script>
import List from './components/list'
export default {
components: {
List: List
},
data() {
return {
activeName: 'List',
SUPERVISE_CORPINFO_ID: ''
}
}
}
</script>
<style scoped>
</style>

View File