doway-coms 2.10.52 → 2.10.55

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.10.52",
3
+ "version": "2.10.55",
4
4
  "description": "doway组件库",
5
5
  "author": "dowaysoft",
6
6
  "main": "packages/index.js",
@@ -0,0 +1,106 @@
1
+ <template>
2
+ <div>
3
+ <vxe-modal
4
+ v-model="showExport"
5
+ :title="exportTitle"
6
+ show-zoom
7
+ resize
8
+ showFooter
9
+ show-close
10
+ :mask-closable="true"
11
+ width="400px"
12
+ height="400px"
13
+ :destroyOnClose="true"
14
+ >
15
+ <template #default>
16
+ <draggable ref="dragView" v-model="exportFields">
17
+ <div v-for="loopField in exportFields" :key="loopField.code">
18
+ <a-checkbox v-model="loopField.selected">{{ loopField.title }}</a-checkbox>
19
+ </div>
20
+ </draggable>
21
+ </template>
22
+ <template #footer>
23
+ <Button type="primary" size="small" @click="confirmExport">确认导出</Button>
24
+ </template>
25
+ </vxe-modal>
26
+ </div>
27
+ </template>
28
+
29
+ <script>
30
+ import { commonExportApi } from './gridApi';
31
+ import XEUtils from 'xe-utils';
32
+ import { controlType } from '../../utils/enum';
33
+ import draggable from 'vuedraggable';
34
+ import { Button } from 'ant-design-vue';
35
+
36
+ export default {
37
+ name: 'commonExportCmp',
38
+ components: {
39
+ draggable,
40
+ Button
41
+ },
42
+ props: {
43
+ objectService: {
44
+ type: String,
45
+ default: ''
46
+ }
47
+ },
48
+ data() {
49
+ return {
50
+ showExport: false,
51
+ exportTitle: '',
52
+ exportFields: [],
53
+ moduleCode: '',
54
+ dataCode: '',
55
+ fieldCode: '',
56
+ searchParam: {}
57
+ };
58
+ },
59
+ methods: {
60
+ show(moduleCodeParam, dataCodeParam, dataNameParam, fieldCodeParam, searchParamParam, fields) {
61
+ this.exportFields = [];
62
+ this.moduleCode = moduleCodeParam;
63
+ this.dataCode = dataCodeParam;
64
+ this.fieldCode = fieldCodeParam;
65
+ this.searchParam = searchParamParam;
66
+
67
+ XEUtils.arrayEach(fields, (loopField) => {
68
+ if (loopField.ignoreExport === true || loopField.controlType === controlType.buttons) {
69
+ return;
70
+ }
71
+ this.exportFields.push({
72
+ code: loopField.field,
73
+ title: loopField.title,
74
+ selected: true
75
+ });
76
+ });
77
+
78
+ this.exportTitle = dataNameParam + '导出字段选择';
79
+ this.showExport = true;
80
+ },
81
+ confirmExport() {
82
+ let postData = {
83
+ moduleCode: this.moduleCode,
84
+ dataCode: this.dataCode,
85
+ fieldCode: this.fieldCode,
86
+ fields: [],
87
+ searchParam: this.searchParam
88
+ };
89
+
90
+ XEUtils.arrayEach(this.exportFields, (loopField) => {
91
+ if (loopField.selected === true) {
92
+ postData.fields.push(loopField.code);
93
+ }
94
+ });
95
+
96
+ console.debug('export post data', postData);
97
+ commonExportApi(this.objectService, postData);
98
+ }
99
+ }
100
+ };
101
+ </script>
102
+
103
+ <style scoped>
104
+
105
+ </style>
106
+
@@ -0,0 +1,33 @@
1
+ import store from '../../utils/store'
2
+
3
+ export function commonExportApi(objectService, data) {
4
+ const formExport = document.createElement('form');
5
+ formExport.method = 'post';
6
+ (formExport.action =
7
+ getServiceUrl(objectService) + '/v1/commonOperation/exportGridExcel?token=' + store.state.token),
8
+ (formExport.target = 'exportFrame');
9
+ const inputValue = document.createElement('input');
10
+ inputValue.type = 'text';
11
+ inputValue.name = 'exportData';
12
+ inputValue.value = JSON.stringify(data);
13
+ formExport.appendChild(inputValue);
14
+ document.body.appendChild(formExport);
15
+ formExport.submit();
16
+ document.body.removeChild(formExport);
17
+ }
18
+ export function getServiceUrl(objectService) {
19
+ let url = process.env.VUE_APP_ERP_SERVICE_URL;
20
+ if (objectService === 'base') {
21
+ url = process.env.VUE_APP_BASE_SERVICE_URL;
22
+ }
23
+ if (objectService === 'mes') {
24
+ url = process.env.VUE_APP_MES_SERVICE_URL;
25
+ }
26
+ if (objectService === 'aps') {
27
+ url = process.env.VUE_APP_APS_SERVICE_URL;
28
+ }
29
+ if (objectService === 'wms') {
30
+ url = process.env.VUE_APP_WMS_SERVICE_URL;
31
+ }
32
+ return url;
33
+ }
@@ -746,6 +746,7 @@
746
746
  </a-button>
747
747
  </template>
748
748
  </VxeModal> -->
749
+ <exportCmp :objectService="objectService" ref="exportCmpView" />
749
750
  </div>
750
751
  </template>
751
752
  <script>
@@ -781,6 +782,7 @@ import {
781
782
  Tag,
782
783
  } from 'ant-design-vue'
783
784
  import BasePagination from '../../BasePagination/index'
785
+ import exportCmp from './exportCmp.vue'
784
786
  import BasePulldown from '../../BasePulldown/index'
785
787
  import BaseGridAdjust from '../../BaseGridAdjust/index'
786
788
  import { saveUserModuleDataFieldApi, userResetApi } from '../../utils/api'
@@ -811,6 +813,7 @@ export default {
811
813
  BaseGridAdjust,
812
814
  SeqSetting,
813
815
  Tooltip,
816
+ exportCmp
814
817
  },
815
818
  data() {
816
819
  return {
@@ -988,6 +991,10 @@ export default {
988
991
  },
989
992
  },
990
993
  props: {
994
+ objectService: {
995
+ type: String,
996
+ default: ''
997
+ },
991
998
  isSeqPopover: {
992
999
  type: Boolean,
993
1000
  default: true,
@@ -2110,6 +2117,10 @@ export default {
2110
2117
  }
2111
2118
  if (originCol.controlType === controlType.text) {
2112
2119
  colParams['controlEdit'] = true
2120
+ colParams['allowClear'] = true
2121
+ if (originCol.hasOwnProperty('allowClear')) {
2122
+ colParams['allowClear'] = originCol.allowClear
2123
+ }
2113
2124
  }
2114
2125
  if (originCol.controlType === controlType.select) {
2115
2126
  colParams['controlEdit'] = true
@@ -2803,6 +2814,26 @@ export default {
2803
2814
  * 表尾按钮操作
2804
2815
  */
2805
2816
  pagerBtnClick(pagerBtnInfo) {
2817
+ //判断系统配置导出,用来兼容老的导出模式,定义的时候用export开头
2818
+ if(pagerBtnInfo.field.indexOf('export')===0 && pagerBtnInfo.exportMaxSize){
2819
+ let searchParam = {
2820
+ begin:
2821
+ (this.pager.current - 1) *
2822
+ this.pager.size +
2823
+ 1,
2824
+ size: this.pager.size,
2825
+ sorts:[],
2826
+ // this.sorts.length > 0
2827
+ // ? this.sorts
2828
+ // : [],
2829
+ expression: {
2830
+ expressions: this.getFiltersList(),
2831
+ operator: 'and',
2832
+ },
2833
+ };
2834
+ this.$refs.exportCmpView.show(this.moduleCode,this.dataCode,this.dataName,pagerBtnInfo.field,searchParam,this.columns
2835
+ )
2836
+ }
2806
2837
  this.$emit('pagerButtonClick', pagerBtnInfo, this)
2807
2838
  },
2808
2839
  /**