fix: BUG修改

This commit is contained in:
kun 2024-05-13 21:23:33 +08:00
parent 2f0f2d50a3
commit 649ed51269
4 changed files with 62 additions and 8 deletions

View File

@ -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",

View File

@ -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;

View File

@ -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)"

View File

@ -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">