cnhis-design-vue 3.2.10-beta.8 → 3.2.10-release.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/base-search/index.d.ts +3 -0
- package/es/components/base-search/src/index.vue.d.ts +3 -0
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/card-reader-sdk/src/insuranceSDK.js +1 -1
- package/es/components/card-reader-sdk/src/utils/index.js +1 -1
- package/es/components/classification/index.d.ts +1 -1
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +1 -1
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +1 -1
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
- package/es/components/classification/src/index.vue.d.ts +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/temperature/useCenter.js +1 -1
- package/es/components/field-set/index.d.ts +13 -0
- package/es/components/field-set/src/FieldColor.vue.d.ts +72 -26
- package/es/components/field-set/src/FieldColor.vue2.js +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +19 -4
- package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +5 -2
- package/es/components/field-set/src/Index.vue.d.ts +13 -0
- package/es/components/field-set/src/Index.vue2.js +1 -1
- package/es/components/field-set/src/components/condition.vue.d.ts +18 -4
- package/es/components/field-set/src/components/condition.vue2.js +1 -1
- package/es/components/field-set/src/components/edit-dialog.vue.d.ts +63 -22
- package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -1
- package/es/components/field-set/src/components/edit-filter.vue.d.ts +44 -44
- 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 +5 -2
- package/es/components/field-set/src/components/table-row.vue2.js +1 -1
- package/es/components/field-set/style/index.css +1 -1
- package/es/components/form-config/index.d.ts +3 -3
- package/es/components/form-config/src/FormConfig.vue.d.ts +3 -3
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -3
- package/es/components/form-render/index.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/combination.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/combination/jsonCombination.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/combination/tableCombination.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/text.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/text.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +1 -1
- package/es/components/form-render/src/types/index.d.ts +4 -3
- package/es/components/form-render/src/utils/index.d.ts +2 -0
- package/es/components/form-render/src/utils/index.js +1 -1
- package/es/components/iho-chat/index.d.ts +8 -8
- package/es/components/iho-chat/src/Index.vue.d.ts +8 -8
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +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 +3 -3
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +2 -2
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +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.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/utils/index.d.ts +1 -1
- package/es/components/iho-chat/src/utils/index.js +1 -1
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +1 -0
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue.d.ts +30 -0
- package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue.js +1 -0
- package/es/components/iho-table/src/plugins/filterTextPlugin/filter.vue2.js +1 -0
- package/es/components/iho-table/src/plugins/filterTextPlugin/index.d.ts +1 -0
- package/es/components/iho-table/src/plugins/filterTextPlugin/index.js +1 -0
- package/es/components/iho-table/src/plugins/headerPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +1 -0
- package/es/components/iho-table/src/utils/index.d.ts +3 -1
- package/es/components/iho-table/src/utils/index.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.js +1 -1
- package/es/components/quick-search/index.d.ts +18 -0
- package/es/components/quick-search/src/index.vue.d.ts +18 -0
- 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/standard-modal.d.ts +1 -1
- package/es/components/shortcut-setter/index.d.ts +1 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/bi-filter/helpers/options.d.ts +1 -7
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/SelectTreeDynamic.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +1 -1
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/SelectTreeDynamic.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/helpers/dateExtraMap.d.ts +3 -49
- package/es/components/table-filter/src/components/render-widget/helpers/enums.d.ts +1 -18
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +1 -1
- package/es/components/table-filter/src/hooks/useAdvanced.d.ts +1 -0
- package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
- package/es/components/table-filter/src/hooks/useMixins.d.ts +1 -1
- package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
- package/es/components/table-filter/src/types/index.d.ts +3 -0
- package/es/env.d.ts +25 -25
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -446,9 +446,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
446
446
|
}>> & {
|
447
447
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
448
448
|
}, {
|
449
|
+
title: string;
|
449
450
|
defaultValue: AnyObject[];
|
450
451
|
mode: string;
|
451
|
-
title: string;
|
452
452
|
disabledIds: string[];
|
453
453
|
}>;
|
454
454
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
@@ -615,9 +615,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
615
615
|
}>> & {
|
616
616
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
617
617
|
}, {
|
618
|
+
title: string;
|
618
619
|
defaultValue: AnyObject[];
|
619
620
|
mode: string;
|
620
|
-
title: string;
|
621
621
|
disabledIds: string[];
|
622
622
|
}>;
|
623
623
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
@@ -915,9 +915,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
915
915
|
}>> & {
|
916
916
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
917
917
|
}, {
|
918
|
+
title: string;
|
918
919
|
defaultValue: AnyObject[];
|
919
920
|
mode: string;
|
920
|
-
title: string;
|
921
921
|
disabledIds: string[];
|
922
922
|
}>;
|
923
923
|
PersonAddOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
@@ -956,7 +956,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
956
956
|
showMessage: (item: AnyObject) => boolean;
|
957
957
|
showReEdit: (item: AnyObject) => boolean;
|
958
958
|
showReferenceMsg: (item: AnyObject) => any;
|
959
|
-
showBlendMsg: (item: AnyObject) =>
|
959
|
+
showBlendMsg: (item: AnyObject) => number | false | null;
|
960
960
|
showTemplateMsg: (item: AnyObject, type: "template" | "system") => boolean | undefined;
|
961
961
|
isTemplate3: (content: AnyObject) => boolean;
|
962
962
|
needShowTime: (item: AnyObject, index: number) => boolean;
|
@@ -1258,9 +1258,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
1258
1258
|
}>> & {
|
1259
1259
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
1260
1260
|
}, {
|
1261
|
+
title: string;
|
1261
1262
|
defaultValue: AnyObject[];
|
1262
1263
|
mode: string;
|
1263
|
-
title: string;
|
1264
1264
|
disabledIds: string[];
|
1265
1265
|
}>;
|
1266
1266
|
simplifyMessage: typeof import("./utils").simplifyMessage;
|
@@ -1414,9 +1414,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
1414
1414
|
}>> & {
|
1415
1415
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
1416
1416
|
}, {
|
1417
|
+
title: string;
|
1417
1418
|
defaultValue: AnyObject[];
|
1418
1419
|
mode: string;
|
1419
|
-
title: string;
|
1420
1420
|
disabledIds: string[];
|
1421
1421
|
}>;
|
1422
1422
|
emojis: {
|
@@ -1611,9 +1611,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
1611
1611
|
}>> & {
|
1612
1612
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
1613
1613
|
}, {
|
1614
|
+
title: string;
|
1614
1615
|
defaultValue: AnyObject[];
|
1615
1616
|
mode: string;
|
1616
|
-
title: string;
|
1617
1617
|
disabledIds: string[];
|
1618
1618
|
}>;
|
1619
1619
|
Video: import("vue").DefineComponent<{}, {
|
@@ -1839,9 +1839,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
1839
1839
|
}>> & {
|
1840
1840
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
1841
1841
|
}, {
|
1842
|
+
title: string;
|
1842
1843
|
defaultValue: AnyObject[];
|
1843
1844
|
mode: string;
|
1844
|
-
title: string;
|
1845
1845
|
disabledIds: string[];
|
1846
1846
|
}>;
|
1847
1847
|
Call: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
@@ -108,9 +108,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
108
108
|
}>> & {
|
109
109
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
110
110
|
}, {
|
111
|
+
title: string;
|
111
112
|
defaultValue: AnyObject[];
|
112
113
|
mode: string;
|
113
|
-
title: string;
|
114
114
|
disabledIds: string[];
|
115
115
|
}>;
|
116
116
|
export default _default;
|
@@ -164,9 +164,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
164
164
|
}>> & {
|
165
165
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
166
166
|
}, {
|
167
|
+
title: string;
|
167
168
|
defaultValue: AnyObject[];
|
168
169
|
mode: string;
|
169
|
-
title: string;
|
170
170
|
disabledIds: string[];
|
171
171
|
}>;
|
172
172
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
@@ -144,9 +144,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
144
144
|
}>> & {
|
145
145
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
146
146
|
}, {
|
147
|
+
title: string;
|
147
148
|
defaultValue: AnyObject[];
|
148
149
|
mode: string;
|
149
|
-
title: string;
|
150
150
|
disabledIds: string[];
|
151
151
|
}>;
|
152
152
|
emojis: {
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as n,computed as t,watch as o,withDirectives as
|
1
|
+
import{defineComponent as e,ref as n,computed as t,watch as o,withDirectives as i,openBlock as s,createElementBlock as r,normalizeStyle as a,unref as c,createElementVNode as l,toDisplayString as u,createVNode as f,createCommentVNode as d,withCtx as m,Fragment as g,renderList as p,createBlock as h,createTextVNode as y,mergeProps as v,vShow as w}from"vue";import{NIcon as M,NTooltip as _,NPopover as k,NButton as E,NUpload as C,NUploadTrigger as T}from"naive-ui";import I from"./ChatAdd.vue.js";import{useState as x}from"../hooks/useState.js";import{useSession as b}from"../hooks/useSession.js";import{MESSAGE_TYPE as j,AV_STATUS as z}from"../constants/index.js";import"trtc-sdk-v5";import{simplifyMessage as L,base64ToFile as O}from"../utils/index.js";import{emojis as R}from"../utils/emoji.js";import{uploadFileApi as q}from"../api/index.js";import{CloseCircleOutline as D,CallOutline as $,VideocamOutline as A}from"@vicons/ionicons5";import{xor as H,uniq as J,trim as V,cloneDeep as K}from"lodash-es";import{uuidGenerator as F}from"../../../../shared/utils/index.js";import{useStorage as U}from"@vueuse/core";const G={key:0,class:"reference-content-box"},N={class:"reference-content"},X=["innerHTML"],B={class:"tool-box"},S=l("i",{class:"chat--iconfont chat--icon-face"},null,-1),P=l("span",null,"最近使用",-1),Q={class:"list-box",style:{"margin-bottom":"8px"}},W=["src"],Y=l("span",null,"默认表情",-1),Z={class:"list-box"},ee=["src"],ne=l("i",{class:"chat--iconfont chat--icon-good"},null,-1),te=l("i",{class:"chat--iconfont chat--icon-image"},null,-1),oe=l("i",{class:"chat--iconfont chat--icon-folder"},null,-1),ie={class:"btn-box"},se=l("span",{class:"tip"},"Enter 发送, Ctrl + Enter 换行",-1);var re=e({__name:"ChatFooter",setup(e){const re=n(),{state:ae,sendMessage:ce}=x(),{isGroupChat:le}=b(ae),ue=n(!1),fe=n(""),de=U("commonEmoticons",[]),me=t((()=>({options:ae.currentGroupUser,defaultValue:[ae.userInfo]}))),ge=t((()=>!fe.value.replace(/( |\s|<br>)+/g,"")));function pe(e,n=[]){const t=F(),o=[],i=n.length>0;ae.showVideo||ae.showMultipleVideo||(i?(o.push(...H(n,[ae.userInfo.id])),Object.assign(ae.currentAVMsg,{callMode:"call",checkedIds:o,strRoomId:t,chatMessageType:e}),ae.showMultipleVideo=!0):ce({content:{chatMessageType:e,msg:"",avStatus:z.IN_CALL}}))}function he(e){["Enter"].includes(e.key)&&(e.ctrlKey&&(e.preventDefault(),document.execCommand("InsertLineBreak")),function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),_e()))}function ye(){var e;fe.value=(null==(e=re.value)?void 0:e.innerHTML)||""}function ve(e){var n;de.value.unshift(e),de.value=J(de.value).slice(0,26),null==(n=re.value)||n.focus(),document.execCommand("insertHTML",!1,`<img data-msg=${e} data-type=${j.EMOJI} class="emoji--min" src=${R.findEmoji(e)} />`)}async function we(e){const n=new FormData;return n.append("sender",ae.userInfo.id),n.append("file",e),await q(n)}async function Me(e,n){const{file:t,name:o}=e.file,i=await we(t);if(!i)return console.log("上传失败");ke({chatMessageType:n,msg:n===j.FILE?o:i,url:i})}async function _e(){const{innerHTML:e="",innerText:n="",outerText:t=""}=re.value||{};if(ge.value)return console.log("请输入内容");let o=j.TEXT,i="";if(e){const t=e.match(/<img[^>]*>/gi),s=(t||[]).length;if(n&&0===s)i=n;else if(n||1!==s){if(o=j.BLEND,i=e,null==t?void 0:t.length)for(let e=0;e<s;e++)if(t[e].includes(`data-type="${j.EMOJI}"`)){const n=t[e].match(/data-msg="(.*?)"/);n&&n.length>1&&(i=i.replace(t[e],`[${n[1]}]`))}else{const n=t[e].match(/src\s*=\s*"([^"]*)"/);if(n&&n.length>1){const e=await O(n[1]);if(e){const t=await we(e);i=i.replace(n[1],t||"")}}}}else if(e.includes(j.EMOJI)){o=j.EMOJI;const n=e.match(/data-msg\s*=\s*"([^"]*)"/);n&&(i=n[1])}else{o=j.IMAGE;const n=e.match(/src\s*=\s*"([^"]*)"/);if(n){const e=await O(n[1]);if(e){const n=await we(e);n&&(i=n)}}}}else i=V(n);i&&ke({msg:i,chatMessageType:o,origin:"btn"})}async function ke(e){const{chatMessageType:n=j.TEXT,msg:t,url:o,origin:i=""}=e,s={msg:t,chatMessageType:n};n===j.FILE&&(s.fileUrl=o),"btn"===i&&Ee(),ae.currentReferenceMsg&&([j.TEXT,j.EMOJI,j.BLEND].includes(n)&&(s.referenceContent=K(ae.currentReferenceMsg)),ae.currentReferenceMsg=null),ce({content:s})}function Ee(){re.value.innerHTML="",fe.value=""}return o((()=>[ae.currentReferenceMsg,ae.currentReEditMsg]),(([e,n])=>{var t;if((e||n)&&(null==(t=re.value)||t.focus()),n){const{chatMessageType:e,msg:t}=n.content||{},o=e===j.TEXT?t:`<img data-msg=${t} data-type=${j.EMOJI} class="emoji--min" src=${R.findEmoji(t)} />`;document.execCommand("insertHTML",!1,o),ae.currentReEditMsg=null}})),o((()=>ae.id),(e=>{e&&Ee()})),(e,n)=>i((s(),r("section",{class:"chat-footer",style:a({cursor:c(ae).id?"default":"not-allowed"})},[c(ae).currentReferenceMsg?(s(),r("div",G,[l("div",N,[l("span",null,u(c(ae).currentReferenceMsg.senderName)+":",1),l("pre",{innerHTML:c(L)(c(ae).currentReferenceMsg.content)},null,8,X)]),f(c(M),{component:c(D),onClick:n[0]||(n[0]=()=>c(ae).currentReferenceMsg=null)},null,8,["component"])])):d("v-if",!0),l("div",B,[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(k),{"content-class":"emoji-content",class:"emoji-wrapper",show:ue.value,"onUpdate:show":n[1]||(n[1]=e=>ue.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny"},{icon:m((()=>[S])),_:1})])),default:m((()=>[c(de).length>0?(s(),r(g,{key:0},[P,l("div",Q,[(s(!0),r(g,null,p(c(de),(e=>(s(),h(c(_),{key:e,"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:()=>ve(e)},{icon:m((()=>[l("img",{src:c(R).findEmoji(e)},null,8,W)])),_:2},1032,["onClick"])])),default:m((()=>[y(" "+u(e),1)])),_:2},1024)))),128))])],64)):d("v-if",!0),Y,l("div",Z,[(s(!0),r(g,null,p(c(R).default,(([e,n])=>(s(),h(c(_),{key:e,"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:()=>ve(e)},{icon:m((()=>[l("img",{src:n},null,8,ee)])),_:2},1032,["onClick"])])),default:m((()=>[y(" "+u(e),1)])),_:2},1024)))),128))])])),_:1},8,["show"])])),default:m((()=>[y(" 表情 ")])),_:1}),f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:n[2]||(n[2]=()=>ke({chatMessageType:c(j).EMOJI,msg:0}))},{icon:m((()=>[ne])),_:1})])),default:m((()=>[y(" 点赞 ")])),_:1}),f(c(C),{abstract:"",multiple:"",accept:"image/*",onChange:n[3]||(n[3]=e=>Me(e,c(j).IMAGE))},{default:m((()=>[f(c(T),{abstract:""},{default:m((({handleClick:e})=>[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:e},{icon:m((()=>[te])),_:2},1032,["onClick"])])),default:m((()=>[y(" 上传图片 ")])),_:2},1024)])),_:1})])),_:1}),f(c(C),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:n[4]||(n[4]=e=>Me(e,c(j).FILE))},{default:m((()=>[f(c(T),{abstract:""},{default:m((({handleClick:e})=>[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:e},{icon:m((()=>[oe])),_:2},1032,["onClick"])])),default:m((()=>[y(" 上传文件 ")])),_:2},1024)])),_:1})])),_:1}),c(le)?(s(),r(g,{key:0},[f(I,v(c(me),{onComfirm:n[5]||(n[5]=e=>pe(c(j).AUDIO,e))}),{trigger:m((()=>[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny"},{icon:m((()=>[f(c(M),{size:"18",component:c($)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 语音通话 ")])),_:1})])),_:1},16),f(I,v(c(me),{onComfirm:n[6]||(n[6]=e=>pe(c(j).VIDEO,e))}),{trigger:m((()=>[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny"},{icon:m((()=>[f(c(M),{size:"20",component:c(A)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 视频会议 ")])),_:1})])),_:1},16)],64)):(s(),r(g,{key:1},[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:n[7]||(n[7]=()=>pe(c(j).AUDIO))},{icon:m((()=>[f(c(M),{size:"18",component:c($)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 语音通话 ")])),_:1}),f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:n[8]||(n[8]=()=>pe(c(j).VIDEO))},{icon:m((()=>[f(c(M),{size:"20",component:c(A)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 视频通话 ")])),_:1})],64))]),i(l("div",{ref_key:"inputRef",ref:re,class:"input-box",contenteditable:"",onKeydown:he,onInput:ye},null,544),[[w,c(ae).id]]),l("div",ie,[se,f(c(E),{type:"primary",round:"",disabled:c(ge),onClick:_e},{default:m((()=>[y("发送")])),_:1},8,["disabled"])])],4)),[[w,c(ae).id]])}});export{re as default};
|
@@ -299,9 +299,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
299
299
|
}>> & {
|
300
300
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
301
301
|
}, {
|
302
|
+
title: string;
|
302
303
|
defaultValue: AnyObject[];
|
303
304
|
mode: string;
|
304
|
-
title: string;
|
305
305
|
disabledIds: string[];
|
306
306
|
}>;
|
307
307
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
@@ -468,9 +468,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
468
468
|
}>> & {
|
469
469
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
470
470
|
}, {
|
471
|
+
title: string;
|
471
472
|
defaultValue: AnyObject[];
|
472
473
|
mode: string;
|
473
|
-
title: string;
|
474
474
|
disabledIds: string[];
|
475
475
|
}>;
|
476
476
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
@@ -768,9 +768,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
768
768
|
}>> & {
|
769
769
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
770
770
|
}, {
|
771
|
+
title: string;
|
771
772
|
defaultValue: AnyObject[];
|
772
773
|
mode: string;
|
773
|
-
title: string;
|
774
774
|
disabledIds: string[];
|
775
775
|
}>;
|
776
776
|
PersonAddOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
@@ -37,7 +37,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
37
37
|
showMessage: (item: AnyObject) => boolean;
|
38
38
|
showReEdit: (item: AnyObject) => boolean;
|
39
39
|
showReferenceMsg: (item: AnyObject) => any;
|
40
|
-
showBlendMsg: (item: AnyObject) =>
|
40
|
+
showBlendMsg: (item: AnyObject) => number | false | null;
|
41
41
|
showTemplateMsg: (item: AnyObject, type: 'system' | 'template') => boolean | undefined;
|
42
42
|
isTemplate3: (content: AnyObject) => boolean;
|
43
43
|
needShowTime: (item: AnyObject, index: number) => boolean;
|
@@ -339,9 +339,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
339
339
|
}>> & {
|
340
340
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
341
341
|
}, {
|
342
|
+
title: string;
|
342
343
|
defaultValue: AnyObject[];
|
343
344
|
mode: string;
|
344
|
-
title: string;
|
345
345
|
disabledIds: string[];
|
346
346
|
}>;
|
347
347
|
simplifyMessage: typeof simplifyMessage;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,computed as n,watch as s,openBlock as o,createElementBlock as i,normalizeClass as r,unref as a,normalizeStyle as c,createVNode as l,withCtx as u,Fragment as m,renderList as p,toDisplayString as d,createCommentVNode as f,createBlock as g,createElementVNode as v,createTextVNode as y,withModifiers as h,nextTick as T}from"vue";import{NImageGroup as M,NButton as k,NAvatar as _,NImage as x,NIcon as I,NSpace as C,NButtonGroup as w,NTooltip as S}from"naive-ui";import{format as j}from"date-fns";import{getHistoryRecordApi as E,readMessageApi as L}from"../api/index.js";import{useState as b}from"../hooks/useState.js";import{useSession as A}from"../hooks/useSession.js";import{MESSAGE_TYPE as z}from"../constants/index.js";import"trtc-sdk-v5";import{isAudioOrVideoMessage as H,simplifyMessage as D,getAVTime as R,downloadFile as N}from"../utils/index.js";import{first as O,last as P}from"lodash-es";import
|
1
|
+
import{defineComponent as e,ref as t,computed as n,watch as s,openBlock as o,createElementBlock as i,normalizeClass as r,unref as a,normalizeStyle as c,createVNode as l,withCtx as u,Fragment as m,renderList as p,toDisplayString as d,createCommentVNode as f,createBlock as g,createElementVNode as v,createTextVNode as y,withModifiers as h,nextTick as T}from"vue";import{NImageGroup as M,NButton as k,NAvatar as _,NImage as x,NIcon as I,NSpace as C,NButtonGroup as w,NTooltip as S}from"naive-ui";import{format as j}from"date-fns";import{getHistoryRecordApi as E,readMessageApi as L}from"../api/index.js";import{useState as b}from"../hooks/useState.js";import{useSession as A}from"../hooks/useSession.js";import{MESSAGE_TYPE as z}from"../constants/index.js";import"trtc-sdk-v5";import{isAudioOrVideoMessage as H,simplifyMessage as D,getAVTime as R,downloadFile as N}from"../utils/index.js";import{first as O,last as P,toString as q}from"lodash-es";import B from"./PersonProfile.vue.js";import J from"./MessageTemplate.vue.js";import{emojis as W}from"../utils/emoji.js";import U from"./ContextMenu.js";import X from"./ChatAdd.vue.js";import"../../../../shared/utils/index.js";import"@vueuse/core";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{CallOutline as F,VideocamOutline as G,DocumentSharp as K,ChatbubbleEllipsesOutline as Y,EllipsisHorizontal as $,ArrowDownSharp as Q}from"@vicons/ionicons5";import{useScrollLoading as V}from"../../../../shared/hooks/useScrollLoading.js";const Z={key:0,class:"tip-text"},ee={key:1,class:"tip-text"},te={key:2,class:"message-box"},ne={key:0,class:"content-box"},se={class:"name-box"},oe=["data-time"],ie=["onContextmenu"],re={key:0,class:"reference-content"},ae=["innerHTML"],ce=["src"],le=["innerHTML"],ue=["innerHTML"],me={style:{"margin-left":"8px"}},pe={class:"size"};var de=e({__name:"ChatMain",setup(e){const de=t(),{state:fe,setMsgList:ge,relayMessage:ve}=b(),{setCurrentSessionItem:ye,isGroupChat:he}=A(fe),Te=t(),Me=t(!1),ke=t({left:0,top:0}),_e=t(),xe=t(),Ie={page:0,hasMore:!0,lastSendTime:j(new Date,"yyyy-MM-dd HH:mm:ss")},Ce=n((()=>({"--c-tip-top":he.value?"1px":"-20px","--c-tip-gap":he.value?"10px":"0px"})));function we({nodes:e}){var t,n;const{_ctx:s}=null==(t=e.download)?void 0:t.children,o=s?null==(n=null==s?void 0:s.proxy)?void 0:n.previewSrc:"";return[e.prev,e.next,e.rotateCounterclockwise,e.rotateClockwise,e.resizeToOriginalSize,e.zoomOut,e.zoomIn,l(S,null,{trigger:()=>l(I,{style:"cursor: pointer",color:"rgba(255, 255, 255, 0.75",size:24,component:Q,onClick:()=>o&&N(o,"img")},null),default:()=>"下载"}),e.close]}async function Se(){try{if(!Ie.hasMore)return;Ie.page++;const e=await E({sessionKey:fe.currentSessionItem.sessionKey,page:Ie.page,lastSendTime:Ie.lastSendTime});if(!Array.isArray(e)||0===e.length)return Ie.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");const t=O(e).id;Ie.lastSendTime=P(e).sendTime,ge(Ie.page>1?[...fe.msgList,...e]:e),1===Ie.page&&fe.currentSessionItem.unreadNum&&(await L({chatType:fe.currentSessionItem.chatType,messageIdSet:[t],receiver:fe.userInfo.id,sender:fe.currentSessionItem.receiver}),ye({unreadNum:0}))}catch(e){console.log(e)}}async function je(e,t){_e.value=t,async function(e){var t,n,s,o,i,r;Me.value=!0,await T();const{clientX:a,clientY:c}=e,{width:l=0,height:u=0,left:m=0,top:p=0}=(null==(t=de.value)?void 0:t.getBoundingClientRect())||{},d=null!=(o=null==(s=null==(n=Te.value)?void 0:n.$el)?void 0:s.getBoundingClientRect().height)?o:220,f=null!=(r=null==(i=de.value)?void 0:i.scrollTop)?r:0,g=5,v={};a<=m+l/2?v.left=a-m+g+"px":v.right=m+l-a-g+"px";c-p<d/2?v.top=f+g+"px":p+u-c<=d/2?v.bottom=Math.abs(f)+g+"px":v.top=f+c-p-d/2+"px";ke.value=v}(e)}function Ee(e){const{chatMessageType:t,messageTemplate:n}=e.content;return t!==z.TEMPLATE||!!n}function Le(e){const{chatMessageType:t}=e.content;return e.sender===fe.userInfo.id&&Date.now()-new Date(e.sendTime).getTime()<864e5&&[z.TEXT,z.EMOJI].includes(t)}function be(e){const{chatMessageType:t,msg:n=""}=e.content;if(t===z.BLEND){const e=q(n).match(/<img[^>]*>/gi);return!e||!e.length}return t&&[z.TEXT,z.EMOJI].includes(t)}function Ae(e){const{chatMessageType:t,msg:n=""}=e.content,s=q(n).match(/<img[^>]*>/gi);return t===z.BLEND&&s&&s.length}function ze(e,t){var n,s;const{chatMessageType:o,messageTemplate:i}=e.content;if(o===z.TEMPLATE)return"system"===t?2==(null==(n=null==i?void 0:i.setting)?void 0:n.style.id):2!=(null==(s=null==i?void 0:i.setting)?void 0:s.style.id)}function He(e){var t,n;const{chatMessageType:s,messageTemplate:o}=e;return s===z.TEMPLATE&&3==(null==(n=null==(t=null==o?void 0:o.setting)?void 0:t.style)?void 0:n.id)}function De(e,t){var n;const s=new Date(e.sendTime).getTime(),o=null==(n=fe.msgList[t+1])?void 0:n.sendTime;if(o){return s-new Date(o).getTime()>3e5}return!0}function Re(e){fe.currentReferenceMsg=e,fe.currentReferenceMsg.content.referenceContent=null,Object.assign(fe.currentReferenceMsg,{chatType:fe.currentSessionItem.chatType,receiver:fe.currentSessionItem.receiver,receiverAvatar:fe.currentSessionItem.avatar,receiverName:fe.currentSessionItem.name})}function Ne(e,t){var n;"reply"!==e?"relay"===e&&(null==(n=xe.value)||n.click()):Re(t)}function Oe(e,t){const n=fe.msgList.find((e=>e.id===_e.value));ve({checkedIds:e,remark:t,content:n.content})}return V(de,(()=>{Se()}),"top",(()=>{Me.value=!1})),s((()=>fe.id),(e=>{e&&(fe.currentReferenceMsg=null,Object.assign(Ie,{page:0,hasMore:!0,lastSendTime:j(new Date,"yyyy-MM-dd HH:mm:ss")}),Se())}),{immediate:!0}),s((()=>fe.isAppendMsg),(e=>{e&&(ge([fe.currentMsg,...fe.msgList]),async function(){var e;null==(e=de.value)||e.scrollTo({top:0,behavior:"auto"})}(),fe.isAppendMsg=!1)}),{immediate:!0}),(e,t)=>(o(),i("div",{class:r(["chat-main",{"home-bg":!a(fe).id}]),ref_key:"chatMainRef",ref:de,style:c(a(Ce))},[l(a(M),{"show-toolbar-tooltip":"","render-toolbar":we},{default:u((()=>[(o(!0),i(m,null,p(a(fe).msgList,((e,t)=>(o(),i(m,{key:e.id},[Ee(e)?(o(),i("div",{key:0,class:r(["message-item",{"message-item--mine":e.sender==a(fe).userInfo.id}])},[De(e,t)?(o(),i("p",Z,d(e.__sendTime),1)):f("v-if",!0),ze(e,"system")||"WITHDRAWN"===e.status?(o(),i(m,{key:1},[ze(e,"system")?(o(),g(J,{key:0,data:e},null,8,["data"])):f("v-if",!0),"WITHDRAWN"===e.status?(o(),i("p",ee,[v("span",null,d(e.sender==a(fe).userInfo.id?"你":e.senderName)+"撤回了一条消息",1),Le(e)?(o(),g(a(k),{key:0,size:"tiny",style:{color:"var(--c-primary-color)","margin-left":"5px"},text:"",onClick:()=>function(e){fe.currentReEditMsg=e}(e)},{default:u((()=>[y(" 重新编辑 ")])),_:2},1032,["onClick"])):f("v-if",!0)])):f("v-if",!0)],64)):(o(),i("div",te,[l(B,{"user-id":e.sender,placement:e.sender==a(fe).userInfo.id?"left":"right"},{trigger:u((()=>[l(a(_),{round:"",size:38,src:e.senderAvatar},null,8,["src"])])),_:2},1032,["user-id","placement"]),e.content?(o(),i("div",ne,[v("div",se,[v("span",{class:"name","data-time":e.__time},d(a(he)?e.senderName:""),9,oe)]),v("div",{class:r(["content",{emoji:e.content.chatMessageType===a(z).EMOJI&&!e.content.referenceContent,template:e.content.chatMessageType===a(z).TEMPLATE,"template--3":He(e.content),"audio-video":a(H)(e.content),file:e.content.chatMessageType===a(z).FILE}]),onContextmenu:h((t=>je(t,e.id)),["prevent"])},[be(e)?(o(),i(m,{key:0},[e.content.referenceContent?(o(),i("div",re,[v("span",null,d(e.content.referenceContent.senderName)+":",1),v("pre",{innerHTML:a(D)(e.content.referenceContent.content)},null,8,ae)])):f("v-if",!0),e.content.chatMessageType===a(z).EMOJI?(o(),i("img",{key:1,class:r([e.content.referenceContent?"emoji--min":"emoji--big"]),src:a(W).findEmoji(e.__content)},null,10,ce)):(o(),i("pre",{key:2,innerHTML:e.__content},null,8,le))],64)):f("v-if",!0),Ae(e)?(o(),i("pre",{key:1,innerHTML:e.__content},null,8,ue)):f("v-if",!0),ze(e,"template")?(o(),g(J,{key:2,data:e},null,8,["data"])):f("v-if",!0),e.content.chatMessageType===a(z).IMAGE?(o(),g(a(x),{key:3,width:"240",src:e.__content},null,8,["src"])):f("v-if",!0),a(H)(e.content)?(o(),i(m,{key:4},[l(a(I),{class:r({"is-audio":e.content.chatMessageType===a(z).AUDIO}),component:e.content.chatMessageType===a(z).AUDIO?a(F):a(G)},null,8,["class","component"]),v("span",me,d(a(R)(e.__content)),1)],64)):f("v-if",!0),e.content.chatMessageType===a(z).FILE?(o(),g(a(C),{key:5,"wrap-item":!1},{default:u((()=>[l(a(I),{class:"icon-file",size:"40",component:a(K)},null,8,["component"]),l(a(C),{"wrap-item":!1,vertical:"",justify:"space-between",style:{"row-gap":"0"}},{default:u((()=>[v("span",null,d(e.__content),1),v("span",pe,d(e.__size),1)])),_:2},1024)])),_:2},1024)):f("v-if",!0),l(a(w),{class:"quick-menu"},{default:u((()=>[a(H)(e.content)?f("v-if",!0):(o(),i(m,{key:0},[f(' <n-button quaternary size="tiny">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<template #icon>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<i class="chat--iconfont chat--icon-face" />\r\n\t\t\t\t\t\t\t\t\t\t\t\t</template>\r\n\t\t\t\t\t\t\t\t\t\t\t</n-button> '),l(a(k),{quaternary:"",size:"tiny",onClick:()=>Re(e)},{icon:u((()=>[l(a(I),{size:"17",component:a(Y)},null,8,["component"])])),_:2},1032,["onClick"])],64)),l(a(k),{quaternary:"",size:"tiny",onClick:t=>je(t,e.id)},{icon:u((()=>[l(a(I),{size:"14",component:a($)},null,8,["component"])])),_:2},1032,["onClick"])])),_:2},1024)],42,ie)])):f("v-if",!0)]))],2)):f("v-if",!0)],64)))),128))])),_:1}),l(a(U),{ref_key:"contextmenuRef",ref:Te,show:Me.value,"onUpdate:show":t[0]||(t[0]=e=>Me.value=e),position:ke.value,"msg-id":_e.value,onSelect:Ne},null,8,["show","position","msg-id"]),l(X,{title:"转发消息",mode:"relay",onComfirm:Oe},{trigger:u((()=>[v("span",{style:{display:"none"},ref_key:"relayTriggerRef",ref:xe},"转发",512)])),_:1})],6))}});export{de as default};
|
@@ -212,9 +212,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
212
212
|
}>> & {
|
213
213
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
214
214
|
}, {
|
215
|
+
title: string;
|
215
216
|
defaultValue: AnyObject[];
|
216
217
|
mode: string;
|
217
|
-
title: string;
|
218
218
|
disabledIds: string[];
|
219
219
|
}>;
|
220
220
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,computed as s,withDirectives as o,createVNode as i,vShow as n,isVNode as r}from"vue";import{NButtonGroup as a,NButton as l,NIcon as c}from"naive-ui";import{CopyOutline as m,OpenOutline as d,ChatbubbleEllipsesOutline as u,ReturnDownBack as p,DownloadOutline as g}from"@vicons/ionicons5";import{onClickOutside as f}from"@vueuse/core";import{useState as y}from"../hooks/useState.js";import{useSession as w}from"../hooks/useSession.js";import{MESSAGE_TYPE as h}from"../constants/index.js";import"trtc-sdk-v5";import{isAudioOrVideoMessage as
|
1
|
+
import{defineComponent as e,ref as t,computed as s,withDirectives as o,createVNode as i,vShow as n,isVNode as r}from"vue";import{NButtonGroup as a,NButton as l,NIcon as c}from"naive-ui";import{CopyOutline as m,OpenOutline as d,ChatbubbleEllipsesOutline as u,ReturnDownBack as p,DownloadOutline as g}from"@vicons/ionicons5";import{onClickOutside as f}from"@vueuse/core";import{useState as y}from"../hooks/useState.js";import{useSession as w}from"../hooks/useSession.js";import{MESSAGE_TYPE as h}from"../constants/index.js";import"trtc-sdk-v5";import{isAudioOrVideoMessage as I,downloadFile as v}from"../utils/index.js";import{emojis as T}from"../utils/emoji.js";import{recallMessageApi as M}from"../api/index.js";import{format as b}from"date-fns";var E=e({name:"PopupMenu",inheritAttrs:!1,props:{show:{type:Boolean,default:!1},position:{type:Object},msgId:{type:String}},emits:["update:show","select"],setup(e,{attrs:E,slots:j,emit:k}){const{state:S,setMsgList:x}=y(),{setCurrentSessionItem:L}=w(S),A=[{icon:m,label:"复制",key:"copy"},{icon:d,label:"转发",key:"relay"},{icon:u,label:"回复",key:"reply"},{icon:p,label:"撤回",key:"withdraw"},{icon:g,label:"下载",key:"download"}],O=t(null),D=s((()=>S.msgList.find((({id:t})=>t===e.msgId)))),W=s((()=>{if(!e.msgId)return[];if(!(null==D?void 0:D.value))return[];const{content:t={},sendTime:s,sender:o}=D.value,{chatMessageType:i}=t,n=[];return(o!==S.userInfo.id||i===h.TEMPLATE||o===S.userInfo.id&&Date.now()-new Date(s).getTime()>2592e5)&&n.push("withdraw"),[h.TEXT,h.EMOJI,h.BLEND].includes(i)?n.push("download"):I(t)?n.push("copy","relay","reply","download"):i===h.FILE?n.push("copy"):[h.FORWARD,h.TEMPLATE].includes(i)&&n.push("copy","download"),n.length?A.filter((e=>!n.includes(e.key))):A}));return f(O,(e=>{k("update:show",!1)})),()=>{let t;return e.msgId&&W.value?o(i("div",{class:"contextmenu-wrapper",ref:O,style:e.position},[i(a,{vertical:!0},(s=t=W.value.map((t=>i(l,{onClick:()=>async function(t){k("update:show",!1);const{content:s={},sendTime:o,sender:i}=D.value||{},{chatMessageType:n}=s;switch(t){case"copy":if(!s.msg)return console.log("复制内容为空!");if(!navigator||!("clipboard"in navigator))return console.log("当前浏览器版本不支持复制!");try{if(n===h.TEXT)await navigator.clipboard.writeText(s.msg);else{let e;if([h.EMOJI,h.IMAGE].includes(n)){const t=n===h.EMOJI?T.findEmoji(s.msg):s.msg;e=`<img data-msg=${s.msg} data-type=${n} class=${n===h.EMOJI?"emoji--min":""} src=${t} />`}else e=s.msg;await navigator.clipboard.write([new window.ClipboardItem({"text/html":new Blob([e],{type:"text/html"})})])}}catch(e){console.log("复制失败!")}return;case"download":{let{fileUrl:e,msg:t}=s;return n===h.IMAGE&&(e=t,t=t.match(/\/([^\/?#]+)$/)[1]),void v(e,t)}case"withdraw":{const t=S.msgList.findIndex((({id:t})=>t===e.msgId)),s=0===t;if(await M({chatType:S.currentSessionItem.chatType,messageIdSet:[e.msgId],receiver:S.currentSessionItem.receiver,sender:S.userInfo.id,isLastMessage:s}),S.msgList[t].status="WITHDRAWN",s){const e=b(new Date,"yyyy-MM-dd HH:mm:ss");L({lastMessageStatus:"WITHDRAWN",lastMessageSendTime:e,sortTime:e,updatedTime:e})}return}}k("select",t,D.value)}(t.key),quaternary:!0},{default:()=>t.label,icon:()=>i(c,{component:t.icon},null)}))),"function"==typeof s||"[object Object]"===Object.prototype.toString.call(s)&&!r(s)?t:{default:()=>[t]}))]),[[n,e.show]]):null;var s}}});export{E as default};
|
@@ -160,9 +160,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
160
160
|
}>> & {
|
161
161
|
onComfirm?: ((...args: any[]) => any) | undefined;
|
162
162
|
}, {
|
163
|
+
title: string;
|
163
164
|
defaultValue: AnyObject[];
|
164
165
|
mode: string;
|
165
|
-
title: string;
|
166
166
|
disabledIds: string[];
|
167
167
|
}>;
|
168
168
|
Call: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as t,ref as e,reactive as a,computed as o,openBlock as l,createBlock as
|
1
|
+
import{defineComponent as t,ref as e,reactive as a,computed as o,openBlock as l,createBlock as r,unref as n,withCtx as s,renderSlot as i,createElementBlock as c,Fragment as u,withDirectives as d,createElementVNode as p,createVNode as m,createCommentVNode as v,toDisplayString as f,createTextVNode as g,renderList as y,vShow as k}from"vue";import{NPopover as h,NAvatar as b,NButton as w,NIcon as j}from"naive-ui";import{ChatbubbleEllipses as C,EyeOffOutline as I,EyeOutline as _,Close as x}from"@vicons/ionicons5";import{useState as z}from"../hooks/useState.js";import{useSession as N}from"../hooks/useSession.js";import{CHAT_TYPE as S}from"../constants/index.js";import"trtc-sdk-v5";import"date-fns";import"lodash-es";import"../utils/emoji.js";import"../../../../shared/utils/index.js";import{openSessionApi as $,getUserDetailApi as D}from"../api/index.js";const E={class:"person-profile-main"},L={class:"left"},P={class:"profile"},q={class:"profile__text"},B={class:"right"},G={class:"right__content"},O={class:"label"},T={class:"content"};var U=t({__name:"PersonProfile",props:{userId:{type:String,required:!0},disabled:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:U}){const A=t,{state:F}=z(),{openSession:H}=N(F),J=e(!1),K=e(!1),M=e(!1),Q=a({}),R=[{label:"机构",value:"",key:"orgName"},{label:"姓名",value:"",key:"name"},{label:"归属科室",value:"",key:"deptName"},{label:"业务科室",value:"",key:"businessDeptNames"},{label:"手机号",value:"",key:"phone"},{label:"岗位",value:"",key:"post"},{label:"工号",value:"",key:"jobId"},{label:"性别",value:"",key:"orgName"}],V=o((()=>(Q.id&&R.forEach((t=>{const{key:e}=t;t.value=Q[e]})),R)));async function W(){J.value=!1;let t=F.sessionList.find((t=>t.receiver===A.userId));if(!t)try{t=await $({chatType:S.SINGLE,receiver:A.userId,sender:F.userInfo.id})}catch(t){console.log("error :>> ",t)}t&&H(t),U("close")}async function X(t){if(!t)return;const e=await D({userId:A.userId});(null==e?void 0:e.id)?Object.assign(Q,e):Q.id=""}function Y(t){const{key:e,value:a}=t;return"phone"!==e||M.value?a:(a||"").replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}return(e,a)=>(l(),r(n(h),{raw:"",class:"person-profile-wrapper",show:J.value,"onUpdate:show":[a[3]||(a[3]=t=>J.value=t),X],trigger:t.disabled?"manual":"click","show-arrow":!1,to:"body",shift:""},{trigger:s((()=>[i(e.$slots,"trigger")])),default:s((()=>[Q.id?(l(),c(u,{key:0},[d(p("div",E,[p("div",L,[p("div",P,[m(n(b),{src:Q.avatar,bordered:"",round:"",size:100,onClickCapture:a[0]||(a[0]=t=>K.value=!0)},null,8,["src"]),v(' <n-upload abstract accept="image/*" @change="onChange">\r\n\t\t\t\t\t\t\t<n-upload-trigger #="{ handleClick }" abstract>\r\n\t\t\t\t\t\t\t\t<n-button\r\n\t\t\t\t\t\t\t\t\tcircle\r\n\t\t\t\t\t\t\t\t\tsecondary\r\n\t\t\t\t\t\t\t\t\tclass="edit-avatar"\r\n\t\t\t\t\t\t\t\t\tv-show="userDetail.id === state.userInfo.id"\r\n\t\t\t\t\t\t\t\t\t@click="handleClick"\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t<template #icon>\r\n\t\t\t\t\t\t\t\t\t\t<n-icon size="16" color="#666666" :component="Camera" />\r\n\t\t\t\t\t\t\t\t\t</template>\r\n\t\t\t\t\t\t\t\t</n-button>\r\n\t\t\t\t\t\t\t</n-upload-trigger>\r\n\t\t\t\t\t\t</n-upload> '),p("div",q,[p("h4",null,f(Q.name),1),p("p",null,f(Q.orgName),1)]),m(n(w),{strong:"",secondary:"",onClick:W},{default:s((()=>[m(n(j),{size:"13",color:"#666666",component:n(C),style:{"margin-right":"6px"}},null,8,["component"]),g(" 发消息 ")])),_:1})])]),p("div",B,[p("div",G,[(l(!0),c(u,null,y(n(V),((t,e)=>(l(),c("div",{class:"info-item",key:e},[p("span",O,f(t.label),1),p("div",T,[p("span",null,f(Y(t)),1),"phone"===t.key&&Y(t)?(l(),r(n(j),{key:0,size:"16",color:"#666666",component:M.value?n(I):n(_),style:{"margin-left":"10px"},onClick:a[1]||(a[1]=t=>M.value=!M.value)},null,8,["component"])):v("v-if",!0)])])))),128))])])],512),[[k,!K.value]]),d(p("div",{class:"large-avatar",onClick:a[2]||(a[2]=t=>K.value=!1)},[m(n(w),{circle:"",size:"small",secondary:""},{icon:s((()=>[m(n(j),{size:24,component:n(x),color:"#fff"},null,8,["component"])])),_:1}),m(n(b),{size:310,round:"",src:Q.avatar},null,8,["src"])],512),[[k,K.value]])],64)):v("v-if",!0)])),_:3},8,["show","trigger"]))}});export{U as default};
|
@@ -10,6 +10,6 @@ export declare function getAVTime(msg: string): string;
|
|
10
10
|
export declare function simplifyMessage(lastMessage: AnyObject): any;
|
11
11
|
export declare function downloadFile(url: string, filename: string): void;
|
12
12
|
export declare function getFileSize(url: string): Promise<unknown>;
|
13
|
-
export declare function base64ToFile(base64: string): File | undefined
|
13
|
+
export declare function base64ToFile(base64: string): Promise<File | undefined>;
|
14
14
|
export declare function isAudioOrVideoMessage(message: AnyObject): boolean;
|
15
15
|
export declare function formatSeconds(seconds: number): string;
|
@@ -1 +1 @@
|
|
1
|
-
import{isToday as e,format as t,isYesterday as n,startOfDay as r}from"date-fns";import{cloneDeep as
|
1
|
+
import{isToday as e,format as t,isYesterday as n,startOfDay as r}from"date-fns";import{cloneDeep as s,isNumber as o,isNaN as a}from"lodash-es";import{MESSAGE_TYPE as i}from"../constants/index.js";import{emojis as c}from"./emoji.js";import{uuidGenerator as l}from"../../../../shared/utils/index.js";function u(r){const s=new Date(r);let o,a;if(e(s))o=a=t(s,"HH:mm");else{o=n(s)?"昨天":t(s,"MM-dd");const e=s.getFullYear(),r=(new Date).getFullYear();a=t(s,e<r?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}return{siderMsgTime:o,msgTime:a,recordTime:function(r){const s=new Date(r),o=Date.now()-s.getTime();if(o<6e4)return"刚刚";if(o<36e5)return Math.ceil(o/1e3/60)+"分钟前";if(e(s))return"今天 "+t(s,"HH:mm");if(n(s))return"昨天 "+t(s,"HH:mm");{const e=s.getFullYear(),n=(new Date).getFullYear();return t(s,e<n?"yyyy年M月d日 HH:mm":"M月d日 HH:mm")}}(r)}}function m(e){return s(e).sort(((e,t)=>e.topping&&!t.topping?-1:!e.topping&&t.topping?1:new Date(t.sortTime).getTime()-new Date(e.sortTime).getTime()))}function p(e){if(!(null==e?void 0:e.msg))return"";const{chatMessageType:t="",msg:n=""}=e;let r=n.toString();if(t===i.BLEND){const e=r.match(/\[([^\]]+)\]/g);return null==e||e.forEach((e=>{const n=e.match(/\[([^\]]+)\]/);if(n&&n.length>1){const s=c.findEmoji(n[1]);s&&(r=r.replace(e,`<img data-msg=${n[1]} data-type=${t} class="emoji--min" src=${s} />`))}})),r}const s=e=>new RegExp("\\n*\\["+(e||"")+"(code|pre|div|span|p|table|thead|th|tbody|tr|td|ul|li|ol|li|dl|dt|dd|h2|h3|h4|h5)([\\s\\S]*?)]\\n*","g");return r=r.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""").replace(/@(\S+)(\s+?|$)/g,'@<a href="javascript:;">$1</a>$2').replace(s(),"<$1 $2>").replace(s("/"),"</$1>").replace(/\n/g,"<br>"),r}function d(e){if(e&&o(+e)&&!a(+e)){const t=H(+e),n=t.split(":");let r=t;return 3===n.length&&"00"===n[0]&&(r=`${n[1]}:${n[2]}`),"通话时长 "+r}return"已取消"}function g(e){var t;if(!e)return"";const{chatMessageType:n,msg:r,messageTemplate:s}=e,o=y(e)?d(r):"";switch(n){case i.TEXT:return p(e);case i.IMAGE:return"[图片]";case i.FILE:return"[文件]";case i.EMOJI:return`<img class="emoji--min" alt=${r} src=${c.findEmoji(r)}>`;case i.TEMPLATE:return null==(t=null==s?void 0:s.setting)?void 0:t.title;case i.VIDEO:return`[视频通话]${o}`;case i.AUDIO:return`[语音通话]${o}`;default:return"[消息]"}}function f(e,t){const n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="blob",n.onload=function(e){if(200===n.status){const e=window.URL.createObjectURL(n.response),r=document.createElement("a");r.href=e,r.download=t,r.dispatchEvent(new MouseEvent("click")),window.URL.revokeObjectURL(e)}},n.send()}function h(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("HEAD",e,!0),r.onreadystatechange=()=>{var e;if(4===r.readyState&&200===r.status){let n=null!=(e=r.getResponseHeader("Content-Length"))?e:0;const s=+n;s>1048576?n=(s/1048576).toFixed(2)+"M":s>1024?n=(s/1024).toFixed(2)+"K":n+="B",t(n)}},r.send()}))}async function w(e){try{const t=await fetch(e),n=await t.blob();return new File([n],`${l()}.${n.type.split("/")[1]}`,{type:n.type})}catch(e){return}}function y(e){return e&&[i.AUDIO,i.VIDEO].includes(e.chatMessageType)}function H(e){const n=r(new Date);return n.setSeconds(e),t(n,"HH:mm:ss")}export{w as base64ToFile,f as downloadFile,H as formatSeconds,u as formatTime,d as getAVTime,h as getFileSize,y as isAudioOrVideoMessage,m as listSort,g as simplifyMessage,p as transformMessage};
|
@@ -1 +1 @@
|
|
1
|
-
import{createVNode as e}from"vue";import"../../../index.js";import t from"./filter.vue.js";import{isValid as
|
1
|
+
import{createVNode as e}from"vue";import"../../../index.js";import{IhoTableRenderHelper as t}from"../../utils/index.js";import i from"./filter.vue.js";import{isValid as o,compareDesc as r}from"date-fns";import{isObject as n,isArray as l}from"@vue/shared";import{defineTablePlugin as f}from"../../hooks/useTablePlugin.js";function a(){const a="filterDaterangeRenderPlugin";return f({name:a,vxe(t){t.renderer.mixin({[a]:{showFilterFooter:!1,renderFilter:(t,o)=>e(i,{payload:o,key:o.column.field},null)}})},apply(e){e.fieldHooks.field.tap(a,((e,i,f,{$table:d})=>{var s,u,m;const c=null==(s=e.editRender)?void 0:s.props;if(!n(c))return e;if(!t.hasDateFilter(c))return e;e.filterRender={name:a};const p=null==(u=d.value)?void 0:u.getColumnByField(e.field),h={};return p&&l(p.filters)&&Object.assign(h,{...null==(m=p.filters)?void 0:m[0]}),e.filters=[{...h}],e.filterMethod||(e.filterMethod=function({option:e,row:t,column:i}){const{data:n}=e,l=t[i.field];return!!o(new Date(l))&&(r(new Date(l),new Date(n[0]))<=0&&r(new Date(l),new Date(n[1]))>=0)}),f.filterConfig={iconMatch:"iho-table--iconfont iho-table-icon-filter",iconNone:"iho-table--iconfont iho-table-icon-filter",...f.filterConfig},e}))}})}export{a as filterDaterangeRenderPlugin};
|
@@ -22,6 +22,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
22
22
|
close: () => Promise<void>;
|
23
23
|
OPTION_ITEM_HEIGHT: number;
|
24
24
|
viewCapacity: import("vue").ComputedRef<number>;
|
25
|
+
customFilterMethod: import("vue").ComputedRef<any>;
|
25
26
|
filteredList: import("vue").ComputedRef<import("vxe-table").VxeTableDefines.FilterOption[]>;
|
26
27
|
list: import("vue").Ref<import("@vueuse/core").UseVirtualListItem<import("vxe-table").VxeTableDefines.FilterOption>[]>;
|
27
28
|
containerProps: {
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as l,computed as a,ref as t,onDeactivated as u,onMounted as i,toRaw as n,openBlock as o,createElementBlock as r,unref as v,createBlock as s,createCommentVNode as c,createElementVNode as d,createVNode as p,isRef as f,withCtx as
|
1
|
+
import{defineComponent as e,inject as l,computed as a,ref as t,onDeactivated as u,onMounted as i,toRaw as n,openBlock as o,createElementBlock as r,unref as v,createBlock as s,createCommentVNode as c,createElementVNode as d,createVNode as p,isRef as f,withCtx as h,mergeProps as m,normalizeProps as _,guardReactiveProps as y,Fragment as b,renderList as k,toDisplayString as g,createTextVNode as C,normalizeStyle as L}from"vue";import w from"../../../../../shared/components/CancelRadio/CancelRadio.js";import{keywordMatcher as D,widthAppend as F}from"../../../../../shared/utils/index.js";import{useVirtualList as I}from"@vueuse/core";import{isNumber as j,isString as x,isFunction as R,isEqual as S}from"lodash-es";import{NInput as U,NCheckbox as W,NSpin as E,NCheckboxGroup as O,NRadioGroup as Y,NButtonGroup as $,NButton as M}from"naive-ui";import{InjectionIhoTableConfig as P}from"../../constants/index.js";import{isVariableHeightTable as V}from"../../utils/index.js";const q={class:"iho-table__filterWrapper"},z={key:1,class:"iho-table__filterCheckAllWrapper"},A={class:"iho-table__filterListItem"},H={class:"iho-table__filterListItem"},B=["title"],G=["title"],J={class:"iho-table__filterListItemContent"},K={class:"iho-table__filterFooter"};var N=e({__name:"filter",props:{payload:{type:Object,required:!0}},setup(e){const N=e,Q=l("$xetable"),T=l(P),X=a((()=>{var e;return!!(null==(e=N.payload)?void 0:e.column.filterMultiple)})),Z=a((()=>{var e,l,a;return null!=(a=null==(l=null==(e=N.payload)?void 0:e.column)?void 0:l.filters)?a:[]})),ee=a({get:()=>Z.value.reduce(((e,l)=>(l.checked&&e.push(l.value),e)),[]),async set(e){var l,a,t,u;if(!N.payload||!Q)return;const i=Q.reactData.filterStore.options||[];if(X.value?(i.forEach((l=>l._checked=e.includes(l.value))),Q.checkFilterOptions()):i.forEach((l=>l._checked=l.value===e[0])),!V(Q))return n();function n(){N.payload.$panel.confirmFilter(new CustomEvent("click"))}(null!=(a=null==(l=Q.internalData.afterFullData)?void 0:l.length)?a:0)>(null!=(u=null==(t=T.value.scrollY)?void 0:t.gt)?u:100)&&(Q.reactData.scrollYLoad=!0),n(),Q.reactData.scrollYLoad=!1}}),le=t([...ee.value]),ae=t("");async function te(){Q&&(Q.reactData.filterStore.visible=!1)}u(te);const ue=a((()=>{var e,l;if(!N.payload||!N.payload.column)return 10;const{filterCapacity:a}=null!=(l=null==(e=N.payload.column.editRender)?void 0:e.props)?l:{};return j(a)&&a>0?a:10})),ie=a((()=>{var e;return null==(e=N.payload.column.editRender.props)?void 0:e.filterOptionsFilterMethod})),ne=a((()=>ae.value?Z.value.filter((e=>ie.value?ie.value(ae.value,e):!!`${e.label}`.includes(ae.value)||(x(e.data)?D(ae.value,e.data):void 0))):Z.value)),{list:oe,containerProps:re,wrapperProps:ve}=I(ne,{itemHeight:32,overscan:3}),se=a({get:()=>!!ne.value.length&&ne.value.every((e=>le.value.includes(e.value))),set(e){le.value=e?[...new Set([...le.value,...ne.value.map((e=>e.value))])]:le.value.filter((e=>ne.value.every((l=>l.value!==e))))}}),ce=a((()=>ne.value.some((e=>le.value.includes(e.value)))&&!se.value)),de=a({get:()=>le.value.length===Z.value.length&&0!==Z.value.length,set:e=>{le.value=e?Z.value.map((e=>e.value)):[]}}),pe=a((()=>!!le.value.length&&!de.value)),fe=a((()=>({height:F(32*ue.value)})));function he(){ee.value=X.value?le.value:S(le.value[0],null)?[]:[le.value[0]],te()}function me(){le.value=X.value?[]:[null]}const _e=t(!1);return i((async()=>{var e;if(!Q)return;const l=null==(e=N.payload.column.editRender.props)?void 0:e.onFilterShow;if(R(l))try{_e.value=!0,await l(N.payload);const{filterStore:e}=Q.reactData;n(e.options)!==n(Z.value)&&(e.options=Z.value)}finally{_e.value=!1}})),(e,l)=>(o(),r("section",q,[v(Z).length>5?(o(),s(v(U),{key:0,value:ae.value,"onUpdate:value":l[0]||(l[0]=e=>ae.value=e)},null,8,["value"])):c("v-if",!0),v(X)?(o(),r("div",z,[d("div",A,[p(v(W),{label:"全选当前",checked:v(se),"onUpdate:checked":l[1]||(l[1]=e=>f(se)?se.value=e:null),indeterminate:v(ce)},null,8,["checked","indeterminate"])]),d("div",H,[p(v(W),{label:"全选所有",checked:v(de),"onUpdate:checked":l[2]||(l[2]=e=>f(de)?de.value=e:null),indeterminate:v(pe)},null,8,["checked","indeterminate"])])])):c("v-if",!0),p(v(E),{show:_e.value},{default:h((()=>[v(X)?(o(),s(v(O),{key:0,value:le.value,"onUpdate:value":l[3]||(l[3]=e=>le.value=e)},{default:h((()=>[d("section",m(v(re),{style:v(fe),class:"iho-table__filterListWrapper"}),[d("section",_(y(v(ve))),[(o(!0),r(b,null,k(v(oe),(e=>(o(),r("div",{class:"iho-table__filterListItem",key:e.data.value},[p(v(W),{value:e.data.value},{default:h((()=>[d("div",{class:"iho-table__filterListItemContent",title:e.data.label},g(e.data.label),9,B)])),_:2},1032,["value"])])))),128))],16)],16)])),_:1},8,["value"])):(o(),s(v(Y),{key:1,value:le.value[0],"onUpdate:value":l[5]||(l[5]=e=>le.value[0]=e)},{default:h((()=>[d("section",m(v(re),{style:v(fe),class:"iho-table__filterListWrapper"}),[d("section",_(y(v(ve))),[(o(!0),r(b,null,k(v(oe),(e=>(o(),r("div",{class:"iho-table__filterListItem",key:e.data.value,title:e.data.label},[p(v(w),{value:e.data.value,currentValue:le.value[0],cancelable:"",onCancel:l[4]||(l[4]=e=>le.value=[null])},{default:h((()=>[d("div",J,g(e.data.label),1)])),_:2},1032,["value","currentValue"])],8,G)))),128))],16)],16)])),_:1},8,["value"]))])),_:1},8,["show"]),d("footer",K,[d("section",null,[v(X)?(o(),r(b,{key:0},[C(" 已选择 "),d("span",{style:L({color:"var(--c-primary-color)"})},g(le.value.length),5),C(" 项 ")],64)):c("v-if",!0)]),p(v($),{size:"small"},{default:h((()=>[p(v(M),{onClick:me},{default:h((()=>[C("清空")])),_:1}),p(v(M),{onClick:te},{default:h((()=>[C("取消")])),_:1}),p(v(M),{type:"primary",onClick:he},{default:h((()=>[C("确定")])),_:1})])),_:1})])]))}});export{N as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{createVNode as e}from"vue";import{jsonParse as l,arrayed as i}from"../../../../../shared/utils/index.js";import{isObject as r}from"@vue/shared";import{promiseTimeout as t}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,parseRichContent as c}from"../../utils/index.js";import v 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(v,{payload:i,key:i.column.field},null)}})},apply(e){const{getItemFromUUID:v,setItemFromUUID:p,removeItemFromUUID:g}=s((()=>[]),!1);e.fieldHooks.field.tap(m,((e,i,t,{$table:d})=>{var s,v,p,h,g,b,F,k;const y=null==(s=e.editRender)?void 0:s.props;if(!r(y))return e;if(!a.
|
1
|
+
import{createVNode as e}from"vue";import{jsonParse as l,arrayed as i}from"../../../../../shared/utils/index.js";import{isObject as r}from"@vue/shared";import{promiseTimeout as t}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,parseRichContent as c}from"../../utils/index.js";import v 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(v,{payload:i,key:i.column.field},null)}})},apply(e){const{getItemFromUUID:v,setItemFromUUID:p,removeItemFromUUID:g}=s((()=>[]),!1);e.fieldHooks.field.tap(m,((e,i,t,{$table:d})=>{var s,v,p,h,g,b,F,k;const y=null==(s=e.editRender)?void 0:s.props;if(!r(y))return e;if(!a.hasOptionFilter(y))return e;e.editRender={...e.editRender,props:{...null==(v=e.editRender)?void 0:v.props,sortable:e.sortable}},e.filterRender={name:m};const x=null==(p=d.value)?void 0:p.getColumnByField(e.field),R={};let C;if(x&&o(x.filters)&&x.filters.forEach((e=>{e&&(R[`${e.label}_${e.value}`]=e.checked)})),f(y))C=null!=(h=y.options)?h:[];else{C=null!=(F=null==(b=null==(g=(r(y.fieldSetting)?y.fieldSetting:n(y.fieldSetting)?l(y.fieldSetting||""):{}).mapping)?void 0:g.mappingFiled)?void 0:b.reduce(((e,l)=>{var i;const t=u(l.value);return r(t)&&e.push({label:t.key,value:t.value,data:null!=(i=t.keyword)?i:t.value}),e}),[]))?F:[]}if(e.filters=C.reduce(((e,l)=>(r(l)&&e.push({...l,checked:!!R[`${l.label}_${l.value}`]}),e)),[]),!e.filterMethod){const l=null==(k=t.treeConfig)?void 0:k.children;e.filterMethod=function({option:e,column:i,row:r}){if(l&&o(r[l])&&r[l].length)return!1;const t=r[i.field];if(o(t))return t.some((l=>[e.label,e.value].includes(l)));if(n(t)){if(t===e.value||t===e.label)return!0;const{value:l,change_text:i}=c(t);return i===e.label||l===e.value}return!1}}return t.filterConfig={iconMatch:"iho-table--iconfont iho-table-icon-filter",iconNone:"iho-table--iconfont iho-table-icon-filter",...t.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;if(l.value&&e.uuid)try{const r=v(e.uuid);if(null==(i=e.sortConfig)?void 0:i.multiple){const e=r.reduce(((e,i)=>{var r;const t=null==(r=i.editRender)?void 0:r.props;if(!i.sortable)return e;if(t&&h(t.isOrder)){const r=l.value.getColumnByField(i.field);e.push({field:i.field,order:(null==r?void 0:r.order)?r.order:t.isOrder})}return e}),[]);if(!e.length)return;await t(200),await l.value.sort(e)}else d(r,(e=>{var i;const r=null==(i=e.editRender)?void 0:i.props;if(r&&h(r.isOrder))return e&&l.value.sort(e.field,r.isOrder),!0}))}finally{g(e.uuid)}})),e.exposeHooks.expose.tap(m,((e,l,{$table:r})=>(Object.assign(e,{setSort(e,l){r.value&&r.value.sort(e,l)},setFilter(e,l){if(!r.value)return;const t=r.value.getColumnByField(e);if(!t||!o(t.filters))return;const n=i(l);t.filters.forEach((e=>{e.checked=n.includes(e.value)})),r.value.updateData()}}),e)))}})}function h(e){return["asc","desc",null].includes(e)}export{m as filterRenderPlugin};
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { PropType } from 'vue';
|
2
|
+
import { VxeColumnPropTypes, VxeTableConstructor, VxeTableMethods, VxeTablePrivateMethods } from 'vxe-table';
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
4
|
+
payload: {
|
5
|
+
type: PropType<VxeColumnPropTypes.FilterSlotParams>;
|
6
|
+
required: true;
|
7
|
+
};
|
8
|
+
}, {
|
9
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
10
|
+
payload: {
|
11
|
+
type: PropType<VxeColumnPropTypes.FilterSlotParams>;
|
12
|
+
required: true;
|
13
|
+
};
|
14
|
+
}>> & {}>>;
|
15
|
+
valueRef: import("vue").Ref<string>;
|
16
|
+
onUpdateValue: (value: string) => void;
|
17
|
+
$table: (VxeTableConstructor & VxeTablePrivateMethods & VxeTableMethods) | undefined;
|
18
|
+
close: () => void;
|
19
|
+
confirm: () => void;
|
20
|
+
NButton: any;
|
21
|
+
NButtonGroup: any;
|
22
|
+
NInput: any;
|
23
|
+
NSpace: any;
|
24
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
25
|
+
payload: {
|
26
|
+
type: PropType<VxeColumnPropTypes.FilterSlotParams>;
|
27
|
+
required: true;
|
28
|
+
};
|
29
|
+
}>>, {}>;
|
30
|
+
export default _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
import e from"./filter.vue2.js";import r from"../../../../../_virtual/_plugin-vue_export-helper.js";var t=r(e,[["__file","filter.vue"]]);export{t as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{defineComponent as a,ref as l,inject as e,openBlock as t,createBlock as n,unref as o,withCtx as u,createVNode as i,createTextVNode as r}from"vue";import{cloneDeep as p}from"lodash-es";import{NSpace as d,NInput as f,NButtonGroup as c,NButton as v}from"naive-ui";var s=a({__name:"filter",props:{payload:{type:Object,required:!0}},setup(a){var s;const m=a,y=l(p((null==(s=m.payload.column.filters)?void 0:s[0])||{}).data);function _(a){y.value=a}const b=e("$xetable");function x(){b&&(b.reactData.filterStore.visible=!1)}function $(){var a,l;const e=null==(a=m.payload.column.filters)?void 0:a[0];if(!e)return x();e.data=y.value,(null==(l=m.payload)?void 0:l.$panel)&&(m.payload.$panel.changeOption(null,!!y.value,e),m.payload.$panel.confirmFilter(new CustomEvent("click")))}return(a,l)=>(t(),n(o(d),{vertical:"",style:{padding:"8px 12px"}},{default:u((()=>[i(o(f),{clearable:"",value:y.value,"onUpdate:value":_},null,8,["value"]),i(o(d),{justify:"end"},{default:u((()=>[i(o(c),{size:"small"},{default:u((()=>[i(o(v),{onClick:x},{default:u((()=>[r("取消")])),_:1}),i(o(v),{type:"primary",onClick:$},{default:u((()=>[r("确定")])),_:1})])),_:1})])),_:1})])),_:1}))}});export{s as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function filterTextRenderPlugin(): import("../../../../../components/iho-table").TablePlugin;
|
@@ -0,0 +1 @@
|
|
1
|
+
import{createVNode as e}from"vue";import{isString as i}from"lodash-es";import"../../../index.js";import{IhoTableRenderHelper as t,parseRichContent as o}from"../../utils/index.js";import r from"./filter.vue.js";import{isObject as n,isArray as l}from"@vue/shared";import{defineTablePlugin as f}from"../../hooks/useTablePlugin.js";function d(){const d="filterTextRenderPlugin";return f({name:d,vxe(i){i.renderer.mixin({[d]:{showFilterFooter:!1,renderFilter:(i,t)=>e(r,{payload:t,key:t.column.field},null)}})},apply(e){e.fieldHooks.field.tap(d,((e,r,f,{$table:u})=>{var a,s,c;const m=null==(a=e.editRender)?void 0:a.props;if(!n(m))return e;if(!t.hasTextFilter(m))return e;e.filterRender={name:d};const p=null==(s=u.value)?void 0:s.getColumnByField(e.field),h={};return p&&l(p.filters)&&Object.assign(h,{...null==(c=p.filters)?void 0:c[0]}),e.filters=[{...h}],e.filterMethod||(e.filterMethod=function({option:e,row:t,column:r}){const n=t[r.field];if(!i(n))return!1;if(n.includes(e.data))return!0;const{value:l,change_text:f}=o(n);return i(f)&&f.includes(e.data)||i(l)&&l.includes(e.data)}),f.filterConfig={iconMatch:"iho-table--iconfont iho-table-icon-filter",iconNone:"iho-table--iconfont iho-table-icon-filter",...f.filterConfig},e}))}})}export{d as filterTextRenderPlugin};
|
@@ -1 +1 @@
|
|
1
|
-
import{useAttrs as e,onBeforeUnmount as t,inject as l,createVNode as o,mergeProps as n}from"vue";import{arrayed as i,widthAppend as s}from"../../../../../shared/utils/index.js";import{CodeSlash as r}from"@vicons/ionicons5";import{isObject as a,isString as u,isFunction as d}from"lodash-es";import c from"../../../../annotation-edit/index.js";import"../../../index.js";import{InjectionIhoTableAnnotation as m,InjectionIhoTableConfig as p,InjectionIhoTableXeInstance as f,InjectionIhoTableGlobProps as v}from"../../constants/index.js";import{getLowCodeFieldFromField as h,IhoTableRenderHelper as b}from"../../utils/index.js";import x from"./tooltipMessage.vue.js";import{defineTablePlugin as g}from"../../hooks/useTablePlugin.js";function j(){const j="headerPlugin";return g({name:j,apply(g){let w=null;g.setupHooks.setup.tap(j,(()=>{w=e(),t((()=>{w=null}))})),g.fieldHooks.field.tap(j,((e,t,g)=>{var j;const D=null==(j=e.slots)?void 0:j.header;return e.slots={...e.slots,header:t=>function(e,t,h){var g;const j=l(m),D=l(p),M=l("$xetable"),y=l(f);y&&!(null==y?void 0:y.value)&&(y.value=M);const W=e.column||{},k=a(null==j?void 0:j.value)&&!1!==t.annotation,O=b.isEditableColumn(D.value,W),P=b.hasFilter(t)
|
1
|
+
import{useAttrs as e,onBeforeUnmount as t,inject as l,createVNode as o,mergeProps as n}from"vue";import{arrayed as i,widthAppend as s}from"../../../../../shared/utils/index.js";import{CodeSlash as r}from"@vicons/ionicons5";import{isObject as a,isString as u,isFunction as d}from"lodash-es";import c from"../../../../annotation-edit/index.js";import"../../../index.js";import{InjectionIhoTableAnnotation as m,InjectionIhoTableConfig as p,InjectionIhoTableXeInstance as f,InjectionIhoTableGlobProps as v}from"../../constants/index.js";import{getLowCodeFieldFromField as h,IhoTableRenderHelper as b}from"../../utils/index.js";import x from"./tooltipMessage.vue.js";import{defineTablePlugin as g}from"../../hooks/useTablePlugin.js";function j(){const j="headerPlugin";return g({name:j,apply(g){let w=null;g.setupHooks.setup.tap(j,(()=>{w=e(),t((()=>{w=null}))})),g.fieldHooks.field.tap(j,((e,t,g)=>{var j;const D=null==(j=e.slots)?void 0:j.header;return e.slots={...e.slots,header:t=>function(e,t,h){var g;const j=l(m),D=l(p),M=l("$xetable"),y=l(f);y&&!(null==y?void 0:y.value)&&(y.value=M);const W=e.column||{},k=a(null==j?void 0:j.value)&&!1!==t.annotation,O=b.isEditableColumn(D.value,W),P=b.hasFilter(t),$=b.hasTitlePrefix(e.column),C=u(h)?h:d(h)?h(e):null;let H=null==(g=t.settingObj)?void 0:g.fieldDescDev;if(u(H)&&H){const e=l(v);H=(null==e?void 0:e.developMode)?H:""}let R=!1;if(D.value){const e=D.value.editRules&&D.value.editRules[W.field];e&&(R=i(e).some((e=>e.required)))}const S=D.value.border?Math.max(2,Math.ceil(M.reactData.scrollbarWidth/M.reactData.tableColumn.length)):1,T=s(Math.max(0,W.renderWidth-20-S-(R?14:0)-(k?18:0)-(P?23:0)-(O?22:0)-($?20:0)-(W.sortable?23:0)-(H?20:0)));return o("section",{class:"iho-table__headerWrapper"},[o("section",{style:{width:T}},[null!=C?C:o("div",n({style:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},function(){var e;const l=null==(e=t.settingObj)?void 0:e.fieldDescribe;return l?{title:`${W.title}\n${l}`}:{}}()),[function(){const e=W.title,t=/\\n|\n|\r/g;if(!t.test(e))return e;const l=e.replace(t,"<br>").split("<br>");return l.map(((e,t)=>[e,t===l.length-1?null:o("br",null,null)]))}()])]),H?o(x,{message:H},{trigger:()=>o(r,{style:"width:14px"},null)}):null,k?o(c,{modelValue:j.value[W.field],"onUpdate:modelValue":e=>j.value[W.field]=e,shortcuts:w&&(w["annotation-shortcuts"]||w.annotationShortcuts)||[]},null):null])}(t,h(e),D)},e}))}})}export{j as default};
|
@@ -1 +1 @@
|
|
1
|
-
import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin.js";import*as i from"./colorAndIconPlugin.js";import*as n from"./copyPastePlugin.js";import*as s from"./defaultConfigPlugin.js";import*as t from"./defaultValuePlugin.js";import*as l from"./dragScrollPlugin.js";import*as d from"./filterDaterangeRenderPlugin/index.js";import*as g from"./filterRenderPlugin/index.js";import*as o from"./
|
1
|
+
import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin.js";import*as i from"./colorAndIconPlugin.js";import*as n from"./copyPastePlugin.js";import*as s from"./defaultConfigPlugin.js";import*as t from"./defaultValuePlugin.js";import*as l from"./dragScrollPlugin.js";import*as d from"./filterDaterangeRenderPlugin/index.js";import*as g from"./filterRenderPlugin/index.js";import*as o from"./filterTextPlugin/index.js";import*as u from"./filterVisibleEventPlugin.js";import*as a from"./forceArrowKeyPlugin.js";import*as P from"./headerPlugin/index.js";import*as m from"./highLightSetPlugin.js";import*as f from"./keyboardEventPlugin.js";import*as p from"./lowCodeFieldAdaptorPlugin.js";import*as x from"./maxCheckSizePlugin.js";import*as j from"./operationalFormPlugin.js";import*as c from"./pagerScrollPlugin/index.js";import*as b from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as R from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as w from"./rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.js";import*as h from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as W from"./rendererPlugins/editableWidgets/radioRendererPlugin.js";import*as S from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as v from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as k from"./rendererPlugins/editableWidgets/switchRendererPlugin.js";import*as C from"./rendererPlugins/editableWidgets/timeRendererPlugin/index.js";import*as y from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as A from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as E from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as F from"./rendererPlugins/widgets/htmlRendererPlugin.js";import*as T from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as D from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as V from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as q from"./rowClickPlugin.js";import*as z from"./rowDragPlugin.js";import*as G from"./rowGroupSettingPlugin/index.js";import*as H from"./stickyFixedPlugin.js";import*as I from"./varialbleHeightPlugin.js";import*as K from"./verticalTablePlugin/index.js";import*as L from"./virtualTreePlugin.js";import*as O from"./wordbookSettingPlugin.js";import{separateMetaModule as B}from"../../../../shared/utils/index.js";var J=B(Object.assign({"./anchorPlugin/index.tsx":e,"./bindEventSettingPlugin.ts":r,"./colorAndIconPlugin.ts":i,"./copyPastePlugin.ts":n,"./defaultConfigPlugin.ts":s,"./defaultValuePlugin.ts":t,"./dragScrollPlugin.ts":l,"./filterDaterangeRenderPlugin/index.tsx":d,"./filterRenderPlugin/index.tsx":g,"./filterTextPlugin/index.tsx":o,"./filterVisibleEventPlugin.ts":u,"./forceArrowKeyPlugin.ts":a,"./headerPlugin/index.tsx":P,"./highLightSetPlugin.tsx":m,"./keyboardEventPlugin.ts":f,"./lowCodeFieldAdaptorPlugin.tsx":p,"./maxCheckSizePlugin.ts":x,"./operationalFormPlugin.ts":j,"./pagerScrollPlugin/index.ts":c,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":b,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":R,"./rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.tsx":w,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":h,"./rendererPlugins/editableWidgets/radioRendererPlugin.tsx":W,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":S,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":v,"./rendererPlugins/editableWidgets/switchRendererPlugin.tsx":k,"./rendererPlugins/editableWidgets/timeRendererPlugin/index.tsx":C,"./rendererPlugins/widgets/checkRendererPlugin.tsx":y,"./rendererPlugins/widgets/colorRendererPlugin.tsx":A,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":E,"./rendererPlugins/widgets/htmlRendererPlugin.tsx":F,"./rendererPlugins/widgets/labelRendererPlugin.tsx":T,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":D,"./rendererPlugins/widgets/seqRendererPlugin.tsx":V,"./rowClickPlugin.ts":q,"./rowDragPlugin.ts":z,"./rowGroupSettingPlugin/index.ts":G,"./stickyFixedPlugin.tsx":H,"./varialbleHeightPlugin.tsx":I,"./verticalTablePlugin/index.ts":K,"./virtualTreePlugin.ts":L,"./wordbookSettingPlugin.ts":O}));export{J as default};
|