@dhccmobile/vue3-lo-form 2.0.52 → 2.0.53

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhccmobile/vue3-lo-form",
3
- "version": "2.0.52",
3
+ "version": "2.0.53",
4
4
  "description": "VUE3动态表单",
5
5
  "private": false,
6
6
  "main": "dist/vue3-lo-form.umd.js",
@@ -184,8 +184,10 @@ export default class DyForm extends Vue {
184
184
  */
185
185
  private initDesForm(): void {
186
186
  if (this.formId != null && this.formId !== "") {
187
- this.desForm = formToolsService.loadResource(this.formId);
188
- this.formatDesForm();
187
+ formToolsService.initResource(this.formId).then((form: any) => {
188
+ this.desForm = form;
189
+ this.formatDesForm();
190
+ });
189
191
  }
190
192
  }
191
193
 
@@ -702,6 +702,34 @@ class FormToolsService {
702
702
  }
703
703
  }
704
704
 
705
+ initResource(formId: string): Promise<void | DesForm> {
706
+ if (this.desForms.length === 0) {
707
+ return new Promise((resolve, reject) => {
708
+ Promise.all([dictStore.getDicts(), dictStore.getTreeDicts(), dictStore.getMapDicts(), dictStore.getMapTreeDicts(), formStore.getForms()]).then(([dicts, treeDicts, mapDicts, mapTreeDicts, forms]: any[]) => {
709
+ this.desForms = forms;
710
+ this.sysDictDetailOptions = dicts;
711
+ this.sysDictTreeDetailOptions = treeDicts;
712
+ this.mapSysDictDetailOptions = mapDicts;
713
+ this.mapSysDictTreeDetailOptions = mapTreeDicts;
714
+ const desForm: DesForm | undefined = this.desForms.find((item) => item.formId === formId);
715
+ if (desForm != null) {
716
+ resolve(formBeanUtilsService.copy(desForm));
717
+ return formBeanUtilsService.copy(desForm);
718
+ } else {
719
+ reject(new DesForm({ formId: formId }));
720
+ }
721
+ });
722
+ });
723
+ } else {
724
+ const desForm: DesForm | undefined = this.desForms.find((item) => item.formId === formId);
725
+ if (desForm != null) {
726
+ return Promise.resolve(formBeanUtilsService.copy(desForm));
727
+ } else {
728
+ return Promise.reject(new DesForm({ formId: formId }));
729
+ }
730
+ }
731
+ }
732
+
705
733
  /**
706
734
  * @description: rest客户端
707
735
  * @author ChenRui
@@ -193,6 +193,7 @@
193
193
  .ant-select-arrow {
194
194
  z-index: 10;
195
195
  }
196
+ /** 下拉框占位符的样式 */
196
197
  .ant-select-selection-placeholder {
197
198
  display: flex !important;
198
199
  align-items: center !important;
@@ -399,4 +399,3 @@
399
399
  }
400
400
  }
401
401
  }
402
-
@@ -125,6 +125,7 @@ declare class FormToolsService {
125
125
  * @date 2020/11/23 11:00
126
126
  */
127
127
  loadResource(formId: string): DesForm;
128
+ initResource(formId: string): Promise<void | DesForm>;
128
129
  /**
129
130
  * @description: rest客户端
130
131
  * @author ChenRui