cnhis-design-vue 3.2.17-release.1 → 3.2.18-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/index.d.ts +1 -0
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +1 -0
- package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +1 -0
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/field-editor/src/fields.js +1 -1
- package/es/components/field-set/index.d.ts +3 -2
- package/es/components/field-set/src/FieldColor.vue.d.ts +2 -0
- package/es/components/field-set/src/FieldFilter.vue.d.ts +2 -0
- package/es/components/field-set/src/FieldSet.vue.d.ts +2 -0
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/Index.vue.d.ts +3 -2
- package/es/components/field-set/src/Index.vue2.js +1 -1
- package/es/components/field-set/src/types/index.d.ts +1 -0
- package/es/components/field-set/style/index.css +1 -1
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/iho-chat/index.d.ts +155 -3
- package/es/components/iho-chat/src/Index.vue.d.ts +155 -3
- package/es/components/iho-chat/src/api/index.d.ts +1 -0
- package/es/components/iho-chat/src/api/index.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +9 -0
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +11 -1
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +22 -0
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +32 -1
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +77 -3
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +1 -0
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +1 -0
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +10 -0
- package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
- package/es/components/iho-chat/src/components/MessageEvent.vue.d.ts +1 -0
- package/es/components/iho-chat/src/components/MessageMergeForward.vue.d.ts +59 -0
- package/es/components/iho-chat/src/components/MessageMergeForward.vue.js +1 -0
- package/es/components/iho-chat/src/components/MessageMergeForward.vue2.js +1 -0
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +10 -0
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +1 -0
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +1 -0
- package/es/components/iho-chat/src/components/Video.vue.d.ts +1 -0
- package/es/components/iho-chat/src/hooks/useData.d.ts +4 -2
- package/es/components/iho-chat/src/hooks/useData.js +1 -1
- package/es/components/iho-chat/src/hooks/useVideo.d.ts +1 -0
- package/es/components/iho-chat/src/types/index.d.ts +1 -0
- package/es/components/iho-chat/src/utils/index.d.ts +1 -0
- package/es/components/iho-chat/src/utils/index.js +1 -1
- package/es/components/iho-chat/style/iconfont.ttf +0 -0
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +5 -0
- package/es/components/index.css +1 -1
- package/es/components/select-label/style/index.css +1 -1
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/es/components/select-person/src/index.vue2.js +1 -1
- package/es/components/select-person/style/index.css +1 -1
- package/es/components/shortcut-provider/src/types/index.d.ts +3 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue2.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/index.js +1 -1
- package/package.json +2 -2
@@ -482,6 +482,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<{
|
|
482
482
|
printAllShortcut: import("vue").ComputedRef<any>;
|
483
483
|
showSettingItems: import("vue").ComputedRef<import("../../shared/types").AnyObject[]>;
|
484
484
|
isSelectedAll: import("vue").WritableComputedRef<boolean>;
|
485
|
+
innerFilterPrintItems: import("vue").ComputedRef<any[]>;
|
485
486
|
initShowDownList: () => Promise<void>;
|
486
487
|
printAllButtonClick: (origin: string) => Promise<void>;
|
487
488
|
renderLabel: (option: import("../../shared/types").AnyObject) => JSX.Element;
|
@@ -488,6 +488,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
488
488
|
printAllShortcut: import("vue").ComputedRef<any>;
|
489
489
|
showSettingItems: import("vue").ComputedRef<AnyObject[]>;
|
490
490
|
isSelectedAll: import("vue").WritableComputedRef<boolean>;
|
491
|
+
innerFilterPrintItems: import("vue").ComputedRef<any[]>;
|
491
492
|
initShowDownList: () => Promise<void>;
|
492
493
|
printAllButtonClick: (origin: string) => Promise<void>;
|
493
494
|
renderLabel: (option: AnyObject) => JSX.Element;
|
@@ -256,6 +256,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
256
256
|
printAllShortcut: import("vue").ComputedRef<any>;
|
257
257
|
showSettingItems: import("vue").ComputedRef<AnyObject[]>;
|
258
258
|
isSelectedAll: import("vue").WritableComputedRef<boolean>;
|
259
|
+
innerFilterPrintItems: import("vue").ComputedRef<any[]>;
|
259
260
|
initShowDownList: () => Promise<void>;
|
260
261
|
printAllButtonClick: (origin: string) => Promise<void>;
|
261
262
|
renderLabel: (option: AnyObject) => JSX.Element;
|
@@ -1 +1 @@
|
|
1
|
-
import{createElementVNode as e,defineComponent as t,inject as n,ref as a,reactive as i,computed as r,onMounted as l,onBeforeUnmount as o,watch as s,openBlock as u,createElementBlock as d,Fragment as c,createCommentVNode as p,createVNode as m,unref as v,withCtx as g,renderList as y,createBlock as f,mergeProps as w,createTextVNode as h,toDisplayString as k,normalizeStyle as b,isRef as P,renderSlot as C,withModifiers as S,normalizeClass as I}from"vue";import{isObject as L}from"@vue/shared";import{useMessage as O,NButtonGroup as x,NDropdown as T,NButton as j,NIcon as M,NPopover as E,NCheckbox as F,NDivider as B}from"naive-ui";import{PrintOutline as N,SettingsOutline as _,ChevronDownSharp as D,ArrowForwardOutline as R}from"@vicons/ionicons5";import{InjectionButtonPrintEmits as J}from"../constants/index.js";import{Print as U}from"../utils/print.js";import{isIReport as z}from"../utils/browserPrint.js";import A from"./IdentityVerification.vue.js";import{format as K}from"date-fns";import"../api.js";import"../../../shortcut-provider/index.js";import{encapBrowserLog as V}from"../../../../shared/utils/index.js";import{useShortcuts as H}from"../../../shortcut-provider/src/hooks/useShortcuts.js";var $,G,Y,q,Q,W,X;const Z={class:"newprint-button-outer"},ee={key:0,class:"newprint-button-outer__shortcut"},te=e("span",{class:"label bold"},(null==($=window.getLanguageByCode)?void 0:$.call(window,"10010.1.473"))||"外显设置",-1),ne={class:"print-lite"},ae={class:"label bold"},ie={class:"print-li"},re={class:"print-lite"},le={key:0,class:"newprint-button-outer__shortcut"},oe=["onMouseenter","onClick"],se={class:"label bold"},ue={class:"print-lite",style:{background:"transparent"}},de={class:"label bold"},ce={class:"print-li"},pe={class:"print-lite",style:{background:"transparent"}},me=["onClick"],ve={key:0,class:"newprint-button-outer__shortcut"},ge={class:"newprint-button-poperOver"},ye=["onMouseenter"],fe={class:"print-lite",style:{background:"transparent"}},we=["onClick"];var he=t({__name:"NewPrintComponent",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:(null==(G=window.getLanguageByCode)?void 0:G.call(window,"10010.1.478"))||"打印",type:String},printText:{default:(null==(Y=window.getLanguageByCode)?void 0:Y.call(window,"10010.1.479"))||"直接打印",type:String},previewText:{default:(null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.480"))||"打印预览",type:String},pdfLoadText:{default:(null==(Q=window.getLanguageByCode)?void 0:Q.call(window,"10010.1.481"))||"下载pdf",type:String},formatEditText:{default:(null==(W=window.getLanguageByCode)?void 0:W.call(window,"10010.1.482"))||"格式编辑",type:String},prevFn:{default:()=>Promise.resolve(),type:Function},queryPrintFormatByNumber:{default:()=>Promise.resolve({}),type:Function},strategy:{default:"MULTI",type:String},clickPrevFn:{default:()=>Promise.resolve(!0),type:Function},noDataMsg:{default:(null==(X=window.getLanguageByCode)?void 0:X.call(window,"10010.1.483"))||"请选中需要打印的数据",type:String},token:{type:String},printdlgshow:{default:"0",type:String},btnprint:{type:String,default:"1"},directPrint:{type:Boolean,default:!1},externalOptionConfig:{type:Object,default:()=>({})},signature:{type:String},showLoading:{type:Boolean,default:!0},hideButtons:{type:Array,default:()=>[]},printCopies:{type:Number},resolution:{type:Number},newPrintSetting:{type:Object,default:()=>({isShowPrintAll:!0,printAllType:1,isShowOutSetting:!0,customProps:{},outerPrintKeys:[],defaultFormatId:"",shortcut:{},buttonProps:{},showMaxHeight:null})},svrUpdateIp:{type:String}},setup(t,{expose:$}){var G,Y,q;const Q=t;String(navigator.platform).toLowerCase().includes("linux");const W=[{label:(null==(G=window.getLanguageByCode)?void 0:G.call(window,"10010.1.476"))||"分割线",key:"divider"},{label:(null==(Y=window.getLanguageByCode)?void 0:Y.call(window,"10010.1.473"))||"外显设置",key:"outSetting"}],X=O();let he;const ke=n(J),be=a(""),Pe=i({spinning:!1,visible:!1,formatList:[],templateParams:[],printParams:[],originParams:{},currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null,isClickOuterPrint:!1,curPrintParamList:[],iReportExecuteMode:1}),Ce=a({});let Se=a([]),Ie=a([{label:Q.previewText,key:"previewText"},{label:Q.pdfLoadText,key:"downloadPdf"},{label:Q.formatEditText,key:"formatEditText"},{label:(null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.484"))||"重置打印机",key:"resetPrinter"}]);const Le=i({oneMouseType:"",oneClickType:"",twoMouseType:""}),Oe=i({oneShow:!1,isOperation:!1,isOutSetting:!1}),xe=a([]),Te=a([]),je=r((()=>{if(!Pe.currentFormatId)return{};let e=Pe.currentFormatId;return Pe.formatList.find((t=>t.id===e))}));r((()=>{var e,t;return(null==(e=je.value)?void 0:e.name)||(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.485"))||"格式选择"}));const Me=r((()=>{let e=Pe.formatList.find((e=>e.id===Pe.currentFormatId));return null==e?void 0:e.templateId})),Ee=r((()=>{let e=Pe.formatList.find((e=>e.id===Pe.currentFormatId));return null==e?void 0:e.number})),Fe=r((()=>{var e;return null==(e=Q.newPrintSetting)?void 0:e.isShowPrintAll})),Be=r((()=>{var e;return null==(e=Q.newPrintSetting)?void 0:e.isShowOutSetting})),Ne=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.customProps)||{}})),_e=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.defaultFormatId)||""})),De=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.printAllType)||1})),Re=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.shortcut)||{}})),Je=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.buttonProps)||{}})),Ue=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.showMaxHeight)||{}})),ze=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.printAllFormatIds)||[]})),Ae=r((()=>{var e;return null==(e=Q.newPrintSetting)?void 0:e.positionElement})),Ke=r((()=>{var e,t;const n=Object.keys(Re.value);if(n.length>0){if(_e.value&&n.includes(_e.value))return(null==(e=Re.value[_e.value])?void 0:e.shortcutLabel)||"";if(n.includes("all"))return(null==(t=Re.value.all)?void 0:t.shortcutLabel)||""}return""})),Ve=r((()=>{const e=W.map((e=>e.key));return Se.value.filter((t=>!e.includes(t.key)))})),He=r({get:()=>Ve.value.every((e=>e.selected)),set(e){Ve.value.forEach((t=>{t.selected=e}))}}),$e=async()=>{var e,t;(null==(t=null==(e=Q.newPrintSetting)?void 0:e.outerPrintKeys)?void 0:t.length)||await kt(),Oe.oneShow=!0},Ge=async e=>{if(Q.directPrint){if(Pe.spinning)return;return"button"===e?void(Fe.value?await Ct():_e.value?async function(e){await kt(!1);const t=xe.value.find((t=>t.key==e));t&&ot(t.templateCode,t.templateId,t.key,!1)}(_e.value):$e()):$e()}return $e()},Ye=(e,t)=>Pe.printParams[t.templateCode]?z(t.key)?e.filter((e=>"formatEditText"!=e.key)):e:[],qe=(e,t)=>{Le[e]=t},Qe=()=>{xe.value=Se.value.filter((e=>!e.selected)),Te.value=Ve.value.filter((e=>e.selected)),Xe("oneShow"),Xe("isOutSetting"),ke("saveOuterPrint",Te.value)},We=e=>{Oe[e]=!0},Xe=e=>{Le.oneClickType="",Oe[e]=!1,"isOutSetting"==e&&(Oe.isOutSetting=!1)},Ze=(e,t)=>{rt(!1);let n={type:t,formatId:Pe.currentFormatId,templateId:(null==e?void 0:e.templateId)||Me.value,templateCode:(null==e?void 0:e.templateCode)||Ee.value};V({type:"进入成功的回调",info:n},"PRINT-SDK"),ke("success",e,n)},et=e=>{rt(!1),V({type:"进入失败的回调",res:e},"PRINT-SDK"),ke("error",e),L(e)&&"notInstalledApp"===e.type&&X.error(e.message)},tt=e=>{rt(!1),ke("cancel",e)},nt=e=>{var t;const n={message:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.486"))||"前置条件执行错误",type:e,preExecution:!0};ke("error",n)},at=()=>JSON.stringify({...Q.token?{token:Q.token}:{}}),it=(e=[],t)=>{var n,a;let i={},r={};if((null==(n=Pe.templateParams[t].customizeDataset)?void 0:n.length)>0){const t=(null==(a=Object.keys(e[0].datasetData||{}))?void 0:a[0])||"",n=JSON.stringify(e.map((e=>JSON.parse(e.datasetData[t]))));r={datasetData:{}},r.datasetData[t]=n}else Object.keys(e[0]).forEach((t=>{r[t]=[],e.forEach((e=>{r[t].includes(e[t])||r[t].push(e[t])})),r[t]=r[t].join(",")}));return i=Object.assign({},JSON.parse(at()),r,Ne.value),JSON.stringify(i)},rt=(e,t)=>{if(Pe.isClickOuterPrint){if(e&&t){const n=Te.value.find((e=>e.key==t));return void(n&&(n.isLoading=e))}Te.value.forEach((e=>{e.isLoading=!1}))}else Pe.spinning=e},lt=()=>Pe.isClickOuterPrint?Te.value.some((e=>e.isLoading)):Pe.spinning,ot=(e,t,n,a)=>{const i=Pe.printParams[e];if(!i)return;Pe.isClickOuterPrint=a,Pe.currentFormatId=n;const r=Pe.originParams[e]||[];st(i,e,t,n,r)},st=async(e=[],t,n,a,i=[],r)=>{let l=e.length;const o=async e=>{try{--l<=0&&Ze(e,"print")}catch(e){console.log("error",e)}};Q.showLoading&<()&&!r||(rt(!0,a),Q.prevFn("print",{formatId:a,templateId:n,params:e}).then((()=>{var r;Pe.curPrintParamList=e;const l=(null==(r=Ne.value)?void 0:r.printdlgshow)||Q.printdlgshow,s={formatId:a,iReportExecuteMode:Pe.iReportExecuteMode,templateId:n,authorizationKey:be.value,printdlgshow:l,signature:Q.signature,copies:Q.printCopies,svrUpdateIp:Q.svrUpdateIp};if("MULTI"===Q.strategy)for(let t=0;t<e.length;t++){t>0&&(s.printdlgshow="0");const n=JSON.stringify(Object.assign({},JSON.parse(at()),e[t],Ne.value));he.printDirect({...s,params:n},o,et,tt)}else he.printDirect({...s,params:it(e,t)},(e=>{e.params=i,e.templateCode=t,e.templateId=n,Ze(e,"print")}),et,tt)})).catch((()=>{nt("print"),rt(!1)})).finally((()=>{Pe.visible=!1})))},ut=async(e,{templateCode:t,templateId:n,key:a},i)=>{const r=Pe.printParams[t];if(r)switch(Pe.isClickOuterPrint=i,Pe.currentFormatId=a,e){case"previewText":(async(e=[],t,n,a)=>{Q.showLoading&<()||(rt(!0,a),Q.prevFn("preview",{formatId:a,templateId:n,params:e}).then((()=>{Pe.curPrintParamList=e;const i=JSON.stringify(Object.assign({},JSON.parse(at()),e[0],Ne.value)),r="MULTI"===Q.strategy?i:it(e,t),l={formatId:a,templateId:n,iReportExecuteMode:Pe.iReportExecuteMode,authorizationKey:be.value,params:r,btnprint:Q.btnprint,signature:Q.signature};he.preview(l,(e=>{Ze(e,"preview")}),et)})).catch((()=>{nt("preview"),rt(!1)})).finally((()=>{Pe.visible=!1})))})(r,t,n,a);break;case"formatEditText":((e=[],t,n,a)=>{Q.showLoading&<()||(rt(!0,a),Q.prevFn("edit",{formatId:a,templateId:n,params:e}).then((()=>{Pe.curPrintParamList=e,Pe.currentFormatId=a,Pe.identityVerification.visible=!0})).catch((()=>{nt("edit")})).finally((()=>{rt(!1)})))})(r,0,n,a);break;case"downloadPdf":(async(e=[],t,n,a)=>{Q.showLoading&<()||(rt(!0,a),Q.prevFn("download",{formatId:a,templateId:n,params:e}).then((()=>{Pe.curPrintParamList=e;const i=JSON.stringify(Object.assign({},JSON.parse(at()),e[0],Ne.value)),r="MULTI"===Q.strategy?i:it(e,t),l={formatId:a,templateId:n,iReportExecuteMode:Pe.iReportExecuteMode,authorizationKey:be.value,print:{print:"1",type:"1",resolution:null==Q?void 0:Q.resolution},params:r,signature:Q.signature};he.downloadPDF(l,(e=>Ze(e,"preview")),et)})).catch((()=>{nt("download"),rt(!1)})).finally((()=>{Pe.visible=!1})))})(r,t,n,a);break;case"resetPrinter":(async(e=[],t,n,a)=>{var i,r,l;if(!Q.showLoading||!lt()){rt(!0,a);try{const e=await he.resetPrinter(a,Pe.iReportExecuteMode);if(rt(!1),"success"==(null==e?void 0:e.result))return void X.success((null==e?void 0:e.message)||(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.487"))||"重置打印机成功");X.warning((null==e?void 0:e.message)||(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.488"))||"重置打印机失败")}catch(e){rt(!1),X.warning((null==e?void 0:e.message)||(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.488"))||"重置打印机失败")}}})(r,0,0,a)}},dt=()=>{},ct=(e,t=[])=>{let n={};return(t=t||[]).forEach((t=>{n=Object.assign({},gt(n,t,e))})),n},pt=(e,t=[])=>{let n={};return(t=t||[]).forEach((t=>{n=Object.assign({},yt(n,t,e))})),n},mt=(e,t,n)=>{const a={};return t.forEach((t=>{let i=((e,t)=>{const n={DATE:"yyyy-MM-dd",DATETIME:"yyyy-MM-dd HH:mm:ss"};let a=t;return Object.keys(n).includes(e.type)&&t&&t instanceof Date&&(a=K(t,n[e.type])),(null==e?void 0:e.defaultValue)||a})(t,e[t[n]]);e[t[n]]&&i&&(a[t[n]]=i)})),a},vt=({customizeDataset:e=[],param:t=[]},n={})=>{let a={};return e.forEach((e=>{const t=e.dataSetting[0].selectFieldList;a.datasetData||(a.datasetData={}),a.datasetData[e.name]=JSON.stringify(mt(n,t,"fieldName"))})),a=Object.assign({},a,mt(n,t,"key")),a},gt=(e,t,n)=>{if(t.templateNumbers){for(let a=0;a<t.templateNumbers.length;a++){const i=t.templateNumbers[a],r=n[i];if(!r)return e;e[i]||(e[i]=[]),e[i].push(vt(r,t))}return e}const a=Object.keys(n);for(let i=0;i<a.length;i++){const r=a[i],l=n[r];if(!l)return e;e[r]||(e[r]=[]),e[r].push(vt(l,t))}return e},yt=(e,t,n)=>{if(t.templateNumbers){for(let a=0;a<t.templateNumbers.length;a++){const i=t.templateNumbers[a];if(!n[i])return e;e[i]||(e[i]=[]),e[i].push(t)}return e}const a=Object.keys(n);for(let i=0;i<a.length;i++){const r=a[i];if(!n[r])return e;e[r]||(e[r]=[]),e[r].push(t)}return e},ft=async e=>{var t;Pe.formatList=e?(e=>{let t=[];return e&&e.forEach((e=>{if(!e.format)return!1;t.push(...e.format.map((t=>Object.assign({},t,{templateName:e.name}))))})),t})(e.obj):[],Pe.iReportExecuteMode=(null==(t=null==e?void 0:e.obj)?void 0:t.length)>0&&e.obj[0].iReportExecuteMode||1,(()=>{var e,t,n;const a=Object.keys(Re.value),i=Pe.formatList.map((e=>{const t={templateCode:e.number,templateId:e.templateId,label:e.name,key:e.id,selected:!1,isLoading:!1};if(a.includes(e.id)){const n=Re.value[e.id];n&&(t.shortcutLabel=n.shortcutLabel)}return t}));Se.value.unshift(...i),Be.value&&Se.value.push(...W),(null==(t=null==(e=Q.newPrintSetting)?void 0:e.outerPrintKeys)?void 0:t.length)>0&&(Se.value.forEach((e=>{var t;(null==(t=Q.newPrintSetting)?void 0:t.outerPrintKeys.includes(e.key))&&(e.selected=!0)})),Te.value=Se.value.filter((e=>e.selected))),xe.value=Se.value.filter((e=>!e.selected)),Q.hideButtons.length>0&&(Ie.value=Ie.value.filter((e=>!Q.hideButtons.includes(e.key))));const r=sessionStorage.getItem("portal");if(r){const e=JSON.parse(r),t=(null==(n=null==e?void 0:e.user)?void 0:n.currentRoleResourceObj)||{},a=Object.keys(t);a.includes("RY7.2.21.1.M2.G94181E")||(Ie.value=Ie.value.filter((e=>"downloadPdf"!=e.key))),a.includes("RY7.2.21.1.M2.G33633A")||(Ie.value=Ie.value.filter((e=>"formatEditText"!=e.key))),a.includes("RY7.2.21.1.M2.G99314S")||(Ie.value=Ie.value.filter((e=>"resetPrinter"!=e.key)))}})(),Pe.templateParams=(e=>{let t={};return e&&e.forEach((e=>{if(!e.templateConfig)return!1;t[e.number]=e.templateConfig})),t})(e.obj),Pe.printParams=ct(Pe.templateParams,Q.params),Pe.originParams=pt(Pe.templateParams,Q.params),ht()},wt=async()=>{var e;if(Pe.isInited)return!0;Pe.isInited=!0,Pe.spinning=!0,(()=>{if(he)return!1;he=new U})();const t=await Q.queryPrintFormatByNumber();return await ft(t),(null==(e=t.obj)?void 0:e.length)>0&&(be.value=t.obj[0].authorizationKey||""),Pe.spinning=!1,!0},ht=async()=>{const e=Object.keys(Re.value);if(e.length>0)for(let t=0;t<e.length;t++){const n=e[t],a=Re.value[n],{stop:i,signature:r}=H().register({label:a.code,shortcutSignature:a.shortcutKey,operation:["state","reset"],callback(){"all"==n&&Ge("button");const e=Ve.value.map((e=>e.key)),t=Pe.originParams;if(e.includes(n)){const e=Ve.value.find((e=>e.key==n));if(e){const n=Pe.printParams[null==e?void 0:e.templateCode],a=t[null==e?void 0:e.templateCode]||[];st(n,e.templateCode,e.templateId,e.key,a)}}}});Ce.value[n]=i}},kt=async(e=!0)=>{if(await Q.clickPrevFn()){if(!Pe.visible){if(!await wt())return!1}e&&(Pe.visible=!Pe.visible)}},bt=e=>{if(Pe.identityVerification.visible=!1,z(Pe.currentFormatId))return Ze({result:"success",message:""},"edit");const t=JSON.stringify(Object.assign({},JSON.parse(at()),Pe.curPrintParamList[0],Ne.value)),n="MULTI"===Q.strategy?t:it(Pe.curPrintParamList,Ee.value),a={formatId:Pe.currentFormatId,templateId:Me.value,params:n,token:e};he.editPrintFormat(a,(e=>{Ze(e,"edit")}),et)},Pt=(e,t)=>{const n=Te.value[t+1];return t<Te.value.length-1&&!Pe.printParams[e.templateCode]&&Pe.printParams[n.templateCode]};async function Ct(){await kt(!1),(()=>{var e;const t=Object.keys(Pe.printParams);Pe.isClickOuterPrint=!1;const n=Pe.originParams;if((null==(e=Object.keys(ze.value))?void 0:e.length)>0)Se.value.forEach((e=>{if(ze.value.includes(e.key)){const t=Pe.printParams[e.templateCode],a=n[e.templateCode]||[];Pe.currentFormatId=e.key,st(t,e.templateCode,e.templateId,e.key,a,!0)}}));else{if(1==De.value)for(let e=0;e<t.length;e++){const a=t[e],i=Pe.printParams[a],r=n[a]||[],l=Pe.formatList.filter((e=>e.number==a));l&&l.length>0&&l.forEach((e=>{Pe.currentFormatId=e.id,st(i,e.number,e.templateId,e.id,r,!0)}))}2==De.value&&Te.value.forEach((e=>{const t=Pe.printParams[e.templateCode],a=n[e.templateCode]||[];Pe.currentFormatId=e.key,st(t,e.templateCode,e.templateId,e.key,a,!0)}))}})()}return l((()=>{Pe.isInited=!1})),o((()=>{const e=Object.keys(Ce.value);e.length>0&&e.forEach((e=>{Ce.value[e]&&Ce.value[e]()}))})),s((()=>Q.params),(e=>{Object.keys(Pe.templateParams).length>0&&(Pe.printParams=ct(Pe.templateParams,Q.params),Pe.originParams=pt(Pe.templateParams,Q.params))}),{deep:!0}),s((()=>{var e;return null==(e=Q.newPrintSetting)?void 0:e.outerPrintKeys}),(async e=>{(null==e?void 0:e.length)>0&&await kt(!1)}),{deep:!0,immediate:!0}),$({directPrint:Ct}),(n,a)=>(u(),d(c,null,[e("div",Z,[p(" 外显按钮集合 "),m(v(x),{class:"outButtonGroup"},{default:g((()=>[(u(!0),d(c,null,y(Te.value,((e,n)=>(u(),f(v(T),{key:e.key,class:"c-dropdown",placement:"bottom-start",trigger:"hover",onClickoutside:dt,options:Ye(v(Ie),e),onSelect:t=>ut(t,e,!0)},{default:g((()=>[m(v(j),w(v(Je),{disabled:!Pe.printParams[e.templateCode],loading:t.showLoading&&e.isLoading,onClick:t=>ot(e.templateCode,e.templateId,e.key,!0),class:n==Te.value.length-1?"outerLastButton":Pt(e,n)?"isPrintDisabled":""}),{icon:g((()=>[m(v(M),{component:v(N),size:"18"},null,8,["component"])])),default:g((()=>[h(" "+k(e.label)+" ",1),e.shortcutLabel?(u(),d("span",ee,k(e.shortcutLabel),1)):p("v-if",!0)])),_:2},1040,["disabled","loading","onClick","class"])])),_:2},1032,["options","onSelect"])))),128))])),_:1}),p(" 外显设置按钮 "),Te.value.length>0&&Te.value.length==v(Ve).length&&v(Be)&&2!=v(De)?(u(),f(v(E),{key:0,trigger:"click",to:v(Ae),"show-arrow":!1,show:Oe.isOutSetting,onClickoutside:a[2]||(a[2]=e=>Xe("isOutSetting"))},{trigger:g((()=>[m(v(j),w(v(Je),{class:Te.value.length>0?"printAllLeftCls":"",onClick:a[0]||(a[0]=e=>We("isOutSetting"))}),{default:g((()=>[te,m(v(M),{style:{"margin-left":"8px"},component:v(_),size:"18"},null,8,["component"])])),_:1},16,["class"])])),default:g((()=>[e("div",{class:"newprint-button-poperOver",style:b({maxHeight:v(Ue)?`${v(Ue)}px`:void 0})},[(u(!0),d(c,null,y(v(Ve),(t=>(u(),d("div",{class:"print-li",key:t.key},[e("div",ne,[e("span",ae,k(t.label),1),m(v(F),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.474"))||"外显")]})),_:2},1032,["checked","onUpdate:checked"])])])))),128)),e("div",ie,[m(v(B)),e("div",re,[m(v(j),{type:"primary",size:"small",onClick:Qe},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.244"))||"保存")]})),_:1}),v(Ve)&&v(Ve).length>1?(u(),f(v(F),{key:0,checked:v(He),"onUpdate:checked":a[1]||(a[1]=e=>P(He)?He.value=e:null)},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.37"))||"全选")]})),_:1},8,["checked"])):p("v-if",!0)])])],4)])),_:1},8,["to","show"])):(u(),d(c,{key:1},[p(" 打印全部按钮 "),m(v(E),{trigger:"click","show-arrow":!1,to:v(Ae),show:Oe.oneShow,onClickoutside:a[10]||(a[10]=e=>Xe("oneShow"))},{trigger:g((()=>[C(n.$slots,"button",{handleClickPrintBtn:$e,handlePrintBySetting:()=>Ge("button"),printSpinning:Pe.spinning,printbtnText:t.btnText,printVisible:Pe.visible},(()=>[m(v(x),{class:"newprint-button-component",onClick:a[4]||(a[4]=S((()=>Ge("icon")),["stop"]))},{default:g((()=>[m(v(j),w({loading:t.showLoading&&Pe.spinning},v(Je),{onClick:a[3]||(a[3]=S((()=>Ge("button")),["stop"])),class:Te.value.length>0?"printAllLeftCls":""}),{icon:g((()=>[m(v(M),{component:v(N),size:"18"},null,8,["component"])])),default:g((()=>{var e;return[h(" "+k(v(Fe)?(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.475"))||"打印全部":t.btnText)+" ",1),v(Ke)?(u(),d("span",le,k(v(Ke)),1)):p("v-if",!0)]})),_:1},16,["loading","class"]),m(v(j),w({class:"icon-select"},v(Je)),{icon:g((()=>[m(v(M),{component:v(D),size:"18"},null,8,["component"])])),_:1},16)])),_:1})]))])),default:g((()=>[e("div",{class:"newprint-button-poperOver",style:b({maxHeight:v(Ue)?`${v(Ue)}px`:void 0})},[(u(!0),d(c,null,y(xe.value,(t=>(u(),d("div",{class:I(["print-li",Le.oneMouseType==t.key||Le.oneClickType==t.key?"active":""]),key:t.key,onMouseenter:e=>qe("oneMouseType",t.key),onMouseleave:a[9]||(a[9]=e=>qe("oneMouseType","")),onClick:e=>((e,t,n)=>{if(!Pe.printParams[n.templateCode])return[];qe(e,t)})("oneClickType",t.key,t)},["divider"==t.key?(u(),f(v(B),{key:0})):"outSetting"==t.key?(u(),d(c,{key:1},[p(" 第二层外显设置 "),m(v(E),{trigger:"click","show-arrow":!1,to:!1,placement:"right-start",show:Oe.isOutSetting,onClickoutside:a[7]||(a[7]=e=>Xe("isOutSetting"))},{trigger:g((()=>[e("div",{class:"print-lite",onClick:a[5]||(a[5]=e=>We("isOutSetting"))},[e("span",se,k(t.label),1),m(v(M),{color:Te.value.length>0?"#2563F4":"",component:v(_),size:"18"},null,8,["color","component"])])])),default:g((()=>[e("div",{class:"newprint-button-poperOver",style:b({maxHeight:v(Ue)?`${v(Ue)}px`:void 0})},[(u(!0),d(c,null,y(v(Ve),(t=>(u(),d("div",{class:"print-li",key:t.key},[e("div",ue,[e("span",de,k(t.label),1),m(v(F),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.474"))||"外显")]})),_:2},1032,["checked","onUpdate:checked"])])])))),128)),e("div",ce,[m(v(B)),e("div",pe,[m(v(j),{type:"primary",size:"small",onClick:Qe},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.244"))||"保存")]})),_:1}),v(Ve)&&v(Ve).length>1?(u(),f(v(F),{key:0,checked:v(He),"onUpdate:checked":a[6]||(a[6]=e=>P(He)?He.value=e:null)},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.37"))||"全选")]})),_:1},8,["checked"])):p("v-if",!0)])])],4)])),_:2},1032,["show"])],2112)):(u(),d(c,{key:2},[p(" 第二层功能操作 "),e("div",{class:I(["print-lite",Pe.printParams[t.templateCode]?"":"isDisabled"]),style:{background:"transparent"}},[e("span",{class:"label bold",onClick:e=>ot(t.templateCode,t.templateId,t.key,!1)},[h(k(t.label)+" ",1),t.shortcutLabel?(u(),d("span",ve,k(t.shortcutLabel),1)):p("v-if",!0)],8,me),Pe.printParams[t.templateCode]?(u(),f(v(E),{key:0,trigger:"click","show-arrow":!1,to:!1,placement:"right-start",show:Oe[t.key],onClickoutside:e=>Xe(t.key)},{trigger:g((()=>[m(v(M),{component:v(R),size:"18",onClick:e=>We(t.key)},null,8,["component","onClick"])])),default:g((()=>[e("div",ge,[(u(!0),d(c,null,y(Ye(v(Ie),t),(n=>(u(),d("div",{class:I(["print-li",Le.twoMouseType==n.key?"active":""]),key:n.key,onMouseenter:e=>qe("twoMouseType",n.key),onMouseleave:a[8]||(a[8]=e=>qe("twoMouseType",""))},[e("div",fe,[e("span",{class:"label",onClick:e=>ut(n.key,t,!1)},k(n.label),9,we)])],42,ye)))),128))])])),_:2},1032,["show","onClickoutside"])):p("v-if",!0)],2)],2112))],42,oe)))),128))],4)])),_:3},8,["to","show"])],2112))]),m(A,w(n.$attrs,{modelValue:Pe.identityVerification.visible,"onUpdate:modelValue":a[11]||(a[11]=e=>Pe.identityVerification.visible=e),formatId:Pe.currentFormatId,templateId:v(Me),onSuccess:bt}),null,16,["modelValue","formatId","templateId"])],64))}});export{he as default};
|
1
|
+
import{createElementVNode as e,defineComponent as t,inject as n,ref as a,reactive as i,computed as r,onMounted as l,onBeforeUnmount as o,watch as s,openBlock as u,createElementBlock as d,Fragment as c,createCommentVNode as p,createVNode as m,unref as v,withCtx as g,renderList as y,createBlock as f,mergeProps as w,createTextVNode as h,toDisplayString as k,normalizeStyle as b,isRef as P,renderSlot as C,withModifiers as S,normalizeClass as I}from"vue";import{isObject as L}from"@vue/shared";import{useMessage as O,NButtonGroup as x,NDropdown as T,NButton as j,NIcon as M,NPopover as E,NCheckbox as F,NDivider as B}from"naive-ui";import{PrintOutline as N,SettingsOutline as _,ChevronDownSharp as D,ArrowForwardOutline as R}from"@vicons/ionicons5";import{InjectionButtonPrintEmits as J}from"../constants/index.js";import{Print as U}from"../utils/print.js";import{isIReport as z}from"../utils/browserPrint.js";import A from"./IdentityVerification.vue.js";import{format as K}from"date-fns";import"../api.js";import"../../../shortcut-provider/index.js";import{encapBrowserLog as V}from"../../../../shared/utils/index.js";import{useShortcuts as H}from"../../../shortcut-provider/src/hooks/useShortcuts.js";var $,G,Y,q,Q,W,X;const Z={class:"newprint-button-outer"},ee={key:0,class:"newprint-button-outer__shortcut"},te=e("span",{class:"label bold"},(null==($=window.getLanguageByCode)?void 0:$.call(window,"10010.1.473"))||"外显设置",-1),ne={class:"print-lite"},ae={class:"label bold"},ie={class:"print-li"},re={class:"print-lite"},le={key:0,class:"newprint-button-outer__shortcut"},oe=["onMouseenter","onClick"],se={class:"label bold"},ue={class:"print-lite",style:{background:"transparent"}},de={class:"label bold"},ce={class:"print-li"},pe={class:"print-lite",style:{background:"transparent"}},me=["onClick"],ve={key:0,class:"newprint-button-outer__shortcut"},ge={class:"newprint-button-poperOver"},ye=["onMouseenter"],fe={class:"print-lite",style:{background:"transparent"}},we=["onClick"];var he=t({__name:"NewPrintComponent",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:(null==(G=window.getLanguageByCode)?void 0:G.call(window,"10010.1.478"))||"打印",type:String},printText:{default:(null==(Y=window.getLanguageByCode)?void 0:Y.call(window,"10010.1.479"))||"直接打印",type:String},previewText:{default:(null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.480"))||"打印预览",type:String},pdfLoadText:{default:(null==(Q=window.getLanguageByCode)?void 0:Q.call(window,"10010.1.481"))||"下载pdf",type:String},formatEditText:{default:(null==(W=window.getLanguageByCode)?void 0:W.call(window,"10010.1.482"))||"格式编辑",type:String},prevFn:{default:()=>Promise.resolve(),type:Function},queryPrintFormatByNumber:{default:()=>Promise.resolve({}),type:Function},strategy:{default:"MULTI",type:String},clickPrevFn:{default:()=>Promise.resolve(!0),type:Function},noDataMsg:{default:(null==(X=window.getLanguageByCode)?void 0:X.call(window,"10010.1.483"))||"请选中需要打印的数据",type:String},token:{type:String},printdlgshow:{default:"0",type:String},btnprint:{type:String,default:"1"},directPrint:{type:Boolean,default:!1},externalOptionConfig:{type:Object,default:()=>({})},signature:{type:String},showLoading:{type:Boolean,default:!0},hideButtons:{type:Array,default:()=>[]},printCopies:{type:Number},resolution:{type:Number},newPrintSetting:{type:Object,default:()=>({isShowPrintAll:!0,printAllType:1,isShowOutSetting:!0,customProps:{},outerPrintKeys:[],defaultFormatId:"",shortcut:{},buttonProps:{},showMaxHeight:null})},svrUpdateIp:{type:String}},setup(t,{expose:$}){var G,Y,q;const Q=t;String(navigator.platform).toLowerCase().includes("linux");const W=[{label:(null==(G=window.getLanguageByCode)?void 0:G.call(window,"10010.1.476"))||"分割线",key:"divider"},{label:(null==(Y=window.getLanguageByCode)?void 0:Y.call(window,"10010.1.473"))||"外显设置",key:"outSetting"}],X=O();let he;const ke=n(J),be=a(""),Pe=i({spinning:!1,visible:!1,formatList:[],templateParams:[],printParams:[],originParams:{},currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null,isClickOuterPrint:!1,curPrintParamList:[],iReportExecuteMode:1}),Ce=a({});let Se=a([]),Ie=a([{label:Q.previewText,key:"previewText"},{label:Q.pdfLoadText,key:"downloadPdf"},{label:Q.formatEditText,key:"formatEditText"},{label:(null==(q=window.getLanguageByCode)?void 0:q.call(window,"10010.1.484"))||"重置打印机",key:"resetPrinter"}]);const Le=i({oneMouseType:"",oneClickType:"",twoMouseType:""}),Oe=i({oneShow:!1,isOperation:!1,isOutSetting:!1}),xe=a([]),Te=a([]),je=r((()=>{if(!Pe.currentFormatId)return{};let e=Pe.currentFormatId;return Pe.formatList.find((t=>t.id===e))}));r((()=>{var e,t;return(null==(e=je.value)?void 0:e.name)||(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.485"))||"格式选择"}));const Me=r((()=>{let e=Pe.formatList.find((e=>e.id===Pe.currentFormatId));return null==e?void 0:e.templateId})),Ee=r((()=>{let e=Pe.formatList.find((e=>e.id===Pe.currentFormatId));return null==e?void 0:e.number})),Fe=r((()=>{var e;return null==(e=Q.newPrintSetting)?void 0:e.isShowPrintAll})),Be=r((()=>{var e;return null==(e=Q.newPrintSetting)?void 0:e.isShowOutSetting})),Ne=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.customProps)||{}})),_e=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.defaultFormatId)||""})),De=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.printAllType)||1})),Re=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.shortcut)||{}})),Je=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.buttonProps)||{}})),Ue=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.showMaxHeight)||{}})),ze=r((()=>{var e;return(null==(e=Q.newPrintSetting)?void 0:e.printAllFormatIds)||[]})),Ae=r((()=>{var e;return null==(e=Q.newPrintSetting)?void 0:e.positionElement})),Ke=r((()=>{var e,t;const n=Object.keys(Re.value);if(n.length>0){if(_e.value&&n.includes(_e.value))return(null==(e=Re.value[_e.value])?void 0:e.shortcutLabel)||"";if(n.includes("all"))return(null==(t=Re.value.all)?void 0:t.shortcutLabel)||""}return""})),Ve=r((()=>{const e=W.map((e=>e.key));return Se.value.filter((t=>!e.includes(t.key)))})),He=r({get:()=>Ve.value.every((e=>e.selected)),set(e){Ve.value.forEach((t=>{t.selected=e}))}}),$e=r((()=>{var e;return 2===(null==(e=xe.value)?void 0:e.length)?xe.value.filter((e=>"divider"!==e.key)):xe.value})),Ge=async()=>{var e,t;(null==(t=null==(e=Q.newPrintSetting)?void 0:e.outerPrintKeys)?void 0:t.length)||await bt(),Oe.oneShow=!0},Ye=async e=>{if(Q.directPrint){if(Pe.spinning)return;return"button"===e?void(Fe.value?await St():_e.value?async function(e){await bt(!1);const t=xe.value.find((t=>t.key==e));t&&st(t.templateCode,t.templateId,t.key,!1)}(_e.value):Ge()):Ge()}return Ge()},qe=(e,t)=>Pe.printParams[t.templateCode]?z(t.key)?e.filter((e=>"formatEditText"!=e.key)):e:[],Qe=(e,t)=>{Le[e]=t},We=()=>{xe.value=Se.value.filter((e=>!e.selected)),Te.value=Ve.value.filter((e=>e.selected)),Ze("oneShow"),Ze("isOutSetting"),ke("saveOuterPrint",Te.value)},Xe=e=>{Oe[e]=!0},Ze=e=>{Le.oneClickType="",Oe[e]=!1,"isOutSetting"==e&&(Oe.isOutSetting=!1)},et=(e,t)=>{lt(!1);let n={type:t,formatId:Pe.currentFormatId,templateId:(null==e?void 0:e.templateId)||Me.value,templateCode:(null==e?void 0:e.templateCode)||Ee.value};V({type:"进入成功的回调",info:n},"PRINT-SDK"),ke("success",e,n)},tt=e=>{lt(!1),V({type:"进入失败的回调",res:e},"PRINT-SDK"),ke("error",e),L(e)&&"notInstalledApp"===e.type&&X.error(e.message)},nt=e=>{lt(!1),ke("cancel",e)},at=e=>{var t;const n={message:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.486"))||"前置条件执行错误",type:e,preExecution:!0};ke("error",n)},it=()=>JSON.stringify({...Q.token?{token:Q.token}:{}}),rt=(e=[],t)=>{var n,a;let i={},r={};if((null==(n=Pe.templateParams[t].customizeDataset)?void 0:n.length)>0){const t=(null==(a=Object.keys(e[0].datasetData||{}))?void 0:a[0])||"",n=JSON.stringify(e.map((e=>JSON.parse(e.datasetData[t]))));r={datasetData:{}},r.datasetData[t]=n}else Object.keys(e[0]).forEach((t=>{r[t]=[],e.forEach((e=>{r[t].includes(e[t])||r[t].push(e[t])})),r[t]=r[t].join(",")}));return i=Object.assign({},JSON.parse(it()),r,Ne.value),JSON.stringify(i)},lt=(e,t)=>{if(Pe.isClickOuterPrint){if(e&&t){const n=Te.value.find((e=>e.key==t));return void(n&&(n.isLoading=e))}Te.value.forEach((e=>{e.isLoading=!1}))}else Pe.spinning=e},ot=()=>Pe.isClickOuterPrint?Te.value.some((e=>e.isLoading)):Pe.spinning,st=(e,t,n,a)=>{const i=Pe.printParams[e];if(!i)return;Pe.isClickOuterPrint=a,Pe.currentFormatId=n;const r=Pe.originParams[e]||[];ut(i,e,t,n,r)},ut=async(e=[],t,n,a,i=[],r)=>{let l=e.length;const o=async e=>{try{--l<=0&&et(e,"print")}catch(e){console.log("error",e)}};Q.showLoading&&ot()&&!r||(lt(!0,a),Q.prevFn("print",{formatId:a,templateId:n,params:e}).then((()=>{var r;Pe.curPrintParamList=e;const l=(null==(r=Ne.value)?void 0:r.printdlgshow)||Q.printdlgshow,s={formatId:a,iReportExecuteMode:Pe.iReportExecuteMode,templateId:n,authorizationKey:be.value,printdlgshow:l,signature:Q.signature,copies:Q.printCopies,svrUpdateIp:Q.svrUpdateIp};if("MULTI"===Q.strategy)for(let t=0;t<e.length;t++){t>0&&(s.printdlgshow="0");const n=JSON.stringify(Object.assign({},JSON.parse(it()),e[t],Ne.value));he.printDirect({...s,params:n},o,tt,nt)}else he.printDirect({...s,params:rt(e,t)},(e=>{e.params=i,e.templateCode=t,e.templateId=n,et(e,"print")}),tt,nt)})).catch((()=>{at("print"),lt(!1)})).finally((()=>{Pe.visible=!1})))},dt=async(e,{templateCode:t,templateId:n,key:a},i)=>{const r=Pe.printParams[t];if(r)switch(Pe.isClickOuterPrint=i,Pe.currentFormatId=a,e){case"previewText":(async(e=[],t,n,a)=>{Q.showLoading&&ot()||(lt(!0,a),Q.prevFn("preview",{formatId:a,templateId:n,params:e}).then((()=>{Pe.curPrintParamList=e;const i=JSON.stringify(Object.assign({},JSON.parse(it()),e[0],Ne.value)),r="MULTI"===Q.strategy?i:rt(e,t),l={formatId:a,templateId:n,iReportExecuteMode:Pe.iReportExecuteMode,authorizationKey:be.value,params:r,btnprint:Q.btnprint,signature:Q.signature};he.preview(l,(e=>{et(e,"preview")}),tt)})).catch((()=>{at("preview"),lt(!1)})).finally((()=>{Pe.visible=!1})))})(r,t,n,a);break;case"formatEditText":((e=[],t,n,a)=>{Q.showLoading&&ot()||(lt(!0,a),Q.prevFn("edit",{formatId:a,templateId:n,params:e}).then((()=>{Pe.curPrintParamList=e,Pe.currentFormatId=a,Pe.identityVerification.visible=!0})).catch((()=>{at("edit")})).finally((()=>{lt(!1)})))})(r,0,n,a);break;case"downloadPdf":(async(e=[],t,n,a)=>{Q.showLoading&&ot()||(lt(!0,a),Q.prevFn("download",{formatId:a,templateId:n,params:e}).then((()=>{Pe.curPrintParamList=e;const i=JSON.stringify(Object.assign({},JSON.parse(it()),e[0],Ne.value)),r="MULTI"===Q.strategy?i:rt(e,t),l={formatId:a,templateId:n,iReportExecuteMode:Pe.iReportExecuteMode,authorizationKey:be.value,print:{print:"1",type:"1",resolution:null==Q?void 0:Q.resolution},params:r,signature:Q.signature};he.downloadPDF(l,(e=>et(e,"preview")),tt)})).catch((()=>{at("download"),lt(!1)})).finally((()=>{Pe.visible=!1})))})(r,t,n,a);break;case"resetPrinter":(async(e=[],t,n,a)=>{var i,r,l;if(!Q.showLoading||!ot()){lt(!0,a);try{const e=await he.resetPrinter(a,Pe.iReportExecuteMode);if(lt(!1),"success"==(null==e?void 0:e.result))return void X.success((null==e?void 0:e.message)||(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.487"))||"重置打印机成功");X.warning((null==e?void 0:e.message)||(null==(r=window.getLanguageByCode)?void 0:r.call(window,"10010.1.488"))||"重置打印机失败")}catch(e){lt(!1),X.warning((null==e?void 0:e.message)||(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.488"))||"重置打印机失败")}}})(r,0,0,a)}},ct=()=>{},pt=(e,t=[])=>{let n={};return(t=t||[]).forEach((t=>{n=Object.assign({},yt(n,t,e))})),n},mt=(e,t=[])=>{let n={};return(t=t||[]).forEach((t=>{n=Object.assign({},ft(n,t,e))})),n},vt=(e,t,n)=>{const a={};return t.forEach((t=>{let i=((e,t)=>{const n={DATE:"yyyy-MM-dd",DATETIME:"yyyy-MM-dd HH:mm:ss"};let a=t;return Object.keys(n).includes(e.type)&&t&&t instanceof Date&&(a=K(t,n[e.type])),(null==e?void 0:e.defaultValue)||a})(t,e[t[n]]);e[t[n]]&&i&&(a[t[n]]=i)})),a},gt=({customizeDataset:e=[],param:t=[]},n={})=>{let a={};return e.forEach((e=>{const t=e.dataSetting[0].selectFieldList;a.datasetData||(a.datasetData={}),a.datasetData[e.name]=JSON.stringify(vt(n,t,"fieldName"))})),a=Object.assign({},a,vt(n,t,"key")),a},yt=(e,t,n)=>{if(t.templateNumbers){for(let a=0;a<t.templateNumbers.length;a++){const i=t.templateNumbers[a],r=n[i];if(!r)return e;e[i]||(e[i]=[]),e[i].push(gt(r,t))}return e}const a=Object.keys(n);for(let i=0;i<a.length;i++){const r=a[i],l=n[r];if(!l)return e;e[r]||(e[r]=[]),e[r].push(gt(l,t))}return e},ft=(e,t,n)=>{if(t.templateNumbers){for(let a=0;a<t.templateNumbers.length;a++){const i=t.templateNumbers[a];if(!n[i])return e;e[i]||(e[i]=[]),e[i].push(t)}return e}const a=Object.keys(n);for(let i=0;i<a.length;i++){const r=a[i];if(!n[r])return e;e[r]||(e[r]=[]),e[r].push(t)}return e},wt=async e=>{var t;Pe.formatList=e?(e=>{let t=[];return e&&e.forEach((e=>{if(!e.format)return!1;t.push(...e.format.map((t=>Object.assign({},t,{templateName:e.name}))))})),t})(e.obj):[],Pe.iReportExecuteMode=(null==(t=null==e?void 0:e.obj)?void 0:t.length)>0&&e.obj[0].iReportExecuteMode||1,(()=>{var e,t,n;const a=Object.keys(Re.value),i=Pe.formatList.map((e=>{const t={templateCode:e.number,templateId:e.templateId,label:e.name,key:e.id,selected:!1,isLoading:!1};if(a.includes(e.id)){const n=Re.value[e.id];n&&(t.shortcutLabel=n.shortcutLabel)}return t}));Se.value.unshift(...i),Be.value&&Se.value.push(...W),(null==(t=null==(e=Q.newPrintSetting)?void 0:e.outerPrintKeys)?void 0:t.length)>0&&(Se.value.forEach((e=>{var t;(null==(t=Q.newPrintSetting)?void 0:t.outerPrintKeys.includes(e.key))&&(e.selected=!0)})),Te.value=Se.value.filter((e=>e.selected))),xe.value=Se.value.filter((e=>!e.selected)),Q.hideButtons.length>0&&(Ie.value=Ie.value.filter((e=>!Q.hideButtons.includes(e.key))));const r=sessionStorage.getItem("portal");if(r){const e=JSON.parse(r),t=(null==(n=null==e?void 0:e.user)?void 0:n.currentRoleResourceObj)||{},a=Object.keys(t);a.includes("RY7.2.21.1.M2.G94181E")||(Ie.value=Ie.value.filter((e=>"downloadPdf"!=e.key))),a.includes("RY7.2.21.1.M2.G33633A")||(Ie.value=Ie.value.filter((e=>"formatEditText"!=e.key))),a.includes("RY7.2.21.1.M2.G99314S")||(Ie.value=Ie.value.filter((e=>"resetPrinter"!=e.key)))}})(),Pe.templateParams=(e=>{let t={};return e&&e.forEach((e=>{if(!e.templateConfig)return!1;t[e.number]=e.templateConfig})),t})(e.obj),Pe.printParams=pt(Pe.templateParams,Q.params),Pe.originParams=mt(Pe.templateParams,Q.params),kt()},ht=async()=>{var e;if(Pe.isInited)return!0;Pe.isInited=!0,Pe.spinning=!0,(()=>{if(he)return!1;he=new U})();const t=await Q.queryPrintFormatByNumber();return await wt(t),(null==(e=t.obj)?void 0:e.length)>0&&(be.value=t.obj[0].authorizationKey||""),Pe.spinning=!1,!0},kt=async()=>{const e=Object.keys(Re.value);if(e.length>0)for(let t=0;t<e.length;t++){const n=e[t],a=Re.value[n],{stop:i,signature:r}=H().register({label:a.code,shortcutSignature:a.shortcutKey,operation:["state","reset"],callback(){"all"==n&&Ye("button");const e=Ve.value.map((e=>e.key)),t=Pe.originParams;if(e.includes(n)){const e=Ve.value.find((e=>e.key==n));if(e){const n=Pe.printParams[null==e?void 0:e.templateCode],a=t[null==e?void 0:e.templateCode]||[];ut(n,e.templateCode,e.templateId,e.key,a)}}}});Ce.value[n]=i}},bt=async(e=!0)=>{if(await Q.clickPrevFn()){if(!Pe.visible){if(!await ht())return!1}e&&(Pe.visible=!Pe.visible)}},Pt=e=>{if(Pe.identityVerification.visible=!1,z(Pe.currentFormatId))return et({result:"success",message:""},"edit");const t=JSON.stringify(Object.assign({},JSON.parse(it()),Pe.curPrintParamList[0],Ne.value)),n="MULTI"===Q.strategy?t:rt(Pe.curPrintParamList,Ee.value),a={formatId:Pe.currentFormatId,templateId:Me.value,params:n,token:e};he.editPrintFormat(a,(e=>{et(e,"edit")}),tt)},Ct=(e,t)=>{const n=Te.value[t+1];return t<Te.value.length-1&&!Pe.printParams[e.templateCode]&&Pe.printParams[n.templateCode]};async function St(){await bt(!1),(()=>{var e;const t=Object.keys(Pe.printParams);Pe.isClickOuterPrint=!1;const n=Pe.originParams;if((null==(e=Object.keys(ze.value))?void 0:e.length)>0)Se.value.forEach((e=>{if(ze.value.includes(e.key)){const t=Pe.printParams[e.templateCode],a=n[e.templateCode]||[];Pe.currentFormatId=e.key,ut(t,e.templateCode,e.templateId,e.key,a,!0)}}));else{if(1==De.value)for(let e=0;e<t.length;e++){const a=t[e],i=Pe.printParams[a],r=n[a]||[],l=Pe.formatList.filter((e=>e.number==a));l&&l.length>0&&l.forEach((e=>{Pe.currentFormatId=e.id,ut(i,e.number,e.templateId,e.id,r,!0)}))}2==De.value&&Te.value.forEach((e=>{const t=Pe.printParams[e.templateCode],a=n[e.templateCode]||[];Pe.currentFormatId=e.key,ut(t,e.templateCode,e.templateId,e.key,a,!0)}))}})()}return l((()=>{Pe.isInited=!1})),o((()=>{const e=Object.keys(Ce.value);e.length>0&&e.forEach((e=>{Ce.value[e]&&Ce.value[e]()}))})),s((()=>Q.params),(e=>{Object.keys(Pe.templateParams).length>0&&(Pe.printParams=pt(Pe.templateParams,Q.params),Pe.originParams=mt(Pe.templateParams,Q.params))}),{deep:!0}),s((()=>{var e;return null==(e=Q.newPrintSetting)?void 0:e.outerPrintKeys}),(async e=>{(null==e?void 0:e.length)>0&&await bt(!1)}),{deep:!0,immediate:!0}),$({directPrint:St}),(n,a)=>(u(),d(c,null,[e("div",Z,[p(" 外显按钮集合 "),m(v(x),{class:"outButtonGroup"},{default:g((()=>[(u(!0),d(c,null,y(Te.value,((e,n)=>(u(),f(v(T),{key:e.key,class:"c-dropdown",placement:"bottom-start",trigger:"hover",onClickoutside:ct,options:qe(v(Ie),e),onSelect:t=>dt(t,e,!0)},{default:g((()=>[m(v(j),w(v(Je),{disabled:!Pe.printParams[e.templateCode],loading:t.showLoading&&e.isLoading,onClick:t=>st(e.templateCode,e.templateId,e.key,!0),class:n==Te.value.length-1?"outerLastButton":Ct(e,n)?"isPrintDisabled":""}),{icon:g((()=>[m(v(M),{component:v(N),size:"18"},null,8,["component"])])),default:g((()=>[h(" "+k(e.label)+" ",1),e.shortcutLabel?(u(),d("span",ee,k(e.shortcutLabel),1)):p("v-if",!0)])),_:2},1040,["disabled","loading","onClick","class"])])),_:2},1032,["options","onSelect"])))),128))])),_:1}),p(" 外显设置按钮 "),Te.value.length>0&&Te.value.length==v(Ve).length&&v(Be)&&2!=v(De)?(u(),f(v(E),{key:0,trigger:"click",to:v(Ae),"show-arrow":!1,show:Oe.isOutSetting,onClickoutside:a[2]||(a[2]=e=>Ze("isOutSetting"))},{trigger:g((()=>[m(v(j),w(v(Je),{class:Te.value.length>0?"printAllLeftCls":"",onClick:a[0]||(a[0]=e=>Xe("isOutSetting"))}),{default:g((()=>[te,m(v(M),{style:{"margin-left":"8px"},component:v(_),size:"18"},null,8,["component"])])),_:1},16,["class"])])),default:g((()=>[e("div",{class:"newprint-button-poperOver",style:b({maxHeight:v(Ue)?`${v(Ue)}px`:void 0})},[(u(!0),d(c,null,y(v(Ve),(t=>(u(),d("div",{class:"print-li",key:t.key},[e("div",ne,[e("span",ae,k(t.label),1),m(v(F),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.474"))||"外显")]})),_:2},1032,["checked","onUpdate:checked"])])])))),128)),e("div",ie,[m(v(B)),e("div",re,[m(v(j),{type:"primary",size:"small",onClick:We},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.244"))||"保存")]})),_:1}),v(Ve)&&v(Ve).length>1?(u(),f(v(F),{key:0,checked:v(He),"onUpdate:checked":a[1]||(a[1]=e=>P(He)?He.value=e:null)},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.37"))||"全选")]})),_:1},8,["checked"])):p("v-if",!0)])])],4)])),_:1},8,["to","show"])):(u(),d(c,{key:1},[p(" 打印全部按钮 "),m(v(E),{trigger:"click","show-arrow":!1,to:v(Ae),show:Oe.oneShow,onClickoutside:a[10]||(a[10]=e=>Ze("oneShow"))},{trigger:g((()=>[C(n.$slots,"button",{handleClickPrintBtn:Ge,handlePrintBySetting:()=>Ye("button"),printSpinning:Pe.spinning,printbtnText:t.btnText,printVisible:Pe.visible},(()=>[m(v(x),{class:"newprint-button-component",onClick:a[4]||(a[4]=S((()=>Ye("icon")),["stop"]))},{default:g((()=>[m(v(j),w({loading:t.showLoading&&Pe.spinning},v(Je),{onClick:a[3]||(a[3]=S((()=>Ye("button")),["stop"])),class:Te.value.length>0?"printAllLeftCls":""}),{icon:g((()=>[m(v(M),{component:v(N),size:"18"},null,8,["component"])])),default:g((()=>{var e;return[h(" "+k(v(Fe)?(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.475"))||"打印全部":t.btnText)+" ",1),v(Ke)?(u(),d("span",le,k(v(Ke)),1)):p("v-if",!0)]})),_:1},16,["loading","class"]),m(v(j),w({class:"icon-select"},v(Je)),{icon:g((()=>[m(v(M),{component:v(D),size:"18"},null,8,["component"])])),_:1},16)])),_:1})]))])),default:g((()=>[e("div",{class:"newprint-button-poperOver",style:b({maxHeight:v(Ue)?`${v(Ue)}px`:void 0})},[(u(!0),d(c,null,y(v($e),(t=>(u(),d("div",{class:I(["print-li",Le.oneMouseType==t.key||Le.oneClickType==t.key?"active":""]),key:t.key,onMouseenter:e=>Qe("oneMouseType",t.key),onMouseleave:a[9]||(a[9]=e=>Qe("oneMouseType","")),onClick:e=>((e,t,n)=>{if(!Pe.printParams[n.templateCode])return[];Qe(e,t)})("oneClickType",t.key,t)},["divider"==t.key?(u(),f(v(B),{key:0})):"outSetting"==t.key?(u(),d(c,{key:1},[p(" 第二层外显设置 "),m(v(E),{trigger:"click","show-arrow":!1,to:!1,placement:"right-start",show:Oe.isOutSetting,onClickoutside:a[7]||(a[7]=e=>Ze("isOutSetting"))},{trigger:g((()=>[e("div",{class:"print-lite",onClick:a[5]||(a[5]=e=>Xe("isOutSetting"))},[e("span",se,k(t.label),1),m(v(M),{color:Te.value.length>0?"#2563F4":"",component:v(_),size:"18"},null,8,["color","component"])])])),default:g((()=>[e("div",{class:"newprint-button-poperOver",style:b({maxHeight:v(Ue)?`${v(Ue)}px`:void 0})},[(u(!0),d(c,null,y(v(Ve),(t=>(u(),d("div",{class:"print-li",key:t.key},[e("div",ue,[e("span",de,k(t.label),1),m(v(F),{checked:t.selected,"onUpdate:checked":e=>t.selected=e},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.474"))||"外显")]})),_:2},1032,["checked","onUpdate:checked"])])])))),128)),e("div",ce,[m(v(B)),e("div",pe,[m(v(j),{type:"primary",size:"small",onClick:We},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.244"))||"保存")]})),_:1}),v(Ve)&&v(Ve).length>1?(u(),f(v(F),{key:0,checked:v(He),"onUpdate:checked":a[6]||(a[6]=e=>P(He)?He.value=e:null)},{default:g((()=>{var e;return[h((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.37"))||"全选")]})),_:1},8,["checked"])):p("v-if",!0)])])],4)])),_:2},1032,["show"])],2112)):(u(),d(c,{key:2},[p(" 第二层功能操作 "),e("div",{class:I(["print-lite",Pe.printParams[t.templateCode]?"":"isDisabled"]),style:{background:"transparent"}},[e("span",{class:"label bold",onClick:e=>st(t.templateCode,t.templateId,t.key,!1)},[h(k(t.label)+" ",1),t.shortcutLabel?(u(),d("span",ve,k(t.shortcutLabel),1)):p("v-if",!0)],8,me),Pe.printParams[t.templateCode]?(u(),f(v(E),{key:0,trigger:"click","show-arrow":!1,to:!1,placement:"right-start",show:Oe[t.key],onClickoutside:e=>Ze(t.key)},{trigger:g((()=>[m(v(M),{component:v(R),size:"18",onClick:e=>Xe(t.key)},null,8,["component","onClick"])])),default:g((()=>[e("div",ge,[(u(!0),d(c,null,y(qe(v(Ie),t),(n=>(u(),d("div",{class:I(["print-li",Le.twoMouseType==n.key?"active":""]),key:n.key,onMouseenter:e=>Qe("twoMouseType",n.key),onMouseleave:a[8]||(a[8]=e=>Qe("twoMouseType",""))},[e("div",fe,[e("span",{class:"label",onClick:e=>dt(n.key,t,!1)},k(n.label),9,we)])],42,ye)))),128))])])),_:2},1032,["show","onClickoutside"])):p("v-if",!0)],2)],2112))],42,oe)))),128))],4)])),_:3},8,["to","show"])],2112))]),m(A,w(n.$attrs,{modelValue:Pe.identityVerification.visible,"onUpdate:modelValue":a[11]||(a[11]=e=>Pe.identityVerification.visible=e),formatId:Pe.currentFormatId,templateId:v(Me),onSuccess:Pt}),null,16,["modelValue","formatId","templateId"])],64))}});export{he as default};
|
@@ -1 +1 @@
|
|
1
|
-
var l,e,a,d,o,n,t,i,w,u,g,v,y,C,L,_,T,B,E,c,m,I,x,s,O,p,A,h,D,H=(l=>(l.INPUT="INPUT",l.TEXTAREA="TEXTAREA",l.DIGITAL="DIGITAL",l.DATE="DATE",l.RADIO="RADIO",l.RADIO_BLOCK="RADIO_BLOCK",l.CHECKBOX="CHECKBOX",l.CHECKBOX_BLOCK="CHECKBOX_BLOCK",l.SELECT="SELECT",l.MULTI_SELECT="MULTI_SELECT",l))(H||{});const M={open:{describe:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.351"))||"是",value:
|
1
|
+
var l,e,a,d,o,n,t,i,w,u,g,v,y,C,L,_,T,B,E,c,m,I,x,s,O,p,A,h,D,H=(l=>(l.INPUT="INPUT",l.TEXTAREA="TEXTAREA",l.DIGITAL="DIGITAL",l.DATE="DATE",l.RADIO="RADIO",l.RADIO_BLOCK="RADIO_BLOCK",l.CHECKBOX="CHECKBOX",l.CHECKBOX_BLOCK="CHECKBOX_BLOCK",l.SELECT="SELECT",l.MULTI_SELECT="MULTI_SELECT",l))(H||{});const M={open:{describe:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.351"))||"是",value:1},close:{describe:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.352"))||"否",value:0}},k=[{text:(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.293"))||"文本框",value:"INPUT"},{text:(null==(d=window.getLanguageByCode)?void 0:d.call(window,"10010.1.564"))||"文本域",value:"TEXTAREA"},{text:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.292"))||"数字框",value:"DIGITAL"},{text:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.74"))||"日期",value:"DATE"},{text:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.565"))||"横向单选",value:"RADIO"},{text:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.566"))||"纵向单选",value:"RADIO_BLOCK"},{text:(null==(w=window.getLanguageByCode)?void 0:w.call(window,"10010.1.567"))||"横向多选",value:"CHECKBOX"},{text:(null==(u=window.getLanguageByCode)?void 0:u.call(window,"10010.1.568"))||"纵向多选",value:"CHECKBOX_BLOCK"},{text:(null==(g=window.getLanguageByCode)?void 0:g.call(window,"10010.1.294"))||"下拉框",value:"SELECT"},{text:(null==(v=window.getLanguageByCode)?void 0:v.call(window,"10010.1.569"))||"下拉多选框",value:"MULTI_SELECT"}],r=[{text:"1/3",value:"4"},{text:"2/3",value:"8"},{text:"1/4",value:"3"},{text:"3/4",value:"9"},{text:"1/6",value:"2"},{text:"5/6",value:"10"},{text:"1/8",value:"1.5"},{text:"7/8",value:"10.5"},{text:(null==(y=window.getLanguageByCode)?void 0:y.call(window,"10010.1.30"))||"半行",value:"6"},{text:(null==(C=window.getLanguageByCode)?void 0:C.call(window,"10010.1.29"))||"整行",value:"12"}],N=[{text:(null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.548"))||"年-月-日 时:分:秒",value:"yyyy-MM-dd HH:mm:ss"},{text:(null==(_=window.getLanguageByCode)?void 0:_.call(window,"10010.1.549"))||"年-月-日 时:分",value:"yyyy-MM-dd HH:mm"},{text:(null==(T=window.getLanguageByCode)?void 0:T.call(window,"10010.1.550"))||"年-月-日",value:"yyyy-MM-dd"},{text:(null==(B=window.getLanguageByCode)?void 0:B.call(window,"10010.1.551"))||"年-月",value:"yyyy-MM"},{text:"月-日 时-分",value:"MM-dd HH:mm"},{text:(null==(E=window.getLanguageByCode)?void 0:E.call(window,"10010.1.553"))||"月-日",value:"MM-dd"},{text:(null==(c=window.getLanguageByCode)?void 0:c.call(window,"10010.1.554"))||"时:分:秒",value:"HH:mm:ss"},{text:(null==(m=window.getLanguageByCode)?void 0:m.call(window,"10010.1.555"))||"时:分",value:"HH:mm"}],U={alias:(null==(I=window.getLanguageByCode)?void 0:I.call(window,"10010.1.541"))||"日期格式",val_key:"date_format",html_type:"SELECT",option:N},K={alias:"选项",val_key:"option",html_type:"COMBINATION",jsonCombination:!1,minGroupNum:0,children:[{elem_width:6,alias:"文本",val_key:"text",html_type:"INPUT",is_null:"0"},{elem_width:6,alias:(null==(x=window.getLanguageByCode)?void 0:x.call(window,"10010.1.22"))||"值",val_key:"value",html_type:"INPUT",is_null:"0"}]},P=[{alias:"id",val_key:"id",html_type:"TEXT",decoratorProps:{style:{display:"none"}}},{alias:(null==(s=window.getLanguageByCode)?void 0:s.call(window,"10010.1.530"))||"字段键名",val_key:"key",html_type:"INPUT",remark:"数据库字段键名,不填写时由系统生成,填写则以填写为准"},{alias:(null==(O=window.getLanguageByCode)?void 0:O.call(window,"10010.1.16"))||"是否必填",val_key:"is_null",html_type:"SWITCH",...M},{alias:(null==(p=window.getLanguageByCode)?void 0:p.call(window,"10010.1.529"))||"字段标题",val_key:"name",html_type:"INPUT"},{alias:(null==(A=window.getLanguageByCode)?void 0:A.call(window,"10010.1.532"))||"字段类型",val_key:"html_type",html_type:"SELECT",option:k,is_null:"0"},{alias:"字段默认值",val_key:"default_val",html_type:"INPUT"},{alias:(null==(h=window.getLanguageByCode)?void 0:h.call(window,"10010.1.534"))||"字段问号提示",val_key:"remark",html_type:"INPUT"},{alias:(null==(D=window.getLanguageByCode)?void 0:D.call(window,"10010.1.13"))||"宽度",val_key:"elem_width",html_type:"SELECT",option:r}],S=Object.freeze({DATE_FORMAT_FIELD:U,DECIMAL_LENGTH_FIELD:{alias:"小数位数",val_key:"decimal_length",html_type:"INPUT",remark:"小数位数,默认为0"},OPTION_FIELD:K,DEFAULT_FIELD_LIST:P});export{S as FIELD_EDITOR_FIELDS,H as HtmlType};
|
@@ -73,12 +73,13 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
|
|
73
73
|
setRefs: import("../../shared/types").AnyObject;
|
74
74
|
fieldSetRef: import("vue").Ref<any>;
|
75
75
|
primaryColor: import("vue").Ref<string>;
|
76
|
-
fieldSetHeight: import("vue").Ref<number>;
|
77
76
|
dataLength: import("vue").ComputedRef<number>;
|
78
77
|
style: import("vue").ComputedRef<{
|
79
78
|
'--row-height': string;
|
80
79
|
'--primary-color': string;
|
81
|
-
|
80
|
+
}>;
|
81
|
+
newAttrs: import("vue").ComputedRef<{
|
82
|
+
[x: string]: unknown;
|
82
83
|
}>;
|
83
84
|
tabList: import("vue").ComputedRef<{
|
84
85
|
name: import("./src/types").FieldSetTab;
|
@@ -50,6 +50,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
50
50
|
isShow?: boolean | undefined;
|
51
51
|
contentRender?: ((column: AnyObject, row: AnyObject) => import("vue").VNodeChild) | undefined;
|
52
52
|
hide?: boolean | undefined;
|
53
|
+
positionField?: string | undefined;
|
53
54
|
}[]>;
|
54
55
|
rowProps: {
|
55
56
|
columns: {
|
@@ -63,6 +64,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
63
64
|
isShow?: boolean | undefined;
|
64
65
|
contentRender?: ((column: AnyObject, row: AnyObject) => import("vue").VNodeChild) | undefined;
|
65
66
|
hide?: boolean | undefined;
|
67
|
+
positionField?: string | undefined;
|
66
68
|
}[];
|
67
69
|
data: AnyObject[];
|
68
70
|
onEdit: ({ row, readonly: _readonly, add }: AnyObject) => void;
|
@@ -46,6 +46,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
46
46
|
isShow?: boolean | undefined;
|
47
47
|
contentRender?: ((column: AnyObject, row: AnyObject) => import("vue").VNodeChild) | undefined;
|
48
48
|
hide?: boolean | undefined;
|
49
|
+
positionField?: string | undefined;
|
49
50
|
}[]>;
|
50
51
|
data: import("vue").Ref<{
|
51
52
|
[x: string]: any;
|
@@ -72,6 +73,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
72
73
|
isShow?: boolean | undefined;
|
73
74
|
contentRender?: ((column: AnyObject, row: AnyObject) => import("vue").VNodeChild) | undefined;
|
74
75
|
hide?: boolean | undefined;
|
76
|
+
positionField?: string | undefined;
|
75
77
|
}[];
|
76
78
|
data: {
|
77
79
|
[x: string]: any;
|
@@ -207,6 +207,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
207
207
|
isShow?: boolean | undefined;
|
208
208
|
contentRender?: ((column: AnyObject, row: AnyObject) => VNodeChild) | undefined;
|
209
209
|
hide?: boolean | undefined;
|
210
|
+
positionField?: string | undefined;
|
210
211
|
}[]>;
|
211
212
|
itemWidth: import("vue").ComputedRef<string>;
|
212
213
|
fieldList: import("vue").ComputedRef<AnyObject[]>;
|
@@ -223,6 +224,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
223
224
|
isShow?: boolean | undefined;
|
224
225
|
contentRender?: ((column: AnyObject, row: AnyObject) => VNodeChild) | undefined;
|
225
226
|
hide?: boolean | undefined;
|
227
|
+
positionField?: string | undefined;
|
226
228
|
}[];
|
227
229
|
data: AnyObject[];
|
228
230
|
onUpdateChecked: ({ checked, column }: {
|
@@ -1 +1 @@
|
|
1
|
-
import{createElementVNode as e,defineComponent as l,ref as i,computed as t,reactive as o,toRef as d,watch as a,openBlock as n,createElementBlock as r,createBlock as u,unref as s,withKeys as c,withModifiers as w,createCommentVNode as h,Fragment as f,renderList as g,normalizeStyle as p,withCtx as v,createTextVNode as y,toDisplayString as m,createVNode as b,normalizeClass as x,mergeProps as k,renderSlot as C}from"vue";import{NInput as B,NCheckbox as S,NTooltip as L,NIcon as _,NPopconfirm as A,NButton as W}from"naive-ui";import E from"../../../shared/components/VueDraggable/src/vuedraggable.js";import H from"./components/table-row.vue.js";import{isArray as D,cloneDeep as F,isString as M,omit as P}from"lodash-es";import{isDisable as R,setStyle as N,isDraggableItem as j,isDraggable as V,getGroupTree as O}from"./utils/index.js";import{uuidGenerator as q}from"../../../shared/utils/index.js";import{HelpCircleSharp as I}from"@vicons/ionicons5";var K;const U={class:"main-wrapper"},T={class:"main-wrapper__table-header"},G=e("span",null,(null==(K=window.getLanguageByCode)?void 0:K.call(window,"10010.1.246"))||"数值越小,优先级越高",-1),$=["tabindex"],z={key:1,class:"main-wrapper__table-footer"};var J=l({__name:"FieldSet",props:{fields:{type:Array,default:()=>[]},footerFlag:{type:Boolean,default:!0},type:{type:String,default:"old"},isEdit:{type:Boolean,default:!1},showColumnNames:{type:Array},groupSetting:{type:Object},customColumns:{type:Array,default:()=>[]},showSeq:{type:Boolean,default:!1},showSearch:{type:Boolean,default:!1},showSortPriority:{type:Boolean,default:!1},showHeadFilter:{type:Boolean,default:!1},fieldShowMaxValue:{type:Number},rowDraggable:{type:Boolean,default:!0},fieldDescribeMode:{type:String,default:"tooltip"},developMode:{type:Boolean},columnWidthProps:{type:Object},hideExpressionConfig:{type:Object},primaryKey:{type:String,default:"id"},titleRender:{type:Function}},emits:["save","close","reset"],setup(l,{expose:K,emit:J}){var Q,X,Y,Z,ee,le,ie,te,oe,de,ae,ne,re,ue,se,ce;const we=l,he={sid:"id",columnName:"name",isShow:"show",isSort:"sort",isFixed:"fixedWay",colWidth:"columnWidth"},fe=i(Date.now()),ge=i(""),pe=i(),ve=i(),ye=i([]),me=[{title:(null==(Q=window.getLanguageByCode)?void 0:Q.call(window,"10010.1.247"))||"所有字段",type:"text",field:"title"},{title:(null==(X=window.getLanguageByCode)?void 0:X.call(window,"10010.1.240"))||"显示",type:"checkbox",checkedAll:!1,disabledAll:!!we.fieldShowMaxValue,field:"show",fieldShowMaxValue:we.fieldShowMaxValue},{title:(null==(Y=window.getLanguageByCode)?void 0:Y.call(window,"10010.1.284"))||"编辑",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"editable"},{title:(null==(Z=window.getLanguageByCode)?void 0:Z.call(window,"10010.1.248"))||"必填",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"required"},{title:(null==(ee=window.getLanguageByCode)?void 0:ee.call(window,"10010.1.249"))||"排序",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"sort"},{title:(null==(le=window.getLanguageByCode)?void 0:le.call(window,"10010.1.250"))||"加粗",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"bold"},{title:(null==(ie=window.getLanguageByCode)?void 0:ie.call(window,"10010.1.251"))||"默认排序",type:"select",field:"sortDirection"},{title:(null==(te=window.getLanguageByCode)?void 0:te.call(window,"10010.1.252"))||"排序优先级",type:"select",field:"sortPriority"},{title:(null==(oe=window.getLanguageByCode)?void 0:oe.call(window,"10010.1.253"))||"固定",type:"select",field:"fixedWay"},{title:(null==(de=window.getLanguageByCode)?void 0:de.call(window,"10010.1.254"))||"自定义标题",type:"input",field:"alias"},{title:(null==(ae=window.getLanguageByCode)?void 0:ae.call(window,"10010.1.255"))||"列宽",type:"inputNumber",field:"columnWidth"},{title:(null==(ne=window.getLanguageByCode)?void 0:ne.call(window,"10010.1.256"))||"表头筛选",type:"checkbox",isHeadCheckHide:!0,field:"isShowHeaderFilter"},{title:(null==(re=window.getLanguageByCode)?void 0:re.call(window,"10010.1.36"))||"搜索",type:"checkbox",isHeadCheckHide:!0,field:"isSearch",hide:!0},{title:(null==(ue=window.getLanguageByCode)?void 0:ue.call(window,"10010.1.257"))||"求和",type:"checkbox",isHeadCheckHide:!0,field:"isSum",hide:!0},{title:(null==(se=window.getLanguageByCode)?void 0:se.call(window,"10010.1.258"))||"平均值",type:"checkbox",isHeadCheckHide:!0,field:"isAvg",hide:!0},{title:(null==(ce=window.getLanguageByCode)?void 0:ce.call(window,"10010.1.259"))||"脱敏配置",type:"select",field:"hideExpression",hide:!0}],be=i([]),xe=t((()=>{var e;return(null==(e=ve.value)?void 0:e.scrollWidth)?ve.value.scrollWidth+"px":"auto"})),ke=t((()=>ye.value.flat())),Ce=t((()=>ke.value.some((e=>e.feildDescribe)))),Be=o({columns:be,data:ke,onUpdateChecked:function({checked:e,column:l}){const i=!e||Fe(l.field);l.checkedAll=!i},draggable:we.rowDraggable,isFieldSet:!0,fieldDescribeMode:we.fieldDescribeMode,developMode:we.developMode,columnWidthProps:we.columnWidthProps,hideExpressionOption:d(we.hideExpressionConfig||{option:[]},"option"),primaryKey:d(we,"primaryKey"),titleRender:we.titleRender}),Se={keyword:ge.value,idx:0,startIdx:0},Le=()=>{J("save")},_e=()=>{J("close")};function Ae(){ye.value=We(),De(),fe.value=Date.now(),J("reset")}function We(){const e=F(we.fields).map((e=>({...e,uuid:q()})));return Object.keys(he).forEach((l=>{e.forEach((e=>{var i;"old"==we.type&&Reflect.has(e,l)&&("isFixed"==l?e.fixedWay=1==e[l]?"LEFT":2==e[l]?"RIGHT":"NONE":["isShow","isSort"].includes(l)&&"boolean"!=typeof l?e[he[l]]=1==e[l]:e[he[l]]=e[l],Reflect.deleteProperty(e,l)),e.columnWidth=+e.columnWidth||null,Reflect.has(e,"alias")||(e.alias=""),Reflect.has(e,"bold")||(e.bold=!1),e.draggable=!!V(e),D(null==(i=e.relation)?void 0:i.fieldList)&&e.relation.fieldList.forEach((e=>{1==e.isSearch&&(e.checked=!0)}))}))})),function(e){if(we.groupSetting){return O(we.groupSetting,e).reduce(((i,t)=>{const o=M(t)?e.find((e=>e.name===t)):l(t.children);return o&&i.push(o),i}),[])}return e;function l(i){const t=[];return i.forEach((i=>{if(i.children)t.push(...l(i.children));else{const l=e.find((e=>e.name===i));l&&t.push(l)}})),t}}(e)}function Ee(){const e=Se.keyword!==ge.value;let l=ge.value?ke.value.findIndex(((l,i)=>{var t;if(null==(t=l.title)?void 0:t.includes(ge.value))return!!e||i>Se.idx})):0;-1!==l||e||(l=Se.startIdx),pe.value.scrollTop=52*l,Object.assign(Se,{keyword:ge.value,idx:l},e?{startIdx:l}:{})}function He(e){var l;return!!ge.value&&(null==(l=e.title)?void 0:l.includes(ge.value))}function De(){var e,l,i,t;be.value=F(me),(null==(e=we.showColumnNames)?void 0:e.length)&&(be.value=me.filter((e=>{var l,i;return"title"===e.field||(null==(i=null==(l=we.showColumnNames)?void 0:l.includes)?void 0:i.call(l,e.field))}))),(null==(l=we.customColumns)?void 0:l.length)&&be.value.push(...we.customColumns),"column"===we.fieldDescribeMode&&Ce.value&&be.value.push({title:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.260"))||"字段描述",type:"text",field:"feildDescribe"}),we.showSeq&&be.value.splice(1,0,{title:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.249"))||"排序",type:"text",field:"seq"}),be.value.forEach((e=>{if(e.isShow=function(e){var l,i;if(!(null==(l=we.showColumnNames)?void 0:l.length))return!(["editable","required"].includes(e.field)&&!we.isEdit||"sortPriority"===e.field&&!we.showSortPriority||"isShowHeaderFilter"===e.field&&!we.showHeadFilter||"hideExpression"===e.field&&!(null==(i=we.hideExpressionConfig)?void 0:i.show)||e.hide);return!0}(e),"checkbox"===e.type){const l=ye.value.flat().every((l=>!Reflect.has(l,e.field)));e.checkedAll=!Fe(e.field)&&!l}}))}function Fe(e){return ye.value.flat().some((l=>!R(l,e)&&!l[e]&&"0001"!=l.id))}function Me(e){return!!j(e.relatedContext.element)}return a([()=>we.fields,()=>{var e;return null==(e=we.showColumnNames)?void 0:e.length}],(([e,l])=>{e.length>0&&(ye.value=We(),De())}),{immediate:!0,deep:!0}),K({getTableFields:function(){let e=[];return e="old"==we.type?ke.value.map(((e,l)=>P({...e,field:e.name,visible:e.show,sequence:l,sortable:e.sort,title:e.alias,fixed:e.fixedWay,minWidth:e.columnWidth},["name","show","sort","alias","fixedWay","columnWidth"]))):ke.value,e.map((e=>P(e,["uuid"])))}}),(i,t)=>{var o;return n(),r("div",U,[l.showSearch?(n(),u(s(B),{key:0,class:"main-wrapper__search-wrapper",value:ge.value,"onUpdate:value":t[0]||(t[0]=e=>ge.value=e),valueModifiers:{trim:!0},placeholder:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.245"))||"请输入字段标题",onKeydown:c(w(Ee,["prevent"]),["enter"])},null,8,["value","onKeydown"])):h("v-if",!0),e("div",{class:"main-wrapper__table",ref_key:"tableRef",ref:ve},[e("div",T,[(n(!0),r(f,null,g(be.value,((i,t)=>(n(),r(f,{key:t},[i.isShow?(n(),r("span",{key:0,class:"table-cell",style:p(s(N)(i,t,l.columnWidthProps))},[e("span",null,["checkbox"!==i.type||i.isHeadCheckHide?(n(),r(f,{key:1},[y(m(i.title),1)],64)):(n(),u(s(S),{key:0,checked:i.checkedAll,"onUpdate:checked":[e=>i.checkedAll=e,e=>{return l=e,t=i.field,void ke.value.forEach((e=>{R(e,t)||(e[t]=l)}));var l,t}],disabled:i.disabledAll},{default:v((()=>[y(m(i.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"])),"sortPriority"===i.field?(n(),u(s(L),{key:2,trigger:"hover"},{trigger:v((()=>[b(s(_),{component:s(I),style:{top:"2px"}},null,8,["component"])])),default:v((()=>[G])),_:1})):h("v-if",!0)])],4)):h("v-if",!0)],64)))),128))]),e("div",{class:"main-wrapper__table-body",ref_key:"tableBodyRef",ref:pe},[(n(),u(s(E),{modelValue:ye.value,"onUpdate:modelValue":t[1]||(t[1]=e=>ye.value=e),animation:"150","item-key":"id",filter:".disabled",draggable:".item",move:Me,disabled:!l.rowDraggable,key:fe.value},{item:v((({element:e,index:l})=>[e.hide?h("v-if",!0):(n(),r("div",{key:0,class:x(["item",s(j)(e)?"":"disabled"]),tabindex:l,style:p({width:s(xe)})},[s(D)(e)?(n(!0),r(f,{key:0},g(e,((e,i)=>(n(),u(H,k(Be,{key:i,element:e,idx:l+1,"is-highlight":He(e)}),null,16,["element","idx","is-highlight"])))),128)):(n(),u(H,k({key:1},Be,{element:e,idx:l+1,"is-highlight":He(e)}),null,16,["element","idx","is-highlight"]))],14,$))])),_:1},8,["modelValue","disabled"]))],512)],512),l.footerFlag?(n(),r("div",z,[h(" 底部按钮插槽 "),C(i.$slots,"footer",{},(()=>[b(s(A),{onPositiveClick:Ae},{trigger:v((()=>[b(s(W),{style:{"margin-right":"8px"}},{default:v((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.242"))||"恢复默认设置")]})),_:1})])),default:v((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.243"))||"确认要恢复系统默认设置吗?")]})),_:1}),b(s(W),{style:{"margin-right":"8px"},onClick:_e},{default:v((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.28"))||"取消")]})),_:1}),b(s(W),{type:"primary",onClick:Le},{default:v((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.244"))||"保存")]})),_:1})]))])):h("v-if",!0)])}}});export{J as default};
|
1
|
+
import{createElementVNode as e,defineComponent as l,ref as i,computed as t,reactive as o,toRef as d,watch as a,openBlock as n,createElementBlock as r,createBlock as u,unref as s,withKeys as c,withModifiers as w,createCommentVNode as f,Fragment as h,renderList as p,normalizeStyle as g,withCtx as v,createTextVNode as y,toDisplayString as m,createVNode as b,normalizeClass as x,mergeProps as k,renderSlot as C}from"vue";import{NInput as B,NCheckbox as S,NTooltip as L,NIcon as _,NPopconfirm as A,NButton as W}from"naive-ui";import E from"../../../shared/components/VueDraggable/src/vuedraggable.js";import H from"./components/table-row.vue.js";import{isArray as F,cloneDeep as D,isString as M,omit as P}from"lodash-es";import{isDisable as R,setStyle as N,isDraggableItem as j,isDraggable as V,getGroupTree as O}from"./utils/index.js";import{uuidGenerator as q}from"../../../shared/utils/index.js";import{HelpCircleSharp as I}from"@vicons/ionicons5";var K;const U={class:"main-wrapper"},T={class:"main-wrapper__table-header"},G=e("span",null,(null==(K=window.getLanguageByCode)?void 0:K.call(window,"10010.1.246"))||"数值越小,优先级越高",-1),$=["tabindex"],z={key:1,class:"main-wrapper__table-footer"};var J=l({__name:"FieldSet",props:{fields:{type:Array,default:()=>[]},footerFlag:{type:Boolean,default:!0},type:{type:String,default:"old"},isEdit:{type:Boolean,default:!1},showColumnNames:{type:Array},groupSetting:{type:Object},customColumns:{type:Array,default:()=>[]},showSeq:{type:Boolean,default:!1},showSearch:{type:Boolean,default:!1},showSortPriority:{type:Boolean,default:!1},showHeadFilter:{type:Boolean,default:!1},fieldShowMaxValue:{type:Number},rowDraggable:{type:Boolean,default:!0},fieldDescribeMode:{type:String,default:"tooltip"},developMode:{type:Boolean},columnWidthProps:{type:Object},hideExpressionConfig:{type:Object},primaryKey:{type:String,default:"id"},titleRender:{type:Function}},emits:["save","close","reset"],setup(l,{expose:K,emit:J}){var Q,X,Y,Z,ee,le,ie,te,oe,de,ae,ne,re,ue,se,ce;const we=l,fe={sid:"id",columnName:"name",isShow:"show",isSort:"sort",isFixed:"fixedWay",colWidth:"columnWidth"},he=i(Date.now()),pe=i(""),ge=i(),ve=i(),ye=i([]),me=[{title:(null==(Q=window.getLanguageByCode)?void 0:Q.call(window,"10010.1.247"))||"所有字段",type:"text",field:"title"},{title:(null==(X=window.getLanguageByCode)?void 0:X.call(window,"10010.1.240"))||"显示",type:"checkbox",checkedAll:!1,disabledAll:!!we.fieldShowMaxValue,field:"show",fieldShowMaxValue:we.fieldShowMaxValue},{title:(null==(Y=window.getLanguageByCode)?void 0:Y.call(window,"10010.1.284"))||"编辑",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"editable"},{title:(null==(Z=window.getLanguageByCode)?void 0:Z.call(window,"10010.1.248"))||"必填",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"required"},{title:(null==(ee=window.getLanguageByCode)?void 0:ee.call(window,"10010.1.249"))||"排序",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"sort"},{title:(null==(le=window.getLanguageByCode)?void 0:le.call(window,"10010.1.250"))||"加粗",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"bold"},{title:(null==(ie=window.getLanguageByCode)?void 0:ie.call(window,"10010.1.251"))||"默认排序",type:"select",field:"sortDirection"},{title:(null==(te=window.getLanguageByCode)?void 0:te.call(window,"10010.1.252"))||"排序优先级",type:"select",field:"sortPriority"},{title:(null==(oe=window.getLanguageByCode)?void 0:oe.call(window,"10010.1.253"))||"固定",type:"select",field:"fixedWay"},{title:(null==(de=window.getLanguageByCode)?void 0:de.call(window,"10010.1.254"))||"自定义标题",type:"input",field:"alias"},{title:(null==(ae=window.getLanguageByCode)?void 0:ae.call(window,"10010.1.255"))||"列宽",type:"inputNumber",field:"columnWidth"},{title:(null==(ne=window.getLanguageByCode)?void 0:ne.call(window,"10010.1.256"))||"表头筛选",type:"checkbox",isHeadCheckHide:!0,field:"isShowHeaderFilter"},{title:(null==(re=window.getLanguageByCode)?void 0:re.call(window,"10010.1.36"))||"搜索",type:"checkbox",isHeadCheckHide:!0,field:"isSearch",hide:!0},{title:(null==(ue=window.getLanguageByCode)?void 0:ue.call(window,"10010.1.257"))||"求和",type:"checkbox",isHeadCheckHide:!0,field:"isSum",hide:!0},{title:(null==(se=window.getLanguageByCode)?void 0:se.call(window,"10010.1.258"))||"平均值",type:"checkbox",isHeadCheckHide:!0,field:"isAvg",hide:!0},{title:(null==(ce=window.getLanguageByCode)?void 0:ce.call(window,"10010.1.259"))||"脱敏配置",type:"select",field:"hideExpression",hide:!0}],be=i([]),xe=t((()=>{var e;return(null==(e=ve.value)?void 0:e.scrollWidth)?ve.value.scrollWidth+"px":"auto"})),ke=t((()=>ye.value.flat())),Ce=t((()=>ke.value.some((e=>e.feildDescribe)))),Be=o({columns:be,data:ke,onUpdateChecked:function({checked:e,column:l}){const i=!e||De(l.field);l.checkedAll=!i},draggable:we.rowDraggable,isFieldSet:!0,fieldDescribeMode:we.fieldDescribeMode,developMode:we.developMode,columnWidthProps:we.columnWidthProps,hideExpressionOption:d(we.hideExpressionConfig||{option:[]},"option"),primaryKey:d(we,"primaryKey"),titleRender:we.titleRender}),Se={keyword:pe.value,idx:0,startIdx:0},Le=()=>{J("save")},_e=()=>{J("close")};function Ae(){ye.value=We(),Fe(),he.value=Date.now(),J("reset")}function We(){const e=D(we.fields).map((e=>({...e,uuid:q()})));return Object.keys(fe).forEach((l=>{e.forEach((e=>{var i;"old"==we.type&&Reflect.has(e,l)&&("isFixed"==l?e.fixedWay=1==e[l]?"LEFT":2==e[l]?"RIGHT":"NONE":["isShow","isSort"].includes(l)&&"boolean"!=typeof l?e[fe[l]]=1==e[l]:e[fe[l]]=e[l],Reflect.deleteProperty(e,l)),e.columnWidth=+e.columnWidth||null,Reflect.has(e,"alias")||(e.alias=""),Reflect.has(e,"bold")||(e.bold=!1),e.draggable=!!V(e),F(null==(i=e.relation)?void 0:i.fieldList)&&e.relation.fieldList.forEach((e=>{1==e.isSearch&&(e.checked=!0)}))}))})),function(e){if(we.groupSetting){return O(we.groupSetting,e).reduce(((i,t)=>{const o=M(t)?e.find((e=>e.name===t)):l(t.children);return o&&i.push(o),i}),[])}return e;function l(i){const t=[];return i.forEach((i=>{if(i.children)t.push(...l(i.children));else{const l=e.find((e=>e.name===i));l&&t.push(l)}})),t}}(e)}function Ee(){const e=Se.keyword!==pe.value;let l=pe.value?ke.value.findIndex(((l,i)=>{var t;if(null==(t=l.title)?void 0:t.includes(pe.value))return!!e||i>Se.idx})):0;-1!==l||e||(l=Se.startIdx),ge.value.scrollTop=52*l,Object.assign(Se,{keyword:pe.value,idx:l},e?{startIdx:l}:{})}function He(e){var l;return!!pe.value&&(null==(l=e.title)?void 0:l.includes(pe.value))}function Fe(){var e,l,i,t;be.value=D(me),(null==(e=we.showColumnNames)?void 0:e.length)&&(be.value=me.filter((e=>{var l,i;return"title"===e.field||(null==(i=null==(l=we.showColumnNames)?void 0:l.includes)?void 0:i.call(l,e.field))}))),(null==(l=we.customColumns)?void 0:l.length)&&we.customColumns.forEach((e=>{const{positionField:l}=e;if(l&&be.value.some((e=>e.field===l))){const i=be.value.findIndex((e=>e.field===l));be.value.splice(i,0,e)}else be.value.push(e)})),"column"===we.fieldDescribeMode&&Ce.value&&be.value.push({title:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.260"))||"字段描述",type:"text",field:"feildDescribe"}),we.showSeq&&be.value.splice(1,0,{title:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.249"))||"排序",type:"text",field:"seq"}),be.value.forEach((e=>{if(e.isShow=function(e){var l,i;if(!(null==(l=we.showColumnNames)?void 0:l.length))return!(["editable","required"].includes(e.field)&&!we.isEdit||"sortPriority"===e.field&&!we.showSortPriority||"isShowHeaderFilter"===e.field&&!we.showHeadFilter||"hideExpression"===e.field&&!(null==(i=we.hideExpressionConfig)?void 0:i.show)||e.hide);return!0}(e),"checkbox"===e.type){const l=ye.value.flat().every((l=>!Reflect.has(l,e.field)));e.checkedAll=!De(e.field)&&!l}}))}function De(e){return ye.value.flat().some((l=>!R(l,e)&&!l[e]&&"0001"!=l.id))}function Me(e){return!!j(e.relatedContext.element)}return a([()=>we.fields,()=>{var e;return null==(e=we.showColumnNames)?void 0:e.length}],(([e,l])=>{e.length>0&&(ye.value=We(),Fe())}),{immediate:!0,deep:!0}),K({getTableFields:function(){let e=[];return e="old"==we.type?ke.value.map(((e,l)=>P({...e,field:e.name,visible:e.show,sequence:l,sortable:e.sort,title:e.alias,fixed:e.fixedWay,minWidth:e.columnWidth},["name","show","sort","alias","fixedWay","columnWidth"]))):ke.value,e.map((e=>P(e,["uuid"])))}}),(i,t)=>{var o;return n(),r("div",U,[l.showSearch?(n(),u(s(B),{key:0,class:"main-wrapper__search-wrapper",value:pe.value,"onUpdate:value":t[0]||(t[0]=e=>pe.value=e),valueModifiers:{trim:!0},placeholder:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.245"))||"请输入字段标题",onKeydown:c(w(Ee,["prevent"]),["enter"])},null,8,["value","onKeydown"])):f("v-if",!0),e("div",{class:"main-wrapper__table",ref_key:"tableRef",ref:ve},[e("div",T,[(n(!0),r(h,null,p(be.value,((i,t)=>(n(),r(h,{key:t},[i.isShow?(n(),r("span",{key:0,class:"table-cell",style:g(s(N)(i,t,l.columnWidthProps))},[e("span",null,["checkbox"!==i.type||i.isHeadCheckHide?(n(),r(h,{key:1},[y(m(i.title),1)],64)):(n(),u(s(S),{key:0,checked:i.checkedAll,"onUpdate:checked":[e=>i.checkedAll=e,e=>{return l=e,t=i.field,void ke.value.forEach((e=>{R(e,t)||(e[t]=l)}));var l,t}],disabled:i.disabledAll},{default:v((()=>[y(m(i.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"])),"sortPriority"===i.field?(n(),u(s(L),{key:2,trigger:"hover"},{trigger:v((()=>[b(s(_),{component:s(I),style:{top:"2px"}},null,8,["component"])])),default:v((()=>[G])),_:1})):f("v-if",!0)])],4)):f("v-if",!0)],64)))),128))]),e("div",{class:"main-wrapper__table-body",ref_key:"tableBodyRef",ref:ge},[(n(),u(s(E),{modelValue:ye.value,"onUpdate:modelValue":t[1]||(t[1]=e=>ye.value=e),animation:"150","item-key":"id",filter:".disabled",draggable:".item",move:Me,disabled:!l.rowDraggable,key:he.value},{item:v((({element:e,index:l})=>[e.hide?f("v-if",!0):(n(),r("div",{key:0,class:x(["item",s(j)(e)?"":"disabled"]),tabindex:l,style:g({width:s(xe)})},[s(F)(e)?(n(!0),r(h,{key:0},p(e,((e,i)=>(n(),u(H,k(Be,{key:i,element:e,idx:l+1,"is-highlight":He(e)}),null,16,["element","idx","is-highlight"])))),128)):(n(),u(H,k({key:1},Be,{element:e,idx:l+1,"is-highlight":He(e)}),null,16,["element","idx","is-highlight"]))],14,$))])),_:1},8,["modelValue","disabled"]))],512)],512),l.footerFlag?(n(),r("div",z,[f(" 底部按钮插槽 "),C(i.$slots,"footer",{},(()=>[b(s(A),{onPositiveClick:Ae},{trigger:v((()=>[b(s(W),{style:{"margin-right":"8px"}},{default:v((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.242"))||"恢复默认设置")]})),_:1})])),default:v((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.243"))||"确认要恢复系统默认设置吗?")]})),_:1}),b(s(W),{style:{"margin-right":"8px"},onClick:_e},{default:v((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.28"))||"取消")]})),_:1}),b(s(W),{type:"primary",onClick:Le},{default:v((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.244"))||"保存")]})),_:1})]))])):f("v-if",!0)])}}});export{J as default};
|
@@ -71,12 +71,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
71
71
|
setRefs: AnyObject;
|
72
72
|
fieldSetRef: import("vue").Ref<any>;
|
73
73
|
primaryColor: import("vue").Ref<string>;
|
74
|
-
fieldSetHeight: import("vue").Ref<number>;
|
75
74
|
dataLength: import("vue").ComputedRef<number>;
|
76
75
|
style: import("vue").ComputedRef<{
|
77
76
|
'--row-height': string;
|
78
77
|
'--primary-color': string;
|
79
|
-
|
78
|
+
}>;
|
79
|
+
newAttrs: import("vue").ComputedRef<{
|
80
|
+
[x: string]: unknown;
|
80
81
|
}>;
|
81
82
|
tabList: import("vue").ComputedRef<{
|
82
83
|
name: FieldSetTab;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,useAttrs as l,provide as t,reactive as i,ref as o,computed as a,h as r,unref as d,openBlock as n,createElementBlock as s,normalizeStyle as
|
1
|
+
import{defineComponent as e,useAttrs as l,provide as t,reactive as i,ref as o,computed as a,h as r,unref as d,openBlock as n,createElementBlock as s,normalizeStyle as f,createBlock as u,withCtx as m,Fragment as w,renderList as g,resolveDynamicComponent as h,mergeProps as y,createSlots as v,renderSlot as b,createCommentVNode as F}from"vue";import{useThemeVars as p,NTabs as c,NTabPane as C}from"naive-ui";import L from"./FieldSet.vue.js";import T from"./FieldColor.vue.js";import S from"./TableStyle.vue.js";import _ from"./FieldFilter.vue.js";import{InjectionFieldList as k,InjectionQueryWordbookData as j}from"./constants/index.js";import{isArray as N}from"lodash-es";var R=e({__name:"Index",props:{showTabNames:{type:Array,default:()=>["field"]},fieldColorList:{type:Array,default:()=>[]},highlightRowColorList:{type:Array,default:()=>[]},fieldList:{type:Object},queryWordbookData:{type:Function},fieldFilterList:{type:Array,default:()=>[]},showFilterColumnNames:{type:Array,default:()=>[]}},emits:["save"],setup(e,{expose:R,emit:x}){const A=e,B=l();t(k,A.fieldList),t(j,A.queryWordbookData);const $=i({}),q=o(),D=o(p().value.primaryColor),W=a((()=>{const e=A.showTabNames[0];return"field"===e?N(B.fields)?B.fields.length:0:"fieldFilter"===e?N(A.fieldFilterList)?A.fieldFilterList.length:0:1})),H=a((()=>({"--row-height":"showSearch"in B&&!1!==B.showSearch||"show-search"in B&&!1!==B["show-search"]?"52px":"auto","--primary-color":D.value}))),I=a((()=>{const{style:e,...l}=B;return l})),O=a((()=>{var e,l,t,i,o;return[{name:"field",tab:(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.261"))||"字段设置",render:()=>r(L)},{name:"fieldColor",tab:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.262"))||"字段颜色",render:()=>r(T,{isFieldColor:!0,defaultList:A.fieldColorList})},{name:"highlightRow",tab:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.263"))||"高亮行",render:()=>r(T,{isFieldColor:!1,defaultList:A.highlightRowColorList})},{name:"tableStyle",tab:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.264"))||"表格样式",render:()=>r(S)},{name:"fieldFilter",tab:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.265"))||"高级筛选",render:()=>r(_,{defaultList:A.fieldFilterList,showFilterColumnNames:A.showFilterColumnNames})}].filter((e=>A.showTabNames.includes(e.name)))}));function z(){var e,l,t,i,o;x("save",{tableFields:null==(e=$.field)?void 0:e.getTableFields(),tableFieldColors:null==(l=$.fieldColor)?void 0:l.getTableFields(),tableHighlightRows:null==(t=$.highlightRow)?void 0:t.getTableFields(),tableStyle:null==(i=$.tableStyle)?void 0:i.getTableFields(),tableFilters:null==(o=$.fieldFilter)?void 0:o.getTableFields()})}function E(e,l){$[l]=e}return R({getTableFields:function(e){var l;return null==(l=$[e||"field"])?void 0:l.getTableFields()}}),(e,l)=>d(W)>0?(n(),s("div",{key:0,class:"c-field-set",style:f(d(H)),ref_key:"fieldSetRef",ref:q},[d(O).length>1?(n(),u(d(c),{key:0,type:"line",naimated:""},{default:m((()=>[(n(!0),s(w,null,g(d(O),(l=>(n(),u(d(C),{key:l.name,name:l.name,tab:l.tab,"display-directive":"show"},{default:m((()=>[(n(),u(h(l.render()),y(d(I),{ref_for:!0,ref:e=>E(e,l.name),onSave:z}),v({_:2},[g(e.$slots,((l,t)=>({name:t,fn:m((()=>[b(e.$slots,t)]))})))]),1040))])),_:2},1032,["name","tab"])))),128))])),_:3})):(n(),u(h(d(O)[0].render()),y({key:1},d(I),{ref:e=>E(e,d(O)[0].name),onSave:z}),v({_:2},[g(e.$slots,((l,t)=>({name:t,fn:m((()=>[b(e.$slots,t)]))})))]),1040))],4)):F("v-if",!0)}});export{R as default};
|
@@ -29,6 +29,7 @@ export type FieldSetColumnItem = {
|
|
29
29
|
isShow?: boolean;
|
30
30
|
contentRender?: (column: AnyObject, row: AnyObject) => VNodeChild;
|
31
31
|
hide?: boolean;
|
32
|
+
positionField?: string;
|
32
33
|
[key: string]: any;
|
33
34
|
};
|
34
35
|
export type FieldSetTab = 'field' | 'fieldColor' | 'highlightRow' | 'tableStyle' | 'fieldFilter';
|
@@ -1 +1 @@
|
|
1
|
-
.c-field-set{height:100%;width:100%}.c-field-set__color-picker .n-color-picker-trigger__value{display:none}.c-field-set .main-wrapper{box-sizing:border-box;display:flex;flex-flow:column nowrap;height:
|
1
|
+
.c-field-set{height:100%;width:100%}.c-field-set__color-picker .n-color-picker-trigger__value{display:none}.c-field-set .n-tabs{height:100%}.c-field-set .n-tabs .n-tab-pane{flex:1;overflow:auto}.c-field-set .main-wrapper{box-sizing:border-box;display:flex;flex-flow:column nowrap;height:100%;width:100%}.c-field-set .main-wrapper__search-wrapper.n-input{margin-bottom:12px;width:50%}.c-field-set .main-wrapper .item{background:#fff}.c-field-set .main-wrapper .item:active{background:#f2f2f2;box-shadow:0 0 10px 0 #d5d5d5}.c-field-set .main-wrapper .item:focus{background-color:#f2f2f2}.c-field-set .main-wrapper .item.disabled{cursor:not-allowed}.c-field-set .main-wrapper .item .row{align-items:center;border-bottom:1px solid #e8e8e8;display:flex;height:var(--row-height);padding:8px 0}.c-field-set .main-wrapper .table-cell{word-wrap:break-word;box-sizing:border-box;color:inherit;display:inline-block;padding:0 5px}.c-field-set .main-wrapper .table-cell>.n-button{margin-right:5px}.c-field-set .main-wrapper .table-cell>.n-button:last-child{margin-right:0}.c-field-set .main-wrapper .table-cell .highlight{background-color:var(--primary-color);color:#fff}.c-field-set .main-wrapper .table-cell .c-field-set__color-picker{display:block}.c-field-set .main-wrapper__table{box-sizing:border-box;display:flex;flex:1;flex-flow:column nowrap;min-height:0;overflow:auto;width:100%}.c-field-set .main-wrapper__table-header{align-items:center;background:#f2f2f4;border:1px solid #f2f2f2;display:flex;flex:0 0 52px;position:sticky;top:0;z-index:1}.c-field-set .main-wrapper__table-header .n-checkbox.n-checkbox--disabled .n-checkbox__label{color:var(--n-text-color)}.c-field-set .main-wrapper__table-header .table-cell{align-items:center;background:#f2f2f4;display:flex;height:100%}.c-field-set .main-wrapper__table-body{flex:1}.c-field-set .main-wrapper__table-footer{border-top:1px solid #d5d5d5;padding:12px 0}.c-field-set .main-wrapper .set-item{padding:10px 0}.c-field-set .main-wrapper .set-item.table-item{border-top:1px solid #e8e8e8;width:50%}.c-field-set .main-wrapper .set-item.table-item h4{font-size:16px;font-weight:400;margin-bottom:12px}.c-field-set .main-wrapper .set-item.table-item .table-style{background:#e5e5e5;border:2px solid #cfcfcf;border-radius:4px;cursor:pointer;margin-bottom:10px;padding:20px 0 0}.c-field-set .main-wrapper .set-item.table-item .table-style .table-bg{background:#fff;border-radius:5px;margin:0 20px 20px;padding:10px}.c-field-set .main-wrapper .set-item.table-item .table-style .table-bg img{width:100%}.c-field-set .main-wrapper .set-item.table-item .table-style__desc{align-items:center;background:#fff;display:flex;padding:10px}.c-field-set .main-wrapper .set-item.table-item .table-style__desc .n-icon{color:var(--c-primary-color);font-size:20px}.c-field-set .main-wrapper .set-item.table-item .table-style__desc .circle{border:1px solid #d5d5d5;border-radius:50%;display:inline-block;height:18px;width:18px}.c-field-set .main-wrapper .set-item.table-item .table-style__desc span{margin-left:5px}.c-field-set .main-wrapper .set-item.table-item .table-style.active{background:#e2ebfa;border:2px solid var(--c-primary-color)}.c-field-set__color-block{display:inline-block;margin-left:20px;position:relative}.c-field-set__color-block:before{background-color:var(--color);border-radius:2px;content:"";height:14px;left:-20px;position:absolute;top:3px;width:14px}.c-field-set__space{width:100%}.c-field-set__space>div:first-child{width:80%}.c-field-set__space .filter-btn{color:var(--c-primary-color);cursor:pointer}.c-field-set__condition .condition-wrapper__item{align-items:center;display:flex;margin-top:10px}.c-field-set__condition .condition-wrapper__item .item-index{margin-right:10px}.c-field-set__condition .condition-wrapper__item>.n-date-picker,.c-field-set__condition .condition-wrapper__item>.n-input,.c-field-set__condition .condition-wrapper__item>.n-input-number,.c-field-set__condition .condition-wrapper__item>.n-select{margin-right:10px;width:20%}.c-field-set__condition .sql-expression-wrapper{margin-top:10px}
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as o,provide as t,computed as r,nextTick as a,onBeforeUnmount as s,openBlock as i,createBlock as l,unref as n,mergeProps as m,withCtx as p,createElementBlock as d,createVNode as u,isRef as c,Fragment as f,renderList as h,createCommentVNode as y,createElementVNode as g,normalizeStyle as v,toDisplayString as b,renderSlot as j}from"vue";import{useTheme as k}from"../../../shared/hooks/useTheme.js";import{useElementSize as C}from"@vueuse/core";import"date-fns";import{isNumber as F,cloneDeep as S}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NForm as x,NTabs as w,NTabPane as L,NConfigProvider as B}from"naive-ui";import{useVersion as A}from"../../../shared/hooks/useVersion.js";import"../../../shared/hooks/useScrollLoading.js";import{createForm as R,onFormMount as H,onFieldValueChange as O,onFieldMount as T,onFieldUnmount as I,onFieldReact as V}from"@formily/core";import{Path as N}from"@formily/path";import{FormProvider as _,FormConsumer as D}from"@formily/vue";import{InjectionFormColumnWidth as W,InjectionFormLifeCycleCaller as U,InjectionFormGraph as E}from"./constants/index.js";import"./components/renderer/text.js";import"./utils/business.js";import{createObjSchema as M}from"./utils/schema.js";import{useAnchor as q}from"./hooks/useAnchor.js";import"../index.js";import{useComplexOptionsSpan as P}from"./hooks/useComplexOptions.js";import{useFieldListAdaptor as G}from"./hooks/useFieldListAdaptor.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{useFieldVisitor as K}from"./hooks/useFieldVisitor.js";import{useFormContext as z}from"./hooks/useFormContext.js";import{useFormDomEvent as J,useFormExposeEvent as Q}from"./hooks/useFormEvent.js";import{useFormGraph as $}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as X}from"./hooks/useFormRenderLifeCycle.js";import{validateMessageLocale as Y}from"./hooks/useFormValidator.js";import{useLowCodeEvent as Z}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as ee}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as oe}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as te}from"./hooks/useOperationalForm.js";import{useWordbookSetting as re}from"./hooks/useWordbookSetting.js";import{useNewLowCodeReactions as ae}from"./hooks/useNewLowCodeReactions.js";import{GlobalState as se}from"@formily/core/esm/shared/constants";const ie={key:0,style:{height:"54px"}},le={style:{"white-space":"pre"}};var ne=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:5},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},annotationShortcuts:{type:Array},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},autoExpand:Boolean,lowCodeReactions:{type:Array},newLowCodeReactions:{type:Array},operationalForm:{type:Array},dateOperationalForm:{type:Object},operationalFormInit:{type:Boolean,default:!0},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},labelPlacementOverwrite:Boolean,outBordered:{type:Boolean,default:!1},uniqueCacheData:{type:Boolean,default:!1},forceClearable:Boolean,wordSplitFilter:{type:Boolean,default:!0},selectMode:Boolean,selectedFields:{type:Array},linebarDirection:{type:String,default:"vertical"},linebarTextDirection:{type:String,default:"horizontal"},linebarWidth:{type:[Number,String],default:120},autoWidth:{type:[Boolean,Number],default:!1},incrementalRender:{type:Boolean,default:!1},feedbackType:{type:String,default:"default"},fixMemoLeak:{type:Boolean}},emits:["formChange","annotationChange","scroll","update:selectedFields","linebarChange","ready"],setup(e,{expose:ne,emit:me}){const pe=e,de=k(),{nuiThemeOverrides:ue}=oe();Y();const ce=o(),{width:fe}=C(ce);t(W,r((()=>fe.value?(fe.value-16*(pe.column-1))/24:0)));const he=r((()=>F(pe.maxHeight)?pe.maxHeight+"px":pe.maxHeight)),{SchemaField:ye,businessCollector:ge,formItemDepsCollector:ve,changeContextCollector:be,asyncQueue:je,formUUID:ke}=z(pe,me),{anchorBarRef:Ce,currentAnchor:Fe,updateAnchorList:Se,anchorIdList:xe,onScroll:we,generateAnchorList:Le}=q(pe,me,ce,ve),{callLifeCycle:Be}=X(pe);t(U,Be),Be("onSetup");const{observeFormGraph:Ae,setGraph:Re,removeGraph:He}=$();t(E,Ae);const{lowCodeEventTrigger:Oe}=Z(),Te=o(!0),Ie=R({initialValues:pe.initialData,effects(e){const o={};H((()=>{Object.assign(o,S(e.values))})),O("*",(t=>{const r=N.getIn(o,t.path);N.setIn(o,t.path,t.value);const a=t.props.name.toString();ge.trigger(e,a),ve.trigger(t.path),Te.value&&me("formChange",{fieldInstance:t,fieldKey:a,oldValue:r,fieldName:t.title,value:t.value,context:be.getContext(a,t.value)}),Oe(t),Ve(a),Ne(a),_e.trigger(a),De.trigger(a,t.value)})),T("*",Re),T("*",(e=>{const o=e.props.name.toString();Ve(o),Ne(o),pe.operationalFormInit&&_e.trigger(o)})),I("*",He),pe.anchor&&V("*",Se)}}),{lowCodeReactionsHandler:Ve}=ee(r((()=>pe.lowCodeReactions)),Ie),{newLowCodeReactionsHandler:Ne}=ae(r((()=>pe.newLowCodeReactions)),Ie),_e=te(pe,Ie),De=re().create(Ie,be),{schemaAdaptor:We}=G(ge,pe.lifeCycle);let Ue=pe.fieldList||[],Ee=[];const Me=r((()=>{let
|
1
|
+
import{defineComponent as e,ref as o,provide as t,computed as r,nextTick as a,onBeforeUnmount as s,openBlock as i,createBlock as l,unref as n,mergeProps as m,withCtx as p,createElementBlock as d,createVNode as u,isRef as c,Fragment as f,renderList as h,createCommentVNode as y,createElementVNode as g,normalizeStyle as v,toDisplayString as b,renderSlot as j}from"vue";import{useTheme as k}from"../../../shared/hooks/useTheme.js";import{useElementSize as C}from"@vueuse/core";import"date-fns";import{isNumber as F,cloneDeep as S}from"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NForm as x,NTabs as w,NTabPane as L,NConfigProvider as B}from"naive-ui";import{useVersion as A}from"../../../shared/hooks/useVersion.js";import"../../../shared/hooks/useScrollLoading.js";import{createForm as R,onFormMount as H,onFieldValueChange as O,onFieldMount as T,onFieldUnmount as I,onFieldReact as V}from"@formily/core";import{Path as N}from"@formily/path";import{FormProvider as _,FormConsumer as D}from"@formily/vue";import{InjectionFormColumnWidth as W,InjectionFormLifeCycleCaller as U,InjectionFormGraph as E}from"./constants/index.js";import"./components/renderer/text.js";import"./utils/business.js";import{createObjSchema as M}from"./utils/schema.js";import{useAnchor as q}from"./hooks/useAnchor.js";import"../index.js";import{useComplexOptionsSpan as P}from"./hooks/useComplexOptions.js";import{useFieldListAdaptor as G}from"./hooks/useFieldListAdaptor.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{useFieldVisitor as K}from"./hooks/useFieldVisitor.js";import{useFormContext as z}from"./hooks/useFormContext.js";import{useFormDomEvent as J,useFormExposeEvent as Q}from"./hooks/useFormEvent.js";import{useFormGraph as $}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as X}from"./hooks/useFormRenderLifeCycle.js";import{validateMessageLocale as Y}from"./hooks/useFormValidator.js";import{useLowCodeEvent as Z}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as ee}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as oe}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as te}from"./hooks/useOperationalForm.js";import{useWordbookSetting as re}from"./hooks/useWordbookSetting.js";import{useNewLowCodeReactions as ae}from"./hooks/useNewLowCodeReactions.js";import{GlobalState as se}from"@formily/core/esm/shared/constants";const ie={key:0,style:{height:"54px"}},le={style:{"white-space":"pre"}};var ne=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:5},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},annotationShortcuts:{type:Array},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},autoExpand:Boolean,lowCodeReactions:{type:Array},newLowCodeReactions:{type:Array},operationalForm:{type:Array},dateOperationalForm:{type:Object},operationalFormInit:{type:Boolean,default:!0},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},labelPlacementOverwrite:Boolean,outBordered:{type:Boolean,default:!1},uniqueCacheData:{type:Boolean,default:!1},forceClearable:Boolean,wordSplitFilter:{type:Boolean,default:!0},selectMode:Boolean,selectedFields:{type:Array},linebarDirection:{type:String,default:"vertical"},linebarTextDirection:{type:String,default:"horizontal"},linebarWidth:{type:[Number,String],default:120},autoWidth:{type:[Boolean,Number],default:!1},incrementalRender:{type:Boolean,default:!1},feedbackType:{type:String,default:"default"},fixMemoLeak:{type:Boolean}},emits:["formChange","annotationChange","scroll","update:selectedFields","linebarChange","ready"],setup(e,{expose:ne,emit:me}){const pe=e,de=k(),{nuiThemeOverrides:ue}=oe();Y();const ce=o(),{width:fe}=C(ce);t(W,r((()=>fe.value?(fe.value-16*(pe.column-1))/24:0)));const he=r((()=>F(pe.maxHeight)?pe.maxHeight+"px":pe.maxHeight)),{SchemaField:ye,businessCollector:ge,formItemDepsCollector:ve,changeContextCollector:be,asyncQueue:je,formUUID:ke}=z(pe,me),{anchorBarRef:Ce,currentAnchor:Fe,updateAnchorList:Se,anchorIdList:xe,onScroll:we,generateAnchorList:Le}=q(pe,me,ce,ve),{callLifeCycle:Be}=X(pe);t(U,Be),Be("onSetup");const{observeFormGraph:Ae,setGraph:Re,removeGraph:He}=$();t(E,Ae);const{lowCodeEventTrigger:Oe}=Z(),Te=o(!0),Ie=R({initialValues:pe.initialData,effects(e){const o={};H((()=>{Object.assign(o,S(e.values))})),O("*",(t=>{const r=N.getIn(o,t.path);N.setIn(o,t.path,t.value);const a=t.props.name.toString();ge.trigger(e,a),ve.trigger(t.path),Te.value&&me("formChange",{fieldInstance:t,fieldKey:a,oldValue:r,fieldName:t.title,value:t.value,context:be.getContext(a,t.value)}),Oe(t),Ve(a),Ne(a),_e.trigger(a),De.trigger(a,t.value)})),T("*",Re),T("*",(e=>{const o=e.props.name.toString();Ve(o),Ne(o),pe.operationalFormInit&&_e.trigger(o)})),I("*",He),pe.anchor&&V("*",Se)}}),{lowCodeReactionsHandler:Ve}=ee(r((()=>pe.lowCodeReactions)),Ie),{newLowCodeReactionsHandler:Ne}=ae(r((()=>pe.newLowCodeReactions)),Ie),_e=te(pe,Ie),De=re().create(Ie,be),{schemaAdaptor:We}=G(ge,pe.lifeCycle);let Ue=pe.fieldList||[],Ee=[];const Me=r((()=>{var e;let o=!1;const t=pe.schema?pe.schema:pe.fieldList?(Ue!==pe.fieldList&&0!==Ue.length||(o=!0),Ue=K().traverse(S(pe.fieldList),pe.fieldVisitor),M(We(Ue,pe))):M({});return pe.incrementalRender&&(null==(e=pe.fieldList)?void 0:e.length)&&o&&(Ee=[],Object.values(t.properties).forEach((e=>{var o;"visible"===e["x-display"]&&"LINEBAR"===e["x-component"]&&!1!==(null==(o=e["x-component-props"])?void 0:o.show)&&(Ee.push(e),e["x-component-props"].show=!1)})),qe()),t}));function qe(){Ee.length?setTimeout((()=>{const e=Ee.shift();e&&(ve.trigger(N.parse(e.name),!0),Ie.setFieldState(e.name,(e=>{e.componentProps.show=!0})),Ee.length?qe():a().then((()=>{me("ready")})))}),300):me("ready")}const{onKeydown:Pe}=J({formModel:Ie,formRenderRef:ce,props:pe,formUUID:ke}),{clearSpan:Ge}=P();s((()=>{Ge(ke),pe.fixMemoLeak&&(se.lifecycles.length=0)}));const Ke=Q({formModel:Ie,formRenderRef:ce,formItemDepsCollector:ve,businessCollector:ge,wordbookSettingHandler:De,operationalFormHandler:_e,getFieldList:()=>Ue,formUUID:ke,changeContextCollector:be,emitFormChange:Te});return ne({formModel:Ie,validate:(e="*",o={})=>Ke.validate(e,o),getFormValues:(e=!0)=>Ke.getFormValues(e),setFormValues:async(e,o={})=>Ke.setFormValues(e,o),setFieldState(e,o){Ke.setFieldState(e,o)},resetFields(e="*"){Ke.resetFields(e)},queryWidget:async e=>Ke.queryWidget(e),getFieldList:()=>Ue,applySelectedSetting:e=>Ke.applySelectedSetting(e),async reload(){console.error("reload function is abstract,it should be overwrite!")},async optionInited(e={}){if(await a(),je.activeTasks)return new Promise((o=>{var t;const r=()=>{o(),je.onActiveTaskChange=null};je.onActiveTaskChange=()=>{je.activeTasks||r()},setTimeout(r,null!=(t=e.timeout)?t:5e3)}))},updateAnchor(){Le(Ie)},getTextFormValues:()=>Ke.getTextFormValues()}),(o,t)=>(i(),l(n(x),m({class:["form-render",{"form-render--out-border":e.outBordered}],"require-mark-placement":"left",style:n(de)},n(A)(),{uuid:n(ke)}),{default:p((()=>[e.anchor&&n(xe).length?(i(),d("section",ie,[u(n(w),{value:n(Fe),"onUpdate:value":t[0]||(t[0]=e=>c(Fe)?Fe.value=e:null),type:"line",ref_key:"anchorBarRef",ref:Ce},{default:p((()=>[(i(!0),d(f,null,h(n(xe),(e=>(i(),l(n(L),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):y("v-if",!0),u(n(B),{"theme-overrides":n(ue)},{default:p((()=>[g("section",{class:"form-render__wrapper",style:v({"--column":e.column,"--form-height":n(he)}),ref_key:"formRenderRef",ref:ce,onScroll:t[1]||(t[1]=(...e)=>n(we)&&n(we)(...e)),onKeydownCapture:t[2]||(t[2]=(...e)=>n(Pe)&&n(Pe)(...e))},[u(n(_),{form:n(Ie)},{default:p((()=>[u(n(ye),{schema:n(Me)},null,8,["schema"]),e.consumer?(i(),l(n(D),{key:0},{default:p((({form:e})=>[g("div",le,b(JSON.stringify(e.values,null,2)),1)])),_:1})):y("v-if",!0),j(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},16,["class","style","uuid"]))}});export{ne as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as l,computed as t,ref as r,onUnmounted as o,createVNode as
|
1
|
+
import{defineComponent as e,inject as l,computed as t,ref as r,onUnmounted as o,createVNode as i,mergeProps as a,unref as n,withModifiers as d,createTextVNode as u}from"vue";import{arrayed as s,getStringWidth as m,widthAppend as f}from"../../../../../shared/utils/index.js";import{isVoidField as v}from"@formily/core";import{observe as c,autorun as p}from"@formily/reactive";import{connect as b,mapProps as h}from"@formily/vue";import{useDebounceFn as _}from"@vueuse/core";import{isString as y,isArray as g,isObject as k,isNumber as I,isFunction as x,uniq as F}from"lodash-es";import{NFormItem as w,NTooltip as O,NButton as T}from"naive-ui";import P from"../../../../annotation-edit/index.js";import"../../../index.js";import R from"../tooltipMessage.vue.js";import{InjectionFormGlobalProps as j,InjectionFormGlobalEmit as E,InjectionFormUUID as L,InjectionFormGraph as M,InjectionAnnotation as S,InjectionAnnotationShortcuts as C,InjectionFormColumnWidth as A}from"../../constants/index.js";import{useComplexOptionsSpan as U}from"../../hooks/useComplexOptions.js";import{validateMessageParser as W,editorUnescape as N}from"../../utils/index.js";import{dotEscape as q,createFieldAddressId as B}from"../../utils/schema.js";import{useFormField as H}from"../../hooks/useFormField.js";const K=b(e({name:"FormRenderItem",props:{label:String,propertyKey:String,remark:String,span:{type:Number,default:6},suffixFields:{type:Array},labelRender:Function,annotation:{},isOptionChildField:Boolean,feedback:String,showFeedback:{type:Boolean,default:void 0},fieldItem:{type:Object},showTooltipFeedback:{type:Boolean,default:!0}},setup(e,{slots:s,attrs:b}){const h=l(j),W=l(E),{field:K,fieldKey:V,fieldAddress:D}=H(),G=l(L),$=t((()=>q(`${G}-${D.value}`))),z=r(!1);if(v(K.value)&&g(e.suffixFields)){const t=l(M);o(c(t,_((()=>{v(K.value)&&g(e.suffixFields)&&(z.value=e.suffixFields.some((e=>{const l=K.value.form.query(e).take();return l&&Reflect.get(l,"required")})))}),100)))}else o(p((()=>{z.value=Reflect.get(K.value,"required")})));const Y=l(S),J=t({get(){var l,t;return null!=(t=null==(l=Y.value)?void 0:l[e.propertyKey])?t:""},set(l){Y.value={property:e.propertyKey,value:l}}}),Q=l(C);const X=t((()=>{var l;const t={color:null==(l=e.fieldItem)?void 0:l.labelColor};return k(b.labelStyle)&&Object.assign(t,b.labelStyle),t})),Z=t((()=>Y.value&&!1!==e.annotation)),ee=t((()=>{var l;return y(null==(l=e.fieldItem)?void 0:l.editor_title)&&e.fieldItem.editor_title&&["POPUP_ALERT","HOVER_TOOLTIP"].includes(e.fieldItem.editor_title_mode)})),le=r(!1);const te=t((()=>e.label&&" "!==e.label)),re=t((()=>{let l=0;return Z.value&&(l+=18),e.remark&&(l+=18),ee.value&&(l+=32),l})),oe=l(j,{}),ie=t((()=>{var l;const t=null==(l=e.fieldItem)?void 0:l.bordered;return null==t?oe.bordered:t})),ae=l("n-form",{}),ne=t((()=>{var e,l,t,r;if("left"!==(null!=(l=b.labelPlacement)?l:null==(e=ae.props)?void 0:e.labelPlacement))return"";let o=null!=(r=b.labelWidth)?r:null==(t=ae.props)?void 0:t.labelWidth;return o&&"auto"!==o?(o=parseInt(o+""),isNaN(o)||!I(o)?"":o-12-re.value-(z.value?11:0)):""})),de=t((()=>x(e.labelRender)?"":y(e.label)?e.label:"")),ue=t((()=>{var l;return null==(l=e.fieldItem)?void 0:l.fieldTitleColor}));function se(){return te.value?i("section",{class:"form-render__formItemLabel"},[i("span",{class:"form-render__formItemLabel--text",style:{marginRight:f(re.value),maxWidth:f(ne.value),color:ue.value},title:de.value},[x(e.labelRender)?e.labelRender(e.label):e.label]),re.value?i("section",{class:"form-render__formItemLabel--operation"},[e.remark?i("div",{class:"form-render__formItemLabel--tooltip"},[i(R,{message:e.remark},null)]):null,Z.value?i(P,{class:"form-render__formItemLabel--annotation",modelValue:J.value,"onUpdate:modelValue":e=>J.value=e,shortcuts:n(Q)},null):null,ee.value?i(O,{zIndex:3e3,raw:!0,showArrow:!1,trigger:"POPUP_ALERT"===e.fieldItem.editor_title_mode?"manual":"hover",placement:"top-start",show:"HOVER_TOOLTIP"===e.fieldItem.editor_title_mode?void 0:le.value,contentStyle:"background-color:white;color:rgb(51, 54, 57);padding:8px;position:relative;"},{trigger:()=>i(T,{onClick:d((()=>le.value=!le.value),["stop","prev"]),text:!0,type:"primary"},{default:()=>[i("span",{style:"display:inline-block;margin-left:4px"},[u("提示")])]}),default:()=>{var l,t;return[i("div",{innerHTML:N(null!=(t=null==(l=e.fieldItem)?void 0:l.editor_title)?t:"")},null),i(T,{text:!0,onClick:()=>le.value=!le.value,style:"position:absolute;right:2px;top:2px;line-height:1;height:12px;transform:scaleY(0.9)"},{default:()=>[u("x")]})]}}):null]):null]):null}const me=t((()=>{let l=re.value;return z.value&&(l+=11),y(e.label)&&(l+=ne.value||m(e.label)),l})),fe=l(A),{getSpan:ve}=U();function ce(){var l,t,r,o,i,a,d;const u="inner"===(null==(l=e.fieldItem)?void 0:l.childWidthMode)?e.span:ve(G,K.value.address,!1)+e.span;if("left"!==(null!=(r=b.labelPlacement)?r:null==(t=ae.props)?void 0:t.labelPlacement)||!n(fe)||!(null==h?void 0:h.autoWidth)||"INPUT_GROUP"===(null==(i=null==(o=K.value.parent)?void 0:o.component)?void 0:i[0]))return u;if("INPUT_GROUP"===(null==(d=null==(a=K.value.parent)?void 0:a.component)?void 0:d[0]))return u;const s=16+fe.value;let m=u*s-16-me.value;const f=I(null==h?void 0:h.autoWidth)?h.autoWidth:120;let v=u;for(;m<f&&v<12;)v++,m+=s;return v}function pe(){var l;return"tooltip"!==(null==h?void 0:h.feedbackType)?null==(l=s.default)?void 0:l.call(s):i(O,{to:"body",trigger:"manual",show:!!e.feedback&&e.showTooltipFeedback,raw:!0,animated:!1,showArrow:!1,placement:"top-start",contentStyle:"background-color:#e88080;color:white;padding:8px;border-radius:4px"},{trigger(){var e;return null==(e=s.default)?void 0:e.call(s)},default:()=>e.feedback})}function be(){var l,t,r;const o=null==(l=e.fieldItem)?void 0:l.editor_title,a=!(null==(t=e.fieldItem)?void 0:t.editor_title_mode)||"EMBEDDED_FORM"===(null==(r=e.fieldItem)?void 0:r.editor_title_mode);return y(o)&&o&&a?i("section",{style:"display:flex;flex-direction:column;gap:4px;width:100%"},[pe(),i("div",{innerHTML:N(o)},null)]):pe()}function he(){const e=[K.value.path+""];return K.value.form.query("*").forEach((l=>{(l.address+"").includes(K.value.address+"")&&((l.path+"").includes(K.value.path+"")||e.push(l.path+""))})),e}const _e=t({get:()=>!(!(null==h?void 0:h.selectMode)||!g(null==h?void 0:h.selectedFields))&&h.selectedFields.includes(K.value.path+""),set(e){if(!g(null==h?void 0:h.selectedFields))return;let l=[...h.selectedFields];e?(l.push(...he()),l=F(l)):he().forEach((e=>{const t=l.indexOf(e);t>-1&&l.splice(t,1)})),null==W||W("update:selectedFields",l)}}),ye=t((()=>(null==h?void 0:h.selectMode)&&!(K.value.parent&&"LINEBAR"!==K.value.parent.componentType)));function ge(){(null==h?void 0:h.selectMode)&&(_e.value=!_e.value)}const ke=t((()=>e.isOptionChildField?!!e.feedback&&" "!==e.feedback&&e.showFeedback:e.showFeedback));return()=>i(w,a({class:["form-render__formItem",{"form-render--no-border":!ie.value,"form-render--underline":"underline"===ie.value,"form-render__formItemMask":ye.value,"form-render__formItemMask--selected":ye.value&&_e.value}],style:{"--form-item-column":ce()},showFeedback:ke.value,feedback:"tooltip"===(null==h?void 0:h.feedbackType)?"":e.feedback,labelStyle:X.value},{id:$.value,uuid:G,onClick:ge,"widget-type":K.value.componentType,"field-key":q(V.value),"field-address":B(D.value),required:z.value}),{...s,default:be,label:se})}}),h({title:"label"},((e,l)=>{const t=v(l)?void 0:s(l.selfErrors).length?function(e,l){if(!y(l.defined_error_msg)||!l.defined_error_msg)return e.map((e=>W(e,l))).join(",");return W(l.defined_error_msg,l)}(s(l.selfErrors),e.fieldItem):void 0;return{...e,fieldItem:void 0,feedback:t,"validation-status":t?"error":void 0}})));export{K as FORM_ITEM};
|