jgy-public-component 0.0.23 → 0.0.25

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 (32) hide show
  1. package/dist/components/JDocDetail/DocDetailHost.d.ts +3 -0
  2. package/dist/components/JDocDetail/DocNoLink.d.ts +38 -0
  3. package/dist/components/JDocDetail/index.d.ts +16 -0
  4. package/dist/components/JDocDetail/labels/inbound.d.ts +20 -0
  5. package/dist/components/JDocDetail/labels/putaway.d.ts +1 -0
  6. package/dist/components/JDocDetail/labels/receipt.d.ts +24 -0
  7. package/dist/components/JDocDetail/registry.d.ts +25 -0
  8. package/dist/components/JDocDetail/store.d.ts +31 -0
  9. package/dist/components/JDocDetail/types.d.ts +38 -0
  10. package/dist/components/JDocDetail/utils/copyText.d.ts +1 -0
  11. package/dist/components/JDocDetail/utils/flattenOrderItems.d.ts +7 -0
  12. package/dist/components/JDocDetail/views/DeliveryOrderDetailView.d.ts +22 -0
  13. package/dist/components/JDocDetail/views/InboundOrderDetailView.d.ts +22 -0
  14. package/dist/components/JDocDetail/views/PutawayOrderDetailView.d.ts +22 -0
  15. package/dist/components/JDocDetail/views/QcOrderDetailView.d.ts +22 -0
  16. package/dist/components/JDocDetail/views/ReceiptOrderDetailView.d.ts +22 -0
  17. package/dist/components/JDocDetail/views/TransferOrderDetailView.d.ts +22 -0
  18. package/dist/components/JDocDetail/views/WorkOrderDetailView.d.ts +22 -0
  19. package/dist/components/JDocDetail/wmsViews.d.ts +12 -0
  20. package/dist/components/JProductDetail/JSkuLink.d.ts +9 -0
  21. package/dist/components/JProductDetail/ProductDetailHost.d.ts +3 -0
  22. package/dist/components/JProductDetail/index.d.ts +3 -0
  23. package/dist/components/JProductDetail/store.d.ts +36 -0
  24. package/dist/components/JProductDetail/useProductDetailDialog.d.ts +2 -21
  25. package/dist/components/JUploadImg/JUploadImg.d.ts +1 -1
  26. package/dist/index.d.ts +6 -3
  27. package/dist/index.js +4698 -1311
  28. package/dist/index.js.map +1 -1
  29. package/dist/index.umd.cjs +2 -2
  30. package/dist/index.umd.cjs.map +1 -1
  31. package/dist/style.css +1 -1
  32. package/package.json +3 -1
@@ -0,0 +1,3 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
3
+ export default _default;
@@ -0,0 +1,38 @@
1
+ import { DocDetailType } from './types';
2
+ import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, PropType } from 'vue';
3
+
4
+ declare const _default: DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
5
+ type: DocDetailType;
6
+ orderNo: string;
7
+ /** 是否显示复制按钮,默认 true */
8
+ showCopy?: boolean;
9
+ }>, {
10
+ showCopy: boolean;
11
+ }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
12
+ type: DocDetailType;
13
+ orderNo: string;
14
+ /** 是否显示复制按钮,默认 true */
15
+ showCopy?: boolean;
16
+ }>, {
17
+ showCopy: boolean;
18
+ }>>> & Readonly<{}>, {
19
+ showCopy: boolean;
20
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
21
+ export default _default;
22
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
23
+ type __VLS_TypePropsToRuntimeProps<T> = {
24
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
25
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
26
+ } : {
27
+ type: PropType<T[K]>;
28
+ required: true;
29
+ };
30
+ };
31
+ type __VLS_WithDefaults<P, D> = {
32
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
33
+ default: D[K];
34
+ }> : P[K];
35
+ };
36
+ type __VLS_Prettify<T> = {
37
+ [K in keyof T]: T[K];
38
+ } & {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * JDocDetail — 全局单据详情(传单号打开只读弹窗)
3
+ *
4
+ * 用法概要:
5
+ * 1. createDocDetail({ components, adapters }) // 注册组件 + 注入接口
6
+ * 2. MainLayout 挂载 <DocDetailHost />
7
+ * 3. 列表使用 <DocNoLink type="receipt" :order-no="xxx" />
8
+ *
9
+ * WMS 可直接用 wmsDocDetailComponents 作为 components。
10
+ */
11
+ export type { DocDetailType, DocDetailAdapters, DocDetailRegistryItem, DocDetailComponents, CreateDocDetailOptions, } from './types';
12
+ export { createDocDetail, registerDocDetail, getDocDetailRegistry, getDocDetailAdapters, getDocDetailEntry, isDocDetailInitialized, } from './registry';
13
+ export { useDocDetailStore } from './store';
14
+ export { default as DocNoLink } from './DocNoLink';
15
+ export { default as DocDetailHost } from './DocDetailHost';
16
+ export { wmsDocDetailComponents, ReceiptOrderDetailView, QcOrderDetailView, InboundOrderDetailView, PutawayOrderDetailView, DeliveryOrderDetailView, TransferOrderDetailView, WorkOrderDetailView, } from './wmsViews';
@@ -0,0 +1,20 @@
1
+ export declare const INBOUND_TYPE_MAP: Record<number, string>;
2
+ export declare const getInboundTypeLabel: (type?: number | string | null) => string;
3
+ export declare const INBOUND_STATUS_MAP: Record<number, string>;
4
+ export declare const getInboundStatusLabel: (status?: number | string | null) => string;
5
+ export interface InboundLocationItem {
6
+ inventory_status?: number;
7
+ location_code?: string;
8
+ inbound_qty?: number;
9
+ inventory_status_name?: string;
10
+ location_type?: string;
11
+ location_type_name?: string;
12
+ location_display?: string;
13
+ }
14
+ export declare const formatInboundLocationList: (locationList?: InboundLocationItem[] | null, inventoryStatus?: number) => string;
15
+ export declare const getInboundGoodLocation: (row?: {
16
+ location_list?: InboundLocationItem[];
17
+ } | null) => string;
18
+ export declare const getInboundBadLocation: (row?: {
19
+ location_list?: InboundLocationItem[];
20
+ } | null) => string;
@@ -0,0 +1 @@
1
+ export declare const PUTAWAY_STATUS_COMPLETED = 300;
@@ -0,0 +1,24 @@
1
+ export declare const RECEIPT_TYPE_MAP: Record<number, string>;
2
+ export declare const getReceiptTypeLabel: (type?: number | string | null) => string;
3
+ export declare const RECEIPT_STATUS_MAP: Record<number, string>;
4
+ export declare const ABNORMAL_INITIATE_STATUS_MAP: Record<number, string>;
5
+ export declare const calcAbnormalInitiateStatus: (orderItems: Array<{
6
+ id?: number;
7
+ receive_qty?: number;
8
+ notice_receive_qty?: number;
9
+ }>, occupiedItemIds?: number[]) => {
10
+ sub_status: number;
11
+ sub_status_name: string;
12
+ };
13
+ export declare const getReceiptStatusLabel: (status?: number, baseLabel?: string, subMemo?: string) => string;
14
+ export declare const resolveAbnormalSubMemo: (row: {
15
+ status?: number;
16
+ status_sub_memo?: string;
17
+ abnormal_sub_status_name?: string;
18
+ order_item?: any;
19
+ abnormal_occupied_item_ids?: number[];
20
+ }, flatOrderItems?: Array<{
21
+ id?: number;
22
+ receive_qty?: number;
23
+ notice_receive_qty?: number;
24
+ }>) => string;
@@ -0,0 +1,25 @@
1
+ import { Component } from 'vue';
2
+ import { CreateDocDetailOptions, DocDetailAdapters } from './types';
3
+
4
+ type NormalizedRegistry = Record<string, {
5
+ component: Component;
6
+ orderNoProp: string;
7
+ }>;
8
+ /**
9
+ * 注册全局单据详情:组件映射 + 接口适配器
10
+ * 建议在 main.ts 中 pinia 之后调用一次
11
+ */
12
+ export declare function createDocDetail(options: CreateDocDetailOptions): {
13
+ registry: NormalizedRegistry;
14
+ adapters: DocDetailAdapters;
15
+ };
16
+ /** 合并追加注册(可选,用于微前端/按模块懒注册) */
17
+ export declare function registerDocDetail(options: Partial<CreateDocDetailOptions>): void;
18
+ export declare function getDocDetailRegistry(): NormalizedRegistry;
19
+ export declare function getDocDetailAdapters(): DocDetailAdapters;
20
+ export declare function isDocDetailInitialized(): boolean;
21
+ export declare function getDocDetailEntry(type: string): {
22
+ component: Component;
23
+ orderNoProp: string;
24
+ };
25
+ export {};
@@ -0,0 +1,31 @@
1
+ import { DocDetailType } from './types';
2
+ import { StoreDefinition } from 'pinia';
3
+ import { Ref } from 'vue';
4
+
5
+ /**
6
+ * 全局单据详情状态
7
+ * 业务页:DocNoLink / store.open(type, orderNo)
8
+ * 宿主:DocDetailHost 按 registry 渲染
9
+ */
10
+ export declare const useDocDetailStore: StoreDefinition<"jgyDocDetail", Pick<{
11
+ visible: Ref<boolean, boolean>;
12
+ type: Ref<string, string>;
13
+ orderNo: Ref<string, string>;
14
+ open: (docType: DocDetailType, no: string) => Promise<void>;
15
+ close: () => void;
16
+ reset: () => void;
17
+ }, "type" | "orderNo" | "visible">, Pick<{
18
+ visible: Ref<boolean, boolean>;
19
+ type: Ref<string, string>;
20
+ orderNo: Ref<string, string>;
21
+ open: (docType: DocDetailType, no: string) => Promise<void>;
22
+ close: () => void;
23
+ reset: () => void;
24
+ }, never>, Pick<{
25
+ visible: Ref<boolean, boolean>;
26
+ type: Ref<string, string>;
27
+ orderNo: Ref<string, string>;
28
+ open: (docType: DocDetailType, no: string) => Promise<void>;
29
+ close: () => void;
30
+ reset: () => void;
31
+ }, "close" | "open" | "reset">>;
@@ -0,0 +1,38 @@
1
+ import { Component } from 'vue';
2
+
3
+ /** 单据类型:业务可扩展任意 string */
4
+ export type DocDetailType = string;
5
+ /**
6
+ * 详情数据适配器:由各业务项目注入真实接口
7
+ * 约定返回项目原有接口结构(通常为 { code, data, msg }),由对应 DetailView 解析
8
+ */
9
+ export type DocDetailAdapters = {
10
+ getReceiptDetail?: (orderNo: string) => Promise<any>;
11
+ getQcDetail?: (orderNo: string) => Promise<any>;
12
+ /** 质检标准等附属数据(可选) */
13
+ getSkuDetail?: (skuCode: string) => Promise<any>;
14
+ getInboundDetail?: (orderNo: string) => Promise<any>;
15
+ getPutawayDetail?: (orderNo: string) => Promise<any>;
16
+ getDeliveryDetail?: (orderNo: string) => Promise<any>;
17
+ getTransferDetail?: (orderNo: string) => Promise<any>;
18
+ getProcessingDetail?: (orderNo: string) => Promise<any>;
19
+ /** 业务方可自行扩展 key */
20
+ [key: string]: ((...args: any[]) => Promise<any>) | undefined;
21
+ };
22
+ /** 单个 type 的注册项 */
23
+ export type DocDetailRegistryItem = {
24
+ /** 纯展示详情组件 */
25
+ component: Component;
26
+ /**
27
+ * 详情组件接收单号的 prop 名
28
+ * 默认 orderNo;WMS 沿用 receiptOrderNo / qcOrderNo 等
29
+ */
30
+ orderNoProp?: string;
31
+ };
32
+ export type DocDetailComponents = Record<string, Component | DocDetailRegistryItem>;
33
+ export type CreateDocDetailOptions = {
34
+ /** type → 详情组件 */
35
+ components: DocDetailComponents;
36
+ /** 接口适配器(各项目自行注入) */
37
+ adapters?: DocDetailAdapters;
38
+ };
@@ -0,0 +1 @@
1
+ export declare function copyText(text?: string | number | null): Promise<void>;
@@ -0,0 +1,7 @@
1
+ export interface FlatOrderItem extends Record<string, any> {
2
+ _skuGroupSize?: number;
3
+ _skuGroupIndex?: number;
4
+ }
5
+ /** 将 order_item 按 SKU 分组对象或数组展平为子行 */
6
+ export declare function flattenOrderItems(orderItem: any, withSkuGroupMeta?: boolean): FlatOrderItem[];
7
+ export declare function sumOrderItemField(orderItem: any, field: string): number;
@@ -0,0 +1,22 @@
1
+ import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, PropType } from 'vue';
2
+ declare const _default: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
3
+ modelValue: boolean;
4
+ outboundOrderNo: string;
5
+ }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
6
+ "update:modelValue": (val: boolean) => void;
7
+ }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
8
+ modelValue: boolean;
9
+ outboundOrderNo: string;
10
+ }>>> & Readonly<{
11
+ "onUpdate:modelValue"?: ((val: boolean) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
13
+ export default _default;
14
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
15
+ type __VLS_TypePropsToRuntimeProps<T> = {
16
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
17
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
18
+ } : {
19
+ type: PropType<T[K]>;
20
+ required: true;
21
+ };
22
+ };
@@ -0,0 +1,22 @@
1
+ import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, PropType } from 'vue';
2
+ declare const _default: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
3
+ modelValue: boolean;
4
+ inboundOrderNo: string;
5
+ }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
6
+ "update:modelValue": (val: boolean) => void;
7
+ }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
8
+ modelValue: boolean;
9
+ inboundOrderNo: string;
10
+ }>>> & Readonly<{
11
+ "onUpdate:modelValue"?: ((val: boolean) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
13
+ export default _default;
14
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
15
+ type __VLS_TypePropsToRuntimeProps<T> = {
16
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
17
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
18
+ } : {
19
+ type: PropType<T[K]>;
20
+ required: true;
21
+ };
22
+ };
@@ -0,0 +1,22 @@
1
+ import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, PropType } from 'vue';
2
+ declare const _default: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
3
+ modelValue: boolean;
4
+ putawayOrderNo: string;
5
+ }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
6
+ "update:modelValue": (val: boolean) => void;
7
+ }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
8
+ modelValue: boolean;
9
+ putawayOrderNo: string;
10
+ }>>> & Readonly<{
11
+ "onUpdate:modelValue"?: ((val: boolean) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
13
+ export default _default;
14
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
15
+ type __VLS_TypePropsToRuntimeProps<T> = {
16
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
17
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
18
+ } : {
19
+ type: PropType<T[K]>;
20
+ required: true;
21
+ };
22
+ };
@@ -0,0 +1,22 @@
1
+ import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, PropType } from 'vue';
2
+ declare const _default: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
3
+ modelValue: boolean;
4
+ qcOrderNo: string;
5
+ }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
6
+ "update:modelValue": (val: boolean) => void;
7
+ }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
8
+ modelValue: boolean;
9
+ qcOrderNo: string;
10
+ }>>> & Readonly<{
11
+ "onUpdate:modelValue"?: ((val: boolean) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
13
+ export default _default;
14
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
15
+ type __VLS_TypePropsToRuntimeProps<T> = {
16
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
17
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
18
+ } : {
19
+ type: PropType<T[K]>;
20
+ required: true;
21
+ };
22
+ };
@@ -0,0 +1,22 @@
1
+ import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, PropType } from 'vue';
2
+ declare const _default: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
3
+ modelValue: boolean;
4
+ receiptOrderNo: string;
5
+ }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
6
+ "update:modelValue": (val: boolean) => void;
7
+ }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
8
+ modelValue: boolean;
9
+ receiptOrderNo: string;
10
+ }>>> & Readonly<{
11
+ "onUpdate:modelValue"?: ((val: boolean) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
13
+ export default _default;
14
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
15
+ type __VLS_TypePropsToRuntimeProps<T> = {
16
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
17
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
18
+ } : {
19
+ type: PropType<T[K]>;
20
+ required: true;
21
+ };
22
+ };
@@ -0,0 +1,22 @@
1
+ import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, PropType } from 'vue';
2
+ declare const _default: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
3
+ modelValue: boolean;
4
+ transferOrderNo: string;
5
+ }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
6
+ "update:modelValue": (val: boolean) => void;
7
+ }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
8
+ modelValue: boolean;
9
+ transferOrderNo: string;
10
+ }>>> & Readonly<{
11
+ "onUpdate:modelValue"?: ((val: boolean) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
13
+ export default _default;
14
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
15
+ type __VLS_TypePropsToRuntimeProps<T> = {
16
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
17
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
18
+ } : {
19
+ type: PropType<T[K]>;
20
+ required: true;
21
+ };
22
+ };
@@ -0,0 +1,22 @@
1
+ import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, PropType } from 'vue';
2
+ declare const _default: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
3
+ modelValue: boolean;
4
+ processingOrderNo: string;
5
+ }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
6
+ "update:modelValue": (val: boolean) => void;
7
+ }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
8
+ modelValue: boolean;
9
+ processingOrderNo: string;
10
+ }>>> & Readonly<{
11
+ "onUpdate:modelValue"?: ((val: boolean) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
13
+ export default _default;
14
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
15
+ type __VLS_TypePropsToRuntimeProps<T> = {
16
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
17
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
18
+ } : {
19
+ type: PropType<T[K]>;
20
+ required: true;
21
+ };
22
+ };
@@ -0,0 +1,12 @@
1
+ import { DocDetailComponents } from './types';
2
+ import { default as ReceiptOrderDetailView } from './views/ReceiptOrderDetailView';
3
+ import { default as QcOrderDetailView } from './views/QcOrderDetailView';
4
+ import { default as InboundOrderDetailView } from './views/InboundOrderDetailView';
5
+ import { default as PutawayOrderDetailView } from './views/PutawayOrderDetailView';
6
+ import { default as DeliveryOrderDetailView } from './views/DeliveryOrderDetailView';
7
+ import { default as TransferOrderDetailView } from './views/TransferOrderDetailView';
8
+ import { default as WorkOrderDetailView } from './views/WorkOrderDetailView';
9
+
10
+ /** WMS 默认只读详情组件映射(接口由业务项目 adapters 注入) */
11
+ export declare const wmsDocDetailComponents: DocDetailComponents;
12
+ export { ReceiptOrderDetailView, QcOrderDetailView, InboundOrderDetailView, PutawayOrderDetailView, DeliveryOrderDetailView, TransferOrderDetailView, WorkOrderDetailView, };
@@ -1,19 +1,28 @@
1
+ import { ProductDetailType } from './store';
1
2
  import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, PropType } from 'vue';
3
+
2
4
  declare const _default: DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
3
5
  code?: string | null;
4
6
  emptyText?: string;
7
+ /** sku 或 spu,默认 sku */
8
+ type?: ProductDetailType;
5
9
  }>, {
6
10
  emptyText: string;
11
+ type: string;
7
12
  }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
8
13
  open: (code: string) => void;
9
14
  }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
10
15
  code?: string | null;
11
16
  emptyText?: string;
17
+ /** sku 或 spu,默认 sku */
18
+ type?: ProductDetailType;
12
19
  }>, {
13
20
  emptyText: string;
21
+ type: string;
14
22
  }>>> & Readonly<{
15
23
  onOpen?: ((code: string) => any) | undefined;
16
24
  }>, {
25
+ type: ProductDetailType;
17
26
  emptyText: string;
18
27
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
19
28
  export default _default;
@@ -0,0 +1,3 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
3
+ export default _default;
@@ -1,5 +1,8 @@
1
1
  export { default as JProductDetailDialog } from './JProductDetailDialog';
2
2
  export { default as JSkuLink } from './JSkuLink';
3
+ export { default as ProductDetailHost } from './ProductDetailHost';
3
4
  export { useProductDetailDialog } from './useProductDetailDialog';
5
+ export { useProductDetailStore } from './store';
6
+ export type { ProductDetailType } from './store';
4
7
  export { provideProductRequest, resolveProductRequest, useInjectedProductRequest, J_PRODUCT_REQUEST_KEY, } from './request';
5
8
  export type { JProductDetailDialogProps, JSkuLinkProps, JProductRequestFn, JProductRequestConfig, } from './types';
@@ -0,0 +1,36 @@
1
+ import { StoreDefinition } from 'pinia';
2
+ import { Ref } from 'vue';
3
+ export type ProductDetailType = 'sku' | 'spu';
4
+ /**
5
+ * 全局产品详情状态
6
+ * 业务页:JSkuLink / store.open(code)
7
+ * 宿主:ProductDetailHost 渲染 JProductDetailDialog
8
+ */
9
+ export declare const useProductDetailStore: StoreDefinition<"jgyProductDetail", Pick<{
10
+ visible: Ref<boolean, boolean>;
11
+ code: Ref<string, string>;
12
+ type: Ref<ProductDetailType, ProductDetailType>;
13
+ open: (skuCode: string, opts?: {
14
+ type?: ProductDetailType;
15
+ }) => Promise<void>;
16
+ close: () => void;
17
+ reset: () => void;
18
+ }, "type" | "code" | "visible">, Pick<{
19
+ visible: Ref<boolean, boolean>;
20
+ code: Ref<string, string>;
21
+ type: Ref<ProductDetailType, ProductDetailType>;
22
+ open: (skuCode: string, opts?: {
23
+ type?: ProductDetailType;
24
+ }) => Promise<void>;
25
+ close: () => void;
26
+ reset: () => void;
27
+ }, never>, Pick<{
28
+ visible: Ref<boolean, boolean>;
29
+ code: Ref<string, string>;
30
+ type: Ref<ProductDetailType, ProductDetailType>;
31
+ open: (skuCode: string, opts?: {
32
+ type?: ProductDetailType;
33
+ }) => Promise<void>;
34
+ close: () => void;
35
+ reset: () => void;
36
+ }, "close" | "open" | "reset">>;
@@ -1,26 +1,7 @@
1
1
  import { Ref } from 'vue';
2
2
  /**
3
- * 产品详情弹窗状态管理(页面级:多个 JSkuLink 共用一个 Dialog)。
4
- *
5
- * @example
6
- * ```ts
7
- * const {
8
- * productDetailDialogVisible,
9
- * productDetailDialogCode,
10
- * openProductDetailDialog,
11
- * } = useProductDetailDialog()
12
- * ```
13
- *
14
- * ```vue
15
- * <JSkuLink :code="row.sku" @open="openProductDetailDialog" />
16
- * <JProductDetailDialog
17
- * v-model:visible="productDetailDialogVisible"
18
- * :code="productDetailDialogCode"
19
- * type="sku"
20
- * />
21
- * ```
22
- *
23
- * 注意:列表中每行只用 JSkuLink,Dialog 放页面底部只挂一次,不要每行一个 Dialog。
3
+ * @deprecated 推荐 MainLayout 挂载 ProductDetailHost,页面只用 JSkuLink。
4
+ * 保留兼容:内部转调全局 store。
24
5
  */
25
6
  export declare function useProductDetailDialog(): {
26
7
  productDetailDialogVisible: Ref<boolean, boolean>;
@@ -47,8 +47,8 @@ declare const _default: DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VL
47
47
  uploadFn: undefined;
48
48
  }>>> & Readonly<{
49
49
  onSuccess?: ((url: string) => any) | undefined;
50
- "onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
51
50
  onError?: ((error: any) => any) | undefined;
51
+ "onUpdate:modelValue"?: ((value: string | string[]) => any) | undefined;
52
52
  }>, {
53
53
  disabled: boolean;
54
54
  modelValue: string | string[];
package/dist/index.d.ts CHANGED
@@ -6,15 +6,17 @@ import { JSearchHeader } from './components/JSearchHeader';
6
6
  import { JImportExcel } from './components/JImportExcel';
7
7
  import { JSidebar, JSideMenuItem } from './components/JSidebar';
8
8
  import { JAdminLayout } from './components/JAdminLayout';
9
- import { JProductDetailDialog, JSkuLink } from './components/JProductDetail';
9
+ import { JProductDetailDialog, JSkuLink, ProductDetailHost } from './components/JProductDetail';
10
10
  import { JSearchInputDialog } from './components/JSearchInputDialog';
11
+ import { DocNoLink, DocDetailHost } from './components/JDocDetail';
11
12
 
12
13
  declare const _default: {
13
14
  install: (app: App) => void;
14
15
  };
15
16
  export default _default;
16
- export { JButton, JUploadImg, JIconRender, JSearchHeader, JImportExcel, JSidebar, JSideMenuItem, JAdminLayout, JProductDetailDialog, JSkuLink, JSearchInputDialog, };
17
- export { useProductDetailDialog, provideProductRequest, resolveProductRequest, useInjectedProductRequest, J_PRODUCT_REQUEST_KEY, } from './components/JProductDetail';
17
+ export { JButton, JUploadImg, JIconRender, JSearchHeader, JImportExcel, JSidebar, JSideMenuItem, JAdminLayout, JProductDetailDialog, JSkuLink, ProductDetailHost, JSearchInputDialog, DocNoLink, DocDetailHost, };
18
+ export { useProductDetailDialog, useProductDetailStore, provideProductRequest, resolveProductRequest, useInjectedProductRequest, J_PRODUCT_REQUEST_KEY, } from './components/JProductDetail';
19
+ export { createDocDetail, registerDocDetail, getDocDetailAdapters, getDocDetailEntry, getDocDetailRegistry, isDocDetailInitialized, useDocDetailStore, wmsDocDetailComponents, ReceiptOrderDetailView, QcOrderDetailView, InboundOrderDetailView, PutawayOrderDetailView, DeliveryOrderDetailView, TransferOrderDetailView, WorkOrderDetailView, } from './components/JDocDetail';
18
20
  export { toSnakeCase, toCamelCase, pick, omit, deepClone, filterEmpty, flatten, unflatten, toTableColumns } from './utils';
19
21
  export { createRouterGuard, buildRouteTree, transformBackendRoutes, findFirstAllowedRoute, getComponentImport } from './router';
20
22
  export type { BackendRoute, RouteStoreAdapter, PermissionStoreAdapter, UserStoreAdapter, RouterGuardOptions } from './router';
@@ -27,3 +29,4 @@ export type { SidebarMenuItem, JSidebarProps, JSideMenuItemProps } from './compo
27
29
  export type { AdminLayoutMenuItem, JAdminLayoutProps } from './components/JAdminLayout';
28
30
  export type { JProductDetailDialogProps, JSkuLinkProps, JProductRequestFn, JProductRequestConfig, } from './components/JProductDetail';
29
31
  export type { JSearchInputDialogProps, SearchInputOption, SearchInputModel, } from './components/JSearchInputDialog';
32
+ export type { DocDetailType, DocDetailAdapters, DocDetailRegistryItem, DocDetailComponents, CreateDocDetailOptions, } from './components/JDocDetail';