doway-coms 2.10.51 → 2.10.54
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
|
@@ -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
|
+
}
|
|
@@ -302,10 +302,11 @@
|
|
|
302
302
|
<template #pulldown_edit="scope" class="interceptor-class">
|
|
303
303
|
<div class="interceptor-class">
|
|
304
304
|
<BasePulldown
|
|
305
|
+
v-if="getCellEditExp(scope)"
|
|
305
306
|
v-model="scope.row[scope.column.property]"
|
|
306
307
|
:field="scope.column.property"
|
|
307
308
|
:formRow="formRow"
|
|
308
|
-
:edit="
|
|
309
|
+
:edit="true"
|
|
309
310
|
:showLabel="false"
|
|
310
311
|
:row="scope.row"
|
|
311
312
|
:api="scope.column.params.api"
|
|
@@ -331,6 +332,9 @@
|
|
|
331
332
|
:propTableData="getTableData()"
|
|
332
333
|
:disabled="editDisabled(scope)"
|
|
333
334
|
/>
|
|
335
|
+
<div v-else>
|
|
336
|
+
{{ gridDefaultValueDisplay(scope.row, scope.column) }}
|
|
337
|
+
</div>
|
|
334
338
|
</div>
|
|
335
339
|
</template>
|
|
336
340
|
<template #treeSelect_edit="scope">
|
|
@@ -339,7 +343,8 @@
|
|
|
339
343
|
v-model="scope.row[scope.column.property]"
|
|
340
344
|
:field="scope.column.property"
|
|
341
345
|
:formRow="formRow"
|
|
342
|
-
|
|
346
|
+
v-if="getCellEditExp(scope)"
|
|
347
|
+
:edit="true"
|
|
343
348
|
:showLabel="false"
|
|
344
349
|
:row="scope.row"
|
|
345
350
|
class="inner-cell-control"
|
|
@@ -355,6 +360,9 @@
|
|
|
355
360
|
@preSearch="(searchInfo) => preSearch(searchInfo, scope)"
|
|
356
361
|
>
|
|
357
362
|
</BaseTreeSelect>
|
|
363
|
+
<div v-else>
|
|
364
|
+
{{ gridDefaultValueDisplay(scope.row, scope.column) }}
|
|
365
|
+
</div>
|
|
358
366
|
</div>
|
|
359
367
|
</template>
|
|
360
368
|
|
|
@@ -738,6 +746,7 @@
|
|
|
738
746
|
</a-button>
|
|
739
747
|
</template>
|
|
740
748
|
</VxeModal> -->
|
|
749
|
+
<exportCmp :objectService="objectService" ref="exportCmpView" />
|
|
741
750
|
</div>
|
|
742
751
|
</template>
|
|
743
752
|
<script>
|
|
@@ -773,6 +782,7 @@ import {
|
|
|
773
782
|
Tag,
|
|
774
783
|
} from 'ant-design-vue'
|
|
775
784
|
import BasePagination from '../../BasePagination/index'
|
|
785
|
+
import exportCmp from './exportCmp.vue'
|
|
776
786
|
import BasePulldown from '../../BasePulldown/index'
|
|
777
787
|
import BaseGridAdjust from '../../BaseGridAdjust/index'
|
|
778
788
|
import { saveUserModuleDataFieldApi, userResetApi } from '../../utils/api'
|
|
@@ -803,6 +813,7 @@ export default {
|
|
|
803
813
|
BaseGridAdjust,
|
|
804
814
|
SeqSetting,
|
|
805
815
|
Tooltip,
|
|
816
|
+
exportCmp
|
|
806
817
|
},
|
|
807
818
|
data() {
|
|
808
819
|
return {
|
|
@@ -980,6 +991,10 @@ export default {
|
|
|
980
991
|
},
|
|
981
992
|
},
|
|
982
993
|
props: {
|
|
994
|
+
objectService: {
|
|
995
|
+
type: String,
|
|
996
|
+
default: ''
|
|
997
|
+
},
|
|
983
998
|
isSeqPopover: {
|
|
984
999
|
type: Boolean,
|
|
985
1000
|
default: true,
|
|
@@ -2102,6 +2117,10 @@ export default {
|
|
|
2102
2117
|
}
|
|
2103
2118
|
if (originCol.controlType === controlType.text) {
|
|
2104
2119
|
colParams['controlEdit'] = true
|
|
2120
|
+
colParams['allowClear'] = true
|
|
2121
|
+
if (originCol.hasOwnProperty('allowClear')) {
|
|
2122
|
+
colParams['allowClear'] = originCol.allowClear
|
|
2123
|
+
}
|
|
2105
2124
|
}
|
|
2106
2125
|
if (originCol.controlType === controlType.select) {
|
|
2107
2126
|
colParams['controlEdit'] = true
|
|
@@ -2795,6 +2814,26 @@ export default {
|
|
|
2795
2814
|
* 表尾按钮操作
|
|
2796
2815
|
*/
|
|
2797
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
|
+
}
|
|
2798
2837
|
this.$emit('pagerButtonClick', pagerBtnInfo, this)
|
|
2799
2838
|
},
|
|
2800
2839
|
/**
|