sun-biz 0.0.3-beta.5 → 0.0.3-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.
@@ -269,8 +269,8 @@ const copy_text_with_tooltip_exports_ = /*#__PURE__*/ (0, exportHelper["default"
269
269
  * @returns {String}
270
270
  * */ function formatValue(callValue) {
271
271
  // 如果当前值为数组,使用 / 拼接(根据需求自定义)
272
- if (isArray(callValue)) return callValue.length ? callValue.join(' / ') : '--';
273
- return callValue ?? '--';
272
+ if (isArray(callValue)) return callValue.length ? callValue.join(" / ") : "--";
273
+ return callValue ?? "--";
274
274
  }
275
275
  /**
276
276
  * @description 处理 prop 为多级嵌套的情况,返回的数据 (列如: prop: user.name)
@@ -278,8 +278,8 @@ const copy_text_with_tooltip_exports_ = /*#__PURE__*/ (0, exportHelper["default"
278
278
  * @param {String} prop 当前 prop
279
279
  * @returns {*}
280
280
  * */ function handleRowAccordingToProp(row, prop) {
281
- if (!prop?.includes('.')) return row[prop] ?? '--';
282
- prop.split('.').forEach((item)=>row = row[item] ?? '--');
281
+ if (!prop?.includes(".")) return row[prop] ?? "--";
282
+ prop.split(".").forEach((item)=>row = row[item] ?? "--");
283
283
  return row;
284
284
  }
285
285
  /**
@@ -287,7 +287,7 @@ const copy_text_with_tooltip_exports_ = /*#__PURE__*/ (0, exportHelper["default"
287
287
  * @param {String} prop 当前 prop
288
288
  * @returns {String}
289
289
  * */ function handleProp(prop) {
290
- const propArr = prop.split('.');
290
+ const propArr = prop.split(".");
291
291
  if (1 == propArr.length) return prop;
292
292
  return propArr[propArr.length - 1];
293
293
  }
@@ -308,15 +308,15 @@ const copy_text_with_tooltip_exports_ = /*#__PURE__*/ (0, exportHelper["default"
308
308
  * @param {String} type 过滤类型(目前只有 tag)
309
309
  * @returns {String}
310
310
  * */ function filterEnum(callValue, enumData, fieldNames, type) {
311
- const value = fieldNames?.value ?? 'value';
312
- const label = fieldNames?.label ?? 'label';
313
- const children = fieldNames?.children ?? 'children';
311
+ const value = fieldNames?.value ?? "value";
312
+ const label = fieldNames?.label ?? "label";
313
+ const children = fieldNames?.children ?? "children";
314
314
  let filterData = {};
315
315
  // 判断 enumData 是否为数组
316
316
  if (Array.isArray(enumData)) filterData = findItemNested(enumData, callValue, value, children);
317
317
  // 判断是否输出的结果为 tag 类型
318
- if ('tag' == type) return filterData?.tagType ? filterData.tagType : '';
319
- return filterData ? filterData[label] : '--';
318
+ if ("tag" == type) return filterData?.tagType ? filterData.tagType : "";
319
+ return filterData ? filterData[label] : "--";
320
320
  }
321
321
  function _isSlot(s) {
322
322
  return 'function' == typeof s || '[object Object]' === Object.prototype.toString.call(s) && !(0, __WEBPACK_EXTERNAL_MODULE_vue__.isVNode)(s);
@@ -1415,7 +1415,7 @@ const pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_1 = {
1415
1415
  class: "relative flex flex-1 flex-col overflow-hidden"
1416
1416
  };
1417
1417
  const pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_2 = {
1418
- key: 0,
1418
+ key: 1,
1419
1419
  class: "mt-5 flex justify-between items-center"
1420
1420
  };
1421
1421
  // 接受父组件参数,配置默认值
@@ -1474,7 +1474,20 @@ const pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_2 = {
1474
1474
  default: ()=>({})
1475
1475
  },
1476
1476
  layout: {
1477
- default: 'total, sizes, prev, pager, next'
1477
+ default: "total, sizes, prev, pager, next"
1478
+ },
1479
+ dragTips: {
1480
+ default: "温馨提示:您可通过拖动进行排序"
1481
+ },
1482
+ isShowDragTips: {
1483
+ type: Boolean,
1484
+ default: false
1485
+ },
1486
+ dragTipsCustomStyle: {
1487
+ default: {}
1488
+ },
1489
+ dragTipsClassName: {
1490
+ default: ""
1478
1491
  }
1479
1492
  },
1480
1493
  emits: [
@@ -1719,6 +1732,18 @@ const pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_2 = {
1719
1732
  return (_ctx, _cache)=>{
1720
1733
  const _directive_loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective)("loading");
1721
1734
  return (0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_1, [
1735
+ props?.draggable || props?.isShowDragTips ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", {
1736
+ key: 0,
1737
+ style: (0, __WEBPACK_EXTERNAL_MODULE_vue__.normalizeStyle)({
1738
+ color: '#f7ba2a',
1739
+ ...props.dragTipsCustomStyle
1740
+ }),
1741
+ class: (0, __WEBPACK_EXTERNAL_MODULE_vue__.normalizeClass)([
1742
+ 'text-base',
1743
+ 'mb-2',
1744
+ props.dragTipsClassName
1745
+ ])
1746
+ }, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(props.dragTips), 7)) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true),
1722
1747
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(TableContainer, {
1723
1748
  ref_key: "formRef",
1724
1749
  ref: formRef,
@@ -2829,16 +2854,6 @@ const _hoisted_12 = {
2829
2854
  };
2830
2855
  // 计算实际布局列数
2831
2856
  const layoutColumns = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>parseLayoutColumns(bannerInfo.value?.layoutTypeCode));
2832
- /** 如果是住院就诊,返回就诊状态和天数 */ const encounterInfo = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>{
2833
- if (BANNER_COMPONENT_CONFIG[__props.code].bizIdTypeCode !== __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.BIZ_ID_TYPE_CODE.IENC_ENCOUNTER) return null;
2834
- const bannerItems = bannerInfo.value?.bannerItemList ?? [];
2835
- const statusItem = bannerItems.find((item)=>"inEncStatusDesc" === item.bindingFieldNo);
2836
- const daysItem = bannerItems.find((item)=>"inpatientDays" === item.bindingFieldNo);
2837
- return {
2838
- inEncStatusDesc: statusItem?.dataValue ?? "--",
2839
- inpatientDays: daysItem?.dataValue ? `(${daysItem.dataValue})` : "--"
2840
- };
2841
- });
2842
2857
  /** 获取banner配置 */ const queryBannerConfig = async ()=>{
2843
2858
  loading.value = true;
2844
2859
  if (!__props.bizId && initBannerInfo.value) {
@@ -2853,7 +2868,7 @@ const _hoisted_12 = {
2853
2868
  });
2854
2869
  loading.value = false;
2855
2870
  if (res?.success) {
2856
- res.data.bannerItemList = (res?.data?.bannerItemList ?? [])?.filter((item)=>item.displayFlag);
2871
+ res.data.bannerItemList = (res?.data?.bannerItemList ?? [])?.filter((item)=>item?.displayFlag === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.YES);
2857
2872
  if (!__props.bizId) initBannerInfo.value = res?.data;
2858
2873
  bannerInfo.value = res?.data;
2859
2874
  }
@@ -2931,8 +2946,8 @@ const _hoisted_12 = {
2931
2946
  ]),
2932
2947
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", _hoisted_8, [
2933
2948
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(BANNER_COMPONENT_CONFIG)[_ctx.code].bizIdTypeCode === (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.BIZ_ID_TYPE_CODE).IENC_ENCOUNTER ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", _hoisted_9, [
2934
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", _hoisted_10, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(encounterInfo.value?.inEncStatusDesc), 1),
2935
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(encounterInfo.value?.inpatientDays), 1)
2949
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", _hoisted_10, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(bannerInfo.value?.inpatientStatusDesc ?? "--"), 1),
2950
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(bannerInfo.value?.inpatientDays ?? "--"), 1)
2936
2951
  ])) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true)
2937
2952
  ])
2938
2953
  ]),
@@ -2954,7 +2969,7 @@ const _hoisted_12 = {
2954
2969
  class: "w-full overflow-hidden text-ellipsis whitespace-nowrap",
2955
2970
  onMouseenter: checkTextOverflow
2956
2971
  }, [
2957
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", _hoisted_11, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(item.labelNameDisplay) + ":", 1),
2972
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", _hoisted_11, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(item.labelNameDisplay) + "", 1),
2958
2973
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(_component_el_tooltip, {
2959
2974
  disabled: !isTextOverflowing.value,
2960
2975
  content: item.dataValue
@@ -3220,6 +3235,11 @@ const pluginMainRequest = async (methodName, params)=>{
3220
3235
  * @param params
3221
3236
  * @returns
3222
3237
  */ const designPreviewPrintReceipt = (params)=>pluginMainRequest("designPreviewPrintReceipt", params);
3238
+ /**
3239
+ * [97-10005-1]web单据打印
3240
+ * @param params
3241
+ * @returns
3242
+ */ const designPreviewPrintReceiptWeb = (params)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.baseRequest)("/report/designPreviewPrintReceipt", params);
3223
3243
  /**
3224
3244
  * 分单方式代码
3225
3245
  */ var constant_RECEIPT_SPLIT_TYPE_CODE = /*#__PURE__*/ function(RECEIPT_SPLIT_TYPE_CODE) {
@@ -3326,6 +3346,129 @@ var constant_DATA_SOURCE_CONTENT_TYPE_CODE = /*#__PURE__*/ function(DATA_SOURCE_
3326
3346
  */ DATA_SOURCE_CONTENT_TYPE_CODE["BASE64"] = "BASE64";
3327
3347
  return DATA_SOURCE_CONTENT_TYPE_CODE;
3328
3348
  }({});
3349
+ /** 用于获取单据 */ const usePrintReceipt = (params, isInit = true)=>{
3350
+ const menuXReceiptList = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)([]);
3351
+ const loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false);
3352
+ const getMenuXReceiptList = async (params)=>{
3353
+ loading.value = true;
3354
+ const [, res] = await queryMenuXReceiptBySysMenuId(params);
3355
+ loading.value = false;
3356
+ if (res?.success) menuXReceiptList.value = res.data?.menuXReceiptList || [];
3357
+ };
3358
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.onMounted)(()=>{
3359
+ if (isInit) getMenuXReceiptList(params);
3360
+ });
3361
+ return {
3362
+ menuXReceiptList,
3363
+ loading,
3364
+ getMenuXReceiptList
3365
+ };
3366
+ };
3367
+ /** web打印弹出打印框 类型默认是BASE64的格式
3368
+ * type 数据源格式类型代码
3369
+ * @param [type='BASE64']
3370
+ */ function useWebPrint(content, type = constant_DATA_SOURCE_CONTENT_TYPE_CODE.BASE64) {
3371
+ // 创建隐藏的iframe
3372
+ const iframe = document.createElement("iframe");
3373
+ iframe.style.position = "fixed";
3374
+ iframe.style.right = "0";
3375
+ iframe.style.bottom = "0";
3376
+ iframe.style.width = "0";
3377
+ iframe.style.height = "0";
3378
+ iframe.style.border = "0";
3379
+ iframe.style.visibility = "hidden"; // 添加这行确保iframe完全隐藏
3380
+ document.body.appendChild(iframe);
3381
+ // 等待iframe加载完成
3382
+ iframe.onload = async ()=>{
3383
+ const iframeDoc = iframe.contentDocument || iframe.contentWindow?.document;
3384
+ // 根据类型处理内容
3385
+ if (type === constant_DATA_SOURCE_CONTENT_TYPE_CODE.H5 || type === constant_DATA_SOURCE_CONTENT_TYPE_CODE.JSON) {
3386
+ iframeDoc.body.innerHTML = content;
3387
+ return; // 不再执行打印操作
3388
+ }
3389
+ if (type === constant_DATA_SOURCE_CONTENT_TYPE_CODE.BASE64) {
3390
+ const img = new Image();
3391
+ // 处理Base64图片
3392
+ if (content.startsWith("data:image")) img.src = content;
3393
+ else // 如果不是完整的data URL,添加前缀
3394
+ img.src = `data:image/png;base64,${content}`;
3395
+ iframeDoc.body.appendChild(img);
3396
+ img.onerror = (error)=>{
3397
+ console.error("加载失败:", error);
3398
+ iframeDoc.body.innerHTML = "<p>加载失败,请检查数据</p>";
3399
+ };
3400
+ }
3401
+ /** 返回二进制文件时候的解析 */ // else if (type === "FILE") {
3402
+ // const blob = new Blob([content], { type: "application/pdf" });
3403
+ // const url = URL.createObjectURL(blob);
3404
+ // iframeDoc.body.innerHTML = `<embed src="${url}" type="application/pdf" width="100%" height="100%">`;
3405
+ // }
3406
+ await iframe.contentWindow?.focus();
3407
+ await iframe.contentWindow?.print();
3408
+ // 打印完成后移除iframe
3409
+ await document.body.removeChild(iframe);
3410
+ };
3411
+ // 最后添加到DOM
3412
+ document.body.appendChild(iframe);
3413
+ // 强制触发加载
3414
+ iframe.src = "about:blank";
3415
+ }
3416
+ /** 设计或预览 */ function useDesignAndPreview(htmlContent, title = "设计", options = {}) {
3417
+ // 创建一个容器元素
3418
+ const container = document.createElement("div");
3419
+ // 关闭弹窗的函数
3420
+ const closeDialog = ()=>{
3421
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.render)(null, container); // 卸载组件
3422
+ document.body.removeChild(container); // 移除容器
3423
+ document.head.removeChild(style); // 移除样式
3424
+ };
3425
+ // 在渲染前动态创建并插入样式
3426
+ const style = document.createElement("style");
3427
+ style.innerHTML = `
3428
+ .custom-dialog .el-dialog__headerbtn .el-icon {
3429
+ width: 48px; /* 设置图标的宽度 */
3430
+ height: 48px; /* 设置图标的高度 */
3431
+ }
3432
+ `;
3433
+ document.head.appendChild(style);
3434
+ // 使用 h 函数创建弹窗组件
3435
+ const dialog = (0, __WEBPACK_EXTERNAL_MODULE_vue__.h)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElDialog, {
3436
+ modelValue: true,
3437
+ title: title,
3438
+ width: "50%",
3439
+ onClose: ()=>{
3440
+ options.onCancel?.(); // 触发取消回调
3441
+ closeDialog();
3442
+ },
3443
+ class: "custom-dialog"
3444
+ }, {
3445
+ default: ()=>(0, __WEBPACK_EXTERNAL_MODULE_vue__.h)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElScrollbar, {
3446
+ style: {
3447
+ height: "400px",
3448
+ paddingRight: "10px"
3449
+ }
3450
+ }, ()=>(0, __WEBPACK_EXTERNAL_MODULE_vue__.h)("div", {
3451
+ style: {
3452
+ padding: "10px"
3453
+ },
3454
+ innerHTML: htmlContent
3455
+ })),
3456
+ footer: options.footer ? options.footer : ()=>(0, __WEBPACK_EXTERNAL_MODULE_vue__.h)("div", {
3457
+ class: "dialog-footer"
3458
+ }, [
3459
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.h)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElButton, {
3460
+ onClick: ()=>{
3461
+ options.onCancel?.(); // 触发取消回调
3462
+ closeDialog();
3463
+ }
3464
+ }, ()=>"取消")
3465
+ ])
3466
+ });
3467
+ // 将弹窗渲染到容器中
3468
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.render)(dialog, container);
3469
+ // 将容器添加到 body
3470
+ document.body.appendChild(container);
3471
+ }
3329
3472
  let defaultContext = {
3330
3473
  printParams: void 0,
3331
3474
  receiptInfo: void 0,
@@ -3621,7 +3764,7 @@ const printStart = async (params)=>{
3621
3764
  throw new Error("暂不支持该方式打印");
3622
3765
  }
3623
3766
  if (defaultContext?.dataSourceContentTypeCodeItem === constant_DATA_SOURCE_CONTENT_TYPE_CODE.JSON) {
3624
- const [, res] = await designPreviewPrintReceipt({
3767
+ const params = {
3625
3768
  formOperationType: defaultContext?.printParams?.formOperationType,
3626
3769
  printType: defaultContext?.printParams?.printType,
3627
3770
  receiptId: defaultContext?.printParams?.receiptId,
@@ -3630,31 +3773,25 @@ const printStart = async (params)=>{
3630
3773
  dataSourceContentTypeCode: defaultContext?.dataSourceContentTypeCodeItem,
3631
3774
  dataSourceContent: defaultContext?.dataSourceContentItem,
3632
3775
  printQty: defaultContext?.receiptInfo?.printQty
3633
- });
3634
- if (res?.success) return res.data ?? [];
3776
+ };
3777
+ /** 判断是否客户端打印 */ const { isLocalPrint } = use_app_config([
3778
+ use_app_config_MAIN_APP_CONFIG.IS_LOCAL_PRINT
3779
+ ]);
3780
+ if (isLocalPrint) {
3781
+ const [, res] = await designPreviewPrintReceipt(params);
3782
+ if (res?.success) return res.data ?? [];
3783
+ } else {
3784
+ /** 调用接口 */ const [, res] = await designPreviewPrintReceiptWeb(params);
3785
+ if (res?.success) {
3786
+ if (defaultContext?.printParams?.formOperationType === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FORM_OPERATION_TYPE.PRINT) useWebPrint(res?.data);
3787
+ else useDesignAndPreview(res?.data, defaultContext?.printParams?.formOperationType === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FORM_OPERATION_TYPE.DESIGN ? "设计" : "预览");
3788
+ }
3789
+ }
3635
3790
  }
3636
3791
  };
3637
3792
  const print = async (params)=>{
3638
3793
  await printStart(params);
3639
3794
  };
3640
- const usePrintReceipt = (params, isInit = true)=>{
3641
- const menuXReceiptList = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)([]);
3642
- const loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false);
3643
- const getMenuXReceiptList = async (params)=>{
3644
- loading.value = true;
3645
- const [, res] = await queryMenuXReceiptBySysMenuId(params);
3646
- loading.value = false;
3647
- if (res?.success) menuXReceiptList.value = res.data?.menuXReceiptList || [];
3648
- };
3649
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.onMounted)(()=>{
3650
- if (isInit) getMenuXReceiptList(params);
3651
- });
3652
- return {
3653
- menuXReceiptList,
3654
- loading,
3655
- getMenuXReceiptList
3656
- };
3657
- };
3658
3795
  /* ESM default export */ const printReceiptBtnvue_type_script_setup_true_lang_ts_name_printReceipt = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
3659
3796
  __name: 'printReceiptBtn',
3660
3797
  props: {
@@ -4134,6 +4271,8 @@ const DICT_SELECT = 'dictSelect';
4134
4271
  const _component_el_option = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-option");
4135
4272
  return 'select' === (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs).component ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveDynamicComponent)(`el-${(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs).component}`), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
4136
4273
  key: 0,
4274
+ ref_key: "componentRef",
4275
+ ref: componentRef,
4137
4276
  filterable: !!(__WEBPACK_EXTERNAL_MODULE_vue__.unref(attrs)?.filterable || __WEBPACK_EXTERNAL_MODULE_vue__.unref(attrs)?.options?.length && __WEBPACK_EXTERNAL_MODULE_vue__.unref(attrs)?.options?.length > 5) || false,
4138
4277
  clearable: true
4139
4278
  }, {
@@ -5356,6 +5495,9 @@ const access_infovue_type_script_setup_true_lang_ts_name_accessInfo_hoisted_3 =
5356
5495
  /* ESM default export */ const access_infovue_type_script_setup_true_lang_ts_name_accessInfo = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
5357
5496
  __name: 'index',
5358
5497
  props: {
5498
+ btnTitle: {
5499
+ default: "新患者"
5500
+ },
5359
5501
  code: {},
5360
5502
  menuId: {},
5361
5503
  clearBtn: {
@@ -5442,9 +5584,9 @@ const access_infovue_type_script_setup_true_lang_ts_name_accessInfo_hoisted_3 =
5442
5584
  plain: "",
5443
5585
  onClick: clearFn
5444
5586
  }, {
5445
- default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>_cache[0] || (_cache[0] = [
5446
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)("新患者")
5447
- ])),
5587
+ default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
5588
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(_ctx.btnTitle), 1)
5589
+ ]),
5448
5590
  _: 1
5449
5591
  })) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true)
5450
5592
  ])
@@ -35,3 +35,9 @@ export declare const splitReceipt: (params: SplitReceiptReqParams) => Promise<[i
35
35
  * @returns
36
36
  */
37
37
  export declare const designPreviewPrintReceipt: (params: DesignPreviewPrintReceiptResParams) => Promise<any[]>;
38
+ /**
39
+ * [97-10005-1]web单据打印
40
+ * @param params
41
+ * @returns
42
+ */
43
+ export declare const designPreviewPrintReceiptWeb: (params: DesignPreviewPrintReceiptResParams) => Promise<[import("@sun-toolkit/request").SunApiResultData<null> | undefined, import("@sun-toolkit/request").SunApiResultData<unknown> | undefined]>;
@@ -1,4 +1,7 @@
1
+ import { VNode } from "vue";
2
+ import { DATA_SOURCE_CONTENT_TYPE_CODE } from "../constant";
1
3
  import type { MenuXReceiptReqParams, MenuXReceiptListReqItem } from "../types";
4
+ /** 用于获取单据 */
2
5
  export declare const usePrintReceipt: (params: MenuXReceiptReqParams, isInit?: boolean) => {
3
6
  menuXReceiptList: import("vue").Ref<{
4
7
  menuXReceiptId: string;
@@ -20,3 +23,14 @@ export declare const usePrintReceipt: (params: MenuXReceiptReqParams, isInit?: b
20
23
  loading: import("vue").Ref<boolean, boolean>;
21
24
  getMenuXReceiptList: (params: MenuXReceiptReqParams) => Promise<void>;
22
25
  };
26
+ /** web打印弹出打印框 类型默认是BASE64的格式
27
+ * type 数据源格式类型代码
28
+ * @param [type='BASE64']
29
+ */
30
+ export declare function useWebPrint(content: string, type?: DATA_SOURCE_CONTENT_TYPE_CODE): void;
31
+ /** 设计或预览 */
32
+ export declare function useDesignAndPreview(htmlContent: string | undefined, title?: string, options?: {
33
+ footer?: () => VNode;
34
+ onConfirm?: () => void;
35
+ onCancel?: () => void;
36
+ }): void;
@@ -1,8 +1,23 @@
1
- import { FieldNamesProps } from './interface';
1
+ import { FieldNamesProps } from "./interface";
2
2
  /**
3
3
  * @description: 是否为数组
4
4
  */
5
5
  export declare function isArray(val: any): val is Array<any>;
6
+ /**
7
+ * @description 生成随机数
8
+ * @param {Number} min 最小值
9
+ * @param {Number} max 最大值
10
+ * @returns {Number}
11
+ */
12
+ export declare function randomNum(min: number, max: number): number;
13
+ /**
14
+ * @description 格式化表格单元格默认值 (el-table-column)
15
+ * @param {Number} row 行
16
+ * @param {Number} col 列
17
+ * @param {*} callValue 当前单元格值
18
+ * @returns {String}
19
+ * */
20
+ export declare function formatTableColumn(row: number, col: number, callValue: unknown): {};
6
21
  /**
7
22
  * @description 处理 ProTable 值为数组 || 无数据
8
23
  * @param {*} callValue 需要处理的值
@@ -36,4 +51,4 @@ export declare function findItemNested(enumData: any, callValue: any, value: str
36
51
  * @param {String} type 过滤类型(目前只有 tag)
37
52
  * @returns {String}
38
53
  * */
39
- export declare function filterEnum(callValue: unknown, enumData?: unknown, fieldNames?: FieldNamesProps, type?: 'tag'): any;
54
+ export declare function filterEnum(callValue: unknown, enumData?: unknown, fieldNames?: FieldNamesProps, type?: "tag"): any;
package/dist/index.js CHANGED
@@ -269,8 +269,8 @@ const copy_text_with_tooltip_exports_ = /*#__PURE__*/ (0, exportHelper["default"
269
269
  * @returns {String}
270
270
  * */ function formatValue(callValue) {
271
271
  // 如果当前值为数组,使用 / 拼接(根据需求自定义)
272
- if (isArray(callValue)) return callValue.length ? callValue.join(' / ') : '--';
273
- return callValue ?? '--';
272
+ if (isArray(callValue)) return callValue.length ? callValue.join(" / ") : "--";
273
+ return callValue ?? "--";
274
274
  }
275
275
  /**
276
276
  * @description 处理 prop 为多级嵌套的情况,返回的数据 (列如: prop: user.name)
@@ -278,8 +278,8 @@ const copy_text_with_tooltip_exports_ = /*#__PURE__*/ (0, exportHelper["default"
278
278
  * @param {String} prop 当前 prop
279
279
  * @returns {*}
280
280
  * */ function handleRowAccordingToProp(row, prop) {
281
- if (!prop?.includes('.')) return row[prop] ?? '--';
282
- prop.split('.').forEach((item)=>row = row[item] ?? '--');
281
+ if (!prop?.includes(".")) return row[prop] ?? "--";
282
+ prop.split(".").forEach((item)=>row = row[item] ?? "--");
283
283
  return row;
284
284
  }
285
285
  /**
@@ -287,7 +287,7 @@ const copy_text_with_tooltip_exports_ = /*#__PURE__*/ (0, exportHelper["default"
287
287
  * @param {String} prop 当前 prop
288
288
  * @returns {String}
289
289
  * */ function handleProp(prop) {
290
- const propArr = prop.split('.');
290
+ const propArr = prop.split(".");
291
291
  if (1 == propArr.length) return prop;
292
292
  return propArr[propArr.length - 1];
293
293
  }
@@ -308,15 +308,15 @@ const copy_text_with_tooltip_exports_ = /*#__PURE__*/ (0, exportHelper["default"
308
308
  * @param {String} type 过滤类型(目前只有 tag)
309
309
  * @returns {String}
310
310
  * */ function filterEnum(callValue, enumData, fieldNames, type) {
311
- const value = fieldNames?.value ?? 'value';
312
- const label = fieldNames?.label ?? 'label';
313
- const children = fieldNames?.children ?? 'children';
311
+ const value = fieldNames?.value ?? "value";
312
+ const label = fieldNames?.label ?? "label";
313
+ const children = fieldNames?.children ?? "children";
314
314
  let filterData = {};
315
315
  // 判断 enumData 是否为数组
316
316
  if (Array.isArray(enumData)) filterData = findItemNested(enumData, callValue, value, children);
317
317
  // 判断是否输出的结果为 tag 类型
318
- if ('tag' == type) return filterData?.tagType ? filterData.tagType : '';
319
- return filterData ? filterData[label] : '--';
318
+ if ("tag" == type) return filterData?.tagType ? filterData.tagType : "";
319
+ return filterData ? filterData[label] : "--";
320
320
  }
321
321
  function _isSlot(s) {
322
322
  return 'function' == typeof s || '[object Object]' === Object.prototype.toString.call(s) && !(0, __WEBPACK_EXTERNAL_MODULE_vue__.isVNode)(s);
@@ -1416,7 +1416,7 @@ const pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_1 = {
1416
1416
  class: "relative flex flex-1 flex-col overflow-hidden"
1417
1417
  };
1418
1418
  const pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_2 = {
1419
- key: 0,
1419
+ key: 1,
1420
1420
  class: "mt-5 flex justify-between items-center"
1421
1421
  };
1422
1422
  // 接受父组件参数,配置默认值
@@ -1475,7 +1475,20 @@ const pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_2 = {
1475
1475
  default: ()=>({})
1476
1476
  },
1477
1477
  layout: {
1478
- default: 'total, sizes, prev, pager, next'
1478
+ default: "total, sizes, prev, pager, next"
1479
+ },
1480
+ dragTips: {
1481
+ default: "温馨提示:您可通过拖动进行排序"
1482
+ },
1483
+ isShowDragTips: {
1484
+ type: Boolean,
1485
+ default: false
1486
+ },
1487
+ dragTipsCustomStyle: {
1488
+ default: {}
1489
+ },
1490
+ dragTipsClassName: {
1491
+ default: ""
1479
1492
  }
1480
1493
  },
1481
1494
  emits: [
@@ -1720,6 +1733,18 @@ const pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_2 = {
1720
1733
  return (_ctx, _cache)=>{
1721
1734
  const _directive_loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective)("loading");
1722
1735
  return (0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_1, [
1736
+ props?.draggable || props?.isShowDragTips ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", {
1737
+ key: 0,
1738
+ style: (0, __WEBPACK_EXTERNAL_MODULE_vue__.normalizeStyle)({
1739
+ color: '#f7ba2a',
1740
+ ...props.dragTipsCustomStyle
1741
+ }),
1742
+ class: (0, __WEBPACK_EXTERNAL_MODULE_vue__.normalizeClass)([
1743
+ 'text-base',
1744
+ 'mb-2',
1745
+ props.dragTipsClassName
1746
+ ])
1747
+ }, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(props.dragTips), 7)) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true),
1723
1748
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(TableContainer, {
1724
1749
  ref_key: "formRef",
1725
1750
  ref: formRef,
@@ -3227,16 +3252,6 @@ const _hoisted_12 = {
3227
3252
  };
3228
3253
  // 计算实际布局列数
3229
3254
  const layoutColumns = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>parseLayoutColumns(bannerInfo.value?.layoutTypeCode));
3230
- /** 如果是住院就诊,返回就诊状态和天数 */ const encounterInfo = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>{
3231
- if (BANNER_COMPONENT_CONFIG[__props.code].bizIdTypeCode !== __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.BIZ_ID_TYPE_CODE.IENC_ENCOUNTER) return null;
3232
- const bannerItems = bannerInfo.value?.bannerItemList ?? [];
3233
- const statusItem = bannerItems.find((item)=>"inEncStatusDesc" === item.bindingFieldNo);
3234
- const daysItem = bannerItems.find((item)=>"inpatientDays" === item.bindingFieldNo);
3235
- return {
3236
- inEncStatusDesc: statusItem?.dataValue ?? "--",
3237
- inpatientDays: daysItem?.dataValue ? `(${daysItem.dataValue})` : "--"
3238
- };
3239
- });
3240
3255
  /** 获取banner配置 */ const queryBannerConfig = async ()=>{
3241
3256
  loading.value = true;
3242
3257
  if (!__props.bizId && initBannerInfo.value) {
@@ -3251,7 +3266,7 @@ const _hoisted_12 = {
3251
3266
  });
3252
3267
  loading.value = false;
3253
3268
  if (res?.success) {
3254
- res.data.bannerItemList = (res?.data?.bannerItemList ?? [])?.filter((item)=>item.displayFlag);
3269
+ res.data.bannerItemList = (res?.data?.bannerItemList ?? [])?.filter((item)=>item?.displayFlag === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.YES);
3255
3270
  if (!__props.bizId) initBannerInfo.value = res?.data;
3256
3271
  bannerInfo.value = res?.data;
3257
3272
  }
@@ -3329,8 +3344,8 @@ const _hoisted_12 = {
3329
3344
  ]),
3330
3345
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", _hoisted_8, [
3331
3346
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(BANNER_COMPONENT_CONFIG)[_ctx.code].bizIdTypeCode === (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.BIZ_ID_TYPE_CODE).IENC_ENCOUNTER ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", _hoisted_9, [
3332
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", _hoisted_10, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(encounterInfo.value?.inEncStatusDesc), 1),
3333
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(encounterInfo.value?.inpatientDays), 1)
3347
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", _hoisted_10, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(bannerInfo.value?.inpatientStatusDesc ?? "--"), 1),
3348
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(bannerInfo.value?.inpatientDays ?? "--"), 1)
3334
3349
  ])) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true)
3335
3350
  ])
3336
3351
  ]),
@@ -3352,7 +3367,7 @@ const _hoisted_12 = {
3352
3367
  class: "w-full overflow-hidden text-ellipsis whitespace-nowrap",
3353
3368
  onMouseenter: checkTextOverflow
3354
3369
  }, [
3355
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", _hoisted_11, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(item.labelNameDisplay) + ":", 1),
3370
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", _hoisted_11, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(item.labelNameDisplay) + "", 1),
3356
3371
  (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(_component_el_tooltip, {
3357
3372
  disabled: !isTextOverflowing.value,
3358
3373
  content: item.dataValue
@@ -3618,6 +3633,11 @@ const pluginMainRequest = async (methodName, params)=>{
3618
3633
  * @param params
3619
3634
  * @returns
3620
3635
  */ const designPreviewPrintReceipt = (params)=>pluginMainRequest("designPreviewPrintReceipt", params);
3636
+ /**
3637
+ * [97-10005-1]web单据打印
3638
+ * @param params
3639
+ * @returns
3640
+ */ const designPreviewPrintReceiptWeb = (params)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.baseRequest)("/report/designPreviewPrintReceipt", params);
3621
3641
  /**
3622
3642
  * 分单方式代码
3623
3643
  */ var constant_RECEIPT_SPLIT_TYPE_CODE = /*#__PURE__*/ function(RECEIPT_SPLIT_TYPE_CODE) {
@@ -3724,6 +3744,129 @@ var constant_DATA_SOURCE_CONTENT_TYPE_CODE = /*#__PURE__*/ function(DATA_SOURCE_
3724
3744
  */ DATA_SOURCE_CONTENT_TYPE_CODE["BASE64"] = "BASE64";
3725
3745
  return DATA_SOURCE_CONTENT_TYPE_CODE;
3726
3746
  }({});
3747
+ /** 用于获取单据 */ const usePrintReceipt = (params, isInit = true)=>{
3748
+ const menuXReceiptList = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)([]);
3749
+ const loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false);
3750
+ const getMenuXReceiptList = async (params)=>{
3751
+ loading.value = true;
3752
+ const [, res] = await queryMenuXReceiptBySysMenuId(params);
3753
+ loading.value = false;
3754
+ if (res?.success) menuXReceiptList.value = res.data?.menuXReceiptList || [];
3755
+ };
3756
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.onMounted)(()=>{
3757
+ if (isInit) getMenuXReceiptList(params);
3758
+ });
3759
+ return {
3760
+ menuXReceiptList,
3761
+ loading,
3762
+ getMenuXReceiptList
3763
+ };
3764
+ };
3765
+ /** web打印弹出打印框 类型默认是BASE64的格式
3766
+ * type 数据源格式类型代码
3767
+ * @param [type='BASE64']
3768
+ */ function useWebPrint(content, type = constant_DATA_SOURCE_CONTENT_TYPE_CODE.BASE64) {
3769
+ // 创建隐藏的iframe
3770
+ const iframe = document.createElement("iframe");
3771
+ iframe.style.position = "fixed";
3772
+ iframe.style.right = "0";
3773
+ iframe.style.bottom = "0";
3774
+ iframe.style.width = "0";
3775
+ iframe.style.height = "0";
3776
+ iframe.style.border = "0";
3777
+ iframe.style.visibility = "hidden"; // 添加这行确保iframe完全隐藏
3778
+ document.body.appendChild(iframe);
3779
+ // 等待iframe加载完成
3780
+ iframe.onload = async ()=>{
3781
+ const iframeDoc = iframe.contentDocument || iframe.contentWindow?.document;
3782
+ // 根据类型处理内容
3783
+ if (type === constant_DATA_SOURCE_CONTENT_TYPE_CODE.H5 || type === constant_DATA_SOURCE_CONTENT_TYPE_CODE.JSON) {
3784
+ iframeDoc.body.innerHTML = content;
3785
+ return; // 不再执行打印操作
3786
+ }
3787
+ if (type === constant_DATA_SOURCE_CONTENT_TYPE_CODE.BASE64) {
3788
+ const img = new Image();
3789
+ // 处理Base64图片
3790
+ if (content.startsWith("data:image")) img.src = content;
3791
+ else // 如果不是完整的data URL,添加前缀
3792
+ img.src = `data:image/png;base64,${content}`;
3793
+ iframeDoc.body.appendChild(img);
3794
+ img.onerror = (error)=>{
3795
+ console.error("加载失败:", error);
3796
+ iframeDoc.body.innerHTML = "<p>加载失败,请检查数据</p>";
3797
+ };
3798
+ }
3799
+ /** 返回二进制文件时候的解析 */ // else if (type === "FILE") {
3800
+ // const blob = new Blob([content], { type: "application/pdf" });
3801
+ // const url = URL.createObjectURL(blob);
3802
+ // iframeDoc.body.innerHTML = `<embed src="${url}" type="application/pdf" width="100%" height="100%">`;
3803
+ // }
3804
+ await iframe.contentWindow?.focus();
3805
+ await iframe.contentWindow?.print();
3806
+ // 打印完成后移除iframe
3807
+ await document.body.removeChild(iframe);
3808
+ };
3809
+ // 最后添加到DOM
3810
+ document.body.appendChild(iframe);
3811
+ // 强制触发加载
3812
+ iframe.src = "about:blank";
3813
+ }
3814
+ /** 设计或预览 */ function useDesignAndPreview(htmlContent, title = "设计", options = {}) {
3815
+ // 创建一个容器元素
3816
+ const container = document.createElement("div");
3817
+ // 关闭弹窗的函数
3818
+ const closeDialog = ()=>{
3819
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.render)(null, container); // 卸载组件
3820
+ document.body.removeChild(container); // 移除容器
3821
+ document.head.removeChild(style); // 移除样式
3822
+ };
3823
+ // 在渲染前动态创建并插入样式
3824
+ const style = document.createElement("style");
3825
+ style.innerHTML = `
3826
+ .custom-dialog .el-dialog__headerbtn .el-icon {
3827
+ width: 48px; /* 设置图标的宽度 */
3828
+ height: 48px; /* 设置图标的高度 */
3829
+ }
3830
+ `;
3831
+ document.head.appendChild(style);
3832
+ // 使用 h 函数创建弹窗组件
3833
+ const dialog = (0, __WEBPACK_EXTERNAL_MODULE_vue__.h)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElDialog, {
3834
+ modelValue: true,
3835
+ title: title,
3836
+ width: "50%",
3837
+ onClose: ()=>{
3838
+ options.onCancel?.(); // 触发取消回调
3839
+ closeDialog();
3840
+ },
3841
+ class: "custom-dialog"
3842
+ }, {
3843
+ default: ()=>(0, __WEBPACK_EXTERNAL_MODULE_vue__.h)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElScrollbar, {
3844
+ style: {
3845
+ height: "400px",
3846
+ paddingRight: "10px"
3847
+ }
3848
+ }, ()=>(0, __WEBPACK_EXTERNAL_MODULE_vue__.h)("div", {
3849
+ style: {
3850
+ padding: "10px"
3851
+ },
3852
+ innerHTML: htmlContent
3853
+ })),
3854
+ footer: options.footer ? options.footer : ()=>(0, __WEBPACK_EXTERNAL_MODULE_vue__.h)("div", {
3855
+ class: "dialog-footer"
3856
+ }, [
3857
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.h)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElButton, {
3858
+ onClick: ()=>{
3859
+ options.onCancel?.(); // 触发取消回调
3860
+ closeDialog();
3861
+ }
3862
+ }, ()=>"取消")
3863
+ ])
3864
+ });
3865
+ // 将弹窗渲染到容器中
3866
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.render)(dialog, container);
3867
+ // 将容器添加到 body
3868
+ document.body.appendChild(container);
3869
+ }
3727
3870
  let defaultContext = {
3728
3871
  printParams: void 0,
3729
3872
  receiptInfo: void 0,
@@ -4019,7 +4162,7 @@ const printStart = async (params)=>{
4019
4162
  throw new Error("暂不支持该方式打印");
4020
4163
  }
4021
4164
  if (defaultContext?.dataSourceContentTypeCodeItem === constant_DATA_SOURCE_CONTENT_TYPE_CODE.JSON) {
4022
- const [, res] = await designPreviewPrintReceipt({
4165
+ const params = {
4023
4166
  formOperationType: defaultContext?.printParams?.formOperationType,
4024
4167
  printType: defaultContext?.printParams?.printType,
4025
4168
  receiptId: defaultContext?.printParams?.receiptId,
@@ -4028,31 +4171,25 @@ const printStart = async (params)=>{
4028
4171
  dataSourceContentTypeCode: defaultContext?.dataSourceContentTypeCodeItem,
4029
4172
  dataSourceContent: defaultContext?.dataSourceContentItem,
4030
4173
  printQty: defaultContext?.receiptInfo?.printQty
4031
- });
4032
- if (res?.success) return res.data ?? [];
4174
+ };
4175
+ /** 判断是否客户端打印 */ const { isLocalPrint } = use_app_config([
4176
+ use_app_config_MAIN_APP_CONFIG.IS_LOCAL_PRINT
4177
+ ]);
4178
+ if (isLocalPrint) {
4179
+ const [, res] = await designPreviewPrintReceipt(params);
4180
+ if (res?.success) return res.data ?? [];
4181
+ } else {
4182
+ /** 调用接口 */ const [, res] = await designPreviewPrintReceiptWeb(params);
4183
+ if (res?.success) {
4184
+ if (defaultContext?.printParams?.formOperationType === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FORM_OPERATION_TYPE.PRINT) useWebPrint(res?.data);
4185
+ else useDesignAndPreview(res?.data, defaultContext?.printParams?.formOperationType === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FORM_OPERATION_TYPE.DESIGN ? "设计" : "预览");
4186
+ }
4187
+ }
4033
4188
  }
4034
4189
  };
4035
4190
  const print = async (params)=>{
4036
4191
  await printStart(params);
4037
4192
  };
4038
- const usePrintReceipt = (params, isInit = true)=>{
4039
- const menuXReceiptList = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)([]);
4040
- const loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false);
4041
- const getMenuXReceiptList = async (params)=>{
4042
- loading.value = true;
4043
- const [, res] = await queryMenuXReceiptBySysMenuId(params);
4044
- loading.value = false;
4045
- if (res?.success) menuXReceiptList.value = res.data?.menuXReceiptList || [];
4046
- };
4047
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.onMounted)(()=>{
4048
- if (isInit) getMenuXReceiptList(params);
4049
- });
4050
- return {
4051
- menuXReceiptList,
4052
- loading,
4053
- getMenuXReceiptList
4054
- };
4055
- };
4056
4193
  /* ESM default export */ const printReceiptBtnvue_type_script_setup_true_lang_ts_name_printReceipt = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
4057
4194
  __name: 'printReceiptBtn',
4058
4195
  props: {
@@ -4748,6 +4885,8 @@ const DICT_SELECT = 'dictSelect';
4748
4885
  const _component_el_option = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-option");
4749
4886
  return 'select' === (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs).component ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveDynamicComponent)(`el-${(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs).component}`), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
4750
4887
  key: 0,
4888
+ ref_key: "componentRef",
4889
+ ref: componentRef,
4751
4890
  filterable: !!(__WEBPACK_EXTERNAL_MODULE_vue__.unref(attrs)?.filterable || __WEBPACK_EXTERNAL_MODULE_vue__.unref(attrs)?.options?.length && __WEBPACK_EXTERNAL_MODULE_vue__.unref(attrs)?.options?.length > 5) || false,
4752
4891
  clearable: true
4753
4892
  }, {
@@ -5234,6 +5373,9 @@ const access_infovue_type_script_setup_true_lang_ts_name_accessInfo_hoisted_3 =
5234
5373
  /* ESM default export */ const access_infovue_type_script_setup_true_lang_ts_name_accessInfo = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
5235
5374
  __name: 'index',
5236
5375
  props: {
5376
+ btnTitle: {
5377
+ default: "新患者"
5378
+ },
5237
5379
  code: {},
5238
5380
  menuId: {},
5239
5381
  clearBtn: {
@@ -5320,9 +5462,9 @@ const access_infovue_type_script_setup_true_lang_ts_name_accessInfo_hoisted_3 =
5320
5462
  plain: "",
5321
5463
  onClick: clearFn
5322
5464
  }, {
5323
- default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>_cache[0] || (_cache[0] = [
5324
- (0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)("新患者")
5325
- ])),
5465
+ default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
5466
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(_ctx.btnTitle), 1)
5467
+ ]),
5326
5468
  _: 1
5327
5469
  })) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true)
5328
5470
  ])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sun-biz",
3
- "version": "0.0.3-beta.5",
3
+ "version": "0.0.3-beta.6",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -56,12 +56,12 @@
56
56
  "vue": "^3.2.0"
57
57
  },
58
58
  "dependencies": {
59
- "@element-sun/icons-vue": "^1.0.5",
60
- "@sun-toolkit/enums": "1.0.0-beta.10",
61
- "@sun-toolkit/request": "1.0.0-beta.5",
62
- "@sun-toolkit/shared": "0.0.1-beta.3",
59
+ "@element-sun/icons-vue": "^1.0.6",
60
+ "@sun-toolkit/enums": "1.0.0-beta.12",
61
+ "@sun-toolkit/request": "1.0.0-beta.10",
62
+ "@sun-toolkit/shared": "0.0.1-beta.4",
63
63
  "axios": "^1.8.1",
64
- "element-sun": "0.0.0-dev.2",
64
+ "element-sun": "0.0.0-dev.4",
65
65
  "i18next": "^23.16.8",
66
66
  "i18next-vue": "^5.2.0",
67
67
  "js-pinyin": "^0.2.7",