yc-vep-ui 0.3.40 → 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>>;
@@ -49,10 +49,7 @@ var le = Object.defineProperty, L = (e, t) => {
49
49
  //#endregion
50
50
  //#region src/components/utils/components.ts
51
51
  function me() {
52
- let e = d();
53
- if (console.log("[getMessage] instance:", !!e), console.log("[getMessage] instance.type:", e?.type?.name), console.log("[getMessage] appContext:", e?.appContext), e?.appContext) return console.log("[getMessage] from instance.appContext"), e.appContext.config.globalProperties.$message || null;
54
- let t = $();
55
- return console.log("[getMessage] hostVue:", !!t), console.log("[getMessage] hostVue.config:", t?.config), console.log("[getMessage] hostVue.$message:", t?.config?.globalProperties?.$message), t?.config?.globalProperties?.$message ? (console.log("[getMessage] from hostVue.config"), t.config.globalProperties.$message) : e?.app?.config?.globalProperties?.$message ? (console.log("[getMessage] from instance.app"), e.app.config.globalProperties.$message) : null;
52
+ return d()?.appContext.config.globalProperties.$message || null;
56
53
  }
57
54
  var z = {
58
55
  get Button() {
@@ -139,6 +136,9 @@ var z = {
139
136
  get DescriptionsItem() {
140
137
  return $()?.resolveComponent?.("el-descriptions-item") || "el-descriptions-item";
141
138
  },
139
+ get Switch() {
140
+ return $()?.resolveComponent?.("el-switch") || "el-switch";
141
+ },
142
142
  get Message() {
143
143
  return me() || {
144
144
  error: (e) => console.error("[Message.error]", e),
@@ -165,9 +165,9 @@ function he(e) {
165
165
  } }, (Array.isArray(e) ? e : [e]).map((e) => {
166
166
  let { text: n, ...r } = e;
167
167
  return t(z.Button, {
168
- ...r,
169
168
  link: !0,
170
169
  size: "small",
170
+ ...r,
171
171
  type: e.type || "default"
172
172
  }, () => n);
173
173
  })) : null;
@@ -195,16 +195,19 @@ function ge(e) {
195
195
  }
196
196
  function _e(e) {
197
197
  let t = B();
198
- 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: {
199
201
  display: "flex",
200
202
  gap: "4px",
201
203
  flexDirection: "row",
202
- flexWrap: "wrap"
203
- } }, (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)));
204
207
  }
205
208
  function ve(e) {
206
209
  let t = B();
207
- return t ? t(z.Tag, { ...e }) : null;
210
+ return t ? t(z.Switch, { ...e }) : null;
208
211
  }
209
212
  function ye(e) {
210
213
  let t = B();
@@ -1031,7 +1034,7 @@ var Ot = { style: {
1031
1034
  "update:modelValue"
1032
1035
  ],
1033
1036
  setup(a, { expose: o, emit: s }) {
1034
- re((e) => ({ v57cec5bb: N(ee) / 2 }));
1037
+ re((e) => ({ v6444961e: N(ee) / 2 }));
1035
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({
1036
1039
  get: () => P.value,
1037
1040
  set: (e) => {
@@ -1114,7 +1117,7 @@ var Ot = { style: {
1114
1117
  }, { ref_for: !0 }, N(V)(r, F.value).props, {
1115
1118
  clearable: !0,
1116
1119
  key: `${r.prop}-${A.value}`,
1117
- style: { display: "inline-block" },
1120
+ style: { height: "100%" },
1118
1121
  class: { underline: N(O) === "underline" }
1119
1122
  }), null, 16, [
1120
1123
  "modelValue",
@@ -1194,7 +1197,7 @@ var Ot = { style: {
1194
1197
  ]))], 64);
1195
1198
  };
1196
1199
  }
1197
- }), 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({
1198
1201
  __name: "index",
1199
1202
  props: /* @__PURE__ */ h({
1200
1203
  defaultValue: { default: "" },
@@ -1889,10 +1892,10 @@ var vn = /* @__PURE__ */ u({
1889
1892
  immediate: !0,
1890
1893
  deep: !0
1891
1894
  });
1892
- 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"));
1893
1896
  return (e, t) => {
1894
- let u = D("el-button"), _ = D("el-upload");
1895
- return S(), n(_, g(e.$attrs, {
1897
+ let u = D("el-button"), v = D("el-upload");
1898
+ return S(), n(v, g(e.$attrs, {
1896
1899
  style: { width: "100%" },
1897
1900
  action: r.action,
1898
1901
  "file-list": f.value,
@@ -1912,14 +1915,16 @@ var vn = /* @__PURE__ */ u({
1912
1915
  plain: "",
1913
1916
  icon: N(a),
1914
1917
  size: N(o),
1915
- disabled: N(d)
1918
+ disabled: N(d),
1919
+ loading: _.value
1916
1920
  }, {
1917
1921
  default: I(() => [c(j(N(i)), 1)]),
1918
1922
  _: 1
1919
1923
  }, 8, [
1920
1924
  "icon",
1921
1925
  "size",
1922
- "disabled"
1926
+ "disabled",
1927
+ "loading"
1923
1928
  ])]),
1924
1929
  key: "0"
1925
1930
  }]), 1040, [
@@ -1930,7 +1935,7 @@ var vn = /* @__PURE__ */ u({
1930
1935
  ]);
1931
1936
  };
1932
1937
  }
1933
- }), [["__scopeId", "data-v-43d34dc4"]]), jn = ["src"], Mn = /* @__PURE__ */ u({
1938
+ }), [["__scopeId", "data-v-090b952e"]]), jn = ["src"], Mn = /* @__PURE__ */ R(/* @__PURE__ */ u({
1934
1939
  __name: "image",
1935
1940
  props: {
1936
1941
  icon: {},
@@ -1945,45 +1950,54 @@ var vn = /* @__PURE__ */ u({
1945
1950
  onChange: { type: Function }
1946
1951
  },
1947
1952
  emits: ["update:fileList"],
1948
- setup(n, { emit: r }) {
1949
- let o = n, s = w({}), c = w(!1), u = r, d = t({
1950
- get: () => o.fileList || [],
1951
- set: (e) => u("update:fileList", e)
1952
- });
1953
- function f(e) {
1954
- 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;
1955
1962
  }
1956
- return (t, n) => {
1957
- 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");
1958
1965
  return S(), i(e, null, [l(u, g({
1959
1966
  accept: "image/*",
1960
- action: o.action,
1967
+ action: c.action,
1961
1968
  "auto-upload": !1
1962
1969
  }, t.$attrs, {
1970
+ limit: c.limit,
1963
1971
  "list-type": "picture-card",
1964
- "on-preview": f,
1965
- "file-list": d.value,
1966
- "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 }
1967
1976
  }), {
1968
- default: I(() => [l(r, null, {
1977
+ default: I(() => [m.value ? r("", !0) : (S(), n(s, { key: 0 }, {
1969
1978
  default: I(() => [l(N(Ge))]),
1970
1979
  _: 1
1971
- })]),
1980
+ }))]),
1972
1981
  _: 1
1973
- }, 16, ["action", "file-list"]), l(p, {
1974
- modelValue: c.value,
1975
- "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
1976
1990
  }, {
1977
1991
  default: I(() => [a("img", {
1978
1992
  "w-full": "",
1979
- src: s.value.url,
1993
+ src: d.value.url,
1980
1994
  alt: "预览"
1981
1995
  }, null, 8, jn)]),
1982
1996
  _: 1
1983
1997
  }, 8, ["modelValue"])], 64);
1984
1998
  };
1985
1999
  }
1986
- }), Nn = /* @__PURE__ */ u({
2000
+ }), [["__scopeId", "data-v-82d40f84"]]), Nn = /* @__PURE__ */ u({
1987
2001
  __name: "index",
1988
2002
  props: {
1989
2003
  icon: {},
@@ -2023,17 +2037,21 @@ var vn = /* @__PURE__ */ u({
2023
2037
  i("update:fileList", t), i("update:modelValue", t), i("remove", t);
2024
2038
  }
2025
2039
  function w(e, t) {
2026
- let n = [...a.fileList || []];
2027
2040
  if (e?.code !== "ok") return z.Message.error(e?.message);
2028
- let r = hn + `/attachment/downloadAttachment?objectKey=${e.data?.objectKey}&fileName=${e.data?.fileName}&token=${h.token}`;
2029
- 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, {
2030
2048
  name: t.name,
2031
2049
  uid: t.uid,
2032
2050
  size: t.size,
2033
2051
  status: "success",
2034
2052
  ...e.data,
2035
- url: r
2036
- }), 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);
2037
2055
  }
2038
2056
  function T(e, t, n) {
2039
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-Bu3txmxT.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-Bu3txmxT.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.40",
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
+ }