@jctrans-materials/comps-vue3 1.0.41-beta.4 → 1.0.41-beta.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/dist/components/ChineseCompanySearch/ChineseCompanySearch.test.d.ts +1 -0
- package/dist/components/ChineseCompanySearch/index.d.ts +89 -0
- package/dist/components/JcCarrierSearch/index.d.ts +3 -3
- package/dist/components/JcMSearch/index.d.ts +1 -1
- package/dist/components/JcSearch/index.d.ts +1 -1
- package/dist/components/LineCascader/index.d.ts +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.esm.js +44 -34
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -3461,27 +3461,22 @@ const useIsEn = (lang = "") => {
|
|
|
3461
3461
|
};
|
|
3462
3462
|
const _hoisted_1$l = { class: "global-company-input" };
|
|
3463
3463
|
const _hoisted_2$j = { class: "company-option-item" };
|
|
3464
|
-
const
|
|
3464
|
+
const CHINA_COUNTRY_ID = 1;
|
|
3465
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
3465
3466
|
__name: "index",
|
|
3466
3467
|
props: {
|
|
3467
|
-
lang: {
|
|
3468
|
-
companyName: {
|
|
3469
|
-
countryId: {
|
|
3468
|
+
lang: { default: "" },
|
|
3469
|
+
companyName: { default: "" },
|
|
3470
|
+
countryId: {},
|
|
3470
3471
|
useKq: { type: Boolean, default: false },
|
|
3471
|
-
kqCode: {
|
|
3472
|
-
kqInfo: {
|
|
3473
|
-
city: {
|
|
3472
|
+
kqCode: { default: "" },
|
|
3473
|
+
kqInfo: { default: () => ({}) },
|
|
3474
|
+
city: { default: () => ({}) },
|
|
3474
3475
|
disabled: { type: Boolean, default: false },
|
|
3475
3476
|
defaultFirstOption: { type: Boolean, default: false },
|
|
3476
3477
|
allowCreate: { type: Boolean, default: false }
|
|
3477
3478
|
},
|
|
3478
|
-
emits: [
|
|
3479
|
-
"update:companyName",
|
|
3480
|
-
"update:useKq",
|
|
3481
|
-
"update:kqCode",
|
|
3482
|
-
"update:kqInfo",
|
|
3483
|
-
"change"
|
|
3484
|
-
],
|
|
3479
|
+
emits: ["update:companyName", "update:useKq", "update:kqCode", "update:kqInfo", "change"],
|
|
3485
3480
|
setup(__props, { emit: __emit }) {
|
|
3486
3481
|
const props = __props;
|
|
3487
3482
|
const emit = __emit;
|
|
@@ -3493,7 +3488,9 @@ const _sfc_main$p = {
|
|
|
3493
3488
|
get: () => props.companyName,
|
|
3494
3489
|
set: (val) => emit("update:companyName", val)
|
|
3495
3490
|
});
|
|
3491
|
+
const isChina = computed(() => props.countryId === CHINA_COUNTRY_ID);
|
|
3496
3492
|
const isDisabled = ref(false);
|
|
3493
|
+
let abortController = null;
|
|
3497
3494
|
const handleRemoteSearch = (query) => {
|
|
3498
3495
|
if (query) {
|
|
3499
3496
|
loading.value = true;
|
|
@@ -3502,28 +3499,34 @@ const _sfc_main$p = {
|
|
|
3502
3499
|
options.value = [];
|
|
3503
3500
|
}
|
|
3504
3501
|
};
|
|
3505
|
-
const fetchOptionsDebounced = debounce((query) => {
|
|
3506
|
-
var _a;
|
|
3507
|
-
|
|
3502
|
+
const fetchOptionsDebounced = debounce(async (query) => {
|
|
3503
|
+
var _a, _b, _c, _d;
|
|
3504
|
+
if (abortController) {
|
|
3505
|
+
abortController.abort();
|
|
3506
|
+
}
|
|
3507
|
+
abortController = new AbortController();
|
|
3508
3508
|
const data = {
|
|
3509
3509
|
current: 1,
|
|
3510
3510
|
size: 50,
|
|
3511
3511
|
compName: query,
|
|
3512
3512
|
cityName: ((_a = props.city) == null ? void 0 : _a.nameCn) + "市"
|
|
3513
3513
|
};
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
options.value = ((
|
|
3514
|
+
try {
|
|
3515
|
+
const res = await getCompanyOptionApi(data);
|
|
3516
|
+
options.value = ((_d = (_c = (_b = res == null ? void 0 : res.data) == null ? void 0 : _b.data) == null ? void 0 : _c.records) == null ? void 0 : _d.map((i) => ({
|
|
3517
3517
|
value: i.nameCn,
|
|
3518
3518
|
code: i.kqId,
|
|
3519
|
+
kqId: i.kqId,
|
|
3519
3520
|
...i
|
|
3520
3521
|
}))) || [];
|
|
3521
|
-
}
|
|
3522
|
-
|
|
3522
|
+
} catch (err) {
|
|
3523
|
+
if ((err == null ? void 0 : err.name) !== "AbortError" && (err == null ? void 0 : err.name) !== "CanceledError") {
|
|
3524
|
+
console.error("获取公司选项失败:", err);
|
|
3525
|
+
}
|
|
3523
3526
|
options.value = [];
|
|
3524
|
-
}
|
|
3527
|
+
} finally {
|
|
3525
3528
|
loading.value = false;
|
|
3526
|
-
}
|
|
3529
|
+
}
|
|
3527
3530
|
}, 800);
|
|
3528
3531
|
const handleSelectChange = (val) => {
|
|
3529
3532
|
const selectedObj = options.value.find((item) => item.value === val);
|
|
@@ -3543,7 +3546,10 @@ const _sfc_main$p = {
|
|
|
3543
3546
|
emit("update:useKq", false);
|
|
3544
3547
|
emit("update:kqCode", "");
|
|
3545
3548
|
emit("change", val);
|
|
3546
|
-
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch(() => {
|
|
3549
|
+
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => {
|
|
3550
|
+
if (process.env.NODE_ENV === "development") {
|
|
3551
|
+
console.warn("[ChineseCompanySearch] formItem.validate 失败:", err);
|
|
3552
|
+
}
|
|
3547
3553
|
});
|
|
3548
3554
|
};
|
|
3549
3555
|
const resetKq = () => {
|
|
@@ -3552,7 +3558,10 @@ const _sfc_main$p = {
|
|
|
3552
3558
|
emit("update:useKq", false);
|
|
3553
3559
|
emit("update:kqCode", "");
|
|
3554
3560
|
emit("update:kqInfo", {});
|
|
3555
|
-
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch(() => {
|
|
3561
|
+
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => {
|
|
3562
|
+
if (process.env.NODE_ENV === "development") {
|
|
3563
|
+
console.warn("[ChineseCompanySearch] formItem.validate 失败:", err);
|
|
3564
|
+
}
|
|
3556
3565
|
});
|
|
3557
3566
|
options.value = [];
|
|
3558
3567
|
};
|
|
@@ -3564,10 +3573,13 @@ const _sfc_main$p = {
|
|
|
3564
3573
|
);
|
|
3565
3574
|
onBeforeUnmount(() => {
|
|
3566
3575
|
fetchOptionsDebounced.cancel();
|
|
3576
|
+
if (abortController) {
|
|
3577
|
+
abortController.abort();
|
|
3578
|
+
}
|
|
3567
3579
|
});
|
|
3568
3580
|
return (_ctx, _cache) => {
|
|
3569
3581
|
return openBlock(), createElementBlock("div", _hoisted_1$l, [
|
|
3570
|
-
|
|
3582
|
+
isChina.value ? (openBlock(), createBlock(unref(ElSelect), {
|
|
3571
3583
|
key: 0,
|
|
3572
3584
|
modelValue: companyNameValue.value,
|
|
3573
3585
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => companyNameValue.value = $event),
|
|
@@ -3575,13 +3587,12 @@ const _sfc_main$p = {
|
|
|
3575
3587
|
remote: "",
|
|
3576
3588
|
"reserve-keyword": "",
|
|
3577
3589
|
clearable: "",
|
|
3578
|
-
"allow-create":
|
|
3579
|
-
"default-first-option":
|
|
3590
|
+
"allow-create": props.allowCreate,
|
|
3591
|
+
"default-first-option": props.defaultFirstOption,
|
|
3580
3592
|
"remote-method": handleRemoteSearch,
|
|
3581
3593
|
loading: loading.value,
|
|
3582
3594
|
disabled: isDisabled.value || props.disabled,
|
|
3583
3595
|
placeholder: unref(isEn) ? "Company Name in Chinese" : "请输入您的公司中文名称",
|
|
3584
|
-
style: { "width": "100%" },
|
|
3585
3596
|
"popper-class": `company-search dialog-join-us`,
|
|
3586
3597
|
onChange: handleSelectChange
|
|
3587
3598
|
}, {
|
|
@@ -3591,7 +3602,7 @@ const _sfc_main$p = {
|
|
|
3591
3602
|
default: withCtx(() => [
|
|
3592
3603
|
(openBlock(true), createElementBlock(Fragment, null, renderList(options.value, (item) => {
|
|
3593
3604
|
return openBlock(), createBlock(unref(ElOption), {
|
|
3594
|
-
key: item.
|
|
3605
|
+
key: item.kqId,
|
|
3595
3606
|
label: item.value,
|
|
3596
3607
|
value: item.value
|
|
3597
3608
|
}, {
|
|
@@ -3612,7 +3623,6 @@ const _sfc_main$p = {
|
|
|
3612
3623
|
disabled: isDisabled.value || props.disabled,
|
|
3613
3624
|
placeholder: unref(isEn) ? "Company name in English" : "请输入您的公司英文名称",
|
|
3614
3625
|
"max-length": "200",
|
|
3615
|
-
style: { "width": "100%" },
|
|
3616
3626
|
onChange: handleChange
|
|
3617
3627
|
}, {
|
|
3618
3628
|
prepend: withCtx(() => [
|
|
@@ -3623,8 +3633,8 @@ const _sfc_main$p = {
|
|
|
3623
3633
|
]);
|
|
3624
3634
|
};
|
|
3625
3635
|
}
|
|
3626
|
-
};
|
|
3627
|
-
const ChineseCompanySearch$1 = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-
|
|
3636
|
+
});
|
|
3637
|
+
const ChineseCompanySearch$1 = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-1c4f606a"]]);
|
|
3628
3638
|
const __vite_glob_0_1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3629
3639
|
__proto__: null,
|
|
3630
3640
|
default: ChineseCompanySearch$1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jctrans-materials/comps-vue3",
|
|
3
|
-
"version": "1.0.41-beta.
|
|
3
|
+
"version": "1.0.41-beta.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"type": "module",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"nanoid": "^5.1.6",
|
|
39
39
|
"qrcode": "^1.5.4",
|
|
40
40
|
"tailwindcss": "4.1.18",
|
|
41
|
-
"@jctrans-materials/shared": "1.0.41-beta.
|
|
41
|
+
"@jctrans-materials/shared": "1.0.41-beta.6"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@tailwindcss/postcss": "4.1.18",
|