three-trees-ui 1.0.30 → 1.0.32
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/package.json
CHANGED
|
@@ -2,6 +2,8 @@ import { Loading } from 'element-ui'
|
|
|
2
2
|
import utils from 'three-trees-ui/src/utils.js'
|
|
3
3
|
const { Base64 } = require('js-base64')
|
|
4
4
|
const { saveAs } = require('file-saver')
|
|
5
|
+
import { decode } from '@/util/base64'
|
|
6
|
+
|
|
5
7
|
import Vue from 'vue'
|
|
6
8
|
import $ from 'jquery'
|
|
7
9
|
import _ from 'lodash'
|
|
@@ -49,12 +51,12 @@ export default {
|
|
|
49
51
|
}
|
|
50
52
|
},
|
|
51
53
|
watch: {
|
|
52
|
-
formKey: function
|
|
54
|
+
formKey: function(newVal) {
|
|
53
55
|
if (newVal) {
|
|
54
56
|
this.init()
|
|
55
57
|
}
|
|
56
58
|
},
|
|
57
|
-
'tableData.selectRows': function
|
|
59
|
+
'tableData.selectRows': function(newVal) {
|
|
58
60
|
if (newVal.length > 0) {
|
|
59
61
|
let me_ = this
|
|
60
62
|
me_.uploadParams.id = []
|
|
@@ -83,10 +85,10 @@ export default {
|
|
|
83
85
|
handler(newVal) {
|
|
84
86
|
if (newVal.shows) {
|
|
85
87
|
let displayField = utils.parseToJson(newVal.shows)
|
|
86
|
-
let buttonsts = utils.parseToJson(newVal.buttons)
|
|
88
|
+
let buttonsts = utils.parseToJson(newVal.buttons)
|
|
87
89
|
console.log(buttonsts)
|
|
88
|
-
if(buttonsts[0].isdefault ==
|
|
89
|
-
|
|
90
|
+
if (buttonsts[0].isdefault == '1') {
|
|
91
|
+
this.isdefaultQuery = false
|
|
90
92
|
}
|
|
91
93
|
for (var i = 0; i < displayField.length; i++) {
|
|
92
94
|
if (displayField[i].hidden == 0) {
|
|
@@ -247,7 +249,7 @@ export default {
|
|
|
247
249
|
this.$router.push(url)
|
|
248
250
|
},
|
|
249
251
|
|
|
250
|
-
handleSizeChange: function
|
|
252
|
+
handleSizeChange: function(size) {
|
|
251
253
|
//每页下拉显示数据
|
|
252
254
|
this.pagination.pageSize = size
|
|
253
255
|
if (this.$refs.queryViewList) {
|
|
@@ -256,7 +258,7 @@ export default {
|
|
|
256
258
|
this.search()
|
|
257
259
|
}
|
|
258
260
|
},
|
|
259
|
-
handleCurrentChange: function
|
|
261
|
+
handleCurrentChange: function(currentPage) {
|
|
260
262
|
//点击第几页
|
|
261
263
|
this.pagination.page = currentPage
|
|
262
264
|
if (this.$refs.queryViewList) {
|
|
@@ -266,7 +268,7 @@ export default {
|
|
|
266
268
|
}
|
|
267
269
|
},
|
|
268
270
|
//回车查询
|
|
269
|
-
searchEnterFun: function
|
|
271
|
+
searchEnterFun: function(e) {
|
|
270
272
|
let keyCode = window.event ? e.keyCode : e.which
|
|
271
273
|
if (keyCode == 13) {
|
|
272
274
|
this.pagination.page = 1
|
|
@@ -419,11 +421,19 @@ export default {
|
|
|
419
421
|
? operationType[operation]
|
|
420
422
|
: operation
|
|
421
423
|
} else if (
|
|
422
|
-
typeof $(searchItems[i])
|
|
424
|
+
typeof $(searchItems[i])
|
|
425
|
+
.children()
|
|
426
|
+
.attr('ht-query') != 'undefined'
|
|
423
427
|
) {
|
|
424
428
|
//查询条件类型
|
|
425
|
-
operation = $(searchItems[i])
|
|
426
|
-
|
|
429
|
+
operation = $(searchItems[i])
|
|
430
|
+
.children()
|
|
431
|
+
.attr('operation')
|
|
432
|
+
operationMap[
|
|
433
|
+
$(searchItems[i])
|
|
434
|
+
.children()
|
|
435
|
+
.attr('ht-query')
|
|
436
|
+
] =
|
|
427
437
|
typeof operationType[operation] != 'undefined'
|
|
428
438
|
? operationType[operation]
|
|
429
439
|
: operation
|
|
@@ -445,12 +455,16 @@ export default {
|
|
|
445
455
|
searchItems[i]
|
|
446
456
|
).attr('field-query')
|
|
447
457
|
} else if (
|
|
448
|
-
typeof $(searchItems[i])
|
|
458
|
+
typeof $(searchItems[i])
|
|
459
|
+
.children()
|
|
460
|
+
.attr('ht-query') != 'undefined'
|
|
449
461
|
) {
|
|
450
462
|
//查询条件字段
|
|
451
|
-
fieldQueryMap[
|
|
452
|
-
searchItems[i]
|
|
453
|
-
|
|
463
|
+
fieldQueryMap[
|
|
464
|
+
$(searchItems[i])
|
|
465
|
+
.children()
|
|
466
|
+
.attr('ht-query')
|
|
467
|
+
] = $(searchItems[i])
|
|
454
468
|
.children()
|
|
455
469
|
.attr('field-query')
|
|
456
470
|
}
|
|
@@ -472,12 +486,19 @@ export default {
|
|
|
472
486
|
? true
|
|
473
487
|
: false
|
|
474
488
|
} else if (
|
|
475
|
-
typeof $(searchItems[i])
|
|
489
|
+
typeof $(searchItems[i])
|
|
490
|
+
.children()
|
|
491
|
+
.attr('ht-query') != 'undefined'
|
|
476
492
|
) {
|
|
477
493
|
//查询条件字段
|
|
478
|
-
fieldQueryMap[
|
|
479
|
-
|
|
480
|
-
|
|
494
|
+
fieldQueryMap[
|
|
495
|
+
$(searchItems[i])
|
|
496
|
+
.children()
|
|
497
|
+
.attr('ht-query')
|
|
498
|
+
] =
|
|
499
|
+
typeof $(searchItems[i])
|
|
500
|
+
.children()
|
|
501
|
+
.attr('special-query') != 'undefined'
|
|
481
502
|
? true
|
|
482
503
|
: false
|
|
483
504
|
}
|
|
@@ -559,14 +580,16 @@ export default {
|
|
|
559
580
|
},
|
|
560
581
|
//点击导出按钮
|
|
561
582
|
exports() {
|
|
562
|
-
if(this.isdefaultQuery){
|
|
583
|
+
if (this.isdefaultQuery) {
|
|
563
584
|
this.dialogExportVisible = true
|
|
564
|
-
}else{
|
|
565
|
-
|
|
566
|
-
|
|
585
|
+
} else {
|
|
586
|
+
// 增加导出字段限制
|
|
587
|
+
const checkField = this.getCheckField().map((item) => item.value)
|
|
588
|
+
this.exportData.expField = this.displayFields.filter((item) =>
|
|
589
|
+
checkField.includes(item.fieldName)
|
|
590
|
+
)
|
|
567
591
|
this.submitExport()
|
|
568
592
|
}
|
|
569
|
-
|
|
570
593
|
},
|
|
571
594
|
punchOrder() {
|
|
572
595
|
this.$store
|
|
@@ -861,5 +884,19 @@ export default {
|
|
|
861
884
|
showSearchPane() {
|
|
862
885
|
return true
|
|
863
886
|
},
|
|
887
|
+
getCheckField() {
|
|
888
|
+
let customColumns = this.$refs.queryViewList.customColumns || []
|
|
889
|
+
let customColumnSetting = JSON.parse(
|
|
890
|
+
localStorage.getItem('customColumnSetting') || '{}'
|
|
891
|
+
)
|
|
892
|
+
const keys = customColumns.reduce((m, n) => m.concat(n.key), [])
|
|
893
|
+
const customColumnsHashCode = utils.hashCode(keys.join(','))
|
|
894
|
+
const checkField = JSON.parse(
|
|
895
|
+
decode(customColumnSetting[customColumnsHashCode]) || '[]'
|
|
896
|
+
)
|
|
897
|
+
return checkField.filter(
|
|
898
|
+
(field) => field.checked && ['序号', '操作'].indexOf(field.value) == -1
|
|
899
|
+
)
|
|
900
|
+
},
|
|
864
901
|
},
|
|
865
902
|
}
|
|
@@ -9,6 +9,7 @@ import $ from 'jquery'
|
|
|
9
9
|
const axios = require('axios')
|
|
10
10
|
const { saveAs } = require('file-saver')
|
|
11
11
|
import _ from 'lodash'
|
|
12
|
+
import { decode } from '@/util/base64'
|
|
12
13
|
|
|
13
14
|
const req = function(url, data = {}, option = {}) {
|
|
14
15
|
const requestData = {
|
|
@@ -464,9 +465,13 @@ export default {
|
|
|
464
465
|
return list
|
|
465
466
|
},
|
|
466
467
|
tableHeight() {
|
|
468
|
+
const currentHeight = 0.85 * window.innerHeight
|
|
469
|
+
const tableHeight = this.currentTableHeight
|
|
470
|
+
? this.currentTableHeight
|
|
471
|
+
: currentHeight
|
|
467
472
|
return this.summaryFields && this.summaryFields.length > 0
|
|
468
|
-
?
|
|
469
|
-
:
|
|
473
|
+
? tableHeight - this.summaryTableHeight
|
|
474
|
+
: tableHeight
|
|
470
475
|
},
|
|
471
476
|
},
|
|
472
477
|
mounted() {
|
|
@@ -2417,6 +2422,15 @@ export default {
|
|
|
2417
2422
|
if (type === 'searchResult') {
|
|
2418
2423
|
this.curSelectParams.queryFilter.querys = this.templateSearchQuery
|
|
2419
2424
|
}
|
|
2425
|
+
// 增加导出字段限制
|
|
2426
|
+
const checkField = this.getCheckField()
|
|
2427
|
+
if (checkField && checkField.length) {
|
|
2428
|
+
let fieldExport = {}
|
|
2429
|
+
checkField.forEach((item) => {
|
|
2430
|
+
fieldExport[item.key] = item.value
|
|
2431
|
+
})
|
|
2432
|
+
this.curSelectParams.fieldExport = fieldExport
|
|
2433
|
+
}
|
|
2420
2434
|
this.$requestConfig
|
|
2421
2435
|
.exportByBtnSetting({
|
|
2422
2436
|
id: this.templateInfo.id,
|
|
@@ -4518,6 +4532,20 @@ export default {
|
|
|
4518
4532
|
return strData
|
|
4519
4533
|
}
|
|
4520
4534
|
},
|
|
4535
|
+
getCheckField() {
|
|
4536
|
+
let customColumns = this.$refs.multipleTemplateTable.customColumns || []
|
|
4537
|
+
let customColumnSetting = JSON.parse(
|
|
4538
|
+
localStorage.getItem('customColumnSetting') || '{}'
|
|
4539
|
+
)
|
|
4540
|
+
const keys = customColumns.reduce((m, n) => m.concat(n.key), [])
|
|
4541
|
+
const customColumnsHashCode = utils.hashCode(keys.join(','))
|
|
4542
|
+
const checkField = JSON.parse(
|
|
4543
|
+
decode(customColumnSetting[customColumnsHashCode]) || '[]'
|
|
4544
|
+
)
|
|
4545
|
+
return checkField.filter(
|
|
4546
|
+
(field) => field.checked && ['序号', '操作'].indexOf(field.value) == -1
|
|
4547
|
+
)
|
|
4548
|
+
},
|
|
4521
4549
|
},
|
|
4522
4550
|
// asyncComputed: {
|
|
4523
4551
|
// showDraftList() {
|