cloud-web-corejs 1.0.163 → 1.0.165
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 +2 -1
- package/src/components/vb-tabs/x-tabs.vue +30 -13
- package/src/components/xform/form-designer/designer.js +1 -1
- package/src/components/xform/form-designer/form-widget/components/gantt/index.vue +419 -0
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +1 -1
- package/src/components/xform/form-designer/form-widget/dialog/baseFormulaDialog copy.vue +971 -0
- package/src/components/xform/form-designer/form-widget/dialog/baseFormulaDialog.vue +971 -0
- package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +71 -50
- package/src/components/xform/form-designer/form-widget/dialog/formulaDialog.vue +799 -0
- package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin - /345/211/257/346/234/254.js" +1639 -0
- package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +102 -73
- package/src/components/xform/form-designer/form-widget/field-widget/cascader-widget.vue +19 -1
- package/src/components/xform/form-designer/form-widget/field-widget/census-widget.vue +41 -27
- package/src/components/xform/form-designer/form-widget/field-widget/checkbox-widget.vue +4 -1
- package/src/components/xform/form-designer/form-widget/field-widget/color-widget.vue +4 -1
- package/src/components/xform/form-designer/form-widget/field-widget/date-range-widget.vue +13 -2
- package/src/components/xform/form-designer/form-widget/field-widget/date-widget.vue +9 -2
- package/src/components/xform/form-designer/form-widget/field-widget/download-button-widget.vue +133 -0
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +2 -1
- package/src/components/xform/form-designer/form-widget/field-widget/gantt-widget.vue +962 -0
- package/src/components/xform/form-designer/form-widget/field-widget/input-widget.vue +7 -2
- package/src/components/xform/form-designer/form-widget/field-widget/multiSearch-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/number-widget.vue +7 -0
- package/src/components/xform/form-designer/form-widget/field-widget/oplog-widget.vue +1 -0
- package/src/components/xform/form-designer/form-widget/field-widget/print-button-widget.vue +44 -27
- package/src/components/xform/form-designer/form-widget/field-widget/print-detail-button-widget.vue +19 -11
- package/src/components/xform/form-designer/form-widget/field-widget/project-tag-widget.vue +19 -1
- package/src/components/xform/form-designer/form-widget/field-widget/radio-widget.vue +11 -7
- package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +11 -8
- package/src/components/xform/form-designer/form-widget/field-widget/singerSearch-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/table-export-button-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/vabSearch-widget.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +106 -76
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +13 -263
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +47 -81
- package/src/components/xform/form-designer/setting-panel/property-editor/downloadButtonFlag-editor.vue +32 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onClick-editor.vue +14 -7
- package/src/components/xform/form-designer/setting-panel/property-editor/field-gantt/gantt-editor.vue +36 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-button-editor.vue +37 -16
- package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-detail-button-editor.vue +42 -18
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/field-vabUpload-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +57 -34
- package/src/components/xform/form-designer/setting-panel/property-editor/project-tag-editor.vue +84 -53
- package/src/components/xform/form-designer/setting-panel/property-editor/wfFlag-editor.vue +35 -44
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +2 -0
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +68 -3
- package/src/components/xform/form-render/container-item/containerItemMixin.js +2 -2
- package/src/components/xform/form-render/container-item/data-table-mixin.js +1 -1
- package/src/components/xform/form-render/container-item/tab-item.vue +64 -32
- package/src/components/xform/form-render/index.vue +69 -23
- package/src/components/xform/form-render/indexMixin.js +18 -17
- package/src/components/xform/lang/zh-CN.js +8 -2
- package/src/components/xform/utils/formula-util.js +306 -5
- package/src/components/xform/utils/util.js +1 -1
- package/src/components/xform/utils/vue2js-generator.js +2 -2
- package/src/utils/request.js +1 -1
- package/src/utils/vab.js +1 -1
- package/src/views/bd/setting/config_manage/list.vue +7 -0
- package/src/views/user/area/dialog.vue +223 -116
- package/src/views/user/area/list.vue +318 -0
- package/src/views/user/form/vform/render.vue +54 -36
- package/src/views/user/form/view/list.vue +103 -10
- package/src/views/user/menu/list.vue +24 -1
- package/src/views/user/role/authConfig.vue +89 -0
- package/src/views/user/role/dialog.vue +70 -48
- package/src/views/user/role/edit.vue +114 -4
|
@@ -6,12 +6,24 @@
|
|
|
6
6
|
v-bind="dialogConfig"
|
|
7
7
|
@close="close"
|
|
8
8
|
>
|
|
9
|
-
<div class="cont" style="height:450px" v-bind="bodyConfig">
|
|
10
|
-
<v-form-render
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
<div class="cont" style="height: 450px" v-bind="bodyConfig">
|
|
10
|
+
<v-form-render
|
|
11
|
+
:form-json.sync="formJson"
|
|
12
|
+
:form-data="formData"
|
|
13
|
+
:option-data="optionData"
|
|
14
|
+
ref="vFormRef"
|
|
15
|
+
:reportTemplate.sync="formTemplate"
|
|
16
|
+
:conditionParam.sync="conditionParam"
|
|
17
|
+
:formInsData.sync="formInsData"
|
|
18
|
+
v-if="showRender"
|
|
19
|
+
visible-key="showRender"
|
|
20
|
+
:parent-target="_self"
|
|
21
|
+
@reload="reload"
|
|
22
|
+
:dataTableOption="dataTableOption"
|
|
23
|
+
v-bind="formConfig"
|
|
24
|
+
:param="dialogParam"
|
|
25
|
+
class="data-table_height"
|
|
26
|
+
/>
|
|
15
27
|
</div>
|
|
16
28
|
<label id="labBtn" class="transverse">
|
|
17
29
|
<div class="icon">
|
|
@@ -20,46 +32,54 @@
|
|
|
20
32
|
</div>
|
|
21
33
|
</label>
|
|
22
34
|
<div class="multipleChoice">
|
|
23
|
-
<el-tooltip
|
|
24
|
-
|
|
25
|
-
|
|
35
|
+
<el-tooltip
|
|
36
|
+
:enterable="false"
|
|
37
|
+
effect="dark"
|
|
38
|
+
:content="$t1('全部删除')"
|
|
39
|
+
placement="top"
|
|
40
|
+
><a class="allDel icon-quanbushanchu" @click="clearChecked()"></a>
|
|
26
41
|
</el-tooltip>
|
|
27
42
|
<div class="list">
|
|
28
43
|
<template v-if="showRender">
|
|
29
|
-
<div class="item" v-for="(checkRow, index) in checkRows" :key="'c'+index">
|
|
44
|
+
<div class="item" v-for="(checkRow, index) in checkRows" :key="'c' + index">
|
|
30
45
|
<p>{{ checkRow[showFormField] }}</p>
|
|
31
46
|
<a class="el-icon-close" @click="clearTable1Select(index)"></a>
|
|
32
47
|
</div>
|
|
33
48
|
</template>
|
|
34
49
|
</div>
|
|
35
50
|
</div>
|
|
36
|
-
<span
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
51
|
+
<span
|
|
52
|
+
slot="footer"
|
|
53
|
+
class="dialog-footer"
|
|
54
|
+
v-if="option.showFooter !== false"
|
|
55
|
+
v-bind="option.footerConfig"
|
|
56
|
+
>
|
|
57
|
+
<span class="fl tips" v-if="!selectMulti">{{
|
|
58
|
+
$t1("注:双击确认选择(单选)")
|
|
59
|
+
}}</span>
|
|
60
|
+
<el-button type="primary" plain class="button-sty" @click="close">
|
|
61
|
+
<i class="el-icon-close el-icon"></i>
|
|
62
|
+
{{ $t1("取 消") }}
|
|
63
|
+
</el-button>
|
|
64
|
+
<el-button type="primary" @click="dialogSubmit" class="button-sty">
|
|
65
|
+
<i class="el-icon-check el-icon"></i>
|
|
66
|
+
{{ $t1("确 定") }}
|
|
67
|
+
</el-button>
|
|
68
|
+
</span>
|
|
47
69
|
</el-dialog>
|
|
48
70
|
</template>
|
|
49
71
|
|
|
50
72
|
<script>
|
|
51
|
-
import {selectDialogMixins} from
|
|
73
|
+
import { selectDialogMixins } from "../../../../../mixins/selectDialog/index.js";
|
|
52
74
|
import VFormRender from "../../../../../components/xform/form-render/index.vue";
|
|
53
75
|
|
|
54
76
|
export default {
|
|
55
77
|
// name: "vabSearchDialog",
|
|
56
|
-
components: {VFormRender},
|
|
57
|
-
props: [
|
|
78
|
+
components: { VFormRender },
|
|
79
|
+
props: ["visiable", "multi", "rows", "param", "widget", "option"],
|
|
58
80
|
mixins: [selectDialogMixins],
|
|
59
81
|
inject: ["getFormConfig"],
|
|
60
|
-
mounted() {
|
|
61
|
-
|
|
62
|
-
},
|
|
82
|
+
mounted() {},
|
|
63
83
|
data() {
|
|
64
84
|
var that = this;
|
|
65
85
|
return {
|
|
@@ -93,16 +113,21 @@ export default {
|
|
|
93
113
|
onCellDblclick: (param) => {
|
|
94
114
|
this.checkWithSubmit(param);
|
|
95
115
|
},
|
|
116
|
+
otherConfig: {
|
|
117
|
+
onFilter: () => {
|
|
118
|
+
this.checkRows = [];
|
|
119
|
+
},
|
|
120
|
+
},
|
|
96
121
|
config: {
|
|
97
122
|
checkboxConfig: {
|
|
98
123
|
checkStrictly: true,
|
|
99
124
|
showHeader: true,
|
|
100
|
-
trigger:
|
|
101
|
-
}
|
|
102
|
-
}
|
|
125
|
+
trigger: "row",
|
|
126
|
+
},
|
|
127
|
+
},
|
|
103
128
|
},
|
|
104
129
|
$grid: null,
|
|
105
|
-
currentLayoutType: null
|
|
130
|
+
currentLayoutType: null,
|
|
106
131
|
};
|
|
107
132
|
},
|
|
108
133
|
computed: {
|
|
@@ -118,7 +143,7 @@ export default {
|
|
|
118
143
|
dialogConfig() {
|
|
119
144
|
let customClass = "dialog-style list-dialog dialog-checkbox pd_0";
|
|
120
145
|
if (this.option.dialogConfig?.customClass) {
|
|
121
|
-
customClass = customClass + " " + this.option.dialogConfig.customClass
|
|
146
|
+
customClass = customClass + " " + this.option.dialogConfig.customClass;
|
|
122
147
|
}
|
|
123
148
|
let config = {
|
|
124
149
|
title: this.formTemplate.formName,
|
|
@@ -129,41 +154,41 @@ export default {
|
|
|
129
154
|
width: "1200px",
|
|
130
155
|
fullscreen: this.option.fullscreen,
|
|
131
156
|
};
|
|
132
|
-
config = Object.assign({}, config, this.option.dialogConfig, {customClass});
|
|
157
|
+
config = Object.assign({}, config, this.option.dialogConfig, { customClass });
|
|
133
158
|
config.title = this.$t1(config.title);
|
|
134
159
|
return config;
|
|
135
160
|
},
|
|
136
161
|
bodyConfig() {
|
|
137
162
|
let config = {};
|
|
138
|
-
let classStr = this.currentLayoutType
|
|
163
|
+
let classStr = this.currentLayoutType;
|
|
139
164
|
if (this.option.bodyConfig?.class) {
|
|
140
165
|
classStr = classStr + " " + this.option.bodyConfig.class;
|
|
141
166
|
}
|
|
142
167
|
if (this.option.showFooter == false) {
|
|
143
168
|
classStr = classStr + " nfootBtn";
|
|
144
169
|
}
|
|
145
|
-
config = Object.assign({}, config, this.option.bodyConfig, {class: classStr});
|
|
170
|
+
config = Object.assign({}, config, this.option.bodyConfig, { class: classStr });
|
|
146
171
|
return config;
|
|
147
|
-
}
|
|
172
|
+
},
|
|
148
173
|
},
|
|
149
174
|
created() {
|
|
150
175
|
let currentFormConfig = this.getFormConfig();
|
|
151
|
-
this.currentLayoutType = currentFormConfig.layoutType
|
|
176
|
+
this.currentLayoutType = currentFormConfig.layoutType;
|
|
152
177
|
this.initSetting();
|
|
153
178
|
|
|
154
179
|
if (this.option.rows?.length) {
|
|
155
|
-
this.checkRows.push(...this.$baseLodash.cloneDeep(this.option.rows))
|
|
180
|
+
this.checkRows.push(...this.$baseLodash.cloneDeep(this.option.rows));
|
|
156
181
|
}
|
|
157
182
|
|
|
158
183
|
this.selectMulti = this.option.multiple ?? true;
|
|
159
184
|
this.dataTableOption.config.checkboxConfig.showHeader = this.selectMulti;
|
|
160
|
-
if(this.option.queryParam){
|
|
185
|
+
if (this.option.queryParam) {
|
|
161
186
|
this.dataTableOption.queryParam = this.option.queryParam;
|
|
162
187
|
}
|
|
163
188
|
this.getReportTemplate();
|
|
164
189
|
},
|
|
165
190
|
methods: {
|
|
166
|
-
reload(){
|
|
191
|
+
reload() {
|
|
167
192
|
this.showRender = false;
|
|
168
193
|
this.getReportTemplate();
|
|
169
194
|
},
|
|
@@ -171,12 +196,12 @@ export default {
|
|
|
171
196
|
let param = {
|
|
172
197
|
objTypeCode: this.$attrs.objTypeCode,
|
|
173
198
|
objId: this.$attrs.objId,
|
|
174
|
-
taskId: this.$attrs.taskId
|
|
199
|
+
taskId: this.$attrs.taskId,
|
|
175
200
|
};
|
|
176
201
|
this.conditionParam = param;
|
|
177
202
|
let url, data;
|
|
178
203
|
url = USER_PREFIX + `/formTemplate/getByFormCode`;
|
|
179
|
-
data = {stringOne: this.formCode}
|
|
204
|
+
data = { stringOne: this.formCode };
|
|
180
205
|
|
|
181
206
|
let that = this;
|
|
182
207
|
this.$http({
|
|
@@ -186,11 +211,13 @@ export default {
|
|
|
186
211
|
isLoading: true,
|
|
187
212
|
loadingTarget: document.body,
|
|
188
213
|
modalStrictly: true,
|
|
189
|
-
success: res => {
|
|
214
|
+
success: (res) => {
|
|
190
215
|
let formTemplate = res.objx || {};
|
|
191
216
|
this.formTemplate = formTemplate;
|
|
192
|
-
this.formJson = formTemplate.formViewContent
|
|
193
|
-
|
|
217
|
+
this.formJson = formTemplate.formViewContent
|
|
218
|
+
? JSON.parse(formTemplate.formViewContent)
|
|
219
|
+
: {};
|
|
220
|
+
this.layoutType = this.formJson.formConfig.layoutType;
|
|
194
221
|
let formConfig = this.formJson.formConfig;
|
|
195
222
|
if (formConfig.searchDialogUniqueField) {
|
|
196
223
|
this.fieldKey = formConfig.searchDialogUniqueField;
|
|
@@ -203,27 +230,27 @@ export default {
|
|
|
203
230
|
})*/
|
|
204
231
|
this.initShowFormField();
|
|
205
232
|
this.showRender = true;
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
233
|
+
},
|
|
209
234
|
});
|
|
210
235
|
},
|
|
211
|
-
getGrid(){
|
|
212
|
-
if(!this.$grid){
|
|
236
|
+
getGrid() {
|
|
237
|
+
if (!this.$grid) {
|
|
213
238
|
let widgetList = this.formJson.widgetList;
|
|
214
|
-
this.$grid = this.$refs.vFormRef
|
|
239
|
+
this.$grid = this.$refs.vFormRef
|
|
240
|
+
.getWidgetRef(widgetList[0].options.name)
|
|
241
|
+
.getGridTable();
|
|
215
242
|
}
|
|
216
243
|
return this.$grid;
|
|
217
244
|
},
|
|
218
245
|
initShowFormField() {
|
|
219
246
|
let showFormField = this.formJson.formConfig.searchDialogNameField || null;
|
|
220
247
|
if (!showFormField) {
|
|
221
|
-
let widgetList = this.formJson.widgetList
|
|
248
|
+
let widgetList = this.formJson.widgetList;
|
|
222
249
|
let tableColumns = widgetList[0].options.tableColumns;
|
|
223
|
-
let column = tableColumns.find(column => !!column.prop);
|
|
250
|
+
let column = tableColumns.find((column) => !!column.prop);
|
|
224
251
|
this.showFormField = column.prop;
|
|
225
|
-
}else{
|
|
226
|
-
this.showFormField = showFormField
|
|
252
|
+
} else {
|
|
253
|
+
this.showFormField = showFormField;
|
|
227
254
|
}
|
|
228
255
|
},
|
|
229
256
|
async getFormInsData() {
|
|
@@ -236,17 +263,17 @@ export default {
|
|
|
236
263
|
method: `post`,
|
|
237
264
|
data: {
|
|
238
265
|
insUuid: insUuid,
|
|
239
|
-
tableAlias: this.formCode
|
|
266
|
+
tableAlias: this.formCode,
|
|
240
267
|
},
|
|
241
268
|
isLoading: true,
|
|
242
269
|
loadingTarget: document.body,
|
|
243
270
|
modalStrictly: true,
|
|
244
|
-
success: res => {
|
|
271
|
+
success: (res) => {
|
|
245
272
|
let formData = res.objx && res.objx.data ? res.objx.data : {};
|
|
246
273
|
this.formData = formData;
|
|
247
274
|
this.formInsData = res.objx;
|
|
248
275
|
// this.formInsData = formData;
|
|
249
|
-
}
|
|
276
|
+
},
|
|
250
277
|
});
|
|
251
278
|
},
|
|
252
279
|
changeH5Checkbox(obj) {
|
|
@@ -257,7 +284,7 @@ export default {
|
|
|
257
284
|
if (selectMulti) {
|
|
258
285
|
let rows = this.checkRows;
|
|
259
286
|
if (obj.checked) {
|
|
260
|
-
let flag = rows.some(item => {
|
|
287
|
+
let flag = rows.some((item) => {
|
|
261
288
|
return row[fieldKey] == item[fieldKey];
|
|
262
289
|
});
|
|
263
290
|
if (!flag) {
|
|
@@ -288,7 +315,7 @@ export default {
|
|
|
288
315
|
if (selectMulti) {
|
|
289
316
|
let rows = this.checkRows;
|
|
290
317
|
if (obj.checked) {
|
|
291
|
-
let flag = rows.some(item => {
|
|
318
|
+
let flag = rows.some((item) => {
|
|
292
319
|
return row[fieldKey] == item[fieldKey];
|
|
293
320
|
});
|
|
294
321
|
if (!flag) {
|
|
@@ -313,8 +340,9 @@ export default {
|
|
|
313
340
|
}
|
|
314
341
|
|
|
315
342
|
if (obj.checked) {
|
|
316
|
-
let ay = $table1.getTableData().fullData;
|
|
317
|
-
let aRows = this.findAllRows(ay);
|
|
343
|
+
// let ay = $table1.getTableData().fullData;
|
|
344
|
+
// let aRows = this.findAllRows(ay);
|
|
345
|
+
let aRows = $table1.getTableData().visibleData;
|
|
318
346
|
let cRows = $table1.getCheckboxRecords();
|
|
319
347
|
if (aRows.length == cRows.length) {
|
|
320
348
|
$table1.setAllCheckboxRow(true);
|
|
@@ -335,7 +363,8 @@ export default {
|
|
|
335
363
|
var rowid = row[fieldKey];
|
|
336
364
|
let $grid1 = this.getGrid();
|
|
337
365
|
|
|
338
|
-
let rows = $grid1.getTableData().fullData;
|
|
366
|
+
// let rows = $grid1.getTableData().fullData;
|
|
367
|
+
let rows = $grid1.getTableData().visibleData;
|
|
339
368
|
let row2 = this.findTreeRowById(rows, rowid);
|
|
340
369
|
if (selectMulti) {
|
|
341
370
|
if (row2) $grid1.setCheckboxRow(row2, false);
|
|
@@ -350,10 +379,12 @@ export default {
|
|
|
350
379
|
if (this.currentLayoutType !== "H5") {
|
|
351
380
|
let fieldKey = this.fieldKey;
|
|
352
381
|
var $grid = res.$grid;
|
|
353
|
-
let tableData = $grid.getTableData().fullData;
|
|
354
|
-
let allRows = this.findAllRows(tableData);
|
|
382
|
+
// let tableData = $grid.getTableData().fullData;
|
|
383
|
+
// let allRows = this.findAllRows(tableData);
|
|
384
|
+
let tableData = $grid.getTableData().visibleData;
|
|
385
|
+
let allRows = $grid.getTableData().visibleData;
|
|
355
386
|
$grid.setCheckboxRow(allRows, res.checked);
|
|
356
|
-
allRows.forEach(lineData => {
|
|
387
|
+
allRows.forEach((lineData) => {
|
|
357
388
|
let rowid = lineData[fieldKey];
|
|
358
389
|
let tableData2 = this.checkRows;
|
|
359
390
|
let row2;
|
|
@@ -380,7 +411,7 @@ export default {
|
|
|
380
411
|
if (delIndex != null) checkRows.splice(delIndex, 1);
|
|
381
412
|
}
|
|
382
413
|
}
|
|
383
|
-
})
|
|
414
|
+
});
|
|
384
415
|
}
|
|
385
416
|
},
|
|
386
417
|
clearChecked() {
|
|
@@ -402,7 +433,7 @@ export default {
|
|
|
402
433
|
close() {
|
|
403
434
|
let formRef = this.$refs.vFormRef;
|
|
404
435
|
this.showDialog = false;
|
|
405
|
-
this.$emit(
|
|
436
|
+
this.$emit("update:visiable", false);
|
|
406
437
|
this.option.close && this.option.close(formRef, this);
|
|
407
438
|
},
|
|
408
439
|
dialogSubmit() {
|
|
@@ -414,11 +445,9 @@ export default {
|
|
|
414
445
|
} else {
|
|
415
446
|
this.close();
|
|
416
447
|
}
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
}
|
|
421
|
-
}
|
|
448
|
+
},
|
|
449
|
+
},
|
|
450
|
+
};
|
|
422
451
|
</script>
|
|
423
452
|
|
|
424
453
|
<style scoped>
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
<form-item-wrapper :designer="designer" :field="field" :rules="rules" :design-state="designState"
|
|
3
3
|
:parent-widget="parentWidget" :parent-list="parentList" :index-of-parent-list="indexOfParentList"
|
|
4
4
|
:sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex" :sub-form-row-id="subFormRowId">
|
|
5
|
-
<el-cascader ref="fieldEditor" :options="field.options.optionItems"
|
|
5
|
+
<el-cascader ref="fieldEditor" :options="field.options.optionItems"
|
|
6
|
+
v-model="fieldModel" class="full-width-input"
|
|
7
|
+
v-show="!isReadMode"
|
|
6
8
|
:disabled="field.options.disabled"
|
|
7
9
|
:size="field.options.size"
|
|
8
10
|
:clearable="field.options.clearable"
|
|
@@ -13,6 +15,9 @@
|
|
|
13
15
|
@focus="handleFocusCustomEvent" @blur="handleBlurCustomEvent"
|
|
14
16
|
@change="handleChangeEvent">
|
|
15
17
|
</el-cascader>
|
|
18
|
+
<template v-if="isReadMode">
|
|
19
|
+
<span class="readonly-mode-field">{{contentForReadMode}}</span>
|
|
20
|
+
</template>
|
|
16
21
|
</form-item-wrapper>
|
|
17
22
|
</template>
|
|
18
23
|
|
|
@@ -101,6 +106,19 @@
|
|
|
101
106
|
})
|
|
102
107
|
}, 100)
|
|
103
108
|
},
|
|
109
|
+
contentForReadMode() {
|
|
110
|
+
if (!!this.field.options.multiple) {
|
|
111
|
+
//console.log('test======', this.$refs.fieldEditor.presentTags)
|
|
112
|
+
const curTags = this.$refs.fieldEditor.presentTags
|
|
113
|
+
if (!curTags || (curTags.length <= 0)) {
|
|
114
|
+
return '--'
|
|
115
|
+
} else {
|
|
116
|
+
return curTags.map(tagItem => tagItem.text).join(', ')
|
|
117
|
+
}
|
|
118
|
+
} else {
|
|
119
|
+
return this.$refs.fieldEditor.presentText || '--'
|
|
120
|
+
}
|
|
121
|
+
},
|
|
104
122
|
|
|
105
123
|
}
|
|
106
124
|
}
|
|
@@ -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>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<form-item-wrapper :designer="designer" :field="field" :rules="rules" :design-state="designState"
|
|
3
3
|
:parent-widget="parentWidget" :parent-list="parentList" :index-of-parent-list="indexOfParentList"
|
|
4
4
|
:sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex" :sub-form-row-id="subFormRowId">
|
|
5
|
-
<el-checkbox-group ref="fieldEditor" v-model="fieldModel"
|
|
5
|
+
<el-checkbox-group ref="fieldEditor" v-model="fieldModel" v-show="!isReadMode"
|
|
6
6
|
:disabled="field.options.disabled" :size="field.options.size"
|
|
7
7
|
@change="handleChangeEvent">
|
|
8
8
|
<template v-if="!!field.options.buttonStyle">
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
:style="{display: field.options.displayStyle}">{{ getI18nLabel(item[labelField]) }}</el-checkbox>
|
|
17
17
|
</template>
|
|
18
18
|
</el-checkbox-group>
|
|
19
|
+
<template v-if="isReadMode">
|
|
20
|
+
<span class="readonly-mode-field">{{optionLabel}}</span>
|
|
21
|
+
</template>
|
|
19
22
|
</form-item-wrapper>
|
|
20
23
|
</template>
|
|
21
24
|
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
<form-item-wrapper :designer="designer" :field="field" :rules="rules" :design-state="designState"
|
|
3
3
|
:parent-widget="parentWidget" :parent-list="parentList" :index-of-parent-list="indexOfParentList"
|
|
4
4
|
:sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex" :sub-form-row-id="subFormRowId">
|
|
5
|
-
<el-color-picker ref="fieldEditor" v-model="fieldModel"
|
|
5
|
+
<el-color-picker ref="fieldEditor" v-model="fieldModel" v-show="!isReadMode"
|
|
6
6
|
:size="field.options.size"
|
|
7
7
|
:disabled="field.options.disabled"
|
|
8
8
|
@change="handleChangeEvent">
|
|
9
9
|
</el-color-picker>
|
|
10
|
+
<template v-if="isReadMode">
|
|
11
|
+
<span class="readonly-mode-field">{{fieldModel}}</span>
|
|
12
|
+
</template>
|
|
10
13
|
</form-item-wrapper>
|
|
11
14
|
</template>
|
|
12
15
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
:parent-widget="parentWidget" :parent-list="parentList" :index-of-parent-list="indexOfParentList"
|
|
4
4
|
:sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex"
|
|
5
5
|
:sub-form-row-id="subFormRowId">
|
|
6
|
-
<el-date-picker ref="fieldEditor" :type="field.options.type" v-model="fieldModel" class="full-width-input"
|
|
6
|
+
<el-date-picker ref="fieldEditor" :type="field.options.type" v-model="fieldModel" v-show="!isReadMode" class="full-width-input"
|
|
7
7
|
:disabled="field.options.disabled" :readonly="field.options.readonly"
|
|
8
8
|
:size="field.options.size"
|
|
9
9
|
:clearable="field.options.clearable" :editable="field.options.editable"
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
@focus="handleFocusCustomEvent" @blur="handleBlurCustomEvent"
|
|
15
15
|
@change="handleChangeEvent">
|
|
16
16
|
</el-date-picker>
|
|
17
|
+
<template v-if="isReadMode">
|
|
18
|
+
<span class="readonly-mode-field">{{contentForReadMode}}</span>
|
|
19
|
+
</template>
|
|
17
20
|
</form-item-wrapper>
|
|
18
21
|
</template>
|
|
19
22
|
|
|
@@ -64,7 +67,15 @@ export default {
|
|
|
64
67
|
rules: [],
|
|
65
68
|
}
|
|
66
69
|
},
|
|
67
|
-
computed: {
|
|
70
|
+
computed: {
|
|
71
|
+
contentForReadMode() {
|
|
72
|
+
if (!this.fieldModel) {
|
|
73
|
+
return ''
|
|
74
|
+
} else {
|
|
75
|
+
return this.fieldModel[0] + ' - ' + this.fieldModel[1]
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
},
|
|
68
79
|
beforeCreate() {
|
|
69
80
|
/* 这里不能访问方法和属性!! */
|
|
70
81
|
},
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
:parent-widget="parentWidget" :parent-list="parentList" :index-of-parent-list="indexOfParentList"
|
|
4
4
|
:sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex"
|
|
5
5
|
:sub-form-row-id="subFormRowId">
|
|
6
|
-
<el-date-picker ref="fieldEditor" :type="field.options.type" v-model="fieldModel" class="full-width-input"
|
|
6
|
+
<el-date-picker ref="fieldEditor" :type="field.options.type" v-model="fieldModel" v-show="!isReadMode" class="full-width-input"
|
|
7
7
|
:readonly="field.options.readonly" :disabled="field.options.disabled"
|
|
8
8
|
:size="field.options.size"
|
|
9
9
|
:clearable="field.options.clearable" :editable="field.options.editable"
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
:picker-options="pickerOptions"
|
|
15
15
|
>
|
|
16
16
|
</el-date-picker>
|
|
17
|
+
<template v-if="isReadMode">
|
|
18
|
+
<span class="readonly-mode-field">{{contentForReadMode}}</span>
|
|
19
|
+
</template>
|
|
17
20
|
</form-item-wrapper>
|
|
18
21
|
</template>
|
|
19
22
|
|
|
@@ -65,7 +68,11 @@ export default {
|
|
|
65
68
|
pickerOptions: {}
|
|
66
69
|
}
|
|
67
70
|
},
|
|
68
|
-
computed: {
|
|
71
|
+
computed: {
|
|
72
|
+
contentForReadMode() {
|
|
73
|
+
return this.fieldModel ? this.fieldModel : ''
|
|
74
|
+
},
|
|
75
|
+
},
|
|
69
76
|
beforeCreate() {
|
|
70
77
|
/* 这里不能访问方法和属性!! */
|
|
71
78
|
},
|