cloud-web-corejs 1.0.54-dev.439 → 1.0.54-dev.440
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
|
@@ -2460,6 +2460,52 @@ modules = {
|
|
|
2460
2460
|
}
|
|
2461
2461
|
return realFormData;
|
|
2462
2462
|
},
|
|
2463
|
+
closeDetailPage(){
|
|
2464
|
+
//关闭详情页
|
|
2465
|
+
let listPageRef = this.getListPageRef();
|
|
2466
|
+
if(listPageRef){
|
|
2467
|
+
listPageRef.dataId = 0;
|
|
2468
|
+
listPageRef.showEdit = false;
|
|
2469
|
+
}
|
|
2470
|
+
},
|
|
2471
|
+
getListPageRef() {
|
|
2472
|
+
//获取列表页面对象
|
|
2473
|
+
let target1 = this.$attrs["parent-target"];
|
|
2474
|
+
let parentTarget = target1?.$attrs["parent-target"];
|
|
2475
|
+
return parentTarget;
|
|
2476
|
+
},
|
|
2477
|
+
getListTabFormRef() {
|
|
2478
|
+
//获取列表tab的表单对象
|
|
2479
|
+
let parentTarget = this.getListPageRef();
|
|
2480
|
+
let listTabFormRef = parentTarget?.$refs?.list?.$refs?.vFormRef ?? null;
|
|
2481
|
+
return listTabFormRef;
|
|
2482
|
+
},
|
|
2483
|
+
getFirstWidgetRef(){
|
|
2484
|
+
//获取表单的第一个组件
|
|
2485
|
+
let target = null;
|
|
2486
|
+
if(this.formJsonObj.widgetList && this.formJsonObj.widgetList.length > 0){
|
|
2487
|
+
target = this.getWidgetRef(this.formJsonObj.widgetList[0].options.name);
|
|
2488
|
+
}
|
|
2489
|
+
return target
|
|
2490
|
+
},
|
|
2491
|
+
switchToListTab(option){
|
|
2492
|
+
//切换到列表页的tab
|
|
2493
|
+
let handleType = option?.handleType;
|
|
2494
|
+
let listPageRef = this.getListPageRef();
|
|
2495
|
+
if(listPageRef){
|
|
2496
|
+
listPageRef.activeName = "second";
|
|
2497
|
+
}
|
|
2498
|
+
if(handleType){
|
|
2499
|
+
let listTabFormRef = this.getListTabFormRef();
|
|
2500
|
+
if(handleType == "reload"){
|
|
2501
|
+
listTabFormRef.reloadForm();
|
|
2502
|
+
}else if(handleType == "searchEvent"){
|
|
2503
|
+
listTabFormRef.getFirstWidgetRef().searchEvent();
|
|
2504
|
+
}else if(handleType == "resethEvent"){
|
|
2505
|
+
listTabFormRef.getFirstWidgetRef().resethEvent();
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
},
|
|
2463
2509
|
reloadForm(option) {
|
|
2464
2510
|
let target1 = this.$attrs["parent-target"];
|
|
2465
2511
|
let target2 = target1?.$attrs["parent-target"];
|
|
@@ -1,30 +1,46 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<div
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
<div
|
|
4
|
+
class="designer-view"
|
|
5
|
+
:class="[
|
|
6
|
+
layoutType === 'H5' ? 'h5-layout' : layoutType === 'Pad' ? 'pad-layout' : '',
|
|
7
|
+
]"
|
|
8
|
+
>
|
|
9
|
+
<v-form-render
|
|
10
|
+
:form-json.sync="formJson"
|
|
11
|
+
:form-data="formData"
|
|
12
|
+
:option-data="optionData"
|
|
13
|
+
ref="vFormRef"
|
|
14
|
+
:reportTemplate.sync="formTemplate"
|
|
15
|
+
:conditionParam.sync="conditionParam"
|
|
16
|
+
:formInsData.sync="formInsData"
|
|
17
|
+
v-if="showRender"
|
|
18
|
+
visible-key="showRender"
|
|
19
|
+
:visiable.sync="showRender"
|
|
20
|
+
:parent-target="_self"
|
|
21
|
+
@reload="$baseReload()"
|
|
22
|
+
:dataId.sync="dataId"
|
|
23
|
+
:param="param"
|
|
24
|
+
v-bind="$attrs"
|
|
25
|
+
@openCopyEditTab="openCopyEditTab"
|
|
26
|
+
/>
|
|
9
27
|
</div>
|
|
10
28
|
</div>
|
|
11
|
-
|
|
12
29
|
</template>
|
|
13
30
|
<script>
|
|
14
|
-
import {loadExtension} from
|
|
31
|
+
import { loadExtension } from "@base/components/xform/extension/extension-loader";
|
|
15
32
|
|
|
16
|
-
loadExtension()
|
|
17
|
-
import VFormRender from
|
|
33
|
+
loadExtension();
|
|
34
|
+
import VFormRender from "@base/components/xform/form-render/index.vue";
|
|
18
35
|
import scriptHttpMixin from "@base/components/xform/mixins/scriptHttp";
|
|
19
36
|
|
|
20
|
-
|
|
21
37
|
export default {
|
|
22
|
-
name:
|
|
38
|
+
name: "vform_render",
|
|
23
39
|
mixins: [scriptHttpMixin],
|
|
24
40
|
components: {
|
|
25
|
-
VFormRender
|
|
41
|
+
VFormRender,
|
|
26
42
|
},
|
|
27
|
-
props: [
|
|
43
|
+
props: ["object_foreign_id", "dataId", "param"],
|
|
28
44
|
data() {
|
|
29
45
|
return {
|
|
30
46
|
formJson: {},
|
|
@@ -35,7 +51,7 @@ export default {
|
|
|
35
51
|
formCode: null,
|
|
36
52
|
layoutType: null,
|
|
37
53
|
conditionParam: null,
|
|
38
|
-
formInsData: null
|
|
54
|
+
formInsData: null,
|
|
39
55
|
};
|
|
40
56
|
},
|
|
41
57
|
created() {
|
|
@@ -47,7 +63,7 @@ export default {
|
|
|
47
63
|
let code = this.$attrs.formCode;
|
|
48
64
|
if (!code) {
|
|
49
65
|
var hash = window.location.hash;
|
|
50
|
-
let str =
|
|
66
|
+
let str = "#/report/xform/render/";
|
|
51
67
|
if (hash.indexOf(str) == 0) {
|
|
52
68
|
code = hash.slice(str.length);
|
|
53
69
|
}
|
|
@@ -61,12 +77,12 @@ export default {
|
|
|
61
77
|
let param = {
|
|
62
78
|
objTypeCode: this.$attrs.objTypeCode,
|
|
63
79
|
objId: this.$attrs.objId,
|
|
64
|
-
taskId: this.$attrs.taskId
|
|
80
|
+
taskId: this.$attrs.taskId,
|
|
65
81
|
};
|
|
66
82
|
this.conditionParam = param;
|
|
67
83
|
let url, data;
|
|
68
84
|
url = USER_PREFIX + `/formTemplate/getByFormCode`;
|
|
69
|
-
data = {stringOne: this.formCode};
|
|
85
|
+
data = { stringOne: this.formCode };
|
|
70
86
|
this.$http({
|
|
71
87
|
aes: true,
|
|
72
88
|
url: url,
|
|
@@ -75,26 +91,28 @@ export default {
|
|
|
75
91
|
// isLoading: true,
|
|
76
92
|
// loadingTarget: document.body,
|
|
77
93
|
// modalStrictly: true,
|
|
78
|
-
success: async res => {
|
|
94
|
+
success: async (res) => {
|
|
79
95
|
let formTemplate = res.objx || {};
|
|
80
96
|
this.formTemplate = formTemplate;
|
|
81
|
-
this.formJson = formTemplate.formViewContent
|
|
82
|
-
|
|
97
|
+
this.formJson = formTemplate.formViewContent
|
|
98
|
+
? JSON.parse(formTemplate.formViewContent)
|
|
99
|
+
: {};
|
|
100
|
+
this.layoutType = this.formJson.formConfig.layoutType;
|
|
83
101
|
this.getFormInsData2();
|
|
84
|
-
}
|
|
102
|
+
},
|
|
85
103
|
});
|
|
86
104
|
},
|
|
87
105
|
getReqParam(item, dataId, billData) {
|
|
88
106
|
let param = {};
|
|
89
107
|
if (item.accessParam) {
|
|
90
108
|
if (typeof item.accessParam === "string") {
|
|
91
|
-
let n = new Function(
|
|
109
|
+
let n = new Function("billData", item.accessParam);
|
|
92
110
|
param = n.call(this, billData);
|
|
93
111
|
} else {
|
|
94
|
-
param = item.accessParam
|
|
112
|
+
param = item.accessParam;
|
|
95
113
|
}
|
|
96
114
|
} else {
|
|
97
|
-
param = {id: dataId}
|
|
115
|
+
param = { id: dataId };
|
|
98
116
|
}
|
|
99
117
|
return param;
|
|
100
118
|
},
|
|
@@ -103,13 +121,13 @@ export default {
|
|
|
103
121
|
let formConfig = this.formJson.formConfig;
|
|
104
122
|
let dataId = this.dataId;
|
|
105
123
|
if (formConfig.onBeforeCreated) {
|
|
106
|
-
let n = new Function(
|
|
124
|
+
let n = new Function("dataId", "formCode", "done", formConfig.onBeforeCreated);
|
|
107
125
|
let toDo = function (res) {
|
|
108
126
|
let formData = res && res.objx ? res.objx : {};
|
|
109
127
|
that.formData = formData;
|
|
110
128
|
that.formInsData = formData;
|
|
111
129
|
that.showRender = true;
|
|
112
|
-
}
|
|
130
|
+
};
|
|
113
131
|
n.call(this, dataId, this.formCode, toDo);
|
|
114
132
|
} else {
|
|
115
133
|
this.formData = this.$attrs.formData ?? {};
|
|
@@ -121,25 +139,25 @@ export default {
|
|
|
121
139
|
let getConfig = formConfig.getConfig || {};
|
|
122
140
|
let dataId = this.dataId;
|
|
123
141
|
if (dataId) {
|
|
124
|
-
let reqParam = {id: dataId};
|
|
125
|
-
let accessParamArguments = [{name: "id", value: dataId}]
|
|
142
|
+
let reqParam = { id: dataId };
|
|
143
|
+
let accessParamArguments = [{ name: "id", value: dataId }];
|
|
126
144
|
this.scriptHttp({
|
|
127
145
|
options: getConfig,
|
|
128
146
|
params: reqParam,
|
|
129
147
|
targetFormTemplate: this.formTemplate,
|
|
130
148
|
accessParamArguments: accessParamArguments,
|
|
131
|
-
success: res => {
|
|
149
|
+
success: (res) => {
|
|
132
150
|
let formData = res.objx || {};
|
|
133
151
|
this.formData = formData;
|
|
134
152
|
this.formInsData = res.objx;
|
|
135
153
|
this.showRender = true;
|
|
136
|
-
}
|
|
137
|
-
})
|
|
154
|
+
},
|
|
155
|
+
});
|
|
138
156
|
}
|
|
139
157
|
},
|
|
140
|
-
openCopyEditTab(formData){
|
|
141
|
-
this.$emit("openCopyEditTab",formData)
|
|
142
|
-
}
|
|
143
|
-
}
|
|
158
|
+
openCopyEditTab(formData) {
|
|
159
|
+
this.$emit("openCopyEditTab", formData);
|
|
160
|
+
},
|
|
161
|
+
},
|
|
144
162
|
};
|
|
145
163
|
</script>
|
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
<x-tabs ref="xTabs" v-model="activeName" class="tab-box">
|
|
5
5
|
<el-tab-pane :label="$t2('常规')" name="first">
|
|
6
6
|
<vFormRender
|
|
7
|
+
ref="edit"
|
|
7
8
|
:formCode.sync="formCode1"
|
|
8
9
|
:dataId.sync="dataId"
|
|
9
10
|
:param="param"
|
|
10
11
|
:formData="formData"
|
|
11
12
|
v-if="showEdit"
|
|
12
13
|
visible-key="showEdit"
|
|
14
|
+
:visiable.sync="showEdit"
|
|
13
15
|
:parent-target="_self"
|
|
14
16
|
@reload="reload"
|
|
15
17
|
@openCopyEditTab="openCopyEditTab"
|
|
@@ -18,10 +20,12 @@
|
|
|
18
20
|
<el-tab-pane :label="$t2('列表')" name="second">
|
|
19
21
|
<div class="grid-height">
|
|
20
22
|
<vFormRender
|
|
23
|
+
ref="list"
|
|
21
24
|
:formCode="formCode"
|
|
22
25
|
style="height: 100%"
|
|
23
26
|
v-if="showRender"
|
|
24
27
|
visible-key="showRender"
|
|
28
|
+
:visiable.sync="showRender"
|
|
25
29
|
:parent-target="_self"
|
|
26
30
|
@reload="$reloadHandle"
|
|
27
31
|
:openEditDialog="openEditDialog"
|
|
@@ -36,6 +40,7 @@
|
|
|
36
40
|
:closable="true"
|
|
37
41
|
>
|
|
38
42
|
<vFormRender
|
|
43
|
+
ref="multiEdit"
|
|
39
44
|
:formCode.sync="tab.formCode"
|
|
40
45
|
:dataId.sync="tab.dataId"
|
|
41
46
|
:param="tab.param"
|
|
@@ -125,6 +130,11 @@ export default {
|
|
|
125
130
|
this.initParam();
|
|
126
131
|
this.getReportTemplate();
|
|
127
132
|
},
|
|
133
|
+
provide() {
|
|
134
|
+
return {
|
|
135
|
+
_self: this,
|
|
136
|
+
};
|
|
137
|
+
},
|
|
128
138
|
methods: {
|
|
129
139
|
initParam() {
|
|
130
140
|
let path = this.$route.path;
|