cnhis-design-vue 3.1.49-beta.7 → 3.1.49-beta.8

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.
Files changed (66) hide show
  1. package/README.md +87 -87
  2. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  3. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  4. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  5. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  6. package/es/components/expand-field/index.d.ts +1630 -0
  7. package/es/components/expand-field/index.js +1 -0
  8. package/es/components/expand-field/src/components/FormBatchOptionsModal.vue.d.ts +54 -0
  9. package/es/components/expand-field/src/components/FormBatchOptionsModal.vue.js +1 -0
  10. package/es/components/expand-field/src/components/FormBatchOptionsModal.vue2.js +1 -0
  11. package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +841 -0
  12. package/es/components/expand-field/src/components/FormItemPerson.vue.js +1 -0
  13. package/es/components/expand-field/src/components/FormItemPerson.vue2.js +1 -0
  14. package/es/components/expand-field/src/components/PersonModal.vue.d.ts +777 -0
  15. package/es/components/expand-field/src/components/PersonModal.vue.js +1 -0
  16. package/es/components/expand-field/src/components/PersonModal.vue2.js +1 -0
  17. package/es/components/expand-field/src/components/form.vue.d.ts +1502 -0
  18. package/es/components/expand-field/src/components/form.vue.js +1 -0
  19. package/es/components/expand-field/src/components/form.vue2.js +1 -0
  20. package/es/components/expand-field/src/constants/index.d.ts +3 -0
  21. package/es/components/expand-field/src/constants/index.js +1 -0
  22. package/es/components/expand-field/src/hooks/useAsyncData.d.ts +6 -0
  23. package/es/components/expand-field/src/hooks/useAsyncData.js +1 -0
  24. package/es/components/expand-field/src/index.vue.d.ts +1632 -0
  25. package/es/components/expand-field/src/index.vue.js +1 -0
  26. package/es/components/expand-field/src/index.vue2.js +1 -0
  27. package/es/components/expand-field/src/types/index.d.ts +1 -0
  28. package/es/components/expand-field/src/types/index.js +1 -0
  29. package/es/components/expand-field/src/utils/constant.d.ts +17 -0
  30. package/es/components/expand-field/src/utils/constant.js +1 -0
  31. package/es/components/expand-field/src/utils/index.d.ts +6 -0
  32. package/es/components/expand-field/src/utils/index.js +1 -0
  33. package/es/components/expand-field/src/utils/tool.d.ts +2 -0
  34. package/es/components/expand-field/src/utils/tool.js +1 -0
  35. package/es/components/expand-field/style/expand-field-iconfont.ttf +0 -0
  36. package/es/components/expand-field/style/index.css +1 -0
  37. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  38. package/es/components/fabric-chart/src/interface.d.ts +1 -1
  39. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +6 -0
  40. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  41. package/es/components/index.css +1 -1
  42. package/es/components/index.d.ts +2 -1
  43. package/es/components/index.js +1 -1
  44. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  45. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  46. package/es/components/select-person/src/SearchMultiple.vue.d.ts +0 -6
  47. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  48. package/es/components/select-person/style/index.css +1 -1
  49. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +3 -0
  50. package/es/env.d.ts +25 -25
  51. package/es/shared/assets/img/failure.png.js +1 -1
  52. package/es/shared/assets/img/no-permission.png.js +1 -1
  53. package/es/shared/assets/img/nodata.png.js +1 -1
  54. package/es/shared/assets/img/notfound.png.js +1 -1
  55. package/es/shared/assets/img/qr.png.js +1 -1
  56. package/es/shared/assets/img/success.png.js +1 -1
  57. package/es/shared/assets/img/video.png.js +1 -1
  58. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  59. package/es/shared/assets/img/xb_big.png.js +1 -1
  60. package/es/shared/assets/img/xb_small.png.js +1 -1
  61. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  62. package/es/shared/hooks/useDateTime.js +1 -1
  63. package/es/shared/package.json.js +1 -1
  64. package/es/shared/utils/fabricjs/index.d.ts +6823 -0
  65. package/es/shared/utils/tapable/index.d.ts +139 -0
  66. 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,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,2 @@
1
+ export declare function isJSON(str: string): boolean;
2
+ export declare function isValidDate(val: any): boolean;
@@ -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};
@@ -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 f}from"../useCumputedPoint.js";import"vue";import{cloneDeep as c}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";function a(a,d,u,m,h){const{cumputedX:p,getXValue:x}=f(d),{originX:L,endX:g,xCellWidth:v,originYXAxis:X,top:C,topList:w,canvasWidth:y,borderStyle:Y,treeData:S,xAxis:j,topGridYNumber:b,topGridOriginY:k,topGridYCellHeight:G,topGridEndY:I,event:z}=d,A=new Set;function M(t,e,i){let n;const{content:o}=t.value||{};if(o){const{lineStyle:l,textStyle:s,totalStyle:f}=C.data||{},{startLine:c,centerLine:a,endLine:d}=e;n=r(o,{fontSize:12,...s,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const u=$(n,e,i);n&&(n.set(u),n.origin={data:t},D(n),c&&(c.text=n),d&&(d.text=n))}return n}function $(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(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:f,y2:c,halfY:a}=e;if(!s||s<L||s>g)return;const{lineStyle:d}=C.data||{};let u;const m={left:s,top:a};u=i?r("circle",{fill:d.stroke,...m}):n?r(">",{fill:d.stroke,...m,fontSize:18}):l([s,f,s,a],d);const h=new t.Rect({width:v,height:G,fill:"transparent",left:s-v/2,top:f}),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,D(p),p}function D(t){z.hovered&&(t.on("mouseover",(()=>{H(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=$(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),z.hovered&&H(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 H(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=x(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(a,{...d,gridYNumber:b,originY:k,yCellHeight:G,endY:I}),function(){const{height:o,list:l,left:r,spaceValue:s}=j;if(!o)return;const f=[],c=X+o/2;l.forEach(((t,i)=>{const n=r+i*v*s;f.push(e([n,c],{value:t.slice(11,16)}))}));const d=f.length>0?new t.Group([...f],{...i,objectCaching:!1}):null;d&&a.value.add(d);const u=new t.Rect({width:y,height:o,left:0,top:X,...n,originX:"left",originY:"top",...Y});a.value.add(u)}(),function(){var e;const n=(null==(e=null==C?void 0:C.tree)?void 0:e.textStyle)||{},r=[];!function t(e){e.forEach((e=>{var i;const{width:s,height:f,left:a,top:d,title:u=""}=e,m={value:u,...n};(null==(i=e.children)?void 0:i.length)?(m.value=u.split("").join("\n"),t(e.children)):(m.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+G,s=r-G/2,f={y1:o,y2:r,halfY:s},a=[],d=c(t);delete d.data,t.data.forEach(((t,i,n)=>{const{time:o,continue:r}=t,[c,u]=o,m=c&&p(c),h=u&&p(u),x=E({...f,x:m},{isCustomIcon:!h&&!r,isContinue:!1,isLeft:!0}),v=E({...f,x:h},{isCustomIcon:!1,isContinue:!!r});let X,C,w;if((x||m<L)&&(v||h>g)){X=l([x?m:L,s,v?h:g,s],e)}a.push({startLine:x,centerLine:X,endLine:v}),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:L,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:L,x2:g};l.limitX=t,o&&(l.centerLine=o)}n&&l&&(n.nearLine=l,l.nearLine=n)}(i,a,Object.assign({},d,{data:t,index:i})),n[i-1]&&(C=M(n[i-1],a[i-1],s)),i===n.length-1&&(w=M(t,a[i],s)),X&&A.add(X),x&&A.add(x),v&&A.add(v),C&&A.add(C),w&&A.add(w)}))}(e)),r.push(o({width:s,height:f,...Y},m,{left:a,top:d},!0))}))}(S);const s=r.length>0?new t.Group([...r],{...i,objectCaching:!1}):null;s&&a.value.add(s),A.size&&a.value.add(...A)}()}export{a as useTop};
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};
@@ -9,7 +9,7 @@ interface IEvent {
9
9
  }
10
10
  export declare type ITreeItem = Partial<{
11
11
  title: string;
12
- totle: number;
12
+ total: number;
13
13
  data: Array<{
14
14
  time: string[];
15
15
  value: AnyObject;
@@ -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 a,toRaw as n,Fragment as r}from"vue";import{keywordMatcher as u,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 f}from"../../../../constants/index.js";import{selectOptionsMap as m}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}},emits:["update:value"],setup(e,{emit:x}){const j=l("$xetable"),q=o(null);function _(e){q.value=e}const k=o(!1),{emitFormChangeWithParams:C}=h({...e,$table:j}),F=o("");function W(){return E()}const M=o([]),P=t((()=>{let l=b(M.value)?e.options:M.value;return F.value?(l=l.filter((e=>e.label&&e.label.includes(F.value)||u(F.value,e.keyword))),!e.allowCreate||l.some((e=>e.label===F.value))?l:[...l,{label:F.value,value:F.value,created:!0,shouldSave:e.shouldSave}]):l})),B=o(!1),E=y((async function(l=""){F.value=l;try{if(B.value=!0,!w(e.queryOptions)||!b(e.options))return;M.value=await e.queryOptions({keyword:l,row:e.row,column:e.column,rowIndex:e.rowIndex})}catch(l){console.log(`获取${e.column.field}options错误`)}finally{B.value=!1}}),400),I=l(f);function U(l,o){const t=e.value;x("update:value",l);const a=m.get(I);a&&S(a[e.column.field])&&i(o).forEach((l=>{if(!g(l))return;const o=l;o.created&&o.shouldSave&&a[e.column.field].push(O(n(o),["created","shouldSave"]))})),C({oldValue:t,option:o})}function $(e){var l,o;"Tab"===e.key&&q.value&&(null==(o=(l=q.value).handleKeydown)||o.call(l,{...e,key:"Enter",preventDefault:e.preventDefault.bind(e)}))}function A({node:e,option:l}){return l.detail?a("div",{class:"iho-table__selectOptionWrapper"},[[e,a(d,null,{trigger:()=>a(p,{component:v},null),default:()=>l.detail})]]):e}function D({option:l,handleClose:o}){var t;const n=null!=(t=e.aliasField&&l[e.aliasField])?t:l.label;return S(e.value)?a(c,{closable:!0,onClose:e=>{e.stopPropagation(),o()}},{default:()=>n}):a(r,null,[n])}const K=()=>({class:"iho-table__selectOption"}),N={class:"iho-table__selectMenu"};return()=>a(s,{ref:_,show:k.value,"onUpdate:show":e=>k.value=e,consistentMenuWidth:e.consistentMenuWidth,placeholder:e.placeholder,loading:B.value,options:P.value,value:e.value,remote:!0,onSearch:E,clearable:!0,filterable:!0,nodeProps:K,menuProps:N,renderTag:D,renderOption:A,onUpdateShow:W,onUpdateValue:U,onKeydown:$},null)}});export{x as default};
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};