cnhis-design-vue 3.2.7-beta.24 → 3.2.7-beta.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -87
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/iho-chat/index.d.ts +62 -1
- package/es/components/iho-chat/src/Index.vue.d.ts +62 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +1 -0
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +1 -0
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +2 -0
- package/es/components/iho-chat/src/components/ChatHeader.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +57 -1
- package/es/components/iho-chat/src/components/ChatSearch.vue2.js +1 -1
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +1 -0
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-chat/src/hooks/useSearchUserList.js +1 -1
- package/es/components/iho-chat/src/hooks/useSession.js +1 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
- package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
- package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
- package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
- package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
- package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
- package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
- package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
- package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
- package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
- package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/table_style_2.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/fabricjs/index.d.ts +0 -6823
- package/es/shared/utils/tapable/index.d.ts +0 -139
package/README.md
CHANGED
@@ -1,87 +1,87 @@
|
|
1
|
-
# 安装
|
2
|
-
|
3
|
-
```shell
|
4
|
-
npm i cnhis-design-vue@[版本号]
|
5
|
-
# or
|
6
|
-
yarn add cnhis-design-vue@[版本号] #推荐
|
7
|
-
```
|
8
|
-
|
9
|
-
## 1.全局引入
|
10
|
-
|
11
|
-
```typescript
|
12
|
-
// main.ts
|
13
|
-
import { createApp } from 'vue';
|
14
|
-
import App from './App.vue';
|
15
|
-
import 'cnhis-design-vue/es/packages/index.css';
|
16
|
-
import cui from 'cnhis-design-vue';
|
17
|
-
|
18
|
-
const app = createApp(App);
|
19
|
-
app.use(cui).mount('#app');
|
20
|
-
```
|
21
|
-
|
22
|
-
## 2. 按需引入
|
23
|
-
|
24
|
-
组件现在支持了自动按需引入, 但是样式文件需要额外的处理
|
25
|
-
|
26
|
-
### 2.1 样式处理方式1 (按需引入样式)
|
27
|
-
|
28
|
-
```shell
|
29
|
-
# 安装自动导入样式的插件
|
30
|
-
npm i -d vite-plugin-style-import
|
31
|
-
```
|
32
|
-
|
33
|
-
```typescript
|
34
|
-
// vite.config.ts
|
35
|
-
import { defineConfig } from 'vite';
|
36
|
-
import { createStyleImportPlugin } from 'vite-plugin-style-import';
|
37
|
-
|
38
|
-
export default defineConfig({
|
39
|
-
plugins: [
|
40
|
-
// ...otherPlugins
|
41
|
-
createStyleImportPlugin({
|
42
|
-
libs: [
|
43
|
-
{
|
44
|
-
libraryName: 'cnhis-design-vue',
|
45
|
-
esModule: true,
|
46
|
-
ensureStyleFile: true,
|
47
|
-
resolveStyle: name => {
|
48
|
-
return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
|
49
|
-
}
|
50
|
-
}
|
51
|
-
]
|
52
|
-
})
|
53
|
-
]
|
54
|
-
});
|
55
|
-
```
|
56
|
-
|
57
|
-
### 2.2 样式处理方式2 (全局引入样式)
|
58
|
-
|
59
|
-
```typescript
|
60
|
-
// main.ts
|
61
|
-
import 'cnhis-design-vue/es/components/index.css';
|
62
|
-
```
|
63
|
-
|
64
|
-
## 3.FAQ
|
65
|
-
|
66
|
-
### 3.1 项目打包后样式丢失
|
67
|
-
|
68
|
-
处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
|
69
|
-
|
70
|
-
```typescript
|
71
|
-
// vite.config.ts
|
72
|
-
import { defineConfig } from 'vite';
|
73
|
-
|
74
|
-
export default defineConfig({
|
75
|
-
build: {
|
76
|
-
rollupOptions: {
|
77
|
-
// ..otherOptions
|
78
|
-
output: {
|
79
|
-
dir: './dist',
|
80
|
-
manualChunks: {
|
81
|
-
'cnhis-vendor': ['cnhis-design-vue']
|
82
|
-
}
|
83
|
-
}
|
84
|
-
}
|
85
|
-
}
|
86
|
-
});
|
87
|
-
```
|
1
|
+
# 安装
|
2
|
+
|
3
|
+
```shell
|
4
|
+
npm i cnhis-design-vue@[版本号]
|
5
|
+
# or
|
6
|
+
yarn add cnhis-design-vue@[版本号] #推荐
|
7
|
+
```
|
8
|
+
|
9
|
+
## 1.全局引入
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
// main.ts
|
13
|
+
import { createApp } from 'vue';
|
14
|
+
import App from './App.vue';
|
15
|
+
import 'cnhis-design-vue/es/packages/index.css';
|
16
|
+
import cui from 'cnhis-design-vue';
|
17
|
+
|
18
|
+
const app = createApp(App);
|
19
|
+
app.use(cui).mount('#app');
|
20
|
+
```
|
21
|
+
|
22
|
+
## 2. 按需引入
|
23
|
+
|
24
|
+
组件现在支持了自动按需引入, 但是样式文件需要额外的处理
|
25
|
+
|
26
|
+
### 2.1 样式处理方式1 (按需引入样式)
|
27
|
+
|
28
|
+
```shell
|
29
|
+
# 安装自动导入样式的插件
|
30
|
+
npm i -d vite-plugin-style-import
|
31
|
+
```
|
32
|
+
|
33
|
+
```typescript
|
34
|
+
// vite.config.ts
|
35
|
+
import { defineConfig } from 'vite';
|
36
|
+
import { createStyleImportPlugin } from 'vite-plugin-style-import';
|
37
|
+
|
38
|
+
export default defineConfig({
|
39
|
+
plugins: [
|
40
|
+
// ...otherPlugins
|
41
|
+
createStyleImportPlugin({
|
42
|
+
libs: [
|
43
|
+
{
|
44
|
+
libraryName: 'cnhis-design-vue',
|
45
|
+
esModule: true,
|
46
|
+
ensureStyleFile: true,
|
47
|
+
resolveStyle: name => {
|
48
|
+
return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
]
|
52
|
+
})
|
53
|
+
]
|
54
|
+
});
|
55
|
+
```
|
56
|
+
|
57
|
+
### 2.2 样式处理方式2 (全局引入样式)
|
58
|
+
|
59
|
+
```typescript
|
60
|
+
// main.ts
|
61
|
+
import 'cnhis-design-vue/es/components/index.css';
|
62
|
+
```
|
63
|
+
|
64
|
+
## 3.FAQ
|
65
|
+
|
66
|
+
### 3.1 项目打包后样式丢失
|
67
|
+
|
68
|
+
处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
|
69
|
+
|
70
|
+
```typescript
|
71
|
+
// vite.config.ts
|
72
|
+
import { defineConfig } from 'vite';
|
73
|
+
|
74
|
+
export default defineConfig({
|
75
|
+
build: {
|
76
|
+
rollupOptions: {
|
77
|
+
// ..otherOptions
|
78
|
+
output: {
|
79
|
+
dir: './dist',
|
80
|
+
manualChunks: {
|
81
|
+
'cnhis-vendor': ['cnhis-design-vue']
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
});
|
87
|
+
```
|
@@ -1 +1 @@
|
|
1
|
-
import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as n}from"../useEvent.js";import{setOtherType as r,getFloorNumber as o}from"../../utils/index.js";import{flatten as v}from"lodash-es";import{format as s,addDays as d}from"date-fns";import"naive-ui";import"@vueuse/core";import{useTop as c}from"./useTop.js";import{useLeft as
|
1
|
+
import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as n}from"../useEvent.js";import{setOtherType as r,getFloorNumber as o}from"../../utils/index.js";import{flatten as v}from"lodash-es";import{format as s,addDays as d}from"date-fns";import"naive-ui";import"@vueuse/core";import{useTop as c}from"./useTop.js";import{useLeft as h}from"./useLeft.js";import{useRight as p}from"./useRight.js";import{useCenter as g}from"./useCenter.js";import{useBottom as m}from"./useBottom.js";import{useOther as f}from"./useOther.js";function y(y,S,b,Y,w,C){const D=15,x=e({select:null,redrawPoints:null,clickMenu:null}),j=a((()=>{const{painSurplusCell:e=[0,0]}=S.data.grid||{};return~Z.value?e:[0,0]})),V=a((()=>{var e,a;const t=(null==(a=null==(e=S.data.grid)?void 0:e.surplusCell)?void 0:a.slice())||[0,0,0,0];return 0===Z.value?t[0]=t[0]+j.value[1]:Z.value>0&&(t[2]=t[2]+j.value[0]),t})),H=a((()=>0===Z.value?[j.value[0],V.value[1],V.value[2],V.value[3]]:Z.value>0?[V.value[0],V.value[1],j.value[1],V.value[3]]:V.value)),X=a((()=>{const{top:e}=S.data;return e.date.show&&(e.date.height||D)||0})),L=a((()=>{var e;const{top:a}=S.data;return(null==(e=a.hospitalDays)?void 0:e.show)&&(a.hospitalDays.height||D)||0})),P=a((()=>{var e;const{top:a}=S.data;return(null==(e=a.operationDays)?void 0:e.show)&&(a.operationDays.height||D)||0})),M=a((()=>{var e,a,t;const{top:l}=S.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||D)||0)+((null==(a=l.xScalevalue)?void 0:a.show)&&null!=(t=l.dayHeight)?t:0)})),I=a((()=>{var e;const{top:a}=S.data;return(null==(e=a.childbirthDays)?void 0:e.show)&&(a.childbirthDays.height||D)||0})),N=a((()=>{var e;const{bottom:a}=S.data;return(null==(e=null==a?void 0:a.breathing)?void 0:e.show)&&(a.breathing.height||30)||0})),k=a((()=>{const{grid:e}=S.data;return e.mainXCell*e.subXCell+V.value[1]+V.value[3]})),O=a((()=>{const{grid:e}=S.data,a=Z.value>0?j.value[1]:j.value[0];return e.mainYCell*e.subYCell+V.value[0]+V.value[2]+a})),R=a((()=>{var e;const{width:a,right:t=null,top:l}=S.data;if(!t)return a;return a-(null!=(e=t.width)?e:0)})),W=a((()=>R.value-V.value[1]*z.value)),$=a((()=>{const{top:e,left:a}=S.data;return e.titleWidth+A.value})),G=a((()=>{const{bottom:e=null,height:a}=S.data;if(!e)return a;return a-(e.height||30)})),q=a((()=>{var e;const{top:a}=S.data,t=a.xScalevalue.show&&(null!=(e=a.dayHeight)?e:0)||0,l=a.xScalevalue.show&&(a.xScalevalue.height||D)||0;return X.value+t+l+L.value+P.value+I.value})),z=a((()=>(R.value-$.value)/k.value)),T=a((()=>(G.value-q.value)/O.value)),A=a((()=>{var e,a;const{left:t}=S.data;return(null==(e=t.icons)?void 0:e.show)&&((null==(a=t.icons)?void 0:a.width)||100)||0})),B=a((()=>{var e,a;const{top:t,grid:l}=S.data,u=(null==(a=null==(e=t.date.list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],i=t.xScalevalue.times;let n=$.value-z.value;const r=t.date.startDate||s(new Date,"yyyy-MM-dd"),o=u.reduce(((e,a,t)=>0===t?e.concat(r):e.concat(s(d(new Date(r.replace(/-/g,"/")),t),"yyyy-MM-dd"))),[]).map((e=>i.map((a=>{n+=z.value;const t=Date.parse(`${e} ${a.start}`),l=Date.parse(`${e} ${a.end}`);return{start:t,end:l,left:n,center:n+z.value/2,scaleCell:(l-t)/z.value}}))));return v(o)})),E=a((()=>ie("breathe"))),F=a((()=>ie("pulse"))),J=a((()=>ie("temperature"))),K=a((()=>ie("pain"))),Q=a((()=>{var e;return(null==(e=S.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),U=a((()=>{const{left:e}=S.data;return v(e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((a,t)=>({...a,bigType:r(a.title,e.type),unit:e.unit,dataIndex:t}))))))})),Z=a((()=>{var e,a;const{left:t}=S.data,l=t.yScaleValue.findIndex((e=>"pain"===e.type));return l>-1&&(null==(a=null==(e=t.yScaleValue[l].dataList)?void 0:e[0])?void 0:a.show)?l:-1})),_=a((()=>{const{grid:e}=S.data;return-1===Z.value?0:T.value*e.subYCell})),ee=a((()=>{const{left:e}=S.data,a={originY:q.value+j.value[0]*T.value,endY:G.value-j.value[1]*T.value};return 0===Z.value&&e.yScaleValue.length>1?a.endY=a.originY+_.value:Z.value===e.yScaleValue.length-1&&(a.originY=a.endY-_.value),a})),ae=a((()=>{const{left:e}=S.data,a={originY:q.value+V.value[0]*T.value,endY:G.value-V.value[2]*T.value};return 0===Z.value&&e.yScaleValue.length>1?a.originY=ee.value.endY+V.value[0]*T.value:Z.value===e.yScaleValue.length-1&&(a.endY=ee.value.originY-V.value[2]*T.value),a})),te=a((()=>{var e,a;const{top:t,grid:l}=S.data,u=[];for(const i in t)t[i].show&&u.push({...t[i],list:(null==(a=null==(e=t[i].list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,a)=>e.seq-a.seq))})),le=a((()=>{var e;const{left:a,right:t}=S.data,l=a.yScaleValue.find((e=>"temperature"===e.type)),u=(null==t?void 0:t.yScaleValue)||{};if(null==(e=null==l?void 0:l.list)?void 0:e.length){const e=(null==u?void 0:u.showdetailedScale)?l.list.reduce((e=>{const a=e[e.length-1];return a?e.concat([a+1,a+2]):e.concat([92])}),[]):[],a=l.list.map((e=>o(1.8*e+32)));Object.assign(u,{list:a,detailedList:e,spaceGridNumber:l.spaceGridNumber})}return u})),ue=e({canvasWidth:S.data.width,canvasHeight:S.data.height,borderStyle:{...u,...S.data.borderStyle||{}},selectionStyle:S.data.selectionStyle||{},dateHeight:X.value,hospitalDaysHeight:L.value,operationDaysHeight:P.value,xScalevalueHeight:M.value,childbirthDaysHeight:I.value,topList:te.value,breathingHeight:N.value,hospitalizationDate:S.data.hospitalizationDate,grid:S.data.grid,top:S.data.top,left:S.data.left,right:S.data.right,bottom:S.data.bottom,other:S.data.other,painIndex:Z.value,painHeight:_.value,painOriginY:ee.value,vitalSignsOriginY:ae.value,gridXNumber:k.value,gridYNumber:O.value,iconsWidth:A.value,originX:$.value,originY:q.value,endX:R.value,endXLimit:W.value,endY:G.value,xCellWidth:z.value,yCellHeight:T.value,xScaleList:B.value,breatheYCell:E.value,pulseYCell:F.value,temperatureYCell:J.value,painYCell:K.value,event:Q.value,itemList:U.value,getRightInfo:le.value,config:S.data.config||{},surplusCell:V.value,painSurplusCell:j.value,mainSurplusCell:H.value});function ie(e){const{yScaleValue:a}=S.data.left,t=a.find((a=>a.type===e)),l=(null==t?void 0:t.list)||[];return l.length?T.value/((l[1]-l[0])/t.spaceGridNumber):0}const{computedX:ne,computedY:re,getXValue:oe,getYValue:ve}=i(ue);return t((()=>y.value),(e=>{e&&function(){c(y,ue);const{setPopup:e,isAddPoint:a,updateData:t,redrawPoints:l,clickMenu:u,gridPoints:i,fixedNoRisePoints:r}=g(y,ue,b,ne,re,oe,ve,S.addRenderItem,w,C);x.redrawPoints=l,x.clickMenu=u;const{drawScaleValue:o}=h(y,ue,b,e,w,ne,re,oe,ve,a,t,i);p(y,ue,o),m(y,ue),f(y,ue,b,ne,re,r);const{select:v}=n(y,ue,b);x.select=v}()}),{immediate:!0}),{propItems:ue,...l(x)}}export{y as useTemperatureChart};
|
@@ -152,6 +152,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
152
152
|
NAvatar: any;
|
153
153
|
NIcon: any;
|
154
154
|
NButton: any;
|
155
|
+
NTooltip: any;
|
155
156
|
PersonProfile: import("vue").DefineComponent<{
|
156
157
|
userId: {
|
157
158
|
type: StringConstructor;
|
@@ -593,6 +594,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
593
594
|
NInput: any;
|
594
595
|
NCheckbox: any;
|
595
596
|
NCheckboxGroup: any;
|
597
|
+
NTooltip: any;
|
596
598
|
SearchOutline: 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<{}>>, {}>;
|
597
599
|
AddOutline: 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<{}>>, {}>;
|
598
600
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
@@ -961,6 +963,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
961
963
|
NInput: any;
|
962
964
|
NCheckbox: any;
|
963
965
|
NCheckboxGroup: any;
|
966
|
+
NTooltip: any;
|
964
967
|
SearchOutline: 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<{}>>, {}>;
|
965
968
|
AddOutline: 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<{}>>, {}>;
|
966
969
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
@@ -1004,11 +1007,12 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
1004
1007
|
listRef: import("vue").Ref<any>;
|
1005
1008
|
inputRef: import("vue").Ref<any>;
|
1006
1009
|
showSearch: import("vue").Ref<boolean>;
|
1007
|
-
keyword: import("vue").Ref<
|
1010
|
+
keyword: import("vue").Ref<string>;
|
1008
1011
|
state: import("./src/types").IState;
|
1009
1012
|
openSession: (item: import("../../shared/types").AnyObject) => Promise<void>;
|
1010
1013
|
userList: import("vue").Ref<import("../../shared/types").AnyObject[]>;
|
1011
1014
|
handleInput: () => void;
|
1015
|
+
showNoData: import("vue").ComputedRef<boolean>;
|
1012
1016
|
addSession: (userId: string) => Promise<void>;
|
1013
1017
|
NPopover: any;
|
1014
1018
|
NButton: any;
|
@@ -1016,6 +1020,61 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
1016
1020
|
NInput: any;
|
1017
1021
|
NIcon: any;
|
1018
1022
|
SearchOutline: 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<{}>>, {}>;
|
1023
|
+
DefaultPage: SFCWithInstall<import("vue").DefineComponent<{
|
1024
|
+
type: {
|
1025
|
+
type: StringConstructor;
|
1026
|
+
default: string;
|
1027
|
+
};
|
1028
|
+
config: {
|
1029
|
+
type: import("vue").PropType<import("../../shared/types").AnyObject>;
|
1030
|
+
default: () => {
|
1031
|
+
title: string;
|
1032
|
+
content: string;
|
1033
|
+
};
|
1034
|
+
};
|
1035
|
+
}, {
|
1036
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
1037
|
+
type: {
|
1038
|
+
type: StringConstructor;
|
1039
|
+
default: string;
|
1040
|
+
};
|
1041
|
+
config: {
|
1042
|
+
type: import("vue").PropType<import("../../shared/types").AnyObject>;
|
1043
|
+
default: () => {
|
1044
|
+
title: string;
|
1045
|
+
content: string;
|
1046
|
+
};
|
1047
|
+
};
|
1048
|
+
}>> & {
|
1049
|
+
onReloadPage?: ((...args: any[]) => any) | undefined;
|
1050
|
+
}>>;
|
1051
|
+
emit: (event: "reloadPage", ...args: any[]) => void;
|
1052
|
+
configResult: import("vue").ComputedRef<{
|
1053
|
+
title: string;
|
1054
|
+
content: string;
|
1055
|
+
img: string;
|
1056
|
+
}>;
|
1057
|
+
reloadPage: () => void;
|
1058
|
+
NIcon: any;
|
1059
|
+
Refresh: 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<{}>>, {}>;
|
1060
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "reloadPage"[], "reloadPage", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
1061
|
+
type: {
|
1062
|
+
type: StringConstructor;
|
1063
|
+
default: string;
|
1064
|
+
};
|
1065
|
+
config: {
|
1066
|
+
type: import("vue").PropType<import("../../shared/types").AnyObject>;
|
1067
|
+
default: () => {
|
1068
|
+
title: string;
|
1069
|
+
content: string;
|
1070
|
+
};
|
1071
|
+
};
|
1072
|
+
}>> & {
|
1073
|
+
onReloadPage?: ((...args: any[]) => any) | undefined;
|
1074
|
+
}, {
|
1075
|
+
type: string;
|
1076
|
+
config: import("../../shared/types").AnyObject;
|
1077
|
+
}>>;
|
1019
1078
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
1020
1079
|
ChatAdd: import("vue").DefineComponent<{
|
1021
1080
|
title: {
|
@@ -1096,6 +1155,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
1096
1155
|
NInput: any;
|
1097
1156
|
NCheckbox: any;
|
1098
1157
|
NCheckboxGroup: any;
|
1158
|
+
NTooltip: any;
|
1099
1159
|
SearchOutline: 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<{}>>, {}>;
|
1100
1160
|
AddOutline: 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<{}>>, {}>;
|
1101
1161
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
@@ -1318,6 +1378,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
1318
1378
|
NInput: any;
|
1319
1379
|
NCheckbox: any;
|
1320
1380
|
NCheckboxGroup: any;
|
1381
|
+
NTooltip: any;
|
1321
1382
|
SearchOutline: 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<{}>>, {}>;
|
1322
1383
|
AddOutline: 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<{}>>, {}>;
|
1323
1384
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
@@ -157,6 +157,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
157
157
|
NAvatar: any;
|
158
158
|
NIcon: any;
|
159
159
|
NButton: any;
|
160
|
+
NTooltip: any;
|
160
161
|
PersonProfile: import("vue").DefineComponent<{
|
161
162
|
userId: {
|
162
163
|
type: StringConstructor;
|
@@ -598,6 +599,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
598
599
|
NInput: any;
|
599
600
|
NCheckbox: any;
|
600
601
|
NCheckboxGroup: any;
|
602
|
+
NTooltip: any;
|
601
603
|
SearchOutline: 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<{}>>, {}>;
|
602
604
|
AddOutline: 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<{}>>, {}>;
|
603
605
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
@@ -966,6 +968,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
966
968
|
NInput: any;
|
967
969
|
NCheckbox: any;
|
968
970
|
NCheckboxGroup: any;
|
971
|
+
NTooltip: any;
|
969
972
|
SearchOutline: 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<{}>>, {}>;
|
970
973
|
AddOutline: 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<{}>>, {}>;
|
971
974
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
@@ -1009,11 +1012,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
1009
1012
|
listRef: import("vue").Ref<any>;
|
1010
1013
|
inputRef: import("vue").Ref<any>;
|
1011
1014
|
showSearch: import("vue").Ref<boolean>;
|
1012
|
-
keyword: import("vue").Ref<
|
1015
|
+
keyword: import("vue").Ref<string>;
|
1013
1016
|
state: IState;
|
1014
1017
|
openSession: (item: AnyObject) => Promise<void>;
|
1015
1018
|
userList: import("vue").Ref<AnyObject[]>;
|
1016
1019
|
handleInput: () => void;
|
1020
|
+
showNoData: import("vue").ComputedRef<boolean>;
|
1017
1021
|
addSession: (userId: string) => Promise<void>;
|
1018
1022
|
NPopover: any;
|
1019
1023
|
NButton: any;
|
@@ -1021,6 +1025,61 @@ declare const _default: import("vue").DefineComponent<{
|
|
1021
1025
|
NInput: any;
|
1022
1026
|
NIcon: any;
|
1023
1027
|
SearchOutline: 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<{}>>, {}>;
|
1028
|
+
DefaultPage: import("../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
|
1029
|
+
type: {
|
1030
|
+
type: StringConstructor;
|
1031
|
+
default: string;
|
1032
|
+
};
|
1033
|
+
config: {
|
1034
|
+
type: PropType<AnyObject>;
|
1035
|
+
default: () => {
|
1036
|
+
title: string;
|
1037
|
+
content: string;
|
1038
|
+
};
|
1039
|
+
};
|
1040
|
+
}, {
|
1041
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
1042
|
+
type: {
|
1043
|
+
type: StringConstructor;
|
1044
|
+
default: string;
|
1045
|
+
};
|
1046
|
+
config: {
|
1047
|
+
type: PropType<AnyObject>;
|
1048
|
+
default: () => {
|
1049
|
+
title: string;
|
1050
|
+
content: string;
|
1051
|
+
};
|
1052
|
+
};
|
1053
|
+
}>> & {
|
1054
|
+
onReloadPage?: ((...args: any[]) => any) | undefined;
|
1055
|
+
}>>;
|
1056
|
+
emit: (event: "reloadPage", ...args: any[]) => void;
|
1057
|
+
configResult: import("vue").ComputedRef<{
|
1058
|
+
title: string;
|
1059
|
+
content: string;
|
1060
|
+
img: string;
|
1061
|
+
}>;
|
1062
|
+
reloadPage: () => void;
|
1063
|
+
NIcon: any;
|
1064
|
+
Refresh: 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<{}>>, {}>;
|
1065
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "reloadPage"[], "reloadPage", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
1066
|
+
type: {
|
1067
|
+
type: StringConstructor;
|
1068
|
+
default: string;
|
1069
|
+
};
|
1070
|
+
config: {
|
1071
|
+
type: PropType<AnyObject>;
|
1072
|
+
default: () => {
|
1073
|
+
title: string;
|
1074
|
+
content: string;
|
1075
|
+
};
|
1076
|
+
};
|
1077
|
+
}>> & {
|
1078
|
+
onReloadPage?: ((...args: any[]) => any) | undefined;
|
1079
|
+
}, {
|
1080
|
+
type: string;
|
1081
|
+
config: AnyObject;
|
1082
|
+
}>>;
|
1024
1083
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
1025
1084
|
ChatAdd: import("vue").DefineComponent<{
|
1026
1085
|
title: {
|
@@ -1101,6 +1160,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1101
1160
|
NInput: any;
|
1102
1161
|
NCheckbox: any;
|
1103
1162
|
NCheckboxGroup: any;
|
1163
|
+
NTooltip: any;
|
1104
1164
|
SearchOutline: 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<{}>>, {}>;
|
1105
1165
|
AddOutline: 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<{}>>, {}>;
|
1106
1166
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
@@ -1323,6 +1383,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1323
1383
|
NInput: any;
|
1324
1384
|
NCheckbox: any;
|
1325
1385
|
NCheckboxGroup: any;
|
1386
|
+
NTooltip: any;
|
1326
1387
|
SearchOutline: 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<{}>>, {}>;
|
1327
1388
|
AddOutline: 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<{}>>, {}>;
|
1328
1389
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
@@ -79,6 +79,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
79
79
|
NInput: any;
|
80
80
|
NCheckbox: any;
|
81
81
|
NCheckboxGroup: any;
|
82
|
+
NTooltip: any;
|
82
83
|
SearchOutline: 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<{}>>, {}>;
|
83
84
|
AddOutline: 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<{}>>, {}>;
|
84
85
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as a,computed as l,watch as t,openBlock as i,createElementBlock as
|
1
|
+
import{defineComponent as e,ref as a,computed as l,watch as t,openBlock as i,createElementBlock as o,Fragment as u,createVNode as r,unref as s,withCtx as d,createElementVNode as n,createCommentVNode as v,isRef as c,renderList as p,createBlock as f,toDisplayString as m,createTextVNode as h,renderSlot as b}from"vue";import{NModal as g,NInput as k,NIcon as y,NCheckbox as _,NCheckboxGroup as w,NSpace as I,NAvatar as x,NTag as S,NTooltip as U,NButton as j}from"naive-ui";import{SearchOutline as C,AddOutline as L}from"@vicons/ionicons5";import{useState as A}from"../hooks/useState.js";import{listSort as V}from"../utils/index.js";import{cloneDeep as R,union as E,unionBy as G,remove as M,isArray as T,uniqBy as z}from"lodash-es";import{CHAT_TYPE as D}from"../constants/index.js";import{groupJoinApi as N,groupCreateApi as P}from"../api/index.js";import"trtc-sdk-v5";import{useSearchUserList as $}from"../hooks/useSearchUserList.js";const q={class:"iho-chat-dialog__content iho-chat-add-wrapper"},B={key:0,class:"input-box"},F=n("span",null,"群名称:",-1),H={class:"transfer-box"},J={class:"transfer-box__left"},K={class:"user-list-box"},O={key:1,class:"no-data"},Q={class:"transfer-box__right"},W={class:"checked-tag-box"};var X=e({__name:"ChatAdd",props:{title:{type:String,default:"添加新成员"},mode:{type:String,default:"select"},options:{type:Array},disabledIds:{type:Array,default:()=>[]},defaultValue:{type:Array}},emits:["comfirm"],setup(e,{emit:X}){const Y=e,{state:Z}=A(),ee=a(),ae=a(),le=a(!1),te=a([]),ie=a([]),oe=a(""),ue=a([]),{userList:re,handleInput:se}=$({wrapperRef:ee,keywordRef:ae,before:()=>{re.value=R(ie.value),me()},after:()=>{re.value.forEach((e=>{var a;e.disabled=null==(a=de.value)?void 0:a.includes(e.id)})),me()}}),de=l((()=>E(Y.disabledIds,[Z.userInfo.id]))),ne=l((()=>{var e,a;return(null==(e=Z.sessionList)?void 0:e.length)?null==(a=V(Z.sessionList).filter((e=>e.chatType===D.SINGLE)))?void 0:a.map((e=>({id:e.receiver,name:e.name,avatar:e.avatar}))):[]})),ve=l((()=>te.value.length?te.value.map((e=>e.id)):[])),ce=l((()=>"create"===Y.mode?ve.value.length<3:ve.value.length<1)),pe=l({get:()=>ue.value.length===re.value.filter((e=>!e.disabled)).length,set(e){const a=re.value.filter((e=>!e.disabled));ue.value=e?a.map((e=>e.id)):[],e?te.value=G(te.value,a,"id"):M(te.value,(e=>a.map((e=>e.id)).includes(e.id)))}});async function fe(){switch(Y.mode){case"create":await P({creator:Z.userInfo.id,memberIdSet:ve.value,name:oe.value,orgId:Z.orgId});break;case"join":await N({groupId:Z.currentSessionItem.receiver,operator:Z.userInfo.id,memberIdSet:ve.value}),Z.currentGroupUser.push(re.value.filter((e=>ve.value.includes(e.value))));break;default:X("comfirm",ve.value)}le.value=!1}function me(){var e,a;ue.value=null!=(a=null==(e=re.value.filter((e=>ve.value.includes(e.id))))?void 0:e.map((e=>e.id)))?a:[]}function he(e,a){if("check"===a.actionType){const e=re.value.find((e=>e.id===a.value));te.value.push(e)}else M(te.value,(e=>e.id===a.value))}return t((()=>le.value),(e=>{if(!e)return;const a=T(Y.options)&&Y.options.length?Y.options:ne.value;ie.value=z(a,"id").map((e=>{var a;return{...e,disabled:null==(a=de.value)?void 0:a.includes(e.id)}})),re.value=R(ie.value),T(Y.defaultValue)&&Y.defaultValue.length?(te.value=R(Y.defaultValue),me()):(te.value=[],ue.value=[])})),(a,l)=>(i(),o(u,null,[r(s(g),{preset:"dialog",title:e.title,"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog",show:le.value,"onUpdate:show":l[4]||(l[4]=e=>le.value=e),"negative-text":"取消","positive-text":"确定","positive-button-props":{disabled:s(ce)},onPositiveClick:fe},{default:d((()=>[n("div",q,["create"===e.mode?(i(),o("div",B,[F,r(s(k),{clearable:"",placeholder:"取个群名称方便后续搜索",value:oe.value,"onUpdate:value":l[0]||(l[0]=e=>oe.value=e),valueModifiers:{trim:!0}},null,8,["value"])])):v("v-if",!0),n("div",H,[n("div",J,[r(s(k),{placeholder:"搜索",clearable:"",value:ae.value,"onUpdate:value":[l[1]||(l[1]=e=>ae.value=e),s(se)],valueModifiers:{trim:!0}},{prefix:d((()=>[r(s(y),{component:s(C)},null,8,["component"])])),_:1},8,["value","onUpdate:value"]),n("div",K,[s(re).length>0?(i(),o(u,{key:0},[r(s(_),{label:"全选",checked:s(pe),"onUpdate:checked":l[2]||(l[2]=e=>c(pe)?pe.value=e:null)},null,8,["checked"]),r(s(w),{ref_key:"listRef",ref:ee,value:ue.value,"onUpdate:value":[l[3]||(l[3]=e=>ue.value=e),he]},{default:d((()=>[(i(!0),o(u,null,p(s(re),(e=>(i(),f(s(_),{key:e.id,value:e.id,disabled:e.disabled},{default:d((()=>[r(s(I),{align:"center","wrap-item":!1},{default:d((()=>[r(s(x),{src:e.avatar,round:"",size:32},null,8,["src"]),n("span",null,m(e.name),1)])),_:2},1024)])),_:2},1032,["value","disabled"])))),128))])),_:1},8,["value"])],64)):(i(),o("div",O,"找不到相关结果"))])]),n("div",Q,[n("span",null,"已选择 "+m(s(ve).length)+" 人",1),n("div",W,[(i(!0),o(u,null,p(te.value,(e=>(i(),f(s(S),{key:e.id,bordered:!1,closable:e.id!==s(Z).userInfo.id,disabled:s(de).includes(e.id),onClose:()=>{return a=e.id,M(te.value,(e=>e.id===a)),void M(ue.value,(e=>e===a));var a}},{avatar:d((()=>[r(s(x),{round:"",src:e.avatar},null,8,["src"])])),default:d((()=>[h(" "+m(e.name),1)])),_:2},1032,["closable","disabled","onClose"])))),128))])])])])])),_:1},8,["title","show","positive-button-props"]),n("span",{class:"btn-wrapper",onClick:l[5]||(l[5]=e=>le.value=!0)},[b(a.$slots,"trigger",{},(()=>[r(s(U),{"show-arrow":!1,trigger:"hover",placement:"bottom"},{trigger:d((()=>[r(s(j),{color:"#ffffff4D",class:"add-btn"},{icon:d((()=>[r(s(y),{component:s(L),color:"#fff"},null,8,["component"])])),_:1})])),default:d((()=>[h(" "+m(e.title),1)])),_:1})]))])],64))}});export{X as default};
|
@@ -114,6 +114,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
114
114
|
NInput: any;
|
115
115
|
NCheckbox: any;
|
116
116
|
NCheckboxGroup: any;
|
117
|
+
NTooltip: any;
|
117
118
|
SearchOutline: 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<{}>>, {}>;
|
118
119
|
AddOutline: 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<{}>>, {}>;
|
119
120
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", 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 n,watch as o,withDirectives as
|
1
|
+
import{defineComponent as e,ref as t,computed as n,watch as o,withDirectives as r,openBlock as i,createElementBlock as s,normalizeStyle as a,unref as c,createElementVNode as l,toDisplayString as u,createVNode as g,createCommentVNode as p,withCtx as f,Fragment as m,renderList as d,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 C,NUpload as I,NUploadTrigger as T}from"naive-ui";import E from"./ChatAdd.vue.js";import{useState as b}from"../hooks/useState.js";import{useSession as x}from"../hooks/useSession.js";import{MESSAGE_TYPE as z,AV_STATUS as j}from"../constants/index.js";import"trtc-sdk-v5";import{simplifyMessage as L}from"../utils/index.js";import{emojis as R}from"../utils/emoji.js";import{uploadFileApi as q}from"../api/index.js";import{CloseCircleOutline as O,CallOutline as D,VideocamOutline as A}from"@vicons/ionicons5";import{xor as V,cloneDeep as K}from"lodash-es";import{uuidGenerator as F}from"../../../../shared/utils/index.js";const H={key:0,class:"reference-content-box"},U={class:"reference-content"},G=["innerHTML"],J={class:"tool-box"},N=l("i",{class:"chat--iconfont chat--icon-face"},null,-1),S=l("span",null,"默认表情",-1),X={class:"list-box"},B=["src"],$=l("i",{class:"chat--iconfont chat--icon-good"},null,-1),P=l("i",{class:"chat--iconfont chat--icon-image"},null,-1),Q=l("i",{class:"chat--iconfont chat--icon-folder"},null,-1),W={class:"btn-box"},Y=l("span",{class:"tip"},"Enter 发送, Ctrl + Enter 换行",-1);var Z=e({__name:"ChatFooter",setup(e){const Z=t(),{state:ee,sendMessage:te}=b(),{isGroupChat:ne}=x(ee),oe=t(!1),re=t(""),ie=n((()=>({options:ee.currentGroupUser,defaultValue:[ee.userInfo]})));function se(e,t=[]){const n=F(),o=[],r=t.length>0;ee.showVideo||ee.showMultipleVideo||(r?(o.push(...V(t,[ee.userInfo.id])),Object.assign(ee.currentAVMsg,{callMode:"call",checkedIds:o,strRoomId:n,chatMessageType:e}),ee.showMultipleVideo=!0):te({content:{chatMessageType:e,msg:"",avStatus:j.IN_CALL}}))}function ae(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(),ue()))}function ce(){var e;re.value=(null==(e=Z.value)?void 0:e.innerHTML)||""}async function le(e,t){const{file:n,name:o}=e.file,r=new FormData;r.append("sender",ee.userInfo.id),r.append("file",n);const i=await q(r);if(!i)return console.log("上传失败");ge({chatMessageType:t,msg:t===z.FILE?o:i,url:i})}function ue(){const{innerHTML:e="",innerText:t=""}=Z.value||{};if(re.value.trim().length>2e3)return void console.log("请控制在2000字以内");if(!re.value)return console.log("请输入内容");const n=e.split(t).find((e=>!!e));let o=z.TEXT,r="";if(n){if(t.replace(/\n$/,"")||(e.match(/<img[^>]*>/gi)||[]).length>1)o=z.BLEND,r=e;else if(e.includes(z.EMOJI)){o=z.EMOJI;const t=e.match(/data-msg\s*=\s*"([^"]*)"/);t&&(r=t[1])}else{o=z.IMAGE;const t=e.match(/src\s*=\s*"([^"]*)"/);t&&(r=t[1])}}else r=t.trim();r&&ge({msg:r,chatMessageType:o,origin:"btn"})}async function ge(e){const{chatMessageType:t=z.TEXT,msg:n,url:o,origin:r=""}=e,i={msg:n,chatMessageType:t};t===z.FILE&&(i.fileUrl=o),"btn"===r&&(Z.value.innerHTML="",re.value=""),ee.currentReferenceMsg&&(t===z.TEXT&&(i.referenceContent=K(ee.currentReferenceMsg)),ee.currentReferenceMsg=null),te({content:i})}return o((()=>ee.currentReferenceMsg),(e=>{var t;e&&(null==(t=Z.value)||t.focus())})),(e,t)=>r((i(),s("section",{class:"chat-footer",style:a({cursor:c(ee).id?"default":"not-allowed"})},[c(ee).currentReferenceMsg?(i(),s("div",H,[l("div",U,[l("span",null,u(c(ee).currentReferenceMsg.senderName)+":",1),l("pre",{innerHTML:c(L)(c(ee).currentReferenceMsg.content)},null,8,G)]),g(c(M),{component:c(O),onClick:t[0]||(t[0]=()=>c(ee).currentReferenceMsg=null)},null,8,["component"])])):p("v-if",!0),l("div",J,[g(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:f((()=>[g(c(k),{"content-class":"emoji-content",class:"emoji-wrapper",show:oe.value,"onUpdate:show":t[1]||(t[1]=e=>oe.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:f((()=>[g(c(C),{quaternary:"",size:"tiny"},{icon:f((()=>[N])),_:1})])),default:f((()=>[S,l("div",X,[(i(!0),s(m,null,d(c(R).default,(([e,t])=>(i(),h(c(_),{key:e,"show-arrow":!1,trigger:"hover"},{trigger:f((()=>[g(c(C),{quaternary:"",size:"tiny",onClick:()=>function(e){oe.value=!1,ge({chatMessageType:z.EMOJI,msg:e})}(e)},{icon:f((()=>[l("img",{src:t},null,8,B)])),_:2},1032,["onClick"])])),default:f((()=>[y(" "+u(e),1)])),_:2},1024)))),128))])])),_:1},8,["show"])])),default:f((()=>[y(" 表情 ")])),_:1}),g(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:f((()=>[g(c(C),{quaternary:"",size:"tiny",onClick:t[2]||(t[2]=()=>ge({chatMessageType:c(z).EMOJI,msg:0}))},{icon:f((()=>[$])),_:1})])),default:f((()=>[y(" 点赞 ")])),_:1}),g(c(I),{abstract:"",multiple:"",accept:"image/*",onChange:t[3]||(t[3]=e=>le(e,c(z).IMAGE))},{default:f((()=>[g(c(T),{abstract:""},{default:f((({handleClick:e})=>[g(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:f((()=>[g(c(C),{quaternary:"",size:"tiny",onClick:e},{icon:f((()=>[P])),_:2},1032,["onClick"])])),default:f((()=>[y(" 上传图片 ")])),_:2},1024)])),_:1})])),_:1}),g(c(I),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:t[4]||(t[4]=e=>le(e,c(z).FILE))},{default:f((()=>[g(c(T),{abstract:""},{default:f((({handleClick:e})=>[g(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:f((()=>[g(c(C),{quaternary:"",size:"tiny",onClick:e},{icon:f((()=>[Q])),_:2},1032,["onClick"])])),default:f((()=>[y(" 上传文件 ")])),_:2},1024)])),_:1})])),_:1}),c(ne)?(i(),s(m,{key:0},[g(E,v(c(ie),{onComfirm:t[5]||(t[5]=e=>se(c(z).AUDIO,e))}),{trigger:f((()=>[g(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:f((()=>[g(c(C),{quaternary:"",size:"tiny"},{icon:f((()=>[g(c(M),{size:"18",component:c(D)},null,8,["component"])])),_:1})])),default:f((()=>[y(" 语音通话 ")])),_:1})])),_:1},16),g(E,v(c(ie),{onComfirm:t[6]||(t[6]=e=>se(c(z).VIDEO,e))}),{trigger:f((()=>[g(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:f((()=>[g(c(C),{quaternary:"",size:"tiny"},{icon:f((()=>[g(c(M),{size:"20",component:c(A)},null,8,["component"])])),_:1})])),default:f((()=>[y(" 视频会议 ")])),_:1})])),_:1},16)],64)):(i(),s(m,{key:1},[g(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:f((()=>[g(c(C),{quaternary:"",size:"tiny",onClick:t[7]||(t[7]=()=>se(c(z).AUDIO))},{icon:f((()=>[g(c(M),{size:"18",component:c(D)},null,8,["component"])])),_:1})])),default:f((()=>[y(" 语音通话 ")])),_:1}),g(c(_),{"show-arrow":!1,trigger:"hover",placement:"top"},{trigger:f((()=>[g(c(C),{quaternary:"",size:"tiny",onClick:t[8]||(t[8]=()=>se(c(z).VIDEO))},{icon:f((()=>[g(c(M),{size:"20",component:c(A)},null,8,["component"])])),_:1})])),default:f((()=>[y(" 视频通话 ")])),_:1})],64))]),r(l("div",{ref_key:"inputRef",ref:Z,class:"input-box",contenteditable:"",onKeydown:ae,onInput:ce},null,544),[[w,c(ee).id]]),l("div",W,[Y,g(c(C),{type:"primary",round:"",disabled:!re.value,onClick:ue},{default:f((()=>[y("发送")])),_:1},8,["disabled"])])],4)),[[w,c(ee).id]])}});export{Z as default};
|
@@ -19,6 +19,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
19
19
|
NAvatar: any;
|
20
20
|
NIcon: any;
|
21
21
|
NButton: any;
|
22
|
+
NTooltip: any;
|
22
23
|
PersonProfile: import("vue").DefineComponent<{
|
23
24
|
userId: {
|
24
25
|
type: StringConstructor;
|
@@ -460,6 +461,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
460
461
|
NInput: any;
|
461
462
|
NCheckbox: any;
|
462
463
|
NCheckboxGroup: any;
|
464
|
+
NTooltip: any;
|
463
465
|
SearchOutline: 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<{}>>, {}>;
|
464
466
|
AddOutline: 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<{}>>, {}>;
|
465
467
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "comfirm"[], "comfirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|