cnhis-design-vue 3.2.8-release.2 → 3.2.8-release.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -87
- package/es/components/ai-chat/index.d.ts +9 -0
- package/es/components/ai-chat/src/Index.vue.d.ts +9 -0
- package/es/components/ai-chat/src/Index.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatMain.js +1 -1
- package/es/components/ai-chat/src/types/index.d.ts +1 -1
- package/es/components/ai-chat/style/index.css +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +2 -2
- package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
- package/es/components/iho-chat/index.d.ts +8 -1
- package/es/components/iho-chat/src/Index.vue.d.ts +8 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +8 -1
- 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.vue.d.ts +1 -0
- package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +6 -0
- package/es/components/iho-chat/src/components/ChatSet.vue2.js +1 -1
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +1 -0
- package/es/components/info-header/index.d.ts +1 -0
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/shared/assets/img/ai__avatar.png.js +1 -1
- package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
- package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
- package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
- package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
- package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
- package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
- package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
- package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
- package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
- package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
- package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/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
|
+
```
|
@@ -4,6 +4,9 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
4
4
|
type: StringConstructor;
|
5
5
|
required: true;
|
6
6
|
};
|
7
|
+
defaultShortcutList: {
|
8
|
+
type: import("vue").PropType<string[]>;
|
9
|
+
};
|
7
10
|
shortcutList: {
|
8
11
|
type: import("vue").PropType<string[]>;
|
9
12
|
};
|
@@ -22,6 +25,9 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
22
25
|
type: StringConstructor;
|
23
26
|
required: true;
|
24
27
|
};
|
28
|
+
defaultShortcutList: {
|
29
|
+
type: import("vue").PropType<string[]>;
|
30
|
+
};
|
25
31
|
shortcutList: {
|
26
32
|
type: import("vue").PropType<string[]>;
|
27
33
|
};
|
@@ -60,6 +66,9 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
60
66
|
type: StringConstructor;
|
61
67
|
required: true;
|
62
68
|
};
|
69
|
+
defaultShortcutList: {
|
70
|
+
type: import("vue").PropType<string[]>;
|
71
|
+
};
|
63
72
|
shortcutList: {
|
64
73
|
type: import("vue").PropType<string[]>;
|
65
74
|
};
|
@@ -6,6 +6,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
6
6
|
type: StringConstructor;
|
7
7
|
required: true;
|
8
8
|
};
|
9
|
+
defaultShortcutList: {
|
10
|
+
type: PropType<string[]>;
|
11
|
+
};
|
9
12
|
shortcutList: {
|
10
13
|
type: PropType<string[]>;
|
11
14
|
};
|
@@ -24,6 +27,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
24
27
|
type: StringConstructor;
|
25
28
|
required: true;
|
26
29
|
};
|
30
|
+
defaultShortcutList: {
|
31
|
+
type: PropType<string[]>;
|
32
|
+
};
|
27
33
|
shortcutList: {
|
28
34
|
type: PropType<string[]>;
|
29
35
|
};
|
@@ -62,6 +68,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
62
68
|
type: StringConstructor;
|
63
69
|
required: true;
|
64
70
|
};
|
71
|
+
defaultShortcutList: {
|
72
|
+
type: PropType<string[]>;
|
73
|
+
};
|
65
74
|
shortcutList: {
|
66
75
|
type: PropType<string[]>;
|
67
76
|
};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,reactive as
|
1
|
+
import{defineComponent as e,reactive as t,provide as r,toRefs as o,openBlock as s,createElementBlock as i,normalizeStyle as a,unref as n,createVNode as p}from"vue";import u from"./components/ChatMain.js";import m from"./components/ChatFooter.vue.js";import{useTheme as d}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"naive-ui";import"../../../shared/hooks/useScrollLoading.js";import{InjectionAIChat as h}from"./types/index.js";var c=e({__name:"Index",props:{userAvatar:{type:String,required:!0},defaultShortcutList:{type:Array},shortcutList:{type:Array},queryData:{type:Function,reuired:!0},queryRecord:{type:Function,reuired:!0}},setup(e){const c=e,y=d(),v=t({beingSent:!1,sendContent:""});return r(h,{...o(c),state:v}),(e,t)=>(s(),i("div",{class:"ai-chat",style:a(n(y))},[p(n(u)),p(m)],4))}});export{c as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as
|
1
|
+
import{defineComponent as e,inject as n,ref as t,computed as l,watch as a,openBlock as i,createElementBlock as o,normalizeClass as s,unref as u,Fragment as r,renderList as c,createBlock as d,withCtx as v,createTextVNode as f,toDisplayString as p,createCommentVNode as b,createElementVNode as m,createVNode as y}from"vue";import{NButton as h,NInput as x,NIcon as g}from"naive-ui";import{PaperPlane as k}from"@vicons/ionicons5";import{InjectionAIChat as C}from"../types/index.js";const K={key:0,class:"menu-box fillet-8"},S={class:"input-wrapper fillet-10"},w={class:"input-box"},z={class:"btn-box"},_=["disabled"];var E=e({__name:"ChatFooter",setup(e){const{shortcutList:E,state:R}=n(C),j=t(""),D=l((()=>!j.value.replace(/( |\s|<br>)+/g,"")));function F(e){["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),L()))}function L(){D.value||(R.beingSent=!0,R.sendContent=j.value,j.value="")}return a((()=>R.sendContent),(e=>{e&&!R.beingSent&&(j.value=e)})),(e,n)=>(i(),o("section",{class:s(["chat-footer",u(R).beingSent?"disabled":""])},[u(E)&&u(E).length>0?(i(),o("div",K,[(i(!0),o(r,null,c(u(E),(e=>(i(),d(u(h),{secondary:"",size:"small",key:e,onClick:n=>j.value=e},{default:v((()=>[f(p(e),1)])),_:2},1032,["onClick"])))),128))])):b("v-if",!0),m("div",S,[m("div",w,[y(u(x),{type:"textarea",placeholder:"请向我提问,Shift+Enter换行",disabled:u(R).beingSent,autosize:{minRows:2,maxRows:7},value:j.value,"onUpdate:value":n[0]||(n[0]=e=>j.value=e),onKeydown:F},null,8,["disabled","value"])]),m("div",z,[m("span",{class:s(["btn-send","fillet-8",u(D)?"disabled":""]),disabled:u(D),onClick:L},[y(u(g),{color:"#fff",size:"22",component:u(k)},null,8,["component"])],10,_)])])],2))}});export{E as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as t,ref as
|
1
|
+
import{defineComponent as e,inject as t,ref as n,watch as s,createVNode as r,createTextVNode as l,isVNode as a}from"vue";import{NAvatar as o,NSpin as i,NSpace as u,NButton as c}from"naive-ui";import{InjectionAIChat as p}from"../types/index.js";import d from"../../../../shared/assets/img/ai__avatar.png.js";import{isArray as m,isFunction as f}from"lodash";import"../../../../shared/utils/index.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{useScrollLoading as v}from"../../../../shared/hooks/useScrollLoading.js";function g(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!a(e)}var h=e({name:"ChatMain",inheritAttrs:!1,props:{},emits:[],setup(e,{attrs:a,slots:h,emit:b}){const{userAvatar:y,queryData:j,state:S,queryRecord:C,defaultShortcutList:x=[]}=t(p),k=n(null),z=n([]),A=n(!1),M={page:0,hasMore:!0};async function w(e=!1){if(!M.hasMore)return;M.page++;const t=await C.value({page:M.page});if(!Array.isArray(t)||0===t.length)return e&&(A.value=!0),M.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了");z.value=M.page>1?[...t,...z.value]:t}function q({content:e=""}){return e.replace(/\\n|\n|\r/g,"<br>").split("<br>").map(((e,t,n)=>[e,t===n.length-1?null:r("br",null,null)]))}function E({role:e=""}){return"user"===e}function H(){let e;return r("div",{class:"message-item"},[r(o,{round:!0,size:40,src:d},null),r("div",{class:"content fillet-10 default"},[r("h2",null,[l("Hi,我是你的AI助理")]),r("p",null,[l("我汇集了医生站/护士站各项智能服务,可以像我进行提问哦 ~ "),r("br",null,null),l("你的反馈助我成长,期待我们一起探索未来!下次可以在首页和应用页找到我~")]),x.value.length>0?[r("p",{style:"margin: 5px 0 5px"},[l("你可以试着问我:")]),r(u,{"wrap-item":!1},g(e=x.value.map((e=>r(c,{size:"large",secondary:!0,onClick:()=>S.sendContent=e,disabled:S.beingSent},g(e)?e:{default:()=>[e]}))))?e:{default:()=>[e]})]:null])])}return v(k,(()=>{w()}),"top"),w(!0),s((()=>S.beingSent),(async e=>{if(e){z.value.unshift({role:"user",content:S.sendContent});const e=await j.value({content:S.sendContent,contentType:"text"});m(e)&&z.value.unshift(...e),S.beingSent=!1,S.sendContent=""}})),()=>r("section",{class:"chat-main",ref:k},[[S.beingSent?r("div",{class:"message-item"},[r(o,{round:!0,size:40,src:d},null),r("div",{class:"content fillet-10 loading"},[r(i,{size:22,stroke:"#4170EE"},null),r("span",null,[l("正在加载中,请稍等...")])])]):null,z.value.map((e=>r("div",{class:"message-item"},[r(o,{round:!0,size:40,src:E(e)?y.value:d},null),r("div",{class:["content",E(e)?"fillet-8 mine":"fillet-10"]},[f(e.render)?e.render():q(e)])]))),A.value?H():null]])}});export{h as default};
|
@@ -1 +1 @@
|
|
1
|
-
.ai-chat{background:linear-gradient(135deg,#c9dbfb,#c9dbfb 20%,rgba(237,237,253,.5) 70%,rgba(151,97,251,.2));display:flex;flex-flow:column nowrap;height:100%;padding:45px 0 60px;width:100%}.ai-chat *{box-sizing:border-box}.ai-chat .fillet-10{border-radius:10px}.ai-chat .fillet-8{border-radius:8px}.ai-chat .n-avatar{background-color:var(--c-primary-color)}.ai-chat .chat-main{display:flex;flex:1;flex-flow:column-reverse nowrap;overflow-y:scroll;padding:0 130px 0 82px;row-gap:16px}.ai-chat .chat-main::-webkit-scrollbar{width:5px}.ai-chat .chat-main::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .chat-main .message-item{column-gap:8px;display:flex;flex-flow:row nowrap}.ai-chat .chat-main .message-item .n-avatar{flex-shrink:0}.ai-chat .chat-main .message-item .content{background:#fff;padding:10px 12px}.ai-chat .chat-main .message-item .content.mine{background:hsla(0,0%,100%,.48)}.ai-chat .chat-main .message-item .content.loading{align-items:center;color:#999;column-gap:10px;display:flex}.ai-chat .chat-footer{padding:30px 130px 0}.ai-chat .chat-footer.disabled{cursor:not-allowed}.ai-chat .chat-footer .menu-box{background:#fff;column-gap:8px;display:flex;margin-bottom:8px;padding:10px}.ai-chat .chat-footer .input-wrapper{background:#fff;box-shadow:0 3px 4px 0 rgba(0,0,0,.1);padding:15px 20px}.ai-chat .chat-footer .input-wrapper .n-input__border,.ai-chat .chat-footer .input-wrapper .n-input__state-border{border:none}.ai-chat .chat-footer .input-wrapper .n-input:not(.n-input--disabled).n-input--focus .n-input__state-border{box-shadow:unset}.ai-chat .chat-footer .input-wrapper .btn-box{display:flex;justify-content:flex-end}.ai-chat .chat-footer .input-wrapper .btn-box .btn-send{align-items:center;background:linear-gradient(178deg,#8f66f7,#4170ee);cursor:pointer;display:flex;height:46px;justify-content:center;width:58px}.ai-chat .chat-footer .input-wrapper .btn-box .btn-send.disabled{cursor:not-allowed}
|
1
|
+
.ai-chat{background:linear-gradient(135deg,#c9dbfb,#c9dbfb 20%,rgba(237,237,253,.5) 70%,rgba(151,97,251,.2));display:flex;flex-flow:column nowrap;height:100%;padding:45px 0 60px;width:100%}.ai-chat,.ai-chat *{box-sizing:border-box}.ai-chat .fillet-10{border-radius:10px}.ai-chat .fillet-8{border-radius:8px}.ai-chat .n-avatar{background-color:var(--c-primary-color)}.ai-chat .chat-main{display:flex;flex:1;flex-flow:column-reverse nowrap;overflow-y:scroll;padding:0 130px 0 82px;row-gap:16px}.ai-chat .chat-main::-webkit-scrollbar{width:5px}.ai-chat .chat-main::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .chat-main .message-item{column-gap:8px;display:flex;flex-flow:row nowrap}.ai-chat .chat-main .message-item:first-child{margin-bottom:auto}.ai-chat .chat-main .message-item .n-avatar{flex-shrink:0}.ai-chat .chat-main .message-item .content{background:#fff;padding:10px 12px}.ai-chat .chat-main .message-item .content.default h2{font-size:22px;font-weight:500;margin:10px 0}.ai-chat .chat-main .message-item .content.mine{background:hsla(0,0%,100%,.48)}.ai-chat .chat-main .message-item .content.loading{align-items:center;color:#999;column-gap:10px;display:flex}.ai-chat .chat-footer{padding:30px 130px 0}.ai-chat .chat-footer.disabled{cursor:not-allowed}.ai-chat .chat-footer .menu-box{background:#fff;column-gap:8px;display:flex;margin-bottom:8px;padding:10px}.ai-chat .chat-footer .input-wrapper{background:#fff;box-shadow:0 3px 4px 0 rgba(0,0,0,.1);padding:15px 20px}.ai-chat .chat-footer .input-wrapper .n-input__border,.ai-chat .chat-footer .input-wrapper .n-input__state-border{border:none}.ai-chat .chat-footer .input-wrapper .n-input:not(.n-input--disabled).n-input--focus .n-input__state-border{box-shadow:unset}.ai-chat .chat-footer .input-wrapper .btn-box{display:flex;justify-content:flex-end}.ai-chat .chat-footer .input-wrapper .btn-box .btn-send{align-items:center;background:linear-gradient(178deg,#8f66f7,#4170ee);cursor:pointer;display:flex;height:46px;justify-content:center;width:58px}.ai-chat .chat-footer .input-wrapper .btn-box .btn-send.disabled{cursor:not-allowed}
|
@@ -486,9 +486,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
486
486
|
}>;
|
487
487
|
developMode: boolean;
|
488
488
|
draggable: boolean;
|
489
|
+
isHighlightRow: boolean;
|
489
490
|
idx: number;
|
490
491
|
isHighlight: boolean;
|
491
|
-
isHighlightRow: boolean;
|
492
492
|
isFieldSet: boolean;
|
493
493
|
fieldDescribeMode: "column" | "tooltip";
|
494
494
|
}>;
|
@@ -508,9 +508,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
508
508
|
}>;
|
509
509
|
developMode: boolean;
|
510
510
|
draggable: boolean;
|
511
|
+
isHighlightRow: boolean;
|
511
512
|
idx: number;
|
512
513
|
isHighlight: boolean;
|
513
|
-
isHighlightRow: boolean;
|
514
514
|
isFieldSet: boolean;
|
515
515
|
fieldDescribeMode: "column" | "tooltip";
|
516
516
|
}>;
|
@@ -646,9 +646,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
646
646
|
}>;
|
647
647
|
developMode: boolean;
|
648
648
|
draggable: boolean;
|
649
|
+
isHighlightRow: boolean;
|
649
650
|
idx: number;
|
650
651
|
isHighlight: boolean;
|
651
|
-
isHighlightRow: boolean;
|
652
652
|
isFieldSet: boolean;
|
653
653
|
fieldDescribeMode: "column" | "tooltip";
|
654
654
|
}>;
|
@@ -766,8 +766,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
766
766
|
developMode: boolean;
|
767
767
|
footerFlag: boolean;
|
768
768
|
fieldDescribeMode: "column" | "tooltip";
|
769
|
-
showSearch: boolean;
|
770
769
|
customColumns: FieldSetColumnItem[];
|
770
|
+
showSearch: boolean;
|
771
771
|
showSortPriority: boolean;
|
772
772
|
showHeadFilter: boolean;
|
773
773
|
}>;
|
@@ -337,9 +337,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
337
337
|
}>;
|
338
338
|
developMode: boolean;
|
339
339
|
draggable: boolean;
|
340
|
+
isHighlightRow: boolean;
|
340
341
|
idx: number;
|
341
342
|
isHighlight: boolean;
|
342
|
-
isHighlightRow: boolean;
|
343
343
|
isFieldSet: boolean;
|
344
344
|
fieldDescribeMode: "column" | "tooltip";
|
345
345
|
}>;
|
@@ -230,8 +230,12 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
230
230
|
inputRef: import("vue").Ref<any>;
|
231
231
|
groupNameEditing: import("vue").Ref<boolean>;
|
232
232
|
groupName: import("vue").Ref<string>;
|
233
|
+
showGroupDetail: import("vue").Ref<boolean>;
|
234
|
+
isGroupLeader: import("vue").ComputedRef<boolean>;
|
233
235
|
currentGroupUserIds: import("vue").ComputedRef<any[]>;
|
236
|
+
currentGroupUser: import("vue").ComputedRef<import("../../shared/types").AnyObject[]>;
|
234
237
|
handleTopping: (value: boolean) => Promise<void>;
|
238
|
+
handleLeaveGroup: (dissolution: boolean) => Promise<void>;
|
235
239
|
handleToEdit: () => Promise<void>;
|
236
240
|
submitFormData: (o: import("../../shared/types").AnyObject) => Promise<void>;
|
237
241
|
handleGroupName: () => Promise<void>;
|
@@ -247,10 +251,12 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
247
251
|
NButton: any;
|
248
252
|
NUploadTrigger: any;
|
249
253
|
NUpload: any;
|
254
|
+
NPopconfirm: any;
|
250
255
|
ChevronForwardOutline: 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<{}>>, {}>;
|
251
256
|
Pencil: 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<{}>>, {}>;
|
252
257
|
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<{}>>, {}>;
|
253
258
|
RemoveOutline: 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<{}>>, {}>;
|
259
|
+
ChevronBackOutline: 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<{}>>, {}>;
|
254
260
|
PersonProfile: import("vue").DefineComponent<{
|
255
261
|
userId: {
|
256
262
|
type: StringConstructor;
|
@@ -472,8 +478,8 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
472
478
|
NImage: any;
|
473
479
|
NInput: any;
|
474
480
|
NIcon: any;
|
481
|
+
NTooltip: any;
|
475
482
|
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<{}>>, {}>;
|
476
|
-
OpenOutline: 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<{}>>, {}>;
|
477
483
|
DownloadOutline: 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<{}>>, {}>;
|
478
484
|
downloadFile: typeof import("./src/utils").downloadFile;
|
479
485
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
@@ -520,6 +526,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
520
526
|
startDateDisabled: (ts: number) => boolean;
|
521
527
|
endDateDisabled: (ts: number) => boolean;
|
522
528
|
resetInfo: () => void;
|
529
|
+
formatEndTime: () => string;
|
523
530
|
handleCloseTag: (type: "start" | "end" | "member") => void;
|
524
531
|
getPrefixCondition: () => (JSX.Element | null)[];
|
525
532
|
renderLabel: (option: import("../../shared/types").AnyObject) => JSX.Element;
|
@@ -235,8 +235,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
235
235
|
inputRef: import("vue").Ref<any>;
|
236
236
|
groupNameEditing: import("vue").Ref<boolean>;
|
237
237
|
groupName: import("vue").Ref<string>;
|
238
|
+
showGroupDetail: import("vue").Ref<boolean>;
|
239
|
+
isGroupLeader: import("vue").ComputedRef<boolean>;
|
238
240
|
currentGroupUserIds: import("vue").ComputedRef<any[]>;
|
241
|
+
currentGroupUser: import("vue").ComputedRef<AnyObject[]>;
|
239
242
|
handleTopping: (value: boolean) => Promise<void>;
|
243
|
+
handleLeaveGroup: (dissolution: boolean) => Promise<void>;
|
240
244
|
handleToEdit: () => Promise<void>;
|
241
245
|
submitFormData: (o: AnyObject) => Promise<void>;
|
242
246
|
handleGroupName: () => Promise<void>;
|
@@ -252,10 +256,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
252
256
|
NButton: any;
|
253
257
|
NUploadTrigger: any;
|
254
258
|
NUpload: any;
|
259
|
+
NPopconfirm: any;
|
255
260
|
ChevronForwardOutline: 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<{}>>, {}>;
|
256
261
|
Pencil: 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<{}>>, {}>;
|
257
262
|
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<{}>>, {}>;
|
258
263
|
RemoveOutline: 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<{}>>, {}>;
|
264
|
+
ChevronBackOutline: 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<{}>>, {}>;
|
259
265
|
PersonProfile: import("vue").DefineComponent<{
|
260
266
|
userId: {
|
261
267
|
type: StringConstructor;
|
@@ -477,8 +483,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
477
483
|
NImage: any;
|
478
484
|
NInput: any;
|
479
485
|
NIcon: any;
|
486
|
+
NTooltip: any;
|
480
487
|
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<{}>>, {}>;
|
481
|
-
OpenOutline: 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<{}>>, {}>;
|
482
488
|
DownloadOutline: 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<{}>>, {}>;
|
483
489
|
downloadFile: typeof import("./utils").downloadFile;
|
484
490
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
@@ -525,6 +531,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
525
531
|
startDateDisabled: (ts: number) => boolean;
|
526
532
|
endDateDisabled: (ts: number) => boolean;
|
527
533
|
resetInfo: () => void;
|
534
|
+
formatEndTime: () => string;
|
528
535
|
handleCloseTag: (type: "start" | "end" | "member") => void;
|
529
536
|
getPrefixCondition: () => (JSX.Element | null)[];
|
530
537
|
renderLabel: (option: AnyObject) => JSX.Element;
|
@@ -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 r,createVNode as s,unref as u,withCtx as n,createElementVNode as d,createCommentVNode as v,isRef as c,renderList as p,createBlock as m,toDisplayString as f,createTextVNode as h,renderSlot as b}from"vue";import{NModal as g,NInput as I,NIcon as k,NCheckbox as y,NCheckboxGroup as w,NSpace as _,NAvatar as S,NTag as x,NTooltip as j,NButton as U}from"naive-ui";import{SearchOutline as C,AddOutline as L}from"@vicons/ionicons5";import{useState as A}from"../hooks/useState.js";import{useSession as R}from"../hooks/useSession.js";import{CHAT_TYPE as V}from"../constants/index.js";import"trtc-sdk-v5";import{listSort as E}from"../utils/index.js";import{groupLeaveApi as G,groupJoinApi as N,groupCreateApi as $}from"../api/index.js";import{cloneDeep as M,union as T,unionBy as z,remove as D,isArray as P,uniqBy as q,trim as B}from"lodash-es";import{useSearchUserList as F}from"../hooks/useSearchUserList.js";const H={class:"iho-chat-dialog__content iho-chat-add-wrapper"},J={key:0,class:"input-box"},K=d("span",null,"群名称:",-1),O={class:"transfer-box"},Q={class:"transfer-box__left"},W={class:"user-list-box"},X={key:1,class:"no-data"},Y={class:"transfer-box__right"},Z={class:"checked-tag-box"};var ee=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:ee}){const ae=e,{state:le}=A(),{setCurrentSessionItem:te}=R(le),ie=a(),oe=a(""),re=a(!1),se=a([]),ue=a([]),ne=a(""),de=a([]),{userList:ve,handleInput:ce}=F({wrapperRef:ie,keywordRef:oe,before:()=>{ve.value=M(ue.value),Ie()},after:()=>{ve.value.forEach((e=>{var a;e.disabled=null==(a=pe.value)?void 0:a.includes(e.id)})),Ie()}}),pe=l((()=>T(ae.disabledIds,[le.userInfo.id]))),me=l((()=>{var e,a;return(null==(e=le.sessionList)?void 0:e.length)?null==(a=E(le.sessionList).filter((e=>e.chatType===V.SINGLE)))?void 0:a.map((e=>({id:e.receiver,name:e.name,avatar:e.avatar}))):[]})),fe=l((()=>se.value.length?se.value.map((e=>e.id)):[])),he=l((()=>"create"===ae.mode?fe.value.length<3:fe.value.length<1)),be=l({get:()=>de.value.length===ve.value.filter((e=>!e.disabled)).length,set(e){const a=ve.value.filter((e=>!e.disabled));de.value=e?a.map((e=>e.id)):[],e?se.value=z(se.value,a,"id"):D(se.value,(e=>a.map((e=>e.id)).includes(e.id)))}});async function ge(){switch(ae.mode){case"create":await $({creator:le.userInfo.id,memberIdSet:fe.value,name:B(ne.value),orgId:le.orgId});break;case"join":if(await N({groupId:le.currentSessionItem.receiver,operator:le.userInfo.id,memberIdSet:fe.value}),!le.currentSessionItem.defaultName){const e=se.value.map((e=>e.name)).join(",");te({name:`${le.currentSessionItem.name},${e}`})}le.currentGroupUser.push(...ve.value.filter((e=>fe.value.includes(e.id))));break;case"remove":if(await G({dissolution:!1,groupId:le.currentSessionItem.receiver,operator:le.userInfo.id,memberIdSet:fe.value}),!le.currentSessionItem.defaultName){const e=se.value.map((e=>e.name)).join(","),a=new RegExp(e,"g");te({name:le.currentSessionItem.name.replace(a,"")})}D(le.currentGroupUser,(e=>fe.value.includes(e.id)));break;default:ee("comfirm",fe.value)}re.value=!1}function Ie(){var e,a;de.value=null!=(a=null==(e=ve.value.filter((e=>fe.value.includes(e.id))))?void 0:e.map((e=>e.id)))?a:[]}function ke(e,a){if("check"===a.actionType){const e=ve.value.find((e=>e.id===a.value));se.value.push(e)}else D(se.value,(e=>e.id===a.value))}return t((()=>re.value),(e=>{if(!e)return;oe.value="",ne.value="";const a=P(ae.options)&&ae.options.length?ae.options:me.value;ue.value=q(a,"id").map((e=>{var a;return{...e,disabled:null==(a=pe.value)?void 0:a.includes(e.id)}})),ve.value=M(ue.value),P(ae.defaultValue)&&ae.defaultValue.length?(se.value=M(ae.defaultValue),Ie()):(se.value=[],de.value=[])})),(a,l)=>(i(),o(r,null,[s(u(g),{preset:"dialog",title:e.title,"show-icon":!1,"auto-focus":!1,"trap-focus":!1,class:"iho-chat-dialog",show:re.value,"onUpdate:show":l[4]||(l[4]=e=>re.value=e),"negative-text":"取消","positive-text":"确定","display-directive":"show","positive-button-props":{disabled:u(he)},onPositiveClick:ge},{default:n((()=>[d("div",H,["create"===e.mode?(i(),o("div",J,[K,s(u(I),{clearable:"",placeholder:"取个群名称方便后续搜索",value:ne.value,"onUpdate:value":l[0]||(l[0]=e=>ne.value=e),valueModifiers:{trim:!0}},null,8,["value"])])):v("v-if",!0),d("div",O,[d("div",Q,[s(u(I),{placeholder:"搜索",clearable:"",value:oe.value,"onUpdate:value":[l[1]||(l[1]=e=>oe.value=e),u(ce)],valueModifiers:{trim:!0}},{prefix:n((()=>[s(u(k),{component:u(C)},null,8,["component"])])),_:1},8,["value","onUpdate:value"]),d("div",W,[u(ve).length>0?(i(),o(r,{key:0},[s(u(y),{label:"全选",checked:u(be),"onUpdate:checked":l[2]||(l[2]=e=>c(be)?be.value=e:null)},null,8,["checked"]),s(u(w),{ref_key:"listRef",ref:ie,value:de.value,"onUpdate:value":[l[3]||(l[3]=e=>de.value=e),ke]},{default:n((()=>[(i(!0),o(r,null,p(u(ve),(e=>(i(),m(u(y),{key:e.id,value:e.id,disabled:e.disabled},{default:n((()=>[s(u(_),{align:"center","wrap-item":!1},{default:n((()=>[s(u(S),{src:e.avatar,round:"",size:32},null,8,["src"]),d("span",null,f(e.name),1)])),_:2},1024)])),_:2},1032,["value","disabled"])))),128))])),_:1},8,["value"])],64)):(i(),o("div",X,"找不到相关结果"))])]),d("div",Y,[d("span",null,"已选择 "+f(u(fe).length)+" 人",1),d("div",Z,[(i(!0),o(r,null,p(se.value,(e=>(i(),m(u(x),{key:e.id,bordered:!1,closable:e.id!==u(le).userInfo.id,disabled:u(pe).includes(e.id),onClose:()=>{return a=e.id,D(se.value,(e=>e.id===a)),void D(de.value,(e=>e===a));var a}},{avatar:n((()=>[s(u(S),{round:"",src:e.avatar},null,8,["src"])])),default:n((()=>[h(" "+f(e.name),1)])),_:2},1032,["closable","disabled","onClose"])))),128))])])])])])),_:1},8,["title","show","positive-button-props"]),d("span",{class:"btn-wrapper",onClick:l[5]||(l[5]=e=>re.value=!0)},[b(a.$slots,"trigger",{},(()=>[s(u(j),{"show-arrow":!1,placement:"bottom"},{trigger:n((()=>[s(u(U),{color:"#ffffff4D",class:"add-btn"},{icon:n((()=>[s(u(k),{component:u(L),color:"#fff"},null,8,["component"])])),_:1})])),default:n((()=>[h(" "+f(e.title),1)])),_:1})]))])],64))}});export{ee as default};
|
@@ -45,8 +45,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
45
45
|
NImage: any;
|
46
46
|
NInput: any;
|
47
47
|
NIcon: any;
|
48
|
+
NTooltip: any;
|
48
49
|
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<{}>>, {}>;
|
49
|
-
OpenOutline: 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<{}>>, {}>;
|
50
50
|
DownloadOutline: 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<{}>>, {}>;
|
51
51
|
downloadFile: typeof downloadFile;
|
52
52
|
}, unknown, {}, {}, 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
|
1
|
+
import{defineComponent as e,ref as t,computed as o,watch as s,openBlock as a,createBlock as i,unref as n,withCtx as r,withDirectives as l,createElementVNode as c,createVNode as m,createElementBlock as p,Fragment as d,renderList as u,toDisplayString as f,vShow as y,normalizeStyle as h,createCommentVNode as g,createTextVNode as v}from"vue";import{NModal as w,NImageGroup as b,NImage as k,NInput as M,NIcon as T,NTooltip as _}from"naive-ui";import{SearchOutline as I,DownloadOutline as S}from"@vicons/ionicons5";import{searchChatRecordApi as x}from"../api/index.js";import{useTheme as j}from"../../../../shared/hooks/useTheme.js";import{useDebounceFn as A}from"@vueuse/core";import{format as H,isSameWeek as D,isSameMonth as C}from"date-fns";import{last as O}from"lodash-es";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as z}from"../../../../shared/hooks/useScrollLoading.js";import{useState as L}from"../hooks/useState.js";import{getFileSize as U,downloadFile as E}from"../utils/index.js";import"trtc-sdk-v5";const $={class:"label"},F={class:"image-box"},K={class:"file-type"},P={class:"text"},R={class:"name"},B={class:"detail"},G={class:"opt-box"};var N=e({__name:"ChatFile",props:{type:{type:String,default:"image"},visible:{type:Boolean}},setup(e){const N=e,q=j(),{state:J}=L(),Q=t([]),V=t([]),W=t(),X=t(),Y=t(),Z=A(oe,500),ee={page:0,hasMore:!0,lastSendTime:H(new Date,"yyyy-MM-dd HH:mm:ss")};async function te(){var e;try{if(!ee.hasMore)return;ee.page++;const t=await x({orgId:J.orgId,keyword:Y.value,endTime:"",startTime:"",lastSendTime:ee.lastSendTime,memberIdSet:[],page:ee.page,recordType:"image"===N.type?"IMAGE":"FILE",sessionKey:J.currentSessionItem.sessionKey,userId:J.userInfo.id});Array.isArray(t)&&0!==t.length&&Array.isArray(t[0].recordList)||(ee.hasMore=!1,console.log("接口返回不是一个数组,或者没有更多消息了"));let o=t||[];if(Array.isArray(t)&&t.length>0&&(o=t[0].recordList),ee.lastSendTime=null==(e=O(o))?void 0:e.sendTime,"image"===N.type){const e=function(e){const t={};e.forEach((e=>{const o=new Date(e.sendTime);let s=H(o,"yyyy年MM月");D(o,new Date)?s="本周":C(o,new Date)&&(s="本月"),t[s]||(t[s]=[]),t[s].push(e.content.msg)}));return Object.entries(t).map((([e,t])=>({label:e,list:t})))}(o);Q.value=ee.page>1?Q.value.concat(e):e}else{const e=o.map((e=>new Promise((async t=>{const o=await U(e.content.fileUrl);t({...e,size:o})})))),t=await Promise.all(e);V.value=ee.page>1?V.value.concat(t):t}}catch(e){console.log(e)}}function oe(){Object.assign(ee,{page:0,hasMore:!0,lastSendTime:H(new Date,"yyyy-MM-dd HH:mm:ss")}),te()}z(W,(()=>{te()})),z(X,(()=>{te()}));const se=o((()=>"image"===N.type?"聊天图片":"聊天文件"));function ae(e){const{size:t,sendTime:o,senderName:s}=e;return`${t} · ${H(new Date(o),"yyyy/MM/dd HH:mm")} ${s}`}function ie(e){var t;const o=(null==(t=e.content)?void 0:t.msg)||"",s=o.lastIndexOf(".");if(-1!==s){return o.charAt(s+1).toUpperCase()}return"?"}return s((()=>N.visible),(e=>{e?oe():Y.value=""})),(t,o)=>(a(),i(n(w),{preset:"dialog",title:n(se),"show-icon":!1,"auto-focus":!1,class:"iho-chat-dialog"},{default:r((()=>[l(c("div",{class:"iho-chat-dialog__content iho-chat-image-wrapper",ref_key:"imageRef",ref:W},[m(n(b),{"show-toolbar-tooltip":""},{default:r((()=>[(a(!0),p(d,null,u(Q.value,(e=>(a(),p("div",{class:"image-item",key:e.label},[c("span",$,f(e.label),1),c("div",F,[(a(!0),p(d,null,u(e.list,(e=>(a(),i(n(k),{key:e,width:"80",height:"80",src:e},null,8,["src"])))),128))])])))),128))])),_:1})],512),[[y,"image"===e.type]]),l(c("div",{class:"iho-chat-dialog__content iho-chat-file-wrapper",style:h(n(q))},[m(n(M),{clearable:"",placeholder:"搜索文件",value:Y.value,"onUpdate:value":o[0]||(o[0]=e=>Y.value=e),valueModifiers:{trim:!0},onInput:n(Z)},{prefix:r((()=>[m(n(T),{component:n(I)},null,8,["component"])])),_:1},8,["value","onInput"]),c("div",{class:"file-list-box",ref_key:"fileRef",ref:X},[(a(!0),p(d,null,u(V.value,((e,t)=>(a(),p("div",{class:"file-item",key:t},[c("span",K,f(ie(e)),1),c("div",P,[c("span",R,f(e.content.msg),1),c("span",B,f(ae(e)),1)]),c("div",G,[g(' <n-tooltip :show-arrow="false">\n\t\t\t\t\t\t\t<template #trigger>\n\t\t\t\t\t\t\t\t<n-icon :size="16" :component="OpenOutline" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t转发\n\t\t\t\t\t\t</n-tooltip> '),m(n(_),{"show-arrow":!1},{trigger:r((()=>[m(n(T),{size:16,component:n(S),onClick:()=>n(E)(e.content.fileUr,e.content.msg)},null,8,["component","onClick"])])),default:r((()=>[v(" 下载 ")])),_:2},1024)])])))),128))],512)],4),[[y,"image"!==e.type]])])),_:1},8,["title"]))}});export{N as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as
|
1
|
+
import{defineComponent as e,ref as n,computed as t,watch as o,withDirectives as r,openBlock as s,createElementBlock as i,normalizeStyle as a,unref as c,createElementVNode as l,toDisplayString as u,createVNode as f,createCommentVNode as d,withCtx as m,Fragment as p,renderList as g,createBlock as h,createTextVNode as y,mergeProps as w,vShow as v}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,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 A,VideocamOutline as V}from"@vicons/ionicons5";import{xor as K,trim as F,cloneDeep as H}from"lodash-es";import{uuidGenerator as J}from"../../../../shared/utils/index.js";const U={key:0,class:"reference-content-box"},G={class:"reference-content"},N=["innerHTML"],S={class:"tool-box"},X=l("i",{class:"chat--iconfont chat--icon-face"},null,-1),B=l("span",null,"默认表情",-1),$={class:"list-box"},P=["src"],Q=l("i",{class:"chat--iconfont chat--icon-good"},null,-1),W=l("i",{class:"chat--iconfont chat--icon-image"},null,-1),Y=l("i",{class:"chat--iconfont chat--icon-folder"},null,-1),Z={class:"btn-box"},ee=l("span",{class:"tip"},"Enter 发送, Ctrl + Enter 换行",-1);var ne=e({__name:"ChatFooter",setup(e){const ne=n(),{state:te,sendMessage:oe}=b(),{isGroupChat:re}=x(te),se=n(!1),ie=n(""),ae=t((()=>({options:te.currentGroupUser,defaultValue:[te.userInfo]}))),ce=t((()=>!ie.value.replace(/( |\s|<br>)+/g,"")));function le(e,n=[]){const t=J(),o=[],r=n.length>0;te.showVideo||te.showMultipleVideo||(r?(o.push(...K(n,[te.userInfo.id])),Object.assign(te.currentAVMsg,{callMode:"call",checkedIds:o,strRoomId:t,chatMessageType:e}),te.showMultipleVideo=!0):oe({content:{chatMessageType:e,msg:"",avStatus:j.IN_CALL}}))}function ue(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(),pe()))}function fe(){var e;ie.value=(null==(e=ne.value)?void 0:e.innerHTML)||""}async function de(e){const n=new FormData;return n.append("sender",te.userInfo.id),n.append("file",e),await q(n)}async function me(e,n){const{file:t,name:o}=e.file,r=await de(t);if(!r)return console.log("上传失败");ge({chatMessageType:n,msg:n===z.FILE?o:r,url:r})}async function pe(){const{innerHTML:e="",innerText:n="",outerText:t=""}=ne.value||{};if(ce.value)return console.log("请输入内容");let o=z.TEXT,r="";if(e){const t=e.match(/<img[^>]*>/gi),s=(t||[]).length;if(n&&0===s)r=n;else if(n||1!==s){if(o=z.BLEND,r=e,null==t?void 0:t.length)for(let e=0;e<s;e++)if(t[e].includes(`data-type="${z.EMOJI}"`)){const n=t[e].match(/data-msg="(.*?)"/);n&&n.length>1&&(r=r.replace(t[e],`[${n[1]}]`))}else{const n=t[e].match(/src\s*=\s*"([^"]*)"/);if(n&&n.length>1){const e=O(n[1]);if(e){const t=await de(e);r=r.replace(n[1],t||"")}}}}else if(e.includes(z.EMOJI)){o=z.EMOJI;const n=e.match(/data-msg\s*=\s*"([^"]*)"/);n&&(r=n[1])}else{o=z.IMAGE;const n=e.match(/src\s*=\s*"([^"]*)"/);if(n){const e=O(n[1]);if(e){const n=await de(e);n&&(r=n)}}}}else r=F(n);r&&ge({msg:r,chatMessageType:o,origin:"btn"})}async function ge(e){const{chatMessageType:n=z.TEXT,msg:t,url:o,origin:r=""}=e,s={msg:t,chatMessageType:n};n===z.FILE&&(s.fileUrl=o),"btn"===r&&(ne.value.innerHTML="",ie.value=""),te.currentReferenceMsg&&(n===z.TEXT&&(s.referenceContent=H(te.currentReferenceMsg)),te.currentReferenceMsg=null),oe({content:s})}return o((()=>te.currentReferenceMsg),(e=>{var n;e&&(null==(n=ne.value)||n.focus())})),(e,n)=>r((s(),i("section",{class:"chat-footer",style:a({cursor:c(te).id?"default":"not-allowed"})},[c(te).currentReferenceMsg?(s(),i("div",U,[l("div",G,[l("span",null,u(c(te).currentReferenceMsg.senderName)+":",1),l("pre",{innerHTML:c(L)(c(te).currentReferenceMsg.content)},null,8,N)]),f(c(M),{component:c(D),onClick:n[0]||(n[0]=()=>c(te).currentReferenceMsg=null)},null,8,["component"])])):d("v-if",!0),l("div",S,[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(k),{"content-class":"emoji-content",class:"emoji-wrapper",show:se.value,"onUpdate:show":n[1]||(n[1]=e=>se.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:m((()=>[f(c(C),{quaternary:"",size:"tiny"},{icon:m((()=>[X])),_:1})])),default:m((()=>[B,l("div",$,[(s(!0),i(p,null,g(c(R).default,(([e,n])=>(s(),h(c(_),{key:e,"show-arrow":!1},{trigger:m((()=>[f(c(C),{quaternary:"",size:"tiny",onClick:()=>function(e){se.value=!1,ge({chatMessageType:z.EMOJI,msg:e})}(e)},{icon:m((()=>[l("img",{src:n},null,8,P)])),_: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(C),{quaternary:"",size:"tiny",onClick:n[2]||(n[2]=()=>ge({chatMessageType:c(z).EMOJI,msg:0}))},{icon:m((()=>[Q])),_:1})])),default:m((()=>[y(" 点赞 ")])),_:1}),f(c(I),{abstract:"",multiple:"",accept:"image/*",onChange:n[3]||(n[3]=e=>me(e,c(z).IMAGE))},{default:m((()=>[f(c(T),{abstract:""},{default:m((({handleClick:e})=>[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(C),{quaternary:"",size:"tiny",onClick:e},{icon:m((()=>[W])),_:2},1032,["onClick"])])),default:m((()=>[y(" 上传图片 ")])),_:2},1024)])),_:1})])),_:1}),f(c(I),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:n[4]||(n[4]=e=>me(e,c(z).FILE))},{default:m((()=>[f(c(T),{abstract:""},{default:m((({handleClick:e})=>[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(C),{quaternary:"",size:"tiny",onClick:e},{icon:m((()=>[Y])),_:2},1032,["onClick"])])),default:m((()=>[y(" 上传文件 ")])),_:2},1024)])),_:1})])),_:1}),c(re)?(s(),i(p,{key:0},[f(E,w(c(ae),{onComfirm:n[5]||(n[5]=e=>le(c(z).AUDIO,e))}),{trigger:m((()=>[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(C),{quaternary:"",size:"tiny"},{icon:m((()=>[f(c(M),{size:"18",component:c(A)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 语音通话 ")])),_:1})])),_:1},16),f(E,w(c(ae),{onComfirm:n[6]||(n[6]=e=>le(c(z).VIDEO,e))}),{trigger:m((()=>[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(C),{quaternary:"",size:"tiny"},{icon:m((()=>[f(c(M),{size:"20",component:c(V)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 视频会议 ")])),_:1})])),_:1},16)],64)):(s(),i(p,{key:1},[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(C),{quaternary:"",size:"tiny",onClick:n[7]||(n[7]=()=>le(c(z).AUDIO))},{icon:m((()=>[f(c(M),{size:"18",component:c(A)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 语音通话 ")])),_:1}),f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(C),{quaternary:"",size:"tiny",onClick:n[8]||(n[8]=()=>le(c(z).VIDEO))},{icon:m((()=>[f(c(M),{size:"20",component:c(V)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 视频通话 ")])),_:1})],64))]),r(l("div",{ref_key:"inputRef",ref:ne,class:"input-box",contenteditable:"",onKeydown:ue,onInput:fe},null,544),[[v,c(te).id]]),l("div",Z,[ee,f(c(C),{type:"primary",round:"",disabled:c(ce),onClick:pe},{default:m((()=>[y("发送")])),_:1},8,["disabled"])])],4)),[[v,c(te).id]])}});export{ne as default};
|