cnhis-design-vue 3.1.41-beta.35 → 3.1.41-beta.37

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 (74) hide show
  1. package/README.md +87 -87
  2. package/es/components/base-search/index.d.ts +286 -0
  3. package/es/components/base-search/index.js +1 -0
  4. package/es/components/{table-filter/src/base-search-com/BaseSearch.vue.d.ts → base-search/src/index.vue.d.ts} +1 -4
  5. package/es/components/base-search/src/index.vue.js +1 -0
  6. package/es/components/base-search/style/index.css +1 -0
  7. package/es/components/classification/index.d.ts +1013 -0
  8. package/es/components/classification/index.js +1 -0
  9. package/es/components/{table-filter → classification}/src/components/search-filter/index.vue.d.ts +9 -9
  10. package/es/components/classification/src/components/search-filter/index.vue.js +1 -0
  11. package/es/components/classification/src/components/set-classification/index.vue.js +1 -0
  12. package/es/components/{table-filter → classification}/src/components/table-modal/index.vue.d.ts +1 -3
  13. package/es/components/classification/src/const/index.d.ts +2 -0
  14. package/es/components/classification/src/const/index.js +1 -0
  15. package/es/components/{table-filter/src/classification/Classification-com.vue.d.ts → classification/src/index.vue.d.ts} +6 -6
  16. package/es/components/classification/src/index.vue.js +1 -0
  17. package/es/components/classification/style/iconfont.ttf +0 -0
  18. package/es/components/classification/style/index.css +1 -0
  19. package/es/components/fabric-chart/src/hooks/useBirthProcess.js +1 -1
  20. package/es/components/fabric-chart/src/hooks/useBirthProcessChart.js +1 -1
  21. package/es/components/index.css +1 -1
  22. package/es/components/index.d.ts +3 -1
  23. package/es/components/index.js +1 -1
  24. package/es/components/quick-search/index.d.ts +712 -0
  25. package/es/components/quick-search/index.js +1 -0
  26. package/es/components/{table-filter/src/quick-search/QuickSearch.vue.d.ts → quick-search/src/index.vue.d.ts} +21 -8
  27. package/es/components/quick-search/src/index.vue.js +1 -0
  28. package/es/components/quick-search/style/index.css +1 -0
  29. package/es/components/scale-view/src/ScaleView.vue.js +1 -1
  30. package/es/components/table-filter/index.d.ts +0 -1997
  31. package/es/components/table-filter/index.js +1 -1
  32. package/es/components/table-filter/src/hooks/useAdvanced.d.ts +2 -1
  33. package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
  34. package/es/components/table-filter/src/hooks/useMixins.d.ts +1 -54
  35. package/es/components/table-filter/src/hooks/useMixins.js +1 -1
  36. package/es/components/table-filter/src/tool/generateDefOptions.js +1 -1
  37. package/es/components/table-filter/src/tool/transformData.d.ts +1 -0
  38. package/es/components/table-filter/src/tool/transformData.js +1 -1
  39. package/es/env.d.ts +24 -24
  40. package/package.json +2 -2
  41. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  42. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  43. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  44. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  45. package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
  46. package/es/components/table-filter/src/base-search-com/BaseSearch.vue.js +0 -1
  47. package/es/components/table-filter/src/classification/Classification-com.vue.js +0 -1
  48. package/es/components/table-filter/src/components/search-filter/index.vue.js +0 -1
  49. package/es/components/table-filter/src/components/set-classification/index.vue.js +0 -1
  50. package/es/components/table-filter/src/const/index.d.ts +0 -5
  51. package/es/components/table-filter/src/const/index.js +0 -1
  52. package/es/components/table-filter/src/hooks/useTableSearchCon.d.ts +0 -8
  53. package/es/components/table-filter/src/hooks/useTableSearchCon.js +0 -1
  54. package/es/components/table-filter/src/hooks/useWordBookutils.d.ts +0 -12
  55. package/es/components/table-filter/src/hooks/useWordBookutils.js +0 -1
  56. package/es/components/table-filter/src/quick-search/QuickSearch.vue.js +0 -1
  57. package/es/components/table-filter/src/tool/time-domain.d.ts +0 -39
  58. package/es/components/table-filter/src/tool/time-domain.js +0 -1
  59. package/es/components/table-filter/src/tool/utils.d.ts +0 -4
  60. package/es/components/table-filter/src/tool/utils.js +0 -1
  61. package/es/components/table-filter/style/index.css +0 -1
  62. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  63. package/es/shared/utils/tapable/index.d.ts +0 -139
  64. /package/es/components/{table-filter → base-search}/src/directive/resize.d.ts +0 -0
  65. /package/es/components/{table-filter → base-search}/src/directive/resize.js +0 -0
  66. /package/es/components/{table-filter → base-search}/src/tool/resizeSensor.d.ts +0 -0
  67. /package/es/components/{table-filter → base-search}/src/tool/resizeSensor.js +0 -0
  68. /package/es/components/{table-filter → base-search}/style/iconfont.ttf +0 -0
  69. /package/es/components/{table-filter → classification}/src/components/set-classification/index.vue.d.ts +0 -0
  70. /package/es/components/{table-filter → classification}/src/components/table-modal/index.vue.js +0 -0
  71. /package/es/components/{table-filter → classification}/src/directive/flexibleResize.d.ts +0 -0
  72. /package/es/components/{table-filter → classification}/src/directive/flexibleResize.js +0 -0
  73. /package/es/components/table-filter/src/tool/{options.d.ts → baseOptions.d.ts} +0 -0
  74. /package/es/components/table-filter/src/tool/{options.js → baseOptions.js} +0 -0
@@ -0,0 +1 @@
1
+ import{COMPONENT_NAMESPACE as i}from"../../shared/global/variable.js";import{safeComponentRegister as s}from"../../shared/utils/index.js";import o from"./src/index.vue.js";const r=o;r.install=function(o){s(o,r,i+"Classification")};export{r as default};
@@ -68,7 +68,7 @@ declare const _default: import("vue").DefineComponent<{
68
68
  NButton: any;
69
69
  SearchConditionByApi: import("vue").DefineComponent<{
70
70
  actionList_prop: {
71
- type: import("vue").PropType<import("../../types").IClassifyListType>;
71
+ type: import("vue").PropType<import("../../../..").IClassifyListType>;
72
72
  default: () => {};
73
73
  };
74
74
  conditionList: {
@@ -95,7 +95,7 @@ declare const _default: import("vue").DefineComponent<{
95
95
  $message: import("naive-ui").MessageApi;
96
96
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
97
97
  actionList_prop: {
98
- type: import("vue").PropType<import("../../types").IClassifyListType>;
98
+ type: import("vue").PropType<import("../../../..").IClassifyListType>;
99
99
  default: () => {};
100
100
  };
101
101
  conditionList: {
@@ -147,9 +147,9 @@ declare const _default: import("vue").DefineComponent<{
147
147
  showAdd: boolean;
148
148
  };
149
149
  isEnableAddDisplayCategory: import("vue").ComputedRef<boolean>;
150
- editDisplayCategory: (e: any, item: import("../../types").ICategoryItemType) => void;
151
- handleDisplayCategorySelect: (item: import("../../types").ICategoryItemType) => void;
152
- handleDisplayCategoryRemove: (index: number, item: import("../../types").ICategoryItemType) => void;
150
+ editDisplayCategory: (e: any, item: import("../../../..").ICategoryItemType) => void;
151
+ handleDisplayCategorySelect: (item: import("../../../..").ICategoryItemType) => void;
152
+ handleDisplayCategoryRemove: (index: number, item: import("../../../..").ICategoryItemType) => void;
153
153
  handleDisplayCategoryAdd: (e: any) => void;
154
154
  handlerBlur: () => void;
155
155
  initDisplayCategories: (rawDataDisplayCategories: any, displayCategory: any) => void;
@@ -160,7 +160,7 @@ declare const _default: import("vue").DefineComponent<{
160
160
  updateKey: (index: number, val: any) => void;
161
161
  updateCondition: (index: number, val: any) => void;
162
162
  getParamCfg: (key: string) => any;
163
- initFilterConditions: (tableId: string, rawConditions: import("../../types").ISearchConfigType) => Promise<void>;
163
+ initFilterConditions: (tableId: string, rawConditions: import("../../../..").ISearchConfigType) => Promise<void>;
164
164
  getRawFilterConditions: () => {
165
165
  field_key: any;
166
166
  con: any;
@@ -168,7 +168,7 @@ declare const _default: import("vue").DefineComponent<{
168
168
  unit: any;
169
169
  }[];
170
170
  findConditionByDisplayCategory: (displayCategory: string) => unknown;
171
- handleDisplayCategorySelectProxy: (item: import("../../types").ICategoryItemType) => void;
171
+ handleDisplayCategorySelectProxy: (item: import("../../../..").ICategoryItemType) => void;
172
172
  clearFormData: () => void;
173
173
  handleInitConditions: () => Promise<void>;
174
174
  validate: () => Promise<unknown>;
@@ -305,7 +305,7 @@ declare const _default: import("vue").DefineComponent<{
305
305
  }[];
306
306
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancelSaveAdd" | "saveAdd")[], "cancelSaveAdd" | "saveAdd", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
307
307
  actionList_prop: {
308
- type: import("vue").PropType<import("../../types").IClassifyListType>;
308
+ type: import("vue").PropType<import("../../../..").IClassifyListType>;
309
309
  default: () => {};
310
310
  };
311
311
  conditionList: {
@@ -335,7 +335,7 @@ declare const _default: import("vue").DefineComponent<{
335
335
  searchFieldList: unknown[];
336
336
  tableId: string;
337
337
  conditionList: unknown[];
338
- actionList_prop: import("../../types").IClassifyListType;
338
+ actionList_prop: import("../../../..").IClassifyListType;
339
339
  showItemName: boolean;
340
340
  hideAddBtn: boolean;
341
341
  }>;
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as i,onBeforeUnmount as t,watch as l,openBlock as a,createBlock as o,unref as n,normalizeClass as u,withCtx as s,createVNode as d,normalizeStyle as c,createElementVNode as r,createTextVNode as v,mergeProps as f}from"vue";import{NModal as h,NCard as p,NButton as m}from"naive-ui";import x from"../../../../table-filter/src/components/classify-filter/index.vue.js";import g from"../../../../../_virtual/plugin-vue_export-helper.js";const b={class:"svg-wrap"},y={class:"flex_right"};var _=g(e({__name:"index",props:{visible:{type:Boolean,default:!1},modalTitle:{type:String,default:"设置分类"},conditionList:{type:Array,default:()=>[]},searchFieldList:{type:Array,default:()=>[]},filterApiConfig:{type:Object,default:()=>({})}},emits:["cancelSaveAdd"],setup(e,{expose:g,emit:_}){const w=e,k=i(w.visible),z=i(!1),A=i("860px");let C=i({maxHeight:"496px",height:"496px",overflowY:"auto"}),L=i(null),S=null;function H(){F(),S=setTimeout((()=>{L&&L.value.handleInitConditions()}),30)}function F(){S&&clearTimeout(S)}function T(){L&&L.value.saveAdd()}function j(){k.value=!1,_("cancelSaveAdd"),A.value="860px",C.value={height:"496px",maxHeight:"496px",overflowY:"auto"},z.value=!1,L&&L.value.cancelSaveAdd()}function $(){z.value=!z.value;let e=document.body.clientHeight;"860px"===A.value?(A.value="100%",C.value.maxHeight=`${e}px`,C.value.height=`${e}px`):(A.value="860px",C.value.maxHeight="496px",C.value.height="")}return t((()=>{F()})),l((()=>w.visible),(e=>{k.value=e,e&&H()})),g({cancelSaveAdd:j}),(e,i)=>(a(),o(n(h),{class:u(["classification-modal-block standard-modal standard-modal-white",{"modal-screen":z.value}]),show:k.value,"onUpdate:show":i[0]||(i[0]=e=>k.value=e),maskClosable:!1,width:A.value,bodyStyle:n(C),closable:!1,centered:"",onPositiveClick:T,onNegativeClick:j},{default:s((()=>[d(n(p),{style:c({width:A.value,...n(C)}),title:w.modalTitle,bordered:!1,size:"huge",role:"dialog","aria-modal":"true"},{"header-extra":s((()=>[r("div",b,[r("i",{onClick:$,class:u(["iconfont-table-filter",z.value?"icon-table-filter-menzhenyishengzhanxitongtubiaozuixiaohua2":"icon-table-filter-menzhenyishengzhanxitongtubiaozuidahua"])},null,2),r("i",{onClick:j,class:"iconfont-table-filter icon-table-filter-menzhenyishengzhanxitongtubiaoguanbi"})])])),footer:s((()=>[r("div",y,[d(n(m),{onClick:j},{default:s((()=>[v("取消")])),_:1}),d(n(m),{type:"info",onClick:T},{default:s((()=>[v("保存")])),_:1})])])),default:s((()=>[d(x,f(e.$attrs,{ref_key:"conditionApiRef",ref:L,searchFieldList:w.searchFieldList,conditionList:w.conditionList}),null,16,["searchFieldList","conditionList"])])),_:1},8,["style","title"])])),_:1},8,["class","show","width","bodyStyle"]))}}),[["__file","index.vue"]]);export{_ as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as i,useAttrs as t,computed as n,watch as o,openBlock as a,createElementBlock as l,createVNode as s,mergeProps as r,unref as c,withCtx as d,createTextVNode as f}from"vue";import{useMessage as u,NButton as p}from"naive-ui";import v from"../table-modal/index.vue.js";import g from"../search-filter/index.vue.js";import C from"../../../../table-filter/src/hooks/useMixins.js";import y from"../../../../../_virtual/plugin-vue_export-helper.js";const m={class:"search"};var b=y(e({__name:"index",props:{searchFieldList:{type:Array,default:()=>[]},conditionList:{type:Array,default:()=>[]},settingId:String,filterApiConfig:{type:Object,default:()=>({})},classifyModal:{type:Boolean,default:!1}},emits:["CondiTionListInit","saveGetTableCondiTionList","setClassifyModal"],setup(e,{emit:y}){const b=e,h=u(),{handleGetConfigApi:A}=C();let L=i(b.conditionList),I=i(),T=i(!1),S=i({}),_=i([]),j=i(!1);const O=i(null),x=t();async function F(e){try{let i=Object.assign(e,{id:b.settingId,tableId:x.tableId});await A(i,"requestSaveTableCondiTionSetting",{},b.filterApiConfig)&&(y("CondiTionListInit"),H(!1))}catch(e){console.log(e)}}function k(){H(!1),L.value.forEach((e=>{e.checked=!1}))}function w(){T.value=!0}function G(e,i){T.value=!0,S.value=Object.assign(e,{from:"edit"})}function M(e,i){T.value=!0,S.value=Object.assign(e,{from:"copy"})}async function q(e){try{if(Object.assign(e,{tableId:x.tableId,conditionList:JSON.stringify(L.value)}),j.value=!0,!await A(e,"requestSaveTableCondiTion",{},b.filterApiConfig))return;O&&O.value.cancelSaveAdd(),y("saveGetTableCondiTionList"),T.value=!1}catch(e){console.log(e)}finally{j.value=!1}}function R(){T.value=!1,S.value={}}function D(e,i){L.value=e,I.value=i}async function E(e,i){if(e)try{let i={id:e.sid};if(!await A(i,"requestDeleteTableCondiTion",{},b.filterApiConfig))return;h.success("删除成功"),y("saveGetTableCondiTionList",{type:"delete",item:e})}catch(e){console.log(e)}else h.info("请选择行")}function H(e){y("setClassifyModal",e)}async function K(){try{let e={id:b.settingId,tableId:x.tableId,type:"SEARCH_CATEGORY"};await A(e,"requestResetDefaultSetting",{},b.filterApiConfig)&&(y("CondiTionListInit"),H(!1))}catch(e){console.log(e)}}let N=n((()=>b.classifyModal));return o((()=>x.searchKey),(()=>{x.selectKeys=[x.searchKey||"all"]})),o((()=>b.searchFieldList),(e=>{e&&e.length>0&&(_.value=e.filter((e=>"operatorColumn"!==e.columnName)))}),{immediate:!0,deep:!0}),o((()=>T),(e=>{e||(S.value={})})),(i,t)=>(a(),l("div",m,[s(v,r({dataSource:c(L),visibleIn:c(N)},i.$attrs,{onHandleOk:F,onClose:k,onChangeData:D,onResetPopconfirm:K,edit:G,copy:M,delItem:E,type:"search",filterApiConfig:e.filterApiConfig}),{add:d((()=>[s(c(p),{type:"info",onClick:w},{default:d((()=>[f("新增")])),_:1})])),_:1},16,["dataSource","visibleIn","filterApiConfig"]),s(g,r({ref_key:"searchFilter",ref:O},i.$attrs,{visible:c(T),loading:c(j),conditionList:c(L),actionList_prop:c(S),searchFieldList:c(_),isInSearch:!0,isCnHis:!0,showCompareField:!0,filterApiConfig:e.filterApiConfig,onSaveAdd:q,onCancelSaveAdd:R}),null,16,["visible","loading","conditionList","actionList_prop","searchFieldList","filterApiConfig"])]))}}),[["__file","index.vue"]]);export{b as default};
@@ -188,9 +188,7 @@ declare const _default: import("vue").DefineComponent<{
188
188
  clone: Function;
189
189
  list: unknown[];
190
190
  modelValue: unknown[];
191
- componentData: Record<string, any>; /**
192
- * 保存
193
- */
191
+ componentData: Record<string, any>;
194
192
  } & {
195
193
  itemKey?: string | Function | undefined;
196
194
  }>, {
@@ -0,0 +1,2 @@
1
+ import { Ref, InjectionKey } from 'vue';
2
+ export declare const root_isShowResetButton: InjectionKey<Ref<boolean>>;
@@ -0,0 +1 @@
1
+ const o=Symbol("root_isShowResetButton");export{o as root_isShowResetButton};
@@ -1,5 +1,5 @@
1
1
  import { PropType } from 'vue';
2
- import { IClassifyListType, ITreeDataType, IConditionMapType } from '../../../../../es/components/table-filter/src/types';
2
+ import { IClassifyListType, ITreeDataType, IConditionMapType } from '../../../../es/components/table-filter/src/types';
3
3
  declare const _default: import("vue").DefineComponent<{
4
4
  tableId: {
5
5
  type: StringConstructor;
@@ -697,9 +697,9 @@ declare const _default: import("vue").DefineComponent<{
697
697
  showAdd: boolean;
698
698
  };
699
699
  isEnableAddDisplayCategory: import("vue").ComputedRef<boolean>;
700
- editDisplayCategory: (e: any, item: import("../../../../../es/components/table-filter/src/types").ICategoryItemType) => void;
701
- handleDisplayCategorySelect: (item: import("../../../../../es/components/table-filter/src/types").ICategoryItemType) => void;
702
- handleDisplayCategoryRemove: (index: number, item: import("../../../../../es/components/table-filter/src/types").ICategoryItemType) => void;
700
+ editDisplayCategory: (e: any, item: import("../../../../es/components/table-filter/src/types").ICategoryItemType) => void;
701
+ handleDisplayCategorySelect: (item: import("../../../../es/components/table-filter/src/types").ICategoryItemType) => void;
702
+ handleDisplayCategoryRemove: (index: number, item: import("../../../../es/components/table-filter/src/types").ICategoryItemType) => void;
703
703
  handleDisplayCategoryAdd: (e: any) => void;
704
704
  handlerBlur: () => void;
705
705
  initDisplayCategories: (rawDataDisplayCategories: any, displayCategory: any) => void;
@@ -710,7 +710,7 @@ declare const _default: import("vue").DefineComponent<{
710
710
  updateKey: (index: number, val: any) => void;
711
711
  updateCondition: (index: number, val: any) => void;
712
712
  getParamCfg: (key: string) => any;
713
- initFilterConditions: (tableId: string, rawConditions: import("../../../../../es/components/table-filter/src/types").ISearchConfigType) => Promise<void>;
713
+ initFilterConditions: (tableId: string, rawConditions: import("../../../../es/components/table-filter/src/types").ISearchConfigType) => Promise<void>;
714
714
  getRawFilterConditions: () => {
715
715
  field_key: any;
716
716
  con: any;
@@ -718,7 +718,7 @@ declare const _default: import("vue").DefineComponent<{
718
718
  unit: any;
719
719
  }[];
720
720
  findConditionByDisplayCategory: (displayCategory: string) => unknown;
721
- handleDisplayCategorySelectProxy: (item: import("../../../../../es/components/table-filter/src/types").ICategoryItemType) => void;
721
+ handleDisplayCategorySelectProxy: (item: import("../../../../es/components/table-filter/src/types").ICategoryItemType) => void;
722
722
  clearFormData: () => void;
723
723
  handleInitConditions: () => Promise<void>;
724
724
  validate: () => Promise<unknown>;
@@ -0,0 +1 @@
1
+ import{defineComponent as e,useAttrs as i,ref as n,provide as l,computed as t,onActivated as a,onBeforeMount as o,onMounted as s,nextTick as d,watch as c,openBlock as r,createElementBlock as h,normalizeClass as u,unref as f,normalizeStyle as p,withDirectives as g,createVNode as m,createTextVNode as v,toDisplayString as C,createCommentVNode as y,createElementVNode as k,Fragment as S,renderList as b,createBlock as x,withCtx as _}from"vue";import{NIcon as O,NTooltip as w}from"naive-ui";import{Repeat as I,SettingsOutline as L,ChevronDown as z,ChevronForward as j,Checkmark as B,Close as N,ChevronUp as P}from"@vicons/ionicons5";import M from"./components/set-classification/index.vue.js";import A from"./directive/flexibleResize.js";import{root_isShowResetButton as E}from"./const/index.js";import J from"../../table-filter/src/hooks/useMixins.js";import T from"../../../_virtual/plugin-vue_export-helper.js";const R={key:0,class:"header"},F={class:"tree"},W=["onClick"],q=["onClick"],G=["onClick"],Q={class:"child-item-name"},$={key:1,class:"tree-type-footer"},D={class:"selected-num"},V=k("i",{class:"iconfont-table-filter icon-table-filter-menzhenyishengzhananniushanchu2"},null,-1),H={key:0,class:"tile-type classify-1"},K={key:0,class:"header"},U={class:"right-setting"},X=["onClick"],Y={class:"parent ellips"},Z={class:"children"},ee=["onClick"],ie={key:1,class:"selected-list"},ne={class:"selected-num"},le=k("i",{class:"iconfont-table-filter icon-table-filter-menzhenyishengzhananniushanchu2"},null,-1),te={class:"name"},ae={class:"name"},oe={key:0,class:"main-wrapper"},se=["onClick"],de={class:"tree-footer"},ce=["onClick"],re=["onClick"],he={key:0,class:"select-type-footer"},ue={class:"selected-num"},fe=k("i",{class:"iconfont-table-filter icon-table-filter-menzhenyishengzhananniushanchu2"},null,-1);var pe=T(e({__name:"index",props:{tableId:{type:String,default:""},searchFieldList:{type:Array,default:()=>[]},conditionMap:{type:Object,default:()=>{}},conditionSid:{type:Array,default:()=>[]},curClassificationIndex:{type:Number,default:0},curClassificationWidth:{type:Number},hideConditionChangeBtn:{type:Number,default:0},hideConditionChangeSetting:{type:Number,default:0},hideClearConditionChange:{type:Number,default:1},isShowResetButton:{type:Boolean,default:!0},filterApiConfig:{type:Object,default:()=>({})}},emits:["changeSearch","setClassificationIndex","getQuickSearchListObj"],setup(e,{emit:T}){const pe=e,{handleGetConfigApi:ge}=J(),me=i(),ve=n(null);let Ce=n(150),ye=n(!1),ke=n([]),Se=n([]),be=n([]),xe=n(2),_e=n(""),Oe=n({name:"全部数据",sid:"all_data"}),we=n([]),Ie=n([]),Le=n(""),ze=n(!1),je=n("全部数据");l(E,n(pe.isShowResetButton));let Be=t((()=>0===xe.value?{marginRight:"8px"}:2===xe.value?{display:"inline-block"}:{})),Ne=t((()=>{let e=Se.value.filter((e=>-1!==pe.conditionSid.indexOf(e.sid)));if(-1!==pe.conditionSid.indexOf("all_data"))return"全部数据";{let i=[];return e.map((e=>{i.push(e.name)})),i.join(",")}})),Pe=t((()=>function(e){let i=0===e.digital?"(0)":e.digital?`(${e.digital})`:"";const{name:n,isPublic:l}=e;return Ue(n,l)+i}));function Me(e){e.open?e.open=!1:e.open=!0}function Ae(e,i,n){je.value=e.name;let l=function(e){let i=[];return ke.value.forEach((n=>{n.children?n.children.forEach((n=>{-1!==e.indexOf(n.sid)?(n.selected=!0,i.push(n)):n.selected=!1})):-1!==e.indexOf(n.sid)?(n.selected=!0,i.push(n)):n.selected=!1})),i}(function(e,i,n){let l=JSON.parse(JSON.stringify(i));l="all_data"===e||-1!==l.indexOf(e)?["all_data"]:[e];return l}(e.sid,pe.conditionSid));Fe(!1),T("changeSearch",Boolean("all_data"===e.sid),e,n,l)}function Ee(){let e="";if(2===xe.value)e=0;else{let i=xe.value;e=++i}Ce.value=150,Je(e)}async function Je(e,i){let n={tableId:pe.tableId,setting:JSON.stringify({classificationIndex:e,classificationWidth:i})};try{await ge(n,"requestSaveListPersonaSetting",{},pe.filterApiConfig)&&T("setClassificationIndex",e)}catch(e){console.log(e)}}function Te(){ze.value=!0,Fe(!1)}function Re(e){ze.value=e}function Fe(e){ye.value=void 0===e?!ye.value:e}function We(e){var i;if((void 0!==e&&"delete"===e.type&&-1!==pe.conditionSid.indexOf(e.item.sid)&&T("changeSearch",!0,{name:"全部数据",sid:"all_data",selected:!0}),pe.tableId)&&Object.keys(pe.conditionMap).length>0){ke.value=[];let{displayCategoryList:e=[],conditionList:n=[]}=pe.conditionMap;be.value=JSON.parse(JSON.stringify(n)),Ie.value=e||[],Se.value=JSON.parse(JSON.stringify(n));const l={name:"全部数据",sid:"all_data"};Se.value.unshift(l);let t=[];0===e.length&&(e=["未分类"]),e.forEach((e=>{let i={name:e,children:[]};n.forEach((n=>{(n.displayCategory===e||!n.displayCategory&&"未分类"===e&&"all_data"!==n.sid)&&(-1!==pe.conditionSid.indexOf(n.sid)&&(n.selected=!0,i.open=!0),n.isShow&&i.children.push(n))})),i.children.length>0&&t.push(i)})),t.unshift({name:"全部数据",sid:"all_data"}),ke.value=t,0===xe.value&&(i=!0,ke.value.forEach((e=>{e.children&&e.children.length&&(e.open=i)})))}}async function qe(e){try{await We(e)}catch(e){console.log(e)}}function Ge({distance:e}){const i=Ce.value+e;Ce.value=Math.min(Math.max(i,50),650)}function Qe(){Je(xe.value,Ce.value)}async function $e(){await Ke(pe.tableId),Ve()}async function De(e){await Ke(pe.tableId),He()}function Ve(e){He(e).then((e=>{}))}function He(e,i={}){if(!pe.tableId)return new Promise((e=>e(!1)));let n=Object.keys(i).length>0?i:pe.conditionMap;return new Promise(((i,l)=>{var t,a,o,s,d,c;if(Object.keys(n).length>0){we.value=n.conditionList||[],Ie.value=n.displayCategoryList||[];let l={conditionList:we.value,displayCategoryList:Ie.value};T("getQuickSearchListObj",l),Le.value=n.settingId;const r=we.value.find((e=>e.isDefault))||{name:"全部数据",sid:"all_data"};(null==(a=null==(t=me.tableOptions)?void 0:t.filterCondition)?void 0:a.displayCategory)&&e&&i({name:null==(s=null==(o=me.tableOptions)?void 0:o.filterCondition)?void 0:s.name,sid:null==(c=null==(d=me.tableOptions)?void 0:d.filterCondition)?void 0:c.displayCategory}),i(r)}else i({})}))}async function Ke(e){try{if(!e)return new Promise((e=>e(!1)));let i={tableId:e},n=await ge(i,"requestTableCondiTionList",{},pe.filterApiConfig);return Promise.resolve(n)}catch(e){return Promise.resolve(!1)}}function Ue(e,i){return e&&"1"===i?e.replace(/\(公共\)$/,""):e}return a((()=>{qe({})})),o((()=>{qe({})})),s((()=>{document.addEventListener("click",(e=>{d((()=>{let i=e.composedPath&&e.composedPath();ve&&i.includes(ve.value)||Fe(!1)}))}))})),c((()=>pe.tableId),(e=>{e&&(Ve(!0),_e.value!==e&&(_e.value=e))}),{immediate:!0,deep:!0}),c((()=>pe.curClassificationIndex),(e=>{void 0!==e&&(xe.value=e)}),{immediate:!0,deep:!0}),c((()=>pe.curClassificationWidth),(e=>{e&&(Ce.value=Number(e)||150)}),{immediate:!0}),(i,n)=>(r(),h("div",{class:u(["classification-block","classificationIndex-"+f(xe)]),style:p(f(Be))},[0===f(xe)?g((r(),h("div",{key:0,class:"tree-type classify-0",style:p({width:f(Ce)+"px",paddingBottom:1!=e.hideClearConditionChange?"80px":0,position:"relative"})},[1!=e.hideConditionChangeBtn||1!=e.hideConditionChangeSetting?(r(),h("div",R,[1!=e.hideConditionChangeBtn?(r(),h("span",{key:0,class:"header-1",onClick:Ee},[m(f(O),{component:f(I),size:"16"},null,8,["component"]),v(" "+C("切换"))])):y("v-if",!0),1!=e.hideConditionChangeSetting?(r(),h("span",{key:1,class:"header-1",onClick:Te},[m(f(O),{component:f(L),size:"16"},null,8,["component"]),v(" "+C("设置"))])):y("v-if",!0)])):y("v-if",!0),k("ul",F,[(r(!0),h(S,null,b(f(ke),((i,n)=>(r(),h(S,null,[0===n||!i.children||0===i.children.length||i.children&&0!==i.children.filter((e=>e.isShow)).length?(r(),h("li",{key:n,class:u(["tree-item",{"tree-header":0===n||!i.children||0===i.children.length}])},[0!==n&&i.children&&0!==i.children.length?(r(),h(S,{key:1},[k("span",{class:u(["parent",{open:i.open}]),onClick:e=>Me(i)},[k("span",null,C(i.name),1),m(f(O),{component:i.open?f(z):f(j)},null,8,["component"])],10,q),i.open?(r(!0),h(S,{key:0},b(i.children.filter((e=>e.isShow)),((e,n)=>(r(),h("div",{class:"children",key:n},[e.isShow?(r(),x(f(w),{key:0,trigger:"hover",placement:"right"},{trigger:_((()=>[k("span",{class:u(["child-item",{selected:e.selected}]),onClick:n=>Ae(e,0,i)},[k("span",Q,C(e.name||Ue(e.isPublic)),1),e.selected?(r(),x(f(O),{key:0,component:f(B),size:"20"},null,8,["component"])):y("v-if",!0)],10,G)])),default:_((()=>[k("span",null,C(f(Pe)(e)),1)])),_:2},1024)):y("v-if",!0)])))),128)):y("v-if",!0)],64)):(r(),h("span",{key:0,class:u(["child-item header-item",{selected:i.selected||-1!==e.conditionSid.indexOf("all_data")}]),onClick:e=>Ae(i)},C(i.name),11,W))],2)):y("v-if",!0)],64)))),256))]),1!=e.hideClearConditionChange?(r(),h("div",$,[k("div",D,"已选择"+C(e.conditionSid.filter((e=>"all_data"!==e)).length)+"项",1),k("div",{class:"selected-item-del",onClick:n[0]||(n[0]=e=>Ae({sid:"all_data",name:"全部数据",digital:f(Oe).digital}))},[V,v(" 清空筛选 ")])])):y("v-if",!0)],4)),[[f(A),{mode:"VR",onMove:Ge,onEnd:Qe}]]):y("v-if",!0),1===f(xe)?(r(),h(S,{key:1},[1!=e.hideConditionChangeBtn||1!=e.hideConditionChangeSetting||1!=e.hideConditionChangeSetting||f(be).filter((e=>e.isShow)).length>0?(r(),h("div",H,[1!=e.hideConditionChangeBtn||1!=e.hideConditionChangeSetting?(r(),h("div",K,[k("span",{class:u(["all-data",{selected:-1!==e.conditionSid.indexOf("all_data")}]),onClick:n[1]||(n[1]=e=>Ae({sid:"all_data",name:"全部数据",digital:f(Oe).digital}))},[v(" 全部数据 "),f(Oe).digital||0===f(Oe).digital?(r(),h(S,{key:0},[v(" ("+C(f(Oe).digital||0)+") ",1)],64)):y("v-if",!0)],2),k("div",U,[1!=e.hideConditionChangeBtn?(r(),h("span",{key:0,class:"setting-1",onClick:Ee,style:{"margin-right":"30px"}},[m(f(O),{component:f(I),size:"16"},null,8,["component"]),v(" "+C("切换"))])):y("v-if",!0),1!=e.hideConditionChangeSetting?(r(),h("span",{key:1,class:"setting-1",onClick:Te},[m(f(O),{component:f(L),size:"16"},null,8,["component"]),v(" "+C("设置"))])):y("v-if",!0)])])):y("v-if",!0),k("ul",{class:"tile",style:p({borderBottom:1!=e.hideClearConditionChange?"1px solid #d5d5d5":0})},[(r(!0),h(S,null,b(f(ke).slice(1),((e,i)=>(r(),h(S,null,[e.children&&e.children.length>0?(r(),h("li",{class:"tile-item",key:i},[e.children&&0!==e.children.length?(r(),h(S,{key:1},[k("span",Y,C(e.name),1),k("div",Z,[(r(!0),h(S,null,b(e.children,((i,n)=>(r(),h(S,null,[i.isShow?(r(),h("span",{key:n,class:u(["child-item",{selected:i.selected}]),onClick:n=>Ae(i,0,e)},C(i.name||Ue(i.isPublic)),11,ee)):y("v-if",!0)],64)))),256))])],64)):(r(),h("span",{key:0,class:u(["child-item",{selected:e.selected}]),style:{"padding-left":"17px"},onClick:i=>Ae(e)},C(e.name)+" "+C(e.digital),11,X))])):y("v-if",!0)],64)))),256))],4),1!=e.hideClearConditionChange?(r(),h("div",ie,[k("div",ne,"已选择"+C(e.conditionSid.filter((e=>"all_data"!==e)).length)+"项",1),(r(!0),h(S,null,b(f(ke).slice(1),((e,i)=>(r(),h(S,null,[e.children&&0!==e.children.length?(r(!0),h(S,{key:1},b(e.children,((i,n)=>(r(),h(S,null,[i.selected?(r(),h("div",{class:"selected-item",key:i.sid},[v(C(i.name)+" ",1),m(f(O),{component:f(N),onClick:n=>Ae(i,0,e)},null,8,["component","onClick"])])):y("v-if",!0)],64)))),256)):(r(),h("div",{class:"selected-item",key:e.sid},[v(C(e.name)+" ",1),m(f(O),{component:f(N),onClick:i=>Ae(e)},null,8,["component","onClick"])]))],64)))),256)),k("div",{class:"selected-item-del",onClick:n[2]||(n[2]=e=>Ae({sid:"all_data",name:"全部数据",digital:f(Oe).digital}))},[le,v(" 清空筛选 ")])])):y("v-if",!0)])):y("v-if",!0)],64)):y("v-if",!0),2===f(xe)?(r(),h("div",{key:2,class:"select-type classify-2",ref_key:"selectType",ref:ve},[k("span",{class:"title",onClick:n[3]||(n[3]=()=>Fe())},[m(f(w),{trigger:"hover",placement:"top"},{trigger:_((()=>[k("span",te,C(f(Ne)),1)])),default:_((()=>[k("span",ae,C(f(Ne)),1)])),_:1}),m(f(O),{component:f(ye)?f(P):f(z)},null,8,["component"])]),f(ye)?(r(),h("div",oe,[k("ul",{class:"tree",style:p({padding:1!=e.hideClearConditionChange?"40px 0":"40px 0 0"})},[(r(!0),h(S,null,b(f(ke),((i,n)=>(r(),h(S,null,[0===n||!i.children||0===i.children.length||i.children&&0!==i.children.filter((e=>e.isShow)).length?(r(),h("li",{key:n,class:u(["tree-item",{"tree-header":0===n||!i.children||0===i.children.length}])},[0!==n&&i.children&&0!==i.children.length?(r(),h(S,{key:1},[0!==i.children.filter((e=>e.isShow)).length?(r(),h("span",{key:0,class:u(["parent",{open:i.open}]),onClick:e=>Me(i)},[v(C(i.name)+C(i.digital||0===i.digital?"("+i.digital+")":"")+" ",1),m(f(O),{component:i.open?f(z):f(j)},null,8,["component"])],10,ce)):y("v-if",!0),i.open?(r(!0),h(S,{key:1},b(i.children.filter((e=>e.isShow)),((e,n)=>(r(),h("div",{class:"children",key:n},[e.isShow?(r(),x(f(w),{key:0,placement:"right",trigger:"hover","z-index":1e4},{trigger:_((()=>[k("span",{class:u(["child-item",{selected:e.selected}]),onClick:n=>Ae(e,0,i)},[k("span",null,C(e.name||Ue(null==e?void 0:e.isPublic)),1),e.selected?(r(),x(f(O),{key:0,component:f(B),size:"20"},null,8,["component"])):y("v-if",!0)],10,re)])),default:_((()=>[k("span",null,C(f(Pe)(e)),1)])),_:2},1024)):y("v-if",!0)])))),128)):y("v-if",!0)],64)):(r(),h(S,{key:0},[k("span",{class:u(["child-item child-header header-item",{selected:i.selected||-1!==e.conditionSid.indexOf("all_data")}]),onClick:e=>Ae(i)},C(i.name),11,se),k("div",de,[1!=e.hideConditionChangeBtn?(r(),h("span",{key:0,class:"tree-footer-icon",onClick:Ee},[m(f(O),{component:f(I),size:"16"},null,8,["component"]),v(" "+C("切换"))])):y("v-if",!0),1!=e.hideConditionChangeSetting?(r(),h("span",{key:1,class:"tree-footer-icon",onClick:Te},[m(f(O),{component:f(L),size:"16"},null,8,["component"]),v(" "+C("设置"))])):y("v-if",!0)])],64))],2)):y("v-if",!0)],64)))),256))],4),1!=e.hideClearConditionChange?(r(),h("div",he,[k("div",ue,"已选择"+C(e.conditionSid.filter((e=>"all_data"!==e)).length)+"项",1),k("div",{class:"selected-item-del",onClick:n[4]||(n[4]=e=>Ae({sid:"all_data",name:"全部数据",digital:f(Oe).digital}))},[fe,v(" 清空筛选 ")])])):y("v-if",!0)])):y("v-if",!0)],512)):y("v-if",!0),y(" 弹出弹窗 "),m(M,{ref:"search",searchFieldList:e.searchFieldList,conditionList:f(we),displayCategoryList:f(Ie),settingId:f(Le),tableId:e.tableId,classifyModal:f(ze),filterApiConfig:e.filterApiConfig,onSaveGetTableCondiTionList:De,onCondiTionListInit:$e,onSetClassifyModal:Re},null,8,["searchFieldList","conditionList","displayCategoryList","settingId","tableId","classifyModal","filterApiConfig"])],6))}}),[["__file","index.vue"]]);export{pe as default};
@@ -0,0 +1 @@
1
+ @font-face{font-family:iconfont;src:url(iconfont.ttf) format("truetype")}.iconfont-table-filter{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:iconfont!important;font-size:14px;font-style:normal}.icon-table-filter-menzhenyishengzhananniuqingchu:before{content:"\e74e"}.icon-table-filter-menzhenyishengzhananniushanchu2:before{content:"\e757"}.icon-table-filter-menzhenyishengzhanxitongtubiaoguanbi:before{content:"\e76e"}.icon-table-filter-menzhenyishengzhanxitongtubiaozuixiaohua2:before{content:"\e778"}.icon-table-filter-menzhenyishengzhanxitongtubiaozuidahua:before{content:"\e779"}.icon-table-filter-reset:before{content:"\e611"}.icon-table-filter-shaixuan:before{content:"\e64b"}.classification-modal-block .n-card-header .svg-wrap .iconfont-table-filter{cursor:pointer;font-size:18px}.classification-modal-block .n-card-header .svg-wrap .iconfont-table-filter:last-child{margin-left:16px}.classification-modal-block .n-card-header .svg-wrap .n-icon{cursor:pointer}.classification-modal-block .n-card__content{overflow-y:auto}.classification-modal-block .n-card__content .table-modal-list .list-title{background-color:#f2f2f4;border:1px solid #e1dfdf;display:flex;height:52px;line-height:52px}.classification-modal-block .n-card__content .table-modal-list .list-title .list-title-item{font-weight:700;width:25%}.classification-modal-block .n-card__content .table-modal-list .list-content{padding:0}.classification-modal-block .n-card__content .table-modal-list .list-content li{display:flex;height:52px;line-height:52px}.classification-modal-block .n-card__content .table-modal-list .list-content li .list-content-item{align-items:center;display:flex;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:25%}.classification-modal-block .n-card__content .table-modal-list .list-content li .list-content-item .n-icon{cursor:pointer;margin-right:8px}.classification-modal-block .n-card__content .table-modal-list .list-content li.checked,.classification-modal-block .n-card__content .table-modal-list .list-content li.checked .text{background-color:#f2f2f2}.classification-modal-block .n-card__content .table-modal-list .list-content li .text{background-color:#fff;display:inline-block;padding:0 10px;position:relative}.classification-modal-block .n-card__content .table-modal-list .list-content li .list-content-line{position:relative;text-align:center;width:75%}.classification-modal-block .n-card__content .table-modal-list .list-content li .list-content-line:before{border:1px solid #e8e8e8;content:"";left:0;margin-top:20px;position:absolute;width:100%}.classification-modal-block .n-card__content .table-modal-list .list-title-item{margin-left:-1px;padding:0 10px}.classification-modal-block .n-card__content .table-modal-list .list-content-item{border-bottom:1px solid #e1dfdf;margin-left:-1px;margin-top:-1px;padding:0 10px}.classification-modal-block .n-card__content .table-modal-list .list-content-item .ant-switch{height:16px;min-width:28px;width:28px}.classification-modal-block .n-card__content .table-modal-list .list-content-item .ant-switch:after{height:12px;width:12px}.classification-modal-block .n-card__content .table-modal-list .list-content-radio,.classification-modal-block .n-card__content .table-modal-list .list-content-switch{text-align:center}.classification-modal-block .n-card__content .table-modal-list .anticon+.anticon{margin-left:8px}.classification-modal-block .n-card__content .class-filter-content .item-name{display:flex;height:32px;line-height:32px;margin-bottom:10px}.classification-modal-block .n-card__content .class-filter-content .item-name .label{text-align:right;width:120px}.classification-modal-block .n-card__content .class-filter-content .item-name .addAction{align-items:center;cursor:pointer;display:flex}.classification-modal-block .n-card__content .class-filter-content .item-name .blue{color:#2d7aff;margin-right:8px}.classification-modal-block .n-card__content .class-filter-content .n-form-item-label{width:120px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content{align-items:center;display:flex;flex-wrap:wrap;line-height:32px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .label{display:inline-block;height:32px;line-height:32px;margin-bottom:10px;text-align:right;width:120px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .ant-btn-dashed{border-color:#a6a6a6;color:#a6a6a6}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag{margin-bottom:10px;margin-right:10px;position:relative}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag .anticon-close{color:#2d7aff;cursor:pointer;line-height:36px;position:absolute;right:5px;top:2px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag .s-content{align-items:center;background-color:rgba(45,122,255,.1);border:1px solid #2d7aff;border-radius:3px;box-sizing:border-box;color:#2d7aff;cursor:pointer;display:flex;justify-content:center;opacity:1;padding:0 10px;width:100px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag .s-content span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag.edit-tag-select .ant-input-disabled,.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag.edit-tag-select .s-content{background-color:#2d7aff;color:#fff}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag.edit-tag-select .anticon-close{color:#fff}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .ant-btn{margin-bottom:10px}.classification-modal-block .n-card__content .class-filter-content .select-item-list{border-top:1px solid #e6e6e6;margin-bottom:6px;margin-top:16px;padding-top:12px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li{align-items:center;display:flex;list-style:none;margin-bottom:10px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .index-span{display:inline-block;width:30px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .form-item{margin-right:10px;width:120px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .form-item.n-date-picker{width:auto}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .value-cfg_wrapper{display:flex;flex-wrap:wrap}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .value-cfg_wrapper .form-item{margin-right:10px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .delete-item-icon{color:red;cursor:pointer;font-size:18px}.classification-modal-block .n-card__footer{padding-top:10px}.classification-modal-block .n-card__footer .flex_between{display:flex;justify-content:space-between}.classification-modal-block .n-card__footer .flex_right{display:flex;justify-content:right}.classification-modal-block .n-card__footer .n-button{margin-left:8px}.classification-block .tree-type{border:1px solid #d5d5d5;border-radius:4px;height:100%;line-height:32px;margin-top:8px;padding-bottom:80px;width:150px}.classification-block .tree-type .header{border-bottom:1px solid #e6eaef;display:flex;font-size:14px;justify-content:space-between;padding:0 10px}.classification-block .tree-type .header .header-1{align-items:center;cursor:pointer;display:flex}.classification-block .tree-type .tree{height:calc(100% - 32px);line-height:32px;margin:0;overflow:auto;padding-left:0}.classification-block .tree-type .tree::-webkit-scrollbar{width:5px}.classification-block .tree-type .tree .tree-item{border-bottom:1px solid #d5d5d5;cursor:pointer}.classification-block .tree-type .tree .tree-item.tree-header{box-sizing:border-box;padding:0 10px}.classification-block .tree-type .tree .tree-item .parent{align-items:center;display:flex;font-weight:600;justify-content:space-between;padding:0 10px}.classification-block .tree-type .tree .tree-item .parent.open{background-color:#f2f2f2;border-bottom:1px solid #d5d5d5}.classification-block .tree-type .tree .tree-item .header-item{box-sizing:border-box;line-height:1.4}.classification-block .tree-type .tree .tree-item .header-item.selected,.classification-block .tree-type .tree .tree-item .header-item:hover{color:#2d7aff}.classification-block .tree-type .tree .tree-item .header-item:active{border-color:transparent;color:#000}.classification-block .tree-type .tree .tree-item .children{align-items:center;display:flex;height:32px;padding-left:23px;padding-right:10px}.classification-block .tree-type .tree .tree-item .children .child-item{align-items:center;border-bottom:1px solid transparent;color:#7c7c7c;display:flex;line-height:1.5;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.classification-block .tree-type .tree .tree-item .children .child-item:hover{color:#2d7aff}.classification-block .tree-type .tree .tree-item .children .child-item.selected{align-items:center;color:#2d7aff;display:flex;justify-content:space-between;width:100%}.classification-block .tree-type .tree .tree-item .children .child-item:active{border-color:transparent;color:#000}.classification-block .tree-type .tree .tree-item .children .child-item.disabled{color:rgba(0,0,0,.2)}.classification-block .tree-type .tree .tree-item .children .child-item .child-item-content{align-items:center;display:flex}.classification-block .tree-type .tree .tree-item .children .child-item .child-item-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.classification-block .tree-type .tree .tree-item .children .child-item .digital-span{flex:1;margin-left:5px;text-align:left}.classification-block .tree-type .tree .tree-item:last-child{border-bottom:none}.classification-block .tree-type .tree-type-footer{border-top:1px solid #d5d5d5;bottom:0;height:80px;line-height:20px;padding-left:16px;position:absolute;width:100%}.classification-block .tree-type .tree-type-footer .selected-num{margin:10px}.classification-block .tree-type .tree-type-footer .selected-item-del{align-items:center;color:#2474ff;cursor:pointer;display:flex;justify-content:center;margin-left:0}.classification-block .tile-type{border:1px solid #d5d5d5;border-radius:4px;margin-bottom:8px;padding:0 17px}.classification-block .tile-type .header{align-items:center;border-bottom:1px solid #d5d5d5;display:inline-flex;justify-content:space-between;line-height:44px;width:100%}.classification-block .tile-type .header .all-data{border-bottom:1px solid transparent;font-family:PingFangSC-Medium,PingFang SC;font-size:14px;font-weight:500;line-height:1.4;margin-right:auto}.classification-block .tile-type .header .all-data:hover{color:#2d7aff}.classification-block .tile-type .header .all-data:active{border-color:transparent;color:#000}.classification-block .tile-type .header .selected{color:#2d7aff}.classification-block .tile-type .header .right-setting{display:flex}.classification-block .tile-type .header .right-setting .setting-1{align-items:center;cursor:pointer;display:flex}.classification-block .tile-type .header .right-setting .setting-1 .n-icon{margin-right:6px}.classification-block .tile-type .header .right-setting .upack-up-btn{color:#2d7aff}.classification-block .tile-type .tile{border-bottom:1px solid #d5d5d5;margin:0;padding:9px 0}.classification-block .tile-type .tile .tile-item{cursor:pointer;display:flex;line-height:38px}.classification-block .tile-type .tile .tile-item .parent{box-sizing:border-box;font-family:PingFangSC-Medium,PingFang SC;font-size:14px;font-weight:600;max-width:135px;padding-right:16px;width:135px}.classification-block .tile-type .tile .tile-item .children{flex:1}.classification-block .tile-type .tile .tile-item .children .child-item{border-bottom:1px solid transparent;border-radius:4px;color:#7c7c7c;display:inline-block;font-size:14px;line-height:1.5;margin:0 5px;padding:1px 6px}.classification-block .tile-type .tile .tile-item .children .child-item.selected,.classification-block .tile-type .tile .tile-item .children .child-item:hover{background-color:rgba(45,122,255,.1);color:#2d7aff}.classification-block .tile-type .tile .tile-item .children .child-item:active{border-color:transparent;color:#000}.classification-block .tile-type .tile .tile-item .children .child-item.disabled{color:rgba(0,0,0,.2)}.classification-block .tile-type .tile .tile-item .child-item.selected{color:#2d7aff}.classification-block .tile-type .selected-list{align-items:center;display:flex;padding:12px 6px}.classification-block .tile-type .selected-list .selected-num{font-size:14px;line-height:20px;margin-right:8px}.classification-block .tile-type .selected-list .selected-item{align-items:center;background-color:rgba(45,122,255,.1);border-radius:4px;color:#2d7aff;cursor:pointer;display:flex;margin-left:8px;padding:1px 8px}.classification-block .tile-type .selected-list .selected-item-del{align-items:center;color:#2474ff;cursor:pointer;display:flex;font-size:14px;line-height:20px;margin-left:22px}.classification-block .select-type{height:32px;line-height:32px;margin-bottom:8px;margin-right:8px;position:relative;width:100px}.classification-block .select-type .title{align-items:center;border:1px solid #d5d5d5;border-radius:4px;box-sizing:border-box;color:#969696;cursor:pointer;display:flex;font-size:12px;height:100%;justify-content:space-between;padding:0 8px;width:100%}.classification-block .select-type .title>.name{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.classification-block .select-type .main-wrapper{background-color:#fff;border:1px solid #d5d5d5;border-radius:4px;min-width:270px;position:absolute;top:39px;width:100%;z-index:3000}.classification-block .select-type .main-wrapper::-webkit-scrollbar{width:5px}.classification-block .select-type .tree{margin:0;max-height:300px;overflow:auto;padding:32px 0}.classification-block .select-type .tree .tree-item{border-bottom:1px solid #d5d5d5;cursor:pointer;line-height:32px}.classification-block .select-type .tree .tree-item.tree-header{align-items:center;background-color:#fff;box-sizing:border-box;display:flex;height:40px;padding:0 10px;position:absolute;top:0;width:100%;z-index:1}.classification-block .select-type .tree .tree-item .tree-footer{align-items:center;color:rgba(0,0,0,.6);display:flex}.classification-block .select-type .tree .tree-item .tree-footer .tree-footer-icon{align-items:center;cursor:pointer;display:flex}.classification-block .select-type .tree .tree-item .tree-footer .tree-footer-icon .n-icon{margin-right:6px}.classification-block .select-type .tree .tree-item .tree-footer .tree-footer-icon:first-child{margin-right:16px}.classification-block .select-type .tree .tree-item .parent{align-items:center;display:flex;font-weight:600;justify-content:space-between;padding:0 10px}.classification-block .select-type .tree .tree-item .parent.open{background-color:#f2f2f2;border-bottom:1px solid #d5d5d5}.classification-block .select-type .tree .tree-item .header-item{border-bottom:1px solid transparent;color:rgba(0,0,0,.6);flex:1}.classification-block .select-type .tree .tree-item .header-item.selected,.classification-block .select-type .tree .tree-item .header-item:hover{color:#2d7aff}.classification-block .select-type .tree .tree-item .header-item:active{border-color:transparent;color:#000}.classification-block .select-type .tree .tree-item .children{align-items:center;display:flex;height:32px;line-height:32px;padding-left:23px;padding-right:10px}.classification-block .select-type .tree .tree-item .children .child-item{border-bottom:1px solid transparent;color:#7c7c7c;display:inline-block;line-height:1.5;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.classification-block .select-type .tree .tree-item .children .child-item.child-header{padding:0 10px}.classification-block .select-type .tree .tree-item .children .child-item.header-item{border-bottom:1px solid transparent;color:rgba(0,0,0,.6)}.classification-block .select-type .tree .tree-item .children .child-item.header-item.selected,.classification-block .select-type .tree .tree-item .children .child-item.header-item:hover{color:#2d7aff}.classification-block .select-type .tree .tree-item .children .child-item.header-item:active{border-color:transparent;color:#000}.classification-block .select-type .tree .tree-item .children .child-item:hover{color:#2d7aff}.classification-block .select-type .tree .tree-item .children .child-item.selected{align-items:center;color:#2d7aff;display:flex;justify-content:space-between;width:100%}.classification-block .select-type .tree .tree-item .children .child-item:active{border-color:transparent;color:#000}.classification-block .select-type .tree .tree-item .children .child-item.disabled{color:rgba(0,0,0,.2)}.classification-block .select-type .tree .tree-item:last-child{border-bottom:0}.classification-block .select-type .select-type-footer{align-items:center;background-color:#fff;border-top:1px solid #d5d5d5;bottom:0;display:flex;height:40px;justify-content:space-between;padding:0 12px;position:absolute;width:100%}.classification-block .select-type .select-type-footer .selected-num{color:rgba(0,0,0,.6)}.classification-block .select-type .select-type-footer .selected-item-del{color:#2474ff;cursor:pointer}
@@ -1 +1 @@
1
- import{useBirthProcessCumputedPoint as t}from"./useCumputedPoint.js";import e from"./useGrid.js";import{drawLine as n,drawArrow as o,drawText as i,defaultTextStyle as r,drawPoint as l,defaultStyle as s,defaultRectStyle as a}from"./useDraw.js";import{fabric as u}from"../utils/index.js";import{getIndex as c,isEffectiveNode as f}from"../utils/utils.js";import{cloneDeep as d}from"lodash-es";import{format as p}from"date-fns";function h(h,g,v,m,y,k){const{cumputedX:w,cumputedY:x,getXValue:b,getYValue:T}=t(g),{getEqualXTypes:j,repeatTip:C}=k,{xAxis:S,grid:E,originX:P,originY:Y,xCellWidth:G,endY:L,startTime:M,leftAddAreaWidth:A,leftScales:X,rightScales:I,yCellHeight:D,endX:H,scaleValues:O,canvasWidth:V,borderStyle:W,rightAddAreaWidth:$,event:R,originYCervix:q,other:z}=g,B=d(O),F=new Set;function J(){B.filter((t=>t.show)).forEach(((t,e)=>{var s;const a=[],u=[],c=[];null==(s=t.data)||s.forEach(((s,f)=>{!function(s,f,d){let p,y;const{pointAttr:k={},lineAttr:w={},title:x="",key:j,type:C="circle",childbirthStyle:S={}}=t,E=t.data[d+1],P=U(E,t);if(s&&P&&!f.breakpoint)y=n([...s,...P],{...w});else if(s&&!P&&!f.breakpoint){const e=U(E,t);y=e?n([...s,...e],{...w}):null}let Y,L;if(f.childbirth){const t=s[1]+D;Y=o([s[0],s[1],t],S),c.push(Y),L=i([s[0]+G/2,t-D/2],{value:String(f.childbirth),...r,originX:"left",originY:"center",...S}),c.push(L)}const M=u[d-1],A={origin:{data:f,title:x,key:j||"",dataIndex:e,index:d},leftLine:M,rightLine:y,arrowGroup:Y,arrowGroupText:L,...k,...g.event.hovered?g.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:g.event};M?p=l(C,{left:M.get("x2"),top:M.get("y2"),...A}):s&&(A.leftLine=null,p=l(C,{left:s[0],top:s[1],...A}));u.push(y),p&&(!function(t){R.hovered&&(t.on("mouseover",(()=>{Q(t)})),t.on("mouseout",(()=>{m.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{N(t),function(t){var e,n,o,i;null==(e=t.leftLine)||e.setCoords().set({x2:t.left,y2:t.top}),null==(n=t.rightLine)||n.setCoords().set({x1:t.left,y1:t.top}),null==(o=t.arrowGroup)||o.setCoords().set({left:t.left,top:t.top}),null==(i=t.arrowGroupText)||i.setCoords().set({left:t.left+G/2,top:t.top+D/2})}(t),R.hovered&&Q(t)})),t.on("mouseup",(e=>{if(m.show=!1,1===e.button){const{key:e}=t.origin,n={...t.origin,data:{...t.origin.data,time:b(t.left),value:T(e,t.top)}};h.value.discardActiveObject(),v("change",n),K(n,"change")}}))}(p),a.push(p),F.add(p))}(U(s,t),s,f)})),Promise.all(a).then((t=>{const e=u.filter((t=>t));let n=null;t=t.filter((t=>(t&&n&&(n.nextPoint=t,t.prevPoint=n),n=t||n,t))),Promise.all(c).then((n=>{h.value.add(...e,...t,...n),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function K(t,e="add"){const{dataIndex:n,data:o,index:i,key:r}=t,l=B.find((t=>t.key===r));switch(e){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=o;break;default:{const t=c(o.time,l.data);l.data.splice(t,0,o);break}}var s;F.size&&(null==(s=h.value)||s.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine),(null==t?void 0:t.arrowGroup)&&e.push(null==t?void 0:t.arrowGroup),(null==t?void 0:t.arrowGroupText)&&e.push(null==t?void 0:t.arrowGroupText)})),e}([...F]))),F.clear(),J()}function N(t){const e=t.prevPoint?t.prevPoint.left:P,n=t.nextPoint?t.nextPoint.left:H;t.setCoords(),["cervix","fetalPresentation"].includes(t.origin.key)&&t.top<q&&t.set("top",q),t.top<Y&&t.set("top",Y),t.top>L&&t.set("top",L),t.left<e&&t.set("left",e),t.left>n&&t.set("left",n)}function Q(t){const{title:e,key:n}=t.origin;m.point={x:t.left,y:t.top},m.list=[`${e} ${T(n,t.top)}`,`时间 ${b(t.left).slice(-5)}`],m.show=!0}function U(t,e){if(f(t)&&function(t){const e=M+864e5,n=new Date(t).getTime();return n>=M&&n<=e}(t.time)){const n=w(t.time),o=x(e.key,e.range,t.value);return[n,o<Y?Y:o>L?L:o]}}function Z(t,e){return t+1>e[1]?e[0]:t+1}return e(h,g,!0),function(){const t=new u.Rect({...W,width:V-A-$-1,height:L,left:A,top:0,fill:"transparent"});h.value.add(t)}(),function(){let t=A;[...X,...I].forEach(((e,n)=>{const{range:o,spaceValue:l,width:c,title:f,titleStyle:d,layout:p}=e,g=[];"right"===p&&(t=H);const v=t+c/2,m=function(t,e){const n=[],[o,i]=t;for(let t=o;e>0?t<=i:t>=i;t+=e)n.push(t);return n}(o,l);m.forEach(((t,e)=>{const n=0===e?L-8:L-e*D;g.push(i([v,n],{value:String(t),...r}))}));const y=new u.Rect({...a,width:c,height:L,left:v,top:L/2}),k=Y>0?i([v,Y-D/2],{value:String(f),...r,...d}):null,w=new u.Group([...g,y,...k?[k]:[]],{objectCaching:!1,...s});h.value.add(w),t+=c}))}(),function(){const{show:t,startTime:e,range:n=[0,23],position:o="top",style:l}=S.time,{show:a,range:c=[0,23],style:f}=S.processTime;if(t||a){const d=[],p=[],g=[],v=[],m=P+G/2;for(let s=0;s<E.mainXCell;s++){if(t){const t=0===s?+e.slice(11,13):Z(d.at(-1),n);d.push(t);const a="top"==o?Y-15:L+15;g.push(i([m+s*G,a],{value:String(t),...r,...l||{}}))}if(a){const t=0===s?c[0]:p.at(-1)+1;p.push(t);const e="top"==o?L+15:Y-15;v.push(i([m+s*G,e],{value:String(t),...r,...f||{}}))}}const y=new u.Group([...g,...v],{objectCaching:!1,...s});h.value.add(y),h.value.sendToBack(y)}}(),function(){var t;const e=Object.values(z),o=[],i={},r=B.find((t=>"cervix"===t.key&&t.show)),l=null==(t=null==r?void 0:r.data)?void 0:t.find((t=>3==+t.value));function s(t,e){const{key:n,range:o}=r||{},i=x(n,o,10),l=[0,e],s=[-e/t,0],a=[(L-i-e)/t,L-i],u=[H-P,t*(H-P)+e];let c=[],f=[];function d([n,o]){return Math.abs(o-t*n-e)<=1}function p([t,e]){const[n,o]=[...h([t,e])];return n>=P&&n<=H&&o>=i&&o<=L}function h([t,e]){return[P+t,L-e]}return d(l)&&p(l)&&(c=h(l)),d(s)&&p(s)&&(c=h(s)),d(a)&&p(a)&&(f=h(a)),d(u)&&p(u)&&(f=h(u)),[...c,...f]}e.forEach((t=>{if(!t.show)return;const{key:e}=t;switch(e){case"fetalPresentation":{const{range:i,show:r}=B.find((t=>t.key===e));if(r){const r=x(e,i,0);o.push(n([P,r,H,r],{...t}))}break}case"alert":if(l){const{key:e,range:a}=r||{},u=216e5,c={time:p(new Date(new Date(l.time).getTime()+u),"yyyy-MM-dd HH:mm"),value:10},[f,d]=[w(l.time)-P,L-x(e,a,l.value)],[h,g]=[w(c.time)-P,L-x(e,a,c.value)],v=(g-d)/(h-f),m=d-f*v,y=s(v,m);y.length>0&&(o.push(n(y,{...t})),Object.assign(i,{k:v,b:m}))}break;case"handling":if(l){const{k:e,b:r}=i,a=144e5,u=s(e,r-(w(p(new Date(new Date(l.time).getTime()+a),"yyyy-MM-dd HH:mm"))-w(l.time))*e);u.length>0&&o.push(n(u,{...t}))}}})),h.value.add(...o)}(),J(),function(){function t(t,e){const n=B.findIndex((e=>e.key===t.key));return{renderItem:()=>t.title,origin:{title:t.title,unit:t.unit,dataIndex:n,key:t.key},pointer:e}}g.event.evented&&h.value.on("mouse:up",(e=>{if(3===e.button){const{x:n=0,y:o=0}=e.pointer||{};n>=P&&n<=H&&o>=Y&&o<=L&&(y.point={x:n,y:o},y.show=!0,e.target?(y.target=e.target,y.list=["删除节点"],h.value.forEachObject((t=>{t.origin&&t.left===e.target.left&&t.top===e.target.top&&y.list.push({renderItem:()=>t.origin.title,origin:{...t.origin},mode:"remove",pointer:e.pointer})}))):(y.target=null,y.list=["新增节点"],B.filter((t=>t.show)).forEach((i=>{if(!j(n,"key",G).includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&o<q)return;y.list.push(t(i,e.pointer))}})),1===y.list.length&&(y.show=!1,C(),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const t=V-$/2;function e(t,e){if(!t.length)return;let o=Y;const i=[];t.forEach((t=>{const n=t.title.split("").join("\n"),s=O.findIndex((e=>e.key===t.key)),a=new u.Text(String(n),{...r,...t.titleStyle||{},originY:"top",left:e,top:o,lineHeight:1}),c=l(t.type,{left:e,top:o+a.height+3,...t.pointAttr,originY:"top",origin:{title:t.title,unit:t.unit,type:t.type,dataIndex:s,key:t.key,isMenu:!0},originLeft:e,originTop:o+a.height+3,...g.event});o+=a.height+c.height+15,function(t){function e(t){const{left:e,top:n}=t;return e>=P&&e<=H&&n>=Y&&n<=L}t.on("moving",(()=>{t.set("originY","center"),e(t)?(N(t),Q(t)):m.show=!1})),t.on("mouseup:before",(n=>{if(m.show=!1,0===n.e.button&&e(t))if(j(t.left,"key",G).includes(t.origin.key))C();else{const e={data:{time:b(t.left),value:T(t.origin.key,t.top)},...t.origin};v("add",e),K(e)}!function(t){t.setCoords().set({originY:"top",left:t.originLeft,top:t.originTop})}(t)}))}(c),i.push(a,c)})),n(i),h.value.add(...i)}function n(t){const e=t.at(-1),n=(L-Y)/2,o=(e.height+e.top-Y)/2;t.forEach((t=>{const e=t.top+n-o;t.set({top:e,originTop:e})}))}e(X,A/2),e(I,t)}(),{clickMenu:function({item:t,target:e}){const n={...t.origin};"remove"===t.mode?(v("remove",n),K(n,"remove")):(Object.assign(n,{data:{time:b(t.pointer.x),value:T(t.origin.key,t.pointer.y)}}),v("add",n),K(n))}}}export{h as useBirthProcess};
1
+ import{useBirthProcessCumputedPoint as t}from"./useCumputedPoint.js";import e from"./useGrid.js";import{drawLine as n,drawArrow as o,drawText as i,defaultTextStyle as r,drawPoint as l,defaultStyle as s,defaultRectStyle as a}from"./useDraw.js";import{fabric as u}from"../utils/index.js";import{getIndex as c,isEffectiveNode as f}from"../utils/utils.js";import{cloneDeep as d}from"lodash-es";import{format as p}from"date-fns";function h(h,g,v,m,y,k){const{cumputedX:w,cumputedY:x,getXValue:b,getYValue:T}=t(g),{getEqualXTypes:S,repeatTip:j}=k,{xAxis:C,grid:E,originX:P,originY:Y,xCellWidth:G,endY:L,startTime:M,leftAddAreaWidth:A,leftScales:X,rightScales:I,yCellHeight:H,endX:D,scaleValues:O,canvasWidth:V,borderStyle:W,rightAddAreaWidth:R,event:$,originYCervix:F,other:q}=g,z=d(O),B=new Set;function N(){z.filter((t=>t.show)).forEach(((t,e)=>{var s;const a=[],u=[],c=[];null==(s=t.data)||s.forEach(((s,f)=>{!function(s,f,d){let p,y;const{pointAttr:k={},lineAttr:w={},title:x="",key:S,type:j="circle",childbirthStyle:C={}}=t,E=t.data[d+1],P=U(E,t);if(s&&P&&!f.breakpoint)y=n([...s,...P],{...w});else if(s&&!P&&!f.breakpoint){const e=U(E,t);y=e?n([...s,...e],{...w}):null}let Y,L;if(f.childbirth){const t=s[1]+H;Y=o([s[0],s[1],t],C),c.push(Y),L=i([s[0]+G/2,t-H/2],{value:String(f.childbirth),...r,originX:"left",originY:"center",...C}),c.push(L)}const M=u[d-1],A={origin:{data:f,title:x,key:S||"",dataIndex:e,index:d},leftLine:M,rightLine:y,arrowGroup:Y,arrowGroupText:L,...k,...g.event.hovered?g.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:g.event};M?p=l(j,{left:M.get("x2"),top:M.get("y2"),...A}):s&&(A.leftLine=null,p=l(j,{left:s[0],top:s[1],...A}));u.push(y),p&&(!function(t){$.hovered&&(t.on("mouseover",(()=>{Q(t)})),t.on("mouseout",(()=>{m.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{K(t),function(t){var e,n,o,i;null==(e=t.leftLine)||e.setCoords().set({x2:t.left,y2:t.top}),null==(n=t.rightLine)||n.setCoords().set({x1:t.left,y1:t.top}),null==(o=t.arrowGroup)||o.setCoords().set({left:t.left,top:t.top}),null==(i=t.arrowGroupText)||i.setCoords().set({left:t.left+G/2,top:t.top+H/2})}(t),$.hovered&&Q(t)})),t.on("mouseup",(e=>{if(m.show=!1,1===e.button){const{key:e}=t.origin,n={...t.origin,data:{...t.origin.data,time:b(t.left),value:T(e,t.top)}};h.value.discardActiveObject(),v("change",n),J(n,"change")}}))}(p),a.push(p),B.add(p))}(U(s,t),s,f)})),Promise.all(a).then((t=>{const e=u.filter((t=>t));let n=null;t=t.filter((t=>(t&&n&&(n.nextPoint=t,t.prevPoint=n),n=t||n,t))),Promise.all(c).then((n=>{h.value.add(...e,...t,...n),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function J(t,e="add"){const{dataIndex:n,data:o,index:i,key:r}=t,l=z.find((t=>t.key===r));switch(e){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=o;break;default:{const t=c(o.time,l.data);l.data.splice(t,0,o);break}}var s;B.size&&(null==(s=h.value)||s.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine),(null==t?void 0:t.arrowGroup)&&e.push(null==t?void 0:t.arrowGroup),(null==t?void 0:t.arrowGroupText)&&e.push(null==t?void 0:t.arrowGroupText)})),e}([...B]))),B.clear(),N()}function K(t){const e=t.prevPoint?t.prevPoint.left:P,n=t.nextPoint?t.nextPoint.left:D;t.setCoords(),["cervix","fetalPresentation"].includes(t.origin.key)&&t.top<F&&t.set("top",F),t.top<Y&&t.set("top",Y),t.top>L&&t.set("top",L),t.left<e&&t.set("left",e),t.left>n&&t.set("left",n)}function Q(t){const{title:e,key:n}=t.origin;m.point={x:t.left,y:t.top},m.list=[`${e} ${T(n,t.top)}`,`时间 ${b(t.left).slice(-5)}`],m.show=!0}function U(t,e){if(f(t)&&function(t){const e=M+864e5,n=new Date(t).getTime();return n>=M&&n<=e}(t.time)){const n=w(t.time),o=x(e.key,e.range,t.value);return[n,o<Y?Y:o>L?L:o]}}function Z(t,e){return t+1>e[1]?e[0]:t+1}return e(h,g,!0),function(){const t=new u.Rect({...W,width:V-A-R-1,height:L-1,left:A,top:0,fill:"transparent"});h.value.add(t)}(),function(){let t=A;[...X,...I].forEach(((e,n)=>{const{range:o,spaceValue:l,width:c,title:f,titleStyle:d,layout:p,key:g,scaleNumberStyle:v={}}=e,m=[];"right"===p&&(t=D);const y=t+c/2,k=function(t,e){const n=[],[o,i]=t;for(let t=o;e>0?t<=i:t>=i;t+=e)n.push(t);return n}(o,l);k.forEach(((t,e)=>{const n=0===e?L-8:e!==k.length-1||Y||F&&"FHR"!==g?L-e*H:Y+8;m.push(i([y,n],{value:String(t),...r,...v}))}));const w=new u.Rect({...a,width:c,height:L,left:y,top:L/2}),x=i([y,Y>0?Y-H/2:H/2],{value:String(f),...r,...d}),b=new u.Group([...m,w,...x?[x]:[]],{objectCaching:!1,...s});h.value.add(b),t+=c}))}(),function(){const{show:t,startTime:e,range:n=[0,23],position:o="top",style:l}=C.time,{show:a,range:c=[0,23],style:f}=C.processTime;if(t||a){const d=[],p=[],g=[],v=[],m=P+G/2;for(let s=0;s<E.mainXCell;s++){if(t){const t=0===s?+e.slice(11,13):Z(d.at(-1),n);d.push(t);const a="top"==o?Y-15:L+15;g.push(i([m+s*G,a],{value:String(t),...r,...l||{}}))}if(a){const t=0===s?c[0]:p.at(-1)+1;p.push(t);const e="top"==o?L+15:Y-15;v.push(i([m+s*G,e],{value:String(t),...r,...f||{}}))}}const y=new u.Group([...g,...v],{objectCaching:!1,...s});h.value.add(y),h.value.sendToBack(y)}}(),function(){var t;const e=Object.values(q),o=[],i={},r=z.find((t=>"cervix"===t.key&&t.show)),l=null==(t=null==r?void 0:r.data)?void 0:t.find((t=>3==+t.value));function s(t,e){const{key:n,range:o}=r||{},i=x(n,o,10),l=[0,e],s=[-e/t,0],a=[(L-i-e)/t,L-i],u=[D-P,t*(D-P)+e];let c=[],f=[];function d([n,o]){return Math.abs(o-t*n-e)<=1}function p([t,e]){const[n,o]=[...h([t,e])];return n>=P&&n<=D&&o>=i&&o<=L}function h([t,e]){return[P+t,L-e]}return d(l)&&p(l)&&(c=h(l)),d(s)&&p(s)&&(c=h(s)),d(a)&&p(a)&&(f=h(a)),d(u)&&p(u)&&(f=h(u)),[...c,...f]}e.forEach((t=>{if(!t.show)return;const{key:e}=t;switch(e){case"fetalPresentation":{const{range:i,show:r}=z.find((t=>t.key===e));if(r){const r=x(e,i,0);o.push(n([P,r,D,r],{...t}))}break}case"alert":if(l){const{key:e,range:a}=r||{},u=216e5,c={time:p(new Date(new Date(l.time).getTime()+u),"yyyy-MM-dd HH:mm"),value:10},[f,d]=[w(l.time)-P,L-x(e,a,l.value)],[h,g]=[w(c.time)-P,L-x(e,a,c.value)],v=(g-d)/(h-f),m=d-f*v,y=s(v,m);y.length>0&&(o.push(n(y,{...t})),Object.assign(i,{k:v,b:m}))}break;case"handling":if(l){const{k:e,b:r}=i,a=144e5,u=s(e,r-(w(p(new Date(new Date(l.time).getTime()+a),"yyyy-MM-dd HH:mm"))-w(l.time))*e);u.length>0&&o.push(n(u,{...t}))}}})),h.value.add(...o)}(),N(),function(){function t(t,e){const n=z.findIndex((e=>e.key===t.key));return{renderItem:()=>t.title,origin:{title:t.title,unit:t.unit,dataIndex:n,key:t.key},pointer:e}}g.event.evented&&h.value.on("mouse:up",(e=>{if(3===e.button){const{x:n=0,y:o=0}=e.pointer||{};n>=P&&n<=D&&o>=Y&&o<=L&&(y.point={x:n,y:o},y.show=!0,e.target?(y.target=e.target,y.list=["删除节点"],h.value.forEachObject((t=>{t.origin&&t.left===e.target.left&&t.top===e.target.top&&y.list.push({renderItem:()=>t.origin.title,origin:{...t.origin},mode:"remove",pointer:e.pointer})}))):(y.target=null,y.list=["新增节点"],z.filter((t=>t.show)).forEach((i=>{if(!S(n,"key",G).includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&o<F)return;y.list.push(t(i,e.pointer))}})),1===y.list.length&&(y.show=!1,j(),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const t=V-R/2;function e(t,e){if(!t.length)return;let o=Y;const i=[];t.forEach((t=>{const n=t.title.split("").join("\n"),s=O.findIndex((e=>e.key===t.key)),a=new u.Text(String(n),{...r,...t.titleStyle||{},originY:"top",left:e,top:o,lineHeight:1}),c=l(t.type,{left:e,top:o+a.height+3,...t.pointAttr,originY:"top",origin:{title:t.title,unit:t.unit,type:t.type,dataIndex:s,key:t.key,isMenu:!0},originLeft:e,originTop:o+a.height+3,...g.event});o+=a.height+c.height+15,function(t){function e(t){const{left:e,top:n}=t;return e>=P&&e<=D&&n>=Y&&n<=L}t.on("moving",(()=>{t.set("originY","center"),e(t)?(K(t),Q(t)):m.show=!1})),t.on("mouseup:before",(n=>{if(m.show=!1,0===n.e.button&&e(t))if(S(t.left,"key",G).includes(t.origin.key))j();else{const e={data:{time:b(t.left),value:T(t.origin.key,t.top)},...t.origin};v("add",e),J(e)}!function(t){t.setCoords().set({originY:"top",left:t.originLeft,top:t.originTop})}(t)}))}(c),i.push(a,c)})),n(i),h.value.add(...i)}function n(t){const e=t.at(-1),n=(L-Y)/2,o=(e.height+e.top-Y)/2;t.forEach((t=>{const e=t.top+n-o;t.set({top:e,originTop:e})}))}e(X,A/2),e(I,t)}(),{clickMenu:function({item:t,target:e}){const n={...t.origin};"remove"===t.mode?(v("remove",n),J(n,"remove")):(Object.assign(n,{data:{time:b(t.pointer.x),value:T(t.origin.key,t.pointer.y)}}),v("add",n),J(n))}}}export{h as useBirthProcess};
@@ -1 +1 @@
1
- import{ref as e,reactive as a,computed as l,onMounted as t,nextTick as u}from"vue";import{defaultBorderStyle as r}from"./useDraw.js";import"date-fns";import"../utils/index.js";import"lodash-es";import"./useShadow.js";import{useEvent as i,useCanvasEvent as s}from"./useEvent.js";import{useBirthProcess as n}from"./useBirthProcess.js";import{useCommon as d}from"./useCommon.js";function o(o,v,c,h){const m=e(),p=e(),g=e(),f=a({show:!1,point:{x:0,y:0},list:[]}),x=a({show:!1,point:{x:0,y:0},list:[],target:null}),w=l((()=>v.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),y=l((()=>v.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),V=l((()=>{var e;return(null==(e=y.value)?void 0:e.length)?30:0})),C=l((()=>{var e;return 30+(null==(e=w.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),A=l((()=>{var e;const{width:a}=v.data,l=null==(e=y.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-V.value-l})),Y=l((()=>v.data.grid.mainXCell)),j=l((()=>{const e=v.data.grid.mainYCell||14;return v.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),k=l((()=>(A.value-C.value)/Y.value)),S=l((()=>{const{xAxis:e,height:a}=v.data,l=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(j.value+l)})),b=l((()=>S.value)),P=l((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"cervix"===e.key)),[,l]=(null==a?void 0:a.range)||[0,10],t=(null==a?void 0:a.spaceValue)||1;return H.value-l*t*S.value})),H=l((()=>{const{height:e}=v.data;return e-S.value})),X=l((()=>new Date(v.data.xAxis.time.startTime).getTime())),T=l((()=>36e5/k.value)),W=l((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"cervix"===e.key));return((null==a?void 0:a.spaceValue)||1)/S.value})),F=l((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"FHR"===e.key));return((null==a?void 0:a.spaceValue)||10)/S.value})),M=l((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"fetalPresentation"===e.key));return((null==a?void 0:a.spaceValue)||1)/S.value})),R=l((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),D=a({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...r,...v.data.borderStyle},selectionStyle:v.data.selectionStyle||{},grid:v.data.grid,other:v.data.other,originX:C.value,endX:A.value,originY:b.value,endY:H.value,xCellWidth:k.value,yCellHeight:S.value,gridXNumber:Y.value,gridYNumber:j.value,xAxis:v.data.xAxis,leftScales:w.value,rightScales:y.value,leftAddAreaWidth:30,rightAddAreaWidth:V.value,startTime:X.value,timeXCell:T.value,cervixYCell:W.value,FHRYCell:F.value,fetalPresentationYCell:M.value,scaleValues:v.data.scaleValues,event:R.value,originYCervix:P.value}),N=d(o);return t((()=>{u((()=>{const{clickMenu:e}=n(o,D,c,f,x,N);g.value=e,i(h.value);const{select:a}=s(o,D,c);m.value=a}))})),{propItems:D,redrawPoints:p,select:m,pointTipProps:f,pointMenuProps:x,clickMenu:g}}export{o as default};
1
+ import{ref as e,reactive as a,computed as t,onMounted as l,nextTick as u}from"vue";import{defaultBorderStyle as r}from"./useDraw.js";import"date-fns";import"../utils/index.js";import"lodash-es";import"./useShadow.js";import{useEvent as i,useCanvasEvent as s}from"./useEvent.js";import{useBirthProcess as o}from"./useBirthProcess.js";import{useCommon as n}from"./useCommon.js";function d(d,v,c,h){const m=e(),p=e(),f=e(),g=a({show:!1,point:{x:0,y:0},list:[]}),x=a({show:!1,point:{x:0,y:0},list:[],target:null}),w=t((()=>v.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),y=t((()=>v.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),V=t((()=>{var e;return(null==(e=y.value)?void 0:e.length)?30:0})),A=t((()=>{var e;return 30+(null==(e=w.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),C=t((()=>{var e;const{width:a}=v.data,t=null==(e=y.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-V.value-t})),b=t((()=>v.data.grid.mainXCell)),j=t((()=>{const e=v.data.grid.mainYCell||14;return v.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),k=t((()=>(C.value-A.value)/b.value)),Y=t((()=>{const{xAxis:e,height:a}=v.data,t=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(j.value+t)})),S=t((()=>{const{xAxis:e}=v.data,a=Object.values(e).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0);return Y.value*a})),H=t((()=>{var e;const{scaleValues:a}=v.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!S.value)return S.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],u=(null==t?void 0:t.spaceValue)||1;return P.value-l*u*Y.value})),P=t((()=>{const{xAxis:e,height:a}=v.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-Y.value*t})),X=t((()=>new Date(v.data.xAxis.time.startTime).getTime())),F=t((()=>36e5/k.value)),R=t((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"cervix"===e.key));return((null==a?void 0:a.spaceValue)||1)/Y.value})),T=t((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"FHR"===e.key));return((null==a?void 0:a.spaceValue)||10)/Y.value})),W=t((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"fetalPresentation"===e.key));return((null==a?void 0:a.spaceValue)||1)/Y.value})),M=t((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),O=a({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...r,...v.data.borderStyle},selectionStyle:v.data.selectionStyle||{},grid:v.data.grid,other:v.data.other,originX:A.value,endX:C.value,originY:S.value,endY:P.value,xCellWidth:k.value,yCellHeight:Y.value,gridXNumber:b.value,gridYNumber:j.value,xAxis:v.data.xAxis,leftScales:w.value,rightScales:y.value,leftAddAreaWidth:30,rightAddAreaWidth:V.value,startTime:X.value,timeXCell:F.value,cervixYCell:R.value,FHRYCell:T.value,fetalPresentationYCell:W.value,scaleValues:v.data.scaleValues,event:M.value,originYCervix:H.value}),D=n(d);return l((()=>{u((()=>{const{clickMenu:e}=o(d,O,c,g,x,D);f.value=e,i(h.value);const{select:a}=s(d,O,c);m.value=a}))})),{propItems:O,redrawPoints:p,select:m,pointTipProps:g,pointMenuProps:x,clickMenu:f}}export{d as default};