three-trees-ui 1.0.83 → 1.0.84
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/lib/three-trees-ui.common.js +17132 -16295
- package/lib/three-trees-ui.css +1 -1
- package/lib/three-trees-ui.umd.js +17132 -16295
- package/lib/three-trees-ui.umd.min.js +1 -1
- package/package.json +1 -1
- package/packages/CustomDialog/src/customDialog.vue +78 -17
- package/packages/DataLists/src/main.vue +2 -3
- package/packages/OrgPostDialog/src/main.vue +1 -1
- package/packages/OrgSelector/src/main.vue +1 -1
- package/packages/QuerySqlPreview/src/QuerySqlPreview.vue +43 -1
- package/packages/Subtable/src/SubPagination.vue +3 -3
- package/packages/Table/src/Table.vue +23 -3
- package/packages/TableSearchField/src/main.vue +5 -0
- package/packages/TemplatePreview/src/TemplatePreview.vue +43 -0
- package/src/mixins/querySqlPreview.js +407 -34
- package/src/mixins/templatePreview.js +577 -69
|
@@ -10,8 +10,9 @@ const axios = require('axios')
|
|
|
10
10
|
const { saveAs } = require('file-saver')
|
|
11
11
|
import _ from 'lodash'
|
|
12
12
|
import { decode } from '@/util/base64'
|
|
13
|
+
import moment from 'moment'
|
|
13
14
|
|
|
14
|
-
const req = function
|
|
15
|
+
const req = function(url, data = {}, option = {}) {
|
|
15
16
|
const requestData = {
|
|
16
17
|
url: url,
|
|
17
18
|
data: data,
|
|
@@ -41,6 +42,7 @@ export default {
|
|
|
41
42
|
},
|
|
42
43
|
data() {
|
|
43
44
|
return {
|
|
45
|
+
defaultQuerys: [],
|
|
44
46
|
treeQuerys: [],
|
|
45
47
|
alias_new: 'statement',
|
|
46
48
|
loading: false,
|
|
@@ -51,6 +53,7 @@ export default {
|
|
|
51
53
|
selectRows: [],
|
|
52
54
|
querys: '',
|
|
53
55
|
},
|
|
56
|
+
exportBtnDisabled: false,
|
|
54
57
|
dialogExportVisible: false,
|
|
55
58
|
exportData: {
|
|
56
59
|
getType: 'all',
|
|
@@ -59,6 +62,8 @@ export default {
|
|
|
59
62
|
displayFields: [],
|
|
60
63
|
exportSellection: [],
|
|
61
64
|
searchForm: {},
|
|
65
|
+
bindKey: {},
|
|
66
|
+
bindValue: {},
|
|
62
67
|
queryForm: {
|
|
63
68
|
queryData: '',
|
|
64
69
|
},
|
|
@@ -112,7 +117,9 @@ export default {
|
|
|
112
117
|
pageSize: 10,
|
|
113
118
|
total: 1,
|
|
114
119
|
},
|
|
120
|
+
lastPage: 1, //上一次输入的分页数、默认为1
|
|
115
121
|
paginationLayout: 'total, sizes, prev, pager, next, jumper',
|
|
122
|
+
paginationLayoutWithoutTotal: 'sizes, prev, pager, next, jumper',
|
|
116
123
|
total: 0,
|
|
117
124
|
permission: {
|
|
118
125
|
print: true,
|
|
@@ -222,6 +229,45 @@ export default {
|
|
|
222
229
|
: 0.85 * window.innerHeight,
|
|
223
230
|
needRequestTotal: false, // 需不需要后端统计列表全部数据
|
|
224
231
|
tableDataTotal: {},
|
|
232
|
+
loadingTotal: false, // 统计按钮加载中
|
|
233
|
+
pageSizeArray: [
|
|
234
|
+
{
|
|
235
|
+
label: '10条/页',
|
|
236
|
+
value: 10,
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
label: '20条/页',
|
|
240
|
+
value: 20,
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
label: '30条/页',
|
|
244
|
+
value: 30,
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
label: '40条/页',
|
|
248
|
+
value: 40,
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
label: '50条/页',
|
|
252
|
+
value: 50,
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
label: '100条/页',
|
|
256
|
+
value: 100,
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
label: '200条/页',
|
|
260
|
+
value: 200,
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
label: '300条/页',
|
|
264
|
+
value: 300,
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
label: '500条/页',
|
|
268
|
+
value: 500,
|
|
269
|
+
},
|
|
270
|
+
],
|
|
225
271
|
}
|
|
226
272
|
},
|
|
227
273
|
watch: {
|
|
@@ -253,7 +299,7 @@ export default {
|
|
|
253
299
|
deep: true,
|
|
254
300
|
},
|
|
255
301
|
ents: {
|
|
256
|
-
handler: function
|
|
302
|
+
handler: function(newVal, oldValue) {
|
|
257
303
|
if (newVal && newVal.length >= 1 && newVal != oldValue) {
|
|
258
304
|
this.getSubData(this, this.refId)
|
|
259
305
|
}
|
|
@@ -262,7 +308,7 @@ export default {
|
|
|
262
308
|
immediate: true,
|
|
263
309
|
},
|
|
264
310
|
templateInfo: {
|
|
265
|
-
handler: function
|
|
311
|
+
handler: async function(newVal) {
|
|
266
312
|
if (newVal && newVal.id) {
|
|
267
313
|
let _me = this
|
|
268
314
|
_me.templateInfo = newVal
|
|
@@ -335,7 +381,7 @@ export default {
|
|
|
335
381
|
)
|
|
336
382
|
params.pagination.querys = querys
|
|
337
383
|
}
|
|
338
|
-
let defaultQuery = this.
|
|
384
|
+
let defaultQuery = await this.newBuildDefaultQuerys()
|
|
339
385
|
if (defaultQuery.length > 0) {
|
|
340
386
|
if (params.pagination.querys) {
|
|
341
387
|
params.pagination.querys.concat(defaultQuery)
|
|
@@ -382,13 +428,13 @@ export default {
|
|
|
382
428
|
deep: true,
|
|
383
429
|
immediate: true,
|
|
384
430
|
},
|
|
385
|
-
currentTabName: function
|
|
431
|
+
currentTabName: function(newVal) {
|
|
386
432
|
if (newVal) {
|
|
387
433
|
this.querySubValue = ''
|
|
388
434
|
}
|
|
389
435
|
},
|
|
390
436
|
rows: {
|
|
391
|
-
handler: function
|
|
437
|
+
handler: function(newVal) {
|
|
392
438
|
if (this.templateInfo.defId) {
|
|
393
439
|
let this_ = this
|
|
394
440
|
let boAlias = this.templateInfo.boDefAlias
|
|
@@ -430,8 +476,9 @@ export default {
|
|
|
430
476
|
if (val) {
|
|
431
477
|
this.$nextTick(() => {
|
|
432
478
|
if (document.getElementById('summaryDiv')) {
|
|
433
|
-
this.summaryTableHeight =
|
|
434
|
-
|
|
479
|
+
this.summaryTableHeight = document.getElementById(
|
|
480
|
+
'summaryDiv'
|
|
481
|
+
).clientHeight
|
|
435
482
|
}
|
|
436
483
|
})
|
|
437
484
|
}
|
|
@@ -442,7 +489,7 @@ export default {
|
|
|
442
489
|
//如果当前页面被嵌入iframe里面不显示草稿
|
|
443
490
|
return !this.isJoinFlow
|
|
444
491
|
},
|
|
445
|
-
navbarCollapseStyle: function
|
|
492
|
+
navbarCollapseStyle: function() {
|
|
446
493
|
if (this.asideShow) {
|
|
447
494
|
return { left: '200px' }
|
|
448
495
|
}
|
|
@@ -481,15 +528,35 @@ export default {
|
|
|
481
528
|
})
|
|
482
529
|
this.handelBindFiledValua()
|
|
483
530
|
let this_ = this
|
|
484
|
-
this.$on('data-reload-success', function
|
|
531
|
+
this.$on('data-reload-success', function() {
|
|
485
532
|
this_.calcScriptBtnPermission()
|
|
486
533
|
})
|
|
487
534
|
this.$emit('afterMounted')
|
|
535
|
+
if (this.templateInfo.jsScript) {
|
|
536
|
+
// 执行js脚本
|
|
537
|
+
this.handleDiyScript(this.templateInfo.jsScript)
|
|
538
|
+
}
|
|
488
539
|
// setTimeout(() => {
|
|
489
540
|
// this.$refs.multipleTemplateTable.handleFilterChange(this.filterMap)
|
|
490
541
|
// }, 100)
|
|
491
542
|
},
|
|
492
543
|
methods: {
|
|
544
|
+
handleDiyScript(scriptValue) {
|
|
545
|
+
//执行前置脚本内容
|
|
546
|
+
const _this = this
|
|
547
|
+
// 用户信息
|
|
548
|
+
const account = this.$requestConfig.getAccount()
|
|
549
|
+
const userId = this.$requestConfig.getUserId()
|
|
550
|
+
const userName = this.$requestConfig.getUsername()
|
|
551
|
+
const preScript = `const scriptFunction = function(_this, account, userId, userName){
|
|
552
|
+
${scriptValue}
|
|
553
|
+
};`
|
|
554
|
+
try {
|
|
555
|
+
eval(`${preScript}scriptFunction(_this, account, userId, userName);`)
|
|
556
|
+
} catch (err) {
|
|
557
|
+
this.$message.error(`脚本事件执行错误:${err}`)
|
|
558
|
+
}
|
|
559
|
+
},
|
|
493
560
|
//因为row.id_ 或row.id可能会有重复,所以加随机值使其唯一
|
|
494
561
|
getRowKey(row) {
|
|
495
562
|
/** 检查row.id是否有重复的缓存对象 */
|
|
@@ -807,7 +874,7 @@ export default {
|
|
|
807
874
|
this.listSelectable = false
|
|
808
875
|
}
|
|
809
876
|
let _this = this
|
|
810
|
-
setTimeout(function
|
|
877
|
+
setTimeout(function() {
|
|
811
878
|
let tdDom = _this.$el.querySelector('td.right_menu')
|
|
812
879
|
if (
|
|
813
880
|
!tdDom ||
|
|
@@ -912,7 +979,7 @@ export default {
|
|
|
912
979
|
selectList[i].selectValue = value
|
|
913
980
|
|
|
914
981
|
//添加监听
|
|
915
|
-
pInst.$watch(path, function
|
|
982
|
+
pInst.$watch(path, function(newVal, oldVal) {
|
|
916
983
|
// 监听中使用间隔请求,减少请求次数
|
|
917
984
|
clearTimeout(this.timeout)
|
|
918
985
|
this.timeout = setTimeout(() => {
|
|
@@ -935,7 +1002,7 @@ export default {
|
|
|
935
1002
|
const value = utils.getValueByPath(pInst, path)
|
|
936
1003
|
|
|
937
1004
|
bindList[i].fillValue = value
|
|
938
|
-
pInst.$watch(path, function
|
|
1005
|
+
pInst.$watch(path, function(newVal, oldVal) {
|
|
939
1006
|
// 监听中使用间隔请求,减少请求次数
|
|
940
1007
|
clearTimeout(this.timeout)
|
|
941
1008
|
this.timeout = setTimeout(() => {
|
|
@@ -1193,7 +1260,7 @@ export default {
|
|
|
1193
1260
|
}
|
|
1194
1261
|
let msg = document.createElement('canvas')
|
|
1195
1262
|
|
|
1196
|
-
this.$qrcode.toCanvas(msg, QRCodeurl, function
|
|
1263
|
+
this.$qrcode.toCanvas(msg, QRCodeurl, function(error) {
|
|
1197
1264
|
console.error(error)
|
|
1198
1265
|
})
|
|
1199
1266
|
let _canvas = document.createElement('div')
|
|
@@ -1233,7 +1300,7 @@ export default {
|
|
|
1233
1300
|
.generateAsync({
|
|
1234
1301
|
type: 'blob',
|
|
1235
1302
|
})
|
|
1236
|
-
.then(function
|
|
1303
|
+
.then(function(content) {
|
|
1237
1304
|
let eleLink = document.createElement('a')
|
|
1238
1305
|
eleLink.download = '二维码.zip'
|
|
1239
1306
|
eleLink.style.display = 'none'
|
|
@@ -1286,7 +1353,7 @@ export default {
|
|
|
1286
1353
|
context.scale(2, 2)
|
|
1287
1354
|
return html2canvas(document.querySelector(classs), {
|
|
1288
1355
|
canvas: canvas2,
|
|
1289
|
-
}).then(function
|
|
1356
|
+
}).then(function(canvas) {
|
|
1290
1357
|
resolve(canvas)
|
|
1291
1358
|
})
|
|
1292
1359
|
})
|
|
@@ -1328,7 +1395,7 @@ export default {
|
|
|
1328
1395
|
// Base64.encode(this.$store.state.login.currentUser.account);
|
|
1329
1396
|
let msg = document.getElementById('QRCode')
|
|
1330
1397
|
|
|
1331
|
-
this.$qrcode.toCanvas(msg, this.QRCodeurl, function
|
|
1398
|
+
this.$qrcode.toCanvas(msg, this.QRCodeurl, function(error) {
|
|
1332
1399
|
console.log(error)
|
|
1333
1400
|
})
|
|
1334
1401
|
this.QRCodeShow = true
|
|
@@ -1341,8 +1408,10 @@ export default {
|
|
|
1341
1408
|
}
|
|
1342
1409
|
for (let x = 0; x < display.length; x++) {
|
|
1343
1410
|
let item = JSON.parse(display[x])
|
|
1344
|
-
if (this.rows[index][item.name]) {
|
|
1345
|
-
|
|
1411
|
+
if (this.rows[index][item.name] || this.rows[index][item.fieldsAlias]) {
|
|
1412
|
+
const qrCode =
|
|
1413
|
+
this.rows[index][item.name] || this.rows[index][item.fieldsAlias]
|
|
1414
|
+
this.QRCodeDesc.push(`${item.desc}:${qrCode}`)
|
|
1346
1415
|
}
|
|
1347
1416
|
}
|
|
1348
1417
|
this.mobileFormAlias = mobileFormAlias
|
|
@@ -1351,15 +1420,15 @@ export default {
|
|
|
1351
1420
|
this.rowTemplateId = templateId
|
|
1352
1421
|
this.rowId = id
|
|
1353
1422
|
},
|
|
1354
|
-
handleSizeChange: function
|
|
1423
|
+
handleSizeChange: function(size) {
|
|
1355
1424
|
//每页下拉显示数据
|
|
1356
1425
|
this.pagination.page = 1
|
|
1357
1426
|
this.pagination.pageSize = size
|
|
1358
1427
|
this.$refs.multipleTemplateTable.handleFilterChange()
|
|
1359
1428
|
},
|
|
1360
|
-
handleCurrentChange: function
|
|
1361
|
-
|
|
1362
|
-
this.pagination.page = currentPage
|
|
1429
|
+
handleCurrentChange: function(currentPage) {
|
|
1430
|
+
//点击第几页,如果当前页数没有值,则默认用上一次页数
|
|
1431
|
+
this.pagination.page = currentPage ? currentPage : this.lastPage
|
|
1363
1432
|
this.$refs.multipleTemplateTable.handleFilterChange()
|
|
1364
1433
|
},
|
|
1365
1434
|
getParam(str) {
|
|
@@ -1407,7 +1476,7 @@ export default {
|
|
|
1407
1476
|
return params
|
|
1408
1477
|
},
|
|
1409
1478
|
//列表数据查询入口
|
|
1410
|
-
search(param, cb, isSearchBtn, needRequestTotal = false) {
|
|
1479
|
+
async search(param, cb, isSearchBtn, needRequestTotal = false) {
|
|
1411
1480
|
// 不需要请求后端接口统计列表数据
|
|
1412
1481
|
this.needRequestTotal = needRequestTotal
|
|
1413
1482
|
// 如果是高级查询,页码重置为首页
|
|
@@ -1520,8 +1589,7 @@ export default {
|
|
|
1520
1589
|
}
|
|
1521
1590
|
//初始化时,把查询字段和筛选字段的默认值也加进去
|
|
1522
1591
|
if (this.isInit) {
|
|
1523
|
-
this.
|
|
1524
|
-
this.handleInitQuery(params)
|
|
1592
|
+
await this.handleInitQuery(params)
|
|
1525
1593
|
}
|
|
1526
1594
|
//数据视图控件
|
|
1527
1595
|
if (this.dataView) {
|
|
@@ -1538,12 +1606,196 @@ export default {
|
|
|
1538
1606
|
params.taskType = this_.taskType
|
|
1539
1607
|
params.defKey = this_.defKey
|
|
1540
1608
|
}
|
|
1609
|
+
// 检查是否有必填字段
|
|
1610
|
+
if (this.checkHaveRequired() && this.isInit) {
|
|
1611
|
+
this.$refs.multipleTemplateTable.showAdvancedSearch = true
|
|
1612
|
+
}
|
|
1613
|
+
// 查询字段 校验是否必填,如果是必填没数据,需返回提示
|
|
1614
|
+
let errorMsg = this.validateSearchRequired(params.pagination.querys)
|
|
1615
|
+
if (errorMsg) {
|
|
1616
|
+
!this.isInit && this.$message.warning(errorMsg)
|
|
1617
|
+
cb && cb()
|
|
1618
|
+
this.isInit = false
|
|
1619
|
+
this.$emit('data-reload-success')
|
|
1620
|
+
return
|
|
1621
|
+
}
|
|
1622
|
+
this.isInit = false
|
|
1541
1623
|
if ($.isEmptyObject(this.searchForm)) {
|
|
1542
1624
|
this.getBpmTemplateByPagination(params, cb)
|
|
1543
1625
|
} else {
|
|
1544
1626
|
this.getBpmTemplateByPagination(params, cb)
|
|
1545
1627
|
}
|
|
1546
1628
|
},
|
|
1629
|
+
// 校验查询字段必填
|
|
1630
|
+
validateSearchRequired(querys = []) {
|
|
1631
|
+
let errorMsg = ''
|
|
1632
|
+
let conditions = JSON.parse(this.templateInfo.conditionField)
|
|
1633
|
+
if (conditions) {
|
|
1634
|
+
conditions.forEach((item) => {
|
|
1635
|
+
if (item.isRequired) {
|
|
1636
|
+
let queryPre = this.getQueryPre(conditions, item.name)
|
|
1637
|
+
let index = querys.findIndex((k) => {
|
|
1638
|
+
return k.property == queryPre + item.name
|
|
1639
|
+
})
|
|
1640
|
+
if (index == -1) {
|
|
1641
|
+
errorMsg = `字段【${item.cm}】为必填查询字段,不能为空!`
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
})
|
|
1645
|
+
}
|
|
1646
|
+
return errorMsg
|
|
1647
|
+
},
|
|
1648
|
+
checkHaveRequired() {
|
|
1649
|
+
let haveRequired = false
|
|
1650
|
+
try {
|
|
1651
|
+
let conditions = JSON.parse(this.templateInfo.conditionField)
|
|
1652
|
+
if (conditions) {
|
|
1653
|
+
haveRequired = conditions.some((item) => {
|
|
1654
|
+
return item.isRequired
|
|
1655
|
+
})
|
|
1656
|
+
}
|
|
1657
|
+
} catch (e) {
|
|
1658
|
+
console.log(e)
|
|
1659
|
+
}
|
|
1660
|
+
return haveRequired
|
|
1661
|
+
},
|
|
1662
|
+
searchCountTotal(param, cb, isSearchBtn, needRequestTotal = false) {
|
|
1663
|
+
// 不需要请求后端接口统计列表数据
|
|
1664
|
+
this.needRequestTotal = needRequestTotal
|
|
1665
|
+
// 如果是高级查询,页码重置为首页
|
|
1666
|
+
if (isSearchBtn) {
|
|
1667
|
+
this.pagination.page = 1
|
|
1668
|
+
}
|
|
1669
|
+
let params = {}
|
|
1670
|
+
//判断为合并查询还是高级查询
|
|
1671
|
+
let showAdvancedSearch = this.$refs.multipleTemplateTable
|
|
1672
|
+
? this.$refs.multipleTemplateTable.showAdvancedSearch
|
|
1673
|
+
: false
|
|
1674
|
+
//高级查询
|
|
1675
|
+
if (showAdvancedSearch) {
|
|
1676
|
+
params = this.getQueryFilter()
|
|
1677
|
+
} else {
|
|
1678
|
+
//合并查询
|
|
1679
|
+
// 快速查询时,需处理添加快速查询字段前缀
|
|
1680
|
+
param = this.handleQuickParams(param)
|
|
1681
|
+
params = this.getConditionQuery(param)
|
|
1682
|
+
}
|
|
1683
|
+
this.templateSearchQuery =
|
|
1684
|
+
(params.pagination && params.pagination.querys) || []
|
|
1685
|
+
if (!params.pagination) {
|
|
1686
|
+
params.pagination = {}
|
|
1687
|
+
}
|
|
1688
|
+
if (!params.pagination.querys) {
|
|
1689
|
+
params.pagination.querys = []
|
|
1690
|
+
}
|
|
1691
|
+
//处理排序字段
|
|
1692
|
+
if (param && param.sorter && param.sorter.length > 0) {
|
|
1693
|
+
let sortField = JSON.parse(this.templateInfo.sortField)
|
|
1694
|
+
params.pagination = params.pagination || {}
|
|
1695
|
+
params.pagination.sorter = []
|
|
1696
|
+
param.sorter.forEach((s) => {
|
|
1697
|
+
let prefix = this.getColPreFix(sortField, s.property)
|
|
1698
|
+
let queryPre = this.getQueryPre(sortField, s.property)
|
|
1699
|
+
// 关联表时需特殊处理
|
|
1700
|
+
let relevancyProperty = this.getRelevancyProperty(
|
|
1701
|
+
sortField,
|
|
1702
|
+
s.property
|
|
1703
|
+
)
|
|
1704
|
+
if (relevancyProperty) {
|
|
1705
|
+
s.property = relevancyProperty
|
|
1706
|
+
}
|
|
1707
|
+
params.pagination.sorter.push({
|
|
1708
|
+
property: queryPre + prefix + s.property,
|
|
1709
|
+
direction: s.direction,
|
|
1710
|
+
})
|
|
1711
|
+
})
|
|
1712
|
+
} else if (this.templateInfo.sortField) {
|
|
1713
|
+
let sortField = JSON.parse(this.templateInfo.sortField)
|
|
1714
|
+
let sorter = []
|
|
1715
|
+
for (let x = 0; x < sortField.length; x++) {
|
|
1716
|
+
const s = sortField[x]
|
|
1717
|
+
// 默认排序字段的排序方向为空或者不为指定值时放弃
|
|
1718
|
+
if (!s.sort || (s.sort != 'ASC' && s.sort != 'DESC')) {
|
|
1719
|
+
continue
|
|
1720
|
+
}
|
|
1721
|
+
let prefix = this.getColPreFix(sortField, s.name)
|
|
1722
|
+
let queryPre = this.getQueryPre(sortField, s.name)
|
|
1723
|
+
if (!queryPre) {
|
|
1724
|
+
if (s.joinTableField && s.tableName) {
|
|
1725
|
+
prefix = `${s.tableName}.${prefix}`
|
|
1726
|
+
} else {
|
|
1727
|
+
prefix = `t.${prefix}`
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
sorter.push({
|
|
1731
|
+
property: queryPre + prefix + s.name,
|
|
1732
|
+
direction: s.sort,
|
|
1733
|
+
})
|
|
1734
|
+
}
|
|
1735
|
+
params.pagination.sorter = sorter
|
|
1736
|
+
} else if (param.querys && param.querys.length > 0) {
|
|
1737
|
+
params.pagination.querys.concat(param.querys)
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
if (params.pagination && params.pagination.querys) {
|
|
1741
|
+
let tempQueryS = []
|
|
1742
|
+
let betweenConditions = {}
|
|
1743
|
+
params.pagination.querys.forEach((q) => {
|
|
1744
|
+
if (
|
|
1745
|
+
q.value != undefined &&
|
|
1746
|
+
(q.operation != 'BETWEEN' || q.value.constructor == Array)
|
|
1747
|
+
) {
|
|
1748
|
+
tempQueryS.push(q)
|
|
1749
|
+
} else if (q.value) {
|
|
1750
|
+
let conditions = q
|
|
1751
|
+
if (betweenConditions[q.property]) {
|
|
1752
|
+
conditions = betweenConditions[q.property]
|
|
1753
|
+
conditions.value = [conditions.value]
|
|
1754
|
+
conditions.value.push(q.value)
|
|
1755
|
+
}
|
|
1756
|
+
betweenConditions[q.property] = conditions
|
|
1757
|
+
}
|
|
1758
|
+
})
|
|
1759
|
+
for (const key in betweenConditions) {
|
|
1760
|
+
tempQueryS.push(betweenConditions[key])
|
|
1761
|
+
}
|
|
1762
|
+
params.pagination.querys = tempQueryS
|
|
1763
|
+
params.pagination.querys = params.pagination.querys
|
|
1764
|
+
? params.pagination.querys.concat(this.treeQuerys)
|
|
1765
|
+
: this.treeQuerys
|
|
1766
|
+
}
|
|
1767
|
+
//把过滤树的条件也拼接进去
|
|
1768
|
+
if (this.treeQuerys && this.treeQuerys.length > 0) {
|
|
1769
|
+
params.pagination.querys = params.pagination.querys
|
|
1770
|
+
? params.pagination.querys.concat(this.treeQuerys)
|
|
1771
|
+
: this.treeQuerys
|
|
1772
|
+
}
|
|
1773
|
+
//初始化时,把查询字段和筛选字段的默认值也加进去
|
|
1774
|
+
if (this.isInit) {
|
|
1775
|
+
this.isInit = false
|
|
1776
|
+
this.handleInitQuery(params)
|
|
1777
|
+
}
|
|
1778
|
+
//数据视图控件
|
|
1779
|
+
if (this.dataView) {
|
|
1780
|
+
this.handelBindFiledValua()
|
|
1781
|
+
params.refIdValue = this.dataView.refIdValue
|
|
1782
|
+
//关联查询字段
|
|
1783
|
+
if (this.dataView.selectList && this.dataView.selectList.length > 0) {
|
|
1784
|
+
params.selectList = this.dataView.selectList
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
const this_ = this
|
|
1788
|
+
if (this_.isJoinFlow) {
|
|
1789
|
+
params.isJoinFlow = true
|
|
1790
|
+
params.taskType = this_.taskType
|
|
1791
|
+
params.defKey = this_.defKey
|
|
1792
|
+
}
|
|
1793
|
+
if ($.isEmptyObject(this.searchForm)) {
|
|
1794
|
+
this.getBpmTemplateByPaginationTotal(params, cb)
|
|
1795
|
+
} else {
|
|
1796
|
+
this.getBpmTemplateByPaginationTotal(params, cb)
|
|
1797
|
+
}
|
|
1798
|
+
},
|
|
1547
1799
|
// 处理快速查询参数
|
|
1548
1800
|
handleQuickParams(param) {
|
|
1549
1801
|
if (param && param.querys && param.querys.length) {
|
|
@@ -1562,20 +1814,24 @@ export default {
|
|
|
1562
1814
|
}
|
|
1563
1815
|
return param
|
|
1564
1816
|
},
|
|
1565
|
-
handleInitQuery(params) {
|
|
1817
|
+
async handleInitQuery(params) {
|
|
1566
1818
|
const conditionFields = JSON.parse(this.templateInfo.conditionField) || []
|
|
1567
1819
|
const querys = []
|
|
1568
|
-
conditionFields.
|
|
1820
|
+
for (let i = 0; i < conditionFields.length; i++) {
|
|
1821
|
+
let item = conditionFields[i]
|
|
1569
1822
|
if (item.defaultValue) {
|
|
1823
|
+
let defaultValue = item.isScriptDefault
|
|
1824
|
+
? await this.getScriptDefaultValue(item.defaultValue)
|
|
1825
|
+
: item.defaultValue
|
|
1570
1826
|
querys.push({
|
|
1571
1827
|
property: `${item.queryPre || ''}${item.colPrefix}${item.name}`,
|
|
1572
|
-
value:
|
|
1828
|
+
value: defaultValue,
|
|
1573
1829
|
operation: item.qt.toUpperCase(),
|
|
1574
1830
|
relation: 'AND',
|
|
1575
1831
|
group: 'defaultQuery',
|
|
1576
1832
|
})
|
|
1577
1833
|
}
|
|
1578
|
-
}
|
|
1834
|
+
}
|
|
1579
1835
|
const filteringFields = JSON.parse(this.templateInfo.filteringField) || []
|
|
1580
1836
|
filteringFields.forEach((item) => {
|
|
1581
1837
|
if (item.defaultValue && item.defaultValue.length) {
|
|
@@ -1628,13 +1884,15 @@ export default {
|
|
|
1628
1884
|
})
|
|
1629
1885
|
}
|
|
1630
1886
|
this.$requestConfig
|
|
1631
|
-
.
|
|
1887
|
+
.getDataTemplateDataListWithoutTotal(dataTemplateQueryVo)
|
|
1632
1888
|
.then((response) => {
|
|
1633
1889
|
this.rows = response.rows
|
|
1634
|
-
this.total = response.total
|
|
1635
1890
|
this.$set(this.pagination, 'page', response.page)
|
|
1636
1891
|
this.$set(this.pagination, 'pageSize', response.pageSize)
|
|
1637
|
-
|
|
1892
|
+
//每次请求后不再统计总数,而是在统计按钮中去统计,当数量统计过一次后,再重新设置到当前页
|
|
1893
|
+
if (this.total) {
|
|
1894
|
+
this.$set(this.pagination, 'total', this.total)
|
|
1895
|
+
}
|
|
1638
1896
|
this.$set(this, 'flowBtnPermission', {})
|
|
1639
1897
|
this.$emit('data-reload-success')
|
|
1640
1898
|
if (response.summary && response.summary.length) {
|
|
@@ -1658,6 +1916,46 @@ export default {
|
|
|
1658
1916
|
cb2 && cb2()
|
|
1659
1917
|
})
|
|
1660
1918
|
},
|
|
1919
|
+
getBpmTemplateByPaginationTotal(params, cb1, cb2) {
|
|
1920
|
+
const dataTemplateQueryVo = {
|
|
1921
|
+
templateId: params.templateId,
|
|
1922
|
+
queryFilter: params.pagination,
|
|
1923
|
+
}
|
|
1924
|
+
if (params.isJoinFlow && params.taskType && params.defKey) {
|
|
1925
|
+
dataTemplateQueryVo.isJoinFlow = params.isJoinFlow
|
|
1926
|
+
dataTemplateQueryVo.taskType = params.taskType
|
|
1927
|
+
dataTemplateQueryVo.defKey = params.defKey
|
|
1928
|
+
}
|
|
1929
|
+
if (params.selectField) {
|
|
1930
|
+
dataTemplateQueryVo.selectField = params.selectField
|
|
1931
|
+
dataTemplateQueryVo.selectValue = params.selectValue
|
|
1932
|
+
}
|
|
1933
|
+
if (params.selectList) {
|
|
1934
|
+
dataTemplateQueryVo.selectList = params.selectList
|
|
1935
|
+
}
|
|
1936
|
+
dataTemplateQueryVo.refIdValue = params.refIdValue
|
|
1937
|
+
this.curSelectParams = dataTemplateQueryVo
|
|
1938
|
+
//加载按钮
|
|
1939
|
+
this.loadingTotal = true
|
|
1940
|
+
this.$requestConfig
|
|
1941
|
+
.getDataTemplateDataListWithTotal(dataTemplateQueryVo)
|
|
1942
|
+
.then((response) => {
|
|
1943
|
+
//设置总数
|
|
1944
|
+
this.total = response.value
|
|
1945
|
+
this.$set(this.pagination, 'total', response.value)
|
|
1946
|
+
this.loadingTotal = false
|
|
1947
|
+
this.$emit('data-reload-success')
|
|
1948
|
+
this.$nextTick(() => {
|
|
1949
|
+
this.$refs.multipleTemplateTable &&
|
|
1950
|
+
this.$refs.multipleTemplateTable.doLayout()
|
|
1951
|
+
})
|
|
1952
|
+
})
|
|
1953
|
+
.finally(() => {
|
|
1954
|
+
this.loadingTotal = false
|
|
1955
|
+
cb1 && cb1()
|
|
1956
|
+
cb2 && cb2()
|
|
1957
|
+
})
|
|
1958
|
+
},
|
|
1661
1959
|
getQueryFilter() {
|
|
1662
1960
|
let operationMap = this.getSearchItems()
|
|
1663
1961
|
let fieldTypeMap = this.getFieldType()
|
|
@@ -1674,6 +1972,12 @@ export default {
|
|
|
1674
1972
|
params.pagination = pageBean
|
|
1675
1973
|
if (!$.isEmptyObject(this.searchForm)) {
|
|
1676
1974
|
let conditionField = utils.parseToJson(this.templateInfo.conditionField)
|
|
1975
|
+
//处理绑定字段
|
|
1976
|
+
this.bindValue = this.searchForm.bindValue || this.bindValue
|
|
1977
|
+
this.bindKey = this.searchForm.bindKey || this.bindKey
|
|
1978
|
+
//记录后再删除
|
|
1979
|
+
delete this.searchForm.bindValue
|
|
1980
|
+
delete this.searchForm.bindKey
|
|
1677
1981
|
for (let key in this.searchForm) {
|
|
1678
1982
|
if (
|
|
1679
1983
|
typeof this.searchForm[key] != 'undefined' &&
|
|
@@ -1711,6 +2015,16 @@ export default {
|
|
|
1711
2015
|
if (fieldTypeMap[key] && fieldTypeMap[key] == 'number') {
|
|
1712
2016
|
value = parseFloat(this.searchForm[key])
|
|
1713
2017
|
}
|
|
2018
|
+
//在表单列表的查询字段中添加的对话框控件 此处逻辑对应 packages/CustomDialog/src/customDialog.vue:1920行
|
|
2019
|
+
if (
|
|
2020
|
+
this.bindValue &&
|
|
2021
|
+
Object.keys(this.bindValue).length &&
|
|
2022
|
+
this.bindValue[key] &&
|
|
2023
|
+
Object.keys(this.bindKey).length
|
|
2024
|
+
) {
|
|
2025
|
+
//获得绑定字段的值
|
|
2026
|
+
value = this.bindValue[key][this.bindKey[key]]
|
|
2027
|
+
}
|
|
1714
2028
|
let queryPre = this.getQueryPre(conditionField, key)
|
|
1715
2029
|
querys.push({
|
|
1716
2030
|
property: queryPre + key,
|
|
@@ -1723,7 +2037,14 @@ export default {
|
|
|
1723
2037
|
}
|
|
1724
2038
|
}
|
|
1725
2039
|
this.clearQueryByGroupName(querys, 'filter')
|
|
1726
|
-
//
|
|
2040
|
+
// 将过滤条件添加查询参数数组中,不是高级查询时使用
|
|
2041
|
+
if (
|
|
2042
|
+
this.$refs.multipleTemplateTable &&
|
|
2043
|
+
this.$refs.multipleTemplateTable.querys &&
|
|
2044
|
+
!this.$refs.multipleTemplateTable.showAdvancedSearch
|
|
2045
|
+
) {
|
|
2046
|
+
querys.push(...this.$refs.multipleTemplateTable.querys)
|
|
2047
|
+
}
|
|
1727
2048
|
this.buildFilterParams(querys)
|
|
1728
2049
|
}
|
|
1729
2050
|
// 判断table中是否含有filter查询
|
|
@@ -1876,10 +2197,18 @@ export default {
|
|
|
1876
2197
|
? operationType[operation]
|
|
1877
2198
|
: operation
|
|
1878
2199
|
} else if (
|
|
1879
|
-
typeof $(searchItems[i])
|
|
2200
|
+
typeof $(searchItems[i])
|
|
2201
|
+
.children()
|
|
2202
|
+
.attr('ht-query') != 'undefined'
|
|
1880
2203
|
) {
|
|
1881
|
-
operation = $(searchItems[i])
|
|
1882
|
-
|
|
2204
|
+
operation = $(searchItems[i])
|
|
2205
|
+
.children()
|
|
2206
|
+
.attr('operation')
|
|
2207
|
+
operationMap[
|
|
2208
|
+
$(searchItems[i])
|
|
2209
|
+
.children()
|
|
2210
|
+
.attr('ht-query')
|
|
2211
|
+
] =
|
|
1883
2212
|
typeof operationType[operation] != 'undefined'
|
|
1884
2213
|
? operationType[operation]
|
|
1885
2214
|
: operation
|
|
@@ -1905,10 +2234,18 @@ export default {
|
|
|
1905
2234
|
? operationType[operation]
|
|
1906
2235
|
: operation
|
|
1907
2236
|
} else if (
|
|
1908
|
-
typeof $(searchItems[i])
|
|
2237
|
+
typeof $(searchItems[i])
|
|
2238
|
+
.children()
|
|
2239
|
+
.attr('ht-query') != 'undefined'
|
|
1909
2240
|
) {
|
|
1910
|
-
operation = $(searchItems[i])
|
|
1911
|
-
|
|
2241
|
+
operation = $(searchItems[i])
|
|
2242
|
+
.children()
|
|
2243
|
+
.attr('type')
|
|
2244
|
+
operationMap[
|
|
2245
|
+
$(searchItems[i])
|
|
2246
|
+
.children()
|
|
2247
|
+
.attr('ht-query')
|
|
2248
|
+
] =
|
|
1912
2249
|
typeof operationType[operation] != 'undefined'
|
|
1913
2250
|
? operationType[operation]
|
|
1914
2251
|
: operation
|
|
@@ -1931,12 +2268,19 @@ export default {
|
|
|
1931
2268
|
? true
|
|
1932
2269
|
: false
|
|
1933
2270
|
} else if (
|
|
1934
|
-
typeof $(searchItems[i])
|
|
2271
|
+
typeof $(searchItems[i])
|
|
2272
|
+
.children()
|
|
2273
|
+
.attr('ht-query') != 'undefined'
|
|
1935
2274
|
) {
|
|
1936
2275
|
//查询条件字段
|
|
1937
|
-
fieldQueryMap[
|
|
1938
|
-
|
|
1939
|
-
|
|
2276
|
+
fieldQueryMap[
|
|
2277
|
+
$(searchItems[i])
|
|
2278
|
+
.children()
|
|
2279
|
+
.attr('ht-query')
|
|
2280
|
+
] =
|
|
2281
|
+
typeof $(searchItems[i])
|
|
2282
|
+
.children()
|
|
2283
|
+
.attr('special-query') != 'undefined'
|
|
1940
2284
|
? true
|
|
1941
2285
|
: false
|
|
1942
2286
|
}
|
|
@@ -2004,7 +2348,7 @@ export default {
|
|
|
2004
2348
|
}
|
|
2005
2349
|
},
|
|
2006
2350
|
//回车查询
|
|
2007
|
-
searchEnterFun: function
|
|
2351
|
+
searchEnterFun: function(e) {
|
|
2008
2352
|
let keyCode = window.event ? e.keyCode : e.which
|
|
2009
2353
|
if (keyCode == 13) {
|
|
2010
2354
|
this.search()
|
|
@@ -2309,7 +2653,9 @@ export default {
|
|
|
2309
2653
|
handledUrlParams(url, row, fieldName) {
|
|
2310
2654
|
if (this.templateInfo.displayField) {
|
|
2311
2655
|
let displayFields = JSON.parse(this.templateInfo.displayField)
|
|
2312
|
-
let params =
|
|
2656
|
+
let params =
|
|
2657
|
+
this.getParentId(displayFields, fieldName, 'name') ||
|
|
2658
|
+
this.getParentId(displayFields, fieldName, 'fieldsAlias')
|
|
2313
2659
|
if (params && params.urlParams && params.urlParams.length > 0) {
|
|
2314
2660
|
let urlParams = params.urlParams
|
|
2315
2661
|
let suffix = ''
|
|
@@ -2464,10 +2810,19 @@ export default {
|
|
|
2464
2810
|
selectedQuery,
|
|
2465
2811
|
]
|
|
2466
2812
|
}
|
|
2813
|
+
// 校验
|
|
2814
|
+
let errorMsg = this.validateSearchRequired(
|
|
2815
|
+
this.curSelectParams.queryFilter.querys
|
|
2816
|
+
)
|
|
2817
|
+
if (errorMsg) {
|
|
2818
|
+
this.$message.warning(errorMsg)
|
|
2819
|
+
return
|
|
2820
|
+
}
|
|
2467
2821
|
//导出全部数据按钮
|
|
2468
2822
|
if (type == 'all') {
|
|
2469
2823
|
this.curSelectParams.queryFilter.querys = []
|
|
2470
2824
|
}
|
|
2825
|
+
this.exportBtnDisabled = true
|
|
2471
2826
|
let loadingInstance = Loading.service({
|
|
2472
2827
|
fullscreen: true,
|
|
2473
2828
|
}) //开始
|
|
@@ -2476,24 +2831,30 @@ export default {
|
|
|
2476
2831
|
id: this.templateInfo.id,
|
|
2477
2832
|
params: this.curSelectParams,
|
|
2478
2833
|
})
|
|
2479
|
-
.then(
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
)
|
|
2834
|
+
// .then(
|
|
2835
|
+
// ({ data, headers }) => {
|
|
2836
|
+
// const fileName = decodeURIComponent(
|
|
2837
|
+
// headers['content-disposition'].split(';')[1].split('filename=')[1]
|
|
2838
|
+
// )
|
|
2839
|
+
// const blob = new Blob([data])
|
|
2840
|
+
// saveAs(blob, fileName)
|
|
2841
|
+
// loadingInstance.close() // 结束
|
|
2842
|
+
// },
|
|
2843
|
+
// (e) => {
|
|
2844
|
+
// loadingInstance.close() // 结束
|
|
2845
|
+
// let enc = new TextDecoder('utf-8')
|
|
2846
|
+
// let uint8_msg = JSON.parse(
|
|
2847
|
+
// enc.decode(new Uint8Array(e.response.data))
|
|
2848
|
+
// )
|
|
2849
|
+
// this.$message.error(uint8_msg.message)
|
|
2850
|
+
// }
|
|
2851
|
+
// )
|
|
2852
|
+
.then(() => {
|
|
2853
|
+
this.$message.success('正在导出,请稍后前往报表附件管理查看')
|
|
2854
|
+
})
|
|
2855
|
+
.finally(() => {
|
|
2856
|
+
loadingInstance.close()
|
|
2857
|
+
})
|
|
2497
2858
|
},
|
|
2498
2859
|
importCommand(params) {
|
|
2499
2860
|
switch (params.command) {
|
|
@@ -3100,7 +3461,7 @@ export default {
|
|
|
3100
3461
|
}
|
|
3101
3462
|
this.dialogSubVisible = true
|
|
3102
3463
|
},
|
|
3103
|
-
nodeClick(node) {
|
|
3464
|
+
async nodeClick(node) {
|
|
3104
3465
|
this.pagination.page = 1
|
|
3105
3466
|
//每次点击过滤树,应该把右边的table 与分页全部重置为初始
|
|
3106
3467
|
|
|
@@ -3135,7 +3496,9 @@ export default {
|
|
|
3135
3496
|
pageBean.querys.push({
|
|
3136
3497
|
property: item.isMain
|
|
3137
3498
|
? `t.${item.key_.oldTableField}`
|
|
3138
|
-
: `${item.key_.
|
|
3499
|
+
: `${item.key_.alias ? item.key_.alias : item.key_.tableName}.${
|
|
3500
|
+
item.key_.oldTableField
|
|
3501
|
+
}`,
|
|
3139
3502
|
value,
|
|
3140
3503
|
group: 'main',
|
|
3141
3504
|
operation,
|
|
@@ -3164,7 +3527,13 @@ export default {
|
|
|
3164
3527
|
params.taskType = this_.taskType
|
|
3165
3528
|
params.defKey = this_.defKey
|
|
3166
3529
|
}
|
|
3167
|
-
this.handleInitQuery(params)
|
|
3530
|
+
await this.handleInitQuery(params)
|
|
3531
|
+
// 查询字段 校验是否必填,如果是必填没数据,需返回提示
|
|
3532
|
+
let errorMsg = this.validateSearchRequired(params.pagination.querys)
|
|
3533
|
+
if (errorMsg) {
|
|
3534
|
+
this.$message.warning(errorMsg)
|
|
3535
|
+
return
|
|
3536
|
+
}
|
|
3168
3537
|
this.getBpmTemplateByPagination(params)
|
|
3169
3538
|
},
|
|
3170
3539
|
filterChange(filters) {
|
|
@@ -3819,7 +4188,7 @@ export default {
|
|
|
3819
4188
|
}
|
|
3820
4189
|
this.$requestConfig
|
|
3821
4190
|
.batchUpdateTemplateData(data)
|
|
3822
|
-
.then((data) => {
|
|
4191
|
+
.then(async (data) => {
|
|
3823
4192
|
if (data.state) {
|
|
3824
4193
|
this.$message({
|
|
3825
4194
|
type: 'success',
|
|
@@ -3829,8 +4198,9 @@ export default {
|
|
|
3829
4198
|
// 以服务的方式调用的 Loading 需要异步关闭
|
|
3830
4199
|
loadingInstance.close()
|
|
3831
4200
|
})
|
|
4201
|
+
let defaultValue = await this.newBuildDefaultQuerys()
|
|
3832
4202
|
this.search({
|
|
3833
|
-
querys:
|
|
4203
|
+
querys: defaultValue || [],
|
|
3834
4204
|
})
|
|
3835
4205
|
// 更新成功后需执行后置js
|
|
3836
4206
|
if (afterScriptValue) {
|
|
@@ -3944,6 +4314,120 @@ export default {
|
|
|
3944
4314
|
})
|
|
3945
4315
|
return querys
|
|
3946
4316
|
},
|
|
4317
|
+
async newBuildDefaultQuerys(isSetSearchForm = true) {
|
|
4318
|
+
let this_ = this
|
|
4319
|
+
let querys = []
|
|
4320
|
+
let conditions = JSON.parse(this_.templateInfo.conditionField)
|
|
4321
|
+
//条件字段默认值判断
|
|
4322
|
+
for (let i = 0; i < conditions.length; i++) {
|
|
4323
|
+
let condition = conditions[i]
|
|
4324
|
+
if (condition.defaultValue) {
|
|
4325
|
+
let field = condition.colPrefix + condition.na
|
|
4326
|
+
let defaultValue = condition.isScriptDefault
|
|
4327
|
+
? await this.getScriptDefaultValue(condition.defaultValue)
|
|
4328
|
+
: condition.defaultValue
|
|
4329
|
+
if (isSetSearchForm) {
|
|
4330
|
+
this_.$set(this_.searchForm, field, defaultValue)
|
|
4331
|
+
}
|
|
4332
|
+
let value = defaultValue
|
|
4333
|
+
if (condition.ty == 'number') {
|
|
4334
|
+
value = parseFloat(value)
|
|
4335
|
+
}
|
|
4336
|
+
querys.push({
|
|
4337
|
+
property: condition.queryPre ? condition.queryPre + field : field,
|
|
4338
|
+
value: value,
|
|
4339
|
+
group: 'main',
|
|
4340
|
+
operation: condition.qt.toUpperCase(),
|
|
4341
|
+
relation: 'AND',
|
|
4342
|
+
})
|
|
4343
|
+
}
|
|
4344
|
+
}
|
|
4345
|
+
//筛选字段默认值判断
|
|
4346
|
+
|
|
4347
|
+
if (this.parameterqQuerys) {
|
|
4348
|
+
let parameterQuerys = JSON.parse(Base64.decode(this.parameterqQuerys))
|
|
4349
|
+
if (parameterQuerys && parameterQuerys.length > 0) {
|
|
4350
|
+
parameterQuerys.forEach((query) => {
|
|
4351
|
+
let prefix = this.templateInfo.isExternal === 1 ? '' : 'F_'
|
|
4352
|
+
query.property = prefix + query.property
|
|
4353
|
+
if (isSetSearchForm) {
|
|
4354
|
+
this_.$set(this_.searchForm, query.property, query.value)
|
|
4355
|
+
}
|
|
4356
|
+
querys.push(query)
|
|
4357
|
+
})
|
|
4358
|
+
}
|
|
4359
|
+
}
|
|
4360
|
+
let filters = JSON.parse(this_.templateInfo.filteringField)
|
|
4361
|
+
filters.forEach((filter) => {
|
|
4362
|
+
if (filter.defaultValue && filter.defaultValue.length > 0) {
|
|
4363
|
+
this_.filterMap[filter.name] = filter.defaultValue
|
|
4364
|
+
filter.defaultValue.forEach((val) => {
|
|
4365
|
+
querys.push({
|
|
4366
|
+
property: `${filter.queryPre || ''}${filter.colPrefix}${
|
|
4367
|
+
filter.name
|
|
4368
|
+
}`,
|
|
4369
|
+
value: val,
|
|
4370
|
+
group: 'defVal_' + filter.name,
|
|
4371
|
+
operation: 'EQUAL',
|
|
4372
|
+
relation: 'OR',
|
|
4373
|
+
})
|
|
4374
|
+
})
|
|
4375
|
+
}
|
|
4376
|
+
})
|
|
4377
|
+
this_.$on('afterMounted', () => {
|
|
4378
|
+
const tab = document.getElementById(this_.templateInfo.alias)
|
|
4379
|
+
if (tab && tab.__vue__) {
|
|
4380
|
+
let headerColumns = tab.__vue__.$refs.tableHeader
|
|
4381
|
+
? tab.__vue__.$refs.tableHeader.columns
|
|
4382
|
+
: []
|
|
4383
|
+
headerColumns.forEach((column) => {
|
|
4384
|
+
if (this_.filterMap.hasOwnProperty(column.property)) {
|
|
4385
|
+
this_.filterMap[column.property].forEach((val) => {
|
|
4386
|
+
column.filteredValue.push(val)
|
|
4387
|
+
})
|
|
4388
|
+
}
|
|
4389
|
+
})
|
|
4390
|
+
}
|
|
4391
|
+
})
|
|
4392
|
+
this.defaultQuerys = querys
|
|
4393
|
+
return querys
|
|
4394
|
+
},
|
|
4395
|
+
getScriptDefaultValue(scriptValue) {
|
|
4396
|
+
return new Promise((resolve) => {
|
|
4397
|
+
//执行前置脚本内容
|
|
4398
|
+
const _this = this
|
|
4399
|
+
// 用户信息
|
|
4400
|
+
const account = this.$requestConfig.getAccount()
|
|
4401
|
+
const userId = this.$requestConfig.getUserId()
|
|
4402
|
+
const userName = this.$requestConfig.getUsername()
|
|
4403
|
+
const _moment = moment
|
|
4404
|
+
const preScript = `const scriptFunction = function(_this, account, userId, userName, _moment){
|
|
4405
|
+
${scriptValue}
|
|
4406
|
+
};`
|
|
4407
|
+
let result = ''
|
|
4408
|
+
try {
|
|
4409
|
+
result = eval(
|
|
4410
|
+
`${preScript}scriptFunction(_this, account, userId, userName, _moment);`
|
|
4411
|
+
)
|
|
4412
|
+
if (result && result.then && typeof result.then === 'function') {
|
|
4413
|
+
result.then(
|
|
4414
|
+
(t) => {
|
|
4415
|
+
resolve(t)
|
|
4416
|
+
},
|
|
4417
|
+
(fail) => {
|
|
4418
|
+
//接口返回失败则终止按钮操作,并输出错误信息
|
|
4419
|
+
resolve('')
|
|
4420
|
+
}
|
|
4421
|
+
)
|
|
4422
|
+
} else {
|
|
4423
|
+
resolve(result)
|
|
4424
|
+
}
|
|
4425
|
+
} catch (err) {
|
|
4426
|
+
resolve('')
|
|
4427
|
+
this.$message.error(`查询值默认脚本事件执行错误:${err}`)
|
|
4428
|
+
}
|
|
4429
|
+
})
|
|
4430
|
+
},
|
|
3947
4431
|
handleClose() {
|
|
3948
4432
|
this.dataViewDialogVisible = false
|
|
3949
4433
|
},
|
|
@@ -4631,6 +5115,30 @@ export default {
|
|
|
4631
5115
|
)
|
|
4632
5116
|
: customColumns
|
|
4633
5117
|
},
|
|
5118
|
+
countPageTotal() {
|
|
5119
|
+
this.searchCountTotal(this.getParam())
|
|
5120
|
+
},
|
|
5121
|
+
switchPage(type) {
|
|
5122
|
+
if (type == 'prev') this.pagination.page--
|
|
5123
|
+
if (type == 'next') this.pagination.page++
|
|
5124
|
+
this.handleCurrentChange(this.pagination.page)
|
|
5125
|
+
},
|
|
5126
|
+
handleInput(value) {
|
|
5127
|
+
if (!value) {
|
|
5128
|
+
return
|
|
5129
|
+
}
|
|
5130
|
+
// 使用正则表达式匹配正整数
|
|
5131
|
+
const regex = /^[1-9]\d*$/
|
|
5132
|
+
|
|
5133
|
+
// 如果输入的值不符合正整数的模式,则将其重置为1
|
|
5134
|
+
if (!regex.test(value)) {
|
|
5135
|
+
//如果上一次输入的页数有值,则用上一次输入的页数,否则默认为1
|
|
5136
|
+
this.pagination.page = this.lastPage ? this.lastPage : 1
|
|
5137
|
+
} else {
|
|
5138
|
+
//本次分页数,赋值给上一次分页数
|
|
5139
|
+
this.lastPage = this.pagination.page
|
|
5140
|
+
}
|
|
5141
|
+
},
|
|
4634
5142
|
},
|
|
4635
5143
|
// asyncComputed: {
|
|
4636
5144
|
// showDraftList() {
|