yc-vep-ui 0.2.7 → 0.3.1

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.
@@ -1,5 +1,5 @@
1
- import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createPropsRestProxy as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, getCurrentInstance as d, h as f, isRef as p, mergeModels as m, mergeProps as h, nextTick as g, normalizeClass as _, normalizeStyle as v, onMounted as y, onUnmounted as b, openBlock as x, reactive as S, ref as C, renderList as w, renderSlot as T, resolveComponent as E, resolveDirective as D, resolveDynamicComponent as O, setBlockTracking as k, shallowRef as A, toDisplayString as j, toRaw as M, toValue as N, unref as P, useAttrs as F, useCssVars as ee, useModel as I, watch as L, watchEffect as R, withCtx as z, withDirectives as B, withKeys as te, withModifiers as V } from "vue";
2
- import { AiEditor as ne } from "aieditor";
1
+ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createPropsRestProxy as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, getCurrentInstance as d, h as f, isRef as p, mergeModels as m, mergeProps as h, nextTick as g, normalizeClass as _, normalizeStyle as v, onMounted as y, onUnmounted as b, openBlock as x, reactive as S, ref as C, renderList as w, renderSlot as T, resolveComponent as E, resolveDirective as D, resolveDynamicComponent as O, setBlockTracking as k, shallowRef as A, toDisplayString as j, toRaw as M, toValue as N, unref as P, useAttrs as F, useCssVars as ee, useModel as I, watch as L, watchEffect as R, withCtx as z, withDirectives as B, withKeys as te, withModifiers as ne } from "vue";
2
+ import { AiEditor as V } from "aieditor";
3
3
  //#region \0rolldown/runtime.js
4
4
  var H = Object.defineProperty, U = (e, t) => {
5
5
  let n = {};
@@ -953,13 +953,13 @@ var nt = { style: {
953
953
  "update:modelValue"
954
954
  ],
955
955
  setup(a, { expose: o, emit: s }) {
956
- ee((e) => ({ v13480ba6: P(D) / 2 }));
957
- let u = s, { fields: d, labelWidth: f = "100px", valueWidth: p = "auto", omitFields: m = [], rules: g = S({}), labelPosition: y = "top", valueModel: b = "default", column: D = 24, model: k, modelValue: A } = a, N = C(0), F = C(), I = t(() => A !== void 0), L = t(() => I.value ? A : k || {}), R = t({
958
- get: () => L.value,
956
+ ee((e) => ({ v7a27e328: P(D) / 2 }));
957
+ let u = s, { fields: d, labelWidth: f = "100px", valueWidth: p = "auto", omitFields: m = [], rules: g = S({}), labelPosition: y = "top", valueModel: b = "default", column: D = 24, model: k, modelValue: A } = a, N = C(0), F = C(), I = t(() => A !== void 0), L = S({}), R = t(() => I.value ? A : k || L), B = t({
958
+ get: () => R.value,
959
959
  set: (e) => {
960
960
  I.value && u("update:modelValue", e);
961
961
  }
962
- }), B = t(() => d.filter((e) => typeof e.prop == "string")), te = t(() => {
962
+ }), te = t(() => d.filter((e) => typeof e.prop == "string")), ne = t(() => {
963
963
  if (g && Object.keys(g).length) return g;
964
964
  let e = {};
965
965
  return d.forEach((t) => {
@@ -971,42 +971,42 @@ var nt = { style: {
971
971
  }), e;
972
972
  });
973
973
  async function V() {
974
- await F.value?.validate().catch(() => !1) && u("submit", M(L.value));
974
+ await F.value?.validate().catch(() => !1) && u("submit", M(R.value));
975
975
  }
976
- function ne() {
976
+ function H() {
977
977
  let e = {};
978
- Object.keys(L.value).forEach((t) => {
978
+ Object.keys(R.value).forEach((t) => {
979
979
  m.includes(t) || (e[t] = void 0);
980
- }), Object.assign(L.value, e), N.value += 1, u("reset", M(L.value));
980
+ }), Object.assign(R.value, e), N.value += 1, u("reset", M(R.value));
981
981
  }
982
- function H() {
983
- return M(L.value);
982
+ function U() {
983
+ return M(R.value);
984
984
  }
985
- function U(e) {
986
- Object.assign(L.value, e);
985
+ function re(e) {
986
+ Object.assign(R.value, e);
987
987
  }
988
- function re() {
988
+ function ie() {
989
989
  F.value?.clearValidate();
990
990
  }
991
- async function ie() {
991
+ async function W() {
992
992
  return new Promise((e) => {
993
993
  F.value?.validate((t, n) => e(n));
994
994
  });
995
995
  }
996
996
  return o({
997
- getValues: H,
998
- setValues: U,
999
- clearValidate: re,
997
+ getValues: U,
998
+ setValues: re,
999
+ clearValidate: ie,
1000
1000
  onSubmit: V,
1001
- validate: ie
1001
+ validate: W
1002
1002
  }), (t, a) => {
1003
1003
  let o = E("el-input"), s = E("el-form-item"), u = E("el-form"), d = E("el-button");
1004
1004
  return x(), i(e, null, [l(u, h({
1005
1005
  ref_key: "uiFormRef",
1006
1006
  ref: F,
1007
- model: R.value
1007
+ model: B.value
1008
1008
  }, t.$attrs, {
1009
- rules: te.value,
1009
+ rules: ne.value,
1010
1010
  inline: P(y) !== "top",
1011
1011
  "label-position": P(y),
1012
1012
  class: {
@@ -1015,7 +1015,7 @@ var nt = { style: {
1015
1015
  },
1016
1016
  "validate-on-rule-change": !1
1017
1017
  }), {
1018
- default: z(() => [(x(!0), i(e, null, w(B.value, (r) => (x(), n(s, {
1018
+ default: z(() => [(x(!0), i(e, null, w(te.value, (r) => (x(), n(s, {
1019
1019
  key: r.prop,
1020
1020
  label: r.label,
1021
1021
  "label-width": P(f),
@@ -1026,11 +1026,11 @@ var nt = { style: {
1026
1026
  gridColumn: `span ${(r?.span || P(D)) / 2 || 1}`
1027
1027
  })
1028
1028
  }, {
1029
- default: z(() => [r.render ? (x(), i(e, { key: 0 }, [P(Y)(r, R.value).component ? (x(), n(O(P(Y)(r, R.value).component), h({
1029
+ default: z(() => [r.render ? (x(), i(e, { key: 0 }, [P(Y)(r, B.value).component ? (x(), n(O(P(Y)(r, B.value).component), h({
1030
1030
  key: 1,
1031
- modelValue: R.value[r.prop],
1032
- "onUpdate:modelValue": (e) => R.value[r.prop] = e
1033
- }, { ref_for: !0 }, P(Y)(r, R.value).props, {
1031
+ modelValue: B.value[r.prop],
1032
+ "onUpdate:modelValue": (e) => B.value[r.prop] = e
1033
+ }, { ref_for: !0 }, P(Y)(r, B.value).props, {
1034
1034
  clearable: !0,
1035
1035
  key: `${r.prop}-${N.value}`,
1036
1036
  style: { display: "inline-block" },
@@ -1039,13 +1039,13 @@ var nt = { style: {
1039
1039
  "modelValue",
1040
1040
  "onUpdate:modelValue",
1041
1041
  "class"
1042
- ])) : (x(), i("span", ot, j(P(Y)(r, R.value) || "-"), 1)), (x(!0), i(e, null, w(r.slots, (e) => T(t.$slots, "default", { form: R.value }, () => [P(Y)(e, R.value).component ? (x(), n(O(P(Y)(e, R.value).component), h({
1042
+ ])) : (x(), i("span", ot, j(P(Y)(r, B.value) || "-"), 1)), (x(!0), i(e, null, w(r.slots, (e) => T(t.$slots, "default", { form: B.value }, () => [P(Y)(e, B.value).component ? (x(), n(O(P(Y)(e, B.value).component), h({
1043
1043
  key: 1,
1044
- modelValue: R.value[e.prop],
1045
- "onUpdate:modelValue": (t) => R.value[e.prop] = t,
1044
+ modelValue: B.value[e.prop],
1045
+ "onUpdate:modelValue": (t) => B.value[e.prop] = t,
1046
1046
  "default-value": e.defaultValue,
1047
1047
  placeholder: e.placeholder
1048
- }, { ref_for: !0 }, P(Y)(e, R.value).props, {
1048
+ }, { ref_for: !0 }, P(Y)(e, B.value).props, {
1049
1049
  style: {
1050
1050
  display: "inline-block",
1051
1051
  marginLeft: "10px",
@@ -1061,10 +1061,10 @@ var nt = { style: {
1061
1061
  "placeholder",
1062
1062
  "style",
1063
1063
  "class"
1064
- ])) : (x(), i("span", st, j(P(Y)(e, R.value) || "-"), 1))], !0)), 256))], 64)) : (x(), n(o, {
1064
+ ])) : (x(), i("span", st, j(P(Y)(e, B.value) || "-"), 1))], !0)), 256))], 64)) : (x(), n(o, {
1065
1065
  key: 1,
1066
- modelValue: R.value[r.prop],
1067
- "onUpdate:modelValue": (e) => R.value[r.prop] = e,
1066
+ modelValue: B.value[r.prop],
1067
+ "onUpdate:modelValue": (e) => B.value[r.prop] = e,
1068
1068
  placeholder: "请输入",
1069
1069
  clearable: !0,
1070
1070
  class: _({ underline: P(b) === "underline" })
@@ -1089,10 +1089,10 @@ var nt = { style: {
1089
1089
  "label-position",
1090
1090
  "class"
1091
1091
  ]), t.$attrs?.hideHandle ? r("", !0) : (x(), i("div", ct, [
1092
- T(t.$slots, "handle", { form: R.value }, void 0, !0),
1092
+ T(t.$slots, "handle", { form: B.value }, void 0, !0),
1093
1093
  l(d, {
1094
1094
  icon: P(Je),
1095
- onClick: ne,
1095
+ onClick: H,
1096
1096
  size: t.$props.size
1097
1097
  }, {
1098
1098
  default: z(() => [...a[0] ||= [c("重置", -1)]]),
@@ -1110,7 +1110,7 @@ var nt = { style: {
1110
1110
  ]))], 64);
1111
1111
  };
1112
1112
  }
1113
- }), ut = /* @__PURE__ */ U({ default: () => dt }), dt = /* @__PURE__ */ W(lt, [["__scopeId", "data-v-65bc3d19"]]), ft = ["disabled"], pt = /* @__PURE__ */ u({
1113
+ }), ut = /* @__PURE__ */ U({ default: () => dt }), dt = /* @__PURE__ */ W(lt, [["__scopeId", "data-v-21628f1c"]]), ft = ["disabled"], pt = /* @__PURE__ */ u({
1114
1114
  __name: "index",
1115
1115
  props: /* @__PURE__ */ m({
1116
1116
  defaultValue: { default: "" },
@@ -1129,7 +1129,7 @@ var nt = { style: {
1129
1129
  setup(e, { emit: t }) {
1130
1130
  let n = C(), r = I(e, "modelValue"), a = C(r.value || e.defaultValue || ""), o = null, s = t;
1131
1131
  return y(() => {
1132
- o = new ne({
1132
+ o = new V({
1133
1133
  element: n.value,
1134
1134
  placeholder: "点击输入内容...",
1135
1135
  content: r.value || e.defaultValue || "",
@@ -1659,7 +1659,7 @@ var Wt = /* @__PURE__ */ u({
1659
1659
  }));
1660
1660
  }
1661
1661
  function L(e, t) {
1662
- let n = (t?.checkedNodes.filter((e) => e.account)).map((e) => `${e.name}(${e.account})`);
1662
+ let n = t?.checkedNodes?.map((e) => `${e.name}(${e.account ?? e.code})`);
1663
1663
  T.value = Ht(T.value.concat(n));
1664
1664
  }
1665
1665
  function B() {
@@ -1672,7 +1672,7 @@ var Wt = /* @__PURE__ */ u({
1672
1672
  });
1673
1673
  u("change", e), u("update:modelValue", e), _.value = !1, H();
1674
1674
  }
1675
- function ne() {
1675
+ function V() {
1676
1676
  u("update:modelValue", void 0), _.value = !1;
1677
1677
  }
1678
1678
  function H() {
@@ -1731,6 +1731,7 @@ var Wt = /* @__PURE__ */ u({
1731
1731
  load: M,
1732
1732
  onCheck: L,
1733
1733
  "show-checkbox": "",
1734
+ "check-strictly": "",
1734
1735
  lazy: "",
1735
1736
  class: "staff-tree",
1736
1737
  ref_key: "staffDialogRef",
@@ -1741,11 +1742,11 @@ var Wt = /* @__PURE__ */ u({
1741
1742
  class: "staff-item"
1742
1743
  }, [a("span", null, j(e), 1), l(d, {
1743
1744
  color: "red",
1744
- onClick: V((t) => ee(e), ["stop"])
1745
+ onClick: ne((t) => ee(e), ["stop"])
1745
1746
  }, {
1746
1747
  default: z(() => [l(P(Me))]),
1747
1748
  _: 1
1748
- }, 8, ["onClick"])]))), 128))])])]), a("div", Zt, [l(p, { onClick: ne }, {
1749
+ }, 8, ["onClick"])]))), 128))])])]), a("div", Zt, [l(p, { onClick: V }, {
1749
1750
  default: z(() => [...n[5] ||= [c("取消", -1)]]),
1750
1751
  _: 1
1751
1752
  }), l(p, {
@@ -1759,7 +1760,7 @@ var Wt = /* @__PURE__ */ u({
1759
1760
  }, 8, ["modelValue"])], 64);
1760
1761
  };
1761
1762
  }
1762
- }), [["__scopeId", "data-v-5c901fff"]]), $t = /* @__PURE__ */ u({
1763
+ }), [["__scopeId", "data-v-6fc1bd58"]]), $t = /* @__PURE__ */ u({
1763
1764
  __name: "index",
1764
1765
  props: {
1765
1766
  multiple: { type: Boolean },
@@ -2155,24 +2156,24 @@ var Q = {
2155
2156
  //#endregion
2156
2157
  //#region src/hooks/useTable/common.ts
2157
2158
  function vn(e, n) {
2158
- let { defaultParams: r, ...i } = n, a = (e) => {
2159
- let { tableId: t, page: n, pageSize: r, sort: i, ...a } = JSON.parse(JSON.stringify(e || {}));
2160
- return {
2161
- tableId: t,
2162
- page: n || 1,
2163
- pageSize: r || 10,
2164
- params: {
2165
- ...a,
2166
- sort: i
2167
- }
2168
- };
2169
- }, o = pn(e, {
2159
+ let { defaultParams: r, ...i } = n, a = p(r) ? r : C(r || {}), o = pn(e, {
2170
2160
  ...i,
2171
2161
  ready: t(() => {
2172
- let e = p(n.ready) ? n.ready.value : n.ready, t = !!N(r)?.tableId;
2162
+ let e = p(n.ready) ? n.ready.value : n.ready, t = !!a.value?.tableId;
2173
2163
  return (e === void 0 || e) && t;
2174
2164
  }),
2175
- defaultParams: t(() => a(N(r))),
2165
+ defaultParams: t(() => {
2166
+ let { tableId: e, page: t, pageSize: n, sort: r, ...i } = N(a) || {};
2167
+ return {
2168
+ tableId: e,
2169
+ page: t || 1,
2170
+ pageSize: n || 10,
2171
+ params: {
2172
+ ...i,
2173
+ sort: r
2174
+ }
2175
+ };
2176
+ }),
2176
2177
  ignoreAttrs: [
2177
2178
  "tableName",
2178
2179
  "sort",
@@ -2180,42 +2181,38 @@ function vn(e, n) {
2180
2181
  ]
2181
2182
  });
2182
2183
  function s(e = {}) {
2183
- if (e) {
2184
- let e = N(r), t = e?.sort ? { sort: e.sort } : {};
2185
- Object.assign(e, {
2186
- ...t,
2187
- page: 1,
2188
- pageSize: 10
2189
- });
2190
- }
2184
+ Object.assign(a.value, e, {
2185
+ page: 1,
2186
+ pageSize: 10
2187
+ });
2191
2188
  }
2192
2189
  async function c(e) {
2193
- let t = N(r);
2190
+ let t = N(a);
2194
2191
  return Q.post("/common/insert", {
2195
2192
  params: { ...e },
2196
2193
  tableId: t?.tableId
2197
2194
  });
2198
2195
  }
2199
2196
  async function l(e) {
2200
- let t = N(r);
2197
+ let t = N(a);
2201
2198
  return Q.post("/common/update", {
2202
2199
  params: { ...e },
2203
2200
  tableId: t?.tableId
2204
2201
  });
2205
2202
  }
2206
2203
  async function u(e) {
2207
- let t = N(r);
2204
+ let t = N(a);
2208
2205
  return Q.post("/common/delete", {
2209
2206
  idList: e,
2210
2207
  tableId: t?.tableId
2211
2208
  });
2212
2209
  }
2213
- async function d(e, t) {
2214
- let { title: n = "export" } = e || {}, i = N(r), a = await Q.blob(t ?? "/common/exportExcel", {
2215
- tableId: i?.tableId,
2210
+ async function d(t) {
2211
+ let { title: n = "export" } = t || {}, r = N(a), i = await Q.blob(e ?? "/common/exportExcel", {
2212
+ tableId: r?.tableId,
2216
2213
  type: "all"
2217
- }), o = document.createElement("a");
2218
- o.href = window.URL.createObjectURL(a), o.download = `${n}.xlsx`, o.click(), G.Message.success("导出成功"), window.URL.revokeObjectURL(o.href);
2214
+ }), o = new Blob([i]), s = document.createElement("a");
2215
+ s.href = window.URL.createObjectURL(o), s.download = `${n}.xlsx`, s.click(), G.Message.success("导出成功"), window.URL.revokeObjectURL(s.href);
2219
2216
  }
2220
2217
  let f = S({
2221
2218
  loading: !1,
@@ -1,2 +1,2 @@
1
- import { a as e, o as t } from "../entry-WJeRIKtA.js";
1
+ import { a as e, o as t } from "../entry-C4bXrk4F.js";
2
2
  export { t as useFetch, e as useTable };
@@ -1,3 +1,3 @@
1
1
  import { TableReturn, IExtra } from './type';
2
2
  import { FetchOptions } from '../useFetch';
3
- export declare function useTable<T = any>(url: string, options: FetchOptions<T> & IExtra): TableReturn<T>;
3
+ export declare function useTable<T>(url: string, options: FetchOptions<T> & IExtra): TableReturn<T>;
package/dist/index.css CHANGED
@@ -42,24 +42,24 @@
42
42
  }
43
43
  }
44
44
 
45
- .ui-form-buttons[data-v-65bc3d19] {
45
+ .ui-form-buttons[data-v-21628f1c] {
46
46
  display: flex;
47
47
  justify-content: flex-start;
48
48
  align-items: center;
49
49
  }
50
50
  .ui-form {
51
- &[data-v-65bc3d19] {
51
+ &[data-v-21628f1c] {
52
52
  display: grid;
53
- grid-template-columns: repeat(var(--v13480ba6), minmax(0, 1fr));
53
+ grid-template-columns: repeat(var(--v7a27e328), minmax(0, 1fr));
54
54
  gap: 0px 40px;
55
55
  }
56
- &[data-v-65bc3d19] .el-form-item__label {
56
+ &[data-v-21628f1c] .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-65bc3d19] .el-form-item__content {
62
+ &[data-v-21628f1c] .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-65bc3d19] .el-input__wrapper,
81
- &[data-v-65bc3d19] .el-textarea__inner {
80
+ &[data-v-21628f1c] .el-input__wrapper,
81
+ &[data-v-21628f1c] .el-textarea__inner {
82
82
  box-shadow: 0px 1px 0px var(--el-input-border-color, var(--el-border-color));
83
83
  }
84
84
  }
@@ -141,7 +141,7 @@
141
141
  }
142
142
  }
143
143
 
144
- .staff-tree[data-v-5c901fff] {
144
+ .staff-tree[data-v-6fc1bd58] {
145
145
  position: relative;
146
146
  height: 90%;
147
147
  overflow-y: auto;
@@ -149,28 +149,28 @@
149
149
  border-radius: 4px;
150
150
  margin-top: 8px;
151
151
  }
152
- .staff-select-trigger[data-v-5c901fff] {
152
+ .staff-select-trigger[data-v-6fc1bd58] {
153
153
  width: 100%;
154
154
  cursor: pointer;
155
155
  }
156
- .staff-select-trigger[data-v-5c901fff] .el-select {
156
+ .staff-select-trigger[data-v-6fc1bd58] .el-select {
157
157
  width: 100%;
158
158
  pointer-events: none;
159
159
  }
160
160
  .staff-item {
161
- &[data-v-5c901fff] {
161
+ &[data-v-6fc1bd58] {
162
162
  line-height: 28px;
163
163
  padding: 0% 20px 0% 10px;
164
164
  display: flex;
165
165
  justify-content: space-between;
166
166
  align-items: center;
167
167
  }
168
- &[data-v-5c901fff]:hover {
168
+ &[data-v-6fc1bd58]:hover {
169
169
  background-color: rgba(102, 177, 255, 0.5);
170
170
  }
171
171
  }
172
172
  .is-required {
173
- &[data-v-5c901fff] .el-select__wrapper {
173
+ &[data-v-6fc1bd58] .el-select__wrapper {
174
174
  border: 1px solid red;
175
175
  }
176
176
  }
package/dist/vep-ui.js CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as e, c as t, d as n, f as r, g as i, h as a, i as o, l as s, m as c, n as l, p as u, r as d, s as f, t as p, u as m } from "./entry-WJeRIKtA.js";
1
+ import { _ as e, c as t, d as n, f as r, g as i, h as a, i as o, l as s, m as c, n as l, p as u, r as d, s as f, t as p, u as m } from "./entry-C4bXrk4F.js";
2
2
  export { e as UiCard, m as UiDescriptions, s as UiDialog, u as UiEditor, a as UiFilter, c as UiForm, n as UiInfiniteScroll, t as UiStaffSelect, i as UiTable, r as UiTree, f as UiUpload, d as default, d as ycPlugin, p as getHostVue, o as hooks, l as setHostVue };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yc-vep-ui",
3
- "version": "0.2.7",
3
+ "version": "0.3.1",
4
4
  "type": "module",
5
5
  "description": "基于 Vue 3 + Element Plus 的企业级 UI 组件库",
6
6
  "keywords": [
@@ -34,6 +34,12 @@
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
+ },
37
43
  "dependencies": {
38
44
  "aieditor": "^1.4.0"
39
45
  },
@@ -60,11 +66,5 @@
60
66
  },
61
67
  "sideEffects": [
62
68
  "**/*.css"
63
- ],
64
- "scripts": {
65
- "dev": "vite",
66
- "build": "vue-tsc && vite build",
67
- "build:lib": "vite build && node scripts/generate-entry-dts.cjs",
68
- "preview": "vite preview"
69
- }
70
- }
69
+ ]
70
+ }