doway-coms 1.6.85 → 1.7.1

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.
@@ -1,7 +1,13 @@
1
1
  <template>
2
- <div :style="{ height: height - 40 + 'px' }">
3
- <div class="head-tag" v-if="tagData.length">
4
- <a-tag closable v-for="item in tagData" :key="item.column.field" @close="tagClosable(item.column)">
2
+ <div :style="{ height: height-tagHeight-10 + 'px' }">
3
+ <div class="head-tag" v-if="tagData.length" ref="tagView">
4
+ <a-tag
5
+ closable
6
+ v-for="item in tagData"
7
+ :key="item.column.field"
8
+ @close="tagClosable(item.column)"
9
+ @change="tagChange"
10
+ >
5
11
  <span>{{ tagContent(item) }} </span>
6
12
  </a-tag>
7
13
  <span style="color:#006cd9;cursor:pointer;font-size: 14px;" @click="clearFilter">清空</span>
@@ -90,6 +96,7 @@
90
96
  trigger="click"
91
97
  placement="rightTop"
92
98
  overlayClassName='popover-content-card'
99
+ style="top:40px"
93
100
  >
94
101
  <template slot="title">
95
102
  <div style="font-size: 17px;">表头设置</div>
@@ -512,7 +519,7 @@
512
519
  </div>
513
520
  </template>
514
521
  </VxeGrid>
515
- <VxeModal
522
+ <!-- <VxeModal
516
523
  v-model="showGridColumnUserDefine"
517
524
  title="表格布局设置"
518
525
  width="70%"
@@ -537,7 +544,7 @@
537
544
  确认
538
545
  </a-button>
539
546
  </template>
540
- </VxeModal>
547
+ </VxeModal> -->
541
548
  </div>
542
549
  </template>
543
550
  <script>
@@ -682,6 +689,7 @@ export default {
682
689
  filterExpression: [],
683
690
  filterStr: [],
684
691
  // 表格上方显示全部筛选条件
692
+ tagHeight: 0,
685
693
  tagData: [],
686
694
  // 默认配置条件-存储初始字段参数
687
695
  defaultPostData: {},
@@ -744,7 +752,7 @@ export default {
744
752
  props: {
745
753
  isSeqPopover: {
746
754
  type: Boolean,
747
- default: false,
755
+ default: true,
748
756
  },
749
757
  showOverFlow: {
750
758
  type: Boolean,
@@ -927,9 +935,17 @@ export default {
927
935
  beforeCreate() {
928
936
  this.simpleImage = Empty.PRESENTED_IMAGE_SIMPLE;
929
937
  },
930
-
938
+ watch: {
939
+ tagData: {
940
+ handler: function(newVal) {
941
+ this.$nextTick(()=>{
942
+ this.tagChange()
943
+ })
944
+ },
945
+ deep: true
946
+ }
947
+ },
931
948
  created() {
932
-
933
949
  try{
934
950
  if(this.pager && this.pager.sizeOptions) {
935
951
  this.pager.sizeOptions = XEUtils.map(this.pager.sizeOptions, item => {
@@ -939,17 +955,8 @@ export default {
939
955
  } catch(err) {
940
956
  console.debug(err)
941
957
  }
942
-
943
-
944
958
  //拖动后输入框有错位问题,暂时不启用
945
959
  // this.initColumnDrop()
946
-
947
- // this.internalColumns.push({
948
- // field: 'sysRowState',
949
- // visible:false,
950
- // filterMethod:this.sysRowStateFilter,
951
- // filters:[{label:'筛选删除行',value:'delete',checked:true}]
952
- // })
953
960
  for (let i = 0; i < this.columns.length; i++) {
954
961
  this.internalColumns.push(this.initColumns(this.columns[i]));
955
962
  if(this.columns[i].visible !== false && this.columns[i].controlType !== 'operation') {
@@ -1035,6 +1042,10 @@ export default {
1035
1042
  })
1036
1043
  },
1037
1044
  methods: {
1045
+ tagChange() {
1046
+ if (!this.$refs.tagView) return
1047
+ this.tagHeight = this.$refs.tagView.offsetHeight
1048
+ },
1038
1049
  // 取消当前字段筛选
1039
1050
  tagClosable(colInfo) {
1040
1051
  colInfo.filters[0].data.bindingValues = [];
@@ -1819,7 +1830,6 @@ export default {
1819
1830
  ).item;
1820
1831
  tempCol.visible = loopCol.params.show;
1821
1832
  tempCol.width = loopCol.width;
1822
- // tempCol.width = colWidth;
1823
1833
  //设置顺序
1824
1834
  tempCol.params["tempCustomSort"] = tempData.sort;
1825
1835
  this.setCustomGridParentSort(
@@ -1866,6 +1876,8 @@ export default {
1866
1876
  },
1867
1877
  // 确认保存自定义表格信息,更新表格
1868
1878
  saveSeqConfig(emitColumns, resData) {
1879
+ // 深拷贝一份参数用来初始化后赋值筛选排序
1880
+ let seqColumns = JSON.parse(JSON.stringify(emitColumns))
1869
1881
  // 获取表格字段数据
1870
1882
  let tableCollectColumn = this.$refs.baseGrid.getTableColumn().collectColumn;
1871
1883
  // 表格排序信息更新
@@ -1873,6 +1885,7 @@ export default {
1873
1885
  const find = XEUtils.find(emitColumns.fields, item => loopCol.field === item.field)
1874
1886
  if (find) {
1875
1887
  loopCol.params.sort = find.sort
1888
+ loopCol.visible = !find.hidden
1876
1889
  }
1877
1890
  })
1878
1891
  //设置表格顺序
@@ -1882,8 +1895,24 @@ export default {
1882
1895
  );
1883
1896
  // 更新表格
1884
1897
  this.$refs.baseGrid.reloadColumn(tableCollectColumn)
1885
- this.userDefineColumns = this.tableCollectColumn
1886
- // this.$refs.baseAdjustGridView.setColumnsOptions()
1898
+ tableCollectColumn.forEach((loopCol) => {
1899
+ const find = XEUtils.find(seqColumns.fields, item => loopCol.field === item.field)
1900
+ if (!find) {
1901
+ return
1902
+ }
1903
+ find.extraInfo.filterExpression ?
1904
+ loopCol.filters = find.extraInfo.filterExpression :
1905
+ loopCol.filters[0].data = {
1906
+ bindingValues: [],
1907
+ displayValues: [],
1908
+ displayValueSearchText:''
1909
+ }
1910
+ find.extraInfo.order ?
1911
+ loopCol.order = find.extraInfo.order :
1912
+ loopCol.order = null
1913
+ loopCol.visible = !find.hidden
1914
+ })
1915
+ this.$refs.baseAdjustGridView.updateColumns(tableCollectColumn)
1887
1916
  //清空store缓存
1888
1917
  this.$store.commit(
1889
1918
  "SET_MODULE_VIEW_INFO",{
@@ -2562,7 +2591,7 @@ export default {
2562
2591
  colInfo.filters[0].data.bindingValues.push(item);
2563
2592
  this.$set(col.filters[0].data,'bindingValues',colInfo.filters[0].data.bindingValues)
2564
2593
  } else {
2565
- if (item.value[0] || item.value[1]||item.value[0]==0||item.value[1]==0) {
2594
+ if (item.value[0] || item.value[1]||item.value[0]===0||item.value[1]===0) {
2566
2595
  colInfo.filters[0].data.bindingValues.push(item);
2567
2596
  this.$set(col.filters[0].data,'bindingValues',colInfo.filters[0].data.bindingValues)
2568
2597
  }
@@ -2783,20 +2812,14 @@ export default {
2783
2812
  saveTableHeight() {
2784
2813
  let vm = this
2785
2814
  // 去除操作列和序号、多选框列
2786
- let showColumns = vm.$refs.baseGrid.getTableColumn().collectColumn
2787
- .filter(x=>
2788
- (x.field !== "operation") &&
2789
- (x.field !== undefined) &&
2790
- x.visible
2791
- )
2792
- let notShowColumns = vm.$refs.baseGrid.getTableColumn().collectColumn
2793
- .filter(x=>
2794
- (x.field !== "operation") &&
2795
- (x.field !== undefined) &&
2796
- !x.visible
2815
+ let resizeColumns = JSON.parse(JSON.stringify(
2816
+ vm.$refs.baseGrid.getTableColumn().collectColumn
2817
+ .filter(x=>
2818
+ (x.field !== "operation") &&
2819
+ (x.field !== undefined)
2820
+ )
2797
2821
  )
2798
- let resizeColumns = []
2799
- resizeColumns.push(...showColumns, ...notShowColumns)
2822
+ )
2800
2823
  // 保存参数
2801
2824
  let postData = {
2802
2825
  moduleCode: vm.moduleCode,
@@ -2804,24 +2827,37 @@ export default {
2804
2827
  fields: [],
2805
2828
  }
2806
2829
  resizeColumns.forEach((item, index)=> {
2830
+ item.width = item.resizeWidth ? item.resizeWidth : item.width
2831
+ // 获取初始字段筛选条件,用于避免赋值宽度将普通筛选条件加入默认筛选
2832
+ let tempObject = vm.defaultPostData.fields.find(x => x.field == item.field)
2807
2833
  let tempData = {
2808
2834
  field: item.field,
2809
2835
  sort: index + 1,
2810
2836
  hidden: !item.visible,
2811
- width: item.resizeWidth,
2837
+ width: item.width,
2812
2838
  extraInfo:{}
2813
2839
  }
2814
- if (item.filters && item.filters[0].data.bindingValues.length) {
2840
+ if (
2841
+ tempObject.extraInfo.filterExpression &&
2842
+ tempObject.extraInfo.filterExpression[0].data.bindingValues.length
2843
+ ) {
2815
2844
  item.filters[0].checked = true;
2816
- tempData.extraInfo.filterExpression = item.filters
2845
+ tempData.extraInfo.filterExpression = tempObject.extraInfo.filterExpression
2817
2846
  }
2818
- if (item.order) {
2819
- tempData.extraInfo.order = item.order
2847
+ if (tempObject.extraInfo.order) {
2848
+ tempData.extraInfo.order = tempObject.extraInfo.order
2820
2849
  }
2821
2850
  postData.fields.push(tempData)
2822
2851
  })
2823
2852
  saveUserModuleDataFieldApi(postData)
2824
- .then(res => {})
2853
+ .then(res => {
2854
+ // 更新默认参数
2855
+ vm.defaultPostData = postData
2856
+ // 更新拖拽弹窗数据,避免宽度改变失效
2857
+ if (vm.$refs.baseAdjustGridView) {
2858
+ vm.$refs.baseAdjustGridView.updateColumns(resizeColumns)
2859
+ }
2860
+ })
2825
2861
  .catch((err) => {
2826
2862
  console.debug(err)
2827
2863
  })
@@ -2829,9 +2865,12 @@ export default {
2829
2865
  // 头部筛选条件展示内容
2830
2866
  tagContent(info) {
2831
2867
  let displayValues = info.column.filters[0].data.displayValues
2868
+ // 筛选条件
2869
+ let returnOperator = null
2832
2870
  // 筛选条件重组数组
2833
2871
  let curretnArr = []
2834
2872
  if(info.column.params.controlType === controlType.number) {
2873
+ returnOperator = '范围'
2835
2874
  // 数字范围选择
2836
2875
  // 去除空值
2837
2876
  displayValues = displayValues.filter(f=>f.value[0])
@@ -2848,6 +2887,7 @@ export default {
2848
2887
  ) {
2849
2888
  // 日期范围选择
2850
2889
  // 去除空值
2890
+ returnOperator = '范围'
2851
2891
  displayValues = displayValues.filter(f=>f.value[0])
2852
2892
  displayValues.forEach(x=> {
2853
2893
  let tempDate = []
@@ -2857,16 +2897,19 @@ export default {
2857
2897
  })
2858
2898
  } else if (info.column.params.controlType === controlType.select) {
2859
2899
  // 下拉
2900
+ returnOperator = '包含'
2860
2901
  displayValues.forEach(x=> {
2861
2902
  let findValue = info.column.params.dataSource.find(f=>f.value == x)
2862
2903
  curretnArr.push(findValue?findValue.caption : x)
2863
2904
  })
2864
2905
  } else if (info.column.params.controlType === controlType.checkbox) {
2906
+ returnOperator = '包含'
2865
2907
  // 单选
2866
2908
  displayValues.forEach(x=> curretnArr.push(x?'是':'否'))
2867
2909
  } else {
2868
2910
  // 其余字符串
2869
2911
  // 去除空值
2912
+ returnOperator = '包含'
2870
2913
  displayValues = displayValues.filter(f=>f.value[0])
2871
2914
  displayValues.forEach(display=> {
2872
2915
  curretnArr.push(display.value[0])
@@ -2878,17 +2921,23 @@ export default {
2878
2921
  // 筛选值数组拼接为字符串
2879
2922
  let curretnValue = '"' + curretnArr.join(' , ') + '"'
2880
2923
  // 三项内容拼接-字段名、筛选条件(组件暂时只有包含)、字段编码
2881
- returnField = title + ' ' + '包含' + ' ' + curretnValue
2924
+ returnField = title + ' ' + returnOperator + ' ' + curretnValue
2882
2925
  return returnField
2883
2926
  },
2884
2927
  // 保存默认配置条件
2885
2928
  saveFilterTable(colInfo) {
2886
2929
  colInfo.filters[0].data.bindingValues = [];
2887
2930
  XEUtils.arrayEach(colInfo.filters[0].data.displayValues, (item) => {
2888
- if (colInfo.params.controlType === controlType.select) {
2889
- colInfo.filters[0].data.bindingValues.push(item);
2931
+ if (
2932
+ colInfo.params.controlType === controlType.select ||
2933
+ colInfo.params.controlType === controlType.checkbox
2934
+ ) {
2935
+ // 复选清空筛选初始数据过滤
2936
+ if (!item.value) {
2937
+ colInfo.filters[0].data.bindingValues.push(item);
2938
+ }
2890
2939
  } else {
2891
- if (item.value[0] || item.value[1]) {
2940
+ if (item.value[0] || item.value[1]||item.value[0]===0||item.value[1]===0) {
2892
2941
  colInfo.filters[0].data.bindingValues.push(item);
2893
2942
  }
2894
2943
  }
@@ -2912,8 +2961,7 @@ export default {
2912
2961
  .then(res => {
2913
2962
  // 更新默认参数
2914
2963
  this.defaultPostData = postData
2915
- console.debug('2',this.defaultPostData);
2916
- this.$refs.baseGrid.closeFilter();
2964
+ this.$refs.baseGrid.closeFilter()
2917
2965
  // 初始标签
2918
2966
  this.tagData = JSON.parse(JSON.stringify(this.$refs.baseGrid.getCheckedFilters()))
2919
2967
  // 设置表格顺序
@@ -2921,20 +2969,21 @@ export default {
2921
2969
  tableCollectColumn,
2922
2970
  (p) => p.params.tempCustomSort
2923
2971
  );
2924
- //设置筛选过滤条件
2972
+ //设置筛选过滤条件及排序,用于保存后回调刷新
2925
2973
  this.setFilterExpression();
2926
2974
  let data = []
2927
2975
  this.$refs.baseGrid.getSortColumns().forEach(x=> {
2928
2976
  data.push([x.field,x.order])
2929
2977
  })
2930
2978
  this.$emit("sortChange", data);
2979
+
2931
2980
  //清空store缓存
2932
2981
  this.$store.commit(
2933
2982
  "SET_MODULE_VIEW_INFO",{
2934
2983
  moduleCode:this.moduleCode,
2935
2984
  info:res.content
2936
2985
  }
2937
- );
2986
+ )
2938
2987
  })
2939
2988
  .catch((err) => {
2940
2989
  console.debug(err)
@@ -2985,6 +3034,7 @@ export default {
2985
3034
  }
2986
3035
  .popover-content-card .ant-popover-inner {
2987
3036
  padding-left: 12px;
3037
+ top: 40px;
2988
3038
  }
2989
3039
  .popover-content-card .ant-popover-inner-content {
2990
3040
  padding: 0px;
@@ -3105,10 +3155,6 @@ export default {
3105
3155
  border-radius: 0;
3106
3156
  border: 0;
3107
3157
  background-color: #f6f7f9;
3108
-
3109
- // :hover {
3110
- // background-color: #e9ebf0 ;
3111
- // }
3112
3158
  .anticon-close {
3113
3159
  font-size: 14px;
3114
3160
  }