@dhccmobile/vue3-lo-form 2.0.5 → 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.5",
3
+ "version": "2.0.53",
4
4
  "description": "VUE3动态表单",
5
5
  "private": false,
6
6
  "main": "dist/vue3-lo-form.umd.js",
package/src/App.vue CHANGED
@@ -101,8 +101,8 @@
101
101
  </div>
102
102
  </div>
103
103
  <div class="lo-input">
104
- <!--styleMode="credit-rd" :formId="'773549593606574080'"-->
105
- <dy-form v-if="showForm" :formId="'984119606230257664'" v-model:edit="formApi.edit" v-model:formApi="formApi" @change="onChange($event)" @click="onClick($event)" @focus="onFocus($event)" @blur="onBlur($event)" @addon-before="onAddonBeforeHandler($event)" @addon-after="onAddonAfterHandler($event)" @add-item="selectAddItem($event)">
104
+ <!--styleMode="credit-rd" :formId="'984119606230257664'"-->
105
+ <dy-form v-if="showForm" :formId="'1486032085101092864'" v-model:edit="formApi.edit" v-model:formApi="formApi" @change="onChange($event)" @click="onClick($event)" @focus="onFocus($event)" @blur="onBlur($event)" @addon-before="onAddonBeforeHandler($event)" @addon-after="onAddonAfterHandler($event)" @add-item="selectAddItem($event)">
106
106
  <template #combinationSelector="{ control, onChange }">
107
107
  <div class="lo-custom-control-box">
108
108
  <a-input v-model:value="control.formControl.value" @input="onChange(control.formControl)" v-if="control && control.formControl" />
@@ -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
 
package/src/main.ts CHANGED
@@ -10,7 +10,8 @@ app.config.performance = true;
10
10
  app
11
11
  .use(VueLoForm, {
12
12
  url: "http://82.156.213.34:8080",
13
- appId: "1009549397931601920",
13
+ // appId: "1009549397931601920",
14
+ appId: "1461652844787691520",
14
15
  onlySimpleLoadConfig: false,
15
16
  loadMode: "dynamic",
16
17
  })
@@ -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,3 +193,9 @@
193
193
  .ant-select-arrow {
194
194
  z-index: 10;
195
195
  }
196
+ /** 下拉框占位符的样式 */
197
+ .ant-select-selection-placeholder {
198
+ display: flex !important;
199
+ align-items: center !important;
200
+ justify-content: start;
201
+ }
@@ -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