cnhis-design-vue 3.2.15-beta.2 → 3.2.15-beta.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/ai-chat/src/components/ChatMain.js +1 -1
- package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -1
- package/es/components/big-table/src/BigTable.vue2.js +1 -1
- package/es/components/branch-notice/index.d.ts +393 -6
- package/es/components/branch-notice/src/BranchNotice.vue.d.ts +369 -6
- package/es/components/branch-notice/src/BranchNotice.vue2.js +1 -1
- package/es/components/branch-notice/src/canstants.d.ts +2 -1
- package/es/components/branch-notice/src/canstants.js +1 -1
- package/es/components/branch-notice/src/components/NoticeItem.vue.d.ts +168 -44
- package/es/components/branch-notice/src/components/NoticeItem.vue.js +1 -0
- package/es/components/branch-notice/src/components/NoticeItem.vue2.js +1 -0
- package/es/components/branch-notice/src/components/NoticeItemAside.vue.d.ts +74 -5
- package/es/components/branch-notice/src/components/NoticeItemAside.vue.js +1 -0
- package/es/components/branch-notice/src/components/NoticeItemAside.vue2.js +1 -0
- package/es/components/branch-notice/src/components/NoticeOperationList.vue.js +1 -0
- package/es/components/branch-notice/src/components/NoticeOperationList.vue2.js +1 -0
- package/es/components/branch-notice/src/drawLine.js +1 -1
- package/es/components/branch-notice/src/hooks/useTheme.d.ts +1 -0
- package/es/components/branch-notice/src/hooks/useTheme.js +1 -0
- package/es/components/branch-notice/src/types.d.ts +22 -4
- package/es/components/branch-notice/style/index.css +1 -1
- package/es/components/button-print/src/components/IdentityVerification.vue2.js +1 -1
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
- package/es/components/classification/src/components/table-modal/index.vue2.js +1 -1
- package/es/components/expand-field/src/components/FormBatchOptionsModal.vue2.js +1 -1
- package/es/components/expand-field/src/components/PersonModal.vue2.js +1 -1
- package/es/components/expand-field/src/components/form.vue2.js +1 -1
- package/es/components/expand-field/src/index.vue2.js +1 -1
- package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
- package/es/components/fabric-chart/src/hooks/index.d.ts +1 -0
- package/es/components/fabric-chart/src/hooks/index.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/{temperature/useShadow.d.ts → useShadow.d.ts} +2 -2
- package/es/components/fabric-chart/src/hooks/useShadow.js +1 -0
- package/es/components/fabric-chart/src/utils/index.d.ts +1 -0
- package/es/components/fabric-chart/src/utils/index.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldColor.vue2.js +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue2.js +1 -1
- package/es/components/field-set/src/TableStyle.vue2.js +1 -1
- package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
- package/es/components/field-set/src/components/edit-filter.vue2.js +1 -1
- package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
- package/es/components/field-set/src/constants/filter.js +1 -1
- package/es/components/field-set/src/constants/index.js +1 -1
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
- package/es/components/form-config/src/hooks/useLocale.js +1 -1
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/combination.js +1 -1
- package/es/components/form-render/src/components/renderer/complex.js +1 -1
- package/es/components/form-render/src/components/renderer/date.js +1 -1
- package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/components/renderer/switch.js +1 -1
- package/es/components/form-render/src/components/renderer/text.js +1 -1
- package/es/components/form-render/src/components/renderer/textarea.js +1 -1
- package/es/components/form-render/src/hooks/useAnchor.js +1 -1
- package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
- package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
- package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
- package/es/components/form-render/src/hooks/usePresetScope.js +1 -1
- package/es/components/form-render/src/utils/index.js +1 -1
- package/es/components/iho-chat/index.d.ts +10 -10
- package/es/components/iho-chat/src/Index.vue.d.ts +10 -10
- package/es/components/iho-chat/src/Index.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +2 -2
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
- package/es/components/iho-chat/src/hooks/useData.d.ts +2 -2
- package/es/components/iho-chat/src/hooks/useData.js +1 -1
- package/es/components/iho-chat/src/hooks/useWebSocket.js +1 -1
- package/es/components/iho-chat/src/utils/index.js +1 -1
- package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/dynamicFilter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue2.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/info-header/src/components/patientInfo/index.vue2.js +1 -1
- package/es/components/keyboard/src/components/NumberPanel.vue2.js +1 -1
- package/es/components/map/src/Map.vue2.js +1 -1
- package/es/components/quick-search/src/index.vue2.js +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/scale-view/src/components/formitem/r-sign.js +1 -1
- package/es/components/scale-view/src/components/formitem/standard-modal.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-methods.js +1 -1
- package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
- package/es/components/select-label/src/SelectLabel.vue2.js +1 -1
- package/es/components/select-label/src/ihoLabel/IhoSelectLabel.vue2.js +1 -1
- package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
- package/es/components/table-export-field/src/components/SaveProjectModal.vue2.js +1 -1
- package/es/components/table-filter/src/components/bi-filter/helpers/options.js +1 -1
- package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.js +1 -1
- package/es/components/table-filter/src/tool/baseOptions.js +1 -1
- package/es/components/template-render/src/components/index.d.ts +23 -23
- package/es/components/tooth-bitmap/src/ToothBitmap.vue2.js +1 -1
- package/es/components/vod-chunk-upload/src/vod-chunk-upload/vod-chunk-upload.vue2.js +1 -1
- package/es/components/vod-chunk-upload/src/vod-upload-modal.js +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/ai__avatar.png.js +1 -1
- package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
- package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
- package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
- package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
- package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
- package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
- package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
- package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
- package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
- package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
- package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/logo.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/table_style_2.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
- 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/hooks/temperature/useShadow.js +0 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/fabricjs/index.d.ts +0 -6823
- package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,computed as a,inject as l,watch as o,createVNode as r,nextTick as n}from"vue";import{connect as u,mapProps as i}from"@formily/vue";import{last as s,isEqual as c,isArray as p,isString as d}from"lodash-es";import{NCascader as v}from"naive-ui";import"../../../index.js";import{useCommonInjection as m}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as f,InjectionAsyncQueue as h,InjectionFormUUID as y}from"../../constants/index.js";import"@formily/path";import"@vueuse/core";import"../../../../../shared/utils/index.js";import"@formily/core";import"@vicons/ionicons5";import"@vue/shared";import"../../utils/business.js";import{assignUpdateValue as k,createVisitedSetter as j,traverseDependKey as g}from"../../utils/schema.js";import"date-fns";import"../../hooks/useComplexOptions.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"@vueuse/shared";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../../shared/hooks/useScrollLoading.js";import"./index.js";import{useFormField as b}from"../../hooks/useFormField.js";import"@formily/reactive";import"../../hooks/useFormValidator.js";const C=u(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},checkStrategy:{type:String,default:"child"},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:u,emit:i}){const k=t(),{field:C,title:S,fieldKey:F}=b(),w=t(1),A=t(!0);const
|
1
|
+
import{defineComponent as e,ref as t,computed as a,inject as l,watch as o,createVNode as r,nextTick as n}from"vue";import{connect as u,mapProps as i}from"@formily/vue";import{last as s,isEqual as c,isArray as p,isString as d}from"lodash-es";import{NCascader as v}from"naive-ui";import"../../../index.js";import{useCommonInjection as m}from"../../hooks/useCommonInjection.js";import{InjectionChangeContextCollector as f,InjectionAsyncQueue as h,InjectionFormUUID as y}from"../../constants/index.js";import"@formily/path";import"@vueuse/core";import"../../../../../shared/utils/index.js";import"@formily/core";import"@vicons/ionicons5";import"@vue/shared";import"./text.js";import"../../utils/business.js";import{assignUpdateValue as k,createVisitedSetter as j,traverseDependKey as g}from"../../utils/schema.js";import"date-fns";import"../../hooks/useComplexOptions.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"@vueuse/shared";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../../shared/hooks/useScrollLoading.js";import"./index.js";import{useFormField as b}from"../../hooks/useFormField.js";import"@formily/reactive";import"../../hooks/useFormValidator.js";const C=u(e({name:"FormCascader",props:{options:{type:Array,default:()=>[]},depth:{type:[Number,String]},urlConfig:{type:Object},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},onFocus:{type:Function},filterable:{type:Boolean,default:!1},checkStrategy:{type:String,default:"child"},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},onChange:{},value:{}},emits:["update:value"],setup(e,{slots:u,emit:i}){const k=t(),{field:C,title:S,fieldKey:F}=b(),w=t(1),A=t(!0);const x=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.nameKey)?a:e.labelField)?l:"text"})),H=a((()=>{var t,a,l;return null!=(l=null!=(a=null==(t=e.urlConfig)?void 0:t.valueKey)?a:e.valueField)?l:"value"}));l(f).setContext(F.value,(()=>({labelField:x.value,valueField:H.value})));const q=a((()=>{var t;try{const a=Array.isArray(e.value)?e.value:JSON.parse(e.value||"");if(!Array.isArray(a)||!a.length)return null;const l=null==(t=s(a))?void 0:t[H.value];return null!=l?l:a.map((e=>e[x.value])).join(" / ")}catch(e){return null}}));function K(e,t,a){i("update:value",p(a)?a.map((function(e){return{...e,label:e[x.value],children:void 0,parent:void 0,mergeItemValue:void 0}})):null)}const L=l(h);async function V(t){e.filterable?await async function(){if(!e.urlConfig||k.value&&e.requestCache)return;const t=await L.addAsync({...e.urlConfig,params:{lvlnr:"1"},key:F.value,cache:e.requestCache,payload:{field:C.value,labelKey:x.value,valueKey:H.value}});function a(e,t,o){const r=[...o,...l(e)],n={[x.value]:e[x.value],[H.value]:e[H.value],depth:t+1,isLeaf:!0,keyword:e.keyword,mergeItemValue:r};return p(e.children)&&(n.children=e.children.map((e=>a(e,t+1,r))),n.isLeaf=!e.children.length),w.value=Math.max(w.value,t+1),n}function l(e){let t=[];if(d(e[x.value])&&(t=[...t,e[x.value]]),d(e.keyword)&&e.keyword.length>0){const a=e.keyword.split(",");t=[...t,...a]}return t}k.value=t.map((e=>a(e,0,[])))}():await async function(t){if(o(e,t))return;const a=await L.addAsync(r(s(t),i(e),S.value,t));if(!a.length&&t)return t.isLeaf=!0,K(0,0,n(t)),void(N.value=!1);const l=a.map((e=>u(e,s(t))));function o(e,t){return!i(e)||!t&&k.value&&e.requestCache||s(t)>=s(e)-1}function r(t,a,l,o){const r={lvlnr:t+1+""};return o&&a.dependKey&&g(a.dependKey,((e,t)=>{r[t]=o[e]})),{params:r,...a,key:l,cache:e.requestCache}}function n(e){let t=e;const a=[e];for(;t.parent;)a.unshift(t.parent),t=t.parent;return a}function u(a,l){return{[x.value]:a[x.value],[H.value]:a[H.value],depth:l+1,parent:t,isLeaf:l+2>=s(e)}}function i(e){return e.urlConfig}function s(e){var t;return null!=(t=null==e?void 0:e.depth)?t:-1}t?t.children=l:k.value=l}(t),await I()}const B=`form-render__cascade--menu-${l(y)}`;async function I(){await n();const e=document.querySelector(`.${B} .v-vl`);e&&e.dispatchEvent(new CustomEvent("scroll"))}function E(t,a){if(!t||!a)return!1;const{mergeItemValue:l}=a;return!(e.checkStrategy.includes("child")&&a.depth<w.value)&&(l.length>0&&l.some((e=>e.includes(t.trim()))))}const{injectValueValidate:O,injectValueWatchFromEmpty:W,injectValueBindKey:z}=m();W((()=>e.value),V),O((()=>e.value)),o((()=>e.urlConfig),(async(t,a)=>{c(t,a)||(k.value=null,A.value?e.lazyRequest||(V(),A.value=!A.value):await V())}),{immediate:!0});const N=t(!1);function P(e){N.value=!!e,e&&V()}const R=a((()=>k.value||e.options||[])),U=a((()=>!e.filterable)),$=z(q);return()=>r(v,{key:$.value,remote:U.value,filterable:e.filterable,"menu-props":{class:B,onClick:I},"check-strategy":e.checkStrategy,show:!!N.value,"onUpdate:show":P,value:q.value,filter:E,"onUpdate:value":K,labelField:x.value,valueField:H.value,options:R.value,onLoad:V,onFocus:j(C)},u)}}),i({dataSource:"options"},k));export{C as SEARCH_CASCADER};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,computed as o,watch as t,inject as l,useAttrs as a,ref as r,createVNode as s,mergeProps as n,toRaw as u}from"vue";import{arrayed as i}from"../../../../../shared/utils/index.js";import{NSelect as p}from"naive-ui";import"@vueuse/core";import"date-fns";import{cloneDeep as m,isArray as d,isObject as c,omit as v,xor as y}from"lodash-es";import"@vue/shared";import{useSelectAllowModify as f}from"../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as h}from"../../../../../shared/hooks/selectHooks/useSelectRenders.js";import"../../../../../shared/hooks/useScrollLoading.js";import{connect as
|
1
|
+
import{defineComponent as e,computed as o,watch as t,inject as l,useAttrs as a,ref as r,createVNode as s,mergeProps as n,toRaw as u}from"vue";import{arrayed as i}from"../../../../../shared/utils/index.js";import{NSelect as p}from"naive-ui";import"@vueuse/core";import"date-fns";import{cloneDeep as m,isArray as d,isObject as c,omit as v,xor as y}from"lodash-es";import"@vue/shared";import{useSelectAllowModify as f}from"../../../../../shared/hooks/selectHooks/useSelectAllowModify.js";import"../../../../../shared/hooks/selectHooks/useSearchContent.js";import{useSelectRenders as h}from"../../../../../shared/hooks/selectHooks/useSelectRenders.js";import"../../../../../shared/hooks/useScrollLoading.js";import{connect as j,mapProps as b}from"@formily/vue";import{useCommonInjection as S,useSelectOptionProps as g}from"../../hooks/useCommonInjection.js";import{useComplexOptions as k,useComplexOptionsSpan as C}from"../../hooks/useComplexOptions.js";import{InjectionChangeContextCollector as F,InjectionFormUUID as B}from"../../constants/index.js";import"@formily/path";import"@formily/core";import"@vicons/ionicons5";import"./text.js";import"../../utils/business.js";import{assignUpdateValue as w,assignClearBindVisited as A,createVisitedSetter as H}from"../../utils/schema.js";import"../../../index.js";import"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import"./index.js";import"@vueuse/shared";import{useFormField as O}from"../../hooks/useFormField.js";import"@formily/reactive";import{useUrlConfigOptions as K,useAutographOptions as R,useRecommendOptions as x}from"../../hooks/useFormRenderOptions.js";import"../../hooks/useFormValidator.js";const V=j(e({name:"FormSelect",props:{value:{type:[String,Array,Number]},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},onChange:{},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},showField:{type:String},allowCreate:Boolean,shouldSave:Boolean,allowModify:Boolean,showCustomValue:Boolean,cursorPlacement:{type:String,default:"end"},urlConfig:{type:Object},autograph:{type:String},wordbook:{type:Object},recommend:{type:Boolean,default:!1},commonList:{type:Array},recentList:{type:Array},getRecommendInfo:{type:Function},commonNum:{type:Number,default:10},recentNum:{type:Number,default:10},recommendCache:{type:Boolean,default:!1},useLoading:{type:Boolean,default:!0},multiple:{type:Boolean},deletable:{type:Boolean,default:!0},selectAll:{type:Boolean},searchByValue:{type:Boolean},wordSplitFilter:{}},emits:["update:value","postRecommend","patternChange"],setup(e,{slots:j,emit:b}){const w=o({get:()=>e.value,async set(e){b("update:value",e),G(e)}}),{labelKey:A,valueKey:V,showKey:L,fetchData:P,searchContent:_,fullOptions:N,filterOptions:I,remoteOptions:W,loading:q}=e.urlConfig?K(e,w):R(e,w);t(_,(e=>{b("patternChange",{pattern:e,options:ue.value})}));const{modifyEvent:E,modifyAbleRef:z,getOptionsWithCreated:M}=f(e,{searchContent:_,labelKey:A,valueKey:V,valueRef:w,fullOptions:N}),{renderComplexOption:T,hasComplexOption:U}=k(e,w),{getRecommend:D,postRecommend:G,sortedOptions:J}=x(e,I,b,A,V),{field:Q,fieldKey:X}=O();l(F).setContext(X.value,(e=>({currentOption:m(function(e){const o=M(N.value);return d(e)?function(e){const t=o.reduce(((e,o)=>(e[o[V.value]]=o,e)),{});return e.map((e=>t[e]))}(e):(t=e,o.find((e=>e[V.value]===t)));var t}(e)),labelField:A.value,valueField:V.value})));const Y=async e=>(_.value=e,Promise.allSettled([P(e),D(e)])),{injectValueValidate:Z,injectValueWatchFromEmpty:$,injectValueBindKey:ee}=S();$(w,(()=>e.lazyRequest&&Y())),Z(w);const oe=ee(w),{menuProps:te,nodeProps:le}=g(),{renderTag:ae,renderLabel:re,renderSelectAll:se,titleRef:ne}=h(e,{labelKey:A,valueKey:V,valueRef:w,showKey:L,searchContent:_}),ue=o((()=>M(z.value?N.value:J.value))),ie=a(),pe=o((()=>{if(e.allowCreate||e.showCustomValue)return w.value;const o=e.multiple&&d(w.value);return N.value.find((e=>o?w.value.includes(e[V.value]):e[V.value]===w.value))?w.value:null})),me=r(!1);async function de(e){e&&await Y(),me.value=e}async function ce(e,o){await E.updateValue(e,o),W.value&&o&&i(o).forEach((e=>{if(!c(e))return;const o=e;o.created&&o.shouldSave&&W.value.push(v(u(o),["created","shouldSave"]))}))}const ve=l(B),{getSpan:ye}=C(),fe=H(Q,E.focus);function he(o){if(!e.multiple)return;const t=o?ue.value.map((e=>e[V.value])):[];y(t,e.value).length&&(w.value=t)}function je(o){let t=j;return e.multiple&&e.selectAll&&(t={action:()=>se(he),...j}),s(p,n({title:ne.value,key:oe.value,multiple:e.multiple,remote:!0,filterable:!0,loading:q.value,value:pe.value,onUpdateValue:ce,"menu-props":te,"node-props":le,labelField:A.value,valueField:V.value,options:ue.value,onSearch:Y,show:me.value,"onUpdate:show":de,onFocus:fe,onBlur:E.blur,renderLabel:re,renderTag:ae},o,ie),t)}return()=>{var e,o;if(!U.value)return je();const t=null!=(o=null==(e=Q.value.decoratorProps)?void 0:e.span)?o:6,l=ye(ve,Q.value.address);return s("section",{class:"form-render__selectChildField",style:{"--column":l+t}},[je({class:"form-render__selectChildFieldItem",style:{"--form-item-column":t}}),N.value.map((e=>T({option:e,value:w.value,valueKey:V.value,labelKey:A.value,childFieldStrategy:"checked",renderLabel:!1,attrs:{class:"form-render__selectChildFieldItem",style:{"--form-item-column":l}}})))])}}}),b({dataSource:"options"},w,A));export{V as SELECT};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,useAttrs as o,ref as i,computed as l,createVNode as t,mergeProps as
|
1
|
+
import{defineComponent as e,useAttrs as o,ref as i,computed as l,createVNode as t,mergeProps as r,createTextVNode as u}from"vue";import{NSwitch as n,NModal as a,NCheckbox as d}from"naive-ui";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"./text.js";import"../../utils/business.js";import{assignUpdateValue as s,assignValueBindKey as v}from"../../utils/schema.js";import{connect as p,mapProps as c}from"@formily/vue";import"../../../index.js";import{useFormField as m}from"../../hooks/useFormField.js";const w=p(e({name:"FormSwitch",props:{value:{},openDescription:{type:Object},closeDescription:{type:Object},showMode:{type:String,default:"SWITCH"},onChange:{}},emits:["update:value"],setup(e,{emit:s}){const v=o(),p=i(!1),{field:c,fieldKey:w}=m(),h=l((()=>{var e,o;return null==(o=null==(e=c.value.decoratorProps)?void 0:e.fieldItem)?void 0:o.requiredReminderContent})),f=l((()=>{var o,i;return null==(i=null==(o=e.openDescription)?void 0:o.value)||i})),g=l((()=>{var o,i;return null!=(i=null==(o=e.closeDescription)?void 0:o.value)&&i})),y=()=>{var o,i;return u(null!=(i=null==(o=e.openDescription)?void 0:o.describe)?i:"")},C=()=>{var o,i;return u(null!=(i=null==(o=e.closeDescription)?void 0:o.describe)?i:"")},j=l({get:()=>e.value===f.value,set(o){if(!h.value||"SWITCH"!==e.showMode||o)return s("update:value",o?f.value:g.value);p.value=!0}});function k(){s("update:value",g.value)}return()=>{return"SWITCH"===e.showMode?[t(n,r({value:j.value,"onUpdate:value":e=>j.value=e},v),{checked:y,unchecked:C}),h.value?t(a,{show:p.value,"onUpdate:show":e=>p.value=e,"display-directive":"show",preset:"dialog",title:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.428"))||"确认","positive-text":(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.428"))||"确认","negative-text":(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.28"))||"取消",content:h.value,onPositiveClick:k},null):null]:t(d,{checked:j.value,"onUpdate:checked":e=>j.value=e},{default:y});var o,i,l}}}),c(s,v));export{w as SWITCH};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,computed as t,inject as n,createVNode as o}from"vue";import{connect as r,mapProps as l,RecursionField as i}from"@formily/vue";import{isString as s}from"lodash-es";import"../../../index.js";import{InjectionBusinessCollector as a,InjectionFormGlobalProps as u}from"../../constants/index.js";import{
|
1
|
+
import{defineComponent as e,computed as t,inject as n,createVNode as o}from"vue";import{connect as r,mapProps as l,RecursionField as i}from"@formily/vue";import{isString as s}from"lodash-es";import"../../../index.js";import{InjectionBusinessCollector as a,InjectionFormGlobalProps as u}from"../../constants/index.js";import{useFieldListAdaptor as m}from"../../hooks/useFieldListAdaptor.js";import{createObjSchema as c}from"../../utils/schema.js";import{createSlot as p,replace2Any as d}from"../../utils/index.js";const f=r(e({name:"FORM_TEXT",props:{content:{},fieldItem:{type:Object},value:{},onChange:{}},setup(e){function r(t,n=!1,r=!0){return r?o("div",{style:n?{display:"flex",alignItems:"center"}:{}},[l()]):l();function l(){var n,r;return null==(r=(n=p(t,e,(e=>s(e)?e=d(e.replace("\n","<br>"),[{from:"<br>",to:o("i",{style:{width:"100%",height:"4px"}},null)},{from:" ",to:o("i",{style:{display:"inline-block",width:"4px"}},null)}]):[e]))).default)?void 0:r.call(n)}}const l=t((()=>{var t,n;return null!=(n=null==(t=e.fieldItem)?void 0:t.__textEnhance)?n:[]})),f=t((()=>l.value.length&&l.value.some((e=>"widget"===e.type)))),v=n(a),h=n(u),{schemaAdaptor:y}=m(v,h.lifeCycle);return()=>{var t;return f.value?o("div",{style:{display:"flex",alignItems:"center"}},[l.value.map((e=>{if("text"===e.type)return r(e.content,!0,!1);if(s(e.content))return r(e.content,!0,!1);const t={...e.content};return t.decoratorProps={...t.decoratorProps,showLabel:!1,showFeedback:!1},o(i,{basePath:".",schema:c(y([t]))},null)}))]):r(null!=(t=e.content)?t:e.value)}}}),l((e=>{var t;return{...e,content:null==(t=e.fieldItem)?void 0:t.content}})));export{f as TEXT};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,computed as o,inject as r,createVNode as t,mergeProps as i}from"vue";import{InjectionFormGlobalProps as s}from"../../constants/index.js";import{useCommonInjection as u}from"../../hooks/useCommonInjection.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"lodash-es";import{NInput as m}from"naive-ui";import"../../utils/business.js";import{assignUpdateValue as a,assignClearBindVisited as l}from"../../utils/schema.js";import{connect as n,mapProps as p,useField as v}from"@formily/vue";const d=n(e({name:"FormTextarea",props:{value:{type:String},rows:{type:Number}},emits:["update:value"],setup(e,{emit:a}){const l=o({get:()=>e.value,set:e=>a("update:value",e)}),n=u().injectValueBindKey(l),p=v(),d=r(s,{}),c=o((()=>{var e,o,r;return null!=(r=null==(o=null==(e=p.value.decoratorProps)?void 0:e.fieldItem)?void 0:o.bordered)?r:d.bordered})),f=o((()=>"underline"===c.value?{autosize:{minRows:e.rows,maxRows:99}}:{rows:e.rows}));return()=>t(m,i({type:"textarea"},f.value,{key:n.value,value:l.value,"onUpdate:value":e=>l.value=e}),null)}}),p(a,l));export{d as TEXTAREA};
|
1
|
+
import{defineComponent as e,computed as o,inject as r,createVNode as t,mergeProps as i}from"vue";import{InjectionFormGlobalProps as s}from"../../constants/index.js";import{useCommonInjection as u}from"../../hooks/useCommonInjection.js";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"lodash-es";import{NInput as m}from"naive-ui";import"./text.js";import"../../utils/business.js";import{assignUpdateValue as a,assignClearBindVisited as l}from"../../utils/schema.js";import{connect as n,mapProps as p,useField as v}from"@formily/vue";const d=n(e({name:"FormTextarea",props:{value:{type:String},rows:{type:Number}},emits:["update:value"],setup(e,{emit:a}){const l=o({get:()=>e.value,set:e=>a("update:value",e)}),n=u().injectValueBindKey(l),p=v(),d=r(s,{}),c=o((()=>{var e,o,r;return null!=(r=null==(o=null==(e=p.value.decoratorProps)?void 0:e.fieldItem)?void 0:o.bordered)?r:d.bordered})),f=o((()=>"underline"===c.value?{autosize:{minRows:e.rows,maxRows:99}}:{rows:e.rows}));return()=>t(m,i({type:"textarea"},f.value,{key:n.value,value:l.value,"onUpdate:value":e=>l.value=e}),null)}}),p(a,l));export{d as TEXTAREA};
|
@@ -1 +1 @@
|
|
1
|
-
import{doAnimation as e}from"../../../../shared/utils/anime.js";import{Path as o}from"@formily/path";import{useDebounceFn as r,watchOnce as t}from"@vueuse/core";import{ref as n,nextTick as i,computed as l}from"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@vicons/ionicons5";import"@vue/shared";import"lodash-es";import"naive-ui";import"../utils/business.js";import{createLinebarId as s}from"../utils/schema.js";function a(a,u,c,m){const
|
1
|
+
import{doAnimation as e}from"../../../../shared/utils/anime.js";import{Path as o}from"@formily/path";import{useDebounceFn as r,watchOnce as t}from"@vueuse/core";import{ref as n,nextTick as i,computed as l}from"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@vicons/ionicons5";import"@vue/shared";import"lodash-es";import"naive-ui";import"../components/renderer/text.js";import"../utils/business.js";import{createLinebarId as s}from"../utils/schema.js";function a(a,u,c,m){const p=n(),v=n(""),f=n([]),d=r((async function(e){var o;f.value=Object.values(e.fields).reduce(((e,o)=>{var r,t,n,i;return"LINEBAR"===o.componentType&&"visible"===o.selfDisplay&&e.push({title:null!=(t=null==(r=o.componentProps)?void 0:r.title)?t:o.title,name:o.address.toString(),index:null!=(i=null==(n=o.decoratorProps)?void 0:n._index)?i:0}),e}),[]).sort(((e,o)=>e.index-o.index)),await i(),null==(o=p.value)||o.syncBarPosition()}),100);let h=!1;async function y(r){h=!0;try{if(!c.value)return;m.trigger(o.parse(r),!0),await i();const t=c.value.querySelector(`#${s(r)}`);if(!t)return;await new Promise((o=>{e(c.value.scrollTop,t.offsetTop,300,(e=>{var o;null==(o=c.value)||o.scrollTo({top:e})}),"easeInSine",(()=>setTimeout(o,300)))}))}finally{h=!1}}const T=r((function(e){var o;if(h||!c.value)return;const{scrollTop:r,clientHeight:t}=c.value,n=f.value.find(((e,o,n)=>{const i=n[o+1];if(!i)return!0;const l=c.value.querySelector(`#${s(i.name)}`);return l?l.offsetTop>r+t/2:void 0}))||f.value[f.value.length-1];v.value=null!=(o=null==n?void 0:n.name)?o:"",u("scroll",e)}),300);t(f,(e=>{var o,r;v.value=null!=(r=null==(o=e[0])?void 0:o.name)?r:""}));return{currentAnchor:l({get:()=>v.value,async set(e){v.value=e,await new Promise((e=>setTimeout(e,100))),await y(e)}}),onScroll:T,anchorIdList:f,generateAnchorList:d,updateAnchorList:function(e){"LINEBAR"===e.componentType&&e.selfDisplay&&d(e.form)},scrollTo:y,anchorBarRef:p}}export{a as useAnchor};
|
@@ -1 +1 @@
|
|
1
|
-
import{isField as e}from"@formily/core";import{Path as t}from"@formily/path";import{isString as s}from"@vueuse/core";import{format as i}from"date-fns";import{isFunction as r,isNumber as n}from"lodash-es";import{FIELD_BUSINESS_TYPE as l}from"../constants/index.js";import"vue";import"../../../../shared/utils/index.js";import"@vicons/ionicons5";import"@vue/shared";import"naive-ui";import{isIdCard as a,parseIdCard as o,parseAgeFromContext as u,parseBirthday as h,parseAge2Birthday as y}from"../utils/business.js";class
|
1
|
+
import{isField as e}from"@formily/core";import{Path as t}from"@formily/path";import{isString as s}from"@vueuse/core";import{format as i}from"date-fns";import{isFunction as r,isNumber as n}from"lodash-es";import{FIELD_BUSINESS_TYPE as l}from"../constants/index.js";import"vue";import"../../../../shared/utils/index.js";import"@vicons/ionicons5";import"@vue/shared";import"naive-ui";import"../components/renderer/text.js";import{isIdCard as a,parseIdCard as o,parseAgeFromContext as u,parseBirthday as h,parseAge2Birthday as y}from"../utils/business.js";class p{constructor(e){this.businessFormatter=e,this.triggerDisabled=!1,this.typeLockMap=new Map,this.typeCollector=new Map,this.fieldNameCollector=new Map,this.changeHandlerMap=new Map([])}formatter(...e){return r(this.businessFormatter)?this.businessFormatter(...e):e[0].value}collect(e,t){this.typeCollector.set(e,t),this.fieldNameCollector.set(t.val_key,e)}getField(e){return this.typeCollector.get(e)}getFieldInstanceByType(e,t){const s=this.getField(t);return s?e.query(s.val_key).take():null}getType(e){return this.fieldNameCollector.get(e)}getValueByField(t,s){const i=t.query(s).take();return e(i)?i.value:null}getValueByType(e,t){const s=this.getField(t);return s?this.getValueByField(e,s.val_key):null}setValueByType(e,i,r,n){const l=this.getField(i);l&&e.setFieldState(l.val_key,(e=>{e.value!==r&&(!this.typeLockMap.get(i)&&this.typeLockMap.set(i,1),this.triggerDisabled&&s(this.triggerDisabled)&&t.parse(this.triggerDisabled).match(l.val_key)||(e.value=this.formatter({value:r,type:i,fieldKey:l.val_key,from:n})))}))}registerChangeBusiness(e,t){return this.changeHandlerMap.set(e,t),this}trigger(e,t,s="change"){var i;if(!0===this.triggerDisabled)return;const r=this.getType(t);if(!r)return;if("change"===s&&this.typeLockMap.get(r))return this.typeLockMap.set(r,0);const n="change"===s?this.changeHandlerMap:null;n&&(null==(i=n.get(r))||i.call(this,e))}}function c(){function e(){var e;const t=this.getField(l.BIRTHDAY);return null!=(e=null==t?void 0:t.date_format)?e:"yyyy-MM-dd HH:mm"}function t(t){const r=this.getValueByType(t,l.ID_CARD);if(!r||!s(r)||!a(r))return;const n=o(r),{age:h,ageUnit:y}=u(n);null!=y&&this.setValueByType(t,l.AGE_UNIT,y,l.ID_CARD),null!=h&&this.setValueByType(t,l.AGE,h,l.ID_CARD),null!=n.sex&&this.setValueByType(t,l.SEX,n.sex,l.ID_CARD),null!=n.birthday&&this.setValueByType(t,l.BIRTHDAY,i(new Date(n.birthday),e.call(this)),l.ID_CARD)}function r(e){const t=this.getValueByType(e,l.BIRTHDAY);if(!s(t))return;const{age:i,ageUnit:r}=u(h(t));this.setValueByType(e,l.AGE_UNIT,r,l.BIRTHDAY),this.setValueByType(e,l.AGE,i,l.BIRTHDAY)}function c(t){return function(i){const r=this.getValueByType(i,l.AGE),a=this.getValueByType(i,l.AGE_UNIT);(s(r)||n(r))&&""!==r&&s(a)&&""!==a&&this.setValueByType(i,l.BIRTHDAY,y(+r,a,e.call(this)),t)}}return{create:function(e){return new p(e).registerChangeBusiness(l.ID_CARD,t).registerChangeBusiness(l.AGE_UNIT,c(l.AGE_UNIT)).registerChangeBusiness(l.AGE,c(l.AGE)).registerChangeBusiness(l.BIRTHDAY,r)}}}export{p as BusinessCollector,c as useBusinessBinding};
|
@@ -1 +1 @@
|
|
1
|
-
import{reactive as e,computed as t,createVNode as r,mergeProps as n,defineComponent as l,inject as o,provide as i,watch as s,onUnmounted as a,onMounted as d,withModifiers as c}from"vue";import{checkInSetupEnv as u}from"../../../../shared/utils/index.js";import{useField as p,useForm as m,RecursionField as f}from"@formily/vue";import{isArray as h,noop as v,isEmpty as y}from"lodash-es";import"../../index.js";import{InjectionFormUUID as g,InjectionBusinessCollector as x}from"../constants/index.js";import{
|
1
|
+
import{reactive as e,computed as t,createVNode as r,mergeProps as n,defineComponent as l,inject as o,provide as i,watch as s,onUnmounted as a,onMounted as d,withModifiers as c}from"vue";import{checkInSetupEnv as u}from"../../../../shared/utils/index.js";import{useField as p,useForm as m,RecursionField as f}from"@formily/vue";import{isArray as h,noop as v,isEmpty as y}from"lodash-es";import"../../index.js";import{InjectionFormUUID as g,InjectionBusinessCollector as x}from"../constants/index.js";import{renderOptionLabel as b,renderDescOption as F}from"../utils/index.js";import{useFieldListAdaptor as S}from"./useFieldListAdaptor.js";import{createObjSchema as j}from"../utils/schema.js";const O=e(new Map);function M(e,t,r=0){O.set(e,O.get(e)||{});O.get(e)[t+""]=r}function W(e,t,r=!0){const n=O.get(e);return n?Object.entries(n).reduce(((e,[n,l])=>r&&n===`${t}`||n.startsWith(`${t}.`)?e+l:e),0):0}function $(e,t){const r=O.get(e);r&&Reflect.deleteProperty(r,t+"")}function E(e){O.delete(e)}const K=l({props:{fieldItems:{type:Array,default:()=>[]},childFieldStrategy:{type:String,default:"checked"},childWidthMode:{type:String,default:"outer"},name:{type:String,required:!0}},setup(e){const l=o(g),u=o(x),h=p(),y=o(l+"_virtualParent",""),b=`${y?y+".":""}${h.value.address}`;function F(e){return`${b}.${e}`}i(l+"_virtualParent",b);const{schemaAdaptor:O}=S(u);function E(t){var r,n,l,o;return Object.assign(t,{"x-decorator-props":{...t["x-decorator-props"],labelPlacement:"left",isOptionChildField:!0},"x-component-props":{...t["x-component-props"],childFieldStrategy:null!=(n=null==(r=t["x-component-props"])?void 0:r.childFieldStrategy)?n:e.childFieldStrategy,childWidthMode:null!=(o=null==(l=t["x-component-props"])?void 0:l.childWidthMode)?o:e.childWidthMode,size:"small"}})}const K=t((()=>{const t=O(e.fieldItems);return Object.values(t).forEach(E),j(t)}));s(K,(()=>{return e=K.value,void Object.values(e.properties||{}).forEach((e=>{var t;M(l,F(e.name),null==(t=null==e?void 0:e["x-decorator-props"])?void 0:t.span)}));var e}),{immediate:!0});const P=m();function _(){return e.fieldItems.map((e=>P.value.query(e.val_key).take()))}a((()=>{var e;_().forEach((e=>{e&&e.setDisplay("none")})),e=K.value,Object.values(e.properties||{}).forEach((e=>{$(l,F(e.name))}))})),d((()=>{_().forEach((e=>{e&&e.setDisplay("visible")}))}));const k=c(v,["stop"]),C=["onClick","onKeydown","onKeyup","onKeypress"].reduce(((e,t)=>(e[t]=k,e)),{});return()=>{return r("section",n({class:"form-render__labelField",style:{"--column":(e=K.value,Object.values(e.properties||{}).reduce(((e,t)=>e+W(l,F(t.name))),0)),flex:"1"}},C),[r(f,{basePath:".",schema:K.value},null)]);var e}}});function P(e,l){u();const o=t((()=>e.options.some((e=>h(e.childrenFields)&&e.childrenFields.length))));function i(e,t,r="value"){return!y(t.childrenFields)&&(h(e)?e.includes(t[r]):e===t[r])}return{renderComplexOption:function({value:e,option:t,valueKey:l="value",labelKey:s="label",childFieldStrategy:a,childWidthMode:d,renderLabel:c=!0,attrs:u}){return[function(){const e=b(t,s);return c?t.desc?F(e,t):e:null}(),o.value&&("all"===a||i(e,t,l))?r(K,n({fieldItems:t.childrenFields,name:t[l],childFieldStrategy:a,childWidthMode:d},u),null):null]},valueRef:l,hasComplexOption:o}}function _(){return{getSpan:W,setSpan:M,deleteSpan:$,clearSpan:E}}export{P as useComplexOptions,_ as useComplexOptionsSpan};
|
@@ -1 +1 @@
|
|
1
|
-
import{arrayed as e,traverse as t}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import
|
1
|
+
import{arrayed as e,traverse as t}from"../../../../shared/utils/index.js";import"../../../../shared/utils/tapable/SyncHook.js";import"../../../../shared/utils/tapable/SyncBailHook.js";import a from"../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{format as l}from"date-fns";import{isString as o,isEmpty as r}from"lodash-es";import"../../index.js";import{FIELD_BUSINESS_TYPE as _}from"../constants/index.js";import{isNegative as i,isPositive as s,FieldListFilter as n,findItemByValCondition as p,parseEnhanceText as c}from"../utils/index.js";import{transformDateFormat as u}from"../utils/business.js";function d(){const d=new a(["fieldList","props"]),m=new a(["fieldItem","props"]);m.tap("__forceClearable",((e,t)=>(t.forceClearable&&(e.componentProps={...e.componentProps,clearable:!0}),e))),m.tap({name:"__fieldAlias",before:"__labelPlacementOverwrite"},(e=>("BOTTOM"===e.inputBorder&&(e.bordered="underline"),null!=e.title_h_layout&&(e.decoratorProps={...e.decoratorProps},i(e.title_h_layout)?e.decoratorProps.labelPlacement="top":s(e.title_h_layout)&&(e.decoratorProps.labelPlacement="left")),o(e.lineBarLayoutDirection)&&(e.linebarDirection=e.lineBarLayoutDirection.toLowerCase()),e))),m.tap("__labelPlacementOverwrite",((e,t)=>(t.labelPlacementOverwrite&&(e.decoratorProps={...e.decoratorProps,labelPlacement:void 0}),e))),m.tap("__time",(e=>("DATE"===e.html_type&&"time"===u(e.date_format)&&(e.html_type="TIME"),e))),m.tap("__block",(e=>(["CHECKBOX_BLOCK","RADIO_BLOCK"].includes(e.html_type)&&(e.__vertical=!0),e))),m.tap("__age",(t=>("AGE"===t.html_type&&(t.html_type="INPUT_NUMBER",t.reactions=t.reactions?e(t.reactions):[],t.reactions.push({target:t.val_key_unit,fulfill:{state:{disabled:"{{$self.disabled}}"}}}),t.suffixConfig=[{validate:{obj_type:_.AGE_UNIT},val_key:t.val_key_unit,html_type:"SELECT",option:t.option,urlConfig:t.urlConfig}]),t))),m.tap({name:"__multiple_select",before:"__defaultValue"},(e=>{const{html_type:t,multi_select:a,__multiple:l}=e;return e.__multiple="SEARCH"!==t&&("SEARCH_MORE"===t||("SELECT"===t?i(a):l)),e})),m.tap("__defaultValue",(e=>{switch(e.html_type){case"TIME":"current"===e.default_val&&(e.default_val=l(new Date,e.date_format||"HH:mm:ss"));break;case"DATE":"current"===e.default_val&&(e.default_val=l(new Date,e.date_format||"yyyy-MM-dd"));break;case"CHECKBOX":case"CHECKBOX_BLOCK":o(e.default_val)&&e.default_val&&(e.default_val=e.default_val.split(","));break;case"SELECT":case"SEARCH":case"SEARCH_MORE":o(e.default_val)&&e.default_val&&(e.default_val=e.__multiple?e.default_val.split(","):e.default_val)}return e}));const E=[[["SEARCH","PHONE_TYPE","IDCARD_TYPE","SEARCH_MORE"],"SELECT"],["DIGITAL","INPUT_NUMBER"],["CHECKBOX_BLOCK","CHECKBOX"],["RADIO_BLOCK","RADIO"],[["DATE-INPUT","DATETIME-INPUT"],"DATE"],["SWITCH_COMPONENT","SWITCH"],["SLIDER_COMPONENT","SLIDER"],["LEVEL_SEARCH_CASCADE","LEVEL_SEARCH_CASCADER"],["SEARCH_CASCADE","SEARCH_CASCADER"]];m.tap("__normalize",(e=>(E.some((([t,a])=>(Array.isArray(t)?t.includes(e.html_type):t===e.html_type)&&(e.html_type=a))),e)));const f=new Map([[["SELECT","SEARCH","SEARCH_MORE"],new Map([["H_TILE",e=>e.html_type=e.__multiple?"CHECKBOX":"RADIO"],["V_TILE",e=>{e.html_type=e.__multiple?"CHECKBOX":"RADIO",e.__vertical=!0}]])],["RADIO",new Map([["DROPDOWN",e=>e.html_type="SELECT"]])],["CHECKBOX",new Map([["DROPDOWN",e=>{e.__multiple=!0,e.html_type="SELECT"}]])]]);return m.tap({stage:9999,name:"__show_mode"},(t=>t.show_mode?([...f].some((([a,l])=>{if(!e(a).includes(t.html_type))return;const o=l.get(t.show_mode);return o&&o(t),!0})),t):t)),d.tap("__out_bordered",((e,{column:t,outBordered:a})=>e)),d.tap("__prefix/suffix",(e=>{const a=[];return t(e,(t=>{["prefix","suffix"].forEach((l=>{const r=t[l];if(!o(r))return;const _=r.match("#{(.+)}");if(!_)return;const i=o(_[1])&&p(e,(e=>e.val_key===_[1].trim()));i&&(Reflect.deleteProperty(t,l),t[`${l}Config`]=t[`${l}Config`]||[],t[`${l}Config`].push(i),a.push(i))}))}),["children","properties"]),a.length?n(e,(e=>a.includes(e))):e})),d.tap("__checkboxOrRadioEnhance",(e=>{const a=[];return t(e,(t=>{["CHECKBOX","RADIO","RADIO_BLOCK","CHECKBOX_BLOCK"].includes(t.html_type)&&!r(t.option)&&t.option.forEach((t=>{const l=c(t.text||"");t.__textEnhance=l,l.forEach((t=>{if("text"===t.type)return;const l=p(e,(e=>[e.name,e.val_key].includes(t.content)));l&&(a.push(l),t.content=l)}))}))})),n(e,(e=>a.includes(e)))})),d.tap("__textEnhance",(e=>{const a=[];return t(e,(t=>{if("TEXT"!==t.html_type||!o(t.default_val))return;const l=c(t.default_val);t.__textEnhance=l,l.forEach((l=>{if("text"===l.type)return;const o=p(e,(e=>[e.name,e.val_key].includes(l.content)));o&&(Reflect.deleteProperty(t,"default_val"),a.push(o),l.content=o)}))}),["children","properties"]),n(e,(e=>a.includes(e)))})),{FieldNormalizeWaterfallHook:m,FieldListNormalizeWaterfallHook:d}}export{d as useFieldNormalize};
|
@@ -1 +1 @@
|
|
1
|
-
import{arrayed as e}from"../../../../shared/utils/index.js";import{once as
|
1
|
+
import{arrayed as e}from"../../../../shared/utils/index.js";import{once as r,isNumber as a,isString as i}from"lodash-es";import"vue";import{registerValidateLocale as m,registerValidateRules as s}from"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import{isFunction as l}from"@vueuse/core";import"naive-ui";import"../components/renderer/text.js";import{isIdCard as n}from"../utils/business.js";function o(){const r=new Map([["mobile",({validate:e})=>({format:"phone",message:null==e?void 0:e.message})],["integer",({validate:e})=>({format:"integer",message:null==e?void 0:e.message})],["number",({validate:e})=>({format:"number",message:null==e?void 0:e.message})],["id_card",({validate:e})=>({validator(r){var a;if(null!=r&&""!==r)return i(r)&&n(r)?void 0:null!=(a=null==e?void 0:e.message)?a:"该字段不是合法的身份证格式"}})],["regular",({validate:e,regular_expression:r,regular_error_tip:a})=>({pattern:r||(null==e?void 0:e.regular_expression)||"",message:a||(null==e?void 0:e.regular_error_tip)||(null==e?void 0:e.message)||"格式错误"})]]),a={triggerType:"onBlur"};return{createValidatorSchema:function(i){const m=[],{validate:{vali_obj:s,max_length:n,min_length:o,message:t,max_value:u,min_value:g,decimal_length:d}={},validator:v}=i;if(v&&e(v).forEach((e=>{l(e)&&m.push({validator:(r,a,m)=>e(r,i,m)})})),n&&m.push({max:n,message:t}),o&&m.push({min:o,message:t}),u&&m.push({maximum:u,message:t}),g&&m.push({minimum:g,message:t}),null!=d&&m.push(((e,r)=>{const a=null!=r?r:`小数位数最多${e}位`;return{validator(r){var i;return(null==(i=String(r).split(".")[1])?void 0:i.length)>e?a:""}}})(+d,t)),s){const e=r.get(s)||(({validate:e})=>({format:s,message:null==e?void 0:e.message}));m.push(Object.assign({},a,e(i)))}return m}}}const t=r((()=>{m({"zh-CN":{required:"${alias||name}为必填"}}),s({maximum:(e,r)=>a(Number(r.maximum))&&null!=e&&""!==e&&"/"!==e?(i(e)&&(e=+e),!a(e)||isNaN(e)?"":e>Number(r.maximum)&&r.message||""):"",minimum:(e,r)=>a(Number(r.minimum))&&null!=e&&""!==e&&"/"!==e?(i(e)&&(e=+e),!a(e)||isNaN(e)?"":e<Number(r.minimum)&&r.message||""):""})}));export{o as useFormValidator,t as validateMessageLocale};
|
@@ -1 +1 @@
|
|
1
|
-
import{isString as i,isEmpty as e}from"lodash-es";import"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"naive-ui";import{isIdCard as r,isMobile as
|
1
|
+
import{isString as i,isEmpty as e}from"lodash-es";import"vue";import"../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"naive-ui";import"../components/renderer/text.js";import{isIdCard as r,isMobile as o}from"../utils/business.js";function s(){return{isIdCard:e=>i(e)&&r(e),isMobile:e=>i(e)&&o(e),isEmail:e=>i(e)&&/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(e),isNumber:e=>i(e)&&/\d+/.test(e),hasVisible(i){if(e(i))return!1;const r=i.slice(0,i.length/2),o=i.slice(i.length/2).map((i=>null==i?void 0:i[0]));return r.some(((i,e)=>(!i||"visible"===i)&&"LINE_BREAKS"!==o[e]))}}}export{s as usePresetScope};
|
@@ -1 +1 @@
|
|
1
|
-
import{inject as e,provide as t,computed as n,createVNode as r,Fragment as o}from"vue";import{widthAppend as i,traverse as u,arrayed as c}from"../../../../shared/utils/index.js";import{isGeneralField as s}from"@formily/core";import{Path as f}from"@formily/path";import{HelpCircleSharp as l}from"@vicons/ionicons5";import{isObject as a}from"@vue/shared";import{useMemoize as p}from"@vueuse/core";import{isString as d,isFunction as m,omit as h,castArray as E,flattenDeep as T}from"lodash-es";import{NTooltip as g,NIcon as x}from"naive-ui";import{NESTED_FORM_ITEM_TYPE as y}from"../constants/index.js";export{businessDateParser,isForeignerID,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./business.js";function
|
1
|
+
import{inject as e,provide as t,computed as n,createVNode as r,Fragment as o}from"vue";import{widthAppend as i,traverse as u,arrayed as c}from"../../../../shared/utils/index.js";import{isGeneralField as s}from"@formily/core";import{Path as f}from"@formily/path";import{HelpCircleSharp as l}from"@vicons/ionicons5";import{isObject as a}from"@vue/shared";import{useMemoize as p}from"@vueuse/core";import{isString as d,isFunction as m,omit as h,castArray as E,flattenDeep as T}from"lodash-es";import{NTooltip as g,NIcon as x}from"naive-ui";import{NESTED_FORM_ITEM_TYPE as y}from"../constants/index.js";import{TEXT as v}from"../components/renderer/text.js";export{businessDateParser,isForeignerID,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./business.js";function I(e){console.warn(`[FormRender]: ${e}`)}function R(e){return"1"===e||!0===e||1===e}function D(e){return"0"===e||!1===e||0===e}function A(e,t,n=["children","properties","suffixConfig"],r="val_key",o="default_val"){return function e(t,r){r.forEach((r=>{a(r)&&(null!=u(r)&&null==t[i(r)]&&f.setIn(t,i(r),u(r)),n.forEach((n=>{r[n]&&(t[i(r)]||(t[i(r)]={}),e(t[i(r)],c(r[n])))})))}))}(e,t),e;function i(e){return e[r]}function u(e){return e[o]}}function W(n,r){let o=e(n,null);return o||(o=r(),t(n,o)),o}function P(e){return e&&d(e)?+e:e}function _(e,t,n){if(a(e)&&!m(e)){const n={};return Object.entries(e).forEach((([e,r])=>{m(r)&&(n[e]=()=>r(t))})),n}return{default:()=>m(e)?e(t):n?n(e):[e]}}function G(e,t){return n((()=>{const n={};return e.prefix&&(n.prefix=()=>r(o,null,[_(e.prefix,e,t).default()])),e.suffix&&(n.suffix=()=>r(o,null,[_(e.suffix,e,t).default()])),n}))}function S(e,t){return d(e)&&e?e.replace(/\$\{([^}]*)}/g,(function(e,n){const r=n.split("||");for(const e of r){const n=t[e.trim()];if(n)return n}return""})):""}function j(e){return e.reduce(((e,t)=>(d(t.extendKey)&&t.extendKey&&e.push(t),B(t)&&e.push(...j(t.children||[])),e)),[])}function w(e,t){const n=j(e);if(!n.length)return t;const r={},o=new Map;return Object.entries(t).forEach((([e,i])=>{const u=n.find((t=>t.val_key===e));if(!u)return r[e]=i;const{val_key:c,extendKey:s}=u,l=o.get(s)||{};o.set(s,l);const a=f.getIn(t,e);null!=a&&f.setIn(l,c,a)})),[...o.entries()].forEach((([e,t])=>{r[e]=JSON.stringify(t)})),r}function $(e,t){const n=j(e);if(!n.length)return t;const r=p((e=>{try{return a(t[e])?t[e]:JSON.parse(t[e])||{}}catch(e){return{}}})),o=h(t,n.map((e=>e.extendKey)));return n.forEach((({val_key:e,extendKey:t})=>{Reflect.has(o,e)||(o[e]=r(t)[e])})),o}function b(e){return e&&y.includes(e)}function B(e){return b(s(e)?e.componentType:e.html_type)}function K(e,t){var n;const o=null!=(n=e.title)?n:e[t];return r("span",{title:o,style:{display:"inline-flex",flexDirection:"column",alignItems:"center","justify-content":"center"}},[e.imageBase64?r("img",{src:e.imageBase64,style:{width:i(e.imageWidth||80),height:i(e.imageHeight||80),marginBottom:"4px"}},null):null,r(v,{content:e[t],fieldItem:e},null)])}function X(e,t){return r("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[e,t.desc?r(g,null,{trigger:()=>r(x,{component:l},null),default:()=>t.desc}):null])}function k(e,t){return f.parse(e.startsWith(".")?e:`.${e}`,t).toString()}function C(e){return e.replace(/</g,"<").replace(/>/g,">")}function F(e,t){return e.reduce(((e,n)=>(t(n)||(e.push(n),n.properties&&(n.properties=F(n.properties,t)),n.children&&(n.children=F(n.children,t))),e)),[])}function O(e,t){let n=null;return u(e,((e,r)=>{t(e)&&(n=e,r())}),["children","properties"]),n}var N=function(e){return e[e.PREPARE=0]="PREPARE",e[e.TEXT=1]="TEXT",e[e.WIDGET_START=2]="WIDGET_START",e[e.WIDGET=3]="WIDGET",e}(N||{});function J(e){const t=[...e],n=[];let r=N.PREPARE,o="";function i(e){switch(r=e,r){case N.PREPARE:case N.WIDGET_START:case N.WIDGET:o=""}}function u(e="text",t=o){n.push({type:e,content:t})}function c(){const e=n.pop();e&&("text"===e.type?o=e.content:n.push(e))}return t.forEach(((e,n)=>{const s=n===t.length-1;switch(r){case N.PREPARE:return"#"===e?(i(N.WIDGET_START),void(s&&u())):(i(N.TEXT),o=e,void(s&&u()));case N.TEXT:return"#"===e?void(s?(o+=e,u()):(u(),i(N.WIDGET_START))):(o+=e,void(s&&u()));case N.WIDGET_START:return"{"!==e||s?(c(),i(N.TEXT),o+=`#${e}`,void(s&&u())):void i(N.WIDGET);case N.WIDGET:return"}"===e?(u("widget"),void i(N.PREPARE)):"#"===e?(c(),u(),i(N.WIDGET_START),o+=`#${e}`,void(s&&u())):(o+=e,void(s&&u("text",`#{${o}`)))}})),n}function M(e,t){let n=E(e);return t.forEach((({from:e,to:t})=>{n.forEach(((r,o)=>{d(r)&&(n[o]=r.split(e).map(((e,n,r)=>[e,n<r.length-1?t:null])))})),n=T(n)})),n}function H(e){return"Enter"===e.code||"NumpadEnter"===e.code}export{F as FieldListFilter,w as combineExtendKey,G as createInputSlot,_ as createSlot,C as editorUnescape,O as findItemByValCondition,I as formRenderLog,k as getAbsoluteKey,W as injectOrProvide,H as isEnter,D as isNegative,B as isNestedFieldType,b as isNestedType,R as isPositive,A as mergeDeepProperties,J as parseEnhanceText,P as parseNumberFromMaybeString,X as renderDescOption,K as renderOptionLabel,M as replace2Any,$ as splitExtendKey,S as validateMessageParser};
|
@@ -20,7 +20,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
20
20
|
type: BooleanConstructor;
|
21
21
|
default: boolean;
|
22
22
|
};
|
23
|
-
|
23
|
+
defaultSessionId: {
|
24
24
|
type: StringConstructor;
|
25
25
|
};
|
26
26
|
show: {
|
@@ -53,7 +53,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
53
53
|
type: BooleanConstructor;
|
54
54
|
default: boolean;
|
55
55
|
};
|
56
|
-
|
56
|
+
defaultSessionId: {
|
57
57
|
type: StringConstructor;
|
58
58
|
};
|
59
59
|
show: {
|
@@ -109,7 +109,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
109
109
|
remark: string;
|
110
110
|
content: import("../../shared/types").AnyObject;
|
111
111
|
}) => Promise<void>;
|
112
|
-
openSession: (
|
112
|
+
openSession: (session: string | import("../../shared/types").AnyObject) => Promise<void>;
|
113
113
|
closeSession: () => import("../../shared/types").AnyObject | null;
|
114
114
|
getCurrentSession: () => import("../../shared/types").AnyObject | null;
|
115
115
|
setCurrentSessionItem: (item: import("../../shared/types").AnyObject) => void;
|
@@ -137,7 +137,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
137
137
|
currentGroupUser: import("../../shared/types").AnyObject[];
|
138
138
|
showMultipleVideo: boolean;
|
139
139
|
};
|
140
|
-
openSession: (
|
140
|
+
openSession: (session: string | import("../../shared/types").AnyObject) => Promise<void>;
|
141
141
|
closeSession: () => import("../../shared/types").AnyObject | null;
|
142
142
|
getCurrentSession: () => import("../../shared/types").AnyObject | null;
|
143
143
|
isEnded: import("vue").ComputedRef<boolean>;
|
@@ -185,7 +185,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
185
185
|
showMultipleVideo: boolean;
|
186
186
|
};
|
187
187
|
unreadTotal: import("vue").ComputedRef<number>;
|
188
|
-
openSession: (
|
188
|
+
openSession: (session: string | import("../../shared/types").AnyObject) => Promise<void>;
|
189
189
|
setUpdateSessionItem: (item: import("../../shared/types").AnyObject) => void;
|
190
190
|
setCurrentSessionItem: (item: import("../../shared/types").AnyObject) => void;
|
191
191
|
currentWidth: import("vue").ComputedRef<number>;
|
@@ -333,7 +333,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
333
333
|
currentGroupUser: import("../../shared/types").AnyObject[];
|
334
334
|
showMultipleVideo: boolean;
|
335
335
|
};
|
336
|
-
openSession: (
|
336
|
+
openSession: (session: string | import("../../shared/types").AnyObject) => Promise<void>;
|
337
337
|
showUserDetail: import("vue").Ref<boolean>;
|
338
338
|
showLargeAvatar: import("vue").Ref<boolean>;
|
339
339
|
showPhone: import("vue").Ref<boolean>;
|
@@ -473,7 +473,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
473
473
|
currentGroupUser: import("../../shared/types").AnyObject[];
|
474
474
|
showMultipleVideo: boolean;
|
475
475
|
};
|
476
|
-
openSession: (
|
476
|
+
openSession: (session: string | import("../../shared/types").AnyObject) => Promise<void>;
|
477
477
|
showUserDetail: import("vue").Ref<boolean>;
|
478
478
|
showLargeAvatar: import("vue").Ref<boolean>;
|
479
479
|
showPhone: import("vue").Ref<boolean>;
|
@@ -1341,7 +1341,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
1341
1341
|
currentGroupUser: import("../../shared/types").AnyObject[];
|
1342
1342
|
showMultipleVideo: boolean;
|
1343
1343
|
};
|
1344
|
-
openSession: (
|
1344
|
+
openSession: (session: string | import("../../shared/types").AnyObject) => Promise<void>;
|
1345
1345
|
showUserDetail: import("vue").Ref<boolean>;
|
1346
1346
|
showLargeAvatar: import("vue").Ref<boolean>;
|
1347
1347
|
showPhone: import("vue").Ref<boolean>;
|
@@ -1888,7 +1888,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
1888
1888
|
currentGroupUser: import("../../shared/types").AnyObject[];
|
1889
1889
|
showMultipleVideo: boolean;
|
1890
1890
|
};
|
1891
|
-
openSession: (
|
1891
|
+
openSession: (session: string | import("../../shared/types").AnyObject) => Promise<void>;
|
1892
1892
|
userList: import("vue").Ref<import("../../shared/types").AnyObject[]>;
|
1893
1893
|
handleInput: () => void;
|
1894
1894
|
currentTabValue: import("vue").Ref<string>;
|
@@ -2442,7 +2442,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
2442
2442
|
type: BooleanConstructor;
|
2443
2443
|
default: boolean;
|
2444
2444
|
};
|
2445
|
-
|
2445
|
+
defaultSessionId: {
|
2446
2446
|
type: StringConstructor;
|
2447
2447
|
};
|
2448
2448
|
show: {
|
@@ -21,7 +21,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
21
21
|
type: BooleanConstructor;
|
22
22
|
default: boolean;
|
23
23
|
};
|
24
|
-
|
24
|
+
defaultSessionId: {
|
25
25
|
type: StringConstructor;
|
26
26
|
};
|
27
27
|
show: {
|
@@ -54,7 +54,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
54
54
|
type: BooleanConstructor;
|
55
55
|
default: boolean;
|
56
56
|
};
|
57
|
-
|
57
|
+
defaultSessionId: {
|
58
58
|
type: StringConstructor;
|
59
59
|
};
|
60
60
|
show: {
|
@@ -110,7 +110,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
110
110
|
remark: string;
|
111
111
|
content: AnyObject;
|
112
112
|
}) => Promise<void>;
|
113
|
-
openSession: (
|
113
|
+
openSession: (session: string | AnyObject) => Promise<void>;
|
114
114
|
closeSession: () => AnyObject | null;
|
115
115
|
getCurrentSession: () => AnyObject | null;
|
116
116
|
setCurrentSessionItem: (item: AnyObject) => void;
|
@@ -138,7 +138,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
138
138
|
currentGroupUser: AnyObject[];
|
139
139
|
showMultipleVideo: boolean;
|
140
140
|
};
|
141
|
-
openSession: (
|
141
|
+
openSession: (session: string | AnyObject) => Promise<void>;
|
142
142
|
closeSession: () => AnyObject | null;
|
143
143
|
getCurrentSession: () => AnyObject | null;
|
144
144
|
isEnded: import("vue").ComputedRef<boolean>;
|
@@ -186,7 +186,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
186
186
|
showMultipleVideo: boolean;
|
187
187
|
};
|
188
188
|
unreadTotal: import("vue").ComputedRef<number>;
|
189
|
-
openSession: (
|
189
|
+
openSession: (session: string | AnyObject) => Promise<void>;
|
190
190
|
setUpdateSessionItem: (item: AnyObject) => void;
|
191
191
|
setCurrentSessionItem: (item: AnyObject) => void;
|
192
192
|
currentWidth: import("vue").ComputedRef<number>;
|
@@ -334,7 +334,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
334
334
|
currentGroupUser: AnyObject[];
|
335
335
|
showMultipleVideo: boolean;
|
336
336
|
};
|
337
|
-
openSession: (
|
337
|
+
openSession: (session: string | AnyObject) => Promise<void>;
|
338
338
|
showUserDetail: import("vue").Ref<boolean>;
|
339
339
|
showLargeAvatar: import("vue").Ref<boolean>;
|
340
340
|
showPhone: import("vue").Ref<boolean>;
|
@@ -474,7 +474,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
474
474
|
currentGroupUser: AnyObject[];
|
475
475
|
showMultipleVideo: boolean;
|
476
476
|
};
|
477
|
-
openSession: (
|
477
|
+
openSession: (session: string | AnyObject) => Promise<void>;
|
478
478
|
showUserDetail: import("vue").Ref<boolean>;
|
479
479
|
showLargeAvatar: import("vue").Ref<boolean>;
|
480
480
|
showPhone: import("vue").Ref<boolean>;
|
@@ -1342,7 +1342,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1342
1342
|
currentGroupUser: AnyObject[];
|
1343
1343
|
showMultipleVideo: boolean;
|
1344
1344
|
};
|
1345
|
-
openSession: (
|
1345
|
+
openSession: (session: string | AnyObject) => Promise<void>;
|
1346
1346
|
showUserDetail: import("vue").Ref<boolean>;
|
1347
1347
|
showLargeAvatar: import("vue").Ref<boolean>;
|
1348
1348
|
showPhone: import("vue").Ref<boolean>;
|
@@ -1889,7 +1889,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1889
1889
|
currentGroupUser: AnyObject[];
|
1890
1890
|
showMultipleVideo: boolean;
|
1891
1891
|
};
|
1892
|
-
openSession: (
|
1892
|
+
openSession: (session: string | AnyObject) => Promise<void>;
|
1893
1893
|
userList: import("vue").Ref<AnyObject[]>;
|
1894
1894
|
handleInput: () => void;
|
1895
1895
|
currentTabValue: import("vue").Ref<string>;
|
@@ -2443,7 +2443,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
2443
2443
|
type: BooleanConstructor;
|
2444
2444
|
default: boolean;
|
2445
2445
|
};
|
2446
|
-
|
2446
|
+
defaultSessionId: {
|
2447
2447
|
type: StringConstructor;
|
2448
2448
|
};
|
2449
2449
|
show: {
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,provide as o,openBlock as s,createElementBlock as r,normalizeStyle as a,unref as n,createVNode as i,withCtx as u,createBlock as l,Fragment as d,createElementVNode as m,renderSlot as p,createCommentVNode as c}from"vue";import{NConfigProvider as f,NSpin as h,NLayout as v,NLayoutContent as y}from"naive-ui";import S from"./components/SiderList.vue.js";import g from"./components/ChatHeader.vue.js";import k from"./components/ChatMain.vue.js";import j from"./components/ChatFooter.vue.js";import _ from"./components/ChatSearch.vue.js";import b from"./components/ChatAdd.vue.js";import w from"./components/Video.vue.js";import C from"./components/MultipleVideo.vue.js";import{instanceAxios as x}from"./api/index.js";import{isNumber as I}from"lodash-es";import{initData as L,InjectionIChatData as V}from"./hooks/useData.js";import{useWebSocket as H}from"./hooks/useWebSocket.js";import"trtc-sdk-v5";import"./utils/index.js";const U={key:0,class:"iho-chat__header"},$={class:"toolbar"};var q=e({__name:"Index",props:{token:{type:String,required:!0},orgId:{type:[String,Number],required:!0},userId:{type:String,required:!0},baseURL:{type:String,default:"/fdp-chat"},showHeader:{type:Boolean,default:!0},
|
1
|
+
import{defineComponent as e,ref as t,provide as o,openBlock as s,createElementBlock as r,normalizeStyle as a,unref as n,createVNode as i,withCtx as u,createBlock as l,Fragment as d,createElementVNode as m,renderSlot as p,createCommentVNode as c}from"vue";import{NConfigProvider as f,NSpin as h,NLayout as v,NLayoutContent as y}from"naive-ui";import S from"./components/SiderList.vue.js";import g from"./components/ChatHeader.vue.js";import k from"./components/ChatMain.vue.js";import j from"./components/ChatFooter.vue.js";import _ from"./components/ChatSearch.vue.js";import b from"./components/ChatAdd.vue.js";import w from"./components/Video.vue.js";import C from"./components/MultipleVideo.vue.js";import{instanceAxios as x}from"./api/index.js";import{isNumber as I}from"lodash-es";import{initData as L,InjectionIChatData as V}from"./hooks/useData.js";import{useWebSocket as H}from"./hooks/useWebSocket.js";import"trtc-sdk-v5";import"./utils/index.js";const U={key:0,class:"iho-chat__header"},$={class:"toolbar"};var q=e({__name:"Index",props:{token:{type:String,required:!0},orgId:{type:[String,Number],required:!0},userId:{type:String,required:!0},baseURL:{type:String,default:"/fdp-chat"},showHeader:{type:Boolean,default:!0},defaultSessionId:{type:String},show:{type:Boolean,default:!0},extraParams:{type:Object,default:()=>({})}},emits:["template-click","unread-message-update","session-change","session-close"],setup(e,{expose:q,emit:B}){const M=e;x.defaults.baseURL=M.baseURL,x.defaults.headers.Authorization="bearer "+M.token;const N=t(!1),R=L(M,B);o(V,R),H(M,R);const{cssVars:A,state:D,openSession:F,closeSession:z,getCurrentSession:E,isEnded:O}=R;return q({getUnreadData:function(){return D.sessionList.filter((e=>I(e.unreadNum)&&e.unreadNum>0))},openSession:F,closeSession:z,getCurrentSession:E}),(t,o)=>e.show?(s(),r("div",{key:0,class:"iho-chat",style:a(n(A))},[i(n(f),{abstract:"",namespace:"iho-chat__popover"},{default:u((()=>{var o;return[N.value?(s(),l(n(h),{key:0,stroke:"#5585f5"})):(s(),r(d,{key:1},[e.showHeader?(s(),r("div",U,[i(_),i(b,{title:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.31"))||"发起群聊",mode:"create","default-value":[n(D).userInfo]},null,8,["default-value"]),m("div",$,[p(t.$slots,"toolbar")])])):c("v-if",!0),i(n(v),{class:"iho-chat__body","has-sider":""},{default:u((()=>[i(S),i(n(y),{class:"chat-content",style:a({"--c-pointer-events":n(O)?"none":"unset","--c-cursor":n(O)?"not-allowed":"unset"})},{default:u((()=>[i(g,null,{header:u((()=>[p(t.$slots,"chatHeader",{session:n(D).currentSessionItem})])),_:3}),i(k),i(j,null,{footer:u((()=>[p(t.$slots,"chatFooter",{session:n(D).currentSessionItem})])),_:3})])),_:3},8,["style"]),p(t.$slots,"external")])),_:3}),n(D).showVideo?(s(),l(w,{key:1})):c("v-if",!0),n(D).showMultipleVideo?(s(),l(C,{key:2})):c("v-if",!0)],64))]})),_:3})],4)):c("v-if",!0)}});export{q as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{createElementVNode as e,defineComponent as a,ref as l,computed as o,watch as t,openBlock as i,createElementBlock as n,Fragment as u,createVNode as d,unref as r,withCtx as s,createCommentVNode as v,isRef as c,renderList as p,createBlock as m,toDisplayString as f,createTextVNode as g,normalizeClass as w,renderSlot as h}from"vue";import{NModal as b,NInput as y,NIcon as k,NCheckbox as I,NCheckboxGroup as C,NSpace as _,NAvatar as x,NTag as L,NTooltip as S,NButton as j}from"naive-ui";import{SearchOutline as B,AddOutline as U}from"@vicons/ionicons5";import{useData as R}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{CHAT_TYPE as V}from"../constants/index.js";import{groupLeaveApi as A,groupJoinApi as E,groupCreateApi as G}from"../api/index.js";import{listSort as N}from"../utils/index.js";import{union as $,intersection as z,unionBy as D,remove as M,isArray as T,uniqBy as P,cloneDeep as q,trim as F}from"lodash-es";import"trtc-sdk-v5";import{useSearchUserList as H}from"../hooks/useSearchUserList.js";var J,K;const O={class:"iho-chat-dialog__content iho-chat-add-wrapper"},Q={key:0,class:"input-box"},W=e("span",null,(null==(J=window.getLanguageByCode)?void 0:J.call(window,"10010.1.34"))||"群名称:",-1),X={class:"transfer-box"},Y={class:"transfer-box__left"},Z={class:"user-list-box"},ee={key:1,class:"no-data"},ae={class:"transfer-box__right"},le={class:"checked-tag-box"},oe={key:0,class:"input-wrapper"};var te=a({__name:"ChatAdd",props:{title:{type:String,default:(null==(K=window.getLanguageByCode)?void 0:K.call(window,"10010.1.42"))||"添加新成员"},mode:{type:String,default:"select"},options:{type:Array},disabledIds:{type:Array,default:()=>[]},defaultValue:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}},emits:["comfirm"],setup(a,{emit:J}){const K=a,{state:te,setCurrentSessionItem:ie}=R(),ne=l(),ue=l(""),de=l(!1),re=l([]),se=l([]),ve=l(""),ce=l([]),pe=l(""),{userList:me,handleInput:fe}=H({wrapperRef:ne,keywordRef:ue,before:()=>{me.value=q(se.value),Ie()},after:()=>{ge.value.length&&me.value.forEach((e=>{var a;e.disabled=null==(a=ge.value)?void 0:a.includes(e.id)})),Ie()}}),ge=o((()=>"relay"===K.mode?[]:$(K.disabledIds,[te.userInfo.id]))),we=o((()=>{var e,a;if(!(null==(e=te.sessionList)?void 0:e.length))return[];const l=N(te.sessionList);return null==(a="relay"===K.mode?l:l.filter((e=>e.chatType===V.SINGLE)))?void 0:a.map((e=>({id:e.receiver,name:e.name,avatar:e.avatar})))})),he=o((()=>re.value.length?re.value.map((e=>e.id)):[])),be=o((()=>"create"===K.mode?he.value.length<3:he.value.length<1)),ye=o({get:()=>ce.value.filter((e=>!ge.value.includes(e))).length===me.value.filter((e=>!e.disabled)).length,set(e){const a=K.defaultValue.map((e=>e.id)),l=z(a,ge.value,me.value.map((e=>e.id))),o=me.value.filter((e=>!e.disabled));ce.value=l.concat(e?o.map((e=>e.id)):[]),e?re.value=D(re.value,o,"id"):M(re.value,(e=>o.map((e=>e.id)).includes(e.id)))}});async function ke(){switch(K.mode){case"create":await G({creator:te.userInfo.id,memberIdSet:he.value,name:F(ve.value),orgId:te.orgId});break;case"join":if(await E({groupId:te.currentSessionItem.receiver,operator:te.userInfo.id,memberIdSet:he.value}),!te.currentSessionItem.defaultName){const e=re.value.map((e=>e.name)).join(",");ie({name:`${te.currentSessionItem.name},${e}`})}te.currentGroupUser.push(...me.value.filter((e=>he.value.includes(e.id))));break;case"remove":if(await A({dissolution:!1,groupId:te.currentSessionItem.receiver,operator:te.userInfo.id,memberIdSet:he.value}),!te.currentSessionItem.defaultName){const e=re.value.map((e=>e.name)).join(","),a=new RegExp(e,"g");ie({name:te.currentSessionItem.name.replace(a,"")})}M(te.currentGroupUser,(e=>he.value.includes(e.id)));break;default:J("comfirm",he.value,pe.value)}de.value=!1}function Ie(){var e,a;ce.value=null!=(a=null==(e=me.value.filter((e=>he.value.includes(e.id))))?void 0:e.map((e=>e.id)))?a:[]}function Ce(e,a){if("check"===a.actionType){const e=me.value.find((e=>e.id===a.value));re.value.push(e)}else M(re.value,(e=>e.id===a.value))}return t((()=>de.value),(e=>{if(!e)return;ue.value="",ve.value="";const a=T(K.options)&&K.options.length?K.options:we.value;se.value=P(a,"id").map((e=>{var a;return{...e,disabled:null==(a=ge.value)?void 0:a.includes(e.id)}})),me.value=q(se.value),T(K.defaultValue)&&K.defaultValue.length?(re.value=q(K.defaultValue),Ie()):(re.value=[],ce.value=[])})),(l,o)=>{var t,R;return i(),n(u,null,[d(r(b),{preset:"dialog",title:a.title,"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog",show:de.value,"onUpdate:show":o[5]||(o[5]=e=>de.value=e),"negative-text":(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.
|
1
|
+
import{createElementVNode as e,defineComponent as a,ref as l,computed as o,watch as t,openBlock as i,createElementBlock as n,Fragment as u,createVNode as d,unref as r,withCtx as s,createCommentVNode as v,isRef as c,renderList as p,createBlock as m,toDisplayString as f,createTextVNode as g,normalizeClass as w,renderSlot as h}from"vue";import{NModal as b,NInput as y,NIcon as k,NCheckbox as I,NCheckboxGroup as C,NSpace as _,NAvatar as x,NTag as L,NTooltip as S,NButton as j}from"naive-ui";import{SearchOutline as B,AddOutline as U}from"@vicons/ionicons5";import{useData as R}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{CHAT_TYPE as V}from"../constants/index.js";import{groupLeaveApi as A,groupJoinApi as E,groupCreateApi as G}from"../api/index.js";import{listSort as N}from"../utils/index.js";import{union as $,intersection as z,unionBy as D,remove as M,isArray as T,uniqBy as P,cloneDeep as q,trim as F}from"lodash-es";import"trtc-sdk-v5";import{useSearchUserList as H}from"../hooks/useSearchUserList.js";var J,K;const O={class:"iho-chat-dialog__content iho-chat-add-wrapper"},Q={key:0,class:"input-box"},W=e("span",null,(null==(J=window.getLanguageByCode)?void 0:J.call(window,"10010.1.34"))||"群名称:",-1),X={class:"transfer-box"},Y={class:"transfer-box__left"},Z={class:"user-list-box"},ee={key:1,class:"no-data"},ae={class:"transfer-box__right"},le={class:"checked-tag-box"},oe={key:0,class:"input-wrapper"};var te=a({__name:"ChatAdd",props:{title:{type:String,default:(null==(K=window.getLanguageByCode)?void 0:K.call(window,"10010.1.42"))||"添加新成员"},mode:{type:String,default:"select"},options:{type:Array},disabledIds:{type:Array,default:()=>[]},defaultValue:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}},emits:["comfirm"],setup(a,{emit:J}){const K=a,{state:te,setCurrentSessionItem:ie}=R(),ne=l(),ue=l(""),de=l(!1),re=l([]),se=l([]),ve=l(""),ce=l([]),pe=l(""),{userList:me,handleInput:fe}=H({wrapperRef:ne,keywordRef:ue,before:()=>{me.value=q(se.value),Ie()},after:()=>{ge.value.length&&me.value.forEach((e=>{var a;e.disabled=null==(a=ge.value)?void 0:a.includes(e.id)})),Ie()}}),ge=o((()=>"relay"===K.mode?[]:$(K.disabledIds,[te.userInfo.id]))),we=o((()=>{var e,a;if(!(null==(e=te.sessionList)?void 0:e.length))return[];const l=N(te.sessionList);return null==(a="relay"===K.mode?l:l.filter((e=>e.chatType===V.SINGLE)))?void 0:a.map((e=>({id:e.receiver,name:e.name,avatar:e.avatar})))})),he=o((()=>re.value.length?re.value.map((e=>e.id)):[])),be=o((()=>"create"===K.mode?he.value.length<3:he.value.length<1)),ye=o({get:()=>ce.value.filter((e=>!ge.value.includes(e))).length===me.value.filter((e=>!e.disabled)).length,set(e){const a=K.defaultValue.map((e=>e.id)),l=z(a,ge.value,me.value.map((e=>e.id))),o=me.value.filter((e=>!e.disabled));ce.value=l.concat(e?o.map((e=>e.id)):[]),e?re.value=D(re.value,o,"id"):M(re.value,(e=>o.map((e=>e.id)).includes(e.id)))}});async function ke(){switch(K.mode){case"create":await G({creator:te.userInfo.id,memberIdSet:he.value,name:F(ve.value),orgId:te.orgId});break;case"join":if(await E({groupId:te.currentSessionItem.receiver,operator:te.userInfo.id,memberIdSet:he.value}),!te.currentSessionItem.defaultName){const e=re.value.map((e=>e.name)).join(",");ie({name:`${te.currentSessionItem.name},${e}`})}te.currentGroupUser.push(...me.value.filter((e=>he.value.includes(e.id))));break;case"remove":if(await A({dissolution:!1,groupId:te.currentSessionItem.receiver,operator:te.userInfo.id,memberIdSet:he.value}),!te.currentSessionItem.defaultName){const e=re.value.map((e=>e.name)).join(","),a=new RegExp(e,"g");ie({name:te.currentSessionItem.name.replace(a,"")})}M(te.currentGroupUser,(e=>he.value.includes(e.id)));break;default:J("comfirm",he.value,pe.value)}de.value=!1}function Ie(){var e,a;ce.value=null!=(a=null==(e=me.value.filter((e=>he.value.includes(e.id))))?void 0:e.map((e=>e.id)))?a:[]}function Ce(e,a){if("check"===a.actionType){const e=me.value.find((e=>e.id===a.value));re.value.push(e)}else M(re.value,(e=>e.id===a.value))}return t((()=>de.value),(e=>{if(!e)return;ue.value="",ve.value="";const a=T(K.options)&&K.options.length?K.options:we.value;se.value=P(a,"id").map((e=>{var a;return{...e,disabled:null==(a=ge.value)?void 0:a.includes(e.id)}})),me.value=q(se.value),T(K.defaultValue)&&K.defaultValue.length?(re.value=q(K.defaultValue),Ie()):(re.value=[],ce.value=[])})),(l,o)=>{var t,R;return i(),n(u,null,[d(r(b),{preset:"dialog",title:a.title,"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog",show:de.value,"onUpdate:show":o[5]||(o[5]=e=>de.value=e),"negative-text":(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.28"))||"取消","positive-text":(null==(R=window.getLanguageByCode)?void 0:R.call(window,"10010.1.27"))||"确定","display-directive":"show","positive-button-props":{disabled:r(be)},onPositiveClick:ke},{default:s((()=>{var l,t,w,h,b,S,j;return[e("div",O,["create"===a.mode?(i(),n("div",Q,[W,d(r(y),{clearable:"",placeholder:(null==(l=window.getLanguageByCode)?void 0:l.call(window,"10010.1.35"))||"取个群名称方便后续搜索",value:ve.value,"onUpdate:value":o[0]||(o[0]=e=>ve.value=e),valueModifiers:{trim:!0}},null,8,["value"])])):v("v-if",!0),e("div",X,[e("div",Y,[d(r(y),{placeholder:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.36"))||"搜索",clearable:"",value:ue.value,"onUpdate:value":[o[1]||(o[1]=e=>ue.value=e),r(fe)],valueModifiers:{trim:!0}},{prefix:s((()=>[d(r(k),{component:r(B)},null,8,["component"])])),_:1},8,["value","onUpdate:value"]),e("div",Z,[r(me).length>0?(i(),n(u,{key:0},[d(r(I),{label:(null==(w=window.getLanguageByCode)?void 0:w.call(window,"10010.1.37"))||"全选",checked:r(ye),"onUpdate:checked":o[2]||(o[2]=e=>c(ye)?ye.value=e:null)},null,8,["checked"]),d(r(C),{ref_key:"listRef",ref:ne,value:ce.value,"onUpdate:value":[o[3]||(o[3]=e=>ce.value=e),Ce]},{default:s((()=>[(i(!0),n(u,null,p(r(me),(a=>(i(),m(r(I),{key:a.id,value:a.id,disabled:a.disabled},{default:s((()=>[d(r(_),{align:"center","wrap-item":!1},{default:s((()=>[d(r(x),{src:a.avatar,round:"",size:32},null,8,["src"]),e("span",null,f(a.name),1)])),_:2},1024)])),_:2},1032,["value","disabled"])))),128))])),_:1},8,["value"])],64)):(i(),n("div",ee,(null==(h=window.getLanguageByCode)?void 0:h.call(window,"10010.1.38"))||"找不到相关结果"))])]),e("div",ae,[e("span",null,((null==(b=window.getLanguageByCode)?void 0:b.call(window,"10010.1.39"))||"已选择")+f(r(he).length)+((null==(S=window.getLanguageByCode)?void 0:S.call(window,"10010.1.40"))||"人"),1),e("div",le,[(i(!0),n(u,null,p(re.value,(e=>(i(),m(r(L),{key:e.id,bordered:!1,closable:"relay"===a.mode||e.id!==r(te).userInfo.id,disabled:r(ge).includes(e.id),onClose:()=>{return a=e.id,M(re.value,(e=>e.id===a)),void M(ce.value,(e=>e===a));var a}},{avatar:s((()=>[d(r(x),{round:"",src:e.avatar},null,8,["src"])])),default:s((()=>[g(" "+f(e.name),1)])),_:2},1032,["closable","disabled","onClose"])))),128))]),"relay"===a.mode?(i(),n("div",oe,[d(r(y),{clearable:"",value:pe.value,"onUpdate:value":o[4]||(o[4]=e=>pe.value=e),type:"textarea",placeholder:(null==(j=window.getLanguageByCode)?void 0:j.call(window,"10010.1.41"))||"留言",autosize:{minRows:2,maxRows:2}},null,8,["value"])])):v("v-if",!0)])])])]})),_:1},8,["title","show","positive-button-props"]),e("span",{class:w(["btn-wrapper",{disabled:a.disabled}]),onClick:o[6]||(o[6]=e=>de.value=!0)},[h(l.$slots,"trigger",{},(()=>[d(r(S),{"show-arrow":!1,placement:"bottom"},{trigger:s((()=>[d(r(j),{color:"#ffffff4D",class:"add-btn"},{icon:s((()=>[d(r(k),{component:r(U),color:"#fff"},null,8,["component"])])),_:1})])),default:s((()=>[g(" "+f(a.title),1)])),_:1})]))],2)],64)}}});export{te as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,computed as o,watch as a,openBlock as n,createBlock as i,unref as r,withCtx as s,withDirectives as l,createElementVNode as d,createVNode as c,createElementBlock as m,Fragment as u,renderList as p,toDisplayString as g,vShow as v,normalizeStyle as w,createTextVNode as y}from"vue";import{NModal as f,NImageGroup as h,NImage as k,NInput as C,NIcon as M,NTooltip as b}from"naive-ui";import{SearchOutline as _,OpenOutline as j,DownloadOutline as I}from"@vicons/ionicons5";import{searchChatRecordApi as L}from"../api/index.js";import"../../../../shared/utils/index.js";import{useDebounceFn as T}from"@vueuse/core";import{format as x,isSameWeek as S,isSameMonth as A}from"date-fns";import{last as B}from"lodash-es";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as D}from"../../../../shared/hooks/useScrollLoading.js";import{useData as H}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{getFileSize as z,downloadFile as U}from"../utils/index.js";import"trtc-sdk-v5";import E from"./ChatAdd.vue.js";const O={class:"label"},$={class:"image-box"},F={class:"file-type"},P={class:"text"},R={class:"name"},G={class:"detail"},N={class:"opt-box"};var V=e({__name:"ChatFile",props:{type:{type:String,default:"image"},visible:{type:Boolean}},setup(e){const V=e,{cssVars:q,state:J,relayMessage:K}=H(),Q=t([]),W=t([]),X=t(),Y=t(),Z=t(),ee=T(ae,500),te={page:0,hasMore:!0,lastSendTime:x(new Date,"yyyy-MM-dd HH:mm:ss")};async function oe(){var e;try{if(!te.hasMore)return;te.page++;const t=await L({orgId:J.orgId,keyword:Z.value,endTime:"",startTime:"",lastSendTime:te.lastSendTime,memberIdSet:[],page:te.page,recordType:"image"===V.type?"IMAGE":"FILE",receiver:J.currentSessionItem.receiver,userId:J.userInfo.id});Array.isArray(t)&&0!==t.length&&Array.isArray(t[0].recordList)||(te.hasMore=!1);let o=t||[];if(Array.isArray(t)&&t.length>0&&(o=t[0].recordList),te.lastSendTime=null==(e=B(o))?void 0:e.sendTime,"image"===V.type){const e=function(e){const t={};e.forEach((e=>{var o,a;const n=new Date(e.sendTime);let i=x(n,"yyyy年MM月");S(n,new Date)?i=(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.47"))||"本周":A(n,new Date)&&(i=(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.404"))||"本月"),t[i]||(t[i]=[]),t[i].push(e.content.msg)}));return Object.entries(t).map((([e,t])=>({label:e,list:t})))}(o);Q.value=te.page>1?Q.value.concat(e):e}else{const e=o.map((e=>new Promise((async t=>{const o=await z(e.content.fileUrl);t({...e,size:o})})))),t=await Promise.all(e);W.value=te.page>1?W.value.concat(t):t}}catch(e){}}function ae(){Object.assign(te,{page:0,hasMore:!0,lastSendTime:x(new Date,"yyyy-MM-dd HH:mm:ss")}),oe()}D(X,(()=>{oe()})),D(Y,(()=>{oe()}));const ne=o((()=>{var e,t;return"image"===V.type?(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.49"))||"聊天图片":(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.50"))||"聊天文件"}));function ie(e){const{size:t,sendTime:o,senderName:a}=e;return`${t} · ${x(new Date(o),"yyyy/MM/dd HH:mm")} ${a}`}function re(e){var t;const o=(null==(t=e.content)?void 0:t.msg)||"",a=o.lastIndexOf(".");if(-1!==a){return o.charAt(a+1).toUpperCase()}return"?"}return a((()=>V.visible),(e=>{e?ae():Z.value=""})),(t,o)=>(n(),i(r(f),{preset:"dialog",title:r(ne),"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog"},{default:s((()=>{var t;return[l(d("div",{class:"iho-chat-dialog__content iho-chat-image-wrapper",ref_key:"imageRef",ref:X},[c(r(h),{"show-toolbar-tooltip":""},{default:s((()=>[(n(!0),m(u,null,p(Q.value,(e=>(n(),m("div",{class:"image-item",key:e.label},[d("span",O,g(e.label),1),d("div",$,[(n(!0),m(u,null,p(e.list,(e=>(n(),i(r(k),{key:e,width:"80",height:"80",src:e},null,8,["src"])))),128))])])))),128))])),_:1})],512),[[v,"image"===e.type]]),l(d("div",{class:"iho-chat-dialog__content iho-chat-file-wrapper",style:w(r(q))},[c(r(C),{clearable:"",placeholder:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.43"))||"搜索文件",value:Z.value,"onUpdate:value":o[0]||(o[0]=e=>Z.value=e),valueModifiers:{trim:!0},onInput:r(ee)},{prefix:s((()=>[c(r(M),{component:r(_)},null,8,["component"])])),_:1},8,["value","onInput"]),d("div",{class:"file-list-box",ref_key:"fileRef",ref:Y},[(n(!0),m(u,null,p(W.value,((e,t)=>{var o;return n(),m("div",{class:"file-item",key:t},[d("span",F,g(re(e)),1),d("div",P,[d("span",R,g(e.content.msg),1),d("span",G,g(ie(e)),1)]),d("div",N,[c(E,{title:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.
|
1
|
+
import{defineComponent as e,ref as t,computed as o,watch as a,openBlock as n,createBlock as i,unref as r,withCtx as s,withDirectives as l,createElementVNode as d,createVNode as c,createElementBlock as m,Fragment as u,renderList as p,toDisplayString as g,vShow as v,normalizeStyle as w,createTextVNode as y}from"vue";import{NModal as f,NImageGroup as h,NImage as k,NInput as C,NIcon as M,NTooltip as b}from"naive-ui";import{SearchOutline as _,OpenOutline as j,DownloadOutline as I}from"@vicons/ionicons5";import{searchChatRecordApi as L}from"../api/index.js";import"../../../../shared/utils/index.js";import{useDebounceFn as T}from"@vueuse/core";import{format as x,isSameWeek as S,isSameMonth as A}from"date-fns";import{last as B}from"lodash-es";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as D}from"../../../../shared/hooks/useScrollLoading.js";import{useData as H}from"../hooks/useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{getFileSize as z,downloadFile as U}from"../utils/index.js";import"trtc-sdk-v5";import E from"./ChatAdd.vue.js";const O={class:"label"},$={class:"image-box"},F={class:"file-type"},P={class:"text"},R={class:"name"},G={class:"detail"},N={class:"opt-box"};var V=e({__name:"ChatFile",props:{type:{type:String,default:"image"},visible:{type:Boolean}},setup(e){const V=e,{cssVars:q,state:J,relayMessage:K}=H(),Q=t([]),W=t([]),X=t(),Y=t(),Z=t(),ee=T(ae,500),te={page:0,hasMore:!0,lastSendTime:x(new Date,"yyyy-MM-dd HH:mm:ss")};async function oe(){var e;try{if(!te.hasMore)return;te.page++;const t=await L({orgId:J.orgId,keyword:Z.value,endTime:"",startTime:"",lastSendTime:te.lastSendTime,memberIdSet:[],page:te.page,recordType:"image"===V.type?"IMAGE":"FILE",receiver:J.currentSessionItem.receiver,userId:J.userInfo.id});Array.isArray(t)&&0!==t.length&&Array.isArray(t[0].recordList)||(te.hasMore=!1);let o=t||[];if(Array.isArray(t)&&t.length>0&&(o=t[0].recordList),te.lastSendTime=null==(e=B(o))?void 0:e.sendTime,"image"===V.type){const e=function(e){const t={};e.forEach((e=>{var o,a;const n=new Date(e.sendTime);let i=x(n,"yyyy年MM月");S(n,new Date)?i=(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.47"))||"本周":A(n,new Date)&&(i=(null==(a=window.getLanguageByCode)?void 0:a.call(window,"10010.1.404"))||"本月"),t[i]||(t[i]=[]),t[i].push(e.content.msg)}));return Object.entries(t).map((([e,t])=>({label:e,list:t})))}(o);Q.value=te.page>1?Q.value.concat(e):e}else{const e=o.map((e=>new Promise((async t=>{const o=await z(e.content.fileUrl);t({...e,size:o})})))),t=await Promise.all(e);W.value=te.page>1?W.value.concat(t):t}}catch(e){}}function ae(){Object.assign(te,{page:0,hasMore:!0,lastSendTime:x(new Date,"yyyy-MM-dd HH:mm:ss")}),oe()}D(X,(()=>{oe()})),D(Y,(()=>{oe()}));const ne=o((()=>{var e,t;return"image"===V.type?(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.49"))||"聊天图片":(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.50"))||"聊天文件"}));function ie(e){const{size:t,sendTime:o,senderName:a}=e;return`${t} · ${x(new Date(o),"yyyy/MM/dd HH:mm")} ${a}`}function re(e){var t;const o=(null==(t=e.content)?void 0:t.msg)||"",a=o.lastIndexOf(".");if(-1!==a){return o.charAt(a+1).toUpperCase()}return"?"}return a((()=>V.visible),(e=>{e?ae():Z.value=""})),(t,o)=>(n(),i(r(f),{preset:"dialog",title:r(ne),"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog"},{default:s((()=>{var t;return[l(d("div",{class:"iho-chat-dialog__content iho-chat-image-wrapper",ref_key:"imageRef",ref:X},[c(r(h),{"show-toolbar-tooltip":""},{default:s((()=>[(n(!0),m(u,null,p(Q.value,(e=>(n(),m("div",{class:"image-item",key:e.label},[d("span",O,g(e.label),1),d("div",$,[(n(!0),m(u,null,p(e.list,(e=>(n(),i(r(k),{key:e,width:"80",height:"80",src:e},null,8,["src"])))),128))])])))),128))])),_:1})],512),[[v,"image"===e.type]]),l(d("div",{class:"iho-chat-dialog__content iho-chat-file-wrapper",style:w(r(q))},[c(r(C),{clearable:"",placeholder:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.43"))||"搜索文件",value:Z.value,"onUpdate:value":o[0]||(o[0]=e=>Z.value=e),valueModifiers:{trim:!0},onInput:r(ee)},{prefix:s((()=>[c(r(M),{component:r(_)},null,8,["component"])])),_:1},8,["value","onInput"]),d("div",{class:"file-list-box",ref_key:"fileRef",ref:Y},[(n(!0),m(u,null,p(W.value,((e,t)=>{var o;return n(),m("div",{class:"file-item",key:t},[d("span",F,g(re(e)),1),d("div",P,[d("span",R,g(e.content.msg),1),d("span",G,g(ie(e)),1)]),d("div",N,[c(E,{title:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.44"))||"转发消息",mode:"relay",onComfirm:(t,o)=>r(K)({content:e.content,checkedIds:t,remark:o})},{trigger:s((()=>[c(r(b),{"show-arrow":!1},{trigger:s((()=>[c(r(M),{size:16,component:r(j)},null,8,["component"])])),default:s((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.45"))||"转发")]})),_:1})])),_:2},1032,["onComfirm"]),c(r(b),{"show-arrow":!1},{trigger:s((()=>[c(r(M),{size:16,component:r(I),onClick:()=>r(U)(e.content.fileUr,e.content.msg)},null,8,["component","onClick"])])),default:s((()=>{var e;return[y((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.102"))||"下载")]})),_:2},1024)])])})),128))],512)],4),[[v,"image"!==e.type]])]})),_:1},8,["title"]))}});export{V as default};
|
@@ -88,7 +88,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
88
88
|
currentGroupUser: AnyObject[];
|
89
89
|
showMultipleVideo: boolean;
|
90
90
|
};
|
91
|
-
openSession: (
|
91
|
+
openSession: (session: string | AnyObject) => Promise<void>;
|
92
92
|
showUserDetail: import("vue").Ref<boolean>;
|
93
93
|
showLargeAvatar: import("vue").Ref<boolean>;
|
94
94
|
showPhone: import("vue").Ref<boolean>;
|
@@ -228,7 +228,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
228
228
|
currentGroupUser: AnyObject[];
|
229
229
|
showMultipleVideo: boolean;
|
230
230
|
};
|
231
|
-
openSession: (
|
231
|
+
openSession: (session: string | AnyObject) => Promise<void>;
|
232
232
|
showUserDetail: import("vue").Ref<boolean>;
|
233
233
|
showLargeAvatar: import("vue").Ref<boolean>;
|
234
234
|
showPhone: import("vue").Ref<boolean>;
|
@@ -114,7 +114,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
114
114
|
currentGroupUser: AnyObject[];
|
115
115
|
showMultipleVideo: boolean;
|
116
116
|
};
|
117
|
-
openSession: (
|
117
|
+
openSession: (session: string | AnyObject) => Promise<void>;
|
118
118
|
showUserDetail: import("vue").Ref<boolean>;
|
119
119
|
showLargeAvatar: import("vue").Ref<boolean>;
|
120
120
|
showPhone: import("vue").Ref<boolean>;
|