doway-coms 2.11.3 → 2.11.4

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": "doway-coms",
3
- "version": "2.11.3",
3
+ "version": "2.11.4",
4
4
  "description": "doway组件库",
5
5
  "author": "dowaysoft",
6
6
  "main": "packages/index.js",
@@ -864,6 +864,18 @@ export default {
864
864
  header: {
865
865
  options: [
866
866
  [
867
+ {
868
+ code: 'fixedCancel',
869
+ name: '取消固定列',
870
+ visible: true,
871
+ disabled: false,
872
+ },
873
+ {
874
+ code: 'fixedLeft',
875
+ name: '固定列到左侧',
876
+ visible: true,
877
+ disabled: false,
878
+ },
867
879
  {
868
880
  code: 'clearFilter',
869
881
  name: '清空筛选',
@@ -922,24 +934,46 @@ export default {
922
934
  ],
923
935
  },
924
936
  visibleMethod: ({ options, column }) => {
925
- console.log(options)
926
- if(this.gridEdit){
927
- options.forEach(list => {
937
+
938
+ options.forEach(list => {
928
939
  list.forEach(item => {
929
940
  if(item.code=='copyRow'||item.code=='paste'){
930
- item.visible=true
941
+ item.visible = this.gridEdit
931
942
  }
932
- })
933
- })
934
- }else{
935
- options.forEach(list => {
936
- list.forEach(item => {
937
- if(item.code=='copyRow'||item.code=='paste'){
938
- item.visible=false
943
+ if(item.code==='fixedCancel'){
944
+ item.visible = Boolean(column && column.fixed && this.moduleCode && this.dataCode && column.type!=='seq' && column.type!=='checkbox')
945
+ }
946
+ if(item.code==='fixedLeft'){
947
+ item.visible = Boolean(column && !column.fixed && this.moduleCode && this.dataCode && column.type!=='seq' && column.type!=='checkbox')
939
948
  }
940
- })
941
949
  })
942
- }
950
+ })
951
+ // if(column && column.fixed){
952
+ // options.forEach(list => {
953
+ // list.forEach(item => {
954
+ // if(item.code==''){
955
+ // item.visible=true
956
+ // }
957
+ // })
958
+ // })
959
+ // }
960
+ // if(this.gridEdit){
961
+ // options.forEach(list => {
962
+ // list.forEach(item => {
963
+ // if(item.code=='copyRow'||item.code=='paste'){
964
+ // item.visible=true
965
+ // }
966
+ // })
967
+ // })
968
+ // }else{
969
+ // options.forEach(list => {
970
+ // list.forEach(item => {
971
+ // if(item.code=='copyRow'||item.code=='paste'){
972
+ // item.visible=false
973
+ // }
974
+ // })
975
+ // })
976
+ // }
943
977
  return true
944
978
  },
945
979
  },
@@ -1717,17 +1751,21 @@ export default {
1717
1751
  contextMenuClickEvent({ menu, row, column }) {
1718
1752
  let vm = this
1719
1753
  const $table = this.$refs.baseGrid
1720
- if (column && column.field) {
1721
- if (
1722
- menu.code !== 'sort' &&
1723
- menu.code !== 'copy' &&
1724
- menu.code !== 'copyRow' &&
1725
- menu.code !== 'refresh' &&
1726
- menu.code !== 'clearFilter'
1727
- ) {
1728
- $table.sort(column.field, menu.code)
1729
- }
1730
- }
1754
+ console.debug('menu',menu)
1755
+ // if (column && column.field) {
1756
+ // if (
1757
+ // menu.code !== 'sort' &&
1758
+ // menu.code !== 'copy' &&
1759
+ // menu.code !== 'copyRow' &&
1760
+ // menu.code !== 'refresh' &&
1761
+ // menu.code !== 'clearFilter' &&
1762
+ // menu.code !== 'fixedLeft' &&
1763
+ // menu.code !== 'fixedRight' &&
1764
+ // menu.code !== 'fixedCancel'
1765
+ // ) {
1766
+ // $table.sort(column.field, menu.code)
1767
+ // }
1768
+ // }
1731
1769
  function pasteChildren (row, childrenField, parentField) {
1732
1770
  if (row[childrenField] && row[childrenField].length > 0) {
1733
1771
  row[childrenField].forEach(item => {
@@ -1786,6 +1824,16 @@ export default {
1786
1824
  }
1787
1825
  }
1788
1826
  break
1827
+ case 'fixedCancel':
1828
+ //取消固定列
1829
+ this.$refs.baseGrid.clearColumnFixed(column.field)
1830
+ this.saveTableHeight()
1831
+ break
1832
+ case 'fixedLeft':
1833
+ //固定列到左侧
1834
+ this.$refs.baseGrid.setColumnFixed(column.field, 'left')
1835
+ this.saveTableHeight()
1836
+ break;
1789
1837
  case 'clearFilter':
1790
1838
  // 示例
1791
1839
  const filterList = this.$refs.baseGrid.getCheckedFilters()
@@ -1852,6 +1900,21 @@ export default {
1852
1900
  break
1853
1901
  default:
1854
1902
  }
1903
+ },
1904
+ /**
1905
+ * 固定列到左侧
1906
+ * @param scope
1907
+ */
1908
+ fixedLeftColumn(scope){
1909
+ this.$refs.baseGrid.setColumnFixed(scope.column.field, 'left')
1910
+
1911
+ },
1912
+ /**
1913
+ * 取消固定列
1914
+ * @param scope
1915
+ */
1916
+ fixedCancelColumn(scope){
1917
+
1855
1918
  },
1856
1919
  getFiltersList() {
1857
1920
  return this.filterExpression
@@ -3712,6 +3775,9 @@ export default {
3712
3775
  if (tempObject.extraInfo.order) {
3713
3776
  tempData.extraInfo.order = tempObject.extraInfo.order
3714
3777
  }
3778
+ if(item.fixed){
3779
+ tempData.extraInfo['fixed'] = item.fixed
3780
+ }
3715
3781
  postData.fields.push(tempData)
3716
3782
  })
3717
3783
  saveUserModuleDataFieldApi(postData)
@@ -3997,6 +4063,7 @@ export default {
3997
4063
  }
3998
4064
  ::v-deep span.vxe-cell--title {
3999
4065
  margin-right: auto;
4066
+ display: inline-flex;//当表头设置换行时需要把这个样式覆盖加上,否则筛选和过滤会在第二行显示
4000
4067
  }
4001
4068
  .inner-cell-control {
4002
4069
  width: 100% !important;