cnhis-design-vue 3.1.54 → 3.1.55-beta.0

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 (135) hide show
  1. package/README.md +87 -87
  2. package/es/components/body-select/src/hooks/renderCanvas.js +1 -1
  3. package/es/components/body-select/src/index.vue2.js +1 -1
  4. package/es/components/button-print/index.d.ts +13 -0
  5. package/es/components/button-print/src/ButtonPrint.vue.d.ts +13 -0
  6. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  7. package/es/components/callback/src/components/render/popupMaps.d.ts +13 -6
  8. package/es/components/chat-sdk/index.d.ts +2 -0
  9. package/es/components/chat-sdk/index.js +1 -0
  10. package/es/components/chat-sdk/src/chatSDK.d.ts +24 -0
  11. package/es/components/chat-sdk/src/chatSDK.js +1 -0
  12. package/es/components/chat-sdk/src/components/recordingDialog.vue.d.ts +26 -0
  13. package/es/components/chat-sdk/src/components/recordingDialog.vue.js +1 -0
  14. package/es/components/chat-sdk/src/components/recordingDialog.vue2.js +1 -0
  15. package/es/components/chat-sdk/src/utils/recordingDialog.d.ts +8 -0
  16. package/es/components/chat-sdk/src/utils/recordingDialog.js +1 -0
  17. package/es/components/chat-sdk/style/index.css +1 -0
  18. package/es/components/classification/index.d.ts +486 -1
  19. package/es/components/classification/src/components/search-filter/index.vue.d.ts +473 -1
  20. package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
  21. package/es/components/classification/src/components/set-classification/index.vue.d.ts +473 -1
  22. package/es/components/classification/src/index.vue.d.ts +486 -1
  23. package/es/components/classification/src/index.vue2.js +1 -1
  24. package/es/components/classification/style/index.css +1 -1
  25. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  26. package/es/components/fabric-chart/index.d.ts +1 -0
  27. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +1 -0
  28. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  29. package/es/components/fabric-chart/src/constants/index.d.ts +1 -0
  30. package/es/components/fabric-chart/src/constants/index.js +1 -1
  31. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  32. package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +1 -1
  33. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
  34. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +5 -0
  35. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  36. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  37. package/es/components/fabric-chart/src/hooks/temperature/useCenter.d.ts +1 -1
  38. package/es/components/fabric-chart/src/hooks/temperature/useLeft.d.ts +1 -1
  39. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  40. package/es/components/fabric-chart/src/hooks/useCumputedPoint.d.ts +3 -3
  41. package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -1
  42. package/es/components/form-config/index.d.ts +71 -57
  43. package/es/components/form-config/src/FormConfig.vue.d.ts +71 -57
  44. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +13 -6
  45. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +28 -21
  46. package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +5 -5
  47. package/es/components/form-render/index.d.ts +13 -6
  48. package/es/components/form-render/index.js +1 -1
  49. package/es/components/form-render/src/FormRender.vue.d.ts +13 -6
  50. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  51. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +13 -6
  52. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  53. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  54. package/es/components/form-render/src/components/renderer/select.js +1 -1
  55. package/es/components/form-render/src/hooks/index.d.ts +20 -9
  56. package/es/components/form-render/src/hooks/index.js +1 -1
  57. package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +1 -1
  58. package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
  59. package/es/components/form-render/src/hooks/useFieldVisitor.js +1 -1
  60. package/es/components/form-render/src/hooks/useFormEvent.d.ts +14 -3
  61. package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
  62. package/es/components/form-render/src/hooks/useFormItemDeps.d.ts +1 -1
  63. package/es/components/form-render/src/hooks/useFormItemDeps.js +1 -1
  64. package/es/components/form-render/src/hooks/useOperationalForm.d.ts +3 -2
  65. package/es/components/form-render/src/hooks/useOperationalForm.js +1 -1
  66. package/es/components/form-render/src/hooks/useWordbookSetting.d.ts +13 -4
  67. package/es/components/form-render/src/hooks/useWordbookSetting.js +1 -1
  68. package/es/components/form-render/src/types/index.d.ts +10 -5
  69. package/es/components/iho-table/src/plugins/bindEventSettingPlugin/index.js +1 -1
  70. package/es/components/iho-table/src/plugins/operationalFormPlugin/index.js +1 -1
  71. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  72. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +7 -3
  73. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
  74. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js +1 -1
  75. package/es/components/index.css +1 -1
  76. package/es/components/index.d.ts +1 -0
  77. package/es/components/index.js +1 -1
  78. package/es/components/info-header/index.d.ts +26 -12
  79. package/es/components/info-header/src/InfoHeader.vue.d.ts +26 -12
  80. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +13 -6
  81. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +13 -6
  82. package/es/components/quick-search/style/index.css +1 -1
  83. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  84. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  85. package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
  86. package/es/components/shortcut-setter/index.d.ts +18 -11
  87. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +18 -11
  88. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
  89. package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +320 -0
  90. package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.js +1 -0
  91. package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue2.js +1 -0
  92. package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +127 -0
  93. package/es/components/table-filter/src/components/bi-filter/components/Date.vue.js +1 -0
  94. package/es/components/table-filter/src/components/bi-filter/components/Date.vue2.js +1 -0
  95. package/es/components/table-filter/src/components/bi-filter/components/InputFilter.vue.d.ts +41 -0
  96. package/es/components/table-filter/src/components/bi-filter/components/InputFilter.vue.js +1 -0
  97. package/es/components/table-filter/src/components/bi-filter/components/InputFilter.vue2.js +1 -0
  98. package/es/components/table-filter/src/components/bi-filter/components/InputNumber.vue.d.ts +28 -0
  99. package/es/components/table-filter/src/components/bi-filter/components/InputNumber.vue.js +1 -0
  100. package/es/components/table-filter/src/components/bi-filter/components/InputNumber.vue2.js +1 -0
  101. package/es/components/table-filter/src/components/bi-filter/components/SelectFilter.vue.d.ts +51 -0
  102. package/es/components/table-filter/src/components/bi-filter/components/SelectFilter.vue.js +1 -0
  103. package/es/components/table-filter/src/components/bi-filter/components/SelectFilter.vue2.js +1 -0
  104. package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +244 -0
  105. package/es/components/table-filter/src/components/bi-filter/components/index.js +1 -0
  106. package/es/components/table-filter/src/components/bi-filter/helpers/options.d.ts +14 -0
  107. package/es/components/table-filter/src/components/bi-filter/helpers/options.js +1 -0
  108. package/es/components/table-filter/src/components/bi-filter/hooks/useBiConditions.d.ts +13 -0
  109. package/es/components/table-filter/src/components/bi-filter/hooks/useBiConditions.js +1 -0
  110. package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +474 -0
  111. package/es/components/table-filter/src/components/bi-filter/index.vue.js +1 -0
  112. package/es/components/table-filter/src/components/bi-filter/index.vue2.js +1 -0
  113. package/es/components/table-filter/src/constants/index.d.ts +1 -0
  114. package/es/components/table-filter/src/constants/index.js +1 -1
  115. package/es/env.d.ts +25 -25
  116. package/es/shared/assets/img/failure.png.js +1 -1
  117. package/es/shared/assets/img/no-permission.png.js +1 -1
  118. package/es/shared/assets/img/nodata.png.js +1 -1
  119. package/es/shared/assets/img/notfound.png.js +1 -1
  120. package/es/shared/assets/img/qr.png.js +1 -1
  121. package/es/shared/assets/img/success.png.js +1 -1
  122. package/es/shared/assets/img/video.png.js +1 -1
  123. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  124. package/es/shared/assets/img/xb_big.png.js +1 -1
  125. package/es/shared/assets/img/xb_small.png.js +1 -1
  126. package/es/shared/package.json.js +1 -1
  127. package/es/shared/utils/business.js +1 -1
  128. package/package.json +3 -2
  129. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  130. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  131. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  132. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  133. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  134. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  135. package/es/shared/utils/tapable/index.d.ts +0 -139
package/README.md CHANGED
@@ -1,87 +1,87 @@
1
- # 安装
2
-
3
- ```shell
4
- npm i cnhis-design-vue@[版本号]
5
- # or
6
- yarn add cnhis-design-vue@[版本号] #推荐
7
- ```
8
-
9
- ## 1.全局引入
10
-
11
- ```typescript
12
- // main.ts
13
- import { createApp } from 'vue';
14
- import App from './App.vue';
15
- import 'cnhis-design-vue/es/packages/index.css';
16
- import cui from 'cnhis-design-vue';
17
-
18
- const app = createApp(App);
19
- app.use(cui).mount('#app');
20
- ```
21
-
22
- ## 2. 按需引入
23
-
24
- 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
-
26
- ### 2.1 样式处理方式1 (按需引入样式)
27
-
28
- ```shell
29
- # 安装自动导入样式的插件
30
- npm i -d vite-plugin-style-import
31
- ```
32
-
33
- ```typescript
34
- // vite.config.ts
35
- import { defineConfig } from 'vite';
36
- import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
-
38
- export default defineConfig({
39
- plugins: [
40
- // ...otherPlugins
41
- createStyleImportPlugin({
42
- libs: [
43
- {
44
- libraryName: 'cnhis-design-vue',
45
- esModule: true,
46
- ensureStyleFile: true,
47
- resolveStyle: name => {
48
- return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
- }
50
- }
51
- ]
52
- })
53
- ]
54
- });
55
- ```
56
-
57
- ### 2.2 样式处理方式2 (全局引入样式)
58
-
59
- ```typescript
60
- // main.ts
61
- import 'cnhis-design-vue/es/components/index.css';
62
- ```
63
-
64
- ## 3.FAQ
65
-
66
- ### 3.1 项目打包后样式丢失
67
-
68
- 处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
69
-
70
- ```typescript
71
- // vite.config.ts
72
- import { defineConfig } from 'vite';
73
-
74
- export default defineConfig({
75
- build: {
76
- rollupOptions: {
77
- // ..otherOptions
78
- output: {
79
- dir: './dist',
80
- manualChunks: {
81
- 'cnhis-vendor': ['cnhis-design-vue']
82
- }
83
- }
84
- }
85
- }
86
- });
87
- ```
1
+ # 安装
2
+
3
+ ```shell
4
+ npm i cnhis-design-vue@[版本号]
5
+ # or
6
+ yarn add cnhis-design-vue@[版本号] #推荐
7
+ ```
8
+
9
+ ## 1.全局引入
10
+
11
+ ```typescript
12
+ // main.ts
13
+ import { createApp } from 'vue';
14
+ import App from './App.vue';
15
+ import 'cnhis-design-vue/es/packages/index.css';
16
+ import cui from 'cnhis-design-vue';
17
+
18
+ const app = createApp(App);
19
+ app.use(cui).mount('#app');
20
+ ```
21
+
22
+ ## 2. 按需引入
23
+
24
+ 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
+
26
+ ### 2.1 样式处理方式1 (按需引入样式)
27
+
28
+ ```shell
29
+ # 安装自动导入样式的插件
30
+ npm i -d vite-plugin-style-import
31
+ ```
32
+
33
+ ```typescript
34
+ // vite.config.ts
35
+ import { defineConfig } from 'vite';
36
+ import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
+
38
+ export default defineConfig({
39
+ plugins: [
40
+ // ...otherPlugins
41
+ createStyleImportPlugin({
42
+ libs: [
43
+ {
44
+ libraryName: 'cnhis-design-vue',
45
+ esModule: true,
46
+ ensureStyleFile: true,
47
+ resolveStyle: name => {
48
+ return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
+ }
50
+ }
51
+ ]
52
+ })
53
+ ]
54
+ });
55
+ ```
56
+
57
+ ### 2.2 样式处理方式2 (全局引入样式)
58
+
59
+ ```typescript
60
+ // main.ts
61
+ import 'cnhis-design-vue/es/components/index.css';
62
+ ```
63
+
64
+ ## 3.FAQ
65
+
66
+ ### 3.1 项目打包后样式丢失
67
+
68
+ 处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
69
+
70
+ ```typescript
71
+ // vite.config.ts
72
+ import { defineConfig } from 'vite';
73
+
74
+ export default defineConfig({
75
+ build: {
76
+ rollupOptions: {
77
+ // ..otherOptions
78
+ output: {
79
+ dir: './dist',
80
+ manualChunks: {
81
+ 'cnhis-vendor': ['cnhis-design-vue']
82
+ }
83
+ }
84
+ }
85
+ }
86
+ });
87
+ ```
@@ -1 +1 @@
1
- import{ref as e}from"vue";import{fabric as t}from"../../../../shared/utils/fabricjs/index.js";function o(o,n,r,{props:l,emits:s}){const c=e({});return function(){if(o){const e=[];Object.keys(n).forEach((o=>{!function(e,o){const n=new t.Path(o,{fill:"",stroke:"#333",strokeWidth:2,hoverCursor:"default",evented:!0,selectable:!1,name:e});n.isSelectMode=!1,c.value[e]=n}(o,n[o]),e.push(c.value[o])}));const u=new t.Group(e,{originX:"left",originY:"top",left:0,scaleX:r,scaleY:r,evented:!0,selectable:!1,hoverCursor:"default",subTargetCheck:!0});return u.forEachObject((e=>{e.on("mouseover",(function(){e.set("fill",l.fillColor),o.renderAll()})),e.on("mouseout",(function(){e.isSelectMode||(e.set("fill",""),o.renderAll())})),e.on("mousedown",(function(){const t=!e.isSelectMode;s("select",e.name,t)}))})),o.add(u),o.centerObject(u),{canvas:o,data:c.value}}return null}()}export{o as default};
1
+ import{ref as e}from"vue";import{fabric as t}from"../../../../shared/utils/fabricjs/index.js";function o(o,n,r,{props:s,emits:l}){const u=e({});return function(){if(o){const e=[];Object.keys(n).forEach((o=>{!function(e,o){const n=new t.Path(o,{fill:"",stroke:"#333",strokeWidth:2,hoverCursor:"default",evented:!0,selectable:!1,name:e});n.isSelectMode=!1,u.value[e]=n}(o,n[o]),e.push(u.value[o])}));const c=new t.Group(e,{originX:"left",originY:"top",left:0,scaleX:r,scaleY:r,evented:!0,selectable:!1,hoverCursor:"default",subTargetCheck:!0});return c.forEachObject((e=>{e.on("mouseover",(function(){e.set("fill",s.fillColor),o.requestRenderAll()})),e.on("mouseout",(function(){e.isSelectMode||(e.set("fill",""),o.requestRenderAll())})),e.on("mousedown",(function(){const t=!e.isSelectMode;l("select",e.name,t)}))})),o.add(c),o.centerObject(c),{canvas:o,data:u.value}}return null}()}export{o as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as a,watch as l,onMounted as s,onBeforeUnmount as t,openBlock as n,createElementBlock as c,createElementVNode as o}from"vue";import{isObject as r}from"lodash-es";import{fabric as i}from"../../../shared/utils/fabricjs/index.js";import{frontCanvasParams as u,palmCanvasParams as v,backCanvasParams as f}from"./config/index.js";import d from"./hooks/renderCanvas.js";const m={class:"c-body-select"},p={class:"canvas-module"},h=o("span",null,"正面",-1),g={class:"canvas-module"},b=o("span",null,"手",-1),k={class:"canvas-module"},j=o("span",null,"背面",-1);var y=e({__name:"index",props:{setting:{type:Object,default:()=>({})},fillColor:{type:String,default:"#E5E5E5"},canvasWidth:{type:Number,default:920}},emits:["select"],setup(e,{emit:y}){const w=e,C=a(null),O=a(),S=a(null),x=a(),E=a(null),_=a(),R=a([]),F=Number((w.canvasWidth/920).toFixed(2));function M(e,a){R.value.forEach((l=>{const s=l.data,t=Object.keys(s),n=Object.keys(e);t.forEach((l=>{a&&a(s,l),s[l].set("fill",""),s[l].set("isSelectMode",!1),n.includes(l)&&e[l]&&(s[l].set("fill",w.fillColor),s[l].set("isSelectMode",!0))})),l.canvas.renderAll()}))}return l((()=>w.setting),(e=>{e&&r(e)&&M(e)}),{deep:!0}),s((async()=>{const e={props:w,emits:y};O.value=new i.Canvas(C.value,{width:360*F,height:700*F,backgroundColor:"#fff",selection:!1,preserveObjectStacking:!0}),_.value=new i.Canvas(E.value,{width:200*F,height:150*F,backgroundColor:"#fff",selection:!1,preserveObjectStacking:!0}),x.value=new i.Canvas(S.value,{width:360*F,height:700*F,backgroundColor:"#fff",selection:!1,preserveObjectStacking:!0});const a=await d(O.value,u,F,e),l=await d(_.value,v,F,e),s=await d(x.value,f,F,e);a&&s&&l&&(R.value=[a,l,s],M(w.setting,((e,a)=>{["1","4","8","22","18"].includes(a)&&e[a].moveTo(100)})))})),t((()=>{O.value.clear(),x.value.clear(),_.value.clear()})),(e,a)=>(n(),c("div",m,[o("div",p,[o("canvas",{ref_key:"canvasFrontRef",ref:C},null,512),h]),o("div",g,[o("canvas",{ref_key:"canvasPalmsRef",ref:E},null,512),b]),o("div",k,[o("canvas",{ref_key:"canvasBackRef",ref:S},null,512),j])]))}});export{y as default};
1
+ import{defineComponent as e,ref as a,watch as l,onMounted as s,onBeforeUnmount as t,openBlock as n,createElementBlock as c,createElementVNode as o}from"vue";import{isObject as r}from"lodash-es";import{fabric as i}from"../../../shared/utils/fabricjs/index.js";import{frontCanvasParams as u,palmCanvasParams as v,backCanvasParams as f}from"./config/index.js";import d from"./hooks/renderCanvas.js";const m={class:"c-body-select"},p={class:"canvas-module"},h=o("span",null,"正面",-1),g={class:"canvas-module"},b=o("span",null,"手",-1),k={class:"canvas-module"},j=o("span",null,"背面",-1);var y=e({__name:"index",props:{setting:{type:Object,default:()=>({})},fillColor:{type:String,default:"#E5E5E5"},canvasWidth:{type:Number,default:920}},emits:["select"],setup(e,{emit:y}){const w=e,C=a(null),O=a(),S=a(null),x=a(),E=a(null),_=a(),R=a([]),F=Number((w.canvasWidth/920).toFixed(2));function M(e,a){R.value.forEach((l=>{const s=l.data,t=Object.keys(s),n=Object.keys(e);t.forEach((l=>{a&&a(s,l),s[l].set("fill",""),s[l].set("isSelectMode",!1),n.includes(l)&&e[l]&&(s[l].set("fill",w.fillColor),s[l].set("isSelectMode",!0))})),l.canvas.requestRenderAll()}))}return l((()=>w.setting),(e=>{e&&r(e)&&M(e)}),{deep:!0}),s((async()=>{const e={props:w,emits:y};O.value=new i.Canvas(C.value,{width:360*F,height:700*F,backgroundColor:"#fff",selection:!1,preserveObjectStacking:!0}),_.value=new i.Canvas(E.value,{width:200*F,height:150*F,backgroundColor:"#fff",selection:!1,preserveObjectStacking:!0}),x.value=new i.Canvas(S.value,{width:360*F,height:700*F,backgroundColor:"#fff",selection:!1,preserveObjectStacking:!0});const a=await d(O.value,u,F,e),l=await d(_.value,v,F,e),s=await d(x.value,f,F,e);a&&s&&l&&(R.value=[a,l,s],M(w.setting,((e,a)=>{["1","4","8","22","18"].includes(a)&&e[a].moveTo(100)})))})),t((()=>{O.value.clear(),x.value.clear(),_.value.clear()})),(e,a)=>(n(),c("div",m,[o("div",p,[o("canvas",{ref_key:"canvasFrontRef",ref:C},null,512),h]),o("div",g,[o("canvas",{ref_key:"canvasPalmsRef",ref:E},null,512),b]),o("div",k,[o("canvas",{ref_key:"canvasBackRef",ref:S},null,512),j])]))}});export{y as default};
@@ -78,6 +78,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
78
78
  signature: {
79
79
  type: StringConstructor;
80
80
  };
81
+ showLoading: {
82
+ type: BooleanConstructor;
83
+ default: boolean;
84
+ };
81
85
  }, {
82
86
  $message: import("naive-ui").MessageApi;
83
87
  printInstance: import("./src/utils").Print | null;
@@ -158,6 +162,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
158
162
  signature: {
159
163
  type: StringConstructor;
160
164
  };
165
+ showLoading: {
166
+ type: BooleanConstructor;
167
+ default: boolean;
168
+ };
161
169
  }>> & {
162
170
  onError?: ((...args: any[]) => any) | undefined;
163
171
  onSuccess?: ((...args: any[]) => any) | undefined;
@@ -1923,6 +1931,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
1923
1931
  signature: {
1924
1932
  type: StringConstructor;
1925
1933
  };
1934
+ showLoading: {
1935
+ type: BooleanConstructor;
1936
+ default: boolean;
1937
+ };
1926
1938
  }>> & {
1927
1939
  onError?: ((...args: any[]) => any) | undefined;
1928
1940
  onSuccess?: ((...args: any[]) => any) | undefined;
@@ -1947,5 +1959,6 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
1947
1959
  options: import("../../../es/shared/types").AnyObject[];
1948
1960
  onSelect: (key: string | number, option: import("../../../es/shared/types").AnyObject) => void;
1949
1961
  }>;
1962
+ showLoading: boolean;
1950
1963
  }>>;
1951
1964
  export default ButtonPrint;
@@ -82,6 +82,10 @@ declare const _default: import("vue").DefineComponent<{
82
82
  signature: {
83
83
  type: StringConstructor;
84
84
  };
85
+ showLoading: {
86
+ type: BooleanConstructor;
87
+ default: boolean;
88
+ };
85
89
  }, {
86
90
  $message: import("naive-ui").MessageApi;
87
91
  printInstance: Print | null;
@@ -165,6 +169,10 @@ declare const _default: import("vue").DefineComponent<{
165
169
  signature: {
166
170
  type: StringConstructor;
167
171
  };
172
+ showLoading: {
173
+ type: BooleanConstructor;
174
+ default: boolean;
175
+ };
168
176
  }>> & {
169
177
  onError?: ((...args: any[]) => any) | undefined;
170
178
  onSuccess?: ((...args: any[]) => any) | undefined;
@@ -1933,6 +1941,10 @@ declare const _default: import("vue").DefineComponent<{
1933
1941
  signature: {
1934
1942
  type: StringConstructor;
1935
1943
  };
1944
+ showLoading: {
1945
+ type: BooleanConstructor;
1946
+ default: boolean;
1947
+ };
1936
1948
  }>> & {
1937
1949
  onError?: ((...args: any[]) => any) | undefined;
1938
1950
  onSuccess?: ((...args: any[]) => any) | undefined;
@@ -1957,5 +1969,6 @@ declare const _default: import("vue").DefineComponent<{
1957
1969
  options: AnyObject[];
1958
1970
  onSelect: (key: string | number, option: AnyObject) => void;
1959
1971
  }>;
1972
+ showLoading: boolean;
1960
1973
  }>;
1961
1974
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as t,reactive as e,computed as r,onMounted as a,watch as n,openBlock as i,createElementBlock as s,Fragment as o,createVNode as l,unref as m,withCtx as p,renderSlot as d,withModifiers as u,createTextVNode as c,toDisplayString as f,mergeProps as v}from"vue";import{isObject as y}from"@vue/shared";import{useMessage as b,NDropdown as g,NButton as I,NIcon as P}from"naive-ui";import{ChevronDown as w}from"@vicons/ionicons5";import{Print as h}from"./utils/print.js";import{isIReport as F}from"./utils/browserPrint.js";import k from"./components/IdentityVerification.vue.js";import{format as T}from"date-fns";import{savePrivateFormatApi as x,getPrivateFormatApi as S}from"./api.js";var D=t({__name:"ButtonPrint",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:"打印",type:String},printText:{default:"直接打印",type:String},previewText:{default:"打印预览",type:String},pdfLoadText:{default:"下载pdf",type:String},formatEditText:{default:"格式编辑",type:String},prevFn:{default:()=>Promise.resolve(),type:Function},queryPrintFormatByNumber:{default:()=>Promise.resolve({}),type:Function},queryTemplateParams:{default:()=>Promise.resolve({}),type:Function},strategy:{default:"MULTI",type:String},clickPrevFn:{default:()=>Promise.resolve(!0),type:Function},noDataMsg:{default:"请选中需要打印的数据",type:String},token:{type:String},printdlgshow:{default:"0",type:String},btnprint:{type:String,default:"1"},directPrint:{type:Boolean,default:!1},externalOptionConfig:{type:Object,default:()=>({})},signature:{type:String}},emits:["success","error","clickoutside"],setup(t,{expose:D,emit:O}){var j;const E=t,L=b();let M;const N={},V=e({spinning:!1,visible:!1,formatList:[],templateParams:{},printParams:[],currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null}),C=e([{label:E.printText,key:"printText"},{label:E.previewText,key:"previewText"},{label:E.pdfLoadText,key:"downloadPdf"},{label:E.formatEditText,key:"formatEditText"},...(null==(j=E.externalOptionConfig)?void 0:j.options)||[]]),Y=r((()=>{if(!V.currentFormatId)return{};let t=V.currentFormatId;return V.formatList.find((e=>e.id===t))})),J=r((()=>{var t;return(null==(t=Y.value)?void 0:t.name)||"格式选择"})),U=r((()=>{let t=V.formatList.find((t=>t.id===V.currentFormatId));return null==t?void 0:t.templateId})),A=async t=>{if(E.directPrint){if(V.spinning)return;return"button"===t?void await nt():et()}return et()},B=t=>l("span",{class:{active:t.key===V.currentFormatId}},[t.label]),q=(t,e)=>{let r={type:e,formatId:V.currentFormatId,templateId:U.value};O("success",t,r)},R=t=>{O("error",t),y(t)&&"notInstalledApp"===t.type&&L.error(t.message)},_=t=>{O("error",{message:"前置条件执行错误",type:t,preExecution:!0})},z=(t=0)=>{var e;const r=(null==(e=E.printParams)?void 0:e.length)?E.printParams[t]:V.printParams[t];return JSON.stringify({...r||{},...E.token?{token:E.token}:{}})},H=()=>{var t,e;let r={},a={};if(null==(t=V.templateParams.customizeDataset)?void 0:t.length){const t=(null==(e=Object.keys(V.printParams[0].datasetData||{}))?void 0:e[0])||"",r=JSON.stringify(V.printParams.map((e=>JSON.parse(e.datasetData[t]))));a={datasetData:{}},a.datasetData[t]=r}else Object.keys(V.printParams[0]).forEach((t=>{a[t]=[],V.printParams.forEach((e=>{a[t].push(e[t])})),a[t]=a[t].join(",")}));return r=Object.assign({},JSON.parse(z(0)),a),JSON.stringify(r)},$=()=>{let t=V.printParams.length;const e=async e=>{try{--t<=0&&q(e,"print")}catch(t){console.log("error",t)}};E.prevFn("print").then((()=>{const t={formatId:V.currentFormatId,templateId:U.value,printdlgshow:E.printdlgshow,signature:E.signature};if("MULTI"===E.strategy)for(let r=0;r<V.printParams.length;r++)r>0&&(t.printdlgshow="0"),M.printDirect({...t,params:z(r)},e,R);else M.printDirect({...t,params:H()},(t=>{q(t,"print")}),R)})).catch((()=>{_("print")})).finally((()=>{V.visible=!1}))},G=async(t,e)=>{var r,a;switch(t){case"printText":$();break;case"previewText":(async()=>{E.prevFn("preview").then((()=>{const t="MULTI"===E.strategy?z():H(),e={formatId:V.currentFormatId,templateId:U.value,params:t,btnprint:E.btnprint,signature:E.signature};M.preview(e,(t=>{q(t,"preview")}),R)})).catch((()=>{_("preview")})).finally((()=>{V.visible=!1}))})();break;case"formatEditText":E.prevFn("edit").then((()=>{V.identityVerification.visible=!0})).catch((()=>{_("edit")})).finally((()=>{V.visible=!1}));break;case"downloadPdf":(async()=>{E.prevFn("download").then((()=>{const t="MULTI"===E.strategy?z():H(),e={formatId:V.currentFormatId,templateId:U.value,print:{print:"1",type:"1"},params:t,signature:E.signature};M.downloadPDF(e,(t=>q(t,"preview")),R)})).catch((()=>{_("download")})).finally((()=>{V.visible=!1}))})();break;default:{V.visible=!1;const n=V.formatList.find((e=>e.id===t))||{};if(Object.keys(n).length>0){V.currentFormatId=t;const[e]=C;e.label=(null==n?void 0:n.name)||e.label,await x({formatForms:[{...n}],name:N.name||n.templateName,number:N.number||n.number,templateId:N.templateId||n.templateId,...N.id?{id:N.id}:{}},{token:E.token})}else null==(a=null==(r=E.externalOptionConfig)?void 0:r.onSelect)||a.call(r,t,e);break}}},K=()=>{V.visible=!1,O("clickoutside")},Q=()=>(V.isInited=!1,V.spinning=!1,setTimeout((()=>{V.visible=!1}),0),!1),W=(t,e,r)=>{const a={};return e.forEach((e=>{let n=((t,e)=>{const r={DATE:"YYYY-MM-DD",DATETIME:"YYYY-MM-DD HH:mm:ss"};let a=e;return Object.keys(r).includes(t.type)&&e&&(a=T(e,r[t.type])),(null==t?void 0:t.defaultValue)||a})(e,t[e[r]]);t[e[r]]&&n&&(a[e[r]]=n)})),a},X=({customizeDataset:t=[],param:e=[]},r=[])=>r.map((r=>{let a={};return t.forEach((t=>{const e=t.dataSetting[0].selectFieldList;a.datasetData={[t.name]:JSON.stringify(W(r,e,"fieldName"))}})),a=Object.assign({},a,W(r,e,"key")),a})),Z=async t=>{var e;if(V.formatList=t?(t=>{let e=[];return t&&t.forEach((t=>{if(!t.format)return!1;e.push(...t.format.map((e=>Object.assign({},e,{templateName:t.name}))))})),e})(t.obj):[],V.currentFormatId=await(async(t,e)=>{var r;if(!(null==t?void 0:t.length))return"";const{data:a}=await S({templateId:t[0].templateId},{token:E.token});if("SUCCESS"===a.result){const{formatForms:e=[]}=a.map||{};Object.assign(N,a.map||{});const n=null==(r=null==e?void 0:e[0])?void 0:r.id;if(n&&t.map((t=>t.id)).includes(n))return n}const n=t.find((t=>1==t[e]));return(null==n?void 0:n.id)||t[0].id})(V.formatList,"defaultFlag"),!V.currentFormatId)return L.error("获取打印格式失败,请联系管理员!"),Q();(()=>{const t=V.formatList.map((t=>({label:t.name,key:t.id})));C.unshift({label:J.value,key:"format",children:t})})();let r=null==(e=await E.queryTemplateParams())?void 0:e.obj;if(!r||!U.value)return L.error("获取打印模板失败,请联系管理员!"),Q();V.templateParams=r,V.printParams=X(V.templateParams,E.params)},tt=async()=>{if(V.isInited)return!0;V.isInited=!0,V.spinning=!0,(()=>{if(M)return!1;M=new h})();const t=await E.queryPrintFormatByNumber();return await Z(t),V.spinning=!1,!0},et=async(t=!0)=>{var e;if(await E.clickPrevFn())if(null==(e=E.params)?void 0:e.length){if(!V.visible){if(!await tt())return!1}t&&(V.visible=!V.visible)}else L.warning(E.noDataMsg)},rt=()=>{V.watchPrintParamsReformatFn&&V.watchPrintParamsReformatFn(),V.isInited?V.printParams=X(V.templateParams,E.params):V.watchPrintParamsReformatFn=()=>n((()=>V.isInited),(t=>{if(!t)return!1;rt()}))},at=t=>{if(V.identityVerification.visible=!1,F(V.currentFormatId))return q(null,"edit");const e={formatId:V.currentFormatId,templateId:U.value,params:z(),token:t};M.editPrintFormat(e,(t=>{q(t,"edit")}),R)};async function nt(){await et(!1),$()}return a((()=>{V.isInited=!1})),n((()=>E.params),(t=>{if(!(null==t?void 0:t.length))return!1;rt()}),{deep:!0}),D({directPrint:nt}),(e,r)=>(i(),s(o,null,[l(m(g),{class:"c-dropdown",placement:"bottom-start",trigger:"click",show:V.visible,onClickoutside:K,options:C,onSelect:G,"render-label":B},{default:p((()=>[d(e.$slots,"button",{handleClickPrintBtn:et,printSpinning:V.spinning,printbtnText:t.btnText,printVisible:V.visible},(()=>[l(m(I),{class:"dropdown-button",onClick:r[1]||(r[1]=u((()=>A("button")),["stop"]))},{default:p((()=>[c(f(t.btnText)+" ",1),l(m(P),{component:m(w),style:{"margin-left":"5px"},onClick:r[0]||(r[0]=u((()=>A("icon")),["stop"]))},null,8,["component"])])),_:1})]))])),_:3},8,["show","options"]),l(k,v(e.$attrs,{modelValue:V.identityVerification.visible,"onUpdate:modelValue":r[2]||(r[2]=t=>V.identityVerification.visible=t),formatId:V.currentFormatId,templateId:m(U),onSuccess:at}),null,16,["modelValue","formatId","templateId"])],64))}});export{D as default};
1
+ import{defineComponent as t,reactive as e,computed as n,onMounted as i,watch as r,openBlock as a,createElementBlock as s,Fragment as o,createVNode as l,unref as p,withCtx as d,renderSlot as m,withModifiers as u,createTextVNode as c,toDisplayString as f,mergeProps as g}from"vue";import{isObject as v}from"@vue/shared";import{useMessage as y,NDropdown as b,NButton as I,NIcon as P}from"naive-ui";import{ChevronDown as h}from"@vicons/ionicons5";import{Print as w}from"./utils/print.js";import{isIReport as F}from"./utils/browserPrint.js";import k from"./components/IdentityVerification.vue.js";import{format as T}from"date-fns";import{savePrivateFormatApi as x,getPrivateFormatApi as S}from"./api.js";var L=t({__name:"ButtonPrint",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:"打印",type:String},printText:{default:"直接打印",type:String},previewText:{default:"打印预览",type:String},pdfLoadText:{default:"下载pdf",type:String},formatEditText:{default:"格式编辑",type:String},prevFn:{default:()=>Promise.resolve(),type:Function},queryPrintFormatByNumber:{default:()=>Promise.resolve({}),type:Function},queryTemplateParams:{default:()=>Promise.resolve({}),type:Function},strategy:{default:"MULTI",type:String},clickPrevFn:{default:()=>Promise.resolve(!0),type:Function},noDataMsg:{default:"请选中需要打印的数据",type:String},token:{type:String},printdlgshow:{default:"0",type:String},btnprint:{type:String,default:"1"},directPrint:{type:Boolean,default:!1},externalOptionConfig:{type:Object,default:()=>({})},signature:{type:String},showLoading:{type:Boolean,default:!0}},emits:["success","error","clickoutside"],setup(t,{expose:L,emit:D}){var O;const j=t,E=y();let M;const N={},V=e({spinning:!1,visible:!1,formatList:[],templateParams:{},printParams:[],currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null}),C=e([{label:j.printText,key:"printText"},{label:j.previewText,key:"previewText"},{label:j.pdfLoadText,key:"downloadPdf"},{label:j.formatEditText,key:"formatEditText"},...(null==(O=j.externalOptionConfig)?void 0:O.options)||[]]),Y=n((()=>{if(!V.currentFormatId)return{};let t=V.currentFormatId;return V.formatList.find((e=>e.id===t))})),B=n((()=>{var t;return(null==(t=Y.value)?void 0:t.name)||"格式选择"})),J=n((()=>{let t=V.formatList.find((t=>t.id===V.currentFormatId));return null==t?void 0:t.templateId})),U=async t=>{if(j.directPrint){if(V.spinning)return;return"button"===t?void await rt():et()}return et()},A=t=>l("span",{class:{active:t.key===V.currentFormatId}},[t.label]),q=(t,e)=>{V.spinning=!1;let n={type:e,formatId:V.currentFormatId,templateId:J.value};D("success",t,n)},R=t=>{V.spinning=!1,D("error",t),v(t)&&"notInstalledApp"===t.type&&E.error(t.message)},_=t=>{D("error",{message:"前置条件执行错误",type:t,preExecution:!0})},z=(t=0)=>{var e;const n=(null==(e=j.printParams)?void 0:e.length)?j.printParams[t]:V.printParams[t];return JSON.stringify({...n||{},...j.token?{token:j.token}:{}})},H=()=>{var t,e;let n={},i={};if(null==(t=V.templateParams.customizeDataset)?void 0:t.length){const t=(null==(e=Object.keys(V.printParams[0].datasetData||{}))?void 0:e[0])||"",n=JSON.stringify(V.printParams.map((e=>JSON.parse(e.datasetData[t]))));i={datasetData:{}},i.datasetData[t]=n}else Object.keys(V.printParams[0]).forEach((t=>{i[t]=[],V.printParams.forEach((e=>{i[t].push(e[t])})),i[t]=i[t].join(",")}));return n=Object.assign({},JSON.parse(z(0)),i),JSON.stringify(n)},$=()=>{let t=V.printParams.length;const e=async e=>{try{--t<=0&&q(e,"print")}catch(t){console.log("error",t)}};j.showLoading&&V.spinning||(V.spinning=!0,j.prevFn("print").then((()=>{const t={formatId:V.currentFormatId,templateId:J.value,printdlgshow:j.printdlgshow,signature:j.signature};if("MULTI"===j.strategy)for(let n=0;n<V.printParams.length;n++)n>0&&(t.printdlgshow="0"),M.printDirect({...t,params:z(n)},e,R);else M.printDirect({...t,params:H()},(t=>{q(t,"print")}),R)})).catch((()=>{_("print"),V.spinning=!1})).finally((()=>{V.visible=!1})))},G=async(t,e)=>{var n,i;switch(t){case"printText":$();break;case"previewText":(async()=>{j.showLoading&&V.spinning||(V.spinning=!0,j.prevFn("preview").then((()=>{const t="MULTI"===j.strategy?z():H(),e={formatId:V.currentFormatId,templateId:J.value,params:t,btnprint:j.btnprint,signature:j.signature};M.preview(e,(t=>{q(t,"preview")}),R)})).catch((()=>{_("preview"),V.spinning=!1})).finally((()=>{V.visible=!1})))})();break;case"formatEditText":j.showLoading&&V.spinning||(V.spinning=!0,j.prevFn("edit").then((()=>{V.identityVerification.visible=!0})).catch((()=>{_("edit")})).finally((()=>{V.visible=!1,V.spinning=!1})));break;case"downloadPdf":(async()=>{j.showLoading&&V.spinning||(V.spinning=!0,j.prevFn("download").then((()=>{const t="MULTI"===j.strategy?z():H(),e={formatId:V.currentFormatId,templateId:J.value,print:{print:"1",type:"1"},params:t,signature:j.signature};M.downloadPDF(e,(t=>q(t,"preview")),R)})).catch((()=>{_("download"),V.spinning=!1})).finally((()=>{V.visible=!1})))})();break;default:{V.visible=!1;const r=V.formatList.find((e=>e.id===t))||{};if(Object.keys(r).length>0){V.currentFormatId=t;const[e]=C;e.label=(null==r?void 0:r.name)||e.label,await x({formatForms:[{...r}],name:N.name||r.templateName,number:N.number||r.number,templateId:N.templateId||r.templateId,...N.id?{id:N.id}:{}},{token:j.token})}else null==(i=null==(n=j.externalOptionConfig)?void 0:n.onSelect)||i.call(n,t,e);break}}},K=()=>{V.visible=!1,D("clickoutside")},Q=()=>(V.isInited=!1,V.spinning=!1,setTimeout((()=>{V.visible=!1}),0),!1),W=(t,e,n)=>{const i={};return e.forEach((e=>{let r=((t,e)=>{const n={DATE:"YYYY-MM-DD",DATETIME:"YYYY-MM-DD HH:mm:ss"};let i=e;return Object.keys(n).includes(t.type)&&e&&(i=T(e,n[t.type])),(null==t?void 0:t.defaultValue)||i})(e,t[e[n]]);t[e[n]]&&r&&(i[e[n]]=r)})),i},X=({customizeDataset:t=[],param:e=[]},n=[])=>n.map((n=>{let i={};return t.forEach((t=>{const e=t.dataSetting[0].selectFieldList;i.datasetData={[t.name]:JSON.stringify(W(n,e,"fieldName"))}})),i=Object.assign({},i,W(n,e,"key")),i})),Z=async t=>{var e;if(V.formatList=t?(t=>{let e=[];return t&&t.forEach((t=>{if(!t.format)return!1;e.push(...t.format.map((e=>Object.assign({},e,{templateName:t.name}))))})),e})(t.obj):[],V.currentFormatId=await(async(t,e)=>{var n;if(!(null==t?void 0:t.length))return"";const{data:i}=await S({templateId:t[0].templateId},{token:j.token});if("SUCCESS"===i.result){const{formatForms:e=[]}=i.map||{};Object.assign(N,i.map||{});const r=null==(n=null==e?void 0:e[0])?void 0:n.id;if(r&&t.map((t=>t.id)).includes(r))return r}const r=t.find((t=>1==t[e]));return(null==r?void 0:r.id)||t[0].id})(V.formatList,"defaultFlag"),!V.currentFormatId)return E.error("获取打印格式失败,请联系管理员!"),Q();(()=>{const t=V.formatList.map((t=>({label:t.name,key:t.id})));C.unshift({label:B.value,key:"format",children:t})})();let n=null==(e=await j.queryTemplateParams())?void 0:e.obj;if(!n||!J.value)return E.error("获取打印模板失败,请联系管理员!"),Q();V.templateParams=n,V.printParams=X(V.templateParams,j.params)},tt=async()=>{if(V.isInited)return!0;V.isInited=!0,V.spinning=!0,(()=>{if(M)return!1;M=new w})();const t=await j.queryPrintFormatByNumber();return await Z(t),V.spinning=!1,!0},et=async(t=!0)=>{var e,n;if(await j.clickPrevFn())if((null==(e=j.params)?void 0:e.length)&&(null==(n=j.printParams)?void 0:n.length)){if(!V.visible){if(!await tt())return!1}t&&(V.visible=!V.visible)}else E.warning(j.noDataMsg)},nt=()=>{V.watchPrintParamsReformatFn&&V.watchPrintParamsReformatFn(),V.isInited?V.printParams=X(V.templateParams,j.params):V.watchPrintParamsReformatFn=()=>r((()=>V.isInited),(t=>{if(!t)return!1;nt()}))},it=t=>{if(V.identityVerification.visible=!1,F(V.currentFormatId))return q(null,"edit");const e={formatId:V.currentFormatId,templateId:J.value,params:z(),token:t};M.editPrintFormat(e,(t=>{q(t,"edit")}),R)};async function rt(){await et(!1),$()}return i((()=>{V.isInited=!1})),r((()=>j.params),(t=>{if(!(null==t?void 0:t.length))return!1;nt()}),{deep:!0}),L({directPrint:rt}),(e,n)=>(a(),s(o,null,[l(p(b),{class:"c-dropdown",placement:"bottom-start",trigger:"click",show:V.visible,onClickoutside:K,options:C,onSelect:G,"render-label":A},{default:d((()=>[m(e.$slots,"button",{handleClickPrintBtn:et,printSpinning:V.spinning,printbtnText:t.btnText,printVisible:V.visible},(()=>[l(p(I),{class:"dropdown-button",loading:t.showLoading&&V.spinning,onClick:n[1]||(n[1]=u((()=>U("button")),["stop"]))},{default:d((()=>[c(f(t.btnText)+" ",1),l(p(P),{component:p(h),style:{"margin-left":"5px"},onClick:n[0]||(n[0]=u((()=>U("icon")),["stop"]))},null,8,["component"])])),_:1},8,["loading"])]))])),_:3},8,["show","options"]),l(k,g(e.$attrs,{modelValue:V.identityVerification.visible,"onUpdate:modelValue":n[2]||(n[2]=t=>V.identityVerification.visible=t),formatId:V.currentFormatId,templateId:p(J),onSuccess:it}),null,16,["modelValue","formatId","templateId"])],64))}});export{L as default};
@@ -372,12 +372,12 @@ export declare const CallbackMaps: Map<string, {
372
372
  }>;
373
373
  lowCodeReactionsHandler: (field: string) => void;
374
374
  triggerAllReactionsHandler: () => void;
375
- operationalFormHandler: (fieldKey: string) => void;
376
- triggerAllOperationalFormHandler: () => void;
377
- wordbookSettingHandler: {
378
- trigger: (fieldKey: string, value: unknown) => void;
379
- setDisabled: (value: boolean) => void;
375
+ operationalFormHandler: {
376
+ trigger(fieldKey: string): void;
377
+ triggerAll(): void;
378
+ triggerDisabled: string | boolean;
380
379
  };
380
+ wordbookSettingHandler: import("../../../../../../es/components/form-render").wordbookSettingHandler;
381
381
  schemaAdaptor: (fieldList: import("../../../../../../es/components/form-render").FieldItem[], options?: Partial<{
382
382
  fieldList: import("../../../../../../es/components/form-render").FieldItem[];
383
383
  initialData: import("../../../..").AnyObject;
@@ -590,7 +590,14 @@ export declare const CallbackMaps: Map<string, {
590
590
  force?: boolean | undefined;
591
591
  }): Promise<void>;
592
592
  getFormValues(needCombineExtendKey?: boolean): any;
593
- setFormValues(values: import("../../../..").AnyObject, needSplitExtendKey?: boolean, overwrite?: boolean): void;
593
+ setFormValues(values: import("../../../..").AnyObject, options?: boolean | {
594
+ needSplitExtendKey?: boolean | undefined;
595
+ avoidBusinessConnection?: string | boolean | undefined;
596
+ avoidDependKeyConnection?: string | boolean | undefined;
597
+ avoidWordbookSettingConnection?: string | boolean | undefined;
598
+ avoidOperationalFormConnection?: string | boolean | undefined;
599
+ overwrite?: boolean | undefined;
600
+ }, avoidBusinessConnection?: string | boolean, overwrite?: boolean): Promise<void>;
594
601
  setFieldState(path: string, setter: (field: Partial<Pick<import("@formily/core").Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
595
602
  match: (pattern: import("@formily/path").Pattern) => boolean;
596
603
  validate: (triggerType?: import("@formily/validator").ValidatorTriggerType | undefined) => any;
@@ -0,0 +1,2 @@
1
+ import chatSDK from './src/chatSDK';
2
+ export { chatSDK as CChatSDK };
@@ -0,0 +1 @@
1
+ export{default as CChatSDK}from"./src/chatSDK.js";
@@ -0,0 +1,24 @@
1
+ import { ComponentInternalInstance } from 'vue';
2
+ import 'recorder-core/src/engine/mp3';
3
+ import 'recorder-core/src/engine/mp3-engine';
4
+ import { AnyObject } from '../../../../es/shared/types';
5
+ export default class ChatSDK {
6
+ private recorder;
7
+ private recordingDialog;
8
+ private onProcess;
9
+ static instance: ChatSDK | null;
10
+ constructor();
11
+ static create(): ChatSDK;
12
+ private initRecorder;
13
+ private recorderOpen;
14
+ recorderStart(instance: ComponentInternalInstance, afterLeave: Function): Promise<{
15
+ result: string;
16
+ }>;
17
+ recorderStop(isRecognition?: boolean): Promise<AnyObject>;
18
+ destroy(): void;
19
+ static audioRecognition(params: FormData): Promise<import("axios").AxiosResponse<any, any>>;
20
+ static audioRevise(params: {
21
+ file_id: string;
22
+ audio_txt: string;
23
+ }): Promise<import("axios").AxiosResponse<any, any>>;
24
+ }
@@ -0,0 +1 @@
1
+ import r from"axios";import e from"recorder-core";import"recorder-core/src/engine/mp3";import"recorder-core/src/engine/mp3-engine";import{uuidGenerator as t}from"../../../shared/utils/index.js";import{useThrottleFn as i}from"@vueuse/core";import{RecordingDialog as s}from"./utils/recordingDialog.js";class o{constructor(){if(this.recorder=null,this.recordingDialog=new s,this.onProcess=i(((r,e)=>{if(!this.recordingDialog.target)return;const t=this.recordingDialog.target.querySelector(".animation");if(t){const r="translateX(-50%) translateY(-50%)";if(e>.5){const i=1+.05*e;t.style.transform=r+" scale("+i+")"}else t.style.transform=r+" scale(1)"}}),1e3),o.instance)return o.instance;this.initRecorder(),o.instance=this}static create(){return new o}initRecorder(){this.recorder=e({type:"mp3",sampleRate:16e3,bitRate:16,onProcess:this.onProcess})}async recorderOpen(){return this.recorder||this.initRecorder(),new Promise(((r,e)=>{this.recorder.open((()=>{r({})}),((r,t)=>{e({result:"fail",msg:r,isUserNotAllow:t})}))}))}async recorderStart(r,e){try{return await this.recorderOpen(),this.recorder.start(),await this.recordingDialog.show(r,e),Promise.resolve({result:"success"})}catch(r){return Promise.reject(r)}}recorderStop(r=!0){return this.recorder?(this.recordingDialog.hide(),new Promise(((e,i)=>{this.recorder.stop((async(s,a)=>{const n=new File([s],`${t()}.mp3`,{type:s.type});try{let t;if(r){const r=new FormData;r.append("audio",n);const{data:e}=await o.audioRecognition(r);t=e}e({result:"success",file:n,duration:a,...t?{data:t}:{}})}catch(r){i({result:"fail",msg:r})}}),(r=>{i({result:"fail",msg:r})}))}))):Promise.reject({result:"fail",msg:"请先打开麦克风录音"})}destroy(){var r;null==(r=this.recorder)||r.close(),this.recorder=null}static async audioRecognition(e){return await r.post("/audio/recognition",e,{headers:{"Content-Type":"multipart/form-data"}})}static async audioRevise(e){return await r.post("/audio/revise",e)}}export{o as default};
@@ -0,0 +1,26 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ visible: {
3
+ type: BooleanConstructor;
4
+ default: boolean;
5
+ };
6
+ }, {
7
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
8
+ visible: {
9
+ type: BooleanConstructor;
10
+ default: boolean;
11
+ };
12
+ }>> & {}>>;
13
+ showModal: import("vue").Ref<boolean>;
14
+ close: () => void;
15
+ NModal: any;
16
+ NIcon: any;
17
+ Mic: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
18
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
19
+ visible: {
20
+ type: BooleanConstructor;
21
+ default: boolean;
22
+ };
23
+ }>>, {
24
+ visible: boolean;
25
+ }>;
26
+ export default _default;
@@ -0,0 +1 @@
1
+ import r from"./recordingDialog.vue2.js";import e from"../../../../_virtual/_plugin-vue_export-helper.js";var o=e(r,[["__file","recordingDialog.vue"]]);export{o as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as o,ref as e,watch as i,openBlock as n,createBlock as a,unref as l,withCtx as s,createElementVNode as r,createVNode as t}from"vue";import{NModal as c,NIcon as u}from"naive-ui";import{Mic as p}from"@vicons/ionicons5";const v={class:"c-recording-wrapper"},f=r("div",{class:"animation"},null,-1);var m=o({__name:"recordingDialog",props:{visible:{type:Boolean,default:!1}},setup(o){const m=o,d=e(!0);function w(){d.value=!1}return i((()=>m.visible),(o=>{d.value=o})),(o,e)=>(n(),a(l(c),{show:d.value,"onUpdate:show":e[0]||(e[0]=o=>d.value=o)},{default:s((()=>[r("div",v,[f,r("div",{class:"icon-box",onClick:w},[t(l(u),{size:"60",color:"#fff",component:l(p)},null,8,["component"])])])])),_:1},8,["show"]))}});export{m as default};
@@ -0,0 +1,8 @@
1
+ import { ComponentInternalInstance } from 'vue';
2
+ export declare class RecordingDialog {
3
+ rendered: boolean;
4
+ target: HTMLElement | null;
5
+ static createMsg(message: string): string;
6
+ show(instance: ComponentInternalInstance, afterLeave: Function): Promise<string>;
7
+ hide(): void;
8
+ }
@@ -0,0 +1 @@
1
+ import{ref as e,render as t,createVNode as r,withCtx as n,nextTick as i}from"vue";import{createProviderWrapper as s}from"../../../../shared/utils/index.js";import o from"../components/recordingDialog.vue.js";class a{constructor(){this.rendered=!1,this.target=null}static createMsg(e){return`[PreviewDialog] ${e}`}show(l,d){return this.rendered?Promise.reject(a.createMsg("请勿重复打开弹窗")):new Promise(((a,u)=>{this.rendered=!0;const c=document.createElement("div"),m=e(!1),h=s(l);t(r(h,null,{default:n((()=>r(o,{to:c,visible:m.value,onAfterLeave:()=>function(e){if(!e.parentElement)return;v.rendered=!1,v.hide(),d(),a("success")}(c)},null)),l)}),c);const v=this;var g;g=c,document.body.appendChild(g),v.target=g,i((()=>m.value=!0))}))}hide(){var e;(null==(e=this.target)?void 0:e.parentElement)&&(this.target.parentElement.removeChild(this.target),this.target=null)}}export{a as RecordingDialog};
@@ -0,0 +1 @@
1
+ .c-recording-wrapper{align-items:center;background-color:#fff;border-radius:10px;bottom:100px;display:flex;height:350px;justify-content:center;left:50%;position:fixed;transform:translateX(-50%);width:500px}.c-recording-wrapper .animation{background-color:#5585f557;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%) scale(1);z-index:-1}.c-recording-wrapper .animation,.c-recording-wrapper .icon-box{align-items:center;border-radius:50%;display:flex;height:90px;justify-content:center;width:90px}.c-recording-wrapper .icon-box{background-color:#5585f5;cursor:pointer}