cnhis-design-vue 3.1.43-beta.1 → 3.1.43-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/big-table/src/utils.js +1 -1
- package/es/components/button-print/src/utils/print.d.ts +2 -0
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/date-picker/index.d.ts +1 -1
- package/es/components/date-picker/src/DatePicker.vue.d.ts +1 -1
- package/es/components/date-picker/src/DatePicker.vue.js +1 -1
- package/es/components/form-config/index.d.ts +72 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +72 -0
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +1 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +43 -0
- package/es/components/form-render/index.d.ts +1 -0
- package/es/components/form-render/src/FormRender.vue.d.ts +1 -0
- package/es/components/form-render/src/FormRender.vue.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +1 -0
- package/es/components/form-render/src/hooks/useLowCodeEvent.d.ts +6 -0
- package/es/components/form-render/src/hooks/useLowCodeEvent.js +1 -0
- package/es/components/form-render/src/types/fieldItem.d.ts +2 -127
- package/es/components/form-render/src/types/index.d.ts +1 -2
- package/es/components/iho-table/index.d.ts +7 -3
- package/es/components/iho-table/src/IhoTable.vue.d.ts +7 -3
- package/es/components/iho-table/src/IhoTable.vue.js +1 -1
- package/es/components/iho-table/src/plugins/fieldConnectionPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +1 -1
- package/es/components/iho-table/src/types/index.d.ts +2 -2
- package/es/components/iho-table/src/types/pluginType.d.ts +18 -21
- package/es/components/info-header/index.d.ts +2 -0
- package/es/components/info-header/src/InfoHeader.vue.d.ts +2 -0
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +1 -0
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +1 -0
- package/es/components/shortcut-setter/index.d.ts +15 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +15 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/business.d.ts +3 -2
- package/es/shared/utils/business.d.ts +3 -3
- package/package.json +2 -2
- package/es/components/form-render/src/components/renderer/dist/levelSearchCascader.d.ts +0 -77
- package/es/components/form-render/src/components/renderer/dist/searchCascade.d.ts +0 -93
- package/es/components/iho-table/src/plugins/dist/highLightSetPlugin.d.ts +0 -3
- package/es/components/iho-table/src/plugins/filterRenderPlugin/dist/index.d.ts +0 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/dist/index.d.ts +0 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/dist/defaultRendererPlugin.d.ts +0 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/dist/seqRendererPlugin.d.ts +0 -3
- package/es/components/iho-table/src/utils/dist/index.d.ts +0 -44
- package/es/components/scale-view/src/components/formitem/dist/r-address.d.ts +0 -36
- package/es/components/scale-view/src/components/formitem/dist/r-sign.d.ts +0 -36
- package/es/components/scale-view/src/components/formitem/dist/standard-modal.d.ts +0 -82
- package/es/components/search-cascader/src/components/dist/SearchMenu.d.ts +0 -57
- package/es/components/search-cascader/src/components/dist/SearchMenu1.d.ts +0 -57
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../../../shared/assets/img/xb_small.png.js";import"xe-utils";import"moment";import t from"../../../shared/utils/vexutilsExpand.js";import{nextTick as i}from"vue";import{groupTraverser as n,createRowGroupList as r}from"../../iho-table/src/plugins/rowGroupSettingPlugin/rowGroupUtils.js";const l=e=>{if("string"==typeof e)try{const t=JSON.parse(e);return!("object"!=typeof t||!t)}catch(e){return!1}return!1},s=(e,t)=>{const i=e[t.columnName];if(l(i)){const e=JSON.parse(i);return e.star?`${e.star}星`:""}return i},o=(e,t)=>{const i=e[t.columnName];if(l(i)){return JSON.parse(i).address||""}return i},a=(e,t)=>{const i=e[t.columnName];if(l(i)){const e=JSON.parse(i),t=e.days||0;if(!(t>0))return"";if(t<91)return`${t} 天`;if(90<t&&t<365)return`${Math.floor(t/30)} 个月`;if(365<t&&t<1095)return`${e.year} 岁 ${e.month} 月`;if(1095<t)return`${e.year}岁`}return i||""},d=()=>{const e=document.querySelectorAll(".big-table-filter-wrap"),t=e[e.length-1].querySelector(".js-checkbox-wrap"),n=t.scrollTop;i((()=>{t.scrollTop=n}))},c=(e,t,i,n,r)=>{var l,s,o,a,d,c;if(n.isInlineOperating)return!1;const u=i.target,h=document.body,{left:f,right:g,top:p,width:m}=u.getBoundingClientRect();e.left="initial",e.right="initial",e.top="initial";if(f+400>h.clientWidth){const t=(null==h?void 0:h.getBoundingClientRect().right)||0;e.right=t-g-m/2+"px"}else e.left=f+"px";e.top=p+20+(n.filterTopOffset||0)+"px",e.visible=!e.visible;const v=null==(l=r.filterFields[t])?void 0:l.CONVERT.length;e.checkAll=v===(null==(o=null==(s=r.filterFields[t])?void 0:s.filterItems)?void 0:o.length),e.indeterminate=!!v&&v!==((null==(d=null==(a=e.setting)?void 0:a.showSetting)?void 0:d.length)||(null==(c=e.options)?void 0:c.length)),e.searchFilterText=""},u=(e,t)=>{const{rowGroupSetting:i}=t;return n(r(i,e,(e=>e.columnName||e.type)),((t,i)=>i?{field:t,title:t,align:"center"}:function(e,t){return t.find((t=>(t.columnName||t.type)===e))}(t,e)))},h=e=>{var t;return 1!=(e.notParticipatingSearch||"")&&["search","select","radio","checkbox"].includes(e.formType)&&(null==(t=e.options)?void 0:t.length)},f=(e,i)=>{Array.isArray(e)&&e.forEach((e=>{var n;if(i)e.CONVERT=[];else{if(e.setting){if(e.setting="string"==typeof e.setting?JSON.parse(e.setting):e.setting,!t.isEmpty(e.setting.wordbook))return e.con="QUOTE",e.dataSource=[],void(e.QUOTE=[]);if(e.setting.showSetting&&e.setting.showSetting.length>0)return e.con="CONVERT",e.setting.showSetting.forEach((e=>{e.label=e.change_text,e.value=JSON.stringify(e.filter)})),void(e.CONVERT=[])}(null==(n=e.fieldType)?void 0:n.includes("DATE"))?e.settingObj&&"BIRTHDAY"==e.settingObj.attr?(e.con="BIRTHDAY",e.showDate=!1,e.marginx="ml"):(e.con="DATE",e.showDate=!1,e.marginx="ml",e.DATE={con:null,start_val:null,end_val:null}):"TEXT"==e.fieldType?(e.con="CL",e.CL=""):("NUMBER"==e.fieldType||"JSONB"==e.fieldType)&&(e.con="EQ",e.EQ=""),"LABEL"===e.setting.attr&&(e.con="EQ",e.LABELAttr=!0,e.labelSelectList=[]),"EVALUATE"===e.setting.attr&&(e.con="CL",e.selecteds=[],e.EVALUATEAttr=!0)}}))},g=e=>{if("operatorColumn"!==e.columnName)return{name:"EditInput",enabled:1==e.isEdit}},p=(e,i,n)=>{const{groupCountMap:r}=n,l=[];return n.groupCountFields.forEach((e=>{const s=e.tips,o=e.color||"#000",a=e.unit||"";let d=e.defaultValue||0;if("all"==e.range)d=r[e.key];else if("page"==e.range){const{sum:r=0,count:l=0}=((e,i,n=[],r)=>{let l=0,s=0;const{fieldList:o=[]}=r.columnConfig;return e.forEach((e=>{m(e,(e=>{var a,d;if(!e.childrenList||!e.childrenList.length){let c=!0;if(n.length){const i={table:e,form:{},sys:(null==(d=null==(a=null==r?void 0:r.userInfo)?void 0:a.map)?void 0:d.sysParams)||{}};c=t.parseCondition(n,i,o)}if(c){const t=e[i]||0;l+=Number(t),++s}}}))})),{sum:l,count:s}})(i,e.field,e.conObj,n);d=l,"avg"==e.method?d=r/l||0:"sum"==e.method&&(d=r)}d=t.round(d,4),l.push(`<span style="color: ${o}">${s}:${d}${a}</span>`)})),l.join("、")},m=(e,t)=>{if(!e)return;const i=[e];for(;i.length>0;){const e=i.shift();e&&t(e),e.childrenList&&e.childrenList.reverse().forEach((e=>{i.unshift(e)}))}},v=({row:e})=>!e.forbiddenBatchSelect,y=({row:e})=>!e.$__SEPARATE,T=e=>{const t=[],i=(e,n)=>{e.length>0&&e.forEach((e=>{e.qianduan_id||(e.qianduan_id=e.theUniqueKey||window.crypto.getRandomValues(new Uint32Array(1))[0]),e.qianduan_parent_id=n||null,e.childrenList&&i(e.childrenList,e.qianduan_id),t.push(e)}))};return i(e),t},E=(e,t,i,n)=>{t.push(e),i.push(e[n]),e.childrenList&&e.childrenList.length&&e.childrenList.forEach((e=>{e.childrenList&&e.childrenList.length?E(e,t,i,n):(i.push(e[n]),t.push(e))}))},A=(e,t,i)=>{const n=[];if(!e.length)return 1;if(e.forEach((e=>n.push(e[i]))),!n.length)return 1;if(n.length!==t.length)return 1;return n.filter((e=>{t.includes(e)})).length},b=e=>{1!=e.checkedRows.length||v({row:e.checkedRows[0]})||e.checkedRows.pop()},_=(e,t)=>{if(!e.filterFields||!Object.keys(e.filterFields).length)return;const i=t.quickSearchConfig;if(!i||!i.length){return Object.keys(e.filterFields).forEach((t=>{e.filterFields[t].CONVERT=[]})),!1}for(const t in e.filterFields){const i=e.filterFields[t];i&&(i.CONVERT=[])}i.forEach((t=>{if(t.field_key in e.filterFields){if(!e.filterFields[t.field_key])return e.filterFields[t.field_key].CONVERT=[],!1;const i=t.value;e.filterFields[t.field_key].CONVERT=i}}))},O=({row:e})=>{if(e.rowColor){const i=t.hexToRGBA(e.rowColor,.2);return`background-color:${`rgba(${i.r}, ${i.g}, ${i.b}, ${i.a})`}`}return null},R=(e,t)=>{var i,n;if(!t.isNestTable)return t.height;const r=(null==(i=t.styleSetting)?void 0:i.tableHeight)||"table-simple",l=(null==(n=t.data)?void 0:n.length)||1;return`${e.checkWidth[r]*l+90}px`},N=(e,t="name")=>e.alias||e[t],D=(t,i,n)=>("HEADPORTRAIT"===i&&(t||(t=e)),n(t)),w=(e,t,i)=>{if(!t||!t.length)return e;const n=t.find((e=>e.type===i));if(!n)return e;if(n.suffix)return e+n.suffix;let r=n.h;const l=n.w;"adaptive"===n.h&&"adaptive"!=n.w&&(r=n.w),"adaptive"===n.w&&"adaptive"!=n.h&&(r=n.h);return e+`_${r}x${l}`},L=(e,i,n)=>{if(!e||!e.length)return{display:"inline-block",maxWidth:"100%",maxheight:n};const r=e.find((e=>e.type===i));if(!r)return{display:"inline-block",height:n};return t.handleImageSize(r,n)},C=(e,i)=>{var n;const r=e[i.columnName];if(t.isJSON(r)){const e=r.includes("user_name"),t=JSON.parse(r);if(Array.isArray(t)){const i=t.length;if(i>1)return`已选${i}人`;if(1===i)return e&&(null==(n=t[0])?void 0:n.user_name)||`已选${i}人`}}},B=(e,t)=>{var i,n;const{settingObj:r={},fieldSetting:l={}}=t,{mergedFeildExpression:s}=l;let o=e[t.field];if(s){const t=/#{(.+?)\}/g;o=s.replace(t,((t,i)=>e[i]||""))}const a={content:o};return{btnName:null==(i=null==r?void 0:r.qrCode)?void 0:i.name,trigger_id:null==(n=null==r?void 0:r.qrCode)?void 0:n.id,params:a}},S=(e,t)=>{var i;return(null==(i=e[t])?void 0:i.length)?e[t].filter((e=>"EDIT_ROW"===e.settingObj[0].trigger_type)):[]},k=(e,t)=>t[e.columnName]&&e.fieldSetting&&1==e.fieldSetting.fontContentCopy,I=(e,t,i)=>{if(!e||0===e.length)return document.body.style.setProperty("--table-image-height",i),void document.body.style.setProperty("--table-image-width","auto");const n=e.find((e=>e.type===t));if(!n)return document.body.style.setProperty("--table-image-height",i),void document.body.style.setProperty("--table-image-width","auto");let r=i,l="auto";n.h&&(r="adaptive"===n.h?"auto":n.h+"px"),n.w&&(l="adaptive"===n.w?"auto":n.w+"px"),document.body.style.setProperty("--table-image-height",r),document.body.style.setProperty("--table-image-width",l)},Y=(e,t,i={})=>{const n=i[e];return{[t.name]:(r=n,r&&"string"==typeof r&&r.startsWith("###")&&(r=r.slice(3),r=(r=JSON.parse(r)).tooltip||r.value),r)};var r},H=(e,t)=>{Object.values(e.filterFields).forEach((e=>{e.visible=!1})),_(e,t)},j=(e,i)=>{const n=Object.values(e.filterFields),r=Object.keys(e.filterFields),l=((e,i)=>{var n;if(!Array.isArray(e))return[];const r=[];for(let l=0;l<e.length;l++){const s=e[l];let o=0,a="";if(s.EQ||s.CL)o=s.EQ||s.CL,"PERCENTAGE"===(null==(n=s.settingObj)?void 0:n.attr)&&(o=Number(o)/100),s.EVALUATEAttr&&(o=s.selecteds.join("|#|"));else if(t.isEmpty(s.QUOTE))if(t.isEmpty(s.CONVERT))if(s.DATE)(s.DATE.start_val||s.DATE.end_val)&&(s.DATE.con="IN"),s.tempCon=s.DATE.con,s.start_val=s.DATE.start_val?s.DATE.start_val.format("YYYY-MM-DD HH:mm:ss"):"",s.end_val=s.DATE.end_val?s.DATE.end_val.format("YYYY-MM-DD HH:mm:ss"):"";else if(s.BIRTHDAY){let e=!1;if((s.BIRTHDAY.limit_date.length>0||s.BIRTHDAY.start_val||s.BIRTHDAY.end_val)&&(s.BIRTHDAY.con="IN"),s.tempCon=s.BIRTHDAY.con,e=!(!s.BIRTHDAY.start_val&&!s.BIRTHDAY.end_val),s.BIRTHDAY.start_val&&!t.validateBirthday(s.BIRTHDAY.start_val,s.title,s.BIRTHDAY.unit))return;if(s.BIRTHDAY.end_val&&!t.validateBirthday(s.BIRTHDAY.end_val,s.title,s.BIRTHDAY.unit))return;if(+s.BIRTHDAY.start_val>+s.BIRTHDAY.end_val)return void window.$message.warning(`${s.title}请输入有效范围`,2);a=i.limit_date||"",s.unit=e&&s.BIRTHDAY.unit||"",s.start_val=s.BIRTHDAY.start_val||"",s.end_val=s.BIRTHDAY.end_val||""}else if(s.LABELAttr){const e=[];s.labelSelectList.forEach((t=>{e.push(t.labelName)})),o=e.join("|#|")}else s.EVALUATEAttr&&(o=s.selecteds.join("|#|"));else o=s.CONVERT.map((e=>["string","number"].includes(typeof e)?e:JSON.parse(e)));else o=s.QUOTE.join("|#|");const d={field_key:s.columnName,con:s.DATE||s.BIRTHDAY?s.tempCon:s.con,value:o,limit_date:a||"",start_val:s.start_val||"",end_val:s.end_val||"",unit:s.unit||""};r.push(d)}return r.filter((e=>e.value||e.limit_date||e.start_val||e.end_val))})(n,e),s=[...l];return(i.tableParams.qqConObj?JSON.parse(i.tableParams.qqConObj):[]).forEach((e=>{r.includes(e.field_key)||s.push(e)})),s},x=(e,t,i)=>{var n;return t.clickFieldKey==t.columnName||"field"==e.relatedItems.triggerMethodPc&&t.columnName==e.relatedItems.triggerMethodField||t.isbtnLink&&i.btnLinks&&(null==(n=i.btnLinks)?void 0:n.includes(t.columnName))},$=(e,t)=>{t.showButtonTop=e.showButtonTop,t.isTree=e.isTree,t.openOnly=e.openOnly,t.isExpand=e.spreadAllBtn,t.levelLazyLoadSetting=Object.assign({},e.levelLazyLoadSetting),t.checkWidth=Object.assign({},t.checkWidth,e.checkWidth)},F=(e,i,n)=>{e.forEach((e=>{t.has(e,"childrenList")&&F(e.childrenList,i,n),t.has(e,n)&&(e[i]=e[n])}))},V=(e,t,i)=>{if(t.isNestTable)return;if(1==e.isTree)return e.visibleCheckAllWrap=!1,!1;e.visibleCheckAllWrap=i.length>1;const n=i.length>=e.curAbleCheckedLen,r=t.pageVO.pageSize===t.pageVO.total,l=i.length>e.currentPageSelectedLength;e.visibleCheckAllWrapMore=l||n&&!r};export{v as checkMethod,E as flattenRow,g as generateEditRender,C as getCandidateComponents,s as getEvaluate,p as getFooterGroup,S as getInlineEditBtn,o as getMapVal,O as getRowStyle,a as getageShowType,u as handleGroupColums,D as handleImgArr,w as handleImgSrc,N as handleName,B as handleQrCodeContent,R as handleTableHeight,I as handleTableImageSize,f as handlerInitSearchItem,H as hideFilterWrap,A as intersectRow,k as isCopy,h as isFilterItem,x as isLink,j as mergeConObjFn,L as modalDetailImage,d as reScrollFilterWrap,b as removeCheckedDisabledRows,Y as setDefaultFormData,_ as setFilterStatus,$ as setTableConfig,F as setTreeGroupTitle,V as setVisibleCheckAllWrap,c as showFilter,T as treeToList,y as visibleMethod};
|
|
1
|
+
import e from"../../../shared/assets/img/xb_small.png.js";import"xe-utils";import"moment";import t from"../../../shared/utils/vexutilsExpand.js";import{nextTick as i}from"vue";import{groupTraverser as n,createRowGroupList as r}from"../../iho-table/src/plugins/rowGroupSettingPlugin/rowGroupUtils.js";const l=e=>{if("string"==typeof e)try{const t=JSON.parse(e);return!("object"!=typeof t||!t)}catch(e){return!1}return!1},s=(e,t)=>{const i=e[t.columnName];if(l(i)){const e=JSON.parse(i);return e.star?`${e.star}星`:""}return i},o=(e,t)=>{const i=e[t.columnName];if(l(i)){return JSON.parse(i).address||""}return i},a=(e,t)=>{const i=e[t.columnName];if(l(i)){const e=JSON.parse(i),t=e.days||0;if(!(t>0))return"";if(t<91)return`${t} 天`;if(90<t&&t<365)return`${Math.floor(t/30)} 个月`;if(365<t&&t<1095)return`${e.year} 岁 ${e.month} 月`;if(1095<t)return`${e.year}岁`}return i||""},d=()=>{const e=document.querySelectorAll(".big-table-filter-wrap"),t=e[e.length-1].querySelector(".js-checkbox-wrap"),n=t.scrollTop;i((()=>{t.scrollTop=n}))},c=(e,t,i,n,r)=>{var l,s,o,a,d,c;if(n.isInlineOperating)return!1;const u=i.target,h=document.body,{left:f,right:g,top:p,width:m}=u.getBoundingClientRect();e.left="initial",e.right="initial",e.top="initial";if(f+400>h.clientWidth){const t=(null==h?void 0:h.getBoundingClientRect().right)||0;e.right=t-g-m/2+"px"}else e.left=f+"px";e.top=p+20+(n.filterTopOffset||0)+"px",e.visible=!e.visible;const v=null==(l=r.filterFields[t])?void 0:l.CONVERT.length;e.checkAll=v===(null==(o=null==(s=r.filterFields[t])?void 0:s.filterItems)?void 0:o.length),e.indeterminate=!!v&&v!==((null==(d=null==(a=e.setting)?void 0:a.showSetting)?void 0:d.length)||(null==(c=e.options)?void 0:c.length)),e.searchFilterText=""},u=(e,t)=>{const{rowGroupSetting:i}=t;return n(r(i,e,(e=>e.columnName||e.type)),((t,i)=>i?{field:t,title:t,align:"center"}:function(e,t){return t.find((t=>(t.columnName||t.type)===e))}(t,e)))},h=e=>{var t;return 1!=(e.notParticipatingSearch||"")&&["search","select","radio","checkbox"].includes(e.formType)&&(null==(t=e.options)?void 0:t.length)},f=(e,i)=>{Array.isArray(e)&&e.forEach((e=>{var n;if(i)e.CONVERT=[];else{if(e.setting){if(e.setting="string"==typeof e.setting?JSON.parse(e.setting):e.setting,!t.isEmpty(e.setting.wordbook))return e.con="QUOTE",e.dataSource=[],void(e.QUOTE=[]);if(e.setting.showSetting&&e.setting.showSetting.length>0)return e.con="CONVERT",e.setting.showSetting.forEach((e=>{e.label=e.change_text,e.value=JSON.stringify(e.filter)})),void(e.CONVERT=[])}(null==(n=e.fieldType)?void 0:n.includes("DATE"))?e.settingObj&&"BIRTHDAY"==e.settingObj.attr?(e.con="BIRTHDAY",e.showDate=!1,e.marginx="ml"):(e.con="DATE",e.showDate=!1,e.marginx="ml",e.DATE={con:null,start_val:null,end_val:null}):"TEXT"==e.fieldType?(e.con="CL",e.CL=""):("NUMBER"==e.fieldType||"JSONB"==e.fieldType)&&(e.con="EQ",e.EQ=""),"LABEL"===e.setting.attr&&(e.con="EQ",e.LABELAttr=!0,e.labelSelectList=[]),"EVALUATE"===e.setting.attr&&(e.con="CL",e.selecteds=[],e.EVALUATEAttr=!0)}}))},g=e=>{if("operatorColumn"!==e.columnName)return{name:"EditInput",enabled:1==e.isEdit}},p=(e,i,n)=>{const{groupCountMap:r}=n,l=[];return n.groupCountFields.forEach((e=>{const s=e.tips,o=e.color||"#000",a=e.unit||"";let d=e.defaultValue||0;if("all"==e.range)d=r[e.key];else if("page"==e.range){const{sum:r=0,count:l=0}=((e,i,n=[],r)=>{let l=0,s=0;const{fieldList:o=[]}=r.columnConfig;return e.forEach((e=>{m(e,(e=>{var a,d;if(!e.childrenList||!e.childrenList.length){let c=!0;if(n.length){const i={table:e,form:{},sys:(null==(d=null==(a=null==r?void 0:r.userInfo)?void 0:a.map)?void 0:d.sysParams)||{}};c=t.parseCondition(n,i,o)}if(c){const t=e[i]||0;l+=Number(t),++s}}}))})),{sum:l,count:s}})(i,e.field,e.conObj,n);d=l,"avg"==e.method?d=r/l||0:"sum"==e.method&&(d=r)}d=t.round(d,4),l.push(`<span style="color: ${o}">${s}:${d}${a}</span>`)})),l.join("、")},m=(e,t)=>{if(!e)return;const i=[e];for(;i.length>0;){const e=i.shift();e&&t(e),e.childrenList&&e.childrenList.reverse().forEach((e=>{i.unshift(e)}))}},v=({row:e})=>!e.forbiddenBatchSelect,y=({row:e})=>!e.$__SEPARATE,T=e=>{const t=[],i=(e,n)=>{e.length>0&&e.forEach((e=>{e.qianduan_id||(e.qianduan_id=e.theUniqueKey||window.crypto.getRandomValues(new Uint32Array(1))[0]),e.qianduan_parent_id=n||null,e.childrenList&&i(e.childrenList,e.qianduan_id),t.push(e)}))};return i(e),t},E=(e,t,i,n)=>{t.push(e),i.push(e[n]),e.childrenList&&e.childrenList.length&&e.childrenList.forEach((e=>{e.childrenList&&e.childrenList.length?E(e,t,i,n):(i.push(e[n]),t.push(e))}))},A=(e,t,i)=>{const n=[];if(!e.length)return 1;if(e.forEach((e=>n.push(e[i]))),!n.length)return 1;if(n.length!==t.length)return 1;return n.filter((e=>{t.includes(e)})).length},b=e=>{1!=e.checkedRows.length||v({row:e.checkedRows[0]})||e.checkedRows.pop()},_=(e,t)=>{if(!e.filterFields||!Object.keys(e.filterFields).length)return;const i=t.quickSearchConfig;if(!i||!i.length){return Object.keys(e.filterFields).forEach((t=>{e.filterFields[t].CONVERT=[]})),!1}for(const t in e.filterFields){const i=e.filterFields[t];i&&(i.CONVERT=[])}i.forEach((t=>{if(t.field_key in e.filterFields){if(!e.filterFields[t.field_key])return e.filterFields[t.field_key].CONVERT=[],!1;const i=t.value;e.filterFields[t.field_key].CONVERT=i}}))},O=({row:e})=>{if(e.rowColor){const i=t.hexToRGBA(e.rowColor,.2)||{};return`background-color:${`rgba(${i.r}, ${i.g}, ${i.b}, ${i.a})`}`}return null},R=(e,t)=>{var i,n;if(!t.isNestTable)return t.height;const r=(null==(i=t.styleSetting)?void 0:i.tableHeight)||"table-simple",l=(null==(n=t.data)?void 0:n.length)||1;return`${e.checkWidth[r]*l+90}px`},N=(e,t="name")=>e.alias||e[t],D=(t,i,n)=>("HEADPORTRAIT"===i&&(t||(t=e)),n(t)),w=(e,t,i)=>{if(!t||!t.length)return e;const n=t.find((e=>e.type===i));if(!n)return e;if(n.suffix)return e+n.suffix;let r=n.h;const l=n.w;"adaptive"===n.h&&"adaptive"!=n.w&&(r=n.w),"adaptive"===n.w&&"adaptive"!=n.h&&(r=n.h);return e+`_${r}x${l}`},L=(e,i,n)=>{if(!e||!e.length)return{display:"inline-block",maxWidth:"100%",maxheight:n};const r=e.find((e=>e.type===i));if(!r)return{display:"inline-block",height:n};return t.handleImageSize(r,n)},C=(e,i)=>{var n;const r=e[i.columnName];if(t.isJSON(r)){const e=r.includes("user_name"),t=JSON.parse(r);if(Array.isArray(t)){const i=t.length;if(i>1)return`已选${i}人`;if(1===i)return e&&(null==(n=t[0])?void 0:n.user_name)||`已选${i}人`}}},B=(e,t)=>{var i,n;const{settingObj:r={},fieldSetting:l={}}=t,{mergedFeildExpression:s}=l;let o=e[t.field];if(s){const t=/#{(.+?)\}/g;o=s.replace(t,((t,i)=>e[i]||""))}const a={content:o};return{btnName:null==(i=null==r?void 0:r.qrCode)?void 0:i.name,trigger_id:null==(n=null==r?void 0:r.qrCode)?void 0:n.id,params:a}},S=(e,t)=>{var i;return(null==(i=e[t])?void 0:i.length)?e[t].filter((e=>"EDIT_ROW"===e.settingObj[0].trigger_type)):[]},k=(e,t)=>t[e.columnName]&&e.fieldSetting&&1==e.fieldSetting.fontContentCopy,I=(e,t,i)=>{if(!e||0===e.length)return document.body.style.setProperty("--table-image-height",i),void document.body.style.setProperty("--table-image-width","auto");const n=e.find((e=>e.type===t));if(!n)return document.body.style.setProperty("--table-image-height",i),void document.body.style.setProperty("--table-image-width","auto");let r=i,l="auto";n.h&&(r="adaptive"===n.h?"auto":n.h+"px"),n.w&&(l="adaptive"===n.w?"auto":n.w+"px"),document.body.style.setProperty("--table-image-height",r),document.body.style.setProperty("--table-image-width",l)},Y=(e,t,i={})=>{const n=i[e];return{[t.name]:(r=n,r&&"string"==typeof r&&r.startsWith("###")&&(r=r.slice(3),r=(r=JSON.parse(r)).tooltip||r.value),r)};var r},H=(e,t)=>{Object.values(e.filterFields).forEach((e=>{e.visible=!1})),_(e,t)},j=(e,i)=>{const n=Object.values(e.filterFields),r=Object.keys(e.filterFields),l=((e,i)=>{var n;if(!Array.isArray(e))return[];const r=[];for(let l=0;l<e.length;l++){const s=e[l];let o=0,a="";if(s.EQ||s.CL)o=s.EQ||s.CL,"PERCENTAGE"===(null==(n=s.settingObj)?void 0:n.attr)&&(o=Number(o)/100),s.EVALUATEAttr&&(o=s.selecteds.join("|#|"));else if(t.isEmpty(s.QUOTE))if(t.isEmpty(s.CONVERT))if(s.DATE)(s.DATE.start_val||s.DATE.end_val)&&(s.DATE.con="IN"),s.tempCon=s.DATE.con,s.start_val=s.DATE.start_val?s.DATE.start_val.format("YYYY-MM-DD HH:mm:ss"):"",s.end_val=s.DATE.end_val?s.DATE.end_val.format("YYYY-MM-DD HH:mm:ss"):"";else if(s.BIRTHDAY){let e=!1;if((s.BIRTHDAY.limit_date.length>0||s.BIRTHDAY.start_val||s.BIRTHDAY.end_val)&&(s.BIRTHDAY.con="IN"),s.tempCon=s.BIRTHDAY.con,e=!(!s.BIRTHDAY.start_val&&!s.BIRTHDAY.end_val),s.BIRTHDAY.start_val&&!t.validateBirthday(s.BIRTHDAY.start_val,s.title,s.BIRTHDAY.unit))return;if(s.BIRTHDAY.end_val&&!t.validateBirthday(s.BIRTHDAY.end_val,s.title,s.BIRTHDAY.unit))return;if(+s.BIRTHDAY.start_val>+s.BIRTHDAY.end_val)return void window.$message.warning(`${s.title}请输入有效范围`,2);a=i.limit_date||"",s.unit=e&&s.BIRTHDAY.unit||"",s.start_val=s.BIRTHDAY.start_val||"",s.end_val=s.BIRTHDAY.end_val||""}else if(s.LABELAttr){const e=[];s.labelSelectList.forEach((t=>{e.push(t.labelName)})),o=e.join("|#|")}else s.EVALUATEAttr&&(o=s.selecteds.join("|#|"));else o=s.CONVERT.map((e=>["string","number"].includes(typeof e)?e:JSON.parse(e)));else o=s.QUOTE.join("|#|");const d={field_key:s.columnName,con:s.DATE||s.BIRTHDAY?s.tempCon:s.con,value:o,limit_date:a||"",start_val:s.start_val||"",end_val:s.end_val||"",unit:s.unit||""};r.push(d)}return r.filter((e=>e.value||e.limit_date||e.start_val||e.end_val))})(n,e),s=[...l];return(i.tableParams.qqConObj?JSON.parse(i.tableParams.qqConObj):[]).forEach((e=>{r.includes(e.field_key)||s.push(e)})),s},x=(e,t,i)=>{var n;return t.clickFieldKey==t.columnName||"field"==e.relatedItems.triggerMethodPc&&t.columnName==e.relatedItems.triggerMethodField||t.isbtnLink&&i.btnLinks&&(null==(n=i.btnLinks)?void 0:n.includes(t.columnName))},$=(e,t)=>{t.showButtonTop=e.showButtonTop,t.isTree=e.isTree,t.openOnly=e.openOnly,t.isExpand=e.spreadAllBtn,t.levelLazyLoadSetting=Object.assign({},e.levelLazyLoadSetting),t.checkWidth=Object.assign({},t.checkWidth,e.checkWidth)},F=(e,i,n)=>{e.forEach((e=>{t.has(e,"childrenList")&&F(e.childrenList,i,n),t.has(e,n)&&(e[i]=e[n])}))},V=(e,t,i)=>{if(t.isNestTable)return;if(1==e.isTree)return e.visibleCheckAllWrap=!1,!1;e.visibleCheckAllWrap=i.length>1;const n=i.length>=e.curAbleCheckedLen,r=t.pageVO.pageSize===t.pageVO.total,l=i.length>e.currentPageSelectedLength;e.visibleCheckAllWrapMore=l||n&&!r};export{v as checkMethod,E as flattenRow,g as generateEditRender,C as getCandidateComponents,s as getEvaluate,p as getFooterGroup,S as getInlineEditBtn,o as getMapVal,O as getRowStyle,a as getageShowType,u as handleGroupColums,D as handleImgArr,w as handleImgSrc,N as handleName,B as handleQrCodeContent,R as handleTableHeight,I as handleTableImageSize,f as handlerInitSearchItem,H as hideFilterWrap,A as intersectRow,k as isCopy,h as isFilterItem,x as isLink,j as mergeConObjFn,L as modalDetailImage,d as reScrollFilterWrap,b as removeCheckedDisabledRows,Y as setDefaultFormData,_ as setFilterStatus,$ as setTableConfig,F as setTreeGroupTitle,V as setVisibleCheckAllWrap,c as showFilter,T as treeToList,y as visibleMethod};
|
|
@@ -9,6 +9,7 @@ export declare class Print {
|
|
|
9
9
|
private downloadPath;
|
|
10
10
|
private printOrigin;
|
|
11
11
|
private isRemote;
|
|
12
|
+
private CMonitor;
|
|
12
13
|
constructor();
|
|
13
14
|
private readonly messageHandlerQueue;
|
|
14
15
|
private messageHandler;
|
|
@@ -22,6 +23,7 @@ export declare class Print {
|
|
|
22
23
|
_testConnection(): Promise<unknown>;
|
|
23
24
|
_queryServicesPrint(params: AnyObject): Promise<any>;
|
|
24
25
|
_callPrintWithFile(queryParams: AnyObject): Promise<any>;
|
|
26
|
+
_handleMonitorNotify(message: string): void;
|
|
25
27
|
_handleResult(data: AnyObject, errorCallbackFn?: Func): false | AnyObject;
|
|
26
28
|
_handleResultTest(result: unknown, errorCallbackFn?: Func): boolean;
|
|
27
29
|
_handleEventQueryPrintData(templateId: string, formatId: string, params: AnyObject, errorCallbackFn?: Func): Promise<false | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"axios";import{isArray as e}from"lodash-es";import{IdentityVerificationDialog as i,PreviewDialog as n}from"./dialog.js";import{getFileUrl as s,useBrowserPrint as r,isIReport as a}from"./browserPrint.js";import{getCurrentInstance as o}from"vue";import{format as l}from"date-fns";const d=t.create({timeout:1e3,withCredentials:!1}),h=`${window.location.protocol}//${window.location.host}`,c=`${h}/fdp-api/print/assembly/printIReport`,p=`${h}/bi-api/reprot/print/open/client/getRemote`,u=`${h}/printService/file`;let m=null;class w{constructor(){var t;if(this.webview=null,this.dialog=new i,this.dialogPreview=new n,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.isRemote=!1,this.messageHandlerQueue=[],m)return m;m=this;const e=window;if(this.webview=null==(t=e.chrome)?void 0:t.webview,this.webview){this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler);try{this.postMessage({exec:"config",data:""})}catch(t){console.log("非封装浏览器或者当前版本不支持获取配置接口")}}}messageHandler(t){var e;const i=this.messageHandlerQueue.shift();if(!i)return console.log("当前回执",t,"没有可用的handler");const{resolve:n,reject:s}=i;try{console.log(t);const i=JSON.parse(t.data||"{}");"config"===i.exec&&(this.downloadPath=(null==(e=i.res)?void 0:e.downloadpath)||""),n(i.res||"")}catch(t){s(t)}}async postMessage(t){return this.webview?new Promise(((e,i)=>{this.messageHandlerQueue.push({resolve:e,reject:i}),this.webview.postMessage(t)})):Promise.reject()}destroy(){this.webview&&this.currentMessageHandler&&(this.webview.removeEventListener("message",this.currentMessageHandler),this.currentMessageHandler=void 0)}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{d({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_queryServicesPrint(e){return this.webview?this.postMessage({exec:"print",data:{inputData:e}}):t({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(e)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:n(i)}):d({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[n]}).then((({data:t})=>t));function n(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleResult(t,e){if(!t)return null==e||e({type:"printError",message:"打印命令未返回信息",result:!1,errinfo:"打印命令未返回信息"}),!1;if("success"!==t.result){const i={type:"printError",message:
|
|
1
|
+
import t from"axios";import{isArray as e}from"lodash-es";import{IdentityVerificationDialog as i,PreviewDialog as n}from"./dialog.js";import{getFileUrl as s,useBrowserPrint as r,isIReport as a}from"./browserPrint.js";import{getCurrentInstance as o}from"vue";import{format as l}from"date-fns";const d=t.create({timeout:1e3,withCredentials:!1}),h=`${window.location.protocol}//${window.location.host}`,c=`${h}/fdp-api/print/assembly/printIReport`,p=`${h}/bi-api/reprot/print/open/client/getRemote`,u=`${h}/printService/file`;let m=null;class w{constructor(){var t;if(this.webview=null,this.dialog=new i,this.dialogPreview=new n,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.isRemote=!1,this.CMonitor=null,this.messageHandlerQueue=[],m)return m;m=this;const e=window;if(this.CMonitor=e.$CMonitor,this.webview=null==(t=e.chrome)?void 0:t.webview,this.webview){this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler);try{this.postMessage({exec:"config",data:""})}catch(t){this._handleMonitorNotify("当前浏览器版本不支持获取配置接口"),console.log("非封装浏览器或者当前版本不支持获取配置接口")}}}messageHandler(t){var e;const i=this.messageHandlerQueue.shift();if(!i)return console.log("当前回执",t,"没有可用的handler");const{resolve:n,reject:s}=i;try{console.log(t);const i=JSON.parse(t.data||"{}");"config"===i.exec&&(this.downloadPath=(null==(e=i.res)?void 0:e.downloadpath)||""),n(i.res||"")}catch(t){s(t)}}async postMessage(t){return this.webview?new Promise(((e,i)=>{this.messageHandlerQueue.push({resolve:e,reject:i}),this.webview.postMessage(t)})):Promise.reject()}destroy(){this.webview&&this.currentMessageHandler&&(this.webview.removeEventListener("message",this.currentMessageHandler),this.currentMessageHandler=void 0)}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{d({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_queryServicesPrint(e){return this.webview?this.postMessage({exec:"print",data:{inputData:e}}):t({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(e)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:n(i)}):d({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[n]}).then((({data:t})=>t));function n(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleMonitorNotify(t){var e,i;null==(i=null==(e=this.CMonitor)?void 0:e.notify)||i.call(e,{name:"打印sdk错误收集",message:t,businessName:"打印sdk"})}_handleResult(t,e){if(!t)return this._handleMonitorNotify("打印命令未返回信息"),null==e||e({type:"printError",message:"打印命令未返回信息",result:!1,errinfo:"打印命令未返回信息"}),!1;if("success"!==t.result){const i=t.message||t.Message;this._handleMonitorNotify(i);const n={type:"printError",message:i,result:t.result,errinfo:t.errinfo};return null==e||e(n),!1}return t}_handleResultTest(t,e){return!!t||(console.log("notInstalledApp"),null==e||e({type:"notInstalledApp",message:"请打开打印服务器插件"}),!1)}async _handleEventQueryPrintData(t,e,i,n){const s={templateId:t,formatId:e,params:i,cmdid:"7"},r=await this._queryServicesPrint(s);return this._handleQueryPrintDataResult(r,e,n)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),null==i||i({type:"queryPrintDataFailure",message:e})}catch(t){console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,params:i,cmdid:n,print:s,printdlgshow:r="1",nobillnode:a="1",btnprint:o="1"}){const d={templateId:t,formatId:e,params:i,cmdid:n,nobillnode:a,printdlgshow:r,btnprint:o};if(s){try{s=JSON.parse(s)}catch(t){}d.print=s}else if(this.isRemote){const t=l(new Date,"yyyyMMddHHmmss");d.print={print:"1",type:"1",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${t}\\${t}`}}return await this._queryServicesPrint(d)}async _handleEventEditFormat({templateId:t,formatId:e="",params:i="",token:n}){const s={};let r={};try{r=Object.assign({},s,JSON.parse(i))}catch(t){r=s}const a={templateId:t,formatId:e,cmdid:"9",token:n,params:JSON.stringify(r)};return await this._queryServicesPrint(a)}async _queryProxyOrigin(){if(this.isRemote)return;const{data:t}=await d({method:"get",url:p})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=h+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await d({method:"post",url:c,responseType:"blob",params:{formatId:t.split("_")[1],params:e}})||{};return i}async _browserPrint(t,e){if(this.isRemote){const{filedir:i}=t,n=JSON.parse(i)[0].replace(/\\/g,"/").split("/"),a=n[n.length-2],o=n[n.length-1],l=await s(`${u}/${a}/${o}`),d=r(null,e,l);if("preview"===e)return d}}async preview({templateId:t,formatId:e,params:i="",btnprint:n},s,l){if(a(e)){const t=await this._queryPrintFile(e,i);if(!t)return null==l?void 0:l("获取文件失败!");const n=r(t,"preview");return this.instance||(this.instance=o()),this.showPreview(this.instance,n),void(null==s||s({file:t}))}await this._queryProxyOrigin();const d=await this._testConnection();if(!this._handleResultTest(d,l))return!1;const h=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:this.isRemote?"7":"8",btnprint:n}),c=this._handleResult(h,l);if(!c)return!1;if(this.isRemote){const t=await this._browserPrint(c,"preview");this.instance||(this.instance=o()),this.showPreview(this.instance,t)}s&&s(c)}async printDirect({templateId:t,formatId:e,params:i="",print:n,printdlgshow:s,nobillnode:o,isDownloadFile:l=!0},d,h,c="printDirect"){if(a(e)){const t=await this._queryPrintFile(e,i);return t?(r(t,c),void(null==d||d({file:t}))):null==h?void 0:h("获取文件失败!")}await this._queryProxyOrigin();const p=await this._testConnection();if(!this._handleResultTest(p,h))return!1;const u=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:"7",print:n,printdlgshow:s,nobillnode:o}),m=this._handleResult(u,h);if(!m)return!1;l&&["downloadPDF"].includes(c)&&await this._browserPrint(m,c),null==d||d(m)}_downloadPDF(t){return this.webview?this.postMessage({exec:"pdf",data:{file:t}}):d.get(this.printOrigin+"/download",{params:{inputData:t}}).then((({data:t})=>t))}downloadPDF(t,i,n){this.webview&&this.downloadPath&&(t.print.filename=this.downloadPath.replace(/\\/g,"/")),this.printDirect(t,(async s=>{if(s||n(null),a(t.formatId))return i(s);const r=this,o=await async function(t){const i=[],n=JSON.parse(t);if(!e(n))return await r._downloadPDF("");if(1===n.length)return await r._downloadPDF(n[0]||"");for(let t=0,e=n.length;t<e;t++)i.push(await r._downloadPDF(n[t]||""));return i}(s.filedir);i(o,s)}),(t=>n(t)),"downloadPDF")}async print({templateId:t,formatId:e,params:i=""},n,s){const r=await this._testConnection();if(!this._handleResultTest(r,s))return!1;const a=await this.queryPrintData({templateId:t,formatId:e,params:i},void 0,s);if(!a)return!1;const o=this.printFileData({formatId:e,file:a.file,printerName:a.printerName},void 0,s);if(!o)return!1;n&&n(o)}async queryPrintData({templateId:t,formatId:e,params:i=""},n,s){const r=await this._testConnection();if(!this._handleResultTest(r,s))return!1;const a=await this._handleEventQueryPrintData(t,e,i,s);return!!a&&(n&&n(a),a)}async printFileData({formatId:t,file:e,printerName:i="Default"},n,s){const r=await this._testConnection();if(!this._handleResultTest(r,s))return!1;const a=await this._callPrintWithFile({formatId:t,printname:i,file:e}),o=this._handleResult(a,s);return!!o&&(n&&n(o),o)}async editPrintFormat({templateId:t,formatId:e,params:i,token:n},s,r){const a=await this._testConnection();if(!this._handleResultTest(a,r))return!1;const o=await this._handleEventEditFormat({templateId:t,formatId:e,params:i,token:n}),l=this._handleResult(o,r);if(!l)return!1;s&&s(l)}async addPrintFormat({templateId:t,params:e,token:i},n,s){const r=await this._testConnection();if(!this._handleResultTest(r,s))return!1;const a=await this._handleEventEditFormat({templateId:t,params:e,token:i}),o=this._handleResult(a,s);if(!o)return!1;n&&n(o)}}export{w as Print};
|
|
@@ -26,7 +26,7 @@ declare const DatePicker: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
26
26
|
focus: () => any;
|
|
27
27
|
blur: () => any;
|
|
28
28
|
onUpdateShow: (show: boolean) => void;
|
|
29
|
-
onConfirm: () => void;
|
|
29
|
+
onConfirm: (...args: any[]) => void;
|
|
30
30
|
NDatePicker: any;
|
|
31
31
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
32
32
|
updateUnchangedValue: {
|
|
@@ -26,7 +26,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
26
26
|
focus: () => any;
|
|
27
27
|
blur: () => any;
|
|
28
28
|
onUpdateShow: (show: boolean) => void;
|
|
29
|
-
onConfirm: () => void;
|
|
29
|
+
onConfirm: (...args: any[]) => void;
|
|
30
30
|
NDatePicker: any;
|
|
31
31
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
32
32
|
updateUnchangedValue: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as t,ref as n,computed as l,openBlock as u,createBlock as a,unref as o,mergeProps as r,createSlots as i,renderList as s,withCtx as p,renderSlot as v,nextTick as d}from"vue";import{NDatePicker as f}from"naive-ui";import"../../../shared/utils/index.js";import"lodash-es";import{useDateTime as c}from"../../../shared/hooks/useDateTime.js";import{format as m}from"date-fns";import y from"../../../_virtual/plugin-vue_export-helper.js";var h=y(e({__name:"DatePicker",props:{updateUnchangedValue:{type:Boolean},onConfirm:{type:Function}},setup(e,{expose:y}){const h=e,g=t(),_=n(null),k=n(null),M=l((()=>{const e=Reflect.get(g,"type")||"";return["datetime","datetimerange"].includes(e)})),R=l((()=>{if(Reflect.get(g,"format"))return g.format;const e=g.type||"";return M.value?"yyyy-MM-dd HH:mm:ss":"month"===e?"yyyy-MM":"year"===e?"yyyy":"yyyy-MM-dd"})),$=l((()=>M.value?R.value.split(" "):"")),{focus:w,blur:x}=c(_,R,g);function D(e){e&&M.value&&d((()=>{var e;k.value=null==(e=_.value)?void 0:e.panelInstRef,c(k,$,g)}))}function E(){var
|
|
1
|
+
import{defineComponent as e,useAttrs as t,ref as n,computed as l,openBlock as u,createBlock as a,unref as o,mergeProps as r,createSlots as i,renderList as s,withCtx as p,renderSlot as v,nextTick as d}from"vue";import{NDatePicker as f}from"naive-ui";import"../../../shared/utils/index.js";import"lodash-es";import{useDateTime as c}from"../../../shared/hooks/useDateTime.js";import{format as m}from"date-fns";import y from"../../../_virtual/plugin-vue_export-helper.js";var h=y(e({__name:"DatePicker",props:{updateUnchangedValue:{type:Boolean},onConfirm:{type:Function}},setup(e,{expose:y}){const h=e,g=t(),_=n(null),k=n(null),M=l((()=>{const e=Reflect.get(g,"type")||"";return["datetime","datetimerange"].includes(e)})),R=l((()=>{if(Reflect.get(g,"format"))return g.format;const e=g.type||"";return M.value?"yyyy-MM-dd HH:mm:ss":"month"===e?"yyyy-MM":"year"===e?"yyyy":"yyyy-MM-dd"})),$=l((()=>M.value?R.value.split(" "):"")),{focus:w,blur:x}=c(_,R,g);function D(e){e&&M.value&&d((()=>{var e;k.value=null==(e=_.value)?void 0:e.panelInstRef,c(k,$,g)}))}function E(...e){var t,n,l,u,a;null==(t=h.onConfirm)||t.call(h,...e);const o=Reflect.get(g,"type")||"",r=null==(a=null==(u=null==(l=null==(n=_.value)?void 0:n.inputInstRef)?void 0:l.$el)?void 0:u.querySelector)?void 0:a.call(u,"input");if(!(null==r?void 0:r.value)||!h.updateUnchangedValue||o.includes("range"))return;const i=r.value;r.value=m(new Date,R.value),r.dispatchEvent(new InputEvent("input")),r.value=i,r.dispatchEvent(new InputEvent("input"))}return y({$datePicker:_,focus:w,blur:x}),(e,t)=>(u(),a(o(f),r({ref_key:"datePickerRef",ref:_},e.$attrs,{"onUpdate:show":D,onConfirm:E}),i({_:2},[s(e.$slots,((t,n)=>({name:n,fn:p((()=>[v(e.$slots,n)]))})))]),1040))}}),[["__file","DatePicker.vue"]]);export{h as default};
|
|
@@ -164,6 +164,20 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
164
164
|
remark?: string | undefined;
|
|
165
165
|
free_entry?: import("..").FormCommonState | undefined;
|
|
166
166
|
initialize_high?: number | undefined;
|
|
167
|
+
bindEventSetting?: {
|
|
168
|
+
[x: string]: unknown;
|
|
169
|
+
event_type: import("../../../es/shared/types").LOW_CODE_EVENT_TYPE;
|
|
170
|
+
event_field?: string | undefined;
|
|
171
|
+
params?: {
|
|
172
|
+
p_value?: string | undefined;
|
|
173
|
+
p_name: string;
|
|
174
|
+
p_select: import("../../../es/shared/types").LOW_CODE_VALUE_RELATION;
|
|
175
|
+
}[] | undefined;
|
|
176
|
+
results?: {
|
|
177
|
+
p_value: string;
|
|
178
|
+
p_name: string;
|
|
179
|
+
}[] | undefined;
|
|
180
|
+
}[] | undefined;
|
|
167
181
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
168
182
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
169
183
|
lazyRequest?: boolean | undefined;
|
|
@@ -1861,6 +1875,20 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1861
1875
|
remark?: string | undefined;
|
|
1862
1876
|
free_entry?: import("..").FormCommonState | undefined;
|
|
1863
1877
|
initialize_high?: number | undefined;
|
|
1878
|
+
bindEventSetting?: {
|
|
1879
|
+
[x: string]: unknown;
|
|
1880
|
+
event_type: import("../../../es/shared/types").LOW_CODE_EVENT_TYPE;
|
|
1881
|
+
event_field?: string | undefined;
|
|
1882
|
+
params?: {
|
|
1883
|
+
p_value?: string | undefined;
|
|
1884
|
+
p_name: string;
|
|
1885
|
+
p_select: import("../../../es/shared/types").LOW_CODE_VALUE_RELATION;
|
|
1886
|
+
}[] | undefined;
|
|
1887
|
+
results?: {
|
|
1888
|
+
p_value: string;
|
|
1889
|
+
p_name: string;
|
|
1890
|
+
}[] | undefined;
|
|
1891
|
+
}[] | undefined;
|
|
1864
1892
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
1865
1893
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
1866
1894
|
lazyRequest?: boolean | undefined;
|
|
@@ -3829,6 +3857,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
3829
3857
|
observeFormGraph: Record<string, import("@formily/core").GeneralField>;
|
|
3830
3858
|
setGraph: (field: import("@formily/core").GeneralField) => void;
|
|
3831
3859
|
removeGraph: (field: import("@formily/core").GeneralField) => void;
|
|
3860
|
+
lowCodeEventTrigger: (field: import("@formily/core").GeneralField) => void;
|
|
3832
3861
|
formModel: import("@formily/core").Form<{
|
|
3833
3862
|
[x: string]: any;
|
|
3834
3863
|
}>;
|
|
@@ -4502,6 +4531,20 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
4502
4531
|
remark?: string | undefined;
|
|
4503
4532
|
free_entry?: import("..").FormCommonState | undefined;
|
|
4504
4533
|
initialize_high?: number | undefined;
|
|
4534
|
+
bindEventSetting?: {
|
|
4535
|
+
[x: string]: unknown;
|
|
4536
|
+
event_type: import("../../../es/shared/types").LOW_CODE_EVENT_TYPE;
|
|
4537
|
+
event_field?: string | undefined;
|
|
4538
|
+
params?: {
|
|
4539
|
+
p_value?: string | undefined;
|
|
4540
|
+
p_name: string;
|
|
4541
|
+
p_select: import("../../../es/shared/types").LOW_CODE_VALUE_RELATION;
|
|
4542
|
+
}[] | undefined;
|
|
4543
|
+
results?: {
|
|
4544
|
+
p_value: string;
|
|
4545
|
+
p_name: string;
|
|
4546
|
+
}[] | undefined;
|
|
4547
|
+
}[] | undefined;
|
|
4505
4548
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
4506
4549
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
4507
4550
|
lazyRequest?: boolean | undefined;
|
|
@@ -6211,6 +6254,20 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
6211
6254
|
remark?: string | undefined;
|
|
6212
6255
|
free_entry?: import("..").FormCommonState | undefined;
|
|
6213
6256
|
initialize_high?: number | undefined;
|
|
6257
|
+
bindEventSetting?: {
|
|
6258
|
+
[x: string]: unknown;
|
|
6259
|
+
event_type: import("../../../es/shared/types").LOW_CODE_EVENT_TYPE;
|
|
6260
|
+
event_field?: string | undefined;
|
|
6261
|
+
params?: {
|
|
6262
|
+
p_value?: string | undefined;
|
|
6263
|
+
p_name: string;
|
|
6264
|
+
p_select: import("../../../es/shared/types").LOW_CODE_VALUE_RELATION;
|
|
6265
|
+
}[] | undefined;
|
|
6266
|
+
results?: {
|
|
6267
|
+
p_value: string;
|
|
6268
|
+
p_name: string;
|
|
6269
|
+
}[] | undefined;
|
|
6270
|
+
}[] | undefined;
|
|
6214
6271
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
6215
6272
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
6216
6273
|
lazyRequest?: boolean | undefined;
|
|
@@ -7892,6 +7949,20 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
7892
7949
|
remark?: string | undefined;
|
|
7893
7950
|
free_entry?: import("..").FormCommonState | undefined;
|
|
7894
7951
|
initialize_high?: number | undefined;
|
|
7952
|
+
bindEventSetting?: {
|
|
7953
|
+
[x: string]: unknown;
|
|
7954
|
+
event_type: import("../../../es/shared/types").LOW_CODE_EVENT_TYPE;
|
|
7955
|
+
event_field?: string | undefined;
|
|
7956
|
+
params?: {
|
|
7957
|
+
p_value?: string | undefined;
|
|
7958
|
+
p_name: string;
|
|
7959
|
+
p_select: import("../../../es/shared/types").LOW_CODE_VALUE_RELATION;
|
|
7960
|
+
}[] | undefined;
|
|
7961
|
+
results?: {
|
|
7962
|
+
p_value: string;
|
|
7963
|
+
p_name: string;
|
|
7964
|
+
}[] | undefined;
|
|
7965
|
+
}[] | undefined;
|
|
7895
7966
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
7896
7967
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
7897
7968
|
lazyRequest?: boolean | undefined;
|
|
@@ -9771,6 +9842,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
9771
9842
|
observeFormGraph: Record<string, import("@formily/core").GeneralField>;
|
|
9772
9843
|
setGraph: (field: import("@formily/core").GeneralField) => void;
|
|
9773
9844
|
removeGraph: (field: import("@formily/core").GeneralField) => void;
|
|
9845
|
+
lowCodeEventTrigger: (field: import("@formily/core").GeneralField) => void;
|
|
9774
9846
|
formModel: import("@formily/core").Form<{
|
|
9775
9847
|
[x: string]: any;
|
|
9776
9848
|
}>;
|
|
@@ -166,6 +166,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
166
166
|
remark?: string | undefined;
|
|
167
167
|
free_entry?: import("../../../../es/components/form-render").FormCommonState | undefined;
|
|
168
168
|
initialize_high?: number | undefined;
|
|
169
|
+
bindEventSetting?: {
|
|
170
|
+
[x: string]: unknown;
|
|
171
|
+
event_type: import("../../../../es/shared/types").LOW_CODE_EVENT_TYPE;
|
|
172
|
+
event_field?: string | undefined;
|
|
173
|
+
params?: {
|
|
174
|
+
p_value?: string | undefined;
|
|
175
|
+
p_name: string;
|
|
176
|
+
p_select: import("../../../../es/shared/types").LOW_CODE_VALUE_RELATION;
|
|
177
|
+
}[] | undefined;
|
|
178
|
+
results?: {
|
|
179
|
+
p_value: string;
|
|
180
|
+
p_name: string;
|
|
181
|
+
}[] | undefined;
|
|
182
|
+
}[] | undefined;
|
|
169
183
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
170
184
|
content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
|
|
171
185
|
lazyRequest?: boolean | undefined;
|
|
@@ -1863,6 +1877,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1863
1877
|
remark?: string | undefined;
|
|
1864
1878
|
free_entry?: import("../../../../es/components/form-render").FormCommonState | undefined;
|
|
1865
1879
|
initialize_high?: number | undefined;
|
|
1880
|
+
bindEventSetting?: {
|
|
1881
|
+
[x: string]: unknown;
|
|
1882
|
+
event_type: import("../../../../es/shared/types").LOW_CODE_EVENT_TYPE;
|
|
1883
|
+
event_field?: string | undefined;
|
|
1884
|
+
params?: {
|
|
1885
|
+
p_value?: string | undefined;
|
|
1886
|
+
p_name: string;
|
|
1887
|
+
p_select: import("../../../../es/shared/types").LOW_CODE_VALUE_RELATION;
|
|
1888
|
+
}[] | undefined;
|
|
1889
|
+
results?: {
|
|
1890
|
+
p_value: string;
|
|
1891
|
+
p_name: string;
|
|
1892
|
+
}[] | undefined;
|
|
1893
|
+
}[] | undefined;
|
|
1866
1894
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
1867
1895
|
content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
|
|
1868
1896
|
lazyRequest?: boolean | undefined;
|
|
@@ -3831,6 +3859,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3831
3859
|
observeFormGraph: Record<string, import("../../../../es/components/form-render").GeneralField>;
|
|
3832
3860
|
setGraph: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
3833
3861
|
removeGraph: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
3862
|
+
lowCodeEventTrigger: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
3834
3863
|
formModel: import("../../../../es/components/form-render").Form<{
|
|
3835
3864
|
[x: string]: any;
|
|
3836
3865
|
}>;
|
|
@@ -4504,6 +4533,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
4504
4533
|
remark?: string | undefined;
|
|
4505
4534
|
free_entry?: import("../../../../es/components/form-render").FormCommonState | undefined;
|
|
4506
4535
|
initialize_high?: number | undefined;
|
|
4536
|
+
bindEventSetting?: {
|
|
4537
|
+
[x: string]: unknown;
|
|
4538
|
+
event_type: import("../../../../es/shared/types").LOW_CODE_EVENT_TYPE;
|
|
4539
|
+
event_field?: string | undefined;
|
|
4540
|
+
params?: {
|
|
4541
|
+
p_value?: string | undefined;
|
|
4542
|
+
p_name: string;
|
|
4543
|
+
p_select: import("../../../../es/shared/types").LOW_CODE_VALUE_RELATION;
|
|
4544
|
+
}[] | undefined;
|
|
4545
|
+
results?: {
|
|
4546
|
+
p_value: string;
|
|
4547
|
+
p_name: string;
|
|
4548
|
+
}[] | undefined;
|
|
4549
|
+
}[] | undefined;
|
|
4507
4550
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
4508
4551
|
content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
|
|
4509
4552
|
lazyRequest?: boolean | undefined;
|
|
@@ -6213,6 +6256,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6213
6256
|
remark?: string | undefined;
|
|
6214
6257
|
free_entry?: import("../../../../es/components/form-render").FormCommonState | undefined;
|
|
6215
6258
|
initialize_high?: number | undefined;
|
|
6259
|
+
bindEventSetting?: {
|
|
6260
|
+
[x: string]: unknown;
|
|
6261
|
+
event_type: import("../../../../es/shared/types").LOW_CODE_EVENT_TYPE;
|
|
6262
|
+
event_field?: string | undefined;
|
|
6263
|
+
params?: {
|
|
6264
|
+
p_value?: string | undefined;
|
|
6265
|
+
p_name: string;
|
|
6266
|
+
p_select: import("../../../../es/shared/types").LOW_CODE_VALUE_RELATION;
|
|
6267
|
+
}[] | undefined;
|
|
6268
|
+
results?: {
|
|
6269
|
+
p_value: string;
|
|
6270
|
+
p_name: string;
|
|
6271
|
+
}[] | undefined;
|
|
6272
|
+
}[] | undefined;
|
|
6216
6273
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
6217
6274
|
content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
|
|
6218
6275
|
lazyRequest?: boolean | undefined;
|
|
@@ -7894,6 +7951,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7894
7951
|
remark?: string | undefined;
|
|
7895
7952
|
free_entry?: import("../../../../es/components/form-render").FormCommonState | undefined;
|
|
7896
7953
|
initialize_high?: number | undefined;
|
|
7954
|
+
bindEventSetting?: {
|
|
7955
|
+
[x: string]: unknown;
|
|
7956
|
+
event_type: import("../../../../es/shared/types").LOW_CODE_EVENT_TYPE;
|
|
7957
|
+
event_field?: string | undefined;
|
|
7958
|
+
params?: {
|
|
7959
|
+
p_value?: string | undefined;
|
|
7960
|
+
p_name: string;
|
|
7961
|
+
p_select: import("../../../../es/shared/types").LOW_CODE_VALUE_RELATION;
|
|
7962
|
+
}[] | undefined;
|
|
7963
|
+
results?: {
|
|
7964
|
+
p_value: string;
|
|
7965
|
+
p_name: string;
|
|
7966
|
+
}[] | undefined;
|
|
7967
|
+
}[] | undefined;
|
|
7897
7968
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
7898
7969
|
content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
|
|
7899
7970
|
lazyRequest?: boolean | undefined;
|
|
@@ -9773,6 +9844,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
9773
9844
|
observeFormGraph: Record<string, import("../../../../es/components/form-render").GeneralField>;
|
|
9774
9845
|
setGraph: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
9775
9846
|
removeGraph: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
9847
|
+
lowCodeEventTrigger: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
9776
9848
|
formModel: import("../../../../es/components/form-render").Form<{
|
|
9777
9849
|
[x: string]: any;
|
|
9778
9850
|
}>;
|
|
@@ -314,6 +314,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
314
314
|
observeFormGraph: Record<string, import("../../../../../es/components/form-render").GeneralField>;
|
|
315
315
|
setGraph: (field: import("../../../../../es/components/form-render").GeneralField) => void;
|
|
316
316
|
removeGraph: (field: import("../../../../../es/components/form-render").GeneralField) => void;
|
|
317
|
+
lowCodeEventTrigger: (field: import("../../../../../es/components/form-render").GeneralField) => void;
|
|
317
318
|
formModel: import("../../../../../es/components/form-render").Form<{
|
|
318
319
|
[x: string]: any;
|
|
319
320
|
}>;
|
|
@@ -129,6 +129,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
129
129
|
remark?: string | undefined;
|
|
130
130
|
free_entry?: import("../../../../../es/components/form-render").FormCommonState | undefined;
|
|
131
131
|
initialize_high?: number | undefined;
|
|
132
|
+
bindEventSetting?: {
|
|
133
|
+
[x: string]: unknown;
|
|
134
|
+
event_type: import("../../../../../es/shared/types").LOW_CODE_EVENT_TYPE;
|
|
135
|
+
event_field?: string | undefined;
|
|
136
|
+
params?: {
|
|
137
|
+
p_value?: string | undefined;
|
|
138
|
+
p_name: string;
|
|
139
|
+
p_select: import("../../../../../es/shared/types").LOW_CODE_VALUE_RELATION;
|
|
140
|
+
}[] | undefined;
|
|
141
|
+
results?: {
|
|
142
|
+
p_value: string;
|
|
143
|
+
p_name: string;
|
|
144
|
+
}[] | undefined;
|
|
145
|
+
}[] | undefined;
|
|
132
146
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
133
147
|
content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
|
|
134
148
|
lazyRequest?: boolean | undefined;
|
|
@@ -1838,6 +1852,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1838
1852
|
remark?: string | undefined;
|
|
1839
1853
|
free_entry?: import("../../../../../es/components/form-render").FormCommonState | undefined;
|
|
1840
1854
|
initialize_high?: number | undefined;
|
|
1855
|
+
bindEventSetting?: {
|
|
1856
|
+
[x: string]: unknown;
|
|
1857
|
+
event_type: import("../../../../../es/shared/types").LOW_CODE_EVENT_TYPE;
|
|
1858
|
+
event_field?: string | undefined;
|
|
1859
|
+
params?: {
|
|
1860
|
+
p_value?: string | undefined;
|
|
1861
|
+
p_name: string;
|
|
1862
|
+
p_select: import("../../../../../es/shared/types").LOW_CODE_VALUE_RELATION;
|
|
1863
|
+
}[] | undefined;
|
|
1864
|
+
results?: {
|
|
1865
|
+
p_value: string;
|
|
1866
|
+
p_name: string;
|
|
1867
|
+
}[] | undefined;
|
|
1868
|
+
}[] | undefined;
|
|
1841
1869
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
1842
1870
|
content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
|
|
1843
1871
|
lazyRequest?: boolean | undefined;
|
|
@@ -3519,6 +3547,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3519
3547
|
remark?: string | undefined;
|
|
3520
3548
|
free_entry?: import("../../../../../es/components/form-render").FormCommonState | undefined;
|
|
3521
3549
|
initialize_high?: number | undefined;
|
|
3550
|
+
bindEventSetting?: {
|
|
3551
|
+
[x: string]: unknown;
|
|
3552
|
+
event_type: import("../../../../../es/shared/types").LOW_CODE_EVENT_TYPE;
|
|
3553
|
+
event_field?: string | undefined;
|
|
3554
|
+
params?: {
|
|
3555
|
+
p_value?: string | undefined;
|
|
3556
|
+
p_name: string;
|
|
3557
|
+
p_select: import("../../../../../es/shared/types").LOW_CODE_VALUE_RELATION;
|
|
3558
|
+
}[] | undefined;
|
|
3559
|
+
results?: {
|
|
3560
|
+
p_value: string;
|
|
3561
|
+
p_name: string;
|
|
3562
|
+
}[] | undefined;
|
|
3563
|
+
}[] | undefined;
|
|
3522
3564
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
3523
3565
|
content?: string | import("../../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../../es/components/form-render").FormRenderer> | undefined;
|
|
3524
3566
|
lazyRequest?: boolean | undefined;
|
|
@@ -5398,6 +5440,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5398
5440
|
observeFormGraph: Record<string, import("../../../../../es/components/form-render").GeneralField>;
|
|
5399
5441
|
setGraph: (field: import("../../../../../es/components/form-render").GeneralField) => void;
|
|
5400
5442
|
removeGraph: (field: import("../../../../../es/components/form-render").GeneralField) => void;
|
|
5443
|
+
lowCodeEventTrigger: (field: import("../../../../../es/components/form-render").GeneralField) => void;
|
|
5401
5444
|
formModel: import("../../../../../es/components/form-render").Form<{
|
|
5402
5445
|
[x: string]: any;
|
|
5403
5446
|
}>;
|
|
@@ -301,6 +301,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
|
301
301
|
observeFormGraph: Record<string, import("@formily/core/esm/types").GeneralField>;
|
|
302
302
|
setGraph: (field: import("@formily/core/esm/types").GeneralField) => void;
|
|
303
303
|
removeGraph: (field: import("@formily/core/esm/types").GeneralField) => void;
|
|
304
|
+
lowCodeEventTrigger: (field: import("@formily/core/esm/types").GeneralField) => void;
|
|
304
305
|
formModel: import("@formily/core/esm/models/Form").Form<{
|
|
305
306
|
[x: string]: any;
|
|
306
307
|
}>;
|
|
@@ -295,6 +295,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
295
295
|
observeFormGraph: Record<string, import("@formily/core").GeneralField>;
|
|
296
296
|
setGraph: (field: import("@formily/core").GeneralField) => void;
|
|
297
297
|
removeGraph: (field: import("@formily/core").GeneralField) => void;
|
|
298
|
+
lowCodeEventTrigger: (field: import("@formily/core").GeneralField) => void;
|
|
298
299
|
formModel: import("@formily/core").Form<{
|
|
299
300
|
[x: string]: any;
|
|
300
301
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as p,normalizeStyle as d,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as j,createCommentVNode as g,createElementVNode as
|
|
1
|
+
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as p,normalizeStyle as d,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as j,createCommentVNode as g,createElementVNode as v,withKeys as b,withModifiers as k,toDisplayString as F,renderSlot as C}from"vue";import{useTheme as x}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as H,cloneDeep as S}from"lodash-es";import{createForm as A,onFieldValueChange as L,onFieldMount as R,onFieldUnmount as _,onFieldReact as O,onFormMount as w}from"@formily/core";import{FormProvider as B,FormConsumer as V}from"@formily/vue";import{NForm as I,NTabs as N,NTabPane as D,NConfigProvider as q}from"naive-ui";import{InjectionFormGraph as T}from"./constants/index.js";import{useAutoHidden as U}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as W}from"./hooks/useComplexOptions.js";import{useFormDomEvent as E,useFormExposeEvent as G}from"./hooks/useFormEvent.js";import{useFormGraph as K}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as M}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeEvent as P}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as J}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as $}from"./hooks/useNuiThemeOverrides.js";import"./utils/index.js";import{useFieldListAdaptor as z}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/index.js";import"../index.js";import{useFieldVisitor as Q}from"./hooks/useFieldVisitor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{validateMessageLocale as X}from"./hooks/useFormValidator.js";import{useAnchor as Y}from"./hooks/useAnchor.js";import{useFormContext as Z}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";import ee from"../../../_virtual/plugin-vue_export-helper.js";import{createObjSchema as oe}from"./utils/schema.js";const te={key:0,style:{height:"54px"}},re={style:{"white-space":"pre"}};var se=ee(e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},linebarAutoHidden:{type:Boolean},bordered:{type:Boolean,default:!0}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:ee,emit:se}){const ae=e,ie=x(),{nuiThemeOverrides:le}=$();X();const ne=o(),me=t((()=>H(ae.maxHeight)?ae.maxHeight+"px":ae.maxHeight)),{SchemaField:pe,businessCollector:de,formItemDepsCollector:ue,changeContextCollector:ce,formUUID:fe}=Z(ae,se),{anchorBarRef:he,currentAnchor:ye,generateAnchorList:je,updateAnchorList:ge,anchorIdList:ve,onScroll:be}=Y(ae,se,ne,ue);M(ae).callLifeCycle("onSetup");const{trigger:ke}=U(),{observeFormGraph:Fe,setGraph:Ce,removeGraph:xe}=K();r(T,Fe);const{lowCodeEventTrigger:He}=P(),Se=A({initialValues:ae.initialData,effects(e){L("*",(o=>{const t=o.props.name.toString();de.trigger(e,t),ue.trigger(t),se("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:ce.getContext(t,o.value)}),He(o),Ae(t,o.value)})),R("*",Ce),_("*",xe),ae.linebarAutoHidden&&(O("*",ke),w((e=>e.query("*").forEach(ke)))),ae.anchor&&(O("*",ge),w(je))}}),{lowCodeReactionsHandler:Ae,triggerAllReactionsHandler:Le}=J(t((()=>ae.lowCodeReactions)),Se);s(Le);const{schemaAdaptor:Re}=z(de);let _e=ae.fieldList||[];const Oe=t((()=>ae.schema?ae.schema:ae.fieldList?(_e=Q().traverse(S(ae.fieldList),ae.fieldVisitor),oe(Re(_e))):oe({}))),{onKeydown:we}=E({formModel:Se,formRenderRef:ne,props:ae}),{clearSpan:Be}=W();a((()=>Be(fe)));const Ve=G({formModel:Se,formRenderRef:ne,formItemDepsCollector:ue,getFieldList:()=>_e,formUUID:fe});return ee({formModel:Se,validate:(e="*")=>Ve.validate(e),getFormValues:(e=!0)=>Ve.getFormValues(e),async setFormValues(e,o=!0,t=!1,r=!0){t&&(de.triggerLock=!0),Ve.setFormValues(e,o,r),await i(),de.triggerLock=!1},setFieldState(e,o){Ve.setFieldState(e,o)},resetFields(e="*"){Ve.resetFields(e)},queryWidget:async e=>Ve.queryWidget(e),getFieldList:()=>_e,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(l(),n(m(I),{class:p(["form-render",{"form-render--no-border":!e.bordered}]),"require-mark-placement":"left",style:d(m(ie))},{default:u((()=>[e.anchor?(l(),c("section",te,[f(m(N),{value:m(ye),"onUpdate:value":t[0]||(t[0]=e=>h(ye)?ye.value=e:null),type:"line",ref_key:"anchorBarRef",ref:he},{default:u((()=>[(l(!0),c(y,null,j(m(ve),(e=>(l(),n(m(D),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):g("v-if",!0),f(m(q),{"theme-overrides":m(le)},{default:u((()=>[v("section",{class:"form-render__wrapper",style:d({"--column":e.column,"--form-height":m(me)}),ref_key:"formRenderRef",ref:ne,onScroll:t[1]||(t[1]=(...e)=>m(be)&&m(be)(...e)),onKeydownCapture:t[2]||(t[2]=b(k(((...e)=>m(we)&&m(we)(...e)),["prevent"]),["enter"]))},[f(m(B),{form:m(Se)},{default:u((()=>[f(m(pe),{schema:m(Oe)},null,8,["schema"]),e.consumer?(l(),n(m(V),{key:0},{default:u((({form:e})=>[v("div",re,F(JSON.stringify(e.values,null,2)),1)])),_:1})):g("v-if",!0),C(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},8,["class","style"]))}}),[["__file","FormRender.vue"]]);export{se as default};
|
|
@@ -299,6 +299,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
299
299
|
observeFormGraph: Record<string, import("../../../../es/components/form-render").GeneralField>;
|
|
300
300
|
setGraph: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
301
301
|
removeGraph: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
302
|
+
lowCodeEventTrigger: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
302
303
|
formModel: import("../../../../es/components/form-render").Form<{
|
|
303
304
|
[x: string]: any;
|
|
304
305
|
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../../../shared/utils/index.js";import{isField as e}from"@formily/core";import{isArray as t,isObject as r}from"lodash-es";import{getBindEventSettingTrigger as n}from"../../../../shared/utils/business.js";function o(o){if(!e(o))return;const{decoratorProps:{fieldItem:i}={}}=o;i&&t(i.bindEventSetting)&&i.bindEventSetting.length&&i.bindEventSetting.forEach((e=>{r(e)&&n(e.event_type)(e,{getter:e=>o.form.getValuesIn(e),setter(e,t){o.form.setValuesIn(e,t)}})}))}function i(){return{lowCodeEventTrigger:o}}export{i as useLowCodeEvent};
|