cloud-web-corejs 1.0.54-dev.334 → 1.0.54-dev.336
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 +1 -1
- package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +33 -12
- package/src/components/xform/form-designer/form-widget/field-widget/import-button-widget.vue +4 -0
- package/src/components/xform/form-designer/form-widget/field-widget/oplog-widget.vue +171 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +7 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/oplog-editor.vue +31 -0
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +2 -0
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +25 -0
- package/src/components/xform/lang/zh-CN.js +1 -0
package/package.json
CHANGED
@@ -540,6 +540,7 @@ tmixins = {
|
|
540
540
|
})
|
541
541
|
},
|
542
542
|
saveImportHandle(data, opt) {
|
543
|
+
var multi = this.option.multi;
|
543
544
|
let importOption = this.option.importOption;
|
544
545
|
|
545
546
|
let entity = importOption.importEntity;
|
@@ -553,16 +554,23 @@ tmixins = {
|
|
553
554
|
|
554
555
|
// let reqData = this.getReqFormData();
|
555
556
|
let fileCellFields = this.fileCellFields;
|
556
|
-
let formData =
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
557
|
+
let formData = null
|
558
|
+
if(multi){
|
559
|
+
formData = data
|
560
|
+
}else{
|
561
|
+
formData = {
|
562
|
+
[entity]: {...data}
|
563
|
+
}
|
564
|
+
if (fileCellFields.length) {
|
565
|
+
fileCellFields.forEach(field => {
|
566
|
+
let attachments = data[field] || [];
|
567
|
+
delete formData[entity][field]
|
568
|
+
formData[field] = attachments;
|
569
|
+
})
|
570
|
+
}
|
565
571
|
}
|
572
|
+
|
573
|
+
|
566
574
|
let reqData = {
|
567
575
|
formCode: formCode,
|
568
576
|
formVersion: reportTemplate.formVersion,
|
@@ -637,7 +645,7 @@ tmixins = {
|
|
637
645
|
doneNumObj.innerText = successNum + failNum;
|
638
646
|
that.percentageNum = percentageStr;
|
639
647
|
let isEnd = false;
|
640
|
-
if (uniqueFields.length) {
|
648
|
+
if (multi && uniqueFields.length) {
|
641
649
|
isEnd = groupIndex + 1 >= groupDatas.length;
|
642
650
|
} else {
|
643
651
|
isEnd = index + excNum >= size;
|
@@ -766,10 +774,23 @@ tmixins = {
|
|
766
774
|
} else {
|
767
775
|
// error_win(resultMsg);
|
768
776
|
// layer.close(opts.dialogObjIndex);
|
769
|
-
|
777
|
+
|
778
|
+
let items = param.map(item=>{
|
779
|
+
return {
|
780
|
+
...item,
|
781
|
+
_resultType: "error",
|
782
|
+
_resultContent: resultMsg.content,
|
783
|
+
}
|
784
|
+
})
|
785
|
+
failNum = failNum + items.length;
|
786
|
+
that.failRows.push(...items);
|
787
|
+
|
788
|
+
that.failRows = that.failRows.sort(compareV('impSeq'));
|
789
|
+
|
790
|
+
/* that.$errorMsg(resultMsg);
|
770
791
|
that.showContent = false;
|
771
792
|
that.clearImportTimer();
|
772
|
-
return;
|
793
|
+
return; */
|
773
794
|
}
|
774
795
|
} else {
|
775
796
|
var data = that.resultData.data[index];
|
package/src/components/xform/form-designer/form-widget/field-widget/import-button-widget.vue
CHANGED
@@ -61,10 +61,14 @@ export default {
|
|
61
61
|
|
62
62
|
methods: {
|
63
63
|
importHandle() {
|
64
|
+
let multi = this.field.options.importMultiple || false;
|
65
|
+
let multiSize = this.field.options.importMultiSize || 1;
|
64
66
|
this.getFormRef().openImportDialog({
|
65
67
|
target: this,
|
66
68
|
importOption: this.field.options,
|
67
69
|
importFrontOnly: false,
|
70
|
+
multi,
|
71
|
+
multiSize,
|
68
72
|
callback: (resultData, file, done) => {
|
69
73
|
|
70
74
|
}
|
@@ -0,0 +1,171 @@
|
|
1
|
+
<template>
|
2
|
+
<static-content-wrapper :designer="designer" :field="field" :design-state="designState"
|
3
|
+
:display-style="field.options.displayStyle"
|
4
|
+
:parent-widget="parentWidget" :parent-list="parentList"
|
5
|
+
:index-of-parent-list="indexOfParentList"
|
6
|
+
:sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex"
|
7
|
+
:sub-form-row-id="subFormRowId">
|
8
|
+
<vxe-grid ref="table-m1" :data="oplogDTOs" v-bind="m1Option" @resizable-change="$vxeTableUtil.onColumnWitchChange" @custom="$vxeTableUtil.customHandle"></vxe-grid>
|
9
|
+
</static-content-wrapper>
|
10
|
+
</template>
|
11
|
+
|
12
|
+
<script>
|
13
|
+
import StaticContentWrapper from './static-content-wrapper'
|
14
|
+
import emitter from '../../../utils/emitter'
|
15
|
+
import i18n from "../../../utils/i18n";
|
16
|
+
import fieldMixin from "./fieldMixin";
|
17
|
+
|
18
|
+
export default {
|
19
|
+
name: "oplog-widget",
|
20
|
+
componentName: 'FieldWidget', //必须固定为FieldWidget,用于接收父级组件的broadcast事件
|
21
|
+
mixins: [emitter, fieldMixin, i18n],
|
22
|
+
props: {
|
23
|
+
field: Object,
|
24
|
+
parentWidget: Object,
|
25
|
+
parentList: Array,
|
26
|
+
indexOfParentList: Number,
|
27
|
+
designer: Object,
|
28
|
+
|
29
|
+
designState: {
|
30
|
+
type: Boolean,
|
31
|
+
default: false
|
32
|
+
},
|
33
|
+
|
34
|
+
subFormRowIndex: { /* 子表单组件行索引,从0开始计数 */
|
35
|
+
type: Number,
|
36
|
+
default: -1
|
37
|
+
},
|
38
|
+
subFormColIndex: { /* 子表单组件列索引,从0开始计数 */
|
39
|
+
type: Number,
|
40
|
+
default: -1
|
41
|
+
},
|
42
|
+
subFormRowId: { /* 子表单组件行Id,唯一id且不可变 */
|
43
|
+
type: String,
|
44
|
+
default: ''
|
45
|
+
},
|
46
|
+
|
47
|
+
},
|
48
|
+
components: {
|
49
|
+
StaticContentWrapper,
|
50
|
+
},
|
51
|
+
computed: {
|
52
|
+
showLabel(){
|
53
|
+
return this.field.options.labelHidden? null: this.label;
|
54
|
+
},
|
55
|
+
label() {
|
56
|
+
return this.field.options.isFormLabel ? this.currentValue : this.getI18nLabel(this.field.options.label);
|
57
|
+
},
|
58
|
+
widgetClass() {
|
59
|
+
let list = [];
|
60
|
+
let optionModel = this.field.options
|
61
|
+
if (optionModel.colorClass) list.push(optionModel.colorClass);
|
62
|
+
if (optionModel.underline) list.push('underLine');
|
63
|
+
if (optionModel.disabled) list.push('is-disabled');
|
64
|
+
return list
|
65
|
+
}
|
66
|
+
},
|
67
|
+
beforeCreate() {
|
68
|
+
/* 这里不能访问方法和属性!! */
|
69
|
+
},
|
70
|
+
data(){
|
71
|
+
return {
|
72
|
+
m1Option:{},
|
73
|
+
oplogDTOs:[]
|
74
|
+
}
|
75
|
+
},
|
76
|
+
|
77
|
+
created() {
|
78
|
+
/* 注意:子组件mounted在父组件created之后、父组件mounted之前触发,故子组件mounted需要用到的prop
|
79
|
+
需要在父组件created中初始化!! */
|
80
|
+
this.registerToRefList()
|
81
|
+
this.initEventHandler()
|
82
|
+
|
83
|
+
this.handleOnCreated()
|
84
|
+
},
|
85
|
+
|
86
|
+
mounted() {
|
87
|
+
this.handleOnMounted()
|
88
|
+
this.initOplogDTOs();
|
89
|
+
},
|
90
|
+
|
91
|
+
beforeDestroy() {
|
92
|
+
this.unregisterFromRefList()
|
93
|
+
},
|
94
|
+
|
95
|
+
methods: {
|
96
|
+
initOplogDTOs() {
|
97
|
+
const tableOption = {
|
98
|
+
vue: this,
|
99
|
+
tableRef: 'table-m1',
|
100
|
+
tableName: 'xform-oplog-oplogList-m1Grid',
|
101
|
+
columns: [{
|
102
|
+
type: 'checkbox',
|
103
|
+
fixed: 'left',
|
104
|
+
width: 48,
|
105
|
+
resizable: false
|
106
|
+
},
|
107
|
+
{
|
108
|
+
title: this.$t2('操作时间', 'components.oplogTable.createDate'),
|
109
|
+
field: 'createDate',
|
110
|
+
width: 150
|
111
|
+
},
|
112
|
+
{
|
113
|
+
title: this.$t2('操作人员', 'components.oplogTable.createBy'),
|
114
|
+
field: '_createBy',
|
115
|
+
width: 150
|
116
|
+
},
|
117
|
+
{
|
118
|
+
title: this.$t2('操作日志', 'components.oplogTable.content'),
|
119
|
+
field: 'content',
|
120
|
+
width: 150
|
121
|
+
},
|
122
|
+
{
|
123
|
+
width: 47,
|
124
|
+
fixed: 'right',
|
125
|
+
title: '',
|
126
|
+
sortable: false
|
127
|
+
}
|
128
|
+
]
|
129
|
+
};
|
130
|
+
this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
|
131
|
+
this.m1Option = opts;
|
132
|
+
});
|
133
|
+
this.initData();
|
134
|
+
},
|
135
|
+
initData(option) {
|
136
|
+
let reportTemplate = this.getFormRef().reportTemplate;
|
137
|
+
let formCode = reportTemplate.formCode;
|
138
|
+
let scriptCode = this.field.options.formScriptCode;
|
139
|
+
let oplogTypeCode = this.field.options.oplogTypeCode || formCode;
|
140
|
+
let oplogBusinessKey = this.field.options.oplogBusinessKey || "id";
|
141
|
+
if (!scriptCode) return;
|
142
|
+
let business_code = this.formModel[oplogBusinessKey];
|
143
|
+
if(!business_code) return;
|
144
|
+
this.formHttp({
|
145
|
+
scriptCode: scriptCode,
|
146
|
+
data: {
|
147
|
+
formCode: formCode,
|
148
|
+
formVersion: reportTemplate.formVersion,
|
149
|
+
data: {
|
150
|
+
log_type: oplogTypeCode,
|
151
|
+
business_code: business_code
|
152
|
+
}
|
153
|
+
},
|
154
|
+
callback: res => {
|
155
|
+
let rows = res.objx || [];
|
156
|
+
this.oplogDTOs = rows;
|
157
|
+
}
|
158
|
+
});
|
159
|
+
},
|
160
|
+
}
|
161
|
+
|
162
|
+
}
|
163
|
+
</script>
|
164
|
+
|
165
|
+
<style lang="scss" scoped>
|
166
|
+
@import "~@/styles/global.scss"; //* static-content-wrapper已引入,还需要重复引入吗? *//
|
167
|
+
a.is-disabled {
|
168
|
+
cursor: not-allowed;
|
169
|
+
}
|
170
|
+
|
171
|
+
</style>
|
@@ -29,6 +29,13 @@
|
|
29
29
|
<el-form-item label="执行后台脚本编码">
|
30
30
|
<el-input v-model="optionModel.importScriptCode"></el-input>
|
31
31
|
</el-form-item>
|
32
|
+
<el-form-item label="批量导入">
|
33
|
+
<el-switch v-model="optionModel.importMultiple"></el-switch>
|
34
|
+
</el-form-item>
|
35
|
+
<el-form-item label="批量导入大小">
|
36
|
+
<base-input-number v-model="optionModel.importMultiSize" :max="200"></base-input-number>
|
37
|
+
</el-form-item>
|
38
|
+
|
32
39
|
<el-form-item label="启用图片处理">
|
33
40
|
<el-switch v-model="optionModel.enabledImportPreHandle"></el-switch>
|
34
41
|
</el-form-item>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<template>
|
2
|
+
<div>
|
3
|
+
<el-form-item :label="i18nt('脚本编码')">
|
4
|
+
<el-input type="text" v-model="optionModel.formScriptCode"></el-input>
|
5
|
+
</el-form-item>
|
6
|
+
<el-form-item :label="i18nt('日志类型')">
|
7
|
+
<el-input type="text" v-model="optionModel.oplogTypeCode" placeholder="默认表单模板编码"></el-input>
|
8
|
+
</el-form-item>
|
9
|
+
<el-form-item :label="i18nt('业务唯一字段')">
|
10
|
+
<el-input type="text" v-model="optionModel.oplogBusinessKey" placeholder="默认单据id"></el-input>
|
11
|
+
</el-form-item>
|
12
|
+
</div>
|
13
|
+
</template>
|
14
|
+
|
15
|
+
<script>
|
16
|
+
import i18n from "../../../utils/i18n"
|
17
|
+
|
18
|
+
export default {
|
19
|
+
name: "oplogFlag-editor",
|
20
|
+
mixins: [i18n],
|
21
|
+
props: {
|
22
|
+
designer: Object,
|
23
|
+
selectedWidget: Object,
|
24
|
+
optionModel: Object,
|
25
|
+
},
|
26
|
+
}
|
27
|
+
</script>
|
28
|
+
|
29
|
+
<style scoped>
|
30
|
+
|
31
|
+
</style>
|
@@ -3043,6 +3043,8 @@ export const advancedFields = [
|
|
3043
3043
|
...defaultWfConfig,
|
3044
3044
|
hiddenByWf: true,
|
3045
3045
|
...defaultWidgetShowRuleConfig,
|
3046
|
+
importMultiple:false,
|
3047
|
+
importMultiSize: 1,
|
3046
3048
|
importFileLimitSize: 200,
|
3047
3049
|
importEntity: "",
|
3048
3050
|
importAttachCode: "",
|
@@ -3679,6 +3681,29 @@ export const businessFields = [
|
|
3679
3681
|
...defaultWidgetShowRuleConfig,
|
3680
3682
|
},
|
3681
3683
|
},
|
3684
|
+
{
|
3685
|
+
type: "oplog",
|
3686
|
+
icon: "uploadbox",
|
3687
|
+
commonFlag: !0,
|
3688
|
+
formItemFlag: !1,
|
3689
|
+
options: {
|
3690
|
+
name: "",
|
3691
|
+
// label: "操作日志",
|
3692
|
+
disabled: !1,
|
3693
|
+
hidden: !1,
|
3694
|
+
|
3695
|
+
oplogFlag:1,
|
3696
|
+
formScriptCode: "listUserLog",
|
3697
|
+
oplogTypeCode:null,
|
3698
|
+
oplogBusinessKey:null,
|
3699
|
+
|
3700
|
+
|
3701
|
+
customClass: "",
|
3702
|
+
onCreated: "",
|
3703
|
+
onMounted: "",
|
3704
|
+
|
3705
|
+
},
|
3706
|
+
},
|
3682
3707
|
];
|
3683
3708
|
|
3684
3709
|
export const keyNamePrefixMap = {
|