1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/**
* @Description:
* @author cxg
* @date 2023/07/05
*/
<template>
<div class="use-export-page">
<dee-dialog
width="500px"
title="导出"
:dialog-visible="dialogShow"
:dialog-bttons="formButtons"
form-btn-position="center"
@handleClose="dialogShow = false"
@on-submit="takeTimeAddsubmit"
@on-cancel="dialogShow = false"
>
<dee-as-com
:lay-config="{
typeName: 'DxOrganization',
layKey: '944264fb-96e6-48c5-af48-5d389a0fc49a'
}"
@check="checkChange"
/>
</dee-dialog>
</div>
</template>
<script>
import { downloadFile } from '@/utils/http'
export default {
componentName: '用户导出',
name: 'UserExportCom',
components: { },
data() {
return {
checkData: [],
dialogShow: false,
formButtons: [
{
'text': '确定',
'type': 'submit',
'component': {
'type': 'primary'
}
},
{
'text': '取消',
'type': 'cancel',
'component': {
}
}
],
showImportOrgTempDialog: false
}
},
computed: {},
mounted() {},
methods: {
checkChange(val) {
this.checkData = val.checked.checkedNodes.map(el => {
return el.id
})
},
takeTimeAddsubmit() {
if (!this.checkData.length) {
this.$utils.showMessageWarning('请选择需要导出用户对应的组织')
return
}
const params = {
items: [{ 'fieldName': 'orgId', 'operator': 'IN', 'value': this.checkData }],
'operator': 'AND'
}
downloadFile(`/DxUserAccount/export/userInfo?generateOperator=VOTOEXCEL`, 'post', params).then(res => {
const fileName = res.headers['content-disposition'].substring(res.headers['content-disposition'].indexOf('=') + 1, res.headers['content-disposition'].length)
const name = fileName.substring(fileName.indexOf('_') + 1, fileName.lastIndexOf('.xlsx'))
this.$utils.downLoadFile(res, '用户_' + name + '(内部).xlsx')
this.dialogShow = false
})
},
eventFunc() {
this.dialogShow = true
},
// 导入
onImportTempOk() {
this.$emit('import-temp')
}
}
}
</script>
<style lang='scss'>
</style>