| 
									
										
										
										
											2023-02-09 19:18:06 +00:00
										 |  |  | {{define "textModal"}} | 
					
						
							|  |  |  | <a-modal id="text-modal" v-model="txtModal.visible" :title="txtModal.title" | 
					
						
							| 
									
										
										
										
											2024-02-21 11:46:27 +00:00
										 |  |  |          :closable="true" | 
					
						
							|  |  |  |          :class="themeSwitcher.currentTheme"> | 
					
						
							|  |  |  |     <template slot="footer"> | 
					
						
							|  |  |  |         <a-button v-if="!ObjectUtil.isEmpty(txtModal.fileName)" icon="download" | 
					
						
							|  |  |  |             :href="'data:application/text;charset=utf-8,' + encodeURIComponent(txtModal.content)" | 
					
						
							|  |  |  |             :download="txtModal.fileName">[[ txtModal.fileName ]] | 
					
						
							|  |  |  |         </a-button> | 
					
						
							|  |  |  |             <a-button type="primary" id="copy-btn">{{ i18n "copy" }}</a-button> | 
					
						
							|  |  |  |     </template> | 
					
						
							| 
									
										
										
										
											2024-02-22 19:20:38 +00:00
										 |  |  |     <a-input style="overflow-y: auto;" type="textarea" v-model="txtModal.content" | 
					
						
							| 
									
										
										
										
											2024-02-21 11:46:27 +00:00
										 |  |  |         :autosize="{ minRows: 10, maxRows: 20}"></a-input> | 
					
						
							| 
									
										
										
										
											2023-02-09 19:18:06 +00:00
										 |  |  | </a-modal> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <script> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     const txtModal = { | 
					
						
							|  |  |  |         title: '', | 
					
						
							|  |  |  |         content: '', | 
					
						
							|  |  |  |         fileName: '', | 
					
						
							|  |  |  |         qrcode: null, | 
					
						
							|  |  |  |         clipboard: null, | 
					
						
							|  |  |  |         visible: false, | 
					
						
							| 
									
										
										
										
											2023-05-08 14:44:22 +00:00
										 |  |  |         show: function (title = '', content = '', fileName = '') { | 
					
						
							| 
									
										
										
										
											2023-02-09 19:18:06 +00:00
										 |  |  |             this.title = title; | 
					
						
							|  |  |  |             this.content = content; | 
					
						
							|  |  |  |             this.fileName = fileName; | 
					
						
							|  |  |  |             this.visible = true; | 
					
						
							|  |  |  |             textModalApp.$nextTick(() => { | 
					
						
							|  |  |  |                 if (this.clipboard === null) { | 
					
						
							| 
									
										
										
										
											2024-02-21 11:46:27 +00:00
										 |  |  |                     this.clipboard = new ClipboardJS('#copy-btn', { | 
					
						
							| 
									
										
										
										
											2023-02-09 19:18:06 +00:00
										 |  |  |                         text: () => this.content, | 
					
						
							|  |  |  |                     }); | 
					
						
							| 
									
										
										
										
											2023-12-08 19:08:44 +00:00
										 |  |  |                     this.clipboard.on('success', () => { | 
					
						
							|  |  |  |                         app.$message.success('{{ i18n "copied" }}') | 
					
						
							|  |  |  |                         this.close(); | 
					
						
							|  |  |  |                     }); | 
					
						
							| 
									
										
										
										
											2023-02-09 19:18:06 +00:00
										 |  |  |                 } | 
					
						
							|  |  |  |             }); | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         close: function () { | 
					
						
							|  |  |  |             this.visible = false; | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     const textModalApp = new Vue({ | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  |         delimiters: ['[[', ']]'], | 
					
						
							| 
									
										
										
										
											2023-02-09 19:18:06 +00:00
										 |  |  |         el: '#text-modal', | 
					
						
							|  |  |  |         data: { | 
					
						
							|  |  |  |             txtModal: txtModal, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | </script> | 
					
						
							| 
									
										
										
										
											2024-02-22 19:20:38 +00:00
										 |  |  | {{end}} |