cnhis-design-vue 3.1.51-beta.2 → 3.1.51-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/base-search/src/index.vue2.js +1 -1
- package/es/components/callback/index.d.ts +69 -0
- package/es/components/callback/index.js +1 -0
- package/es/components/callback/src/components/dialog/drawer.vue.d.ts +353 -0
- package/es/components/callback/src/components/dialog/drawer.vue.js +1 -0
- package/es/components/callback/src/components/dialog/drawer.vue2.js +1 -0
- package/es/components/callback/src/components/dialog/modal.vue.d.ts +166 -0
- package/es/components/callback/src/components/dialog/modal.vue.js +1 -0
- package/es/components/callback/src/components/dialog/modal.vue2.js +1 -0
- package/es/components/callback/src/components/popup/index.vue.d.ts +48 -0
- package/es/components/callback/src/components/popup/index.vue.js +1 -0
- package/es/components/callback/src/components/render/drawerIframe/index.vue.d.ts +62 -0
- package/es/components/callback/src/components/render/drawerIframe/index.vue.js +1 -0
- package/es/components/callback/src/components/render/drawerIframe/index.vue2.js +1 -0
- package/es/components/callback/src/components/render/enums.d.ts +5 -0
- package/es/components/callback/src/components/render/enums.js +1 -0
- package/es/components/callback/src/components/render/index.vue.d.ts +57 -0
- package/es/components/callback/src/components/render/index.vue.js +1 -0
- package/es/components/callback/src/components/render/popupMaps.d.ts +5702 -0
- package/es/components/callback/src/components/render/popupMaps.js +1 -0
- package/es/components/callback/src/index.vue.d.ts +68 -0
- package/es/components/callback/src/index.vue.js +1 -0
- package/es/components/callback/src/index.vue2.js +1 -0
- package/es/components/callback/src/types/index.d.ts +11 -0
- package/es/components/callback/style/callback-iconfont.ttf +0 -0
- package/es/components/callback/style/index.css +1 -0
- package/es/components/classification/src/index.vue2.js +1 -1
- package/es/components/expand-field/index.d.ts +0 -13
- package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +0 -13
- package/es/components/expand-field/src/components/PersonModal.vue.d.ts +0 -13
- package/es/components/expand-field/src/components/PersonModal.vue2.js +1 -1
- package/es/components/expand-field/src/components/form.vue.d.ts +0 -13
- package/es/components/expand-field/src/index.vue.d.ts +0 -13
- package/es/components/expand-field/src/index.vue2.js +1 -1
- package/es/components/fabric-chart/index.d.ts +5 -6
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +5 -6
- package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
- package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
- package/es/components/fabric-chart/src/components/PopupTip.vue.d.ts +0 -6
- package/es/components/fabric-chart/src/components/PopupTip.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/style/index.css +1 -1
- package/es/components/form-config/index.d.ts +6 -2
- package/es/components/form-config/src/FormConfig.vue.d.ts +6 -2
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +3 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -1
- package/es/components/form-render/index.d.ts +3 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +3 -1
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +3 -1
- package/es/components/form-render/src/components/renderer/remoteSearch.js +1 -1
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/hooks/useFormEvent.d.ts +3 -1
- package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
- package/es/components/form-render/src/types/index.d.ts +4 -1
- package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/keyboardEventPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.d.ts +2 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useSelectOption.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +27 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.d.ts +2 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/separateUtils.d.ts +4 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/separateUtils.js +1 -1
- package/es/components/iho-table/src/plugins/varialbleHeightPlugin/index.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +8 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +5 -3
- package/es/components/index.js +1 -1
- package/es/components/info-header/index.d.ts +6 -2
- package/es/components/info-header/src/InfoHeader.vue.d.ts +6 -2
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +3 -1
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +3 -1
- package/es/components/scale-view/src/hooks/use-component.d.ts +615 -255
- package/es/components/select-label/index.d.ts +617 -256
- package/es/components/select-label/index.js +1 -1
- package/es/components/{iho-select-label/src/LabelFormContent.vue.d.ts → select-label/src/ihoLabel/IhoLabelFormContent.vue.d.ts} +5 -5
- package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue.js +1 -0
- package/es/components/select-label/src/ihoLabel/IhoLabelFormContent.vue2.js +1 -0
- package/es/components/{iho-select-label/src/SelectLabel.vue.d.ts → select-label/src/ihoLabel/IhoSelectLabel.vue.d.ts} +7 -7
- package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue.js +1 -0
- package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -0
- package/es/components/{iho-select-label/src/components/label-classify.vue.d.ts → select-label/src/ihoLabel/iho-label-classify.vue.d.ts} +1 -1
- package/es/components/select-label/src/ihoLabel/iho-label-classify.vue.js +1 -0
- package/es/components/select-label/src/ihoLabel/iho-label-classify.vue2.js +1 -0
- package/es/components/select-label/src/index.vue.d.ts +899 -0
- package/es/components/select-label/src/index.vue.js +1 -0
- package/es/components/select-label/src/index.vue2.js +1 -0
- package/es/components/shortcut-provider/src/hooks/useShortcuts.d.ts +1 -0
- package/es/components/shortcut-provider/src/hooks/useShortcuts.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +4 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +4 -1
- package/es/components/slider-tree/index.d.ts +153 -0
- package/es/components/slider-tree/index.js +1 -0
- package/es/components/slider-tree/src/hooks/useAsyncData.d.ts +6 -0
- package/es/components/slider-tree/src/hooks/useAsyncData.js +1 -0
- package/es/components/slider-tree/src/index.vue.d.ts +152 -0
- package/es/components/slider-tree/src/index.vue.js +1 -0
- package/es/components/slider-tree/src/index.vue2.js +1 -0
- package/es/components/slider-tree/src/utils/index.d.ts +1 -0
- package/es/components/slider-tree/src/utils/index.js +1 -0
- package/es/components/slider-tree/style/index.css +1 -0
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +1 -1
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
- package/es/shared/directive/flexibleResize.d.ts +4 -0
- package/es/{components/classification/src → shared}/directive/flexibleResize.js +1 -1
- package/es/shared/directive/index.d.ts +1 -0
- package/es/shared/directive/index.js +1 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/business.d.ts +7 -0
- package/es/shared/utils/index.js +1 -1
- package/package.json +2 -2
- package/es/components/classification/src/directive/flexibleResize.d.ts +0 -28
- package/es/components/iho-select-label/index.d.ts +0 -363
- package/es/components/iho-select-label/index.js +0 -1
- package/es/components/iho-select-label/src/LabelFormContent.vue.js +0 -1
- package/es/components/iho-select-label/src/LabelFormContent.vue2.js +0 -1
- package/es/components/iho-select-label/src/SelectLabel.vue.js +0 -1
- package/es/components/iho-select-label/src/SelectLabel.vue2.js +0 -1
- package/es/components/iho-select-label/src/components/label-classify.vue.js +0 -1
- package/es/components/iho-select-label/src/components/label-classify.vue2.js +0 -1
- package/es/components/iho-select-label/style/iho-select-label-iconfont.ttf +0 -0
- package/es/components/iho-select-label/style/index.css +0 -1
- package/es/components/table-filter/src/types/tool.d.ts +0 -7
- /package/es/components/{iho-select-label → callback}/src/types/index.js +0 -0
- /package/es/components/{iho-select-label → select-label}/src/types/index.d.ts +0 -0
- /package/es/components/{table-filter/src/types/tool.js → select-label/src/types/index.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CallbackTypeEnums as o}from"./enums.js";import e from"../../../../form-render/index.js";import r from"../../../../iho-table/index.js";import p from"./drawerIframe/index.vue.js";const m=new Map([[o.FORM,{component:e,props:{consumer:!0},style:{}}],[o.TABLE_LIST,{component:r,props:{},style:{}}],[o.PAGE,{component:p,props:{clearable:!0,options:[],filterable:!0,multiple:!1}}]]);export{m as CallbackMaps};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
config: {
|
|
3
|
+
type: ObjectConstructor;
|
|
4
|
+
};
|
|
5
|
+
callbackApiConfig: {
|
|
6
|
+
type: ObjectConstructor;
|
|
7
|
+
};
|
|
8
|
+
}, {
|
|
9
|
+
emit: (event: "closeModal", ...args: any[]) => void;
|
|
10
|
+
closeModal: (bool: boolean) => void;
|
|
11
|
+
CallbackPopup: import("vue").DefineComponent<{
|
|
12
|
+
options: {
|
|
13
|
+
type: ObjectConstructor;
|
|
14
|
+
default: () => {
|
|
15
|
+
visible: boolean;
|
|
16
|
+
type: string;
|
|
17
|
+
code: string;
|
|
18
|
+
targetId: string;
|
|
19
|
+
targetName: string;
|
|
20
|
+
openWindowType: string;
|
|
21
|
+
params: string;
|
|
22
|
+
page: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
callbackApiConfig: {
|
|
26
|
+
type: ObjectConstructor;
|
|
27
|
+
};
|
|
28
|
+
}, any, {
|
|
29
|
+
initialProps: {};
|
|
30
|
+
dialogVisible: any;
|
|
31
|
+
}, {}, {
|
|
32
|
+
generateModal(cfg: any): import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}>;
|
|
35
|
+
onClose(): Promise<void>;
|
|
36
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "closeModal"[], "closeModal", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
37
|
+
options: {
|
|
38
|
+
type: ObjectConstructor;
|
|
39
|
+
default: () => {
|
|
40
|
+
visible: boolean;
|
|
41
|
+
type: string;
|
|
42
|
+
code: string;
|
|
43
|
+
targetId: string;
|
|
44
|
+
targetName: string;
|
|
45
|
+
openWindowType: string;
|
|
46
|
+
params: string;
|
|
47
|
+
page: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
callbackApiConfig: {
|
|
51
|
+
type: ObjectConstructor;
|
|
52
|
+
};
|
|
53
|
+
}>> & {
|
|
54
|
+
onCloseModal?: ((...args: any[]) => any) | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
options: Record<string, any>;
|
|
57
|
+
}>;
|
|
58
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "closeModal"[], "closeModal", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
59
|
+
config: {
|
|
60
|
+
type: ObjectConstructor;
|
|
61
|
+
};
|
|
62
|
+
callbackApiConfig: {
|
|
63
|
+
type: ObjectConstructor;
|
|
64
|
+
};
|
|
65
|
+
}>> & {
|
|
66
|
+
onCloseModal?: ((...args: any[]) => any) | undefined;
|
|
67
|
+
}, {}>;
|
|
68
|
+
export default _default;
|
|
@@ -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 o,openBlock as e,createBlock as i}from"vue";import n from"./components/popup/index.vue.js";var p=o({__name:"index",props:{config:{type:Object},callbackApiConfig:{type:Object}},emits:["closeModal"],setup(o,{emit:p}){function l(o){p("closeModal",o)}return(p,c)=>(e(),i(n,{options:o.config,callbackApiConfig:o.callbackApiConfig,onCloseModal:l},null,8,["options","callbackApiConfig"]))}});export{p as default};
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@font-face{font-family:callback-iconfont;src:url(callback-iconfont.ttf) format("truetype")}.iconfont-callback{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;cursor:pointer;font-family:callback-iconfont!important;font-size:16px;font-style:normal}.icon-callback-menzhenyishengzhanxitongtubiaoguanbi:before{content:"\e76e"}.icon-callback-menzhenyishengzhanxitongtubiaozuixiaohua:before{content:"\e778"}.icon-callback-menzhenyishengzhanxitongtubiaozuidahua:before{content:"\e779"}.callback-drawer-block .n-drawer-header .n-drawer-header__main{width:100%}.callback-drawer-block .n-drawer-header .n-drawer-header__main .d-header{align-items:center;display:flex;justify-content:space-between;width:100%}.callback-drawer-block .n-drawer-header .n-drawer-header__main .d-header .title{font-size:18px;margin:0;padding:0}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as i,ref as n,provide as l,computed as t,onMounted as a,nextTick as s,watch as o,openBlock as d,createElementBlock as c,normalizeClass as r,unref as h,normalizeStyle as u,withDirectives as f,createVNode as p,createTextVNode as m,toDisplayString as g,createCommentVNode as v,createElementVNode as C,Fragment as y,renderList as k,createBlock as S,withCtx as b}from"vue";import{useMessage as x,NIcon as O,NTooltip as _}from"naive-ui";import{Repeat as w,SettingsOutline as I,ChevronDown as L,ChevronForward as N,Checkmark as z,Close as j,ChevronUp as B}from"@vicons/ionicons5";import P from"./components/set-classification/index.vue.js";import J from"./directive/flexibleResize.js";import{InjectionFilterApiConfig as M}from"../../table-filter/src/constants/index.js";import{root_isShowResetButton as A}from"./const/index.js";import E from"../../table-filter/src/hooks/useMixins.js";import F from"../../table-filter/src/hooks/useAdvanced.js";const T={key:0,class:"header"},R={class:"tree"},W=["onClick"],q=["onClick"],G=["onClick"],Q={class:"child-item-name"},$={key:1,class:"tree-type-footer"},D={class:"selected-num"},V=C("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=C("i",{class:"iconfont-table-filter icon-table-filter-menzhenyishengzhananniushanchu2"},null,-1),te={class:"name"},ae={class:"name"},se={key:0,class:"main-wrapper"},oe=["onClick"],de={class:"tree-footer"},ce=["onClick"],re=["onClick"],he={key:0,class:"select-type-footer"},ue={class:"selected-num"},fe=C("i",{class:"iconfont-table-filter icon-table-filter-menzhenyishengzhananniushanchu2"},null,-1);var pe=e({__name:"index",props:{tableId:{type:String,default:""},searchFieldList:{type:Array,default:()=>[]},conditionMap:{type:Object,default:()=>({})},conditionSid:{type:Array,default:()=>["all_data"]},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:pe}){const me=e,{handleGetConfigApi:ge}=E(),{transformClassifyChild:ve}=F(),Ce=i(),ye=x(),ke=n(null);let Se=n(150),be=n(!1),xe=n([]),Oe=n([]),_e=n([]),we=n(2),Ie=n({name:"全部数据",sid:"all_data"}),Le=n([]),Ne=n(""),ze=n(!1),je=n("全部数据");l(A,me.isShowResetButton),l(M,me.filterApiConfig);let Be=t((()=>0===we.value?{marginRight:"8px"}:2===we.value?{display:"inline-block"}:{})),Pe=t((()=>{let e=Oe.value.filter((e=>-1!==me.conditionSid.indexOf(e.sid)));if(-1!==me.conditionSid.indexOf("all_data"))return"全部数据";{let i=[];return e.map((e=>{i.push(e.name)})),i.join(",")}})),Je=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 xe.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,me.conditionSid));We(!1);const t=ve(null==e?void 0:e.conObj,me.searchFieldList);pe("changeSearch",Boolean("all_data"===e.sid),e,t,n,l)}function Ee(){let e="";if(2===we.value)e=0;else{let i=we.value;e=++i}Se.value=150,Fe(e)}async function Fe(e,i){let n={tableId:me.tableId,setting:JSON.stringify({classificationIndex:e,classificationWidth:i})};try{await ge(n,"requestSaveListPersonaSetting",{},me.filterApiConfig)&&pe("setClassificationIndex",e)}catch(e){console.log(e)}}function Te(){ze.value=!0,We(!1)}function Re(e){ze.value=e}function We(e){be.value=void 0===e?!be.value:e}function qe(){if(!me.tableId)return ye.warning("请传入tableId");xe.value=[];let{displayCategoryList:e=[],conditionList:i=[]}=me.conditionMap;Le.value=JSON.parse(JSON.stringify(e))||[],_e.value=JSON.parse(JSON.stringify(i)),Oe.value=JSON.parse(JSON.stringify([{name:"全部数据",sid:"all_data"},...i]));let n=[];var l;0===Le.value.length&&(Le.value=["未分类"]),Le.value.forEach((e=>{let i={name:e,children:[]};Oe.value.forEach((n=>{if(n.displayCategory===e||!n.displayCategory&&"未分类"===e&&"all_data"!==n.sid){if(-1!==me.conditionSid.indexOf(n.sid)){n.selected=!0,i.open=!0;const e=ve(null==n?void 0:n.conObj,me.searchFieldList);pe("changeSearch",!1,n,e)}n.isShow&&i.children.push(n)}})),i.children.length>0&&n.push(i)})),n.unshift({name:"全部数据",sid:"all_data"}),xe.value=n,0===we.value&&(l=!0,xe.value.forEach((e=>{e.children&&e.children.length&&(e.open=l)})))}function Ge({distance:e}){const i=Se.value+e;Se.value=Math.min(Math.max(i,50),650)}function Qe(){Fe(we.value,Se.value)}async function $e(){await Ke(me.tableId),Ve()}async function De(e){await Ke(me.tableId),He()}function Ve(e){He(e).then((e=>({})))}function He(e,i={}){if(!me.tableId)return new Promise((e=>e(!1)));let n=Object.keys(i).length>0?i:JSON.parse(JSON.stringify(me.conditionMap));return new Promise(((i,l)=>{var t,a,s,o,d,c,r;if(Object.keys(n).length>0){_e.value=n.conditionList||[],Le.value=n.displayCategoryList||[];let l={conditionList:_e.value,displayCategoryList:Le.value};pe("getQuickSearchListObj",l),Ne.value=null!=(t=n.settingId)?t:"";const h=_e.value.find((e=>e.isDefault))||{name:"全部数据",sid:"all_data"};(null==(s=null==(a=Ce.tableOptions)?void 0:a.filterCondition)?void 0:s.displayCategory)&&e&&i({name:null==(d=null==(o=Ce.tableOptions)?void 0:o.filterCondition)?void 0:d.name,sid:null==(r=null==(c=Ce.tableOptions)?void 0:c.filterCondition)?void 0:r.displayCategory}),i(h)}else i({})}))}async function Ke(e){try{if(!e)return new Promise((e=>e(!1)));let i={tableId:e},n=await ge(i,"requestTableCondiTionList",{},me.filterApiConfig);return Promise.resolve(n)}catch(e){return Promise.resolve(!1)}}function Ue(e,i){return i&&e&&"1"===i?e.replace(/\(公共\)$/,""):e}return a((()=>{document.addEventListener("click",(e=>{s((()=>{let i=e.composedPath&&e.composedPath();ke.value&&i.includes(ke.value)||We(!1)}))}))})),o((()=>me.tableId),(e=>{e&&Ve(!0)}),{immediate:!0,deep:!0}),o((()=>me.curClassificationIndex),(e=>{void 0!==e&&(we.value=e,qe())}),{immediate:!0,deep:!0}),o((()=>me.curClassificationWidth),(e=>{e&&(Se.value=Number(e)||150)}),{immediate:!0}),o((()=>me.conditionMap),(e=>{!async function(){try{await qe()}catch(e){console.log(e)}}()}),{immediate:!0,deep:!0}),(i,n)=>(d(),c("div",{class:r(["classification-block","classificationIndex-"+h(we)]),style:u(h(Be))},[0===h(we)?f((d(),c("div",{key:0,class:"tree-type classify-0",style:u({width:h(Se)+"px",paddingBottom:1!=e.hideClearConditionChange?"80px":0,position:"relative"})},[1!=e.hideConditionChangeBtn||1!=e.hideConditionChangeSetting?(d(),c("div",T,[1!=e.hideConditionChangeBtn?(d(),c("span",{key:0,class:"header-1",onClick:Ee},[p(h(O),{component:h(w),size:"16"},null,8,["component"]),m(" "+g("切换"))])):v("v-if",!0),1!=e.hideConditionChangeSetting?(d(),c("span",{key:1,class:"header-1",onClick:Te},[p(h(O),{component:h(I),size:"16"},null,8,["component"]),m(" "+g("设置"))])):v("v-if",!0)])):v("v-if",!0),C("ul",R,[(d(!0),c(y,null,k(h(xe),((i,n)=>(d(),c(y,null,[0===n||!i.children||0===i.children.length||i.children&&0!==i.children.filter((e=>e.isShow)).length?(d(),c("li",{key:n,class:r(["tree-item",{"tree-header":0===n||!i.children||0===i.children.length}])},[0!==n&&i.children&&0!==i.children.length?(d(),c(y,{key:1},[C("span",{class:r(["parent",{open:i.open}]),onClick:e=>Me(i)},[C("span",null,g(i.name),1),p(h(O),{component:i.open?h(L):h(N)},null,8,["component"])],10,q),i.open?(d(!0),c(y,{key:0},k(i.children.filter((e=>e.isShow)),((e,n)=>(d(),c("div",{key:n,class:"children",onClick:n=>Ae(e,0,i)},[e.isShow?(d(),S(h(_),{key:0,trigger:"hover",placement:"right"},{trigger:b((()=>[C("span",{class:r(["child-item",{selected:e.selected}])},[C("span",Q,g(Ue(e.name,null==e?void 0:e.isPublic)),1),e.selected?(d(),S(h(O),{key:0,component:h(z),size:"20"},null,8,["component"])):v("v-if",!0)],2)])),default:b((()=>[C("span",null,g(h(Je)(e)),1)])),_:2},1024)):v("v-if",!0)],8,G)))),128)):v("v-if",!0)],64)):(d(),c("span",{key:0,class:r(["child-item header-item",{selected:i.selected||-1!==e.conditionSid.indexOf("all_data")}]),onClick:e=>Ae(i)},g(i.name),11,W))],2)):v("v-if",!0)],64)))),256))]),1!=e.hideClearConditionChange?(d(),c("div",$,[C("div",D,"已选择"+g(e.conditionSid.filter((e=>"all_data"!==e)).length)+"项",1),C("div",{class:"selected-item-del",onClick:n[0]||(n[0]=e=>Ae({sid:"all_data",name:"全部数据",digital:h(Ie).digital}))},[V,m(" 清空筛选 ")])])):v("v-if",!0)],4)),[[h(J),{mode:"VR",onMove:Ge,onEnd:Qe}]]):v("v-if",!0),1===h(we)?(d(),c(y,{key:1},[1!=e.hideConditionChangeBtn||1!=e.hideConditionChangeSetting||1!=e.hideConditionChangeSetting||h(_e).filter((e=>e.isShow)).length>0?(d(),c("div",H,[1!=e.hideConditionChangeBtn||1!=e.hideConditionChangeSetting?(d(),c("div",K,[C("span",{class:r(["all-data",{selected:-1!==e.conditionSid.indexOf("all_data")}]),onClick:n[1]||(n[1]=e=>Ae({sid:"all_data",name:"全部数据",digital:h(Ie).digital}))},[m(" 全部数据 "),h(Ie).digital||0===h(Ie).digital?(d(),c(y,{key:0},[m(" ("+g(h(Ie).digital||0)+") ",1)],64)):v("v-if",!0)],2),C("div",U,[1!=e.hideConditionChangeBtn?(d(),c("span",{key:0,class:"setting-1",onClick:Ee,style:{"margin-right":"30px"}},[p(h(O),{component:h(w),size:"16"},null,8,["component"]),m(" "+g("切换"))])):v("v-if",!0),1!=e.hideConditionChangeSetting?(d(),c("span",{key:1,class:"setting-1",onClick:Te},[p(h(O),{component:h(I),size:"16"},null,8,["component"]),m(" "+g("设置"))])):v("v-if",!0)])])):v("v-if",!0),C("ul",{class:"tile",style:u({borderBottom:1!=e.hideClearConditionChange?"1px solid #d5d5d5":0})},[(d(!0),c(y,null,k(h(xe).slice(1),((e,i)=>(d(),c(y,null,[e.children&&e.children.length>0?(d(),c("li",{class:"tile-item",key:i},[e.children&&0!==e.children.length?(d(),c(y,{key:1},[C("span",Y,g(e.name),1),C("div",Z,[(d(!0),c(y,null,k(e.children,((i,n)=>(d(),c(y,null,[i.isShow?(d(),c("span",{key:n,class:r(["child-item",{selected:i.selected}]),onClick:n=>Ae(i,0,e)},g(Ue(i.name,null==i?void 0:i.isPublic)),11,ee)):v("v-if",!0)],64)))),256))])],64)):(d(),c("span",{key:0,class:r(["child-item",{selected:e.selected}]),style:{"padding-left":"17px"},onClick:i=>Ae(e)},g(e.name)+" "+g(e.digital),11,X))])):v("v-if",!0)],64)))),256))],4),1!=e.hideClearConditionChange?(d(),c("div",ie,[C("div",ne,"已选择"+g(e.conditionSid.filter((e=>"all_data"!==e)).length)+"项",1),(d(!0),c(y,null,k(h(xe).slice(1),(e=>(d(),c(y,null,[e.children&&0!==e.children.length?(d(!0),c(y,{key:1},k(e.children,((i,n)=>(d(),c(y,null,[i.selected?(d(),c("div",{class:"selected-item",key:i.sid},[m(g(i.name)+" ",1),p(h(O),{component:h(j),onClick:n=>Ae(i,0,e)},null,8,["component","onClick"])])):v("v-if",!0)],64)))),256)):(d(),c("div",{class:"selected-item",key:e.sid},[m(g(e.name)+" ",1),p(h(O),{component:h(j),onClick:i=>Ae(e)},null,8,["component","onClick"])]))],64)))),256)),C("div",{class:"selected-item-del",onClick:n[2]||(n[2]=e=>Ae({sid:"all_data",name:"全部数据",digital:h(Ie).digital}))},[le,m(" 清空筛选 ")])])):v("v-if",!0)])):v("v-if",!0)],64)):v("v-if",!0),2===h(we)?(d(),c("div",{key:2,class:"select-type classify-2",ref_key:"selectType",ref:ke},[C("span",{class:"title",onClick:n[3]||(n[3]=()=>We())},[p(h(_),{trigger:"hover",placement:"top"},{trigger:b((()=>[C("span",te,g(h(Pe)),1)])),default:b((()=>[C("span",ae,g(h(Pe)),1)])),_:1}),p(h(O),{component:h(be)?h(B):h(L)},null,8,["component"])]),h(be)?(d(),c("div",se,[C("ul",{class:"tree",style:u({padding:1!=e.hideClearConditionChange?"40px 0":"40px 0 0"})},[(d(!0),c(y,null,k(h(xe),((i,n)=>(d(),c(y,null,[0===n||!i.children||0===i.children.length||i.children&&0!==i.children.filter((e=>e.isShow)).length?(d(),c("li",{key:n,class:r(["tree-item",{"tree-header":0===n||!i.children||0===i.children.length}])},[0!==n&&i.children&&0!==i.children.length?(d(),c(y,{key:1},[0!==i.children.filter((e=>e.isShow)).length?(d(),c("span",{key:0,class:r(["parent",{open:i.open}]),onClick:e=>Me(i)},[m(g(i.name)+g(i.digital||0===i.digital?"("+i.digital+")":"")+" ",1),p(h(O),{component:i.open?h(L):h(N)},null,8,["component"])],10,ce)):v("v-if",!0),i.open?(d(!0),c(y,{key:1},k(i.children.filter((e=>e.isShow)),((e,n)=>(d(),c("div",{key:n,class:"children",onClick:n=>Ae(e,0,i)},[e.isShow?(d(),S(h(_),{key:0,placement:"right",trigger:"hover","z-index":1e4},{trigger:b((()=>[C("span",{class:r(["child-item",{selected:e.selected}])},[C("span",null,g(Ue(e.name,null==e?void 0:e.isPublic)),1),e.selected?(d(),S(h(O),{key:0,component:h(z),size:"20"},null,8,["component"])):v("v-if",!0)],2)])),default:b((()=>[C("span",null,g(h(Je)(e)),1)])),_:2},1024)):v("v-if",!0)],8,re)))),128)):v("v-if",!0)],64)):(d(),c(y,{key:0},[C("span",{class:r(["child-item child-header header-item",{selected:i.selected||-1!==e.conditionSid.indexOf("all_data")}]),onClick:e=>Ae(i)},g(i.name),11,oe),C("div",de,[1!=e.hideConditionChangeBtn?(d(),c("span",{key:0,class:"tree-footer-icon",onClick:Ee},[p(h(O),{component:h(w),size:"16"},null,8,["component"]),m(" "+g("切换"))])):v("v-if",!0),1!=e.hideConditionChangeSetting?(d(),c("span",{key:1,class:"tree-footer-icon",onClick:Te},[p(h(O),{component:h(I),size:"16"},null,8,["component"]),m(" "+g("设置"))])):v("v-if",!0)])],64))],2)):v("v-if",!0)],64)))),256))],4),1!=e.hideClearConditionChange?(d(),c("div",he,[C("div",ue,"已选择"+g(e.conditionSid.filter((e=>"all_data"!==e)).length)+"项",1),C("div",{class:"selected-item-del",onClick:n[4]||(n[4]=e=>Ae({sid:"all_data",name:"全部数据",digital:h(Ie).digital}))},[fe,m(" 清空筛选 ")])])):v("v-if",!0)])):v("v-if",!0)],512)):v("v-if",!0),v(" 弹出弹窗 "),p(P,{ref:"search",searchFieldList:e.searchFieldList,conditionList:h(_e),displayCategoryList:h(Le),settingId:h(Ne),tableId:e.tableId,classifyModal:h(ze),onSaveGetTableCondiTionList:De,onCondiTionListInit:$e,onSetClassifyModal:Re},null,8,["searchFieldList","conditionList","displayCategoryList","settingId","tableId","classifyModal"])],6))}});export{pe as default};
|
|
1
|
+
import{defineComponent as e,useAttrs as i,ref as n,provide as l,computed as t,onMounted as a,nextTick as s,watch as o,openBlock as d,createElementBlock as c,normalizeClass as r,unref as h,normalizeStyle as u,withDirectives as f,createVNode as p,createTextVNode as m,toDisplayString as g,createCommentVNode as v,createElementVNode as C,Fragment as y,renderList as k,createBlock as S,withCtx as b}from"vue";import{useMessage as x,NIcon as O,NTooltip as _}from"naive-ui";import{Repeat as w,SettingsOutline as I,ChevronDown as L,ChevronForward as N,Checkmark as z,Close as j,ChevronUp as B}from"@vicons/ionicons5";import P from"./components/set-classification/index.vue.js";import{vFlexibleResize as J}from"../../../shared/directive/flexibleResize.js";import{InjectionFilterApiConfig as M}from"../../table-filter/src/constants/index.js";import{root_isShowResetButton as A}from"./const/index.js";import E from"../../table-filter/src/hooks/useMixins.js";import F from"../../table-filter/src/hooks/useAdvanced.js";const T={key:0,class:"header"},R={class:"tree"},W=["onClick"],q=["onClick"],G=["onClick"],Q={class:"child-item-name"},$={key:1,class:"tree-type-footer"},D={class:"selected-num"},V=C("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=C("i",{class:"iconfont-table-filter icon-table-filter-menzhenyishengzhananniushanchu2"},null,-1),te={class:"name"},ae={class:"name"},se={key:0,class:"main-wrapper"},oe=["onClick"],de={class:"tree-footer"},ce=["onClick"],re=["onClick"],he={key:0,class:"select-type-footer"},ue={class:"selected-num"},fe=C("i",{class:"iconfont-table-filter icon-table-filter-menzhenyishengzhananniushanchu2"},null,-1);var pe=e({__name:"index",props:{tableId:{type:String,default:""},searchFieldList:{type:Array,default:()=>[]},conditionMap:{type:Object,default:()=>({})},conditionSid:{type:Array,default:()=>["all_data"]},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:pe}){const me=e,{handleGetConfigApi:ge}=E(),{transformClassifyChild:ve}=F(),Ce=i(),ye=x(),ke=n(null);let Se=n(150),be=n(!1),xe=n([]),Oe=n([]),_e=n([]),we=n(2),Ie=n({name:"全部数据",sid:"all_data"}),Le=n([]),Ne=n(""),ze=n(!1),je=n("全部数据");l(A,me.isShowResetButton),l(M,me.filterApiConfig);let Be=t((()=>0===we.value?{marginRight:"8px"}:2===we.value?{display:"inline-block"}:{})),Pe=t((()=>{let e=Oe.value.filter((e=>-1!==me.conditionSid.indexOf(e.sid)));if(-1!==me.conditionSid.indexOf("all_data"))return"全部数据";{let i=[];return e.map((e=>{i.push(e.name)})),i.join(",")}})),Je=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 xe.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,me.conditionSid));We(!1);const t=ve(null==e?void 0:e.conObj,me.searchFieldList);pe("changeSearch",Boolean("all_data"===e.sid),e,t,n,l)}function Ee(){let e="";if(2===we.value)e=0;else{let i=we.value;e=++i}Se.value=150,Fe(e)}async function Fe(e,i){let n={tableId:me.tableId,setting:JSON.stringify({classificationIndex:e,classificationWidth:i})};try{await ge(n,"requestSaveListPersonaSetting",{},me.filterApiConfig)&&pe("setClassificationIndex",e)}catch(e){console.log(e)}}function Te(){ze.value=!0,We(!1)}function Re(e){ze.value=e}function We(e){be.value=void 0===e?!be.value:e}function qe(){if(!me.tableId)return ye.warning("请传入tableId");xe.value=[];let{displayCategoryList:e=[],conditionList:i=[]}=me.conditionMap;Le.value=JSON.parse(JSON.stringify(e))||[],_e.value=JSON.parse(JSON.stringify(i)),Oe.value=JSON.parse(JSON.stringify([{name:"全部数据",sid:"all_data"},...i]));let n=[];var l;0===Le.value.length&&(Le.value=["未分类"]),Le.value.forEach((e=>{let i={name:e,children:[]};Oe.value.forEach((n=>{if(n.displayCategory===e||!n.displayCategory&&"未分类"===e&&"all_data"!==n.sid){if(-1!==me.conditionSid.indexOf(n.sid)){n.selected=!0,i.open=!0;const e=ve(null==n?void 0:n.conObj,me.searchFieldList);pe("changeSearch",!1,n,e)}n.isShow&&i.children.push(n)}})),i.children.length>0&&n.push(i)})),n.unshift({name:"全部数据",sid:"all_data"}),xe.value=n,0===we.value&&(l=!0,xe.value.forEach((e=>{e.children&&e.children.length&&(e.open=l)})))}function Ge({distance:e}){const i=Se.value+e;Se.value=Math.min(Math.max(i,50),650)}function Qe(){Fe(we.value,Se.value)}async function $e(){await Ke(me.tableId),Ve()}async function De(e){await Ke(me.tableId),He()}function Ve(e){He(e).then((e=>({})))}function He(e,i={}){if(!me.tableId)return new Promise((e=>e(!1)));let n=Object.keys(i).length>0?i:JSON.parse(JSON.stringify(me.conditionMap));return new Promise(((i,l)=>{var t,a,s,o,d,c,r;if(Object.keys(n).length>0){_e.value=n.conditionList||[],Le.value=n.displayCategoryList||[];let l={conditionList:_e.value,displayCategoryList:Le.value};pe("getQuickSearchListObj",l),Ne.value=null!=(t=n.settingId)?t:"";const h=_e.value.find((e=>e.isDefault))||{name:"全部数据",sid:"all_data"};(null==(s=null==(a=Ce.tableOptions)?void 0:a.filterCondition)?void 0:s.displayCategory)&&e&&i({name:null==(d=null==(o=Ce.tableOptions)?void 0:o.filterCondition)?void 0:d.name,sid:null==(r=null==(c=Ce.tableOptions)?void 0:c.filterCondition)?void 0:r.displayCategory}),i(h)}else i({})}))}async function Ke(e){try{if(!e)return new Promise((e=>e(!1)));let i={tableId:e},n=await ge(i,"requestTableCondiTionList",{},me.filterApiConfig);return Promise.resolve(n)}catch(e){return Promise.resolve(!1)}}function Ue(e,i){return i&&e&&"1"===i?e.replace(/\(公共\)$/,""):e}return a((()=>{document.addEventListener("click",(e=>{s((()=>{let i=e.composedPath&&e.composedPath();ke.value&&i.includes(ke.value)||We(!1)}))}))})),o((()=>me.tableId),(e=>{e&&Ve(!0)}),{immediate:!0,deep:!0}),o((()=>me.curClassificationIndex),(e=>{void 0!==e&&(we.value=e,qe())}),{immediate:!0,deep:!0}),o((()=>me.curClassificationWidth),(e=>{e&&(Se.value=Number(e)||150)}),{immediate:!0}),o((()=>me.conditionMap),(e=>{!async function(){try{await qe()}catch(e){console.log(e)}}()}),{immediate:!0,deep:!0}),(i,n)=>(d(),c("div",{class:r(["classification-block","classificationIndex-"+h(we)]),style:u(h(Be))},[0===h(we)?f((d(),c("div",{key:0,class:"tree-type classify-0",style:u({width:h(Se)+"px",paddingBottom:1!=e.hideClearConditionChange?"80px":0,position:"relative"})},[1!=e.hideConditionChangeBtn||1!=e.hideConditionChangeSetting?(d(),c("div",T,[1!=e.hideConditionChangeBtn?(d(),c("span",{key:0,class:"header-1",onClick:Ee},[p(h(O),{component:h(w),size:"16"},null,8,["component"]),m(" "+g("切换"))])):v("v-if",!0),1!=e.hideConditionChangeSetting?(d(),c("span",{key:1,class:"header-1",onClick:Te},[p(h(O),{component:h(I),size:"16"},null,8,["component"]),m(" "+g("设置"))])):v("v-if",!0)])):v("v-if",!0),C("ul",R,[(d(!0),c(y,null,k(h(xe),((i,n)=>(d(),c(y,null,[0===n||!i.children||0===i.children.length||i.children&&0!==i.children.filter((e=>e.isShow)).length?(d(),c("li",{key:n,class:r(["tree-item",{"tree-header":0===n||!i.children||0===i.children.length}])},[0!==n&&i.children&&0!==i.children.length?(d(),c(y,{key:1},[C("span",{class:r(["parent",{open:i.open}]),onClick:e=>Me(i)},[C("span",null,g(i.name),1),p(h(O),{component:i.open?h(L):h(N)},null,8,["component"])],10,q),i.open?(d(!0),c(y,{key:0},k(i.children.filter((e=>e.isShow)),((e,n)=>(d(),c("div",{key:n,class:"children",onClick:n=>Ae(e,0,i)},[e.isShow?(d(),S(h(_),{key:0,trigger:"hover",placement:"right"},{trigger:b((()=>[C("span",{class:r(["child-item",{selected:e.selected}])},[C("span",Q,g(Ue(e.name,null==e?void 0:e.isPublic)),1),e.selected?(d(),S(h(O),{key:0,component:h(z),size:"20"},null,8,["component"])):v("v-if",!0)],2)])),default:b((()=>[C("span",null,g(h(Je)(e)),1)])),_:2},1024)):v("v-if",!0)],8,G)))),128)):v("v-if",!0)],64)):(d(),c("span",{key:0,class:r(["child-item header-item",{selected:i.selected||-1!==e.conditionSid.indexOf("all_data")}]),onClick:e=>Ae(i)},g(i.name),11,W))],2)):v("v-if",!0)],64)))),256))]),1!=e.hideClearConditionChange?(d(),c("div",$,[C("div",D,"已选择"+g(e.conditionSid.filter((e=>"all_data"!==e)).length)+"项",1),C("div",{class:"selected-item-del",onClick:n[0]||(n[0]=e=>Ae({sid:"all_data",name:"全部数据",digital:h(Ie).digital}))},[V,m(" 清空筛选 ")])])):v("v-if",!0)],4)),[[h(J),{mode:"VR",onMove:Ge,onEnd:Qe}]]):v("v-if",!0),1===h(we)?(d(),c(y,{key:1},[1!=e.hideConditionChangeBtn||1!=e.hideConditionChangeSetting||1!=e.hideConditionChangeSetting||h(_e).filter((e=>e.isShow)).length>0?(d(),c("div",H,[1!=e.hideConditionChangeBtn||1!=e.hideConditionChangeSetting?(d(),c("div",K,[C("span",{class:r(["all-data",{selected:-1!==e.conditionSid.indexOf("all_data")}]),onClick:n[1]||(n[1]=e=>Ae({sid:"all_data",name:"全部数据",digital:h(Ie).digital}))},[m(" 全部数据 "),h(Ie).digital||0===h(Ie).digital?(d(),c(y,{key:0},[m(" ("+g(h(Ie).digital||0)+") ",1)],64)):v("v-if",!0)],2),C("div",U,[1!=e.hideConditionChangeBtn?(d(),c("span",{key:0,class:"setting-1",onClick:Ee,style:{"margin-right":"30px"}},[p(h(O),{component:h(w),size:"16"},null,8,["component"]),m(" "+g("切换"))])):v("v-if",!0),1!=e.hideConditionChangeSetting?(d(),c("span",{key:1,class:"setting-1",onClick:Te},[p(h(O),{component:h(I),size:"16"},null,8,["component"]),m(" "+g("设置"))])):v("v-if",!0)])])):v("v-if",!0),C("ul",{class:"tile",style:u({borderBottom:1!=e.hideClearConditionChange?"1px solid #d5d5d5":0})},[(d(!0),c(y,null,k(h(xe).slice(1),((e,i)=>(d(),c(y,null,[e.children&&e.children.length>0?(d(),c("li",{class:"tile-item",key:i},[e.children&&0!==e.children.length?(d(),c(y,{key:1},[C("span",Y,g(e.name),1),C("div",Z,[(d(!0),c(y,null,k(e.children,((i,n)=>(d(),c(y,null,[i.isShow?(d(),c("span",{key:n,class:r(["child-item",{selected:i.selected}]),onClick:n=>Ae(i,0,e)},g(Ue(i.name,null==i?void 0:i.isPublic)),11,ee)):v("v-if",!0)],64)))),256))])],64)):(d(),c("span",{key:0,class:r(["child-item",{selected:e.selected}]),style:{"padding-left":"17px"},onClick:i=>Ae(e)},g(e.name)+" "+g(e.digital),11,X))])):v("v-if",!0)],64)))),256))],4),1!=e.hideClearConditionChange?(d(),c("div",ie,[C("div",ne,"已选择"+g(e.conditionSid.filter((e=>"all_data"!==e)).length)+"项",1),(d(!0),c(y,null,k(h(xe).slice(1),(e=>(d(),c(y,null,[e.children&&0!==e.children.length?(d(!0),c(y,{key:1},k(e.children,((i,n)=>(d(),c(y,null,[i.selected?(d(),c("div",{class:"selected-item",key:i.sid},[m(g(i.name)+" ",1),p(h(O),{component:h(j),onClick:n=>Ae(i,0,e)},null,8,["component","onClick"])])):v("v-if",!0)],64)))),256)):(d(),c("div",{class:"selected-item",key:e.sid},[m(g(e.name)+" ",1),p(h(O),{component:h(j),onClick:i=>Ae(e)},null,8,["component","onClick"])]))],64)))),256)),C("div",{class:"selected-item-del",onClick:n[2]||(n[2]=e=>Ae({sid:"all_data",name:"全部数据",digital:h(Ie).digital}))},[le,m(" 清空筛选 ")])])):v("v-if",!0)])):v("v-if",!0)],64)):v("v-if",!0),2===h(we)?(d(),c("div",{key:2,class:"select-type classify-2",ref_key:"selectType",ref:ke},[C("span",{class:"title",onClick:n[3]||(n[3]=()=>We())},[p(h(_),{trigger:"hover",placement:"top"},{trigger:b((()=>[C("span",te,g(h(Pe)),1)])),default:b((()=>[C("span",ae,g(h(Pe)),1)])),_:1}),p(h(O),{component:h(be)?h(B):h(L)},null,8,["component"])]),h(be)?(d(),c("div",se,[C("ul",{class:"tree",style:u({padding:1!=e.hideClearConditionChange?"40px 0":"40px 0 0"})},[(d(!0),c(y,null,k(h(xe),((i,n)=>(d(),c(y,null,[0===n||!i.children||0===i.children.length||i.children&&0!==i.children.filter((e=>e.isShow)).length?(d(),c("li",{key:n,class:r(["tree-item",{"tree-header":0===n||!i.children||0===i.children.length}])},[0!==n&&i.children&&0!==i.children.length?(d(),c(y,{key:1},[0!==i.children.filter((e=>e.isShow)).length?(d(),c("span",{key:0,class:r(["parent",{open:i.open}]),onClick:e=>Me(i)},[m(g(i.name)+g(i.digital||0===i.digital?"("+i.digital+")":"")+" ",1),p(h(O),{component:i.open?h(L):h(N)},null,8,["component"])],10,ce)):v("v-if",!0),i.open?(d(!0),c(y,{key:1},k(i.children.filter((e=>e.isShow)),((e,n)=>(d(),c("div",{key:n,class:"children",onClick:n=>Ae(e,0,i)},[e.isShow?(d(),S(h(_),{key:0,placement:"right",trigger:"hover","z-index":1e4},{trigger:b((()=>[C("span",{class:r(["child-item",{selected:e.selected}])},[C("span",null,g(Ue(e.name,null==e?void 0:e.isPublic)),1),e.selected?(d(),S(h(O),{key:0,component:h(z),size:"20"},null,8,["component"])):v("v-if",!0)],2)])),default:b((()=>[C("span",null,g(h(Je)(e)),1)])),_:2},1024)):v("v-if",!0)],8,re)))),128)):v("v-if",!0)],64)):(d(),c(y,{key:0},[C("span",{class:r(["child-item child-header header-item",{selected:i.selected||-1!==e.conditionSid.indexOf("all_data")}]),onClick:e=>Ae(i)},g(i.name),11,oe),C("div",de,[1!=e.hideConditionChangeBtn?(d(),c("span",{key:0,class:"tree-footer-icon",onClick:Ee},[p(h(O),{component:h(w),size:"16"},null,8,["component"]),m(" "+g("切换"))])):v("v-if",!0),1!=e.hideConditionChangeSetting?(d(),c("span",{key:1,class:"tree-footer-icon",onClick:Te},[p(h(O),{component:h(I),size:"16"},null,8,["component"]),m(" "+g("设置"))])):v("v-if",!0)])],64))],2)):v("v-if",!0)],64)))),256))],4),1!=e.hideClearConditionChange?(d(),c("div",he,[C("div",ue,"已选择"+g(e.conditionSid.filter((e=>"all_data"!==e)).length)+"项",1),C("div",{class:"selected-item-del",onClick:n[4]||(n[4]=e=>Ae({sid:"all_data",name:"全部数据",digital:h(Ie).digital}))},[fe,m(" 清空筛选 ")])])):v("v-if",!0)])):v("v-if",!0)],512)):v("v-if",!0),v(" 弹出弹窗 "),p(P,{ref:"search",searchFieldList:e.searchFieldList,conditionList:h(_e),displayCategoryList:h(Le),settingId:h(Ne),tableId:e.tableId,classifyModal:h(ze),onSaveGetTableCondiTionList:De,onCondiTionListInit:$e,onSetClassifyModal:Re},null,8,["searchFieldList","conditionList","displayCategoryList","settingId","tableId","classifyModal"])],6))}});export{pe as default};
|
|
@@ -774,10 +774,6 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
774
774
|
type: BooleanConstructor;
|
|
775
775
|
default: boolean;
|
|
776
776
|
};
|
|
777
|
-
orgId: {
|
|
778
|
-
type: StringConstructor;
|
|
779
|
-
default: string;
|
|
780
|
-
};
|
|
781
777
|
defaultList: {
|
|
782
778
|
type: import("vue").PropType<string[]>;
|
|
783
779
|
default: () => never[];
|
|
@@ -792,10 +788,6 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
792
788
|
type: BooleanConstructor;
|
|
793
789
|
default: boolean;
|
|
794
790
|
};
|
|
795
|
-
orgId: {
|
|
796
|
-
type: StringConstructor;
|
|
797
|
-
default: string;
|
|
798
|
-
};
|
|
799
791
|
defaultList: {
|
|
800
792
|
type: import("vue").PropType<string[]>;
|
|
801
793
|
default: () => never[];
|
|
@@ -1522,10 +1514,6 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1522
1514
|
type: BooleanConstructor;
|
|
1523
1515
|
default: boolean;
|
|
1524
1516
|
};
|
|
1525
|
-
orgId: {
|
|
1526
|
-
type: StringConstructor;
|
|
1527
|
-
default: string;
|
|
1528
|
-
};
|
|
1529
1517
|
defaultList: {
|
|
1530
1518
|
type: import("vue").PropType<string[]>;
|
|
1531
1519
|
default: () => never[];
|
|
@@ -1541,7 +1529,6 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1541
1529
|
visible: boolean;
|
|
1542
1530
|
defaultList: string[];
|
|
1543
1531
|
treeData: import("../../../es/shared/types").AnyObject[];
|
|
1544
|
-
orgId: string;
|
|
1545
1532
|
}>;
|
|
1546
1533
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "checkPerson"[], "checkPerson", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1547
1534
|
defaultValue: {
|
|
@@ -56,10 +56,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
56
56
|
type: BooleanConstructor;
|
|
57
57
|
default: boolean;
|
|
58
58
|
};
|
|
59
|
-
orgId: {
|
|
60
|
-
type: StringConstructor;
|
|
61
|
-
default: string;
|
|
62
|
-
};
|
|
63
59
|
defaultList: {
|
|
64
60
|
type: PropType<string[]>;
|
|
65
61
|
default: () => never[];
|
|
@@ -74,10 +70,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
74
70
|
type: BooleanConstructor;
|
|
75
71
|
default: boolean;
|
|
76
72
|
};
|
|
77
|
-
orgId: {
|
|
78
|
-
type: StringConstructor;
|
|
79
|
-
default: string;
|
|
80
|
-
};
|
|
81
73
|
defaultList: {
|
|
82
74
|
type: PropType<string[]>;
|
|
83
75
|
default: () => never[];
|
|
@@ -804,10 +796,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
804
796
|
type: BooleanConstructor;
|
|
805
797
|
default: boolean;
|
|
806
798
|
};
|
|
807
|
-
orgId: {
|
|
808
|
-
type: StringConstructor;
|
|
809
|
-
default: string;
|
|
810
|
-
};
|
|
811
799
|
defaultList: {
|
|
812
800
|
type: PropType<string[]>;
|
|
813
801
|
default: () => never[];
|
|
@@ -823,7 +811,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
823
811
|
visible: boolean;
|
|
824
812
|
defaultList: string[];
|
|
825
813
|
treeData: import("../../..").AnyObject[];
|
|
826
|
-
orgId: string;
|
|
827
814
|
}>;
|
|
828
815
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "checkPerson"[], "checkPerson", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
829
816
|
defaultValue: {
|
|
@@ -5,10 +5,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5
5
|
type: BooleanConstructor;
|
|
6
6
|
default: boolean;
|
|
7
7
|
};
|
|
8
|
-
orgId: {
|
|
9
|
-
type: StringConstructor;
|
|
10
|
-
default: string;
|
|
11
|
-
};
|
|
12
8
|
defaultList: {
|
|
13
9
|
type: PropType<string[]>;
|
|
14
10
|
default: () => never[];
|
|
@@ -23,10 +19,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
23
19
|
type: BooleanConstructor;
|
|
24
20
|
default: boolean;
|
|
25
21
|
};
|
|
26
|
-
orgId: {
|
|
27
|
-
type: StringConstructor;
|
|
28
|
-
default: string;
|
|
29
|
-
};
|
|
30
22
|
defaultList: {
|
|
31
23
|
type: PropType<string[]>;
|
|
32
24
|
default: () => never[];
|
|
@@ -753,10 +745,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
753
745
|
type: BooleanConstructor;
|
|
754
746
|
default: boolean;
|
|
755
747
|
};
|
|
756
|
-
orgId: {
|
|
757
|
-
type: StringConstructor;
|
|
758
|
-
default: string;
|
|
759
|
-
};
|
|
760
748
|
defaultList: {
|
|
761
749
|
type: PropType<string[]>;
|
|
762
750
|
default: () => never[];
|
|
@@ -772,6 +760,5 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
772
760
|
visible: boolean;
|
|
773
761
|
defaultList: string[];
|
|
774
762
|
treeData: AnyObject[];
|
|
775
|
-
orgId: string;
|
|
776
763
|
}>;
|
|
777
764
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as a,openBlock as o,createBlock as t,unref as i,isRef as l,withCtx as n,createVNode as d,createElementVNode as r,createTextVNode as s}from"vue";import{NModal as u,NCard as p,NButton as c}from"naive-ui";import
|
|
1
|
+
import{defineComponent as e,ref as a,openBlock as o,createBlock as t,unref as i,isRef as l,withCtx as n,createVNode as d,createElementVNode as r,createTextVNode as s}from"vue";import{NModal as u,NCard as p,NButton as c}from"naive-ui";import _ from"../../../select-person/index.js";const f={class:"flex_right"};var m=e({__name:"PersonModal",props:{visible:{type:Boolean,default:!1},defaultList:{type:Array,default:()=>[]},treeData:{type:Array,default:()=>[]}},emits:["check","changeModalVisible"],setup(e,{emit:m}){const b=a({parent_id_obj:"id",parent_id_obj_key:"id",parent_name_obj:"name",parent_name_obj_key:"name",user_count_obj:"count"}),h={user_id_obj:"id",user_id_obj_key:"id",user_name_obj:"name",user_name_obj_key:"name"},v=a([]),k=a([]);function x(){m("check",k.value),v.value=[],g()}function g(){m("changeModalVisible")}function y(e){const a=e.map((e=>e.originItem));a.forEach((e=>{e.parentNode&&delete e.parentNode})),k.value=a}return(a,m)=>(o(),t(i(u),{class:"expand-field-modal-block expand-person-modal",show:e.visible,"onUpdate:show":m[0]||(m[0]=e=>l(visible)?visible.value=e:null),maskClosable:!1,width:"700px",bodyStyle:"height: 556px;maxHeight: 556px;",closable:!1,centered:"",onPositiveClick:x,onNegativeClick:g},{default:n((()=>[d(i(p),{style:{width:"700px",height:"556px",maxHeight:"556px"},title:"批量编辑",bordered:!1,size:"huge",role:"dialog","aria-modal":"true"},{"header-extra":n((()=>[r("div",{class:"svg-wrap"},[r("i",{onClick:g,class:"iconfont-expand-field icon-expand-field-menzhenyishengzhanxitongtubiaoguanbi"})])])),footer:n((()=>[r("div",f,[d(i(c),{onClick:g},{default:n((()=>[s("取消")])),_:1}),d(i(c),{type:"info",onClick:x},{default:n((()=>[s("保存")])),_:1})])])),default:n((()=>[d(i(_),{style:{padding:"0"},ref:"personRef",wordbook:b.value,wordbookChild:h,data:e.treeData,defaultList:e.defaultList,onCheckWithLevel:y},null,8,["wordbook","data","defaultList"])])),_:1})])),_:1},8,["show"]))}});export{m as default};
|
|
@@ -669,10 +669,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
669
669
|
type: BooleanConstructor;
|
|
670
670
|
default: boolean;
|
|
671
671
|
};
|
|
672
|
-
orgId: {
|
|
673
|
-
type: StringConstructor;
|
|
674
|
-
default: string;
|
|
675
|
-
};
|
|
676
672
|
defaultList: {
|
|
677
673
|
type: import("vue").PropType<string[]>;
|
|
678
674
|
default: () => never[];
|
|
@@ -687,10 +683,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
687
683
|
type: BooleanConstructor;
|
|
688
684
|
default: boolean;
|
|
689
685
|
};
|
|
690
|
-
orgId: {
|
|
691
|
-
type: StringConstructor;
|
|
692
|
-
default: string;
|
|
693
|
-
};
|
|
694
686
|
defaultList: {
|
|
695
687
|
type: import("vue").PropType<string[]>;
|
|
696
688
|
default: () => never[];
|
|
@@ -1417,10 +1409,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1417
1409
|
type: BooleanConstructor;
|
|
1418
1410
|
default: boolean;
|
|
1419
1411
|
};
|
|
1420
|
-
orgId: {
|
|
1421
|
-
type: StringConstructor;
|
|
1422
|
-
default: string;
|
|
1423
|
-
};
|
|
1424
1412
|
defaultList: {
|
|
1425
1413
|
type: import("vue").PropType<string[]>;
|
|
1426
1414
|
default: () => never[];
|
|
@@ -1436,7 +1424,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1436
1424
|
visible: boolean;
|
|
1437
1425
|
defaultList: string[];
|
|
1438
1426
|
treeData: AnyObject[];
|
|
1439
|
-
orgId: string;
|
|
1440
1427
|
}>;
|
|
1441
1428
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "checkPerson"[], "checkPerson", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1442
1429
|
defaultValue: {
|
|
@@ -776,10 +776,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
776
776
|
type: BooleanConstructor;
|
|
777
777
|
default: boolean;
|
|
778
778
|
};
|
|
779
|
-
orgId: {
|
|
780
|
-
type: StringConstructor;
|
|
781
|
-
default: string;
|
|
782
|
-
};
|
|
783
779
|
defaultList: {
|
|
784
780
|
type: PropType<string[]>;
|
|
785
781
|
default: () => never[];
|
|
@@ -794,10 +790,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
794
790
|
type: BooleanConstructor;
|
|
795
791
|
default: boolean;
|
|
796
792
|
};
|
|
797
|
-
orgId: {
|
|
798
|
-
type: StringConstructor;
|
|
799
|
-
default: string;
|
|
800
|
-
};
|
|
801
793
|
defaultList: {
|
|
802
794
|
type: PropType<string[]>;
|
|
803
795
|
default: () => never[];
|
|
@@ -1524,10 +1516,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1524
1516
|
type: BooleanConstructor;
|
|
1525
1517
|
default: boolean;
|
|
1526
1518
|
};
|
|
1527
|
-
orgId: {
|
|
1528
|
-
type: StringConstructor;
|
|
1529
|
-
default: string;
|
|
1530
|
-
};
|
|
1531
1519
|
defaultList: {
|
|
1532
1520
|
type: PropType<string[]>;
|
|
1533
1521
|
default: () => never[];
|
|
@@ -1543,7 +1531,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1543
1531
|
visible: boolean;
|
|
1544
1532
|
defaultList: string[];
|
|
1545
1533
|
treeData: AnyObject[];
|
|
1546
|
-
orgId: string;
|
|
1547
1534
|
}>;
|
|
1548
1535
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "checkPerson"[], "checkPerson", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1549
1536
|
defaultValue: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as t,provide as e,ref as l,openBlock as a,createElementBlock as i,createElementVNode as n,
|
|
1
|
+
import{defineComponent as t,provide as e,ref as l,openBlock as a,createElementBlock as i,createElementVNode as n,createVNode as o,unref as s,withCtx as r,Fragment as d,renderList as c,createTextVNode as u,toDisplayString as m,createBlock as p,withModifiers as f}from"vue";import{useMessage as v,NGrid as h,NGridItem as _,NTooltip as g,NIcon as y,NPopconfirm as C,NButton as k}from"naive-ui";import{Brush as x}from"@vicons/ionicons5";import D from"./components/form.vue.js";import w from"./hooks/useAsyncData.js";import{InjectionExpandFieldApiConfig as b}from"./constants/index.js";const M={class:"tableset-expand-field"},N={class:"list"},I={class:"table-modal-list"},z={class:"list-content"},A=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),S={class:"footer"};var j=t({__name:"index",props:{id:{type:String,default:""},expandFieldApiConfig:{type:Object},tableData:{type:Array,default:()=>[]},orgId:{type:String,default:""}},emits:["closeModal"],setup(t,{emit:j}){const F=t,O=v(),{deleteExtendFieldById:V}=w();e(b,F.expandFieldApiConfig);const B=[{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}],E=l(!1),P=l("add"),U=l({});function q(){j("closeModal")}function G(){E.value=!0,P.value="add",U.value={}}function H(){E.value=!1}return(e,l)=>(a(),i("div",M,[n("div",N,[n("div",I,[o(s(h),{cols:24,class:"list-title"},{default:r((()=>[(a(),i(d,null,c(B,(t=>o(s(_),{span:t.span,class:"list-title-item",key:t.columnName},{default:r((()=>[u(m(t.title),1)])),_:2},1032,["span"]))),64))])),_:1}),n("div",z,[(a(!0),i(d,null,c(t.tableData,((t,e)=>(a(),p(s(h),{key:e,class:"list-content-block"},{default:r((()=>[o(s(_),{span:3,title:t.name,class:"list-content-item"},{default:r((()=>[u(m(t.name),1)])),_:2},1032,["title"]),o(s(_),{span:3,title:t.code,class:"list-content-item"},{default:r((()=>[u(m(t.code),1)])),_:2},1032,["title"]),o(s(_),{span:3,title:t.html_type,class:"list-content-item"},{default:r((()=>[u(m(t.html_type),1)])),_:2},1032,["title"]),o(s(_),{span:4,title:t.remark,class:"list-content-item"},{default:r((()=>[u(m(t.remark),1)])),_:2},1032,["title"]),o(s(_),{span:4,title:t.createdDate,class:"list-content-item"},{default:r((()=>[u(m(t.createdDate),1)])),_:2},1032,["title"]),o(s(_),{span:4,title:t.updatedDate,class:"list-content-item"},{default:r((()=>[u(m(t.updatedDate),1)])),_:2},1032,["title"]),o(s(_),{span:3,class:"list-content-item"},{default:r((()=>[o(s(g),{duration:0},{trigger:r((()=>[o(s(y),{component:s(x),onClick:f((e=>{return l=t,E.value=!0,P.value="edit",void(U.value={...l});var l}),["prevent","stop"])},null,8,["component","onClick"])])),default:r((()=>[u(" 编辑 ")])),_:2},1024),o(s(g),{duration:0},{trigger:r((()=>[o(s(C),{onPositiveClick:e=>async function(t){try{const e=await V(t,F.expandFieldApiConfig);if("SUCCESS"!==(null==e?void 0:e.result))return void O.error((null==e?void 0:e.resultMsg)||"删除失败");O.success("删除成功")}catch(t){O.error(t)}}(t)},{trigger:r((()=>[o(s(y),null,{default:r((()=>[A])),_:1})])),default:r((()=>[u(" 确认要删除-"+m(t.name)+"吗? ",1)])),_:2},1032,["onPositiveClick"])])),default:r((()=>[u(" 删除 ")])),_:2},1024)])),_:2},1024)])),_:2},1024)))),128))])]),n("div",S,[o(s(k),{onClick:q},{default:r((()=>[u("取消")])),_:1}),o(s(k),{type:"info",onClick:G},{default:r((()=>[u("增加字段")])),_:1})])]),o(D,{visible:E.value,formItemData:U.value,formOntype:P.value,id:t.id,orgId:t.orgId,onCancelModal:H},null,8,["visible","formItemData","formOntype","id","orgId"])]))}});export{j as default};
|
|
@@ -51,6 +51,11 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
51
51
|
list: any[];
|
|
52
52
|
target: any;
|
|
53
53
|
};
|
|
54
|
+
warapperEl: import("vue").ComputedRef<any>;
|
|
55
|
+
style: import("vue").ComputedRef<{
|
|
56
|
+
width: string;
|
|
57
|
+
height: string;
|
|
58
|
+
}>;
|
|
54
59
|
propItems: any;
|
|
55
60
|
redrawPoints: import("vue").Ref<any>;
|
|
56
61
|
select: import("vue").Ref<any>;
|
|
@@ -94,12 +99,6 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
94
99
|
right: string;
|
|
95
100
|
'transform-origin': string;
|
|
96
101
|
}>;
|
|
97
|
-
Teleport: {
|
|
98
|
-
new (): {
|
|
99
|
-
$props: import("vue").VNodeProps & import("vue").TeleportProps;
|
|
100
|
-
};
|
|
101
|
-
__isTeleport: true;
|
|
102
|
-
};
|
|
103
102
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
104
103
|
show: {
|
|
105
104
|
type: BooleanConstructor;
|
|
@@ -53,6 +53,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
53
53
|
list: any[];
|
|
54
54
|
target: any;
|
|
55
55
|
};
|
|
56
|
+
warapperEl: import("vue").ComputedRef<any>;
|
|
57
|
+
style: import("vue").ComputedRef<{
|
|
58
|
+
width: string;
|
|
59
|
+
height: string;
|
|
60
|
+
}>;
|
|
56
61
|
propItems: any;
|
|
57
62
|
redrawPoints: import("vue").Ref<any>;
|
|
58
63
|
select: import("vue").Ref<any>;
|
|
@@ -96,12 +101,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
96
101
|
right: string;
|
|
97
102
|
'transform-origin': string;
|
|
98
103
|
}>;
|
|
99
|
-
Teleport: {
|
|
100
|
-
new (): {
|
|
101
|
-
$props: import("vue").VNodeProps & import("vue").TeleportProps;
|
|
102
|
-
};
|
|
103
|
-
__isTeleport: true;
|
|
104
|
-
};
|
|
105
104
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
106
105
|
show: {
|
|
107
106
|
type: BooleanConstructor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as t,reactive as s,onMounted as
|
|
1
|
+
import{defineComponent as e,ref as t,reactive as r,computed as s,onMounted as o,onBeforeUnmount as a,openBlock as i,createElementBlock as n,normalizeStyle as p,unref as u,createElementVNode as l,Fragment as c,createVNode as h,mergeProps as m,createCommentVNode as d}from"vue";import{fabric as f}from"../../../shared/utils/fabricjs/index.js";import v from"./components/PopupTip.vue.js";import w from"./components/PopupMenu.js";import"./hooks/useDraw.js";import"date-fns";import"lodash-es";import"./hooks/useEvent.js";import{useBirthProcessChart as g}from"./hooks/birthProcess/useBirthProcessChart.js";import{useTemperatureChart as k}from"./hooks/temperature/useTemperatureChart.js";import{useSurgicalAnesthesiaChart as j}from"./hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js";var y=e({__name:"FabricChart",props:{type:{type:String,default:"temperature"},data:{type:Object,required:!0},addRenderItem:{type:Function}},emits:["change","add","remove","select","add:prevent"],setup(e,{expose:y,emit:C}){const x=e,b=t(null),P=t(),I=r({show:!1,point:{x:0,y:0},list:[]}),M=r({show:!1,point:{x:0,y:0},list:[],target:null}),A=s((()=>{var e;return null==(e=P.value)?void 0:e.wrapperEl})),R=s((()=>({width:`${x.data.width||800}px`,height:`${x.data.height||500}px`}))),{propItems:S,redrawPoints:T,select:_,clickMenu:E}=function(){const e=[P,x,C,b,I,M];switch(x.type){case"birthProcess":return g(...e);case"surgicalAnesthesia":return j(...e);default:return k(...e)}}();return o((()=>{P.value=new f.Canvas(b.value,{width:S.canvasWidth,height:S.canvasHeight,backgroundColor:"#fff",selection:!1,stopContextMenu:!0,fireRightClick:!0,allowTouchScrolling:!0})})),a((()=>{P.value.off(),P.value.clear()})),y({redrawPoints:T,select:_,canvas:P}),(e,t)=>(i(),n("div",{class:"c-fabric-chart",style:p(u(R))},[l("canvas",{ref_key:"canvasRef",ref:b},null,512),u(A)?(i(),n(c,{key:0},[h(v,m({propItems:u(S)},I),null,16,["propItems"]),h(u(w),m({propItems:u(S)},M,{show:M.show,"onUpdate:show":t[0]||(t[0]=e=>M.show=e),onClickMenu:u(E)}),null,16,["propItems","show","onClickMenu"])],64)):d("v-if",!0)],4))}});export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as t,watch as l,
|
|
1
|
+
import{defineComponent as e,ref as t,watch as l,withDirectives as a,createVNode as o,vShow as r}from"vue";import{NSpace as n,NInputNumber as u}from"naive-ui";import s from"./useStyle.js";import{useEventListener as i,onClickOutside as p}from"@vueuse/core";var c=e({name:"PopupMenu",inheritAttrs:!1,props:{show:{type:Boolean,default:!1},list:{type:Array,default:()=>[]},point:{type:Object},propItems:{type:Object},target:{type:Object}},emits:["update:show","clickMenu"],setup(e,{attrs:c,slots:f,emit:m}){const v=t(null);i(v,"contextmenu",(e=>(e.preventDefault(),!1))),p(v,(e=>{m("update:show",!1)}));const{left:d}=e.propItems,h=s(e);function y(e){if("string"==typeof e&&(e.startsWith("新增")||e.startsWith("删除")))return!0}function g(t){var l;if("string"==typeof t)return t;if("boolean"==typeof t.value)return t.label;if(t.renderItem)return t.renderItem();const a=+((null==(l=d.yScaleValue.find((t=>t.type===e.target.origin.type)))?void 0:l.list[0])||0);return o(n,{inline:!0,align:"center"},{default:()=>[o("span",null,[t.label]),o(u,{style:"width: 110px",size:"small",value:t.value,"onUpdate:value":e=>t.value=e,clearable:!0,placeholder:"请输入数值",max:e.target.origin.data.value,min:a,showButton:!1,onFocus:()=>m("update:show",!0)},null)]})}return l((()=>e.show),(t=>{t&&e.list.forEach((e=>{"object"==typeof e&&Reflect.has(e,"value")&&"boolean"!=typeof e.value&&(e.value=void 0)}))})),()=>a(o("ul",{ref:v,class:"c-fabric-chart-popup-menu",style:h.value},[e.list.map((t=>e.show?o("li",{class:{"no-click":y(t)},onClick:l=>function(t,l){y(l)||""===(null==t?void 0:t.target.className)&&(m("update:show",!1),m("clickMenu",{item:l,target:e.target}))}(l,t)},[g(t)]):null))]),[[r,e.show]])}});export{c as default};
|
|
@@ -33,12 +33,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
33
33
|
right: string;
|
|
34
34
|
'transform-origin': string;
|
|
35
35
|
}>;
|
|
36
|
-
Teleport: {
|
|
37
|
-
new (): {
|
|
38
|
-
$props: import("vue").VNodeProps & import("vue").TeleportProps;
|
|
39
|
-
};
|
|
40
|
-
__isTeleport: true;
|
|
41
|
-
};
|
|
42
36
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
43
37
|
show: {
|
|
44
38
|
type: BooleanConstructor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as t,
|
|
1
|
+
import{defineComponent as t,withDirectives as l,openBlock as p,createElementBlock as e,normalizeStyle as o,unref as s,Fragment as u,renderList as r,toDisplayString as a,vShow as i}from"vue";import n from"./useStyle.js";var f=t({__name:"PopupTip",props:{show:{type:Boolean,default:!1},point:null,list:{default:()=>[]},propItems:null},setup(t){const f=n(t);return(n,m)=>l((p(),e("ul",{class:"c-fabric-chart-popup-tip",style:o(s(f))},[(p(!0),e(u,null,r(t.list,(t=>(p(),e("li",{key:t},a(t),1)))),128))],4)),[[i,t.show]])}});export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as e,computed as a,reactive as t,
|
|
1
|
+
import{ref as e,computed as a,reactive as t,watch as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as r}from"../../utils/index.js";import{useCanvasEvent as i}from"../useEvent.js";import"../temperature/useShadow.js";import"lodash-es";import"naive-ui";import"@vueuse/core";import{useBirthProcess as s}from"./useBirthProcess.js";function d(d,n,o,v,c,h){const m=e(),f=e(),p=e(),g=a((()=>n.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),x=a((()=>n.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),w=a((()=>{var e;return(null==(e=x.value)?void 0:e.length)?30:0})),y=a((()=>{var e;return 30+(null==(e=g.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),V=a((()=>{var e;const{width:a}=n.data,t=null==(e=x.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-w.value-t})),b=a((()=>n.data.grid.mainXCell)),j=a((()=>{const e=n.data.grid.mainYCell||14;return n.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),A=a((()=>(V.value-y.value)/b.value)),C=a((()=>{const{xAxis:e,height:a}=n.data,t=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(j.value+t)})),k=a((()=>{const{xAxis:e}=n.data,a=Object.values(e).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0);return C.value*a})),Y=a((()=>{var e;const{scaleValues:a}=n.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!k.value)return k.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 S.value-l*u*C.value})),S=a((()=>{const{xAxis:e,height:a}=n.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-C.value*t})),H=a((()=>r(n.data.xAxis.time.startTime))),P=a((()=>36e5/A.value)),X=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"cervix"===e.key));return C.value/((null==a?void 0:a.spaceValue)||1)})),F=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"FHR"===e.key));return C.value/((null==a?void 0:a.spaceValue)||10)})),R=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"fetalPresentation"===e.key));return C.value/((null==a?void 0:a.spaceValue)||1)})),W=a((()=>{var e;return(null==(e=n.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),O=t({canvasWidth:n.data.width,canvasHeight:n.data.height,borderStyle:{...u,...n.data.borderStyle||{}},selectionStyle:n.data.selectionStyle||{},grid:n.data.grid,other:n.data.other,originX:y.value,endX:V.value,originY:k.value,endY:S.value,xCellWidth:A.value,yCellHeight:C.value,gridXNumber:b.value,gridYNumber:j.value,xAxis:n.data.xAxis,leftScales:g.value,rightScales:x.value,leftAddAreaWidth:30,rightAddAreaWidth:w.value,startTime:H.value,timeXCell:P.value,cervixYCell:X.value,FHRYCell:F.value,fetalPresentationYCell:R.value,scaleValues:n.data.scaleValues,event:W.value,originYCervix:Y.value});return l((()=>d.value),(e=>{e&&function(){const{clickMenu:e,redrawPoints:a}=s(d,O,o,c,h);f.value=a,p.value=e;const{select:t}=i(d,O,o);m.value=t}()}),{immediate:!0}),{propItems:O,redrawPoints:f,select:m,clickMenu:p}}export{d as useBirthProcessChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{onUnmounted as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as n,drawLine as o,drawPoint as i}from"../useDraw.js";import{useGrid as l}from"../useGrid.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useCommon as s}from"../useCommon.js";import{getPointRange as f,getIndex as u,isEffectiveNode as c,getTime as p}from"../../utils/index.js";import{cloneDeep as d,omit as m}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import{useIntervalFn as v}from"@vueuse/core";function y(y,g,h,k,x){const{cumputedX:L,cumputedY:P,getXValue:w,getYValue:b}=r(g),{xCellWidth:A,pointSelectionStyle:C,originX:K,endX:j,originY:E,endY:I,event:T,scaleValues:M,xAxis:S,startTime:V,timeXCell:X,itemList:$,dialog:O}=g,Y=new Map,D=new Set,_=d(M);let N=[],z=null;const G=new Set;l(y,g);const{getEqualXTypes:J,handleAddPrevent:q,setPrevAndNextPoint:F}=s(y,h,g),{pause:R,resume:W}=v((()=>{!function(){for(const e of G)e.set("opacity",1===e.opacity?.5:1),y.value.renderAll()}()}),800);function B(){_.forEach((e=>{e.dataList.forEach(((t,n)=>{t.show&&(!function(e,t){const{max:n={},min:i={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function a({show:e=!1,value:n,name:i,lineStyle:l}){if(!e||!n)return;const r=P(t.type,t.range,n),a=o([K,r,j,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});T.hovered&&i&&(a.on("mousemove",(({pointer:e})=>{k.point={...e||{x:a.left,y:a.top}},k.list=[`${i} ${n}${t.unit||""}`],k.show=!0})),a.on("mouseout",(()=>{k.show=!1}))),y.value.add(a)}a(n),a(i),a(l),a(r)}(t,e),Z(t,n,e))}))}))}function H(e=[]){if(!(null==z?void 0:z.areaPos))return[];const{startPos:t,endPos:n}=z.areaPos,[o,i]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:ae()).filter((e=>e.left>=o&&e.left<=i&&e.top>=l&&e.top<=r))}function Q(e){O.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),U()},onNegativeClick:()=>U(),onClose:()=>U()})}function U(){z&&y.value.remove(z),z=null}function Z(e,t,n){var l;const{type:r,unit:a,dataList:s=[]}=n,f=[];Y.set(e.key,[]),function(e,t){G.size&&[...G].forEach((n=>{const{dataIndex:o,type:i}=n.origin;o===t&&i===e&&G.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,u)=>{!function(e,l,u,c){var p;let d,v,x=c;l.key&&(x=s.find((e=>e.key===l.key)));const{pointAttr:L={},lineAttr:P={},title:C="",key:K,type:j="circle"}=x,E=re(c.list[u+1],n);e&&E&&!l.breakpoint&&e[0]!==E[0]&&(v=o([...e,...E],P));const I=f[u-1],M={origin:{data:l,title:C,key:c.key,selfKey:K,unit:a,type:r,dataIndex:t,index:u,lineAttr:P},__type:"main",leftLine:I,rightLine:v,...L,...g.event.hovered?g.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:g.event};I?d=i(j,{left:I.get("x2"),top:I.get("y2"),...M}):e&&(M.leftLine=null,d=i(j,{left:e[0],top:e[1],...M}));f.push(v),d&&(d.originLeft=d.left,d.originTop=d.top,function(e){T.hovered&&(e.on("mouseover",(()=>{ie(e,"hover")})),e.on("mouseout",(()=>{k.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{le(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),T.hovered&&ie(e),function(e){const{originLeft:t,originTop:n,left:o,top:i,origin:l}=e,r=~~((o-t)/A);if(o>t+A&&!e.nextPoint){if(0===N.length){ee(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[t,n],t,n]),e.leftLine&&e.leftLine.set({stroke:"transparent"})}const o=t+A*r;if(N.every((e=>e.left!==o))){const t=w(o),n=b(l.type,i);N.push({data:{time:t,value:n,...l.selfKey!==l.key?{key:l.selfKey}:{}},left:o,top:i}),ee(e,[...e.prevPointer,o,i])}N.length<r&&function(e,t){const{originLeft:n,originTop:o,origin:i}=e;let l=1;for(;l<=t;){const t=n+A*l,r=N.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=N.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const a=JSON.parse(JSON.stringify(r)),s=N[l-1]||{left:n,top:o},f=~~((r.left-(t-A))/A),u=(r.top-s.top)/f;a.top=s.top+u,a.left=t,a.data={time:w(t),value:b(i.type,a.top),...i.selfKey!==i.key?{key:i.selfKey}:{}},N.splice(l,0,a),ee(e,[s.left,s.top,a.left,a.top])}}l++}}(e,r)}if(N.length>0&&o<N[N.length-1].left){for(const e of D)e.left>o&&(e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e));if(N=N.filter((e=>e.left<=o)),0===N.length){e.leftLine&&e.leftLine.set(e.origin.lineAttr);for(const e of D)e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e)}if(N.length>0){const t=N.at(-1);e.prevPointer=[t.left,t.top]}}}(e)})),e.on("mouseup",(t=>{if(k.show=!1,1===t.button){const{type:t,selfKey:n}=e.origin,o={...e.origin,data:{...e.origin.data,time:w(e.left),value:b(t,e.top)}};if(y.value.discardActiveObject(),N.length>0){const e=N.map((e=>e.data)),i=_.find((e=>e.type===t)),l=i.dataList.findIndex((e=>e.key===n));h("add",{...m(o,["index","selfKey","lineAttr"]),dataIndex:l,key:n,data:e}),te({...o,data:e})}else h("change",{...m(o,["selfKey","lineAttr"]),key:n}),te(o,"change")}}))}(d),null==(p=Y.get(c.key))||p.push(d))}(re(l,n),l,u,e)})),Promise.all(Y.get(e.key)).then((t=>{const n=f.filter((e=>e));F(t),y.value.add(...n,...t),function(e,t){const{max:n={},min:o={}}=t.panicValue||{},{max:i={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:o},i){!t&&n&&o&&e.forEach((e=>{const t=e.origin.data.value;"max"===i&&t<n||"min"===i&&t>n||G.add(e)}))}r(n,"max"),r(o,"min"),r(i,"max"),r(l,"min")}(t,e)}))}function ee(e,t){const[,,n,i]=t;e.clone((l=>{l.set({left:n,top:i}),e.prevPointer=[n,i];const r=o(t,e.origin.lineAttr);l.leftLine=r,D.add(l),y.value.add(r,l)}))}function te(e,t="add",n=1){const{data:o,index:i,key:l,type:r}=e;let{dataIndex:a}=e;const s=_.find((e=>e.type===r)),f=s.dataList.find(((e,t)=>(a=t,e.key===l)));switch(t){case"remove":f.list.splice(i,n);break;case"change":f.list[i]=o;break;default:{const e=Array.isArray(o)?o[0].time:o.time,t=u(e,f.list),n=Array.isArray(o)?o:[o];f.list.splice(t,0,...n);break}}ne({dataIndex:a,scaleValue:s})}function ne(e){var t,n,o;if(D.size&&(null==(t=y.value)||t.remove(...oe([...D]))),D.clear(),N=[],e){const{dataIndex:t,scaleValue:o}=e,i=o.dataList[t];null==(n=y.value)||n.remove(...oe(Y.get(i.key))),Y.delete(i.key),Z(i,t,o)}else Y.size&&(null==(o=y.value)||o.remove(...oe(ae()))),Y.clear(),B()}function oe(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function ie(e,t="moving"){const{title:n,type:o,data:i,unit:l}=e.origin;k.point={x:e.left,y:e.top};const r=`${"hover"===t?i.value:b(o,e.top)}`;k.list=[`${n} ${r}${l||""}`,`时间 ${w(e.left).slice(-5)}`],k.show=!0}function le(e){e.setCoords();const t=6e4/X,n=e.prevPoint?e.prevPoint.left+t:K,o=e.nextPoint?e.nextPoint.left-t:j;e.top<E&&e.set("top",E),e.top>I&&e.set("top",I),e.left<n&&e.set("left",n),e.left>o&&e.set("left",o)}function re(e,t){if(c(e)&&function(e){const t=Date.parse(S.list.at(-1)),n=p(e);return n>=V&&n<=t}(e.time)){const n=L(e.time),o=P(t.type,t.range,e.value);return[n,o<E?E:o>I?I:o]}}function ae(){return Array.from(Y.values()).flat()}return e((()=>{R()})),B(),function(){if(!T.evented)return;let e=!1,o={x:0,y:0};y.value.on("mouse:up",(t=>{if(3===t.button&&function(e){const{x:t=0,y:n=0}=e.pointer||{};if(t>=K&&t<=j&&n>=E&&n<=I)if(e.target){if("main"!==e.target.__type)return;o(e.pointer,e.target,["删除节点"]);const{minLeft:t,maxLeft:n,minTop:i,maxTop:l}=f(e.target);ae().forEach((o=>{"main"===o.__type&&o.left>t&&o.left<n&&o.top>i&&o.top<l&&x.list.push({renderItem:()=>o.origin.title,origin:{...o.origin},mode:"remove",pointer:e.pointer})})),1===x.list.length&&(x.show=!1,console.log("当前时间段内无可删除节点"))}else o(e.pointer,null,["新增节点"]),$.forEach((n=>{J(ae(),t,"key",2*A).includes(n.linkKey||n.key)||x.list.push({renderItem:()=>n.title,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,linkKey:n.linkKey},pointer:e.pointer})})),1===x.list.length&&(x.show=!1,q("repeat"),console.log("当前时间段内无可新增节点"));function o(e,t,n){Object.assign(x,{point:e,show:!0,target:t,list:n})}}(t),1===t.button&&e){e=!1;const t=H();t.length>0?Q((()=>{const e=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return te(n[0],"remove",n.length),n.map((e=>({...m(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(t);h("remove",e)})):a.emit(z)}})),y.value.on("mouse:down",(t=>{1!==t.button||t.target||(e=!0,o=t.pointer)})),y.value.on("mouse:move",(i=>{if(!e)return;const{x:l,y:r}=o,{x:a,y:s}=i.pointer;z&&y.value.remove(z),z=new t.Rect({...n,fill:"#CAF982",opacity:.4,...C,left:l,top:r,width:a-l,height:s-r,objectCaching:!0}),z.areaPos={startPos:o,endPos:i.pointer},y.value.add(z)}))}(),{redrawPoints:ne,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(h("remove",n),te(n,"remove")):(Object.assign(n,{data:{time:w(e.pointer.x),value:b(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),h("add",n),te({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:le,setPopup:ie,updateData:te,getGridPoints:ae,getContainPoints:H,showDialog:Q,removeCurrentSelection:U}}export{y as useCenter};
|
|
1
|
+
import{onUnmounted as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as n,drawLine as i,drawPoint as o}from"../useDraw.js";import{useGrid as l}from"../useGrid.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useCommon as s}from"../useCommon.js";import{getPointRange as f,getIndex as c,isEffectiveNode as u,getTime as d}from"../../utils/index.js";import{cloneDeep as p,omit as m}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import{useIntervalFn as v}from"@vueuse/core";function g(g,y,h,k,x){const{cumputedX:L,cumputedY:P,getXValue:b,getYValue:w}=r(y),{xCellWidth:A,pointSelectionStyle:I,originX:C,endX:K,originY:j,endY:E,event:X,scaleValues:M,xAxis:T,startTime:V,timeXCell:Y,itemList:S,dialog:$}=y,F=new Map,O=new Set,D=p(M);let _=[],z=null;const N=new Set;l(g,y);const{getEqualXTypes:G,handleAddPrevent:J,setPrevAndNextPoint:q}=s(g,h,y),{pause:R,resume:W}=v((()=>{!function(){if(!N.size)return;for(const e of N)e.set("opacity",1===e.opacity?.5:1);g.value.renderAll()}()}),800);function B(){D.forEach((e=>{e.dataList.forEach(((t,n)=>{t.show&&(!function(e,t){const{max:n={},min:o={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function a({show:e=!1,value:n,name:o,lineStyle:l}){if(!e||!n)return;const r=P(t.type,t.range,n),a=i([C,r,K,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});X.hovered&&o&&(a.on("mousemove",(({pointer:e})=>{k.point={...e||{x:a.left,y:a.top}},k.list=[`${o} ${n}${t.unit||""}`],k.show=!0})),a.on("mouseout",(()=>{k.show=!1}))),g.value.add(a)}a(n),a(o),a(l),a(r)}(t,e),Z(t,n,e))}))}))}function H(e=[]){if(!(null==z?void 0:z.areaPos))return[];const{startPos:t,endPos:n}=z.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:se()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function Q(e){$.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),U()},onNegativeClick:()=>U(),onClose:()=>U()})}function U(){z&&g.value.remove(z),z=null}function Z(e,t,n){var l;const{type:r,unit:a,dataList:s=[]}=n,f=[];F.set(e.key,[]),function(e,t){N.size&&[...N].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&N.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,c)=>{!function(e,l,c,u){var d;let p,v,x=u;l.key&&(x=s.find((e=>e.key===l.key)));const{pointAttr:L={},lineAttr:P={},title:I="",key:C,type:K="circle"}=x,j=ae(u.list[c+1],n);e&&j&&!l.breakpoint&&e[0]!==j[0]&&(v=i([...e,...j],P));const E=f[c-1],M={origin:{data:l,title:I,key:u.key,selfKey:C,unit:a,type:r,dataIndex:t,index:c,lineAttr:P},__type:"main",leftLine:E,rightLine:v,...L,...y.event.hovered?y.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:y.event};E?p=o(K,{left:E.get("x2"),top:E.get("y2"),...M}):e&&(M.leftLine=null,p=o(K,{left:e[0],top:e[1],...M}));f.push(v),p&&(p.originLeft=p.left,p.originTop=p.top,function(e){X.hovered&&(e.on("mouseover",(()=>{le(e,"hover")})),e.on("mouseout",(()=>{k.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{re(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),X.hovered&&le(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:a,top:s,origin:f}=e,c=~~((a-l)/A);if(a>l+A){if(0===_.length){te(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,r],l,r]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const u=l+A*c;if(_.every((e=>e.left!==u))){const t=b(u),n=w(f.type,s);_.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:u,top:s}),te(e,[...e.prevPointer,u,s])}if(_.length<c&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+A*l,r=_.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=_.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const a=JSON.parse(JSON.stringify(r)),s=_[l-1]||{left:n,top:i},f=~~((r.left-(t-A))/A),c=(r.top-s.top)/f;a.top=s.top+c,a.left=t,a.data={time:b(t),value:w(o.type,a.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},_.splice(l,0,a),te(e,[s.left,s.top,a.left,a.top])}}l++}}(e,c),e.nextPoint){const t=F.get(f.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=A/2,r=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));r>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[r]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{e.left<=l||f.index===e.origin.index||(e.left<a?ee(e,"#999"):ee(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(_.length>0&&i<_[_.length-1].left){for(const e of O)e.left>i&&(e.leftLine&&g.value.remove(e.leftLine),g.value.remove(e));if(_=_.filter((e=>e.left<=i)),0===_.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of O)e.leftLine&&g.value.remove(e.leftLine),g.value.remove(e)}if(_.length>0){const t=_.at(-1);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(k.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:b(e.left),value:w(t,e.top)}};if(g.value.discardActiveObject(),_.length>0){const l=D.find((e=>e.type===t));let r=-1;const a=_.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void ie({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=a.findIndex((e=>e.time===n.time));o>-1?a[o].value=n.value:a.push({...a.at(-1),time:n.time,value:n.value})}const s=l.dataList.findIndex((e=>e.key===n));h("add",{...m(o,["index","selfKey","lineAttr"]),dataIndex:s,key:n,data:a}),ne({...o,data:a,coincideIndex:r})}else h("change",{...m(o,["selfKey","lineAttr"]),key:n}),ne(o,"change")}}))}(p),null==(d=F.get(u.key))||d.push(p))}(ae(l,n),l,c,e)})),Promise.all(F.get(e.key)).then((t=>{const n=f.filter((e=>e));q(t),g.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||N.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function ee(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&e.rightLine.stroke!==t&&e.rightLine.set("stroke",t)}function te(e,t){const[,,n,o]=t;e.clone((l=>{l.set({left:n,top:o,scaleX:1,scaleY:1}),e.prevPointer=[n,o];const r=i(t,e.origin.lineAttr);l.leftLine=r,O.add(l),g.value.add(r,l)}))}function ne(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:a}=e;let{dataIndex:s}=e;const f=D.find((e=>e.type===r)),u=f.dataList.find(((e,t)=>(s=t,e.key===l)));switch(t){case"remove":u.list.splice(o,n),u.list[o-1]&&(u.list[o-1].breakpoint=!0);break;case"change":u.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=c(e,u.list),n=Array.isArray(i)?i:[i];u.list.splice(t,a>-1?a-t+1:0,...n);break}}ie({dataIndex:s,scaleValue:f})}function ie(e){var t,n,i;if(O.size&&(null==(t=g.value)||t.remove(...oe([...O]))),O.clear(),_=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=g.value)||n.remove(...oe(F.get(o.key))),F.delete(o.key),Z(o,t,i)}else F.size&&(null==(i=g.value)||i.remove(...oe(se()))),F.clear(),B()}function oe(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function le(e,t="moving"){const{title:n,type:i,data:o,unit:l}=e.origin;k.point={x:e.left,y:e.top};const r=`${"hover"===t?o.value:w(i,e.top)}`;k.list=[`${n} ${r}${l||""}`,`时间 ${b(e.left).slice(-5)}`],k.show=!0}function re(e){e.setCoords();const t=6e4/Y,n=e.prevPoint?e.prevPoint.left+t:C,i=K;e.top<j&&e.set("top",j),e.top>E&&e.set("top",E),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}function ae(e,t){if(u(e)&&function(e){const t=Date.parse(T.list.at(-1)),n=d(e);return n>=V&&n<=t}(e.time)){const n=L(e.time),i=P(t.type,t.range,e.value);return[n,i<j?j:i>E?E:i]}}function se(){return Array.from(F.values()).flat()}return e((()=>{R()})),B(),function(){if(!X.evented)return;let e=!1,i={x:0,y:0};g.value.on("mouse:up",(t=>{if(3===t.button&&function(e){const{x:t=0,y:n=0}=e.pointer||{};if(t>=C&&t<=K&&n>=j&&n<=E)if(e.target){if("main"!==e.target.__type)return;i(e.pointer,e.target,["删除节点"]);const{minLeft:t,maxLeft:n,minTop:o,maxTop:l}=f(e.target);se().forEach((i=>{"main"===i.__type&&i.left>t&&i.left<n&&i.top>o&&i.top<l&&x.list.push({renderItem:()=>i.origin.title,origin:{...i.origin},mode:"remove",pointer:e.pointer})})),1===x.list.length&&(x.show=!1,console.log("当前时间段内无可删除节点"))}else i(e.pointer,null,["新增节点"]),S.forEach((n=>{G(se(),t,"key",2*A).includes(n.linkKey||n.key)||x.list.push({renderItem:()=>n.title,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,linkKey:n.linkKey},pointer:e.pointer})})),1===x.list.length&&(x.show=!1,J("repeat"),console.log("当前时间段内无可新增节点"));function i(e,t,n){Object.assign(x,{point:e,show:!0,target:t,list:n})}}(t),1===t.button&&e){e=!1;const t=H();t.length>0?Q((()=>{const e=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return ne(n[0],"remove",n.length),n.map((e=>({...m(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(t);h("remove",e)})):a.emit(z)}})),g.value.on("mouse:down",(t=>{1!==t.button||t.target||(e=!0,i=t.pointer)})),g.value.on("mouse:move",(o=>{if(!e)return;const{x:l,y:r}=i,{x:a,y:s}=o.pointer;z&&g.value.remove(z),z=new t.Rect({...n,fill:"#CAF982",opacity:.4,...I,left:l,top:r,width:a-l,height:s-r,objectCaching:!0}),z.areaPos={startPos:i,endPos:o.pointer},g.value.add(z)}))}(),{redrawPoints:ie,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(h("remove",n),ne(n,"remove")):(Object.assign(n,{data:{time:b(e.pointer.x),value:w(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),h("add",n),ne({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:re,setPopup:le,updateData:ne,getGridPoints:se,getContainPoints:H,showDialog:Q,removeCurrentSelection:U}}export{g as useCenter};
|