diff --git a/public/config/project.config.json b/public/config/project.config.json index 36c6f79..ef37f8d 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -3,6 +3,7 @@ "subtitle": "", "theme":"blue", "baseUrl": "http://60.208.121.150:5001/", + "wsUrl": "ws://60.208.121.150:5001/websocket", "mainPage": "http://111.198.10.15:11404/dcms/#", "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", diff --git a/public/config/project.config.json b/public/config/project.config.json index 36c6f79..ef37f8d 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -3,6 +3,7 @@ "subtitle": "", "theme":"blue", "baseUrl": "http://60.208.121.150:5001/", + "wsUrl": "ws://60.208.121.150:5001/websocket", "mainPage": "http://111.198.10.15:11404/dcms/#", "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", diff --git a/src/App.vue b/src/App.vue index 3320e88..d103696 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,8 +11,13 @@ name: 'App', mounted() { this.windowResize(window.innerHeight, window.innerWidth) + this.initWebSocket() }, methods: { + initWebSocket() { + console.log('初始化websocket') + this.$store.dispatch('initWebSocket') + }, // 窗口变化 windowResize(height, width) { // 查找header高度 diff --git a/public/config/project.config.json b/public/config/project.config.json index 36c6f79..ef37f8d 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -3,6 +3,7 @@ "subtitle": "", "theme":"blue", "baseUrl": "http://60.208.121.150:5001/", + "wsUrl": "ws://60.208.121.150:5001/websocket", "mainPage": "http://111.198.10.15:11404/dcms/#", "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", diff --git a/src/App.vue b/src/App.vue index 3320e88..d103696 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,8 +11,13 @@ name: 'App', mounted() { this.windowResize(window.innerHeight, window.innerWidth) + this.initWebSocket() }, methods: { + initWebSocket() { + console.log('初始化websocket') + this.$store.dispatch('initWebSocket') + }, // 窗口变化 windowResize(height, width) { // 查找header高度 diff --git a/src/components/Amap/mixins/register-component.js b/src/components/Amap/mixins/register-component.js index b256cce..aac7931 100644 --- a/src/components/Amap/mixins/register-component.js +++ b/src/components/Amap/mixins/register-component.js @@ -10,7 +10,7 @@ }, mounted() { - console.log('mounted') + // console.log('mounted') this.map = this.map || this.$parent.map if (this.map) { this.register() @@ -142,7 +142,7 @@ Object.keys(this._props).forEach(k => { const fn = this.$amapComponent[`set${upperCamelCase(k)}`] if (fn) { - console.log(k) + // console.log(k) } }) }, diff --git a/public/config/project.config.json b/public/config/project.config.json index 36c6f79..ef37f8d 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -3,6 +3,7 @@ "subtitle": "", "theme":"blue", "baseUrl": "http://60.208.121.150:5001/", + "wsUrl": "ws://60.208.121.150:5001/websocket", "mainPage": "http://111.198.10.15:11404/dcms/#", "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", diff --git a/src/App.vue b/src/App.vue index 3320e88..d103696 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,8 +11,13 @@ name: 'App', mounted() { this.windowResize(window.innerHeight, window.innerWidth) + this.initWebSocket() }, methods: { + initWebSocket() { + console.log('初始化websocket') + this.$store.dispatch('initWebSocket') + }, // 窗口变化 windowResize(height, width) { // 查找header高度 diff --git a/src/components/Amap/mixins/register-component.js b/src/components/Amap/mixins/register-component.js index b256cce..aac7931 100644 --- a/src/components/Amap/mixins/register-component.js +++ b/src/components/Amap/mixins/register-component.js @@ -10,7 +10,7 @@ }, mounted() { - console.log('mounted') + // console.log('mounted') this.map = this.map || this.$parent.map if (this.map) { this.register() @@ -142,7 +142,7 @@ Object.keys(this._props).forEach(k => { const fn = this.$amapComponent[`set${upperCamelCase(k)}`] if (fn) { - console.log(k) + // console.log(k) } }) }, diff --git a/src/main.js b/src/main.js index 1ceea3c..6d48f72 100644 --- a/src/main.js +++ b/src/main.js @@ -44,29 +44,28 @@ Vue.use(dataV) // 引入音频文件 -import audio from '@/assets/audio/alarm.mp3' +import alarmAudio from '@/assets/audio/alarm.mp3' // 方法1:注册播放音频事件到Vue实例上 Vue.prototype.playAudio = (audioName) => { - const buttonAudio = document.getElementById('eventAudio') - buttonAudio.setAttribute('src', audio) - console.log(buttonAudio) - const playPromise = buttonAudio.play() - if (playPromise) { - playPromise.then(() => { - // 音频加载成功 - console.log('音频加载成功') - }).catch((e) => { - // 音频加载失败 - console.error(e.message) - }) - } - if (buttonAudio.paused === true) { - buttonAudio.load() - } else { + const audio = document.getElementById('eventAudio') + audio.setAttribute('src', alarmAudio) + if (audio.paused === true) { // 判断音频是否暂停,暂停重新加载音频元素 + audio.load() + } else { // 否则 + // audio.pause() setTimeout(() => { - buttonAudio.pause() - buttonAudio.play() + // audio.play() + const playPromise = audio.load() + if (playPromise) { + playPromise.then(() => { + // 音频加载成功 + console.log('音频加载成功') + }).catch((e) => { + // 音频加载失败 + console.error(e.message) + }) + } }, 10) } } diff --git a/public/config/project.config.json b/public/config/project.config.json index 36c6f79..ef37f8d 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -3,6 +3,7 @@ "subtitle": "", "theme":"blue", "baseUrl": "http://60.208.121.150:5001/", + "wsUrl": "ws://60.208.121.150:5001/websocket", "mainPage": "http://111.198.10.15:11404/dcms/#", "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", diff --git a/src/App.vue b/src/App.vue index 3320e88..d103696 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,8 +11,13 @@ name: 'App', mounted() { this.windowResize(window.innerHeight, window.innerWidth) + this.initWebSocket() }, methods: { + initWebSocket() { + console.log('初始化websocket') + this.$store.dispatch('initWebSocket') + }, // 窗口变化 windowResize(height, width) { // 查找header高度 diff --git a/src/components/Amap/mixins/register-component.js b/src/components/Amap/mixins/register-component.js index b256cce..aac7931 100644 --- a/src/components/Amap/mixins/register-component.js +++ b/src/components/Amap/mixins/register-component.js @@ -10,7 +10,7 @@ }, mounted() { - console.log('mounted') + // console.log('mounted') this.map = this.map || this.$parent.map if (this.map) { this.register() @@ -142,7 +142,7 @@ Object.keys(this._props).forEach(k => { const fn = this.$amapComponent[`set${upperCamelCase(k)}`] if (fn) { - console.log(k) + // console.log(k) } }) }, diff --git a/src/main.js b/src/main.js index 1ceea3c..6d48f72 100644 --- a/src/main.js +++ b/src/main.js @@ -44,29 +44,28 @@ Vue.use(dataV) // 引入音频文件 -import audio from '@/assets/audio/alarm.mp3' +import alarmAudio from '@/assets/audio/alarm.mp3' // 方法1:注册播放音频事件到Vue实例上 Vue.prototype.playAudio = (audioName) => { - const buttonAudio = document.getElementById('eventAudio') - buttonAudio.setAttribute('src', audio) - console.log(buttonAudio) - const playPromise = buttonAudio.play() - if (playPromise) { - playPromise.then(() => { - // 音频加载成功 - console.log('音频加载成功') - }).catch((e) => { - // 音频加载失败 - console.error(e.message) - }) - } - if (buttonAudio.paused === true) { - buttonAudio.load() - } else { + const audio = document.getElementById('eventAudio') + audio.setAttribute('src', alarmAudio) + if (audio.paused === true) { // 判断音频是否暂停,暂停重新加载音频元素 + audio.load() + } else { // 否则 + // audio.pause() setTimeout(() => { - buttonAudio.pause() - buttonAudio.play() + // audio.play() + const playPromise = audio.load() + if (playPromise) { + playPromise.then(() => { + // 音频加载成功 + console.log('音频加载成功') + }).catch((e) => { + // 音频加载失败 + console.error(e.message) + }) + } }, 10) } } diff --git a/src/store/modules/websocket.js b/src/store/modules/websocket.js index bf7a5dd..0da8a05 100644 --- a/src/store/modules/websocket.js +++ b/src/store/modules/websocket.js @@ -35,8 +35,8 @@ } else { // 获取token保存到vuex中的用户信息,此处仅适用于本项目,注意删除或修改 // 实例化socket,这里我把用户名传给了后台,使后台能判断要把消息发给哪个用户,其实也可以后台直接获取用户IP来判断并推送 - const socketUrl = wsUrl + user.state.id - console.log('======>', socketUrl) + const socketUrl = getWsUrl() + user.state.id + console.log('初始化websocket===>', socketUrl) const socket = new WebSocket(socketUrl) commit('SET_WEBSOCKET', socket) commit('SET_WS_STATUS', true) diff --git a/public/config/project.config.json b/public/config/project.config.json index 36c6f79..ef37f8d 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -3,6 +3,7 @@ "subtitle": "", "theme":"blue", "baseUrl": "http://60.208.121.150:5001/", + "wsUrl": "ws://60.208.121.150:5001/websocket", "mainPage": "http://111.198.10.15:11404/dcms/#", "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", diff --git a/src/App.vue b/src/App.vue index 3320e88..d103696 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,8 +11,13 @@ name: 'App', mounted() { this.windowResize(window.innerHeight, window.innerWidth) + this.initWebSocket() }, methods: { + initWebSocket() { + console.log('初始化websocket') + this.$store.dispatch('initWebSocket') + }, // 窗口变化 windowResize(height, width) { // 查找header高度 diff --git a/src/components/Amap/mixins/register-component.js b/src/components/Amap/mixins/register-component.js index b256cce..aac7931 100644 --- a/src/components/Amap/mixins/register-component.js +++ b/src/components/Amap/mixins/register-component.js @@ -10,7 +10,7 @@ }, mounted() { - console.log('mounted') + // console.log('mounted') this.map = this.map || this.$parent.map if (this.map) { this.register() @@ -142,7 +142,7 @@ Object.keys(this._props).forEach(k => { const fn = this.$amapComponent[`set${upperCamelCase(k)}`] if (fn) { - console.log(k) + // console.log(k) } }) }, diff --git a/src/main.js b/src/main.js index 1ceea3c..6d48f72 100644 --- a/src/main.js +++ b/src/main.js @@ -44,29 +44,28 @@ Vue.use(dataV) // 引入音频文件 -import audio from '@/assets/audio/alarm.mp3' +import alarmAudio from '@/assets/audio/alarm.mp3' // 方法1:注册播放音频事件到Vue实例上 Vue.prototype.playAudio = (audioName) => { - const buttonAudio = document.getElementById('eventAudio') - buttonAudio.setAttribute('src', audio) - console.log(buttonAudio) - const playPromise = buttonAudio.play() - if (playPromise) { - playPromise.then(() => { - // 音频加载成功 - console.log('音频加载成功') - }).catch((e) => { - // 音频加载失败 - console.error(e.message) - }) - } - if (buttonAudio.paused === true) { - buttonAudio.load() - } else { + const audio = document.getElementById('eventAudio') + audio.setAttribute('src', alarmAudio) + if (audio.paused === true) { // 判断音频是否暂停,暂停重新加载音频元素 + audio.load() + } else { // 否则 + // audio.pause() setTimeout(() => { - buttonAudio.pause() - buttonAudio.play() + // audio.play() + const playPromise = audio.load() + if (playPromise) { + playPromise.then(() => { + // 音频加载成功 + console.log('音频加载成功') + }).catch((e) => { + // 音频加载失败 + console.error(e.message) + }) + } }, 10) } } diff --git a/src/store/modules/websocket.js b/src/store/modules/websocket.js index bf7a5dd..0da8a05 100644 --- a/src/store/modules/websocket.js +++ b/src/store/modules/websocket.js @@ -35,8 +35,8 @@ } else { // 获取token保存到vuex中的用户信息,此处仅适用于本项目,注意删除或修改 // 实例化socket,这里我把用户名传给了后台,使后台能判断要把消息发给哪个用户,其实也可以后台直接获取用户IP来判断并推送 - const socketUrl = wsUrl + user.state.id - console.log('======>', socketUrl) + const socketUrl = getWsUrl() + user.state.id + console.log('初始化websocket===>', socketUrl) const socket = new WebSocket(socketUrl) commit('SET_WEBSOCKET', socket) commit('SET_WS_STATUS', true) diff --git a/src/views/jobManage/detailJob.vue b/src/views/jobManage/detailJob.vue index 383928d..83afc6d 100644 --- a/src/views/jobManage/detailJob.vue +++ b/src/views/jobManage/detailJob.vue @@ -1,130 +1,55 @@ @@ -138,6 +63,17 @@ return { dialogFormVisible: false, // 对话框是否显示 dialogStatus: '', // 对话框类型:create,update + formConfig: [ + { type: 'text', label: '工单编号', value: 'jobCode', placeholder: '未知' }, + { type: 'text', label: '点位编号', value: 'wellCode', placeholder: '未知' }, + { type: 'text', label: '设备编号', value: 'devcode', placeholder: '未知' }, + { type: 'text', label: '详细地址', value: 'position', placeholder: '未知' }, + { type: 'text', label: '告警类型', value: 'alarmTypeName', placeholder: '未知' }, + { type: 'text', label: '告警内容', value: 'alarmContentName', placeholder: '--' }, + { type: 'text', label: '告警详情', value: 'alarmMessage', placeholder: '未知' }, + { type: 'text', label: '工单状态', value: 'jobStatusName', placeholder: '未知' }, + { type: 'timeline', label: '工单动态', value: '', placeholder: '暂无', span: 5 } + ], // 表单配置项 jobForm: { jobCode: '', // 工单编号 wellCode: '', // 点位编号 diff --git a/public/config/project.config.json b/public/config/project.config.json index 36c6f79..ef37f8d 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -3,6 +3,7 @@ "subtitle": "", "theme":"blue", "baseUrl": "http://60.208.121.150:5001/", + "wsUrl": "ws://60.208.121.150:5001/websocket", "mainPage": "http://111.198.10.15:11404/dcms/#", "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", diff --git a/src/App.vue b/src/App.vue index 3320e88..d103696 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,8 +11,13 @@ name: 'App', mounted() { this.windowResize(window.innerHeight, window.innerWidth) + this.initWebSocket() }, methods: { + initWebSocket() { + console.log('初始化websocket') + this.$store.dispatch('initWebSocket') + }, // 窗口变化 windowResize(height, width) { // 查找header高度 diff --git a/src/components/Amap/mixins/register-component.js b/src/components/Amap/mixins/register-component.js index b256cce..aac7931 100644 --- a/src/components/Amap/mixins/register-component.js +++ b/src/components/Amap/mixins/register-component.js @@ -10,7 +10,7 @@ }, mounted() { - console.log('mounted') + // console.log('mounted') this.map = this.map || this.$parent.map if (this.map) { this.register() @@ -142,7 +142,7 @@ Object.keys(this._props).forEach(k => { const fn = this.$amapComponent[`set${upperCamelCase(k)}`] if (fn) { - console.log(k) + // console.log(k) } }) }, diff --git a/src/main.js b/src/main.js index 1ceea3c..6d48f72 100644 --- a/src/main.js +++ b/src/main.js @@ -44,29 +44,28 @@ Vue.use(dataV) // 引入音频文件 -import audio from '@/assets/audio/alarm.mp3' +import alarmAudio from '@/assets/audio/alarm.mp3' // 方法1:注册播放音频事件到Vue实例上 Vue.prototype.playAudio = (audioName) => { - const buttonAudio = document.getElementById('eventAudio') - buttonAudio.setAttribute('src', audio) - console.log(buttonAudio) - const playPromise = buttonAudio.play() - if (playPromise) { - playPromise.then(() => { - // 音频加载成功 - console.log('音频加载成功') - }).catch((e) => { - // 音频加载失败 - console.error(e.message) - }) - } - if (buttonAudio.paused === true) { - buttonAudio.load() - } else { + const audio = document.getElementById('eventAudio') + audio.setAttribute('src', alarmAudio) + if (audio.paused === true) { // 判断音频是否暂停,暂停重新加载音频元素 + audio.load() + } else { // 否则 + // audio.pause() setTimeout(() => { - buttonAudio.pause() - buttonAudio.play() + // audio.play() + const playPromise = audio.load() + if (playPromise) { + playPromise.then(() => { + // 音频加载成功 + console.log('音频加载成功') + }).catch((e) => { + // 音频加载失败 + console.error(e.message) + }) + } }, 10) } } diff --git a/src/store/modules/websocket.js b/src/store/modules/websocket.js index bf7a5dd..0da8a05 100644 --- a/src/store/modules/websocket.js +++ b/src/store/modules/websocket.js @@ -35,8 +35,8 @@ } else { // 获取token保存到vuex中的用户信息,此处仅适用于本项目,注意删除或修改 // 实例化socket,这里我把用户名传给了后台,使后台能判断要把消息发给哪个用户,其实也可以后台直接获取用户IP来判断并推送 - const socketUrl = wsUrl + user.state.id - console.log('======>', socketUrl) + const socketUrl = getWsUrl() + user.state.id + console.log('初始化websocket===>', socketUrl) const socket = new WebSocket(socketUrl) commit('SET_WEBSOCKET', socket) commit('SET_WS_STATUS', true) diff --git a/src/views/jobManage/detailJob.vue b/src/views/jobManage/detailJob.vue index 383928d..83afc6d 100644 --- a/src/views/jobManage/detailJob.vue +++ b/src/views/jobManage/detailJob.vue @@ -1,130 +1,55 @@ @@ -138,6 +63,17 @@ return { dialogFormVisible: false, // 对话框是否显示 dialogStatus: '', // 对话框类型:create,update + formConfig: [ + { type: 'text', label: '工单编号', value: 'jobCode', placeholder: '未知' }, + { type: 'text', label: '点位编号', value: 'wellCode', placeholder: '未知' }, + { type: 'text', label: '设备编号', value: 'devcode', placeholder: '未知' }, + { type: 'text', label: '详细地址', value: 'position', placeholder: '未知' }, + { type: 'text', label: '告警类型', value: 'alarmTypeName', placeholder: '未知' }, + { type: 'text', label: '告警内容', value: 'alarmContentName', placeholder: '--' }, + { type: 'text', label: '告警详情', value: 'alarmMessage', placeholder: '未知' }, + { type: 'text', label: '工单状态', value: 'jobStatusName', placeholder: '未知' }, + { type: 'timeline', label: '工单动态', value: '', placeholder: '暂无', span: 5 } + ], // 表单配置项 jobForm: { jobCode: '', // 工单编号 wellCode: '', // 点位编号 diff --git a/src/views/overview/overviewAmap.vue b/src/views/overview/overviewAmap.vue index acf2562..1da6eb4 100644 --- a/src/views/overview/overviewAmap.vue +++ b/src/views/overview/overviewAmap.vue @@ -70,7 +70,7 @@ wellOffset: [-8, -16], // 井偏移量 massMarkerUrl: './static/overview/icon-location-small.png', massMarkerSize: [15, 15], - massMarkerOffset: [0, 8], + massMarkerOffset: [8, 8], searchResultSize: [24, 30], searchResultOffset: [-12, -30], searchResultIcon: require('@/assets/overview/pure-position-icon.png'), // 报警图标 @@ -565,7 +565,7 @@ const wellWindow = new WellInfo().$mount() const infoWindow = new window.AMap.InfoWindow({ content: wellWindow.$el, // 显示内容 - offset: [0, offsetY], // 偏移 + offset: [8, offsetY], // 偏移 autoMove: true // 是否自动调整窗体到视野内 }) infoWindow.open(this.map, new toLngLat(coordinates)) diff --git a/public/config/project.config.json b/public/config/project.config.json index 36c6f79..ef37f8d 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -3,6 +3,7 @@ "subtitle": "", "theme":"blue", "baseUrl": "http://60.208.121.150:5001/", + "wsUrl": "ws://60.208.121.150:5001/websocket", "mainPage": "http://111.198.10.15:11404/dcms/#", "amapSecurityCode": "182a2c5889f7fe6d90546d9b8f4781ad", "amapKey": "1733551f35b56f6d8e9c0a9d4c2523b", diff --git a/src/App.vue b/src/App.vue index 3320e88..d103696 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,8 +11,13 @@ name: 'App', mounted() { this.windowResize(window.innerHeight, window.innerWidth) + this.initWebSocket() }, methods: { + initWebSocket() { + console.log('初始化websocket') + this.$store.dispatch('initWebSocket') + }, // 窗口变化 windowResize(height, width) { // 查找header高度 diff --git a/src/components/Amap/mixins/register-component.js b/src/components/Amap/mixins/register-component.js index b256cce..aac7931 100644 --- a/src/components/Amap/mixins/register-component.js +++ b/src/components/Amap/mixins/register-component.js @@ -10,7 +10,7 @@ }, mounted() { - console.log('mounted') + // console.log('mounted') this.map = this.map || this.$parent.map if (this.map) { this.register() @@ -142,7 +142,7 @@ Object.keys(this._props).forEach(k => { const fn = this.$amapComponent[`set${upperCamelCase(k)}`] if (fn) { - console.log(k) + // console.log(k) } }) }, diff --git a/src/main.js b/src/main.js index 1ceea3c..6d48f72 100644 --- a/src/main.js +++ b/src/main.js @@ -44,29 +44,28 @@ Vue.use(dataV) // 引入音频文件 -import audio from '@/assets/audio/alarm.mp3' +import alarmAudio from '@/assets/audio/alarm.mp3' // 方法1:注册播放音频事件到Vue实例上 Vue.prototype.playAudio = (audioName) => { - const buttonAudio = document.getElementById('eventAudio') - buttonAudio.setAttribute('src', audio) - console.log(buttonAudio) - const playPromise = buttonAudio.play() - if (playPromise) { - playPromise.then(() => { - // 音频加载成功 - console.log('音频加载成功') - }).catch((e) => { - // 音频加载失败 - console.error(e.message) - }) - } - if (buttonAudio.paused === true) { - buttonAudio.load() - } else { + const audio = document.getElementById('eventAudio') + audio.setAttribute('src', alarmAudio) + if (audio.paused === true) { // 判断音频是否暂停,暂停重新加载音频元素 + audio.load() + } else { // 否则 + // audio.pause() setTimeout(() => { - buttonAudio.pause() - buttonAudio.play() + // audio.play() + const playPromise = audio.load() + if (playPromise) { + playPromise.then(() => { + // 音频加载成功 + console.log('音频加载成功') + }).catch((e) => { + // 音频加载失败 + console.error(e.message) + }) + } }, 10) } } diff --git a/src/store/modules/websocket.js b/src/store/modules/websocket.js index bf7a5dd..0da8a05 100644 --- a/src/store/modules/websocket.js +++ b/src/store/modules/websocket.js @@ -35,8 +35,8 @@ } else { // 获取token保存到vuex中的用户信息,此处仅适用于本项目,注意删除或修改 // 实例化socket,这里我把用户名传给了后台,使后台能判断要把消息发给哪个用户,其实也可以后台直接获取用户IP来判断并推送 - const socketUrl = wsUrl + user.state.id - console.log('======>', socketUrl) + const socketUrl = getWsUrl() + user.state.id + console.log('初始化websocket===>', socketUrl) const socket = new WebSocket(socketUrl) commit('SET_WEBSOCKET', socket) commit('SET_WS_STATUS', true) diff --git a/src/views/jobManage/detailJob.vue b/src/views/jobManage/detailJob.vue index 383928d..83afc6d 100644 --- a/src/views/jobManage/detailJob.vue +++ b/src/views/jobManage/detailJob.vue @@ -1,130 +1,55 @@ @@ -138,6 +63,17 @@ return { dialogFormVisible: false, // 对话框是否显示 dialogStatus: '', // 对话框类型:create,update + formConfig: [ + { type: 'text', label: '工单编号', value: 'jobCode', placeholder: '未知' }, + { type: 'text', label: '点位编号', value: 'wellCode', placeholder: '未知' }, + { type: 'text', label: '设备编号', value: 'devcode', placeholder: '未知' }, + { type: 'text', label: '详细地址', value: 'position', placeholder: '未知' }, + { type: 'text', label: '告警类型', value: 'alarmTypeName', placeholder: '未知' }, + { type: 'text', label: '告警内容', value: 'alarmContentName', placeholder: '--' }, + { type: 'text', label: '告警详情', value: 'alarmMessage', placeholder: '未知' }, + { type: 'text', label: '工单状态', value: 'jobStatusName', placeholder: '未知' }, + { type: 'timeline', label: '工单动态', value: '', placeholder: '暂无', span: 5 } + ], // 表单配置项 jobForm: { jobCode: '', // 工单编号 wellCode: '', // 点位编号 diff --git a/src/views/overview/overviewAmap.vue b/src/views/overview/overviewAmap.vue index acf2562..1da6eb4 100644 --- a/src/views/overview/overviewAmap.vue +++ b/src/views/overview/overviewAmap.vue @@ -70,7 +70,7 @@ wellOffset: [-8, -16], // 井偏移量 massMarkerUrl: './static/overview/icon-location-small.png', massMarkerSize: [15, 15], - massMarkerOffset: [0, 8], + massMarkerOffset: [8, 8], searchResultSize: [24, 30], searchResultOffset: [-12, -30], searchResultIcon: require('@/assets/overview/pure-position-icon.png'), // 报警图标 @@ -565,7 +565,7 @@ const wellWindow = new WellInfo().$mount() const infoWindow = new window.AMap.InfoWindow({ content: wellWindow.$el, // 显示内容 - offset: [0, offsetY], // 偏移 + offset: [8, offsetY], // 偏移 autoMove: true // 是否自动调整窗体到视野内 }) infoWindow.open(this.map, new toLngLat(coordinates)) diff --git a/src/views/wellManage/infoWell.vue b/src/views/wellManage/infoWell.vue index 465612e..d62c0b5 100644 --- a/src/views/wellManage/infoWell.vue +++ b/src/views/wellManage/infoWell.vue @@ -184,9 +184,7 @@