apply-clients 7.1.36-yuchuan-67 → 7.1.36-yuchuan-69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dev-server.js +3 -6
- package/package.json +1 -1
- package/src/components/android/AppServiceView.vue +603 -603
- package/src/components/android/Process/AppServiceControl.vue +1434 -1434
- package/src/components/android/Process/Processes/AppInstallationDetails.vue +1029 -1029
- package/src/components/android/Process/Processes/newAppInstallationDetails.vue +671 -671
- package/src/components/android/SealBind.vue +405 -405
- package/src/components/product/ApplyGaiXianCharge/ApplyGaiXianChargeList.vue +211 -211
- package/src/components/product/ApplyGuanXian/GuanXianExplorationSelect.vue +325 -325
- package/src/components/product/Function/Service/FunctionServiceControl.vue +581 -581
- package/src/components/product/Ignition/IgnitionListManage.vue +604 -604
- package/src/components/product/List/OldShowDevices.vue +272 -272
- package/src/components/product/List/ShowAllActivity.vue +540 -540
- package/src/components/product/Print/BuildOrder/buildOrderList.vue +446 -446
- package/src/components/product/Process/ExplorationSelect.vue +593 -593
- package/src/components/product/Process/NewExplorationSelect.vue +587 -587
- package/src/components/product/Process/Processes/InstallationDetails.vue +1166 -1166
- package/src/components/product/Process/Processes/Print/printCharge.vue +250 -250
- package/src/components/product/Process/Processes/Print/printGaiXianCharge.vue +244 -244
- package/src/components/product/Process/Processes/newInstallationDetails.vue +683 -683
- package/src/components/product/Process/Processes/supplementalAgreement.vue +298 -298
- package/src/components/product/Process/Service/ServiceControl.vue +2230 -2222
- package/src/components/product/ServiceView.vue +650 -650
- package/src/components/product/Supervisory/ExportExcel.vue +359 -359
- package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +592 -592
- package/src/components/product/Supervisory/SupervisoryList.vue +585 -585
- package/src/components/product/Supervisory/YiBanSupervisoryList.vue +543 -543
- package/src/components/product/VueUtils/ApplyUpload.vue +302 -302
- package/src/components/product/VueUtils/HighMeter.vue +208 -208
|
@@ -1,359 +1,359 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<button v-show="isshow" class="button_export button_spacing" @click.prevent='exportExcel()'
|
|
3
|
-
:id="'vc-exportexcel-'+attach">{{ btnName }}
|
|
4
|
-
</button>
|
|
5
|
-
<modal :show.sync="show" v-ref:modal backdrop="false">
|
|
6
|
-
<header slot="modal-header" class="modal-header text-center">
|
|
7
|
-
<div v-show="!progressShow">
|
|
8
|
-
<h4 class="modal-title">导出列选择</h4>
|
|
9
|
-
<input type="checkbox" class="" id="f_operator" v-model="all">
|
|
10
|
-
<label for="f_operator" class="font-size">全选</label>
|
|
11
|
-
<input type="checkbox" class="" id="f_operator1" v-model="civils">
|
|
12
|
-
<label for="f_operator1" class="font-size">民用</label>
|
|
13
|
-
<input type="checkbox" class="" id="f_operator2" v-model="uncivils">
|
|
14
|
-
<label for="f_operator2" class="font-size">非民用</label>
|
|
15
|
-
</div>
|
|
16
|
-
<div v-show="progressShow">
|
|
17
|
-
<h4 class="modal-title">导出中,请耐心等待...</h4>
|
|
18
|
-
</div>
|
|
19
|
-
</header>
|
|
20
|
-
<article slot="modal-body">
|
|
21
|
-
<div class="auto col-sm-11 col-md-offset-1" style="margin-top: 10px;" v-show="!progressShow">
|
|
22
|
-
<div class="col-sm-4" v-for="f in fields">
|
|
23
|
-
<input type="checkbox" class="" :id="'export-col-'+$index" v-model="modelval" :value="$key">
|
|
24
|
-
<label :for="'export-col-'+$index" class="font-size">{{ f }}</label>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
<div class="progress" style="margin: 20px" v-show="progressShow">
|
|
28
|
-
<div class="progress-bar progress-bar-success progress-bar-striped active" :style="{width: percent}">
|
|
29
|
-
{{ percent }}
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
</article>
|
|
33
|
-
<footer slot="modal-footer" class="modal-footer">
|
|
34
|
-
<center>
|
|
35
|
-
<button v-show="show" type="button" class="btn btn-default" @click='close()'>取消</button>
|
|
36
|
-
<button v-show="show && !progressShow" type="button" class="btn btn-success" @click='export()'>导出</button>
|
|
37
|
-
</center>
|
|
38
|
-
</footer>
|
|
39
|
-
</modal>
|
|
40
|
-
</template>
|
|
41
|
-
|
|
42
|
-
<script>
|
|
43
|
-
import co from 'co'
|
|
44
|
-
import {HttpResetClass} from 'vue-client'
|
|
45
|
-
|
|
46
|
-
let postGen = function* (self) {
|
|
47
|
-
try {
|
|
48
|
-
let p = {}
|
|
49
|
-
// 判断如果有field,说明表头为自动生成,否则为模板导出
|
|
50
|
-
if (self.exporthead) {
|
|
51
|
-
if (self.sqlName) {
|
|
52
|
-
p = yield self.$resetpost(self.sqlurl, {
|
|
53
|
-
data: {
|
|
54
|
-
body: {
|
|
55
|
-
header: self.header,
|
|
56
|
-
footer: self.footer,
|
|
57
|
-
sumName: self.sumname,
|
|
58
|
-
data: self.data,
|
|
59
|
-
field: self.exporthead,
|
|
60
|
-
templateName: self.templateName,
|
|
61
|
-
sqlName: self.sqlName,
|
|
62
|
-
uuid: self.uuid
|
|
63
|
-
},
|
|
64
|
-
bean: self.bean
|
|
65
|
-
}
|
|
66
|
-
}, {resolveMsg: null, rejectMsg: null}, 1000)
|
|
67
|
-
} else if (self.pathName) {
|
|
68
|
-
p = yield self.$resetpost(self.sqlurl, {
|
|
69
|
-
data: {
|
|
70
|
-
body: {
|
|
71
|
-
sumName: self.sumname,
|
|
72
|
-
data: self.data,
|
|
73
|
-
field: self.exporthead,
|
|
74
|
-
templateName: self.templateName,
|
|
75
|
-
pathName: self.pathName,
|
|
76
|
-
uuid: self.uuid
|
|
77
|
-
},
|
|
78
|
-
bean: self.bean
|
|
79
|
-
}
|
|
80
|
-
}, {resolveMsg: null, rejectMsg: null}, 0)
|
|
81
|
-
}
|
|
82
|
-
} else {
|
|
83
|
-
p = yield self.$resetpost(self.sqlurl, {
|
|
84
|
-
data: {
|
|
85
|
-
body: {sumName: self.sumname, data: self.data, total: self.total, uuid: self.uuid},
|
|
86
|
-
bean: self.bean
|
|
87
|
-
}
|
|
88
|
-
}, {resolveMsg: null, rejectMsg: null}, 0)
|
|
89
|
-
}
|
|
90
|
-
} catch (e) {
|
|
91
|
-
console.error(e)
|
|
92
|
-
}
|
|
93
|
-
self.modelval = []
|
|
94
|
-
self.fields = {}
|
|
95
|
-
self.exporthead = []
|
|
96
|
-
self.progressQuery()
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export default {
|
|
100
|
-
//uuid:需要导出的Excel对应的key
|
|
101
|
-
// data:sql需要的替换字段
|
|
102
|
-
// sqlurl:导出Excel查询的sql语句
|
|
103
|
-
// field:需要导出Excel的字段名和对应中文名或hbm配置文件名(全名)
|
|
104
|
-
// total:统计字段(统计行)
|
|
105
|
-
// props: ['data', 'sqlurl', 'field', 'total', 'bean', 'chooseCol','sumName'],
|
|
106
|
-
data() {
|
|
107
|
-
return {
|
|
108
|
-
uuid: '',
|
|
109
|
-
show: false,
|
|
110
|
-
all: false,
|
|
111
|
-
civils: false,
|
|
112
|
-
uncivils: false,
|
|
113
|
-
fields: {},
|
|
114
|
-
modelval: [],
|
|
115
|
-
// 表头
|
|
116
|
-
exporthead: [],
|
|
117
|
-
selftotal: [],
|
|
118
|
-
// sumName:[],
|
|
119
|
-
// 进度条显示
|
|
120
|
-
progressShow: false,
|
|
121
|
-
// 进度百分比
|
|
122
|
-
percent: '0%',
|
|
123
|
-
// 定时器
|
|
124
|
-
timer: null,
|
|
125
|
-
// 请求对象
|
|
126
|
-
HttpReset: new HttpResetClass()
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
props: {
|
|
130
|
-
// 表头
|
|
131
|
-
header: {},
|
|
132
|
-
// 表尾
|
|
133
|
-
footer: {},
|
|
134
|
-
sumname: {},
|
|
135
|
-
data: {},
|
|
136
|
-
sqlurl: {
|
|
137
|
-
type: String
|
|
138
|
-
},
|
|
139
|
-
field: {},
|
|
140
|
-
civil: {},
|
|
141
|
-
uncivil: {},
|
|
142
|
-
total: {},
|
|
143
|
-
bean: {
|
|
144
|
-
type: String
|
|
145
|
-
},
|
|
146
|
-
progress: {
|
|
147
|
-
type: String,
|
|
148
|
-
default: 'getExportProgress'
|
|
149
|
-
},
|
|
150
|
-
btnName: {
|
|
151
|
-
type: String,
|
|
152
|
-
default: '导出Excel'
|
|
153
|
-
},
|
|
154
|
-
templateName: {
|
|
155
|
-
type: String
|
|
156
|
-
},
|
|
157
|
-
sqlName: {
|
|
158
|
-
type: String
|
|
159
|
-
},
|
|
160
|
-
pathName: {
|
|
161
|
-
type: String
|
|
162
|
-
},
|
|
163
|
-
attach: {
|
|
164
|
-
type: String,
|
|
165
|
-
default: 'name'
|
|
166
|
-
},
|
|
167
|
-
chooseCol: {
|
|
168
|
-
type: Boolean,
|
|
169
|
-
default: false
|
|
170
|
-
},
|
|
171
|
-
isshow: {
|
|
172
|
-
type: Boolean,
|
|
173
|
-
default: true
|
|
174
|
-
},
|
|
175
|
-
defaultselect: [],
|
|
176
|
-
chooserow: {
|
|
177
|
-
type: Boolean,
|
|
178
|
-
default: false
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
beforeDestroy() {
|
|
182
|
-
this.closeTimer()
|
|
183
|
-
},
|
|
184
|
-
methods: {
|
|
185
|
-
|
|
186
|
-
exportExcel() {
|
|
187
|
-
console.log('选择列,。。', this.chooseCol, this.field)
|
|
188
|
-
if (this.field) {
|
|
189
|
-
if (this.chooseCol === true) {
|
|
190
|
-
this.fields = this.field
|
|
191
|
-
this.show = true;
|
|
192
|
-
if (this.defaultselect != null && this.defaultselect) {
|
|
193
|
-
for (var item in this.defaultselect) {
|
|
194
|
-
this.modelval.push(item)
|
|
195
|
-
}
|
|
196
|
-
if (this.chooserow) {
|
|
197
|
-
this.export()
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
} else {
|
|
202
|
-
this.data.items = '*'
|
|
203
|
-
Object.keys(this.field).forEach((key) => {
|
|
204
|
-
this.exporthead.push(key + ':' + this.field[key])
|
|
205
|
-
})
|
|
206
|
-
this.post()
|
|
207
|
-
}
|
|
208
|
-
} else {
|
|
209
|
-
this.post()
|
|
210
|
-
}
|
|
211
|
-
},
|
|
212
|
-
export() {
|
|
213
|
-
if (this.$login.r.includes('限制导出')) {
|
|
214
|
-
this.$showMessage('你被限制导出, 请联系管理员')
|
|
215
|
-
return
|
|
216
|
-
}
|
|
217
|
-
// 获取导出选择的表头和列
|
|
218
|
-
let temp = ''
|
|
219
|
-
this.modelval.forEach((item) => {
|
|
220
|
-
temp = temp + item + ','
|
|
221
|
-
this.exporthead.push(item + ':' + this.field[item])
|
|
222
|
-
//this.exporthead[item] = this.field[item]
|
|
223
|
-
})
|
|
224
|
-
temp = temp.slice(0, temp.length - 1)
|
|
225
|
-
console.log('表头,,,,', this.exporthead)
|
|
226
|
-
this.data.items = temp
|
|
227
|
-
this.post()
|
|
228
|
-
},
|
|
229
|
-
post() {
|
|
230
|
-
// if(this.total) {
|
|
231
|
-
//
|
|
232
|
-
// var temp={"合计":"合计"}
|
|
233
|
-
// for (var a in this.field) {
|
|
234
|
-
// for (var b in this.total) {
|
|
235
|
-
// if(a==b){
|
|
236
|
-
// temp[a]=this.total[a]
|
|
237
|
-
// }
|
|
238
|
-
// }
|
|
239
|
-
// }
|
|
240
|
-
// this.selftotal.push(temp)
|
|
241
|
-
// console.log("========================")
|
|
242
|
-
// console.log(temp)
|
|
243
|
-
//
|
|
244
|
-
// // this.selftotal.push(this.total)
|
|
245
|
-
// // this.selftotal[0].a="合计"
|
|
246
|
-
// }
|
|
247
|
-
this.uuid = this.guid();
|
|
248
|
-
let gen = postGen(this)
|
|
249
|
-
co(gen)
|
|
250
|
-
},
|
|
251
|
-
stamp() {
|
|
252
|
-
this.modelval = []
|
|
253
|
-
this.show = true
|
|
254
|
-
},
|
|
255
|
-
sortModelval() {
|
|
256
|
-
let sortModel = []
|
|
257
|
-
Object.keys(this.fields).forEach((key) => {
|
|
258
|
-
if (this.modelval.includes(key)) {
|
|
259
|
-
sortModel.push(key)
|
|
260
|
-
}
|
|
261
|
-
})
|
|
262
|
-
console.log('看看选择的顺序。。。', sortModel)
|
|
263
|
-
this.modelval = sortModel
|
|
264
|
-
},
|
|
265
|
-
close() {
|
|
266
|
-
this.closeTimer()
|
|
267
|
-
this.all = false
|
|
268
|
-
this.civils = false
|
|
269
|
-
this.uncivils = false
|
|
270
|
-
this.modelval = []
|
|
271
|
-
this.show = false
|
|
272
|
-
this.progressShow = false
|
|
273
|
-
this.percent = '0%'
|
|
274
|
-
},
|
|
275
|
-
progressQuery() {
|
|
276
|
-
console.log('导出进度开始查询')
|
|
277
|
-
this.progressShow = true
|
|
278
|
-
// 启动定时器之前先关闭定时器,防止之前的定时器未关闭
|
|
279
|
-
this.closeTimer()
|
|
280
|
-
// 立即执行一遍
|
|
281
|
-
this.progressTask()
|
|
282
|
-
this.timer = setInterval(this.progressTask, 3000)
|
|
283
|
-
},
|
|
284
|
-
async progressTask() {
|
|
285
|
-
let self = this
|
|
286
|
-
let res = await self.HttpReset.load('POST', `rs/logic/getBatchOperaPro`,{data: {uuid: self.uuid}}, {resolveMsg: null, rejectMsg: null})
|
|
287
|
-
res = res.data
|
|
288
|
-
console.log('进度数据', res)
|
|
289
|
-
if (res.error) {
|
|
290
|
-
self.$showAlert(`导出excel错误: ${res.error}`, 'danger', 0)
|
|
291
|
-
self.closeTimer()
|
|
292
|
-
} else {
|
|
293
|
-
// self.$showAlert(`${res.msg}`, 'success', 2000)
|
|
294
|
-
self.percent = (res.percent ? res.percent : 0) + '%'
|
|
295
|
-
// 进度100%
|
|
296
|
-
if (res.fileName && res.percent == 100) {
|
|
297
|
-
var link = document.createElement('a');
|
|
298
|
-
res.fileName.forEach((item) => {
|
|
299
|
-
console.log('导出路径', item.filename)
|
|
300
|
-
// let path = item.filename.substring(item.filename.indexOf('webapps'), (item.filename.length))
|
|
301
|
-
// let pathName = path.substring(path.indexOf('/') + 1, path.length)
|
|
302
|
-
let path = item.filename
|
|
303
|
-
//webapps这个是在服务器上导出用的
|
|
304
|
-
var xy=this.$appdata.getSingleValue('协议')?this.$appdata.getSingleValue('协议'):"http://"
|
|
305
|
-
let pathName = xy + location.host + "/webapps" + path.split('webapps')[1]
|
|
306
|
-
//excel这个是在本地导出用的
|
|
307
|
-
// let pathName = "http://" + location.host + "/excel" + path.split('excel')[1]
|
|
308
|
-
link.href = pathName;
|
|
309
|
-
link.download = path.split('excel/')[1];
|
|
310
|
-
link.dispatchEvent(new MouseEvent('click'));
|
|
311
|
-
})
|
|
312
|
-
self.close()
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
},
|
|
316
|
-
// 关闭定时器
|
|
317
|
-
closeTimer() {
|
|
318
|
-
if (this.timer) {
|
|
319
|
-
clearInterval(this.timer)
|
|
320
|
-
this.timer = null
|
|
321
|
-
}
|
|
322
|
-
},
|
|
323
|
-
guid() {
|
|
324
|
-
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
325
|
-
let r = Math.random() * 16 | 0,
|
|
326
|
-
v = c == 'x' ? r : (r & 0x3 | 0x8)
|
|
327
|
-
return v.toString(16)
|
|
328
|
-
})
|
|
329
|
-
}
|
|
330
|
-
},
|
|
331
|
-
watch: {
|
|
332
|
-
'all'(val) {
|
|
333
|
-
if (val) {
|
|
334
|
-
this.modelval = Object.keys(this.fields)
|
|
335
|
-
} else {
|
|
336
|
-
this.modelval = []
|
|
337
|
-
}
|
|
338
|
-
},
|
|
339
|
-
'civils'(val) {
|
|
340
|
-
if (val) {
|
|
341
|
-
this.modelval = Object.keys(this.civil)
|
|
342
|
-
} else {
|
|
343
|
-
this.modelval = []
|
|
344
|
-
}
|
|
345
|
-
},
|
|
346
|
-
'uncivils'(val) {
|
|
347
|
-
if (val) {
|
|
348
|
-
this.modelval = Object.keys(this.uncivil)
|
|
349
|
-
} else {
|
|
350
|
-
this.modelval = []
|
|
351
|
-
}
|
|
352
|
-
},
|
|
353
|
-
|
|
354
|
-
'modelval.length'() {
|
|
355
|
-
this.sortModelval()
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<button v-show="isshow" class="button_export button_spacing" @click.prevent='exportExcel()'
|
|
3
|
+
:id="'vc-exportexcel-'+attach">{{ btnName }}
|
|
4
|
+
</button>
|
|
5
|
+
<modal :show.sync="show" v-ref:modal backdrop="false">
|
|
6
|
+
<header slot="modal-header" class="modal-header text-center">
|
|
7
|
+
<div v-show="!progressShow">
|
|
8
|
+
<h4 class="modal-title">导出列选择</h4>
|
|
9
|
+
<input type="checkbox" class="" id="f_operator" v-model="all">
|
|
10
|
+
<label for="f_operator" class="font-size">全选</label>
|
|
11
|
+
<input type="checkbox" class="" id="f_operator1" v-model="civils">
|
|
12
|
+
<label for="f_operator1" class="font-size">民用</label>
|
|
13
|
+
<input type="checkbox" class="" id="f_operator2" v-model="uncivils">
|
|
14
|
+
<label for="f_operator2" class="font-size">非民用</label>
|
|
15
|
+
</div>
|
|
16
|
+
<div v-show="progressShow">
|
|
17
|
+
<h4 class="modal-title">导出中,请耐心等待...</h4>
|
|
18
|
+
</div>
|
|
19
|
+
</header>
|
|
20
|
+
<article slot="modal-body">
|
|
21
|
+
<div class="auto col-sm-11 col-md-offset-1" style="margin-top: 10px;" v-show="!progressShow">
|
|
22
|
+
<div class="col-sm-4" v-for="f in fields">
|
|
23
|
+
<input type="checkbox" class="" :id="'export-col-'+$index" v-model="modelval" :value="$key">
|
|
24
|
+
<label :for="'export-col-'+$index" class="font-size">{{ f }}</label>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="progress" style="margin: 20px" v-show="progressShow">
|
|
28
|
+
<div class="progress-bar progress-bar-success progress-bar-striped active" :style="{width: percent}">
|
|
29
|
+
{{ percent }}
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</article>
|
|
33
|
+
<footer slot="modal-footer" class="modal-footer">
|
|
34
|
+
<center>
|
|
35
|
+
<button v-show="show" type="button" class="btn btn-default" @click='close()'>取消</button>
|
|
36
|
+
<button v-show="show && !progressShow" type="button" class="btn btn-success" @click='export()'>导出</button>
|
|
37
|
+
</center>
|
|
38
|
+
</footer>
|
|
39
|
+
</modal>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script>
|
|
43
|
+
import co from 'co'
|
|
44
|
+
import {HttpResetClass} from 'vue-client'
|
|
45
|
+
|
|
46
|
+
let postGen = function* (self) {
|
|
47
|
+
try {
|
|
48
|
+
let p = {}
|
|
49
|
+
// 判断如果有field,说明表头为自动生成,否则为模板导出
|
|
50
|
+
if (self.exporthead) {
|
|
51
|
+
if (self.sqlName) {
|
|
52
|
+
p = yield self.$resetpost(self.sqlurl, {
|
|
53
|
+
data: {
|
|
54
|
+
body: {
|
|
55
|
+
header: self.header,
|
|
56
|
+
footer: self.footer,
|
|
57
|
+
sumName: self.sumname,
|
|
58
|
+
data: self.data,
|
|
59
|
+
field: self.exporthead,
|
|
60
|
+
templateName: self.templateName,
|
|
61
|
+
sqlName: self.sqlName,
|
|
62
|
+
uuid: self.uuid
|
|
63
|
+
},
|
|
64
|
+
bean: self.bean
|
|
65
|
+
}
|
|
66
|
+
}, {resolveMsg: null, rejectMsg: null}, 1000)
|
|
67
|
+
} else if (self.pathName) {
|
|
68
|
+
p = yield self.$resetpost(self.sqlurl, {
|
|
69
|
+
data: {
|
|
70
|
+
body: {
|
|
71
|
+
sumName: self.sumname,
|
|
72
|
+
data: self.data,
|
|
73
|
+
field: self.exporthead,
|
|
74
|
+
templateName: self.templateName,
|
|
75
|
+
pathName: self.pathName,
|
|
76
|
+
uuid: self.uuid
|
|
77
|
+
},
|
|
78
|
+
bean: self.bean
|
|
79
|
+
}
|
|
80
|
+
}, {resolveMsg: null, rejectMsg: null}, 0)
|
|
81
|
+
}
|
|
82
|
+
} else {
|
|
83
|
+
p = yield self.$resetpost(self.sqlurl, {
|
|
84
|
+
data: {
|
|
85
|
+
body: {sumName: self.sumname, data: self.data, total: self.total, uuid: self.uuid},
|
|
86
|
+
bean: self.bean
|
|
87
|
+
}
|
|
88
|
+
}, {resolveMsg: null, rejectMsg: null}, 0)
|
|
89
|
+
}
|
|
90
|
+
} catch (e) {
|
|
91
|
+
console.error(e)
|
|
92
|
+
}
|
|
93
|
+
self.modelval = []
|
|
94
|
+
self.fields = {}
|
|
95
|
+
self.exporthead = []
|
|
96
|
+
self.progressQuery()
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export default {
|
|
100
|
+
//uuid:需要导出的Excel对应的key
|
|
101
|
+
// data:sql需要的替换字段
|
|
102
|
+
// sqlurl:导出Excel查询的sql语句
|
|
103
|
+
// field:需要导出Excel的字段名和对应中文名或hbm配置文件名(全名)
|
|
104
|
+
// total:统计字段(统计行)
|
|
105
|
+
// props: ['data', 'sqlurl', 'field', 'total', 'bean', 'chooseCol','sumName'],
|
|
106
|
+
data() {
|
|
107
|
+
return {
|
|
108
|
+
uuid: '',
|
|
109
|
+
show: false,
|
|
110
|
+
all: false,
|
|
111
|
+
civils: false,
|
|
112
|
+
uncivils: false,
|
|
113
|
+
fields: {},
|
|
114
|
+
modelval: [],
|
|
115
|
+
// 表头
|
|
116
|
+
exporthead: [],
|
|
117
|
+
selftotal: [],
|
|
118
|
+
// sumName:[],
|
|
119
|
+
// 进度条显示
|
|
120
|
+
progressShow: false,
|
|
121
|
+
// 进度百分比
|
|
122
|
+
percent: '0%',
|
|
123
|
+
// 定时器
|
|
124
|
+
timer: null,
|
|
125
|
+
// 请求对象
|
|
126
|
+
HttpReset: new HttpResetClass()
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
props: {
|
|
130
|
+
// 表头
|
|
131
|
+
header: {},
|
|
132
|
+
// 表尾
|
|
133
|
+
footer: {},
|
|
134
|
+
sumname: {},
|
|
135
|
+
data: {},
|
|
136
|
+
sqlurl: {
|
|
137
|
+
type: String
|
|
138
|
+
},
|
|
139
|
+
field: {},
|
|
140
|
+
civil: {},
|
|
141
|
+
uncivil: {},
|
|
142
|
+
total: {},
|
|
143
|
+
bean: {
|
|
144
|
+
type: String
|
|
145
|
+
},
|
|
146
|
+
progress: {
|
|
147
|
+
type: String,
|
|
148
|
+
default: 'getExportProgress'
|
|
149
|
+
},
|
|
150
|
+
btnName: {
|
|
151
|
+
type: String,
|
|
152
|
+
default: '导出Excel'
|
|
153
|
+
},
|
|
154
|
+
templateName: {
|
|
155
|
+
type: String
|
|
156
|
+
},
|
|
157
|
+
sqlName: {
|
|
158
|
+
type: String
|
|
159
|
+
},
|
|
160
|
+
pathName: {
|
|
161
|
+
type: String
|
|
162
|
+
},
|
|
163
|
+
attach: {
|
|
164
|
+
type: String,
|
|
165
|
+
default: 'name'
|
|
166
|
+
},
|
|
167
|
+
chooseCol: {
|
|
168
|
+
type: Boolean,
|
|
169
|
+
default: false
|
|
170
|
+
},
|
|
171
|
+
isshow: {
|
|
172
|
+
type: Boolean,
|
|
173
|
+
default: true
|
|
174
|
+
},
|
|
175
|
+
defaultselect: [],
|
|
176
|
+
chooserow: {
|
|
177
|
+
type: Boolean,
|
|
178
|
+
default: false
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
beforeDestroy() {
|
|
182
|
+
this.closeTimer()
|
|
183
|
+
},
|
|
184
|
+
methods: {
|
|
185
|
+
|
|
186
|
+
exportExcel() {
|
|
187
|
+
console.log('选择列,。。', this.chooseCol, this.field)
|
|
188
|
+
if (this.field) {
|
|
189
|
+
if (this.chooseCol === true) {
|
|
190
|
+
this.fields = this.field
|
|
191
|
+
this.show = true;
|
|
192
|
+
if (this.defaultselect != null && this.defaultselect) {
|
|
193
|
+
for (var item in this.defaultselect) {
|
|
194
|
+
this.modelval.push(item)
|
|
195
|
+
}
|
|
196
|
+
if (this.chooserow) {
|
|
197
|
+
this.export()
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
} else {
|
|
202
|
+
this.data.items = '*'
|
|
203
|
+
Object.keys(this.field).forEach((key) => {
|
|
204
|
+
this.exporthead.push(key + ':' + this.field[key])
|
|
205
|
+
})
|
|
206
|
+
this.post()
|
|
207
|
+
}
|
|
208
|
+
} else {
|
|
209
|
+
this.post()
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
export() {
|
|
213
|
+
if (this.$login.r.includes('限制导出')) {
|
|
214
|
+
this.$showMessage('你被限制导出, 请联系管理员')
|
|
215
|
+
return
|
|
216
|
+
}
|
|
217
|
+
// 获取导出选择的表头和列
|
|
218
|
+
let temp = ''
|
|
219
|
+
this.modelval.forEach((item) => {
|
|
220
|
+
temp = temp + item + ','
|
|
221
|
+
this.exporthead.push(item + ':' + this.field[item])
|
|
222
|
+
//this.exporthead[item] = this.field[item]
|
|
223
|
+
})
|
|
224
|
+
temp = temp.slice(0, temp.length - 1)
|
|
225
|
+
console.log('表头,,,,', this.exporthead)
|
|
226
|
+
this.data.items = temp
|
|
227
|
+
this.post()
|
|
228
|
+
},
|
|
229
|
+
post() {
|
|
230
|
+
// if(this.total) {
|
|
231
|
+
//
|
|
232
|
+
// var temp={"合计":"合计"}
|
|
233
|
+
// for (var a in this.field) {
|
|
234
|
+
// for (var b in this.total) {
|
|
235
|
+
// if(a==b){
|
|
236
|
+
// temp[a]=this.total[a]
|
|
237
|
+
// }
|
|
238
|
+
// }
|
|
239
|
+
// }
|
|
240
|
+
// this.selftotal.push(temp)
|
|
241
|
+
// console.log("========================")
|
|
242
|
+
// console.log(temp)
|
|
243
|
+
//
|
|
244
|
+
// // this.selftotal.push(this.total)
|
|
245
|
+
// // this.selftotal[0].a="合计"
|
|
246
|
+
// }
|
|
247
|
+
this.uuid = this.guid();
|
|
248
|
+
let gen = postGen(this)
|
|
249
|
+
co(gen)
|
|
250
|
+
},
|
|
251
|
+
stamp() {
|
|
252
|
+
this.modelval = []
|
|
253
|
+
this.show = true
|
|
254
|
+
},
|
|
255
|
+
sortModelval() {
|
|
256
|
+
let sortModel = []
|
|
257
|
+
Object.keys(this.fields).forEach((key) => {
|
|
258
|
+
if (this.modelval.includes(key)) {
|
|
259
|
+
sortModel.push(key)
|
|
260
|
+
}
|
|
261
|
+
})
|
|
262
|
+
console.log('看看选择的顺序。。。', sortModel)
|
|
263
|
+
this.modelval = sortModel
|
|
264
|
+
},
|
|
265
|
+
close() {
|
|
266
|
+
this.closeTimer()
|
|
267
|
+
this.all = false
|
|
268
|
+
this.civils = false
|
|
269
|
+
this.uncivils = false
|
|
270
|
+
this.modelval = []
|
|
271
|
+
this.show = false
|
|
272
|
+
this.progressShow = false
|
|
273
|
+
this.percent = '0%'
|
|
274
|
+
},
|
|
275
|
+
progressQuery() {
|
|
276
|
+
console.log('导出进度开始查询')
|
|
277
|
+
this.progressShow = true
|
|
278
|
+
// 启动定时器之前先关闭定时器,防止之前的定时器未关闭
|
|
279
|
+
this.closeTimer()
|
|
280
|
+
// 立即执行一遍
|
|
281
|
+
this.progressTask()
|
|
282
|
+
this.timer = setInterval(this.progressTask, 3000)
|
|
283
|
+
},
|
|
284
|
+
async progressTask() {
|
|
285
|
+
let self = this
|
|
286
|
+
let res = await self.HttpReset.load('POST', `rs/logic/getBatchOperaPro`,{data: {uuid: self.uuid}}, {resolveMsg: null, rejectMsg: null})
|
|
287
|
+
res = res.data
|
|
288
|
+
console.log('进度数据', res)
|
|
289
|
+
if (res.error) {
|
|
290
|
+
self.$showAlert(`导出excel错误: ${res.error}`, 'danger', 0)
|
|
291
|
+
self.closeTimer()
|
|
292
|
+
} else {
|
|
293
|
+
// self.$showAlert(`${res.msg}`, 'success', 2000)
|
|
294
|
+
self.percent = (res.percent ? res.percent : 0) + '%'
|
|
295
|
+
// 进度100%
|
|
296
|
+
if (res.fileName && res.percent == 100) {
|
|
297
|
+
var link = document.createElement('a');
|
|
298
|
+
res.fileName.forEach((item) => {
|
|
299
|
+
console.log('导出路径', item.filename)
|
|
300
|
+
// let path = item.filename.substring(item.filename.indexOf('webapps'), (item.filename.length))
|
|
301
|
+
// let pathName = path.substring(path.indexOf('/') + 1, path.length)
|
|
302
|
+
let path = item.filename
|
|
303
|
+
//webapps这个是在服务器上导出用的
|
|
304
|
+
var xy=this.$appdata.getSingleValue('协议')?this.$appdata.getSingleValue('协议'):"http://"
|
|
305
|
+
let pathName = xy + location.host + "/webapps" + path.split('webapps')[1]
|
|
306
|
+
//excel这个是在本地导出用的
|
|
307
|
+
// let pathName = "http://" + location.host + "/excel" + path.split('excel')[1]
|
|
308
|
+
link.href = pathName;
|
|
309
|
+
link.download = path.split('excel/')[1];
|
|
310
|
+
link.dispatchEvent(new MouseEvent('click'));
|
|
311
|
+
})
|
|
312
|
+
self.close()
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
// 关闭定时器
|
|
317
|
+
closeTimer() {
|
|
318
|
+
if (this.timer) {
|
|
319
|
+
clearInterval(this.timer)
|
|
320
|
+
this.timer = null
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
guid() {
|
|
324
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
325
|
+
let r = Math.random() * 16 | 0,
|
|
326
|
+
v = c == 'x' ? r : (r & 0x3 | 0x8)
|
|
327
|
+
return v.toString(16)
|
|
328
|
+
})
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
watch: {
|
|
332
|
+
'all'(val) {
|
|
333
|
+
if (val) {
|
|
334
|
+
this.modelval = Object.keys(this.fields)
|
|
335
|
+
} else {
|
|
336
|
+
this.modelval = []
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
'civils'(val) {
|
|
340
|
+
if (val) {
|
|
341
|
+
this.modelval = Object.keys(this.civil)
|
|
342
|
+
} else {
|
|
343
|
+
this.modelval = []
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
'uncivils'(val) {
|
|
347
|
+
if (val) {
|
|
348
|
+
this.modelval = Object.keys(this.uncivil)
|
|
349
|
+
} else {
|
|
350
|
+
this.modelval = []
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
|
|
354
|
+
'modelval.length'() {
|
|
355
|
+
this.sortModelval()
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
</script>
|