@a2simcode/ui 0.0.57 → 0.0.59
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/dist/components/index.d.ts +1 -0
- package/dist/components/table/index.d.ts +7 -6
- package/dist/components/table/src/interface.d.ts +2 -1
- package/dist/simcode-ui.es.js +659 -656
- package/dist/simcode-ui.umd.js +2 -2
- package/dist/stats.html +1 -1
- package/docs/examples/form/basic.vue +150 -2
- package/package.json +1 -1
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
<div style="margin-top: 16px; padding-left: 100px">
|
|
5
5
|
<j-button type="primary" label="提交" @click="handleSubmit"></j-button>
|
|
6
6
|
<j-button style="margin-left: 8px" label="重置" @click="handleReset"></j-button>
|
|
7
|
+
<j-button style="margin-left: 8px" label="获取数据" @click="handleGetFormData"></j-button>
|
|
7
8
|
</div>
|
|
8
9
|
</div>
|
|
9
10
|
</template>
|
|
10
11
|
|
|
11
12
|
<script setup>
|
|
12
|
-
import { ref, reactive } from 'vue'
|
|
13
|
+
import { ref, reactive, h, onMounted } from 'vue'
|
|
13
14
|
|
|
14
15
|
const formRef = ref()
|
|
15
16
|
|
|
@@ -21,6 +22,9 @@ const formConfig = reactive({
|
|
|
21
22
|
span: 24,
|
|
22
23
|
})
|
|
23
24
|
|
|
25
|
+
const handleGetFormData = () => {
|
|
26
|
+
console.log(formRef.value.getFormData(), 'getFormData')
|
|
27
|
+
}
|
|
24
28
|
const schema = [
|
|
25
29
|
{
|
|
26
30
|
type: 'j-input',
|
|
@@ -169,7 +173,7 @@ const schema = [
|
|
|
169
173
|
],
|
|
170
174
|
},
|
|
171
175
|
],
|
|
172
|
-
}
|
|
176
|
+
},
|
|
173
177
|
},
|
|
174
178
|
{
|
|
175
179
|
type: 'j-upload',
|
|
@@ -225,8 +229,152 @@ const schema = [
|
|
|
225
229
|
},
|
|
226
230
|
],
|
|
227
231
|
},
|
|
232
|
+
{
|
|
233
|
+
type: 'j-collapse',
|
|
234
|
+
config: {
|
|
235
|
+
label: '属性设置',
|
|
236
|
+
field: 'collapse',
|
|
237
|
+
},
|
|
238
|
+
children: [
|
|
239
|
+
{
|
|
240
|
+
config: {
|
|
241
|
+
label: '基础信息',
|
|
242
|
+
},
|
|
243
|
+
children: [
|
|
244
|
+
{
|
|
245
|
+
type: 'j-input',
|
|
246
|
+
config: {
|
|
247
|
+
label: '名称',
|
|
248
|
+
field: 'j_Name',
|
|
249
|
+
rule: [{ required: true, message: '请输入名称' }],
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
type: 'j-input',
|
|
254
|
+
config: {
|
|
255
|
+
label: '编码',
|
|
256
|
+
field: 'j_Code',
|
|
257
|
+
rule: [
|
|
258
|
+
{ required: true, message: '请输入编码' },
|
|
259
|
+
{
|
|
260
|
+
type: 'only',
|
|
261
|
+
table: 'base_datasource',
|
|
262
|
+
key: 'j_Id',
|
|
263
|
+
},
|
|
264
|
+
],
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
type: 'j-tree-select',
|
|
269
|
+
config: {
|
|
270
|
+
label: '分类',
|
|
271
|
+
field: 'j_Category',
|
|
272
|
+
dataType: 'dataItem',
|
|
273
|
+
dataCode: 'datasourceType',
|
|
274
|
+
rule: [{ required: true, message: '请选择' }],
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
type: 'j-input',
|
|
279
|
+
config: {
|
|
280
|
+
label: '备注',
|
|
281
|
+
field: 'j_Des',
|
|
282
|
+
type: 'textarea',
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
],
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
config: {
|
|
289
|
+
label: '排序字段',
|
|
290
|
+
},
|
|
291
|
+
children: [
|
|
292
|
+
{
|
|
293
|
+
type: 'j-input-cards',
|
|
294
|
+
config: {
|
|
295
|
+
field: 'orders',
|
|
296
|
+
labelWidth: '48px',
|
|
297
|
+
},
|
|
298
|
+
children: [
|
|
299
|
+
{
|
|
300
|
+
// id: 'field',
|
|
301
|
+
type: 'j-autocomplete',
|
|
302
|
+
config: {
|
|
303
|
+
label: '字段',
|
|
304
|
+
field: 'field',
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
// id: 'isDESC',
|
|
309
|
+
type: 'j-switch',
|
|
310
|
+
config: {
|
|
311
|
+
label: '倒序',
|
|
312
|
+
field: 'isDESC',
|
|
313
|
+
activeValue: true,
|
|
314
|
+
inactiveValue: false,
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
],
|
|
318
|
+
},
|
|
319
|
+
],
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
config: {
|
|
323
|
+
label: '字段信息',
|
|
324
|
+
},
|
|
325
|
+
children: [
|
|
326
|
+
{
|
|
327
|
+
type: 'j-input-rows',
|
|
328
|
+
config: {
|
|
329
|
+
// label: '字段信息',
|
|
330
|
+
field: 'fields',
|
|
331
|
+
labelWidth: '48px',
|
|
332
|
+
// isRemoveBtn: false,
|
|
333
|
+
// isAddBtn: false,
|
|
334
|
+
// drag: false,
|
|
335
|
+
},
|
|
336
|
+
children: [
|
|
337
|
+
{
|
|
338
|
+
type: 'j-input',
|
|
339
|
+
config: {
|
|
340
|
+
label: '',
|
|
341
|
+
field: 'name',
|
|
342
|
+
},
|
|
343
|
+
getCompConfig: (data) => {
|
|
344
|
+
console.log(data, 'getCompConfig')
|
|
345
|
+
return {
|
|
346
|
+
// prepend: h(
|
|
347
|
+
// 'span',
|
|
348
|
+
// {
|
|
349
|
+
// style: { color: 'blue' },
|
|
350
|
+
// },
|
|
351
|
+
// row.type,
|
|
352
|
+
// ),
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
],
|
|
357
|
+
},
|
|
358
|
+
],
|
|
359
|
+
},
|
|
360
|
+
],
|
|
361
|
+
},
|
|
228
362
|
]
|
|
229
363
|
|
|
364
|
+
onMounted(() => {
|
|
365
|
+
// formRef.value.setFormData({
|
|
366
|
+
// fields: [
|
|
367
|
+
// {
|
|
368
|
+
// name: '字段1',
|
|
369
|
+
// type: '字符串'
|
|
370
|
+
// },
|
|
371
|
+
// {
|
|
372
|
+
// name: '字段2',
|
|
373
|
+
// type: '数字'
|
|
374
|
+
// },
|
|
375
|
+
// ],
|
|
376
|
+
// })
|
|
377
|
+
})
|
|
230
378
|
const handleSubmit = async () => {
|
|
231
379
|
const valid = await formRef.value.validate()
|
|
232
380
|
if (valid) {
|