Commit 2eb827b9 authored by 罗超's avatar 罗超

临时保存

parent 03f0fcd0
......@@ -46,6 +46,7 @@
"vue-electron": "^1.0.6",
"vue-qart": "^2.1.0",
"vue-router": "^2.5.3",
"vue-video-player": "^5.0.2",
"vuex": "^2.3.1"
},
"devDependencies": {
......
......@@ -38,8 +38,9 @@ let downloadObj = null
let mainEvent = null
let messageEvent = null
let messageProtocol = null
global.defaultdownloaddir=require('os').userInfo().homedir+'\\Downloads\\'
console.log(require('os').userInfo())
const winURL = process.env.NODE_ENV === 'development' ? `http://localhost:9080` : `file://${__dirname}/index.html`
......@@ -60,7 +61,6 @@ fs.readFile(appXmlPath, 'utf-8', function (err, result) {
global.VERSION = version.Application.Version
}
})
const isSecondInstance = app.makeSingleInstance((commandLine, workingDirectory) => {
if (commandLine.length > 1) {
try {
......@@ -142,6 +142,7 @@ function createWindow () {
mainWindow.webContents.session.on('will-download', (event, item, webContents) => {
const totalBytes = item.getTotalBytes()
let pathAll = folderpath + `\\` + downloadname
console.log(pathAll)
item.setSavePath(pathAll)
item.on('updated', (event, state) => {
if (state === 'interrupted') {
......@@ -152,12 +153,17 @@ function createWindow () {
} else {
console.log(`Received bytes: ${item.getReceivedBytes()}`)
}
// mainWindow.setProgressBar(item.getReceivedBytes() / totalBytes)
mainWindow.setProgressBar(item.getReceivedBytes() / totalBytes)
console.log(downloadObj)
downloadObj.sender.send('downloading', ((parseFloat(item.getReceivedBytes()) / parseFloat(totalBytes))*100).toFixed())
}
})
item.once('done', (event, state) => {
if (!mainWindow.isDestroyed()) {
mainWindow.setProgressBar(-1)
mainWindow.flashFrame(true)
// console.log(BrowserWindow.getFocusedWindow())
}
if (state === 'completed') {
try {
......@@ -165,8 +171,6 @@ function createWindow () {
} catch (error) {
}
// shell.openItem(folderpath + `\\` + downloadname)
// app.dock.downloadFinished(filePath)
} else {
console.log(`Download failed: ${state}`)
}
......@@ -479,10 +483,12 @@ ipc.on('download', (evt, pdownloadpath, pfolderpath, dfileName, pmsgId) => {
})
ipc.on('OpenFile', (evt, filePaht) => {
var a = shell.openItem(filePaht)
let isHave=true
if (!a) {
dialog.showErrorBox('打开文件', '此文件不存在,可能被删除或者移动到其它位置')
return false
isHave = false
}
evt.sender.send('FileExsit', isHave)
})
ipc.on('showItemInFolder', (evt, filePaht) => {
shell.showItemInFolder(filePaht)
......@@ -588,7 +594,7 @@ let getMainWinodw=function(isLoad){
height: 600,
width: 900,
icon: windowIcon,
minWidth:800,
minWidth:850,
minHeight:580
})
mainWindow.on('close', (e) => {
......
This diff is collapsed.
<style>
@import url('./assets/css/font.css');
@import url('./assets/css/global.css');
@import url('//at.alicdn.com/t/font_1062339_xxfkedot0lp.css');
@import url('//at.alicdn.com/t/font_1062339_zmy9rxarggi.css');
</style>
......
This diff is collapsed.
......@@ -267,11 +267,11 @@ export default {
right: 0;
overflow: auto;
background: #f1f1f1;
padding: 20px;
box-sizing: border-box;
}
.msgbox .messagebox .messagecontent .invalidHint {
text-align: center;
margin:20px;
}
.msgbox .messagebox .messagecontent .invalidHint span {
height: 22px;
......
......@@ -13,6 +13,7 @@
:key="(msg.idClient || index)"
:isHistory="isHistory"
@msg-loaded="msgLoaded"
ref="chatitem"
></chat-item>
<!-- <li class="u-msg item-time none" v-else>已无更多记录</li> -->
</ul>
......@@ -31,6 +32,9 @@ export default {
msgLoadedTimer: null
};
},
mounted () {
document.querySelector('#chat-list').addEventListener('scroll', this.handleScroll);
},
props: {
type: String,
canLoadMore: [String, Boolean],
......@@ -72,6 +76,19 @@ export default {
// }
},
methods: {
handleScroll(){
let ch=document.querySelector('#chat-list').scrollTop+document.querySelector('#chat-list').clientHeight-40
this.$refs.chatitem.forEach(x=>{
if(x.$refs.msgvideo){
let minh=x.$refs.msgvideo.offsetTop
let maxh=x.$refs.msgvideo.offsetTop+x.$refs.msgvideo.clientHeight
if(ch>=minh && ch<=maxh){
x.$refs.msgvideo.play()
} else
x.$refs.msgvideo.pause()
}
})
},
msgLoaded() {
clearTimeout(this.msgLoadedTimer);
this.msgLoadedTimer = setTimeout(() => {
......@@ -86,16 +103,18 @@ export default {
width: 100%;
box-sizing: border-box;
margin: 0;
padding: 0;
padding: 20px;
height: 100%;
overflow: auto;
}
.chat__list li {
list-style: none;
margin: 0;
padding: 0;
margin-bottom: 12px;
margin-bottom: 18px;
}
.chat__list .u-msg {
margin-bottom: 12px;
margin-bottom: 18px;
}
.chat__list .u-msg.item-time {
color: #2d98da;
......
<template>
<div class="previewerfile">
<div class="header__opera">
<span class="opera__item close" @click="hideWin">
<i class="iconfont iconguanbi"></i>
</span>
</div>
<iframe class="iframe" :src="url"></iframe>
</div>
</template>
<script>
export default {
data () {
return {
url:''
}
},
mounted() {
this.url=this.$electron.remote.getGlobal('previwerurl')
},
}
</script>
<style scope>
.previewerfile{
width: 100%;
height: 100%;
background: rgba(0,0,0,.5);
position: relative;
}
.header__opera {
position: absolute;
top: 0px;
right: -1px;
text-align: right;
-webkit-app-region: no-drag !important;
}
.header__opera .opera__item {
padding: 2px 5px;
color: #f1f1f1;
cursor: pointer;
display: inline-block;
}
.header__opera .opera__item i {
font-size: 14px;
}
.login-box .login-box__header .header__opera .close:hover {
background: #eb3b5a;
}
.iframe{
width: 100%;
height: 100%;
}
</style>
......@@ -12,7 +12,6 @@ import editor from 'vue-html5-editor'
import 'vue-html5-editor/src/style.css'
import MyPlugin from '../plugin/plugin'
import encrypt from '../plugin/encry'
Vue.use(editor)
Vue.use(MyPlugin)
Vue.use(ElementUI)
......
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