cloud-web-corejs 1.0.54-dev.667 → 1.0.54-dev.668

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.667",
4
+ "version": "1.0.54-dev.668",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -21,9 +21,13 @@
21
21
  </div>
22
22
  </div>
23
23
  <div v-else class="vue-page-container" :style="containerStyle">
24
- <div v-if="!componentPath" class="vue-page-placeholder">{{ $t1("请配置 Vue 页面路径") }}</div>
24
+ <div v-if="!componentPath" class="vue-page-placeholder">
25
+ {{ $t1("请配置 Vue 页面路径") }}
26
+ </div>
25
27
  <div v-else-if="loadError" class="vue-page-error">{{ loadError }}</div>
26
- <div v-else-if="loading" class="vue-page-loading">{{ $t1("页面加载中...") }}</div>
28
+ <div v-else-if="loading" class="vue-page-loading">
29
+ {{ $t1("页面加载中...") }}
30
+ </div>
27
31
  <component
28
32
  v-if="showComponent && dynamicComponent"
29
33
  :is="dynamicComponent"
@@ -80,7 +84,6 @@ export default {
80
84
  dynamicComponent: null,
81
85
  componentProps: {},
82
86
  componentRenderKey: 0,
83
- componentLoaded: false,
84
87
  loading: false,
85
88
  loadError: null,
86
89
  };
@@ -101,25 +104,10 @@ export default {
101
104
  };
102
105
  },
103
106
  },
104
- watch: {
105
- componentPath() {
106
- this.reloadDynamicComponent();
107
- },
108
- "field.options.componentConfig"() {
109
- this.updateComponentProps();
110
- },
111
- formModel: {
112
- deep: true,
113
- handler() {
114
- this.updateComponentProps();
115
- },
116
- },
117
- },
118
107
  created() {
119
108
  this.registerToRefList();
120
109
  this.initEventHandler();
121
110
  this.handleOnCreated();
122
- this.loadPage();
123
111
  },
124
112
  mounted() {
125
113
  this.handleOnMounted();
@@ -135,54 +123,48 @@ export default {
135
123
  this.showComponent = false;
136
124
  this.dynamicComponent = null;
137
125
  this.componentProps = {};
138
- this.componentLoaded = false;
139
126
  this.loading = false;
140
127
  this.loadError = null;
141
128
  },
142
- reloadDynamicComponent() {
143
- this.resetComponentState();
144
- this.loadPage();
145
- },
146
129
  loadPage() {
147
130
  if (this.designState) {
148
131
  return;
149
132
  }
150
133
 
134
+ const path = this.normalizeComponentPath(this.componentPath);
135
+ if (!path) {
136
+ this.resetComponentState();
137
+ return;
138
+ }
139
+
151
140
  if (this.dynamicComponent) {
152
- this.showComponent = true;
153
141
  this.updateComponentProps();
142
+ this.showComponent = true;
154
143
  return;
155
144
  }
156
145
 
157
- const path = this.normalizeComponentPath(this.componentPath);
158
146
  this.showComponent = false;
159
147
  this.loadError = null;
160
-
161
- if (!path) {
162
- this.loading = false;
163
- this.componentLoaded = false;
164
- return;
165
- }
166
-
167
148
  this.loading = true;
149
+
168
150
  try {
169
151
  const loader = loadView(path);
170
152
  loader((component) => {
153
+ if (path !== this.normalizeComponentPath(this.componentPath)) {
154
+ return;
155
+ }
171
156
  this.loading = false;
172
157
  if (!component) {
173
158
  this.loadError = this.$t1("页面组件未找到");
174
- this.componentLoaded = false;
175
159
  return;
176
160
  }
177
161
  this.dynamicComponent = component.default || component;
178
162
  this.componentRenderKey += 1;
179
- this.componentLoaded = true;
180
- this.showComponent = true;
181
163
  this.updateComponentProps();
164
+ this.showComponent = true;
182
165
  });
183
166
  } catch (error) {
184
167
  this.loading = false;
185
- this.componentLoaded = false;
186
168
  this.loadError = error.message || this.$t1("页面加载失败");
187
169
  }
188
170
  },
@@ -198,11 +180,7 @@ export default {
198
180
  return;
199
181
  }
200
182
 
201
- let props = this.handleCustomEvent(
202
- this.field.options.componentConfig,
203
- ["formModel"],
204
- [this.formModel]
205
- );
183
+ let props = this.handleCustomEvent(this.field.options.componentConfig);
206
184
  this.componentProps = props && typeof props === "object" ? props : {};
207
185
  },
208
186
  },
@@ -39,7 +39,7 @@ export default {
39
39
  },
40
40
  data() {
41
41
  return {
42
- params: ["dataId", "formCode", "formModel"],
42
+ params: ["dataId", "formCode"],
43
43
  };
44
44
  },
45
45
  };