mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-01 02:38:43 +08:00 
			
		
		
		
	基于 screw 实现一个 mvp 的数据库文档功能
This commit is contained in:
		
							
								
								
									
										10
									
								
								ruoyi-ui/src/api/infra/dbDoc.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								ruoyi-ui/src/api/infra/dbDoc.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,10 @@ | |||||||
|  | // 导出参数 | ||||||
|  | import request from "@/utils/request"; | ||||||
|  |  | ||||||
|  | export function exportHtml() { | ||||||
|  |   return request({ | ||||||
|  |     url: '/infra/db-doc/export-html', | ||||||
|  |     method: 'get', | ||||||
|  |     responseType: 'blob' | ||||||
|  |   }) | ||||||
|  | } | ||||||
							
								
								
									
										34
									
								
								ruoyi-ui/src/views/tool/dbDoc/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								ruoyi-ui/src/views/tool/dbDoc/index.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | |||||||
|  | <template> | ||||||
|  |   <div v-loading="loading" :style="'height:'+ height"> | ||||||
|  |     <iframe :src="src" frameborder="no" style="width: 100%;height: 100%" scrolling="auto" /> | ||||||
|  |   </div> | ||||||
|  | </template> | ||||||
|  | <script> | ||||||
|  | import {exportHtml} from "@/api/infra/dbDoc"; | ||||||
|  |  | ||||||
|  | export default { | ||||||
|  |   name: "DBDoc", | ||||||
|  |   data() { | ||||||
|  |     return { | ||||||
|  |       height: document.documentElement.clientHeight - 94.5 + "px;", | ||||||
|  |       loading: true, | ||||||
|  |       src: undefined, | ||||||
|  |     }; | ||||||
|  |   }, | ||||||
|  |   mounted: function() { | ||||||
|  |     setTimeout(() => { | ||||||
|  |       this.loading = false; | ||||||
|  |     }, 230); | ||||||
|  |     const that = this; | ||||||
|  |     window.onresize = function temp() { | ||||||
|  |       that.height = document.documentElement.clientHeight - 94.5 + "px;"; | ||||||
|  |     }; | ||||||
|  |   }, | ||||||
|  |   created() { | ||||||
|  |     exportHtml().then(response => { | ||||||
|  |       // var blob = new Blob(['<a id="a"><b id="b">hey!</b></a>'], {type : 'text/html'}); | ||||||
|  |       this.src = window.URL.createObjectURL(response); | ||||||
|  |     }) | ||||||
|  |   }, | ||||||
|  | }; | ||||||
|  | </script> | ||||||
		Reference in New Issue
	
	Block a user
	 YunaiV
					YunaiV