cnhis-design-vue 3.1.47-beta.2 → 3.1.47-beta.3

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 (47) hide show
  1. package/README.md +87 -87
  2. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  3. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  4. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  5. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  6. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  7. package/es/components/button-print/src/utils/print.js +1 -1
  8. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  9. package/es/components/form-render/src/components/renderer/dist/levelSearchCascader.d.ts +77 -0
  10. package/es/components/form-render/src/components/renderer/dist/searchCascade.d.ts +93 -0
  11. package/es/components/form-render/src/hooks/useFormItemDeps.d.ts +1 -0
  12. package/es/components/form-render/src/hooks/useFormItemDeps.js +1 -1
  13. package/es/components/form-render/src/types/index.d.ts +6 -1
  14. package/es/components/iho-table/src/plugins/dist/highLightSetPlugin.d.ts +3 -0
  15. package/es/components/iho-table/src/plugins/filterRenderPlugin/dist/index.d.ts +3 -0
  16. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/dist/index.d.ts +3 -0
  17. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/dist/defaultRendererPlugin.d.ts +3 -0
  18. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/dist/seqRendererPlugin.d.ts +3 -0
  19. package/es/components/iho-table/src/plugins/varialbleHeightPlugin/dist/index.d.ts +3 -0
  20. package/es/components/iho-table/src/utils/dist/index.d.ts +44 -0
  21. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  22. package/es/components/scale-view/src/components/AnswerParse.vue2.js +1 -1
  23. package/es/components/scale-view/src/components/formitem/dist/r-address.d.ts +36 -0
  24. package/es/components/scale-view/src/components/formitem/dist/r-sign.d.ts +36 -0
  25. package/es/components/scale-view/src/components/formitem/dist/standard-modal.d.ts +82 -0
  26. package/es/components/scale-view/src/components/formitem/r-datetime.js +1 -1
  27. package/es/components/search-cascader/src/components/dist/SearchMenu.d.ts +57 -0
  28. package/es/components/search-cascader/src/components/dist/SearchMenu1.d.ts +57 -0
  29. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  30. package/es/components/select-person/src/SearchMultiple.vue.d.ts +0 -6
  31. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +3 -0
  32. package/es/env.d.ts +25 -25
  33. package/es/shared/assets/img/failure.png.js +1 -1
  34. package/es/shared/assets/img/no-permission.png.js +1 -1
  35. package/es/shared/assets/img/nodata.png.js +1 -1
  36. package/es/shared/assets/img/notfound.png.js +1 -1
  37. package/es/shared/assets/img/qr.png.js +1 -1
  38. package/es/shared/assets/img/success.png.js +1 -1
  39. package/es/shared/assets/img/video.png.js +1 -1
  40. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  41. package/es/shared/assets/img/xb_big.png.js +1 -1
  42. package/es/shared/assets/img/xb_small.png.js +1 -1
  43. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  44. package/es/shared/package.json.js +1 -1
  45. package/es/shared/utils/fabricjs/index.d.ts +6823 -0
  46. package/es/shared/utils/tapable/index.d.ts +139 -0
  47. package/package.json +2 -2
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
+ ```
@@ -0,0 +1 @@
1
+ declare module 'bpmn-js/lib/Viewer';
@@ -0,0 +1 @@
1
+ declare module 'bpmn-js/lib/features/modeling';
@@ -0,0 +1 @@
1
+ declare module 'diagram-js/lib/navigation/movecanvas';
@@ -1 +1 @@
1
- import{defineComponent as t,reactive as e,computed as r,onMounted as a,onUnmounted as n,watch as i,openBlock as l,createElementBlock as o,Fragment as s,createVNode as m,unref as d,withCtx as p,renderSlot as u,withModifiers as c,createTextVNode as f,toDisplayString as v,mergeProps as y}from"vue";import{isObject as b}from"@vue/shared";import{useMessage as g,NDropdown as I,NButton as P,NIcon as w}from"naive-ui";import{ChevronDown as h}from"@vicons/ionicons5";import{Print as F}from"./utils/print.js";import{isIReport as k}from"./utils/browserPrint.js";import T from"./components/IdentityVerification.vue.js";import{format as x}from"date-fns";import{savePrivateFormatApi as S,getPrivateFormatApi as D}from"./api.js";var O=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:()=>({})}},emits:["success","error","clickoutside"],setup(t,{expose:O,emit:j}){var E;const L=t,M=g();let N;const V={},C=e({spinning:!1,visible:!1,formatList:[],templateParams:{},printParams:[],currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null}),Y=e([{label:L.printText,key:"printText"},{label:L.previewText,key:"previewText"},{label:L.pdfLoadText,key:"downloadPdf"},{label:L.formatEditText,key:"formatEditText"},...(null==(E=L.externalOptionConfig)?void 0:E.options)||[]]),J=r((()=>{if(!C.currentFormatId)return{};let t=C.currentFormatId;return C.formatList.find((e=>e.id===t))})),U=r((()=>{var t;return(null==(t=J.value)?void 0:t.name)||"格式选择"})),A=r((()=>{let t=C.formatList.find((t=>t.id===C.currentFormatId));return null==t?void 0:t.templateId})),B=async t=>{if(L.directPrint){if(C.spinning)return;return"button"===t?void await it():rt()}return rt()},q=t=>m("span",{class:{active:t.key===C.currentFormatId}},[t.label]),R=(t,e)=>{let r={type:e,formatId:C.currentFormatId,templateId:A.value};j("success",t,r)},_=t=>{j("error",t),b(t)&&"notInstalledApp"===t.type&&M.error(t.message)},z=t=>{j("error",{message:"前置条件执行错误",type:t,preExecution:!0})},H=(t=0)=>{var e;const r=(null==(e=L.printParams)?void 0:e.length)?L.printParams[t]:C.printParams[t];return JSON.stringify({...r||{},...L.token?{token:L.token}:{}})},$=()=>{var t,e;let r={},a={};if(null==(t=C.templateParams.customizeDataset)?void 0:t.length){const t=(null==(e=Object.keys(C.printParams[0].datasetData||{}))?void 0:e[0])||"",r=JSON.stringify(C.printParams.map((e=>JSON.parse(e.datasetData[t]))));a={datasetData:{}},a.datasetData[t]=r}else Object.keys(C.printParams[0]).forEach((t=>{a[t]=[],C.printParams.forEach((e=>{a[t].push(e[t])})),a[t]=a[t].join(",")}));return r=Object.assign({},JSON.parse(H(0)),a),JSON.stringify(r)},G=()=>{let t=C.printParams.length;const e=async e=>{try{--t<=0&&R(e,"print")}catch(t){console.log("error",t)}};L.prevFn("print").then((()=>{const t={formatId:C.currentFormatId,templateId:A.value,printdlgshow:L.printdlgshow};if("MULTI"===L.strategy)for(let r=0;r<C.printParams.length;r++)r>0&&(t.printdlgshow="0"),N.printDirect({...t,params:H(r)},e,_);else N.printDirect({...t,params:$()},(t=>{R(t,"print")}),_)})).catch((()=>{z("print")})).finally((()=>{C.visible=!1}))},K=async(t,e)=>{var r,a;switch(t){case"printText":G();break;case"previewText":(async()=>{L.prevFn("preview").then((()=>{const t="MULTI"===L.strategy?H():$(),e={formatId:C.currentFormatId,templateId:A.value,params:t,btnprint:L.btnprint};N.preview(e,(t=>{R(t,"preview")}),_)})).catch((()=>{z("preview")})).finally((()=>{C.visible=!1}))})();break;case"formatEditText":L.prevFn("edit").then((()=>{C.identityVerification.visible=!0})).catch((()=>{z("edit")})).finally((()=>{C.visible=!1}));break;case"downloadPdf":(async()=>{L.prevFn("download").then((()=>{const t="MULTI"===L.strategy?H():$(),e={formatId:C.currentFormatId,templateId:A.value,print:{print:"1",type:"1"},params:t};N.downloadPDF(e,(t=>R(t,"preview")),_)})).catch((()=>{z("download")})).finally((()=>{C.visible=!1}))})();break;default:{C.visible=!1;const n=C.formatList.find((e=>e.id===t))||{};if(Object.keys(n).length>0){C.currentFormatId=t;const[e]=Y;e.label=(null==n?void 0:n.name)||e.label,await S({formatForms:[{...n}],name:V.name||n.templateName,number:V.number||n.number,templateId:V.templateId||n.templateId,...V.id?{id:V.id}:{}},{token:L.token})}else null==(a=null==(r=L.externalOptionConfig)?void 0:r.onSelect)||a.call(r,t,e);break}}},Q=()=>{C.visible=!1,j("clickoutside")},W=()=>(C.isInited=!1,C.spinning=!1,setTimeout((()=>{C.visible=!1}),0),!1),X=(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=x(e,r[t.type])),(null==t?void 0:t.defaultValue)||a})(e,t[e[r]]);t[e[r]]&&n&&(a[e[r]]=n)})),a},Z=({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(X(r,e,"fieldName"))}})),a=Object.assign({},a,X(r,e,"key")),a})),tt=async t=>{var e;if(C.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):[],C.currentFormatId=await(async(t,e)=>{var r;if(!(null==t?void 0:t.length))return"";const{data:a}=await D({templateId:t[0].templateId},{token:L.token});if("SUCCESS"===a.result){const{formatForms:e=[]}=a.map||{};Object.assign(V,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})(C.formatList,"defaultFlag"),!C.currentFormatId)return M.error("获取打印格式失败,请联系管理员!"),W();(()=>{const t=C.formatList.map((t=>({label:t.name,key:t.id})));Y.unshift({label:U.value,key:"format",children:t})})();let r=null==(e=await L.queryTemplateParams())?void 0:e.obj;if(!r||!A.value)return M.error("获取打印模板失败,请联系管理员!"),W();C.templateParams=r,C.printParams=Z(C.templateParams,L.params)},et=async()=>{if(C.isInited)return!0;C.isInited=!0,C.spinning=!0,(()=>{if(N)return!1;N=new F})();const t=await L.queryPrintFormatByNumber();return await tt(t),C.spinning=!1,!0},rt=async(t=!0)=>{var e;if(await L.clickPrevFn())if(null==(e=L.params)?void 0:e.length){if(!C.visible){if(!await et())return!1}t&&(C.visible=!C.visible)}else M.warning(L.noDataMsg)},at=()=>{C.watchPrintParamsReformatFn&&C.watchPrintParamsReformatFn(),C.isInited?C.printParams=Z(C.templateParams,L.params):C.watchPrintParamsReformatFn=()=>i((()=>C.isInited),(t=>{if(!t)return!1;at()}))},nt=t=>{if(C.identityVerification.visible=!1,k(C.currentFormatId))return R(null,"edit");const e={formatId:C.currentFormatId,templateId:A.value,params:H(),token:t};N.editPrintFormat(e,(t=>{R(t,"edit")}),_)};async function it(){await rt(!1),G()}return a((()=>{C.isInited=!1})),n((()=>{null==N||N.destroy()})),i((()=>L.params),(t=>{if(!(null==t?void 0:t.length))return!1;at()}),{deep:!0}),O({directPrint:it}),(e,r)=>(l(),o(s,null,[m(d(I),{class:"c-dropdown",placement:"bottom-start",trigger:"click",show:C.visible,onClickoutside:Q,options:Y,onSelect:K,"render-label":q},{default:p((()=>[u(e.$slots,"button",{handleClickPrintBtn:rt,printSpinning:C.spinning,printbtnText:t.btnText,printVisible:C.visible},(()=>[m(d(P),{class:"dropdown-button",onClick:r[1]||(r[1]=c((()=>B("button")),["stop"]))},{default:p((()=>[f(v(t.btnText)+" ",1),m(d(w),{component:d(h),style:{"margin-left":"5px"},onClick:r[0]||(r[0]=c((()=>B("icon")),["stop"]))},null,8,["component"])])),_:1})]))])),_:3},8,["show","options"]),m(T,y(e.$attrs,{modelValue:C.identityVerification.visible,"onUpdate:modelValue":r[2]||(r[2]=t=>C.identityVerification.visible=t),formatId:C.currentFormatId,templateId:d(A),onSuccess:nt}),null,16,["modelValue","formatId","templateId"])],64))}});export{O as default};
1
+ import{defineComponent as t,reactive as e,computed as r,onMounted as a,watch as n,openBlock as i,createElementBlock as o,Fragment as l,createVNode as s,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:()=>({})}},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=>s("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};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};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};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(),o(l,null,[s(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},(()=>[s(m(I),{class:"dropdown-button",onClick:r[1]||(r[1]=u((()=>A("button")),["stop"]))},{default:p((()=>[c(f(t.btnText)+" ",1),s(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"]),s(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 +1 @@
1
- import t from"axios";import{isArray as e}from"lodash-es";import{IdentityVerificationDialog as i,PreviewDialog as n}from"./dialog.js";import{getFileUrl as s,useBrowserPrint as r,isIReport as a}from"./browserPrint.js";import{getCurrentInstance as o}from"vue";import{format as l}from"date-fns";const d=t.create({timeout:1e3,withCredentials:!1}),h=`${window.location.protocol}//${window.location.host}`,c=`${h}/fdp-api/print/assembly/printIReport`,u=`${h}/bi-api/reprot/print/open/client/getRemote`,m=`${h}/printService/file`;let p=null;class w{constructor(){var t;if(this.webview=null,this.dialog=new i,this.dialogPreview=new n,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.isRemote=!1,this.CMonitor=null,this.messageHandlerQueue=[],p)return p;p=this;const e=window;if(this.CMonitor=e.$CMonitor,this.webview=null==(t=e.chrome)?void 0:t.webview,this.webview){this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler);try{this.webview.postMessage({exec:"config",data:""})}catch(t){const e="当前浏览器版本不支持获取配置接口";this._handleMonitorNotify(e),console.log("非封装浏览器或者"+e)}}}messageHandler(t){var e;if(console.log("打印事件message",t),!t)return this._handleMonitorNotify("接收到空的浏览器事件,"+t),console.log("当前回执",t,"接收到空的浏览器事件");let i;try{i=JSON.parse(t.data||"{}")}catch(e){console.log("解析e.data失败,"+e),this._handleMonitorNotify("解析e.data失败,"+t)}if(["print","pdf"].includes(null==i?void 0:i.cmd)){console.log("打印命令执行了",i);const e=this.messageHandlerQueue.shift();if(!e)return console.log("当前回执",t,"没有可用的handler");const{resolve:n,reject:s}=e;try{n(i.res||"")}catch(t){s(t)}}else"config"===(null==i?void 0:i.exec)&&(this.downloadPath=(null==(e=i.res)?void 0:e.downloadpath)||"")}async postMessage(t){if(!this.webview)return Promise.reject();const e=Date.now().toString();return Promise.race([new Promise(((i,n)=>{this.messageHandlerQueue.push({resolve:i,reject:n,id:e}),this.webview.postMessage(t)})),new Promise(((t,i)=>{setTimeout((()=>{const t=this.messageHandlerQueue.findIndex((t=>t.id===e));t>-1&&this.messageHandlerQueue.splice(t,1),i({type:"timeout"})}),5e3)}))])}destroy(){this.webview&&this.currentMessageHandler&&(this.webview.removeEventListener("message",this.currentMessageHandler),this.currentMessageHandler=void 0)}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{d({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_queryServicesPrint(e){return this.webview?this.postMessage({exec:"print",data:{inputData:e}}):t({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(e)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:n(i)}):d({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[n]}).then((({data:t})=>t));function n(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleMonitorNotify(t){var e,i;null==(i=null==(e=this.CMonitor)?void 0:e.notify)||i.call(e,{name:"custom_info",message:t,businessName:"打印sdk"})}_handleResult(t,e){if(!t){const t="打印命令返回空数据";return this._handleMonitorNotify(""),null==e||e({type:"printError",message:t,result:!1,errinfo:t}),!1}if("success"!==t.result){const i=t.message||t.Message;this._handleMonitorNotify(i);const n={type:"printError",message:i,result:t.result,errinfo:t.errinfo};return null==e||e(n),!1}return t}_handleResultTest(t,e){return!!t||(console.log("notInstalledApp"),null==e||e({type:"notInstalledApp",message:"请打开打印服务器插件"}),!1)}async _handleEventQueryPrintData(t,e,i,n){const s={templateId:t,formatId:e,params:i,cmdid:"7"},r=await this._queryServicesPrint(s);return this._handleQueryPrintDataResult(r,e,n)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),null==i||i({type:"queryPrintDataFailure",message:e})}catch(t){console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,params:i,cmdid:n,print:s,printdlgshow:r="0",nobillnode:a="1",btnprint:o="1"}){const d={templateId:t,formatId:e,params:i,cmdid:n,nobillnode:a,printdlgshow:r,btnprint:o};if(s){try{s=JSON.parse(s)}catch(t){}d.print=s}else if(this.isRemote){const t=l(new Date,"yyyyMMddHHmmss");d.print={print:"1",type:"1",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${t}\\${t}`}}return await this._queryServicesPrint(d)}async _handleEventEditFormat({templateId:t,formatId:e="",params:i="",token:n}){const s={};let r={};try{r=Object.assign({},s,JSON.parse(i))}catch(t){r=s}const a={templateId:t,formatId:e,cmdid:"9",token:n,params:JSON.stringify(r)};return await this._queryServicesPrint(a)}async _queryProxyOrigin(){if(this.isRemote)return;const{data:t}=await d({method:"get",url:u})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=h+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await d({method:"post",url:c,responseType:"blob",params:{formatId:t.split("_")[1],params:e}})||{};return i}async _browserPrint(t,e){if(this.isRemote){const{filedir:i}=t,n=JSON.parse(i)[0].replace(/\\/g,"/").split("/"),a=n[n.length-2],o=n[n.length-1],l=await s(`${m}/${a}/${o}`),d=r(null,e,l);if("preview"===e)return d}}async preview({templateId:t,formatId:e,params:i="",btnprint:n},s,l){if(a(e)){const t=await this._queryPrintFile(e,i);if(!t)return null==l?void 0:l("获取文件失败!");const n=r(t,"preview");return this.instance||(this.instance=o()),this.showPreview(this.instance,n),void(null==s||s({file:t}))}await this._queryProxyOrigin();const d=await this._testConnection();if(!this._handleResultTest(d,l))return!1;try{const r=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:this.isRemote?"7":"8",btnprint:n}),a=this._handleResult(r,l);if(!a)return!1;if(this.isRemote){const t=await this._browserPrint(a,"preview");this.instance||(this.instance=o()),this.showPreview(this.instance,t)}null==s||s(a)}catch(t){const e="预览失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==l||l(i),this._handleMonitorNotify(i)}}async printDirect({templateId:t,formatId:e,params:i="",print:n,printdlgshow:s,nobillnode:o,isDownloadFile:l=!0},d,h,c="printDirect"){if(a(e)){const t=await this._queryPrintFile(e,i);return t?(r(t,c),void(null==d||d({file:t}))):null==h?void 0:h("获取文件失败!")}await this._queryProxyOrigin();const u=await this._testConnection();if(!this._handleResultTest(u,h))return!1;try{const r=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:"7",print:n,printdlgshow:s,nobillnode:o}),a=this._handleResult(r,h);if(!a)return!1;l&&["downloadPDF"].includes(c)&&await this._browserPrint(a,c),null==d||d(a)}catch(t){const e="printDirect"===c?"打印失败":"下载失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==h||h(i),this._handleMonitorNotify(i)}}_downloadPDF(t){return this.webview?this.postMessage({exec:"pdf",data:{file:t}}):d.get(this.printOrigin+"/download",{params:{inputData:t}}).then((({data:t})=>t))}downloadPDF(t,i,n){if(this.webview&&this.downloadPath&&(Reflect.has(t,"print")||Reflect.set(t,"print",{print:"1",type:"1"}),!t.print.filename)){const e=l(new Date,"yyyy-MM-dd");let i=l(new Date,"yyyyMMddHHmmss");t.customFileName&&(i=`${i}${t.customFileName}`),t.print.filename=`${this.downloadPath}/${e}/${i}/${i}`.replace(/\\/g,"/")}this.printDirect(t,(async s=>{if(s||n(null),a(t.formatId))return i(s);const r=this,o=await async function(t){const i=[],n=JSON.parse(t);if(!e(n))return await r._downloadPDF("");if(1===n.length)return await r._downloadPDF(n[0]||"");for(let t=0,e=n.length;t<e;t++)i.push(await r._downloadPDF(n[t]||""));return i}(s.filedir);i(o,s)}),(t=>n(t)),"downloadPDF")}async print({templateId:t,formatId:e,params:i=""},n,s){const r=await this._testConnection();if(!this._handleResultTest(r,s))return!1;const a=await this.queryPrintData({templateId:t,formatId:e,params:i},void 0,s);if(!a)return!1;const o=this.printFileData({formatId:e,file:a.file,printerName:a.printerName},void 0,s);if(!o)return!1;n&&n(o)}async queryPrintData({templateId:t,formatId:e,params:i=""},n,s){const r=await this._testConnection();if(!this._handleResultTest(r,s))return!1;const a=await this._handleEventQueryPrintData(t,e,i,s);return!!a&&(n&&n(a),a)}async printFileData({formatId:t,file:e,printerName:i="Default"},n,s){const r=await this._testConnection();if(!this._handleResultTest(r,s))return!1;const a=await this._callPrintWithFile({formatId:t,printname:i,file:e}),o=this._handleResult(a,s);return!!o&&(n&&n(o),o)}async editPrintFormat({templateId:t,formatId:e,params:i,token:n},s,r){const a=await this._testConnection();if(!this._handleResultTest(a,r))return!1;const o=await this._handleEventEditFormat({templateId:t,formatId:e,params:i,token:n}),l=this._handleResult(o,r);if(!l)return!1;s&&s(l)}async addPrintFormat({templateId:t,params:e,token:i},n,s){const r=await this._testConnection();if(!this._handleResultTest(r,s))return!1;const a=await this._handleEventEditFormat({templateId:t,params:e,token:i}),o=this._handleResult(a,s);if(!o)return!1;n&&n(o)}}export{w as Print};
1
+ import t from"axios";import{isArray as e}from"lodash-es";import{IdentityVerificationDialog as i,PreviewDialog as n}from"./dialog.js";import{getFileUrl as s,useBrowserPrint as r,isIReport as a}from"./browserPrint.js";import{getCurrentInstance as o}from"vue";import{uuidGenerator as l}from"../../../../shared/utils/index.js";import{format as d}from"date-fns";const h=t.create({timeout:1e3,withCredentials:!1}),c=`${window.location.protocol}//${window.location.host}`,u=`${c}/fdp-api/print/assembly/printIReport`,p=`${c}/bi-api/reprot/print/open/client/getRemote`,m=`${c}/printService/file`;let f=null;class w{constructor(){var t;if(this.webview=null,this.dialog=new i,this.dialogPreview=new n,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.isRemote=!1,this.CMonitor=null,this.messageHandlerQueue=[],f)return f;f=this;const e=window;if(this.CMonitor=e.$CMonitor,this.webview=null==(t=e.chrome)?void 0:t.webview,this.webview){this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler);try{this.webview.postMessage({exec:"config",data:""})}catch(t){const e="当前浏览器版本不支持获取配置接口";this._handleMonitorNotify(e),console.log("非封装浏览器或者"+e)}}}messageHandler(t){var e;if(console.log("打印事件message",t),!t)return this._handleMonitorNotify("接收到空的浏览器事件,"+t),console.log("当前回执",t,"接收到空的浏览器事件");let i;try{i=JSON.parse(t.data||"{}")}catch(e){console.log("解析e.data失败,"+e),this._handleMonitorNotify("解析e.data失败,"+t)}if(["print","pdf"].includes(null==i?void 0:i.cmd)){console.log("打印命令执行了",i);const e=this.messageHandlerQueue.shift();if(!e)return console.log("当前回执",t,"没有可用的handler");const{resolve:n,reject:s}=e;try{n(i.res||"")}catch(t){s(t)}}else"config"===(null==i?void 0:i.exec)&&(this.downloadPath=(null==(e=i.res)?void 0:e.downloadpath)||"")}async postMessage(t){if(!this.webview)return Promise.reject();const e=Date.now().toString();return Promise.race([new Promise(((i,n)=>{this.messageHandlerQueue.push({resolve:i,reject:n,id:e}),this.webview.postMessage(t)})),new Promise(((t,i)=>{setTimeout((()=>{const t=this.messageHandlerQueue.findIndex((t=>t.id===e));t>-1&&this.messageHandlerQueue.splice(t,1),i({type:"timeout"})}),5e3)}))])}destroy(){}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{h({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_queryServicesPrint(e){return this.webview?this.postMessage({exec:"print",data:{inputData:e}}):t({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(e)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:n(i)}):h({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[n]}).then((({data:t})=>t));function n(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleMonitorNotify(t){var e,i;null==(i=null==(e=this.CMonitor)?void 0:e.notify)||i.call(e,{name:"custom_info",message:t,businessName:"打印sdk"})}_handleResult(t,e){if(!t){const t="打印命令返回空数据";return this._handleMonitorNotify(""),null==e||e({type:"printError",message:t,result:!1,errinfo:t}),!1}if("success"!==t.result){const i=t.message||t.Message;this._handleMonitorNotify(i);const n={type:"printError",message:i,result:t.result,errinfo:t.errinfo};return null==e||e(n),!1}return t}_handleResultTest(t,e){return!!t||(console.log("notInstalledApp"),null==e||e({type:"notInstalledApp",message:"请打开打印服务器插件"}),!1)}async _handleEventQueryPrintData(t,e,i,n){const s={templateId:t,formatId:e,params:i,cmdid:"7"},r=await this._queryServicesPrint(s);return this._handleQueryPrintDataResult(r,e,n)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),null==i||i({type:"queryPrintDataFailure",message:e})}catch(t){console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,params:i,cmdid:n,print:s,printdlgshow:r="0",nobillnode:a="1",btnprint:o="1"}){const l={templateId:t,formatId:e,params:i,cmdid:n,nobillnode:a,printdlgshow:r,btnprint:o};if(s){try{s=JSON.parse(s)}catch(t){}l.print=s}else if(this.isRemote){const t=d(new Date,"yyyyMMddHHmmss");l.print={print:"1",type:"1",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${t}\\${t}`}}return await this._queryServicesPrint(l)}async _handleEventEditFormat({templateId:t,formatId:e="",params:i="",token:n}){const s={};let r={};try{r=Object.assign({},s,JSON.parse(i))}catch(t){r=s}const a={templateId:t,formatId:e,cmdid:"9",token:n,params:JSON.stringify(r)};return await this._queryServicesPrint(a)}async _queryProxyOrigin(){if(this.isRemote)return;const{data:t}=await h({method:"get",url:p})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=c+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await h({method:"post",url:u,responseType:"blob",params:{formatId:t.split("_")[1],params:e}})||{};return i}async _browserPrint(t,e){if(this.isRemote){const{filedir:i}=t,n=JSON.parse(i)[0].replace(/\\/g,"/").split("/"),a=n[n.length-2],o=n[n.length-1],l=await s(`${m}/${a}/${o}`),d=r(null,e,l);if("preview"===e)return d}}async preview({templateId:t,formatId:e,params:i="",btnprint:n},s,l){if(a(e)){const t=await this._queryPrintFile(e,i);if(!t)return null==l?void 0:l("获取文件失败!");const n=r(t,"preview");return this.instance||(this.instance=o()),this.showPreview(this.instance,n),void(null==s||s({file:t}))}await this._queryProxyOrigin();const d=await this._testConnection();if(!this._handleResultTest(d,l))return!1;try{const r=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:this.isRemote?"7":"8",btnprint:n}),a=this._handleResult(r,l);if(!a)return!1;if(this.isRemote){const t=await this._browserPrint(a,"preview");this.instance||(this.instance=o()),this.showPreview(this.instance,t)}null==s||s(a)}catch(t){const e="预览失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==l||l(i),this._handleMonitorNotify(i)}}async printDirect({templateId:t,formatId:e,params:i="",print:n,printdlgshow:s,nobillnode:o,isDownloadFile:l=!0},d,h,c="printDirect"){if(a(e)){const t=await this._queryPrintFile(e,i);return t?(r(t,c),void(null==d||d({file:t}))):null==h?void 0:h("获取文件失败!")}await this._queryProxyOrigin();const u=await this._testConnection();if(!this._handleResultTest(u,h))return!1;try{const r=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:"7",print:n,printdlgshow:s,nobillnode:o}),a=this._handleResult(r,h);if(!a)return!1;l&&["downloadPDF"].includes(c)&&await this._browserPrint(a,c),null==d||d(a)}catch(t){const e="printDirect"===c?"打印失败":"下载失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==h||h(i),this._handleMonitorNotify(i)}}_downloadPDF(t){return this.webview?this.postMessage({exec:"pdf",data:{file:t}}):h.get(this.printOrigin+"/download",{params:{inputData:t}}).then((({data:t})=>t))}downloadPDF(t,i,n){if(this.webview&&this.downloadPath&&(Reflect.has(t,"print")||Reflect.set(t,"print",{print:"1",type:"1"}),!t.print.filename)){const e=d(new Date,"yyyy-MM-dd"),i=l(),n=d(new Date,"yyyyMMddHHmmss")+i;t.print.filename=`${this.downloadPath}/${e}/${n}/${n}`.replace(/\\/g,"/")}this.printDirect(t,(async s=>{if(s||n(null),a(t.formatId))return i(s);const r=this,o=await async function(t){const i=[],n=JSON.parse(t);if(!e(n))return await r._downloadPDF("");if(1===n.length)return await r._downloadPDF(n[0]||"");for(let t=0,e=n.length;t<e;t++)i.push(await r._downloadPDF(n[t]||""));return i}(s.filedir);i(o,s)}),(t=>n(t)),"downloadPDF")}async print({templateId:t,formatId:e,params:i=""},n,s){const r=await this._testConnection();if(!this._handleResultTest(r,s))return!1;const a=await this.queryPrintData({templateId:t,formatId:e,params:i},void 0,s);if(!a)return!1;const o=this.printFileData({formatId:e,file:a.file,printerName:a.printerName},void 0,s);if(!o)return!1;n&&n(o)}async queryPrintData({templateId:t,formatId:e,params:i=""},n,s){const r=await this._testConnection();if(!this._handleResultTest(r,s))return!1;const a=await this._handleEventQueryPrintData(t,e,i,s);return!!a&&(n&&n(a),a)}async printFileData({formatId:t,file:e,printerName:i="Default"},n,s){const r=await this._testConnection();if(!this._handleResultTest(r,s))return!1;const a=await this._callPrintWithFile({formatId:t,printname:i,file:e}),o=this._handleResult(a,s);return!!o&&(n&&n(o),o)}async editPrintFormat({templateId:t,formatId:e,params:i,token:n},s,r){const a=await this._testConnection();if(!this._handleResultTest(a,r))return!1;const o=await this._handleEventEditFormat({templateId:t,formatId:e,params:i,token:n}),l=this._handleResult(o,r);if(!l)return!1;s&&s(l)}async addPrintFormat({templateId:t,params:e,token:i},n,s){const r=await this._testConnection();if(!this._handleResultTest(r,s))return!1;const a=await this._handleEventEditFormat({templateId:t,params:e,token:i}),o=this._handleResult(a,s);if(!o)return!1;n&&n(o)}}export{w as Print};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as d,normalizeStyle as p,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as g,createCommentVNode as j,createElementVNode as b,withKeys as k,toDisplayString as v,renderSlot as F}from"vue";import{useTheme as C}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as H,cloneDeep as S}from"lodash-es";import{createForm as x,onFieldValueChange as A,onFieldMount as L,onFieldUnmount as O,onFieldReact as R,onFormMount as w}from"@formily/core";import{FormProvider as B,FormConsumer as _}from"@formily/vue";import{NForm as V,NTabs as D,NTabPane as I,NConfigProvider as N}from"naive-ui";import{InjectionFormLifeCycleCaller as q,InjectionFormGraph as W}from"./constants/index.js";import{useAutoHidden as T}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as U}from"./hooks/useComplexOptions.js";import{useFormDomEvent as E,useFormExposeEvent as G}from"./hooks/useFormEvent.js";import{useFormGraph as K}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as M}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeEvent as P}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as J}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as $}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as z}from"./hooks/useOperationalForm.js";import{useWordbookSetting as Q}from"./hooks/useWordbookSetting.js";import"./utils/index.js";import{useFieldListAdaptor as X}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/index.js";import"../index.js";import{useFieldVisitor as Y}from"./hooks/useFieldVisitor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{validateMessageLocale as Z}from"./hooks/useFormValidator.js";import{useAnchor as ee}from"./hooks/useAnchor.js";import{useFormContext as oe}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";import{createObjSchema as te}from"./utils/schema.js";const re={key:0,style:{height:"54px"}},se={style:{"white-space":"pre"}};var ae=e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},operationalForm:{type:Object},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},uniqueCacheData:{type:Boolean,default:!1}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:ae,emit:ie}){const le=e,ne=C(),{nuiThemeOverrides:me}=$();Z();const de=o(),pe=t((()=>H(le.maxHeight)?le.maxHeight+"px":le.maxHeight)),{SchemaField:ue,businessCollector:ce,formItemDepsCollector:fe,changeContextCollector:he,formUUID:ye}=oe(le,ie),{anchorBarRef:ge,currentAnchor:je,updateAnchorList:be,anchorIdList:ke,onScroll:ve}=ee(le,ie,de,fe),{callLifeCycle:Fe}=M(le);r(q,Fe),Fe("onSetup");const{trigger:Ce}=T(),{observeFormGraph:He,setGraph:Se,removeGraph:xe}=K();r(W,He);const{lowCodeEventTrigger:Ae}=P(),Le=x({initialValues:le.initialData,effects(e){A("*",(o=>{const t=o.props.name.toString();ce.trigger(e,t),fe.trigger(t),ie("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:he.getContext(t,o.value)}),Ae(o),Oe(t,o.value),we(t),_e(t,o.value)})),L("*",Se),O("*",xe),le.linebarAutoHidden&&(R("*",Ce),w((e=>e.query("*").forEach(Ce)))),le.anchor&&R("*",be)}}),{lowCodeReactionsHandler:Oe,triggerAllReactionsHandler:Re}=J(t((()=>le.lowCodeReactions)),Le),{operationalFormHandler:we,triggerAllOperationalFormHandler:Be}=z(t((()=>le.operationalForm)),Le),{wordbookSettingHandler:_e}=Q(Le,he);s(Re),s(Be);const{schemaAdaptor:Ve}=X(ce);let De=le.fieldList||[];const Ie=t((()=>le.schema?le.schema:le.fieldList?(De=Y().traverse(S(le.fieldList),le.fieldVisitor),te(Ve(De))):te({}))),{onKeydown:Ne}=E({formModel:Le,formRenderRef:de,props:le}),{clearSpan:qe}=U();a((()=>qe(ye)));const We=G({formModel:Le,formRenderRef:de,formItemDepsCollector:fe,getFieldList:()=>De,formUUID:ye});return ae({formModel:Le,validate:(e="*")=>We.validate(e),getFormValues:(e=!0)=>We.getFormValues(e),async setFormValues(e,o=!0,t=!1,r=!0){t&&(ce.triggerLock=!0),We.setFormValues(e,o,r),await i(),ce.triggerLock=!1},setFieldState(e,o){We.setFieldState(e,o)},resetFields(e="*"){We.resetFields(e)},queryWidget:async e=>We.queryWidget(e),getFieldList:()=>De,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(l(),n(m(V),{class:d(["form-render",{"form-render--no-border":!e.bordered,"form-render--underline":"underline"===e.bordered}]),"require-mark-placement":"left",style:p(m(ne))},{default:u((()=>[e.anchor?(l(),c("section",re,[f(m(D),{value:m(je),"onUpdate:value":t[0]||(t[0]=e=>h(je)?je.value=e:null),type:"line",ref_key:"anchorBarRef",ref:ge},{default:u((()=>[(l(!0),c(y,null,g(m(ke),(e=>(l(),n(m(I),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):j("v-if",!0),f(m(N),{"theme-overrides":m(me)},{default:u((()=>[b("section",{class:"form-render__wrapper",style:p({"--column":e.column,"--form-height":m(pe)}),ref_key:"formRenderRef",ref:de,onScroll:t[1]||(t[1]=(...e)=>m(ve)&&m(ve)(...e)),onKeydownCapture:t[2]||(t[2]=k(((...e)=>m(Ne)&&m(Ne)(...e)),["enter"]))},[f(m(B),{form:m(Le)},{default:u((()=>[f(m(ue),{schema:m(Ie)},null,8,["schema"]),e.consumer?(l(),n(m(_),{key:0},{default:u((({form:e})=>[b("div",se,v(JSON.stringify(e.values,null,2)),1)])),_:1})):j("v-if",!0),F(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},8,["class","style"]))}});export{ae as default};
1
+ import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as d,normalizeStyle as p,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as g,createCommentVNode as j,createElementVNode as b,withKeys as k,toDisplayString as v,renderSlot as F}from"vue";import{useTheme as C}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as S,cloneDeep as H}from"lodash-es";import{createForm as x,onFieldValueChange as A,onFieldMount as L,onFieldUnmount as O,onFieldReact as R,onFormMount as w}from"@formily/core";import{FormProvider as B,FormConsumer as _}from"@formily/vue";import{NForm as D,NTabs as V,NTabPane as I,NConfigProvider as N}from"naive-ui";import{InjectionFormLifeCycleCaller as q,InjectionFormGraph as W}from"./constants/index.js";import{useAutoHidden as E}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as K}from"./hooks/useComplexOptions.js";import{useFormDomEvent as T,useFormExposeEvent as U}from"./hooks/useFormEvent.js";import{useFormGraph as G}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as M}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeEvent as P}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as J}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as $}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as z}from"./hooks/useOperationalForm.js";import{useWordbookSetting as Q}from"./hooks/useWordbookSetting.js";import"./utils/index.js";import{useFieldListAdaptor as X}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/index.js";import"../index.js";import{useFieldVisitor as Y}from"./hooks/useFieldVisitor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{validateMessageLocale as Z}from"./hooks/useFormValidator.js";import{useAnchor as ee}from"./hooks/useAnchor.js";import{useFormContext as oe}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";import{createObjSchema as te}from"./utils/schema.js";const re={key:0,style:{height:"54px"}},se={style:{"white-space":"pre"}};var ae=e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},operationalForm:{type:Object},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},uniqueCacheData:{type:Boolean,default:!1}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:ae,emit:ie}){const le=e,ne=C(),{nuiThemeOverrides:me}=$();Z();const de=o(),pe=t((()=>S(le.maxHeight)?le.maxHeight+"px":le.maxHeight)),{SchemaField:ue,businessCollector:ce,formItemDepsCollector:fe,changeContextCollector:he,formUUID:ye}=oe(le,ie),{anchorBarRef:ge,currentAnchor:je,updateAnchorList:be,anchorIdList:ke,onScroll:ve}=ee(le,ie,de,fe),{callLifeCycle:Fe}=M(le);r(q,Fe),Fe("onSetup");const{trigger:Ce}=E(),{observeFormGraph:Se,setGraph:He,removeGraph:xe}=G();r(W,Se);const{lowCodeEventTrigger:Ae}=P(),Le=x({initialValues:le.initialData,effects(e){A("*",(o=>{const t=o.props.name.toString();ce.trigger(e,t),fe.trigger(t),ie("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:he.getContext(t,o.value)}),Ae(o),Oe(t,o.value),we(t),_e(t,o.value)})),L("*",He),O("*",xe),le.linebarAutoHidden&&(R("*",Ce),w((e=>e.query("*").forEach(Ce)))),le.anchor&&R("*",be)}}),{lowCodeReactionsHandler:Oe,triggerAllReactionsHandler:Re}=J(t((()=>le.lowCodeReactions)),Le),{operationalFormHandler:we,triggerAllOperationalFormHandler:Be}=z(t((()=>le.operationalForm)),Le),{wordbookSettingHandler:_e}=Q(Le,he);s(Re),s(Be);const{schemaAdaptor:De}=X(ce);let Ve=le.fieldList||[];const Ie=t((()=>le.schema?le.schema:le.fieldList?(Ve=Y().traverse(H(le.fieldList),le.fieldVisitor),te(De(Ve))):te({}))),{onKeydown:Ne}=T({formModel:Le,formRenderRef:de,props:le}),{clearSpan:qe}=K();a((()=>qe(ye)));const We=U({formModel:Le,formRenderRef:de,formItemDepsCollector:fe,getFieldList:()=>Ve,formUUID:ye});return ae({formModel:Le,validate:(e="*")=>We.validate(e),getFormValues:(e=!0)=>We.getFormValues(e),async setFormValues(e,{needSplitExtendKey:o=!0,avoidBusinessConnection:t=!1,avoidDependKeyConnection:r=!0,overwrite:s=!0}={}){t&&(ce.triggerLock=!0),r&&(fe.triggerDisabled=!0),We.setFormValues(e,o,s),await i(),ce.triggerLock=!1,fe.triggerDisabled=!1},setFieldState(e,o){We.setFieldState(e,o)},resetFields(e="*"){We.resetFields(e)},queryWidget:async e=>We.queryWidget(e),getFieldList:()=>Ve,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(l(),n(m(D),{class:d(["form-render",{"form-render--no-border":!e.bordered,"form-render--underline":"underline"===e.bordered}]),"require-mark-placement":"left",style:p(m(ne))},{default:u((()=>[e.anchor?(l(),c("section",re,[f(m(V),{value:m(je),"onUpdate:value":t[0]||(t[0]=e=>h(je)?je.value=e:null),type:"line",ref_key:"anchorBarRef",ref:ge},{default:u((()=>[(l(!0),c(y,null,g(m(ke),(e=>(l(),n(m(I),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):j("v-if",!0),f(m(N),{"theme-overrides":m(me)},{default:u((()=>[b("section",{class:"form-render__wrapper",style:p({"--column":e.column,"--form-height":m(pe)}),ref_key:"formRenderRef",ref:de,onScroll:t[1]||(t[1]=(...e)=>m(ve)&&m(ve)(...e)),onKeydownCapture:t[2]||(t[2]=k(((...e)=>m(Ne)&&m(Ne)(...e)),["enter"]))},[f(m(B),{form:m(Le)},{default:u((()=>[f(m(ue),{schema:m(Ie)},null,8,["schema"]),e.consumer?(l(),n(m(_),{key:0},{default:u((({form:e})=>[b("div",se,v(JSON.stringify(e.values,null,2)),1)])),_:1})):j("v-if",!0),F(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},8,["class","style"]))}});export{ae as default};
@@ -0,0 +1,77 @@
1
+ export const __esModule: true;
2
+ export const LEVEL_SEARCH_CASCADER: vue_2.DefineComponent<{
3
+ options: {
4
+ type: ArrayConstructor;
5
+ default: () => never[];
6
+ };
7
+ labelField: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ valueField: {
12
+ type: StringConstructor;
13
+ default: string;
14
+ };
15
+ autograph: {
16
+ type: StringConstructor;
17
+ required: true;
18
+ };
19
+ lazyRequest: {
20
+ type: BooleanConstructor;
21
+ default: boolean;
22
+ };
23
+ requestCache: {
24
+ type: BooleanConstructor;
25
+ default: boolean;
26
+ };
27
+ wordbook: {
28
+ type: ObjectConstructor;
29
+ required: true;
30
+ };
31
+ onChange: {};
32
+ value: {
33
+ type: (ArrayConstructor | StringConstructor)[];
34
+ };
35
+ }, () => any, any, {}, {}, vue_2.ComponentOptionsMixin, vue_2.ComponentOptionsMixin, "update:value"[], "update:value", vue_2.VNodeProps & vue_2.AllowedComponentProps & vue_2.ComponentCustomProps, Readonly<vue_2.ExtractPropTypes<{
36
+ options: {
37
+ type: ArrayConstructor;
38
+ default: () => never[];
39
+ };
40
+ labelField: {
41
+ type: StringConstructor;
42
+ default: string;
43
+ };
44
+ valueField: {
45
+ type: StringConstructor;
46
+ default: string;
47
+ };
48
+ autograph: {
49
+ type: StringConstructor;
50
+ required: true;
51
+ };
52
+ lazyRequest: {
53
+ type: BooleanConstructor;
54
+ default: boolean;
55
+ };
56
+ requestCache: {
57
+ type: BooleanConstructor;
58
+ default: boolean;
59
+ };
60
+ wordbook: {
61
+ type: ObjectConstructor;
62
+ required: true;
63
+ };
64
+ onChange: {};
65
+ value: {
66
+ type: (ArrayConstructor | StringConstructor)[];
67
+ };
68
+ }>> & {
69
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
70
+ }, {
71
+ options: unknown[];
72
+ labelField: string;
73
+ valueField: string;
74
+ lazyRequest: boolean;
75
+ requestCache: boolean;
76
+ }>;
77
+ import vue_2 = require("vue");
@@ -0,0 +1,93 @@
1
+ export const __esModule: true;
2
+ export const SEARCH_CASCADER: vue_2.DefineComponent<{
3
+ options: {
4
+ type: ArrayConstructor;
5
+ default: () => never[];
6
+ };
7
+ depth: {
8
+ type: (NumberConstructor | StringConstructor)[];
9
+ };
10
+ urlConfig: {
11
+ type: ObjectConstructor;
12
+ };
13
+ lazyRequest: {
14
+ type: BooleanConstructor;
15
+ default: boolean;
16
+ };
17
+ requestCache: {
18
+ type: BooleanConstructor;
19
+ default: boolean;
20
+ };
21
+ onFocus: {
22
+ type: FunctionConstructor;
23
+ };
24
+ filterable: {
25
+ type: BooleanConstructor;
26
+ default: boolean;
27
+ };
28
+ checkStrategy: {
29
+ type: StringConstructor;
30
+ default: string;
31
+ };
32
+ labelField: {
33
+ type: StringConstructor;
34
+ default: string;
35
+ };
36
+ valueField: {
37
+ type: StringConstructor;
38
+ default: string;
39
+ };
40
+ onChange: {};
41
+ value: {};
42
+ }, () => any, any, {}, {}, vue_2.ComponentOptionsMixin, vue_2.ComponentOptionsMixin, "update:value"[], "update:value", vue_2.VNodeProps & vue_2.AllowedComponentProps & vue_2.ComponentCustomProps, Readonly<vue_2.ExtractPropTypes<{
43
+ options: {
44
+ type: ArrayConstructor;
45
+ default: () => never[];
46
+ };
47
+ depth: {
48
+ type: (NumberConstructor | StringConstructor)[];
49
+ };
50
+ urlConfig: {
51
+ type: ObjectConstructor;
52
+ };
53
+ lazyRequest: {
54
+ type: BooleanConstructor;
55
+ default: boolean;
56
+ };
57
+ requestCache: {
58
+ type: BooleanConstructor;
59
+ default: boolean;
60
+ };
61
+ onFocus: {
62
+ type: FunctionConstructor;
63
+ };
64
+ filterable: {
65
+ type: BooleanConstructor;
66
+ default: boolean;
67
+ };
68
+ checkStrategy: {
69
+ type: StringConstructor;
70
+ default: string;
71
+ };
72
+ labelField: {
73
+ type: StringConstructor;
74
+ default: string;
75
+ };
76
+ valueField: {
77
+ type: StringConstructor;
78
+ default: string;
79
+ };
80
+ onChange: {};
81
+ value: {};
82
+ }>> & {
83
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
84
+ }, {
85
+ options: unknown[];
86
+ checkStrategy: string;
87
+ labelField: string;
88
+ valueField: string;
89
+ lazyRequest: boolean;
90
+ requestCache: boolean;
91
+ filterable: boolean;
92
+ }>;
93
+ import vue_2 = require("vue");
@@ -1,6 +1,7 @@
1
1
  import { Func } from '../../../../../es/shared/types';
2
2
  import { DependKeyType } from '../../../../../es/components/form-render';
3
3
  export declare class FormItemDepsCollector {
4
+ triggerDisabled: boolean;
4
5
  private readonly collector;
5
6
  setDeps(key: string, dependKeys: DependKeyType, callback: Func): void;
6
7
  getDeps(dependKey: string): Map<string, Func<any[], any>> | undefined;
@@ -1 +1 @@
1
- import{isFunction as t}from"lodash-es";import"../utils/index.js";import{traverseDependKey as e}from"../utils/schema.js";class r{constructor(){this.collector=new Map}setDeps(t,r,s){e(r,(e=>{const r=this.collector.get(e)||new Map;r.set(t,s),this.collector.set(e,r)}))}getDeps(t){return this.collector.get(t)}trigger(e,r){var s;null==(s=this.getDeps(e))||s.forEach((e=>t(e)&&e(r)))}}function s(){return{create:function(){return new r}}}export{r as FormItemDepsCollector,s as useFormItemDeps};
1
+ import{isFunction as t}from"lodash-es";import"../utils/index.js";import{traverseDependKey as e}from"../utils/schema.js";class r{constructor(){this.triggerDisabled=!1,this.collector=new Map}setDeps(t,r,s){e(r,(e=>{const r=this.collector.get(e)||new Map;r.set(t,s),this.collector.set(e,r)}))}getDeps(t){return this.collector.get(t)}trigger(e,r){var s;this.triggerDisabled||null==(s=this.getDeps(e))||s.forEach((e=>t(e)&&e(r)))}}function s(){return{create:function(){return new r}}}export{r as FormItemDepsCollector,s as useFormItemDeps};
@@ -30,7 +30,12 @@ export declare type FormRenderExpose = {
30
30
  formModel: Form;
31
31
  validate(path?: string): Promise<unknown>;
32
32
  getFormValues(needCombineExtendKey?: boolean): AnyObject;
33
- setFormValues(values: AnyObject, needSplitExtendKey?: boolean, avoidBusinessConnection?: boolean, overwrite?: boolean): any;
33
+ setFormValues(values: AnyObject, options?: Partial<{
34
+ needSplitExtendKey: boolean;
35
+ avoidBusinessConnection: boolean;
36
+ avoidDependKeyConnection: boolean;
37
+ overwrite: boolean;
38
+ }>): any;
34
39
  setFieldState(path: string, setter: (field: Field) => void): void;
35
40
  resetFields(path?: string): void;
36
41
  queryWidget(key: string): Promise<{
@@ -0,0 +1,3 @@
1
+ export const __esModule: true;
2
+ export function highLightSetPlugin(): iho_table_1.TablePlugin;
3
+ import iho_table_1 = require("../../../../../../es/components/iho-table");
@@ -0,0 +1,3 @@
1
+ export const __esModule: true;
2
+ export function filterRenderPlugin(): iho_table_1.TablePlugin;
3
+ import iho_table_1 = require("../../../../../../../es/components/iho-table");
@@ -0,0 +1,3 @@
1
+ export const __esModule: true;
2
+ export function dateRendererPlugin(): iho_table_1.TablePlugin;
3
+ import iho_table_1 = require("../../../../../../../../../es/components/iho-table");
@@ -0,0 +1,3 @@
1
+ export const __esModule: true;
2
+ export function defaultRendererPlugin(): iho_table_1.TablePlugin;
3
+ import iho_table_1 = require("../../../../../../../../es/components/iho-table");
@@ -0,0 +1,3 @@
1
+ export const __esModule: true;
2
+ export function seqRendererPlugin(): iho_table_1.TablePlugin;
3
+ import iho_table_1 = require("../../../../../../../../es/components/iho-table");
@@ -0,0 +1,3 @@
1
+ export const __esModule: true;
2
+ export function variableHeightRendererPlugin(): iho_table_1.TablePlugin;
3
+ import iho_table_1 = require("../../../../../../../es/components/iho-table");
@@ -0,0 +1,44 @@
1
+ export const __esModule: true;
2
+ export const IhoTableUtils: Readonly<{
3
+ getCellType: (lowCodeField: any) => any;
4
+ }>;
5
+ export const IhoTableRenderHelper: Readonly<{
6
+ createDefaultRenderCell: typeof createDefaultRenderCell;
7
+ createRenderEdit: typeof createRenderEdit;
8
+ isEditableColumn: (config: any, column: any) => any;
9
+ hasFilter: (lowCodeField: any) => boolean;
10
+ hasDateFiler: (lowCodeField: any) => any;
11
+ }>;
12
+ export const IhoTableStatusHelper: Readonly<{
13
+ isPositive: (value: any) => boolean;
14
+ isNegative: (value: any) => boolean;
15
+ notPositive: (value: any) => boolean;
16
+ notNegative: (value: any) => boolean;
17
+ }>;
18
+ export function createIhoTableClearActivedInterceptor(type: any, solution: any): (_a: any) => boolean;
19
+ export function IhoTableLog(message: any): void;
20
+ export function IhoTableWarn(message: any): void;
21
+ export function getRowHeight(): number;
22
+ export function eventListener2EventName(eventListenerName: any): string;
23
+ export function eventName2EventListener(eventName: any): string;
24
+ export function useUUIDMap(creator: any, isReactive: any): {
25
+ getItemFromUUID: (uuid: any) => any;
26
+ setItemFromUUID: (uuid: any, value: any) => void;
27
+ removeItemFromUUID: (uuid: any) => void;
28
+ };
29
+ export function getColumnRenderWidth(column: any, $table: any): any;
30
+ export function useIhoTableFormEvent(payload: any): {
31
+ emitFormChange: () => void;
32
+ emitFormClick: () => void;
33
+ emitFormChangeWithParams: (params: any) => void;
34
+ emitFormClickWithParams: (params: any) => void;
35
+ };
36
+ export function getLowCodeFieldFromField(field: any): any;
37
+ declare function createDefaultRenderCell(): (_: any, _a: any) => any[];
38
+ declare function createRenderEdit(renderer: any): (_a: any, params: any) => any;
39
+ export function isTransformTreeType(config: any): boolean;
40
+ export function isRichContent(content: any): boolean;
41
+ export function parseRichContent(richContent: any): any;
42
+ export function parseMergeField(row: any, column: any): any;
43
+ export function isCompatibleColumn(field: any): any;
44
+ export {};