cnhis-design-vue 3.1.41-beta.0 → 3.1.41-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/button-print/src/utils/print.d.ts +1 -1
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/form-config/index.d.ts +14 -2
- package/es/components/form-config/src/FormConfig.vue.d.ts +14 -2
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +4 -1
- package/es/components/form-config/src/components/FormConfigDragDisplay.vue.js +1 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +8 -1
- package/es/components/form-config/src/components/renderer/DefaultNode.vue.js +1 -1
- package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
- package/es/components/form-config/src/hooks/useSortalbeConfig.js +1 -1
- package/es/components/form-config/src/types/index.d.ts +1 -0
- package/es/components/form-render/index.d.ts +4 -1
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +4 -1
- package/es/components/form-render/src/FormRender.vue.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +4 -1
- package/es/components/form-render/src/components/renderer/date.d.ts +2 -0
- package/es/components/form-render/src/components/renderer/formItem.d.ts +7 -0
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/components/renderer/select.d.ts +3 -0
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/constants/index.d.ts +2 -0
- package/es/components/form-render/src/constants/index.js +1 -1
- package/es/components/form-render/src/hooks/useComplexOptions.d.ts +2 -6
- package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.d.ts +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
- package/es/components/form-render/src/hooks/useFormField.d.ts +1 -0
- package/es/components/form-render/src/hooks/useFormField.js +1 -1
- package/es/components/form-render/src/hooks/useFormGraph.d.ts +6 -0
- package/es/components/form-render/src/hooks/useFormGraph.js +1 -0
- package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +7 -1
- package/es/components/form-render/src/types/index.d.ts +1 -1
- package/es/components/form-render/src/utils/dom.d.ts +2 -1
- package/es/components/form-render/src/utils/dom.js +1 -1
- package/es/components/iho-table/index.d.ts +5 -5
- package/es/components/iho-table/index.js +1 -1
- package/es/components/iho-table/src/IhoTable.vue.d.ts +5 -5
- package/es/components/iho-table/src/IhoTable.vue.js +1 -1
- package/es/components/iho-table/src/constants/index.d.ts +2 -2
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +1 -1
- package/es/components/iho-table/src/plugins/{filterPlugin → filterRenderPlugin}/filter.vue.d.ts +15 -74
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.js +1 -0
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/colorRendererPlugin.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +6 -6
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.js +1 -1
- package/es/components/info-header/src/InfoHeader.vue.js +1 -1
- package/es/components/recommend-search/index.d.ts +10 -10
- package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +10 -10
- package/es/components/recommend-search/src/components/BaseSearch.vue.d.ts +2 -2
- package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +4 -4
- package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +4 -4
- package/es/components/scale-view/index.d.ts +1 -2
- package/es/components/scale-view/src/ScaleView.vue.d.ts +1 -2
- package/es/components/scale-view/src/ScaleView.vue.js +1 -1
- package/es/components/scale-view/src/components/formitem/text-over-tooltip/TextOverTooltip.vue.d.ts +1 -1
- package/es/components/scale-view/src/hooks/scaleview-computed.d.ts +1 -0
- package/es/components/scale-view/src/hooks/scaleview-computed.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
- package/es/components/scale-view/src/utils/judge-types.js +1 -1
- package/es/components/scale-view/style/index.css +1 -1
- package/es/components/shortcut-setter/index.d.ts +6 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +6 -1
- package/es/components/steps-wheel/index.d.ts +1 -1
- package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +1 -1
- package/es/components/table-filter/index.d.ts +1171 -7721
- package/es/components/table-filter/index.js +1 -1
- package/es/components/table-filter/src/base-search-com/BaseSearch.vue.d.ts +42 -3529
- package/es/components/table-filter/src/base-search-com/BaseSearch.vue.js +1 -1
- package/es/components/table-filter/src/classification/Classification-com.vue.d.ts +486 -2454
- package/es/components/table-filter/src/classification/Classification-com.vue.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/hooks/useDisplayCategory.d.ts +1 -1
- package/es/components/table-filter/src/components/classify-filter/hooks/useDisplayCategory.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.d.ts +1 -42
- package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +45 -5
- package/es/components/table-filter/src/components/classify-filter/index.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/index.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
- package/es/components/table-filter/src/components/search-filter/index.vue.d.ts +456 -0
- package/es/components/table-filter/src/components/search-filter/index.vue.js +1 -0
- package/es/components/table-filter/src/components/{search-modal/set-classification.vue.d.ts → set-classification/index.vue.d.ts} +37 -818
- package/es/components/table-filter/src/components/set-classification/index.vue.js +1 -0
- package/es/components/table-filter/src/components/table-modal/index.vue.js +1 -0
- package/es/components/table-filter/src/hooks/export.js +1 -1
- package/es/components/table-filter/src/hooks/useAdvanced.d.ts +3 -3
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
- package/es/components/table-filter/src/hooks/useMixins.d.ts +3 -2
- package/es/components/table-filter/src/hooks/useMixins.js +1 -1
- package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
- package/es/components/table-filter/src/quick-search/QuickSearch.vue.d.ts +47 -1188
- package/es/components/table-filter/src/quick-search/QuickSearch.vue.js +1 -1
- package/es/components/table-filter/src/types/index.d.ts +4 -14
- package/es/components/table-filter/style/index.css +1 -1
- package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.d.ts +1 -1
- package/package.json +2 -2
- package/es/components/iho-table/src/plugins/filterPlugin/filter.vue.js +0 -1
- package/es/components/iho-table/src/plugins/filterPlugin/index.d.ts +0 -1
- package/es/components/iho-table/src/plugins/filterPlugin/index.js +0 -1
- package/es/components/iho-table/src/plugins/filterPlugin/types.d.ts +0 -7
- package/es/components/iho-table/src/plugins/filterPlugin/types.js +0 -1
- package/es/components/table-filter/src/classification/search-class-name.vue.d.ts +0 -71
- package/es/components/table-filter/src/classification/search-class-name.vue.js +0 -1
- package/es/components/table-filter/src/classification/search-professional-model.vue.d.ts +0 -1119
- package/es/components/table-filter/src/classification/search-professional-model.vue.js +0 -1
- package/es/components/table-filter/src/components/age-com/index.vue.d.ts +0 -119
- package/es/components/table-filter/src/components/age-com/index.vue.js +0 -1
- package/es/components/table-filter/src/components/button-group/ButtonGroup.vue.d.ts +0 -199
- package/es/components/table-filter/src/components/button-group/ButtonGroup.vue.js +0 -1
- package/es/components/table-filter/src/components/button-icon/getBtnIcon.d.ts +0 -2
- package/es/components/table-filter/src/components/button-icon/getBtnIcon.js +0 -1
- package/es/components/table-filter/src/components/c-tree-select/tree-select.vue.d.ts +0 -90
- package/es/components/table-filter/src/components/c-tree-select/tree-select.vue.js +0 -1
- package/es/components/table-filter/src/components/multi-select/multi-select.vue.d.ts +0 -113
- package/es/components/table-filter/src/components/multi-select/multi-select.vue.js +0 -1
- package/es/components/table-filter/src/components/out-quick-search/out-quick-search.vue.d.ts +0 -266
- package/es/components/table-filter/src/components/out-quick-search/out-quick-search.vue.js +0 -1
- package/es/components/table-filter/src/components/range-age/index.vue.d.ts +0 -248
- package/es/components/table-filter/src/components/range-age/index.vue.js +0 -1
- package/es/components/table-filter/src/components/search-condition/SearchCondition.vue.d.ts +0 -789
- package/es/components/table-filter/src/components/search-condition/SearchCondition.vue.js +0 -1
- package/es/components/table-filter/src/components/search-condition/fieldTypeList.d.ts +0 -18
- package/es/components/table-filter/src/components/search-condition/fieldTypeList.js +0 -1
- package/es/components/table-filter/src/components/search-filter/SearchFilter.vue.d.ts +0 -1217
- package/es/components/table-filter/src/components/search-filter/SearchFilter.vue.js +0 -1
- package/es/components/table-filter/src/components/search-modal/set-classification.vue.js +0 -1
- package/es/components/table-filter/src/components/table-modal/TableModal.vue.js +0 -1
- package/es/components/table-filter/src/const/dataOptions.d.ts +0 -36
- package/es/components/table-filter/src/const/dataOptions.js +0 -1
- package/es/components/table-filter/src/directive/preventReClick.d.ts +0 -4
- package/es/components/table-filter/src/directive/preventReClick.js +0 -1
- /package/es/components/table-filter/src/components/table-modal/{TableModal.vue.d.ts → index.vue.d.ts} +0 -0
|
@@ -42,7 +42,7 @@ export declare class Print {
|
|
|
42
42
|
_queryPrintFile(formatId: string, params?: string): Promise<any>;
|
|
43
43
|
_browserPrint(result: AnyObject, mode: string): Promise<string | void>;
|
|
44
44
|
preview({ templateId, formatId, params, btnprint }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<any>;
|
|
45
|
-
printDirect({ templateId, formatId, params, print, printdlgshow, nobillnode }: AnyObject, successCallbackFn: Func, errorCallbackFn: Func, mode?: string): Promise<any>;
|
|
45
|
+
printDirect({ templateId, formatId, params, print, printdlgshow, nobillnode, isDownloadFile }: AnyObject, successCallbackFn: Func, errorCallbackFn: Func, mode?: string): Promise<any>;
|
|
46
46
|
private _downloadPDF;
|
|
47
47
|
/**
|
|
48
48
|
* 下载pdf
|
|
@@ -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=t.create({withCredentials:!1}),c=`${window.location.protocol}//${window.location.host}`,p=`${c}/fdp-api/print/assembly/printIReport`,u=`${c}/bi-api/reprot/print/open/client/getRemote`,m=`${c}/printService/file`;let w=null;class f{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.messageHandlerQueue=[],w)return w;w=this;const e=window;this.webview=null==(t=e.chrome)?void 0:t.webview,this.webview&&(this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler),this.postMessage({exec:"config",data:""}))}messageHandler(t){var e;const i=this.messageHandlerQueue.shift();if(!i)return console.log("当前回执",t,"没有可用的handler");const{resolve:n,reject:s}=i;try{const{exec:i}=JSON.parse(t.data);"config"===i&&(this.downloadPath=(null==(e=JSON.parse(t.data).res)?void 0:e.downloadpath)||""),console.log(t),n(JSON.parse(t.data).res)}catch(t){s(t)}}async postMessage(t){return this.webview?new Promise(((e,i)=>{this.messageHandlerQueue.push({resolve:e,reject:i}),this.webview.postMessage(t)})):Promise.reject()}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(t){return this.webview?this.postMessage({exec:"print",data:{inputData:t}}):h({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(t)}}).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}}_handleResult(t,e){if("success"!==t.result){const i={type:"printError",message:t.message||t.Message,result:t.result,errinfo:t.errinfo};return null==e||e(i),!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="1",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 this.isRemote&&(d.print={print:"1",type:"
|
|
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=t.create({withCredentials:!1}),c=`${window.location.protocol}//${window.location.host}`,p=`${c}/fdp-api/print/assembly/printIReport`,u=`${c}/bi-api/reprot/print/open/client/getRemote`,m=`${c}/printService/file`;let w=null;class f{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.messageHandlerQueue=[],w)return w;w=this;const e=window;this.webview=null==(t=e.chrome)?void 0:t.webview,this.webview&&(this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler),this.postMessage({exec:"config",data:""}))}messageHandler(t){var e;const i=this.messageHandlerQueue.shift();if(!i)return console.log("当前回执",t,"没有可用的handler");const{resolve:n,reject:s}=i;try{const{exec:i}=JSON.parse(t.data);"config"===i&&(this.downloadPath=(null==(e=JSON.parse(t.data).res)?void 0:e.downloadpath)||""),console.log(t),n(JSON.parse(t.data).res)}catch(t){s(t)}}async postMessage(t){return this.webview?new Promise(((e,i)=>{this.messageHandlerQueue.push({resolve:e,reject:i}),this.webview.postMessage(t)})):Promise.reject()}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(t){return this.webview?this.postMessage({exec:"print",data:{inputData:t}}):h({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(t)}}).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}}_handleResult(t,e){if("success"!==t.result){const i={type:"printError",message:t.message||t.Message,result:t.result,errinfo:t.errinfo};return null==e||e(i),!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="1",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 this.isRemote&&(d.print={print:"1",type:"1",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${l(new Date,"yyyyMMddHHmmss")}`});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 h({method:"get",url:u})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=c+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await h({method:"post",url:p,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-1],o=await s(`${m}/${a}`),l=r(null,e,o);if("preview"===e)return l}}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;const h=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:this.isRemote?"7":"8",btnprint:n});if(!h)return!1;const c=this._handleResult(h,l);if(!c)return!1;if(this.isRemote){const t=await this._browserPrint(c,"preview");this.instance||(this.instance=o()),this.showPreview(this.instance,t)}s&&s(c)}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 p=await this._testConnection();if(!this._handleResultTest(p,h))return!1;const u=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:"7",print:n,printdlgshow:s,nobillnode:o});if(!u)return!1;const m=this._handleResult(u,h);if(!m)return!1;l&&["downloadPDF"].includes(c)&&await this._browserPrint(m,c),d&&d(m)}_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){this.webview&&this.downloadPath&&(t.print.filename=this.downloadPath.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)}),(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{f as Print};
|
|
@@ -43,6 +43,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
43
43
|
fold?: boolean | undefined;
|
|
44
44
|
required?: boolean | undefined;
|
|
45
45
|
requiredDisabled?: boolean | undefined;
|
|
46
|
+
editableDisabled?: boolean | undefined;
|
|
46
47
|
editable?: boolean | undefined;
|
|
47
48
|
notes?: string | undefined;
|
|
48
49
|
desc?: string | undefined;
|
|
@@ -64,6 +65,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
64
65
|
fold?: boolean | undefined;
|
|
65
66
|
required?: boolean | undefined;
|
|
66
67
|
requiredDisabled?: boolean | undefined;
|
|
68
|
+
editableDisabled?: boolean | undefined;
|
|
67
69
|
editable?: boolean | undefined;
|
|
68
70
|
notes?: string | undefined;
|
|
69
71
|
desc?: string | undefined;
|
|
@@ -452,6 +454,9 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
452
454
|
}[]>;
|
|
453
455
|
onScroll: (scrollEvent: Event) => void;
|
|
454
456
|
triggerAutoHidden: (field: import("@formily/core").GeneralField) => Promise<void>;
|
|
457
|
+
observeFormGraph: Record<string, import("@formily/core").GeneralField>;
|
|
458
|
+
setGraph: (field: import("@formily/core").GeneralField) => void;
|
|
459
|
+
removeGraph: (field: import("@formily/core").GeneralField) => void;
|
|
455
460
|
formModel: import("@formily/core").Form<{
|
|
456
461
|
[x: string]: any;
|
|
457
462
|
}>;
|
|
@@ -576,7 +581,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
576
581
|
clearSpan: (uuid: string) => void;
|
|
577
582
|
exposeEvent: {
|
|
578
583
|
validate(path?: string): Promise<void>;
|
|
579
|
-
getFormValues(needCombineExtendKey?: boolean
|
|
584
|
+
getFormValues(needCombineExtendKey?: boolean): any;
|
|
580
585
|
setFormValues(values: import("../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean): void;
|
|
581
586
|
setFieldState(path: string, handler: (field: Partial<Pick<import("@formily/core").Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
|
|
582
587
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
@@ -1056,6 +1061,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1056
1061
|
[Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
|
|
1057
1062
|
} | undefined;
|
|
1058
1063
|
regular_error_tip?: string | undefined;
|
|
1064
|
+
message?: string | undefined;
|
|
1059
1065
|
} | undefined;
|
|
1060
1066
|
option?: {
|
|
1061
1067
|
text: string;
|
|
@@ -1111,6 +1117,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1111
1117
|
extendKey?: string | undefined;
|
|
1112
1118
|
is_not_fold?: string | undefined;
|
|
1113
1119
|
remark?: string | undefined;
|
|
1120
|
+
free_entry?: import("..").FormCommonState | undefined;
|
|
1114
1121
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
1115
1122
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
1116
1123
|
lazyRequest?: boolean | undefined;
|
|
@@ -2696,6 +2703,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
2696
2703
|
fold?: boolean | undefined;
|
|
2697
2704
|
required?: boolean | undefined;
|
|
2698
2705
|
requiredDisabled?: boolean | undefined;
|
|
2706
|
+
editableDisabled?: boolean | undefined;
|
|
2699
2707
|
editable?: boolean | undefined;
|
|
2700
2708
|
notes?: string | undefined;
|
|
2701
2709
|
desc?: string | undefined;
|
|
@@ -2714,6 +2722,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
2714
2722
|
fold?: boolean | undefined;
|
|
2715
2723
|
required?: boolean | undefined;
|
|
2716
2724
|
requiredDisabled?: boolean | undefined;
|
|
2725
|
+
editableDisabled?: boolean | undefined;
|
|
2717
2726
|
editable?: boolean | undefined;
|
|
2718
2727
|
notes?: string | undefined;
|
|
2719
2728
|
desc?: string | undefined;
|
|
@@ -3015,6 +3024,9 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
3015
3024
|
}[]>;
|
|
3016
3025
|
onScroll: (scrollEvent: Event) => void;
|
|
3017
3026
|
triggerAutoHidden: (field: import("@formily/core").GeneralField) => Promise<void>;
|
|
3027
|
+
observeFormGraph: Record<string, import("@formily/core").GeneralField>;
|
|
3028
|
+
setGraph: (field: import("@formily/core").GeneralField) => void;
|
|
3029
|
+
removeGraph: (field: import("@formily/core").GeneralField) => void;
|
|
3018
3030
|
formModel: import("@formily/core").Form<{
|
|
3019
3031
|
[x: string]: any;
|
|
3020
3032
|
}>;
|
|
@@ -3139,7 +3151,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
3139
3151
|
clearSpan: (uuid: string) => void;
|
|
3140
3152
|
exposeEvent: {
|
|
3141
3153
|
validate(path?: string): Promise<void>;
|
|
3142
|
-
getFormValues(needCombineExtendKey?: boolean
|
|
3154
|
+
getFormValues(needCombineExtendKey?: boolean): any;
|
|
3143
3155
|
setFormValues(values: import("../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean): void;
|
|
3144
3156
|
setFieldState(path: string, handler: (field: Partial<Pick<import("@formily/core").Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
|
|
3145
3157
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
@@ -44,6 +44,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
44
44
|
fold?: boolean | undefined;
|
|
45
45
|
required?: boolean | undefined;
|
|
46
46
|
requiredDisabled?: boolean | undefined;
|
|
47
|
+
editableDisabled?: boolean | undefined;
|
|
47
48
|
editable?: boolean | undefined;
|
|
48
49
|
notes?: string | undefined;
|
|
49
50
|
desc?: string | undefined;
|
|
@@ -65,6 +66,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
65
66
|
fold?: boolean | undefined;
|
|
66
67
|
required?: boolean | undefined;
|
|
67
68
|
requiredDisabled?: boolean | undefined;
|
|
69
|
+
editableDisabled?: boolean | undefined;
|
|
68
70
|
editable?: boolean | undefined;
|
|
69
71
|
notes?: string | undefined;
|
|
70
72
|
desc?: string | undefined;
|
|
@@ -453,6 +455,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
453
455
|
}[]>;
|
|
454
456
|
onScroll: (scrollEvent: Event) => void;
|
|
455
457
|
triggerAutoHidden: (field: import("@formily/core").GeneralField) => Promise<void>;
|
|
458
|
+
observeFormGraph: Record<string, import("@formily/core").GeneralField>;
|
|
459
|
+
setGraph: (field: import("@formily/core").GeneralField) => void;
|
|
460
|
+
removeGraph: (field: import("@formily/core").GeneralField) => void;
|
|
456
461
|
formModel: import("@formily/core").Form<{
|
|
457
462
|
[x: string]: any;
|
|
458
463
|
}>;
|
|
@@ -577,7 +582,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
577
582
|
clearSpan: (uuid: string) => void;
|
|
578
583
|
exposeEvent: {
|
|
579
584
|
validate(path?: string): Promise<void>;
|
|
580
|
-
getFormValues(needCombineExtendKey?: boolean
|
|
585
|
+
getFormValues(needCombineExtendKey?: boolean): any;
|
|
581
586
|
setFormValues(values: import("../../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean): void;
|
|
582
587
|
setFieldState(path: string, handler: (field: Partial<Pick<import("@formily/core").Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
|
|
583
588
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
@@ -1057,6 +1062,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1057
1062
|
[Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
|
|
1058
1063
|
} | undefined;
|
|
1059
1064
|
regular_error_tip?: string | undefined;
|
|
1065
|
+
message?: string | undefined;
|
|
1060
1066
|
} | undefined;
|
|
1061
1067
|
option?: {
|
|
1062
1068
|
text: string;
|
|
@@ -1112,6 +1118,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1112
1118
|
extendKey?: string | undefined;
|
|
1113
1119
|
is_not_fold?: string | undefined;
|
|
1114
1120
|
remark?: string | undefined;
|
|
1121
|
+
free_entry?: import("../..").FormCommonState | undefined;
|
|
1115
1122
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
1116
1123
|
content?: string | import("../..").FormRenderer | Record<string, import("../..").FormRenderer> | undefined;
|
|
1117
1124
|
lazyRequest?: boolean | undefined;
|
|
@@ -2697,6 +2704,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2697
2704
|
fold?: boolean | undefined;
|
|
2698
2705
|
required?: boolean | undefined;
|
|
2699
2706
|
requiredDisabled?: boolean | undefined;
|
|
2707
|
+
editableDisabled?: boolean | undefined;
|
|
2700
2708
|
editable?: boolean | undefined;
|
|
2701
2709
|
notes?: string | undefined;
|
|
2702
2710
|
desc?: string | undefined;
|
|
@@ -2715,6 +2723,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2715
2723
|
fold?: boolean | undefined;
|
|
2716
2724
|
required?: boolean | undefined;
|
|
2717
2725
|
requiredDisabled?: boolean | undefined;
|
|
2726
|
+
editableDisabled?: boolean | undefined;
|
|
2718
2727
|
editable?: boolean | undefined;
|
|
2719
2728
|
notes?: string | undefined;
|
|
2720
2729
|
desc?: string | undefined;
|
|
@@ -3016,6 +3025,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3016
3025
|
}[]>;
|
|
3017
3026
|
onScroll: (scrollEvent: Event) => void;
|
|
3018
3027
|
triggerAutoHidden: (field: import("@formily/core").GeneralField) => Promise<void>;
|
|
3028
|
+
observeFormGraph: Record<string, import("@formily/core").GeneralField>;
|
|
3029
|
+
setGraph: (field: import("@formily/core").GeneralField) => void;
|
|
3030
|
+
removeGraph: (field: import("@formily/core").GeneralField) => void;
|
|
3019
3031
|
formModel: import("@formily/core").Form<{
|
|
3020
3032
|
[x: string]: any;
|
|
3021
3033
|
}>;
|
|
@@ -3140,7 +3152,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3140
3152
|
clearSpan: (uuid: string) => void;
|
|
3141
3153
|
exposeEvent: {
|
|
3142
3154
|
validate(path?: string): Promise<void>;
|
|
3143
|
-
getFormValues(needCombineExtendKey?: boolean
|
|
3155
|
+
getFormValues(needCombineExtendKey?: boolean): any;
|
|
3144
3156
|
setFormValues(values: import("../../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean): void;
|
|
3145
3157
|
setFieldState(path: string, handler: (field: Partial<Pick<import("@formily/core").Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
|
|
3146
3158
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
@@ -302,6 +302,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
302
302
|
}[]>;
|
|
303
303
|
onScroll: (scrollEvent: Event) => void;
|
|
304
304
|
triggerAutoHidden: (field: import("../../../../../es/components/form-render").GeneralField) => Promise<void>;
|
|
305
|
+
observeFormGraph: Record<string, import("../../../../../es/components/form-render").GeneralField>;
|
|
306
|
+
setGraph: (field: import("../../../../../es/components/form-render").GeneralField) => void;
|
|
307
|
+
removeGraph: (field: import("../../../../../es/components/form-render").GeneralField) => void;
|
|
305
308
|
formModel: import("../../../../../es/components/form-render").Form<{
|
|
306
309
|
[x: string]: any;
|
|
307
310
|
}>;
|
|
@@ -426,7 +429,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
426
429
|
clearSpan: (uuid: string) => void;
|
|
427
430
|
exposeEvent: {
|
|
428
431
|
validate(path?: string): Promise<void>;
|
|
429
|
-
getFormValues(needCombineExtendKey?: boolean
|
|
432
|
+
getFormValues(needCombineExtendKey?: boolean): any;
|
|
430
433
|
setFormValues(values: import("../../../../shared/types").AnyObject, needSplitExtendKey?: boolean): void;
|
|
431
434
|
setFieldState(path: string, handler: (field: Partial<Pick<import("../../../../../es/components/form-render").Field<any, any, any, any>, import("../../../../../es/components/form-render").NonFunctionPropertyNames<{
|
|
432
435
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,openBlock as t,createBlock as r,unref as o,mergeProps as
|
|
1
|
+
import{defineComponent as e,openBlock as t,createBlock as r,unref as o,mergeProps as i,withCtx as m,createElementVNode as a,normalizeStyle as s,resolveDynamicComponent as l}from"vue";import n from"../../../../shared/components/VueDraggable/src/vuedraggable.js";import{usePresetRenderer as u}from"../hooks/usePresetRenderer.js";import{useSortableConfig as d}from"../hooks/useSortalbeConfig.js";import"lodash-es";import{layoutWidthEnum2Column as p}from"../utils/index.js";import f from"../../../../_virtual/plugin-vue_export-helper.js";const g=["data-type","data-required"];var y=f(e({__name:"FormConfigDragDisplay",props:{fieldItem:{type:Object},textFormatter:{type:Function,required:!0}},setup(e){function f(e){return{"--item-column":e?p(e.layoutWidthEnum):24}}const{getRenderer:y}=u(),{getCommonConfig:c}=d();return(u,d)=>(t(),r(o(n),i(o(c)(e.fieldItem),{style:f(e.fieldItem)}),{item:m((({element:i})=>[a("div",{class:"form-config__displayContentItem","data-type":i.type,"data-required":i.required,style:s(f(i))},[(t(),r(l(o(y)(i)),{"field-item":i,textFormatter:e.textFormatter},null,8,["field-item","textFormatter"]))],12,g)])),_:1},16,["style"]))}}),[["__file","FormConfigDragDisplay.vue"]]);export{y as default};
|
|
@@ -64,6 +64,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
64
64
|
[Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
|
|
65
65
|
} | undefined;
|
|
66
66
|
regular_error_tip?: string | undefined;
|
|
67
|
+
message?: string | undefined;
|
|
67
68
|
} | undefined;
|
|
68
69
|
option?: {
|
|
69
70
|
text: string;
|
|
@@ -119,6 +120,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
119
120
|
extendKey?: string | undefined;
|
|
120
121
|
is_not_fold?: string | undefined;
|
|
121
122
|
remark?: string | undefined;
|
|
123
|
+
free_entry?: import("../../../../../es/components/form-render").FormCommonState | undefined;
|
|
122
124
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
123
125
|
content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
|
|
124
126
|
lazyRequest?: boolean | undefined;
|
|
@@ -1704,6 +1706,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1704
1706
|
fold?: boolean | undefined;
|
|
1705
1707
|
required?: boolean | undefined;
|
|
1706
1708
|
requiredDisabled?: boolean | undefined;
|
|
1709
|
+
editableDisabled?: boolean | undefined;
|
|
1707
1710
|
editable?: boolean | undefined;
|
|
1708
1711
|
notes?: string | undefined;
|
|
1709
1712
|
desc?: string | undefined;
|
|
@@ -1722,6 +1725,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1722
1725
|
fold?: boolean | undefined;
|
|
1723
1726
|
required?: boolean | undefined;
|
|
1724
1727
|
requiredDisabled?: boolean | undefined;
|
|
1728
|
+
editableDisabled?: boolean | undefined;
|
|
1725
1729
|
editable?: boolean | undefined;
|
|
1726
1730
|
notes?: string | undefined;
|
|
1727
1731
|
desc?: string | undefined;
|
|
@@ -2023,6 +2027,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2023
2027
|
}[]>;
|
|
2024
2028
|
onScroll: (scrollEvent: Event) => void;
|
|
2025
2029
|
triggerAutoHidden: (field: import("../../../../../es/components/form-render").GeneralField) => Promise<void>;
|
|
2030
|
+
observeFormGraph: Record<string, import("../../../../../es/components/form-render").GeneralField>;
|
|
2031
|
+
setGraph: (field: import("../../../../../es/components/form-render").GeneralField) => void;
|
|
2032
|
+
removeGraph: (field: import("../../../../../es/components/form-render").GeneralField) => void;
|
|
2026
2033
|
formModel: import("../../../../../es/components/form-render").Form<{
|
|
2027
2034
|
[x: string]: any;
|
|
2028
2035
|
}>;
|
|
@@ -2147,7 +2154,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2147
2154
|
clearSpan: (uuid: string) => void;
|
|
2148
2155
|
exposeEvent: {
|
|
2149
2156
|
validate(path?: string): Promise<void>;
|
|
2150
|
-
getFormValues(needCombineExtendKey?: boolean
|
|
2157
|
+
getFormValues(needCombineExtendKey?: boolean): any;
|
|
2151
2158
|
setFormValues(values: import("../../../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean): void;
|
|
2152
2159
|
setFieldState(path: string, handler: (field: Partial<Pick<import("../../../../../es/components/form-render").Field<any, any, any, any>, import("../../../../../es/components/form-render").NonFunctionPropertyNames<{
|
|
2153
2160
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as t,computed as i,openBlock as r,createBlock as
|
|
1
|
+
import{defineComponent as e,inject as t,computed as i,openBlock as r,createBlock as d,unref as l,mergeProps as o,withModifiers as f,withCtx as m,createVNode as a,normalizeClass as n,createTextVNode as s,toDisplayString as u,createCommentVNode as p}from"vue";import{NButton as c,NEllipsis as I}from"naive-ui";import _ from"./CloseButton.vue.js";import{InjectionActiveFieldItem as v,WidgetTextMap as y}from"../../constants/index.js";import{bindHover as x}from"../../utils/index.js";import j from"../../../../../_virtual/plugin-vue_export-helper.js";var q=j(e({__name:"DefaultNode",props:{fieldItem:{type:Object,required:!0},textFormatter:{type:Function,required:!0}},setup(e){const j=e,q=t(v);function g(){q.value=j.fieldItem}const h=i((()=>[{"is-active":q.value===j.fieldItem},"form-config__renderer"])),k=i((()=>["form-config__renderer--default",{"is-required":j.fieldItem.required}])),C=i((()=>!1===j.fieldItem.editable));function F(){const e=y.get(j.fieldItem.type);return j.textFormatter(j.fieldItem,`${j.fieldItem.name}${e?`(${e})`:""}`)}return(t,i)=>(r(),d(l(c),o({secondary:!l(C),dashed:l(C)},l(x)(e.fieldItem),{onClick:f(g,["stop"]),class:l(h),"data-type":e.fieldItem.type}),{default:m((()=>[a(l(I),{class:n(l(k))},{default:m((()=>[s(u(F()),1)])),_:1},8,["class"]),e.fieldItem.required?p("v-if",!0):(r(),d(_,{key:0,"field-item":e.fieldItem},null,8,["field-item"]))])),_:1},16,["secondary","dashed","onClick","class","data-type"]))}}),[["__file","DefaultNode.vue"]]);export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isArray as e}from"lodash-es";import{EditAbleField as t,widgetWidthOptionConfig as l,isShowOptionConfig as i,isNotFoldOptionConfig as
|
|
1
|
+
import{isArray as e}from"lodash-es";import{EditAbleField as t,widgetWidthOptionConfig as l,isShowOptionConfig as i,isNotFoldOptionConfig as a,isEditOptionConfig as _,isNullOptionConfig as E}from"../constants/index.js";function n(){const n=new Map([[t.NAME,()=>({alias:"名称",elem_width:6,is_null:"0",html_type:"INPUT"})],[t.NOTES,()=>({alias:"问号提示",elem_width:6,html_type:"INPUT"})],[t.DEFAULT_VALUE,t=>e(null==t?void 0:t.options)&&t.options.length?{alias:"默认值",elem_width:6,html_type:"SELECT",option:null==t?void 0:t.options}:{alias:"默认值",elem_width:6,html_type:"INPUT",validate:{max_length:20}}],[t.LAYOUT_WIDTH_ENUM,()=>({alias:"宽度",fieldType:"number",html_type:"SELECT",elem_width:6,...l()})],[t.DESC,()=>({alias:"说明文本",elem_width:6,html_type:"INPUT",validate:{max_length:30}})],[t.DEFAULT_EXPAND,()=>({alias:"是否默认展开",html_type:"SWITCH",elem_width:6,...i()})],[t.FOLD,()=>({alias:"是否可折叠",html_type:"SWITCH",elem_width:6,...a()})],[t.EDITABLE,e=>({alias:"是否可编辑",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.editableDisabled)?"0":"1",..._()})],[t.REQUIRED,e=>({alias:"是否必填",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.requiredDisabled)?"0":"1",...E()})]]);function m(e,t){return t.map((t=>{var l,i;return{...null!=(i=null==(l=n.get(t))?void 0:l(e))?i:{},val_key:t}}))}return{generateFieldListByKeys:m,generateFieldListByFieldItem:function(e){const l=new Map([["LINE_BAR",[t.NAME,t.LAYOUT_WIDTH_ENUM,t.NOTES,t.DEFAULT_EXPAND,t.FOLD]],...["NEWLINE","COMPLEX","COMBINATION"].map((e=>[e,[t.NAME,t.LAYOUT_WIDTH_ENUM]]))]),i=[t.NAME,t.DEFAULT_VALUE,t.LAYOUT_WIDTH_ENUM,t.DESC,t.NOTES,t.EDITABLE,t.REQUIRED];return m(e,l.get(e.type)||i)}}}export{n as useConfigurationField};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{findAncestor as o}from"../../../../shared/utils/index.js";import{FORM_CONFIG_GROUP as s}from"../constants/index.js";function
|
|
1
|
+
import{findAncestor as o}from"../../../../shared/utils/index.js";import{FORM_CONFIG_GROUP as s}from"../constants/index.js";function t(){let t,e=null;function i({target:o,item:s}){e=setTimeout((()=>{o.classList.add("is-choosing-area"),s.classList.add("is-choosing")}),200)}function a({from:o,to:s,target:t,item:i}){clearTimeout(e),[o,s,t].forEach((o=>{o.classList.remove("is-choosing-area")})),i.classList.remove("is-choosing")}function n({to:s,from:e,dragged:i}){return("LINE_BAR"!==i.dataset.type||!o(s,(o=>"LINE_BAR"===o.dataset.type)))&&(("true"!==i.dataset.required||!o(s,(o=>o.classList.contains("form-config__materialContent"))))&&(null==t||t.classList.remove("is-choosing-area"),t=s,s!==e&&e.classList.remove("is-choosing-area"),void s.classList.add("is-choosing-area")))}return{getCommonConfig:o=>({move:n,onChoose:i,onUnchoose:a,tag:"section",forceFallback:!1,animation:"150","item-key":"key",group:"COMBINATION"===(null==o?void 0:o.type)?o.key:s})}}export{t as useSortableConfig};
|
|
@@ -289,6 +289,9 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
289
289
|
}[]>;
|
|
290
290
|
onScroll: (scrollEvent: Event) => void;
|
|
291
291
|
triggerAutoHidden: (field: import("@formily/core/esm/types").GeneralField) => Promise<void>;
|
|
292
|
+
observeFormGraph: Record<string, import("@formily/core/esm/types").GeneralField>;
|
|
293
|
+
setGraph: (field: import("@formily/core/esm/types").GeneralField) => void;
|
|
294
|
+
removeGraph: (field: import("@formily/core/esm/types").GeneralField) => void;
|
|
292
295
|
formModel: import("@formily/core/esm/models/Form").Form<{
|
|
293
296
|
[x: string]: any;
|
|
294
297
|
}>;
|
|
@@ -413,7 +416,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
413
416
|
clearSpan: (uuid: string) => void;
|
|
414
417
|
exposeEvent: {
|
|
415
418
|
validate(path?: string): Promise<void>;
|
|
416
|
-
getFormValues(needCombineExtendKey?: boolean
|
|
419
|
+
getFormValues(needCombineExtendKey?: boolean): any;
|
|
417
420
|
setFormValues(values: import("../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean): void;
|
|
418
421
|
setFieldState(path: string, handler: (field: Partial<Pick<import("@formily/core/esm/models/Field").Field<any, any, any, any>, import("@formily/core/esm/types").NonFunctionPropertyNames<{
|
|
419
422
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{COMPONENT_NAMESPACE as e}from"../../shared/global/variable.js";import{safeComponentRegister as s}from"../../shared/utils/index.js";import r from"./src/FormRenderWrapper.vue.js";export{useFieldListAdaptor}from"./src/hooks/useFieldListAdaptor.js";export{useFormRequest}from"./src/hooks/useFormRequest.js";export{useCommonLog}from"./src/hooks/useCommonLog.js";export{useFormField}from"./src/hooks/useFormField.js";export{AsyncQueue,useAsyncQueue}from"./src/hooks/useAsyncQueue.js";export{useFieldVisitor}from"./src/hooks/useFieldVisitor.js";export{useFieldNormalize}from"./src/hooks/useFieldNormalize.js";export{useFormValidator,validateMessageLocale}from"./src/hooks/useFormValidator.js";export{BusinessCollector,useBusinessBinding}from"./src/hooks/useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./src/hooks/useChangeContext.js";export{FormItemDepsCollector,useFormItemDeps}from"./src/hooks/useFormItemDeps.js";export{useAnchor}from"./src/hooks/useAnchor.js";export{useFormContext}from"./src/hooks/useFormContext.js";export{useCommonInjection,useSelectOptionProps}from"./src/hooks/useCommonInjection.js";export{searchContentMatcher,useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./src/hooks/useFormRenderOptions.js";export{combineExtendKey,createInputSlot,createSlot,createUrlConfigParams,formRenderLog,injectOrProvide,isNestedFieldType,isNestedType,keywordMatcher,mergeDeepProperties,parseNumberFromMaybeString,presetRequestHandler,splitExtendKey,validateMessageParser}from"./src/utils/index.js";export*from"@formily/core";export{businessDateParser,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./src/utils/business.js";export{findNextWidget,
|
|
1
|
+
import{COMPONENT_NAMESPACE as e}from"../../shared/global/variable.js";import{safeComponentRegister as s}from"../../shared/utils/index.js";import r from"./src/FormRenderWrapper.vue.js";export{useFieldListAdaptor}from"./src/hooks/useFieldListAdaptor.js";export{useFormRequest}from"./src/hooks/useFormRequest.js";export{useCommonLog}from"./src/hooks/useCommonLog.js";export{useFormField}from"./src/hooks/useFormField.js";export{AsyncQueue,useAsyncQueue}from"./src/hooks/useAsyncQueue.js";export{useFieldVisitor}from"./src/hooks/useFieldVisitor.js";export{useFieldNormalize}from"./src/hooks/useFieldNormalize.js";export{useFormValidator,validateMessageLocale}from"./src/hooks/useFormValidator.js";export{BusinessCollector,useBusinessBinding}from"./src/hooks/useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./src/hooks/useChangeContext.js";export{FormItemDepsCollector,useFormItemDeps}from"./src/hooks/useFormItemDeps.js";export{useAnchor}from"./src/hooks/useAnchor.js";export{useFormContext}from"./src/hooks/useFormContext.js";export{useCommonInjection,useSelectOptionProps}from"./src/hooks/useCommonInjection.js";export{searchContentMatcher,useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./src/hooks/useFormRenderOptions.js";export{combineExtendKey,createInputSlot,createSlot,createUrlConfigParams,formRenderLog,injectOrProvide,isNestedFieldType,isNestedType,keywordMatcher,mergeDeepProperties,parseNumberFromMaybeString,presetRequestHandler,splitExtendKey,validateMessageParser}from"./src/utils/index.js";export*from"@formily/core";export{businessDateParser,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./src/utils/business.js";export{findNextWidget,queryDecoratorByAddress,queryDecoratorByFieldKey,queryInput}from"./src/utils/dom.js";export{assignClearBindVisited,assignUpdateValue,assignValueBindKey,createLinebarId,createObjSchema,createVisitedSetter,dotEscape,fieldKeyEscape,getParentLinebar,traverseDependKey,traverseSchema}from"./src/utils/schema.js";const o=r;o.install=function(r){s(r,o,e+"FormRender")};export{o as default};
|
|
@@ -283,6 +283,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
283
283
|
}[]>;
|
|
284
284
|
onScroll: (scrollEvent: Event) => void;
|
|
285
285
|
triggerAutoHidden: (field: import("@formily/core").GeneralField) => Promise<void>;
|
|
286
|
+
observeFormGraph: Record<string, import("@formily/core").GeneralField>;
|
|
287
|
+
setGraph: (field: import("@formily/core").GeneralField) => void;
|
|
288
|
+
removeGraph: (field: import("@formily/core").GeneralField) => void;
|
|
286
289
|
formModel: import("@formily/core").Form<{
|
|
287
290
|
[x: string]: any;
|
|
288
291
|
}>;
|
|
@@ -407,7 +410,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
407
410
|
clearSpan: (uuid: string) => void;
|
|
408
411
|
exposeEvent: {
|
|
409
412
|
validate(path?: string): Promise<void>;
|
|
410
|
-
getFormValues(needCombineExtendKey?: boolean
|
|
413
|
+
getFormValues(needCombineExtendKey?: boolean): any;
|
|
411
414
|
setFormValues(values: AnyObject, needSplitExtendKey?: boolean): void;
|
|
412
415
|
setFieldState(path: string, handler: (field: Partial<Pick<import("@formily/core").Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
|
|
413
416
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as o,computed as t,
|
|
1
|
+
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,openBlock as i,createBlock as l,unref as n,withCtx as m,createElementBlock as p,createVNode as u,isRef as d,Fragment as c,renderList as f,createCommentVNode as h,createElementVNode as y,normalizeStyle as j,withKeys as v,withModifiers as g,toDisplayString as b}from"vue";import{createForm as k,onFieldValueChange as F,onFieldMount as x,onFieldUnmount as C,onFieldReact as H,onFormMount as S}from"@formily/core";import{FormProvider as A,FormConsumer as R}from"@formily/vue";import{isNumber as _,cloneDeep as L}from"lodash-es";import{NForm as O,NTabs as w,NTabPane as B,NConfigProvider as V}from"naive-ui";import{InjectionFormGraph as I}from"./constants/index.js";import{useAutoHidden as N}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as D}from"./hooks/useComplexOptions.js";import{useFormDomEvent as q,useFormExposeEvent as U}from"./hooks/useFormEvent.js";import{useFormGraph as W}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as G}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeReactions as K}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as M}from"./hooks/useNuiThemeOverrides.js";import"./utils/index.js";import{useFieldListAdaptor as T}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/index.js";import"../index.js";import{useFieldVisitor as E}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 P}from"./hooks/useFormValidator.js";import"@vueuse/core";import"date-fns";import{useAnchor as J}from"./hooks/useAnchor.js";import{useFormContext as z}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";import Q from"../../../_virtual/plugin-vue_export-helper.js";import{createObjSchema as X}from"./utils/schema.js";const Y={key:0,style:{height:"54px"}},Z={style:{"white-space":"pre"}};var $=Q(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},linebarAutoHidden:{type:Boolean}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:Q,emit:$}){const ee=e,{nuiThemeOverrides:oe}=M();P();const te=o(),re=t((()=>_(ee.maxHeight)?ee.maxHeight+"px":ee.maxHeight)),{SchemaField:se,businessCollector:ae,formItemDepsCollector:ie,changeContextCollector:le,formUUID:ne}=z(ee,$),{anchorBarRef:me,currentAnchor:pe,generateAnchorList:ue,updateAnchorList:de,anchorIdList:ce,onScroll:fe}=J(ee,$,te,ie);G(ee).callLifeCycle("onSetup");const{trigger:he}=N(),{observeFormGraph:ye,setGraph:je,removeGraph:ve}=W();r(I,ye);const ge=k({initialValues:ee.initialData,effects(e){F("*",(o=>{const t=o.props.name.toString();ae.trigger(e,t),ie.trigger(t),$("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:le.getContext(t,o.value)}),be(t,o.value)})),x("*",je),C("*",ve),ee.linebarAutoHidden&&(H("*",he),S((e=>e.query("*").forEach(he)))),ee.anchor&&(H("*",de),S(ue))}}),{lowCodeReactionsHandler:be,triggerAllReactionsHandler:ke}=K(t((()=>ee.lowCodeReactions)),ge);s(ke);const{schemaAdaptor:Fe}=T(ae);let xe=ee.fieldList||[];const Ce=t((()=>ee.schema?ee.schema:ee.fieldList?(xe=E().traverse(L(ee.fieldList),ee.fieldVisitor),X(Fe(xe))):X({}))),{onKeydown:He}=q({formModel:ge,formRenderRef:te,props:ee}),{clearSpan:Se}=D();a((()=>Se(ne)));const Ae=U({formModel:ge,formRenderRef:te,formItemDepsCollector:ie,getFieldList:()=>xe,formUUID:ne});return Q({formModel:ge,validate:(e="*")=>Ae.validate(e),getFormValues:(e=!0)=>Ae.getFormValues(e),setFormValues:(e,o=!0)=>Ae.setFormValues(e,o),setFieldState(e,o){Ae.setFieldState(e,o)},resetFields(e="*"){Ae.resetFields(e)},queryWidget:async e=>Ae.queryWidget(e),async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(i(),l(n(O),{class:"form-render","require-mark-placement":"left"},{default:m((()=>[e.anchor?(i(),p("section",Y,[u(n(w),{value:n(pe),"onUpdate:value":t[0]||(t[0]=e=>d(pe)?pe.value=e:null),type:"line",ref_key:"anchorBarRef",ref:me},{default:m((()=>[(i(!0),p(c,null,f(n(ce),(e=>(i(),l(n(B),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):h("v-if",!0),u(n(V),{"theme-overrides":n(oe)},{default:m((()=>[y("section",{class:"form-render__wrapper",style:j({"--column":e.column,"--form-height":n(re)}),ref_key:"formRenderRef",ref:te,onScroll:t[1]||(t[1]=(...e)=>n(fe)&&n(fe)(...e)),onKeydownCapture:t[2]||(t[2]=v(g(((...e)=>n(He)&&n(He)(...e)),["prevent"]),["enter"]))},[u(n(A),{form:n(ge)},{default:m((()=>[u(n(se),{schema:n(Ce)},null,8,["schema"]),e.consumer?(i(),l(n(R),{key:0},{default:m((({form:e})=>[y("div",Z,b(JSON.stringify(e.values,null,2)),1)])),_:1})):h("v-if",!0)])),_:1},8,["form"])],36)])),_:1},8,["theme-overrides"])])),_:1}))}}),[["__file","FormRender.vue"]]);export{$ as default};
|
|
@@ -286,6 +286,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
286
286
|
}[]>;
|
|
287
287
|
onScroll: (scrollEvent: Event) => void;
|
|
288
288
|
triggerAutoHidden: (field: import("../../../../es/components/form-render").GeneralField) => Promise<void>;
|
|
289
|
+
observeFormGraph: Record<string, import("../../../../es/components/form-render").GeneralField>;
|
|
290
|
+
setGraph: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
291
|
+
removeGraph: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
289
292
|
formModel: import("../../../../es/components/form-render").Form<{
|
|
290
293
|
[x: string]: any;
|
|
291
294
|
}>;
|
|
@@ -410,7 +413,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
410
413
|
clearSpan: (uuid: string) => void;
|
|
411
414
|
exposeEvent: {
|
|
412
415
|
validate(path?: string): Promise<void>;
|
|
413
|
-
getFormValues(needCombineExtendKey?: boolean
|
|
416
|
+
getFormValues(needCombineExtendKey?: boolean): any;
|
|
414
417
|
setFormValues(values: import("../../../shared/types").AnyObject, needSplitExtendKey?: boolean): void;
|
|
415
418
|
setFieldState(path: string, handler: (field: Partial<Pick<import("../../../../es/components/form-render").Field<any, any, any, any>, import("../../../../es/components/form-render").NonFunctionPropertyNames<{
|
|
416
419
|
match: (pattern: import("@formily/path").Pattern) => boolean;
|
|
@@ -16,6 +16,7 @@ export declare const DATE: import("vue").DefineComponent<{
|
|
|
16
16
|
decimal_length: string | number;
|
|
17
17
|
regular_expression: string | RegExp;
|
|
18
18
|
regular_error_tip: string;
|
|
19
|
+
message: string;
|
|
19
20
|
}>>;
|
|
20
21
|
};
|
|
21
22
|
valueFormat: {
|
|
@@ -39,6 +40,7 @@ export declare const DATE: import("vue").DefineComponent<{
|
|
|
39
40
|
decimal_length: string | number;
|
|
40
41
|
regular_expression: string | RegExp;
|
|
41
42
|
regular_error_tip: string;
|
|
43
|
+
message: string;
|
|
42
44
|
}>>;
|
|
43
45
|
};
|
|
44
46
|
valueFormat: {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
1
2
|
export declare const FORM_ITEM: import("vue").DefineComponent<{
|
|
2
3
|
label: StringConstructor;
|
|
3
4
|
propertyKey: StringConstructor;
|
|
@@ -6,6 +7,9 @@ export declare const FORM_ITEM: import("vue").DefineComponent<{
|
|
|
6
7
|
type: NumberConstructor;
|
|
7
8
|
default: number;
|
|
8
9
|
};
|
|
10
|
+
suffixFields: {
|
|
11
|
+
type: PropType<string[]>;
|
|
12
|
+
};
|
|
9
13
|
annotation: {};
|
|
10
14
|
fieldItem: {};
|
|
11
15
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -16,6 +20,9 @@ export declare const FORM_ITEM: import("vue").DefineComponent<{
|
|
|
16
20
|
type: NumberConstructor;
|
|
17
21
|
default: number;
|
|
18
22
|
};
|
|
23
|
+
suffixFields: {
|
|
24
|
+
type: PropType<string[]>;
|
|
25
|
+
};
|
|
19
26
|
annotation: {};
|
|
20
27
|
fieldItem: {};
|
|
21
28
|
}>>, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as r,computed as o,
|
|
1
|
+
import{defineComponent as e,inject as r,computed as o,ref as t,onUnmounted as l,createVNode as i,mergeProps as s}from"vue";import{arrayed as a,widthAppend as m}from"../../../../../shared/utils/index.js";import{isVoidField as n}from"@formily/core";import{observe as u,autorun as f}from"@formily/reactive";import{connect as d,mapProps as p}from"@formily/vue";import{useDebounceFn as v}from"@vueuse/core";import{isArray as c,isString as y}from"lodash-es";import{NFormItem as _}from"naive-ui";import g from"../../../../annotation-edit/index.js";import"../../../index.js";import b from"../tooltipMessage.vue.js";import{InjectionFormUUID as x,InjectionFormGraph as j,InjectionAnnotation as I}from"../../constants/index.js";import{useComplexOptionsSpan as k}from"../../hooks/useComplexOptions.js";import{dotEscape as h}from"../../utils/schema.js";import{useFormField as F}from"../../hooks/useFormField.js";import{validateMessageParser as L}from"../../utils/index.js";const q=d(e({name:"FormRenderItem",props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},annotation:{},fieldItem:{}},setup(e,{slots:a}){const{field:d,fieldKey:p,fieldAddress:y}=F(),L=r(x),q=o((()=>h(`${L}-${y.value}`))),K=t(!1);if(n(d.value)&&c(e.suffixFields)){const o=r(j);l(u(o,v((()=>{n(d.value)&&c(e.suffixFields)&&(K.value=e.suffixFields.some((e=>{const r=d.value.form.query(e).take();return r&&Reflect.get(r,"required")})))}),100)))}else l(f((()=>{K.value=Reflect.get(d.value,"required")})));const R=r(I),S=o({get(){var r,o;return null!=(o=null==(r=R.value)?void 0:r[e.propertyKey])?o:""},set(r){R.value={property:e.propertyKey,value:r}}});const A=o((()=>R.value&&!1!==e.annotation)),E=o((()=>e.label&&" "!==e.label)),V=o((()=>{let r=0;return A.value&&(r+=18),e.remark&&(r+=18),r}));function $(){return E.value?i("section",{class:"form-render__formItemLabel"},[i("span",{class:"form-render__formItemLabel--text",style:{marginRight:m(V.value)}},[e.label]),V.value?i("section",{class:"form-render__formItemLabel--operation"},[e.remark?i("div",{class:"form-render__formItemLabel--tooltip"},[i(b,{message:e.remark},null)]):null,A.value?i(g,{class:"form-render__formItemLabel--annotation",modelValue:S.value,"onUpdate:modelValue":e=>S.value=e},null):null]):null]):null}const{getSpan:w}=k();return()=>i(_,s({class:"form-render__formItem",style:{"--form-item-column":w(L,d.value.address,!1)+e.span}},{id:q.value,uuid:L,"widget-type":d.value.componentType,"field-key":h(p.value),"field-address":h(y.value),required:K.value}),{...a,label:$})}}),p({title:"label"},((e,r)=>{const o=n(r)?void 0:a(r.selfErrors).length?function(e,r){if(!y(r.defined_error_msg)||!r.defined_error_msg)return e.map((e=>L(e,r))).join(",");return L(r.defined_error_msg,r)}(a(r.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:o,"validation-status":o?"error":void 0}})));export{q as FORM_ITEM};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,createVNode as o,isVNode as t}from"vue";import{connect as a,mapProps as
|
|
1
|
+
import{defineComponent as e,createVNode as o,isVNode as t}from"vue";import{connect as a,mapProps as r}from"@formily/vue";import{NSpace as l,NRadio as u,NRadioGroup as i,NCheckbox as n,NCheckboxGroup as p}from"naive-ui";import"../../../index.js";import{useComplexOptions as s}from"../../hooks/useComplexOptions.js";import"../../utils/index.js";import{useAutographOptions as m}from"../../hooks/useFormRenderOptions.js";import{useCommonInjection as v}from"../../hooks/useCommonInjection.js";import{assignUpdateValue as c,createVisitedSetter as d}from"../../utils/schema.js";import{useFormField as f}from"../../hooks/useFormField.js";function y(a,r,u){return e({name:a,props:{value:{type:[String,Number,Object,Array]},options:{type:Array,default:()=>[]},autograph:{type:String},lazyRequest:{type:Boolean,default:!1},requestCache:{type:Boolean,default:!0},wordbook:{type:Object},vertical:{type:Boolean,default:!1},onChange:{}},emits:["update:value"],setup(e,{emit:a}){const{field:i}=f(),{renderComplexOption:n,valueRef:p}=s(e,a),{labelKey:c,valueKey:y,options:j}=m(e,p),{injectValueBindKey:b,injectValueValidate:h}=v();h(p);const k=b(p);return()=>o(r,{key:k.value,value:p.value,"onUpdate:value":e=>p.value=e,onClick:d(i)},{default:()=>[o(l,{vertical:e.vertical,"vertical-space":e.vertical},{default:()=>{var e;return[null==(e=j.value)?void 0:e.map((e=>{let a;return o(u,{key:e[y.value],value:e[y.value],disabled:e.disabled},"function"==typeof(r=a=n({value:p.value,option:e,valueKey:y.value,labelKey:c.value}))||"[object Object]"===Object.prototype.toString.call(r)&&!t(r)?a:{default:()=>[a]});var r}))]}})]})}})}const j=a(y("FormRadio",i,u),r({dataSource:"options"},c)),b=a(y("FormCheckbox",p,n),r({dataSource:"options"},c));export{b as CHECKBOX,j as RADIO};
|
|
@@ -20,6 +20,7 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
20
20
|
default: () => never[];
|
|
21
21
|
};
|
|
22
22
|
onChange: {};
|
|
23
|
+
allowCreate: BooleanConstructor;
|
|
23
24
|
urlConfig: {
|
|
24
25
|
type: PropType<UrlConfig>;
|
|
25
26
|
};
|
|
@@ -82,6 +83,7 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
82
83
|
default: () => never[];
|
|
83
84
|
};
|
|
84
85
|
onChange: {};
|
|
86
|
+
allowCreate: BooleanConstructor;
|
|
85
87
|
urlConfig: {
|
|
86
88
|
type: PropType<UrlConfig>;
|
|
87
89
|
};
|
|
@@ -137,4 +139,5 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
137
139
|
recommend: boolean;
|
|
138
140
|
recommendCache: boolean;
|
|
139
141
|
recommendNum: number;
|
|
142
|
+
allowCreate: boolean;
|
|
140
143
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as o,inject as t,createVNode as r}from"vue";import{useDebounceFn as
|
|
1
|
+
import{defineComponent as e,computed as o,inject as t,ref as a,createVNode as r}from"vue";import{useDebounceFn as l}from"@vueuse/core";import{cloneDeep as s,isString as i}from"lodash-es";import{useCommonInjection as n,useSelectOptionProps as u}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as p}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"../../../index.js";import"../../utils/index.js";import{useFormField as m}from"../../hooks/useFormField.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"../../hooks/useFormValidator.js";import"@formily/core";import"date-fns";import"@formily/reactive";import{connect as c,mapProps as d}from"@formily/vue";import"@vue/shared";import"./index.js";import{useUrlConfigOptions as y,useAutographOptions as v,useRecommendOptions as f,searchContentMatcher as h}from"../../hooks/useFormRenderOptions.js";import{NSelect as j}from"naive-ui";import{createVisitedSetter as b,assignUpdateValue as k,assignClearBindVisited as S}from"../../utils/schema.js";const g=c(e({name:"FormSelect",props:{value:{type:[String,Array]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},allowCreate:Boolean,urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},recommendNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1}},emits:["update:value","postRecommend"],setup(e,{slots:c,emit:d}){const k=o({get:()=>e.value,async set(e){d("update:value",e),B(e)}}),{labelKey:S,valueKey:g,fetchData:A,options:F}=e.urlConfig?y(e,k):v(e,k),{getRecommend:H,postRecommend:B,sortedOptions:C}=f(e,F,d,S,g),{field:x,fieldKey:R}=m();t(p).setContext(R.value,(e=>{return{currentOption:s((o=e,C.value.find((e=>e[g.value]===o))))};var o}));const L=a(""),O=l((async(e="")=>{L.value=e,A(e),H(e)}),300),{injectValueValidate:V,injectValueWatchFromEmpty:w,injectValueBindKey:K}=n();w(k,O),V(k);const P=K(k),{menuProps:W,nodeProps:q}=u();function I(e){const o=e[S.value];if(!o||!i(o))return"";const t=h(L.value,o);return t?r("section",null,[t.map(((e,o)=>0!==o&&e?r("span",{style:{color:o%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):o}const N=o((()=>C.value.length||!e.allowCreate?C.value:L.value?[{[S.value]:L.value,[g.value]:L.value},...C.value]:C.value));return()=>r(j,{key:P.value,remote:!0,filterable:!0,value:k.value,"onUpdate:value":e=>k.value=e,"menu-props":W,"node-props":q,labelField:S.value,valueField:g.value,options:N.value,onSearch:O,"onUpdate:show":e=>e&&O(),onFocus:b(x),renderLabel:I},c)}}),d({dataSource:"options"},k,S));export{g as SELECT};
|