pull/571/head
零殇_Fanzero 2022-05-18 10:40:09 +08:00 committed by GitHub
parent dfd445f976
commit 2e3959bd12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 15 additions and 19 deletions

View File

@ -63,7 +63,7 @@
</template>
<span slot="title">
普通链接
<a-button class="!p-0" type="link" @click="handleCopyLink(`${encodeURI(attachment.path)}`)">
<a-button class="!p-0" type="link" @click="handleCopyLink(`${attachment.path}`)">
<a-icon type="copy" />
</a-button>
</span>
@ -74,11 +74,7 @@
<span slot="description">![{{ attachment.name }}]({{ attachment.path }})</span>
<span slot="title">
Markdown 格式
<a-button
class="!p-0"
type="link"
@click="handleCopyLink(`![${attachment.name}](${encodeURI(attachment.path)})`)"
>
<a-button class="!p-0" type="link" @click="handleCopyLink(`![${attachment.name}](${attachment.path})`)">
<a-icon type="copy" />
</a-button>
</span>

View File

@ -72,7 +72,7 @@
<span v-if="!isImage(item)" class="attachments-group-item-type">{{ item.suffix }}</span>
<span
v-else
:style="{ backgroundImage: `url('${encodeURI(item.thumbPath)}')` }"
:style="{ backgroundImage: `url('${item.thumbPath}')` }"
class="attachments-group-item-img"
loading="lazy"
/>
@ -259,7 +259,7 @@ export default {
return []
}
return this.list.selected.map(item => {
return `![${item.name}](${encodeURI(item.path)})`
return `![${item.name}](${item.path})`
})
},
htmlSyntaxList() {
@ -267,7 +267,7 @@ export default {
return []
}
return this.list.selected.map(item => {
return `<img src="${encodeURI(item.path)}" alt="${item.name}">`
return `<img src="${item.path}" alt="${item.name}">`
})
}
},
@ -378,8 +378,8 @@ export default {
if (!this.multiSelect) {
this.$emit('confirm', {
raw: [attachment],
markdown: [`![${attachment.name}](${encodeURI(attachment.path)})`],
html: [`<img src="${encodeURI(attachment.path)}" alt="${attachment.name}">`]
markdown: [`![${attachment.name}](${attachment.path})`],
html: [`<img src="${attachment.path}" alt="${attachment.name}">`]
})
this.modalVisible = false
return

View File

@ -69,7 +69,7 @@ export default {
const attachment = response.data
resolve({
name: attachment.name,
path: encodeURI(attachment.path)
path: attachment.path
})
})
.catch(e => {

View File

@ -52,7 +52,7 @@ export default {
},
handleSelectAttachment({ raw }) {
if (raw.length) {
this.$emit('input', encodeURI(raw[0].path))
this.$emit('input', raw[0].path)
}
},
focus() {

View File

@ -457,7 +457,7 @@ export default {
*/
handleSelectPostThumbnail({ raw }) {
if (raw.length) {
this.form.model.thumbnail = encodeURI(raw[0].path)
this.form.model.thumbnail = raw[0].path
}
this.attachmentSelectVisible = false
},

View File

@ -85,7 +85,7 @@
<span v-if="!isImage(item)" class="attachments-group-item-type">{{ item.suffix }}</span>
<span
v-else
:style="{ backgroundImage: `url('${encodeURI(item.thumbPath)}')` }"
:style="{ backgroundImage: `url('${item.thumbPath}')` }"
class="attachments-group-item-img"
loading="lazy"
/>

View File

@ -405,7 +405,7 @@ export default {
*/
handleSelectSheetThumbnail({ raw }) {
if (raw.length) {
this.form.model.thumbnail = encodeURI(raw[0].path)
this.form.model.thumbnail = raw[0].path
}
this.attachmentSelectVisible = false
},

View File

@ -77,7 +77,7 @@
>
<div class="photo-thumb photos-group-item">
<span
:style="{ backgroundImage: `url('${encodeURI(item.thumbnail)}')` }"
:style="{ backgroundImage: `url('${item.thumbnail}')` }"
class="photos-group-item-img"
loading="lazy"
/>

View File

@ -151,8 +151,8 @@ export default {
handleAttachmentSelected({ raw }) {
if (raw.length) {
const { path, thumbPath, name } = raw[0]
this.$set(this.form.model, 'url', encodeURI(path))
this.$set(this.form.model, 'thumbnail', encodeURI(thumbPath))
this.$set(this.form.model, 'url', path)
this.$set(this.form.model, 'thumbnail', thumbPath)
this.$set(this.form.model, 'name', name)
}
this.attachmentSelectModal.visible = false