Files
trihuy-russian/web/html/modals/text_modal.html
T

51 lines
1.6 KiB
HTML
Raw Normal View History

{{define "modals/textModal"}}
2025-04-06 16:40:33 +07:00
<a-modal id="text-modal" v-model="txtModal.visible" :title="txtModal.title" :closable="true"
:class="themeSwitcher.currentTheme">
<a-input :style="{ overflowY: 'auto' }" type="textarea" v-model="txtModal.content"
:autosize="{ minRows: 10, maxRows: 20}"></a-input>
2024-02-21 15:16:27 +03:30
<template slot="footer">
<a-button v-if="!ObjectUtil.isEmpty(txtModal.fileName)" icon="download"
@click="FileManager.downloadTextFile(txtModal.content, txtModal.fileName)">
2025-04-06 16:40:33 +07:00
<span>[[ txtModal.fileName ]]</span>
</a-button>
<a-button type="primary" icon="copy" @click="txtModal.copy(txtModal.content)">
<span>{{ i18n "copy" }}</span>
2024-02-21 15:16:27 +03:30
</a-button>
</template>
2023-02-09 22:48:06 +03:30
</a-modal>
<script>
const txtModal = {
title: '',
content: '',
fileName: '',
qrcode: null,
visible: false,
2023-05-08 19:14:22 +04:30
show: function (title = '', content = '', fileName = '') {
2023-02-09 22:48:06 +03:30
this.title = title;
this.content = content;
this.fileName = fileName;
this.visible = true;
2025-03-07 02:43:46 +07:00
},
copy: function (content = '') {
2025-03-07 07:27:33 +00:00
ClipboardManager
.copyText(content)
.then(() => {
app.$message.success('{{ i18n "copied" }}')
this.close();
})
2023-02-09 22:48:06 +03:30
},
close: function () {
this.visible = false;
},
};
const textModalApp = new Vue({
2023-03-17 19:37:49 +03:30
delimiters: ['[[', ']]'],
2023-02-09 22:48:06 +03:30
el: '#text-modal',
data: {
txtModal: txtModal,
},
});
</script>
2025-04-06 16:40:33 +07:00
{{end}}