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

临时保存

parent 03f0fcd0
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
"vue-electron": "^1.0.6", "vue-electron": "^1.0.6",
"vue-qart": "^2.1.0", "vue-qart": "^2.1.0",
"vue-router": "^2.5.3", "vue-router": "^2.5.3",
"vue-video-player": "^5.0.2",
"vuex": "^2.3.1" "vuex": "^2.3.1"
}, },
"devDependencies": { "devDependencies": {
......
...@@ -38,8 +38,9 @@ let downloadObj = null ...@@ -38,8 +38,9 @@ let downloadObj = null
let mainEvent = null let mainEvent = null
let messageEvent = null let messageEvent = null
let messageProtocol = 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` 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) { ...@@ -60,7 +61,6 @@ fs.readFile(appXmlPath, 'utf-8', function (err, result) {
global.VERSION = version.Application.Version global.VERSION = version.Application.Version
} }
}) })
const isSecondInstance = app.makeSingleInstance((commandLine, workingDirectory) => { const isSecondInstance = app.makeSingleInstance((commandLine, workingDirectory) => {
if (commandLine.length > 1) { if (commandLine.length > 1) {
try { try {
...@@ -142,6 +142,7 @@ function createWindow () { ...@@ -142,6 +142,7 @@ function createWindow () {
mainWindow.webContents.session.on('will-download', (event, item, webContents) => { mainWindow.webContents.session.on('will-download', (event, item, webContents) => {
const totalBytes = item.getTotalBytes() const totalBytes = item.getTotalBytes()
let pathAll = folderpath + `\\` + downloadname let pathAll = folderpath + `\\` + downloadname
console.log(pathAll)
item.setSavePath(pathAll) item.setSavePath(pathAll)
item.on('updated', (event, state) => { item.on('updated', (event, state) => {
if (state === 'interrupted') { if (state === 'interrupted') {
...@@ -152,12 +153,17 @@ function createWindow () { ...@@ -152,12 +153,17 @@ function createWindow () {
} else { } else {
console.log(`Received bytes: ${item.getReceivedBytes()}`) 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) => { item.once('done', (event, state) => {
if (!mainWindow.isDestroyed()) { if (!mainWindow.isDestroyed()) {
mainWindow.setProgressBar(-1) mainWindow.setProgressBar(-1)
mainWindow.flashFrame(true)
// console.log(BrowserWindow.getFocusedWindow())
} }
if (state === 'completed') { if (state === 'completed') {
try { try {
...@@ -165,8 +171,6 @@ function createWindow () { ...@@ -165,8 +171,6 @@ function createWindow () {
} catch (error) { } catch (error) {
} }
// shell.openItem(folderpath + `\\` + downloadname)
// app.dock.downloadFinished(filePath)
} else { } else {
console.log(`Download failed: ${state}`) console.log(`Download failed: ${state}`)
} }
...@@ -479,10 +483,12 @@ ipc.on('download', (evt, pdownloadpath, pfolderpath, dfileName, pmsgId) => { ...@@ -479,10 +483,12 @@ ipc.on('download', (evt, pdownloadpath, pfolderpath, dfileName, pmsgId) => {
}) })
ipc.on('OpenFile', (evt, filePaht) => { ipc.on('OpenFile', (evt, filePaht) => {
var a = shell.openItem(filePaht) var a = shell.openItem(filePaht)
let isHave=true
if (!a) { if (!a) {
dialog.showErrorBox('打开文件', '此文件不存在,可能被删除或者移动到其它位置') dialog.showErrorBox('打开文件', '此文件不存在,可能被删除或者移动到其它位置')
return false isHave = false
} }
evt.sender.send('FileExsit', isHave)
}) })
ipc.on('showItemInFolder', (evt, filePaht) => { ipc.on('showItemInFolder', (evt, filePaht) => {
shell.showItemInFolder(filePaht) shell.showItemInFolder(filePaht)
...@@ -588,7 +594,7 @@ let getMainWinodw=function(isLoad){ ...@@ -588,7 +594,7 @@ let getMainWinodw=function(isLoad){
height: 600, height: 600,
width: 900, width: 900,
icon: windowIcon, icon: windowIcon,
minWidth:800, minWidth:850,
minHeight:580 minHeight:580
}) })
mainWindow.on('close', (e) => { mainWindow.on('close', (e) => {
......
This diff is collapsed.
<style> <style>
@import url('./assets/css/font.css'); @import url('./assets/css/font.css');
@import url('./assets/css/global.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> </style>
......
This diff is collapsed.
...@@ -267,11 +267,11 @@ export default { ...@@ -267,11 +267,11 @@ export default {
right: 0; right: 0;
overflow: auto; overflow: auto;
background: #f1f1f1; background: #f1f1f1;
padding: 20px;
box-sizing: border-box; box-sizing: border-box;
} }
.msgbox .messagebox .messagecontent .invalidHint { .msgbox .messagebox .messagecontent .invalidHint {
text-align: center; text-align: center;
margin:20px;
} }
.msgbox .messagebox .messagecontent .invalidHint span { .msgbox .messagebox .messagecontent .invalidHint span {
height: 22px; height: 22px;
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
:key="(msg.idClient || index)" :key="(msg.idClient || index)"
:isHistory="isHistory" :isHistory="isHistory"
@msg-loaded="msgLoaded" @msg-loaded="msgLoaded"
ref="chatitem"
></chat-item> ></chat-item>
<!-- <li class="u-msg item-time none" v-else>已无更多记录</li> --> <!-- <li class="u-msg item-time none" v-else>已无更多记录</li> -->
</ul> </ul>
...@@ -31,6 +32,9 @@ export default { ...@@ -31,6 +32,9 @@ export default {
msgLoadedTimer: null msgLoadedTimer: null
}; };
}, },
mounted () {
document.querySelector('#chat-list').addEventListener('scroll', this.handleScroll);
},
props: { props: {
type: String, type: String,
canLoadMore: [String, Boolean], canLoadMore: [String, Boolean],
...@@ -72,6 +76,19 @@ export default { ...@@ -72,6 +76,19 @@ export default {
// } // }
}, },
methods: { 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() { msgLoaded() {
clearTimeout(this.msgLoadedTimer); clearTimeout(this.msgLoadedTimer);
this.msgLoadedTimer = setTimeout(() => { this.msgLoadedTimer = setTimeout(() => {
...@@ -86,16 +103,18 @@ export default { ...@@ -86,16 +103,18 @@ export default {
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
margin: 0; margin: 0;
padding: 0; padding: 20px;
height: 100%;
overflow: auto;
} }
.chat__list li { .chat__list li {
list-style: none; list-style: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
margin-bottom: 12px; margin-bottom: 18px;
} }
.chat__list .u-msg { .chat__list .u-msg {
margin-bottom: 12px; margin-bottom: 18px;
} }
.chat__list .u-msg.item-time { .chat__list .u-msg.item-time {
color: #2d98da; 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' ...@@ -12,7 +12,6 @@ import editor from 'vue-html5-editor'
import 'vue-html5-editor/src/style.css' import 'vue-html5-editor/src/style.css'
import MyPlugin from '../plugin/plugin' import MyPlugin from '../plugin/plugin'
import encrypt from '../plugin/encry' import encrypt from '../plugin/encry'
Vue.use(editor) Vue.use(editor)
Vue.use(MyPlugin) Vue.use(MyPlugin)
Vue.use(ElementUI) 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