mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-17 19:23:26 +00:00
perf: 聊天内容图片支持下载
This commit is contained in:
parent
d50d32147b
commit
9f8350da3f
@ -1622,13 +1622,23 @@ 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') {
|
||||||
this.operateCopys.push({
|
if (event.target.nodeName === 'IMG') {
|
||||||
type: 'text',
|
this.operateCopys.push({
|
||||||
icon: '',
|
type: 'imagedown',
|
||||||
label: this.operateCopys.length > 0 ? '复制文本' : '复制',
|
icon: '',
|
||||||
value: '',
|
label: '下载图片',
|
||||||
})
|
value: $A.rightDelete(event.target.currentSrc, '_thumb.jpg'),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (msgData.msg.text.replace(/<[^>]+>/g,"").length > 0) {
|
||||||
|
this.operateCopys.push({
|
||||||
|
type: 'text',
|
||||||
|
icon: '',
|
||||||
|
label: this.operateCopys.length > 0 ? '复制文本' : '复制',
|
||||||
|
value: '',
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const projectRect = el.getBoundingClientRect();
|
const projectRect = 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;
|
||||||
|
|||||||
19
resources/assets/js/store/actions.js
vendored
19
resources/assets/js/store/actions.js
vendored
@ -171,14 +171,21 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
let url = data;
|
let url = data;
|
||||||
let params = {
|
let addToken = true
|
||||||
token: state.userToken
|
|
||||||
};
|
|
||||||
if ($A.isJson(data)) {
|
if ($A.isJson(data)) {
|
||||||
url = data.url;
|
url = data.url
|
||||||
params = data.params || {};
|
addToken = !!data.token
|
||||||
|
}
|
||||||
|
if (addToken) {
|
||||||
|
let params = {
|
||||||
|
token: state.userToken
|
||||||
|
};
|
||||||
|
if ($A.isJson(data)) {
|
||||||
|
url = data.url;
|
||||||
|
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