three-trees-ui 1.0.62 → 1.0.64
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 +17286 -16186
- package/lib/three-trees-ui.css +1 -1
- package/lib/three-trees-ui.umd.js +17286 -16186
- package/lib/three-trees-ui.umd.min.js +1 -1
- package/package.json +1 -1
- package/packages/CustomDialog/src/customDialog.vue +4 -66
- package/packages/DataLists/src/main.vue +3 -2
- package/packages/Subtable/src/SubExportDialog.vue +1 -90
- package/packages/Subtable/src/SubImportDialog.vue +12 -172
- package/packages/Subtable/src/SubPagination.vue +8 -3
- package/packages/TableSearchField/src/main.vue +0 -5
- package/src/directive/formulas.js +1 -1
- package/src/mixins/onlineSubtable.js +0 -301
- package/src/mixins/querySqlPreview.js +20 -238
- package/src/mixins/templatePreview.js +38 -436
- package/src/services/SubPagination.js +18 -51
- package/src/utils.js +1 -32
|
@@ -10,7 +10,6 @@ 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'
|
|
14
13
|
|
|
15
14
|
const req = function(url, data = {}, option = {}) {
|
|
16
15
|
const requestData = {
|
|
@@ -42,7 +41,6 @@ export default {
|
|
|
42
41
|
},
|
|
43
42
|
data() {
|
|
44
43
|
return {
|
|
45
|
-
defaultQuerys: [],
|
|
46
44
|
treeQuerys: [],
|
|
47
45
|
alias_new: 'statement',
|
|
48
46
|
loading: false,
|
|
@@ -61,8 +59,6 @@ export default {
|
|
|
61
59
|
displayFields: [],
|
|
62
60
|
exportSellection: [],
|
|
63
61
|
searchForm: {},
|
|
64
|
-
bindKey: {},
|
|
65
|
-
bindValue: {},
|
|
66
62
|
queryForm: {
|
|
67
63
|
queryData: '',
|
|
68
64
|
},
|
|
@@ -117,7 +113,6 @@ export default {
|
|
|
117
113
|
total: 1,
|
|
118
114
|
},
|
|
119
115
|
paginationLayout: 'total, sizes, prev, pager, next, jumper',
|
|
120
|
-
paginationLayoutWithoutTotal: 'sizes, prev, pager, next, jumper',
|
|
121
116
|
total: 0,
|
|
122
117
|
permission: {
|
|
123
118
|
print: true,
|
|
@@ -227,7 +222,6 @@ export default {
|
|
|
227
222
|
: 0.85 * window.innerHeight,
|
|
228
223
|
needRequestTotal: false, // 需不需要后端统计列表全部数据
|
|
229
224
|
tableDataTotal: {},
|
|
230
|
-
loadingTotal: false, // 统计按钮加载中
|
|
231
225
|
}
|
|
232
226
|
},
|
|
233
227
|
watch: {
|
|
@@ -268,7 +262,7 @@ export default {
|
|
|
268
262
|
immediate: true,
|
|
269
263
|
},
|
|
270
264
|
templateInfo: {
|
|
271
|
-
handler:
|
|
265
|
+
handler: function(newVal) {
|
|
272
266
|
if (newVal && newVal.id) {
|
|
273
267
|
let _me = this
|
|
274
268
|
_me.templateInfo = newVal
|
|
@@ -341,7 +335,7 @@ export default {
|
|
|
341
335
|
)
|
|
342
336
|
params.pagination.querys = querys
|
|
343
337
|
}
|
|
344
|
-
let defaultQuery =
|
|
338
|
+
let defaultQuery = this.buildDefaultQuerys()
|
|
345
339
|
if (defaultQuery.length > 0) {
|
|
346
340
|
if (params.pagination.querys) {
|
|
347
341
|
params.pagination.querys.concat(defaultQuery)
|
|
@@ -492,31 +486,11 @@ export default {
|
|
|
492
486
|
this_.calcScriptBtnPermission()
|
|
493
487
|
})
|
|
494
488
|
this.$emit('afterMounted')
|
|
495
|
-
if (this.templateInfo.jsScript) {
|
|
496
|
-
// 执行js脚本
|
|
497
|
-
this.handleDiyScript(this.templateInfo.jsScript)
|
|
498
|
-
}
|
|
499
489
|
// setTimeout(() => {
|
|
500
490
|
// this.$refs.multipleTemplateTable.handleFilterChange(this.filterMap)
|
|
501
491
|
// }, 100)
|
|
502
492
|
},
|
|
503
493
|
methods: {
|
|
504
|
-
handleDiyScript(scriptValue) {
|
|
505
|
-
//执行前置脚本内容
|
|
506
|
-
const _this = this
|
|
507
|
-
// 用户信息
|
|
508
|
-
const account = this.$requestConfig.getAccount()
|
|
509
|
-
const userId = this.$requestConfig.getUserId()
|
|
510
|
-
const userName = this.$requestConfig.getUsername()
|
|
511
|
-
const preScript = `const scriptFunction = function(_this, account, userId, userName){
|
|
512
|
-
${scriptValue}
|
|
513
|
-
};`
|
|
514
|
-
try {
|
|
515
|
-
eval(`${preScript}scriptFunction(_this, account, userId, userName);`)
|
|
516
|
-
} catch (err) {
|
|
517
|
-
this.$message.error(`脚本事件执行错误:${err}`)
|
|
518
|
-
}
|
|
519
|
-
},
|
|
520
494
|
//因为row.id_ 或row.id可能会有重复,所以加随机值使其唯一
|
|
521
495
|
getRowKey(row) {
|
|
522
496
|
/** 检查row.id是否有重复的缓存对象 */
|
|
@@ -1434,171 +1408,7 @@ export default {
|
|
|
1434
1408
|
return params
|
|
1435
1409
|
},
|
|
1436
1410
|
//列表数据查询入口
|
|
1437
|
-
|
|
1438
|
-
// 不需要请求后端接口统计列表数据
|
|
1439
|
-
this.needRequestTotal = needRequestTotal
|
|
1440
|
-
// 如果是高级查询,页码重置为首页
|
|
1441
|
-
if (isSearchBtn) {
|
|
1442
|
-
this.pagination.page = 1
|
|
1443
|
-
}
|
|
1444
|
-
let params = {}
|
|
1445
|
-
//判断为合并查询还是高级查询
|
|
1446
|
-
let showAdvancedSearch = this.$refs.multipleTemplateTable
|
|
1447
|
-
? this.$refs.multipleTemplateTable.showAdvancedSearch
|
|
1448
|
-
: false
|
|
1449
|
-
//高级查询
|
|
1450
|
-
if (showAdvancedSearch) {
|
|
1451
|
-
params = this.getQueryFilter()
|
|
1452
|
-
} else {
|
|
1453
|
-
//合并查询
|
|
1454
|
-
// 快速查询时,需处理添加快速查询字段前缀
|
|
1455
|
-
param = this.handleQuickParams(param)
|
|
1456
|
-
params = this.getConditionQuery(param)
|
|
1457
|
-
}
|
|
1458
|
-
this.templateSearchQuery =
|
|
1459
|
-
(params.pagination && params.pagination.querys) || []
|
|
1460
|
-
if (!params.pagination) {
|
|
1461
|
-
params.pagination = {}
|
|
1462
|
-
}
|
|
1463
|
-
if (!params.pagination.querys) {
|
|
1464
|
-
params.pagination.querys = []
|
|
1465
|
-
}
|
|
1466
|
-
//处理排序字段
|
|
1467
|
-
if (param && param.sorter && param.sorter.length > 0) {
|
|
1468
|
-
let sortField = JSON.parse(this.templateInfo.sortField)
|
|
1469
|
-
params.pagination = params.pagination || {}
|
|
1470
|
-
params.pagination.sorter = []
|
|
1471
|
-
param.sorter.forEach((s) => {
|
|
1472
|
-
let prefix = this.getColPreFix(sortField, s.property)
|
|
1473
|
-
let queryPre = this.getQueryPre(sortField, s.property)
|
|
1474
|
-
// 关联表时需特殊处理
|
|
1475
|
-
let relevancyProperty = this.getRelevancyProperty(
|
|
1476
|
-
sortField,
|
|
1477
|
-
s.property
|
|
1478
|
-
)
|
|
1479
|
-
if (relevancyProperty) {
|
|
1480
|
-
s.property = relevancyProperty
|
|
1481
|
-
}
|
|
1482
|
-
params.pagination.sorter.push({
|
|
1483
|
-
property: queryPre + prefix + s.property,
|
|
1484
|
-
direction: s.direction,
|
|
1485
|
-
})
|
|
1486
|
-
})
|
|
1487
|
-
} else if (this.templateInfo.sortField) {
|
|
1488
|
-
let sortField = JSON.parse(this.templateInfo.sortField)
|
|
1489
|
-
let sorter = []
|
|
1490
|
-
for (let x = 0; x < sortField.length; x++) {
|
|
1491
|
-
const s = sortField[x]
|
|
1492
|
-
// 默认排序字段的排序方向为空或者不为指定值时放弃
|
|
1493
|
-
if (!s.sort || (s.sort != 'ASC' && s.sort != 'DESC')) {
|
|
1494
|
-
continue
|
|
1495
|
-
}
|
|
1496
|
-
let prefix = this.getColPreFix(sortField, s.name)
|
|
1497
|
-
let queryPre = this.getQueryPre(sortField, s.name)
|
|
1498
|
-
if (!queryPre) {
|
|
1499
|
-
if (s.joinTableField && s.tableName) {
|
|
1500
|
-
prefix = `${s.tableName}.${prefix}`
|
|
1501
|
-
} else {
|
|
1502
|
-
prefix = `t.${prefix}`
|
|
1503
|
-
}
|
|
1504
|
-
}
|
|
1505
|
-
sorter.push({
|
|
1506
|
-
property: queryPre + prefix + s.name,
|
|
1507
|
-
direction: s.sort,
|
|
1508
|
-
})
|
|
1509
|
-
}
|
|
1510
|
-
params.pagination.sorter = sorter
|
|
1511
|
-
} else if (param.querys && param.querys.length > 0) {
|
|
1512
|
-
params.pagination.querys.concat(param.querys)
|
|
1513
|
-
}
|
|
1514
|
-
|
|
1515
|
-
if (params.pagination && params.pagination.querys) {
|
|
1516
|
-
let tempQueryS = []
|
|
1517
|
-
let betweenConditions = {}
|
|
1518
|
-
params.pagination.querys.forEach((q) => {
|
|
1519
|
-
if (
|
|
1520
|
-
q.value != undefined &&
|
|
1521
|
-
(q.operation != 'BETWEEN' || q.value.constructor == Array)
|
|
1522
|
-
) {
|
|
1523
|
-
tempQueryS.push(q)
|
|
1524
|
-
} else if (q.value) {
|
|
1525
|
-
let conditions = q
|
|
1526
|
-
if (betweenConditions[q.property]) {
|
|
1527
|
-
conditions = betweenConditions[q.property]
|
|
1528
|
-
conditions.value = [conditions.value]
|
|
1529
|
-
conditions.value.push(q.value)
|
|
1530
|
-
}
|
|
1531
|
-
betweenConditions[q.property] = conditions
|
|
1532
|
-
}
|
|
1533
|
-
})
|
|
1534
|
-
for (const key in betweenConditions) {
|
|
1535
|
-
tempQueryS.push(betweenConditions[key])
|
|
1536
|
-
}
|
|
1537
|
-
params.pagination.querys = tempQueryS
|
|
1538
|
-
params.pagination.querys = params.pagination.querys
|
|
1539
|
-
? params.pagination.querys.concat(this.treeQuerys)
|
|
1540
|
-
: this.treeQuerys
|
|
1541
|
-
}
|
|
1542
|
-
//把过滤树的条件也拼接进去
|
|
1543
|
-
if (this.treeQuerys && this.treeQuerys.length > 0) {
|
|
1544
|
-
params.pagination.querys = params.pagination.querys
|
|
1545
|
-
? params.pagination.querys.concat(this.treeQuerys)
|
|
1546
|
-
: this.treeQuerys
|
|
1547
|
-
}
|
|
1548
|
-
//初始化时,把查询字段和筛选字段的默认值也加进去
|
|
1549
|
-
if (this.isInit) {
|
|
1550
|
-
await this.handleInitQuery(params)
|
|
1551
|
-
}
|
|
1552
|
-
//数据视图控件
|
|
1553
|
-
if (this.dataView) {
|
|
1554
|
-
this.handelBindFiledValua()
|
|
1555
|
-
params.refIdValue = this.dataView.refIdValue
|
|
1556
|
-
//关联查询字段
|
|
1557
|
-
if (this.dataView.selectList && this.dataView.selectList.length > 0) {
|
|
1558
|
-
params.selectList = this.dataView.selectList
|
|
1559
|
-
}
|
|
1560
|
-
}
|
|
1561
|
-
const this_ = this
|
|
1562
|
-
if (this_.isJoinFlow) {
|
|
1563
|
-
params.isJoinFlow = true
|
|
1564
|
-
params.taskType = this_.taskType
|
|
1565
|
-
params.defKey = this_.defKey
|
|
1566
|
-
}
|
|
1567
|
-
// 查询字段 校验是否必填,如果是必填没数据,需返回提示
|
|
1568
|
-
let errorMsg = this.validateSearchRequired(params.pagination.querys)
|
|
1569
|
-
if (errorMsg) {
|
|
1570
|
-
!this.isInit && this.$message.warning(errorMsg)
|
|
1571
|
-
cb && cb()
|
|
1572
|
-
this.isInit = false
|
|
1573
|
-
return
|
|
1574
|
-
}
|
|
1575
|
-
this.isInit = false
|
|
1576
|
-
if ($.isEmptyObject(this.searchForm)) {
|
|
1577
|
-
this.getBpmTemplateByPagination(params, cb)
|
|
1578
|
-
} else {
|
|
1579
|
-
this.getBpmTemplateByPagination(params, cb)
|
|
1580
|
-
}
|
|
1581
|
-
},
|
|
1582
|
-
// 校验查询字段必填
|
|
1583
|
-
validateSearchRequired(querys) {
|
|
1584
|
-
let errorMsg = ''
|
|
1585
|
-
let conditions = JSON.parse(this.templateInfo.conditionField)
|
|
1586
|
-
if (conditions) {
|
|
1587
|
-
conditions.forEach((item) => {
|
|
1588
|
-
if (item.isRequired) {
|
|
1589
|
-
let queryPre = this.getQueryPre(conditions, item.name)
|
|
1590
|
-
let index = querys.findIndex((k) => {
|
|
1591
|
-
return k.property == queryPre + item.name
|
|
1592
|
-
})
|
|
1593
|
-
if (index == -1) {
|
|
1594
|
-
errorMsg = `字段【${item.cm}】为必填查询字段,不能为空!`
|
|
1595
|
-
}
|
|
1596
|
-
}
|
|
1597
|
-
})
|
|
1598
|
-
}
|
|
1599
|
-
return errorMsg
|
|
1600
|
-
},
|
|
1601
|
-
searchCountTotal(param, cb, isSearchBtn, needRequestTotal = false) {
|
|
1411
|
+
search(param, cb, isSearchBtn, needRequestTotal = false) {
|
|
1602
1412
|
// 不需要请求后端接口统计列表数据
|
|
1603
1413
|
this.needRequestTotal = needRequestTotal
|
|
1604
1414
|
// 如果是高级查询,页码重置为首页
|
|
@@ -1730,9 +1540,9 @@ export default {
|
|
|
1730
1540
|
params.defKey = this_.defKey
|
|
1731
1541
|
}
|
|
1732
1542
|
if ($.isEmptyObject(this.searchForm)) {
|
|
1733
|
-
this.
|
|
1543
|
+
this.getBpmTemplateByPagination(params, cb)
|
|
1734
1544
|
} else {
|
|
1735
|
-
this.
|
|
1545
|
+
this.getBpmTemplateByPagination(params, cb)
|
|
1736
1546
|
}
|
|
1737
1547
|
},
|
|
1738
1548
|
// 处理快速查询参数
|
|
@@ -1753,24 +1563,20 @@ export default {
|
|
|
1753
1563
|
}
|
|
1754
1564
|
return param
|
|
1755
1565
|
},
|
|
1756
|
-
|
|
1566
|
+
handleInitQuery(params) {
|
|
1757
1567
|
const conditionFields = JSON.parse(this.templateInfo.conditionField) || []
|
|
1758
1568
|
const querys = []
|
|
1759
|
-
|
|
1760
|
-
let item = conditionFields[i]
|
|
1569
|
+
conditionFields.forEach((item) => {
|
|
1761
1570
|
if (item.defaultValue) {
|
|
1762
|
-
let defaultValue = item.isScriptDefault
|
|
1763
|
-
? await this.getScriptDefaultValue(item.defaultValue)
|
|
1764
|
-
: item.defaultValue
|
|
1765
1571
|
querys.push({
|
|
1766
1572
|
property: `${item.queryPre || ''}${item.colPrefix}${item.name}`,
|
|
1767
|
-
value: defaultValue,
|
|
1573
|
+
value: item.defaultValue,
|
|
1768
1574
|
operation: item.qt.toUpperCase(),
|
|
1769
1575
|
relation: 'AND',
|
|
1770
1576
|
group: 'defaultQuery',
|
|
1771
1577
|
})
|
|
1772
1578
|
}
|
|
1773
|
-
}
|
|
1579
|
+
})
|
|
1774
1580
|
const filteringFields = JSON.parse(this.templateInfo.filteringField) || []
|
|
1775
1581
|
filteringFields.forEach((item) => {
|
|
1776
1582
|
if (item.defaultValue && item.defaultValue.length) {
|
|
@@ -1823,15 +1629,13 @@ export default {
|
|
|
1823
1629
|
})
|
|
1824
1630
|
}
|
|
1825
1631
|
this.$requestConfig
|
|
1826
|
-
.
|
|
1632
|
+
.getDataTemplateDataList(dataTemplateQueryVo)
|
|
1827
1633
|
.then((response) => {
|
|
1828
1634
|
this.rows = response.rows
|
|
1635
|
+
this.total = response.total
|
|
1829
1636
|
this.$set(this.pagination, 'page', response.page)
|
|
1830
1637
|
this.$set(this.pagination, 'pageSize', response.pageSize)
|
|
1831
|
-
|
|
1832
|
-
if (this.total) {
|
|
1833
|
-
this.$set(this.pagination, 'total', this.total)
|
|
1834
|
-
}
|
|
1638
|
+
this.$set(this.pagination, 'total', response.total)
|
|
1835
1639
|
this.$set(this, 'flowBtnPermission', {})
|
|
1836
1640
|
this.$emit('data-reload-success')
|
|
1837
1641
|
if (response.summary && response.summary.length) {
|
|
@@ -1855,46 +1659,6 @@ export default {
|
|
|
1855
1659
|
cb2 && cb2()
|
|
1856
1660
|
})
|
|
1857
1661
|
},
|
|
1858
|
-
getBpmTemplateByPaginationTotal(params, cb1, cb2) {
|
|
1859
|
-
const dataTemplateQueryVo = {
|
|
1860
|
-
templateId: params.templateId,
|
|
1861
|
-
queryFilter: params.pagination,
|
|
1862
|
-
}
|
|
1863
|
-
if (params.isJoinFlow && params.taskType && params.defKey) {
|
|
1864
|
-
dataTemplateQueryVo.isJoinFlow = params.isJoinFlow
|
|
1865
|
-
dataTemplateQueryVo.taskType = params.taskType
|
|
1866
|
-
dataTemplateQueryVo.defKey = params.defKey
|
|
1867
|
-
}
|
|
1868
|
-
if (params.selectField) {
|
|
1869
|
-
dataTemplateQueryVo.selectField = params.selectField
|
|
1870
|
-
dataTemplateQueryVo.selectValue = params.selectValue
|
|
1871
|
-
}
|
|
1872
|
-
if (params.selectList) {
|
|
1873
|
-
dataTemplateQueryVo.selectList = params.selectList
|
|
1874
|
-
}
|
|
1875
|
-
dataTemplateQueryVo.refIdValue = params.refIdValue
|
|
1876
|
-
this.curSelectParams = dataTemplateQueryVo
|
|
1877
|
-
//加载按钮
|
|
1878
|
-
this.loadingTotal = true
|
|
1879
|
-
this.$requestConfig
|
|
1880
|
-
.getDataTemplateDataListWithTotal(dataTemplateQueryVo)
|
|
1881
|
-
.then((response) => {
|
|
1882
|
-
//设置总数
|
|
1883
|
-
this.total = response.value
|
|
1884
|
-
this.$set(this.pagination, 'total', response.value)
|
|
1885
|
-
this.loadingTotal = false
|
|
1886
|
-
this.$emit('data-reload-success')
|
|
1887
|
-
this.$nextTick(() => {
|
|
1888
|
-
this.$refs.multipleTemplateTable &&
|
|
1889
|
-
this.$refs.multipleTemplateTable.doLayout()
|
|
1890
|
-
})
|
|
1891
|
-
})
|
|
1892
|
-
.finally(() => {
|
|
1893
|
-
this.loadingTotal = false
|
|
1894
|
-
cb1 && cb1()
|
|
1895
|
-
cb2 && cb2()
|
|
1896
|
-
})
|
|
1897
|
-
},
|
|
1898
1662
|
getQueryFilter() {
|
|
1899
1663
|
let operationMap = this.getSearchItems()
|
|
1900
1664
|
let fieldTypeMap = this.getFieldType()
|
|
@@ -1911,12 +1675,6 @@ export default {
|
|
|
1911
1675
|
params.pagination = pageBean
|
|
1912
1676
|
if (!$.isEmptyObject(this.searchForm)) {
|
|
1913
1677
|
let conditionField = utils.parseToJson(this.templateInfo.conditionField)
|
|
1914
|
-
//处理绑定字段
|
|
1915
|
-
this.bindValue = this.searchForm.bindValue || this.bindValue
|
|
1916
|
-
this.bindKey = this.searchForm.bindKey || this.bindKey
|
|
1917
|
-
//记录后再删除
|
|
1918
|
-
delete this.searchForm.bindValue
|
|
1919
|
-
delete this.searchForm.bindKey
|
|
1920
1678
|
for (let key in this.searchForm) {
|
|
1921
1679
|
if (
|
|
1922
1680
|
typeof this.searchForm[key] != 'undefined' &&
|
|
@@ -1954,16 +1712,6 @@ export default {
|
|
|
1954
1712
|
if (fieldTypeMap[key] && fieldTypeMap[key] == 'number') {
|
|
1955
1713
|
value = parseFloat(this.searchForm[key])
|
|
1956
1714
|
}
|
|
1957
|
-
//在表单列表的查询字段中添加的对话框控件 此处逻辑对应 packages/CustomDialog/src/customDialog.vue:1920行
|
|
1958
|
-
if (
|
|
1959
|
-
this.bindValue &&
|
|
1960
|
-
Object.keys(this.bindValue).length &&
|
|
1961
|
-
this.bindValue[key] &&
|
|
1962
|
-
Object.keys(this.bindKey).length
|
|
1963
|
-
) {
|
|
1964
|
-
//获得绑定字段的值
|
|
1965
|
-
value = this.bindValue[key][this.bindKey[key]]
|
|
1966
|
-
}
|
|
1967
1715
|
let queryPre = this.getQueryPre(conditionField, key)
|
|
1968
1716
|
querys.push({
|
|
1969
1717
|
property: queryPre + key,
|
|
@@ -1976,14 +1724,7 @@ export default {
|
|
|
1976
1724
|
}
|
|
1977
1725
|
}
|
|
1978
1726
|
this.clearQueryByGroupName(querys, 'filter')
|
|
1979
|
-
//
|
|
1980
|
-
if (
|
|
1981
|
-
this.$refs.multipleTemplateTable &&
|
|
1982
|
-
this.$refs.multipleTemplateTable.querys &&
|
|
1983
|
-
!this.$refs.multipleTemplateTable.showAdvancedSearch
|
|
1984
|
-
) {
|
|
1985
|
-
querys.push(...this.$refs.multipleTemplateTable.querys)
|
|
1986
|
-
}
|
|
1727
|
+
// 将过滤条件添加查询参数数组中
|
|
1987
1728
|
this.buildFilterParams(querys)
|
|
1988
1729
|
}
|
|
1989
1730
|
// 判断table中是否含有filter查询
|
|
@@ -2592,7 +2333,7 @@ export default {
|
|
|
2592
2333
|
handledUrlParams(url, row, fieldName) {
|
|
2593
2334
|
if (this.templateInfo.displayField) {
|
|
2594
2335
|
let displayFields = JSON.parse(this.templateInfo.displayField)
|
|
2595
|
-
let params = this.getParentId(displayFields, fieldName, 'name')
|
|
2336
|
+
let params = this.getParentId(displayFields, fieldName, 'name')
|
|
2596
2337
|
if (params && params.urlParams && params.urlParams.length > 0) {
|
|
2597
2338
|
let urlParams = params.urlParams
|
|
2598
2339
|
let suffix = ''
|
|
@@ -2759,30 +2500,24 @@ export default {
|
|
|
2759
2500
|
id: this.templateInfo.id,
|
|
2760
2501
|
params: this.curSelectParams,
|
|
2761
2502
|
})
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
.then(() => {
|
|
2781
|
-
this.$message.success('正在导出,请稍后前往报表附件管理查看')
|
|
2782
|
-
})
|
|
2783
|
-
.finally(() => {
|
|
2784
|
-
loadingInstance.close()
|
|
2785
|
-
})
|
|
2503
|
+
.then(
|
|
2504
|
+
({ data, headers }) => {
|
|
2505
|
+
const fileName = decodeURIComponent(
|
|
2506
|
+
headers['content-disposition'].split(';')[1].split('filename=')[1]
|
|
2507
|
+
)
|
|
2508
|
+
const blob = new Blob([data])
|
|
2509
|
+
saveAs(blob, fileName)
|
|
2510
|
+
loadingInstance.close() // 结束
|
|
2511
|
+
},
|
|
2512
|
+
(e) => {
|
|
2513
|
+
loadingInstance.close() // 结束
|
|
2514
|
+
let enc = new TextDecoder('utf-8')
|
|
2515
|
+
let uint8_msg = JSON.parse(
|
|
2516
|
+
enc.decode(new Uint8Array(e.response.data))
|
|
2517
|
+
)
|
|
2518
|
+
this.$message.error(uint8_msg.message)
|
|
2519
|
+
}
|
|
2520
|
+
)
|
|
2786
2521
|
},
|
|
2787
2522
|
importCommand(params) {
|
|
2788
2523
|
switch (params.command) {
|
|
@@ -3389,7 +3124,7 @@ export default {
|
|
|
3389
3124
|
}
|
|
3390
3125
|
this.dialogSubVisible = true
|
|
3391
3126
|
},
|
|
3392
|
-
|
|
3127
|
+
nodeClick(node) {
|
|
3393
3128
|
this.pagination.page = 1
|
|
3394
3129
|
//每次点击过滤树,应该把右边的table 与分页全部重置为初始
|
|
3395
3130
|
|
|
@@ -3424,9 +3159,7 @@ export default {
|
|
|
3424
3159
|
pageBean.querys.push({
|
|
3425
3160
|
property: item.isMain
|
|
3426
3161
|
? `t.${item.key_.oldTableField}`
|
|
3427
|
-
: `${item.key_.
|
|
3428
|
-
item.key_.oldTableField
|
|
3429
|
-
}`,
|
|
3162
|
+
: `${item.key_.tableName}.${item.key_.oldTableField}`,
|
|
3430
3163
|
value,
|
|
3431
3164
|
group: 'main',
|
|
3432
3165
|
operation,
|
|
@@ -3455,7 +3188,7 @@ export default {
|
|
|
3455
3188
|
params.taskType = this_.taskType
|
|
3456
3189
|
params.defKey = this_.defKey
|
|
3457
3190
|
}
|
|
3458
|
-
|
|
3191
|
+
this.handleInitQuery(params)
|
|
3459
3192
|
this.getBpmTemplateByPagination(params)
|
|
3460
3193
|
},
|
|
3461
3194
|
filterChange(filters) {
|
|
@@ -4111,7 +3844,7 @@ export default {
|
|
|
4111
3844
|
}
|
|
4112
3845
|
this.$requestConfig
|
|
4113
3846
|
.batchUpdateTemplateData(data)
|
|
4114
|
-
.then(
|
|
3847
|
+
.then((data) => {
|
|
4115
3848
|
if (data.state) {
|
|
4116
3849
|
this.$message({
|
|
4117
3850
|
type: 'success',
|
|
@@ -4121,9 +3854,8 @@ export default {
|
|
|
4121
3854
|
// 以服务的方式调用的 Loading 需要异步关闭
|
|
4122
3855
|
loadingInstance.close()
|
|
4123
3856
|
})
|
|
4124
|
-
let defaultValue = await this.newBuildDefaultQuerys()
|
|
4125
3857
|
this.search({
|
|
4126
|
-
querys:
|
|
3858
|
+
querys: this.buildDefaultQuerys() || [],
|
|
4127
3859
|
})
|
|
4128
3860
|
// 更新成功后需执行后置js
|
|
4129
3861
|
if (afterScriptValue) {
|
|
@@ -4237,120 +3969,6 @@ export default {
|
|
|
4237
3969
|
})
|
|
4238
3970
|
return querys
|
|
4239
3971
|
},
|
|
4240
|
-
async newBuildDefaultQuerys(isSetSearchForm = true) {
|
|
4241
|
-
let this_ = this
|
|
4242
|
-
let querys = []
|
|
4243
|
-
let conditions = JSON.parse(this_.templateInfo.conditionField)
|
|
4244
|
-
//条件字段默认值判断
|
|
4245
|
-
for (let i = 0; i < conditions.length; i++) {
|
|
4246
|
-
let condition = conditions[i]
|
|
4247
|
-
if (condition.defaultValue) {
|
|
4248
|
-
let field = condition.colPrefix + condition.na
|
|
4249
|
-
let defaultValue = condition.isScriptDefault
|
|
4250
|
-
? await this.getScriptDefaultValue(condition.defaultValue)
|
|
4251
|
-
: condition.defaultValue
|
|
4252
|
-
if (isSetSearchForm) {
|
|
4253
|
-
this_.$set(this_.searchForm, field, defaultValue)
|
|
4254
|
-
}
|
|
4255
|
-
let value = defaultValue
|
|
4256
|
-
if (condition.ty == 'number') {
|
|
4257
|
-
value = parseFloat(value)
|
|
4258
|
-
}
|
|
4259
|
-
querys.push({
|
|
4260
|
-
property: condition.queryPre ? condition.queryPre + field : field,
|
|
4261
|
-
value: value,
|
|
4262
|
-
group: 'main',
|
|
4263
|
-
operation: condition.qt.toUpperCase(),
|
|
4264
|
-
relation: 'AND',
|
|
4265
|
-
})
|
|
4266
|
-
}
|
|
4267
|
-
}
|
|
4268
|
-
//筛选字段默认值判断
|
|
4269
|
-
|
|
4270
|
-
if (this.parameterqQuerys) {
|
|
4271
|
-
let parameterQuerys = JSON.parse(Base64.decode(this.parameterqQuerys))
|
|
4272
|
-
if (parameterQuerys && parameterQuerys.length > 0) {
|
|
4273
|
-
parameterQuerys.forEach((query) => {
|
|
4274
|
-
let prefix = this.templateInfo.isExternal === 1 ? '' : 'F_'
|
|
4275
|
-
query.property = prefix + query.property
|
|
4276
|
-
if (isSetSearchForm) {
|
|
4277
|
-
this_.$set(this_.searchForm, query.property, query.value)
|
|
4278
|
-
}
|
|
4279
|
-
querys.push(query)
|
|
4280
|
-
})
|
|
4281
|
-
}
|
|
4282
|
-
}
|
|
4283
|
-
let filters = JSON.parse(this_.templateInfo.filteringField)
|
|
4284
|
-
filters.forEach((filter) => {
|
|
4285
|
-
if (filter.defaultValue && filter.defaultValue.length > 0) {
|
|
4286
|
-
this_.filterMap[filter.name] = filter.defaultValue
|
|
4287
|
-
filter.defaultValue.forEach((val) => {
|
|
4288
|
-
querys.push({
|
|
4289
|
-
property: `${filter.queryPre || ''}${filter.colPrefix}${
|
|
4290
|
-
filter.name
|
|
4291
|
-
}`,
|
|
4292
|
-
value: val,
|
|
4293
|
-
group: 'defVal_' + filter.name,
|
|
4294
|
-
operation: 'EQUAL',
|
|
4295
|
-
relation: 'OR',
|
|
4296
|
-
})
|
|
4297
|
-
})
|
|
4298
|
-
}
|
|
4299
|
-
})
|
|
4300
|
-
this_.$on('afterMounted', () => {
|
|
4301
|
-
const tab = document.getElementById(this_.templateInfo.alias)
|
|
4302
|
-
if (tab && tab.__vue__) {
|
|
4303
|
-
let headerColumns = tab.__vue__.$refs.tableHeader
|
|
4304
|
-
? tab.__vue__.$refs.tableHeader.columns
|
|
4305
|
-
: []
|
|
4306
|
-
headerColumns.forEach((column) => {
|
|
4307
|
-
if (this_.filterMap.hasOwnProperty(column.property)) {
|
|
4308
|
-
this_.filterMap[column.property].forEach((val) => {
|
|
4309
|
-
column.filteredValue.push(val)
|
|
4310
|
-
})
|
|
4311
|
-
}
|
|
4312
|
-
})
|
|
4313
|
-
}
|
|
4314
|
-
})
|
|
4315
|
-
this.defaultQuerys = querys
|
|
4316
|
-
return querys
|
|
4317
|
-
},
|
|
4318
|
-
getScriptDefaultValue(scriptValue) {
|
|
4319
|
-
return new Promise((resolve) => {
|
|
4320
|
-
//执行前置脚本内容
|
|
4321
|
-
const _this = this
|
|
4322
|
-
// 用户信息
|
|
4323
|
-
const account = this.$requestConfig.getAccount()
|
|
4324
|
-
const userId = this.$requestConfig.getUserId()
|
|
4325
|
-
const userName = this.$requestConfig.getUsername()
|
|
4326
|
-
const _moment = moment
|
|
4327
|
-
const preScript = `const scriptFunction = function(_this, account, userId, userName, _moment){
|
|
4328
|
-
${scriptValue}
|
|
4329
|
-
};`
|
|
4330
|
-
let result = ''
|
|
4331
|
-
try {
|
|
4332
|
-
result = eval(
|
|
4333
|
-
`${preScript}scriptFunction(_this, account, userId, userName, _moment);`
|
|
4334
|
-
)
|
|
4335
|
-
if (result && result.then && typeof result.then === 'function') {
|
|
4336
|
-
result.then(
|
|
4337
|
-
(t) => {
|
|
4338
|
-
resolve(t)
|
|
4339
|
-
},
|
|
4340
|
-
(fail) => {
|
|
4341
|
-
//接口返回失败则终止按钮操作,并输出错误信息
|
|
4342
|
-
resolve('')
|
|
4343
|
-
}
|
|
4344
|
-
)
|
|
4345
|
-
} else {
|
|
4346
|
-
resolve(result)
|
|
4347
|
-
}
|
|
4348
|
-
} catch (err) {
|
|
4349
|
-
resolve('')
|
|
4350
|
-
this.$message.error(`查询值默认脚本事件执行错误:${err}`)
|
|
4351
|
-
}
|
|
4352
|
-
})
|
|
4353
|
-
},
|
|
4354
3972
|
handleClose() {
|
|
4355
3973
|
this.dataViewDialogVisible = false
|
|
4356
3974
|
},
|
|
@@ -4485,8 +4103,7 @@ export default {
|
|
|
4485
4103
|
this.printDetail(parameter.templateId, parameter.id, parameter.action)
|
|
4486
4104
|
} else if (btnAlias == 'sub' && this.checkSelect()) {
|
|
4487
4105
|
this.showSubList(this.tableData.selectRows[0].id_, parameter)
|
|
4488
|
-
} else if (btnAlias == 'js') {
|
|
4489
|
-
if (parameter.needValidateSelect && !this.checkSelect()) return
|
|
4106
|
+
} else if (btnAlias == 'js' && this.checkSelect()) {
|
|
4490
4107
|
this.customEvilJS(this.tableData.selectRows[0], parameter.jsValue)
|
|
4491
4108
|
} else if (
|
|
4492
4109
|
btnAlias == 'startFlow' &&
|
|
@@ -5038,21 +4655,6 @@ export default {
|
|
|
5038
4655
|
)
|
|
5039
4656
|
: customColumns
|
|
5040
4657
|
},
|
|
5041
|
-
countPageTotal() {
|
|
5042
|
-
this.searchCountTotal(this.getParam())
|
|
5043
|
-
},
|
|
5044
|
-
sizeChange() {
|
|
5045
|
-
this.$refs.multipleTemplateTable.handleFilterChange()
|
|
5046
|
-
},
|
|
5047
|
-
currentPageChange() {
|
|
5048
|
-
this.isResetPage = false
|
|
5049
|
-
this.$refs.multipleTemplateTable.handleFilterChange()
|
|
5050
|
-
},
|
|
5051
|
-
switchPage(type) {
|
|
5052
|
-
if (type == 'prev') this.pagination.page--
|
|
5053
|
-
if (type == 'next') this.pagination.page++
|
|
5054
|
-
this.currentPageChange()
|
|
5055
|
-
},
|
|
5056
4658
|
},
|
|
5057
4659
|
// asyncComputed: {
|
|
5058
4660
|
// showDraftList() {
|