cnhis-design-vue 3.2.15-release.5 → 3.2.16-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/ai-chat/src/components/ChatCard.js +1 -1
- package/es/components/branch-notice/src/canstants.js +1 -1
- package/es/components/button-print/index.d.ts +6 -13
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +6 -13
- package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +6 -13
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/button-print/style/index.css +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +10 -0
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/expand-field/index.d.ts +26 -0
- package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +26 -0
- package/es/components/expand-field/src/components/PersonModal.vue.d.ts +26 -0
- package/es/components/expand-field/src/components/form.vue.d.ts +26 -0
- package/es/components/expand-field/src/index.vue.d.ts +26 -0
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
- package/es/components/form-config/index.d.ts +30 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +30 -0
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +10 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +10 -0
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +10 -0
- package/es/components/form-render/index.d.ts +10 -0
- package/es/components/form-render/src/FormRender.vue.d.ts +10 -0
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +10 -0
- package/es/components/form-render/src/components/renderer/input.d.ts +9 -1
- package/es/components/form-render/src/components/renderer/input.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/iho-chat/index.d.ts +181 -23
- package/es/components/iho-chat/src/Index.vue.d.ts +181 -23
- 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/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +24 -12
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +150 -7
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +12 -6
- package/es/components/iho-chat/src/components/MessageEvent.vue.d.ts +137 -0
- package/es/components/iho-chat/src/components/MessageEvent.vue.js +1 -0
- package/es/components/iho-chat/src/components/MessageEvent.vue2.js +1 -0
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +6 -3
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +13 -6
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/Video.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
- package/es/components/iho-chat/src/constants/index.d.ts +2 -1
- package/es/components/iho-chat/src/constants/index.js +1 -1
- package/es/components/iho-chat/src/hooks/useVideo.d.ts +2 -2
- package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
- package/es/components/iho-chat/src/utils/asyncQueue.d.ts +10 -0
- package/es/components/iho-chat/src/utils/asyncQueue.js +1 -0
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +14 -0
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/info-header/index.d.ts +20 -0
- package/es/components/info-header/src/InfoHeader.vue.d.ts +20 -0
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +10 -0
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +10 -0
- package/es/components/select-person/index.d.ts +26 -0
- package/es/components/select-person/src/SelectPerson.vue.d.ts +14 -0
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/es/components/select-person/src/index.vue.d.ts +26 -0
- package/es/components/select-person/src/index.vue2.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +10 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +10 -0
- package/es/shared/hooks/useDateTime.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -28,7 +28,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
28
28
|
trtcProxy: import("vue").Ref<any>;
|
29
29
|
trtc: TRTC;
|
30
30
|
timing: import("vue").Ref<string>;
|
31
|
-
|
31
|
+
voiceClose: import("vue").Ref<boolean>;
|
32
32
|
isAudio: import("vue").ComputedRef<boolean>;
|
33
33
|
isCall: import("vue").ComputedRef<boolean>;
|
34
34
|
startTimer: () => void;
|
@@ -1 +1 @@
|
|
1
|
-
import{createElementVNode as e,defineComponent as o,ref as n,computed as s,watch as t,onBeforeUnmount as r,openBlock as a,createElementBlock as l,withDirectives as i,vShow as c,createVNode as u,unref as d,toDisplayString as v,Fragment as m,normalizeClass as p,withCtx as g}from"vue";import{NAvatar as f,NButton as w,NIcon as h}from"naive-ui";import{Mic as y,MicOffCircle as I,Call as A}from"@vicons/ionicons5";import{avFinishApi as k}from"../api/index.js";import"@vueuse/core";import{$message as E}from"../utils/index.js";import"lodash-es";import{AV_STATUS as V,CHAT_TYPE as R}from"../constants/index.js";import"../../../../shared/utils/index.js";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{useVideo as S}from"../hooks/useVideo.js";import C from"trtc-sdk-v5";var M,b,x,L;const T={class:"video-wrapper"},j={class:"user"},_={class:"name"},N={class:"tip"},H={class:"opt-btn"},D={class:"btn"},z=e("span",null,(null==(M=window.getLanguageByCode)?void 0:M.call(window,"10010.1.104"))||"静音",-1),B=e("span",null,(null==(b=window.getLanguageByCode)?void 0:b.call(window,"10010.1.113"))||"拒接",-1),U={class:"btn"},F=e("span",null,(null==(x=window.getLanguageByCode)?void 0:x.call(window,"10010.1.125"))||"挂断",-1),O=e("span",null,(null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.114"))||"接听",-1);var P=o({__name:"Video",setup(o){const{sendMessage:M,state:b,trtcProxy:x,trtc:L,timing:P,
|
1
|
+
import{createElementVNode as e,defineComponent as o,ref as n,computed as s,watch as t,onBeforeUnmount as r,openBlock as a,createElementBlock as l,withDirectives as i,vShow as c,createVNode as u,unref as d,toDisplayString as v,Fragment as m,normalizeClass as p,withCtx as g}from"vue";import{NAvatar as f,NButton as w,NIcon as h}from"naive-ui";import{Mic as y,MicOffCircle as I,Call as A}from"@vicons/ionicons5";import{avFinishApi as k}from"../api/index.js";import"@vueuse/core";import{$message as E}from"../utils/index.js";import"lodash-es";import{AV_STATUS as V,CHAT_TYPE as R}from"../constants/index.js";import"../../../../shared/utils/index.js";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{useVideo as S}from"../hooks/useVideo.js";import C from"trtc-sdk-v5";var M,b,x,L;const T={class:"video-wrapper"},j={class:"user"},_={class:"name"},N={class:"tip"},H={class:"opt-btn"},D={class:"btn"},z=e("span",null,(null==(M=window.getLanguageByCode)?void 0:M.call(window,"10010.1.104"))||"静音",-1),B=e("span",null,(null==(b=window.getLanguageByCode)?void 0:b.call(window,"10010.1.113"))||"拒接",-1),U={class:"btn"},F=e("span",null,(null==(x=window.getLanguageByCode)?void 0:x.call(window,"10010.1.125"))||"挂断",-1),O=e("span",null,(null==(L=window.getLanguageByCode)?void 0:L.call(window,"10010.1.114"))||"接听",-1);var P=o({__name:"Video",setup(o){const{sendMessage:M,state:b,trtcProxy:x,trtc:L,timing:P,voiceClose:G,isAudio:J,isCall:$,startTimer:q,resetTimer:K,toggleAudio:Q,messageTypeText:W,time:X,installEventHandlers:Y,uninstallEventHandlers:Z}=S(),ee=n(),oe=n(),ne=n(!1);let se=null;const te=s((()=>{var e,o,n;return $.value?{avatar:b.currentSessionItem.avatar,name:b.currentSessionItem.name,userId:b.currentSessionItem.receiver}:{avatar:null==(e=b.currentAVMsg.currentMsg)?void 0:e.senderAvatar,name:null==(o=b.currentAVMsg.currentMsg)?void 0:o.senderName,userId:null==(n=b.currentAVMsg.currentMsg)?void 0:n.sender}})),re=s((()=>ne.value?J.value?P.value:"":$.value?"正在呼叫...":`邀请你${W.value}问诊...`)),ae=s((()=>{var e,o;return null==(o=null==(e=b.currentAVMsg.currentMsg)?void 0:e.content)?void 0:o.avStatus}));async function le(e=V.FINISHED){M({chatType:R.SINGLE,content:{msg:e===V.FINISHED?""+X.seconds:"s",chatMessageType:b.currentAVMsg.chatMessageType,avStatus:e},receiver:te.value.userId}),await k({recordId:b.currentAVMsg.currentMsg.id,status:e,duration:e===V.FINISHED?X.seconds:0})}async function ie(){const e=await C.isSupported();if(!e.result||!e.detail.isH264EncodeSupported||!e.detail.isH264DecodeSupported)return console.log("checkResult :>> ",e),void(b.showVideo=!1);try{if(await L.enterRoom({strRoomId:b.currentAVMsg.strRoomId,sdkAppId:parseInt(b.userInfo.sdkAppID),userId:b.userInfo.id,userSig:b.userInfo.userSig,proxy:x.value}),$.value||(ne.value=!0,q()),Y({handleError:ge,handleRemoteUserEnter:me,handleRemoteAudioAvailable:ve,handleRemoteUserExit:pe,handleRemoteVideoAvailable:de}),await L.startLocalAudio(),J.value)return;await L.startLocalVideo({view:oe.value})}catch(e){console.log("error :>> ",e),E.error(e),b.showVideo=!1}}function ce(){$.value&&!ne.value?le(V.CANCELED):le()}async function ue(){try{if(b.showVideo=!1,Z({handleError:ge,handleRemoteUserEnter:me,handleRemoteAudioAvailable:ve,handleRemoteUserExit:pe,handleRemoteVideoAvailable:de}),await L.exitRoom(),await L.stopLocalAudio(),J.value)return;await L.stopLocalVideo()}catch(e){console.log("error :>> ",e)}}async function de(e){const{userId:o,streamType:n}=e;try{await L.startRemoteVideo({userId:o,streamType:n,view:ee.value})}catch(e){console.log("error :>> ",e)}}function ve(e){}function me(){ne.value=!0,q()}function pe(e){console.log("event :>> 对方已挂断",e),ue()}function ge(e){console.log("error :>> ",e),b.showVideo=!1}return t((()=>ae.value),(e=>{b.showVideo&&(e===V.IN_CALL?async function(){$.value?ie():(se&&clearTimeout(se),se=setTimeout((async()=>{ne.value||le(V.NO_RESPONSE)}),6e4))}():ue())}),{immediate:!0}),r((()=>{ue()})),(o,n)=>(a(),l("div",T,[i(e("div",{class:"video-box",ref_key:"videoRef",ref:ee},null,512),[[c,ne.value]]),i(e("div",{class:"video-box--self",ref_key:"selfVideoRef",ref:oe},null,512),[[c,ne.value]]),i(e("div",j,[u(d(f),{size:58,round:"",src:d(te).avatar},null,8,["src"]),e("span",_,v(d(te).name),1),e("span",N,v(d(re)),1)],512),[[c,d(J)||!ne.value]]),e("div",H,[e("div",D,[d($)&&!ne.value||ne.value?(a(),l(m,{key:0},[u(d(w),{circle:"",onClick:d(Q),class:p({bordered:!d(G)})},{icon:g((()=>[u(d(h),{size:"30",color:d(G)?"#626262":"#fff",component:d(G)?d(I):d(y)},null,8,["color","component"])])),_:1},8,["onClick","class"]),z],64)):(a(),l(m,{key:1},[u(d(w),{circle:"",color:"#f17568",class:"btn--rotate",onClick:n[0]||(n[0]=()=>le(d(V).REJECTED))},{icon:g((()=>[u(d(h),{size:"30",component:d(A)},null,8,["component"])])),_:1}),B],64))]),e("div",U,[d($)&&!ne.value||ne.value?(a(),l(m,{key:0},[u(d(w),{circle:"",color:"#f17568",class:"btn--rotate",onClick:ce},{icon:g((()=>[u(d(h),{size:"30",component:d(A)},null,8,["component"])])),_:1}),F],64)):(a(),l(m,{key:1},[u(d(w),{circle:"",color:"#2ac98b",onClick:ie},{icon:g((()=>[u(d(h),{size:"30",component:d(A)},null,8,["component"])])),_:1}),O],64))])])]))}});export{P as default};
|
@@ -1 +1 @@
|
|
1
|
-
var E=(E=>(E.SINGLE="SINGLE",E.GROUP="GROUP",E))(E||{}),S=(E=>(E.TEXT="TEXT",E.FILE="FILE",E.EMOJI="EMOJI",E.IMAGE="IMAGE",E.TEMPLATE="TEMPLATE",E.BLEND="BLEND",E.FORWARD="FORWARD",E.QUICK_REPLY="QUICK_REPLY",E.AUDIO="AUDIO",E.VIDEO="VIDEO",E))(S||{}),A=(E=>(E.JOIN_GROUP="JOIN_GROUP",E.LEAVE_GROUP="LEAVE_GROUP",E.NEW_SESSION="NEW_SESSION",E.MESSAGE="MESSAGE",E.AV_STATUS="AV_STATUS",E.RECALL_MESSAGE="RECALL_MESSAGE",E.DISABLE_SESSION="DISABLE_SESSION",E))(A||{}),L=(E=>(E.IN_CALL="IN_CALL",E.CALL_BUSY="CALL_BUSY",E.NO_RESPONSE="NO_RESPONSE",E.FINISHED="FINISHED",E.REJECTED="REJECTED",E.CANCELED="CANCELED",E))(L||{}),I=(E=>(E.REMOVED="REMOVED",E.ENABLED="ENABLED",E.ENDED="ENDED",E))(I||{});export{L as AV_STATUS,E as CHAT_TYPE,S as MESSAGE_TYPE,I as STATUS,A as SUBSCRIBE_MESSAGE_TYPE};
|
1
|
+
var E=(E=>(E.SINGLE="SINGLE",E.GROUP="GROUP",E))(E||{}),S=(E=>(E.TEXT="TEXT",E.FILE="FILE",E.EMOJI="EMOJI",E.IMAGE="IMAGE",E.TEMPLATE="TEMPLATE",E.BLEND="BLEND",E.FORWARD="FORWARD",E.QUICK_REPLY="QUICK_REPLY",E.AUDIO="AUDIO",E.VIDEO="VIDEO",E.EVENT="EVENT",E))(S||{}),A=(E=>(E.JOIN_GROUP="JOIN_GROUP",E.LEAVE_GROUP="LEAVE_GROUP",E.NEW_SESSION="NEW_SESSION",E.MESSAGE="MESSAGE",E.AV_STATUS="AV_STATUS",E.RECALL_MESSAGE="RECALL_MESSAGE",E.DISABLE_SESSION="DISABLE_SESSION",E))(A||{}),L=(E=>(E.IN_CALL="IN_CALL",E.CALL_BUSY="CALL_BUSY",E.NO_RESPONSE="NO_RESPONSE",E.FINISHED="FINISHED",E.REJECTED="REJECTED",E.CANCELED="CANCELED",E))(L||{}),I=(E=>(E.REMOVED="REMOVED",E.ENABLED="ENABLED",E.ENDED="ENDED",E))(I||{});export{L as AV_STATUS,E as CHAT_TYPE,S as MESSAGE_TYPE,I as STATUS,A as SUBSCRIBE_MESSAGE_TYPE};
|
@@ -35,8 +35,8 @@ export declare function useVideo(): {
|
|
35
35
|
}) => Promise<void>;
|
36
36
|
trtc: TRTC;
|
37
37
|
timing: import("vue").Ref<string>;
|
38
|
-
|
39
|
-
|
38
|
+
voiceClose: import("vue").Ref<boolean>;
|
39
|
+
videocamClose: import("vue").Ref<boolean>;
|
40
40
|
isAudio: import("vue").ComputedRef<boolean>;
|
41
41
|
isCall: import("vue").ComputedRef<boolean>;
|
42
42
|
startTimer: () => void;
|
@@ -1 +1 @@
|
|
1
|
-
import{ref as e,computed as t,onBeforeUnmount as o}from"vue";import{useData as
|
1
|
+
import{ref as e,computed as t,onBeforeUnmount as o}from"vue";import{useData as a}from"./useData.js";import"stompjs";import"sockjs-client/dist/sockjs.min.js";import{MESSAGE_TYPE as n}from"../constants/index.js";import"../api/index.js";import{formatSeconds as l}from"../utils/index.js";import"lodash-es";import i from"trtc-sdk-v5";function E(){const E={timer:null,seconds:0},{state:s,trtcProxy:r,sendMessage:d}=a(),u=e(""),m=e(!1),c=e(!1),R=t((()=>s.currentAVMsg.chatMessageType===n.AUDIO)),T=t((()=>"call"===s.currentAVMsg.callMode)),v=t((()=>{var e,t;return R.value?(null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.130"))||"语音":(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.131"))||"视频"})),A=i.create();function f(){u.value="00:00:00",E.timer&&clearInterval(E.timer),E.timer=null,E.seconds=0}return o((()=>{f()})),{state:s,trtcProxy:r,sendMessage:d,trtc:A,timing:u,voiceClose:m,videocamClose:c,isAudio:R,isCall:T,startTimer:function(){f(),E.timer=setInterval((()=>{E.seconds++,u.value=l(E.seconds)}),1e3)},resetTimer:f,toggleAudio:async function(){await A.updateLocalAudio({mute:!m.value}),m.value=!m.value},toggleVideo:async function(){await A.updateLocalVideo({mute:!c.value}),c.value=!c.value},messageTypeText:v,time:E,installEventHandlers:function({handleError:e,handleRemoteUserEnter:t,handleRemoteAudioAvailable:o,handleRemoteUserExit:a,handleRemoteVideoAvailable:n}){A.on(i.EVENT.ERROR,e),A.on(i.EVENT.REMOTE_USER_ENTER,t),A.on(i.EVENT.REMOTE_AUDIO_AVAILABLE,o),A.on(i.EVENT.REMOTE_USER_EXIT,a),R.value||A.on(i.EVENT.REMOTE_VIDEO_AVAILABLE,n)},uninstallEventHandlers:function({handleError:e,handleRemoteUserEnter:t,handleRemoteAudioAvailable:o,handleRemoteUserExit:a,handleRemoteVideoAvailable:n}){A.off(i.EVENT.ERROR,e),A.off(i.EVENT.REMOTE_USER_ENTER,t),A.off(i.EVENT.REMOTE_AUDIO_AVAILABLE,o),A.off(i.EVENT.REMOTE_USER_EXIT,a),R.value||A.off(i.EVENT.REMOTE_VIDEO_AVAILABLE,n)}}}export{E as useVideo};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export declare class AsyncScheduler {
|
2
|
+
private maxConcurrency;
|
3
|
+
private runningTasks;
|
4
|
+
private taskQueue;
|
5
|
+
private allPromises;
|
6
|
+
constructor(maxConcurrency?: number);
|
7
|
+
add(task: () => Promise<unknown>): Promise<unknown>;
|
8
|
+
runNextTask(): Promise<void>;
|
9
|
+
waitForAll(): Promise<unknown[]>;
|
10
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
class s{constructor(s=5){this.runningTasks=0,this.taskQueue=[],this.allPromises=[],this.maxConcurrency=s,this.runningTasks=0,this.taskQueue=[]}add(s){const t=new Promise(((t,n)=>{this.taskQueue.push((()=>s().then(t,n))),this.runNextTask()}));return this.allPromises.push(t),t}async runNextTask(){if(this.runningTasks>=this.maxConcurrency||0===this.taskQueue.length)return;const s=this.taskQueue.shift();this.runningTasks++;try{await(null==s?void 0:s())}finally{this.runningTasks--,this.runNextTask()}}waitForAll(){return Promise.all(this.allPromises)}}export{s as AsyncScheduler};
|
@@ -1 +1 @@
|
|
1
|
-
import{createVNode as e}from"vue";import{jsonParse as
|
1
|
+
import{createVNode as e}from"vue";import{jsonParse as l,arrayed as i}from"../../../../../shared/utils/index.js";import{isObject as t}from"@vue/shared";import{promiseTimeout as r}from"@vueuse/shared";import{isArray as o,isString as n,first as u,findLastIndex as d}from"lodash-es";import"../../../index.js";import{useUUIDMap as s,IhoTableRenderHelper as a,isCompatibleColumn as f,createIhoTableFilterMethod as v}from"../../utils/index.js";import c from"./filter.vue.js";import{defineTablePlugin as p}from"../../hooks/useTablePlugin.js";function m(){const m="filterRenderPlugin";return p({name:m,vxe(l){l.renderer.mixin({[m]:{showFilterFooter:!1,renderFilter:(l,i)=>e(c,{payload:i,key:i.column.field},null)}})},apply(e){const{getItemFromUUID:c,setItemFromUUID:p,removeItemFromUUID:g}=s((()=>[]),!1);e.fieldHooks.field.tap(m,((e,i,r,{$table:d})=>{var s,c,p,h,g,b,k,y,F,x;const R=null==(s=e.editRender)?void 0:s.props;if(!t(R))return e;if(!a.hasOptionFilter(R))return e;e.editRender={...e.editRender,props:{...null==(c=e.editRender)?void 0:c.props,sortable:e.sortable}},e.filterRender={name:m};const j=null==(p=d.value)?void 0:p.getColumnByField(e.field),C={};let O;if(j&&o(j.filters)&&j.filters.forEach((e=>{e&&(C[`${e.label}_${e.value}`]=e.checked)})),f(R))O=null!=(h=R.options)?h:[];else{const e=null==(b=null==(g=R.settingObj)?void 0:g.showSetting)?void 0:b.reduce(((e,l)=>{var i,t,r;return l&&l.change_text&&null!=(null==(t=null==(i=l.filter)?void 0:i[0])?void 0:t.value)&&e.push({label:l.change_text,value:l.filter[0].value,data:null!=(r=l.filter[0].keyword)?r:l.filter[0].value}),e}),[]);if(null==e?void 0:e.length)O=e;else{O=null!=(F=null==(y=null==(k=(t(R.fieldSetting)?R.fieldSetting:n(R.fieldSetting)?l(R.fieldSetting||""):{}).mapping)?void 0:k.mappingFiled)?void 0:y.reduce(((e,l)=>{var i;const r=u(l.value);return t(r)&&e.push({label:l.key||r.key,value:r.value,data:null!=(i=r.keyword)?i:r.value}),e}),[]))?F:[]}}if(e.filters=O.reduce(((e,l)=>(t(l)&&e.push({...l,checked:!!C[`${l.label}_${l.value}`]}),e)),[]),!e.filterMethod){const l=null==(x=r.treeConfig)?void 0:x.children;e.filterMethod=v(l)}return r.filterConfig={iconMatch:"iho-table--iconfont iho-table-icon-filter",iconNone:"iho-table--iconfont iho-table-icon-filter",...r.filterConfig},e})),e.fieldHooks.fieldList.tap(m,((e,l)=>l.uuid?(p(l.uuid,e),e):e)),e.fieldHooks.fieldEnd.tapPromise(m,(async(e,{$table:l})=>{var i;try{if(!l.value||!e.uuid)return;const t=c(e.uuid);if(null==(i=e.sortConfig)?void 0:i.multiple){const e=t.reduce(((e,i)=>{var t;const r=null==(t=i.editRender)?void 0:t.props;if(!i.sortable)return e;if(r&&h(r.isOrder)){const t=l.value.getColumnByField(i.field);e.push({field:i.field,order:(null==t?void 0:t.order)?t.order:r.isOrder})}return e}),[]);if(!e.length)return;await r(200),await l.value.sort(e)}else d(t,(e=>{var i;const t=null==(i=e.editRender)?void 0:i.props;if(t&&h(t.isOrder))return e&&l.value.sort(e.field,t.isOrder),!0}))}finally{e.uuid&&g(e.uuid)}})),e.exposeHooks.expose.tap(m,((e,l,{$table:t})=>(Object.assign(e,{setSort(e,l){t.value&&t.value.sort(e,l)},setFilter(e,l){if(!t.value)return;const r=t.value.getColumnByField(e);if(!r||!o(r.filters))return;const n=i(l);r.filters.forEach((e=>{e.checked=n.includes(e.value)})),t.value.updateData()}}),e)))}})}function h(e){return["asc","desc",null].includes(e)}export{m as filterRenderPlugin};
|
@@ -176,6 +176,20 @@ export declare namespace IhoTableLowCodeField {
|
|
176
176
|
colorAndIcon: ColorAndIconItem[];
|
177
177
|
fieldDescribe: string;
|
178
178
|
fieldDescDev: string;
|
179
|
+
showSetting: Partial<{
|
180
|
+
filter: Partial<{
|
181
|
+
con: string;
|
182
|
+
conName: string;
|
183
|
+
field_key: string;
|
184
|
+
keyword: string;
|
185
|
+
i18n: string;
|
186
|
+
key: string;
|
187
|
+
value: string;
|
188
|
+
}>[];
|
189
|
+
change_text: string;
|
190
|
+
field_key: string;
|
191
|
+
sqlExpression: string;
|
192
|
+
}>[];
|
179
193
|
[K: string]: unknown;
|
180
194
|
}>;
|
181
195
|
type QueryOptions = (payload: {
|
@@ -1 +1 @@
|
|
1
|
-
import{reactive as e,inject as t,unref as n,toRaw as r,normalizeStyle as i,createVNode as o}from"vue";import{jsonParse as l}from"../../../../shared/utils/index.js";import{promiseTimeout as u}from"@vueuse/shared";import{parse as a,isValid as c,compareDesc as s}from"date-fns";import{isNumber as d,isFunction as f,isString as p,isObject as m,isArray as v}from"lodash-es";import{InjectionIhoTableEmits as h,InjectionIhoTableConfig as
|
1
|
+
import{reactive as e,inject as t,unref as n,toRaw as r,normalizeStyle as i,createVNode as o}from"vue";import{jsonParse as l}from"../../../../shared/utils/index.js";import{promiseTimeout as u}from"@vueuse/shared";import{parse as a,isValid as c,compareDesc as s}from"date-fns";import{isNumber as d,isFunction as f,isString as p,isObject as m,isArray as v}from"lodash-es";import{InjectionIhoTableEmits as h,InjectionIhoTableConfig as g,IHO_TABLE_STRING_STATUS as I,IHO_TABLE_NUMBER_STATUS as E,IHO_TABLE_TREE_TYPE as T,EDITABLE_WIDGET_TYPE as w,InjectionIhoTableUUID as F}from"../constants/index.js";import{getSeparateInfo as R}from"./separateMap.js";export{deleteSeparateInfo,getSeparateInfo,setSeparateInfo}from"./separateMap.js";function S(e){return console.warn(`[IhoTable]: ${e}`)}const C=Object.freeze({getCellType(e){var t;return((null==(t=e.settingObj)?void 0:t.attr)||e.formType||"DEFAULT").toUpperCase()}});function b(){var e,n,r;const i=t(g);return i||S("this function(getRowHeight) only can be used in setup environment"),null!=(r=null==(n=null==(e=null==i?void 0:i.value)?void 0:e.rowConfig)?void 0:n.height)?r:32}function D(e){const t=e.slice(2);return`${t[0].toLowerCase()}${t.slice(1)}`}function O(e){return`on${e[0].toUpperCase()}${e.slice(1)}`}function P(t,n=!0){const r=n?e(new Map):new Map;return{uuidMap:r,getItemFromUUID:function(e){return r.get(e)||r.set(e,t()),r.get(e)},setItemFromUUID:function(e,t){r.set(e,t)},removeItemFromUUID:function(e){r.delete(e)}}}async function x(e,t,r,i,o=2){const l=function(){var o;const l=null==(o=n(i))?void 0:o.getColumnByField(e.field);if(!l)return;const u=y(l);return u?f(u.separateWidth)?u.separateWidth({column:l,row:t,rowIndex:r,$table:n(i)}):d(u.separateWidth)?u.separateWidth:l.renderWidth:l.renderWidth}();return d(l)&&l>0?l:o<=0?function(){const t=+e.colWidth;return d(t)?t:64}():(await u(0),x(e,t,r,i,o-1))}function A(e){const i=t(h);function o(){var t;const r=n(e);return{$table:r.$table,value:r.row[r.column.field],row:r.row,column:{...r.column,...null==(t=r.column.editRender)?void 0:t.props},index:r.rowIndex>-1?r.rowIndex:r.$rowIndex}}function l(e={}){i("formChange",{...o(),...r(e)})}function u(e={}){i("formClick",{...o(),...r(e)})}return{emitFormChange:function(){l()},emitFormClick:function(){u()},emitFormChangeWithParams:l,emitFormClickWithParams:u}}function y(e){var t;return null==(t=e.editRender)?void 0:t.props}const $=Object.freeze({createDefaultRenderCell:function(){return function({props:e},{row:n,column:r}){if("bottom"!==(null==e?void 0:e.separatePlacement))return c(n[r.field]);const i=t(F),l=R(i,n);if(!l)return c(n[r.field]);const{originalData:u=n,isLastRow:a}=l;return c(a?u[r.field]:null);function c(e){return[o("span",{title:U(r,e),class:"iho-table__colorAndIcon"},[e])]}}},createRenderEdit:function(e){return function({props:t},n){return e({...n,fieldItem:t||{},...A(n)})}},isEditableColumn(e,t){var n;return!1!==(null==(n=e.editConfig)?void 0:n.showIcon)&&t.editRender&&!1!==t.editRender.enabled},hasFilter(e){return this.hasDateFilter(e)||this.hasOptionFilter(e)||this.hasTextFilter(e)},hasDynamicFilter:e=>e.optionInfo&&(e.optionInfo.dynamicOptionInfo||e.optionInfo.list),hasOptionFilter(e){var t;if(M(e))return!0;const n=null==(t=e.settingObj)?void 0:t.showSetting;if(n&&n.length)return n.some((e=>{var t;return e.change_text&&(null==(t=e.filter)?void 0:t.length)}));let r=e.fieldSetting;return p(r)&&(r=l(r||"")),m(r)&&((i=r).notParticipatingSearch!==I.POSITIVE&&"manual"===(null==(o=i.mapping)?void 0:o.type));var i,o},hasDateFilter(e){var t;return"daterange"===(null==(t=null==e?void 0:e.filterSetting)?void 0:t.type)},hasTextFilter(e){var t;return"text"===(null==(t=null==e?void 0:e.filterSetting)?void 0:t.type)},hasTitlePrefix(e){var t,n;return e&&((null==(t=e.titlePrefix)?void 0:t.content)||(null==(n=e.titlePrefix)?void 0:n.useHTML))}}),_=Object.freeze({isPositive:e=>e===E.POSITIVE||e===I.POSITIVE,isNegative:e=>e===E.NEGATIVE||e===I.NEGATIVE,notPositive:e=>e!==E.POSITIVE&&e!==I.POSITIVE,notNegative:e=>e!==E.NEGATIVE&&e!==I.NEGATIVE});function N(e){return[T.TRANSFORM_WITH_SPAN_METHOD,T.TRANSFORM_TREE_TYPE].includes(`${e.isTree}`)}function H(e){return p(e)&&!!e.match(/^###\{[^{}]+}$/)}function V(e){try{return JSON.parse(e.replace(/^###/,""))}catch(e){return{}}}function W(e,t){if(e.$__SEPARATE||!t.editRender||!t.editRender.props)return e[t.field];const{fieldSetting:n}=t.editRender.props;if(!p(n))return e[t.field];const{mergedFeildExpression:r}=l(n);return r&&p(r)?r.replace(/#{(.+?)}/g,(function(t,n){let r=n?e[n.trim()]:null;H(r)&&(r=V(r).change_text);return r||(null==r?"--":r)})):e[t.field]}const j=["SEARCH","SELECT","RADIO","CHECKBOX"];function M(e){return e.notParticipatingSearch===E.NEGATIVE&&j.includes(C.getCellType(e))&&v(e.options)&&e.options.length}function U(e,t=""){return"tooltip"!==e.showOverflow&&p(t)?t:""}function G(e,t){var r,i,o;t=n(t)||"";const l=null!=(i=null==(r=e.editRender)?void 0:r.props)?i:{},u=a(t,(null==(o=null==l?void 0:l.componentProps)?void 0:o.valueFormat)||"HH:mm",new Date);return!c(u)}function L(e,t,r){var i,o;const l=null!=(o=null==(i=e.editRender)?void 0:i.props)?o:{};return r=n(r)||"",!c(new Date(r))||p(l.connectField)&&t[l.connectField]&&(l.isStartDate&&s(new Date(r),new Date(t[l.connectField]))<0||l.isEndDate&&s(new Date(r),new Date(t[l.connectField]))>0)}function k(e){var t,n;return(!0===e.variableHeight||"1"===e.variableHeight)&&(null!=(n=null==(t=e.editRender)?void 0:t.name)?n:C.getCellType(e))!==w.SEPARATE}function z(e){const t=e.internalData.tableFullColumn;return!!v(t)&&t.some((e=>{var t,n;return k(null!=(n=null==(t=e.editRender)?void 0:t.props)?n:{})}))}function B(e,t){return t?e?n=>[f(e)?e(n):e,f(t)?t(n):t]:t:e}function J(e,t){return t?e?n=>i([f(e)?e(n):e,f(t)?t(n):t]):t:e}function K(e){return function({option:t,column:n,row:r}){if(e&&v(r[e])&&r[e].length)return!1;const i=r[n.field];if(v(i))return i.some((e=>[t.label,t.value].includes(e)));if(p(i)){if(i===t.value||i===t.label)return!0;const{value:e,change_text:n}=V(i);return n===t.label||e===t.value}return null!=i&&t.value===i}}export{$ as IhoTableRenderHelper,_ as IhoTableStatusHelper,C as IhoTableUtils,S as IhoTableWarn,K as createIhoTableFilterMethod,D as eventListener2EventName,O as eventName2EventListener,x as getColumnRenderWidth,y as getLowCodeFieldFromField,b as getRowHeight,U as getTitle,M as isCompatibleColumn,L as isInvalidDate,G as isInvalidTime,H as isRichContent,N as isTransformTreeType,k as isVariableHeightColumn,z as isVariableHeightTable,B as mergeVxeClass,J as mergeVxeStyle,W as parseMergeField,V as parseRichContent,A as useIhoTableFormEvent,P as useUUIDMap};
|