FormDataExportLogDialog.vue
4.17 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<template>
<!-- 表单列表添加到菜单 -->
<el-dialog
title="导出日志"
:visible.sync="dialogVisible"
width="60%"
appendToBody
:close-on-click-modal="false"
top="8vh"
>
<ht-table
v-if="dialogVisible"
@load="loadData"
:data="data"
:pageResult="pageResult"
:selection="true"
quick-search-props="userId,userName"
:show-export="false"
:show-custom-column="false"
ref="htTable"
>
<template v-slot:toolbar>
<el-button-group>
<ht-delete-button
url="${form}/formDataExportLog/v1/"
:htTable="$refs.htTable"
>删除</ht-delete-button>
</el-button-group>
</template>
<template v-slot:search>
<ht-table-search-panel :divide="3">
<ht-table-search-field
type="daterange"
label="导出时间"
prop="time"
operation="BETWEEN"
/>
</ht-table-search-panel>
</template>
<template>
<ht-table-column type="index" width="50" align="center" label="序号" />
<ht-table-column
prop="userId"
label="导出人账号"
:sortable="true"
:show-overflow-tooltip="true"
>
</ht-table-column>
<ht-table-column
prop="userName"
label="导出人姓名"
:sortable="true"
:show-overflow-tooltip="true"
>
</ht-table-column>
<ht-table-column
prop="time"
label="导出时间"
:sortable="true"
:show-overflow-tooltip="true"
>
</ht-table-column>
<ht-table-column
prop="ip"
label="导出人ip"
:sortable="true"
:show-overflow-tooltip="true"
>
</ht-table-column>
</template>
</ht-table>
</el-dialog>
</template>
<script>
export default {
data() {
return {
dialogVisible: false,
data: [],
pageResult: {
page: 1,
pageSize: 50,
total: 0,
},
FormDataExportLog: {},
saveMethod: 'POST',
params:{}
}
},
mounted() {
this.$validator = this.$root.$validator
},
methods: {
open(params) {
this.params = params;
this.dialogVisible = true
},
showDialog(id) {
if (id) {
this.saveMethod = 'PUT'
this.$http.get('${form}/formDataExportLog/v1/' + id).then(
(resp) => {
this.FormDataExportLog = resp.data
this.dialogVisible = true
},
(error) => {
reject(error)
}
)
} else {
this.saveMethod = 'POST'
this.dialogVisible = true
}
},
beforeCloseDialog() {
this.FormDataExportLog = {}
this.dialogVisible = false
},
loadData(param, cb) {
let querys = param.querys || [];
let hasDefault = false;
querys.forEach((q) => {
if (q.group == "default") {
hasDefault = true;
}
});
if (!hasDefault) {
querys.push({
group: "default",
operation: "EQUAL",
property: "MODEL_",
relation: "AND",
value: this.params.model,
});
querys.push({
group: "default",
operation: "EQUAL",
property: "MODEL_KEY_",
relation: "AND",
value: this.params.modelKey,
});
}
param.querys = querys;
this.$http
.post('${form}/formDataExportLog/v1/query', param)
.then(
(resp) => {
let response = resp.data
this.data = response.rows
this.pageResult = {
page: response.page,
pageSize: response.pageSize,
total: response.total,
}
},
(error) => {
reject(error)
}
)
.finally(() => cb())
},
afterSaveData() {
setTimeout(() => {
this.beforeCloseDialog()
this.$refs.htTable.load()
}, 500)
},
},
}
</script>
<style lang="scss" scoped>
.sp-manager__dialog /deep/ > .el-dialog > .el-dialog__body {
height: calc(100% - 170px);
}
</style>