mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-17 11:13:26 +00:00
perf: 聊天内容图片支持下载
This commit is contained in:
parent
d50d32147b
commit
9f8350da3f
@ -1622,7 +1622,16 @@ export default {
|
|||||||
value: event.target.href,
|
value: event.target.href,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (msgData.type === 'text' && msgData.msg.text.replace(/<[^>]+>/g,"").length > 0) {
|
if (msgData.type === 'text') {
|
||||||
|
if (event.target.nodeName === 'IMG') {
|
||||||
|
this.operateCopys.push({
|
||||||
|
type: 'imagedown',
|
||||||
|
icon: '',
|
||||||
|
label: '下载图片',
|
||||||
|
value: $A.rightDelete(event.target.currentSrc, '_thumb.jpg'),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (msgData.msg.text.replace(/<[^>]+>/g,"").length > 0) {
|
||||||
this.operateCopys.push({
|
this.operateCopys.push({
|
||||||
type: 'text',
|
type: 'text',
|
||||||
icon: '',
|
icon: '',
|
||||||
@ -1630,6 +1639,7 @@ export default {
|
|||||||
value: '',
|
value: '',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const projectRect = el.getBoundingClientRect();
|
const projectRect = el.getBoundingClientRect();
|
||||||
const wrapRect = this.$el.getBoundingClientRect();
|
const wrapRect = this.$el.getBoundingClientRect();
|
||||||
@ -1735,6 +1745,14 @@ export default {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'imagedown':
|
||||||
|
this.$store.dispatch('downUrl', {
|
||||||
|
url: value,
|
||||||
|
token: false
|
||||||
|
})
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
case 'link':
|
case 'link':
|
||||||
this.$copyText(value).then(_ => $A.messageSuccess('复制成功')).catch(_ => $A.messageError('复制失败'))
|
this.$copyText(value).then(_ => $A.messageSuccess('复制成功')).catch(_ => $A.messageError('复制失败'))
|
||||||
break;
|
break;
|
||||||
|
|||||||
7
resources/assets/js/store/actions.js
vendored
7
resources/assets/js/store/actions.js
vendored
@ -171,6 +171,12 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
let url = data;
|
let url = data;
|
||||||
|
let addToken = true
|
||||||
|
if ($A.isJson(data)) {
|
||||||
|
url = data.url
|
||||||
|
addToken = !!data.token
|
||||||
|
}
|
||||||
|
if (addToken) {
|
||||||
let params = {
|
let params = {
|
||||||
token: state.userToken
|
token: state.userToken
|
||||||
};
|
};
|
||||||
@ -179,6 +185,7 @@ export default {
|
|||||||
params = data.params || {};
|
params = data.params || {};
|
||||||
}
|
}
|
||||||
url = $A.urlAddParams(url, params);
|
url = $A.urlAddParams(url, params);
|
||||||
|
}
|
||||||
if ($A.Electron) {
|
if ($A.Electron) {
|
||||||
$A.Electron.request({action: 'openExternal', url}, () => {
|
$A.Electron.request({action: 'openExternal', url}, () => {
|
||||||
// 成功
|
// 成功
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user