gi-component 0.0.50 → 0.0.51

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/index.es.js CHANGED
@@ -2261,120 +2261,85 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2261
2261
  __name: "form",
2262
2262
  props: {
2263
2263
  modelValue: {},
2264
- columns: {
2265
- default: () => []
2266
- },
2267
- fc: {
2268
- default: () => ({})
2269
- },
2264
+ columns: { default: () => [] },
2265
+ fc: { default: () => ({}) },
2270
2266
  gridProps: {},
2271
- gridItemProps: {
2272
- default: () => ({
2273
- span: {
2274
- xs: 24,
2275
- sm: 24,
2276
- md: 12
2277
- }
2278
- })
2279
- },
2280
- search: {
2281
- type: Boolean,
2282
- default: false
2283
- },
2284
- searchText: {
2285
- default: "查询"
2286
- },
2287
- hideFoldBtn: {
2288
- type: Boolean,
2289
- default: false
2290
- },
2291
- defaultCollapsed: {
2292
- type: Boolean,
2293
- default: void 0
2294
- },
2295
- suffix: {
2296
- type: Boolean,
2297
- default: true
2298
- },
2267
+ gridItemProps: { default: () => ({ span: { xs: 24, sm: 24, md: 12 } }) },
2268
+ search: { type: Boolean, default: false },
2269
+ searchText: { default: "查询" },
2270
+ hideFoldBtn: { type: Boolean, default: false },
2271
+ defaultCollapsed: { type: Boolean, default: void 0 },
2272
+ suffix: { type: Boolean, default: true },
2299
2273
  model: {},
2300
2274
  rules: {},
2301
2275
  labelPosition: {},
2302
2276
  requireAsteriskPosition: {},
2303
- labelWidth: {
2304
- default: "auto"
2305
- },
2277
+ labelWidth: { default: "auto" },
2306
2278
  labelSuffix: {},
2307
- inline: {
2308
- type: Boolean
2309
- },
2310
- inlineMessage: {
2311
- type: Boolean
2312
- },
2313
- statusIcon: {
2314
- type: Boolean
2315
- },
2316
- showMessage: {
2317
- type: Boolean,
2318
- default: true
2319
- },
2320
- validateOnRuleChange: {
2321
- type: Boolean
2322
- },
2323
- hideRequiredAsterisk: {
2324
- type: Boolean
2325
- },
2326
- scrollToError: {
2327
- type: Boolean,
2328
- default: true
2329
- },
2279
+ inline: { type: Boolean },
2280
+ inlineMessage: { type: Boolean },
2281
+ statusIcon: { type: Boolean },
2282
+ showMessage: { type: Boolean, default: true },
2283
+ validateOnRuleChange: { type: Boolean },
2284
+ hideRequiredAsterisk: { type: Boolean },
2285
+ scrollToError: { type: Boolean, default: true },
2330
2286
  scrollIntoViewOptions: {},
2331
2287
  size: {},
2332
- disabled: {
2333
- type: Boolean
2334
- }
2288
+ disabled: { type: Boolean }
2335
2289
  },
2336
2290
  emits: ["update:modelValue", "search", "reset"],
2337
- setup(__props, {
2338
- expose: __expose,
2339
- emit: __emit
2340
- }) {
2291
+ setup(__props, { expose: __expose, emit: __emit }) {
2341
2292
  const props = __props;
2342
2293
  const emit = __emit;
2343
2294
  const attrs = useAttrs();
2344
- const {
2345
- b
2346
- } = useBemClass();
2295
+ const { b } = useBemClass();
2347
2296
  const collapsed = ref((props == null ? void 0 : props.defaultCollapsed) ?? props.search);
2348
2297
  const instance = getCurrentInstance();
2349
2298
  const globalConfig = instance == null ? void 0 : instance.appContext.config.globalProperties.$config;
2350
2299
  const clearable2 = (globalConfig == null ? void 0 : globalConfig.clearable) ?? false;
2351
2300
  const dictData = ref({});
2352
- const STATIC_PROPS = /* @__PURE__ */ new Map([["input", {
2353
- clearable: clearable2,
2354
- maxlength: 20
2355
- }], ["textarea", {
2356
- clearable: clearable2,
2357
- type: "textarea",
2358
- maxlength: 200,
2359
- showWordLimit: true
2360
- }], ["input-number", {}], ["input-tag", {
2361
- clearable: clearable2
2362
- }], ["select", {
2363
- clearable: clearable2
2364
- }], ["select-v2", {
2365
- clearable: clearable2
2366
- }], ["tree-select", {
2367
- clearable: clearable2
2368
- }], ["cascader", {
2369
- clearable: clearable2
2370
- }], ["slider", {}], ["switch", {}], ["rate", {}], ["checkbox-group", {}], ["checkbox", {}], ["radio-group", {}], ["radio", {}], ["date-picker", {
2371
- clearable: clearable2
2372
- }], ["time-picker", {
2373
- clearable: clearable2
2374
- }], ["time-select", {
2375
- clearable: clearable2
2376
- }], ["color-picker", {}], ["transfer", {}], ["autocomplete", {}], ["upload", {}], ["title", {}]]);
2377
- const PLACEHOLDER_MAP = /* @__PURE__ */ new Map([["input", (label) => `请输入${label}`], ["input-number", (label) => `请输入${label}`], ["input-tag", (label) => `请输入${label}`], ["textarea", (label) => `请填写${label}`], ["select", (label) => `请选择${label}`], ["select-v2", (label) => `请选择${label}`], ["tree-select", (label) => `请选择${label}`], ["cascader", (label) => `请选择${label}`], ["time-select", (label) => `请选择${label}`], ["input-search", (label) => `请选择${label}`], ["date-picker", () => "请选择日期"], ["time-picker", () => "请选择时间"]]);
2301
+ const STATIC_PROPS = /* @__PURE__ */ new Map([
2302
+ ["input", { clearable: clearable2, maxlength: 20 }],
2303
+ [
2304
+ "textarea",
2305
+ { clearable: clearable2, type: "textarea", maxlength: 200, showWordLimit: true }
2306
+ ],
2307
+ ["input-number", {}],
2308
+ ["input-tag", { clearable: clearable2 }],
2309
+ ["select", { clearable: clearable2 }],
2310
+ ["select-v2", { clearable: clearable2 }],
2311
+ ["tree-select", { clearable: clearable2 }],
2312
+ ["cascader", { clearable: clearable2 }],
2313
+ ["slider", {}],
2314
+ ["switch", {}],
2315
+ ["rate", {}],
2316
+ ["checkbox-group", {}],
2317
+ ["checkbox", {}],
2318
+ ["radio-group", {}],
2319
+ ["radio", {}],
2320
+ ["date-picker", { clearable: clearable2 }],
2321
+ ["time-picker", { clearable: clearable2 }],
2322
+ ["time-select", { clearable: clearable2 }],
2323
+ ["color-picker", {}],
2324
+ ["transfer", {}],
2325
+ ["autocomplete", {}],
2326
+ ["upload", {}],
2327
+ ["title", {}]
2328
+ ]);
2329
+ const PLACEHOLDER_MAP = /* @__PURE__ */ new Map([
2330
+ ["input", (label) => `请输入${label}`],
2331
+ ["input-number", (label) => `请输入${label}`],
2332
+ ["input-tag", (label) => `请输入${label}`],
2333
+ ["textarea", (label) => `请填写${label}`],
2334
+ ["select", (label) => `请选择${label}`],
2335
+ ["select-v2", (label) => `请选择${label}`],
2336
+ ["tree-select", (label) => `请选择${label}`],
2337
+ ["cascader", (label) => `请选择${label}`],
2338
+ ["time-select", (label) => `请选择${label}`],
2339
+ ["input-search", (label) => `请选择${label}`],
2340
+ ["date-picker", () => "请选择日期"],
2341
+ ["time-picker", () => "请选择时间"]
2342
+ ]);
2378
2343
  const loadDictData = async () => {
2379
2344
  var _a;
2380
2345
  const dictCodes = (_a = props.columns) == null ? void 0 : _a.filter((item) => item.dictCode).map((item) => item.dictCode).filter((code, index2, arr) => arr.indexOf(code) === index2);
@@ -2384,20 +2349,15 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2384
2349
  return;
2385
2350
  }
2386
2351
  try {
2387
- const dictResponses = await Promise.all(dictCodes.map((code) => globalConfig.dictRequest(code).then((response) => ({
2388
- code,
2389
- response
2390
- })).catch((error) => {
2391
- console.error(`获取字典 ${code} 失败:`, error);
2392
- return {
2393
- code,
2394
- response: []
2395
- };
2396
- })));
2397
- dictResponses.forEach(({
2398
- code,
2399
- response
2400
- }) => {
2352
+ const dictResponses = await Promise.all(
2353
+ dictCodes.map(
2354
+ (code) => globalConfig.dictRequest(code).then((response) => ({ code, response })).catch((error) => {
2355
+ console.error(`获取字典 ${code} 失败:`, error);
2356
+ return { code, response: [] };
2357
+ })
2358
+ )
2359
+ );
2360
+ dictResponses.forEach(({ code, response }) => {
2401
2361
  dictData.value[code] = response;
2402
2362
  });
2403
2363
  } catch (error) {
@@ -2415,9 +2375,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2415
2375
  };
2416
2376
  function getComponentBindProps(item) {
2417
2377
  var _a;
2418
- const defaultProps = {
2419
- ...STATIC_PROPS.get(item.type) || {}
2420
- };
2378
+ const defaultProps = { ...STATIC_PROPS.get(item.type) || {} };
2421
2379
  const placeholder = getPlaceholder(item);
2422
2380
  if (placeholder) {
2423
2381
  defaultProps.placeholder = placeholder;
@@ -2428,10 +2386,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2428
2386
  if (item.dictCode && dictData.value[item.dictCode]) {
2429
2387
  defaultProps.options = dictData.value[item.dictCode];
2430
2388
  }
2431
- return {
2432
- ...defaultProps,
2433
- ...(item == null ? void 0 : item.props) || {}
2434
- };
2389
+ return { ...defaultProps, ...(item == null ? void 0 : item.props) || {} };
2435
2390
  }
2436
2391
  const formProps = computed(() => {
2437
2392
  const {
@@ -2446,10 +2401,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2446
2401
  fc,
2447
2402
  ...restProps
2448
2403
  } = props;
2449
- return {
2450
- ...attrs,
2451
- ...restProps
2452
- };
2404
+ return { ...attrs, ...restProps };
2453
2405
  });
2454
2406
  const getClass = computed(() => {
2455
2407
  const arr = [b("form")];
@@ -2490,16 +2442,19 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2490
2442
  const rules = Array.isArray(item.rules) ? item.rules : [];
2491
2443
  const requiredMessage = `${item.label}为必填项`;
2492
2444
  if (item.required) {
2493
- return [{
2494
- required: true,
2495
- message: requiredMessage
2496
- }, ...rules];
2445
+ return [
2446
+ { required: true, message: requiredMessage },
2447
+ ...rules
2448
+ ];
2497
2449
  }
2498
2450
  if ((_b = (_a = props.fc) == null ? void 0 : _a[item.field]) == null ? void 0 : _b.required) {
2499
- return [{
2500
- required: props.fc[item.field].required,
2501
- message: requiredMessage
2502
- }, ...rules];
2451
+ return [
2452
+ {
2453
+ required: props.fc[item.field].required,
2454
+ message: requiredMessage
2455
+ },
2456
+ ...rules
2457
+ ];
2503
2458
  }
2504
2459
  return item.rules;
2505
2460
  }
@@ -2519,14 +2474,9 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2519
2474
  return false;
2520
2475
  }
2521
2476
  function updateModelValue(value, item) {
2522
- emit("update:modelValue", {
2523
- ...props.modelValue,
2524
- [item.field]: value
2525
- });
2477
+ emit("update:modelValue", { ...props.modelValue, [item.field]: value });
2526
2478
  }
2527
- __expose({
2528
- formRef
2529
- });
2479
+ __expose({ formRef });
2530
2480
  return (_ctx, _cache) => {
2531
2481
  const _component_el_alert = resolveComponent("el-alert");
2532
2482
  return openBlock(), createBlock(unref(ElForm), mergeProps({
@@ -2536,148 +2486,179 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2536
2486
  }, formProps.value, {
2537
2487
  model: props.modelValue
2538
2488
  }), {
2539
- default: withCtx(() => [createVNode(unref(Grid), mergeProps({
2540
- class: "w-full",
2541
- "col-gap": 12
2542
- }, props.gridProps, {
2543
- collapsed: collapsed.value
2544
- }), {
2545
- default: withCtx(() => {
2546
- var _a;
2547
- return [(openBlock(true), createElementBlock(Fragment, null, renderList(props.columns, (item, index2) => {
2548
- var _a2, _b;
2549
- return openBlock(), createElementBlock(Fragment, null, [item.type === "title" ? (openBlock(), createBlock(unref(GridItem), {
2550
- key: `title${index2}`,
2551
- span: 24
2552
- }, {
2553
- default: withCtx(() => [createVNode(unref(ElFormItem), {
2554
- "label-width": "0"
2555
- }, {
2556
- default: withCtx(() => [createVNode(_component_el_alert, {
2557
- class: normalizeClass(unref(b)("form-item__title")),
2558
- title: typeof item.label === "string" ? item.label : "",
2559
- type: "info",
2560
- closable: false
2561
- }, null, 8, ["class", "title"])]),
2562
- _: 2
2563
- }, 1024)]),
2564
- _: 2
2565
- }, 1024)) : (openBlock(), createElementBlock(Fragment, {
2566
- key: 1
2567
- }, [!isHide(item) ? (openBlock(), createBlock(unref(GridItem), mergeProps({
2568
- key: item.field + index2
2569
- }, {
2570
- ref_for: true
2571
- }, item.gridItemProps || props.gridItemProps, {
2572
- span: item.span || ((_a2 = item.gridItemProps) == null ? void 0 : _a2.span) || ((_b = props == null ? void 0 : props.gridItemProps) == null ? void 0 : _b.span)
2573
- }), {
2574
- default: withCtx(() => [(openBlock(), createBlock(unref(ElFormItem), mergeProps({
2575
- key: item.field + index2,
2576
- prop: item.field,
2577
- label: item.label,
2578
- rules: getFormItemRules(item)
2579
- }, {
2580
- ref_for: true
2581
- }, item.formItemProps), createSlots({
2582
- default: withCtx(() => [item.type === "slot" ? (openBlock(), createElementBlock("div", _hoisted_1$2, [renderSlot(_ctx.$slots, item.field, {
2583
- item
2584
- }, void 0, true)])) : (openBlock(), createElementBlock("div", {
2585
- key: 1,
2586
- class: normalizeClass(unref(b)("form-item__content"))
2587
- }, [createElementVNode("div", {
2588
- class: normalizeClass(unref(b)("form-item__component"))
2589
- }, [(openBlock(), createBlock(resolveDynamicComponent(CompMap[item.type] || item.type), mergeProps({
2590
- disabled: isDisabled(item),
2591
- class: "w-full"
2592
- }, {
2593
- ref_for: true
2594
- }, getComponentBindProps(item), {
2595
- "model-value": props.modelValue[item.fieldName || item.field],
2596
- "onUpdate:modelValue": ($event) => updateModelValue($event, item)
2597
- }), createSlots({
2598
- _: 2
2599
- }, [renderList((item == null ? void 0 : item.slots) || {}, (slotValue, slotKey) => {
2600
- return {
2601
- name: slotKey,
2602
- fn: withCtx((scope) => [typeof slotValue === "string" ? (openBlock(), createElementBlock(Fragment, {
2603
- key: 0
2604
- }, [createTextVNode(toDisplayString(slotValue), 1)], 64)) : slotValue ? (openBlock(), createBlock(resolveDynamicComponent(slotValue(scope)), {
2605
- key: 1
2606
- })) : createCommentVNode("", true)])
2607
- };
2608
- })]), 1040, ["disabled", "model-value", "onUpdate:modelValue"])), item.tip ? (openBlock(), createBlock(unref(ElText), {
2609
- key: 0,
2610
- class: normalizeClass(unref(b)("form-item__tip")),
2611
- type: "info",
2612
- size: "small"
2613
- }, {
2614
- default: withCtx(() => [createTextVNode(toDisplayString(item.tip), 1)]),
2615
- _: 2
2616
- }, 1032, ["class"])) : createCommentVNode("", true)], 2), item.extra ? (openBlock(), createElementBlock("div", {
2617
- key: 0,
2618
- class: normalizeClass(unref(b)("form-item__extra"))
2619
- }, [typeof item.extra === "string" ? (openBlock(), createBlock(unref(ElText), {
2620
- key: 0,
2621
- type: "info",
2622
- size: "small"
2623
- }, {
2624
- default: withCtx(() => [createTextVNode(toDisplayString(item.extra), 1)]),
2625
- _: 2
2626
- }, 1024)) : item.extra ? (openBlock(), createBlock(resolveDynamicComponent(item.extra), {
2627
- key: 1
2628
- })) : createCommentVNode("", true)], 2)) : createCommentVNode("", true)], 2))]),
2629
- _: 2
2630
- }, [(item == null ? void 0 : item.labelRender) ? {
2631
- name: "label",
2632
- fn: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(item.labelRender)))]),
2633
- key: "0"
2634
- } : void 0]), 1040, ["prop", "label", "rules"]))]),
2635
- _: 2
2636
- }, 1040, ["span"])) : createCommentVNode("", true)], 64))], 64);
2637
- }), 256)), props.search ? (openBlock(), createBlock(unref(GridItem), {
2638
- key: 0,
2639
- suffix: props.suffix && props.search,
2640
- span: (_a = props == null ? void 0 : props.gridItemProps) == null ? void 0 : _a.span
2641
- }, {
2642
- default: withCtx(() => [createVNode(unref(ElSpace), {
2643
- class: normalizeClass(unref(b)("form__search-btns"))
2644
- }, {
2645
- default: withCtx(() => [createVNode(unref(ElButton), {
2646
- type: "primary",
2647
- onClick: _cache[0] || (_cache[0] = ($event) => emit("search"))
2648
- }, {
2649
- default: withCtx(() => [createTextVNode(toDisplayString(_ctx.searchText), 1)]),
2650
- _: 1
2651
- }), createVNode(unref(ElButton), {
2652
- onClick: _cache[1] || (_cache[1] = ($event) => emit("reset"))
2653
- }, {
2654
- default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode(" 重置 ", -1)])]),
2655
- _: 1
2656
- }), !props.hideFoldBtn ? (openBlock(), createBlock(unref(ElButton), {
2489
+ default: withCtx(() => [
2490
+ createVNode(unref(Grid), mergeProps({
2491
+ class: "w-full",
2492
+ "col-gap": 12
2493
+ }, props.gridProps, { collapsed: collapsed.value }), {
2494
+ default: withCtx(() => {
2495
+ var _a;
2496
+ return [
2497
+ (openBlock(true), createElementBlock(Fragment, null, renderList(props.columns, (item, index2) => {
2498
+ var _a2, _b;
2499
+ return openBlock(), createElementBlock(Fragment, null, [
2500
+ item.type === "title" ? (openBlock(), createBlock(unref(GridItem), {
2501
+ key: `title${index2}`,
2502
+ span: 24
2503
+ }, {
2504
+ default: withCtx(() => [
2505
+ createVNode(unref(ElFormItem), { "label-width": "0" }, {
2506
+ default: withCtx(() => [
2507
+ createVNode(_component_el_alert, {
2508
+ class: normalizeClass(unref(b)("form-item__title")),
2509
+ title: typeof item.label === "string" ? item.label : "",
2510
+ type: "info",
2511
+ closable: false
2512
+ }, null, 8, ["class", "title"])
2513
+ ]),
2514
+ _: 2
2515
+ }, 1024)
2516
+ ]),
2517
+ _: 2
2518
+ }, 1024)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2519
+ !isHide(item) ? (openBlock(), createBlock(unref(GridItem), mergeProps({
2520
+ key: item.field + index2
2521
+ }, { ref_for: true }, item.gridItemProps || props.gridItemProps, {
2522
+ span: item.span || ((_a2 = item.gridItemProps) == null ? void 0 : _a2.span) || ((_b = props == null ? void 0 : props.gridItemProps) == null ? void 0 : _b.span)
2523
+ }), {
2524
+ default: withCtx(() => [
2525
+ (openBlock(), createBlock(unref(ElFormItem), mergeProps({
2526
+ key: item.field + index2,
2527
+ prop: item.field,
2528
+ label: item.label,
2529
+ rules: getFormItemRules(item)
2530
+ }, { ref_for: true }, item.formItemProps), createSlots({
2531
+ default: withCtx(() => [
2532
+ item.type === "slot" ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
2533
+ renderSlot(_ctx.$slots, item.field, { item }, void 0, true)
2534
+ ])) : (openBlock(), createElementBlock("div", {
2535
+ key: 1,
2536
+ class: normalizeClass(unref(b)("form-item__content"))
2537
+ }, [
2538
+ createElementVNode("div", {
2539
+ class: normalizeClass(unref(b)("form-item__component"))
2540
+ }, [
2541
+ (openBlock(), createBlock(resolveDynamicComponent(CompMap[item.type] || item.type), mergeProps({
2542
+ disabled: isDisabled(item),
2543
+ class: "w-full"
2544
+ }, { ref_for: true }, getComponentBindProps(item), {
2545
+ "model-value": props.modelValue[item.fieldName || item.field],
2546
+ "onUpdate:modelValue": ($event) => updateModelValue($event, item)
2547
+ }), createSlots({ _: 2 }, [
2548
+ renderList((item == null ? void 0 : item.slots) || {}, (slotValue, slotKey) => {
2549
+ return {
2550
+ name: slotKey,
2551
+ fn: withCtx((scope) => [
2552
+ typeof slotValue === "string" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2553
+ createTextVNode(toDisplayString(slotValue), 1)
2554
+ ], 64)) : slotValue ? (openBlock(), createBlock(resolveDynamicComponent(slotValue(scope)), { key: 1 })) : createCommentVNode("", true)
2555
+ ])
2556
+ };
2557
+ })
2558
+ ]), 1040, ["disabled", "model-value", "onUpdate:modelValue"])),
2559
+ item.tip ? (openBlock(), createBlock(unref(ElText), {
2560
+ key: 0,
2561
+ class: normalizeClass(unref(b)("form-item__tip")),
2562
+ type: "info",
2563
+ size: "small"
2564
+ }, {
2565
+ default: withCtx(() => [
2566
+ createTextVNode(toDisplayString(item.tip), 1)
2567
+ ]),
2568
+ _: 2
2569
+ }, 1032, ["class"])) : createCommentVNode("", true)
2570
+ ], 2),
2571
+ item.extra ? (openBlock(), createElementBlock("div", {
2572
+ key: 0,
2573
+ class: normalizeClass(unref(b)("form-item__extra"))
2574
+ }, [
2575
+ typeof item.extra === "string" ? (openBlock(), createBlock(unref(ElText), {
2576
+ key: 0,
2577
+ type: "info",
2578
+ size: "small"
2579
+ }, {
2580
+ default: withCtx(() => [
2581
+ createTextVNode(toDisplayString(item.extra), 1)
2582
+ ]),
2583
+ _: 2
2584
+ }, 1024)) : item.extra ? (openBlock(), createBlock(resolveDynamicComponent(item.extra), { key: 1 })) : createCommentVNode("", true)
2585
+ ], 2)) : createCommentVNode("", true)
2586
+ ], 2))
2587
+ ]),
2588
+ _: 2
2589
+ }, [
2590
+ (item == null ? void 0 : item.labelRender) ? {
2591
+ name: "label",
2592
+ fn: withCtx(() => [
2593
+ (openBlock(), createBlock(resolveDynamicComponent(item.labelRender)))
2594
+ ]),
2595
+ key: "0"
2596
+ } : void 0
2597
+ ]), 1040, ["prop", "label", "rules"]))
2598
+ ]),
2599
+ _: 2
2600
+ }, 1040, ["span"])) : createCommentVNode("", true)
2601
+ ], 64))
2602
+ ], 64);
2603
+ }), 256)),
2604
+ props.search ? (openBlock(), createBlock(unref(GridItem), {
2657
2605
  key: 0,
2658
- class: "form__fold-btn",
2659
- type: "primary",
2660
- icon: collapsed.value ? unref(arrow_down_default) : unref(arrow_up_default),
2661
- text: "",
2662
- size: "small",
2663
- onClick: _cache[2] || (_cache[2] = ($event) => collapsed.value = !collapsed.value)
2606
+ suffix: props.suffix && props.search,
2607
+ span: (_a = props == null ? void 0 : props.gridItemProps) == null ? void 0 : _a.span
2664
2608
  }, {
2665
- default: withCtx(() => [createTextVNode(toDisplayString(collapsed.value ? "展开" : "收起"), 1)]),
2609
+ default: withCtx(() => [
2610
+ createVNode(unref(ElSpace), {
2611
+ class: normalizeClass(unref(b)("form__search-btns"))
2612
+ }, {
2613
+ default: withCtx(() => [
2614
+ createVNode(unref(ElButton), {
2615
+ type: "primary",
2616
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("search"))
2617
+ }, {
2618
+ default: withCtx(() => [
2619
+ createTextVNode(toDisplayString(_ctx.searchText), 1)
2620
+ ]),
2621
+ _: 1
2622
+ }),
2623
+ createVNode(unref(ElButton), {
2624
+ onClick: _cache[1] || (_cache[1] = ($event) => emit("reset"))
2625
+ }, {
2626
+ default: withCtx(() => [..._cache[3] || (_cache[3] = [
2627
+ createTextVNode(" 重置 ", -1)
2628
+ ])]),
2629
+ _: 1
2630
+ }),
2631
+ !props.hideFoldBtn ? (openBlock(), createBlock(unref(ElButton), {
2632
+ key: 0,
2633
+ class: "form__fold-btn",
2634
+ type: "primary",
2635
+ icon: collapsed.value ? unref(arrow_down_default) : unref(arrow_up_default),
2636
+ text: "",
2637
+ size: "small",
2638
+ onClick: _cache[2] || (_cache[2] = ($event) => collapsed.value = !collapsed.value)
2639
+ }, {
2640
+ default: withCtx(() => [
2641
+ createTextVNode(toDisplayString(collapsed.value ? "展开" : "收起"), 1)
2642
+ ]),
2643
+ _: 1
2644
+ }, 8, ["icon"])) : createCommentVNode("", true)
2645
+ ]),
2646
+ _: 1
2647
+ }, 8, ["class"])
2648
+ ]),
2666
2649
  _: 1
2667
- }, 8, ["icon"])) : createCommentVNode("", true)]),
2668
- _: 1
2669
- }, 8, ["class"])]),
2670
- _: 1
2671
- }, 8, ["suffix", "span"])) : createCommentVNode("", true)];
2672
- }),
2673
- _: 3
2674
- }, 16, ["collapsed"])]),
2650
+ }, 8, ["suffix", "span"])) : createCommentVNode("", true)
2651
+ ];
2652
+ }),
2653
+ _: 3
2654
+ }, 16, ["collapsed"])
2655
+ ]),
2675
2656
  _: 3
2676
2657
  }, 16, ["class", "model"]);
2677
2658
  };
2678
2659
  }
2679
2660
  });
2680
- const Form = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-85d6c1a1"]]);
2661
+ const Form = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-4c32de90"]]);
2681
2662
  const _hoisted_1$1 = ["data-value", "onClick"];
2682
2663
  const _sfc_main$7 = /* @__PURE__ */ defineComponent({
2683
2664
  __name: "nav-tabs",
@@ -3049,6 +3030,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
3049
3030
  });
3050
3031
  const PageLayout = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-0ed9c74a"]]);
3051
3032
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
3033
+ ...{
3034
+ name: "TableColumn"
3035
+ },
3052
3036
  __name: "table-column",
3053
3037
  props: {
3054
3038
  column: {}
@@ -3060,11 +3044,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
3060
3044
  return restProps;
3061
3045
  });
3062
3046
  return (_ctx, _cache) => {
3047
+ const _component_TableColumn = resolveComponent("TableColumn", true);
3063
3048
  const _directive_slots = resolveDirective("slots");
3064
3049
  return openBlock(), createBlock(unref(ElTableColumn), normalizeProps(guardReactiveProps(columnProps.value)), createSlots({
3065
3050
  default: withCtx(() => [
3066
3051
  _ctx.column.children && _ctx.column.children.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.column.children, (child) => {
3067
- return withDirectives((openBlock(), createBlock(_sfc_main$4, {
3052
+ return withDirectives((openBlock(), createBlock(_component_TableColumn, {
3068
3053
  key: child.prop || child.label,
3069
3054
  column: child
3070
3055
  }, null, 8, ["column"])), [
@@ -3096,22 +3081,18 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
3096
3081
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
3097
3082
  __name: "table",
3098
3083
  props: {
3099
- data: { default: () => [] },
3100
3084
  columns: { default: () => [] },
3101
3085
  pagination: { type: [Object, Boolean], default: () => ({}) },
3102
- size: {},
3103
- width: {},
3086
+ data: { default: () => [] },
3104
3087
  height: {},
3105
3088
  maxHeight: {},
3106
- fit: { type: Boolean, default: true },
3107
3089
  stripe: { type: Boolean },
3108
3090
  border: { type: Boolean },
3109
- rowKey: {},
3110
- context: {},
3091
+ size: {},
3092
+ fit: { type: Boolean, default: true },
3111
3093
  showHeader: { type: Boolean, default: true },
3112
- showSummary: { type: Boolean },
3113
- sumText: {},
3114
- summaryMethod: {},
3094
+ highlightCurrentRow: { type: Boolean },
3095
+ currentRowKey: {},
3115
3096
  rowClassName: {},
3116
3097
  rowStyle: {},
3117
3098
  cellClassName: {},
@@ -3120,30 +3101,52 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
3120
3101
  headerRowStyle: {},
3121
3102
  headerCellClassName: {},
3122
3103
  headerCellStyle: {},
3123
- highlightCurrentRow: { type: Boolean },
3124
- currentRowKey: {},
3104
+ rowKey: {},
3125
3105
  emptyText: {},
3126
- expandRowKeys: {},
3127
3106
  defaultExpandAll: { type: Boolean },
3107
+ expandRowKeys: {},
3128
3108
  defaultSort: {},
3129
3109
  tooltipEffect: {},
3130
3110
  tooltipOptions: {},
3111
+ appendFilterPanelTo: {},
3112
+ showSummary: { type: Boolean },
3113
+ sumText: {},
3114
+ summaryMethod: {},
3131
3115
  spanMethod: {},
3132
3116
  selectOnIndeterminate: { type: Boolean, default: true },
3133
3117
  indent: {},
3134
- treeProps: {},
3135
3118
  lazy: { type: Boolean },
3136
3119
  load: {},
3137
- className: {},
3138
- style: {},
3120
+ treeProps: {},
3139
3121
  tableLayout: {},
3140
3122
  scrollbarAlwaysOn: { type: Boolean },
3141
- flexible: { type: Boolean },
3142
3123
  showOverflowTooltip: { type: [Boolean, Object] },
3143
- tooltipFormatter: {},
3144
- appendFilterPanelTo: {},
3124
+ flexible: { type: Boolean },
3145
3125
  scrollbarTabindex: {},
3146
- nativeScrollbar: { type: Boolean }
3126
+ allowDragLastColumn: { type: Boolean },
3127
+ tooltipFormatter: {},
3128
+ preserveExpandedContent: { type: Boolean },
3129
+ nativeScrollbar: { type: Boolean },
3130
+ rowExpandable: {},
3131
+ onSelect: {},
3132
+ onSelectAll: {},
3133
+ onSelectionChange: {},
3134
+ onCellMouseEnter: {},
3135
+ onCellMouseLeave: {},
3136
+ onCellClick: {},
3137
+ onCellDblclick: {},
3138
+ onCellContextmenu: {},
3139
+ onRowClick: {},
3140
+ onRowContextmenu: {},
3141
+ onRowDblclick: {},
3142
+ onHeaderClick: {},
3143
+ onHeaderContextmenu: {},
3144
+ onSortChange: {},
3145
+ onFilterChange: {},
3146
+ onCurrentChange: {},
3147
+ onHeaderDragend: {},
3148
+ onExpandChange: {},
3149
+ onScroll: {}
3147
3150
  },
3148
3151
  setup(__props, { expose: __expose }) {
3149
3152
  const props = __props;
@@ -3214,7 +3217,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
3214
3217
  };
3215
3218
  }
3216
3219
  });
3217
- const Table = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-3f5ec8bc"]]);
3220
+ const _Table = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-42ae2dfb"]]);
3218
3221
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
3219
3222
  __name: "tabs",
3220
3223
  props: /* @__PURE__ */ mergeModels({
@@ -9172,7 +9175,7 @@ const components = {
9172
9175
  PageLayout,
9173
9176
  Dialog: _sfc_main$i,
9174
9177
  EditTable,
9175
- Table,
9178
+ Table: _Table,
9176
9179
  Tag,
9177
9180
  TreeTransfer
9178
9181
  };
@@ -9192,7 +9195,7 @@ const GiForm = Form;
9192
9195
  const GiPageLayout = PageLayout;
9193
9196
  const GiDialog = _sfc_main$i;
9194
9197
  const GiEditTable = EditTable;
9195
- const GiTable = Table;
9198
+ const GiTable = _Table;
9196
9199
  const GiTag = Tag;
9197
9200
  const GiTreeTransfer = TreeTransfer;
9198
9201
  function capitalizeWord(word) {