sand-components-vben 2.7.143 → 2.7.145

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.
@@ -43977,16 +43977,16 @@ const j$e = { class: "sand-editor" }, z$e = {
43977
43977
  setup(e, { emit: t }) {
43978
43978
  const n = e, r = t, i = lt(), o = Oe(null), a = Oe(n.modalValue || ""), s = new aE(rt.requestClient), l = (g) => ({
43979
43979
  // 必须有 server 字段,虽然我们用 customUpload,但有时编辑器会校验
43980
- server: rt.VITE_GLOB_UPLOAD_URL + "/infra/file/upload",
43980
+ server: rt.VITE_GLOB_UPLOAD_URL + "/infra/file/v2/upload",
43981
43981
  // 自定义上传逻辑
43982
43982
  async customUpload(h, m) {
43983
43983
  if (console.log(`[WangEditor] 开始上传 ${g}:`, h), !!h)
43984
43984
  try {
43985
- const S = rt.VITE_GLOB_UPLOAD_URL + "/infra/file/upload", E = await s.upload(S, {
43985
+ const S = rt.VITE_GLOB_UPLOAD_URL + "/infra/file/v2/upload", E = await s.upload(S, {
43986
43986
  file: h
43987
43987
  // 传给 uploader 的参数,根据你的 fileUploader 实现调整
43988
- });
43989
- console.log("[WangEditor] 上传成功,返回地址:", E), g === "image" ? m(E, "image", "") : m(E, "");
43988
+ }), { accessPrefix: v, paths: A } = E, b = v + A[0];
43989
+ g === "image" ? m(b, "image", "") : m(b, "");
43990
43990
  } catch (S) {
43991
43991
  console.error("[WangEditor] 上传出错:", S);
43992
43992
  }
@@ -44018,12 +44018,18 @@ const j$e = { class: "sand-editor" }, z$e = {
44018
44018
  };
44019
44019
  return Ue(a, (g) => {
44020
44020
  r("update:modalValue", g), r("change", g);
44021
- }), Ue(() => n.modalValue, (g) => {
44022
- g !== a.value && (a.value = g);
44023
- }), Ue(() => n.readOnly, (g) => {
44024
- const h = i.value;
44025
- h && (g ? h.disable() : h.enable());
44026
- }), (g, h) => (q(), re("div", Z$e, [
44021
+ }), Ue(
44022
+ () => n.modalValue,
44023
+ (g) => {
44024
+ g !== a.value && (a.value = g);
44025
+ }
44026
+ ), Ue(
44027
+ () => n.readOnly,
44028
+ (g) => {
44029
+ const h = i.value;
44030
+ h && (g ? h.disable() : h.enable());
44031
+ }
44032
+ ), (g, h) => (q(), re("div", Z$e, [
44027
44033
  L(H(lpe), {
44028
44034
  ref_key: "toolbarRef",
44029
44035
  ref: o,
@@ -44043,7 +44049,7 @@ const j$e = { class: "sand-editor" }, z$e = {
44043
44049
  }, null, 8, ["modelValue", "defaultConfig", "mode"])
44044
44050
  ]));
44045
44051
  }
44046
- }, $$e = /* @__PURE__ */ Ft(X$e, [["__scopeId", "data-v-a9596778"]]);
44052
+ }, $$e = /* @__PURE__ */ Ft(X$e, [["__scopeId", "data-v-b109e19b"]]);
44047
44053
  var vb = { exports: {} }, eet = vb.exports, PW;
44048
44054
  function tet() {
44049
44055
  return PW || (PW = 1, function(e, t) {
@@ -45062,65 +45068,68 @@ const ret = /* @__PURE__ */ AP(net), iet = { class: "group-box" }, oet = {
45062
45068
  emits: ["update:value", "update:previewPath"],
45063
45069
  setup(e, { emit: t }) {
45064
45070
  const n = sr("handleGetExtraData"), r = t, i = e, o = Ut({
45065
- imageList: [],
45066
- flag: !1
45071
+ imageList: []
45072
+ // 删除 flag
45067
45073
  });
45068
- let { imageList: a, flag: s } = cn(o);
45069
- const l = (d) => {
45070
- a.value.splice(d, 1);
45071
- const p = a.value.length === 0 ? void 0 : JSON.stringify(a.value);
45072
- r("update:value", p);
45073
- }, u = te(() => i.value), c = (d) => {
45074
- let p = d.map((f) => ({
45075
- name: f.originalName,
45076
- url: f.downloadPath
45074
+ let { imageList: a } = cn(o);
45075
+ const s = (u) => {
45076
+ a.value.splice(u, 1);
45077
+ const c = a.value.length === 0 ? void 0 : JSON.stringify(a.value);
45078
+ r("update:value", c);
45079
+ }, l = (u) => {
45080
+ let c = u.map((p) => ({
45081
+ name: p.originalName,
45082
+ url: p.downloadPath
45077
45083
  }));
45078
- a.value.push(...p), r("update:value", JSON.stringify(a.value)), n && n(d);
45084
+ const d = [...a.value, ...c];
45085
+ a.value = d, r("update:value", JSON.stringify(d)), n && n(u);
45079
45086
  };
45080
45087
  return Ue(
45081
- u,
45082
- async (d) => {
45083
- if (s.value) return;
45084
- if (!d) {
45088
+ () => i.value,
45089
+ // 直接监听 props.value
45090
+ (u) => {
45091
+ if (!u) {
45085
45092
  a.value = [];
45086
45093
  return;
45087
45094
  }
45088
- let p = [];
45089
- if (typeof d == "string")
45095
+ console.log(i.value);
45096
+ let c = [];
45097
+ if (typeof u == "string")
45090
45098
  try {
45091
- p = JSON.parse(d);
45092
- } catch {
45093
- a.value = [];
45099
+ c = JSON.parse(u);
45100
+ } catch (p) {
45101
+ console.warn("UploadImageV3 JSON parse error", p);
45094
45102
  return;
45095
45103
  }
45096
- else Array.isArray(d) && (p = d);
45097
- a.value = p.map((f) => ({
45098
- name: f.name || f.originalName,
45099
- url: f.url || f.previewPath || f.downloadPath
45100
- })), s.value = !0;
45104
+ else Array.isArray(u) && (c = u);
45105
+ const d = c.map((p) => ({
45106
+ name: p.name || p.originalName,
45107
+ url: p.url || p.previewPath || p.downloadPath
45108
+ }));
45109
+ JSON.stringify(d) !== JSON.stringify(a.value) && (a.value = d);
45101
45110
  },
45102
45111
  {
45103
45112
  immediate: !0
45104
45113
  }
45105
- ), (d, p) => {
45106
- const f = ye("a-image");
45114
+ ), (u, c) => {
45115
+ const d = ye("a-image");
45107
45116
  return q(), re("div", Met, [
45108
- (q(!0), re(We, null, Cn(H(a), (g, h) => (q(), re("div", {
45117
+ (q(!0), re(We, null, Cn(H(a), (p, f) => (q(), re("div", {
45109
45118
  class: "image-item",
45110
- key: h,
45119
+ key: f,
45111
45120
  style: Mt(`height:${parseInt(e.imageWidth + "")}px;width:${parseInt(
45112
45121
  e.imageWidth + ""
45113
45122
  )}px`)
45114
45123
  }, [
45115
- L(f, {
45124
+ L(d, {
45116
45125
  width: e.imageWidth,
45117
45126
  height: e.imageWidth,
45118
- src: g.url
45127
+ src: p.url
45119
45128
  }, null, 8, ["width", "height", "src"]),
45120
45129
  e.disabled ? De("", !0) : (q(), re("div", {
45121
45130
  key: 0,
45122
45131
  class: "delete-image",
45123
- onClick: (m) => l(h)
45132
+ onClick: (g) => s(f)
45124
45133
  }, [
45125
45134
  L(H(ya))
45126
45135
  ], 8, Bet))
@@ -45131,7 +45140,7 @@ const ret = /* @__PURE__ */ AP(net), iet = { class: "group-box" }, oet = {
45131
45140
  size: e.size,
45132
45141
  fileType: e.fileType,
45133
45142
  url: e.url,
45134
- onChange: c,
45143
+ onChange: l,
45135
45144
  disabled: e.disabled
45136
45145
  }, {
45137
45146
  default: pe(() => [
@@ -45153,7 +45162,7 @@ const ret = /* @__PURE__ */ AP(net), iet = { class: "group-box" }, oet = {
45153
45162
  ]);
45154
45163
  };
45155
45164
  }
45156
- }), Uet = /* @__PURE__ */ Ft(Pet, [["__scopeId", "data-v-6e8909b7"]]), Qet = { class: "file-content" }, Get = { class: "file-name-text" }, Ket = { class: "h-full" }, Yet = {
45165
+ }), Uet = /* @__PURE__ */ Ft(Pet, [["__scopeId", "data-v-a3ed4226"]]), Qet = { class: "file-content" }, Get = { class: "file-name-text" }, Ket = { class: "h-full" }, Yet = {
45157
45166
  key: 0,
45158
45167
  class: "uploaded-files-section"
45159
45168
  }, qet = { class: "file-name" }, Vet = /* @__PURE__ */ Ge({