cloud-web-corejs 1.0.54-dev.669 → 1.0.54-dev.671

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.54-dev.669",
4
+ "version": "1.0.54-dev.671",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <vFormRender :formCode="formCode" :dataId.sync="dataId"
2
+ <vFormRender :formCode="formCode" :dataId.sync="dataId" :param="param"
3
3
  v-if="showEdit" visible-key="showEdit" :parent-target="_self"
4
4
  @reload="$reloadHandle"></vFormRender>
5
5
  </template>
@@ -14,15 +14,33 @@ export default {
14
14
  formCode: null,
15
15
  dataId: null,
16
16
  showEdit: false,
17
+ param: {},
17
18
  }
18
19
  },
19
20
  created() {
20
21
  this.init()
21
22
  },
22
23
  methods: {
24
+ parseViewParam() {
25
+ let param = {};
26
+ let rawParam = this.$attrs.param ?? this.$route.query.param;
27
+ if (rawParam) {
28
+ if (typeof rawParam === "string") {
29
+ try {
30
+ param = JSON.parse(rawParam) || {};
31
+ } catch (e) {
32
+ param = {};
33
+ }
34
+ } else if (typeof rawParam === "object") {
35
+ param = { ...rawParam };
36
+ }
37
+ }
38
+ return param;
39
+ },
23
40
  init() {
24
41
  let formCode = this.$route.query.formCode || this.$attrs.formCode;
25
42
  let dataId = this.$route.query.dataId || this.$attrs.dataId || this.$attrs._dataId;
43
+ this.param = this.parseViewParam();
26
44
 
27
45
  if (dataId && formCode) {
28
46
  this.formCode = formCode;
@@ -30,6 +30,7 @@
30
30
  <vFormRender
31
31
  ref="list"
32
32
  :formCode="formCode"
33
+ :param="param"
33
34
  style="height: 100%"
34
35
  v-if="showRender"
35
36
  visible-key="showRender"
@@ -107,6 +108,7 @@
107
108
  <vFormRender
108
109
  :formCode="formCode1"
109
110
  :dataId.sync="dataId"
111
+ :param="param"
110
112
  v-if="showEditDialog && showEdit"
111
113
  visible-key="showEdit"
112
114
  :parent-target="_self"
@@ -116,6 +118,7 @@
116
118
  </el-dialog>
117
119
  <vFormRender
118
120
  :formCode="formCode"
121
+ :param="param"
119
122
  style="height: 100%"
120
123
  v-if="showRender"
121
124
  visible-key="showRender"
@@ -189,11 +192,28 @@ export default {
189
192
  this.$refs[refName][0].dataTableSearch();
190
193
  }
191
194
  },
195
+ parseViewParam() {
196
+ let param = {};
197
+ let rawParam = this.$attrs.param ?? this.$route.query.param;
198
+ if (rawParam) {
199
+ if (typeof rawParam === "string") {
200
+ try {
201
+ param = JSON.parse(rawParam) || {};
202
+ } catch (e) {
203
+ param = {};
204
+ }
205
+ } else if (typeof rawParam === "object") {
206
+ param = { ...rawParam };
207
+ }
208
+ }
209
+ return param;
210
+ },
192
211
  initParam() {
193
212
  let path = this.$route.path;
194
- let param = path.split("/").reverse();
213
+ let pathSegments = path.split("/").reverse();
195
214
 
196
- this.formCode = this.$attrs.formCode || param[0];
215
+ this.formCode = this.$attrs.formCode || pathSegments[0];
216
+ this.param = this.parseViewParam();
197
217
  this.showRender = true;
198
218
  },
199
219
  getReportTemplate() {
@@ -253,7 +273,7 @@ export default {
253
273
  return;
254
274
  }
255
275
  if (this.layoutType == "H5") {
256
- this.openEditH5Dialog(row);
276
+ this.openEditH5Dialog(row, param);
257
277
  return;
258
278
  }
259
279
  let formConfig = this.formJson.formConfig;
@@ -300,10 +320,11 @@ export default {
300
320
  openEditDialog1(row, param, option) {
301
321
  this.openEditDialog(row, param, { multiTabEnabled: false, ...option });
302
322
  },
303
- openEditH5Dialog(row) {
323
+ openEditH5Dialog(row, param) {
304
324
  debugger;
305
325
  this.formCode1 = this.addFormCode;
306
326
  this.dataId = row && row.id ? row.id : null;
327
+ this.param = param;
307
328
  this.activeName = "first";
308
329
  this.showEdit = false;
309
330
  this.showEditDialog = true;