fix: BUG修改
This commit is contained in:
parent
2f0f2d50a3
commit
649ed51269
@ -808,11 +808,11 @@ const routes2 = [
|
||||
component: () => import("@/views/projectFront/examSystem/trainRecord/trainRecord.vue"),
|
||||
},
|
||||
// 安全考试系统--教育培训
|
||||
// {
|
||||
// path: "/project/examSystem/educationalTraining",
|
||||
// name: "安全考试系统_教育培训",
|
||||
// component: () => import("@/views/projectFront/examSystem/educationalTraining/educationalTraining.vue"),
|
||||
// },
|
||||
{
|
||||
path: "/project/examSystem/educationalTraining",
|
||||
name: "安全考试系统_教育培训",
|
||||
component: () => import("@/views/projectFront/examSystem/educationalTraining/educationalTraining.vue"),
|
||||
},
|
||||
{
|
||||
path: "/project/environmentalMonitor/alarmValueSet",
|
||||
name: "绿色施工_阈值设置1",
|
||||
|
||||
@ -1216,6 +1216,19 @@ import {
|
||||
xmglXzHikvisionSyncRetryAPI,
|
||||
} from "@/assets/js/api/laborPerson";
|
||||
import store from "@/store";
|
||||
import mqtt from 'mqtt'
|
||||
var client = null
|
||||
const options = {
|
||||
connectTimeout: 40000,
|
||||
clientId:
|
||||
'mqttjs_' +
|
||||
Math.random()
|
||||
.toString(16)
|
||||
.substr(2, 8),
|
||||
username: 'root',
|
||||
password: '123456',
|
||||
clean: true
|
||||
}
|
||||
export default {
|
||||
data() {
|
||||
var validReserveStartTime = (rule, value, callback) => {
|
||||
@ -1456,10 +1469,21 @@ export default {
|
||||
|
||||
showOtherDetail: false,
|
||||
entityDetail: {},
|
||||
topicName: 'topic',
|
||||
userId: '',
|
||||
|
||||
};
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (client) {
|
||||
client.unsubscribe(this.topicName + this.userId, options)
|
||||
client.end()
|
||||
}
|
||||
client = null
|
||||
},
|
||||
mounted() {
|
||||
this.userId = this.$store.state.userInfo.userId;
|
||||
this.topicName = this.$store.state.userInfo.scope
|
||||
this.getWorkerList();
|
||||
this.getList();
|
||||
this.getLaborManagementList();
|
||||
@ -1467,8 +1491,37 @@ export default {
|
||||
this.getUDevList();
|
||||
this.getEnterpriseListFn();
|
||||
this.getBlackWhiteBoole();
|
||||
client = mqtt.connect(mqttUrl, options)
|
||||
this.mqttMSG();
|
||||
},
|
||||
methods: {
|
||||
// 监听mqtt下发信息然后刷新列表
|
||||
mqttMSG() {
|
||||
// mqtt连接 +"/#" +workerId
|
||||
client.on('connect', e => {
|
||||
// console.log('连接成功:', this.topicName + this.userId)
|
||||
client.subscribe(this.topicName + this.userId, { qos: 0 }, error => {
|
||||
if (!error) {
|
||||
// console.log('订阅成功123')
|
||||
} else {
|
||||
console.log('订阅失败')
|
||||
}
|
||||
})
|
||||
})
|
||||
// 接收消息处理
|
||||
client.on('message', (topic, message) => {
|
||||
// console.log(message);
|
||||
this.getList();
|
||||
})
|
||||
// 断开发起重连
|
||||
// client.on("reconnect", (error) => {
|
||||
// console.log("正在重连:", error);
|
||||
// });
|
||||
// 链接异常处理
|
||||
client.on('error', error => {
|
||||
console.log('连接失败:', error)
|
||||
})
|
||||
},
|
||||
// 展示下发详情
|
||||
async showDetail(id) {
|
||||
this.issueTeamDialog = true;
|
||||
|
||||
@ -1334,6 +1334,7 @@
|
||||
@click="openImg(item)"
|
||||
> -->
|
||||
<el-image
|
||||
v-if="historyDetail.imageUrl"
|
||||
style="width: 100px; height: 100px; margin-right: 10px"
|
||||
:src="fileUrl + historyDetail.imageUrl"
|
||||
:preview-src-list="parseImage2(historyDetail.fileUrl)"
|
||||
|
||||
@ -429,14 +429,14 @@
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="现住地址:" prop="nativePlace">
|
||||
<el-form-item label="现住地址:" prop="nowPlace">
|
||||
<el-input
|
||||
v-if="detailInfoStatus"
|
||||
style="width: 80%"
|
||||
v-model="workerInfo.nativePlace"
|
||||
v-model="workerInfo.nowPlace"
|
||||
:placeholder="$t('message.laborMange.placeholder2')"
|
||||
></el-input>
|
||||
<span v-else>{{ workerInfo.nativePlace }}</span>
|
||||
<span v-else>{{ workerInfo.nowPlace }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user