@qynpm/ui 1.0.4 → 1.0.6
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.
- package/README.md +169 -0
- package/dist/index.cjs +2 -1
- package/dist/index.mjs +54 -15
- package/dist/qy-action-bar/index.cjs +1 -1
- package/dist/qy-action-bar/index.mjs +4 -4
- package/dist/qy-dialog/index.cjs +1 -1
- package/dist/qy-dialog/index.mjs +4 -4
- package/dist/qy-form-section/index.cjs +1 -1
- package/dist/qy-form-section/index.mjs +2 -2
- package/dist/qy-input/index.cjs +1 -1
- package/dist/qy-input/index.mjs +4 -4
- package/dist/qy-money-input/index.cjs +1 -0
- package/dist/qy-money-input/index.mjs +6 -0
- package/dist/qy-radio-group/index.cjs +1 -0
- package/dist/qy-radio-group/index.mjs +6 -0
- package/dist/qy-record-quote-search/index.cjs +1 -1
- package/dist/qy-record-quote-search/index.mjs +2 -2
- package/dist/qy-remark-image/index.cjs +1 -2
- package/dist/qy-remark-image/index.mjs +3 -4
- package/dist/qy-remote-select/index.cjs +1 -0
- package/dist/qy-remote-select/index.mjs +6 -0
- package/dist/qy-search-input/index.cjs +1 -1
- package/dist/qy-search-input/index.mjs +3 -3
- package/dist/qy-select/index.cjs +1 -1
- package/dist/qy-select/index.mjs +4 -4
- package/dist/qy-upload/index.cjs +1 -1
- package/dist/qy-upload/index.mjs +3 -3
- package/dist/qy-voucher-upload/index.cjs +1 -0
- package/dist/qy-voucher-upload/index.mjs +6 -0
- package/dist/shared/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
- package/dist/shared/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
- package/dist/{lib/qy-action-bar/index.vue.mjs → shared/index-Bw9kVFsm.mjs} +13 -13
- package/dist/{lib/qy-record-quote-search/index.vue.mjs → shared/index-BzV4959-.mjs} +42 -43
- package/dist/{lib/qy-form-section/index.vue.mjs → shared/index-C0ADdL4S.mjs} +11 -12
- package/dist/shared/index-CBSjmD0C.mjs +217 -0
- package/dist/shared/index-CJb1S7CP.cjs +1 -0
- package/dist/shared/index-CO8lz02r.cjs +1 -0
- package/dist/shared/index-ClPxDFKd.cjs +1 -0
- package/dist/shared/index-CtOqRiaj.cjs +1 -0
- package/dist/shared/index-DXB7_Tb5.cjs +1 -0
- package/dist/shared/index-DeWkPj3O.mjs +484 -0
- package/dist/shared/index-PUYQxK94.mjs +123 -0
- package/dist/shared/index-UzZbxoqZ.cjs +1 -0
- package/dist/shared/index-a90QeEC4.cjs +1 -0
- package/dist/{lib/qy-search-input/index.vue.mjs → shared/index-wW02nNOp.mjs} +55 -55
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-BcZg8D-y.mjs +214 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-BmeBeCu0.mjs +162 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-C85575cL.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DkYwdYdF.mjs +90 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-Do5SZ8yS.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DpZzyX5f.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DuUkOqwY.cjs +1 -0
- package/dist/{lib/qy-input/index.vue.mjs → shared/index.vue_vue_type_script_setup_true_lang-Dvh1BFaR.mjs} +8 -7
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-RtfqJ73A.mjs +171 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-VVjCLNMD.cjs +1 -0
- package/dist/{lib/dialog/index.vue.mjs → shared/index.vue_vue_type_style_index_0_lang-DpIL_6vO.mjs} +24 -25
- package/dist/shared/index.vue_vue_type_style_index_0_lang-haqCjB5x.cjs +1 -0
- package/dist/{lib/utils/install.mjs → shared/install-CxBnxbuN.mjs} +2 -2
- package/dist/shared/install-c8il9DQv.cjs +1 -0
- package/dist/shared/js.cookie-CojEIxHg.cjs +1 -0
- package/dist/{node_modules/.pnpm/js-cookie@3.0.1/node_modules/js-cookie/dist/js.cookie.mjs → shared/js.cookie-OLEfuq_g.mjs} +16 -16
- package/index.d.ts +9 -0
- package/package.json +25 -1
- package/qy-money-input/index.d.ts +12 -0
- package/qy-money-input/index.js +15 -0
- package/qy-radio-group/index.d.ts +12 -0
- package/qy-radio-group/index.js +15 -0
- package/qy-remote-select/index.d.ts +12 -0
- package/qy-remote-select/index.js +15 -0
- package/qy-voucher-upload/index.d.ts +12 -0
- package/qy-voucher-upload/index.js +15 -0
- package/dist/_virtual/plugin-vue_export-helper.cjs +0 -1
- package/dist/_virtual/plugin-vue_export-helper.mjs +0 -9
- package/dist/lib/dialog/index.vue.cjs +0 -1
- package/dist/lib/index.cjs +0 -1
- package/dist/lib/index.mjs +0 -40
- package/dist/lib/qy-action-bar/index.vue.cjs +0 -1
- package/dist/lib/qy-form-section/index.vue.cjs +0 -1
- package/dist/lib/qy-input/index.vue.cjs +0 -1
- package/dist/lib/qy-record-quote-search/index.vue.cjs +0 -1
- package/dist/lib/qy-search-input/index.vue.cjs +0 -1
- package/dist/lib/qy-select/index.vue.cjs +0 -1
- package/dist/lib/qy-select/index.vue.mjs +0 -137
- package/dist/lib/remark-image/index.vue.cjs +0 -1
- package/dist/lib/remark-image/index.vue.mjs +0 -198
- package/dist/lib/remark-image/utils.cjs +0 -1
- package/dist/lib/remark-image/utils.mjs +0 -22
- package/dist/lib/upload/index.vue.cjs +0 -1
- package/dist/lib/upload/index.vue.mjs +0 -382
- package/dist/lib/utils/auth.cjs +0 -1
- package/dist/lib/utils/auth.mjs +0 -8
- package/dist/lib/utils/install.cjs +0 -1
- package/dist/node_modules/.pnpm/js-cookie@3.0.1/node_modules/js-cookie/dist/js.cookie.cjs +0 -1
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { defineComponent as N, useAttrs as j, ref as v, computed as V, watch as B, onMounted as F, nextTick as K, onUnmounted as M, createElementBlock as g, openBlock as h, normalizeStyle as O, createElementVNode as s, createVNode as _, unref as c, mergeProps as Q, withCtx as y, createTextVNode as W } from "vue";
|
|
2
|
+
import { ElMessage as E, ElInput as G, ElPopover as H, ElButton as J, ElUpload as X } from "element-plus";
|
|
3
|
+
import { a as Y } from "./js.cookie-OLEfuq_g.mjs";
|
|
4
|
+
import { _ as Z } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
5
|
+
function S(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 A(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
|
+
}, oe = {
|
|
33
|
+
key: 2,
|
|
34
|
+
class: "icon-[ph--images-thin]",
|
|
35
|
+
role: "img",
|
|
36
|
+
"aria-hidden": "true"
|
|
37
|
+
}, ne = { class: "qy-remark-image__popover" }, ie = ["src"], se = { class: "qy-remark-image__popover-footer" }, de = /* @__PURE__ */ N({
|
|
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: P }) {
|
|
53
|
+
const o = r, R = P, C = j(), k = v(null), i = v(""), n = v(""), m = v(!1), T = V(
|
|
54
|
+
() => o.type === "text" ? "text" : "textarea"
|
|
55
|
+
), D = V(() => {
|
|
56
|
+
if (o.width)
|
|
57
|
+
return {
|
|
58
|
+
width: typeof o.width == "number" ? `${o.width}px` : o.width
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
B(
|
|
62
|
+
() => o.defaultValue,
|
|
63
|
+
(e) => {
|
|
64
|
+
const a = S(e || "");
|
|
65
|
+
i.value = a.text, n.value = a.imageUrl || o.defaultImage || "";
|
|
66
|
+
},
|
|
67
|
+
{ immediate: !0 }
|
|
68
|
+
), B(
|
|
69
|
+
() => o.defaultImage,
|
|
70
|
+
(e) => {
|
|
71
|
+
e !== void 0 && !S(o.defaultValue || "").imageUrl && (n.value = e || "");
|
|
72
|
+
},
|
|
73
|
+
{ immediate: !0 }
|
|
74
|
+
), F(() => {
|
|
75
|
+
K(L);
|
|
76
|
+
}), M(() => {
|
|
77
|
+
const e = I();
|
|
78
|
+
e && e.removeEventListener("paste", w);
|
|
79
|
+
});
|
|
80
|
+
function I() {
|
|
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 L() {
|
|
85
|
+
const e = I();
|
|
86
|
+
e && (e.removeEventListener("paste", w), e.addEventListener("paste", w));
|
|
87
|
+
}
|
|
88
|
+
function $(e) {
|
|
89
|
+
i.value = ee(e || "");
|
|
90
|
+
}
|
|
91
|
+
function q() {
|
|
92
|
+
n.value = "", b();
|
|
93
|
+
}
|
|
94
|
+
async function w(e) {
|
|
95
|
+
var u;
|
|
96
|
+
const d = Array.from(((u = e.clipboardData) == null ? void 0 : u.files) || []).find((f) => f.type.startsWith("image/"));
|
|
97
|
+
d && (e.preventDefault(), await z({
|
|
98
|
+
file: d,
|
|
99
|
+
onError: () => {
|
|
100
|
+
},
|
|
101
|
+
onProgress: () => {
|
|
102
|
+
},
|
|
103
|
+
onSuccess: () => {
|
|
104
|
+
}
|
|
105
|
+
}));
|
|
106
|
+
}
|
|
107
|
+
async function z(e) {
|
|
108
|
+
var a, d, u, f;
|
|
109
|
+
if (e.file.size > 51200 * 1e3)
|
|
110
|
+
return E.error("图片过大"), !1;
|
|
111
|
+
m.value = !0;
|
|
112
|
+
try {
|
|
113
|
+
const p = new FormData();
|
|
114
|
+
p.append("files", e.file);
|
|
115
|
+
const U = Y.get(o.tokenKey), t = await (await fetch(o.api, {
|
|
116
|
+
method: "POST",
|
|
117
|
+
body: p,
|
|
118
|
+
credentials: "include",
|
|
119
|
+
headers: U ? { Authorization: `Bearer ${U}` } : void 0
|
|
120
|
+
})).json(), x = (t == null ? void 0 : t.urls) ?? ((a = t == null ? void 0 : t.data) == null ? void 0 : a.urls) ?? ((d = t == null ? void 0 : t.data) == null ? void 0 : d.url) ?? (t == null ? void 0 : t.url) ?? "";
|
|
121
|
+
return n.value = Array.isArray(x) ? x[0] : x, b(), E.success("上传图片成功"), (u = e.onSuccess) == null || u.call(e, t), !0;
|
|
122
|
+
} catch (p) {
|
|
123
|
+
return (f = e.onError) == null || f.call(e, p), E.error("上传失败"), !1;
|
|
124
|
+
} finally {
|
|
125
|
+
m.value = !1;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function b() {
|
|
129
|
+
R(
|
|
130
|
+
"change",
|
|
131
|
+
A(i.value || "", n.value || ""),
|
|
132
|
+
n.value || ""
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
return l({
|
|
136
|
+
deleteImage: q,
|
|
137
|
+
// 给表单保存或外部调试读取当前拆分值。
|
|
138
|
+
getValue: () => ({
|
|
139
|
+
text: i.value || "",
|
|
140
|
+
imageUrl: n.value || "",
|
|
141
|
+
value: A(i.value || "", n.value || "")
|
|
142
|
+
})
|
|
143
|
+
}), (e, a) => (h(), g("div", {
|
|
144
|
+
class: "qy-remark-image",
|
|
145
|
+
style: O(D.value)
|
|
146
|
+
}, [
|
|
147
|
+
s("div", ae, [
|
|
148
|
+
_(c(G), Q({
|
|
149
|
+
ref_key: "inputRef",
|
|
150
|
+
ref: k,
|
|
151
|
+
"model-value": i.value,
|
|
152
|
+
type: T.value,
|
|
153
|
+
rows: e.rows,
|
|
154
|
+
autosize: e.autosize,
|
|
155
|
+
disabled: e.disabled,
|
|
156
|
+
placeholder: e.placeholder
|
|
157
|
+
}, c(C), {
|
|
158
|
+
"onUpdate:modelValue": $,
|
|
159
|
+
onBlur: b
|
|
160
|
+
}), null, 16, ["model-value", "type", "rows", "autosize", "disabled", "placeholder"]),
|
|
161
|
+
_(c(H), {
|
|
162
|
+
placement: "top-start",
|
|
163
|
+
width: 400,
|
|
164
|
+
trigger: "hover",
|
|
165
|
+
disabled: !n.value
|
|
166
|
+
}, {
|
|
167
|
+
reference: y(() => [
|
|
168
|
+
s("div", te, [
|
|
169
|
+
_(c(X), {
|
|
170
|
+
disabled: m.value || e.disabled,
|
|
171
|
+
class: "qy-remark-image__upload",
|
|
172
|
+
"show-file-list": !1,
|
|
173
|
+
"http-request": z
|
|
174
|
+
}, {
|
|
175
|
+
default: y(() => [
|
|
176
|
+
m.value ? (h(), g("span", re)) : n.value ? (h(), g("span", oe)) : (h(), g("span", le))
|
|
177
|
+
]),
|
|
178
|
+
_: 1
|
|
179
|
+
}, 8, ["disabled"])
|
|
180
|
+
])
|
|
181
|
+
]),
|
|
182
|
+
default: y(() => [
|
|
183
|
+
s("div", ne, [
|
|
184
|
+
s("img", {
|
|
185
|
+
src: n.value,
|
|
186
|
+
class: "qy-remark-image__preview-img"
|
|
187
|
+
}, null, 8, ie),
|
|
188
|
+
s("div", se, [
|
|
189
|
+
a[1] || (a[1] = s("span", { class: "qy-remark-image__popover-tip" }, "再次点击按钮可更换图片", -1)),
|
|
190
|
+
_(c(J), {
|
|
191
|
+
link: "",
|
|
192
|
+
size: "small",
|
|
193
|
+
type: "danger",
|
|
194
|
+
disabled: e.disabled,
|
|
195
|
+
onClick: q
|
|
196
|
+
}, {
|
|
197
|
+
default: y(() => a[0] || (a[0] = [
|
|
198
|
+
W(" 删除图片 ", -1)
|
|
199
|
+
])),
|
|
200
|
+
_: 1,
|
|
201
|
+
__: [0]
|
|
202
|
+
}, 8, ["disabled"])
|
|
203
|
+
])
|
|
204
|
+
])
|
|
205
|
+
]),
|
|
206
|
+
_: 1
|
|
207
|
+
}, 8, ["disabled"])
|
|
208
|
+
])
|
|
209
|
+
], 4));
|
|
210
|
+
}
|
|
211
|
+
}), ve = /* @__PURE__ */ Z(de, [["__scopeId", "data-v-f8d38d88"]]);
|
|
212
|
+
export {
|
|
213
|
+
ve as Q,
|
|
214
|
+
A as a,
|
|
215
|
+
ee as f,
|
|
216
|
+
S as p
|
|
217
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),d=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),c={class:"qy-form-section__heading"},p={key:0,class:"qy-form-section__title"},u={key:0,class:"qy-form-section__description"},m={class:"qy-form-section__actions"},f=e.defineComponent({name:"QyFormSection",__name:"index",props:{title:{default:""},description:{default:""},tip:{default:""},tipType:{default:"info"},collapsible:{type:Boolean,default:!1},defaultExpanded:{type:Boolean,default:!0},bordered:{type:Boolean,default:!0},background:{default:"white"},bodyClass:{default:""},headerClass:{default:""}},emits:["toggle"],setup(i,{emit:n}){const l=i,a=n,o=e.ref(l.defaultExpanded);e.watch(()=>l.defaultExpanded,t=>{o.value=t});function s(){l.collapsible&&(o.value=!o.value,a("toggle",o.value))}function r(){l.collapsible&&s()}return(t,k)=>(e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass(["qy-form-section",[`is-bg-${t.background}`,{"is-bordered":t.bordered,"is-collapsible":t.collapsible}]])},[e.createElementVNode("header",{class:e.normalizeClass(["qy-form-section__header",t.headerClass]),onClick:r},[e.createElementVNode("div",c,[e.renderSlot(t.$slots,"title",{},()=>[t.title?(e.openBlock(),e.createElementBlock("div",p,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0)],!0),e.renderSlot(t.$slots,"description",{},()=>[t.description?(e.openBlock(),e.createElementBlock("div",u,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)],!0)]),e.createElementVNode("div",m,[e.renderSlot(t.$slots,"actions",{},void 0,!0),t.collapsible?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"qy-form-section__toggle",onClick:e.withModifiers(s,["stop"])},e.toDisplayString(o.value?"收起":"展开"),1)):e.createCommentVNode("",!0)])],2),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["qy-form-section__body",t.bodyClass])},[e.renderSlot(t.$slots,"tip",{},()=>[t.tip?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["qy-form-section__tip",`is-${t.tipType}`])},e.toDisplayString(t.tip),3)):e.createCommentVNode("",!0)],!0),e.renderSlot(t.$slots,"default",{},void 0,!0)],2),[[e.vShow,o.value]])],2))}}),y=d._export_sfc(f,[["__scopeId","data-v-8149aa01"]]);exports.QyFormSection=y;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("vue"),k=require("./index-a90QeEC4.cjs"),S=Object.assign({name:"QyVoucherUpload",inheritAttrs:!1},{__name:"index",props:{modelValue:{type:Array,default:()=>[]},api:{type:String,default:"/permission-api/common/uploads"},name:{type:String,default:"files"},multiple:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},fileType:{type:Array,default:()=>[]},fileSize:{type:Number,default:10},limit:{type:Number,default:9},isShowTip:{type:Boolean,default:!1},tokenKey:{type:String,default:"Admin-Token"},supportVideo:{type:Boolean,default:!1},size:{type:String,default:"90px"},disableDrag:{type:Boolean,default:!1},callBack:{type:Function,default:null},extraData:{type:Object,default:()=>({})},pastePlaceholder:{type:String,default:"粘贴图片上传"}},emits:["update:modelValue","change","success","error","remove"],setup(t,{expose:r,emit:d}){const i=d,s=l.useAttrs(),n=l.ref(null);function o(e){return Array.isArray(e)?e:[]}function c(e){i("update:modelValue",o(e))}function f(e){const a=o(e==null?void 0:e.files);i("change",a)}function m(e){i("success",e)}function p(e){i("error",e)}function y(e,a){i("remove",e,a)}function h(){var e,a;(a=(e=n.value)==null?void 0:e.openFileDialog)==null||a.call(e)}function u(){var e,a;return((a=(e=n.value)==null?void 0:e.getPathList)==null?void 0:a.call(e))||[]}function g(){var e,a;(a=(e=n.value)==null?void 0:e.clearFiles)==null||a.call(e)}function b(){return u()}return r({openFileDialog:h,getPathList:u,clearFiles:g,getValue:b}),(e,a)=>(l.openBlock(),l.createBlock(k.QyUpload,l.mergeProps({ref_key:"uploadRef",ref:n},l.unref(s),{"model-value":t.modelValue,"value-format":"array",api:t.api,name:t.name,multiple:t.multiple,disabled:t.disabled,"file-type":t.fileType,"file-size":t.fileSize,limit:t.limit,"is-show-tip":t.isShowTip,"token-key":t.tokenKey,"support-video":t.supportVideo,size:t.size,"disable-drag":t.disableDrag,"call-back":t.callBack,"extra-data":t.extraData,"show-text":!1,"show-paste-input":!0,"paste-placeholder":t.pastePlaceholder,"onUpdate:modelValue":c,onChange:f,onSuccess:m,onError:p,onRemove:y}),null,16,["model-value","api","name","multiple","disabled","file-type","file-size","limit","is-show-tip","token-key","support-video","size","disable-drag","call-back","extra-data","paste-placeholder"]))}});exports._sfc_main=S;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("vue"),w=require("element-plus"),X=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Y={class:"qy-search-input__item"},Z=["innerHTML"],ee={key:0,class:"qy-search-input__item-description"},te=n.defineComponent({name:"QySearchInput",inheritAttrs:!1,__name:"index",props:{modelValue:{default:""},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{default:"请输入搜索内容"},removeSpace:{type:Boolean,default:!1},trimMode:{default:"none"},clearable:{type:Boolean,default:!0},buttonText:{default:"搜索"},buttonProps:{default:()=>({})},suggestions:{default:()=>[]},fetchSuggestions:{type:[Function,null],default:null},fetchSuggestionsMethod:{type:[Function,null],default:null},debounce:{default:300},minLength:{default:1},triggerOnFocus:{type:Boolean,default:!1},searchOnEnter:{type:Boolean,default:!0},searchOnSelect:{type:Boolean,default:!1},highlightKeyword:{type:Boolean,default:!0},teleported:{type:Boolean,default:!0},appendTo:{default:"body"},popperClass:{default:""},fitInputWidth:{type:Boolean,default:!0}},emits:["update:modelValue","search","clear","input","change","focus","blur","enter","select","visible-change","suggestions-change","error"],setup(k,{expose:B,emit:C}){const o=k,a=C,$=n.useAttrs(),s=n.ref(null),c=n.ref(u(o.modelValue)),p=n.computed(()=>u(o.modelValue)),E=n.computed(()=>["qy-search-input__popper",o.popperClass].filter(Boolean).join(" ")),I=n.computed(()=>u(o.modelValue)),f=n.ref("");n.watch(()=>o.modelValue,e=>{c.value=u(e)});function u(e){return e==null?"":String(e)}function M(e){return o.removeSpace?e.replace(/\s+/g,""):e}function y(e,t){return o.trimMode!==t?e:e.trim()}function g(e){return M(u(e))}function h(e){c.value=e,a("update:modelValue",e)}function v(e,t=""){return{...e,label:e.label||e.value,value:e.value||e.label,description:e.description||t}}function m(e=[]){return e.flatMap(t=>{if(Array.isArray(t.items)){const l=t;return l.items.map(r=>v(r,l.groupLabel))}return v(t)})}function F(e){const t=e.toLowerCase();return l=>[l.label,l.value,l.description].filter(Boolean).some(r=>String(r).toLowerCase().includes(t))}function L(e){return e?e.length>=o.minLength:o.triggerOnFocus}function i(e){a("suggestions-change",e),a("visible-change",e.length>0)}async function T(e){if(!L(e))return i([]),[];if(o.fetchSuggestionsMethod){const r=await new Promise(d=>{var S;(S=o.fetchSuggestionsMethod)==null||S.call(o,e,J=>{d(m(J))})});return i(r),r}if(o.fetchSuggestions){const r=await o.fetchSuggestions(e),d=m(Array.isArray(r)?r:[]);return i(d),d}const t=m(o.suggestions),l=e?t.filter(F(e)):t;return i(l),l}async function _(e,t){f.value=e;try{const l=await T(e);t(l)}catch(l){a("error",l),i([]),t([])}}function P(){var e,t;f.value&&((t=(e=s.value)==null?void 0:e.getData)==null||t.call(e,f.value))}function A(e){const t=g(e);h(t)}function O(e){const t=g(e);c.value=t,a("input",t)}function z(e){const t=y(g(e),"change");t!==u(o.modelValue)&&h(t),a("change",t)}function q(e){a("focus",e)}function x(e){const t=y(c.value,"blur");t!==u(o.modelValue)&&h(t),a("blur",e),a("visible-change",!1)}function H(){c.value="",a("update:modelValue",""),a("clear"),i([])}function K(e){a("enter",e),o.searchOnEnter&&b()}function b(){a("search",u(o.modelValue))}function N(e){a("select",e),o.searchOnSelect&&a("search",e.value)}function V(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Q(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function R(e){const t=V(e||"");if(!o.highlightKeyword||!p.value)return t;const l=Q(V(p.value));return l?t.replace(new RegExp(`(${l})`,"ig"),'<mark class="qy-search-input__mark">$1</mark>'):t}function D(){var e,t;(t=(e=s.value)==null?void 0:e.focus)==null||t.call(e)}function U(){var e,t;(t=(e=s.value)==null?void 0:e.blur)==null||t.call(e)}function W(){var e,t,l;(l=(t=(e=s.value)==null?void 0:e.inputRef)==null?void 0:t.select)==null||l.call(t)}function j(){var e,t;(t=(e=s.value)==null?void 0:e.clear)==null||t.call(e)}function G(){var e,t;(t=(e=s.value)==null?void 0:e.close)==null||t.call(e)}return B({focus:D,blur:U,select:W,clear:j,closePanel:G,retryFetch:P}),(e,t)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["qy-search-input",{"is-disabled":e.disabled}])},[n.createVNode(n.unref(w.ElAutocomplete),n.mergeProps({ref_key:"autocompleteRef",ref:s},n.unref($),{"model-value":I.value,disabled:e.disabled,placeholder:e.placeholder,clearable:e.clearable,debounce:e.debounce,"fetch-suggestions":_,"trigger-on-focus":e.triggerOnFocus,teleported:e.teleported,"fit-input-width":e.fitInputWidth,"popper-class":E.value,"append-to":e.appendTo,"value-key":"value","onUpdate:modelValue":A,onInput:O,onChange:z,onFocus:q,onBlur:x,onClear:H,onSelect:N,onKeydown:n.withKeys(K,["enter"])}),n.createSlots({append:n.withCtx(()=>[e.$slots.append?n.renderSlot(e.$slots,"append",{key:0},void 0,!0):(n.openBlock(),n.createBlock(n.unref(w.ElButton),n.mergeProps({key:1},e.buttonProps,{loading:e.loading,disabled:e.disabled,onClick:b}),{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.buttonText),1)]),_:1},16,["loading","disabled"]))]),default:n.withCtx(({item:l})=>[n.renderSlot(e.$slots,"item",{item:l,keyword:p.value},()=>[n.createElementVNode("div",Y,[n.createElementVNode("div",{class:"qy-search-input__item-label",innerHTML:R(l.label||l.value||"")},null,8,Z),l.description?(n.openBlock(),n.createElementBlock("div",ee,n.toDisplayString(l.description),1)):n.createCommentVNode("",!0)])],!0)]),_:2},[e.$slots.prefix?{name:"prefix",fn:n.withCtx(()=>[n.renderSlot(e.$slots,"prefix",{},void 0,!0)]),key:"0"}:void 0,e.$slots.suffix?{name:"suffix",fn:n.withCtx(()=>[n.renderSlot(e.$slots,"suffix",{},void 0,!0)]),key:"1"}:void 0,e.$slots.prepend?{name:"prepend",fn:n.withCtx(()=>[n.renderSlot(e.$slots,"prepend",{},void 0,!0)]),key:"2"}:void 0]),1040,["model-value","disabled","placeholder","clearable","debounce","trigger-on-focus","teleported","fit-input-width","popper-class","append-to"])],2))}}),ne=X._export_sfc(te,[["__scopeId","data-v-f1f0e1f9"]]);exports.QySearchInput=ne;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),a=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),l={key:0,class:"qy-action-bar__left"},n={key:1,class:"qy-action-bar__center"},d={key:2,class:"qy-action-bar__right"},c=e.defineComponent({name:"QyActionBar",__name:"index",props:{sticky:{type:Boolean,default:!0},offsetBottom:{default:0},bordered:{type:Boolean,default:!0},shadow:{type:Boolean,default:!1},wrap:{type:Boolean,default:!0},justify:{default:"between"},background:{default:"#fff"}},setup(r){const o=r,s=e.computed(()=>({bottom:`${o.offsetBottom}px`,background:o.background}));return(t,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["qy-action-bar",[`is-justify-${t.justify}`,{"is-sticky":t.sticky,"is-bordered":t.bordered,"is-shadow":t.shadow,"is-wrap":t.wrap}]]),style:e.normalizeStyle(s.value)},[t.$slots.left?(e.openBlock(),e.createElementBlock("div",l,[e.renderSlot(t.$slots,"left",{},void 0,!0)])):e.createCommentVNode("",!0),t.$slots.default?(e.openBlock(),e.createElementBlock("div",n,[e.renderSlot(t.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0),t.$slots.right?(e.openBlock(),e.createElementBlock("div",d,[e.renderSlot(t.$slots,"right",{},void 0,!0)])):e.createCommentVNode("",!0)],6))}}),i=a._export_sfc(c,[["__scopeId","data-v-ecba8f49"]]);exports.QyActionBar=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("vue"),O=require("./index-ClPxDFKd.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),T={class:"qy-record-quote-search"},F={key:0,class:"qy-record-quote-search__header"},L={key:0,class:"qy-record-quote-search__label"},P={key:1,class:"qy-record-quote-search__description"},A=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 s(e){return e==null?"":String(e)}function k(e){const o=s(e).trim(),l=c(o),u=l.match(/BJ\d{8}[A-Z0-9]{4}/i);return u?u[0]:l}function c(e){return s(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=s(e),u=f(l),g=r.autoNormalize?h(u):u;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!==s(r.modelValue)&&n("update:modelValue",o.code),p(o)}function M(){n("clear")}function q(e){n("enter",e)}function $(e){if(n("select",e),!r.searchOnSelect)return;const o=m(e.value,e);o.code!==s(r.modelValue)&&n("update:modelValue",o.code),p(o)}function z(e){n("error",e)}function Q(){var e,o;(o=(e=a.value)==null?void 0:e.focus)==null||o.call(e)}function E(){var e,o;(o=(e=a.value)==null?void 0:e.blur)==null||o.call(e)}function w(){var e,o;(o=(e=a.value)==null?void 0:e.select)==null||o.call(e)}function N(){var e,o;(o=(e=a.value)==null?void 0:e.clear)==null||o.call(e)}return S({focus:Q,blur:E,select:w,clear:N,extractQuoteOrderCode:f,normalizeQuoteOrderCode:h}),(e,o)=>(t.openBlock(),t.createElementBlock("div",T,[t.renderSlot(e.$slots,"label",{},()=>[e.label||e.description?(t.openBlock(),t.createElementBlock("div",F,[e.label?(t.openBlock(),t.createElementBlock("div",L,t.toDisplayString(e.label),1)):t.createCommentVNode("",!0),e.description?(t.openBlock(),t.createElementBlock("div",P,t.toDisplayString(e.description),1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)],!0),t.createVNode(O.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:M,onEnter:q,onSelect:$,onError:z}),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=R._export_sfc(A,[["__scopeId","data-v-3a314f64"]]);exports.QyRecordQuoteSearch=D;
|