cnhis-design-vue 3.1.44-release.4 → 3.1.44-release.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -87
- package/es/components/base-search/src/index.vue.js +1 -1
- package/es/components/base-search/src/index.vue2.js +1 -0
- package/es/components/big-table/src/BigTable.vue.js +1 -1
- package/es/components/big-table/src/components/NoData.vue.js +1 -1
- package/es/components/big-table/src/components/NoData.vue2.js +1 -0
- package/es/components/big-table/src/components/edit-form/edit-separate.vue.js +1 -1
- package/es/components/big-table/src/components/edit-form/edit-separate.vue2.js +1 -0
- package/es/components/big-table/src/components/input-button.vue.js +1 -1
- package/es/components/big-table/src/components/input-button.vue2.js +1 -0
- package/es/components/big-table/src/components/separate.vue.js +1 -1
- package/es/components/big-table/src/components/separate.vue2.js +1 -0
- package/es/components/bpmn-workflow/src/BpmnWorkflow.vue.js +1 -1
- package/es/components/bpmn-workflow/src/BpmnWorkflow.vue2.js +1 -0
- package/es/components/button-print/src/ButtonPrint.vue.js +1 -1
- package/es/components/button-print/src/components/EditFormat.vue.js +1 -1
- package/es/components/button-print/src/components/EditFormat.vue2.js +1 -0
- package/es/components/button-print/src/components/IdentityVerification.vue.js +1 -1
- package/es/components/button-print/src/components/IdentityVerification.vue2.js +1 -0
- package/es/components/button-print/src/components/Preview.vue.js +1 -1
- package/es/components/classification/src/components/search-filter/index.vue.js +1 -1
- package/es/components/classification/src/components/search-filter/index.vue2.js +1 -0
- package/es/components/classification/src/components/set-classification/index.vue.js +1 -1
- package/es/components/classification/src/components/set-classification/index.vue2.js +1 -0
- package/es/components/classification/src/components/table-modal/index.vue.js +1 -1
- package/es/components/classification/src/components/table-modal/index.vue2.js +1 -0
- package/es/components/classification/src/index.vue.js +1 -1
- package/es/components/classification/src/index.vue2.js +1 -0
- package/es/components/date-picker/src/DatePicker.vue.js +1 -1
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -0
- package/es/components/fabric-chart/src/FabricChart.vue.js +1 -1
- package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -0
- package/es/components/fabric-chart/src/components/PopupTip.vue.js +1 -1
- package/es/components/fabric-chart/src/components/PopupTip.vue2.js +1 -0
- package/es/components/fabric-chart/src/utils/utils.js +1 -1
- package/es/components/field-set/src/FieldSet.vue.js +1 -1
- package/es/components/field-set/src/FieldSet.vue2.js +1 -0
- package/es/components/form-config/src/FormConfig.vue.js +1 -1
- package/es/components/form-config/src/FormConfig.vue2.js +1 -0
- package/es/components/form-config/src/components/FormConfigCreator.vue.js +1 -1
- package/es/components/form-config/src/components/FormConfigCreator.vue2.js +1 -0
- package/es/components/form-config/src/components/FormConfigDragDisplay.vue.js +1 -1
- package/es/components/form-config/src/components/FormConfigDragDisplay.vue2.js +1 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.js +1 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue2.js +1 -0
- package/es/components/form-config/src/components/renderer/CloseButton.vue.js +1 -1
- package/es/components/form-config/src/components/renderer/CloseButton.vue2.js +1 -0
- package/es/components/form-config/src/components/renderer/ComplexNode.vue.js +1 -1
- package/es/components/form-config/src/components/renderer/ComplexNode.vue2.js +1 -0
- package/es/components/form-config/src/components/renderer/DefaultNode.vue.js +1 -1
- package/es/components/form-config/src/components/renderer/DefaultNode.vue2.js +1 -0
- package/es/components/form-render/src/FormRender.vue.js +1 -1
- package/es/components/form-render/src/FormRender.vue2.js +1 -0
- package/es/components/form-render/src/FormRenderWrapper.vue.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue2.js +1 -0
- package/es/components/form-render/src/components/renderer/combination.js +1 -1
- package/es/components/form-render/src/components/renderer/formItem.js +1 -1
- package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.js +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue2.js +1 -0
- package/es/components/form-render/src/components/renderer/remoteSearch.js +1 -1
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/components/tooltipMessage.vue.js +1 -1
- package/es/components/form-render/src/components/tooltipMessage.vue2.js +1 -0
- package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
- package/es/components/guide/src/renderer.js +1 -1
- package/es/components/iho-select-label/src/LabelFormContent.vue.js +1 -1
- package/es/components/iho-select-label/src/LabelFormContent.vue2.js +1 -0
- package/es/components/iho-select-label/src/SelectLabel.vue.js +1 -1
- package/es/components/iho-select-label/src/SelectLabel.vue2.js +1 -0
- package/es/components/iho-select-label/src/components/label-classify.vue.js +1 -1
- package/es/components/iho-select-label/src/components/label-classify.vue2.js +1 -0
- package/es/components/iho-table/src/IhoTable.vue.js +1 -1
- package/es/components/iho-table/src/IhoTable.vue2.js +1 -0
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.js +1 -1
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue2.js +1 -0
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue2.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/editSeparate.vue2.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -0
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/pictureRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/varialbleHeightPlugin/index.js +1 -1
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/info-header/src/InfoHeader.vue.js +1 -1
- package/es/components/info-header/src/InfoHeader.vue2.js +1 -0
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.js +1 -1
- package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue2.js +1 -0
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.js +1 -1
- package/es/components/info-header/src/components/infoDescription/DescriptionList.vue2.js +1 -0
- package/es/components/info-header/src/components/infoDescription/HiddenContent.vue.js +1 -1
- package/es/components/info-header/src/components/infoDescription/HiddenContent.vue2.js +1 -0
- package/es/components/info-header/src/components/infoDescription/InfoEllipsis.vue.js +1 -1
- package/es/components/info-header/src/components/infoDescription/InfoEllipsis.vue2.js +1 -0
- package/es/components/info-header/src/components/infoDescription/index.vue.js +1 -1
- package/es/components/info-header/src/components/infoDescription/index.vue2.js +1 -0
- package/es/components/info-header/src/components/patientInfo/index.vue.js +1 -1
- package/es/components/info-header/src/components/patientInfo/index.vue2.js +1 -0
- package/es/components/keyboard/src/Keyboard.vue.js +1 -1
- package/es/components/keyboard/src/Keyboard.vue2.js +1 -0
- package/es/components/keyboard/src/components/InputNumber.vue.js +1 -1
- package/es/components/keyboard/src/components/InputNumber.vue2.js +1 -0
- package/es/components/keyboard/src/components/NumberPanel.vue.js +1 -1
- package/es/components/keyboard/src/components/NumberPanel.vue2.js +1 -0
- package/es/components/map/src/Map.vue.js +1 -1
- package/es/components/map/src/Map.vue2.js +1 -0
- package/es/components/quick-search/src/index.vue.js +1 -1
- package/es/components/quick-search/src/index.vue2.js +1 -0
- package/es/components/recommend-search/src/RecommendSearch.vue.js +1 -1
- package/es/components/recommend-search/src/RecommendSearch.vue2.js +1 -0
- package/es/components/recommend-search/src/components/RecommendInput.vue.js +1 -1
- package/es/components/recommend-search/src/components/RecommendInput.vue2.js +1 -0
- package/es/components/recommend-search/src/components/RecommendMenu.vue.js +1 -1
- package/es/components/recommend-search/src/components/RecommendMenu.vue2.js +1 -0
- package/es/components/recommend-search/src/components/RecommendSelect.vue.js +1 -1
- package/es/components/recommend-search/src/components/RecommendSelect.vue2.js +1 -0
- package/es/components/scale-view/src/ScaleView.vue.js +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -0
- package/es/components/scale-view/src/components/AnswerParse.vue.js +1 -1
- package/es/components/scale-view/src/components/AnswerParse.vue2.js +1 -0
- package/es/components/scale-view/src/components/EvaluateCountdown.vue.js +1 -1
- package/es/components/scale-view/src/components/EvaluateCountdown.vue2.js +1 -0
- package/es/components/scale-view/src/components/EvaluatePage.vue.js +1 -1
- package/es/components/scale-view/src/components/EvaluatePage.vue2.js +1 -0
- package/es/components/scale-view/src/components/LoadingCom.vue.js +1 -1
- package/es/components/scale-view/src/components/NoData.vue.js +1 -1
- package/es/components/scale-view/src/components/NoData.vue2.js +1 -0
- package/es/components/search-cascader/src/SearchCascader.vue.js +1 -1
- package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -0
- package/es/components/search-cascader/src/components/SearchMenu.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -0
- package/es/components/select-label/src/SelectLabel.vue.js +1 -1
- package/es/components/select-label/src/components/label-classify.vue.js +1 -1
- package/es/components/select-label/src/components/label-classify.vue2.js +1 -0
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
- package/es/components/select-person/src/SearchMultiple.vue.js +1 -1
- package/es/components/select-person/src/SelectPerson.vue.js +1 -1
- package/es/components/shortcut-provider/src/ShortcutProvider.vue.js +1 -1
- package/es/components/shortcut-provider/src/ShortcutProvider.vue2.js +1 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.js +1 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue2.js +1 -0
- package/es/components/shortcut-setter/src/ShortcutSetterItem.vue.js +1 -1
- package/es/components/shortcut-setter/src/ShortcutSetterItem.vue2.js +1 -0
- package/es/components/steps-wheel/src/StepsWheel.vue.js +1 -1
- package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -0
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue2.js +1 -0
- package/es/components/table-filter/src/components/classify-filter/index.vue.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue2.js +1 -0
- package/es/components/table-filter/src/components/render-widget/components/CheckboxGroup.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/CheckboxGroup.vue2.js +1 -0
- package/es/components/table-filter/src/components/render-widget/components/Date.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/Date.vue2.js +1 -0
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue2.js +1 -0
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue2.js +1 -0
- package/es/components/table-filter/src/components/render-widget/components/InputNumberGroup.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/InputNumberGroup.vue2.js +1 -0
- package/es/components/table-filter/src/components/render-widget/components/Label.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/Label.vue2.js +1 -0
- package/es/components/table-filter/src/components/render-widget/components/Select.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/Select.vue2.js +1 -0
- package/es/components/table-filter/src/components/render-widget/components/SelectLabel.vue.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/SelectLabel.vue2.js +1 -0
- package/es/components/table-filter/src/components/render-widget/index.vue.js +1 -1
- package/es/components/time-line/src/TimeLine.vue.js +1 -1
- package/es/components/time-line/src/TimeLine.vue2.js +1 -0
- package/es/components/time-picker/src/TimePicker.vue.js +1 -1
- package/es/components/time-picker/src/TimePicker.vue2.js +1 -0
- package/es/components/vod-chunk-upload/src/chunk-upload-new.vue.js +1 -1
- package/es/components/vod-chunk-upload/src/chunk-upload-new.vue2.js +1 -0
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue.js +1 -1
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +1 -0
- package/es/env.d.ts +25 -25
- package/es/shared/components/SelectPage/SelectPage.vue.js +1 -1
- package/es/shared/components/SelectPage/SelectPage.vue2.js +1 -0
- package/es/shared/components/SvgIcon/SvgIcon.vue.js +1 -1
- package/es/shared/components/SvgIcon/SvgIcon.vue2.js +1 -0
- package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.js +1 -1
- package/es/shared/components/TextOverTooltip/TextOverTooltip.vue2.js +1 -0
- package/es/shared/components/no-data/NoData.vue.js +1 -1
- package/es/shared/components/no-data/NoData.vue2.js +1 -0
- package/es/shared/package.json.js +1 -1
- package/package.json +1 -1
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/tapable/index.d.ts +0 -139
- /package/es/_virtual/{plugin-vue_export-helper.js → _plugin-vue_export-helper.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"./filter.vue2.js";import r from"../../../../../_virtual/_plugin-vue_export-helper.js";var t=r(e,[["__file","filter.vue"]]);export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,computed as l,inject as a,ref as t,onDeactivated as u,openBlock as n,createElementBlock as o,unref as r,createBlock as i,createCommentVNode as v,createElementVNode as s,createVNode as c,isRef as d,withCtx as p,normalizeStyle as f,Fragment as h,renderList as m,toDisplayString as y,createTextVNode as _}from"vue";import{widthAppend as b}from"../../../../../shared/utils/index.js";import{useVirtualList as g}from"@vueuse/core";import{isNumber as k}from"lodash-es";import{NInput as C,NCheckbox as $,NCheckboxGroup as S,NButtonGroup as x,NButton as L}from"naive-ui";const U={class:"iho-table__filterWrapper"},j={class:"iho-table__filterListItem"},w={class:"iho-table__filterFooter"};var E=e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){const E=e,F=l((()=>{var e,l,a;return null!=(a=null==(l=null==(e=E.payload)?void 0:e.column)?void 0:l.filters)?a:[]})),I=l({get:()=>F.value.reduce(((e,l)=>(l.checked&&e.push(l.value),e)),[]),set(e){if(E.payload)return F.value.forEach((l=>{E.payload.$panel.changeOption(null,e.includes(l.value),l)})),E.payload.$panel.confirmFilter(new CustomEvent("click"))}}),O=a("$xetable"),P=t([...I.value]),W=t("");function q(){O&&(O.reactData.filterStore.visible=!1)}u(q);const z=l((()=>{var e,l;if(!E.payload||!E.payload.column)return 10;const{filterCapacity:a}=null!=(l=null==(e=E.payload.column.editRender)?void 0:e.props)?l:{};return k(a)&&a>0?a:10})),{list:D,containerProps:H,wrapperProps:R}=g(l((()=>W.value?F.value.filter((e=>`${e.label}`.includes(W.value))):F.value)),{itemHeight:32,overscan:3}),A=l((()=>!!P.value.length&&P.value.length!==F.value.length)),B=l({get:()=>P.value.length===F.value.length&&0!==F.value.length,set:e=>{P.value=e?F.value.map((e=>e.value)):[]}}),G=l((()=>({...H.style,height:b(32*z.value)})));function J(){I.value=P.value,q()}function K(){P.value=[]}return(e,l)=>(n(),o("section",U,[r(F).length>5?(n(),i(r(C),{key:0,value:W.value,"onUpdate:value":l[0]||(l[0]=e=>W.value=e)},null,8,["value"])):v("v-if",!0),s("div",j,[c(r($),{label:"全选",checked:r(B),"onUpdate:checked":l[1]||(l[1]=e=>d(B)?B.value=e:null),indeterminate:r(A)},null,8,["checked","indeterminate"])]),c(r(S),{value:P.value,"onUpdate:value":l[3]||(l[3]=e=>P.value=e)},{default:p((()=>[s("section",{ref:r(H).ref,style:f(r(G)),onScroll:l[2]||(l[2]=(...e)=>r(H).onScroll&&r(H).onScroll(...e)),class:"iho-table__filterListWrapper"},[s("section",{style:f(r(R).style)},[(n(!0),o(h,null,m(r(D),(e=>(n(),o("div",{class:"iho-table__filterListItem",key:e.data.value},[c(r($),{value:e.data.value,label:e.data.label},null,8,["value","label"])])))),128))],4)],36)])),_:1},8,["value"]),s("footer",w,[s("section",null,y(`已选择${P.value.length}项`),1),c(r(x),{size:"small"},{default:p((()=>[c(r(L),{onClick:K},{default:p((()=>[_("清空")])),_:1}),c(r(L),{onClick:q},{default:p((()=>[_("取消")])),_:1}),c(r(L),{type:"primary",onClick:J},{default:p((()=>[_("确定")])),_:1})])),_:1})])]))}});export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"./editDate.vue2.js";import t from"../../../../../../../_virtual/_plugin-vue_export-helper.js";var r=t(e,[["__file","editDate.vue"]]);export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,useAttrs as t,ref as r,computed as i,onMounted as a,openBlock as l,createBlock as o,unref as n,mergeProps as u,isRef as s}from"vue";import{generateTimeFormat as d}from"../../../../../../../shared/utils/index.js";import{isFunction as m}from"lodash-es";import{useIhoTableFormEvent as p}from"../../../../utils/index.js";import c from"../../../../../../date-picker/index.js";var f=e({__name:"editDate",props:{value:{type:String,default:void 0},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0}},emits:["update:value"],setup(e,{emit:f}){const v=e,w=t(),{emitFormChangeWithParams:D}=p(v),y=r(),b=i({get:()=>v.value,set(e){const t=v.value;t!==e&&(f("update:value",e),D({oldValue:t}))}}),g=i((()=>{const e=w.valueFormat||"yyyy-MM-dd HH:mm:ss";return{valueFormat:e,format:e,timePickerProps:{format:d(e)}}})),{isStartDate:$=!1,isEndDate:h=!1}=w,T=w.connectField||"",j=(e,t)=>$&&T?e>t:!(!h||!T)&&e<t,x=e=>{const t=new Date(v.row[T]),r=new Date(e),{h:i,m:a,s:l}=q(t),o=(e,t,r,i)=>!(h&&r>i)&&(!($&&r<i)&&j(e,t));return{isHourDisabled:t=>{if(!v.row[T])return!1;const a=new Date(`${v.row[T].split(" ")[0]} 00:00:00`).getTime(),{m:l,s:n}=q(r);return o(t,i,e-60*t*60*1e3-60*l*1e3-1e3*n,a)},isMinuteDisabled:t=>{if(!v.row[T])return!1;const l=new Date(`${v.row[T].split(" ")[0]} ${i}:00:00`).getTime(),{s:n}=q(r);return o(t,a,e-60*t*1e3-1e3*n,l)},isSecondDisabled:t=>{if(!v.row[T])return!1;const r=new Date(`${v.row[T].split(" ")[0]} ${i}:${a}:00`).getTime();return o(t,l,e-1e3*t,r)}}},S={type:w.type||"datetime",clearable:!0,placeholder:w.placeholder||"请选择",...w,...g.value,isDateDisabled:k(w.isDateDisabled)||(e=>!!v.row[T]&&j(e,h?new Date(`${v.row[T].split(" ")[0]} 00:00:00`).getTime():new Date(v.row[T]).getTime()))};function k(e){return m(e)?t=>e(t,v.row):null}function q(e){return{h:e.getHours(),m:e.getMinutes(),s:e.getSeconds()}}return S.type.includes("time")&&(S.isTimeDisabled=k(w.isTimeDisabled)||x),a((()=>{var e,t,r,i,a,l,o;return null==(o=null==(a=null==(r=null==(t=null==(e=y.value)?void 0:e.$datePicker)?void 0:t.inputInstRef)?void 0:(i=r.$el).querySelector)?void 0:(l=a.call(i,"input")).select)?void 0:o.call(l)})),(e,t)=>(l(),o(n(c),u({ref_key:"formRef",ref:y},n(S),{"formatted-value":n(b),"onUpdate:formatted-value":t[0]||(t[0]=e=>s(b)?b.value=e:null)}),null,16,["formatted-value"]))}});export{f as default};
|
package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createVNode as e,mergeProps as l,defineComponent as r,computed as o}from"vue";import{isNumber as t}from"lodash-es";import{NInputNumber as n}from"naive-ui";import"../../../../index.js";import{EDITABLE_WIDGET_TYPE as u}from"../../../constants/index.js";import{IhoTableRenderHelper as a}from"../../../utils/index.js";import{defineTablePlugin as i}from"../../../hooks/useTablePlugin.js";const d=r({name:"IhoTableInputNumber",props:{value:[String,Number]},emits:["update:value"],setup(l,{emit:r}){const u=o({get:()=>t(l.value)?l.value:l.value&&t(+l.value)?+l.value:null,set(e){r("update:value",e)}});return()=>e(n,{value:u.value,"onUpdate:value":e=>u.value=e},null)}});function m(){return i({name:"numberRendererPlugin",vxe(r){r.renderer.add(u.NUMBER,{renderCell:a.createDefaultRenderCell(),renderEdit:a.createRenderEdit((({row:r,column:o,fieldItem:t,emitFormClick:n,emitFormChangeWithParams:u})=>{const{placeholder:a="请输入"}=t.componentProps||{},i={clearable:!0,placeholder:a,onBlur:()=>u({type:"blur",oldValue:r[o.field]}),onUpdateValue:e=>{const l=r[o.field];r[o.field]=e,u({oldValue:l})},onClick:n};return[e(d,l({value:r[o.field],"onUpdate:value":e=>r[o.field]=e},i,t.componentProps),null)]}))})}})}export{m as numberRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"./editSeparate.vue2.js";import r from"../../../../../../../_virtual/_plugin-vue_export-helper.js";var t=r(e,[["__file","editSeparate.vue"]]);export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,inject as t,ref as a,watch as o,computed as u,onMounted as l,onDeactivated as r,openBlock as n,createBlock as i,unref as s,withCtx as p,createElementVNode as d,withModifiers as v,normalizeStyle as c,toDisplayString as m,renderSlot as f,createVNode as h}from"vue";import{cloneDeep as w,isObject as y,isArray as g}from"lodash-es";import{NPopover as b,NInput as x}from"naive-ui";import{InjectionIhoTableHandler as k}from"../../../../constants/index.js";import{useIhoTableFormEvent as C}from"../../../../utils/index.js";const j=["onClick"];var U=e({__name:"editSeparate",props:{value:{},height:{type:Number,default:48},column:{type:Object,required:!0},row:{type:Object,required:!0},displayContent:{type:String,default:""},rowIndex:{type:Number,required:!0}},emits:["update:value","click"],setup(e,{emit:U}){const _=e,q=t(k),P=a(),S=a();function I(e){S.value=e}const N=a(!1);function O(e){N.value=e}function R(e){N.value=!N.value,U("click",e)}o(N,(function(e){e?async function(){var e;S.value=w(_.value),await new Promise((e=>setTimeout(e))),null==(e=P.value)||e.syncPosition()}():z()}));const{emitFormChangeWithParams:T}=C(_);async function z(){if(!y(S.value)&&!g(S.value)&&_.value===S.value)return;const e=_.value;U("update:value",S.value),T({oldValue:e}),q.updateTableDataRef()}const B=u((()=>({border:"1px solid #f5f5f5",height:_.height-16+"px",display:"flex",alignItems:"center",padding:"0",background:"white",wordBreak:"keep-all",boxSizing:"border-box","border-radius":"4px"})));return l((()=>O(!0))),r(z),(t,a)=>(n(),i(s(b),{ref_key:"popoverRef",ref:P,trigger:"manual",show:N.value,"onUpdate:show":a[1]||(a[1]=e=>N.value=e),"show-arrow":!1},{trigger:p((()=>[d("div",{onClick:v(R,["stop"]),style:c(s(B))},m(e.displayContent||" "),13,j)])),default:p((()=>[f(t.$slots,"menu",{value:S.value,"onUpdate:value":I,"onUpdate:show":O,col:e.column,row:e.row},(()=>[h(s(x),{value:S.value,"onUpdate:value":a[0]||(a[0]=e=>S.value=e),type:"textarea"},null,8,["value"])]))])),_:3},8,["show"]))}});export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"./editTime.vue2.js";import i from"../../../../../../../_virtual/_plugin-vue_export-helper.js";var r=i(e,[["__file","editTime.vue"]]);export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,useAttrs as l,ref as t,watch as a,nextTick as o,openBlock as r,createBlock as u,unref as i,mergeProps as n,withCtx as m,createVNode as c,createElementBlock as d,Fragment as v,renderList as f,createTextVNode as s,toDisplayString as p,createCommentVNode as k}from"vue";import{NPopover as h,NInput as y,NSpace as _,NScrollbar as w,NButton as b}from"naive-ui";import{useIhoTableFormEvent as g}from"../../../../utils/index.js";import{useAutoFocus as V}from"../hooks/useAutoFocus.js";import C from"../../../../../../time-picker/index.js";import{parse as F,isValid as j,format as q}from"date-fns";var x=e({__name:"editTime",props:{formattedValue:{type:String,default:void 0},column:{type:Object,required:!0},row:{type:Object,required:!0},rowIndex:{type:Number,required:!0}},emits:["update:formattedValue","click"],setup(e,{emit:x}){const R=e,S=l(),{emitFormChangeWithParams:A}=g(R),{formRef:I,isShow:O}=V(),P=t(),$=t(),E=t();let H=R.formattedValue;const{placeholder:U="请选择",valueFormat:z="HH:mm",shortcutOptions:D=[]}=S,K={placeholder:U,valueFormat:z,format:z};function N(e){E.value=e,H!==e&&(x("update:formattedValue",e),A({oldValue:H}),H=e)}function T(){[K.valueFormat.replace(/:/,""),K.valueFormat].some((e=>{const l=F(($.value||"").trim(),e,new Date);if(j(l)){return N(q(l,K.valueFormat)),!0}}))}function W(e){var l;const{key:t}=e;"Enter"===t&&(null==(l=I.value)||l.blur(),O.value=!1)}return a((()=>R.formattedValue),(e=>{$.value=e,E.value=e}),{immediate:!0}),a((()=>O.value),(async e=>{var l,t,a,r,u;e&&(await o(),null==(u=null==(r=null==(a=null==(t=null==(l=P.value)?void 0:l.$timePicker)?void 0:t.panelInstRef)?void 0:a.$el)?void 0:r.querySelectorAll(".n-time-picker-col"))||u.forEach((e=>{var l,t;return null==(t=null==(l=null==e?void 0:e.querySelector)?void 0:l.call(e,".n-time-picker-col__item--active"))?void 0:t.scrollIntoView()})))})),(e,l)=>(r(),u(i(h),n({show:i(O),trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"}},e.$attrs,{onClickoutside:l[3]||(l[3]=()=>O.value=!1)}),{trigger:m((()=>[c(i(y),{ref_key:"formRef",ref:I,clearable:"",value:$.value,"onUpdate:value":l[0]||(l[0]=e=>$.value=e),onClick:l[1]||(l[1]=()=>O.value=!0),onChange:T,onKeydown:W},null,8,["value"])])),default:m((()=>[c(i(_),null,{default:m((()=>[c(i(C),n({ref_key:"timePickerRef",ref:P,show:"","formatted-value":E.value},i(K),{class:"iho-table__time-picker",to:!1,"onUpdate:formattedValue":N,onConfirm:l[2]||(l[2]=()=>O.value=!1)}),null,16,["formatted-value"]),c(i(w),{class:"iho-table__scrollbar"},{default:m((()=>[i(D).length?(r(),u(i(_),{key:0,vertical:"",wrap:!1},{default:m((()=>[(r(!0),d(v,null,f(i(D),(e=>(r(),u(i(b),{size:"tiny",key:e,onClick:l=>function(e){N(e),O.value=!1}(e)},{default:m((()=>[s(p(e),1)])),_:2},1032,["onClick"])))),128))])),_:1})):k("v-if",!0)])),_:1})])),_:1})])),_:1},16,["show"]))}});export{x as default};
|
package/es/components/iho-table/src/plugins/rendererPlugins/widgets/pictureRendererPlugin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createVNode as e,defineComponent as r,watch as t,onBeforeUnmount as n}from"vue";import{jsonParse as i,arrayed as o}from"../../../../../../shared/utils/index.js";import"../../../../index.js";import{WIDGET_TYPE as s}from"../../../constants/index.js";import{getRowHeight as l,IhoTableWarn as u}from"../../../utils/index.js";import d from"viewerjs";import"viewerjs/dist/viewer.css";import{defineTablePlugin as m}from"../../../hooks/useTablePlugin.js";function a(){return m({name:"pictureRendererPlugin",vxe(r){function t(r){return{renderCell(t,{row:n,column:s}){try{if(!n[s.field])return[];const t=i(n[s.field]),u=l()-16;return[e("section",{style:"display:flex;justify-content:center"},[e(p,{style:{width:u+"px",height:u+"px",...r},images:o(t).map((e=>e.url))},null)])]}catch(e){return u(`invalid ${t.name} value of field(${s.field}): ${n[s.field]}`),[]}}}}r.renderer.add(s.PICTURE,t({})),r.renderer.add(s.HEADPORTRAIT,t({"border-radius":"50%"}))}})}const p=r({name:"ViewerImage",props:{images:{type:Array,default:()=>[]},options:{type:Object,default:()=>({})}},setup(r){let i=null;function o(){if(i)return i.show();const e=document.createElement("section");r.images.map((r=>e.appendChild(function(e){const r=new Image;return r.src=e,r}(r)))),i=new d(e,r.options).show()}return t([()=>r.images,()=>r.options],(()=>{null==i||i.destroy(),i=null}),{deep:!0}),n((()=>null==i?void 0:i.destroy())),()=>e("img",{style:"cursor:pointer",alt:"",src:r.images[0],onClick:o},null)}});export{a as pictureRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{unref as e,createVNode as t,onBeforeUnmount as o,shallowReactive as l,defineComponent as n,inject as r,ref as a,computed as s,provide as i,watch as u,onMounted as d,h as c}from"vue";import{traverse as p,widthAppend as f}from"../../../../../shared/utils/index.js";import{doAnimation as m}from"../../../../../shared/utils/anime.js";import{useThrottleFn as h}from"@vueuse/core";import{promiseTimeout as g}from"@vueuse/shared";import{last as v,isFunction as x,omit as I,isNumber as b}from"lodash-es";import"../../../index.js";import{WIDGET_TYPE as w,InjectionIhoTableUUID as y}from"../../constants/index.js";import{useUUIDMap as T}from"../../utils/index.js";import{defineTablePlugin as H}from"../../hooks/useTablePlugin.js";class R{constructor(){this.records={},this.maxRecords=l(new Map)}set(e,t,o){if(this.records[e]||(this.records[e]={}),this.records[e][t]===o)return;this.records[e][t]=o;const l=Math.max(...Object.values(this.records[e]),0);this.maxRecords.get(e)!==l&&this.maxRecords.set(e,l)}getMax(e){return this.maxRecords.get(e)||0}}const{getItemFromUUID:D,removeItemFromUUID:M}=T((()=>new R),!0),{getItemFromUUID:S,removeItemFromUUID:U,setItemFromUUID:C}=T((()=>null)),{getItemFromUUID:$,removeItemFromUUID:E,setItemFromUUID:k}=T((()=>{})),F=n({props:{payload:{type:Object,required:!0}},setup(e){const o=r(y),l=r("$xetable"),n=a(),p=D(o),m=s((()=>e.payload.row[e.payload.column.field]));function h(){const{row:t,column:o}=e.payload,r=l.getRowSeq(t);if(!p||null==r||!n.value)return;const a=n.value.clientHeight;p.set(r,o.field,a)}i("updateCellHeight",h),u([()=>e.payload.rowIndex,()=>e.payload.column.field,m,()=>e.payload.column.renderWidth],(async()=>{await g(0),h()})),d((()=>{l&&!S(o)&&C(o,l),h()}));const v=s((()=>{var t,o,l,n;const r=null!=(o=null==(t=e.payload.column.editRender)?void 0:t.props)?o:{},a=null!=(n=null==(l=r.slots)?void 0:l.default)?n:r.slotFn;return x(a)?a:()=>m.value})),I=s((()=>{if(e.payload.column.treeNode)return"";const t=e.payload.column.renderWidth;return b(t)&&t>0?f(t-20-2):""}));return()=>t("div",{ref:n,style:{padding:"7px 0",width:I.value,overflow:"hidden"}},[c(v.value,e.payload)])}});function j(t,o,{scrollTop:l=0}){var n,r;const{uuid:a,rowConfig:s={}}=o;if(!a)return;const i=D(a),{oSize:u=0,gt:d=100}=null!=(n=$(a))?n:{},{internalData:c,reactData:p}=t,{scrollYStore:f,elemStore:m,afterFullData:h,fullDataRowIdData:g}=c;if(d>h.length)return;const I=null!=(r=s.height)?r:36,b=m["main-body-wrapper"],w=b?e(b):null;let y=w?Math.max(8,Math.ceil(w.clientHeight/I)+2+u):8;const T=[0];let H=0;if(l&&h.find(((e,o)=>{const n=t.getRowSeq(e),r=(v(T)||0)+Math.max(I,i.getMax(n));if(T.push(r),r>l)return H=Math.max(0,o-u),y+=Math.min(H,u),!0})),H>0&&x(o.spanMethod)){const{spanMethod:e}=o,l={rowspan:1,colspan:1};for(;H>0;){if(!t.getColumns().some(((t,o)=>{const{rowspan:n,colspan:r}=e({column:t,columnIndex:o,$columnIndex:o,row:h[H],rowIndex:H,$rowIndex:H,_rowIndex:H,isHidden:!t.visible,fixed:t.fixed,type:t.type,visibleData:h})||l;if(0===n&&0===r)return H--,!0})))break}}const R=`${T[H]}px`,M=`${h.reduce(((e,o)=>{const l=t.getRowSeq(o);return e+Math.max(I,i.getMax(l))}),0)}px`;["main","left","right"].forEach((t=>{const o=m[`${t}-body-table`],n=o?e(o):null;n&&(n.style.marginTop=R,n.scrollTop=l),["header","body","footer"].forEach((o=>{const l=m[`${t}-${o}-ySpace`],n=l?e(l):null;n&&(n.style.height=M)}))}));const S=Math.min(h.length,H+y);if(f.startIndex===H&&f.endIndex===S)return;f.startIndex=H,f.endIndex=S;const U=h.slice(f.startIndex,f.endIndex);U.forEach(((e,o)=>{const l=t.getRowid(e),n=g[l];n&&(n.$index=o)})),p.tableData.length=0,p.tableData.push(...U)}const L=h(j,300);function Y(){const l="variableHeightRendererPlugin";return H({name:l,vxe(e){e.renderer.add(w.VARIABLE_HEIGHT,{renderCell:(e,o)=>t(F,{payload:o},null)})},apply(t){function n(t){const o=S(t.uuid);if(!o)return;t.scrollY={enabled:!1},o.reactData.scrollYLoad=!1;const l=function(t){const o=t.internalData.elemStore["main-body-wrapper"];return o?e(o):null}(o);l&&j(o,t,{scrollTop:l.scrollTop})}function r(e){if(!e.uuid)return;const t=$(e.uuid);t&&(e.scrollY=t),setTimeout((()=>n(e)),300)}t.dataHooks.dataStart.tap(l,r),t.eventHooks.onFilterChange.tap(l,((e,t)=>r(t))),t.eventHooks.onSortChange.tap(l,((e,t)=>r(t))),t.eventHooks.onToggleTreeExpand.tap(l,((e,t)=>r(t))),t.eventHooks.onResizableChange.tap(l,(async({column:e},t)=>{if(!e.editRender||!e.editRender.props)return;e.editRender.props.variableHeight&&r(t)})),t.eventHooks.onScroll.tap(l,h(((e,t)=>{if(e.isX)return;const{uuid:o}=t;if(!o)return;const l=S(o);l&&j(l,t,e)}),100,!0,!0)),t.fieldHooks.field.tap(l,(e=>{if(Reflect.get(e,"variableHeight")){const t=e.slots;e.slots=I(t,["default"]),e.editRender={...e.editRender,name:w.VARIABLE_HEIGHT};const o=e.className,l="variable-height";e.className=o?function(e){return x(o)?[o(e),l]:[o,l]}:l}return e})),t.fieldHooks.fieldList.tap(l,((t,o,{$table:l})=>(o.uuid&&p(t,((r,a)=>{var s,i,u;if((null==(s=r.editRender)?void 0:s.name)===w.VARIABLE_HEIGHT){const r=null!=(u=null==(i=o.rowConfig)?void 0:i.height)?u:36,s=D(o.uuid),d=o.cellStyle;if(o.cellStyle=function(e){const t={};if(l.value){const o=Math.max(r,s.getMax(l.value.getRowSeq(e.row)));t.height=`${o}px`}return Object.assign(t,d?x(d)?d(e):d:null)},o.sortableConfig&&o.sortableConfig.enable){const t=o.sortableConfig.onEnd;o.sortableConfig.onEnd=function(l){const n=S(o.uuid);if(n){const{internalData:{elemStore:t}}=n,l=t["main-table-body"];l&&e(l)&&j(n,o,{scrollTop:e(l).scrollTop})}x(t)&&t(l)}}o.showOverflow="tooltip",p(t,(e=>{e.showOverflow="tooltip"})),o.scrollY={...o.scrollY,mode:"default"},o.onWheel=function(t){let o=null,l=0,n=!0;return function(r){if(!t.uuid)return;const a=S(t.uuid);if(!a)return;const{internalData:s}=a,{isHover:i}=t.rowConfig||{},{deltaX:u,deltaY:d}=r,{refTableLeftBody:c,refTableRightBody:p,refTableBody:f}=a.getRefMaps(),h=d,g=u,v=h<0,x=e(f),I=x?x.$el:null;if(!I)return;if(v?I.scrollTop<=0:I.scrollTop>=I.scrollHeight-I.clientHeight)return;const b=I.scrollTop+h,w=I.scrollLeft+g;if(b===s.lastScrollTop)return;r.preventDefault(),s.lastScrollTop=b,s.lastScrollLeft=w,s.lastScrollTime=Date.now(),i&&a.clearHoverRow();const y=c.value,T=p.value,H=y?y.$el:null,R=T?T.$el:null,D=Math.min(100,Math.abs(Math.floor(h/2)));n&&(l=I.scrollTop,n=!1),l+=D*(v?-1:1),o&&o(),o=m(I.scrollTop,l,400,(e=>{I.scrollTop=e,H&&(H.scrollTop=e),R&&(R.scrollTop=e)}),"easeOutCubic",(()=>{l=I.scrollTop,n=!0})),L(a,t,I)}}(o),setTimeout((()=>{k(o.uuid,o.scrollY),n(o)}),300),a()}})),t))),t.setupHooks.setup.tap(l,(e=>{o((()=>{e.value.uuid&&(M(e.value.uuid),U(e.value.uuid),E(e.value.uuid))}))}))}})}export{Y as variableHeightRendererPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reactive as e,inject as n,unref as t,toRaw as r,createVNode as i}from"vue";import{jsonParse as o,arrayed as u,findAncestor as l}from"../../../../shared/utils/index.js";import{promiseTimeout as c}from"@vueuse/shared";import{isNumber as a,
|
|
1
|
+
import{reactive as e,inject as n,unref as t,toRaw as r,createVNode as i}from"vue";import{jsonParse as o,arrayed as u,findAncestor as l}from"../../../../shared/utils/index.js";import{promiseTimeout as c}from"@vueuse/shared";import{isNumber as a,isString as d,isObject as s,isArray as f,cloneDeep as m}from"lodash-es";import{InjectionIhoTableConfig as p,InjectionIhoTableEmits as v,IHO_TABLE_STRING_STATUS as g,IHO_TABLE_NUMBER_STATUS as E,IHO_TABLE_TREE_TYPE as I}from"../constants/index.js";function h(e){return console.warn(`[IhoTable]: ${e}`)}const T=Object.freeze({getCellType(e){var n;return((null==(n=e.settingObj)?void 0:n.attr)||e.formType||"DEFAULT").toUpperCase()}});function C(){var e,t,r;const i=n(p);return i||h("this function(getRowHeight) only can be used in setup environment"),null!=(r=null==(t=null==(e=null==i?void 0:i.value)?void 0:e.rowConfig)?void 0:t.height)?r:32}function R(e){const n=e.slice(2);return`${n[0].toLowerCase()}${n.slice(1)}`}function S(e){return`on${e[0].toUpperCase()}${e.slice(1)}`}function w(n,t=!0){const r=t?e(new Map):new Map;return{getItemFromUUID:function(e){return r.set(e,r.get(e)||n()).get(e)},setItemFromUUID:function(e,n){r.set(e,n)},removeItemFromUUID:function(e){r.delete(e)}}}async function O(e,n){return r()||await c(0),r()||function(){const n=+e.colWidth;return a(n)?n:64}();function r(){var r,i;return null==(i=null==(r=t(n))?void 0:r.getColumnByField(e.field))?void 0:i.renderWidth}}function F(e){const t=n(v);function i(){var n;return{value:e.row[e.column.field],row:e.row,column:{...e.column,...null==(n=e.column.editRender)?void 0:n.props},index:e.rowIndex>-1?e.rowIndex:e.$rowIndex}}function o(e={}){t("formChange",{...i(),...m(r(e))})}function u(e={}){t("formClick",{...i(),...m(r(e))})}return{emitFormChange:function(){o()},emitFormClick:function(){u()},emitFormChangeWithParams:o,emitFormClickWithParams:u}}const P=Object.freeze({createDefaultRenderCell:function(){return function(e,{row:n,column:t}){return[i("span",null,[n[t.field]])]}},createRenderEdit:function(e){return function({props:n},t){return e({...t,fieldItem:n||{},...F(t)})}},isEditableColumn(e,n){var t;return!1!==(null==(t=e.editConfig)?void 0:t.showIcon)&&n.editRender&&!1!==n.editRender.enabled},hasFilter(e){if(y(e))return!0;let n=e.fieldSetting;return d(n)&&(n=o(n||"")),s(n)&&((t=n).notParticipatingSearch!==g.POSITIVE&&"manual"===(null==(r=t.mapping)?void 0:r.type));var t,r},hasDateFiler(e){var n;return null==(n=null==e?void 0:e.filterSetting)?void 0:n.daterange}}),A=Object.freeze({isPositive:e=>e===E.POSITIVE||e===g.POSITIVE,isNegative:e=>e===E.NEGATIVE||e===g.NEGATIVE,notPositive:e=>e!==E.POSITIVE&&e!==g.POSITIVE,notNegative:e=>e!==E.NEGATIVE&&e!==g.NEGATIVE}),N=(e,n)=>({$event:t,column:r})=>{var i;if(!u(e).includes(null==(i=r.editRender)?void 0:i.name))return!0;const o=null==t?void 0:t.target;return!s(o)||!l(o,n)};function V(e){return[I.TRANSFORM_WITH_SPAN_METHOD,I.TRANSFORM_TREE_TYPE].includes(`${e.isTree}`)}function $(e){return d(e)&&!!e.match(/^###\{[^{}]+}$/)}function x(e){try{return JSON.parse(e.replace(/^###/,""))}catch(e){return{}}}function U(e,n){if(e.$__SEPARATE||!n.editRender||!n.editRender.props)return e[n.field];const{fieldSetting:t}=n.editRender.props;if(!d(t))return e[n.field];const{mergedFeildExpression:r}=o(t);return r&&d(r)?r.replace(/#{(.+?)}/g,(function(n,t){let r=t?e[t.trim()]:null;$(r)&&(r=x(r).change_text);return r||(null==r?"--":r)})):e[n.field]}const b=["SEARCH","SELECT","RADIO","CHECKBOX"];function y(e){return e.notParticipatingSearch===E.NEGATIVE&&b.includes(T.getCellType(e))&&f(e.options)&&e.options.length}export{P as IhoTableRenderHelper,A as IhoTableStatusHelper,T as IhoTableUtils,h as IhoTableWarn,N as createIhoTableClearActivedInterceptor,R as eventListener2EventName,S as eventName2EventListener,O as getColumnRenderWidth,C as getRowHeight,y as isCompatibleColumn,$ as isRichContent,V as isTransformTreeType,U as parseMergeField,x as parseRichContent,F as useIhoTableFormEvent,w as useUUIDMap};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"./InfoHeader.vue2.js";import r from"../../../_virtual/_plugin-vue_export-helper.js";var o=r(e,[["__file","InfoHeader.vue"]]);export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,provide as t,ref as n,computed as o,openBlock as i,createElementBlock as a,normalizeClass as s,normalizeStyle as r,unref as c,createElementVNode as p,createCommentVNode as f,renderSlot as l,createVNode as d,withCtx as u,mergeProps as m,Fragment as h,renderList as g,createBlock as v,resolveDynamicComponent as y,h as b,nextTick as I}from"vue";import{isString as _}from"lodash-es";import $ from"./components/infoDescription/index.vue.js";import x from"./components/patientInfo/index.vue.js";import{InjectionInfoHeaderEmit as S,InjectionInfoHeaderFormRef as j}from"./constants/index.js";const z={class:"c-info-header__operation"},w={key:0,class:"c-info-header__divider"},k={class:"c-info-header__setting"},C=["onClick"];var H=e({__name:"InfoHeader",props:{compact:{type:Boolean,required:!0},patientInfo:{type:Object,default:()=>({})},patientEditable:{type:Boolean},separator:{type:String,default:":"},infoList:{type:Array,default:()=>[]},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},minColumnWidth:{type:[String,Number],default:180},rowHeight:{type:[String,Number],default:38},settingIcons:{type:Array,default:()=>["patientInfo","fieldSet","compact"]},formProps:{type:Object}},emits:["openPatientInfo","fieldSet","update:compact","formChange"],setup(e,{expose:H,emit:P}){const A=e;t(S,P);const B=n();function D(){var e;return null==(e=B.value)?void 0:e.updateColumn()}const E=o((()=>({"--row-height":A.rowHeight,"--row-num":A.compact?1:2,"--padding-tb":A.compact?9:4}))),F={patientInfo:{event:function(){P("openPatientInfo")},render:()=>[b("i",{class:"info-header--iconfont info-header--icon-a-menzhenyishengzhanxitongtubiaobianji"})]},fieldSet:{event:function(){P("fieldSet")},render:()=>[b("i",{class:"info-header--iconfont info-header--icon-a-menzhenyishengzhanxitongtubiaoshezhi"})]},compact:{event:async function(){P("update:compact",!A.compact),await I(),await D()},render:()=>[b("i",{class:"info-header--iconfont info-header--icon-a-menzhenyishengzhanxitongtubiaojiantouxia"})]}},N=o((()=>A.settingIcons.map((e=>(_(e)?F[e]:e)||{})))),O=n();return t(j,O),H({update:D,$formRender:O}),(t,n)=>(i(),a("div",{class:s(["c-info-header",{"is-compact":e.compact}]),style:r(c(E))},[p("section",z,[f(" 操作区插槽 "),l(t.$slots,"operation")]),t.$slots.operation?(i(),a("div",w)):f("v-if",!0),f(" 患者信息区插槽,需要自己实现整个患者信息区时使用 "),l(t.$slots,"patientModule",{},(()=>[d(c(x),{"patient-info":e.patientInfo,"patient-editable":e.patientEditable},{avatarInfo:u((()=>[f(" 头像区补充内容插槽 (会插入头像下方) "),l(t.$slots,"avatarInfo")])),avatar:u((()=>[f(" 头像插槽 "),l(t.$slots,"avatar")])),tags:u((()=>[f(" 标签插槽 "),l(t.$slots,"tags")])),_:3},8,["patient-info","patient-editable"])])),d(c($),m({ref_key:"infoDescriptionRef",ref:B,"root-slot":t.$slots},t.$props),{info:u((()=>[f(" 信息描述区插槽 "),l(t.$slots,"info")])),_:3},16,["root-slot"]),p("section",k,[f(" 设置区插槽 "),l(t.$slots,"setting",{},(()=>[(i(!0),a(h,null,g(c(N),(e=>(i(),a("div",{key:e,class:"c-info-header__settingIcon",onClick:e.event},[(i(),v(y(e.render)))],8,C)))),128))]))])],6))}});export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"./DescriptionItem.vue2.js";import r from"../../../../../_virtual/_plugin-vue_export-helper.js";var t=r(e,[["__file","DescriptionItem.vue"]]);export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,inject as t,computed as o,watch as n,openBlock as l,createElementBlock as i,createBlock as r,unref as m,normalizeStyle as s,Fragment as d,withDirectives as f,createElementVNode as a,vShow as c,createCommentVNode as u}from"vue";import{isField as p}from"@formily/core";import{useForm as v}from"@formily/vue";import{isFunction as y}from"lodash-es";import{pauseTracking as I,enableTracking as h}from"@vue/reactivity";import"../../../../form-render/index.js";import{InjectionSchemaField as F,InjectionBusinessCollector as w}from"../../../../form-render/src/constants/index.js";import{InjectionInfoHeaderFormRef as b}from"../../constants/index.js";import k from"./HiddenContent.vue.js";import P from"./InfoEllipsis.vue.js";import x from"../../../../../shared/components/SlotRender/SlotRender.js";import{useFieldListAdaptor as j}from"../../../../form-render/src/hooks/useFieldListAdaptor.js";import{createObjSchema as g}from"../../../../form-render/src/utils/schema.js";const S={key:0};var W=e({__name:"DescriptionItem",props:{infoItem:{default:()=>({})},labelField:{default:"label"},valueField:{default:"value"},width:null,rootSlot:null},setup(e){const W=e,_=t(F,{render:()=>null}),B=t(b);async function E(e){var t,o,n;if(!e.formField||e.edit)return;e.edit=!0;const l=await(null==(t=B.value)?void 0:t.queryWidget(e[W.labelField]));l&&(null==(o=l.widgetElement)||o.focus(),null==(n=l.widgetElement)||n.click())}const q=t(w,void 0),{schemaAdaptor:A}=j(q),C=v(),D=o((()=>{var e,t,o;const n=W.infoItem.formField;if(!n)return{};const l=W.infoItem[W.labelField],i={...n,html_type:null!=(e=n.html_type)?e:"INPUT",val_key:l,decoratorProps:{showLabel:!1,...n.decoratorProps,style:{marginBottom:"-12px"}},componentProps:{size:"tiny",clearable:!0,...n.componentProps,style:{fontWeight:(null==(t=W.infoItem)?void 0:t.bold)?700:500,...null==(o=n.componentProps)?void 0:o.style},async onBlur(e){var t;if(C&&C.value)try{const o=C.value.query(l).take();await(o&&p(o)&&o.validate()),W.infoItem.edit=!1,y(null==(t=n.componentProps)?void 0:t.onBlur)&&n.componentProps.onBlur(e)}catch(e){}}}};I(),i.default_val=W.infoItem[W.valueField],h();const r=A([i]);return g(r)}));n((()=>W.width),(e=>{var t;e&&W.infoItem.formField&&(null==(t=B.value)||t.setFieldState(W.infoItem[W.labelField],(t=>{t.componentProps&&(t.componentProps.style={...t.componentProps.style,maxWidth:e+"px"})})))}));const L=o((()=>({fontWeight:W.infoItem.bold?700:500,...W.infoItem.contentStyle}))),R=o((()=>{const{bold:e,contentStyle:t}=W.infoItem,o=W.width+"px";return{width:o,maxWidth:o,fontWeight:e?700:500,...t}})),z=o((()=>["电话","身份证"].some((e=>{var t,o;return null==(o=null==(t=W.infoItem[W.labelField])?void 0:t.includes)?void 0:o.call(t,e)}))));return(t,o)=>(l(),i("section",{onDblclick:o[0]||(o[0]=t=>E(e.infoItem)),onClick:o[1]||(o[1]=t=>async function(e){e.formField&&!e[W.valueField]&&0!==e[W.valueField]&&E(e)}(e.infoItem))},[e.infoItem.slot?(l(),r(m(x),{key:0,renderer:e.infoItem.slot,"root-slots":e.rootSlot,item:e.infoItem,style:s(m(L)),width:e.width},null,8,["renderer","root-slots","item","style","width"])):(l(),i(d,{key:1},[f(a("section",null,[m(z)?(l(),r(k,{key:0,content:e.infoItem[e.valueField],tip:e.infoItem.tip,"content-style":m(L),width:e.width},null,8,["content","tip","content-style","width"])):(l(),r(P,{key:1,"content-style":m(R),content:e.infoItem[e.valueField],tip:e.infoItem.tip},null,8,["content-style","content","tip"]))],512),[[c,!e.infoItem.edit||!e.infoItem.formField]]),e.infoItem.formField?f((l(),i("section",S,[(l(),r(m(_),{schema:m(D),key:e.infoItem[e.labelField]},null,8,["schema"]))],512)),[[c,e.infoItem.edit]]):u("v-if",!0)],64))],32))}});export{W as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"./DescriptionList.vue2.js";import i from"../../../../../_virtual/_plugin-vue_export-helper.js";var r=i(e,[["__file","DescriptionList.vue"]]);export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as l,openBlock as e,createBlock as t,unref as i,withCtx as o,createElementBlock as a,Fragment as n,renderList as u}from"vue";import{NDescriptions as d,NDescriptionsItem as r}from"naive-ui";import f from"./DescriptionItem.vue.js";var s=l({__name:"DescriptionList",props:{infoList:{default:()=>[]},labelField:{default:"label"},valueField:{default:"value"},rootSlot:null,descriptionWidthList:{default:()=>[]},columnNum:{default:3},inForm:{type:Boolean}},setup(l){const s={height:"100%",display:"inline-flex","align-items":"center"};return(m,p)=>(e(),t(i(d),{"label-align":"right","label-placement":"left",separator:":",column:l.columnNum,"label-style":s,"content-style":s},{default:o((()=>[(e(!0),a(n,null,u(l.infoList,((a,n)=>(e(),t(i(r),{key:a[l.labelField],label:a[l.labelField]},{default:o((()=>[(e(),t(f,{key:a[l.labelField],"info-item":a,width:l.descriptionWidthList[n],"root-slot":l.rootSlot,"label-field":l.labelField,"value-field":l.valueField},null,8,["info-item","width","root-slot","label-field","value-field"]))])),_:2},1032,["label"])))),128))])),_:1},8,["column"]))}});export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"./HiddenContent.vue2.js";import t from"../../../../../_virtual/_plugin-vue_export-helper.js";var r=t(e,[["__file","HiddenContent.vue"]]);export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as t,ref as n,computed as e,openBlock as i,createElementBlock as o,normalizeStyle as r,unref as l,createElementVNode as a,createVNode as c,normalizeClass as s}from"vue";import u from"./InfoEllipsis.vue.js";const d={class:"c-info-header__hidden--content"};var f=t({__name:"HiddenContent",props:{content:{type:String,default:""},tip:String,width:{type:Number},contentStyle:{type:Object,default:()=>({})}},setup(t){const f=t,h=n(!0);function p(){h.value=!h.value}const v=e((()=>{const t=f.width+"px";return{maxWidth:t,width:t}})),y=e((()=>{if(!f.width)return{};const t=f.width-40+"px";return Object.assign({},f.contentStyle,{maxWidth:t})})),g=e((()=>{let{content:t}=f;if(!h.value)return t;if(null==t)return"-";t+="";const n=t.length;if(!n||1===n)return t;const e=Math.floor(n/2),i=Math.floor((n-e)/2);return`${t.substring(0,i)}${"*".repeat(e)}${null==t?void 0:t.substring(i+e)}`}));return(n,e)=>(i(),o("div",{class:"c-info-header__hidden",style:r(l(v))},[a("div",d,[c(u,{"content-style":l(y),content:l(g),tip:t.tip},null,8,["content-style","content","tip"])]),a("i",{onClick:p,class:s(["c-info-header__hidden--icon","info-header--iconfont","info-header--icon-"+(h.value?"guanbi-yanjing":"faxian-yanjing")])},null,2)],4))}});export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"./InfoEllipsis.vue2.js";import i from"../../../../../_virtual/_plugin-vue_export-helper.js";var l=i(e,[["__file","InfoEllipsis.vue"]]);export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as t,openBlock as e,createBlock as o,unref as i,withCtx as l,createElementVNode as p,createVNode as n,normalizeStyle as a,createTextVNode as r,toDisplayString as s}from"vue";import{NTooltip as d,NEllipsis as u}from"naive-ui";var f=t({__name:"InfoEllipsis",props:{content:{type:String,default:""},tip:{type:String},contentStyle:{type:Object,default:()=>({})}},setup:t=>(f,c)=>(e(),o(i(d),{disabled:!t.tip},{trigger:l((()=>[p("section",null,[n(i(u),{style:a(t.contentStyle),tooltip:{placement:t.tip?"bottom":"top"}},{default:l((()=>[r(s(t.content||"-"),1)])),_:1},8,["style","tooltip"])])])),default:l((()=>[r(" "+s(t.tip),1)])),_:1},8,["disabled"]))});export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
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 e,inject as i,computed as o,ref as l,nextTick as n,onMounted as t,watch as r,onBeforeUnmount as a,onDeactivated as s,onActivated as u,openBlock as f,createElementBlock as d,normalizeStyle as m,createVNode as c,unref as p,withCtx as v,createCommentVNode as h,renderSlot as _,createElementVNode as y,createBlock as w,mergeProps as F}from"vue";import{useThrottleFn as L,useEventListener as b}from"@vueuse/core";import{isArray as C}from"lodash-es";import{NScrollbar as W,NConfigProvider as k}from"naive-ui";import x from"./DescriptionList.vue.js";import{InjectionInfoHeaderEmit as j,InjectionInfoHeaderFormRef as R}from"../../constants/index.js";import{useThemeOverrides as g}from"../../hooks/useThemeOverrides.js";import $ from"../../../../form-render/index.js";var A=e({__name:"index",props:{infoList:{default:()=>[]},labelField:{default:"label"},valueField:{default:"value"},minColumnWidth:{default:180},rootSlot:null,formProps:{default:()=>({})}},setup(e,{expose:A}){const I=e,{themeOverrides:M}=g(),O=i(j),P=o((()=>C(I.infoList)&&I.infoList.some((e=>e.formField)))),S=o((()=>C(I.infoList)?I.infoList.reduce(((e,i)=>(i.formField&&(e[i[I.labelField]]=i[I.valueField]),e)),{}):{}));function q(e){var i;const{fieldKey:o,value:l}=e,n=null==(i=I.infoList)?void 0:i.find((e=>e[I.labelField]===o));n&&(n[I.valueField]=l,O&&O("formChange",e))}const z=i(R),D=l(3),K=l(),T=l(0),B=l([]),E=L((async function(){await n();const e=K.value;if(!e)return;const{clientWidth:i}=e;D.value=Math.floor(i/+I.minColumnWidth),T.value=Math.floor(i/D.value),await n();const o=e.querySelectorAll(".n-descriptions-table-content__label");o&&(B.value=Array.from(o).map((e=>T.value-e.clientWidth-8)))}),200,!0,!1);let G;function H(){clearInterval(G)}function J(){H(),G=setInterval(E,700)}return t(E),r([()=>I.minColumnWidth,()=>I.infoList],E,{flush:"post",deep:!0}),b(window,"resize",E),a(H),s(H),u(J),t(J),A({updateColumn:E}),(i,o)=>(f(),d("section",{class:"c-info-header__info",ref_key:"infoRef",ref:K,style:m({"--column-width":T.value})},[c(p(W),{class:"c-info-header__infoWrapper"},{default:v((()=>[h(" 描述信息区插槽 "),_(i.$slots,"info",{},(()=>[y("section",null,[p(P)?(f(),w(p($),F({key:1},e.formProps,{onFormChange:q,"initial-data":p(S),ref_key:"formRenderRef",ref:z,class:"c-info-header__formRender"}),{default:v((()=>[c(p(k),{"theme-overrides":p(M),style:m({"grid-column":"span min(var(--column), 999) / span min(var(--column), 999)"})},{default:v((()=>[c(x,F(i.$props,{"description-width-list":B.value,"column-num":D.value,"in-form":""}),null,16,["description-width-list","column-num"])])),_:1},8,["theme-overrides","style"])])),_:1},16,["initial-data"])):(f(),w(x,F({key:0},i.$props,{"description-width-list":B.value,"column-num":D.value}),null,16,["description-width-list","column-num"]))])]))])),_:3})],4))}});export{A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
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 e,computed as t,ref as a,watch as n,nextTick as i,openBlock as l,createElementBlock as o,renderSlot as r,createVNode as s,unref as p,withCtx as f,mergeProps as d,createElementVNode as u,normalizeClass as c,createBlock as v,resolveDynamicComponent as m,createCommentVNode as _,createTextVNode as g,Fragment as x,renderList as y,toDisplayString as I,h}from"vue";import{isArray as w,isString as b,isNumber as k,isFunction as P,isObject as E,pick as U}from"lodash-es";import{NPopover as C,NImage as L,NDivider as H,NSpace as z,NButton as T,NTag as j,NEllipsis as F}from"naive-ui";import N from"../../../../form-render/index.js";const R={class:"c-info-header__patient"},$={class:"c-info-header__patientHeader"},B={key:0,class:"c-info-header__patientHeader--name"},S={key:1,class:"c-info-header__patientHeader--sex"},V={key:2,class:"c-info-header__patientHeader--age"};var D=e({__name:"index",props:{patientInfo:{default:()=>({})},patientEditable:{type:Boolean}},setup(e){const D=e,M=t((()=>D.patientInfo&&w(D.patientInfo.tagList)?D.patientInfo.tagList.filter((e=>e.render||b(e.content)&&e.content)):[])),O={warning:"#fcc200",info:"rgba(45, 122, 255, 0.1)"},W={warning:"#fff",info:"#2563F4"};function q({type:e="warning"}){return{color:O[e],textColor:W[e]}}function A(e){return()=>b(e)||k(e)?e:P(e)?e():E(e)?h(e):null}const G=a(!1),J=t((()=>D.patientEditable?[{val_key:"name",is_null:"0",is_empty:"0",alias:"姓名",html_type:"INPUT",...D.patientInfo.nameProps},{val_key:"sex",alias:"性别",html_type:"SELECT",is_null:"0",option:[{text:"未知",value:"未知"},{text:"男",value:"男"},{text:"女",value:"女"}],...D.patientInfo.sexProps},{val_key:"age",alias:"年龄",html_type:"INPUT_NUMBER",is_null:"0",is_empty:"0",decoratorProps:{style:{flex:2}},...D.patientInfo.ageProps,suffixConfig:{alias:"年龄单位",is_null:"0",val_key:"ageUnit",html_type:"SELECT",decoratorProps:{style:{flex:1}},option:[{value:"天",text:"天"},{value:"月",text:"月"},{value:"岁",text:"岁"},{value:"小时",text:"小时"},{value:"分",text:"分"},{value:"周",text:"周"}],...D.patientInfo.ageUnitProps}}]:[])),K=a();async function Q(){K.value&&(await K.value.validate(),Object.assign(D.patientInfo,U(K.value.getFormValues(),["name","sex","age","ageUnit"])),G.value=!1)}return n(G,(async e=>{await i(),e&&K.value&&K.value.setFormValues(D.patientInfo||{})})),(t,a)=>(l(),o("section",R,[r(t.$slots,"avatar",{},(()=>[s(p(C),null,{trigger:f((()=>[s(p(L),d({style:{"border-radius":"50%"},width:40,height:40,"preview-disabled":"",src:e.patientInfo.avatar},e.patientInfo.avatarProps),null,16,["src"])])),default:f((()=>[s(p(L),d({width:200,"preview-disabled":"",src:e.patientInfo.avatarPreview||e.patientInfo.avatar},e.patientInfo.avatarPreviewProps),null,16,["src"])])),_:1})])),u("section",null,[u("header",$,[s(p(C),{disabled:!e.patientEditable,trigger:"manual",placement:"bottom",show:G.value},{trigger:f((()=>{var t;return[u("section",{class:c(["c-info-header__patientHeaderWrapper",{"in-edit":G.value}]),onDblclick:a[0]||(a[0]=t=>e.patientEditable&&(G.value=!0))},[e.patientInfo.name?(l(),o("div",B,[(l(),v(m(A(e.patientInfo.name))))])):_("v-if",!0),e.patientInfo.sex?(l(),o("div",S,[g(" / "),(l(),v(m(A(e.patientInfo.sex))))])):_("v-if",!0),null!=e.patientInfo.age?(l(),o("div",V,[g(" / "),(l(),v(m(A(e.patientInfo.age)))),(l(),v(m(A(null!=(t=e.patientInfo.ageUnit)?t:"岁"))))])):_("v-if",!0)],34)]})),default:f((()=>[s(p(N),{column:"6",size:"small","label-placement":"left",style:{width:"200px",margin:"4px 0 -8px 0"},"field-list":p(J),ref_key:"formRenderRef",ref:K},null,8,["field-list"]),s(p(H),{style:{margin:"8px -14px",width:"calc(100% + 28px)"}}),s(p(z),{justify:"end"},{default:f((()=>[s(p(T),{size:"small",onClick:a[1]||(a[1]=e=>G.value=!1)},{default:f((()=>[g("取消")])),_:1}),s(p(T),{size:"small",type:"info",onClick:Q},{default:f((()=>[g("确认")])),_:1})])),_:1})])),_:1},8,["disabled","show"]),r(t.$slots,"tags",{tagList:p(M)},(()=>[(l(!0),o(x,null,y(e.patientInfo.tagList||[],(e=>(l(),v(p(j),d({key:e.content,size:"medium",bordered:!1,color:q(e)},e),{default:f((()=>[e.render?(l(),v(m(e.render),{key:0})):(l(),v(p(F),{key:1,style:{"max-width":"96px"}},{default:f((()=>[g(I(e.content),1)])),_:2},1024))])),_:2},1040,["color"])))),128))]))]),r(t.$slots,"avatarInfo")])]))}});export{D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"./Keyboard.vue2.js";import r from"../../../_virtual/_plugin-vue_export-helper.js";var o=r(e,[["__file","Keyboard.vue"]]);export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,ref as l,provide as t,computed as o,unref as n,openBlock as a,createBlock as u,normalizeStyle as i,withCtx as s,createVNode as r,mergeProps as d,createElementBlock as c,normalizeClass as f,createElementVNode as p,Fragment as m,renderList as v,createCommentVNode as y,createTextVNode as g,toDisplayString as h}from"vue";import{NPopover as k,NInputNumber as w,NSpace as V,NIcon as b}from"naive-ui";import{Close as x,GitCompareOutline as O,ArrowUndoSharp as S}from"@vicons/ionicons5";import C from"./components/NumberPanel.vue.js";import{useDraggable as _}from"@vueuse/core";import{useTheme as j}from"../../../shared/hooks/useTheme.js";import"date-fns";import"lodash-es";import{defaultCssVars as I}from"./constants/index.js";const D=p("span",null,"键盘",-1),N={class:"keys"},K=["onClick"];var R=e({__name:"Keyboard",props:{mode:{type:String,default:"english"},drag:{type:Boolean,default:!1},positionInitialValue:{type:Object,default:()=>({x:0,y:0})},defaultValue:{type:Number},value:{type:Number},panel:{type:Boolean,default:!0},moveOffset:{type:Object,default:()=>({x:0,y:0})}},emits:["change","keydown"],setup(e,{expose:R,emit:U}){const B=e,E="QWERTYUIOPASDFGHJKLZXCVBNM.",F=["Switch"," ","Undo","Enter"],J=E.split("").concat(F),M=E.split(".")[0].split("").sort().concat(["."],F),P=j(I,"Keyboard");let Q=l(Date.now());t("toSelectInputContent",Q);const T=o((()=>"english"===B.mode)),$=o((()=>({mode:B.mode,defaultValue:B.defaultValue,value:B.value,positionInitialValue:B.positionInitialValue,moveOffset:B.moveOffset,drag:B.drag,onChange:q}))),A=o((()=>`${JSON.stringify(P.value).replace(/\{|\}|\"/g,"").replace(/,/g,";")};${(null==Y?void 0:Y.value)||""}`)),G=l(J.slice()),H=l(null),L=l(null),W=l(null),X=l(),Y=function(){B.defaultValue&&(X.value=B.defaultValue);if(T.value&&B.drag){const{x:e,y:l,style:t}=_(L,{initialValue:B.positionInitialValue,preventDefault:!0,handle:W,onMove:(e,l)=>{var t,o,n,a;e.x+=null!=(o=null==(t=B.moveOffset)?void 0:t.x)?o:0,e.y+=null!=(a=null==(n=B.moveOffset)?void 0:n.y)?a:0}});return t}}();function Z(e){"Switch"!==e?U("keydown",e):G.value="Q"===G.value[0]?M.slice():J.slice()}function q(e){var l,t;null==(t=null==(l=H.value)?void 0:l.setShow)||t.call(l,!1),X.value=e,U("change",e)}return R({select:function(){Q.value=Date.now()}}),(l,t)=>n(T)||e.panel?!n(T)&&e.panel?(a(),u(C,d({key:1},n($),{style:n(P)}),null,16,["style"])):(a(),c("div",{key:2,class:f(["c-keyboard-english",{isFixed:e.drag}]),ref_key:"englishKeyboardRef",ref:L,style:i(n(A))},[r(n(V),{"wrap-item":!1,align:"center",justify:"space-between",ref_key:"keyboardDragRef",ref:W,style:i({cursor:e.drag?"move":"default"})},{default:s((()=>[D,r(n(b),{onClick:t[1]||(t[1]=e=>Z("close")),component:n(x)},null,8,["component"])])),_:1},8,["style"]),p("div",N,[(a(!0),c(m,null,v(G.value,((e,l)=>(a(),c("span",{key:e,class:f(["key"+l]),onClick:l=>Z(e)},["Switch"===e?(a(),u(n(b),{key:0,component:n(O)},null,8,["component"])):y("v-if",!0),"Undo"===e?(a(),u(n(b),{key:1,component:n(S)},null,8,["component"])):y("v-if",!0),g(" "+h(F.includes(e)&&"Enter"!==e?""===e?"空格":"":e),1)],10,K)))),128))])],6)):(a(),u(n(k),{key:0,ref_key:"popoverRef",ref:H,trigger:"click","show-arrow":!1,placement:"bottom-start",style:i([{padding:"0"},n(P)]),"display-directive":"show"},{trigger:s((()=>[r(n(w),{value:X.value,"onUpdate:value":t[0]||(t[0]=e=>X.value=e),"show-button":!1},null,8,["value"])])),default:s((()=>[r(C,{mode:e.mode,defaultValue:e.defaultValue,onChange:q},null,8,["mode","defaultValue"])])),_:1},8,["style"]))}});export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"./InputNumber.vue2.js";import r from"../../../../_virtual/_plugin-vue_export-helper.js";var u=r(e,[["__file","InputNumber.vue"]]);export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,ref as t,inject as u,watch as l,openBlock as n,createBlock as o,unref as a,withCtx as s,createVNode as i}from"vue";import{NInput as r,NSpace as c,NIcon as p}from"naive-ui";import{CaretUp as d,CaretDown as m}from"@vicons/ionicons5";import{getNumber as f}from"../utils/index.js";var v=e({__name:"InputNumber",props:{modelValue:{type:String,default:""},integer:{type:Boolean,default:!1},status:{type:String,default:"success"}},emits:["update:modelValue","update:status"],setup(e,{expose:v,emit:g}){const y=e,V=t(null),_=u("toSelectInputContent");function x(e){const t="string"==typeof e?e:e.join("");g("update:modelValue",t),g("update:status",t?"success":"error")}function S(e){return y.integer?/(^[1-9]\d*$)/.test(e)||!e:/^\d*\.?\d*$/.test(e)||!e}function b(e){const t=f(y.modelValue);let u="+"===e?t+1:t-1;(u<=0||isNaN(u))&&(u=1),g("update:modelValue",u.toString()),g("update:status","success")}return l((()=>_.value),(e=>{var t,u;!y.integer&&(null==(u=null==(t=V.value)?void 0:t.select)||u.call(t))})),v({$childrenRefs:V}),(t,u)=>(n(),o(a(r),{ref_key:"inputRef",ref:V,value:e.modelValue,"onUpdate:value":x,"allow-input":S,placeholder:"",status:e.status,clearable:!e.integer},{suffix:s((()=>[i(a(c),{justify:"center",vertical:""},{default:s((()=>[i(a(p),{size:"13",component:a(d),onClick:u[0]||(u[0]=e=>b("+"))},null,8,["component"]),i(a(p),{size:"13",component:a(m),onClick:u[1]||(u[1]=e=>b("-"))},null,8,["component"])])),_:1})])),_:1},8,["value","status","clearable"]))}});export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"./NumberPanel.vue2.js";import r from"../../../../_virtual/_plugin-vue_export-helper.js";var u=r(e,[["__file","NumberPanel.vue"]]);export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent,computed,ref,watch,openBlock,createElementBlock,normalizeClass,normalizeStyle,unref,createElementVNode,createVNode,withCtx,Fragment,renderList,toDisplayString,createBlock,createCommentVNode,nextTick}from"vue";import{NSpace,NIcon}from"naive-ui";import{ArrowUndoSharp}from"@vicons/ionicons5";import InputNumber from"./InputNumber.vue.js";import{useDraggable}from"@vueuse/core";import{getNumber}from"../utils/index.js";const _hoisted_1={class:"keys"},_hoisted_2=["onClick"],_hoisted_3=["onClick"],_hoisted_4={class:"btns"},_hoisted_5=["onClick"],_hoisted_6={class:"inputs"},_hoisted_7={class:"inputs-right"},_hoisted_8=createElementVNode("hr",null,null,-1);var _sfc_main=defineComponent({__name:"NumberPanel",props:{defaultValue:{type:Number},value:{type:Number},mode:{type:String},positionInitialValue:{type:Object,default:()=>({x:0,y:0})},moveOffset:{type:Object,default:()=>({x:0,y:0})},drag:{type:Boolean,default:!1}},emits:["change"],setup(__props,{emit:emit}){const props=__props,NUMBERKEYS="1234567890.",DAYS=[3,7,14,30],DOSENUMBERKEYS="123/456*789-0.+",CALCULATIONSYMBOLS=["+","-","*","/"],isNumber=computed((()=>"number"===props.mode)),isDay=computed((()=>"day"===props.mode&&!isNumber.value)),isDose=computed((()=>"dose"===props.mode&&!isNumber.value)),numberKeys=computed((()=>(isDose.value?DOSENUMBERKEYS:NUMBERKEYS).split(""))),days=ref(DAYS),doses=ref([2,3,4,5,6,7,8]),inputValue=ref(""),integerValue=ref(),numeratorValue=ref(),denominatorValue=ref(),inputValueStatus=ref("success"),numeratorValueStatus=ref("success"),denominatorValueStatus=ref("success"),keyboardRef=ref(null),inputRef=ref(null),style=init();function init(){if(props.defaultValue&&(inputValue.value=props.defaultValue.toString()),props.drag){const{x:e,y:t,style:a}=useDraggable(keyboardRef,{initialValue:props.positionInitialValue,onMove:(e,t)=>{var a,u,n,l;e.x+=null!=(u=null==(a=props.moveOffset)?void 0:a.x)?u:0,e.y+=null!=(l=null==(n=props.moveOffset)?void 0:n.y)?l:0}});return a}}async function setFocus(){var e,t,a;const u=null==(a=null==(t=null==(e=inputRef.value)?void 0:e.$childrenRefs)?void 0:t.$refs)?void 0:a.inputElRef;await nextTick(),u.focus()}function keydown(key){switch(key){case"Undo":updateValue(key);break;case"Enter":if(!validator())return void(inputValueStatus.value="error");emit("change",eval(inputValue.value)),setFocus();break;default:"number"==typeof key?(inputValue.value=key.toString(),setInputValueStatus(),setFocus()):updateValue(key)}}function onKeydown(e){["Enter"].includes(e.key)&&keydown("Enter")}async function updateValue(e){var t,a,u;const n=null==(u=null==(a=null==(t=inputRef.value)?void 0:t.$childrenRefs)?void 0:a.$refs)?void 0:u.inputElRef,{selectionStart:l,selectionEnd:o}=n,r=inputValue.value.split("");if("Undo"===e){const e=l===o?1:o-l,t=l===o?l-1:l;inputValue.value&&t>-1&&r.splice(t,e)}else r.splice(l,o-l,e);inputValue.value=r.join(""),await nextTick(),n.focus();const s="Undo"===e?l?o>l?l:l-1:0:l+1;n.setSelectionRange(s,s),setInputValueStatus()}function validator(){if(!inputValue.value)return!1;if(CALCULATIONSYMBOLS.slice(2).includes(inputValue.value[0]))return!1;if(CALCULATIONSYMBOLS.includes(inputValue.value[inputValue.value.length-1]))return!1;const e=[];let t=[];const a=inputValue.value.split("");a.forEach(((u,n)=>{CALCULATIONSYMBOLS.includes(u)?(e.push(t.join("")),t=[]):(t.push(u),n===a.length-1&&e.push(t.join("")))}));return!!e.every(((e,t)=>0===t&&!e||/^\d*(.\d+)?$/.test(e)))}function updateFraction(e){setInputStatus(inputValue,inputValueStatus)&&(inputValue.value=(Math.round(+inputValue.value*(1/e)*100)/100).toString(),setInputValueStatus())}function calculateFraction(){if(!setInputStatus(inputValue,inputValueStatus)||!setInputStatus(numeratorValue,numeratorValueStatus,!0)||!setInputStatus(denominatorValue,denominatorValueStatus,!0))return;const e=getNumber(integerValue.value)+getNumber(numeratorValue.value)/getNumber(denominatorValue.value);inputValue.value=(Math.round(+inputValue.value*e*100)/100).toString(),setInputValueStatus()}function setInputStatus(e,t,a){if((a||e.value&&"."!==e.value)&&(!a||e.value))return!0;t.value="error"}function setInputValueStatus(){inputValueStatus.value=inputValue.value?"success":"error"}return watch((()=>props.value),(e=>inputValue.value=(e||"").toString()),{immediate:!0}),(e,t)=>(openBlock(),createElementBlock("div",{class:normalizeClass(["c-keyboard",{isFixed:__props.drag}]),ref_key:"keyboardRef",ref:keyboardRef,style:normalizeStyle(unref(style)),onKeydown:onKeydown},[createElementVNode("div",{class:normalizeClass(["left",{isDose:unref(isDose)}])},[createVNode(InputNumber,{ref_key:"inputRef",ref:inputRef,modelValue:inputValue.value,"onUpdate:modelValue":t[0]||(t[0]=e=>inputValue.value=e),status:inputValueStatus.value,"onUpdate:status":t[1]||(t[1]=e=>inputValueStatus.value=e)},null,8,["modelValue","status"]),createElementVNode("div",_hoisted_1,[createVNode(unref(NSpace),{class:"margin-offset","wrap-item":!1},{default:withCtx((()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(numberKeys),(e=>(openBlock(),createElementBlock("span",{key:e,class:normalizeClass("0"===e?"is-0":""),onClick:t=>keydown(e)},toDisplayString(e),11,_hoisted_2)))),128))])),_:1}),createVNode(unref(NSpace),{class:"margin-offset","wrap-item":!1},{default:withCtx((()=>[createElementVNode("span",{class:"opt",onClick:t[2]||(t[2]=e=>keydown("Undo"))},[createVNode(unref(NIcon),{component:unref(ArrowUndoSharp)},null,8,["component"])]),createElementVNode("span",{class:"opt",onClick:t[3]||(t[3]=e=>keydown("Enter"))},"确定")])),_:1})])],2),unref(isDay)?(openBlock(),createBlock(unref(NSpace),{key:0,class:"right-days","wrap-item":!1,justify:"center",vertical:""},{default:withCtx((()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(days.value,(e=>(openBlock(),createElementBlock("span",{class:"btn",key:e,onClick:t=>keydown(e)},toDisplayString(e)+"天",9,_hoisted_3)))),128))])),_:1})):createCommentVNode("v-if",!0),unref(isDose)?(openBlock(),createBlock(unref(NSpace),{key:1,class:"right-dose","wrap-item":!1},{default:withCtx((()=>[createElementVNode("div",_hoisted_4,[(openBlock(!0),createElementBlock(Fragment,null,renderList(doses.value,(e=>(openBlock(),createElementBlock("span",{class:"btn",key:e,onClick:t=>updateFraction(e)},"1/"+toDisplayString(e),9,_hoisted_5)))),128))]),createVNode(unref(NSpace),{justify:"center",vertical:"","wrap-item":!1},{default:withCtx((()=>[createElementVNode("div",_hoisted_6,[createVNode(InputNumber,{integer:"",modelValue:integerValue.value,"onUpdate:modelValue":t[4]||(t[4]=e=>integerValue.value=e)},null,8,["modelValue"]),createElementVNode("div",_hoisted_7,[createVNode(InputNumber,{integer:"",modelValue:numeratorValue.value,"onUpdate:modelValue":t[5]||(t[5]=e=>numeratorValue.value=e),status:numeratorValueStatus.value,"onUpdate:status":t[6]||(t[6]=e=>numeratorValueStatus.value=e)},null,8,["modelValue","status"]),_hoisted_8,createVNode(InputNumber,{integer:"",modelValue:denominatorValue.value,"onUpdate:modelValue":t[7]||(t[7]=e=>denominatorValue.value=e),status:denominatorValueStatus.value,"onUpdate:status":t[8]||(t[8]=e=>denominatorValueStatus.value=e)},null,8,["modelValue","status"])])]),createElementVNode("span",{class:"btn",onClick:calculateFraction},"分子式剂量")])),_:1})])),_:1})):createCommentVNode("v-if",!0)],38))}});export{_sfc_main as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"./Map.vue2.js";import r from"../../../_virtual/_plugin-vue_export-helper.js";var p=r(e,[["__file","Map.vue"]]);export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,reactive as a,computed as t,onMounted as n,openBlock as s,createElementBlock as o,createElementVNode as r,createVNode as l,unref as i,withCtx as c,createTextVNode as d,toDisplayString as p,Fragment as m,renderList as u,createCommentVNode as g}from"vue";import{useMessage as v,NInput as q,NButton as L}from"naive-ui";const h={class:"c-map"},y={class:"search-container"},f={class:"map-input-search"},k={class:"input-addon"},w=r("div",{id:"map-core"},null,-1),_={key:0,class:"address-list"},S=["onClick"],P={class:"title"};var C=e({__name:"Map",props:{locationProp:{type:String,default:""},ak:{type:String,default:"KP3BZ-OAC3W-PY6RY-OJ6DV-JYKN3-H6F72"}},emits:["selectLocation"],setup(e,{emit:C}){const O=e,T=a({qq:null,searchKey:"",centrePoint:{},location:{lng:"",lat:""},localObj:{},map:null,ac:null,addressList:[],markers:[],timeout:null,searchService:null,geocoder:{}}),M=t((()=>{var e,a;return null==(a=null==(e=T.addressList)?void 0:e[0])?void 0:a.name})),I=t((()=>O.locationProp&&JSON.parse(O.locationProp)||null)),B=v(),E=e=>{if(e&&"geolocation"==e.module){T.location.lng=e.lng,T.location.lat=e.lat;const a=new T.qq.maps.LatLng(e.lat,e.lng);x({latLng:a}),K({lat:e.lat,lng:e.lng})}else console.log("用户不允许获取地理位置"),T.location.lng=113.275,T.location.lat=23.117},K=e=>{const a=T.qq;var t=new a.maps.LatLng(e.lat,e.lng);T.centrePoint=t,T.map.panTo(t);const n=new a.maps.Marker({position:t,map:T.map});T.markers.push(n)},N=e=>{for(var a;a=e.pop();)a.setMap(null)},b=()=>{T.markers&&T.markers.length&&N(T.markers),T.markers=[]},x=(e={})=>{const a=T.qq,t=e.latLng,n=new a.maps.Geocoder;n.setComplete((e=>{if("GEO_INFO"===e.type){var t=new a.maps.LatLngBounds,n=e.detail.nearPois||[];b(),T.addressList=n||[];for(let e=0;e<n.length;e++){const o=n[e];var s=new a.maps.Marker({map:T.map});s.setPosition(o.latLng),s.setTitle(e+1),T.markers.push(s),t.extend(o.latLng)}T.map.fitBounds(t)}var o=e.detail.location||{};K(o)})),n.setError((function(){alert("出错了,请输入正确的经纬度!!!")})),n.getAddress(t)},A=()=>{let e=T.searchKey;e&&(T.markers&&T.markers.length&&N(T.markers),T.searchService.setLocation(""),T.searchService.setPageCapacity(50),T.searchService.search(e))},G=(e,a)=>{const t=T.qq,{name:n,address:s,latLng:o}=e,{lat:r,lng:l}=o,i=new t.maps.Geocoder;i.setComplete((function(e){if("GEO_INFO"===e.type){const{addressComponents:{province:a,city:t,district:o,country:i}}=e.detail,c=JSON.stringify({name:n,address:s,province:a,city:t,district:o,country:i,lat:r,lng:l});C("selectLocation",{locationProp:c,isInit:!1})}})),i.setError((function(){alert("出错了,请输入正确的经纬度!!!")})),i.getAddress(o)},J=e=>{var a={zoom:12,center:new e.maps.LatLng(39.916527,116.397128),mapTypeId:e.maps.MapTypeId.ROADMAP};T.map=new e.maps.Map(document.getElementById("map-core"),a);const{lat:t,lng:n,address:s}=I.value||{};if(t&&n){const a=new e.maps.LatLng(t,n);x({latLng:a})}else s?setTimeout((()=>{A()}),300):new T.qq.maps.Geolocation(O.ak,"qqmap").getLocation(E,(function(e){console.log(e)}),{timeout:9e3});T.qq.maps.event.addDomListener(T.map,"click",(function(e){x({latLng:e.latLng})}))},Y=e=>{T.qq=e,setTimeout((()=>{J(e),(()=>{const e=T.qq;T.searchService=new e.maps.SearchService({complete:function(a){var t,n,s=a.detail.pois||[],o=new e.maps.LatLngBounds;if("CITY_LIST"===a.type)return T.searchService.setLocation(a.detail.cities[0].cityName),void T.searchService.search(T.searchKey);if(T.addressList=s||[],b(),"POI_LIST"===a.type)for(var r=0,l=s.length;r<l;r++){var i=s[r];o.extend(i.latLng),t=r,n=void 0,(n=new e.maps.Marker({map:T.map})).setPosition(s[t].latLng),n.setTitle(r+1),T.markers.push(n)}T.map.fitBounds(o)},error:function(e){console.log(e),"NO_RESULTS"!==e?B.warning("地址检索先输入城市名称"):B.warning("查无结果!")},autoExtend:!0})})()}),0)},j=()=>{(()=>{var e,a;let t=window;if(t.qq)return t.qq._preloader?t.qq._preloader:Promise.resolve(t.qq);{const n=O.ak||(null==(a=null==(e=t._qq)?void 0:e.call(t))?void 0:a.ak);return t.qq={},t.qq._preloader=new Promise((e=>{t._initBaiduMap=function(){e(t.qq),t.document.body.removeChild(a),t.qq._preloader=null,t._initBaiduMap=null};const a=document.createElement("script");window.document.body.appendChild(a),a.src=`https://map.qq.com/api/js?v=2.exp&key=${n}&callback=_initBaiduMap`;const s=document.createElement("script");window.document.body.appendChild(s),s.src="https://3gimg.qq.com/lightmap/components/geolocation/geolocation.min.js"})),t.qq._preloader}})().then(Y)};return n((()=>{setTimeout((()=>{j()}),200)})),(e,a)=>(s(),o("div",h,[r("div",y,[r("div",f,[l(i(q),{value:T.searchKey,"onUpdate:value":a[0]||(a[0]=e=>T.searchKey=e),placeholder:"请输入地址","enter-button":"检索"},null,8,["value"]),r("span",k,[l(i(L),{type:"primary",size:"small",onClick:A},{default:c((()=>[d("检索")])),_:1})])])]),w,T.addressList&&T.addressList.length?(s(),o("ul",_,[r("li",null,[d(" 地址:"+p(i(M))+" ",1),l(i(L),{type:"primary",size:"small",onClick:a[1]||(a[1]=e=>G(T.addressList[0]))},{default:c((()=>[d("确定")])),_:1})]),(s(!0),o(m,null,u(T.addressList,((e,a)=>(s(),o("li",{class:"address-item",key:a},[r("div",{onClick:a=>G(e)},[r("div",P,p(e.name),1),r("span",null,p(e.address),1)],8,S)])))),128))])):g("v-if",!0)]))}});export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
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 e,ref as l,computed as a,watch as t,onMounted as i,openBlock as n,createElementBlock as o,createElementVNode as s,Fragment as r,renderList as c,unref as u,normalizeClass as d,createCommentVNode as f,createVNode as v,withCtx as m,createTextVNode as p,toDisplayString as h,createBlock as g,withDirectives as k,vShow as b,isRef as y}from"vue";import{useMessage as C,NPopover as S,NModal as x,NCard as _,NIcon as A,NButton as q,NForm as w,NFormItem as F,NInput as j}from"naive-ui";import{CloseOutline as I,AddOutline as E}from"@vicons/ionicons5";import L from"../../table-filter/src/hooks/useMixins.js";import R from"../../table-filter/src/hooks/useRenderWidget.js";import U from"../../table-filter/src/hooks/useAdvanced.js";import V from"../../table-filter/src/components/render-widget/index.vue.js";import"moment/locale/zh-cn";import{cloneDeep as z}from"lodash-es";const D={class:"quick-search-block quick-search-table"},T={class:"quick-row"},B={class:"quick-item-title"},N={class:"quick-item-col"},O={class:"svg-wrap"},P={class:"flex_right"},Q={class:"class-filter-content"},M={class:"quickSearch-content"},W=s("span",{class:"label"},"父类名称:",-1),G=["onDblclick","onClick"],J={key:0,class:"s-content"};var H=e({__name:"index",props:{searchFieldList:{type:Array,default:()=>[]},quickSearchConfig:{type:Array,default:()=>[]},tableId:{type:String,default:""},filterApiConfig:{type:Object}},emits:["getFilterParam","onFilterSearch","clearQuickSearchConfig"],setup(e,{expose:H,emit:K}){const X=e,Y={classname:{required:!0,message:"请输入分类名称",trigger:["input","blur"]}},Z=C(),{handleGetConfigApi:$,outQuickSearchFn:ee}=L(),{getRenderSearchConObj:le,resetRenderWidgetValue:ae,isRender:te}=R(),{transformData:ie,getCacheDef:ne,transformParams:oe}=U(),se=l(null),re=l({classname:""});let ce=l(!1),ue=l([]),de=l([]),fe=l(!1),ve=l(""),me=a((()=>!!de.value.length&&de.value.some((e=>e.isAdd)))),pe=a((()=>(e,l="name")=>e.alias||e[l]));function he(){return function(e){if(!Array.isArray(e))return[];let l=[];for(let a=0;a<e.length;a++){let t=e[a];const i=le(t);!l.find((e=>e.field_key===i.field_key))&&i&&l.push(i)}return l.filter((e=>e.value))}(ue.value)||[]}function ge(){var e;null==(e=se.value)||e.validate((e=>{var l;if(e)return;let a=he();a.length||(a=[]);let t=null==(l=de.value.filter((e=>e.selected))[0])?void 0:l.value;!async function(e){var l;try{if(!await $(e,"requestSaveTableCondiTion",{},X.filterApiConfig))return;ce.value=!1,null==(l=se.value)||l.restoreValidation(),re.value.classname="",de.value=[],Se()}catch(e){console.log(e)}}({tableId:X.tableId||"",setting:JSON.stringify({displayCategory:t,name:re.value.classname,conObj:a}),conditionList:"[]"})}))}function ke(e){var l;const a=null==(l=null==e?void 0:e.target)?void 0:l.nextElementSibling;setTimeout((()=>{a&&a.focus()})),fe.value=!0}function be(){fe.value=!1,ve.value&&(de.value.forEach((e=>e.selected=!1)),de.value.push({disabled:!0,value:ve.value,selected:!0,isAdd:!0}),ve.value="")}function ye(e){!function(e){de.value.splice(e,1)}(e)}function Ce(){ce.value=!1}function Se(){xe(ue.value),K("clearQuickSearchConfig")}function xe(e){Array.isArray(e)&&(e.forEach((e=>{ae(e)})),ee.handlerInitSearchItem(ue.value))}return t((()=>X.searchFieldList),(e=>{e&&e.length>0&&function(){let e=z(ie(X.searchFieldList)).filter((e=>1==e.isShowSearch&&1!=e.filterExplicit))||[];ue.value=e||[],ee.handlerInitSearchItem(ue.value)}()}),{immediate:!0,deep:!0}),t((()=>ue),(()=>{const e=he()||[],l=oe(e);K("getFilterParam",e,l)}),{deep:!0}),i((()=>{const e=X.quickSearchConfig;if(e&&e.length>0)return l=e,void ue.value.forEach((e=>{var a;if(te(e)){const t=l.find((l=>l.field_key===e.columnName));t&&(null==(a=t.value)?void 0:a.length)>0&&(e.value=ne(e,t.value))}}));var l;xe(ue.value)})),H({openSaveToCalss:function(){let e=he();e&&(e.length>0?ce.value=!0:Z.warning("请设置搜索条件"))},clearData:Se,onFilterSearch:function(){let e=he()||[];const l=oe(e);return K("onFilterSearch",e,l,!1),ue.value}}),(l,a)=>(n(),o("div",null,[s("div",D,[(n(!0),o(r,null,c(u(ue),(l=>(n(),o("div",{class:d(["quick-item",{"quick-block":l._isBlock}]),key:l.sid||l.columnName},[s("div",T,[f(" title "),s("div",B,[v(u(S),{trigger:"hover"},{trigger:m((()=>[p(h(u(pe)(l,"title")),1)])),default:m((()=>[s("span",null,h(u(pe)(l,"title")),1)])),_:2},1024)]),f(" content "),s("div",N,[f(" 直接渲染组件 "),l.isRender?(n(),g(V,{key:0,cfg:l,modelValue:l.value,filterApiConfig:e.filterApiConfig,"onUpdate:modelValue":e=>l.value=e},null,8,["cfg","modelValue","filterApiConfig","onUpdate:modelValue"])):f("v-if",!0)])])],2)))),128))]),f(" 保存到分类的弹窗 "),v(u(x),{show:u(ce),maskClosable:!1,"positive-text":"确认","negative-text":"取消",onPositiveClick:ge,onNegativeClick:Ce,class:"classification-modal-block"},{default:m((()=>[v(u(_),{title:"设置筛选分类",style:{width:"520px"},bordered:!1,size:"huge",role:"dialog","aria-modal":"true"},{"header-extra":m((()=>[s("div",O,[v(u(A),{component:u(I),size:"24",onClick:Ce},null,8,["component"])])])),footer:m((()=>[s("div",P,[v(u(q),{onClick:Ce},{default:m((()=>[p("取消")])),_:1}),v(u(q),{type:"info",onClick:ge},{default:m((()=>[p("确认")])),_:1})])])),default:m((()=>[s("div",Q,[v(u(w),{ref_key:"formRef",ref:se,"label-placement":"left",rules:Y,model:re.value},{default:m((()=>[v(u(F),{label:"筛选集名称",path:"classname"},{default:m((()=>[v(u(j),{value:re.value.classname,"onUpdate:value":a[0]||(a[0]=e=>re.value.classname=e),placeholder:"请输入分类名称",clearable:""},null,8,["value"])])),_:1})])),_:1},8,["model"]),s("div",M,[W,(n(!0),o(r,null,c(u(de),((e,l)=>(n(),o("div",{class:d(["edit-tag",{"edit-tag-select":e.selected&&e.disabled}]),key:l,onDblclick:l=>function(e,l){l.disabled=!1,setTimeout((()=>{var l;null==(l=e.target)||l.focus()}),0)}(l,e),onClick:a=>function(e,l){e.disabled&&(de.value.forEach(((e,a)=>{a!==l&&(e.selected=!1)})),e.selected=!e.selected)}(e,l)},[e.disabled?(n(),o("div",J,[s("span",null,h(e.value),1)])):(n(),g(u(j),{key:1,style:{width:"100px"},value:e.value,"onUpdate:value":l=>e.value=l,disabled:e.disabled,onBlur:()=>e.disabled=!0,maxLength:10},null,8,["value","onUpdate:value","disabled","onBlur"])),v(u(A),{component:u(I),class:"anticon-close",size:"20",onClick:e=>ye(l)},null,8,["component","onClick"])],42,G)))),128)),u(me)?f("v-if",!0):(n(),o(r,{key:0},[k(v(u(q),{dashed:"",icon:"plus",class:"ant-btn",onClick:ke},{default:m((()=>[v(u(A),{component:u(E),size:"20"},null,8,["component"]),p("添加分类 ")])),_:1},512),[[b,!u(fe)]]),k(v(u(j),{style:{width:"100px"},class:"edit-tag",value:u(ve),"onUpdate:value":a[1]||(a[1]=e=>y(ve)?ve.value=e:ve=e),valueModifiers:{trim:!0},onBlur:be,maxLength:10},null,8,["value"]),[[b,u(fe)]])],64))])])])),_:1})])),_:1},8,["show"])]))}});export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"./RecommendSearch.vue2.js";import r from"../../../_virtual/_plugin-vue_export-helper.js";var m=r(e,[["__file","RecommendSearch.vue"]]);export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,computed as t,provide as o,useSlots as n,ref as a,getCurrentInstance as p,watch as r,openBlock as l,createBlock as c,resolveDynamicComponent as s,unref as u,mergeProps as m,isRef as i,withCtx as d,renderSlot as f}from"vue";import{useVModel as y}from"@vueuse/core";import{isObject as v}from"lodash-es";import{InjectionRecommendSearchRootSlots as g,InjectionRecommendSearchRef as h}from"./constant/index.js";import b from"./components/RecommendInput.vue.js";import S from"./components/RecommendSelect.vue.js";var j=e({__name:"RecommendSearch",props:{mode:{type:String,default:"input"},value:{type:[String,Number]},labelKey:{type:String,default:"label"},valueKey:{type:String,default:"value"},placeholder:{type:String},editPlaceholder:{type:String,default:"请输入关键字进行搜索"},clearable:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},commonList:{type:Array,default:()=>[]},recentList:{type:Array,default:()=>[]},recommendDeletable:{type:Boolean,default:!0},inputProps:{type:Object},popProps:{type:Object}},emits:["update:value","search","delete","choose","clear","openMenu","closeMenu"],setup(e,{expose:j,emit:x}){const C=e,$=y(C,"value",x),M={input:b,select:S},O=t((()=>M[C.mode]));o(g,n());const P=a();o(h,P);const R={},w=p();return r(P,(e=>{if(Object.keys(R).forEach((e=>Reflect.deleteProperty(R,e))),v(e))try{if(w&&w.appContext&&v(w.appContext.config)){const t=w.appContext.config.warnHandler;w.appContext.config.warnHandler=()=>1,Object.assign(R,e),w.appContext.config.warnHandler=t}else Object.assign(R,e)}catch(e){}})),j(R),(e,t)=>(l(),c(s(u(O)),m(e.$props,{value:u($),"onUpdate:value":t[0]||(t[0]=e=>i($)?$.value=e:null),onSearch:t[1]||(t[1]=t=>e.$emit("search",t)),onChoose:t[2]||(t[2]=t=>e.$emit("choose",t)),onOpenMenu:t[3]||(t[3]=t=>e.$emit("openMenu",t)),onCloseMenu:t[4]||(t[4]=t=>e.$emit("closeMenu",t)),onDelete:t[5]||(t[5]=t=>e.$emit("delete",t))}),{empty:d((()=>[f(e.$slots,"empty")])),_:3},16,["value"]))}});export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"./RecommendInput.vue2.js";import r from"../../../../_virtual/_plugin-vue_export-helper.js";var m=r(e,[["__file","RecommendInput.vue"]]);export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as e,ref as t,watch as o,onMounted as n,computed as l,openBlock as a,createElementBlock as r,createVNode as c,unref as s,mergeProps as i,withCtx as m,Fragment as u,renderSlot as p,createCommentVNode as d,createElementVNode as y,renderList as v,toDisplayString as h}from"vue";import{useVModel as f,useVirtualList as b}from"@vueuse/core";import _ from"./RecommendMenu.vue.js";import k from"./BaseSearch.js";const j={class:"recommend-search"},L=y("section",{class:"recommend-search__empty"},"暂无数据",-1),g=["onClick"],M=["title"],O=y("section",{class:"recommend-search__empty"},"暂无数据",-1);var w=e({__name:"RecommendInput",props:{value:{type:String},options:{type:Array,default:()=>[]},placeholder:{type:String,default:"请输入"},clearable:{type:Boolean,default:!0},commonList:{type:Array,default:()=>[]},recentList:{type:Array,default:()=>[]},recommendDeletable:{type:Boolean,default:!0}},emits:["update:value","search","delete","choose","clear","openMenu","closeMenu"],setup(e,{emit:w}){const A=e,C=t();function S(e=""){var t;null==(t=C.value)||t.setPattern(e)}const D=f(A,"value",w);o(D,S),n((()=>S(D.value)));const $=l((()=>D.value?A.options:A.options.filter((e=>{return A.commonList.every(t)&&A.recentList.every(t);function t(t){return t.itemObj!==e.itemObj}}))));function x(e){D.value=e,w("search",e)}function B(){w("openMenu")}function P(){w("closeMenu")}function R({type:e,value:t}){var o;D.value=t.itemObj,null==(o=C.value)||o.closeMenu(),w("choose",{type:e,value:t.itemObj})}const{list:E,wrapperProps:H,containerProps:I}=b($,{itemHeight:32,overscan:3});function K(e){["ArrowUp","ArrowDown","Enter"].includes(e.key)&&console.log(e)}return(t,o)=>(a(),r("section",j,[c(s(k),i({ref_key:"baseSearchRef",ref:C,"display-value":s(D),"clear-pattern-on-open-menu":!1,placeholder:e.placeholder,clearable:e.clearable,onKeydown:K,onSearch:x,onOpenMenu:B,onCloseMenu:P},t.$attrs),{menu:m((()=>[s(D)?(a(),r(u,{key:1},[s($).length?(a(),r("section",i({key:0,class:"recommend-search__optionContainer"},s(I),{style:{height:"256px"}}),[y("section",i({class:"recommend-search__optionList"},s(H)),[(a(!0),r(u,null,v(s(E),(e=>(a(),r("div",{onClick:t=>R({value:e.data}),key:e.data.itemObj,class:"recommend-search__option"},[y("div",{class:"recommend-search__optionText",title:e.data.itemObj},h(e.data.itemObj),9,M)],8,g)))),128))],16)],16)):p(t.$slots,"empty",{key:1},(()=>[O]))],64)):(a(),r(u,{key:0},[c(_,{"common-list":e.commonList,"recent-list":e.recentList,deletable:e.recommendDeletable,onDelete:o[0]||(o[0]=e=>t.$emit("delete",e)),onChoose:R},null,8,["common-list","recent-list","deletable"]),e.commonList.length||e.recentList.length?d("v-if",!0):p(t.$slots,"empty",{key:0},(()=>[L]))],64))])),_:3},16,["display-value","placeholder","clearable"])]))}});export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"./RecommendMenu.vue2.js";import r from"../../../../_virtual/_plugin-vue_export-helper.js";var m=r(e,[["__file","RecommendMenu.vue"]]);export{m as default};
|