yc-vep-ui 0.3.41 → 0.3.42

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.
@@ -27,6 +27,7 @@ export declare const El: {
27
27
  readonly ButtonGroup: any;
28
28
  readonly Descriptions: any;
29
29
  readonly DescriptionsItem: any;
30
+ readonly Switch: any;
30
31
  readonly Message: any;
31
32
  };
32
33
  export declare function getIcon(name: string): any;
@@ -18,7 +18,8 @@ declare function link(props: LinkProps & {
18
18
  type?: 'primary' | 'success' | 'warning' | 'info' | 'danger';
19
19
  }): any;
20
20
  declare function tag(props: TagProps & {
21
- prop: string;
21
+ prop?: string;
22
+ text?: string | string[];
22
23
  }): any;
23
24
  declare function _switch(props: SwitchProps): any;
24
25
  declare function select(props: SelectProps): any;
@@ -1,5 +1,7 @@
1
- import { IField } from '../type';
1
+ import { IField, IColumn } from '../type';
2
2
  export declare function getLabelWidth(width?: string | number): string;
3
3
  export declare function getValueWidth(width: number | string): string;
4
4
  export declare function getRenderAttr<T>(field: IField<T>, data: T): any;
5
5
  export declare function renderNode<T>(field: IField<T>, data: T): any;
6
+ /** 模板配置,转渲染 */
7
+ export declare function tempToRender<T>(tempList: Array<IColumn<T> | IField<T>>): Array<IColumn<T> | IField<T>>;
@@ -136,6 +136,9 @@ var z = {
136
136
  get DescriptionsItem() {
137
137
  return $()?.resolveComponent?.("el-descriptions-item") || "el-descriptions-item";
138
138
  },
139
+ get Switch() {
140
+ return $()?.resolveComponent?.("el-switch") || "el-switch";
141
+ },
139
142
  get Message() {
140
143
  return me() || {
141
144
  error: (e) => console.error("[Message.error]", e),
@@ -162,9 +165,9 @@ function he(e) {
162
165
  } }, (Array.isArray(e) ? e : [e]).map((e) => {
163
166
  let { text: n, ...r } = e;
164
167
  return t(z.Button, {
165
- ...r,
166
168
  link: !0,
167
169
  size: "small",
170
+ ...r,
168
171
  type: e.type || "default"
169
172
  }, () => n);
170
173
  })) : null;
@@ -192,16 +195,19 @@ function ge(e) {
192
195
  }
193
196
  function _e(e) {
194
197
  let t = B();
195
- return t ? t("div", { style: {
198
+ if (!t) return null;
199
+ let n = e.text === void 0 ? e.prop : e.text;
200
+ return t("div", { style: {
196
201
  display: "flex",
197
202
  gap: "4px",
198
203
  flexDirection: "row",
199
- flexWrap: "wrap"
200
- } }, (Array.isArray(e.prop) ? e.prop : [e.prop]).map((n) => t(z.Tag, e, () => n))) : null;
204
+ flexWrap: "wrap",
205
+ alignItems: "center"
206
+ } }, (Array.isArray(n) ? n : [n || ""]).map((n) => t(z.Tag, e, () => n)));
201
207
  }
202
208
  function ve(e) {
203
209
  let t = B();
204
- return t ? t(z.Tag, { ...e }) : null;
210
+ return t ? t(z.Switch, { ...e }) : null;
205
211
  }
206
212
  function ye(e) {
207
213
  let t = B();
@@ -1028,7 +1034,7 @@ var Ot = { style: {
1028
1034
  "update:modelValue"
1029
1035
  ],
1030
1036
  setup(a, { expose: o, emit: s }) {
1031
- re((e) => ({ v57cec5bb: N(ee) / 2 }));
1037
+ re((e) => ({ v6444961e: N(ee) / 2 }));
1032
1038
  let u = s, d = a, { fields: f, labelWidth: p = "100px", valueWidth: h = "auto", omitFields: _ = [], rules: b = C({}), labelPosition: x = "top", valueModel: O = "default", column: ee = 24 } = d, A = w(0), M = w(), ne = t(() => d.modelValue !== void 0), ie = C({}), P = t(() => ne.value ? d.modelValue : d.model || ie), F = t({
1033
1039
  get: () => P.value,
1034
1040
  set: (e) => {
@@ -1111,7 +1117,7 @@ var Ot = { style: {
1111
1117
  }, { ref_for: !0 }, N(V)(r, F.value).props, {
1112
1118
  clearable: !0,
1113
1119
  key: `${r.prop}-${A.value}`,
1114
- style: { display: "inline-block" },
1120
+ style: { height: "100%" },
1115
1121
  class: { underline: N(O) === "underline" }
1116
1122
  }), null, 16, [
1117
1123
  "modelValue",
@@ -1191,7 +1197,7 @@ var Ot = { style: {
1191
1197
  ]))], 64);
1192
1198
  };
1193
1199
  }
1194
- }), It = /* @__PURE__ */ L({ default: () => Lt }), Lt = /* @__PURE__ */ R(Ft, [["__scopeId", "data-v-539b7aeb"]]), Rt = ["disabled"], zt = /* @__PURE__ */ u({
1200
+ }), It = /* @__PURE__ */ L({ default: () => Lt }), Lt = /* @__PURE__ */ R(Ft, [["__scopeId", "data-v-54cc8e91"]]), Rt = ["disabled"], zt = /* @__PURE__ */ u({
1195
1201
  __name: "index",
1196
1202
  props: /* @__PURE__ */ h({
1197
1203
  defaultValue: { default: "" },
@@ -1886,10 +1892,10 @@ var vn = /* @__PURE__ */ u({
1886
1892
  immediate: !0,
1887
1893
  deep: !0
1888
1894
  });
1889
- let p = t(() => r.limit && u.count < r.limit), m = t(() => r.limit && u.count >= r.limit), h = t(() => r.limit === void 0 ? !1 : !p.value);
1895
+ let p = t(() => r.limit && u.count < r.limit), m = t(() => r.limit && u.count >= r.limit), h = t(() => r.limit === void 0 ? !1 : !p.value), _ = t(() => f.value.some((e) => e.status === "uploading"));
1890
1896
  return (e, t) => {
1891
- let u = D("el-button"), _ = D("el-upload");
1892
- return S(), n(_, g(e.$attrs, {
1897
+ let u = D("el-button"), v = D("el-upload");
1898
+ return S(), n(v, g(e.$attrs, {
1893
1899
  style: { width: "100%" },
1894
1900
  action: r.action,
1895
1901
  "file-list": f.value,
@@ -1909,14 +1915,16 @@ var vn = /* @__PURE__ */ u({
1909
1915
  plain: "",
1910
1916
  icon: N(a),
1911
1917
  size: N(o),
1912
- disabled: N(d)
1918
+ disabled: N(d),
1919
+ loading: _.value
1913
1920
  }, {
1914
1921
  default: I(() => [c(j(N(i)), 1)]),
1915
1922
  _: 1
1916
1923
  }, 8, [
1917
1924
  "icon",
1918
1925
  "size",
1919
- "disabled"
1926
+ "disabled",
1927
+ "loading"
1920
1928
  ])]),
1921
1929
  key: "0"
1922
1930
  }]), 1040, [
@@ -1927,7 +1935,7 @@ var vn = /* @__PURE__ */ u({
1927
1935
  ]);
1928
1936
  };
1929
1937
  }
1930
- }), [["__scopeId", "data-v-43d34dc4"]]), jn = ["src"], Mn = /* @__PURE__ */ u({
1938
+ }), [["__scopeId", "data-v-090b952e"]]), jn = ["src"], Mn = /* @__PURE__ */ R(/* @__PURE__ */ u({
1931
1939
  __name: "image",
1932
1940
  props: {
1933
1941
  icon: {},
@@ -1942,45 +1950,54 @@ var vn = /* @__PURE__ */ u({
1942
1950
  onChange: { type: Function }
1943
1951
  },
1944
1952
  emits: ["update:fileList"],
1945
- setup(n, { emit: r }) {
1946
- let o = n, s = w({}), c = w(!1), u = r, d = t({
1947
- get: () => o.fileList || [],
1948
- set: (e) => u("update:fileList", e)
1949
- });
1950
- function f(e) {
1951
- s.value = e, c.value = !0;
1953
+ setup(o, { emit: s }) {
1954
+ let c = o, u = s, d = w({}), f = w(!1), p = w([]);
1955
+ P(() => c.fileList, (e) => {
1956
+ p.value = e || [];
1957
+ }, { immediate: !0 });
1958
+ let m = t(() => c.limit !== void 0 && p.value.length >= c.limit);
1959
+ P(p, (e) => u("update:fileList", e), { deep: !0 });
1960
+ function h(e) {
1961
+ d.value = e, f.value = !0;
1952
1962
  }
1953
- return (t, n) => {
1954
- let r = D("el-icon"), u = D("el-upload"), p = D("el-dialog");
1963
+ return (t, o) => {
1964
+ let s = D("el-icon"), u = D("el-upload"), _ = D("el-dialog");
1955
1965
  return S(), i(e, null, [l(u, g({
1956
1966
  accept: "image/*",
1957
- action: o.action,
1967
+ action: c.action,
1958
1968
  "auto-upload": !1
1959
1969
  }, t.$attrs, {
1970
+ limit: c.limit,
1960
1971
  "list-type": "picture-card",
1961
- "on-preview": f,
1962
- "file-list": d.value,
1963
- "onUpdate:fileList": n[0] ||= (e) => d.value = e
1972
+ "on-preview": h,
1973
+ "file-list": p.value,
1974
+ "onUpdate:fileList": o[0] ||= (e) => p.value = e,
1975
+ class: { "hide-upload-item": m.value }
1964
1976
  }), {
1965
- default: I(() => [l(r, null, {
1977
+ default: I(() => [m.value ? r("", !0) : (S(), n(s, { key: 0 }, {
1966
1978
  default: I(() => [l(N(Ge))]),
1967
1979
  _: 1
1968
- })]),
1980
+ }))]),
1969
1981
  _: 1
1970
- }, 16, ["action", "file-list"]), l(p, {
1971
- modelValue: c.value,
1972
- "onUpdate:modelValue": n[1] ||= (e) => c.value = e
1982
+ }, 16, [
1983
+ "action",
1984
+ "limit",
1985
+ "file-list",
1986
+ "class"
1987
+ ]), l(_, {
1988
+ modelValue: f.value,
1989
+ "onUpdate:modelValue": o[1] ||= (e) => f.value = e
1973
1990
  }, {
1974
1991
  default: I(() => [a("img", {
1975
1992
  "w-full": "",
1976
- src: s.value.url,
1993
+ src: d.value.url,
1977
1994
  alt: "预览"
1978
1995
  }, null, 8, jn)]),
1979
1996
  _: 1
1980
1997
  }, 8, ["modelValue"])], 64);
1981
1998
  };
1982
1999
  }
1983
- }), Nn = /* @__PURE__ */ u({
2000
+ }), [["__scopeId", "data-v-82d40f84"]]), Nn = /* @__PURE__ */ u({
1984
2001
  __name: "index",
1985
2002
  props: {
1986
2003
  icon: {},
@@ -2020,17 +2037,21 @@ var vn = /* @__PURE__ */ u({
2020
2037
  i("update:fileList", t), i("update:modelValue", t), i("remove", t);
2021
2038
  }
2022
2039
  function w(e, t) {
2023
- let n = [...a.fileList || []];
2024
2040
  if (e?.code !== "ok") return z.Message.error(e?.message);
2025
- let r = hn + `/attachment/downloadAttachment?objectKey=${e.data?.objectKey}&fileName=${e.data?.fileName}&token=${h.token}`;
2026
- n.some((t) => t?.objectKey === e.data?.objectKey) || n.push({
2041
+ let n = hn + `/attachment/downloadAttachment?objectKey=${e.data?.objectKey}&fileName=${e.data?.fileName}&token=${h.token}`, r = u && d && u[d] ? u[d] : a.fileList || [], o = r.some((n) => n?.uid === t.uid || n?.objectKey === e.data?.objectKey), s;
2042
+ s = o ? r.map((r) => r.uid === t.uid ? {
2043
+ ...r,
2044
+ status: "success",
2045
+ ...e.data,
2046
+ url: n
2047
+ } : r) : [...r, {
2027
2048
  name: t.name,
2028
2049
  uid: t.uid,
2029
2050
  size: t.size,
2030
2051
  status: "success",
2031
2052
  ...e.data,
2032
- url: r
2033
- }), i("update:fileList", n), i("update:modelValue", n), i("success", n);
2053
+ url: n
2054
+ }], i("update:fileList", s), i("update:modelValue", s), i("success", s);
2034
2055
  }
2035
2056
  function T(e, t, n) {
2036
2057
  i("update:fileList", n), i("update:modelValue", n);
@@ -1,2 +1,2 @@
1
- import { c as e, d as t, l as n, o as r, s as i, u as a } from "../entry-v6XpsDQF.js";
1
+ import { c as e, d as t, l as n, o as r, s as i, u as a } from "../entry-CDc4BKLZ.js";
2
2
  export { i as useDictionary, t as useFetch, e as useRoute, n as useRouter, a as useTable, r as useUser };
package/dist/index.css CHANGED
@@ -42,24 +42,24 @@
42
42
  }
43
43
  }
44
44
 
45
- .ui-form-buttons[data-v-539b7aeb] {
45
+ .ui-form-buttons[data-v-54cc8e91] {
46
46
  display: flex;
47
47
  justify-content: flex-start;
48
48
  align-items: center;
49
49
  }
50
50
  .ui-form {
51
- &[data-v-539b7aeb] {
51
+ &[data-v-54cc8e91] {
52
52
  display: grid;
53
- grid-template-columns: repeat(var(--v57cec5bb), minmax(0, 1fr));
53
+ grid-template-columns: repeat(var(--v6444961e), minmax(0, 1fr));
54
54
  gap: 0px 40px;
55
55
  }
56
- &[data-v-539b7aeb] .el-form-item__label {
56
+ &[data-v-54cc8e91] .el-form-item__label {
57
57
  margin-bottom: 0;
58
58
  font-weight: bold;
59
59
  font-size: 0.8em;
60
60
  color: #6b7280;
61
61
  }
62
- &[data-v-539b7aeb] .el-form-item__content {
62
+ &[data-v-54cc8e91] .el-form-item__content {
63
63
  display: flex;
64
64
  flex-wrap: inherit;
65
65
  width: 100%;
@@ -77,8 +77,8 @@
77
77
 
78
78
  /* 下划线样式 */
79
79
  .underline {
80
- &[data-v-539b7aeb] .el-input__wrapper,
81
- &[data-v-539b7aeb] .el-textarea__inner {
80
+ &[data-v-54cc8e91] .el-input__wrapper,
81
+ &[data-v-54cc8e91] .el-textarea__inner {
82
82
  box-shadow: 0px 1px 0px var(--el-input-border-color, var(--el-border-color));
83
83
  }
84
84
  }
@@ -175,10 +175,14 @@
175
175
  }
176
176
  }
177
177
 
178
- .hide-upload-text[data-v-43d34dc4] .el-upload--text {
178
+ .hide-upload-text[data-v-090b952e] .el-upload--text {
179
179
  display: none;
180
180
  }
181
- .hide-upload-list[data-v-43d34dc4] .el-upload-list {
181
+ .hide-upload-list[data-v-090b952e] .el-upload-list {
182
+ display: none;
183
+ }
184
+
185
+ .hide-upload-item[data-v-82d40f84] .el-upload--picture-card {
182
186
  display: none;
183
187
  }
184
188
 
package/dist/vep-ui.js CHANGED
@@ -1,2 +1,2 @@
1
- import { S as e, _ as t, a as n, b as r, f as i, g as a, h as o, i as s, m as c, n as l, p as u, r as d, t as f, v as p, x as m, y as h } from "./entry-v6XpsDQF.js";
1
+ import { S as e, _ as t, a as n, b as r, f as i, g as a, h as o, i as s, m as c, n as l, p as u, r as d, t as f, v as p, x as m, y as h } from "./entry-CDc4BKLZ.js";
2
2
  export { e as UiCard, o as UiDescriptions, c as UiDialog, p as UiEditor, r as UiFilter, h as UiForm, a as UiInfiniteScroll, u as UiStaffSelect, m as UiTable, t as UiTree, i as UiUpload, s as YcApproval, d as default, d as ycPlugin, f as getHostVue, n as hooks, l as setHostVue };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yc-vep-ui",
3
- "version": "0.3.41",
3
+ "version": "0.3.42",
4
4
  "type": "module",
5
5
  "description": "基于 Vue 3 + Element Plus 的企业级 UI 组件库",
6
6
  "keywords": [
@@ -34,12 +34,6 @@
34
34
  "dist",
35
35
  "README.md"
36
36
  ],
37
- "scripts": {
38
- "dev": "vite",
39
- "build": "vue-tsc && vite build",
40
- "build:lib": "vite build && node scripts/generate-entry-dts.cjs",
41
- "preview": "vite preview"
42
- },
43
37
  "dependencies": {
44
38
  "aieditor": "^1.4.0",
45
39
  "jsencrypt": "^3.5.4"
@@ -67,5 +61,11 @@
67
61
  },
68
62
  "sideEffects": [
69
63
  "**/*.css"
70
- ]
71
- }
64
+ ],
65
+ "scripts": {
66
+ "dev": "vite",
67
+ "build": "vue-tsc && vite build",
68
+ "build:lib": "vite build && node scripts/generate-entry-dts.cjs",
69
+ "preview": "vite preview"
70
+ }
71
+ }