three-trees-ui 1.0.24 → 1.0.26

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "three-trees-ui",
3
- "version": "1.0.24",
3
+ "version": "1.0.26",
4
4
  "publicPath": "/ui",
5
5
  "author": "hotent",
6
6
  "private": false,
@@ -525,6 +525,8 @@
525
525
  writeable: true,
526
526
  fixedParams: {}, // 传过来的固定值
527
527
  executeScriptResult: null,
528
+ customDialogParams: {},
529
+ treeDialogConfig: null,
528
530
  }
529
531
  },
530
532
  computed: {
@@ -863,7 +865,7 @@
863
865
  ? customDialog.requestType
864
866
  : 'POST'
865
867
  var url =
866
- '${form}/form/customDialog/v1/getTreeData?alias=' +
868
+ '${form}/form/customDialog/v1/getTreeDataByPid?alias=' +
867
869
  pageParam.alias +
868
870
  '&mapParam=' +
869
871
  mapParam
@@ -924,6 +926,7 @@
924
926
  requestParams.requestType = requestType
925
927
  requestParams.url = url
926
928
  requestParams.paramsObj = paramsObj
929
+ this.customDialogParams = requestParams
927
930
  this.searchTree(requestParams, defaultPValue)
928
931
  this.customDialogShowTree = true
929
932
  },
@@ -946,13 +949,18 @@
946
949
  if (defaultPValue) {
947
950
  displayfield.pvalue = defaultPValue
948
951
  }
949
- this_.props1 = this_.toTreeData(
950
- response,
951
- displayfield.id,
952
- displayfield.pid,
953
- displayfield.displayName,
954
- displayfield.pvalue ? displayfield.pvalue : 0
955
- )
952
+ // restful 接口不懒加载
953
+ if (this_.customDialog.dsType != 'dataSource') {
954
+ this_.props1 = this_.toTreeData(
955
+ response,
956
+ displayfield.id,
957
+ displayfield.pid,
958
+ displayfield.displayName,
959
+ displayfield.pvalue ? displayfield.pvalue : 0
960
+ )
961
+ } else {
962
+ this_.props1 = response
963
+ }
956
964
  })
957
965
  },
958
966
  dialogTreeConfirm() {
@@ -1843,11 +1851,40 @@
1843
1851
  this_.customDialog.style == 2
1844
1852
  ? this_.combiTreeDisplayField
1845
1853
  : this_.displayField
1846
- resolve(
1847
- this.treeList.filter(
1848
- (value) => value[displayField.pid] === node.data[displayField.id]
1854
+ // restful 接口不懒加载
1855
+ if (
1856
+ (this.customDialog.style == 2 &&
1857
+ this.treeDialogConfig &&
1858
+ this.treeDialogConfig.dsType != 'dataSource') ||
1859
+ (this.customDialog.style != 2 &&
1860
+ this.customDialog.dsType != 'dataSource')
1861
+ ) {
1862
+ resolve(
1863
+ this.treeList.filter(
1864
+ (value) =>
1865
+ value[displayField.pid] === node.data[displayField.id]
1866
+ )
1849
1867
  )
1850
- )
1868
+ } else {
1869
+ const nodeDataId = node.data[displayField.id]
1870
+ if (nodeDataId) {
1871
+ let { url } = this_.customDialogParams
1872
+ let ljChar = url.indexOf('?') == -1 ? '?' : '&'
1873
+ url = url + ljChar + '&pidValue=' + nodeDataId
1874
+ let query = this.$requestConfig.request({
1875
+ url: url,
1876
+ method:
1877
+ this_.customDialogParams.requestType == 'POST'
1878
+ ? 'post'
1879
+ : 'get',
1880
+ data: this_.customDialogParams.paramsObj,
1881
+ })
1882
+ query.then(function(response) {
1883
+ resolve(response)
1884
+ })
1885
+ }
1886
+ }
1887
+
1851
1888
  if (this.showData && this.showData.length > 0) {
1852
1889
  setTimeout(() => {
1853
1890
  this.showData.forEach((v) => {
@@ -1936,6 +1973,7 @@
1936
1973
  //获取对话框数据
1937
1974
  this.$requestConfig.getCustomDialogByAlias(treeAlias).then((resp) => {
1938
1975
  let treeDialog = resp
1976
+ this.treeDialogConfig = resp
1939
1977
  this.leftTreeTitle = treeDialog.name
1940
1978
  let requestType =
1941
1979
  treeDialog.dsType == 'dataSource'
@@ -1944,7 +1982,7 @@
1944
1982
  ? treeDialog.requestType
1945
1983
  : 'post'
1946
1984
  let url =
1947
- '${form}/form/customDialog/v1/getTreeData?alias=' +
1985
+ '${form}/form/customDialog/v1/getTreeDataByPid?alias=' +
1948
1986
  treeAlias +
1949
1987
  '&mapParam='
1950
1988
  let paramsObj = {}
@@ -1978,6 +2016,7 @@
1978
2016
  requestParams.requestType = requestType
1979
2017
  requestParams.url = url
1980
2018
  requestParams.paramsObj = paramsObj
2019
+ this.customDialogParams = requestParams
1981
2020
 
1982
2021
  this.$requestConfig
1983
2022
  .request({
@@ -1991,14 +2030,19 @@
1991
2030
  this.defaultProps.label = displayField.displayName
1992
2031
  this.treeList = resp
1993
2032
  this.combiTreeDisplayField = displayField
1994
- this.combinationTreeData = this.toTreeData(
1995
- resp,
1996
- displayField.id,
1997
- displayField.pid,
1998
- displayField.displayName,
1999
- displayField.pvalue ? displayField.pvalue : '0',
2000
- resultfield
2001
- )
2033
+ // restful 接口不懒加载
2034
+ if (treeDialog.dsType != 'dataSource') {
2035
+ this.combinationTreeData = this.toTreeData(
2036
+ resp,
2037
+ displayField.id,
2038
+ displayField.pid,
2039
+ displayField.displayName,
2040
+ displayField.pvalue ? displayField.pvalue : '0',
2041
+ resultfield
2042
+ )
2043
+ } else {
2044
+ this.combinationTreeData = resp
2045
+ }
2002
2046
  }
2003
2047
  })
2004
2048
  })
@@ -438,6 +438,8 @@
438
438
  combinationRule: {},
439
439
  leftTreeTitle: '',
440
440
  fixedParams: {}, // 传过来的固定值
441
+ customDialogParams: {},
442
+ treeDialogConfig: null,
441
443
  }
442
444
  },
443
445
  computed: {
@@ -786,7 +788,7 @@
786
788
  ? customDialog.requestType
787
789
  : 'POST'
788
790
  var url =
789
- '${form}/form/customDialog/v1/getTreeData?alias=' +
791
+ '${form}/form/customDialog/v1/getTreeDataByPid?alias=' +
790
792
  pageParam.alias +
791
793
  '&mapParam=' +
792
794
  mapParam
@@ -847,6 +849,7 @@
847
849
  requestParams.requestType = requestType
848
850
  requestParams.url = url
849
851
  requestParams.paramsObj = paramsObj
852
+ this.customDialogParams = requestParams
850
853
  this.searchTree(requestParams, defaultPValue)
851
854
  this.customDialogShowTree = true
852
855
  },
@@ -869,13 +872,18 @@
869
872
  if (defaultPValue) {
870
873
  displayfield.pvalue = defaultPValue
871
874
  }
872
- this_.props1 = this_.toTreeData(
873
- response,
874
- displayfield.id,
875
- displayfield.pid,
876
- displayfield.displayName,
877
- displayfield.pvalue ? displayfield.pvalue : 0
878
- )
875
+ // restful 接口不懒加载
876
+ if (this_.customDialog.dsType != 'dataSource') {
877
+ this_.props1 = this_.toTreeData(
878
+ response,
879
+ displayfield.id,
880
+ displayfield.pid,
881
+ displayfield.displayName,
882
+ displayfield.pvalue ? displayfield.pvalue : 0
883
+ )
884
+ } else {
885
+ this_.props1 = response
886
+ }
879
887
  })
880
888
  },
881
889
  dialogTreeConfirm() {
@@ -1628,11 +1636,39 @@
1628
1636
  this_.customDialog.style == 2
1629
1637
  ? this_.combiTreeDisplayField
1630
1638
  : this_.displayField
1631
- resolve(
1632
- this.treeList.filter(
1633
- (value) => value[displayField.pid] === node.data[displayField.id]
1639
+ // restful 接口不懒加载
1640
+ if (
1641
+ (this.customDialog.style == 2 &&
1642
+ this.treeDialogConfig &&
1643
+ this.treeDialogConfig.dsType != 'dataSource') ||
1644
+ (this.customDialog.style != 2 &&
1645
+ this.customDialog.dsType != 'dataSource')
1646
+ ) {
1647
+ resolve(
1648
+ this.treeList.filter(
1649
+ (value) =>
1650
+ value[displayField.pid] === node.data[displayField.id]
1651
+ )
1634
1652
  )
1635
- )
1653
+ } else {
1654
+ const nodeDataId = node.data[displayField.id]
1655
+ if (nodeDataId) {
1656
+ let { url } = this_.customDialogParams
1657
+ let ljChar = url.indexOf('?') == -1 ? '?' : '&'
1658
+ url = url + ljChar + '&pidValue=' + nodeDataId
1659
+ let query = this.$requestConfig.request({
1660
+ url: url,
1661
+ method:
1662
+ this_.customDialogParams.requestType == 'POST'
1663
+ ? 'post'
1664
+ : 'get',
1665
+ data: this_.customDialogParams.paramsObj,
1666
+ })
1667
+ query.then(function(response) {
1668
+ resolve(response)
1669
+ })
1670
+ }
1671
+ }
1636
1672
  if (this.showData && this.showData.length > 0) {
1637
1673
  setTimeout(() => {
1638
1674
  this.showData.forEach((v) => {
@@ -1712,6 +1748,7 @@
1712
1748
  //获取对话框数据
1713
1749
  this.$requestConfig.getCustomDialogByAlias(treeAlias).then((resp) => {
1714
1750
  let treeDialog = resp
1751
+ this.treeDialogConfig = resp
1715
1752
  this.leftTreeTitle = treeDialog.name
1716
1753
  let requestType =
1717
1754
  treeDialog.dsType == 'dataSource'
@@ -1720,7 +1757,7 @@
1720
1757
  ? treeDialog.requestType
1721
1758
  : 'post'
1722
1759
  let url =
1723
- '${form}/form/customDialog/v1/getTreeData?alias=' +
1760
+ '${form}/form/customDialog/v1/getTreeDataByPid?alias=' +
1724
1761
  treeAlias +
1725
1762
  '&mapParam='
1726
1763
  let paramsObj = {}
@@ -1754,6 +1791,7 @@
1754
1791
  requestParams.requestType = requestType
1755
1792
  requestParams.url = url
1756
1793
  requestParams.paramsObj = paramsObj
1794
+ this.customDialogParams = requestParams
1757
1795
 
1758
1796
  this.$requestConfig
1759
1797
  .request({
@@ -1767,14 +1805,19 @@
1767
1805
  this.defaultProps.label = displayField.displayName
1768
1806
  this.treeList = resp
1769
1807
  this.combiTreeDisplayField = displayField
1770
- this.combinationTreeData = this.toTreeData(
1771
- resp,
1772
- displayField.id,
1773
- displayField.pid,
1774
- displayField.displayName,
1775
- displayField.pvalue ? displayField.pvalue : '0',
1776
- resultfield
1777
- )
1808
+ // restful 接口不懒加载
1809
+ if (treeDialog.dsType != 'dataSource') {
1810
+ this.combinationTreeData = this.toTreeData(
1811
+ resp,
1812
+ displayField.id,
1813
+ displayField.pid,
1814
+ displayField.displayName,
1815
+ displayField.pvalue ? displayField.pvalue : '0',
1816
+ resultfield
1817
+ )
1818
+ } else {
1819
+ this.combinationTreeData = resp
1820
+ }
1778
1821
  }
1779
1822
  })
1780
1823
  })
@@ -18,6 +18,7 @@
18
18
  @search="handleSearch"
19
19
  @reset="handleReset"
20
20
  @page-change="handlePageChange"
21
+ @size-change="handleSizeChange"
21
22
  @contact-group-change="loadContactUser"
22
23
  @load-org-user="loadOrgUser"
23
24
  @load-policy-user="loadPolicyUser"
@@ -165,6 +166,10 @@
165
166
  }
166
167
  }
167
168
  },
169
+ handleSizeChange(size) {
170
+ this.pagination.pageSize = size
171
+ this.handleLoad(this.pagination.page)
172
+ },
168
173
  // 处理过滤类型变化的事件
169
174
  handleFilterTypeChange(type) {
170
175
  this.filterType = type
@@ -10,21 +10,27 @@
10
10
  top="3vh"
11
11
  >
12
12
  <div class="dialog-selector__body">
13
- <el-input
14
- v-model="searchWord"
15
- size="small"
16
- clearable
17
- :placeholder="searchPlaceholder"
18
- @clear="reset"
19
- @keyup.enter.native="search"
20
- >
21
- <i
22
- slot="prefix"
23
- :title="t('ht.common.search')"
24
- class="el-input__icon el-icon-search"
25
- @click="search"
26
- />
27
- </el-input>
13
+ <div class="search-main">
14
+ <el-input
15
+ v-model="searchWord"
16
+ size="small"
17
+ clearable
18
+ :placeholder="searchPlaceholder"
19
+ @clear="reset"
20
+ @keyup.enter.native="search"
21
+ >
22
+ <i
23
+ slot="prefix"
24
+ :title="t('ht.common.search')"
25
+ class="el-input__icon el-icon-search"
26
+ @click="search"
27
+ />
28
+ </el-input>
29
+ <div class="right">
30
+ <el-button type="primary" size="mini" @click="search">搜索</el-button>
31
+ <el-button size="mini" @click="reset">重置</el-button>
32
+ </div>
33
+ </div>
28
34
  <ht-list-selector
29
35
  ref="selector"
30
36
  v-model="selectors"
@@ -290,6 +296,13 @@
290
296
  }
291
297
  }
292
298
  .dialog-selector__body {
299
+ .search-main {
300
+ display: flex;
301
+ .right {
302
+ display: flex;
303
+ margin-left: 15px;
304
+ }
305
+ }
293
306
  .el-icon-search {
294
307
  cursor: pointer;
295
308
  }
@@ -12,6 +12,7 @@ export default {
12
12
  fileList: [],
13
13
  tableData: { selectRows: [], querys: '' },
14
14
  dialogExportVisible: false,
15
+ isdefaultQuery: true,
15
16
  exportData: { getType: 'all', expField: [] },
16
17
  exportSellection: [],
17
18
  searchForm: {},
@@ -82,6 +83,11 @@ export default {
82
83
  handler(newVal) {
83
84
  if (newVal.shows) {
84
85
  let displayField = utils.parseToJson(newVal.shows)
86
+ let buttonsts = utils.parseToJson(newVal.buttons);
87
+ console.log(buttonsts)
88
+ if(buttonsts[0].isdefault == "1"){
89
+ this.isdefaultQuery = false
90
+ }
85
91
  for (var i = 0; i < displayField.length; i++) {
86
92
  if (displayField[i].hidden == 0) {
87
93
  this.displayFields.push(displayField[i])
@@ -553,7 +559,14 @@ export default {
553
559
  },
554
560
  //点击导出按钮
555
561
  exports() {
556
- this.dialogExportVisible = true
562
+ if(this.isdefaultQuery){
563
+ this.dialogExportVisible = true
564
+ }else{
565
+ this.exportData.expField= JSON.parse(JSON.stringify(this.displayFields))
566
+ console.log(this.exportData)
567
+ this.submitExport()
568
+ }
569
+
557
570
  },
558
571
  punchOrder() {
559
572
  this.$store