cnhis-design-vue 3.1.49-beta.7 → 3.1.49-beta.9
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/README.md +87 -87
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/expand-field/index.d.ts +1630 -0
- package/es/components/expand-field/index.js +1 -0
- package/es/components/expand-field/src/components/FormBatchOptionsModal.vue.d.ts +54 -0
- package/es/components/expand-field/src/components/FormBatchOptionsModal.vue.js +1 -0
- package/es/components/expand-field/src/components/FormBatchOptionsModal.vue2.js +1 -0
- package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +841 -0
- package/es/components/expand-field/src/components/FormItemPerson.vue.js +1 -0
- package/es/components/expand-field/src/components/FormItemPerson.vue2.js +1 -0
- package/es/components/expand-field/src/components/PersonModal.vue.d.ts +777 -0
- package/es/components/expand-field/src/components/PersonModal.vue.js +1 -0
- package/es/components/expand-field/src/components/PersonModal.vue2.js +1 -0
- package/es/components/expand-field/src/components/form.vue.d.ts +1502 -0
- package/es/components/expand-field/src/components/form.vue.js +1 -0
- package/es/components/expand-field/src/components/form.vue2.js +1 -0
- package/es/components/expand-field/src/constants/index.d.ts +3 -0
- package/es/components/expand-field/src/constants/index.js +1 -0
- package/es/components/expand-field/src/hooks/useAsyncData.d.ts +6 -0
- package/es/components/expand-field/src/hooks/useAsyncData.js +1 -0
- package/es/components/expand-field/src/index.vue.d.ts +1632 -0
- package/es/components/expand-field/src/index.vue.js +1 -0
- package/es/components/expand-field/src/index.vue2.js +1 -0
- package/es/components/expand-field/src/types/index.d.ts +1 -0
- package/es/components/expand-field/src/types/index.js +1 -0
- package/es/components/expand-field/src/utils/constant.d.ts +17 -0
- package/es/components/expand-field/src/utils/constant.js +1 -0
- package/es/components/expand-field/src/utils/index.d.ts +6 -0
- package/es/components/expand-field/src/utils/index.js +1 -0
- package/es/components/expand-field/src/utils/tool.d.ts +2 -0
- package/es/components/expand-field/src/utils/tool.js +1 -0
- package/es/components/expand-field/style/expand-field-iconfont.ttf +0 -0
- package/es/components/expand-field/style/index.css +1 -0
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/interface.d.ts +1 -1
- package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/components/renderer/complex.js +1 -1
- package/es/components/form-render/src/components/renderer/date.js +1 -1
- package/es/components/form-render/src/components/renderer/inputNumber.js +1 -1
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/components/renderer/remoteSearch.js +1 -1
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/components/renderer/switch.js +1 -1
- package/es/components/form-render/src/components/renderer/textarea.js +1 -1
- package/es/components/form-render/src/hooks/useAnchor.js +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
- package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
- package/es/components/form-render/src/hooks/useFormItemDeps.js +1 -1
- package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
- package/es/components/form-render/src/hooks/usePresetScope.js +1 -1
- package/es/components/form-render/src/utils/index.d.ts +1 -0
- package/es/components/form-render/src/utils/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +6 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +1 -0
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +0 -6
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/es/components/select-person/style/index.css +1 -1
- package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +3 -0
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/components/InputNumberSlash/InputNumberSlash.d.ts +40 -0
- package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -0
- package/es/shared/components/InputNumberSlash/index.d.ts +2 -0
- package/es/shared/components/InputNumberSlash/index.js +1 -0
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/hooks/useDateTime.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/fabricjs/index.d.ts +6823 -0
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./index.vue2.js";import r from"../../../_virtual/_plugin-vue_export-helper.js";var i=r(e,[["__file","index.vue"]]);export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as t,provide as e,ref as l,openBlock as a,createElementBlock as i,createElementVNode as n,createCommentVNode as o,createVNode as s,unref as d,withCtx as r,Fragment as c,renderList as u,createTextVNode as m,toDisplayString as p,createBlock as f,withModifiers as v}from"vue";import{useMessage as h,NGrid as _,NGridItem as g,NTooltip as y,NIcon as k,NPopconfirm as C,NButton as x}from"naive-ui";import{Brush as D}from"@vicons/ionicons5";import w from"./components/form.vue.js";import I from"./hooks/useAsyncData.js";import{InjectionExpandFieldApiConfig as N}from"./constants/index.js";const b={class:"tableset-expand-field"},M={class:"list"},z={class:"table-modal-list"},A={class:"list-content"},S=n("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},[n("path",{d:"M12 12h2v12h-2z",fill:"currentColor"}),n("path",{d:"M18 12h2v12h-2z",fill:"currentColor"}),n("path",{d:"M4 6v2h2v20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8h2V6zm4 22V8h16v20z",fill:"currentColor"}),n("path",{d:"M12 2h8v2h-8z",fill:"currentColor"})],-1),j={class:"footer"};var F=t({__name:"index",props:{id:{type:String,default:""},expandFieldApiConfig:{type:Object},tableData:{type:Array,default:()=>[]},orgId:{type:String,default:""}},emits:["closeModal"],setup(t,{emit:F}){const O=t,V=h(),{deleteExtendFieldById:B}=I();e(N,O.expandFieldApiConfig);const E=[{title:"字段标题",columnName:"name",span:3},{title:"字段键名",columnName:"code",span:3},{title:"字段类型",columnName:"html_type",span:3},{title:"问号提示",columnName:"remark",span:4},{title:"创建时间",columnName:"createdDate",span:4},{title:"修改时间",columnName:"updatedDate",span:4},{title:"操作",columnName:"operator",span:3}],P=l(!1),L=l("add"),U=l({});function q(){F("closeModal")}function G(){P.value=!0,L.value="add",U.value={}}function H(){P.value=!1}return(e,l)=>(a(),i("div",b,[n("div",M,[n("div",z,[o(' <div class="list-title">\n\t\t\t\t\t<span class="list-title-item" v-for="titleItem in filedList" :key="titleItem.columnName">\n\t\t\t\t\t\t{{ titleItem.title }}\n\t\t\t\t\t</span>\n\t\t\t\t</div> '),s(d(_),{cols:24,class:"list-title"},{default:r((()=>[(a(),i(c,null,u(E,(t=>s(d(g),{span:t.span,class:"list-title-item",key:t.columnName},{default:r((()=>[m(p(t.title),1)])),_:2},1032,["span"]))),64))])),_:1}),n("div",A,[(a(!0),i(c,null,u(t.tableData,((t,e)=>(a(),f(d(_),{key:e,class:"list-content-block"},{default:r((()=>[s(d(g),{span:3,title:t.name,class:"list-content-item"},{default:r((()=>[m(p(t.name),1)])),_:2},1032,["title"]),s(d(g),{span:3,title:t.code,class:"list-content-item"},{default:r((()=>[m(p(t.code),1)])),_:2},1032,["title"]),s(d(g),{span:3,title:t.html_type,class:"list-content-item"},{default:r((()=>[m(p(t.html_type),1)])),_:2},1032,["title"]),s(d(g),{span:4,title:t.remark,class:"list-content-item"},{default:r((()=>[m(p(t.remark),1)])),_:2},1032,["title"]),s(d(g),{span:4,title:t.createdDate,class:"list-content-item"},{default:r((()=>[m(p(t.createdDate),1)])),_:2},1032,["title"]),s(d(g),{span:4,title:t.updatedDate,class:"list-content-item"},{default:r((()=>[m(p(t.updatedDate),1)])),_:2},1032,["title"]),s(d(g),{span:3,class:"list-content-item"},{default:r((()=>[s(d(y),{duration:0},{trigger:r((()=>[s(d(k),{component:d(D),onClick:v((e=>{return l=t,P.value=!0,L.value="edit",void(U.value={...l});var l}),["prevent","stop"])},null,8,["component","onClick"])])),default:r((()=>[m(" 编辑 ")])),_:2},1024),s(d(y),{duration:0},{trigger:r((()=>[s(d(C),{onPositiveClick:e=>async function(t){try{const e=await B(t,O.expandFieldApiConfig);if("SUCCESS"!==(null==e?void 0:e.result))return void V.error((null==e?void 0:e.resultMsg)||"删除失败");V.success("删除成功")}catch(t){V.error(t)}}(t)},{trigger:r((()=>[s(d(k),null,{default:r((()=>[S])),_:1})])),default:r((()=>[m(" 是否确认删除? ")])),_:2},1032,["onPositiveClick"])])),default:r((()=>[m(" 删除 ")])),_:2},1024)])),_:2},1024)])),_:2},1024)))),128))])]),n("div",j,[s(d(x),{onClick:q},{default:r((()=>[m("取消")])),_:1}),s(d(x),{type:"info",onClick:G},{default:r((()=>[m("增加字段")])),_:1})])]),s(w,{visible:P.value,formItemData:U.value,formOntype:L.value,id:t.id,orgId:t.orgId,onCancelModal:H},null,8,["visible","formItemData","formOntype","id","orgId"])]))}});export{F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type IExpandFieldItemType = Record<'code' | 'createdDate' | 'html_type' | 'id' | 'name' | 'remark' | 'setting' | 'updatedDate', string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const HtmlType: {
|
|
2
|
+
INPUT: string;
|
|
3
|
+
TEXTAREA: string;
|
|
4
|
+
DIGITAL: string;
|
|
5
|
+
DATE: string;
|
|
6
|
+
RADIO: string;
|
|
7
|
+
RADIO_BLOCK: string;
|
|
8
|
+
CHECKBOX: string;
|
|
9
|
+
CHECKBOX_BLOCK: string;
|
|
10
|
+
SELECT: string;
|
|
11
|
+
MULTI_SELECT: string;
|
|
12
|
+
CANDIDATE_COMPONENTS: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const HtmlTypeList: {
|
|
15
|
+
value: string;
|
|
16
|
+
label: string;
|
|
17
|
+
}[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const l={INPUT:"INPUT",TEXTAREA:"TEXTAREA",DIGITAL:"DIGITAL",DATE:"DATE",RADIO:"RADIO",RADIO_BLOCK:"RADIO_BLOCK",CHECKBOX:"CHECKBOX",CHECKBOX_BLOCK:"CHECKBOX_BLOCK",SELECT:"SELECT",MULTI_SELECT:"MULTI_SELECT",CANDIDATE_COMPONENTS:"CANDIDATE_COMPONENTS"},E=[{value:l.INPUT,label:"文本框"},{value:l.TEXTAREA,label:"文本域"},{value:l.DIGITAL,label:"数字框"},{value:l.DATE,label:"日期"},{value:l.RADIO,label:"横向单选"},{value:l.RADIO_BLOCK,label:"纵向单选"},{value:l.CHECKBOX,label:"横向多选"},{value:l.CHECKBOX_BLOCK,label:"纵向多选"},{value:l.SELECT,label:"下拉框"},{value:l.MULTI_SELECT,label:"下拉多选框"},{value:l.CANDIDATE_COMPONENTS,label:"选人组件"}];export{l as HtmlType,E as HtmlTypeList};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function isTextarea(current: string): boolean;
|
|
2
|
+
export declare function isNumber(current: string): boolean;
|
|
3
|
+
export declare function isDate(current: string): boolean;
|
|
4
|
+
export declare function isShowOptions(current: string): boolean;
|
|
5
|
+
export declare function isCandidate(current: string): boolean;
|
|
6
|
+
export declare function isMulti(current: string): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{HtmlType as n}from"./constant.js";function t(t){return t===n.TEXTAREA}function C(t){return t===n.DIGITAL}function r(t){return t===n.DATE}function E(t){return[n.RADIO,n.RADIO_BLOCK,n.CHECKBOX,n.CHECKBOX_BLOCK,n.SELECT,n.MULTI_SELECT].includes(t)}function u(t){return t===n.CANDIDATE_COMPONENTS}function O(t){return[n.CHECKBOX,n.CHECKBOX_BLOCK,n.MULTI_SELECT].includes(t)}export{u as isCandidate,r as isDate,O as isMulti,C as isNumber,E as isShowOptions,t as isTextarea};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t){if("string"==typeof t)try{const r=JSON.parse(t);return!("object"!=typeof r||!r)}catch(t){return!1}return!1}function r(t){var r,e;return(r="Date",function(t){return"[object "+r+"]"===Object.prototype.toString.call(t)})(t)&&!isNaN((e=t,e.getTime()))}export{t as isJSON,r as isValidDate};
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@font-face{font-family:expand-field-iconfont;src:url(expand-field-iconfont.ttf?t=1689038151631) format("truetype")}.iconfont-expand-field{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:expand-field-iconfont!important;font-size:14px;font-style:normal}.icon-expand-field-help:before{content:"\e6b6"}.icon-expand-field-menzhenyishengzhanxitongtubiaoguanbi:before{content:"\e76e"}.icon-expand-field-menzhenyishengzhanxitongtubiaozuixiaohua2:before{content:"\e778"}.icon-expand-field-menzhenyishengzhanxitongtubiaozuidahua:before{content:"\e779"}.tableset-expand-field{height:100%}.tableset-expand-field .list{background:transparent;display:flex;flex-direction:column;height:100%}.tableset-expand-field .list .table-modal-list{flex:1;overflow-y:auto}.tableset-expand-field .list .table-modal-list .list-title{background-color:#f2f2f4;border:1px solid #e1dfdf;height:52px;line-height:52px}.tableset-expand-field .list .table-modal-list .list-title .list-title-item{font-weight:700;text-align:center}.tableset-expand-field .list .table-modal-list .list-content{margin:0;padding:0}.tableset-expand-field .list .table-modal-list .list-content .list-content-block{border-bottom:1px solid #e1dfdf;height:50px;line-height:50px}.tableset-expand-field .list .table-modal-list .list-content .list-content-block .list-content-item{overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.tableset-expand-field .list .table-modal-list .list-content .list-content-block .list-content-item .n-icon{cursor:pointer;margin-right:8px}.tableset-expand-field .list .table-modal-list .list-content .list-content-block:last-child{border:none}.tableset-expand-field .list .footer{border-top:1px solid #d5d5d5;padding-top:12px}.tableset-expand-field .list .footer .n-button:first-child{margin-right:8px}.expand-field-modal-block.expand-person-modal{overflow-y:hidden}.expand-field-modal-block .n-card-header .svg-wrap .iconfont-expand-field{cursor:pointer;font-size:18px}.expand-field-modal-block .n-card-header .svg-wrap .iconfont-expand-field:last-child{margin-left:16px}.expand-field-modal-block .n-card-header .svg-wrap .n-icon{cursor:pointer}.expand-field-modal-block .n-card__content{overflow-y:auto}.expand-field-modal-block .n-card__content .options-title .iconfont-expand-field{cursor:pointer;font-size:16px;margin-left:5px}.expand-field-modal-block .n-card__content .options-title .batch-span{color:#2d7aff;cursor:pointer;margin-left:8px}.expand-field-modal-block .n-card__content .options-item{border:1px solid #ccc;border-radius:5px;padding:8px 12px;width:100%}.expand-field-modal-block .n-card__content .options-item .flex-center{align-items:center;display:flex}.expand-field-modal-block .n-card__content .options-item .flex-center .n-icon{cursor:pointer}.expand-field-modal-block .n-card__content .options-item.options-item-err{border-color:#f5222d}.expand-field-modal-block .n-card__content .date-time-button{padding:0;width:56px}.expand-field-modal-block .n-card__content .date-time-button .n-button__content{justify-content:center;position:relative;width:100%}.expand-field-modal-block .n-card__content .date-time-button .n-button__content .n-time-picker{position:absolute;width:100%}.expand-field-modal-block .n-card__content .date-time-button .n-button__content .n-time-picker .n-input{background:transparent}.expand-field-modal-block .n-card__content .date-time-button .n-button__content .n-time-picker .n-input .n-input__input-el{color:transparent;cursor:pointer}.expand-field-modal-block .n-card__content .date-time-button .n-button__content .n-time-picker .n-input .n-input__placeholder{color:transparent}.expand-field-modal-block .n-card__content .date-time-button .n-button__content .n-time-picker .n-input .n-input__suffix{display:none}.expand-field-modal-block .n-card__content .people-wrap .inner-content{border:1px solid #e0e0e6;display:flex;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.expand-field-modal-block .n-card__content .people-wrap .inner-content .tagSpanClass{display:flex;flex:1;flex-wrap:nowrap;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.expand-field-modal-block .n-card__content .people-wrap .inner-content .tagSpanClass .n-tag{margin:2px 0 0 5px}.expand-field-modal-block .n-card__content .people-wrap .inner-content .tagClearAll{align-items:center;cursor:pointer;display:flex;flex-basis:30px;justify-content:center}.expand-field-modal-block .n-card__content .validate_tip{color:#f5222d;font-size:12px;margin-top:2px}.expand-field-modal-block .flex_right{display:flex;justify-content:flex-end}.expand-field-modal-block .flex_right .n-button:first-child{margin-right:15px}.expand-field-modal-block .mgb-10{margin-bottom:10px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,defaultRectStyle as n,drawTextGroup as o,drawLine as l,drawPoint as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,defaultRectStyle as n,drawTextGroup as o,drawLine as l,drawPoint as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as a}from"../useCumputedPoint.js";import"vue";import{cloneDeep as f}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";function c(c,d,u,m,h){const{cumputedX:p,getXValue:v}=a(d),{originX:x,endX:g,xCellWidth:L,originYXAxis:X,top:C,canvasWidth:y,borderStyle:w,treeData:S,xAxis:Y,topGridYNumber:j,topGridOriginY:b,topGridYCellHeight:k,topGridEndY:G,event:I}=d,z=new Set;function A(t,e,i){let n;const{content:o}=t.value||{};if(o){const{lineStyle:l,textStyle:s,totalStyle:a}=C.data||{},{startLine:f,centerLine:c,endLine:d}=e;n=r(o,{fontSize:12,...s,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const u=M(n,e,i);n&&(n.set(u),n.origin={data:t},E(n),f&&(f.text=n),d&&(d.text=n))}return n}function M(t,e,i){const n=t.width+1,{startLine:o,centerLine:l,endLine:r}=e,s={top:i,originX:"center",originY:"center"};return l&&n<=l.width?s.left=l.x1+l.width/2:r&&n<=r.limitX.x2-r.left?(s.originX="left",s.left=r.left+1):o&&!r&&n<=o.limitX.x2-o.left?(s.originX="left",s.left=o.left+(o.isCustomIcon?5:1)):o&&n<=o.left-o.limitX.x1?(s.originX="right",s.left=o.left-(o.isCustomIcon?5:1)):l?(s.originY="top",s.left=l.x1+l.width/2,s.top=i+1,s.fontSize=10):o&&(s.originX="left",s.originY="top",s.fontSize=10,s.left=o.left,s.top=i+1),s}function $(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:a,y2:f,halfY:c}=e;if(!s||s<x||s>g)return;const{lineStyle:d}=C.data||{};let u;const m={left:s,top:c};u=i?r("circle",{fill:d.stroke,...m}):n?r(">",{fill:d.stroke,...m,fontSize:18}):l([s,a,s,c],d);const h=new t.Rect({width:L,height:k,fill:"transparent",left:s-L/2,top:a}),p=new t.Group([u,h],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",lockMovementY:!0});return p.isLeft=o,p.isCustomIcon=i,E(p),p}function E(t){I.hovered&&(t.on("mouseover",(()=>{D(t,"hover")})),t.on("mouseout",(()=>{m.show=!1}))),t.lockMovementX&&t.lockMovementY||(t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2)}(t),function(t){if(t.centerLine){const e=t.isLeft?{x1:t.left}:{x2:t.left};t.centerLine.setCoords().set(e)}if(t.text){const e=M(t.text,{startLine:t.isLeft?t:t.nearLine,centerLine:t.centerLine,endLine:t.isLeft?t.nearLine:t},t.top);t.text.setCoords().set(e)}}(t),I.hovered&&D(t)})),t.on("mouseup",(e=>{if(1===e.button){!function(t){t.isLeft?(t.prevLine&&(t.prevLine.limitX.x2=t.left),t.nearLine&&(t.nearLine.limitX.x1=t.left)):(t.nextLine&&(t.nextLine.limitX.x1=t.left),t.nearLine&&(t.nearLine.limitX.x2=t.left))}(t);const e={type:"tree",...t.origin};u("change",e)}})))}function D(t,e="moving"){var i,n,o;const{data:l}=t.origin;m.point={x:t.left,y:t.top};let[r="",s=""]=l.time||[];if("moving"===e){const e=v(t.left);t.isLeft?r=e:s=e,l.time=[r,s],t.text&&(t.text.origin.data.time=[r,s])}m.list=[`开始时间 ${r}`,`结束时间 ${s}`,`流速 ${(null==(i=l.value)?void 0:i.currentSpeed)||""}`,`浓度 ${(null==(n=l.value)?void 0:n.consistence)||""}`,`总量 ${(null==(o=l.value)?void 0:o.total)||""}`],m.show=!0}s(c,{...d,gridYNumber:j,originY:b,yCellHeight:k,endY:G}),function(){var o;const{height:l,list:r,left:s,spaceValue:a}=Y;if(!l)return;const f=[],d=X+l/2;r.forEach(((t,i)=>{const n=s+i*L*a;f.push(e([n,d],{value:t.slice(11,16)}))}));const u=f.length>0?new t.Group([...f],{...i,objectCaching:!1}):null;u&&c.value.add(u);const m=new t.Rect({width:y,height:l,left:0,top:X,...n,originX:"left",originY:"top",...w}),h=e([g+(y-g)/2,d],{value:"总量",...null==(o=C.data)?void 0:o.totalStyle});c.value.add(m,h)}(),function(){var n;const r=(null==(n=null==C?void 0:C.tree)?void 0:n.textStyle)||{},s=[];!function t(i){i.forEach((i=>{var n;const{width:a,height:d,left:u,top:m,title:h=""}=i,v={value:h,...r};(null==(n=i.children)?void 0:n.length)?(v.value=h.split("").join("\n"),t(i.children)):(v.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e,textStyle:i,totalStyle:n}=C.data||{},o=t.top,r=o+k,s=r-k/2,a={y1:o,y2:r,halfY:s},c=[],d=f(t);delete d.data,t.data.forEach(((t,i,n)=>{const{time:o,continue:r}=t,[f,u]=o,m=f&&p(f),h=u&&p(u),v=$({...a,x:m},{isCustomIcon:!h&&!r,isContinue:!1,isLeft:!0}),L=$({...a,x:h},{isCustomIcon:!1,isContinue:!!r});let X,C,y;if((v||m<x)&&(L||h>g)){X=l([v?m:x,s,L?h:g,s],e)}c.push({startLine:v,centerLine:X,endLine:L}),function(t,e,i){const{startLine:n,centerLine:o,endLine:l}=e[t],{startLine:r,endLine:s}=e[t-1]||{};if(n){n.origin=i;const t={x1:x,x2:l?l.left:g};s?(t.x1=s.left,s.limitX.x2=n.left,n.prevLine=s,s.nextLine=n):r&&(t.x1=r.left,r.limitX.x2=n.left,n.prevLine=r,r.nextLine=n),n.limitX=t,o&&(n.centerLine=o)}if(l){l.origin=i;const t={x1:n?n.left:x,x2:g};l.limitX=t,o&&(l.centerLine=o)}n&&l&&(n.nearLine=l,l.nearLine=n)}(i,c,Object.assign({},d,{data:t,index:i})),n[i-1]&&(C=A(n[i-1],c[i-1],s)),i===n.length-1&&(y=A(t,c[i],s)),X&&z.add(X),v&&z.add(v),L&&z.add(L),C&&z.add(C),y&&z.add(y)}))}(i),function(t){var i;if(!(null==t?void 0:t.total))return;const n=t.top+k/2,o=e([g+(y-g)/2,n],{value:t.total,...null==(i=C.data)?void 0:i.totalStyle});o&&c.value.add(o)}(i)),s.push(o({width:a,height:d,...w},v,{left:u,top:m},!0))}))}(S);const a=s.length>0?new t.Group([...s],{...i,objectCaching:!1}):null;a&&c.value.add(a),z.size&&c.value.add(...z)}()}export{c as useTop};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{omit as e,pick as t}from"lodash-es";import{EditAbleField as l,widgetWidthOptionConfig as i,isShowOptionConfig as
|
|
1
|
+
import{omit as e,pick as t}from"lodash-es";import{EditAbleField as l,widgetWidthOptionConfig as i,isShowOptionConfig as _,isNotFoldOptionConfig as a,isEditOptionConfig as o,isNullOptionConfig as m,isVisibleOptionConfig as s,rowsOptionConfig as n}from"../constants/index.js";import"../../../form-render/index.js";import{useFieldNormalize as r}from"../../../form-render/src/hooks/useFieldNormalize.js";const{FieldNormalizeWaterfallHook:d}=r();function E(){const r=new Map([[l.NAME,()=>({alias:"名称",elem_width:6,is_null:"0",html_type:"INPUT"})],[l.NOTES,()=>({alias:"问号提示",elem_width:6,html_type:"INPUT",is_empty:"0"})],[l.DEFAULT_VALUE,(l,i)=>{const _=d.call(Object.assign({},null==l?void 0:l.originalSetting,i));return{alias:"默认值",elem_width:6,html_type:"INPUT",is_empty:"0",componentProps:e(_.componentProps,["class","style","disabled"]),...t(_,["html_type","validate","option","multi_select","multi_select_value","wordbook","open","close","date_format","step_length","urlConfig","autograph","defined_error_msg","free_entry","validator","is_allow_check_mid","allow_check_mid_level"])}}],[l.LAYOUT_WIDTH_ENUM,()=>({alias:"宽度",fieldType:"number",html_type:"SELECT",elem_width:6,...i()})],[l.DESC,()=>({alias:"说明文本",elem_width:6,html_type:"INPUT",is_empty:"0",validate:{max_length:30}})],[l.DEFAULT_EXPAND,()=>({alias:"是否默认展开",html_type:"SWITCH",elem_width:6,..._()})],[l.FOLD,()=>({alias:"是否可折叠",html_type:"SWITCH",elem_width:6,...a()})],[l.EDITABLE,e=>({alias:"是否可编辑",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.editableDisabled)?"0":"1",...o()})],[l.REQUIRED,e=>({alias:"是否必填",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.requiredDisabled)?"0":"1",...m()})],[l.SHOW,e=>({alias:"是否显示",html_type:"SWITCH",elem_width:6,is_show:(null==e?void 0:e.__isCombinationChild)?"1":"0",...s()})],[l.ROWS,()=>({alias:"高度",elem_width:6,remark:"默认为3行高度,可调整为1-10行高度",default_val:3,is_empty:"0",html_type:"SELECT",...n()})]]);function E(e,t,l){return e.map((e=>{var i,_;return{...null!=(_=null==(i=r.get(e))?void 0:i(t,l))?_:{},val_key:e}}))}const p=new Map([["LINE_BAR",[l.NAME,l.LAYOUT_WIDTH_ENUM,l.NOTES,l.DEFAULT_EXPAND,l.FOLD]],...["NEWLINE","COMPLEX","COMBINATION"].map((e=>[e,[l.NAME,l.LAYOUT_WIDTH_ENUM]]))]),h=[l.NAME,l.DEFAULT_VALUE,l.LAYOUT_WIDTH_ENUM,l.DESC,l.NOTES,l.EDITABLE,l.REQUIRED,l.SHOW];return{generateFieldListByKeys:E,generateFieldListByFormConfigItem:function(e,t){var i;const _=p.get(e.type)||h;return"TEXTAREA"===(t?t.html_type:null==(i=e.originalSetting)?void 0:i.html_type)&&_.splice(3,0,l.ROWS),E(_,e,t)}}}export{E as useConfigurationField};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{COMPONENT_NAMESPACE as e}from"../../shared/global/variable.js";import{safeComponentRegister as s}from"../../shared/utils/index.js";import r from"./src/FormRenderWrapper.vue.js";export{useFieldListAdaptor}from"./src/hooks/useFieldListAdaptor.js";export{useFormRequest}from"./src/hooks/useFormRequest.js";export{useCommonLog}from"./src/hooks/useCommonLog.js";export{useFormField}from"./src/hooks/useFormField.js";export{useFormAsyncQueue}from"./src/hooks/useFormAsyncQueue.js";export{useFieldVisitor}from"./src/hooks/useFieldVisitor.js";export{useFieldNormalize}from"./src/hooks/useFieldNormalize.js";export{useFormValidator,validateMessageLocale}from"./src/hooks/useFormValidator.js";export{BusinessCollector,useBusinessBinding}from"./src/hooks/useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./src/hooks/useChangeContext.js";export{FormItemDepsCollector,useFormItemDeps}from"./src/hooks/useFormItemDeps.js";export{useAnchor}from"./src/hooks/useAnchor.js";export{useFormContext}from"./src/hooks/useFormContext.js";export{useCommonInjection,useSelectOptionProps}from"./src/hooks/useCommonInjection.js";export{searchContentMatcher,useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./src/hooks/useFormRenderOptions.js";export{combineExtendKey,createInputSlot,createSlot,createUrlConfigParams,formRenderLog,injectOrProvide,isNestedFieldType,isNestedType,mergeDeepProperties,parseNumberFromMaybeString,presetRequestHandler,splitExtendKey,validateMessageParser}from"./src/utils/index.js";export*from"@formily/core";export{businessDateParser,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./src/utils/business.js";export{findNextWidget,queryDecoratorByAddress,queryDecoratorByFieldKey,queryInput}from"./src/utils/dom.js";export{assignClearBindVisited,assignUpdateValue,assignValueBindKey,createLinebarId,createObjSchema,createVisitedSetter,dotEscape,fieldKeyEscape,getParentLinebar,traverseDependKey,traverseSchema}from"./src/utils/schema.js";const o=r;o.install=function(r){s(r,o,e+"FormRender")};export{o as default};
|
|
1
|
+
import{COMPONENT_NAMESPACE as e}from"../../shared/global/variable.js";import{safeComponentRegister as s}from"../../shared/utils/index.js";import r from"./src/FormRenderWrapper.vue.js";export{useFieldListAdaptor}from"./src/hooks/useFieldListAdaptor.js";export{useFormRequest}from"./src/hooks/useFormRequest.js";export{useCommonLog}from"./src/hooks/useCommonLog.js";export{useFormField}from"./src/hooks/useFormField.js";export{useFormAsyncQueue}from"./src/hooks/useFormAsyncQueue.js";export{useFieldVisitor}from"./src/hooks/useFieldVisitor.js";export{useFieldNormalize}from"./src/hooks/useFieldNormalize.js";export{useFormValidator,validateMessageLocale}from"./src/hooks/useFormValidator.js";export{BusinessCollector,useBusinessBinding}from"./src/hooks/useBusinessBinding.js";export{ContextCollector,useChangeContext}from"./src/hooks/useChangeContext.js";export{FormItemDepsCollector,useFormItemDeps}from"./src/hooks/useFormItemDeps.js";export{useAnchor}from"./src/hooks/useAnchor.js";export{useFormContext}from"./src/hooks/useFormContext.js";export{useCommonInjection,useSelectOptionProps}from"./src/hooks/useCommonInjection.js";export{searchContentMatcher,useAutographOptions,useRecommendOptions,useUrlConfigOptions}from"./src/hooks/useFormRenderOptions.js";export{combineExtendKey,createInputSlot,createSlot,createUrlConfigParams,formRenderLog,injectOrProvide,isNestedFieldType,isNestedType,mergeDeepProperties,parseNumberFromMaybeString,presetRequestHandler,renderDescOption,splitExtendKey,validateMessageParser}from"./src/utils/index.js";export*from"@formily/core";export{businessDateParser,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./src/utils/business.js";export{findNextWidget,queryDecoratorByAddress,queryDecoratorByFieldKey,queryInput}from"./src/utils/dom.js";export{assignClearBindVisited,assignUpdateValue,assignValueBindKey,createLinebarId,createObjSchema,createVisitedSetter,dotEscape,fieldKeyEscape,getParentLinebar,traverseDependKey,traverseSchema}from"./src/utils/schema.js";const o=r;o.install=function(r){s(r,o,e+"FormRender")};export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as d,normalizeStyle as p,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as g,createCommentVNode as j,createElementVNode as b,withKeys as k,toDisplayString as v,renderSlot as F}from"vue";import{useTheme as C}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as S,cloneDeep as H,isObject as x,isBoolean as A}from"lodash-es";import{createForm as L,onFieldValueChange as O,onFieldMount as R,onFieldUnmount as w,onFieldReact as B,onFormMount as _}from"@formily/core";import{FormProvider as D,FormConsumer as V}from"@formily/vue";import{NForm as I,NTabs as N,NTabPane as q,NConfigProvider as W}from"naive-ui";import{InjectionFormLifeCycleCaller as E,InjectionFormGraph as K}from"./constants/index.js";import{useAutoHidden as T}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as U}from"./hooks/useComplexOptions.js";import{useFormDomEvent as G,useFormExposeEvent as M}from"./hooks/useFormEvent.js";import{useFormGraph as P}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as J}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeEvent as $}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as z}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as Q}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as X}from"./hooks/useOperationalForm.js";import{useWordbookSetting as Y}from"./hooks/useWordbookSetting.js";import"../../../shared/utils/index.js";import"@formily/path";import"@vue/shared";import"../index.js";import{createObjSchema as Z}from"./utils/schema.js";import{useFieldListAdaptor as ee}from"./hooks/useFieldListAdaptor.js";import{useFieldVisitor as oe}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 te}from"./hooks/useFormValidator.js";import{useAnchor as re}from"./hooks/useAnchor.js";import{useFormContext as se}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";const ae={key:0,style:{height:"54px"}},ie={style:{"white-space":"pre"}};var le=e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},operationalForm:{type:Object},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},uniqueCacheData:{type:Boolean,default:!1}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:le,emit:ne}){const me=e,de=C(),{nuiThemeOverrides:pe}=Q();te();const ue=o(),ce=t((()=>S(me.maxHeight)?me.maxHeight+"px":me.maxHeight)),{SchemaField:fe,businessCollector:he,formItemDepsCollector:ye,changeContextCollector:ge,formUUID:je}=se(me,ne),{anchorBarRef:be,currentAnchor:ke,updateAnchorList:ve,anchorIdList:Fe,onScroll:Ce}=re(me,ne,ue,ye),{callLifeCycle:Se}=J(me);r(E,Se),Se("onSetup");const{trigger:He}=T(),{observeFormGraph:xe,setGraph:Ae,removeGraph:Le}=P();r(K,xe);const{lowCodeEventTrigger:Oe}=$(),Re=L({initialValues:me.initialData,effects(e){O("*",(o=>{const t=o.props.name.toString();he.trigger(e,t),ye.trigger(t),ne("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:ge.getContext(t,o.value)}),Oe(o),we(t,o.value),_e(t),Ve(t,o.value)})),R("*",Ae),w("*",Le),me.linebarAutoHidden&&(B("*",He),_((e=>e.query("*").forEach(He)))),me.anchor&&B("*",ve)}}),{lowCodeReactionsHandler:we,triggerAllReactionsHandler:Be}=z(t((()=>me.lowCodeReactions)),Re),{operationalFormHandler:_e,triggerAllOperationalFormHandler:De}=X(t((()=>me.operationalForm)),Re),{wordbookSettingHandler:Ve}=Y(Re,ge);s(Be),s(De);const{schemaAdaptor:Ie}=ee(he);let Ne=me.fieldList||[];const qe=t((()=>me.schema?me.schema:me.fieldList?(Ne=oe().traverse(H(me.fieldList),me.fieldVisitor),Z(Ie(Ne))):Z({}))),{onKeydown:We}=G({formModel:Re,formRenderRef:ue,props:me}),{clearSpan:Ee}=U();a((()=>Ee(je)));const Ke=M({formModel:Re,formRenderRef:ue,formItemDepsCollector:ye,getFieldList:()=>Ne,formUUID:je});return le({formModel:Re,validate:(e="*")=>Ke.validate(e),getFormValues:(e=!0)=>Ke.getFormValues(e),async setFormValues(e,o={},t=!1,r=!0){var s,a,l,n;let m=!0,d=!0;x(o)?(d=null==(s=o.needSplitExtendKey)||s,m=null==(a=o.avoidDependKeyConnection)||a,t=null!=(l=o.avoidBusinessConnection)&&l,r=null==(n=o.overwrite)||n):A(o)&&(d=o),t&&(he.triggerLock=!0),m&&(ye.triggerDisabled=!0),Ke.setFormValues(e,d,r),await i(),he.triggerLock=!1,ye.triggerDisabled=!1},setFieldState(e,o){Ke.setFieldState(e,o)},resetFields(e="*"){Ke.resetFields(e)},queryWidget:async e=>Ke.queryWidget(e),getFieldList:()=>Ne,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(l(),n(m(I),{class:d(["form-render",{"form-render--no-border":!e.bordered,"form-render--underline":"underline"===e.bordered}]),"require-mark-placement":"left",style:p(m(de))},{default:u((()=>[e.anchor?(l(),c("section",ae,[f(m(N),{value:m(ke),"onUpdate:value":t[0]||(t[0]=e=>h(ke)?ke.value=e:null),type:"line",ref_key:"anchorBarRef",ref:be},{default:u((()=>[(l(!0),c(y,null,g(m(Fe),(e=>(l(),n(m(q),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):j("v-if",!0),f(m(W),{"theme-overrides":m(pe)},{default:u((()=>[b("section",{class:"form-render__wrapper",style:p({"--column":e.column,"--form-height":m(ce)}),ref_key:"formRenderRef",ref:ue,onScroll:t[1]||(t[1]=(...e)=>m(Ce)&&m(Ce)(...e)),onKeydownCapture:t[2]||(t[2]=k(((...e)=>m(We)&&m(We)(...e)),["enter"]))},[f(m(D),{form:m(Re)},{default:u((()=>[f(m(fe),{schema:m(qe)},null,8,["schema"]),e.consumer?(l(),n(m(V),{key:0},{default:u((({form:e})=>[b("div",ie,v(JSON.stringify(e.values,null,2)),1)])),_:1})):j("v-if",!0),F(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},8,["class","style"]))}});export{le as default};
|
|
1
|
+
import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as d,normalizeStyle as p,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as g,createCommentVNode as j,createElementVNode as b,withKeys as k,toDisplayString as v,renderSlot as F}from"vue";import{useTheme as C}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as S,cloneDeep as H,isObject as x,isBoolean as A}from"lodash-es";import{createForm as L,onFieldValueChange as O,onFieldMount as R,onFieldUnmount as w,onFieldReact as B,onFormMount as _}from"@formily/core";import{FormProvider as D,FormConsumer as V}from"@formily/vue";import{NForm as I,NTabs as N,NTabPane as q,NConfigProvider as W}from"naive-ui";import{InjectionFormLifeCycleCaller as E,InjectionFormGraph as K}from"./constants/index.js";import{useAutoHidden as T}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as U}from"./hooks/useComplexOptions.js";import{useFormDomEvent as G,useFormExposeEvent as M}from"./hooks/useFormEvent.js";import{useFormGraph as P}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as J}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeEvent as $}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as z}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as Q}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as X}from"./hooks/useOperationalForm.js";import{useWordbookSetting as Y}from"./hooks/useWordbookSetting.js";import"../../../shared/utils/index.js";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"../index.js";import{createObjSchema as Z}from"./utils/schema.js";import{useFieldListAdaptor as ee}from"./hooks/useFieldListAdaptor.js";import{useFieldVisitor as oe}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 te}from"./hooks/useFormValidator.js";import{useAnchor as re}from"./hooks/useAnchor.js";import{useFormContext as se}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";const ae={key:0,style:{height:"54px"}},ie={style:{"white-space":"pre"}};var le=e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},operationalForm:{type:Object},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},uniqueCacheData:{type:Boolean,default:!1}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:le,emit:ne}){const me=e,de=C(),{nuiThemeOverrides:pe}=Q();te();const ue=o(),ce=t((()=>S(me.maxHeight)?me.maxHeight+"px":me.maxHeight)),{SchemaField:fe,businessCollector:he,formItemDepsCollector:ye,changeContextCollector:ge,formUUID:je}=se(me,ne),{anchorBarRef:be,currentAnchor:ke,updateAnchorList:ve,anchorIdList:Fe,onScroll:Ce}=re(me,ne,ue,ye),{callLifeCycle:Se}=J(me);r(E,Se),Se("onSetup");const{trigger:He}=T(),{observeFormGraph:xe,setGraph:Ae,removeGraph:Le}=P();r(K,xe);const{lowCodeEventTrigger:Oe}=$(),Re=L({initialValues:me.initialData,effects(e){O("*",(o=>{const t=o.props.name.toString();he.trigger(e,t),ye.trigger(t),ne("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:ge.getContext(t,o.value)}),Oe(o),we(t,o.value),_e(t),Ve(t,o.value)})),R("*",Ae),w("*",Le),me.linebarAutoHidden&&(B("*",He),_((e=>e.query("*").forEach(He)))),me.anchor&&B("*",ve)}}),{lowCodeReactionsHandler:we,triggerAllReactionsHandler:Be}=z(t((()=>me.lowCodeReactions)),Re),{operationalFormHandler:_e,triggerAllOperationalFormHandler:De}=X(t((()=>me.operationalForm)),Re),{wordbookSettingHandler:Ve}=Y(Re,ge);s(Be),s(De);const{schemaAdaptor:Ie}=ee(he);let Ne=me.fieldList||[];const qe=t((()=>me.schema?me.schema:me.fieldList?(Ne=oe().traverse(H(me.fieldList),me.fieldVisitor),Z(Ie(Ne))):Z({}))),{onKeydown:We}=G({formModel:Re,formRenderRef:ue,props:me}),{clearSpan:Ee}=U();a((()=>Ee(je)));const Ke=M({formModel:Re,formRenderRef:ue,formItemDepsCollector:ye,getFieldList:()=>Ne,formUUID:je});return le({formModel:Re,validate:(e="*")=>Ke.validate(e),getFormValues:(e=!0)=>Ke.getFormValues(e),async setFormValues(e,o={},t=!1,r=!0){var s,a,l,n;let m=!0,d=!0;x(o)?(d=null==(s=o.needSplitExtendKey)||s,m=null==(a=o.avoidDependKeyConnection)||a,t=null!=(l=o.avoidBusinessConnection)&&l,r=null==(n=o.overwrite)||n):A(o)&&(d=o),t&&(he.triggerLock=!0),m&&(ye.triggerDisabled=!0),Ke.setFormValues(e,d,r),await i(),he.triggerLock=!1,ye.triggerDisabled=!1},setFieldState(e,o){Ke.setFieldState(e,o)},resetFields(e="*"){Ke.resetFields(e)},queryWidget:async e=>Ke.queryWidget(e),getFieldList:()=>Ne,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(l(),n(m(I),{class:d(["form-render",{"form-render--no-border":!e.bordered,"form-render--underline":"underline"===e.bordered}]),"require-mark-placement":"left",style:p(m(de))},{default:u((()=>[e.anchor?(l(),c("section",ae,[f(m(N),{value:m(ke),"onUpdate:value":t[0]||(t[0]=e=>h(ke)?ke.value=e:null),type:"line",ref_key:"anchorBarRef",ref:be},{default:u((()=>[(l(!0),c(y,null,g(m(Fe),(e=>(l(),n(m(q),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):j("v-if",!0),f(m(W),{"theme-overrides":m(pe)},{default:u((()=>[b("section",{class:"form-render__wrapper",style:p({"--column":e.column,"--form-height":m(ce)}),ref_key:"formRenderRef",ref:ue,onScroll:t[1]||(t[1]=(...e)=>m(Ce)&&m(Ce)(...e)),onKeydownCapture:t[2]||(t[2]=k(((...e)=>m(We)&&m(We)(...e)),["enter"]))},[f(m(D),{form:m(Re)},{default:u((()=>[f(m(fe),{schema:m(qe)},null,8,["schema"]),e.consumer?(l(),n(m(V),{key:0},{default:u((({form:e})=>[b("div",ie,v(JSON.stringify(e.values,null,2)),1)])),_:1})):j("v-if",!0),F(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},8,["class","style"]))}});export{le as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,createVNode as r}from"vue";import{connect as t,mapProps as o}from"@formily/vue";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"../../../index.js";import"date-fns";import{assignUpdateValue as
|
|
1
|
+
import{defineComponent as e,createVNode as r}from"vue";import{connect as t,mapProps as o}from"@formily/vue";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"naive-ui";import"../../../index.js";import"date-fns";import{assignUpdateValue as i}from"../../utils/schema.js";const p=t(e({props:{onChange:{},span:{type:Number,default:6},display:{type:String,default:"grid"},wrapperStyle:{type:Object,default:()=>({})}},setup:(e,{slots:t})=>()=>r("section",{class:"form-render__complex"},[r("section",{class:`form-render__complexContent--${e.display}`,style:e.wrapperStyle},[t.default&&t.default()])])}),o(i));export{p as COMPLEX};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,watch as
|
|
1
|
+
import{defineComponent as e,computed as t,watch as o,createVNode as a,mergeProps as r}from"vue";import{generateTimeFormat as i}from"../../../../../shared/utils/index.js";import{connect as n,mapProps as u}from"@formily/vue";import{isObject as s}from"@vueuse/core";import{format as m}from"date-fns";import l from"../../../../date-picker/index.js";import{useCommonInjection as d}from"../../hooks/useCommonInjection.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"lodash-es";import"naive-ui";import"../../../index.js";import{assignUpdateValue as v,assignClearBindVisited as c}from"../../utils/schema.js";const p=n(e({props:{onChange:{},value:{type:String},validate:{type:Object},valueFormat:{type:String,default:"yyyy-MM-dd"}},emits:["update:value"],setup(e,{emit:n}){const{injectValueValidate:u,injectValueBindKey:v}=d();function c(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.min_date)}function p(){var t;return"currTime"===(null==(t=e.validate)?void 0:t.max_date)}function f(e){return c()&&e<Date.now()-864e5||p()&&e>Date.now()}function y(e){const t=new Date(e),o=new Date,a=new Date(t);a.setHours(0),a.setMinutes(0),a.setSeconds(0);const r=new Date(t);r.setHours(23),r.setMinutes(59),r.setSeconds(59);const i=a>o,n=r<o,u=t.getHours(),s=o.getHours(),m=o.getMinutes();return{isHourDisabled:function(e){return c()&&!i&&e<s||p()&&!n&&e>s},isMinuteDisabled:function(e){if(u===s)return c()&&!i&&e<m||p()&&!n&&e>m;return c()&&!i&&u<s||p()&&!n&&u>s}}}u((()=>e.value));const D=t((()=>{const t={};if(s(e.validate)){const{min_date:o,max_date:a}=e.validate;(o||a)&&(t.isDateDisabled=f,t.isTimeDisabled=y)}return t})),j=t((()=>({valueFormat:e.valueFormat,format:e.valueFormat,timePickerProps:{format:i(e.valueFormat)}})));function g(t){return t?m(new Date(t),e.valueFormat):t}o((()=>e.value),(e=>{e&&g(e)!==e&&n("update:value",g(e))}));const h=t({get:()=>g(e.value),set:e=>{n("update:value",e)}}),w=v(h);return()=>a(l,r({key:w.value},D.value,j.value,{"formatted-value":h.value,"onUpdate:formatted-value":e=>h.value=e}),null)}}),u(v,c));export{p as DATE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,watch as
|
|
1
|
+
import{defineComponent as e,watch as t,computed as n,createVNode as u,mergeProps as o}from"vue";import r from"../../../../../shared/components/InputNumberSlash/InputNumberSlash.js";import{connect as i,mapProps as a}from"@formily/vue";import{isString as l,isNumber as p}from"lodash-es";import{NInputNumber as s}from"naive-ui";import{useCommonInjection as m}from"../../hooks/useCommonInjection.js";import{createInputSlot as c,parseNumberFromMaybeString as v}from"../../utils/index.js";import{assignUpdateValue as f,assignClearBindVisited as y}from"../../utils/schema.js";const g=i(e({props:{value:{type:[Number,String]},onChange:{type:Function,required:!0},prefix:{type:[String,Function,Object]},suffix:{type:[String,Function,Object]}},setup(e){const o=c(e);m().injectValueValidate((()=>e.value)),t((()=>e.value),(t=>{if(null!=t)return!l(t)&&!p(t)||Number.isNaN(+t)?e.onChange(null):void e.onChange(+t)}));const r=n({get:()=>v(e.value),set:t=>{var n;return null==(n=e.onChange)?void 0:n.call(e,t)}}),i=m().injectValueBindKey(r);return()=>u(s,{key:i.value,value:r.value,"onUpdate:value":e=>r.value=e,"show-button":!1},o.value)}}),a(f,y)),h=i(e({props:{value:{type:[Number,String]},onChange:{type:Function,required:!0},prefix:{type:[String,Function,Object]},suffix:{type:[String,Function,Object]},precision:{type:Number}},setup(e){const t=m().injectValueBindKey((()=>e.value));return()=>u(r,o(e,{key:t.value}),null)}}),a(f,y));export{g as INPUT_NUMBER,h as INPUT_NUMBER_SLASH};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,useAttrs as o,createVNode as a,isVNode as l}from"vue";import{connect as r,mapProps as i}from"@formily/vue";import{promiseTimeout as u}from"@vueuse/shared";import{isNumber as n}from"lodash-es";import{NSpace as p,NRadio as s,NRadioGroup as d,NCheckbox as m,NCheckboxGroup as c}from"naive-ui";import"../../../index.js";import{useComplexOptions as v}from"../../hooks/useComplexOptions.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"date-fns";import{assignUpdateValue as f,createVisitedSetter as y}from"../../utils/schema.js";import{useUrlConfigOptions as h,useAutographOptions as b}from"../../hooks/useFormRenderOptions.js";import{useCommonInjection as j}from"../../hooks/useCommonInjection.js";import{useFormField as g}from"../../hooks/useFormField.js";function k(r,i,s){return e({name:r,props:{value:{type:[String,Number,Object,Array]},options:{type:Array,default:()=>[]},urlConfig:{type:Object},autograph:{type:String},lazyRequest:{type:Boolean,default:!1},requestCache:{type:Boolean,default:!0},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},wordbook:{type:Object},vertical:{type:Boolean,default:!1},childFieldStrategy:{type:String,default:"checked"},clearable:Boolean,onChange:{}},emits:["update:value"],setup(e,{emit:r}){const{field:m}=g();const c=t({get(){return t=e.value,n(t)?t+"":t;var t},set(e){r("update:value",e)}}),{renderComplexOption:f}=v(e,c),{labelKey:k,valueKey:S,fullOptions:C}=e.urlConfig?h(e,c):b(e,c),{injectValueBindKey:F,injectValueValidate:O}=j();O(c);const x=F(c),B=o();return()=>a(i,{key:x.value,value:c.value,"onUpdate:value":e=>c.value=e,onClick:y(m)},{default:()=>[a(p,{vertical:e.vertical,"vertical-space":e.vertical},{default:()=>{var t;return[null==(t=C.value)?void 0:t.map((t=>{let o;return a(s,{key:t[S.value],value:t[S.value],disabled:t.disabled,onClick:()=>async function(t){if(null==B?void 0:B.disabled)return;if(i!==d||!e.clearable)return;const o=c.value;await u(0),o===t[S.value]&&(c.value=null)}(t)},"function"==typeof(r=o=f({value:c.value,option:t,valueKey:S.value,labelKey:k.value,childFieldStrategy:e.childFieldStrategy}))||"[object Object]"===Object.prototype.toString.call(r)&&!l(r)?o:{default:()=>[o]});var r}))]}})]})}})}const S=r(k("FormRadio",d,s),i({dataSource:"options"},f)),C=r(k("FormCheckbox",c,m),i({dataSource:"options"},f));export{C as CHECKBOX,S as RADIO};
|
|
1
|
+
import{defineComponent as e,computed as t,useAttrs as o,createVNode as a,isVNode as l}from"vue";import{connect as r,mapProps as i}from"@formily/vue";import{promiseTimeout as u}from"@vueuse/shared";import{isNumber as n}from"lodash-es";import{NSpace as p,NRadio as s,NRadioGroup as d,NCheckbox as m,NCheckboxGroup as c}from"naive-ui";import"../../../index.js";import{useComplexOptions as v}from"../../hooks/useComplexOptions.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"date-fns";import{assignUpdateValue as f,createVisitedSetter as y}from"../../utils/schema.js";import{useUrlConfigOptions as h,useAutographOptions as b}from"../../hooks/useFormRenderOptions.js";import{useCommonInjection as j}from"../../hooks/useCommonInjection.js";import{useFormField as g}from"../../hooks/useFormField.js";function k(r,i,s){return e({name:r,props:{value:{type:[String,Number,Object,Array]},options:{type:Array,default:()=>[]},urlConfig:{type:Object},autograph:{type:String},lazyRequest:{type:Boolean,default:!1},requestCache:{type:Boolean,default:!0},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},wordbook:{type:Object},vertical:{type:Boolean,default:!1},childFieldStrategy:{type:String,default:"checked"},clearable:Boolean,onChange:{}},emits:["update:value"],setup(e,{emit:r}){const{field:m}=g();const c=t({get(){return t=e.value,n(t)?t+"":t;var t},set(e){r("update:value",e)}}),{renderComplexOption:f}=v(e,c),{labelKey:k,valueKey:S,fullOptions:C}=e.urlConfig?h(e,c):b(e,c),{injectValueBindKey:F,injectValueValidate:O}=j();O(c);const x=F(c),B=o();return()=>a(i,{key:x.value,value:c.value,"onUpdate:value":e=>c.value=e,onClick:y(m)},{default:()=>[a(p,{vertical:e.vertical,"vertical-space":e.vertical},{default:()=>{var t;return[null==(t=C.value)?void 0:t.map((t=>{let o;return a(s,{key:t[S.value],value:t[S.value],disabled:t.disabled,onClick:()=>async function(t){if(null==B?void 0:B.disabled)return;if(i!==d||!e.clearable)return;const o=c.value;await u(0),o===t[S.value]&&(c.value=null)}(t)},"function"==typeof(r=o=f({value:c.value,option:t,valueKey:S.value,labelKey:k.value,childFieldStrategy:e.childFieldStrategy}))||"[object Object]"===Object.prototype.toString.call(r)&&!l(r)?o:{default:()=>[o]});var r}))]}})]})}})}const S=r(k("FormRadio",d,s),i({dataSource:"options"},f)),C=r(k("FormCheckbox",c,m),i({dataSource:"options"},f));export{C as CHECKBOX,S as RADIO};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as l,computed as a,inject as u,watch as
|
|
1
|
+
import{defineComponent as e,ref as l,computed as a,inject as u,watch as n,createVNode as o}from"vue";import{connect as t,mapProps as r}from"@formily/vue";import{HelpCircleSharp as i}from"@vicons/ionicons5";import{useVModel as s,useDebounceFn as v}from"@vueuse/core";import{isString as p,isArray as d,cloneDeep as m,isEqual as c}from"lodash-es";import{NSelect as f,NSpin as y,NEmpty as g,NTooltip as C,NIcon as h}from"naive-ui";import"../../../index.js";import{InjectionAsyncQueue as j,InjectionChangeContextCollector as F,InjectionFormItemDepsCollector as x}from"../../constants/index.js";import{createUrlConfigParams as b,formRenderLog as w}from"../../utils/index.js";import{useCommonInjection as K,useSelectOptionProps as S}from"../../hooks/useCommonInjection.js";import{assignUpdateValue as k,assignClearBindVisited as B,createVisitedSetter as L}from"../../utils/schema.js";import{useFormField as V}from"../../hooks/useFormField.js";const q=t(e({name:"FormRemoteSearch",props:{value:{type:String},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},allowCreate:Boolean,labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},urlConfig:{type:Object},onChange:{},useLoading:{type:Boolean,default:!0}},emits:["update:value"],setup(e,{slots:t,emit:r}){const k=s(e,"value",r),{field:B,fieldKey:q}=V(),A=l(null),I=a((()=>{var l,a,u;return null!=(u=null!=(a=null==(l=e.urlConfig)?void 0:l.nameKey)?a:e.labelField)?u:"text"})),O=a((()=>{var l,a,u;return null!=(u=null!=(a=null==(l=e.urlConfig)?void 0:l.valueKey)?a:e.valueField)?u:"value"})),P=u(j),U=l(""),D=l(!1),R=v((async(l="",a="label")=>{if(U.value=l,!e.urlConfig)return A.value=null;try{D.value=!0,A.value=[],A.value=await P.addAsync(await b({config:{...e.urlConfig,params:{...e.urlConfig.params,["value"===a?O.value:"keyword"]:l}},cache:e.requestCache,field:B.value}))}catch(e){p(e)&&w(e)}finally{D.value=!1}})),z=a((()=>d(A.value)?A.value:d(e.options)?e.options:[])),{injectValueValidate:E,injectValueBindKey:G}=K();E(k);const H=G(k);n(k,(e=>{if(e&&!z.value.find((l=>l[O.value]===e)))return R(e,"value")}));u(F).setContext(q.value,(e=>{return{currentOption:m((l=e,z.value.find((e=>e[O.value]===l))))};var l}));const J=u(x);n((()=>e.urlConfig),((e,l)=>{c(e,l)||(A.value=null,e&&(J.setDeps(q.value,e.dependKey||[],(async()=>{A.value=null,k.value=null})),k.value&&R(k.value,"value")))}),{immediate:!0});const{menuProps:M,nodeProps:N}=S(),Q=a((()=>z.value.length||!e.allowCreate?z.value:U.value?[{[I.value]:U.value,[O.value]:U.value},...z.value]:z.value));async function T(e){D.value=e,e&&R()}function W(e){const l=e.alias||e[I.value];if(!l||!p(l))return"";const a=l;return e.desc?o("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[a,e.desc?o(C,null,{trigger:()=>o(h,{component:i},null),default:()=>e.desc}):null]):a}return()=>o(f,{remote:!0,filterable:!0,key:H.value,value:k.value,"onUpdate:value":e=>k.value=e,labelField:I.value,valueField:O.value,"menu-props":M,"node-props":N,onSearch:R,"onUpdate:show":T,options:Q.value,onFocus:L(B),renderLabel:W},{empty:()=>e.useLoading&&D.value?o(y,null,null):o(g,{description:"无数据"},null),...t})}}),r(k,B));export{q as REMOTE_SEARCH};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as t,computed as a,inject as l,watch as r,createVNode as o,nextTick as n}from"vue";import{isEqual as u,isArray as i,isString as s}from"lodash-es";import"../../../index.js";import{useCommonInjection as c}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as p,InjectionFormUUID as d}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"date-fns";import{assignUpdateValue as
|
|
1
|
+
import{defineComponent as e,ref as t,computed as a,inject as l,watch as r,createVNode as o,nextTick as n}from"vue";import{isEqual as u,isArray as i,isString as s}from"lodash-es";import"../../../index.js";import{useCommonInjection as c}from"../../hooks/useCommonInjection.js";import{InjectionAsyncQueue as p,InjectionFormUUID as d}from"../../constants/index.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import{NCascader as m}from"naive-ui";import"date-fns";import{assignUpdateValue as v,createVisitedSetter as f,traverseDependKey as y}from"../../utils/schema.js";import{useFormField as h}from"../../hooks/useFormField.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import{connect as k,mapProps as j}from"@formily/vue";import"./index.js";import"../../hooks/useFormRenderOptions.js";const g=k(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},checkStrategy:{type:String,default:"child"},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:v,emit:k}){const j=t(),{field:g,title:b}=h(),S=t(1),C=t(!0);const w=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),F=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"})),A=a((()=>{try{const t=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");if(!Array.isArray(t)||!t.length)return null;const a=t.map((e=>e[F.value])).slice(-1).join(""),l=t.map((e=>e[w.value])).join(" / ");return a||l}catch(e){return null}}));function H(e,t,a){k("update:value",i(a)?a.map((function(e){return{...e,label:e[w.value],children:void 0,parent:void 0,mergeItemValue:void 0}})):null)}const q=l(p);async function x(t){e.filterable?await async function(){if(!e.urlConfig||j.value&&e.requestCache)return;const t=await q.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:b.value,cache:e.requestCache});function a(e,t,r){const o=[...r,...l(e)],n={[w.value]:e[w.value],[F.value]:e[F.value],depth:t+1,isLeaf:!0,keyword:e.keyword,mergeItemValue:o};return i(e.children)&&(n.children=e.children.map((e=>a(e,t+1,o))),n.isLeaf=!e.children.length),S.value=Math.max(S.value,t+1),n}function l(e){let t=[];if(s(e[w.value])&&(t=[...t,e[w.value]]),s(e.keyword)&&e.keyword.length>0){const a=e.keyword.split(",");t=[...t,...a]}return t}j.value=t.map((e=>a(e,0,[])))}():await async function(t){if(r(e,t))return;const a=await q.addAsync(o(s(t),i(e),b.value,t));if(!a.length&&t)return t.isLeaf=!0,H(0,0,n(t)),void(O.value=!1);const l=a.map((e=>u(e,s(t))));function r(e,t){return!i(e)||!t&&j.value&&e.requestCache||s(t)>=s(e)-1}function o(t,a,l,r){const o={lvlnr:t+1+""};return r&&a.dependKey&&y(a.dependKey,((e,t)=>{o[t]=r[e]})),{params:o,...a,key:l,cache:e.requestCache}}function n(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function u(a,l){return{[w.value]:a[w.value],[F.value]:a[F.value],depth:l+1,parent:t,isLeaf:l+2>=s(e)}}function i(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=l:j.value=l}(t),await B()}const V=`form-render__cascade--menu-${l(d)}`;async function B(){await n();const e=document.querySelector(`.${V} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function L(t,a){if(!t||!a)return!1;const{mergeItemValue:l}=a;if(e.checkStrategy.includes("child")&&a.depth<S.value)return!1;return l.length>0&&l.some((e=>e.includes(t.trim())))}const{injectValueValidate:K,injectValueWatchFromEmpty:I,injectValueBindKey:E}=c();I((()=>e.value),x),K((()=>e.value)),r((()=>e.urlConfig),(async(t,a)=>{u(t,a)||(j.value=null,C.value?e.lazyRequest||(x(),C.value=!C.value):await x())}),{immediate:!0});const O=t(!1);function R(e){O.value=!!e,e&&x()}const W=a((()=>j.value||e.options||[])),z=a((()=>!e.filterable)),N=E(A);return()=>o(m,{key:N.value,remote:z.value,filterable:e.filterable,"menu-props":{class:V,onClick:B},"check-strategy":e.checkStrategy,show:!!O.value,"onUpdate:show":R,value:A.value,filter:L,"onUpdate:value":H,labelField:w.value,valueField:F.value,options:W.value,onLoad:x,onFocus:f(g)},v)}}),j({dataSource:"options"},v));export{g as SEARCH_CASCADER};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as o,inject as t,useAttrs as l,ref as a,createVNode as r,mergeProps as n,toRaw as s}from"vue";import{arrayed as u}from"../../../../../shared/utils/index.js";import{cloneDeep as
|
|
1
|
+
import{defineComponent as e,computed as o,inject as t,useAttrs as l,ref as a,createVNode as r,mergeProps as n,toRaw as s}from"vue";import{arrayed as u}from"../../../../../shared/utils/index.js";import{HelpCircleSharp as i}from"@vicons/ionicons5";import{cloneDeep as p,isArray as m,isString as c,isObject as d,omit as v}from"lodash-es";import{useCommonInjection as f,useSelectOptionProps as y}from"../../hooks/useCommonInjection.js";import{useComplexOptions as h,useComplexOptionsSpan as j}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as b,InjectionFormUUID as S}from"../../constants/index.js";import"../../../index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import{NSelect as g,NTooltip as k,NIcon as C}from"naive-ui";import"date-fns";import{assignUpdateValue as F,assignClearBindVisited as x,createVisitedSetter as B}from"../../utils/schema.js";import{useFormField as O}from"../../hooks/useFormField.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"../../hooks/useFormValidator.js";import{connect as A,mapProps as H}from"@formily/vue";import"./index.js";import{useUrlConfigOptions as w,useAutographOptions as L,useRecommendOptions as K,searchContentMatcher as P}from"../../hooks/useFormRenderOptions.js";const R=A(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},allowCreate:Boolean,shouldSave:Boolean,urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1},useLoading:{type:Boolean,default:!0}},emits:["update:value","postRecommend"],setup(e,{slots:F,emit:x}){const A=o({get:()=>e.value,async set(e){x("update:value",e),D(e)}}),{labelKey:H,valueKey:R,fetchData:V,searchContent:_,fullOptions:I,filterOptions:N,remoteOptions:W,loading:q}=e.urlConfig?w(e,A):L(e,A),{renderComplexOption:E,hasComplexOption:U}=h(e,A),{getRecommend:z,postRecommend:D,sortedOptions:G}=K(e,N,x,H,R),{field:J,fieldKey:M}=O();t(b).setContext(M.value,(e=>({currentOption:p(function(e){const o=te(I.value);return m(e)?function(e){const t=o.reduce(((e,o)=>(e[o[R.value]]=o,e)),{});return e.map((e=>t[e]))}(e):(t=e,o.find((e=>e[R.value]===t)));var t}(e))})));const Q=async(e="")=>(_.value=e,Promise.allSettled([V(e),z(e)])),{injectValueValidate:T,injectValueWatchFromEmpty:X,injectValueBindKey:Y}=f();X(A,Q),T(A);const Z=Y(A),{menuProps:$,nodeProps:ee}=y();function oe(e){const o=e.alias||e[H.value];if(!o||!c(o))return"";const t=_.value?P(_.value,o):null,l=t?r("section",null,[t.map(((e,o)=>0!==o&&e?r("span",{style:{color:o%2==0?"var(--n-option-text-color-active)":""}},[e]):null))]):o;return e.desc?r("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[l,e.desc?r(k,null,{trigger:()=>r(C,{component:i},null),default:()=>e.desc}):null]):l}function te(o){return e.allowCreate&&_.value&&!o.some((e=>e[H.value]===_.value))?[...o,{[H.value]:_.value,[R.value]:_.value,created:!0,shouldSave:e.shouldSave}]:o}const le=o((()=>te(G.value))),ae=l(),re=o((()=>{if(e.allowCreate)return A.value;const o=ae.multiple&&m(A.value);return I.value.find((e=>o?A.value.includes(e[R.value]):e[R.value]===A.value))?A.value:null})),ne=a(!1);async function se(e){e&&await Q(),ne.value=e}function ue(e,o){A.value=e,W.value&&o&&u(o).forEach((e=>{if(!d(e))return;const o=e;o.created&&o.shouldSave&&W.value.push(v(s(o),["created","shouldSave"]))}))}const ie=t(S),{getSpan:pe}=j();function me(e){return r(g,n({key:Z.value,remote:!0,filterable:!0,loading:q.value,value:re.value,onUpdateValue:ue,"menu-props":$,"node-props":ee,labelField:H.value,valueField:R.value,options:le.value,onSearch:Q,show:ne.value,"onUpdate:show":se,onFocus:B(J),renderLabel:oe},e,ae),F)}return()=>{var e,o;if(!U.value)return me();const t=null!=(o=null==(e=J.value.decoratorProps)?void 0:e.span)?o:6,l=pe(ie,J.value.address);return r("section",{class:"form-render__selectChildField",style:{"--column":l+t}},[me({class:"form-render__selectChildFieldItem",style:{"--form-item-column":t}}),I.value.map((e=>E({option:e,value:A.value,valueKey:R.value,labelKey:H.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":l}}})))])}}}),H({dataSource:"options"},F,x));export{R as SELECT};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as r,createVNode as o,createTextVNode as i}from"vue";import{NSwitch as t}from"naive-ui";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"../../../index.js";import"date-fns";import{assignUpdateValue as n,assignValueBindKey as l}from"../../utils/schema.js";import{connect as u,mapProps as
|
|
1
|
+
import{defineComponent as e,computed as r,createVNode as o,createTextVNode as i}from"vue";import{NSwitch as t}from"naive-ui";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"../../../index.js";import"date-fns";import{assignUpdateValue as n,assignValueBindKey as l}from"../../utils/schema.js";import{connect as u,mapProps as c}from"@formily/vue";const p=u(e({name:"FormSwitch",props:{openDescription:{type:Object},closeDescription:{type:Object},onChange:{}},setup:e=>()=>{const n=r((()=>{var r,o;return null==(o=null==(r=e.openDescription)?void 0:r.value)||o})),l=r((()=>{var r,o;return null!=(o=null==(r=e.closeDescription)?void 0:r.value)&&o}));return o(t,{checkedValue:n.value,uncheckedValue:l.value},{checked:()=>{var r,o;return i(null!=(o=null==(r=e.openDescription)?void 0:r.describe)?o:"")},unchecked:()=>{var r,o;return i(null!=(o=null==(r=e.closeDescription)?void 0:r.describe)?o:"")}})}}),c(n,l));export{p as SWITCH};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as
|
|
1
|
+
import{defineComponent as e,computed as o,createVNode as t}from"vue";import{useCommonInjection as r}from"../../hooks/useCommonInjection.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"lodash-es";import{NInput as i}from"naive-ui";import"../../../index.js";import"date-fns";import{assignUpdateValue as m,assignClearBindVisited as a}from"../../utils/schema.js";import{connect as p,mapProps as u}from"@formily/vue";const s=p(e({name:"FormTextarea",props:{value:{type:String}},emits:["update:value"],setup(e,{emit:m}){const a=o({get:()=>e.value,set:e=>m("update:value",e)}),p=r().injectValueBindKey(a);return()=>t(i,{type:"textarea",key:p.value,value:a.value,"onUpdate:value":e=>a.value=e},null)}}),u(m,a));export{s as TEXTAREA};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{doAnimation as e}from"../../../../shared/utils/anime.js";import{useDebounceFn as
|
|
1
|
+
import{doAnimation as e}from"../../../../shared/utils/anime.js";import{useDebounceFn as o,watchOnce as t}from"@vueuse/core";import{ref as r,computed as n,nextTick as i}from"vue";import{FormItemLineBarDepKeyPrepend as l}from"../constants/index.js";import"../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"lodash-es";import"naive-ui";import"../../index.js";import"date-fns";import{createLinebarId as a}from"../utils/schema.js";function s(s,u,c,m){const v=r(),p=r(""),f=r([]),d=async function(e){var o;f.value=Object.values(e.fields).reduce(((e,o)=>{var t,r;return"LINEBAR"===o.componentType&&"visible"===o.selfDisplay&&e.push({title:null!=(r=null==(t=o.componentProps)?void 0:t.title)?r:o.title,name:o.address.toString()}),e}),[]),await i(),null==(o=v.value)||o.syncBarPosition()};let h=!1;async function y(o){h=!0;try{if(!c.value)return;m.trigger(l+o,!0),await i();const t=c.value.querySelector(`#${a(o)}`);if(!t)return;await new Promise((o=>{e(c.value.scrollTop,t.offsetTop,300,(e=>{var o;null==(o=c.value)||o.scrollTo({top:e})}),"easeInSine",(()=>setTimeout(o,300)))}))}finally{h=!1}}const T=o((function(e){var o;if(h||!c.value)return;const{scrollTop:t,clientHeight:r}=c.value,n=f.value.find(((e,o,n)=>{const i=n[o+1];if(!i)return!0;const l=c.value.querySelector(`#${a(i.name)}`);return l?l.offsetTop>t+r/2:void 0}))||f.value[f.value.length-1];p.value=null!=(o=null==n?void 0:n.name)?o:"",u("scroll",e)}),300);t(f,(e=>{var o,t;p.value=null!=(t=null==(o=e[0])?void 0:o.name)?t:""}));return{currentAnchor:n({get:()=>p.value,async set(e){p.value=e,await new Promise((e=>setTimeout(e,100))),await y(e)}}),onScroll:T,anchorIdList:f,generateAnchorList:d,updateAnchorList:function(e){"LINEBAR"===e.componentType&&e.selfDisplay&&d(e.form)},scrollTo:y,anchorBarRef:v}}export{s as useAnchor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isField as e}from"@formily/core";import{isString as t}from"@vueuse/core";import{format as s}from"date-fns";import{isFunction as i,isNumber as r}from"lodash-es";import{FIELD_BUSINESS_TYPE as n}from"../constants/index.js";import"vue";import"../../../../shared/utils/index.js";import"@formily/path";import"@vue/shared";import"../../index.js";import{isIdCard as a,parseIdCard as l,parseAgeFromContext as o,parseBirthday as u,parseAge2Birthday as h}from"../utils/business.js";class y{constructor(e){this.businessFormatter=e,this.triggerLock=!1,this.typeLockMap=new Map,this.typeCollector=new Map,this.fieldNameCollector=new Map,this.changeHandlerMap=new Map([])}formatter(...e){return i(this.businessFormatter)?this.businessFormatter(...e):e[0].value}collect(e,t){this.typeCollector.set(e,t),this.fieldNameCollector.set(t.val_key,e)}getField(e){return this.typeCollector.get(e)}getFieldInstanceByType(e,t){const s=this.getField(t);return s?e.query(s.val_key).take():null}getType(e){return this.fieldNameCollector.get(e)}getValueByField(t,s){const i=t.query(s).take();return e(i)?i.value:null}getValueByType(e,t){const s=this.getField(t);return s?this.getValueByField(e,s.val_key):null}setValueByType(e,t,s,i){const n=this.getField(t);n&&e.setFieldState(n.val_key,(e=>{if(e.value===s)return;const a=this.typeLockMap.get(t);this.typeLockMap.set(t,r(a)?a+1:1),e.value=this.formatter({value:s,type:t,fieldKey:n.val_key,from:i})}))}registerChangeBusiness(e,t){return this.changeHandlerMap.set(e,t),this}trigger(e,t,s="change"){var i;if(this.triggerLock)return;const r=this.getType(t);if(!r)return;if("change"===s&&this.typeLockMap.get(r)>0)return this.typeLockMap.set(r,this.typeLockMap.get(r)-1);const n="change"===s?this.changeHandlerMap:null;n&&(null==(i=n.get(r))||i.call(this,e))}}function c(){function e(){var e;const t=this.getField(n.BIRTHDAY);return null!=(e=null==t?void 0:t.date_format)?e:"yyyy-MM-dd HH:mm"}function i(i){const r=this.getValueByType(i,n.ID_CARD);if(!r||!t(r)||!a(r))return;const u=l(r),{age:h,ageUnit:y}=o(u);this.setValueByType(i,n.AGE_UNIT,y,n.ID_CARD),this.setValueByType(i,n.AGE,h,n.ID_CARD),this.setValueByType(i,n.SEX,u.sex,n.ID_CARD),this.setValueByType(i,n.BIRTHDAY,s(new Date(u.birthday),e.call(this)),n.ID_CARD)}function c(e){const s=this.getValueByType(e,n.BIRTHDAY);if(!t(s))return;const{age:i,ageUnit:r}=o(u(s));this.setValueByType(e,n.AGE_UNIT,r,n.BIRTHDAY),this.setValueByType(e,n.AGE,i,n.BIRTHDAY)}function p(s){return function(i){const a=this.getValueByType(i,n.AGE),l=this.getValueByType(i,n.AGE_UNIT);(t(a)||r(a))&&""!==a&&t(l)&&""!==l&&this.setValueByType(i,n.BIRTHDAY,h(+a,l,e.call(this)),s)}}return{create:function(e){return new y(e).registerChangeBusiness(n.ID_CARD,i).registerChangeBusiness(n.AGE_UNIT,p(n.AGE_UNIT)).registerChangeBusiness(n.AGE,p(n.AGE)).registerChangeBusiness(n.BIRTHDAY,c)}}}export{y as BusinessCollector,c as useBusinessBinding};
|
|
1
|
+
import{isField as e}from"@formily/core";import{isString as t}from"@vueuse/core";import{format as s}from"date-fns";import{isFunction as i,isNumber as r}from"lodash-es";import{FIELD_BUSINESS_TYPE as n}from"../constants/index.js";import"vue";import"../../../../shared/utils/index.js";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"naive-ui";import"../../index.js";import{isIdCard as a,parseIdCard as l,parseAgeFromContext as o,parseBirthday as u,parseAge2Birthday as h}from"../utils/business.js";class y{constructor(e){this.businessFormatter=e,this.triggerLock=!1,this.typeLockMap=new Map,this.typeCollector=new Map,this.fieldNameCollector=new Map,this.changeHandlerMap=new Map([])}formatter(...e){return i(this.businessFormatter)?this.businessFormatter(...e):e[0].value}collect(e,t){this.typeCollector.set(e,t),this.fieldNameCollector.set(t.val_key,e)}getField(e){return this.typeCollector.get(e)}getFieldInstanceByType(e,t){const s=this.getField(t);return s?e.query(s.val_key).take():null}getType(e){return this.fieldNameCollector.get(e)}getValueByField(t,s){const i=t.query(s).take();return e(i)?i.value:null}getValueByType(e,t){const s=this.getField(t);return s?this.getValueByField(e,s.val_key):null}setValueByType(e,t,s,i){const n=this.getField(t);n&&e.setFieldState(n.val_key,(e=>{if(e.value===s)return;const a=this.typeLockMap.get(t);this.typeLockMap.set(t,r(a)?a+1:1),e.value=this.formatter({value:s,type:t,fieldKey:n.val_key,from:i})}))}registerChangeBusiness(e,t){return this.changeHandlerMap.set(e,t),this}trigger(e,t,s="change"){var i;if(this.triggerLock)return;const r=this.getType(t);if(!r)return;if("change"===s&&this.typeLockMap.get(r)>0)return this.typeLockMap.set(r,this.typeLockMap.get(r)-1);const n="change"===s?this.changeHandlerMap:null;n&&(null==(i=n.get(r))||i.call(this,e))}}function c(){function e(){var e;const t=this.getField(n.BIRTHDAY);return null!=(e=null==t?void 0:t.date_format)?e:"yyyy-MM-dd HH:mm"}function i(i){const r=this.getValueByType(i,n.ID_CARD);if(!r||!t(r)||!a(r))return;const u=l(r),{age:h,ageUnit:y}=o(u);this.setValueByType(i,n.AGE_UNIT,y,n.ID_CARD),this.setValueByType(i,n.AGE,h,n.ID_CARD),this.setValueByType(i,n.SEX,u.sex,n.ID_CARD),this.setValueByType(i,n.BIRTHDAY,s(new Date(u.birthday),e.call(this)),n.ID_CARD)}function c(e){const s=this.getValueByType(e,n.BIRTHDAY);if(!t(s))return;const{age:i,ageUnit:r}=o(u(s));this.setValueByType(e,n.AGE_UNIT,r,n.BIRTHDAY),this.setValueByType(e,n.AGE,i,n.BIRTHDAY)}function p(s){return function(i){const a=this.getValueByType(i,n.AGE),l=this.getValueByType(i,n.AGE_UNIT);(t(a)||r(a))&&""!==a&&t(l)&&""!==l&&this.setValueByType(i,n.BIRTHDAY,h(+a,l,e.call(this)),s)}}return{create:function(e){return new y(e).registerChangeBusiness(n.ID_CARD,i).registerChangeBusiness(n.AGE_UNIT,p(n.AGE_UNIT)).registerChangeBusiness(n.AGE,p(n.AGE)).registerChangeBusiness(n.BIRTHDAY,c)}}}export{y as BusinessCollector,c as useBusinessBinding};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,computed as t,createVNode as r,mergeProps as n,defineComponent as l,inject as o,provide as
|
|
1
|
+
import{reactive as e,computed as t,createVNode as r,mergeProps as n,defineComponent as l,inject as o,provide as i,watch as s,onUnmounted as a,onMounted as c,withModifiers as u}from"vue";import{checkInSetupEnv as d}from"../../../../shared/utils/index.js";import{useField as p,useForm as m,RecursionField as f}from"@formily/vue";import{isArray as v,noop as h}from"lodash-es";import"../../index.js";import{InjectionFormUUID as y,InjectionBusinessCollector as g}from"../constants/index.js";import{renderDescOption as b}from"../utils/index.js";import{useFieldListAdaptor as F}from"./useFieldListAdaptor.js";import{createObjSchema as x}from"../utils/schema.js";const j=e(new Map);function S(e,t,r=0){j.set(e,j.get(e)||{});j.get(e)[t+""]=r}function O(e,t,r=!0){const n=j.get(e);return n?Object.entries(n).reduce(((e,[n,l])=>r&&n===`${t}`||n.startsWith(`${t}.`)?e+l:e),0):0}function $(e,t){const r=j.get(e);r&&Reflect.deleteProperty(r,t+"")}function k(e){j.delete(e)}const E=l({props:{fieldItems:{type:Array,default:()=>[]},childFieldStrategy:{type:String,default:"checked"},name:{type:String,required:!0}},setup(e){const l=o(y),d=o(g),v=p(),b=o(l+"_virtualParent",""),j=`${b?b+".":""}${v.value.address}`;function k(e){return`${j}.${e}`}i(l+"_virtualParent",j);const{schemaAdaptor:E}=F(d);function K(t){var r,n;return Object.assign(t,{"x-decorator-props":{...t["x-decorator-props"],labelPlacement:"left",showFeedback:!1},"x-component-props":{...t["x-component-props"],childFieldStrategy:null!=(n=null==(r=t["x-component-props"])?void 0:r.childFieldStrategy)?n:e.childFieldStrategy,size:"small"}})}const P=t((()=>{const t=E(e.fieldItems);return Object.values(t).forEach(K),x(t)}));s(P,(()=>{return e=P.value,void Object.values(e.properties||{}).forEach((e=>{var t;S(l,k(e.name),null==(t=null==e?void 0:e["x-decorator-props"])?void 0:t.span)}));var e}),{immediate:!0});const _=m();function I(){return e.fieldItems.map((e=>_.value.query(e.val_key).take()))}a((()=>{var e;I().forEach((e=>{e&&e.setDisplay("none")})),e=P.value,Object.values(e.properties||{}).forEach((e=>{$(l,k(e.name))}))})),c((()=>{I().forEach((e=>{e&&e.setDisplay("visible")}))}));const w=u(h,["stop"]),A=["onClick","onKeydown","onKeyup","onKeypress"].reduce(((e,t)=>(e[t]=w,e)),{});return()=>{return r("section",n({class:"form-render__labelField",style:{"--column":(e=P.value,Object.values(e.properties||{}).reduce(((e,t)=>e+O(l,k(t.name))),0))}},A),[r(f,{basePath:".",schema:P.value},null)]);var e}}});function K(e,l){d();const o=t((()=>e.options.some((e=>v(e.childrenFields)&&e.childrenFields.length))));function i(e,t,r="value"){if(v(e)?e.includes(t[r]):e===t[r])return v(t.childrenFields)&&t.childrenFields.length}return{renderComplexOption:function({value:e,option:t,valueKey:l="value",labelKey:s="label",childFieldStrategy:a,renderLabel:c=!0,attrs:u}){return[c?t.desc?b(t[s],t):t[s]:null,o.value&&("all"===a||i(e,t,l))?r(E,n({fieldItems:t.childrenFields,name:t[l],childFieldStrategy:a},u),null):null]},valueRef:l,hasComplexOption:o}}function P(){return{getSpan:O,setSpan:S,deleteSpan:$,clearSpan:k}}export{K as useComplexOptions,P as useComplexOptionsSpan};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isFunction as t}from"lodash-es";import"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"../../index.js";import"date-fns";import{traverseDependKey as e}from"../utils/schema.js";class r{constructor(){this.triggerDisabled=!1,this.collector=new Map}setDeps(t,r,
|
|
1
|
+
import{isFunction as t}from"lodash-es";import"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"naive-ui";import"../../index.js";import"date-fns";import{traverseDependKey as e}from"../utils/schema.js";class r{constructor(){this.triggerDisabled=!1,this.collector=new Map}setDeps(t,r,i){e(r,(e=>{const r=this.collector.get(e)||new Map;r.set(t,i),this.collector.set(e,r)}))}getDeps(t){return this.collector.get(t)}trigger(e,r){var i;this.triggerDisabled||null==(i=this.getDeps(e))||i.forEach((e=>t(e)&&e(r)))}}function i(){return{create:function(){return new r}}}export{r as FormItemDepsCollector,i as useFormItemDeps};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{arrayed as e}from"../../../../shared/utils/index.js";import{once as a,isNumber as
|
|
1
|
+
import{arrayed as e}from"../../../../shared/utils/index.js";import{once as a,isNumber as i,isString as m}from"lodash-es";import"vue";import{registerValidateLocale as r,registerValidateRules as s}from"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import{isFunction as l}from"@vueuse/core";import"naive-ui";import"../../index.js";import{isIdCard as n}from"../utils/business.js";function o(){const a=new Map([["mobile",({validate:e})=>({format:"phone",message:null==e?void 0:e.message})],["integer",({validate:e})=>({format:"integer",message:null==e?void 0:e.message})],["number",({validate:e})=>({format:"number",message:null==e?void 0:e.message})],["id_card",({validate:e})=>({validator(a){var i;if(null!=a&&""!==a)return m(a)&&n(a)?void 0:null!=(i=null==e?void 0:e.message)?i:"该字段不是合法的身份证格式"}})],["regular",({validate:e,regular_expression:a,regular_error_tip:i})=>({pattern:a||(null==e?void 0:e.regular_expression)||"",message:i||(null==e?void 0:e.regular_error_tip)||(null==e?void 0:e.message)||"格式错误"})]]),i={triggerType:"onBlur"};return{createValidatorSchema:function(m){const r=[],{validate:{vali_obj:s,max_length:n,min_length:o,message:u,max_value:t,min_value:g,decimal_length:d}={},validator:v}=m;if(v&&e(v).forEach((e=>{l(e)&&r.push({validator:a=>e(a,m)})})),n&&r.push({max:n,message:u}),o&&r.push({min:o,message:u}),t&&r.push({maximum:t,message:u}),g&&r.push({minimum:g,message:u}),null!=d&&r.push(((e,a)=>{const i=null!=a?a:`小数位数最多${e}位`;return{validator(a){var m;return(null==(m=String(a).split(".")[1])?void 0:m.length)>e?i:""}}})(+d,u)),s){const e=a.get(s)||(({validate:e})=>({format:s,message:null==e?void 0:e.message}));r.push(Object.assign({},i,e(m)))}return r}}}const u=a((()=>{r({"zh-CN":{required:"${alias||name}为必填"}}),s({maximum:(e,a)=>i(Number(a.maximum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?a.message||"":e>Number(a.maximum)&&a.message||""):"",minimum:(e,a)=>i(Number(a.minimum))&&null!=e&&""!==e&&"/"!==e?(m(e)&&(e=+e),!i(e)||isNaN(e)?a.message||"":e<Number(a.minimum)&&a.message||""):""})}));export{o as useFormValidator,u as validateMessageLocale};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isString as i}from"lodash-es";import"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vue/shared";import"@vueuse/core";import"../../index.js";import{isIdCard as
|
|
1
|
+
import{isString as i}from"lodash-es";import"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"naive-ui";import"../../index.js";import{isIdCard as o,isMobile as r}from"../utils/business.js";function s(){return{isIdCard:r=>i(r)&&o(r),isMobile:o=>i(o)&&r(o),isEmail:o=>i(o)&&/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(o),isNumber:o=>i(o)&&/\d+/.test(o)}}export{s as usePresetScope};
|
|
@@ -33,3 +33,4 @@ export declare function createUrlConfigParams({ config, field, cache }: {
|
|
|
33
33
|
valueKey?: string | undefined;
|
|
34
34
|
dependKey?: import("../../../../../es/components/form-render").DependKeyType | undefined;
|
|
35
35
|
}>;
|
|
36
|
+
export declare function renderDescOption(labelNode: any, desc: AnyObject): JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{inject as e,provide as t,computed as
|
|
1
|
+
import{inject as e,provide as t,computed as n,createVNode as r,Fragment as o}from"vue";import{arrayed as i}from"../../../../shared/utils/index.js";import{isGeneralField as c,isField as u}from"@formily/core";import{Path as s}from"@formily/path";import{HelpCircleSharp as f}from"@vicons/ionicons5";import{isObject as a}from"@vue/shared";import{useMemoize as l}from"@vueuse/core";import{isString as p,isFunction as m,omit as d}from"lodash-es";import{NTooltip as h,NIcon as y}from"naive-ui";import"../../index.js";import{NESTED_FORM_ITEM_TYPE as x}from"../constants/index.js";import"date-fns";import{traverseDependKey as g}from"./schema.js";export{assignClearBindVisited,assignUpdateValue,assignValueBindKey,createLinebarId,createObjSchema,createVisitedSetter,dotEscape,fieldKeyEscape,getParentLinebar,traverseDependKey,traverseSchema}from"./schema.js";function v(e){console.warn(`[FormRender]: ${e}`)}function j(e,t,n=["children","properties","suffixConfig"],r="val_key",o="default_val"){return function e(t,r){r.forEach((r=>{a(r)&&(null!=u(r)&&null==t[c(r)]&&s.setIn(t,c(r),u(r)),n.forEach((n=>{r[n]&&(t[c(r)]||(t[c(r)]={}),e(t[c(r)],i(r[n])))})))}))}(e,t),e;function c(e){return e[r]}function u(e){return e[o]}}function S(n,r){let o=e(n,null);return o||(o=r(),t(n,o)),o}function E(e){return p(e)?+e:e}function b(e,t,n){if(a(e)&&!m(e)){const n={};return Object.entries(e).forEach((([e,r])=>{m(r)&&(n[e]=()=>r(t))})),n}return{default:()=>m(e)?e(t):n?n(e):[e]}}function K(e,t){return n((()=>{const n={};return e.prefix&&(n.prefix=()=>r(o,null,[b(e.prefix,e,t).default()])),e.suffix&&(n.suffix=()=>r(o,null,[b(e.suffix,e,t).default()])),n}))}function w(e){if(!a(e))throw e;return t=e,Reflect.has(t,"map")&&Reflect.has(t,"result")?function(e){const{result:t,map:n}=e;if("SUCCESS"!==t)throw e;return n.rows}(e):function(e){return Reflect.has(e,"result")&&Reflect.has(e,"obj")}(e)?function(e){const{obj:t,result:n}=e;if("SUCCESS"!==n||!a(t))throw e;return Object.entries(t).reduce(((e,[t,n])=>(n.forEach((n=>e.push({...n,type:t}))),e)),[])}(e):function(e){return Reflect.has(e,"data")&&Reflect.has(e,"success")}(e)?function(e){const{data:t,success:n}=e;if(!n)throw e;return t}(e):[];var t}function R(e,t){return p(e)&&e?e.replace(/\$\{([^}]*)}/g,(function(e,n){const r=n.split("||");for(const e of r){const n=t[e.trim()];if(n)return n}return""})):""}function O(e){return e.reduce(((e,t)=>(p(t.extendKey)&&t.extendKey&&e.push(t),V(t)&&e.push(...O(t.children||[])),e)),[])}function k(e,t){const n=O(e);if(!n.length)return t;const r={},o=new Map;return Object.entries(t).forEach((([e,i])=>{const c=n.find((t=>t.val_key===e));if(!c)return r[e]=i;const{val_key:u,extendKey:s}=c,f=o.get(s)||{};o.set(s,f),f[u]=t[u]})),[...o.entries()].forEach((([e,t])=>{r[e]=JSON.stringify(t)})),r}function C(e,t){const n=O(e);if(!n.length)return t;const r=l((e=>{try{return a(t[e])?t[e]:JSON.parse(t[e])||{}}catch(e){return{}}})),o=d(t,n.map((e=>e.extendKey)));return n.forEach((({val_key:e,extendKey:t})=>{Reflect.has(o,e)||(o[e]=r(t)[e])})),o}function _(e){return e&&x.includes(e)}function V(e){return _(c(e)?e.componentType:e.html_type)}async function I({config:e,field:t,cache:n}){const r={},o=t.props.name.toString();try{g(e.dependKey||[],((e,n,o)=>{const i=t.query(e).take();if(!u(i)||o&&null==i.value)throw`缺少必须的参数=>${e}`;r[n]=i.value}))}catch(e){return Promise.reject(e)}return{...e,params:Object.assign({},e.params,r),key:o,cache:n}}function U(e,t){return r("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[e,t?r(h,null,{trigger:()=>r(y,{component:f},null),default:()=>t}):null])}export{k as combineExtendKey,K as createInputSlot,b as createSlot,I as createUrlConfigParams,v as formRenderLog,S as injectOrProvide,V as isNestedFieldType,_ as isNestedType,j as mergeDeepProperties,E as parseNumberFromMaybeString,w as presetRequestHandler,U as renderDescOption,C as splitExtendKey,R as validateMessageParser};
|
package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVNode as e,mergeProps as l,defineComponent as r,computed as o}from"vue";import{isNumber as
|
|
1
|
+
import{createVNode as e,mergeProps as l,defineComponent as r,computed as o}from"vue";import n from"../../../../../../shared/components/InputNumberSlash/InputNumberSlash.js";import{isNumber as a}from"lodash-es";import{NInputNumber as t}from"naive-ui";import"../../../../index.js";import{EDITABLE_WIDGET_TYPE as u}from"../../../constants/index.js";import{IhoTableRenderHelper as m}from"../../../utils/index.js";import{defineTablePlugin as i}from"../../../hooks/useTablePlugin.js";const s=r({name:"IhoTableInputNumber",props:{value:[String,Number]},emits:["update:value"],setup(l,{emit:r}){const n=o({get:()=>a(l.value)?l.value:l.value&&a(+l.value)?+l.value:null,set(e){r("update:value",e)}});return()=>e(t,{value:n.value,"onUpdate:value":e=>n.value=e},null)}});function d(){return i({name:"numberRendererPlugin",vxe(r){r.renderer.add(u.NUMBER,{renderCell:m.createDefaultRenderCell(),renderEdit:m.createRenderEdit((({row:r,column:o,fieldItem:a,emitFormClick:t,emitFormChangeWithParams:u})=>{const{placeholder:m="请输入"}=a.componentProps||{},i={clearable:!0,placeholder:m,onBlur:()=>u({type:"blur",oldValue:r[o.field]}),[a.allowSlash?"onChange":"onUpdateValue"]:e=>{const l=r[o.field];r[o.field]=e,u({oldValue:l})},onClick:t};return a.allowSlash?e(n,l({value:r[o.field]},i,a.componentProps),null):e(s,l({value:r[o.field]},i,a.componentProps),null)}))})}})}export{d as numberRendererPlugin};
|
|
@@ -44,6 +44,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
44
44
|
aliasField: {
|
|
45
45
|
type: StringConstructor;
|
|
46
46
|
};
|
|
47
|
+
menuProps: {
|
|
48
|
+
type: PropType<AnyObject>;
|
|
49
|
+
};
|
|
47
50
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
48
51
|
value: {
|
|
49
52
|
type: PropType<string | number | (string | number)[]>;
|
|
@@ -86,6 +89,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
86
89
|
aliasField: {
|
|
87
90
|
type: StringConstructor;
|
|
88
91
|
};
|
|
92
|
+
menuProps: {
|
|
93
|
+
type: PropType<AnyObject>;
|
|
94
|
+
};
|
|
89
95
|
}>> & {
|
|
90
96
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
91
97
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as l,ref as o,computed as t,createVNode as
|
|
1
|
+
import{defineComponent as e,inject as l,ref as o,computed as t,createVNode as n,toRaw as a,Fragment as u}from"vue";import{keywordMatcher as r,arrayed as i}from"../../../../../../../shared/utils/index.js";import{NSelect as s,NTooltip as d,NIcon as p,NTag as c}from"naive-ui";import{HelpCircleSharp as v}from"@vicons/ionicons5";import{InjectionIhoTableUUID as m}from"../../../../constants/index.js";import{selectOptionsMap as f}from"../hooks/useSelectOption.js";import{useIhoTableFormEvent as h}from"../../../../utils/index.js";import{useDebounceFn as y}from"@vueuse/core";import{isEmpty as b,isFunction as w,isArray as S,isObject as g,omit as O}from"lodash-es";var x=e({name:"EditSelect",props:{value:{type:[Array,String,Number]},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0},options:{type:Array,default:()=>[]},queryOptions:{type:Function},placeholder:{type:String,default:"请选择"},allowCreate:{type:Boolean,default:!1},shouldSave:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},aliasField:{type:String},menuProps:{type:Object}},emits:["update:value"],setup(e,{emit:x}){const j=l("$xetable"),P=o(null);function q(e){P.value=e}const _=o(!1),{emitFormChangeWithParams:k}=h({...e,$table:j}),C=o("");function F(){return B()}const W=o([]),M=t((()=>{let l=b(W.value)?e.options:W.value;return C.value?(l=l.filter((e=>e.label&&e.label.includes(C.value)||r(C.value,e.keyword))),!e.allowCreate||l.some((e=>e.label===C.value))?l:[...l,{label:C.value,value:C.value,created:!0,shouldSave:e.shouldSave}]):l})),$=o(!1),B=y((async function(l=""){C.value=l;try{if($.value=!0,!w(e.queryOptions)||!b(e.options))return;W.value=await e.queryOptions({keyword:l,row:e.row,column:e.column,rowIndex:e.rowIndex})}catch(l){console.log(`获取${e.column.field}options错误`)}finally{$.value=!1}}),400),E=l(m);function I(l,o){const t=e.value;x("update:value",l);const n=f.get(E);n&&S(n[e.column.field])&&i(o).forEach((l=>{if(!g(l))return;const o=l;o.created&&o.shouldSave&&n[e.column.field].push(O(a(o),["created","shouldSave"]))})),k({oldValue:t,option:o})}function U(e){var l,o;"Tab"===e.key&&P.value&&(null==(o=(l=P.value).handleKeydown)||o.call(l,{...e,key:"Enter",preventDefault:e.preventDefault.bind(e)}))}function A({node:e,option:l}){return l.desc?n("div",{class:"iho-table__selectOptionWrapper"},[[e,n(d,null,{trigger:()=>n(p,{component:v},null),default:()=>l.desc})]]):e}function D({option:l,handleClose:o}){var t;const a=null!=(t=e.aliasField&&l[e.aliasField])?t:l.label;return S(e.value)?n(c,{closable:!0,onClose:e=>{e.stopPropagation(),o()}},{default:()=>a}):n(u,null,[a])}const K=()=>({class:"iho-table__selectOption"}),N=t((()=>{var l,o;return{...e.menuProps,class:`iho-table__selectMenu ${null!=(o=null==(l=e.menuProps)?void 0:l.class)?o:""}`}}));return()=>n(s,{ref:q,show:_.value,"onUpdate:show":e=>_.value=e,consistentMenuWidth:e.consistentMenuWidth,placeholder:e.placeholder,loading:$.value,options:M.value,value:e.value,remote:!0,onSearch:B,clearable:!0,filterable:!0,nodeProps:K,menuProps:N.value,renderTag:D,renderOption:A,onUpdateShow:F,onUpdateValue:I,onKeydown:U},null)}});export{x as default};
|