jgy-public-component 0.0.33 → 0.0.35

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 CHANGED
@@ -41,9 +41,23 @@ import 'jgy-public-component/dist/style.css'
41
41
  | 组件名 | 说明 |
42
42
  |--------|------|
43
43
  | JButton | 按钮 |
44
+ | JIconRender | 图标渲染 |
45
+ | JUploadImg | 图片上传 |
44
46
  | JSearchHeader | 筛选操作条(折叠筛选 + 新增/删除/搜索) |
45
47
  | JListSearchHeader | 列表页搜索头(Tabs + 筛选 + 操作 + 导出/列设置) |
48
+ | JSearchInputDialog | 关键词搜索(类型下拉 + 输入 + 批量弹窗) |
49
+ | JRemoteSelect | 远程搜索下拉(分页滚动 + 联动前置校验 + 编辑回显) |
50
+ | JProductSelectDialog | 产品选择弹窗(跨页多选 + 已选 Popover) |
46
51
  | JImportExcel | Excel 导入 |
52
+ | JSidebar / JSideMenuItem | 侧边栏菜单 |
53
+ | JAdminLayout | 后台布局 |
54
+ | JProductDetailDialog / JSkuLink | 产品详情 / SKU 链接(需注入 request) |
55
+ | DocNoLink / DocDetailHost | 单号链接 + 全局单据详情(需 createDocDetail 注册) |
56
+ | JRelatedDocs | 关联单据子 Tab 容器(需 createRelatedDocs 注入接口) |
57
+
58
+ 工具方法:数据转换、按钮权限、状态条数 / Tabs、`exportStyledExcel` 前端导出 Excel、路由守卫。
59
+
60
+ > 完整 Props / 事件 / 插槽、业务组件接入步骤与排错,见 [`docs/index.html`](docs/index.html)(可离线打开)。
47
61
 
48
62
  ### JListSearchHeader 快速示例
49
63
 
@@ -89,12 +103,6 @@ import { ref } from 'vue'
89
103
  import { JListSearchHeader } from 'jgy-public-component'
90
104
  </script>
91
105
  ```
92
- | JSearchInputDialog | 关键词搜索(类型下拉 + 输入 + 批量弹窗) |
93
- | JUploadImg | 图片上传 |
94
- | JSidebar / JSideMenuItem | 侧边栏菜单 |
95
- | JAdminLayout | 后台布局 |
96
- | JProductDetailDialog / JSkuLink | 产品详情 / SKU 链接(需注入 request) |
97
- | JIconRender | 图标渲染 |
98
106
 
99
107
  ### JSkuLink + JProductDetailDialog(点击 SKU 弹产品详情)
100
108
 
@@ -242,6 +250,192 @@ const handleSearch = () => {
242
250
  </script>
243
251
  ```
244
252
 
253
+ ### JRemoteSelect 快速示例
254
+
255
+ 接口由 `fetchApi` 注入,组件负责分页滚动加载与联动前置校验。
256
+
257
+ ```vue
258
+ <template>
259
+ <!-- 无联动的独立下拉:必须加 allow-empty,否则因 params 为空而一直禁用 -->
260
+ <JRemoteSelect
261
+ v-model="form.warehouseId"
262
+ :fetch-api="getWarehouseList"
263
+ label-field="warehouse_name"
264
+ value-field="id"
265
+ immediate
266
+ allow-empty
267
+ />
268
+
269
+ <!-- 联动:库区依赖仓库,仓库没选时禁用并提示 -->
270
+ <JRemoteSelect
271
+ v-model="form.areaId"
272
+ :fetch-api="getAreaList"
273
+ :params="{ warehouse_id: form.warehouseId }"
274
+ :required-params="['warehouse_id']"
275
+ label-field="area_name"
276
+ depends-placeholder="请先选择仓库"
277
+ auto-clear-on-params-change
278
+ />
279
+ </template>
280
+
281
+ <script setup lang="ts">
282
+ import { reactive } from 'vue'
283
+ import { JRemoteSelect } from 'jgy-public-component'
284
+ import request from '@/api'
285
+
286
+ const form = reactive({ warehouseId: null, areaId: null })
287
+
288
+ // 组件自动传入 pageIndex / pageSize,远程搜索时再带上 keyword
289
+ const getWarehouseList = (params: Record<string, unknown>) =>
290
+ request({ url: '/wms-app/warehouse/list', method: 'post', data: params })
291
+
292
+ const getAreaList = (params: Record<string, unknown>) =>
293
+ request({ url: '/wms-app/area/list', method: 'post', data: params })
294
+ </script>
295
+ ```
296
+
297
+ 编辑页只拿到 id、没有完整选项时,用 `initial-label` 回显名称:
298
+
299
+ ```vue
300
+ <JRemoteSelect
301
+ v-model="form.supplierId"
302
+ :fetch-api="getSupplierList"
303
+ :initial-label="detail.supplier_name"
304
+ allow-empty
305
+ />
306
+ ```
307
+
308
+ ### JProductSelectDialog 快速示例
309
+
310
+ 弹窗只负责分页请求、跨页多选与已选管理;筛选表单和表格列由插槽提供。
311
+
312
+ ```vue
313
+ <template>
314
+ <JProductSelectDialog
315
+ v-model="dialogVisible"
316
+ :fetch-api="getProductList"
317
+ :extra-params="filters"
318
+ row-key="sku_code"
319
+ @confirm="onConfirm"
320
+ >
321
+ <template #filters="{ search, reset, loading }">
322
+ <el-form inline>
323
+ <el-form-item label="SKU">
324
+ <el-input v-model="filters.sku_code" clearable @keyup.enter="search" />
325
+ </el-form-item>
326
+ <el-form-item>
327
+ <el-button type="primary" :loading="loading" @click="search">查询</el-button>
328
+ <el-button @click="filters.sku_code = ''; reset()">重置</el-button>
329
+ </el-form-item>
330
+ </el-form>
331
+ </template>
332
+
333
+ <template #columns>
334
+ <el-table-column prop="sku_code" label="SKU" width="160" />
335
+ <el-table-column prop="product_name" label="品名" show-overflow-tooltip />
336
+ </template>
337
+ </JProductSelectDialog>
338
+ </template>
339
+
340
+ <script setup lang="ts">
341
+ import { reactive, ref } from 'vue'
342
+ import { JProductSelectDialog } from 'jgy-public-component'
343
+ import request from '@/api'
344
+
345
+ const dialogVisible = ref(false)
346
+ const filters = reactive({ sku_code: '' })
347
+
348
+ const getProductList = (params: Record<string, any>) =>
349
+ request({ url: '/bis-app/comm/sku/doList', method: 'post', data: params })
350
+
351
+ // rows 为跨页累计的全部已选行
352
+ const onConfirm = (rows: Record<string, any>[]) => {
353
+ console.log(rows)
354
+ }
355
+ </script>
356
+ ```
357
+
358
+ > 用 `v-model` 控制显隐(不是 `v-model:visible`)。弹窗关闭后已选、分页会全部清空,需要保留请在父级自行缓存。
359
+
360
+ ### 状态条数 Tabs 快速示例
361
+
362
+ 统一处理「各状态返回条数」接口,并解决「全部」Tab 与 `status` 参数的换算。
363
+
364
+ ```vue
365
+ <template>
366
+ <JListSearchHeader v-model="activeTab" @search="onSearch" @tab-change="onSearch">
367
+ <template #tabs>
368
+ <el-tab-pane
369
+ v-for="tab in tabs"
370
+ :key="tab.tab_name"
371
+ :name="tab.tab_name"
372
+ :label="`${tab.name}(${tab.count})`"
373
+ />
374
+ </template>
375
+ </JListSearchHeader>
376
+ </template>
377
+
378
+ <script setup lang="ts">
379
+ import { ref, onMounted } from 'vue'
380
+ import {
381
+ unwrapStatusCountList,
382
+ mapStatusCountToTabs,
383
+ buildFallbackStatusTabs,
384
+ resolveListStatusParam,
385
+ syncActiveTabIfAll,
386
+ } from 'jgy-public-component'
387
+
388
+ const activeTab = ref('all')
389
+ // 接口失败时仍有 Tab 可点
390
+ const tabs = ref(buildFallbackStatusTabs([
391
+ { value: -1, label: '草稿' },
392
+ { value: 100, label: '待审核' },
393
+ ]))
394
+
395
+ const loadTabs = async () => {
396
+ const list = unwrapStatusCountList(await getStatusCounts())
397
+ if (list.length) {
398
+ tabs.value = mapStatusCountToTabs(list)
399
+ syncActiveTabIfAll(activeTab, tabs.value, { asString: true })
400
+ }
401
+ }
402
+
403
+ const onSearch = () => {
404
+ // 「全部」返回 undefined,即不传 status
405
+ loadList({ status: resolveListStatusParam(activeTab.value) })
406
+ }
407
+
408
+ onMounted(() => { loadTabs(); onSearch() })
409
+ </script>
410
+ ```
411
+
412
+ > 注意 `0` 和 `'0'` 会被判为「全部」。若业务里 `status=0` 是真实状态,请避开 0 取值。
413
+
414
+ ### 导出 Excel
415
+
416
+ `exportStyledExcel` 为纯前端导出,`exceljs` 是 peerDependency,需宿主项目安装。
417
+
418
+ ```ts
419
+ import { exportStyledExcel } from 'jgy-public-component'
420
+
421
+ // 对象的 key 即表头,顺序即列顺序(以第一行为准)
422
+ const rows = list.value.map((item) => ({
423
+ 'SKU': item.sku_code,
424
+ '品名': item.product_name,
425
+ '数量': item.qty,
426
+ }))
427
+
428
+ await exportStyledExcel(rows, '产品列表.xlsx', '产品列表')
429
+
430
+ // 可选:自定义表头色(ARGB,带 FF 前缀)与列宽
431
+ await exportStyledExcel(rows, 'data.xlsx', 'Sheet1', {
432
+ headerFill: 'FF67C23A',
433
+ columnWidths: [18, 30, 10],
434
+ })
435
+ ```
436
+
437
+ > 空数组会抛「没有可导出的数据」,调用处需 try/catch。
438
+
245
439
  ## 本地开发
246
440
 
247
441
  ```bash
@@ -1,6 +1,5 @@
1
- import { BtnPermissionChecker, BtnPermissionInput } from '../../utils/btnPermission';
2
1
  import { DefineComponent, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
-
2
+ import { BtnPermissionInput, BtnPermissionChecker } from '../..';
4
3
  declare function __VLS_template(): {
5
4
  tabs?(_: {}): any;
6
5
  filter?(_: {}): any;
@@ -34,10 +33,6 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
34
33
  type: PropType<boolean>;
35
34
  default: boolean;
36
35
  };
37
- defaultVisible: {
38
- type: PropType<number>;
39
- default: number;
40
- };
41
36
  collapsible: {
42
37
  type: PropType<boolean>;
43
38
  default: boolean;
@@ -64,6 +59,10 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
64
59
  permissionChecker: {
65
60
  type: PropType<BtnPermissionChecker>;
66
61
  };
62
+ defaultVisibleRows: {
63
+ type: PropType<number>;
64
+ default: number;
65
+ };
67
66
  }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
68
67
  search: () => void;
69
68
  reset: () => void;
@@ -98,10 +97,6 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
98
97
  type: PropType<boolean>;
99
98
  default: boolean;
100
99
  };
101
- defaultVisible: {
102
- type: PropType<number>;
103
- default: number;
104
- };
105
100
  collapsible: {
106
101
  type: PropType<boolean>;
107
102
  default: boolean;
@@ -128,6 +123,10 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
128
123
  permissionChecker: {
129
124
  type: PropType<BtnPermissionChecker>;
130
125
  };
126
+ defaultVisibleRows: {
127
+ type: PropType<number>;
128
+ default: number;
129
+ };
131
130
  }>> & Readonly<{
132
131
  onSearch?: (() => any) | undefined;
133
132
  onReset?: (() => any) | undefined;
@@ -143,9 +142,9 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
143
142
  showTabs: boolean;
144
143
  showSearch: boolean;
145
144
  showReset: boolean;
146
- defaultVisible: number;
147
145
  collapsible: boolean;
148
146
  moreFilterActiveCount: number;
147
+ defaultVisibleRows: number;
149
148
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
150
149
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
151
150
  export default _default;
@@ -0,0 +1,34 @@
1
+ import { BtnPermissionChecker, BtnPermissionInput } from '../../utils/btnPermission';
2
+
3
+ export interface JListSearchHeaderProps {
4
+ /** 是否展示「更多筛选」 */
5
+ showMoreFilter?: boolean;
6
+ /** 是否展示导出图标 */
7
+ showDownload?: boolean;
8
+ /** 是否展示列设置图标 */
9
+ showSettings?: boolean;
10
+ /** 是否展示顶部状态 Tabs(无 #tabs 插槽时自动隐藏) */
11
+ showTabs?: boolean;
12
+ /** 是否展示查询按钮 */
13
+ showSearch?: boolean;
14
+ /** 是否展示重置按钮 */
15
+ showReset?: boolean;
16
+ /** 默认可见筛选项个数(按 #filter 内 el-form-item 计),超出显示展开/收起 */
17
+ defaultVisible?: number;
18
+ /** 是否启用 #filter 折叠 */
19
+ collapsible?: boolean;
20
+ /** 更多筛选已生效条件数量,>0 时按钮显示「更多筛选 (N)」 */
21
+ moreFilterActiveCount?: number;
22
+ /** 更多筛选按钮权限码 */
23
+ moreFilterPermission?: BtnPermissionInput;
24
+ /** 查询按钮权限码(含更多筛选弹层内查询) */
25
+ searchPermission?: BtnPermissionInput;
26
+ /** 重置按钮权限码 */
27
+ resetPermission?: BtnPermissionInput;
28
+ /** 导出图标权限码 */
29
+ downloadPermission?: BtnPermissionInput;
30
+ /** 列设置权限码(含列设置抽屉内恢复默认/保存) */
31
+ settingsPermission?: BtnPermissionInput;
32
+ /** 单页覆盖全局按钮权限检查函数 */
33
+ permissionChecker?: BtnPermissionChecker;
34
+ }
@@ -13,8 +13,8 @@ export interface JListSearchHeaderProps {
13
13
  showSearch?: boolean;
14
14
  /** 是否展示重置按钮 */
15
15
  showReset?: boolean;
16
- /** 默认可见筛选项个数(按 #filter 内 el-form-item 计),超出显示展开/收起 */
17
- defaultVisible?: number;
16
+ /** 默认可见筛选项行数(按 #filter 内 el-form-item 布局换行计),超出显示展开/收起 */
17
+ defaultVisibleRows?: number;
18
18
  /** 是否启用 #filter 折叠 */
19
19
  collapsible?: boolean;
20
20
  /** 更多筛选已生效条件数量,>0 时按钮显示「更多筛选 (N)」 */
@@ -0,0 +1,146 @@
1
+ import { JProductSelectFetchApi, JProductSelectListResult } from './types';
2
+ import { DefineComponent, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+
4
+ type Row = Record<string, any>;
5
+ declare function __VLS_template(): {
6
+ filters?(_: {
7
+ search: () => void;
8
+ reset: () => Promise<void>;
9
+ loading: boolean;
10
+ }): any;
11
+ columns?(_: {}): any;
12
+ "selected-columns"?(_: {
13
+ remove: (row: Row) => void;
14
+ }): any;
15
+ };
16
+ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
17
+ modelValue: PropType<boolean>;
18
+ title: {
19
+ type: PropType<string>;
20
+ default: string;
21
+ };
22
+ width: {
23
+ type: PropType<string>;
24
+ default: string;
25
+ };
26
+ teleported: {
27
+ type: PropType<boolean>;
28
+ default: boolean;
29
+ };
30
+ zIndex: {
31
+ type: PropType<number>;
32
+ };
33
+ rowKey: {
34
+ type: PropType<string>;
35
+ default: string;
36
+ };
37
+ pageSizes: {
38
+ type: PropType<number[]>;
39
+ default: () => number[];
40
+ };
41
+ fetchApi: {
42
+ type: PropType<JProductSelectFetchApi>;
43
+ required: true;
44
+ };
45
+ extraParams: {
46
+ type: PropType<Record<string, any>>;
47
+ };
48
+ tableHeight: {
49
+ type: PropType<string | number>;
50
+ default: number;
51
+ };
52
+ popoverWidth: {
53
+ type: PropType<number>;
54
+ default: number;
55
+ };
56
+ responseAdapter: {
57
+ type: PropType<(res: any) => JProductSelectListResult>;
58
+ };
59
+ loadErrorMessage: {
60
+ type: PropType<string>;
61
+ default: string;
62
+ };
63
+ fetchOnOpen: {
64
+ type: PropType<boolean>;
65
+ default: boolean;
66
+ };
67
+ }>, {
68
+ reload: () => Promise<void>;
69
+ clearSelected: () => void;
70
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
71
+ open: () => void;
72
+ closed: () => void;
73
+ confirm: (rows: Row[]) => void;
74
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
75
+ modelValue: PropType<boolean>;
76
+ title: {
77
+ type: PropType<string>;
78
+ default: string;
79
+ };
80
+ width: {
81
+ type: PropType<string>;
82
+ default: string;
83
+ };
84
+ teleported: {
85
+ type: PropType<boolean>;
86
+ default: boolean;
87
+ };
88
+ zIndex: {
89
+ type: PropType<number>;
90
+ };
91
+ rowKey: {
92
+ type: PropType<string>;
93
+ default: string;
94
+ };
95
+ pageSizes: {
96
+ type: PropType<number[]>;
97
+ default: () => number[];
98
+ };
99
+ fetchApi: {
100
+ type: PropType<JProductSelectFetchApi>;
101
+ required: true;
102
+ };
103
+ extraParams: {
104
+ type: PropType<Record<string, any>>;
105
+ };
106
+ tableHeight: {
107
+ type: PropType<string | number>;
108
+ default: number;
109
+ };
110
+ popoverWidth: {
111
+ type: PropType<number>;
112
+ default: number;
113
+ };
114
+ responseAdapter: {
115
+ type: PropType<(res: any) => JProductSelectListResult>;
116
+ };
117
+ loadErrorMessage: {
118
+ type: PropType<string>;
119
+ default: string;
120
+ };
121
+ fetchOnOpen: {
122
+ type: PropType<boolean>;
123
+ default: boolean;
124
+ };
125
+ }>> & Readonly<{
126
+ onOpen?: (() => any) | undefined;
127
+ onClosed?: (() => any) | undefined;
128
+ onConfirm?: ((rows: Row[]) => any) | undefined;
129
+ }>, {
130
+ title: string;
131
+ width: string;
132
+ teleported: boolean;
133
+ rowKey: string;
134
+ pageSizes: number[];
135
+ tableHeight: string | number;
136
+ popoverWidth: number;
137
+ loadErrorMessage: string;
138
+ fetchOnOpen: boolean;
139
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
140
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
141
+ export default _default;
142
+ type __VLS_WithTemplateSlots<T, S> = T & {
143
+ new (): {
144
+ $slots: S;
145
+ };
146
+ };
@@ -0,0 +1,2 @@
1
+ export { default as JProductSelectDialog } from './JProductSelectDialog';
2
+ export type { JProductSelectDialogProps, JProductSelectFetchApi, JProductSelectListResult, } from './types';
@@ -0,0 +1,20 @@
1
+ export type JProductSelectFetchApi = (params: Record<string, any>) => Promise<any>;
2
+ export type JProductSelectListResult = {
3
+ list: Array<Record<string, any>>;
4
+ total: number;
5
+ };
6
+ export interface JProductSelectDialogProps {
7
+ fetchApi: JProductSelectFetchApi;
8
+ extraParams?: Record<string, any>;
9
+ title?: string;
10
+ width?: string;
11
+ rowKey?: string;
12
+ tableHeight?: string | number;
13
+ pageSizes?: number[];
14
+ popoverWidth?: number;
15
+ zIndex?: number;
16
+ responseAdapter?: (res: any) => JProductSelectListResult;
17
+ loadErrorMessage?: string;
18
+ fetchOnOpen?: boolean;
19
+ teleported?: boolean;
20
+ }
@@ -1,34 +1,63 @@
1
- /** 远程下拉 fetchApi 返回结构(组件内会自动适配多种格式) */
1
+ /**
2
+ * 远程下拉请求函数。
3
+ * 组件会自动传入 pageIndex、pageSize,远程搜索时还会传 searchField 对应的关键词;
4
+ * 返回结构支持 data.list / list / data[] 等多种格式,见 JRemoteSelect.parseListResponse。
5
+ */
2
6
  export type RemoteSelectFetchApi = (params: Record<string, unknown>) => Promise<unknown>;
7
+ /** v-model 绑定值:单选 string | number | null,多选为数组 */
3
8
  export type RemoteSelectModelValue = string | number | null | (string | number)[];
4
9
  export interface JRemoteSelectProps {
5
- /** API 请求函数 */
10
+ /** 远程数据请求函数(必填) */
6
11
  fetchApi: RemoteSelectFetchApi;
7
- /** 选项 label 字段名 */
12
+ /** 选项展示字段,对应 el-option 的 label,默认 `name` */
8
13
  labelField?: string;
9
- /** 选项 value 字段名 */
14
+ /** 选项值字段,对应 el-option 的 value,默认 `id` */
10
15
  valueField?: string;
11
- /** 远程搜索时传给接口的参数名 */
16
+ /** 远程搜索关键词传给接口的参数名,默认 `keyword` */
12
17
  searchField?: string;
13
- /** 额外请求参数(支持联动) */
18
+ /** 额外请求参数,会合并进每次 fetchApi 调用(常用于联动,如 warehouseId) */
14
19
  params?: Record<string, unknown>;
20
+ /** 是否可搜索,默认 true */
15
21
  searchable?: boolean;
16
- /** true=本地过滤已加载选项;false=远程搜索 */
22
+ /** true=仅过滤已加载选项;false=输入关键词触发远程搜索,默认 false */
17
23
  localFilter?: boolean;
24
+ /** 是否分页加载,下拉滚动到底自动 loadMore,默认 true */
18
25
  paginated?: boolean;
26
+ /** 每页条数;localFilter 模式下会至少拉 2000 条做本地过滤,默认 20 */
19
27
  pageSize?: number;
28
+ /** 是否多选,默认 false */
20
29
  multiple?: boolean;
30
+ /** 是否可清空,默认 true */
21
31
  clearable?: boolean;
32
+ /** 是否禁用,默认 false */
22
33
  disabled?: boolean;
34
+ /** 正常占位文案,默认「请选择」 */
23
35
  placeholder?: string;
36
+ /** 前置条件未满足时的占位文案(如无 params),默认「请先选择前置条件」 */
24
37
  dependsPlaceholder?: string;
38
+ /** 挂载后是否立即请求首屏数据(需 hasRequiredParams 为 true),默认 false */
25
39
  immediate?: boolean;
40
+ /** params 变化时是否自动清空已选值,默认 false */
26
41
  autoClearOnParamsChange?: boolean;
42
+ /**
43
+ * 是否允许在无 params / 无 requiredParams 时也发起请求。
44
+ * false 时缺少联动参数会禁用下拉并显示 dependsPlaceholder,默认 false
45
+ */
27
46
  allowEmpty?: boolean;
47
+ /**
48
+ * params 中必须存在的字段名列表;这些字段都有值才允许请求。
49
+ * 为空时:allowEmpty=true 则直接可请求,否则要求 params 至少有一个 key
50
+ */
28
51
  requiredParams?: string[];
29
- /** 选项未加载时的回显 label */
52
+ /**
53
+ * 编辑回显用:选项尚未加载时,用此文案替代 value 显示在输入框。
54
+ * 常见于详情页只有 id、没有完整 option 对象
55
+ */
30
56
  initialLabel?: string;
57
+ /** 多选时折叠 tag 显示,默认 false */
31
58
  collapseTags?: boolean;
59
+ /** 折叠 tag 是否 hover 展示全部,默认 false */
32
60
  collapseTagsTooltip?: boolean;
61
+ /** 多选折叠时最多展示几个 tag,默认 1 */
33
62
  maxCollapseTags?: number;
34
63
  }
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ import { JAdminLayout } from './components/JAdminLayout';
10
10
  import { JProductDetailDialog, JSkuLink, ProductDetailHost } from './components/JProductDetail';
11
11
  import { JSearchInputDialog } from './components/JSearchInputDialog';
12
12
  import { JRemoteSelect } from './components/JRemoteSelect';
13
+ import { JProductSelectDialog } from './components/JProductSelectDialog';
13
14
  import { DocNoLink, DocDetailHost } from './components/JDocDetail';
14
15
  import { JRelatedDocs } from './components/JRelatedDocs';
15
16
 
@@ -17,13 +18,13 @@ declare const _default: {
17
18
  install: (app: App) => void;
18
19
  };
19
20
  export default _default;
20
- export { JButton, JUploadImg, JIconRender, JSearchHeader, JListSearchHeader, JImportExcel, JSidebar, JSideMenuItem, JAdminLayout, JProductDetailDialog, JSkuLink, ProductDetailHost, JSearchInputDialog, JRemoteSelect, DocNoLink, DocDetailHost, JRelatedDocs, };
21
+ export { JButton, JUploadImg, JIconRender, JSearchHeader, JListSearchHeader, JImportExcel, JSidebar, JSideMenuItem, JAdminLayout, JProductDetailDialog, JSkuLink, ProductDetailHost, JSearchInputDialog, JRemoteSelect, JProductSelectDialog, DocNoLink, DocDetailHost, JRelatedDocs, };
21
22
  export { useProductDetailDialog, useProductDetailStore, provideProductRequest, resolveProductRequest, useInjectedProductRequest, J_PRODUCT_REQUEST_KEY, } from './components/JProductDetail';
22
23
  export { createDocDetail, registerDocDetail, getDocDetailAdapters, getDocDetailEntry, getDocDetailRegistry, isDocDetailInitialized, useDocDetailStore, wmsDocDetailComponents, ReceiptOrderDetailView, QcOrderDetailView, InboundOrderDetailView, PutawayOrderDetailView, DeliveryOrderDetailView, TransferOrderDetailView, WorkOrderDetailView, AbnormalOrderDetailView, PaymentRequestDetailView, ReturnOrderDetailView, CostExpenseDetailView, ReceiptVoucherDetailView, PurchaseOrderDetailView, PurchasePlanDetailView, PurchaseContractDetailView, DeliveryDocDetailView, } from './components/JDocDetail';
23
24
  export { createRelatedDocs, registerRelatedDocs, getRelatedListAdapter, getRelatedTableComponent, getRelatedDocsTableComponents, isRelatedDocsInitialized, RelatedDocSubTabs, RelatedDocNoCopy, RelatedDocPanel, RelatedReceiptOrderTable, RelatedQcOrderTable, RelatedInboundOrderTable, RelatedPutawayOrderTable, flattenOrderItems, sumOrderItemField, useRelatedCollapseExpand, parseListResponse, } from './components/JRelatedDocs';
24
- export { toSnakeCase, toCamelCase, pick, omit, deepClone, filterEmpty, flatten, unflatten, toTableColumns, checkBtnPermission, provideBtnPermission, useInjectedBtnPermission, useInjectedBtnPermissions, J_BTN_PERMISSION_KEY, J_BTN_PERMISSIONS_KEY, } from './utils';
25
+ export { toSnakeCase, toCamelCase, pick, omit, deepClone, filterEmpty, flatten, unflatten, toTableColumns, checkBtnPermission, provideBtnPermission, useInjectedBtnPermission, useInjectedBtnPermissions, J_BTN_PERMISSION_KEY, J_BTN_PERMISSIONS_KEY, isAllStatusTab, resolveListStatusParam, toTabName, getAllTabName, syncActiveTabIfAll, buildStatusCountLookup, buildFallbackStatusTabs, unwrapStatusCountList, mapStatusCountToTabs, exportStyledExcel, } from './utils';
25
26
  export { useBtnPermissionGate } from './composables/useBtnPermissionGate';
26
- export type { BtnPermissionInput, BtnPermissionMode, BtnPermissionChecker } from './utils';
27
+ export type { BtnPermissionInput, BtnPermissionMode, BtnPermissionChecker, StatusCountItem, StatusCountLookup, StatusTabListItem, StatusTabItem, StyledExportOptions, } from './utils';
27
28
  export { createRouterGuard, buildRouteTree, transformBackendRoutes, findFirstAllowedRoute, getComponentImport } from './router';
28
29
  export type { BackendRoute, RouteStoreAdapter, PermissionStoreAdapter, UserStoreAdapter, RouterGuardOptions } from './router';
29
30
  export type { ButtonType, ButtonSize } from './components/JButton';
@@ -37,5 +38,6 @@ export type { AdminLayoutMenuItem, JAdminLayoutProps } from './components/JAdmin
37
38
  export type { JProductDetailDialogProps, JSkuLinkProps, JProductRequestFn, JProductRequestConfig, } from './components/JProductDetail';
38
39
  export type { JSearchInputDialogProps, SearchInputOption, SearchInputModel, } from './components/JSearchInputDialog';
39
40
  export type { JRemoteSelectProps, RemoteSelectFetchApi, RemoteSelectModelValue, } from './components/JRemoteSelect';
41
+ export type { JProductSelectDialogProps, JProductSelectFetchApi, JProductSelectListResult, } from './components/JProductSelectDialog';
40
42
  export type { DocDetailType, DocDetailAdapters, DocDetailRegistryItem, DocDetailComponents, CreateDocDetailOptions, } from './components/JDocDetail';
41
43
  export type { RelatedListAdapter, RelatedDocTypeItem, CreateRelatedDocsOptions, RelatedDocsContainerProps, } from './components/JRelatedDocs';