添加导出实体模板

dev^2
mqh 1 year ago
parent ea1b6c22dc
commit e4a0aa80de
  1. 3
      ant-design-vue-jeecg/src/views/modulex/ModulexList.vue
  2. 28
      ant-design-vue-jeecg/src/views/modulex/modules/ModulexImport.vue

@ -515,7 +515,8 @@ export default {
], ],
title: '导入实体', title: '导入实体',
uploadUrl: this.tablexImportExcelUrl, uploadUrl: this.tablexImportExcelUrl,
downUrl: this.tablexDownExcelUrl downUrl: "temp/tablex.xls",
downName: "实体模板表.xls"
} }
}, },
modelData: function () { modelData: function () {

@ -60,7 +60,7 @@
</template> </template>
<script> <script>
import {getAction} from "@api/manage" import {downloadFile, getAction} from "@api/manage"
import store from '@/store' import store from '@/store'
import {JeecgListMixin} from '@/mixins/JeecgListMixin' import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import {mixinDevice} from '@/utils/mixin' import {mixinDevice} from '@/utils/mixin'
@ -85,6 +85,7 @@ export default {
status: '判断文件结构', status: '判断文件结构',
}, },
form: this.$form.createForm(this), form: this.$form.createForm(this),
downName:'',
url: url:
{ {
downfile: '', downfile: '',
@ -125,18 +126,20 @@ export default {
}, },
// //
handleDownload() { handleDownload() {
console.log(this.downName,"111")
downloadFile( this.url.downfile,this.downName)
// getAction(this.url.list, params).then((res) => // getAction(this.url.list, params).then((res) =>
getAction(this.url.downfile).then((response) => { // getAction(this.url.downfile).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data])) // const url = window.URL.createObjectURL(new Blob([response.data]))
const link = document.createElement('a') // const link = document.createElement('a')
link.href = url // link.href = url
link.setAttribute('download', 'your-document.pdf') // link.setAttribute('download', 'your-document.pdf')
document.body.appendChild(link) // document.body.appendChild(link)
link.click() // link.click()
}) // })
.catch(error => { // .catch(error => {
console.error(error) // console.error(error)
}) // })
}, },
add() { add() {
@ -144,6 +147,7 @@ export default {
show(data,ws) { show(data,ws) {
this.url.uploadUrl = data.uploadUrl this.url.uploadUrl = data.uploadUrl
this.url.downfile = data.downUrl this.url.downfile = data.downUrl
this.downName = data.downName
this.datas = data.note this.datas = data.note
this.title = data.title this.title = data.title
this.ModalData = {} this.ModalData = {}

Loading…
Cancel
Save