@qynpm/ui 1.0.4 → 1.0.5
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 +228 -59
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +19 -15
- package/dist/lib/dialog/index.vue.cjs +1 -1
- package/dist/lib/dialog/index.vue.mjs +24 -25
- package/dist/lib/dialog/index.vue3.cjs +1 -0
- package/dist/lib/dialog/index.vue3.mjs +5 -0
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.mjs +43 -30
- package/dist/lib/qy-action-bar/index.vue.cjs +1 -1
- package/dist/lib/qy-action-bar/index.vue.mjs +4 -53
- package/dist/lib/qy-action-bar/index.vue2.cjs +1 -0
- package/dist/lib/qy-action-bar/index.vue2.mjs +55 -0
- package/dist/lib/qy-form-section/index.vue.cjs +1 -1
- package/dist/lib/qy-form-section/index.vue.mjs +4 -86
- package/dist/lib/qy-form-section/index.vue2.cjs +1 -0
- package/dist/lib/qy-form-section/index.vue2.mjs +87 -0
- package/dist/lib/qy-input/index.vue.mjs +2 -1
- package/dist/lib/qy-input/index.vue2.cjs +1 -0
- package/dist/lib/qy-input/index.vue2.mjs +4 -0
- package/dist/lib/qy-money-input/index.vue.cjs +1 -0
- package/dist/lib/qy-money-input/index.vue.mjs +171 -0
- package/dist/lib/qy-money-input/index.vue2.cjs +1 -0
- package/dist/lib/qy-money-input/index.vue2.mjs +4 -0
- package/dist/lib/qy-radio-group/index.vue.cjs +1 -0
- package/dist/lib/qy-radio-group/index.vue.mjs +90 -0
- package/dist/lib/qy-radio-group/index.vue2.cjs +1 -0
- package/dist/lib/qy-radio-group/index.vue2.mjs +4 -0
- package/dist/lib/qy-record-quote-search/index.vue.cjs +1 -1
- package/dist/lib/qy-record-quote-search/index.vue.mjs +4 -203
- package/dist/lib/qy-record-quote-search/index.vue2.cjs +1 -0
- package/dist/lib/qy-record-quote-search/index.vue2.mjs +204 -0
- package/dist/lib/qy-remote-select/index.vue.cjs +1 -0
- package/dist/lib/qy-remote-select/index.vue.mjs +214 -0
- package/dist/lib/qy-remote-select/index.vue2.cjs +1 -0
- package/dist/lib/qy-remote-select/index.vue2.mjs +4 -0
- package/dist/lib/qy-search-input/index.vue.cjs +1 -1
- package/dist/lib/qy-search-input/index.vue.mjs +4 -274
- package/dist/lib/qy-search-input/index.vue2.cjs +1 -0
- package/dist/lib/qy-search-input/index.vue2.mjs +276 -0
- package/dist/lib/qy-select/index.vue.cjs +1 -1
- package/dist/lib/qy-select/index.vue.mjs +80 -55
- package/dist/lib/qy-select/index.vue2.cjs +1 -0
- package/dist/lib/qy-select/index.vue2.mjs +4 -0
- package/dist/lib/qy-voucher-upload/index.vue.cjs +1 -0
- package/dist/lib/qy-voucher-upload/index.vue.mjs +123 -0
- package/dist/lib/remark-image/index.vue.cjs +1 -1
- package/dist/lib/remark-image/index.vue.mjs +4 -195
- package/dist/lib/remark-image/index.vue2.cjs +1 -0
- package/dist/lib/remark-image/index.vue2.mjs +197 -0
- package/dist/lib/upload/index.vue.cjs +1 -1
- package/dist/lib/upload/index.vue.mjs +317 -217
- package/dist/lib/utils/auth.cjs +1 -1
- package/dist/lib/utils/auth.mjs +1 -1
- package/dist/node_modules/.pnpm/{js-cookie@3.0.1 → js-cookie@3.0.5}/node_modules/js-cookie/dist/js.cookie.cjs +1 -1
- package/dist/node_modules/.pnpm/{js-cookie@3.0.1 → js-cookie@3.0.5}/node_modules/js-cookie/dist/js.cookie.mjs +6 -6
- package/dist/qy-dialog/index.cjs +1 -1
- package/dist/qy-dialog/index.mjs +3 -2
- package/dist/qy-input/index.cjs +1 -1
- 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-remark-image/index.cjs +1 -1
- package/dist/qy-remark-image/index.mjs +1 -1
- package/dist/qy-remote-select/index.cjs +1 -0
- package/dist/qy-remote-select/index.mjs +6 -0
- package/dist/qy-select/index.cjs +1 -1
- package/dist/qy-voucher-upload/index.cjs +1 -0
- package/dist/qy-voucher-upload/index.mjs +6 -0
- package/index.d.ts +20 -11
- 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 → _plugin-vue_export-helper.cjs} +0 -0
- /package/dist/_virtual/{plugin-vue_export-helper.mjs → _plugin-vue_export-helper.mjs} +0 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { defineComponent as z, useAttrs as G, ref as $, computed as t, createBlock as f, openBlock as u, unref as n, mergeProps as m, withCtx as b, renderSlot as c, createElementBlock as E, Fragment as S, renderList as w, resolveDynamicComponent as P, createTextVNode as _, toDisplayString as A } from "vue";
|
|
2
|
+
import { ElRadioButton as D, ElRadio as N, ElRadioGroup as O } from "element-plus";
|
|
3
|
+
const I = /* @__PURE__ */ z({
|
|
4
|
+
name: "QyRadioGroup",
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "index",
|
|
7
|
+
props: {
|
|
8
|
+
modelValue: { type: [String, Number, Boolean, null], default: void 0 },
|
|
9
|
+
options: { default: () => [] },
|
|
10
|
+
labelKey: { default: "label" },
|
|
11
|
+
valueKey: { default: "value" },
|
|
12
|
+
disabledKey: { default: "disabled" },
|
|
13
|
+
disabled: { type: Boolean, default: !1 },
|
|
14
|
+
size: { default: "default" },
|
|
15
|
+
name: { default: void 0 },
|
|
16
|
+
type: { default: "radio" },
|
|
17
|
+
border: { type: Boolean, default: !1 }
|
|
18
|
+
},
|
|
19
|
+
emits: ["update:modelValue", "change"],
|
|
20
|
+
setup(v, { expose: y, emit: i }) {
|
|
21
|
+
const a = v, r = i, g = G(), s = $(null), h = t(
|
|
22
|
+
() => a.type === "button" ? D : N
|
|
23
|
+
), B = t(
|
|
24
|
+
() => (a.options || []).map((e) => ({
|
|
25
|
+
raw: e,
|
|
26
|
+
label: (e == null ? void 0 : e[a.labelKey]) ?? (e == null ? void 0 : e.label) ?? (e == null ? void 0 : e.value) ?? "",
|
|
27
|
+
value: (e == null ? void 0 : e[a.valueKey]) ?? (e == null ? void 0 : e.value) ?? (e == null ? void 0 : e.label),
|
|
28
|
+
disabled: !!(e != null && e[a.disabledKey])
|
|
29
|
+
}))
|
|
30
|
+
);
|
|
31
|
+
function R(e) {
|
|
32
|
+
const d = {
|
|
33
|
+
value: e.value,
|
|
34
|
+
label: e.value,
|
|
35
|
+
disabled: e.disabled
|
|
36
|
+
};
|
|
37
|
+
return a.type === "button" ? d : {
|
|
38
|
+
...d,
|
|
39
|
+
border: a.border
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function k(e, d) {
|
|
43
|
+
return `${String(e.value ?? e.label ?? "")}-${d}`;
|
|
44
|
+
}
|
|
45
|
+
function o(e) {
|
|
46
|
+
r("update:modelValue", e);
|
|
47
|
+
}
|
|
48
|
+
function K(e) {
|
|
49
|
+
r("change", e);
|
|
50
|
+
}
|
|
51
|
+
function V() {
|
|
52
|
+
return s.value;
|
|
53
|
+
}
|
|
54
|
+
return y({
|
|
55
|
+
getRadioGroupInstance: V
|
|
56
|
+
}), (e, d) => (u(), f(n(O), m({
|
|
57
|
+
ref_key: "radioGroupRef",
|
|
58
|
+
ref: s
|
|
59
|
+
}, n(g), {
|
|
60
|
+
"model-value": e.modelValue,
|
|
61
|
+
disabled: e.disabled,
|
|
62
|
+
size: e.size,
|
|
63
|
+
name: e.name,
|
|
64
|
+
"onUpdate:modelValue": o,
|
|
65
|
+
onChange: K
|
|
66
|
+
}), {
|
|
67
|
+
default: b(() => [
|
|
68
|
+
e.$slots.default ? c(e.$slots, "default", { key: 0 }) : (u(!0), E(S, { key: 1 }, w(B.value, (l, C) => (u(), f(P(h.value), m({
|
|
69
|
+
key: k(l, C)
|
|
70
|
+
}, { ref_for: !0 }, R(l)), {
|
|
71
|
+
default: b(() => [
|
|
72
|
+
c(e.$slots, "option", {
|
|
73
|
+
option: l.raw,
|
|
74
|
+
label: l.label,
|
|
75
|
+
value: l.value,
|
|
76
|
+
disabled: l.disabled
|
|
77
|
+
}, () => [
|
|
78
|
+
_(A(l.label), 1)
|
|
79
|
+
])
|
|
80
|
+
]),
|
|
81
|
+
_: 2
|
|
82
|
+
}, 1040))), 128))
|
|
83
|
+
]),
|
|
84
|
+
_: 3
|
|
85
|
+
}, 16, ["model-value", "disabled", "size", "name"]));
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
export {
|
|
89
|
+
I as default
|
|
90
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index.vue.cjs");exports.default=e.default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=require("../../_virtual/_plugin-vue_export-helper.cjs"),u=t.default(e.default,[["__scopeId","data-v-6f12a6f5"]]);exports.default=u;
|
|
@@ -1,206 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import X from "../qy-search-input/index.vue.mjs";
|
|
1
|
+
import o from "./index.vue2.mjs";
|
|
3
2
|
/* empty css */
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
key: 0,
|
|
7
|
-
class: "qy-record-quote-search__header"
|
|
8
|
-
}, ee = {
|
|
9
|
-
key: 0,
|
|
10
|
-
class: "qy-record-quote-search__label"
|
|
11
|
-
}, te = {
|
|
12
|
-
key: 1,
|
|
13
|
-
class: "qy-record-quote-search__description"
|
|
14
|
-
}, oe = U({
|
|
15
|
-
name: "QyRecordQuoteSearch",
|
|
16
|
-
inheritAttrs: !1,
|
|
17
|
-
__name: "index",
|
|
18
|
-
props: {
|
|
19
|
-
modelValue: { default: "" },
|
|
20
|
-
loading: { type: Boolean, default: !1 },
|
|
21
|
-
disabled: { type: Boolean, default: !1 },
|
|
22
|
-
placeholder: { default: "请输入报价单号" },
|
|
23
|
-
buttonText: { default: "查询报价单" },
|
|
24
|
-
autoNormalize: { type: Boolean, default: !0 },
|
|
25
|
-
showStatus: { type: Boolean, default: !0 },
|
|
26
|
-
status: { default: "default" },
|
|
27
|
-
statusText: { default: "" },
|
|
28
|
-
suggestions: { default: () => [] },
|
|
29
|
-
fetchSuggestions: { type: [Function, null], default: null },
|
|
30
|
-
fetchSuggestionsMethod: { type: [Function, null], default: null },
|
|
31
|
-
debounce: { default: 300 },
|
|
32
|
-
minLength: { default: 1 },
|
|
33
|
-
searchOnSelect: { type: Boolean, default: !0 },
|
|
34
|
-
searchMethod: { type: [Function, null], default: null },
|
|
35
|
-
extractMethod: { type: [Function, null], default: null },
|
|
36
|
-
normalizeMethod: { type: [Function, null], default: null },
|
|
37
|
-
label: { default: "报价单号" },
|
|
38
|
-
description: { default: "" },
|
|
39
|
-
trimMode: { default: "blur" }
|
|
40
|
-
},
|
|
41
|
-
emits: ["update:modelValue", "search", "clear", "normalize", "enter", "select", "error", "success"],
|
|
42
|
-
setup(k, { expose: z, emit: E }) {
|
|
43
|
-
const o = k, a = E, F = I(), l = M(null), h = M(!1), m = $(() => o.statusText || ""), C = $(() => o.loading || h.value);
|
|
44
|
-
function u(e) {
|
|
45
|
-
return e == null ? "" : String(e);
|
|
46
|
-
}
|
|
47
|
-
function q(e) {
|
|
48
|
-
const t = u(e).trim(), n = g(t), s = n.match(/BJ\d{8}[A-Z0-9]{4}/i);
|
|
49
|
-
return s ? s[0] : n;
|
|
50
|
-
}
|
|
51
|
-
function g(e) {
|
|
52
|
-
return u(e).replace(/\s+/g, "").trim().toUpperCase();
|
|
53
|
-
}
|
|
54
|
-
function y(e) {
|
|
55
|
-
return o.extractMethod ? o.extractMethod(e) : q(e);
|
|
56
|
-
}
|
|
57
|
-
function v(e) {
|
|
58
|
-
return o.normalizeMethod ? o.normalizeMethod(e) : g(e);
|
|
59
|
-
}
|
|
60
|
-
function b(e, t) {
|
|
61
|
-
const n = u(e), s = y(n), V = o.autoNormalize ? v(s) : s;
|
|
62
|
-
return a("normalize", { rawValue: n, code: V }), {
|
|
63
|
-
rawValue: n,
|
|
64
|
-
code: V,
|
|
65
|
-
item: t
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
function B(e) {
|
|
69
|
-
a("update:modelValue", e);
|
|
70
|
-
}
|
|
71
|
-
async function S(e) {
|
|
72
|
-
if (a("search", e), !!o.searchMethod) {
|
|
73
|
-
h.value = !0;
|
|
74
|
-
try {
|
|
75
|
-
const t = await o.searchMethod(e);
|
|
76
|
-
a("success", t);
|
|
77
|
-
} catch (t) {
|
|
78
|
-
a("error", t);
|
|
79
|
-
} finally {
|
|
80
|
-
h.value = !1;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
function Q(e) {
|
|
85
|
-
const t = b(e);
|
|
86
|
-
t.code !== u(o.modelValue) && a("update:modelValue", t.code), S(t);
|
|
87
|
-
}
|
|
88
|
-
function A() {
|
|
89
|
-
a("clear");
|
|
90
|
-
}
|
|
91
|
-
function N(e) {
|
|
92
|
-
a("enter", e);
|
|
93
|
-
}
|
|
94
|
-
function O(e) {
|
|
95
|
-
if (a("select", e), !o.searchOnSelect) return;
|
|
96
|
-
const t = b(e.value, e);
|
|
97
|
-
t.code !== u(o.modelValue) && a("update:modelValue", t.code), S(t);
|
|
98
|
-
}
|
|
99
|
-
function T(e) {
|
|
100
|
-
a("error", e);
|
|
101
|
-
}
|
|
102
|
-
function w() {
|
|
103
|
-
var e, t;
|
|
104
|
-
(t = (e = l.value) == null ? void 0 : e.focus) == null || t.call(e);
|
|
105
|
-
}
|
|
106
|
-
function R() {
|
|
107
|
-
var e, t;
|
|
108
|
-
(t = (e = l.value) == null ? void 0 : e.blur) == null || t.call(e);
|
|
109
|
-
}
|
|
110
|
-
function L() {
|
|
111
|
-
var e, t;
|
|
112
|
-
(t = (e = l.value) == null ? void 0 : e.select) == null || t.call(e);
|
|
113
|
-
}
|
|
114
|
-
function P() {
|
|
115
|
-
var e, t;
|
|
116
|
-
(t = (e = l.value) == null ? void 0 : e.clear) == null || t.call(e);
|
|
117
|
-
}
|
|
118
|
-
return z({
|
|
119
|
-
focus: w,
|
|
120
|
-
blur: R,
|
|
121
|
-
select: L,
|
|
122
|
-
clear: P,
|
|
123
|
-
extractQuoteOrderCode: y,
|
|
124
|
-
normalizeQuoteOrderCode: v
|
|
125
|
-
}), (e, t) => (c(), i("div", _, [
|
|
126
|
-
r(e.$slots, "label", {}, () => [
|
|
127
|
-
e.label || e.description ? (c(), i("div", x, [
|
|
128
|
-
e.label ? (c(), i("div", ee, p(e.label), 1)) : f("", !0),
|
|
129
|
-
e.description ? (c(), i("div", te, p(e.description), 1)) : f("", !0)
|
|
130
|
-
])) : f("", !0)
|
|
131
|
-
], !0),
|
|
132
|
-
D(X, J({
|
|
133
|
-
ref_key: "searchRef",
|
|
134
|
-
ref: l
|
|
135
|
-
}, Z(F), {
|
|
136
|
-
"model-value": e.modelValue,
|
|
137
|
-
loading: C.value,
|
|
138
|
-
disabled: e.disabled,
|
|
139
|
-
placeholder: e.placeholder,
|
|
140
|
-
"remove-space": !0,
|
|
141
|
-
"trim-mode": e.trimMode,
|
|
142
|
-
"button-text": e.buttonText,
|
|
143
|
-
suggestions: e.suggestions,
|
|
144
|
-
"fetch-suggestions": e.fetchSuggestions,
|
|
145
|
-
"fetch-suggestions-method": e.fetchSuggestionsMethod,
|
|
146
|
-
debounce: e.debounce,
|
|
147
|
-
"min-length": e.minLength,
|
|
148
|
-
"search-on-select": !1,
|
|
149
|
-
"onUpdate:modelValue": B,
|
|
150
|
-
onSearch: Q,
|
|
151
|
-
onClear: A,
|
|
152
|
-
onEnter: N,
|
|
153
|
-
onSelect: O,
|
|
154
|
-
onError: T
|
|
155
|
-
}), j({ _: 2 }, [
|
|
156
|
-
e.$slots.prefix ? {
|
|
157
|
-
name: "prefix",
|
|
158
|
-
fn: d(() => [
|
|
159
|
-
r(e.$slots, "prefix", {}, void 0, !0)
|
|
160
|
-
]),
|
|
161
|
-
key: "0"
|
|
162
|
-
} : void 0,
|
|
163
|
-
e.$slots.suffix ? {
|
|
164
|
-
name: "suffix",
|
|
165
|
-
fn: d(() => [
|
|
166
|
-
r(e.$slots, "suffix", {}, void 0, !0)
|
|
167
|
-
]),
|
|
168
|
-
key: "1"
|
|
169
|
-
} : void 0,
|
|
170
|
-
e.$slots.item ? {
|
|
171
|
-
name: "item",
|
|
172
|
-
fn: d((n) => [
|
|
173
|
-
r(e.$slots, "item", G(H(n)), void 0, !0)
|
|
174
|
-
]),
|
|
175
|
-
key: "2"
|
|
176
|
-
} : void 0,
|
|
177
|
-
e.$slots.empty ? {
|
|
178
|
-
name: "empty",
|
|
179
|
-
fn: d(() => [
|
|
180
|
-
r(e.$slots, "empty", {}, void 0, !0)
|
|
181
|
-
]),
|
|
182
|
-
key: "3"
|
|
183
|
-
} : void 0,
|
|
184
|
-
e.$slots.loading ? {
|
|
185
|
-
name: "loading",
|
|
186
|
-
fn: d(() => [
|
|
187
|
-
r(e.$slots, "loading", {}, void 0, !0)
|
|
188
|
-
]),
|
|
189
|
-
key: "4"
|
|
190
|
-
} : void 0
|
|
191
|
-
]), 1040, ["model-value", "loading", "disabled", "placeholder", "trim-mode", "button-text", "suggestions", "fetch-suggestions", "fetch-suggestions-method", "debounce", "min-length"]),
|
|
192
|
-
e.showStatus && m.value ? r(e.$slots, "status", {
|
|
193
|
-
key: 0,
|
|
194
|
-
status: e.status,
|
|
195
|
-
statusText: m.value
|
|
196
|
-
}, () => [
|
|
197
|
-
K("div", {
|
|
198
|
-
class: W(["qy-record-quote-search__status", `is-${e.status}`])
|
|
199
|
-
}, p(m.value), 3)
|
|
200
|
-
], !0) : f("", !0)
|
|
201
|
-
]));
|
|
202
|
-
}
|
|
203
|
-
}), ue = /* @__PURE__ */ Y(oe, [["__scopeId", "data-v-8bc26d3a"]]);
|
|
3
|
+
import r from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
+
const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-6f12a6f5"]]);
|
|
204
5
|
export {
|
|
205
|
-
|
|
6
|
+
f as default
|
|
206
7
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),T=require("../qy-search-input/index.vue.cjs"),Q={class:"qy-record-quote-search"},F={key:0,class:"qy-record-quote-search__header"},P={key:0,class:"qy-record-quote-search__label"},L={key:1,class:"qy-record-quote-search__description"},R=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:v,emit:S}){const l=y,n=S,b=t.useAttrs(),a=t.ref(null),d=t.ref(!1),i=t.computed(()=>l.statusText||""),k=t.computed(()=>l.loading||d.value);function s(e){return e==null?"":String(e)}function C(e){const o=s(e).trim(),r=c(o),u=r.match(/BJ\d{8}[A-Z0-9]{4}/i);return u?u[0]:r}function c(e){return s(e).replace(/\s+/g,"").trim().toUpperCase()}function f(e){return l.extractMethod?l.extractMethod(e):C(e)}function m(e){return l.normalizeMethod?l.normalizeMethod(e):c(e)}function h(e,o){const r=s(e),u=f(r),g=l.autoNormalize?m(u):u;return n("normalize",{rawValue:r,code:g}),{rawValue:r,code:g,item:o}}function V(e){n("update:modelValue",e)}async function p(e){if(n("search",e),!!l.searchMethod){d.value=!0;try{const o=await l.searchMethod(e);n("success",o)}catch(o){n("error",o)}finally{d.value=!1}}}function M(e){const o=h(e);o.code!==s(l.modelValue)&&n("update:modelValue",o.code),p(o)}function B(){n("clear")}function $(e){n("enter",e)}function q(e){if(n("select",e),!l.searchOnSelect)return;const o=h(e.value,e);o.code!==s(l.modelValue)&&n("update:modelValue",o.code),p(o)}function z(e){n("error",e)}function E(){var e,o;(o=(e=a.value)==null?void 0:e.focus)==null||o.call(e)}function w(){var e,o;(o=(e=a.value)==null?void 0:e.blur)==null||o.call(e)}function N(){var e,o;(o=(e=a.value)==null?void 0:e.select)==null||o.call(e)}function O(){var e,o;(o=(e=a.value)==null?void 0:e.clear)==null||o.call(e)}return v({focus:E,blur:w,select:N,clear:O,extractQuoteOrderCode:f,normalizeQuoteOrderCode:m}),(e,o)=>(t.openBlock(),t.createElementBlock("div",Q,[t.renderSlot(e.$slots,"label",{},()=>[e.label||e.description?(t.openBlock(),t.createElementBlock("div",F,[e.label?(t.openBlock(),t.createElementBlock("div",P,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(T.default,t.mergeProps({ref_key:"searchRef",ref:a},t.unref(b),{"model-value":e.modelValue,loading:k.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":V,onSearch:M,onClear:B,onEnter:$,onSelect:q,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(r=>[t.renderSlot(e.$slots,"item",t.normalizeProps(t.guardReactiveProps(r)),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)]))}});exports.default=R;
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { defineComponent as U, useAttrs as D, ref as M, computed as $, createElementBlock as i, openBlock as c, renderSlot as a, createVNode as I, createCommentVNode as f, toDisplayString as p, mergeProps as J, unref as Z, createSlots as j, withCtx as d, normalizeProps as G, guardReactiveProps as H, createElementVNode as K, normalizeClass as W } from "vue";
|
|
2
|
+
import X from "../qy-search-input/index.vue.mjs";
|
|
3
|
+
const Y = { class: "qy-record-quote-search" }, x = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "qy-record-quote-search__header"
|
|
6
|
+
}, _ = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "qy-record-quote-search__label"
|
|
9
|
+
}, ee = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "qy-record-quote-search__description"
|
|
12
|
+
}, ne = /* @__PURE__ */ U({
|
|
13
|
+
name: "QyRecordQuoteSearch",
|
|
14
|
+
inheritAttrs: !1,
|
|
15
|
+
__name: "index",
|
|
16
|
+
props: {
|
|
17
|
+
modelValue: { default: "" },
|
|
18
|
+
loading: { type: Boolean, default: !1 },
|
|
19
|
+
disabled: { type: Boolean, default: !1 },
|
|
20
|
+
placeholder: { default: "请输入报价单号" },
|
|
21
|
+
buttonText: { default: "查询报价单" },
|
|
22
|
+
autoNormalize: { type: Boolean, default: !0 },
|
|
23
|
+
showStatus: { type: Boolean, default: !0 },
|
|
24
|
+
status: { default: "default" },
|
|
25
|
+
statusText: { default: "" },
|
|
26
|
+
suggestions: { default: () => [] },
|
|
27
|
+
fetchSuggestions: { type: [Function, null], default: null },
|
|
28
|
+
fetchSuggestionsMethod: { type: [Function, null], default: null },
|
|
29
|
+
debounce: { default: 300 },
|
|
30
|
+
minLength: { default: 1 },
|
|
31
|
+
searchOnSelect: { type: Boolean, default: !0 },
|
|
32
|
+
searchMethod: { type: [Function, null], default: null },
|
|
33
|
+
extractMethod: { type: [Function, null], default: null },
|
|
34
|
+
normalizeMethod: { type: [Function, null], default: null },
|
|
35
|
+
label: { default: "报价单号" },
|
|
36
|
+
description: { default: "" },
|
|
37
|
+
trimMode: { default: "blur" }
|
|
38
|
+
},
|
|
39
|
+
emits: ["update:modelValue", "search", "clear", "normalize", "enter", "select", "error", "success"],
|
|
40
|
+
setup(k, { expose: z, emit: C }) {
|
|
41
|
+
const o = k, n = C, q = D(), r = M(null), h = M(!1), m = $(() => o.statusText || ""), B = $(() => o.loading || h.value);
|
|
42
|
+
function s(e) {
|
|
43
|
+
return e == null ? "" : String(e);
|
|
44
|
+
}
|
|
45
|
+
function E(e) {
|
|
46
|
+
const t = s(e).trim(), l = g(t), u = l.match(/BJ\d{8}[A-Z0-9]{4}/i);
|
|
47
|
+
return u ? u[0] : l;
|
|
48
|
+
}
|
|
49
|
+
function g(e) {
|
|
50
|
+
return s(e).replace(/\s+/g, "").trim().toUpperCase();
|
|
51
|
+
}
|
|
52
|
+
function y(e) {
|
|
53
|
+
return o.extractMethod ? o.extractMethod(e) : E(e);
|
|
54
|
+
}
|
|
55
|
+
function v(e) {
|
|
56
|
+
return o.normalizeMethod ? o.normalizeMethod(e) : g(e);
|
|
57
|
+
}
|
|
58
|
+
function b(e, t) {
|
|
59
|
+
const l = s(e), u = y(l), V = o.autoNormalize ? v(u) : u;
|
|
60
|
+
return n("normalize", { rawValue: l, code: V }), {
|
|
61
|
+
rawValue: l,
|
|
62
|
+
code: V,
|
|
63
|
+
item: t
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function Q(e) {
|
|
67
|
+
n("update:modelValue", e);
|
|
68
|
+
}
|
|
69
|
+
async function S(e) {
|
|
70
|
+
if (n("search", e), !!o.searchMethod) {
|
|
71
|
+
h.value = !0;
|
|
72
|
+
try {
|
|
73
|
+
const t = await o.searchMethod(e);
|
|
74
|
+
n("success", t);
|
|
75
|
+
} catch (t) {
|
|
76
|
+
n("error", t);
|
|
77
|
+
} finally {
|
|
78
|
+
h.value = !1;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function N(e) {
|
|
83
|
+
const t = b(e);
|
|
84
|
+
t.code !== s(o.modelValue) && n("update:modelValue", t.code), S(t);
|
|
85
|
+
}
|
|
86
|
+
function O() {
|
|
87
|
+
n("clear");
|
|
88
|
+
}
|
|
89
|
+
function T(e) {
|
|
90
|
+
n("enter", e);
|
|
91
|
+
}
|
|
92
|
+
function w(e) {
|
|
93
|
+
if (n("select", e), !o.searchOnSelect) return;
|
|
94
|
+
const t = b(e.value, e);
|
|
95
|
+
t.code !== s(o.modelValue) && n("update:modelValue", t.code), S(t);
|
|
96
|
+
}
|
|
97
|
+
function F(e) {
|
|
98
|
+
n("error", e);
|
|
99
|
+
}
|
|
100
|
+
function L() {
|
|
101
|
+
var e, t;
|
|
102
|
+
(t = (e = r.value) == null ? void 0 : e.focus) == null || t.call(e);
|
|
103
|
+
}
|
|
104
|
+
function P() {
|
|
105
|
+
var e, t;
|
|
106
|
+
(t = (e = r.value) == null ? void 0 : e.blur) == null || t.call(e);
|
|
107
|
+
}
|
|
108
|
+
function R() {
|
|
109
|
+
var e, t;
|
|
110
|
+
(t = (e = r.value) == null ? void 0 : e.select) == null || t.call(e);
|
|
111
|
+
}
|
|
112
|
+
function A() {
|
|
113
|
+
var e, t;
|
|
114
|
+
(t = (e = r.value) == null ? void 0 : e.clear) == null || t.call(e);
|
|
115
|
+
}
|
|
116
|
+
return z({
|
|
117
|
+
focus: L,
|
|
118
|
+
blur: P,
|
|
119
|
+
select: R,
|
|
120
|
+
clear: A,
|
|
121
|
+
extractQuoteOrderCode: y,
|
|
122
|
+
normalizeQuoteOrderCode: v
|
|
123
|
+
}), (e, t) => (c(), i("div", Y, [
|
|
124
|
+
a(e.$slots, "label", {}, () => [
|
|
125
|
+
e.label || e.description ? (c(), i("div", x, [
|
|
126
|
+
e.label ? (c(), i("div", _, p(e.label), 1)) : f("", !0),
|
|
127
|
+
e.description ? (c(), i("div", ee, p(e.description), 1)) : f("", !0)
|
|
128
|
+
])) : f("", !0)
|
|
129
|
+
], !0),
|
|
130
|
+
I(X, J({
|
|
131
|
+
ref_key: "searchRef",
|
|
132
|
+
ref: r
|
|
133
|
+
}, Z(q), {
|
|
134
|
+
"model-value": e.modelValue,
|
|
135
|
+
loading: B.value,
|
|
136
|
+
disabled: e.disabled,
|
|
137
|
+
placeholder: e.placeholder,
|
|
138
|
+
"remove-space": !0,
|
|
139
|
+
"trim-mode": e.trimMode,
|
|
140
|
+
"button-text": e.buttonText,
|
|
141
|
+
suggestions: e.suggestions,
|
|
142
|
+
"fetch-suggestions": e.fetchSuggestions,
|
|
143
|
+
"fetch-suggestions-method": e.fetchSuggestionsMethod,
|
|
144
|
+
debounce: e.debounce,
|
|
145
|
+
"min-length": e.minLength,
|
|
146
|
+
"search-on-select": !1,
|
|
147
|
+
"onUpdate:modelValue": Q,
|
|
148
|
+
onSearch: N,
|
|
149
|
+
onClear: O,
|
|
150
|
+
onEnter: T,
|
|
151
|
+
onSelect: w,
|
|
152
|
+
onError: F
|
|
153
|
+
}), j({ _: 2 }, [
|
|
154
|
+
e.$slots.prefix ? {
|
|
155
|
+
name: "prefix",
|
|
156
|
+
fn: d(() => [
|
|
157
|
+
a(e.$slots, "prefix", {}, void 0, !0)
|
|
158
|
+
]),
|
|
159
|
+
key: "0"
|
|
160
|
+
} : void 0,
|
|
161
|
+
e.$slots.suffix ? {
|
|
162
|
+
name: "suffix",
|
|
163
|
+
fn: d(() => [
|
|
164
|
+
a(e.$slots, "suffix", {}, void 0, !0)
|
|
165
|
+
]),
|
|
166
|
+
key: "1"
|
|
167
|
+
} : void 0,
|
|
168
|
+
e.$slots.item ? {
|
|
169
|
+
name: "item",
|
|
170
|
+
fn: d((l) => [
|
|
171
|
+
a(e.$slots, "item", G(H(l)), void 0, !0)
|
|
172
|
+
]),
|
|
173
|
+
key: "2"
|
|
174
|
+
} : void 0,
|
|
175
|
+
e.$slots.empty ? {
|
|
176
|
+
name: "empty",
|
|
177
|
+
fn: d(() => [
|
|
178
|
+
a(e.$slots, "empty", {}, void 0, !0)
|
|
179
|
+
]),
|
|
180
|
+
key: "3"
|
|
181
|
+
} : void 0,
|
|
182
|
+
e.$slots.loading ? {
|
|
183
|
+
name: "loading",
|
|
184
|
+
fn: d(() => [
|
|
185
|
+
a(e.$slots, "loading", {}, void 0, !0)
|
|
186
|
+
]),
|
|
187
|
+
key: "4"
|
|
188
|
+
} : void 0
|
|
189
|
+
]), 1040, ["model-value", "loading", "disabled", "placeholder", "trim-mode", "button-text", "suggestions", "fetch-suggestions", "fetch-suggestions-method", "debounce", "min-length"]),
|
|
190
|
+
e.showStatus && m.value ? a(e.$slots, "status", {
|
|
191
|
+
key: 0,
|
|
192
|
+
status: e.status,
|
|
193
|
+
statusText: m.value
|
|
194
|
+
}, () => [
|
|
195
|
+
K("div", {
|
|
196
|
+
class: W(["qy-record-quote-search__status", `is-${e.status}`])
|
|
197
|
+
}, p(m.value), 3)
|
|
198
|
+
], !0) : f("", !0)
|
|
199
|
+
]));
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
export {
|
|
203
|
+
ne as default
|
|
204
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("vue"),P=require("../qy-select/index.vue.cjs"),U=l.defineComponent({name:"QyRemoteSelect",inheritAttrs:!1,__name:"index",props:{modelValue:{type:[String,Number,Boolean,Array,null],default:void 0},fetchMethod:{},defaultOptions:{default:()=>[]},labelKey:{default:"label"},valueKey:{default:"value"},disabledKey:{default:"disabled"},placeholder:{default:"请选择"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},collapseTagsTooltip:{type:Boolean,default:!1},autoSelectSingle:{type:Boolean,default:!1},size:{default:"default"},teleported:{type:Boolean,default:!0},appendTo:{default:"body"},fitInputWidth:{type:Boolean,default:!0},popperClass:{default:""},debounce:{default:300},minLength:{default:1},remoteOnFocus:{type:Boolean,default:!1},remoteShowSuffix:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},reserveSelectedOption:{type:Boolean,default:!0}},emits:["update:modelValue","change","clear","visible-change","focus","blur","options-change","loading-change","error"],setup(S,{expose:O,emit:B}){const t=S,o=B,V=l.useAttrs(),p=l.ref(null),s=l.ref([]),v=l.ref(new Map),m=l.ref(!1),d=l.ref("");let i=0,u=null;const C=l.computed(()=>t.loading||m.value),h=l.ref(!1),r=l.computed(()=>{const e=new Map,a=n=>{e.set(y(n),n)};return t.defaultOptions.forEach(a),t.reserveSelectedOption&&v.value.forEach(n=>a(n)),s.value.forEach(a),Array.from(e.values())});l.watch(()=>t.defaultOptions,e=>{e.forEach(f)},{immediate:!0}),l.watch(()=>t.modelValue,()=>{r.value.forEach(f)},{immediate:!0});function y(e){return(e==null?void 0:e[t.valueKey])??(e==null?void 0:e.value)??(e==null?void 0:e.label)}function w(e){return Array.isArray(t.modelValue)?t.modelValue.includes(e):t.modelValue===e}function f(e){if(!t.reserveSelectedOption)return;const a=y(e);w(a)&&v.value.set(a,e)}function T(e){return t.disabled?!1:e?e.length>=t.minLength:t.remoteOnFocus}function g(e){m.value!==e&&(m.value=e,o("loading-change",e))}async function c(e){if(d.value=e,!T(e)){i+=1,s.value=[],g(!1),o("options-change",r.value);return}const a=++i;g(!0);try{const n=await t.fetchMethod(e);if(a!==i)return;s.value=Array.isArray(n)?n:[],s.value.forEach(f),o("options-change",r.value)}catch(n){if(a!==i)return;s.value=[],o("error",n),o("options-change",r.value)}finally{a===i&&g(!1)}}function b(){h.value||(h.value=!0,c(""))}function k(e){u&&(clearTimeout(u),u=null),u=setTimeout(()=>{c(e)},t.debounce)}function F(){h.value=!0,c("")}function $(){c(d.value)}function M(e){o("update:modelValue",e)}function A(e){r.value.forEach(f),o("change",e)}function K(){o("clear")}function E(e){e&&t.remoteOnFocus&&!d.value&&b(),o("visible-change",e)}function I(e){t.remoteOnFocus&&!d.value&&b(),o("focus",e)}function R(e){o("blur",e)}function z(){var e,a;(a=(e=p.value)==null?void 0:e.focus)==null||a.call(e)}function L(){var e,a;(a=(e=p.value)==null?void 0:e.blur)==null||a.call(e)}function q(){o("update:modelValue",t.multiple?[]:""),o("clear")}return l.onBeforeUnmount(()=>{u&&clearTimeout(u)}),O({focus:z,blur:L,clear:q,retryFetch:$,fetchDefaultOptions:F}),(e,a)=>(l.openBlock(),l.createBlock(P.default,l.mergeProps({ref_key:"selectRef",ref:p},l.unref(V),{"model-value":e.modelValue,options:r.value,"label-key":e.labelKey,"value-key":e.valueKey,"disabled-key":e.disabledKey,placeholder:e.placeholder,disabled:e.disabled,clearable:e.clearable,filterable:!0,multiple:e.multiple,"collapse-tags":e.collapseTags,"collapse-tags-tooltip":e.collapseTagsTooltip,"auto-select-single":e.autoSelectSingle,size:e.size,teleported:e.teleported,"append-to":e.appendTo,"fit-input-width":e.fitInputWidth,"popper-class":e.popperClass,remote:"","remote-show-suffix":e.remoteShowSuffix,"remote-method":k,loading:C.value,"onUpdate:modelValue":M,onChange:A,onClear:K,onVisibleChange:E,onFocus:I,onBlur:R}),l.createSlots({default:l.withCtx(()=>[e.$slots.default?l.renderSlot(e.$slots,"default",{key:0}):l.createCommentVNode("",!0)]),_:2},[e.$slots.prefix?{name:"prefix",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"prefix")]),key:"0"}:void 0,e.$slots.empty?{name:"empty",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"empty")]),key:"1"}:void 0,e.$slots.loading?{name:"loading",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"loading")]),key:"2"}:void 0,e.$slots.tag?{name:"tag",fn:l.withCtx(n=>[l.renderSlot(e.$slots,"tag",l.normalizeProps(l.guardReactiveProps(n)))]),key:"3"}:void 0]),1040,["model-value","options","label-key","value-key","disabled-key","placeholder","disabled","clearable","multiple","collapse-tags","collapse-tags-tooltip","auto-select-single","size","teleported","append-to","fit-input-width","popper-class","remote-show-suffix","loading"]))}});exports.default=U;
|