Commit a80cc97d by 陈超

A

parent 90b68f49
...@@ -95,13 +95,7 @@ ...@@ -95,13 +95,7 @@
watch: { watch: {
lazyList(n, o) { lazyList(n, o) {
if(n && n.length > 0 && !this.lazyLoaded) { if(n && n.length > 0 && !this.lazyLoaded) {
this.lazyLoaded = true this.lazyLoad(n)
this.pushList(n.split(",").map(url => {
return {
url: url,
name: url
}
}))
} }
} }
}, },
...@@ -114,8 +108,16 @@ ...@@ -114,8 +108,16 @@
} }
})) }))
} }
let n = this.lazyList
if(n && n.length > 0 && !this.lazyLoaded) {
this.lazyLoad(n)
}
}, },
methods: { methods: {
lazyLoad(n) {
this.lazyLoaded = true
this.delayInit(n)
},
onUpload(req) { onUpload(req) {
let f = req.file let f = req.file
let bucket = "" let bucket = ""
...@@ -163,6 +165,16 @@ ...@@ -163,6 +165,16 @@
this.nowUrl = f.url this.nowUrl = f.url
} }
}, },
delayInit(urls) {
this.$nextTick(() => {
this.fileList = urls.split(",").map(url => {
return {
url: url,
name: url
}
})
})
},
initList(list) { initList(list) {
this.fileList = list this.fileList = list
}, },
...@@ -179,7 +191,7 @@ ...@@ -179,7 +191,7 @@
}) })
}, },
isImage(str) { isImage(str) {
let sufix = ['png', 'jpg', 'jpeg', 'bmp', 'gif', 'webp', 'psd', 'svg', 'tiff'] let sufix = ['png', 'jpg', 'jpeg', 'bmp', 'gif', 'webp', 'psd', 'svg', 'tiff', 'ico']
for (let i = 0; i < sufix.length; i++) { for (let i = 0; i < sufix.length; i++) {
let sf = sufix[i] let sf = sufix[i]
if (str.endsWith(sf)) { if (str.endsWith(sf)) {
......
...@@ -43,7 +43,6 @@ import {checkToken} from '@/api/login' ...@@ -43,7 +43,6 @@ import {checkToken} from '@/api/login'
import {calcScreen} from '@/util' import {calcScreen} from '@/util'
import GlobalWebSocket from '@/components/WebSocket/GlobalWebSocket' import GlobalWebSocket from '@/components/WebSocket/GlobalWebSocket'
export default { export default {
name: 'Index', name: 'Index',
provide() { provide() {
......
...@@ -64,6 +64,8 @@ import topLogs from './top-logs' ...@@ -64,6 +64,8 @@ import topLogs from './top-logs'
import topColor from './top-color' import topColor from './top-color'
import topSetting from './top-setting' import topSetting from './top-setting'
const synth = window.speechSynthesis
export default { export default {
name: 'Top', name: 'Top',
components: { components: {
...@@ -170,6 +172,7 @@ export default { ...@@ -170,6 +172,7 @@ export default {
z.forEach(d => { z.forEach(d => {
showList.forEach(item => { showList.forEach(item => {
if(item.tag == d.type) { if(item.tag == d.type) {
this.checkNeedSpeak(item, d)
item.number = d.value item.number = d.value
} }
}) })
...@@ -191,6 +194,17 @@ export default { ...@@ -191,6 +194,17 @@ export default {
}) })
}, },
checkNeedSpeak(item, remote) {
if(item.number < remote.value) {
const msg = new SpeechSynthesisUtterance()
msg.text = "有新的" + item.title + "消息,请注意查收"
msg.volume = '1'
msg.rate = '1'
msg.pitch = '0'
msg.lang = 'zh-cn'
synth.speak(msg)
}
},
handleScreen() { handleScreen() {
fullscreenToggel() fullscreenToggel()
}, },
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* 配置参考: * 配置参考:
* https://cli.vuejs.org/zh/config/ * https://cli.vuejs.org/zh/config/
*/ */
//const url = 'http://linshenxs-gateway:9999' const url = 'http://linshenxs-gateway:9999'
const url = 'http://47.108.51.175:9999' //const url = 'http://47.108.51.175:9999'
const CompressionWebpackPlugin = require('compression-webpack-plugin') const CompressionWebpackPlugin = require('compression-webpack-plugin')
const productionGzipExtensions = ['js', 'css'] const productionGzipExtensions = ['js', 'css']
module.exports = { module.exports = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment