three-trees-ui 1.0.33 → 1.0.35
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 +203 -123
- package/lib/three-trees-ui.css +1 -1
- package/lib/three-trees-ui.umd.js +203 -123
- package/lib/three-trees-ui.umd.min.js +1 -1
- package/package.json +1 -1
- package/packages/CustomDialog/src/customDialog.vue +10 -3
- package/packages/CustomDialog/src/main.vue +2 -1
- package/packages/Input/src/main.vue +2 -1
- package/packages/Table/src/Table.vue +13 -1
- package/src/mixins/templatePreview.js +109 -29
package/package.json
CHANGED
|
@@ -527,6 +527,7 @@
|
|
|
527
527
|
executeScriptResult: null,
|
|
528
528
|
customDialogParams: {},
|
|
529
529
|
treeDialogConfig: null,
|
|
530
|
+
isPreview: false,
|
|
530
531
|
}
|
|
531
532
|
},
|
|
532
533
|
computed: {
|
|
@@ -608,7 +609,8 @@
|
|
|
608
609
|
})
|
|
609
610
|
return ids.join(',')
|
|
610
611
|
},
|
|
611
|
-
showDialog(isMounted = false) {
|
|
612
|
+
showDialog(isMounted = false, isPreview = false) {
|
|
613
|
+
this.isPreview = isPreview
|
|
612
614
|
this.fixedParams = {}
|
|
613
615
|
// 如果已存在配置信息就不去请求配置信息 直接初始化数据
|
|
614
616
|
if (this.dialogConfig) {
|
|
@@ -1122,8 +1124,12 @@
|
|
|
1122
1124
|
let flag = false
|
|
1123
1125
|
if (this.queryParams.length != 0 && this.queryParams[0] != '') {
|
|
1124
1126
|
this.conditionBind.forEach((item, index) => {
|
|
1125
|
-
if (
|
|
1126
|
-
|
|
1127
|
+
if (
|
|
1128
|
+
item.isRequire == 1 &&
|
|
1129
|
+
!this.queryParams[index][item.field] &&
|
|
1130
|
+
!this.isPreview
|
|
1131
|
+
) {
|
|
1132
|
+
!flag && this.$message.error(`${item.comment}必填`)
|
|
1127
1133
|
flag = true
|
|
1128
1134
|
return
|
|
1129
1135
|
}
|
|
@@ -1161,6 +1167,7 @@
|
|
|
1161
1167
|
}
|
|
1162
1168
|
})
|
|
1163
1169
|
}
|
|
1170
|
+
this.isPreview = false
|
|
1164
1171
|
if (flag) {
|
|
1165
1172
|
return
|
|
1166
1173
|
}
|
|
@@ -412,7 +412,8 @@
|
|
|
412
412
|
if (this.isMobile) {
|
|
413
413
|
this.$refs.customMobileDialogRef.showDialog()
|
|
414
414
|
} else {
|
|
415
|
-
|
|
415
|
+
// 第二个参数是为了处理点击预览按钮时,不立即触发必传验证提示
|
|
416
|
+
this.$refs.customDialogRef.showDialog(false, true)
|
|
416
417
|
}
|
|
417
418
|
},
|
|
418
419
|
removeSelectOrg(item) {
|
|
@@ -14,13 +14,14 @@
|
|
|
14
14
|
<el-input
|
|
15
15
|
v-if="isShowInput"
|
|
16
16
|
ref="inputEle"
|
|
17
|
+
:class="{ readonly_input: readonly }"
|
|
17
18
|
v-model="inputVal"
|
|
18
19
|
v-validate="inputValidate"
|
|
19
20
|
:type="type"
|
|
20
21
|
:size="inputSize"
|
|
21
22
|
:style="inputWidth"
|
|
22
23
|
:name="inputName"
|
|
23
|
-
:placeholder="placeholder"
|
|
24
|
+
:placeholder="readonly ? '' : placeholder"
|
|
24
25
|
:clearable="clearable"
|
|
25
26
|
:show-password="showPassword"
|
|
26
27
|
:disabled="isDisabled"
|
|
@@ -798,14 +798,26 @@
|
|
|
798
798
|
this.$emit('sort-change', column)
|
|
799
799
|
},
|
|
800
800
|
handleFilterChange(m) {
|
|
801
|
+
// 如果是点击的是重置 筛选条件 需把默认的筛选条件里数据也删除掉
|
|
802
|
+
if (m) {
|
|
803
|
+
Object.keys(m).forEach((key) => {
|
|
804
|
+
if (
|
|
805
|
+
m[key] &&
|
|
806
|
+
m[key].length == 0 &&
|
|
807
|
+
this.resetDefaultFilter.indexOf(key) === -1
|
|
808
|
+
) {
|
|
809
|
+
this.resetDefaultFilter.push(key)
|
|
810
|
+
}
|
|
811
|
+
})
|
|
812
|
+
}
|
|
801
813
|
this.filters = { ...this.filters, ...m }
|
|
802
814
|
Object.keys(this.filters).forEach((k) => {
|
|
803
815
|
if (!this.filters[k] || this.filters[k].length == 0) {
|
|
804
816
|
delete this.filters[k]
|
|
805
817
|
}
|
|
806
818
|
})
|
|
807
|
-
this.load()
|
|
808
819
|
this.$emit('filter-change', m)
|
|
820
|
+
this.load()
|
|
809
821
|
},
|
|
810
822
|
doLayout() {
|
|
811
823
|
this.$nextTick(() => {
|
|
@@ -540,7 +540,7 @@ export default {
|
|
|
540
540
|
//获取汇总全部数据
|
|
541
541
|
getAllSummary(data) {
|
|
542
542
|
const allSummaryConfig = data.reduce((pre, cur) => {
|
|
543
|
-
pre[cur.field] = cur.val
|
|
543
|
+
pre[cur.field] = utils.thousandBit(cur.val)
|
|
544
544
|
return pre
|
|
545
545
|
}, {})
|
|
546
546
|
if (Object.keys(allSummaryConfig).length) {
|
|
@@ -736,9 +736,14 @@ export default {
|
|
|
736
736
|
let manageField = JSON.parse(this.templateInfo.manageField)
|
|
737
737
|
let this_ = this
|
|
738
738
|
manageField.forEach((item) => {
|
|
739
|
+
if (item.buttonId) {
|
|
740
|
+
obj[item.buttonId] = true
|
|
741
|
+
}
|
|
739
742
|
if (item.beforeScriptValue) {
|
|
740
743
|
let promise = this_.beforeScript(item.beforeScriptValue, item)
|
|
741
744
|
promise.then((res) => {
|
|
745
|
+
obj[item.buttonId] = res
|
|
746
|
+
//为兼容旧数据(没有buttonId的数据)
|
|
742
747
|
obj[item.name] = res
|
|
743
748
|
})
|
|
744
749
|
}
|
|
@@ -1404,6 +1409,10 @@ export default {
|
|
|
1404
1409
|
},
|
|
1405
1410
|
//列表数据查询入口
|
|
1406
1411
|
search(param, cb, isSearchBtn) {
|
|
1412
|
+
// 如果是高级查询,页码重置为首页
|
|
1413
|
+
if (isSearchBtn) {
|
|
1414
|
+
this.pagination.page = 1
|
|
1415
|
+
}
|
|
1407
1416
|
let params = {}
|
|
1408
1417
|
//判断为合并查询还是高级查询
|
|
1409
1418
|
let showAdvancedSearch = this.$refs.multipleTemplateTable
|
|
@@ -1480,7 +1489,7 @@ export default {
|
|
|
1480
1489
|
let betweenConditions = {}
|
|
1481
1490
|
params.pagination.querys.forEach((q) => {
|
|
1482
1491
|
if (
|
|
1483
|
-
q.value &&
|
|
1492
|
+
q.value != undefined &&
|
|
1484
1493
|
(q.operation != 'BETWEEN' || q.value.constructor == Array)
|
|
1485
1494
|
) {
|
|
1486
1495
|
tempQueryS.push(q)
|
|
@@ -1962,10 +1971,11 @@ export default {
|
|
|
1962
1971
|
const filterField = utils.parseToJson(this.templateInfo.filteringField)
|
|
1963
1972
|
temquerys.forEach((q) => {
|
|
1964
1973
|
let prefix = this.getColPreFix(conditionField, q.property)
|
|
1974
|
+
const queryPre = this.getQueryPre(conditionField, q.property)
|
|
1965
1975
|
if (!prefix) {
|
|
1966
1976
|
prefix = this.getColPreFix(filterField, q.property)
|
|
1967
1977
|
}
|
|
1968
|
-
q.property = prefix + q.property
|
|
1978
|
+
q.property = queryPre + prefix + q.property
|
|
1969
1979
|
querys.push(q)
|
|
1970
1980
|
})
|
|
1971
1981
|
}
|
|
@@ -2422,7 +2432,7 @@ export default {
|
|
|
2422
2432
|
if (type === 'searchResult') {
|
|
2423
2433
|
this.curSelectParams.queryFilter.querys = this.templateSearchQuery
|
|
2424
2434
|
}
|
|
2425
|
-
|
|
2435
|
+
// 增加导出字段限制
|
|
2426
2436
|
const checkField = this.getCheckField()
|
|
2427
2437
|
if (checkField && checkField.length) {
|
|
2428
2438
|
let fieldExport = {}
|
|
@@ -2431,18 +2441,50 @@ export default {
|
|
|
2431
2441
|
})
|
|
2432
2442
|
this.curSelectParams.fieldExport = fieldExport
|
|
2433
2443
|
}
|
|
2444
|
+
if (type === 'selected') {
|
|
2445
|
+
const selectedId = this.tableData.selectRows.map((item) => item.id_)
|
|
2446
|
+
const selectedQuery = {
|
|
2447
|
+
property: 't.id_',
|
|
2448
|
+
value: selectedId ? selectedId.join(',') : '',
|
|
2449
|
+
group: 'main',
|
|
2450
|
+
operation: 'IN',
|
|
2451
|
+
relation: 'AND',
|
|
2452
|
+
}
|
|
2453
|
+
this.curSelectParams.queryFilter.querys = [
|
|
2454
|
+
...this.curSelectParams.queryFilter.querys,
|
|
2455
|
+
selectedQuery,
|
|
2456
|
+
]
|
|
2457
|
+
}
|
|
2458
|
+
//导出全部数据按钮
|
|
2459
|
+
if (type == 'all') {
|
|
2460
|
+
this.curSelectParams.queryFilter.querys = []
|
|
2461
|
+
}
|
|
2462
|
+
let loadingInstance = Loading.service({
|
|
2463
|
+
fullscreen: true,
|
|
2464
|
+
}) //开始
|
|
2434
2465
|
this.$requestConfig
|
|
2435
2466
|
.exportByBtnSetting({
|
|
2436
2467
|
id: this.templateInfo.id,
|
|
2437
2468
|
params: this.curSelectParams,
|
|
2438
2469
|
})
|
|
2439
|
-
.then(
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2470
|
+
.then(
|
|
2471
|
+
({ data, headers }) => {
|
|
2472
|
+
const fileName = decodeURIComponent(
|
|
2473
|
+
headers['content-disposition'].split(';')[1].split('filename=')[1]
|
|
2474
|
+
)
|
|
2475
|
+
const blob = new Blob([data])
|
|
2476
|
+
saveAs(blob, fileName)
|
|
2477
|
+
loadingInstance.close() // 结束
|
|
2478
|
+
},
|
|
2479
|
+
(e) => {
|
|
2480
|
+
loadingInstance.close() // 结束
|
|
2481
|
+
let enc = new TextDecoder('utf-8')
|
|
2482
|
+
let uint8_msg = JSON.parse(
|
|
2483
|
+
enc.decode(new Uint8Array(e.response.data))
|
|
2484
|
+
)
|
|
2485
|
+
this.$message.error(uint8_msg.message)
|
|
2486
|
+
}
|
|
2487
|
+
)
|
|
2446
2488
|
},
|
|
2447
2489
|
importCommand(params) {
|
|
2448
2490
|
switch (params.command) {
|
|
@@ -2731,6 +2773,13 @@ export default {
|
|
|
2731
2773
|
operation: 'EQUAL',
|
|
2732
2774
|
relation: 'AND',
|
|
2733
2775
|
},
|
|
2776
|
+
{
|
|
2777
|
+
property: 'bo_alias_',
|
|
2778
|
+
value: this.templateInfo.boDefAlias,
|
|
2779
|
+
group: 'main',
|
|
2780
|
+
operation: 'EQUAL',
|
|
2781
|
+
relation: 'AND',
|
|
2782
|
+
},
|
|
2734
2783
|
],
|
|
2735
2784
|
}
|
|
2736
2785
|
this.recordTableLoading = true
|
|
@@ -3117,6 +3166,10 @@ export default {
|
|
|
3117
3166
|
this.getBpmTemplateByPagination(params)
|
|
3118
3167
|
},
|
|
3119
3168
|
filterChange(filters) {
|
|
3169
|
+
// 筛选时需重置页面页码
|
|
3170
|
+
if (filters) {
|
|
3171
|
+
this.pagination.page = 1
|
|
3172
|
+
}
|
|
3120
3173
|
if (filters && Object.keys(filters).length > 0) {
|
|
3121
3174
|
const key = Object.keys(filters)[0]
|
|
3122
3175
|
const filter = filters[key]
|
|
@@ -3497,7 +3550,10 @@ export default {
|
|
|
3497
3550
|
currentRows
|
|
3498
3551
|
.filter((item) => item[fields] !== undefined && item[fields] !== '')
|
|
3499
3552
|
.map((item) => Number(item[fields]))
|
|
3500
|
-
if (!list || list.length == 0)
|
|
3553
|
+
if (!list || list.length == 0) {
|
|
3554
|
+
let num = 0
|
|
3555
|
+
return num.toFixed(decimal)
|
|
3556
|
+
}
|
|
3501
3557
|
const METHOD_MAP = {
|
|
3502
3558
|
count: 'getCount',
|
|
3503
3559
|
sum: 'getSum',
|
|
@@ -3665,7 +3721,7 @@ export default {
|
|
|
3665
3721
|
type: dialogConfig.custDialog,
|
|
3666
3722
|
}
|
|
3667
3723
|
obj.custdialog = {
|
|
3668
|
-
name: '请选择',
|
|
3724
|
+
name: dialogConfig.name || '请选择',
|
|
3669
3725
|
custDialog: custdialog,
|
|
3670
3726
|
resultField: dialogConfig.resultField,
|
|
3671
3727
|
}
|
|
@@ -3741,6 +3797,10 @@ export default {
|
|
|
3741
3797
|
type: 'warning',
|
|
3742
3798
|
})
|
|
3743
3799
|
.then(() => {
|
|
3800
|
+
let loadingInstance = Loading.service({
|
|
3801
|
+
fullscreen: true,
|
|
3802
|
+
text: '数据更新中...',
|
|
3803
|
+
})
|
|
3744
3804
|
let selectRows = row
|
|
3745
3805
|
? [row]
|
|
3746
3806
|
: this.tableData.selectRows
|
|
@@ -3756,20 +3816,37 @@ export default {
|
|
|
3756
3816
|
boData: selectRows,
|
|
3757
3817
|
boAlias: this.templateInfo.boDefAlias,
|
|
3758
3818
|
}
|
|
3759
|
-
this.$requestConfig
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
message
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3819
|
+
this.$requestConfig
|
|
3820
|
+
.batchUpdateTemplateData(data)
|
|
3821
|
+
.then((data) => {
|
|
3822
|
+
if (data.state) {
|
|
3823
|
+
this.$message({
|
|
3824
|
+
type: 'success',
|
|
3825
|
+
message: data.message,
|
|
3826
|
+
})
|
|
3827
|
+
this.$nextTick(() => {
|
|
3828
|
+
// 以服务的方式调用的 Loading 需要异步关闭
|
|
3829
|
+
loadingInstance.close()
|
|
3830
|
+
})
|
|
3831
|
+
this.search({
|
|
3832
|
+
querys: this.buildDefaultQuerys() || [],
|
|
3833
|
+
})
|
|
3834
|
+
// 更新成功后需执行后置js
|
|
3835
|
+
if (afterScriptValue) {
|
|
3836
|
+
let script = Base64.decode(afterScriptValue)
|
|
3837
|
+
this.tempScript(script, row)
|
|
3838
|
+
}
|
|
3839
|
+
} else {
|
|
3840
|
+
this.$nextTick(() => {
|
|
3841
|
+
// 以服务的方式调用的 Loading 需要异步关闭
|
|
3842
|
+
loadingInstance.close()
|
|
3843
|
+
})
|
|
3844
|
+
}
|
|
3845
|
+
})
|
|
3846
|
+
.finally(() => {
|
|
3847
|
+
loadingInstance.close()
|
|
3848
|
+
})
|
|
3849
|
+
this.$parent.init()
|
|
3773
3850
|
})
|
|
3774
3851
|
.catch(() => {
|
|
3775
3852
|
this.$message({
|
|
@@ -4024,8 +4101,11 @@ export default {
|
|
|
4024
4101
|
}
|
|
4025
4102
|
} else if (btnOk.indexOf(btnAlias) != -1) {
|
|
4026
4103
|
if (btnAlias == 'switch') {
|
|
4104
|
+
const pkFieldValue =
|
|
4105
|
+
parameter.pkField ||
|
|
4106
|
+
this.getBindValue(row, this.templateInfo.pkField)
|
|
4027
4107
|
this.switchChange(
|
|
4028
|
-
|
|
4108
|
+
pkFieldValue,
|
|
4029
4109
|
parameter.switchOn,
|
|
4030
4110
|
parameter.switchOff,
|
|
4031
4111
|
parameter.bind,
|
|
@@ -4532,7 +4612,7 @@ export default {
|
|
|
4532
4612
|
return strData
|
|
4533
4613
|
}
|
|
4534
4614
|
},
|
|
4535
|
-
|
|
4615
|
+
getCheckField() {
|
|
4536
4616
|
let customColumns = this.$refs.multipleTemplateTable.customColumns || []
|
|
4537
4617
|
let customColumnSetting = JSON.parse(
|
|
4538
4618
|
localStorage.getItem('customColumnSetting') || '{}'
|