Commit a80cc97d by 陈超

A

parent 90b68f49
......@@ -95,13 +95,7 @@
watch: {
lazyList(n, o) {
if(n && n.length > 0 && !this.lazyLoaded) {
this.lazyLoaded = true
this.pushList(n.split(",").map(url => {
return {
url: url,
name: url
}
}))
this.lazyLoad(n)
}
}
},
......@@ -114,8 +108,16 @@
}
}))
}
let n = this.lazyList
if(n && n.length > 0 && !this.lazyLoaded) {
this.lazyLoad(n)
}
},
methods: {
lazyLoad(n) {
this.lazyLoaded = true
this.delayInit(n)
},
onUpload(req) {
let f = req.file
let bucket = ""
......@@ -163,6 +165,16 @@
this.nowUrl = f.url
}
},
delayInit(urls) {
this.$nextTick(() => {
this.fileList = urls.split(",").map(url => {
return {
url: url,
name: url
}
})
})
},
initList(list) {
this.fileList = list
},
......@@ -179,7 +191,7 @@
})
},
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++) {
let sf = sufix[i]
if (str.endsWith(sf)) {
......
......@@ -43,7 +43,6 @@ import {checkToken} from '@/api/login'
import {calcScreen} from '@/util'
import GlobalWebSocket from '@/components/WebSocket/GlobalWebSocket'
export default {
name: 'Index',
provide() {
......
......@@ -64,6 +64,8 @@ import topLogs from './top-logs'
import topColor from './top-color'
import topSetting from './top-setting'
const synth = window.speechSynthesis
export default {
name: 'Top',
components: {
......@@ -170,6 +172,7 @@ export default {
z.forEach(d => {
showList.forEach(item => {
if(item.tag == d.type) {
this.checkNeedSpeak(item, d)
item.number = d.value
}
})
......@@ -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() {
fullscreenToggel()
},
......
......@@ -2,8 +2,8 @@
* 配置参考:
* https://cli.vuejs.org/zh/config/
*/
//const url = 'http://linshenxs-gateway:9999'
const url = 'http://47.108.51.175:9999'
const url = 'http://linshenxs-gateway:9999'
//const url = 'http://47.108.51.175:9999'
const CompressionWebpackPlugin = require('compression-webpack-plugin')
const productionGzipExtensions = ['js', 'css']
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