@qynpm/ui 0.0.2 → 1.0.2

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.
Files changed (58) hide show
  1. package/README.md +183 -8
  2. package/dist/index-1ocyh-Ge.js +1 -0
  3. package/dist/index-BYAIkGVF.js +1 -0
  4. package/dist/index-BaU5rDMh.js +1 -0
  5. package/dist/index-BddPsC3s.mjs +384 -0
  6. package/dist/index-BzzxlJ2O.mjs +205 -0
  7. package/dist/index-C02naY8D.mjs +276 -0
  8. package/dist/index-CEg8yYrg.mjs +142 -0
  9. package/dist/index-CibtL3Up.mjs +325 -0
  10. package/dist/index-Cuwe7RLf.mjs +88 -0
  11. package/dist/index-CzJWU89H.js +1 -0
  12. package/dist/index-DQ-EEZgS.js +1 -0
  13. package/dist/index-Dg93AsO_.mjs +216 -0
  14. package/dist/index-Djj-T8oy.mjs +137 -0
  15. package/dist/index-DlwgfuD9.mjs +55 -0
  16. package/dist/index-Do5SZ8yS.js +1 -0
  17. package/dist/index-DooOsQ9d.js +1 -0
  18. package/dist/index-DzX3lxdp.js +1 -0
  19. package/dist/index-tC70xKe_.js +1 -0
  20. package/dist/index.cjs +1 -0
  21. package/dist/install-CxBnxbuN.mjs +8 -0
  22. package/dist/install-c8il9DQv.js +1 -0
  23. package/dist/js.cookie-XvHV2tha.js +1 -0
  24. package/dist/js.cookie-tagl12-O.mjs +74 -0
  25. package/dist/plugin-vue_export-helper-BHFhmbuH.js +1 -0
  26. package/dist/plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
  27. package/dist/qy-action-bar/index.cjs +1 -0
  28. package/dist/qy-dialog/index.cjs +1 -0
  29. package/dist/qy-form-section/index.cjs +1 -0
  30. package/dist/qy-input/index.cjs +1 -0
  31. package/dist/qy-record-quote-search/index.cjs +1 -0
  32. package/dist/qy-remark-image/index.cjs +2 -0
  33. package/dist/qy-search-input/index.cjs +1 -0
  34. package/dist/qy-select/index.cjs +1 -0
  35. package/dist/qy-upload/index.cjs +1 -0
  36. package/index.d.ts +16 -4
  37. package/package.json +60 -7
  38. package/qy-action-bar/index.d.ts +5 -0
  39. package/qy-action-bar/index.js +4 -0
  40. package/qy-dialog/index.d.ts +5 -0
  41. package/qy-dialog/index.js +4 -0
  42. package/qy-form-section/index.d.ts +5 -0
  43. package/qy-form-section/index.js +4 -0
  44. package/qy-input/index.d.ts +5 -0
  45. package/qy-input/index.js +4 -0
  46. package/qy-record-quote-search/index.d.ts +5 -0
  47. package/qy-record-quote-search/index.js +4 -0
  48. package/qy-remark-image/index.d.ts +5 -0
  49. package/qy-remark-image/index.js +4 -0
  50. package/qy-search-input/index.d.ts +5 -0
  51. package/qy-search-input/index.js +4 -0
  52. package/qy-select/index.d.ts +5 -0
  53. package/qy-select/index.js +4 -0
  54. package/qy-upload/index.d.ts +5 -0
  55. package/qy-upload/index.js +4 -0
  56. package/dist/ui.es.js +0 -994
  57. package/dist/ui.umd.js +0 -2
  58. package/index.js +0 -9
@@ -0,0 +1,325 @@
1
+ import { ElDialog as ae, ElIcon as se } from "element-plus/es";
2
+ import { defineComponent as re, mergeModels as W, useSlots as de, ref as d, computed as C, createVNode as v, useModel as ue, watchEffect as ce, useAttrs as me, h as Y, unref as s, onMounted as fe, nextTick as ge, onUnmounted as ye, resolveComponent as pe, createElementBlock as i, openBlock as n, withDirectives as ve, mergeProps as we, createSlots as he, withCtx as w, createElementVNode as t, normalizeStyle as $, normalizeClass as Z, createCommentVNode as u, renderSlot as h, toDisplayString as G, withModifiers as a, createBlock as J, vShow as xe } from "vue";
3
+ import _e from "clsx";
4
+ import { ElButton as K } from "element-plus";
5
+ import { useBreakpoints as be, useDraggable as ke } from "@vueuse/core";
6
+ const ze = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]" }, Ce = { key: 0 }, qe = { key: 1 }, Me = {
7
+ key: 0,
8
+ class: "icon-[material-symbols--square-outline-rounded]",
9
+ role: "img",
10
+ "aria-hidden": "true"
11
+ }, Se = {
12
+ key: 1,
13
+ class: "icon-[tdesign--fullscreen-exit-1]",
14
+ role: "img",
15
+ "aria-hidden": "true"
16
+ }, Ie = {
17
+ key: 0,
18
+ class: "fixed -right-12 top-2 h-9 w-9 hover:bg-gray-600/80 transition-all"
19
+ }, Be = { class: "flex justify-between h-[var(--footer-height)] px-[var(--content-padding)] items-center" }, De = { class: "flex items-center justify-between w-full pl-1 pr-4 h-full ml-2" }, Ee = { class: "flex items-center gap-2" }, $e = { class: "text-sm text-gray-700 truncate max-w-[200px]" }, Ze = { class: "flex items-center gap-2" }, Q = 5, A = 2e3, Fe = re({
20
+ __name: "index",
21
+ props: /* @__PURE__ */ W({
22
+ layout: { type: [Array, String, Boolean], default: () => ["confirm", "cancel"] },
23
+ fullscreen: { type: Boolean, default: !1 },
24
+ showFullscreen: { type: Boolean, default: !1 },
25
+ confirmProps: { default: () => ({}) },
26
+ size: { default: "default" },
27
+ zIndex: { default: 2e3 }
28
+ }, {
29
+ modelValue: { default: !0 },
30
+ modelModifiers: {}
31
+ }),
32
+ emits: /* @__PURE__ */ W(["confirm", "cancel", "close", "opened", "ok"], ["update:modelValue"]),
33
+ setup(H, { expose: ee, emit: oe }) {
34
+ const l = H, q = de(), L = d(!0), M = d(!1), O = d(A), te = be({
35
+ mobile: 0,
36
+ tablet: 640,
37
+ laptop: 1024,
38
+ desktop: 1280
39
+ }).isSmaller("tablet"), S = C(() => {
40
+ if (Array.isArray(l.layout)) return l.layout;
41
+ if (typeof l.layout == "string")
42
+ return l.layout.split(",").map((o) => o.trim());
43
+ }), V = C(() => ({
44
+ CancelButton: v(R),
45
+ ConfirmButton: v(P)
46
+ })), j = C(() => q.footer || l.layout !== !1), I = d(!1), g = d(
47
+ l.showFullscreen && te ? !0 : l.fullscreen
48
+ ), y = oe, B = ue(H, "modelValue");
49
+ ce(() => {
50
+ B.value && (I.value = !1);
51
+ }), ee({});
52
+ const D = me(), c = `qy-dialog-${Math.random().toString(36).slice(2, 11)}`, m = d(!1), x = d(null);
53
+ window.minimizedCount || (window.minimizedCount = 0);
54
+ const { x: N, y: E } = ke(x, {
55
+ initialValue: {
56
+ x: 5,
57
+ y: window.innerHeight - 100 - (window.minimizedCount || 0) * 60
58
+ },
59
+ onMove(o) {
60
+ var e;
61
+ (e = x.value) == null || e.classList.add("dragging"), document.body.classList.add("qy-dialog--dragging"), N.value = Math.max(
62
+ 0,
63
+ Math.min(window.innerWidth - 300, o.x)
64
+ ), E.value = Math.max(
65
+ 0,
66
+ Math.min(window.innerHeight - 50, o.y)
67
+ );
68
+ },
69
+ onEnd() {
70
+ var o;
71
+ (o = x.value) == null || o.classList.remove("dragging"), document.body.classList.remove("qy-dialog--dragging");
72
+ }
73
+ }), le = C(() => ({
74
+ transform: `translate(${N.value}px, ${E.value}px)`,
75
+ willChange: "transform"
76
+ }));
77
+ function F(o) {
78
+ const e = o.target, { scrollTop: r, scrollHeight: f, clientHeight: b } = e;
79
+ L.value = r <= Q, M.value = f - (r + b) <= Q;
80
+ }
81
+ function ne() {
82
+ document.querySelector(`.${c}.el-dialog`).addEventListener("scroll", F), _(), y("opened");
83
+ }
84
+ function T() {
85
+ g.value = !g.value, _();
86
+ }
87
+ function p() {
88
+ I.value || (I.value = !0, m.value = !1, B.value = !1, y("cancel"), y("close"));
89
+ }
90
+ function ie(o) {
91
+ l.showFullscreen && o.detail >= 2 && T();
92
+ }
93
+ function P() {
94
+ return Y(
95
+ K,
96
+ {
97
+ ...s(l.confirmProps),
98
+ type: "primary",
99
+ class: "dialog__footerBtn",
100
+ onClick: () => {
101
+ y("confirm"), y("ok");
102
+ }
103
+ },
104
+ () => s(l.confirmProps).title || "确 认"
105
+ );
106
+ }
107
+ function R() {
108
+ return Y(
109
+ K,
110
+ { class: "dialog__footerBtn", onClick: () => p() },
111
+ () => "取 消"
112
+ );
113
+ }
114
+ fe(() => {
115
+ typeof window.qyDialogMaxZIndex > "u" && (window.qyDialogMaxZIndex = A), _();
116
+ });
117
+ function _() {
118
+ var X;
119
+ const o = Array.from(
120
+ document.querySelectorAll(".el-overlay")
121
+ ).filter((z) => window.getComputedStyle(z).display !== "none" && !z.classList.contains("is-message")), e = (X = document.querySelector(`.${c}`)) == null ? void 0 : X.closest(".el-overlay"), r = document.querySelector(
122
+ `.${c}.el-dialog`
123
+ );
124
+ if (!e || !r) return;
125
+ const f = A;
126
+ window.qyDialogMaxZIndex = window.qyDialogMaxZIndex || f;
127
+ const k = Math.max(
128
+ window.qyDialogMaxZIndex,
129
+ ...o.map(
130
+ (z) => parseInt(window.getComputedStyle(z).zIndex || f.toString())
131
+ )
132
+ ) + 2;
133
+ window.qyDialogMaxZIndex = k, ge(() => {
134
+ e.style.zIndex = k.toString(), r.style.zIndex = (k + 1).toString(), O.value = k + 1;
135
+ });
136
+ }
137
+ ye(() => {
138
+ const o = document.querySelector(
139
+ `.${c} .qy-dialog__wrapper-container`
140
+ );
141
+ o && o.removeEventListener("scroll", F), m.value && window.minimizedCount--;
142
+ });
143
+ function U() {
144
+ var e;
145
+ m.value = !m.value;
146
+ const o = (e = document.querySelector(`.${c}`)) == null ? void 0 : e.closest(".el-overlay");
147
+ m.value ? (o.style.display = "none", window.minimizedCount++, E.value = window.innerHeight - 50 - (window.minimizedCount || 0) * 60) : (o.style.display = "block", window.minimizedCount--, _());
148
+ }
149
+ return (o, e) => {
150
+ const r = pe("Close"), f = se, b = ae;
151
+ return n(), i("div", null, [
152
+ v(b, we({
153
+ ref: "dialogRef",
154
+ class: ["qy-dialog", [
155
+ l.size === "small" && "[&_.el-dialog__header]:!hidden",
156
+ c
157
+ ]],
158
+ "model-value": B.value,
159
+ "align-center": "",
160
+ "append-to-body": "",
161
+ style: {
162
+ "--el-dialog-padding-primary": 0
163
+ },
164
+ "show-close": !1,
165
+ fullscreen: g.value,
166
+ "z-index": O.value,
167
+ onClosed: p,
168
+ onOpened: ne,
169
+ draggable: ""
170
+ }, s(D)), he({
171
+ header: w(() => [
172
+ l.size === "default" ? (n(), i("div", {
173
+ key: 0,
174
+ style: $({
175
+ borderBottom: "1px solid",
176
+ borderColor: L.value ? "transparent" : "var(--block-outline-color)",
177
+ transition: "border-color .2s linear"
178
+ }),
179
+ class: "flex justify-between h-[var(--header-height)]",
180
+ onDblclick: ie
181
+ }, [
182
+ t("div", ze, [
183
+ s(q).header ? s(q).header ? (n(), i("div", qe, [
184
+ h(o.$slots, "header")
185
+ ])) : u("", !0) : (n(), i("span", Ce, G(s(D).title), 1))
186
+ ]),
187
+ t("div", {
188
+ class: "flex",
189
+ onMousedown: e[3] || (e[3] = a(() => {
190
+ }, ["stop"]))
191
+ }, [
192
+ l.size === "default" ? (n(), i("div", {
193
+ key: 0,
194
+ class: "qy-dialog__btn qy-dialog__btn--default",
195
+ onClick: a(U, ["stop"]),
196
+ onMousedown: e[0] || (e[0] = a(() => {
197
+ }, ["stop"]))
198
+ }, e[4] || (e[4] = [
199
+ t("span", {
200
+ class: "icon-[material-symbols--minimize] text-xl mb-3",
201
+ role: "img",
202
+ "aria-hidden": "true"
203
+ }, null, -1)
204
+ ]), 32)) : u("", !0),
205
+ l.showFullscreen ? (n(), i("div", {
206
+ key: 1,
207
+ class: "qy-dialog__btn qy-dialog__btn--default",
208
+ onClick: a(T, ["stop"]),
209
+ onMousedown: e[1] || (e[1] = a(() => {
210
+ }, ["stop"]))
211
+ }, [
212
+ g.value ? (n(), i("span", Se)) : (n(), i("span", Me))
213
+ ], 32)) : u("", !0),
214
+ t("div", {
215
+ class: "qy-dialog__btn qy-dialog__btn--danger",
216
+ onClick: a(p, ["stop"]),
217
+ onMousedown: e[2] || (e[2] = a(() => {
218
+ }, ["stop"]))
219
+ }, e[5] || (e[5] = [
220
+ t("span", {
221
+ class: "icon-[ri--close-line] text-xl",
222
+ role: "img",
223
+ "aria-hidden": "true"
224
+ }, null, -1)
225
+ ]), 32)
226
+ ], 32)
227
+ ], 36)) : u("", !0)
228
+ ]),
229
+ default: w(() => [
230
+ t("div", {
231
+ class: Z(["qy-dialog__wrapper", s(_e)(g.value && "qy-dialog__wrapper--fullscreen")]),
232
+ style: $({
233
+ maxHeight: j.value ? "calc(100vh - var(--header-height) - var(--footer-height) - var(--sides-gap))" : "calc(100vh - var(--header-height) - var(--sides-gap))",
234
+ padding: l.size === "small" ? "var(--small-content-padding)" : "var(--content-padding)"
235
+ })
236
+ }, [
237
+ l.size === "small" ? (n(), i("div", Ie, [
238
+ v(f, {
239
+ size: 36,
240
+ class: "cursor-pointer text-gray-100 active:scale-75 rounded-sm transition-all",
241
+ onClick: p
242
+ }, {
243
+ default: w(() => [
244
+ v(r)
245
+ ]),
246
+ _: 1
247
+ })
248
+ ])) : u("", !0),
249
+ h(o.$slots, "default")
250
+ ], 6)
251
+ ]),
252
+ _: 2
253
+ }, [
254
+ !o.$slots.footer && Array.isArray(S.value) ? {
255
+ name: "footer",
256
+ fn: w(() => [
257
+ t("div", Be, [
258
+ t("div", null, [
259
+ h(o.$slots, "footer-left")
260
+ ]),
261
+ t("div", {
262
+ class: Z([{
263
+ "qy-dialog__footer--outline": M.value
264
+ }, "qy-dialog__footer flex items-center justify-end"])
265
+ }, [
266
+ S.value.includes("cancel") ? (n(), J(R, { key: 0 })) : u("", !0),
267
+ S.value.includes("confirm") ? (n(), J(P, { key: 1 })) : u("", !0),
268
+ h(o.$slots, "footer-append")
269
+ ], 2)
270
+ ])
271
+ ]),
272
+ key: "0"
273
+ } : j.value ? {
274
+ name: "footer",
275
+ fn: w(() => [
276
+ t("div", {
277
+ class: Z([{
278
+ "qy-dialog__footer--outline": M.value
279
+ }, "qy-dialog__footer px-[var(--content-padding)] min-h-[var(--footer-height)] flex items-center justify-end"])
280
+ }, [
281
+ h(o.$slots, "footer", {
282
+ layouts: V.value,
283
+ layoutsNode: Object.values(V.value)
284
+ })
285
+ ], 2)
286
+ ]),
287
+ key: "1"
288
+ } : void 0
289
+ ]), 1040, ["class", "model-value", "fullscreen", "z-index"]),
290
+ ve(t("div", {
291
+ ref_key: "minimizedRef",
292
+ ref: x,
293
+ class: "fixed left-0 top-0 bg-white rounded shadow-lg cursor-pointer z-[9999] hover:bg-gray-50",
294
+ style: $([le.value, { width: "300px", height: "50px", "will-change": "transform" }])
295
+ }, [
296
+ t("div", De, [
297
+ t("div", Ee, [
298
+ e[6] || (e[6] = t("div", { class: "icon-[mdi--window-restore] text-gray-600" }, null, -1)),
299
+ t("span", $e, G(s(D).title), 1)
300
+ ]),
301
+ t("div", Ze, [
302
+ t("div", {
303
+ class: "p-1 hover:bg-gray-200 rounded",
304
+ onClick: a(U, ["stop"])
305
+ }, e[7] || (e[7] = [
306
+ t("div", { class: "icon-[mdi--window-maximize] text-gray-600" }, null, -1)
307
+ ])),
308
+ t("div", {
309
+ class: "p-1 hover:bg-red-100 rounded",
310
+ onClick: a(p, ["stop"])
311
+ }, e[8] || (e[8] = [
312
+ t("div", { class: "icon-[mdi--close] text-red-600" }, null, -1)
313
+ ]))
314
+ ])
315
+ ])
316
+ ], 4), [
317
+ [xe, m.value]
318
+ ])
319
+ ]);
320
+ };
321
+ }
322
+ });
323
+ export {
324
+ Fe as _
325
+ };
@@ -0,0 +1,88 @@
1
+ import { defineComponent as y, ref as b, watch as v, createElementBlock as o, openBlock as s, normalizeClass as a, createElementVNode as d, withDirectives as _, renderSlot as i, createCommentVNode as n, toDisplayString as r, withModifiers as h, vShow as g } from "vue";
2
+ import { _ as k } from "./plugin-vue_export-helper-CHgC5LLL.mjs";
3
+ const C = { class: "qy-form-section__heading" }, q = {
4
+ key: 0,
5
+ class: "qy-form-section__title"
6
+ }, $ = {
7
+ key: 0,
8
+ class: "qy-form-section__description"
9
+ }, E = { class: "qy-form-section__actions" }, w = y({
10
+ name: "QyFormSection",
11
+ __name: "index",
12
+ props: {
13
+ title: { default: "" },
14
+ description: { default: "" },
15
+ tip: { default: "" },
16
+ tipType: { default: "info" },
17
+ collapsible: { type: Boolean, default: !1 },
18
+ defaultExpanded: { type: Boolean, default: !0 },
19
+ bordered: { type: Boolean, default: !0 },
20
+ background: { default: "white" },
21
+ bodyClass: { default: "" },
22
+ headerClass: { default: "" }
23
+ },
24
+ emits: ["toggle"],
25
+ setup(u, { emit: p }) {
26
+ const l = u, f = p, t = b(l.defaultExpanded);
27
+ v(
28
+ () => l.defaultExpanded,
29
+ (e) => {
30
+ t.value = e;
31
+ }
32
+ );
33
+ function c() {
34
+ l.collapsible && (t.value = !t.value, f("toggle", t.value));
35
+ }
36
+ function m() {
37
+ l.collapsible && c();
38
+ }
39
+ return (e, B) => (s(), o("section", {
40
+ class: a(["qy-form-section", [
41
+ `is-bg-${e.background}`,
42
+ {
43
+ "is-bordered": e.bordered,
44
+ "is-collapsible": e.collapsible
45
+ }
46
+ ]])
47
+ }, [
48
+ d("header", {
49
+ class: a(["qy-form-section__header", e.headerClass]),
50
+ onClick: m
51
+ }, [
52
+ d("div", C, [
53
+ i(e.$slots, "title", {}, () => [
54
+ e.title ? (s(), o("div", q, r(e.title), 1)) : n("", !0)
55
+ ], !0),
56
+ i(e.$slots, "description", {}, () => [
57
+ e.description ? (s(), o("div", $, r(e.description), 1)) : n("", !0)
58
+ ], !0)
59
+ ]),
60
+ d("div", E, [
61
+ i(e.$slots, "actions", {}, void 0, !0),
62
+ e.collapsible ? (s(), o("button", {
63
+ key: 0,
64
+ type: "button",
65
+ class: "qy-form-section__toggle",
66
+ onClick: h(c, ["stop"])
67
+ }, r(t.value ? "收起" : "展开"), 1)) : n("", !0)
68
+ ])
69
+ ], 2),
70
+ _(d("div", {
71
+ class: a(["qy-form-section__body", e.bodyClass])
72
+ }, [
73
+ i(e.$slots, "tip", {}, () => [
74
+ e.tip ? (s(), o("div", {
75
+ key: 0,
76
+ class: a(["qy-form-section__tip", `is-${e.tipType}`])
77
+ }, r(e.tip), 3)) : n("", !0)
78
+ ], !0),
79
+ i(e.$slots, "default", {}, void 0, !0)
80
+ ], 2), [
81
+ [g, t.value]
82
+ ])
83
+ ], 2));
84
+ }
85
+ }), F = /* @__PURE__ */ k(w, [["__scopeId", "data-v-0185ba6c"]]);
86
+ export {
87
+ F as Q
88
+ };
@@ -0,0 +1 @@
1
+ "use strict";const t=require("vue"),N=require("./index-BaU5rDMh.js"),A=require("./plugin-vue_export-helper-BHFhmbuH.js"),O={class:"qy-record-quote-search"},R={key:0,class:"qy-record-quote-search__header"},T={key:0,class:"qy-record-quote-search__label"},L={key:1,class:"qy-record-quote-search__description"},P=t.defineComponent({name:"QyRecordQuoteSearch",inheritAttrs:!1,__name:"index",props:{modelValue:{default:""},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{default:"请输入报价单号"},buttonText:{default:"查询报价单"},autoNormalize:{type:Boolean,default:!0},showStatus:{type:Boolean,default:!0},status:{default:"default"},statusText:{default:""},suggestions:{default:()=>[]},fetchSuggestions:{type:[Function,null],default:null},fetchSuggestionsMethod:{type:[Function,null],default:null},debounce:{default:300},minLength:{default:1},searchOnSelect:{type:Boolean,default:!0},searchMethod:{type:[Function,null],default:null},extractMethod:{type:[Function,null],default:null},normalizeMethod:{type:[Function,null],default:null},label:{default:"报价单号"},description:{default:""},trimMode:{default:"blur"}},emits:["update:modelValue","search","clear","normalize","enter","select","error","success"],setup(y,{expose:S,emit:v}){const r=y,n=v,b=t.useAttrs(),a=t.ref(null),d=t.ref(!1),i=t.computed(()=>r.statusText||""),V=t.computed(()=>r.loading||d.value);function u(e){return e==null?"":String(e)}function k(e){const o=u(e).trim(),l=c(o),s=l.match(/BJ\d{8}[A-Z0-9]{4}/i);return s?s[0]:l}function c(e){return u(e).replace(/\s+/g,"").trim().toUpperCase()}function f(e){return r.extractMethod?r.extractMethod(e):k(e)}function h(e){return r.normalizeMethod?r.normalizeMethod(e):c(e)}function m(e,o){const l=u(e),s=f(l),g=r.autoNormalize?h(s):s;return n("normalize",{rawValue:l,code:g}),{rawValue:l,code:g,item:o}}function C(e){n("update:modelValue",e)}async function p(e){if(n("search",e),!!r.searchMethod){d.value=!0;try{const o=await r.searchMethod(e);n("success",o)}catch(o){n("error",o)}finally{d.value=!1}}}function B(e){const o=m(e);o.code!==u(r.modelValue)&&n("update:modelValue",o.code),p(o)}function E(){n("clear")}function M(e){n("enter",e)}function q(e){if(n("select",e),!r.searchOnSelect)return;const o=m(e.value,e);o.code!==u(r.modelValue)&&n("update:modelValue",o.code),p(o)}function $(e){n("error",e)}function z(){var e,o;(o=(e=a.value)==null?void 0:e.focus)==null||o.call(e)}function F(){var e,o;(o=(e=a.value)==null?void 0:e.blur)==null||o.call(e)}function Q(){var e,o;(o=(e=a.value)==null?void 0:e.select)==null||o.call(e)}function w(){var e,o;(o=(e=a.value)==null?void 0:e.clear)==null||o.call(e)}return S({focus:z,blur:F,select:Q,clear:w,extractQuoteOrderCode:f,normalizeQuoteOrderCode:h}),(e,o)=>(t.openBlock(),t.createElementBlock("div",O,[t.renderSlot(e.$slots,"label",{},()=>[e.label||e.description?(t.openBlock(),t.createElementBlock("div",R,[e.label?(t.openBlock(),t.createElementBlock("div",T,t.toDisplayString(e.label),1)):t.createCommentVNode("",!0),e.description?(t.openBlock(),t.createElementBlock("div",L,t.toDisplayString(e.description),1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)],!0),t.createVNode(N.QySearchInput,t.mergeProps({ref_key:"searchRef",ref:a},t.unref(b),{"model-value":e.modelValue,loading:V.value,disabled:e.disabled,placeholder:e.placeholder,"remove-space":!0,"trim-mode":e.trimMode,"button-text":e.buttonText,suggestions:e.suggestions,"fetch-suggestions":e.fetchSuggestions,"fetch-suggestions-method":e.fetchSuggestionsMethod,debounce:e.debounce,"min-length":e.minLength,"search-on-select":!1,"onUpdate:modelValue":C,onSearch:B,onClear:E,onEnter:M,onSelect:q,onError:$}),t.createSlots({_:2},[e.$slots.prefix?{name:"prefix",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"prefix",{},void 0,!0)]),key:"0"}:void 0,e.$slots.suffix?{name:"suffix",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"suffix",{},void 0,!0)]),key:"1"}:void 0,e.$slots.item?{name:"item",fn:t.withCtx(l=>[t.renderSlot(e.$slots,"item",t.normalizeProps(t.guardReactiveProps(l)),void 0,!0)]),key:"2"}:void 0,e.$slots.empty?{name:"empty",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"empty",{},void 0,!0)]),key:"3"}:void 0,e.$slots.loading?{name:"loading",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"loading",{},void 0,!0)]),key:"4"}:void 0]),1040,["model-value","loading","disabled","placeholder","trim-mode","button-text","suggestions","fetch-suggestions","fetch-suggestions-method","debounce","min-length"]),e.showStatus&&i.value?t.renderSlot(e.$slots,"status",{key:0,status:e.status,statusText:i.value},()=>[t.createElementVNode("div",{class:t.normalizeClass(["qy-record-quote-search__status",`is-${e.status}`])},t.toDisplayString(i.value),3)],!0):t.createCommentVNode("",!0)]))}}),D=A._export_sfc(P,[["__scopeId","data-v-8bc26d3a"]]);exports.QyRecordQuoteSearch=D;
@@ -0,0 +1 @@
1
+ "use strict";const Z=require("element-plus/es"),e=require("vue"),U=require("clsx"),A=require("element-plus"),H=require("@vueuse/core"),X={class:"text-lg flex items-center pt-2 pl-[var(--content-padding)]"},W={key:0},Y={key:1},G={key:0,class:"icon-[material-symbols--square-outline-rounded]",role:"img","aria-hidden":"true"},J={key:1,class:"icon-[tdesign--fullscreen-exit-1]",role:"img","aria-hidden":"true"},K={key:0,class:"fixed -right-12 top-2 h-9 w-9 hover:bg-gray-600/80 transition-all"},Q={class:"flex justify-between h-[var(--footer-height)] px-[var(--content-padding)] items-center"},ee={class:"flex items-center justify-between w-full pl-1 pr-4 h-full ml-2"},te={class:"flex items-center gap-2"},oe={class:"text-sm text-gray-700 truncate max-w-[200px]"},le={class:"flex items-center gap-2"},L=5,C=2e3,ne=e.defineComponent({__name:"index",props:e.mergeModels({layout:{type:[Array,String,Boolean],default:()=>["confirm","cancel"]},fullscreen:{type:Boolean,default:!1},showFullscreen:{type:Boolean,default:!1},confirmProps:{default:()=>({})},size:{default:"default"},zIndex:{default:2e3}},{modelValue:{default:!0},modelModifiers:{}}),emits:e.mergeModels(["confirm","cancel","close","opened","ok"],["update:modelValue"]),setup(E,{expose:O,emit:j}){const l=E,y=e.useSlots(),B=e.ref(!0),v=e.ref(!1),M=e.ref(C),F=H.useBreakpoints({mobile:0,tablet:640,laptop:1024,desktop:1280}).isSmaller("tablet"),w=e.computed(()=>{if(Array.isArray(l.layout))return l.layout;if(typeof l.layout=="string")return l.layout.split(",").map(o=>o.trim())}),z=e.computed(()=>({CancelButton:e.createVNode(I),ConfirmButton:e.createVNode(S)})),b=e.computed(()=>y.footer||l.layout!==!1),h=e.ref(!1),s=e.ref(l.showFullscreen&&F?!0:l.fullscreen),d=j,x=e.useModel(E,"modelValue");e.watchEffect(()=>{x.value&&(h.value=!1)}),O({});const k=e.useAttrs(),i=`qy-dialog-${Math.random().toString(36).slice(2,11)}`,a=e.ref(!1),u=e.ref(null);window.minimizedCount||(window.minimizedCount=0);const{x:V,y:_}=H.useDraggable(u,{initialValue:{x:5,y:window.innerHeight-100-(window.minimizedCount||0)*60},onMove(o){var t;(t=u.value)==null||t.classList.add("dragging"),document.body.classList.add("qy-dialog--dragging"),V.value=Math.max(0,Math.min(window.innerWidth-300,o.x)),_.value=Math.max(0,Math.min(window.innerHeight-50,o.y))},onEnd(){var o;(o=u.value)==null||o.classList.remove("dragging"),document.body.classList.remove("qy-dialog--dragging")}}),P=e.computed(()=>({transform:`translate(${V.value}px, ${_.value}px)`,willChange:"transform"}));function q(o){const t=o.target,{scrollTop:n,scrollHeight:r,clientHeight:f}=t;B.value=n<=L,v.value=r-(n+f)<=L}function T(){document.querySelector(`.${i}.el-dialog`).addEventListener("scroll",q),m(),d("opened")}function N(){s.value=!s.value,m()}function c(){h.value||(h.value=!0,a.value=!1,x.value=!1,d("cancel"),d("close"))}function R(o){l.showFullscreen&&o.detail>=2&&N()}function S(){return e.h(A.ElButton,{...e.unref(l.confirmProps),type:"primary",class:"dialog__footerBtn",onClick:()=>{d("confirm"),d("ok")}},()=>e.unref(l.confirmProps).title||"确 认")}function I(){return e.h(A.ElButton,{class:"dialog__footerBtn",onClick:()=>c()},()=>"取 消")}e.onMounted(()=>{typeof window.qyDialogMaxZIndex>"u"&&(window.qyDialogMaxZIndex=C),m()});function m(){var $;const o=Array.from(document.querySelectorAll(".el-overlay")).filter(p=>window.getComputedStyle(p).display!=="none"&&!p.classList.contains("is-message")),t=($=document.querySelector(`.${i}`))==null?void 0:$.closest(".el-overlay"),n=document.querySelector(`.${i}.el-dialog`);if(!t||!n)return;const r=C;window.qyDialogMaxZIndex=window.qyDialogMaxZIndex||r;const g=Math.max(window.qyDialogMaxZIndex,...o.map(p=>parseInt(window.getComputedStyle(p).zIndex||r.toString())))+2;window.qyDialogMaxZIndex=g,e.nextTick(()=>{t.style.zIndex=g.toString(),n.style.zIndex=(g+1).toString(),M.value=g+1})}e.onUnmounted(()=>{const o=document.querySelector(`.${i} .qy-dialog__wrapper-container`);o&&o.removeEventListener("scroll",q),a.value&&window.minimizedCount--});function D(){var t;a.value=!a.value;const o=(t=document.querySelector(`.${i}`))==null?void 0:t.closest(".el-overlay");a.value?(o.style.display="none",window.minimizedCount++,_.value=window.innerHeight-50-(window.minimizedCount||0)*60):(o.style.display="block",window.minimizedCount--,m())}return(o,t)=>{const n=e.resolveComponent("Close"),r=Z.ElIcon,f=Z.ElDialog;return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(f,e.mergeProps({ref:"dialogRef",class:["qy-dialog",[l.size==="small"&&"[&_.el-dialog__header]:!hidden",i]],"model-value":x.value,"align-center":"","append-to-body":"",style:{"--el-dialog-padding-primary":0},"show-close":!1,fullscreen:s.value,"z-index":M.value,onClosed:c,onOpened:T,draggable:""},e.unref(k)),e.createSlots({header:e.withCtx(()=>[l.size==="default"?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({borderBottom:"1px solid",borderColor:B.value?"transparent":"var(--block-outline-color)",transition:"border-color .2s linear"}),class:"flex justify-between h-[var(--header-height)]",onDblclick:R},[e.createElementVNode("div",X,[e.unref(y).header?e.unref(y).header?(e.openBlock(),e.createElementBlock("div",Y,[e.renderSlot(o.$slots,"header")])):e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",W,e.toDisplayString(e.unref(k).title),1))]),e.createElementVNode("div",{class:"flex",onMousedown:t[3]||(t[3]=e.withModifiers(()=>{},["stop"]))},[l.size==="default"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"qy-dialog__btn qy-dialog__btn--default",onClick:e.withModifiers(D,["stop"]),onMousedown:t[0]||(t[0]=e.withModifiers(()=>{},["stop"]))},t[4]||(t[4]=[e.createElementVNode("span",{class:"icon-[material-symbols--minimize] text-xl mb-3",role:"img","aria-hidden":"true"},null,-1)]),32)):e.createCommentVNode("",!0),l.showFullscreen?(e.openBlock(),e.createElementBlock("div",{key:1,class:"qy-dialog__btn qy-dialog__btn--default",onClick:e.withModifiers(N,["stop"]),onMousedown:t[1]||(t[1]=e.withModifiers(()=>{},["stop"]))},[s.value?(e.openBlock(),e.createElementBlock("span",J)):(e.openBlock(),e.createElementBlock("span",G))],32)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"qy-dialog__btn qy-dialog__btn--danger",onClick:e.withModifiers(c,["stop"]),onMousedown:t[2]||(t[2]=e.withModifiers(()=>{},["stop"]))},t[5]||(t[5]=[e.createElementVNode("span",{class:"icon-[ri--close-line] text-xl",role:"img","aria-hidden":"true"},null,-1)]),32)],32)],36)):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["qy-dialog__wrapper",e.unref(U)(s.value&&"qy-dialog__wrapper--fullscreen")]),style:e.normalizeStyle({maxHeight:b.value?"calc(100vh - var(--header-height) - var(--footer-height) - var(--sides-gap))":"calc(100vh - var(--header-height) - var(--sides-gap))",padding:l.size==="small"?"var(--small-content-padding)":"var(--content-padding)"})},[l.size==="small"?(e.openBlock(),e.createElementBlock("div",K,[e.createVNode(r,{size:36,class:"cursor-pointer text-gray-100 active:scale-75 rounded-sm transition-all",onClick:c},{default:e.withCtx(()=>[e.createVNode(n)]),_:1})])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default")],6)]),_:2},[!o.$slots.footer&&Array.isArray(w.value)?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",Q,[e.createElementVNode("div",null,[e.renderSlot(o.$slots,"footer-left")]),e.createElementVNode("div",{class:e.normalizeClass([{"qy-dialog__footer--outline":v.value},"qy-dialog__footer flex items-center justify-end"])},[w.value.includes("cancel")?(e.openBlock(),e.createBlock(I,{key:0})):e.createCommentVNode("",!0),w.value.includes("confirm")?(e.openBlock(),e.createBlock(S,{key:1})):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"footer-append")],2)])]),key:"0"}:b.value?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass([{"qy-dialog__footer--outline":v.value},"qy-dialog__footer px-[var(--content-padding)] min-h-[var(--footer-height)] flex items-center justify-end"])},[e.renderSlot(o.$slots,"footer",{layouts:z.value,layoutsNode:Object.values(z.value)})],2)]),key:"1"}:void 0]),1040,["class","model-value","fullscreen","z-index"]),e.withDirectives(e.createElementVNode("div",{ref_key:"minimizedRef",ref:u,class:"fixed left-0 top-0 bg-white rounded shadow-lg cursor-pointer z-[9999] hover:bg-gray-50",style:e.normalizeStyle([P.value,{width:"300px",height:"50px","will-change":"transform"}])},[e.createElementVNode("div",ee,[e.createElementVNode("div",te,[t[6]||(t[6]=e.createElementVNode("div",{class:"icon-[mdi--window-restore] text-gray-600"},null,-1)),e.createElementVNode("span",oe,e.toDisplayString(e.unref(k).title),1)]),e.createElementVNode("div",le,[e.createElementVNode("div",{class:"p-1 hover:bg-gray-200 rounded",onClick:e.withModifiers(D,["stop"])},t[7]||(t[7]=[e.createElementVNode("div",{class:"icon-[mdi--window-maximize] text-gray-600"},null,-1)])),e.createElementVNode("div",{class:"p-1 hover:bg-red-100 rounded",onClick:e.withModifiers(c,["stop"])},t[8]||(t[8]=[e.createElementVNode("div",{class:"icon-[mdi--close] text-red-600"},null,-1)]))])])],4),[[e.vShow,a.value]])])}}});exports._sfc_main=ne;
@@ -0,0 +1,216 @@
1
+ import { defineComponent as $, useAttrs as N, ref as v, computed as q, watch as z, onMounted as j, nextTick as K, onUnmounted as M, createElementBlock as g, openBlock as h, normalizeStyle as O, createElementVNode as i, createVNode as _, unref as c, mergeProps as Q, withCtx as y, createTextVNode as W } from "vue";
2
+ import { ElMessage as F, ElInput as G, ElPopover as H, ElButton as J, ElUpload as X } from "element-plus";
3
+ import { a as Y } from "./js.cookie-tagl12-O.mjs";
4
+ import { _ as Z } from "./plugin-vue_export-helper-CHgC5LLL.mjs";
5
+ function U(r) {
6
+ const l = r == null ? void 0 : r.match(/(\[url\:(.*?)\])(.*)/);
7
+ return l ? {
8
+ imageUrl: l[2],
9
+ text: l[3]
10
+ } : {
11
+ imageUrl: "",
12
+ text: r || ""
13
+ };
14
+ }
15
+ function ee(r) {
16
+ const l = String(r || "").match(/(\[url\:.*?\])([\s\S]*)/);
17
+ return l ? l[2] : r;
18
+ }
19
+ function V(r, l) {
20
+ return l ? `[url:${l}]${r}` : r;
21
+ }
22
+ const ae = { class: "qy-remark-image__field" }, te = { class: "qy-remark-image__upload-anchor" }, re = {
23
+ key: 0,
24
+ class: "icon-[line-md--loading-twotone-loop]",
25
+ role: "img",
26
+ "aria-hidden": "true"
27
+ }, le = {
28
+ key: 1,
29
+ class: "icon-[ion--cloud-upload-outline]",
30
+ role: "img",
31
+ "aria-hidden": "true"
32
+ }, ue = {
33
+ key: 2,
34
+ class: "icon-[ph--images-thin]",
35
+ role: "img",
36
+ "aria-hidden": "true"
37
+ }, oe = { class: "qy-remark-image__popover" }, ne = ["src"], ie = { class: "qy-remark-image__popover-footer" }, se = $({
38
+ __name: "index",
39
+ props: {
40
+ defaultValue: { default: "" },
41
+ defaultImage: { default: "" },
42
+ rows: { default: 6 },
43
+ width: { default: "" },
44
+ autosize: { type: [Boolean, Object], default: !1 },
45
+ disabled: { type: Boolean, default: !1 },
46
+ placeholder: { default: "粘贴图片上传" },
47
+ type: { default: "textarea" },
48
+ api: { default: "/permission-api/common/uploads" },
49
+ tokenKey: { default: "Admin-Token" }
50
+ },
51
+ emits: ["change"],
52
+ setup(r, { expose: l, emit: C }) {
53
+ const u = r, D = C, S = N(), k = v(null), n = v(""), o = v(""), m = v(!1), P = q(
54
+ () => u.type === "text" ? "text" : "textarea"
55
+ ), R = q(() => {
56
+ if (u.width)
57
+ return {
58
+ width: typeof u.width == "number" ? `${u.width}px` : u.width
59
+ };
60
+ });
61
+ z(
62
+ () => u.defaultValue,
63
+ (e) => {
64
+ const a = U(e || "");
65
+ n.value = a.text, o.value = a.imageUrl || u.defaultImage || "";
66
+ },
67
+ { immediate: !0 }
68
+ ), z(
69
+ () => u.defaultImage,
70
+ (e) => {
71
+ e !== void 0 && !U(u.defaultValue || "").imageUrl && (o.value = e || "");
72
+ },
73
+ { immediate: !0 }
74
+ ), j(() => {
75
+ K(T);
76
+ }), M(() => {
77
+ const e = x();
78
+ e && e.removeEventListener("paste", E);
79
+ });
80
+ function x() {
81
+ var e, a;
82
+ return ((e = k.value) == null ? void 0 : e.textarea) || ((a = k.value) == null ? void 0 : a.input) || null;
83
+ }
84
+ function T() {
85
+ const e = x();
86
+ e && (e.removeEventListener("paste", E), e.addEventListener("paste", E));
87
+ }
88
+ function L(e) {
89
+ n.value = ee(e || "");
90
+ }
91
+ function A() {
92
+ o.value = "", w();
93
+ }
94
+ async function E(e) {
95
+ var d;
96
+ const s = Array.from(((d = e.clipboardData) == null ? void 0 : d.files) || []).find((f) => f.type.startsWith("image/"));
97
+ s && (e.preventDefault(), await B({
98
+ file: s,
99
+ onError: () => {
100
+ },
101
+ onProgress: () => {
102
+ },
103
+ onSuccess: () => {
104
+ }
105
+ }));
106
+ }
107
+ async function B(e) {
108
+ var a, s, d, f;
109
+ if (e.file.size > 51200 * 1e3)
110
+ return F.error("图片过大"), !1;
111
+ m.value = !0;
112
+ try {
113
+ const p = new FormData();
114
+ p.append("files", e.file);
115
+ const I = Y.get(u.tokenKey), t = await (await fetch(u.api, {
116
+ method: "POST",
117
+ body: p,
118
+ credentials: "include",
119
+ headers: I ? { Authorization: `Bearer ${I}` } : void 0
120
+ })).json(), b = (t == null ? void 0 : t.urls) ?? ((a = t == null ? void 0 : t.data) == null ? void 0 : a.urls) ?? ((s = t == null ? void 0 : t.data) == null ? void 0 : s.url) ?? (t == null ? void 0 : t.url) ?? "";
121
+ return o.value = Array.isArray(b) ? b[0] : b, w(), F.success("上传图片成功"), (d = e.onSuccess) == null || d.call(e, t), !0;
122
+ } catch (p) {
123
+ return (f = e.onError) == null || f.call(e, p), F.error("上传失败"), !1;
124
+ } finally {
125
+ m.value = !1;
126
+ }
127
+ }
128
+ function w() {
129
+ D(
130
+ "change",
131
+ V(n.value || "", o.value || ""),
132
+ o.value || ""
133
+ );
134
+ }
135
+ return l({
136
+ deleteImage: A,
137
+ getValue: () => ({
138
+ text: n.value || "",
139
+ imageUrl: o.value || "",
140
+ value: V(n.value || "", o.value || "")
141
+ })
142
+ }), (e, a) => (h(), g("div", {
143
+ class: "qy-remark-image",
144
+ style: O(R.value)
145
+ }, [
146
+ i("div", ae, [
147
+ _(c(G), Q({
148
+ ref_key: "inputRef",
149
+ ref: k,
150
+ "model-value": n.value,
151
+ type: P.value,
152
+ rows: e.rows,
153
+ autosize: e.autosize,
154
+ disabled: e.disabled,
155
+ placeholder: e.placeholder
156
+ }, c(S), {
157
+ "onUpdate:modelValue": L,
158
+ onBlur: w
159
+ }), null, 16, ["model-value", "type", "rows", "autosize", "disabled", "placeholder"]),
160
+ _(c(H), {
161
+ placement: "top-start",
162
+ width: 400,
163
+ trigger: "hover",
164
+ disabled: !o.value
165
+ }, {
166
+ reference: y(() => [
167
+ i("div", te, [
168
+ _(c(X), {
169
+ disabled: m.value || e.disabled,
170
+ class: "qy-remark-image__upload",
171
+ "show-file-list": !1,
172
+ "http-request": B
173
+ }, {
174
+ default: y(() => [
175
+ m.value ? (h(), g("span", re)) : o.value ? (h(), g("span", ue)) : (h(), g("span", le))
176
+ ]),
177
+ _: 1
178
+ }, 8, ["disabled"])
179
+ ])
180
+ ]),
181
+ default: y(() => [
182
+ i("div", oe, [
183
+ i("img", {
184
+ src: o.value,
185
+ class: "qy-remark-image__preview-img"
186
+ }, null, 8, ne),
187
+ i("div", ie, [
188
+ a[1] || (a[1] = i("span", { class: "qy-remark-image__popover-tip" }, "再次点击按钮可更换图片", -1)),
189
+ _(c(J), {
190
+ link: "",
191
+ size: "small",
192
+ type: "danger",
193
+ disabled: e.disabled,
194
+ onClick: A
195
+ }, {
196
+ default: y(() => a[0] || (a[0] = [
197
+ W(" 删除图片 ", -1)
198
+ ])),
199
+ _: 1,
200
+ __: [0]
201
+ }, 8, ["disabled"])
202
+ ])
203
+ ])
204
+ ]),
205
+ _: 1
206
+ }, 8, ["disabled"])
207
+ ])
208
+ ], 4));
209
+ }
210
+ }), ve = /* @__PURE__ */ Z(se, [["__scopeId", "data-v-3b943ab8"]]);
211
+ export {
212
+ ve as Q,
213
+ V as a,
214
+ ee as f,
215
+ U as p
216
+ };