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) => {
......
...@@ -78,5 +78,289 @@ export default { ...@@ -78,5 +78,289 @@ export default {
return null; return null;
} }
} }
Vue.prototype.loadFileICON = function (suffix) {
let icons = [{
"name": "\u7f51\u76d8BT\u79bb\u7ebf\u4e0b\u8f7d",
"filesType": "*.bt,*.torrent",
"filesIcon": {
"bt": ["fileicon-small-bt", "fileicon-large-bt", "fileicon-middle-bt"],
"torrent": ["fileicon-small-bt", "fileicon-large-bt", "fileicon-middle-bt"]
},
"entranceFile": "file-widget-1:bt\/start.js"
},
{
"name": "\u6d69\u8fb0CAD",
"group": "com.gstarcad.web",
"notSupport": "ie6",
"filesIcon": {
"dws": ["fileicon-small-dws", "fileicon-large-dws", "fileicon-middle-dws"],
"dwt": ["fileicon-small-dws", "fileicon-large-dws", "fileicon-middle-dws"],
"dxf": ["fileicon-small-dws", "fileicon-large-dws", "fileicon-middle-dws"],
"dwg": ["fileicon-small-dws", "fileicon-large-dws", "fileicon-middle-dws"],
"cad": ["fileicon-small-dws", "fileicon-large-dws", "fileicon-middle-dws"]
},
"entranceFile": "file-widget-1:cad\/start.js"
},
{
"name": "\u7f51\u76d8\u4ee3\u7801\u9605\u8bfb\u5668",
"notSupport": "ie",
"filesType": "*.txt,*.as,*.sh,*.c,*.cpp,*.h,*.cs,*.asp,*.css,*.pas,*.diff,*.patch,*.erl,*.groovy,*.java,*.jsp,*.js,*.json,*.pl,*.php,*.py,*.rb,*.sass,*.scss,*.scala,*.sql,*.vb,*.xml,*.xhtml,*.html,*.htm,*.md,*.less,*.lua,*.go,*.bat,*.wml",
"filesIcon": {
"as": ["fileicon-small-code", "fileicon-large-code"],
"sh": ["fileicon-small-code", "fileicon-large-code"],
"c": ["fileicon-small-code", "fileicon-large-code"],
"cpp": ["fileicon-small-code", "fileicon-large-code"],
"h": ["fileicon-small-code", "fileicon-large-code"],
"cs": ["fileicon-small-code", "fileicon-large-code"],
"asp": ["fileicon-small-code", "fileicon-large-code"],
"css": ["fileicon-small-code", "fileicon-large-code"],
"pas": ["fileicon-small-code", "fileicon-large-code"],
"diff": ["fileicon-small-code", "fileicon-large-code"],
"patch": ["fileicon-small-code", "fileicon-large-code"],
"erl": ["fileicon-small-code", "fileicon-large-code"],
"groovy": ["fileicon-small-code", "fileicon-large-code"],
"java": ["fileicon-small-code", "fileicon-large-code"],
"jsp": ["fileicon-small-code", "fileicon-large-code"],
"js": ["fileicon-small-code", "fileicon-large-code"],
"json": ["fileicon-small-code", "fileicon-large-code"],
"pl": ["fileicon-small-code", "fileicon-large-code"],
"php": ["fileicon-small-code", "fileicon-large-code"],
"py": ["fileicon-small-code", "fileicon-large-code"],
"rb": ["fileicon-small-code", "fileicon-large-code"],
"sass": ["fileicon-small-code", "fileicon-large-code"],
"scss": ["fileicon-small-code", "fileicon-large-code"],
"scala": ["fileicon-small-code", "fileicon-large-code"],
"sql": ["fileicon-small-code", "fileicon-large-code"],
"vb": ["fileicon-small-code", "fileicon-large-code"],
"xml": ["fileicon-small-code", "fileicon-large-code"],
"xhtml": ["fileicon-small-code", "fileicon-large-code"],
"html": ["fileicon-small-code", "fileicon-large-code"],
"htm": ["fileicon-small-code", "fileicon-large-code"],
"md": ["fileicon-small-code", "fileicon-large-code"],
"less": ["fileicon-small-code", "fileicon-large-code"],
"lua": ["fileicon-small-code", "fileicon-large-code"],
"go": ["fileicon-small-code", "fileicon-large-code"],
"bat": ["fileicon-small-code", "fileicon-large-code"],
"wml": ["fileicon-small-code", "fileicon-large-code"]
},
"entranceFile": "file-widget-1:codeReader\/start.js"
},
{
"name": "\u7f51\u76d8\u89e3\u538b\u7f29",
"filesType": "*.rar,*.zip",
"notSupport": "ie6",
"filesIcon": {
"rar": ["fileicon-small-zip", "fileicon-large-zip", "fileicon-middle-zip"],
"zip": ["fileicon-small-zip", "fileicon-large-zip", "fileicon-middle-zip"]
},
"depsFiles": ["file-widget-1:zip\/util\/css\/fileUnzip.css", "file-widget-1:zip\/util\/css\/list-view.css"],
"entranceFile": "file-widget-1:zip\/start.js"
},
{
"name": "\u7f51\u76d8\u6587\u6863\u9605\u8bfb\u5668",
"filesType": "*.txt,*.pdf,*.doc,*.docx,*.ppt,*.pptx,*.xls,*.xlsx,*.rtf",
"filesIcon": {
"txt": ["fileicon-small-txt", "fileicon-large-txt", "fileicon-middle-txt"],
"rtf": ["fileicon-small-txt", "fileicon-large-txt", "fileicon-middle-txt"],
"pdf": ["fileicon-small-pdf", "fileicon-large-pdf", "fileicon-middle-pdf"],
"doc": ["fileicon-small-doc", "fileicon-large-doc", "fileicon-middle-doc"],
"docx": ["fileicon-small-doc", "fileicon-large-doc", "fileicon-middle-doc"],
"ppt": ["fileicon-small-ppt", "fileicon-large-ppt", "fileicon-middle-ppt"],
"pptx": ["fileicon-small-ppt", "fileicon-large-ppt", "fileicon-middle-ppt"],
"xls": ["fileicon-small-xls", "fileicon-large-xls", "fileicon-middle-xls"],
"xlsx": ["fileicon-small-xls", "fileicon-large-xls", "fileicon-middle-xls"],
"vsd": ["fileicon-small-vsd", "fileicon-large-vsd", "fileicon-middle-vsd"]
},
"depsFiles": ["file-widget-1:doc\/util\/docReader.css", "file-widget-1:doc\/pdfJsReader\/pdfJsReader.less", "base:thirdParty\/pdfjs\/_nomd5_nomod\/web\/trans-viewer.less", "base:thirdParty\/pdfjs\/_nomd5_nomod\/web\/viewer.less"],
"entranceFile": "file-widget-1:doc\/start.js"
},
{
"name": "\u7f51\u76d8\u56fe\u7247\u9884\u89c8",
"filesType": "*.jpg,*.jpeg,*.livp,*.gif,*bmp,*.png,*jpe,*.cur,*.svgz,*.ico,*.heic,*.heif,*.avci,*.webp",
"filesIcon": {
"jpg": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"jpeg": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"livp": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"gif": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"bmp": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"png": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"jpe": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"cur": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"svgz": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"tif": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"tiff": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"ico": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"heic": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"heif": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"avci": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"]
},
"depsFiles": ["file-widget-1:image\/util\/picCategory-dialog\/css\/picCategory-dialog.css", "file-widget-1:image\/util\/picPreview\/css\/picPreview.css", "file-widget-1:image\/util\/picPreviewAside\/css\/picPreviewAside.css", "file-widget-1:image\/util\/showPic\/css\/showPic.css", "file-widget-1:image\/util\/thumbnailPic\/css\/thumbnailPic.css", "base:thirdParty\/videojs\/_nomd5_nomod\/video-js.css"],
"entranceFile": "file-widget-1:image\/start.js"
},
{
"name": "\u767e\u5ea6\u8111\u56fe",
"group": "com.baidu.naotu",
"filesType": "*.mmap,*.xmind,*.mm",
"notSupport": "ie6",
"filesIcon": {
"mmap": ["fileicon-small-mmap", "fileicon-large-mmap", "fileicon-middle-mmap"],
"xmind": ["fileicon-small-xmind", "fileicon-large-xmind", "fileicon-middle-xmind"],
"mm": ["fileicon-small-mm", "fileicon-large-mm", "fileicon-middle-mm"]
},
"entranceFile": "file-widget-1:mindmap\/start.js"
},
{
"name": "\u7f51\u76d8\u97f3\u9891\u64ad\u653e\u5668",
"notSupport": "ie6",
"filesType": "*.wma,*.wav,*.mp3,*.aac,*.ra,*.ram,*.mp2,*.ogg,*.aif,*.mpega,*.amr,*.mid,*.midi,*.m4a",
"filesIcon": {
"wma": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"wav": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"mp3": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"aac": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"ra": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"ram": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"mp2": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"ogg": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"aif": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"mpega": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"amr": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"mid": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"midi": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"],
"m4a": ["fileicon-small-mp3", "fileicon-large-mp3", "fileicon-middle-mp3"]
},
"buttons": [{
"title": "\u97f3\u4e50\u64ad\u653e",
"name": "play-music",
"position": "listTools",
"index": 2,
"disabled": "none",
"icon": "icon-play",
"buttonStyle": "normal",
"conditions": {
"pageModule": "list,share,search,category,searchGlobal",
"filesType": "wma,wav,mp3,aac,ra,ram,mp2,ogg,aif,mpega,amr,mid,midi,m4a",
"filesTypeStrongMatch": true
}
}],
"depsFiles": ["file-widget-1:musicPlay\/util\/mbox\/musicbox.css"],
"entranceFile": "file-widget-1:musicPlay\/start.js"
},
{
"name": "\u7f51\u76d8\u5927\u56fe\u9884\u89c8",
"filesType": "*.jpg,*.jpeg,*.gif,*bmp,*.png,*jpe,*.cur,*.svgz,*.ico",
"filesIcon": {
"jpg": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"jpeg": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"gif": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"bmp": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"png": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"jpe": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"cur": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"svgz": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"tif": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"tiff": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"],
"ico": ["fileicon-small-pic", "default-large", "fileicon-middle-pic"]
},
"depsFiles": ["file-widget-1:preview\/picPreview.css"],
"entranceFile": "file-widget-1:preview\/start.js"
},
{
"name": "sysIcon",
"filesType": "*.exe,*.msi,*.dmg,*.pkg,*.psd,*.apk,*.key,*.ai,*.ipa",
"filesIcon": {
"exe": ["fileicon-sys-s-exe", "fileicon-sys-l-exe"],
"msi": ["fileicon-sys-s-exe", "fileicon-sys-l-exe"],
"dmg": ["fileicon-sys-s-exe", "fileicon-sys-l-dmg"],
"pkg": ["fileicon-sys-s-exe", "fileicon-sys-l-dmg"],
"psd": ["fileicon-sys-s-psd", "fileicon-sys-l-psd"],
"apk": ["fileicon-sys-s-apk", "fileicon-sys-l-apk"],
"key": ["fileicon-sys-s-key", "fileicon-sys-l-key"],
"ai": ["fileicon-sys-s-ai", "fileicon-sys-l-ai"],
"ipa": ["fileicon-sys-s-ipa", "fileicon-sys-l-ipa"],
"pages": ["fileicon-sys-s-pages", "fileicon-sys-l-pages"],
"numbers": ["fileicon-sys-s-numbers", "fileicon-sys-l-numbers"],
"eot": ["fileicon-sys-s-fonts", "fileicon-sys-l-fonts"],
"ttf": ["fileicon-sys-s-fonts", "fileicon-sys-l-fonts"],
"woff": ["fileicon-sys-s-fonts", "fileicon-sys-l-fonts"],
"eps": ["fileicon-sys-s-eps", "fileicon-sys-l-eps"],
"lnk": ["fileicon-sys-s-links", "fileicon-sys-l-links"],
"link": ["fileicon-sys-s-links", "fileicon-sys-l-links"],
"swf": ["fileicon-sys-s-swf", "fileicon-sys-l-swf"],
"php": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"c": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"js": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"css": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"html": ["fileicon-sys-s-web", "fileicon-sys-l-web"],
"htm": ["fileicon-sys-s-web", "fileicon-sys-l-web"],
"xhtml": ["fileicon-sys-s-web", "fileicon-sys-l-web"],
"java": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"cc": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"python": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"json": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"sh": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"bat": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"ejs": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"xml": ["fileicon-sys-s-code", "fileicon-sys-l-code"],
"ts": ["fileicon-sys-s-video", "fileicon-sys-l-video"]
}
},
{
"name": "\u7f51\u76d8\u89c6\u9891",
"filesType": "*.wmv,*.rmvb,*.mpeg4,*.mpeg2,*.flv,*.avi,*.3gp,*.mpga,*.qt,*.rm,*.wmz,*.wmd,*.wvx,*.wmx,*.wm,*.mpg,*.mp4,*.mkv,*.mpeg,*mov,*.asf,*.m4v,*.m3u8",
"filesIcon": {
"wmv": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"rmvb": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"mpeg4": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"mpeg2": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"flv": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"avi": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"3gp": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"mpga": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"qt": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"rm": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"wmz": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"wmd": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"wvx": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"wmx": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"wm": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"mpg": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"mp4": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"mkv": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"mpeg": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"mov": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"asf": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"m4v": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"],
"m3u8": ["fileicon-small-video", "fileicon-large-video", "fileicon-middle-video"]
},
"preload": true,
"entranceFile": "file-widget-1:video\/start.js"
}
]
if (suffix == "")
return "dir-small"
let css = ""
icons.forEach(x => {
//console.log(x.filesIcon.hasOwnProperty(suffix))
if (x.filesIcon.hasOwnProperty(suffix)) {
css = x.filesIcon[suffix][1]
return false
}
})
if (css == '') {
css = 'default-small'
}
return css;
}
} }
} }
<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>
......
.default-small,.fileicon-small-video,.fileicon-small-zip,.fileicon-small-bt, .fileicon-small-dws, .fileicon-small-code, .fileicon-small-txt, .fileicon-small-pdf, .fileicon-small-doc, .fileicon-small-ppt, .fileicon-small-xls, .fileicon-small-vsd, .fileicon-small-pic, .fileicon-small-mmap, .fileicon-small-xmind, .fileicon-small-mm, .fileicon-small-mp3, .icon-play-music, .default-small, .dir-multi-small, .dir-multi-middle, .dir-small, .dir-cang-small, .dir-app-small, .dir-apps-small, .dir-backup-small, .dir-share-middle, .dir-phone-small, .fileicon-sys-s-exe, .fileicon-sys-s-apk, .fileicon-sys-s-psd, .fileicon-sys-s-key, .fileicon-sys-s-ai {
background-image: url('../img/im/icons_file.png');
}
.fileIcon {
cursor: default;
display: inline-block;
height: 100%;
width: 100%;
vertical-align: middle;
margin:0px 5px 0 0;
}
.icon-upload {
color: #fff
}
.icon-atv {
font-size: 18px;
line-height: 30px;
text-align: center;
top: 20px
}
.fileicon-small-bt {
background-repeat: no-repeat;
}
.fileicon-small-dws {
background-repeat: no-repeat;
}
.fileicon-small-code {
background-repeat: no-repeat;
}
.fileicon-small-txt {
background-repeat: no-repeat;
}
.fileicon-small-pdf {
background-repeat: no-repeat;
}
.fileicon-small-doc {
background-repeat: no-repeat;
}
.fileicon-small-ppt {
background-repeat: no-repeat;
}
.fileicon-small-xls {
background-repeat: no-repeat;
}
.fileicon-small-vsd {
background-repeat: no-repeat;
}
.fileicon-large-txt {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/Text_54_6d41969.png) center no-repeat
}
.fileicon-large-pdf {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/PDF_54_ae4e37a.png) center no-repeat
}
.fileicon-large-doc {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/Word_54_6167687.png) center no-repeat
}
.fileicon-large-ppt {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/PPT_54_0b3dc6d.png) center no-repeat
}
.fileicon-large-xls {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/Excel_54_08289af.png) center no-repeat
}
.fileicon-large-vsd {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/Visio_54_c3dd4c6.png) center no-repeat
}
.fileicon-middle-txt {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/middleListIcon_a31d29b.png) -161px -1px
}
.fileicon-middle-pdf {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/middleListIcon_a31d29b.png) -41px -1px
}
.fileicon-middle-doc {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/middleListIcon_a31d29b.png) -81px -1px
}
.fileicon-middle-ppt {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/middleListIcon_a31d29b.png) -281px -1px
}
.fileicon-middle-xls {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/middleListIcon_a31d29b.png) -121px -1px
}
.fileicon-middle-rar {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/middleListIcon_a31d29b.png) -319px -51px
}
.fileicon-middle-zip {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/middleListIcon_a31d29b.png) -41px -52px
}
.fileicon-small-pic {
background-repeat: no-repeat;
}
.fileicon-middle-pic {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/middleListIcon_a31d29b.png) -1px -51px
}
.fileicon-small-mmap {
background-repeat: no-repeat;
}
.fileicon-small-xmind {
background-repeat: no-repeat;
}
.fileicon-small-mm {
background-repeat: no-repeat;
}
.fileicon-large-mmap {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/MMAP_54_5451eab.png) center no-repeat
}
.fileicon-large-xmind {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/Xmind_54_3bb4e79.png) center no-repeat
}
.fileicon-large-mm {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/MM_54_6380666.png) center no-repeat
}
.fileicon-middle-mmap {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/middleListIcon_a31d29b.png) -161px -51px
}
.fileicon-middle-xmind {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/middleListIcon_a31d29b.png) -201px -51px
}
.fileicon-middle-mm {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/middleListIcon_a31d29b.png) -241px -51px
}
.fileicon-small-mp3 {
background-repeat: no-repeat;
}
.fileicon-large-mp3 {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/Music_54_fd75225.png) center no-repeat
}
.icon-play-music {
background-repeat: no-repeat;
}
.g-button:hover .icon-play-music {
background-position: -30px -30px
}
.fileicon-middle-mp3 {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/middleListIcon_a31d29b.png) -201px -1px
}
.g-button:hover .icon-edit {
background-position: -90px -27px
}
.default-small {
background-repeat: no-repeat;
}
.dir-multi-small {
background-repeat: no-repeat;
}
.dir-multi-middle {
background-repeat: no-repeat;
}
.dir-small {
background-repeat: no-repeat;
}
.dir-share-small {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/Share_24_f21bad6.png) center no-repeat
}
.dir-cang-small {
background-repeat: no-repeat;
}
.dir-card-small {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/card_24_ff51176.png) center no-repeat
}
.dir-app-small,.dir-apps-small {
background-repeat: no-repeat;
}
.dir-backup-small {
background-repeat: no-repeat;
}
.default-middle {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/sprite_list_icon30_891cc19.png) -561px 0 no-repeat
}
.dir-middle {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/sprite_list_icon30_891cc19.png) -202px -100px no-repeat
}
.dir-share-middle {
background-repeat: no-repeat;
}
.dir-cang-middle {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/sprite_list_icon30_891cc19.png) -82px -100px no-repeat
}
.dir-app-middle,.dir-apps-middle {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/sprite_list_icon30_891cc19.png) -2px -100px no-repeat
}
.dir-backup-middle {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/sprite_list_icon30_891cc19.png) -122px -100px no-repeat
}
.default-large {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/Misc_54_f86ddc2.png) center no-repeat
}
.dir-large {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/Folder_54_fe544cc.png) center no-repeat
}
.dir-share-large {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/Share_54_142956d.png) center no-repeat
}
.dir-cang-large {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/Collection_54_7849a8d.png) center no-repeat
}
.dir-card-large {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/card_54_b068d33.png) center no-repeat
}
.dir-app-large,.dir-apps-large {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/MyData_54_cb4dfe9.png) center no-repeat
}
.dir-backup-large {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/PC_54_e2efc5f.png) center no-repeat
}
.dir-multi-large {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/gridIcon_7165cae.png) -600px -100px no-repeat
}
.dir-phone-large {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/Phone_54_a774466.png) center no-repeat
}
.dir-phone-small {
background-repeat: no-repeat;
}
.fileicon-sys-s-exe {
background-repeat: no-repeat;
}
.fileicon-sys-s-apk {
background-repeat: no-repeat;
}
.fileicon-sys-s-psd {
background-repeat: no-repeat;
}
.fileicon-sys-s-key {
background-repeat: no-repeat;
}
.fileicon-sys-s-ai {
background-repeat: no-repeat;
}
.fileicon-sys-s-ipa {
background-repeat: no-repeat;
}
.fileicon-sys-s-vsd {
background-repeat: no-repeat;
}
.fileicon-sys-s-pages {
background-repeat: no-repeat;
}
.fileicon-sys-s-numbers {
background-repeat: no-repeat;
}
.fileicon-sys-s-fonts {
background-repeat: no-repeat;
}
.fileicon-sys-s-code {
background-repeat: no-repeat;
}
.fileicon-sys-s-web {
background-repeat: no-repeat;
}
.fileicon-sys-s-links {
background-repeat: no-repeat;
}
.fileicon-sys-s-eps {
background-repeat: no-repeat;
}
.fileicon-sys-s-swf {
background-repeat: no-repeat;
}
.fileicon-sys-s-video {
background-repeat: no-repeat;
}
.fileicon-sys-l-dmg,.fileicon-sys-l-exe {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/EXE_54_a0ff130.png) center no-repeat
}
.fileicon-sys-l-apk {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/Android_54_b57a094.png) center no-repeat
}
.fileicon-sys-l-psd {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/PS_54_93523dc.png) center no-repeat
}
.fileicon-sys-l-key {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/Keynote_54_96fb842.png) center no-repeat
}
.fileicon-sys-l-ai {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/AI_54_345b023.png) center no-repeat
}
.fileicon-sys-l-vsd {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/Visio_54_c3dd4c6.png) center no-repeat
}
.fileicon-sys-l-ipa {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/Apple_54_7d9656c.png) center no-repeat
}
.fileicon-sys-l-pages {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/Pages_54_e91ce45.png) center no-repeat
}
.fileicon-sys-l-numbers {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/Numbers_54_dac4f63.png) center no-repeat
}
.fileicon-sys-l-fonts {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/Fonts_54_db07580.png) center no-repeat
}
.fileicon-sys-l-code {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/Code_54_cffd46f.png) center no-repeat
}
.fileicon-sys-l-web {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/Web_54_195198e.png) center no-repeat
}
.fileicon-sys-l-links {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/Links_54_e5e6311.png) center no-repeat
}
.fileicon-sys-l-eps {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/EPS_54_3dad67a.png) center no-repeat
}
.fileicon-sys-l-swf {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/Flash_54_1af0d00.png) center no-repeat
}
.fileicon-sys-l-video {
background: url(https://pan.baidu.com/box-static/file-widget-1/sysIcon/img/Video_54_7880c8d.png) center no-repeat
}
.fileicon-small-video {
background-repeat: no-repeat;
}
.fileicon-large-video {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/Video_54_7880c8d.png) center no-repeat
}
.fileicon-middle-video {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/middleListIcon_a31d29b.png) -240px -1px
}
.fileicon-small-zip {
background-repeat: no-repeat;
}
.fileicon-large-zip {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/ZIP_54_667d9c9.png) center no-repeat
}
.fileicon-small-rar {
background-repeat: no-repeat;
}
.fileicon-large-rar {
background: url(https://pan.baidu.com/box-static/file-widget-1/common/RAR_54_7b7bbfb.png) center no-repeat
}
.fileicon-small-bt {
background-position: -596px 0px
}
.fileicon-small-dws {
background-position: -596px -34px
}
.fileicon-small-code {
background-position: -596px -68px
}
.fileicon-small-txt {
background-position: -596px -102px
}
.fileicon-small-pdf {
background-position: -596px -136px
}
.fileicon-small-doc {
background-position: -596px -170px
}
.fileicon-small-ppt {
background-position: -596px -204px
}
.fileicon-small-xls {
background-position: -596px -238px
}
.fileicon-small-vsd {
background-position: -596px -272px
}
.fileicon-small-pic {
background-position: -596px -306px
}
.fileicon-small-mmap {
background-position: -596px -340px
}
.fileicon-small-xmind {
background-position: -596px -374px
}
.fileicon-small-mm {
background-position: -596px -408px
}
.fileicon-small-mp3 {
background-position: -596px -442px
}
.icon-play-music {
background-position: -361px -506px
}
.default-small {
background-position: -596px -566px
}
.dir-multi-small {
background-position: -500px -630px
}
.dir-multi-middle {
background-position: -280px -752px
}
.dir-small {
background-position: -594px -862px
}
.dir-cang-small {
background-position: -594px -898px
}
.dir-app-small,.dir-apps-small {
background-position: -594px -934px
}
.dir-backup-small {
background-position: -594px -970px
}
.dir-share-middle {
background-position: -588px -1006px
}
.dir-phone-small {
background-position: -594px -1048px
}
.fileicon-sys-s-exe {
background-position: -596px -1084px
}
.fileicon-sys-s-apk {
background-position: -596px -1118px
}
.fileicon-sys-s-psd {
background-position: -596px -1152px
}
.fileicon-sys-s-key {
background-position: -596px -1186px
}
.fileicon-sys-s-ai {
background-position: -596px -1220px
}
.fileicon-sys-s-ipa {
background-position: -596px -1254px
}
.fileicon-sys-s-vsd {
background-position: -596px -1288px
}
.fileicon-sys-s-pages {
background-position: -596px -1322px
}
.fileicon-sys-s-numbers {
background-position: -596px -1356px
}
.fileicon-sys-s-fonts {
background-position: -596px -1390px
}
.fileicon-sys-s-code {
background-position: -596px -1424px
}
.fileicon-sys-s-web {
background-position: -594px -1458px
}
.fileicon-sys-s-links {
background-position: -596px -1494px
}
.fileicon-sys-s-eps {
background-position: -596px -1528px
}
.fileicon-sys-s-swf {
background-position: -596px -1562px
}
.fileicon-sys-s-video {
background-position: -596px -1596px
}
.fileicon-small-video {
background-position: -596px -1630px
}
.fileicon-small-zip {
background-position: -596px -1664px
}
.fileicon-small-rar {
background-position: -596px -1698px
}
.g-button:hover .icon-history-gray {
background-position: -30px -58px
}
.icon-aside-share {
background: url(https://pan.baidu.com/box-static/function-widget-1/common/navigator_8461603.png)
}
a:hover .icon-aside-share {
background-position: -23px 0
}
.icon-print-gray {
background: url(https://pan.baidu.com/box-static/function-widget-1/common/plugin-icon_7318e47.png) -180px -28px no-repeat
}
.g-button:hover .icon-print-gray {
background-position: -210px -28px
}
.icon-beautify-gray {
background: url(https://pan.baidu.com/box-static/function-widget-1/common/plugin-icon_7318e47.png) -60px -58px no-repeat
}
.g-button:hover .icon-beautify-gray {
background-position: -90px -58px
}
.icon-puzzle-gray {
background: url(https://pan.baidu.com/box-static/function-widget-1/common/plugin-icon_7318e47.png) -120px -60px no-repeat
}
.g-button:hover .icon-puzzle-gray {
background-position: -150px -60px
}
.icon-qrCode-gray {
background-repeat: no-repeat;
}
.g-button:hover .icon-qrCode-gray {
background-repeat: no-repeat;
}
.icon-aside-recyclebin {
background: url(https://pan.baidu.com/box-static/function-widget-1/common/navigator_8461603.png) 0 -22px
}
a:hover .icon-aside-recyclebin {
background-position: -23px -22px
}
.icon-share-gray {
background: url(https://pan.baidu.com/box-static/function-widget-1/common/plugin-icon_7318e47.png) -180px 0 no-repeat
}
.g-button:hover .icon-share-gray {
background-position: -240px 0
}
.icon-share-blue {
background: url(https://pan.baidu.com/box-static/function-widget-1/common/plugin-icon_7318e47.png) -210px 0 no-repeat
}
.icon-share-blue:hover {
background-position: -240px 0
}
.icon-qrCode-gray {
background-position: 0px 0px
}
.g-button:hover .icon-qrCode-gray {
background-position: 0px -33px
}
.icon-qrCode-gray,.g-button:hover .icon-qrCode-gray {
background-image: url(https://pan.baidu.com/box-static/function-widget-1/icons_z_e5c1278.png)
}
\ No newline at end of file
...@@ -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;
......
...@@ -23,9 +23,8 @@ ...@@ -23,9 +23,8 @@
:flow="msg.flow" :flow="msg.flow"
:type="msg.type" :type="msg.type"
:class="{'in':msg.flow==='in','out':msg.flow==='out'}" :class="{'in':msg.flow==='in','out':msg.flow==='out'}"
> >
<!-- v-touch:hold="revocateMsg" --> <!-- v-touch:hold="revocateMsg" -->
<a class="msg-head" v-if="msg.avatar"> <a class="msg-head" v-if="msg.avatar">
<img class="icon u-circle" :src="msg.avatar"> <img class="icon u-circle" :src="msg.avatar">
</a> </a>
...@@ -33,20 +32,17 @@ ...@@ -33,20 +32,17 @@
<em>{{msg.showTime}}</em> <em>{{msg.showTime}}</em>
{{msg.from}} {{msg.from}}
</p> </p>
<div class="pool" ref="mediaMsgSplit"> <div class="pool" ref="mediaMsgSplit" v-if="msg.type!=='video'">
<img class="split-item" src="../../assets/img/im/left-3.png" v-if="msg.flow==='in'"> <img class="split-item" src="../../assets/img/im/left-3.png" v-if="msg.flow==='in'">
<img class="split-item" src="../../assets/img/im/right(1).png" v-if="msg.flow==='out'"> <img class="split-item" src="../../assets/img/im/right(1).png" v-if="msg.flow==='out'">
</div> </div>
<span v-if="msg.type==='text'" class="msg-text" v-html="msg.showText"></span> <span v-if="msg.type==='text'" class="msg-text" v-html="msg.showText"></span>
<span v-else-if="msg.type==='custom-type1'" class="msg-text" ref="mediaMsg"></span> <span v-else-if="msg.type==='custom-type1'" class="msg-text" ref="mediaMsg"></span>
<span v-else-if="msg.type==='custom-type3'" class="msg-text" ref="mediaMsg"></span> <span v-else-if="msg.type==='custom-type3'" class="msg-text" ref="mediaMsg"></span>
<span <span v-else-if="msg.type==='image'" class="msg-text" ref="mediaMsg"></span>
v-else-if="msg.type==='image'" <span v-else-if="msg.type==='video'" class="msg-text video">
class="msg-text" <video :src="msg.file.url" loop muted width="200" ref="msgvideo"></video>
ref="mediaMsg" </span>
@click.stop="showFullImg(msg.originLink)"
></span>
<span v-else-if="msg.type==='video'" class="msg-text" ref="mediaMsg"></span>
<span <span
v-else-if="msg.type==='audio'" v-else-if="msg.type==='audio'"
class="msg-text msg-audio" class="msg-text msg-audio"
...@@ -56,10 +52,37 @@ ...@@ -56,10 +52,37 @@
v-html="msg.showText" v-html="msg.showText"
></span> ></span>
<span v-else-if="msg.type==='file'" class="msg-text"> <span v-else-if="msg.type==='file'" class="msg-text">
<a :href="msg.fileLink" target="_blank"> <div class="file-box">
<i class="u-icon icon-file"></i> <div class="split">
{{msg.showText}} <div class="icon">
</a> <div class="fileIcon" :class="[msg.file.icon]"></div>
</div>
<div class="file-info">
<div class="name">{{msg.file.name}}</div>
<div class="size">{{msg.file.size}}</div>
</div>
</div>
<div class="opera-box">
<div class="pro" v-if='progess!=-1'>
<el-progress :percentage="progess" :show-text='false'></el-progress>
</div>
<div class="state" v-if="msg.locationPath!=='' && msg.locationPath!=='-1'">
<i class="iconfont icondagou"></i>已成功下载到本地
</div>
<div class="state" v-else>{{msg.locationPath!=='-1'?'未下载临时文件':'本地文件已被移除'}}</div>
<div class="btn" v-if="msg.locationPath!=='' && msg.locationPath!=='-1'">
<div class="item_btn" @click="openLocaltion(msg.locationPath)">打开</div>
<div class="item_btn" @click="openLocaltionFoled(msg.locationPath)">打开文件夹</div>
<div class="item_btn" @click="downloadFile(msg,1)">另存为</div>
</div>
<div class="btn" v-else>
<div class="item_btn" @click="downloadFile(msg,0)">{{msg.locationPath!=='-1'?'下载':'重新下载'}}</div>
<div class="item_btn" v-if="msg.ispreviwer">预览</div>
<div class="item_btn" @click="downloadFile(msg,1)">另存为</div>
</div>
</div>
</div>
</span> </span>
<!-- <span <!-- <span
v-else-if="msg.type==='robot'" v-else-if="msg.type==='robot'"
...@@ -116,18 +139,20 @@ ...@@ -116,18 +139,20 @@
<span v-if="msg.robotFlow!=='out' && !isRobot" class="msg-link"> <span v-if="msg.robotFlow!=='out' && !isRobot" class="msg-link">
<a class="link-right" @click="continueRobotMsg(msg.content.robotAccid)">继续对话</a> <a class="link-right" @click="continueRobotMsg(msg.content.robotAccid)">继续对话</a>
</span> </span>
</span> --> </span>-->
<span v-else-if="msg.type==='notification'" class="msg-text notify">{{msg.showText}}</span> <span v-else-if="msg.type==='notification'" class="msg-text notify">{{msg.showText}}</span>
<span v-else class="msg-text" v-html="msg.showText"></span> <span v-else class="msg-text" v-html="msg.showText"></span>
<span v-if="msg.status==='fail'" class="msg-failed"> <span v-if="msg.status==='fail'" class="msg-failed">
<i class="weui-icon-warn"></i> <i class="weui-icon-warn"></i>
</span> </span>
<!-- <a <!-- <a
v-if="teamMsgUnRead >=0" v-if="teamMsgUnRead >=0"
class="msg-unread" class="msg-unread"
:href="`#/msgReceiptDetail/${msg.to}-${msg.idServer}`" :href="`#/msgReceiptDetail/${msg.to}-${msg.idServer}`"
>{{teamMsgUnRead>0 ? `${teamMsgUnRead}人未读`: '全部已读'}}</a>--> >{{teamMsgUnRead>0 ? `${teamMsgUnRead}人未读`: '全部已读'}}</a>-->
</div> </div>
<div class="error-msg" v-if="msg.errormsg!=''">{{msg.errormsg}}</div>
</li> </li>
</template> </template>
<script> <script>
...@@ -170,7 +195,9 @@ export default { ...@@ -170,7 +195,9 @@ export default {
}, },
data() { data() {
return { return {
msg: "" msg: "",
isDownloading: false,
progess:-1
}; };
}, },
computed: { computed: {
...@@ -212,21 +239,25 @@ export default { ...@@ -212,21 +239,25 @@ export default {
if (item.type === "image") { if (item.type === "image") {
// 图片消息缩略图 // 图片消息缩略图
media = new Image(); media = new Image();
media.className = 'imimage' media.className = "imimage";
media.style.margin='-8px' media.style.margin = "-8px";
media.style.marginBottom='-14px' media.style.marginBottom = "-14px";
media.style.borderRadius='6px' media.style.borderRadius = "6px";
media.style.paddingRight='-10px' media.style.paddingRight = "-10px";
media.src = item.file.url + "?imageView&thumbnail=180x0&quality=85"; media.src = item.file.url + "?imageView&thumbnail=180x0&quality=85";
if(item.flow==='in'){ if (item.flow === "in") {
this.$refs.mediaMsg.style.width='170px' this.$refs.mediaMsg.style.width = "170px";
this.$refs.mediaMsg.style.overflow='hidden' this.$refs.mediaMsg.style.overflow = "hidden";
media.style.marginLeft='-18px' media.style.marginLeft = "-18px";
this.$refs.mediaMsgSplit.style.background=`url('${media.src}') top left` this.$refs.mediaMsgSplit.style.background = `url('${
}else{ media.src
this.$refs.mediaMsg.style.width='170px' }') top left`;
this.$refs.mediaMsg.style.overflow='hidden' } else {
this.$refs.mediaMsgSplit.style.background=`url('${media.src}') top right` this.$refs.mediaMsg.style.width = "170px";
this.$refs.mediaMsg.style.overflow = "hidden";
this.$refs.mediaMsgSplit.style.background = `url('${
media.src
}') top right`;
} }
} else if (item.type === "custom-type1") { } else if (item.type === "custom-type1") {
// 猜拳消息 // 猜拳消息
...@@ -238,22 +269,6 @@ export default { ...@@ -238,22 +269,6 @@ export default {
media = new Image(); media = new Image();
media.className = "emoji-big"; media.className = "emoji-big";
media.src = item.imgUrl; media.src = item.imgUrl;
} else if (item.type === "video") {
if (/(mov|mp4|ogg|webm)/i.test(item.file.ext)) {
media = document.createElement("video");
media.src = item.file.url;
media.width = 640;
media.height = 480;
media.autoStart = false;
media.preload = "metadata";
media.controls = "controls";
} else {
let aLink = document.createElement("a");
aLink.href = item.file.url;
aLink.target = "_blank";
aLink.innerHTML = `<i class="u-icon icon-file"></i>${video.name}`;
this.$refs.mediaMsg.appendChild(aLink);
}
} }
if (media) { if (media) {
if (this.$refs.mediaMsg) { if (this.$refs.mediaMsg) {
...@@ -336,10 +351,11 @@ export default { ...@@ -336,10 +351,11 @@ export default {
item.imgUrl = `${emojiCnt.img}`; item.imgUrl = `${emojiCnt.img}`;
} }
} else { } else {
this.formatCustom(item);
item.showText = util.parseCustomMsg(item); item.showText = util.parseCustomMsg(item);
if (item.showText !== "[自定义消息]") { // if (item.showText !== "[自定义消息]") {
item.showText += ",请到手机或电脑客户端查看"; // item.showText += ",请到手机或电脑客户端查看";
} // }
} }
} else if (item.type === "image") { } else if (item.type === "image") {
// 原始图片全屏显示 // 原始图片全屏显示
...@@ -414,6 +430,151 @@ export default { ...@@ -414,6 +430,151 @@ export default {
} }
this.msg = item; this.msg = item;
}, },
formatCustom(item) {
if (item.content) {
item.customData = JSON.parse(item.content).data;
if (/(.mov|.mp4|.ogg|.webm)/i.test(item.customData.content.fileName)) {
item.type = "video";
item.file = {
url: item.customData.content.fileUrl,
ext: item.customData.content.fileName,
name: item.customData.content.fileName
};
} else {
console.log(item);
if (item.customData.content.fileName) {
let exts = item.customData.content.fileName.split(".");
let fileType = exts[exts.length - 1].toLowerCase();
item.type = "file";
item.file = {
url: item.customData.content.fileUrl,
ext: exts[exts.length - 1].toLowerCase(),
name: item.customData.content.fileName,
size: item.customData.content.fileSize,
icon: this.loadFileICON(fileType)
};
item.ispreviwer = /(doc|docx|xls|xlsx|ppt|pptx|txt|pdf)/i.test(
item.file.ext
);
item.showText = item.customData.content.fileName;
let key = this.$encrypt.Encrypt(JSON.stringify(item.customData));
item.locationPath = this.getLocationPath(key);
item.locationFolder =
item.locationPath === ""
? ""
: item.locationPath.substring(
0,
item.locationPath.lastIndexOf("\\") + 1
);
}
}
}
},
downloadFile(msg, type) {
event.preventDefault();
if (type == 1) {
let dPath = msg.file.url;
let crt = this;
this.$electron.remote.dialog.showSaveDialog(
{
title: "麦子助手另存文件",
defaultPath: this.$electron.remote.getGlobal("defaultdownloaddir") + msg.file.name,
filters: [{ name: "麦子助手文件", extensions: [msg.file.ext] }]
},
function(res) {
if (res) {
crt.beginDownload(res);
}
}
);
} else {
this.beginDownload(
this.$electron.remote.getGlobal("defaultdownloaddir") + msg.file.name
);
}
},
beginDownload(res) {
this.isDownloading = true;
let key = this.$encrypt.Encrypt(JSON.stringify(this.msg.customData));
let name = res.substring(res.lastIndexOf("\\") + 1, res.length);
this.$electron.ipcRenderer.send(
"download",
this.msg.file.url,
res.substring(0, res.lastIndexOf("\\")),
name,
key
);
let that = this;
this.$electron.ipcRenderer.on("downloading", (event, progess) => {
that.progess=progess
})
this.$electron.ipcRenderer.once("downloadOver", (event, msgId, lpath) => {
//that.progess=-1
setTimeout(() => {
that.progess=-1
}, 1000);
this.$electron.ipcRenderer.removeListener("downloading", (event, progess) => {
that.progess=progess
});
let downloadFileList = [];
that.isDownloading = false;
let newDownLoad = { msgID: msgId, locationPath: lpath };
if (window.localStorage.downloadFileList) {
downloadFileList = JSON.parse(window.localStorage.downloadFileList);
let isUpdate = false;
downloadFileList.forEach((item, index) => {
if (item.msgID === msgId) {
item.locationPath = lpath;
isUpdate = true;
}
});
if (!isUpdate) {
downloadFileList.push(newDownLoad);
}
} else {
downloadFileList.push(newDownLoad);
}
window.localStorage.downloadFileList = JSON.stringify(downloadFileList);
that.msg.locationPath = lpath;
that.msg.locationFolder = lpath.substring(
0,
lpath.lastIndexOf("\\") + 1
);
});
},
getLocationPath(msgId) {
let downloadFileList = [];
if (window.localStorage.downloadFileList) {
downloadFileList = JSON.parse(window.localStorage.downloadFileList);
let dPath = "";
downloadFileList.forEach((item, index) => {
if (item.msgID === msgId) {
dPath = item.locationPath;
}
});
return dPath;
}
return "";
},
removeLocationPath(msgId) {
if (window.localStorage.downloadFileList) {
let downloadFileList = JSON.parse(window.localStorage.downloadFileList);
downloadFileList.forEach((item, index) => {
if (item.msgID === msgId) {
item.locationPath='-1'
}
});
window.localStorage.downloadFileList=JSON.stringify(downloadFileList)
}
},
bytesToSize(bytes) {
if (bytes === 0) return "0B";
var k = 1024;
var sizes = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
var i = Math.floor(Math.log(bytes) / Math.log(k));
return (bytes / Math.pow(k, i)).toFixed(1) + sizes[i];
},
revocateMsg(vNode) { revocateMsg(vNode) {
// 在会话聊天页 // 在会话聊天页
if (this.$store.state.currSessionId) { if (this.$store.state.currSessionId) {
...@@ -478,6 +639,21 @@ export default { ...@@ -478,6 +639,21 @@ export default {
continueRobotMsg(robotAccid) { continueRobotMsg(robotAccid) {
this.$store.dispatch("continueRobotMsg", robotAccid); this.$store.dispatch("continueRobotMsg", robotAccid);
}, },
openLocaltion(path) {
this.$electron.ipcRenderer.send("OpenFile", path)
let that=this
this.$electron.ipcRenderer.once("FileExsit", (event, have) => {
if(!have){
that.removeLocationPath(path)
that.msg.locationPath='-1'
that.msg.locationFolder=''
}
})
},
openLocaltionFoled(path) {
this.$electron.ipcRenderer.send("showItemInFolder", path);
},
showFullImg(src) { showFullImg(src) {
this.$store.dispatch("showFullscreenImg", { this.$store.dispatch("showFullscreenImg", {
src src
...@@ -574,6 +750,25 @@ export default { ...@@ -574,6 +750,25 @@ export default {
}; };
</script> </script>
<style scoped> <style scoped>
@import url("../../assets/css/icon.css");
.item-me .error-msg {
color: #eb3b5a;
font-size: 12px;
height: 20px;
line-height: 20px;
right: 50px;
bottom: -22px;
position: absolute;
}
.item-you .error-msg {
color: #eb3b5a;
font-size: 12px;
height: 20px;
line-height: 20px;
left: 50px;
bottom: -22px;
position: absolute;
}
.p-chat-history { .p-chat-history {
.u-msg { .u-msg {
.msg-link { .msg-link {
...@@ -681,10 +876,9 @@ export default { ...@@ -681,10 +876,9 @@ export default {
-webkit-user-select: text !important; -webkit-user-select: text !important;
box-sizing: border-box; box-sizing: border-box;
border: 1px solid rgb(220, 220, 220); border: 1px solid rgb(220, 220, 220);
} }
.item-me .out span { .item-me .out span {
background: rgba(71, 165, 255, 1) background: rgba(71, 165, 255, 1);
} }
.pool { .pool {
width: 11px; width: 11px;
...@@ -702,7 +896,7 @@ export default { ...@@ -702,7 +896,7 @@ export default {
.item-me .out .pool { .item-me .out .pool {
margin-right: 10px; margin-right: 10px;
margin-left: -1px; margin-left: -1px;
background: rgba(71, 165, 255, 1) background: rgba(71, 165, 255, 1);
} }
.pool .split-item { .pool .split-item {
width: 100%; width: 100%;
...@@ -712,10 +906,100 @@ export default { ...@@ -712,10 +906,100 @@ export default {
top: 0; top: 0;
z-index: 2; z-index: 2;
} }
.imimage{ .imimage {
margin: -8px; margin: -8px;
border-radius: 6px; border-radius: 6px;
margin-bottom: 10px; margin-bottom: 10px;
}
.msg-text.video {
margin: 0 10px;
margin-top: 12px;
}
.msg-text video {
margin: -8px;
margin-bottom: -14px;
border-radius: 6px;
}
.item-you .in .file-box {
width: 270px;
border-radius: 2px;
user-select: none;
}
.item-me .out .file-box {
background: #fff;
border: 1px solid #eee;
border-radius: 2px;
width: 270px;
box-sizing: border-box;
user-select: none;
}
.file-box .split {
padding: 5px;
border-bottom: 1px solid #eee;
display: flex;
}
.file-box .icon {
height: 60px;
width: 60px;
}
.file-box .file-info {
height: 60px;
overflow: hidden;
flex: 1;
margin-left: 5px;
}
.file-box .file-info .name {
height: 30px;
font-size: 20px;
color: #333;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.file-box .file-info .size {
height: 30px;
/* line-height: 30px; */
font-size: 12px;
color: #999;
}
.file-box .opera-box {
padding: 5px;
display: flex;
position: relative;
padding-top: 7px;
}
.file-box .opera-box .pro{
height: 5px;
top: -4px;
left: 5px;
right: 5px;
position: absolute;
}
.file-box .opera-box .btn {
flex: 1;
}
.file-box .opera-box .state {
font-size: 12px;
color: #888;
}
.file-box .opera-box .state i {
font-size: 14px;
color: #20bf6b;
margin-right: 3px;
}
.file-box .opera-box .btn {
text-align: right;
}
.file-box .opera-box .btn .item_btn {
font-size: 12px;
color: #0091e4;
margin-left: 3px;
cursor: pointer;
display: inline;
}
.file-box .opera-box .btn .item_btn:hover {
text-decoration: underline;
} }
/* .item-me .out .msg-head{ /* .item-me .out .msg-head{
position: absolute; position: absolute;
......
...@@ -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