cnhis-design-vue 3.1.43-release.0 → 3.1.43-release.1
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/plugins/varialbleHeightPlugin/index.js +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
|
@@ -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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyObject, ArrayAble } from '../../../../../es/shared/types';
|
|
1
|
+
import { AnyObject, ArrayAble, BindEventSettingItem } from '../../../../../es/shared/types';
|
|
2
2
|
import { SchemaEffectTypes, SchemaTypes } from '@formily/vue';
|
|
3
3
|
import { CSSProperties, VNode } from 'vue';
|
|
4
4
|
import { DependKeyType, FormCommonState, FormRequestType } from '../../../../../es/components/form-render';
|
|
@@ -89,58 +89,19 @@ export declare type FormWordbook = Partial<{
|
|
|
89
89
|
conObjFirstLevel: AnyObject[];
|
|
90
90
|
}>;
|
|
91
91
|
export declare type FieldItem = {
|
|
92
|
-
/**
|
|
93
|
-
* 字段的key
|
|
94
|
-
*/
|
|
95
92
|
val_key: string;
|
|
96
|
-
/**
|
|
97
|
-
* 控件类型
|
|
98
|
-
*/
|
|
99
93
|
html_type: HtmlType;
|
|
100
94
|
} & Partial<{
|
|
101
|
-
/**
|
|
102
|
-
* 是否开启批注(需要先在表单维度开启)
|
|
103
|
-
*/
|
|
104
95
|
annotation: boolean;
|
|
105
|
-
/**
|
|
106
|
-
* 定制化字段, AGE类型控件时的单位字段
|
|
107
|
-
*/
|
|
108
96
|
val_key_unit: string;
|
|
109
|
-
/**
|
|
110
|
-
* 是否允许编辑('1'为允许编辑)
|
|
111
|
-
*/
|
|
112
97
|
is_edit: FormCommonState;
|
|
113
|
-
/**
|
|
114
|
-
* 控件在栅栏系统中的的宽度值, 默认为3
|
|
115
|
-
*/
|
|
116
98
|
elem_width: number;
|
|
117
|
-
/**
|
|
118
|
-
* 是否展示('1'为展示)
|
|
119
|
-
*/
|
|
120
99
|
is_show: FormCommonState;
|
|
121
|
-
/**
|
|
122
|
-
* 是否允许为空('1'为允许为空)
|
|
123
|
-
*/
|
|
124
100
|
is_null: FormCommonState;
|
|
125
|
-
/**
|
|
126
|
-
* 字段label
|
|
127
|
-
*/
|
|
128
101
|
name: string;
|
|
129
|
-
/**
|
|
130
|
-
* 字段label(优先级比name高)
|
|
131
|
-
*/
|
|
132
102
|
alias: string;
|
|
133
|
-
/**
|
|
134
|
-
* 默认值
|
|
135
|
-
*/
|
|
136
103
|
default_val: any;
|
|
137
|
-
/**
|
|
138
|
-
* 是否开启清空功能('0'表示开启)
|
|
139
|
-
*/
|
|
140
104
|
is_empty: FormCommonState;
|
|
141
|
-
/**
|
|
142
|
-
* 是否隐藏label('1'表示隐藏)
|
|
143
|
-
*/
|
|
144
105
|
hide_title: FormCommonState;
|
|
145
106
|
placeholder: string;
|
|
146
107
|
validate: ValidateItem;
|
|
@@ -150,123 +111,40 @@ export declare type FieldItem = {
|
|
|
150
111
|
* 仅在html_type为SELECT时生效
|
|
151
112
|
*/
|
|
152
113
|
multi_select: FormCommonState;
|
|
153
|
-
/**
|
|
154
|
-
* 多选时最大选择数量
|
|
155
|
-
*/
|
|
156
114
|
multi_select_value: number | string;
|
|
157
115
|
/**
|
|
158
116
|
* 1.用于CASCADER控件提供层级参数
|
|
159
117
|
* 2.用于SEARCH控件提供字段信息
|
|
160
118
|
*/
|
|
161
119
|
wordbook: FormWordbook;
|
|
162
|
-
/**
|
|
163
|
-
* switch控件,开启状态参数
|
|
164
|
-
*/
|
|
165
120
|
open: SwitchProperty;
|
|
166
|
-
/**
|
|
167
|
-
* switch控件,关闭状态参数
|
|
168
|
-
*/
|
|
169
121
|
close: SwitchProperty;
|
|
170
|
-
/**
|
|
171
|
-
* date控件value格式
|
|
172
|
-
*/
|
|
173
122
|
date_format: string;
|
|
174
|
-
/**
|
|
175
|
-
* slider控件间距
|
|
176
|
-
*/
|
|
177
123
|
step_length: string | number;
|
|
178
124
|
urlConfig: UrlConfig;
|
|
179
|
-
/**
|
|
180
|
-
* 控件组
|
|
181
|
-
*/
|
|
182
125
|
suffixConfig: ArrayAble<FieldItem>;
|
|
183
|
-
/**
|
|
184
|
-
* 数据源签名
|
|
185
|
-
*/
|
|
186
126
|
autograph: string;
|
|
187
|
-
/**
|
|
188
|
-
* 合并错误信息
|
|
189
|
-
*/
|
|
190
127
|
defined_error_msg: string;
|
|
191
|
-
/**
|
|
192
|
-
* 是否使用json格式对该字段值进行合并
|
|
193
|
-
*/
|
|
194
128
|
extendKey: string;
|
|
195
|
-
/**
|
|
196
|
-
* 是否允许linebar控件收起('1'表示不可收起)
|
|
197
|
-
*/
|
|
198
129
|
is_not_fold: string;
|
|
199
|
-
/**
|
|
200
|
-
* 控件中的备注
|
|
201
|
-
*/
|
|
202
130
|
remark: string;
|
|
203
|
-
/**
|
|
204
|
-
* 是否允许用户在下拉控件中创建自定义选项
|
|
205
|
-
*/
|
|
206
131
|
free_entry: FormCommonState;
|
|
207
|
-
/**
|
|
208
|
-
* 文本域控件默认行数
|
|
209
|
-
*/
|
|
210
132
|
initialize_high: number;
|
|
211
|
-
|
|
212
|
-
* 数据类型
|
|
213
|
-
*/
|
|
133
|
+
bindEventSetting: BindEventSettingItem[];
|
|
214
134
|
fieldType: SchemaTypes;
|
|
215
|
-
/**
|
|
216
|
-
* BUTTON/TEXT控件内容
|
|
217
|
-
*/
|
|
218
135
|
content: string | FormRenderer | Record<string, FormRenderer>;
|
|
219
|
-
/**
|
|
220
|
-
* 用于控制是否启用请求的懒执行
|
|
221
|
-
*/
|
|
222
136
|
lazyRequest: boolean;
|
|
223
|
-
/**
|
|
224
|
-
* 用于控制请求是否开启缓存
|
|
225
|
-
*/
|
|
226
137
|
requestCache: boolean;
|
|
227
|
-
/**
|
|
228
|
-
* COMBINATION控件最大表单组数量
|
|
229
|
-
*/
|
|
230
138
|
maxGroupNum: number;
|
|
231
|
-
/**
|
|
232
|
-
* COMBINATION json format
|
|
233
|
-
*/
|
|
234
139
|
jsonCombination: boolean;
|
|
235
|
-
/**
|
|
236
|
-
* COMBINATION控件子项
|
|
237
|
-
*/
|
|
238
140
|
children: FieldItem[];
|
|
239
|
-
/**
|
|
240
|
-
* 子项
|
|
241
|
-
*/
|
|
242
141
|
properties: FieldItem[];
|
|
243
|
-
/**
|
|
244
|
-
* 控件额外的props
|
|
245
|
-
*/
|
|
246
142
|
componentProps: AnyObject;
|
|
247
|
-
/**
|
|
248
|
-
* FormItem额外的props
|
|
249
|
-
*/
|
|
250
143
|
decoratorProps: AnyObject;
|
|
251
|
-
/**
|
|
252
|
-
* 是否不使用decorator组件(n-form-item)
|
|
253
|
-
*/
|
|
254
144
|
noDecorator: Boolean;
|
|
255
|
-
/**
|
|
256
|
-
* COMPLEX控件布局类型
|
|
257
|
-
*/
|
|
258
145
|
display: 'grid' | 'flex';
|
|
259
|
-
/**
|
|
260
|
-
* 控件插槽
|
|
261
|
-
*/
|
|
262
146
|
slots: Record<string, (...args: unknown[]) => unknown>;
|
|
263
|
-
/**
|
|
264
|
-
* COMPLEX控件额外样式
|
|
265
|
-
*/
|
|
266
147
|
wrapperStyle: CSSProperties | Record<string, string>;
|
|
267
|
-
/**
|
|
268
|
-
* 多级表单的显示策略, checked表示展示选中的子表单, all表示任何时候都展示所有子表单
|
|
269
|
-
*/
|
|
270
148
|
childFieldStrategy?: 'checked' | 'all';
|
|
271
149
|
/**
|
|
272
150
|
* 自定义校验规则
|
|
@@ -275,9 +153,6 @@ export declare type FieldItem = {
|
|
|
275
153
|
* @return {void|string} 返回校验信息
|
|
276
154
|
*/
|
|
277
155
|
validator: (value: unknown, fieldItem: FieldItem) => void | string;
|
|
278
|
-
/**
|
|
279
|
-
* 表单联动配置
|
|
280
|
-
*/
|
|
281
156
|
reactions: ArrayAble<ReactionType>;
|
|
282
157
|
[key: string]: any;
|
|
283
158
|
}>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AsyncQueue } from '../../../../../es/shared/hooks';
|
|
2
|
-
import { AnyObject, UndefinedAble } from '../../../../../es/shared/types';
|
|
3
|
-
import { LOW_CODE_VALUE_RELATION } from '../../../../../es/shared/utils';
|
|
2
|
+
import { AnyObject, LOW_CODE_VALUE_RELATION, UndefinedAble } from '../../../../../es/shared/types';
|
|
4
3
|
import { DataField, Field, Form } from '@formily/core';
|
|
5
4
|
import { ISchema } from '@formily/json-schema/esm/types';
|
|
6
5
|
import { Component, FunctionalComponent } from 'vue';
|
|
@@ -2166,8 +2166,8 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
2166
2166
|
usePreset?: boolean | undefined;
|
|
2167
2167
|
} | undefined;
|
|
2168
2168
|
}>;
|
|
2169
|
+
updateConfigRefDebounced: () => void;
|
|
2169
2170
|
updateConfigRef: () => void;
|
|
2170
|
-
_updateConfigRef: () => void;
|
|
2171
2171
|
fieldListRef: import("vue").Ref<{
|
|
2172
2172
|
property?: string | undefined;
|
|
2173
2173
|
type?: import("vxe-table").VxeColumnPropTypes.Type | undefined;
|
|
@@ -2467,12 +2467,12 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
2467
2467
|
getKey?: (() => string) | undefined;
|
|
2468
2468
|
annotation?: boolean | undefined;
|
|
2469
2469
|
}[]>;
|
|
2470
|
+
updateFieldListRefDebounced: () => void;
|
|
2470
2471
|
updateFieldListRef: () => void;
|
|
2471
|
-
_updateFieldListRef: () => void;
|
|
2472
2472
|
dataTransfer: (data: import("../../../es/shared/types").AnyObject[]) => Promise<import("../../../es/shared/types").AnyObject[]>;
|
|
2473
2473
|
tableDataRef: import("vue").Ref<import("../../../es/shared/types").AnyObject[]>;
|
|
2474
|
+
updateTableDataRefDebounced: () => Promise<void>;
|
|
2474
2475
|
updateTableDataRef: () => Promise<void>;
|
|
2475
|
-
_updateTableDataRef: () => Promise<void>;
|
|
2476
2476
|
tableHandler: import("../../../es/components/iho-table/src/types").IhoTableHandler;
|
|
2477
2477
|
eventHookHandler: {
|
|
2478
2478
|
onCopy: import("vxe-table").VxeTableEvents.Copy | undefined;
|
|
@@ -4580,6 +4580,10 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
4580
4580
|
usePreset?: boolean | undefined;
|
|
4581
4581
|
} | undefined;
|
|
4582
4582
|
}>;
|
|
4583
|
+
configChanged: boolean;
|
|
4584
|
+
fieldChanged: boolean;
|
|
4585
|
+
dataChanged: boolean;
|
|
4586
|
+
updateState: () => void;
|
|
4583
4587
|
header: any;
|
|
4584
4588
|
footer: any;
|
|
4585
4589
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "formClick" | "keyboard" | "rowDrag" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd")[], "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "formClick" | "keyboard" | "rowDrag" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -2165,8 +2165,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2165
2165
|
usePreset?: boolean | undefined;
|
|
2166
2166
|
} | undefined;
|
|
2167
2167
|
}>;
|
|
2168
|
+
updateConfigRefDebounced: () => void;
|
|
2168
2169
|
updateConfigRef: () => void;
|
|
2169
|
-
_updateConfigRef: () => void;
|
|
2170
2170
|
fieldListRef: import("vue").Ref<{
|
|
2171
2171
|
property?: string | undefined;
|
|
2172
2172
|
type?: import("vxe-table").VxeColumnPropTypes.Type | undefined;
|
|
@@ -2466,12 +2466,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2466
2466
|
getKey?: (() => string) | undefined;
|
|
2467
2467
|
annotation?: boolean | undefined;
|
|
2468
2468
|
}[]>;
|
|
2469
|
+
updateFieldListRefDebounced: () => void;
|
|
2469
2470
|
updateFieldListRef: () => void;
|
|
2470
|
-
_updateFieldListRef: () => void;
|
|
2471
2471
|
dataTransfer: (data: AnyObject[]) => Promise<AnyObject[]>;
|
|
2472
2472
|
tableDataRef: import("vue").Ref<AnyObject[]>;
|
|
2473
|
+
updateTableDataRefDebounced: () => Promise<void>;
|
|
2473
2474
|
updateTableDataRef: () => Promise<void>;
|
|
2474
|
-
_updateTableDataRef: () => Promise<void>;
|
|
2475
2475
|
tableHandler: IhoTableHandler;
|
|
2476
2476
|
eventHookHandler: {
|
|
2477
2477
|
onCopy: import("vxe-table").VxeTableEvents.Copy | undefined;
|
|
@@ -4579,6 +4579,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
4579
4579
|
usePreset?: boolean | undefined;
|
|
4580
4580
|
} | undefined;
|
|
4581
4581
|
}>;
|
|
4582
|
+
configChanged: boolean;
|
|
4583
|
+
fieldChanged: boolean;
|
|
4584
|
+
dataChanged: boolean;
|
|
4585
|
+
updateState: () => void;
|
|
4582
4586
|
header: any;
|
|
4583
4587
|
footer: any;
|
|
4584
4588
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "formClick" | "keyboard" | "rowDrag" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd")[], "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "formClick" | "keyboard" | "rowDrag" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,provide as a,ref as o,watch as l,resolveComponent as s,openBlock as n,createElementBlock as i,unref as r,normalizeStyle as u,createBlock as c,resolveDynamicComponent as f,createElementVNode as d,createVNode as m,mergeProps as p,createSlots as v,renderList as b,withCtx as h,createCommentVNode as g,renderSlot as x}from"vue";import{useTheme as k}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as y}from"@vueuse/core";import"date-fns";import{isString as C,isFunction as D}from"lodash-es";import{widthAppend as j,uuidGenerator as $}from"../../../shared/utils/index.js";import{promiseTimeout as _}from"@vueuse/shared";import{VxeTableEventNameList as H,InjectionIhoTableEmits as T,InjectionIhoTableAnnotation as w,InjectionIhoTableUUID as A,InjectionIhoTableInstance as L,InjectionIhoTableConfig as R,InjectionIhoTableFieldList as E,InjectionIhoTableHandler as F}from"./constants/index.js";import{createTableHooks as I,applyTableConfigHooks as O,applyTableFieldHooks as S,createTableEventHandlers as W,createDomInsertComponent as q,createDataTransfer as z}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as B}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as G}from"./utils/index.js";import J from"../../../_virtual/plugin-vue_export-helper.js";const K=["id"];var M=J(e({__name:"IhoTable",props:{tableConfig:{type:Object,default:()=>({})},fieldList:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},annotation:{type:Object}},emits:["formChange","settingClick","formClick","keyboard","rowDrag",...H],setup(e,{expose:H,emit:J}){var M,N;const P=e,Q=k({"--c-border-color":"#e2e2e2","--c-head-bg-color":"#f2f2f2","--c-hover-color":"#f7f7f7"}),U=t((()=>{var e,t;const a=null!=(t=null==(e=P.tableConfig)?void 0:e.height)?t:"100%";return{height:"auto"===a?"100%":C(a)&&(a.includes("calc")||a.endsWith("%"))?a:j(a)}})),V=B(),X=function(e,...t){J(e,...t);const a=r(te)[G(e)];D(a)&&a(...t),V.trigger(e,...t)};a(T,X);const Y=I();a(w,t((()=>P.annotation)));const Z=$();a(A,Z);const ee=o();a(L,ee);const te=o({uuid:null!=(N=null==(M=P.tableConfig)?void 0:M.uuid)?N:Z});a(R,te);const ae=y(oe,10);function oe(){te.value=O(Y,P.tableConfig,{$table:ee,emits:X}),te.value.uuid=Z}const le=o([]);a(E,le);const se=y(ne,10);function ne(){le.value=S(Y,P.fieldList,te.value,{$table:ee,emits:X})}const ie=z(Y,te,ee),re=o([])
|
|
1
|
+
import{defineComponent as e,computed as t,provide as a,ref as o,watch as l,resolveComponent as s,openBlock as n,createElementBlock as i,unref as r,normalizeStyle as u,createBlock as c,resolveDynamicComponent as f,createElementVNode as d,createVNode as m,mergeProps as p,createSlots as v,renderList as b,withCtx as h,createCommentVNode as g,renderSlot as x}from"vue";import{useTheme as k}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as y}from"@vueuse/core";import"date-fns";import{isString as C,isFunction as D}from"lodash-es";import{widthAppend as j,uuidGenerator as $}from"../../../shared/utils/index.js";import{promiseTimeout as _}from"@vueuse/shared";import{VxeTableEventNameList as H,InjectionIhoTableEmits as T,InjectionIhoTableAnnotation as w,InjectionIhoTableUUID as A,InjectionIhoTableInstance as L,InjectionIhoTableConfig as R,InjectionIhoTableFieldList as E,InjectionIhoTableHandler as F}from"./constants/index.js";import{createTableHooks as I,applyTableConfigHooks as O,applyTableFieldHooks as S,createTableEventHandlers as W,createDomInsertComponent as q,createDataTransfer as z}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as B}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as G}from"./utils/index.js";import J from"../../../_virtual/plugin-vue_export-helper.js";const K=["id"];var M=J(e({__name:"IhoTable",props:{tableConfig:{type:Object,default:()=>({})},fieldList:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},annotation:{type:Object}},emits:["formChange","settingClick","formClick","keyboard","rowDrag",...H],setup(e,{expose:H,emit:J}){var M,N;const P=e,Q=k({"--c-border-color":"#e2e2e2","--c-head-bg-color":"#f2f2f2","--c-hover-color":"#f7f7f7"}),U=t((()=>{var e,t;const a=null!=(t=null==(e=P.tableConfig)?void 0:e.height)?t:"100%";return{height:"auto"===a?"100%":C(a)&&(a.includes("calc")||a.endsWith("%"))?a:j(a)}})),V=B(),X=function(e,...t){J(e,...t);const a=r(te)[G(e)];D(a)&&a(...t),V.trigger(e,...t)};a(T,X);const Y=I();a(w,t((()=>P.annotation)));const Z=$();a(A,Z);const ee=o();a(L,ee);const te=o({uuid:null!=(N=null==(M=P.tableConfig)?void 0:M.uuid)?N:Z});a(R,te);const ae=y(oe,10);function oe(){te.value=O(Y,P.tableConfig,{$table:ee,emits:X}),te.value.uuid=Z}const le=o([]);a(E,le);const se=y(ne,10);function ne(){le.value=S(Y,P.fieldList,te.value,{$table:ee,emits:X})}const ie=z(Y,te,ee),re=o([]);async function ue(){var e;re.value=await ie(P.tableData),null==(e=ee.value)||e.recalculate(!0)}const ce={updateTableDataRef:y(ue,10),updateConfigRef:ae,updateFieldListRef:se};a(F,ce);const fe=W({hooks:Y,config:te,$table:ee,context:ce,emits:X}),de=t((()=>({...te.value,...fe})));let me=!1,pe=!1,ve=!1;const be=y((()=>{me&&oe(),pe&&ne(),ve&&ue(),me=!1,pe=!1,ve=!1}),10);l((()=>P.tableConfig),(()=>{me=!0,pe=!0,ve=!0,be()}),{deep:!0}),l((()=>P.fieldList),(()=>{pe=!0,ve=!0,be()}),{deep:!0}),l([()=>[...P.tableData],()=>{var e;return null==(e=P.tableData)?void 0:e.length}],(()=>{ve=!0,be()})),l([()=>P.tableData,()=>{var e;return null==(e=P.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=te.value.treeConfig)?void 0:e.expandAll)&&(await _(11),null==(t=ee.value)||t.setAllTreeExpand(!0))})),oe(),ne(),ue();const{header:he,footer:ge}=q(Y);return H({$table:ee,async loadData(e){var t;null==(t=ee.value)||t.loadData(await ie(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),...Y.exposeHooks.expose.call({},te,{$table:ee,emits:X})}),Y.setupHooks.setup.call(te,le,{$table:ee,emits:X}),(e,t)=>{const a=s("vxe-grid");return n(),i("section",{class:"iho-table",id:r(Z),style:u(r(Q))},[(n(),c(f(r(he)))),d("section",{style:u(r(U))},[m(a,p({ref_key:"$table",ref:ee},r(de),{columns:le.value,data:re.value}),v({_:2},[b(e.$slots,((t,a)=>({name:a,fn:h((()=>[g(" 实际上所有的vxe-grid插槽都支持 "),x(e.$slots,a)]))})))]),1040,["columns","data"])],4),(n(),c(f(r(ge))))],12,K)}}}),[["__file","IhoTable.vue"]]);export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../../../../shared/utils/index.js";import"../../../index.js";import{isFunction as n}from"lodash-es";import{
|
|
1
|
+
import"../../../../../shared/utils/index.js";import"../../../index.js";import{isFunction as n}from"lodash-es";import{defineTablePlugin as o}from"../../hooks/useTablePlugin.js";import{getBindEventSettingTrigger as e}from"../../../../../shared/utils/business.js";function t(){const t="fieldConnectionPlugin";return o({name:t,apply(o){o.configHooks.config.tap(t,(o=>{const t=o.onFormChange;return o.onFormChange=function(o){var i;const{column:r,row:s}=o,l=null==(i=r.editRender)?void 0:i.props;if(l&&(null==l?void 0:l.bindEventSetting)){l.bindEventSetting.forEach((n=>{e(n.event_type)(n,{getter:n=>s[n],setter:(n,o)=>s[n]=o})}))}n(t)&&t(o)},o}))}})}export{t as fieldConnectionPlugin};
|
|
@@ -52,7 +52,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
52
52
|
focus: () => any;
|
|
53
53
|
blur: () => any;
|
|
54
54
|
onUpdateShow: (show: boolean) => void;
|
|
55
|
-
onConfirm: () => void;
|
|
55
|
+
onConfirm: (...args: any[]) => void;
|
|
56
56
|
NDatePicker: any;
|
|
57
57
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
58
58
|
updateUnchangedValue: {
|
|
@@ -93,7 +93,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
93
93
|
focus: () => any;
|
|
94
94
|
blur: () => any;
|
|
95
95
|
onUpdateShow: (show: boolean) => void;
|
|
96
|
-
onConfirm: () => void;
|
|
96
|
+
onConfirm: (...args: any[]) => void;
|
|
97
97
|
NDatePicker: any;
|
|
98
98
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
99
99
|
updateUnchangedValue: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as t,ref as o,computed as l,provide as n,watch as r,onMounted as a,createVNode as s,h as i,unref as u,onBeforeUnmount as d,shallowReactive as c}from"vue";import{widthAppend as p,traverse as f}from"../../../../../shared/utils/index.js";import{doAnimation as m}from"../../../../../shared/utils/anime.js";import{useThrottleFn as h}from"@vueuse/core";import{promiseTimeout as g}from"@vueuse/shared";import{isFunction as v,isNumber as x,last as I,omit as b}from"lodash-es";import"../../../index.js";import{InjectionIhoTableUUID as w,WIDGET_TYPE as y}from"../../constants/index.js";import{useUUIDMap as T}from"../../utils/index.js";import{defineTablePlugin as
|
|
1
|
+
import{defineComponent as e,inject as t,ref as o,computed as l,provide as n,watch as r,onMounted as a,createVNode as s,h as i,unref as u,onBeforeUnmount as d,shallowReactive as c}from"vue";import{widthAppend as p,traverse as f}from"../../../../../shared/utils/index.js";import{doAnimation as m}from"../../../../../shared/utils/anime.js";import{useThrottleFn as h}from"@vueuse/core";import{promiseTimeout as g}from"@vueuse/shared";import{isFunction as v,isNumber as x,last as I,omit as b}from"lodash-es";import"../../../index.js";import{InjectionIhoTableUUID as w,WIDGET_TYPE as y}from"../../constants/index.js";import{useUUIDMap as T}from"../../utils/index.js";import{defineTablePlugin as H}from"../../hooks/useTablePlugin.js";class R{constructor(){this.records={},this.maxRecords=c(new Map)}set(e,t,o){if(this.records[e]||(this.records[e]={}),this.records[e][t]===o)return;this.records[e][t]=o;const l=Math.max(...Object.values(this.records[e]),0);this.maxRecords.get(e)!==l&&this.maxRecords.set(e,l)}getMax(e){return this.maxRecords.get(e)||0}}const{getItemFromUUID:D,removeItemFromUUID:M}=T((()=>new R),!0),{getItemFromUUID:S,removeItemFromUUID:U,setItemFromUUID:C}=T((()=>null)),{getItemFromUUID:$,removeItemFromUUID:E,setItemFromUUID:k}=T((()=>{})),F=e({props:{payload:{type:Object,required:!0}},setup(e){const u=t(w),d=t("$xetable"),c=o(),f=D(u),m=l((()=>e.payload.row[e.payload.column.field]));function h(){const{row:t,column:o}=e.payload,l=d.getRowSeq(t);if(!f||null==l||!c.value)return;const n=c.value.clientHeight;f.set(l,o.field,n)}n("updateCellHeight",h),r([()=>e.payload.rowIndex,()=>e.payload.column.field,m,()=>e.payload.column.renderWidth],(async()=>{await g(0),h()})),a((()=>{d&&!S(u)&&C(u,d),h()}));const I=l((()=>{var t,o,l,n;const r=null!=(o=null==(t=e.payload.column.editRender)?void 0:t.props)?o:{},a=null!=(n=null==(l=r.slots)?void 0:l.default)?n:r.slotFn;return v(a)?a:()=>m.value})),b=l((()=>{if(e.payload.column.treeNode)return"";const t=e.payload.column.renderWidth;return x(t)&&t>0?p(t-20-2):""}));return()=>s("div",{ref:c,style:{padding:"7px 0",width:b.value,overflow:"hidden"}},[i(I.value,e.payload)])}});function j(e,t,{scrollTop:o=0}){var l,n;const{uuid:r,rowConfig:a={}}=t;if(!r)return;const s=D(r),{oSize:i=0,gt:d=100}=null!=(l=$(r))?l:{},{internalData:c,reactData:p}=e,{scrollYStore:f,elemStore:m,afterFullData:h,fullDataRowIdData:g}=c;if(d>h.length)return;const x=null!=(n=a.height)?n:36,b=m["main-body-wrapper"],w=b?u(b):null;let y=w?Math.max(8,Math.ceil(w.clientHeight/x)+2+i):8;const T=[0];let H=0;if(o&&h.find(((t,l)=>{const n=e.getRowSeq(t),r=(I(T)||0)+Math.max(x,s.getMax(n));if(T.push(r),r>o)return H=Math.max(0,l-i),y+=Math.min(H,i),!0})),H>0&&v(t.spanMethod)){const{spanMethod:o}=t,l={rowspan:1,colspan:1};for(;H>0;){if(!e.getColumns().some(((e,t)=>{const{rowspan:n,colspan:r}=o({column:e,columnIndex:t,$columnIndex:t,row:h[H],rowIndex:H,$rowIndex:H,_rowIndex:H,isHidden:!e.visible,fixed:e.fixed,type:e.type,visibleData:h})||l;if(0===n&&0===r)return H--,!0})))break}}const R=`${T[H]}px`,M=`${h.reduce(((t,o)=>{const l=e.getRowSeq(o);return t+Math.max(x,s.getMax(l))}),0)}px`;["main","left","right"].forEach((e=>{const t=m[`${e}-body-table`],l=t?u(t):null;l&&(l.style.marginTop=R,l.scrollTop=o),["header","body","footer"].forEach((t=>{const o=m[`${e}-${t}-ySpace`],l=o?u(o):null;l&&(l.style.height=M)}))}));const S=Math.min(h.length,H+y);if(f.startIndex===H&&f.endIndex===S)return;f.startIndex=H,f.endIndex=S;const U=h.slice(f.startIndex,f.endIndex);U.forEach(((t,o)=>{const l=e.getRowid(t),n=g[l];n&&(n.$index=o)})),p.tableData.length=0,p.tableData.push(...U)}const L=h(j,300);function Y(){const e="variableHeightRendererPlugin";return H({name:e,vxe(e){e.renderer.add(y.VARIABLE_HEIGHT,{renderCell:(e,t)=>s(F,{payload:t},null)})},apply(t){function o(e){const t=S(e.uuid);if(!t)return;e.scrollY={enabled:!1},t.reactData.scrollYLoad=!1;const o=function(e){const t=e.internalData.elemStore["main-body-wrapper"];return t?u(t):null}(t);o&&j(t,e,{scrollTop:o.scrollTop})}function l(e){if(!e.uuid)return;const t=$(e.uuid);t&&(e.scrollY=t),setTimeout((()=>o(e)),300)}t.dataHooks.dataStart.tap(e,l),t.eventHooks.onFilterChange.tap(e,((e,t)=>l(t))),t.eventHooks.onSortChange.tap(e,((e,t)=>l(t))),t.eventHooks.onToggleTreeExpand.tap(e,((e,t)=>l(t))),t.eventHooks.onResizableChange.tap(e,(async({column:e},t)=>{if(!e.editRender||!e.editRender.props)return;e.editRender.props.variableHeight&&l(t)})),t.eventHooks.onScroll.tap(e,h(((e,t)=>{if(e.isX)return;const{uuid:o}=t;if(!o)return;const l=S(o);l&&j(l,t,e)}),100,!0,!0)),t.fieldHooks.field.tap(e,(e=>{if(Reflect.get(e,"variableHeight")){const t=e.slots;e.slots=b(t,["default"]),e.editRender={...e.editRender,name:y.VARIABLE_HEIGHT};const o=e.className,l="variable-height";e.className=o?function(e){return v(o)?[o(e),l]:[o,l]}:l}return e})),t.fieldHooks.fieldList.tap(e,((e,t,{$table:l})=>(t.uuid&&f(e,((n,r)=>{var a,s,i;if((null==(a=n.editRender)?void 0:a.name)===y.VARIABLE_HEIGHT){const n=null!=(i=null==(s=t.rowConfig)?void 0:s.height)?i:36,a=D(t.uuid),d=t.cellStyle;if(t.cellStyle=function(e){const t={};if(l.value){const o=Math.max(n,a.getMax(l.value.getRowSeq(e.row)));t.height=`${o}px`}return Object.assign(t,d?v(d)?d(e):d:null)},t.sortableConfig&&t.sortableConfig.enable){const e=t.sortableConfig.onEnd;t.sortableConfig.onEnd=function(o){const l=S(t.uuid);if(l){const{internalData:{elemStore:e}}=l,o=e["main-table-body"];o&&u(o)&&j(l,t,{scrollTop:u(o).scrollTop})}v(e)&&e(o)}}t.showOverflow="tooltip",f(e,(e=>{e.showOverflow="tooltip"})),t.scrollY={...t.scrollY,mode:"default"},t.onWheel=function(e){let t=null,o=0,l=!0;return function(n){if(!e.uuid)return;const r=S(e.uuid);if(!r)return;const{internalData:a}=r,{isHover:s}=e.rowConfig||{},{deltaX:i,deltaY:d}=n,{refTableLeftBody:c,refTableRightBody:p,refTableBody:f}=r.getRefMaps(),h=d,g=i,v=h<0,x=u(f),I=x?x.$el:null;if(!I)return;if(v?I.scrollTop<=0:I.scrollTop>=I.scrollHeight-I.clientHeight)return;const b=I.scrollTop+h,w=I.scrollLeft+g;if(b===a.lastScrollTop)return;n.preventDefault(),a.lastScrollTop=b,a.lastScrollLeft=w,a.lastScrollTime=Date.now(),s&&r.clearHoverRow();const y=c.value,T=p.value,H=y?y.$el:null,R=T?T.$el:null,D=Math.min(100,Math.abs(Math.floor(h/2)));l&&(o=I.scrollTop,l=!1),o+=D*(v?-1:1),t&&t(),t=m(I.scrollTop,o,400,(e=>{I.scrollTop=e,H&&(H.scrollTop=e),R&&(R.scrollTop=e)}),"easeOutCubic",(()=>{o=I.scrollTop,l=!0})),L(r,e,I)}}(t),setTimeout((()=>{k(t.uuid,t.scrollY),o(t)}),300),r()}})),e))),t.setupHooks.setup.tap(e,(e=>{d((()=>{e.value.uuid&&(M(e.value.uuid),U(e.value.uuid),E(e.value.uuid))}))}))}})}export{Y as variableHeightRendererPlugin};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyObject, ArrayAble,
|
|
1
|
+
import { AnyObject, ArrayAble, BindEventSettingItem, LOW_CODE_VALUE_RELATION, MaybeString, TupleToUnion } from '../../../../../es/shared/types';
|
|
2
2
|
import { VxeTableProps, VxeTableDefines, VxeTableInstance, VxeColumnPropTypes, VxeTablePropTypes } from 'vxe-table';
|
|
3
3
|
import { VxeTableListeners } from 'vxe-table/types/table';
|
|
4
4
|
import { IHO_TABLE_STRING_STATUS, IhoTableEventNameTuple, IhoTableRowGroupSequence } from '../../../../../es/components/iho-table/src/constants';
|
|
@@ -118,7 +118,7 @@ export declare type LowCodeTableFieldItem = {
|
|
|
118
118
|
colorAndIcon: IhoTableLowCodeField.ColorAndIconItem[];
|
|
119
119
|
variableHeight: boolean;
|
|
120
120
|
filterSetting: IhoTableLowCodeField.FilterSetting;
|
|
121
|
-
bindEventSetting:
|
|
121
|
+
bindEventSetting: BindEventSettingItem[];
|
|
122
122
|
}> & Partial<VxeTableDefines.ColumnInfo>;
|
|
123
123
|
export declare type IhoTableFormChangePayload = {
|
|
124
124
|
column: IhoTableFieldItem;
|
|
@@ -34,29 +34,26 @@ export declare type TableHooks = Readonly<{
|
|
|
34
34
|
exposeHooks: AbstractExposeHooks;
|
|
35
35
|
}>;
|
|
36
36
|
export declare type WithTableConfig<T = []> = T extends any[] ? [...T, IhoTableConfig] : [T, IhoTableConfig];
|
|
37
|
-
declare type ConfigHookType<T
|
|
38
|
-
...WithTableConfig<Required<IhoTableConfig>[T]>,
|
|
39
|
-
IhoTableHandlerContext
|
|
40
|
-
]>;
|
|
37
|
+
declare type ConfigHookType<T> = SyncWaterfallHook<[...WithTableConfig<[T]>, IhoTableHandlerContext]>;
|
|
41
38
|
export declare abstract class AbstractConfigHooks {
|
|
42
39
|
abstract readonly config: SyncWaterfallHook<[IhoTableConfig, IhoTableHandlerContext]>;
|
|
43
|
-
abstract readonly rowConfig: ConfigHookType<'rowConfig'>;
|
|
44
|
-
abstract readonly editConfig: ConfigHookType<'editConfig'>;
|
|
45
|
-
abstract readonly columnConfig: ConfigHookType<'columnConfig'>;
|
|
46
|
-
abstract readonly resizableConfig: ConfigHookType<'resizableConfig'>;
|
|
47
|
-
abstract readonly seqConfig: ConfigHookType<'seqConfig'>;
|
|
48
|
-
abstract readonly sortConfig: ConfigHookType<'sortConfig'>;
|
|
49
|
-
abstract readonly filterConfig: ConfigHookType<'filterConfig'>;
|
|
50
|
-
abstract readonly radioConfig: ConfigHookType<'radioConfig'>;
|
|
51
|
-
abstract readonly checkboxConfig: ConfigHookType<'checkboxConfig'>;
|
|
52
|
-
abstract readonly expandConfig: ConfigHookType<'expandConfig'>;
|
|
53
|
-
abstract readonly treeConfig: ConfigHookType<'treeConfig'>;
|
|
54
|
-
abstract readonly mouseConfig: ConfigHookType<'mouseConfig'>;
|
|
55
|
-
abstract readonly menuConfig: ConfigHookType<'menuConfig'>;
|
|
56
|
-
abstract readonly keyboardConfig: ConfigHookType<'keyboardConfig'>;
|
|
57
|
-
abstract readonly scrollY: ConfigHookType<'scrollY'>;
|
|
58
|
-
abstract readonly scrollX: ConfigHookType<'scrollX'>;
|
|
59
|
-
abstract readonly editRules: ConfigHookType<'editRules'>;
|
|
40
|
+
abstract readonly rowConfig: ConfigHookType<IhoTableConfig['rowConfig']>;
|
|
41
|
+
abstract readonly editConfig: ConfigHookType<IhoTableConfig['editConfig']>;
|
|
42
|
+
abstract readonly columnConfig: ConfigHookType<IhoTableConfig['columnConfig']>;
|
|
43
|
+
abstract readonly resizableConfig: ConfigHookType<IhoTableConfig['resizableConfig']>;
|
|
44
|
+
abstract readonly seqConfig: ConfigHookType<IhoTableConfig['seqConfig']>;
|
|
45
|
+
abstract readonly sortConfig: ConfigHookType<IhoTableConfig['sortConfig']>;
|
|
46
|
+
abstract readonly filterConfig: ConfigHookType<IhoTableConfig['filterConfig']>;
|
|
47
|
+
abstract readonly radioConfig: ConfigHookType<IhoTableConfig['radioConfig']>;
|
|
48
|
+
abstract readonly checkboxConfig: ConfigHookType<IhoTableConfig['checkboxConfig']>;
|
|
49
|
+
abstract readonly expandConfig: ConfigHookType<IhoTableConfig['expandConfig']>;
|
|
50
|
+
abstract readonly treeConfig: ConfigHookType<IhoTableConfig['treeConfig']>;
|
|
51
|
+
abstract readonly mouseConfig: ConfigHookType<IhoTableConfig['mouseConfig']>;
|
|
52
|
+
abstract readonly menuConfig: ConfigHookType<IhoTableConfig['menuConfig']>;
|
|
53
|
+
abstract readonly keyboardConfig: ConfigHookType<IhoTableConfig['keyboardConfig']>;
|
|
54
|
+
abstract readonly scrollY: ConfigHookType<IhoTableConfig['scrollY']>;
|
|
55
|
+
abstract readonly scrollX: ConfigHookType<IhoTableConfig['scrollX']>;
|
|
56
|
+
abstract readonly editRules: ConfigHookType<IhoTableConfig['editRules']>;
|
|
60
57
|
}
|
|
61
58
|
export interface FieldHookContext {
|
|
62
59
|
index: number;
|
|
@@ -2753,6 +2753,7 @@ declare const InfoHeader: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
2753
2753
|
observeFormGraph: Record<string, import("@formily/core").GeneralField>;
|
|
2754
2754
|
setGraph: (field: import("@formily/core").GeneralField) => void;
|
|
2755
2755
|
removeGraph: (field: import("@formily/core").GeneralField) => void;
|
|
2756
|
+
lowCodeEventTrigger: (field: import("@formily/core").GeneralField) => void;
|
|
2756
2757
|
formModel: import("@formily/core").Form<{
|
|
2757
2758
|
[x: string]: any;
|
|
2758
2759
|
}>;
|
|
@@ -3602,6 +3603,7 @@ declare const InfoHeader: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
3602
3603
|
observeFormGraph: Record<string, import("@formily/core").GeneralField>;
|
|
3603
3604
|
setGraph: (field: import("@formily/core").GeneralField) => void;
|
|
3604
3605
|
removeGraph: (field: import("@formily/core").GeneralField) => void;
|
|
3606
|
+
lowCodeEventTrigger: (field: import("@formily/core").GeneralField) => void;
|
|
3605
3607
|
formModel: import("@formily/core").Form<{
|
|
3606
3608
|
[x: string]: any;
|
|
3607
3609
|
}>;
|
|
@@ -2747,6 +2747,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2747
2747
|
observeFormGraph: Record<string, import("../../../../es/components/form-render").GeneralField>;
|
|
2748
2748
|
setGraph: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
2749
2749
|
removeGraph: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
2750
|
+
lowCodeEventTrigger: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
2750
2751
|
formModel: import("../../../../es/components/form-render").Form<{
|
|
2751
2752
|
[x: string]: any;
|
|
2752
2753
|
}>;
|
|
@@ -3596,6 +3597,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3596
3597
|
observeFormGraph: Record<string, import("../../../../es/components/form-render").GeneralField>;
|
|
3597
3598
|
setGraph: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
3598
3599
|
removeGraph: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
3600
|
+
lowCodeEventTrigger: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
3599
3601
|
formModel: import("../../../../es/components/form-render").Form<{
|
|
3600
3602
|
[x: string]: any;
|
|
3601
3603
|
}>;
|
|
@@ -2335,6 +2335,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2335
2335
|
observeFormGraph: Record<string, import("../../../../../../es/components/form-render").GeneralField>;
|
|
2336
2336
|
setGraph: (field: import("../../../../../../es/components/form-render").GeneralField) => void;
|
|
2337
2337
|
removeGraph: (field: import("../../../../../../es/components/form-render").GeneralField) => void;
|
|
2338
|
+
lowCodeEventTrigger: (field: import("../../../../../../es/components/form-render").GeneralField) => void;
|
|
2338
2339
|
formModel: import("../../../../../../es/components/form-render").Form<{
|
|
2339
2340
|
[x: string]: any;
|
|
2340
2341
|
}>;
|
|
@@ -347,6 +347,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
347
347
|
observeFormGraph: Record<string, import("../../../../../../es/components/form-render").GeneralField>;
|
|
348
348
|
setGraph: (field: import("../../../../../../es/components/form-render").GeneralField) => void;
|
|
349
349
|
removeGraph: (field: import("../../../../../../es/components/form-render").GeneralField) => void;
|
|
350
|
+
lowCodeEventTrigger: (field: import("../../../../../../es/components/form-render").GeneralField) => void;
|
|
350
351
|
formModel: import("../../../../../../es/components/form-render").Form<{
|
|
351
352
|
[x: string]: any;
|
|
352
353
|
}>;
|
|
@@ -142,6 +142,20 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
142
142
|
remark?: string | undefined;
|
|
143
143
|
free_entry?: import("..").FormCommonState | undefined;
|
|
144
144
|
initialize_high?: number | undefined;
|
|
145
|
+
bindEventSetting?: {
|
|
146
|
+
[x: string]: unknown;
|
|
147
|
+
event_type: import("../../../es/shared/types").LOW_CODE_EVENT_TYPE;
|
|
148
|
+
event_field?: string | undefined;
|
|
149
|
+
params?: {
|
|
150
|
+
p_value?: string | undefined;
|
|
151
|
+
p_name: string;
|
|
152
|
+
p_select: import("../../../es/shared/types").LOW_CODE_VALUE_RELATION;
|
|
153
|
+
}[] | undefined;
|
|
154
|
+
results?: {
|
|
155
|
+
p_value: string;
|
|
156
|
+
p_name: string;
|
|
157
|
+
}[] | undefined;
|
|
158
|
+
}[] | undefined;
|
|
145
159
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
146
160
|
content?: string | import("..").FormRenderer | Record<string, import("..").FormRenderer> | undefined;
|
|
147
161
|
lazyRequest?: boolean | undefined;
|
|
@@ -2020,6 +2034,7 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
2020
2034
|
observeFormGraph: Record<string, import("@formily/core").GeneralField>;
|
|
2021
2035
|
setGraph: (field: import("@formily/core").GeneralField) => void;
|
|
2022
2036
|
removeGraph: (field: import("@formily/core").GeneralField) => void;
|
|
2037
|
+
lowCodeEventTrigger: (field: import("@formily/core").GeneralField) => void;
|
|
2023
2038
|
formModel: import("@formily/core").Form<{
|
|
2024
2039
|
[x: string]: any;
|
|
2025
2040
|
}>;
|
|
@@ -144,6 +144,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
144
144
|
remark?: string | undefined;
|
|
145
145
|
free_entry?: import("../../../../es/components/form-render").FormCommonState | undefined;
|
|
146
146
|
initialize_high?: number | undefined;
|
|
147
|
+
bindEventSetting?: {
|
|
148
|
+
[x: string]: unknown;
|
|
149
|
+
event_type: import("../../../../es/shared/types").LOW_CODE_EVENT_TYPE;
|
|
150
|
+
event_field?: string | undefined;
|
|
151
|
+
params?: {
|
|
152
|
+
p_value?: string | undefined;
|
|
153
|
+
p_name: string;
|
|
154
|
+
p_select: import("../../../../es/shared/types").LOW_CODE_VALUE_RELATION;
|
|
155
|
+
}[] | undefined;
|
|
156
|
+
results?: {
|
|
157
|
+
p_value: string;
|
|
158
|
+
p_name: string;
|
|
159
|
+
}[] | undefined;
|
|
160
|
+
}[] | undefined;
|
|
147
161
|
fieldType?: import("@formily/json-schema").SchemaTypes | undefined;
|
|
148
162
|
content?: string | import("../../../../es/components/form-render").FormRenderer | Record<string, import("../../../../es/components/form-render").FormRenderer> | undefined;
|
|
149
163
|
lazyRequest?: boolean | undefined;
|
|
@@ -2022,6 +2036,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2022
2036
|
observeFormGraph: Record<string, import("../../../../es/components/form-render").GeneralField>;
|
|
2023
2037
|
setGraph: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
2024
2038
|
removeGraph: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
2039
|
+
lowCodeEventTrigger: (field: import("../../../../es/components/form-render").GeneralField) => void;
|
|
2025
2040
|
formModel: import("../../../../es/components/form-render").Form<{
|
|
2026
2041
|
[x: string]: any;
|
|
2027
2042
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="@cnhis-design-vue/shared",s="3.1.43-release.
|
|
1
|
+
var e="@cnhis-design-vue/shared",s="3.1.43-release.1",i="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.1.43-release.1",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,i as main,e as name,n as peerDependencies,s as version};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare type LOW_CODE_VALUE_RELATION = 'EQ' | 'NEQ' | 'CL' | 'NC' | 'NULL' | 'NOT_NULL' | 'BIG' | 'BIGEQ' | 'LESS' | 'LESSEQ';
|
|
2
|
-
export declare type
|
|
3
|
-
|
|
2
|
+
export declare type LOW_CODE_EVENT_TYPE = 'SET_VALUE' | 'REPEAT_VALIDATE' | 'IS_SHOW_FIELD' | 'SQLSAVE' | 'API';
|
|
3
|
+
export declare type BindEventSettingItem = {
|
|
4
|
+
event_type: LOW_CODE_EVENT_TYPE;
|
|
4
5
|
event_field?: string;
|
|
5
6
|
params?: {
|
|
6
7
|
p_value?: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BindEventSettingItem, LOW_CODE_EVENT_TYPE, LOW_CODE_VALUE_RELATION } from '../../../es/shared/types';
|
|
2
2
|
export declare function isMatchLowCodeCondition(value: unknown, condition: {
|
|
3
3
|
con: LOW_CODE_VALUE_RELATION;
|
|
4
4
|
value: unknown;
|
|
5
5
|
}): boolean;
|
|
6
|
-
declare function handleFieldTriggerSetValue(bindEventSetting:
|
|
6
|
+
declare function handleFieldTriggerSetValue(bindEventSetting: BindEventSettingItem, { getter, setter }: {
|
|
7
7
|
setter: (key: string, value: unknown) => void;
|
|
8
8
|
getter: (key: string) => unknown;
|
|
9
9
|
}): void;
|
|
10
|
-
export declare function getBindEventSettingTrigger(key:
|
|
10
|
+
export declare function getBindEventSettingTrigger(key: LOW_CODE_EVENT_TYPE): typeof handleFieldTriggerSetValue;
|
|
11
11
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
|
-
"version": "3.1.43-release.
|
|
3
|
+
"version": "3.1.43-release.1",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"iOS 7",
|
|
62
62
|
"last 3 iOS versions"
|
|
63
63
|
],
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "6205770bb69361fc31a738432f3a637a71050ef1"
|
|
65
65
|
}
|