| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- var y = Object.defineProperty;
- var c = Object.getOwnPropertySymbols;
- var S = Object.prototype.hasOwnProperty, g = Object.prototype.propertyIsEnumerable;
- var u = (l, t, o) => t in l ? y(l, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : l[t] = o, a = (l, t) => {
- for (var o in t || (t = {}))
- S.call(t, o) && u(l, o, t[o]);
- if (c)
- for (var o of c(t))
- g.call(t, o) && u(l, o, t[o]);
- return l;
- };
- import { useAttrs as C, computed as s, openBlock as i, createElementBlock as d, normalizeStyle as w, createVNode as B, mergeProps as A, withCtx as O, renderSlot as m, createCommentVNode as k, createElementVNode as N } from "vue";
- import { _ as V } from "./index5.js";
- const x = {
- key: 0,
- class: "label"
- }, E = { class: "s-form-item-content" }, F = {
- __name: "SFormItem",
- props: {
- // 标签文案
- label: {
- type: String,
- default: ""
- },
- // 标签宽度(不传沿用 SForm 的设置)
- labelWidth: {
- type: [Number, String],
- default: "100%"
- },
- // 支持嵌套字段:name 传字符串,或传数组路径(如 ['dsConfigRdb', 'dbCode']),与 a-form-item 一致
- name: {
- type: [String, Array],
- default: ""
- },
- // 多列布局(SForm column>1 或 SCollapsesItem column>1)时,本项独占一整行
- full: {
- type: Boolean,
- default: !1
- }
- },
- setup(l) {
- const t = C(), o = l, f = s(() => o.full ? { gridColumn: "1 / -1" } : {}), p = /* @__PURE__ */ new Set([
- "disabled",
- "allowClear",
- "clearable",
- "showSearch",
- "multiple",
- "readonly",
- "autofocus",
- "bordered",
- "checked",
- "open",
- "autoClearSearchValue",
- "noDrag",
- "isManual",
- "expandAll",
- "recursionChildren",
- "treeCheckable",
- "showOnlyOrganization",
- "isDataScopeFilter"
- ]), b = (e) => typeof e == "boolean" ? e : e === "" || e === null || e === void 0 ? e === "" ? !0 : e : typeof e == "string" ? !(e === "false" || e === "0") : !!e, h = s(() => {
- const e = {};
- return Object.keys(t || {}).forEach((n) => {
- const r = t[n];
- e[n] = p.has(n) ? b(r) : r;
- }), e;
- }), _ = s(() => {
- const e = o.labelWidth + "";
- return {
- labelCol: {
- style: {
- width: e.includes("px") ? e : e + "px"
- }
- }
- };
- });
- return (e, n) => {
- const r = V;
- return i(), d("div", {
- class: "s-form-item",
- style: w(f.value)
- }, [
- B(r, A({
- label: l.label,
- name: l.name
- }, a(a({}, _.value), h.value), { class: "s-form-item" }), {
- default: O(() => [
- e.$slots.label ? (i(), d("div", x, [
- m(e.$slots, "label")
- ])) : k("", !0),
- N("div", E, [
- m(e.$slots, "default")
- ])
- ]),
- _: 3
- }, 16, ["label", "name"])
- ], 4);
- };
- }
- };
- export {
- F as default
- };
|