Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Madara
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
Madara
Commits
fa5b4a85
Commit
fa5b4a85
authored
Oct 15, 2019
by
华国豪
🙄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化收藏, 收藏下载
parent
9d0c39a9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
3 deletions
+81
-3
CollectionContentList.vue
src/renderer/components/team/CollectionContentList.vue
+1
-1
CollectionContentListItem.vue
src/renderer/components/team/CollectionContentListItem.vue
+79
-1
CollectionSearchBox.vue
src/renderer/components/team/CollectionSearchBox.vue
+1
-1
No files found.
src/renderer/components/team/CollectionContentList.vue
View file @
fa5b4a85
...
...
@@ -43,6 +43,7 @@ export default {
.CollectionContentList
p
{
margin
:
0
;
padding
:
0
;
outline
:
none
;
}
.CollectionContentList
ul
li
{
...
...
@@ -65,7 +66,6 @@ export default {
}
.CollectionContentList
.item
.images
img
{
width
:
120px
;
height
:
60px
;
}
.CollectionContentList
.from-date
p
{
text-align
:
right
;
...
...
src/renderer/components/team/CollectionContentListItem.vue
View file @
fa5b4a85
...
...
@@ -2,6 +2,7 @@
<li
v-contextmenu:msg-contextmenu
@
click=
"preview"
>
<v-contextmenu
ref=
"msg-contextmenu"
>
<v-contextmenu-item
@
click=
"forwardMsg"
>
转发
</v-contextmenu-item>
<v-contextmenu-item
v-if=
"item.CollectionType !== 3 && item.CollectionType !== 1"
@
click=
"downloadFile"
>
另存为
</v-contextmenu-item>
<v-contextmenu-item
@
click=
"deleteCollection(item.ID)"
>
删除
</v-contextmenu-item>
</v-contextmenu>
<el-row
class=
"item"
:gutter=
"30"
>
...
...
@@ -33,7 +34,7 @@
</div>
</el-col>
<el-col
:span=
"8"
class=
"from-date"
>
<
!--
<p>
今天
</p>
--
>
<
p>
{{
item
.
CreateTime
}}
</p
>
<p
class=
"text-row1"
>
来自:
{{
item
.
FromUser
}}
</p>
</el-col>
<video
v-if=
"url!==''"
id=
"video"
:src=
"url"
controls=
"controls"
></video>
...
...
@@ -68,6 +69,7 @@ export default {
this
.
setData
()
},
methods
:
{
// 渲染
setData
:
function
(){
if
(
this
.
item
.
CollectionType
===
2
)
{
let
url
=
this
.
item
.
PicURL
...
...
@@ -97,6 +99,82 @@ export default {
})
}
},
// 下载文件
downloadFile
:
function
(){
event
.
preventDefault
();
let
data
=
this
.
item
let
file
=
JSON
.
parse
(
this
.
item
.
FromContent
)
console
.
log
(
"file"
,
file
,
data
.
PicURL
,
data
.
Content
)
let
crt
=
this
;
this
.
$electron
.
remote
.
dialog
.
showSaveDialog
(
{
title
:
"麦子助手另存文件"
,
defaultPath
:
this
.
$electron
.
remote
.
getGlobal
(
"defaultdownloaddir"
)
+
file
.
file
.
name
,
filters
:
[{
name
:
"麦子助手文件"
,
extensions
:
[
file
.
file
.
ext
]
}]
},
function
(
res
)
{
console
.
log
(
res
)
if
(
res
)
{
crt
.
beginDownload
(
res
);
}
}
);
},
beginDownload
(
res
)
{
this
.
isDownloading
=
true
;
let
file
=
JSON
.
parse
(
this
.
item
.
FromContent
)
let
key
=
file
.
file
.
md5
let
name
=
res
.
substring
(
res
.
lastIndexOf
(
"
\
\"
) + 1, res.length);
this.$electron.ipcRenderer.send(
"
download
",
file.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
);
});
},
// 转发
forwardMsg: function(){
let msg = JSON.parse(this.item.FromContent)
...
...
src/renderer/components/team/CollectionSearchBox.vue
View file @
fa5b4a85
...
...
@@ -105,7 +105,7 @@ export default {
}
.CollectionSearchBox
.type-box
li
div
i
.iconfont
{
color
:
#555
;
font-size
:
2
0
px
;
font-size
:
2
4
px
;
padding-right
:
15px
;
}
.CollectionSearchBox
.type-box
li
div
span
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment