cloud-web-corejs 1.0.54-dev.470 → 1.0.54-dev.471
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/field-widget/census-widget.vue +41 -27
- package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onClick-editor.vue +14 -7
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +1 -0
package/package.json
CHANGED
|
@@ -17,8 +17,13 @@
|
|
|
17
17
|
<b>19850</b>
|
|
18
18
|
</div>
|
|
19
19
|
</div> -->
|
|
20
|
-
<div
|
|
21
|
-
|
|
20
|
+
<div
|
|
21
|
+
class="form-count-item"
|
|
22
|
+
v-for="(item, idx) in field.options.censusItems"
|
|
23
|
+
:key="idx"
|
|
24
|
+
:style="{ marginLeft: field.options.space + 'px' }"
|
|
25
|
+
@click="handleClick(item, idx, $event)"
|
|
26
|
+
>
|
|
22
27
|
<div class="t1">
|
|
23
28
|
<p>{{ item.txt }}</p>
|
|
24
29
|
<b>{{ getRealData(item) }}</b>
|
|
@@ -35,14 +40,14 @@
|
|
|
35
40
|
</template>
|
|
36
41
|
|
|
37
42
|
<script>
|
|
38
|
-
import StaticContentWrapper from
|
|
39
|
-
import emitter from
|
|
40
|
-
import i18n from
|
|
41
|
-
import fieldMixin from
|
|
43
|
+
import StaticContentWrapper from "./static-content-wrapper";
|
|
44
|
+
import emitter from "../../../../../components/xform/utils/emitter";
|
|
45
|
+
import i18n from "../../../../../components/xform/utils/i18n";
|
|
46
|
+
import fieldMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin";
|
|
42
47
|
|
|
43
48
|
export default {
|
|
44
|
-
name:
|
|
45
|
-
componentName:
|
|
49
|
+
name: "census-widget",
|
|
50
|
+
componentName: "FieldWidget", //必须固定为FieldWidget,用于接收父级组件的broadcast事件
|
|
46
51
|
mixins: [emitter, fieldMixin, i18n],
|
|
47
52
|
props: {
|
|
48
53
|
field: Object,
|
|
@@ -53,27 +58,27 @@ export default {
|
|
|
53
58
|
|
|
54
59
|
designState: {
|
|
55
60
|
type: Boolean,
|
|
56
|
-
default: false
|
|
61
|
+
default: false,
|
|
57
62
|
},
|
|
58
63
|
|
|
59
64
|
subFormRowIndex: {
|
|
60
65
|
/* 子表单组件行索引,从0开始计数 */
|
|
61
66
|
type: Number,
|
|
62
|
-
default: -1
|
|
67
|
+
default: -1,
|
|
63
68
|
},
|
|
64
69
|
subFormColIndex: {
|
|
65
70
|
/* 子表单组件列索引,从0开始计数 */
|
|
66
71
|
type: Number,
|
|
67
|
-
default: -1
|
|
72
|
+
default: -1,
|
|
68
73
|
},
|
|
69
74
|
subFormRowId: {
|
|
70
75
|
/* 子表单组件行Id,唯一id且不可变 */
|
|
71
76
|
type: String,
|
|
72
|
-
default:
|
|
73
|
-
}
|
|
77
|
+
default: "",
|
|
78
|
+
},
|
|
74
79
|
},
|
|
75
80
|
components: {
|
|
76
|
-
StaticContentWrapper
|
|
81
|
+
StaticContentWrapper,
|
|
77
82
|
},
|
|
78
83
|
data() {
|
|
79
84
|
return {
|
|
@@ -122,20 +127,20 @@ export default {
|
|
|
122
127
|
return;
|
|
123
128
|
}
|
|
124
129
|
let formScriptEnabled = this.field.options.formScriptEnabled || false;
|
|
125
|
-
let scriptCode = this.field.options.formScriptCode
|
|
130
|
+
let scriptCode = this.field.options.formScriptCode;
|
|
126
131
|
if (!scriptCode) return;
|
|
127
|
-
if (!formScriptEnabled) return
|
|
132
|
+
if (!formScriptEnabled) return;
|
|
128
133
|
this.loadDataDefaultHandle();
|
|
129
134
|
},
|
|
130
135
|
loadDataDefaultHandle() {
|
|
131
136
|
let formScriptEnabled = this.field.options.formScriptEnabled || false;
|
|
132
|
-
let scriptCode = this.field.options.formScriptCode
|
|
137
|
+
let scriptCode = this.field.options.formScriptCode;
|
|
133
138
|
if (!scriptCode) return;
|
|
134
|
-
if (!formScriptEnabled) return
|
|
139
|
+
if (!formScriptEnabled) return;
|
|
135
140
|
|
|
136
141
|
let reportTemplate = this.getFormRef().reportTemplate;
|
|
137
142
|
let formCode = reportTemplate.formCode;
|
|
138
|
-
let accessParam = this.handleCustomEvent(this.field.options.formScriptParam)
|
|
143
|
+
let accessParam = this.handleCustomEvent(this.field.options.formScriptParam);
|
|
139
144
|
return this.formHttp({
|
|
140
145
|
scriptCode: scriptCode,
|
|
141
146
|
data: {
|
|
@@ -143,20 +148,29 @@ export default {
|
|
|
143
148
|
formVersion: reportTemplate.formVersion,
|
|
144
149
|
taBm: this.fieldKeyName,
|
|
145
150
|
data: {
|
|
146
|
-
...accessParam
|
|
147
|
-
}
|
|
151
|
+
...accessParam,
|
|
152
|
+
},
|
|
148
153
|
},
|
|
149
|
-
callback: res => {
|
|
154
|
+
callback: (res) => {
|
|
150
155
|
let data = res.objx || {};
|
|
151
|
-
this.fieldModel = data
|
|
152
|
-
}
|
|
156
|
+
this.fieldModel = data;
|
|
157
|
+
},
|
|
153
158
|
});
|
|
154
|
-
|
|
155
159
|
},
|
|
156
|
-
|
|
160
|
+
handleClick(row, rowIndex, event) {
|
|
161
|
+
this.handleCustomEvent(
|
|
162
|
+
this.field.options.onClick,
|
|
163
|
+
["event", "param"],
|
|
164
|
+
[event, { row, rowIndex }]
|
|
165
|
+
);
|
|
166
|
+
},
|
|
167
|
+
},
|
|
157
168
|
};
|
|
158
169
|
</script>
|
|
159
170
|
|
|
160
171
|
<style lang="scss" scoped>
|
|
161
|
-
@import
|
|
172
|
+
@import "~@/styles/global.scss"; //* static-content-wrapper已引入,还需要重复引入吗? *//
|
|
173
|
+
.form-count-item {
|
|
174
|
+
cursor: pointer;
|
|
175
|
+
}
|
|
162
176
|
</style>
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<el-form-item label="onClick" label-width="150px">
|
|
3
|
-
<a
|
|
3
|
+
<a
|
|
4
|
+
href="javascript:void(0);"
|
|
5
|
+
class="a-link link-oneLind"
|
|
6
|
+
@click="editEventHandler('onClick', eventParams)"
|
|
7
|
+
>
|
|
4
8
|
<span>{{ optionModel.onClick }}</span>
|
|
5
9
|
<i class="el-icon-edit"></i>
|
|
6
10
|
</a>
|
|
@@ -24,15 +28,18 @@ export default {
|
|
|
24
28
|
// eventParams: ["id", "formCode"],
|
|
25
29
|
};
|
|
26
30
|
},
|
|
27
|
-
computed:{
|
|
28
|
-
eventParams(){
|
|
29
|
-
let eventParams = ["dataId", "formCode","event"];
|
|
31
|
+
computed: {
|
|
32
|
+
eventParams() {
|
|
33
|
+
let eventParams = ["dataId", "formCode", "event"];
|
|
30
34
|
if (this.optionModel.rowFlag) {
|
|
31
|
-
eventParams.push("row", "index","event");
|
|
35
|
+
eventParams.push("row", "index", "event");
|
|
36
|
+
}
|
|
37
|
+
if (this.selectedWidget.type == "census") {
|
|
38
|
+
eventParams.push("param");
|
|
32
39
|
}
|
|
33
40
|
return eventParams;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
41
|
+
},
|
|
42
|
+
},
|
|
36
43
|
};
|
|
37
44
|
</script>
|
|
38
45
|
|