@tmagic/form 1.0.1 → 1.0.2

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,5 +1,5 @@
1
1
  {
2
- "version": "1.0.1",
2
+ "version": "1.0.2",
3
3
  "name": "@tmagic/form",
4
4
  "sideEffects": [
5
5
  "dist/*",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@element-plus/icons": "0.0.11",
36
- "@tmagic/utils": "1.0.1",
36
+ "@tmagic/utils": "1.0.2",
37
37
  "element-plus": "^2.2.0",
38
38
  "lodash-es": "^4.17.21",
39
39
  "moment": "^2.29.2",
@@ -154,7 +154,7 @@
154
154
  /* eslint-disable no-param-reassign */
155
155
  import { computed, defineComponent, inject, onMounted, PropType, ref, toRefs } from 'vue';
156
156
  import { ArrowDown, ArrowUp, Delete, FullScreen, Grid } from '@element-plus/icons';
157
- import { ElMessage, ElTable, ElUpload } from 'element-plus';
157
+ import { ElMessage, ElTable, UploadFile } from 'element-plus';
158
158
  import { cloneDeep } from 'lodash-es';
159
159
  import Sortable, { SortableEvent } from 'sortablejs';
160
160
 
@@ -163,23 +163,6 @@ import { asyncLoadJs, sleep } from '@tmagic/utils';
163
163
  import { ColumnConfig, FormState, SortProp, TableConfig } from '../schema';
164
164
  import { display, initValue } from '../utils/form';
165
165
 
166
- export type UploadStatus = 'ready' | 'uploading' | 'success' | 'fail';
167
-
168
- export interface ElFile extends File {
169
- uid: number;
170
- }
171
-
172
- export type UploadFile = {
173
- name: string;
174
- percentage?: number;
175
- status: UploadStatus;
176
- size: number;
177
- response?: unknown;
178
- uid: number;
179
- url?: string;
180
- raw: ElFile;
181
- };
182
-
183
166
  let loadedAMapJS = false; // 是否加载完js
184
167
  let firstLoadingAMapJS = true; // 否是第一次请求
185
168
 
@@ -241,7 +224,7 @@ export default defineComponent({
241
224
  const mForm = inject<FormState | undefined>('mForm');
242
225
 
243
226
  const elTable = ref<InstanceType<typeof ElTable>>();
244
- const excelBtn = ref<InstanceType<typeof ElUpload>>();
227
+ const excelBtn = ref<any>();
245
228
  const mTable = ref<HTMLDivElement>();
246
229
 
247
230
  const pagesize = ref(10);
package/src/utils/form.ts CHANGED
@@ -71,7 +71,7 @@ const initItemsValue = (
71
71
  { items, name, extensible }: any,
72
72
  ) => {
73
73
  if (Array.isArray(initValue[name])) {
74
- value[name] = initValue[name].map((v: any) => init(mForm, items, v));
74
+ value[name] = initValue[name].map((v: any, index: number) => init(mForm, items, v, value[name]?.[index]));
75
75
  } else {
76
76
  value[name] = init(mForm, items, initValue[name], value[name]);
77
77
  if (extensible) {