cnhis-design-vue 3.2.5-beta.0 → 3.2.5-beta.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,watch as n,withDirectives as s,openBlock as i,createElementBlock as o,normalizeStyle as r,unref as a,createElementVNode as c,toDisplayString as l,createVNode as u,createCommentVNode as d,withCtx as f,Fragment as p,renderList as m,createBlock as g,createTextVNode as v,vShow as h}from"vue";import{NIcon as y,NPopover as M,NTooltip as k,NUpload as x,NUploadTrigger as C,NButton as T}from"naive-ui";import{format as b}from"date-fns";import{useState as w}from"../hooks/useState.js";import{useSession as E}from"../hooks/useSession.js";import{images as I,alt as _}from"../utils/emoji.js";import{MESSAGE_TYPE as R}from"../constants/index.js";import{uploadFileApi as j}from"../api/index.js";import{CloseCircleOutline as L}from"@vicons/ionicons5";import{cloneDeep as S}from"lodash-es";import{simplifyMessage as F}from"../utils/index.js";const H={key:0,class:"reference-content-box"},K={class:"reference-content"},D=["innerHTML"],N={class:"tool-box"},J=c("span",null,[c("i",{class:"chat--iconfont chat--icon-face"})],-1),O={class:"emoji-box"},A=c("span",null,"默认表情",-1),G={class:"list-box"},U=["onClick"],X=["src"],z=[c("i",{class:"chat--iconfont chat--icon-good"},null,-1)],B=["onClick"],q=[c("i",{class:"chat--iconfont chat--icon-image"},null,-1)],P=["onClick"],Q=[c("i",{class:"chat--iconfont chat--icon-folder"},null,-1)],V={class:"btn-box"},W=c("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var Y=e({__name:"ChatFooter",setup(e){const Y=t(),Z=t(""),{state:$,stompClient:ee}=w(),{setCurrentSessionItem:te}=E($),ne=t(!1);function se(e){["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),re()))}function ie(){var e,t;Z.value=(null==(t=null==(e=Y.value)?void 0:e.innerText)?void 0:t.trim())||""}async function oe(e,t){const{file:n,name:s}=e.file,i=new FormData;i.append("sender",$.userInfo.id),i.append("file",n);const o=await j(i);if(!o)return console.log("上传失败");ae({chatMessageType:t,msg:t===R.FILE?s:o,url:o})}function re(){if(!(Z.value.length>2e3))return Z.value?void ae({msg:Z.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function ae(e){const{chatMessageType:t=R.TEXT,msg:n,url:s}=e,i={msg:n,chatMessageType:t};t===R.FILE&&(i.fileUrl=s),[R.TEXT,R.BLEND].includes(t)&&(Y.value.innerHTML="",Z.value=""),$.currentReferenceMsg.id&&(i.referenceContent=S($.currentReferenceMsg),$.currentReferenceMsg.id="");const o=b(new Date,"yyyy-MM-dd HH:mm:ss");$.currentMsg={content:i,sender:$.userInfo.id,id:"",sendTime:o,sending:!0,fail:!1},$.isAppendMsg=!0,te({lastMessageSendTime:o,lastMessage:i,sortTime:o});try{ee.value.send("/app/chat/send",{},JSON.stringify({chatType:"SINGLE",content:i,receiver:$.currentSessionItem.receiver})),$.currentMsg={...$.currentMsg,fail:!1}}catch(e){$.currentMsg={...$.currentMsg,fail:!0}}finally{$.currentMsg={...$.currentMsg,sending:!1}}}return n((()=>$.currentReferenceMsg.id),(e=>{var t;e&&(null==(t=Y.value)||t.focus())})),(e,t)=>s((i(),o("section",{class:"chat-footer",style:r({cursor:a($).id?"default":"not-allowed"})},[a($).currentReferenceMsg.id?(i(),o("div",H,[c("div",K,[c("span",null,l(a($).currentReferenceMsg.senderName)+":",1),c("pre",{innerHTML:a(F)(a($).currentReferenceMsg.content)},null,8,D)]),u(a(y),{component:a(L),onClick:t[0]||(t[0]=()=>a($).currentReferenceMsg.id="")},null,8,["component"])])):d("v-if",!0),c("div",N,[u(a(M),{show:ne.value,"onUpdate:show":t[1]||(t[1]=e=>ne.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:f((()=>[J])),default:f((()=>[c("div",O,[d(' <span>最近使用</span>\n\t\t\t\t\t<div class="list-box">\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\n\t\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\t\t<img :src="img" />\n\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</div> '),A,c("div",G,[(i(!0),o(p,null,m(a(I),((e,t)=>(i(),o(p,{key:t},[t>0?(i(),g(a(k),{key:0,"show-arrow":!1,trigger:"hover"},{trigger:f((()=>[c("i",{onClick:()=>function(e){ne.value=!1,ae({chatMessageType:R.EMOJI,msg:e})}(t)},[c("img",{src:e},null,8,X)],8,U)])),default:f((()=>[v(" "+l(a(_)[t-1]||"微笑"),1)])),_:2},1024)):d("v-if",!0)],64)))),128))])])])),_:1},8,["show"]),c("span",{onClick:t[2]||(t[2]=()=>ae({chatMessageType:a(R).EMOJI,msg:0}))},z),u(a(x),{abstract:"",multiple:"",accept:"image/*",onChange:t[3]||(t[3]=e=>oe(e,a(R).IMAGE))},{default:f((()=>[u(a(C),{abstract:""},{default:f((({handleClick:e})=>[c("span",{onClick:e},q,8,B)])),_:1})])),_:1}),u(a(x),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:t[4]||(t[4]=e=>oe(e,a(R).FILE))},{default:f((()=>[u(a(C),{abstract:""},{default:f((({handleClick:e})=>[c("span",{onClick:e},Q,8,P)])),_:1})])),_:1})]),s(c("div",{ref_key:"inputRef",ref:Y,class:"input-box",contenteditable:"",onKeydown:se,onInput:ie},null,544),[[h,a($).id]]),c("div",V,[W,u(a(T),{type:"primary",round:"",disabled:!Z.value,onClick:re},{default:f((()=>[v("发送")])),_:1},8,["disabled"])])],4)),[[h,a($).id]])}});export{Y as default};
1
+ import{defineComponent as e,ref as t,watch as n,withDirectives as s,openBlock as i,createElementBlock as r,normalizeStyle as o,unref as a,createElementVNode as c,toDisplayString as l,createVNode as u,createCommentVNode as d,withCtx as f,Fragment as p,renderList as m,createBlock as g,createTextVNode as v,vShow as h}from"vue";import{NIcon as y,NPopover as M,NTooltip as k,NUpload as x,NUploadTrigger as C,NButton as T}from"naive-ui";import{format as b}from"date-fns";import{useState as w}from"../hooks/useState.js";import{useSession as E}from"../hooks/useSession.js";import{images as I,alt as _}from"../utils/emoji.js";import{MESSAGE_TYPE as R}from"../constants/index.js";import{uploadFileApi as j}from"../api/index.js";import{CloseCircleOutline as L}from"@vicons/ionicons5";import{cloneDeep as S}from"lodash-es";import{simplifyMessage as F}from"../utils/index.js";const H={key:0,class:"reference-content-box"},K={class:"reference-content"},D=["innerHTML"],N={class:"tool-box"},J=c("span",null,[c("i",{class:"chat--iconfont chat--icon-face"})],-1),O={class:"emoji-box"},A=c("span",null,"默认表情",-1),G={class:"list-box"},U=["onClick"],X=["src"],z=[c("i",{class:"chat--iconfont chat--icon-good"},null,-1)],B=["onClick"],q=[c("i",{class:"chat--iconfont chat--icon-image"},null,-1)],P=["onClick"],Q=[c("i",{class:"chat--iconfont chat--icon-folder"},null,-1)],V={class:"btn-box"},W=c("span",{class:"tip"},"Enter 发送, Shift + Enter 换行",-1);var Y=e({__name:"ChatFooter",setup(e){const Y=t(),Z=t(""),{state:$,stompClient:ee}=w(),{setCurrentSessionItem:te}=E($),ne=t(!1);function se(e){["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),oe()))}function ie(){var e,t;Z.value=(null==(t=null==(e=Y.value)?void 0:e.innerText)?void 0:t.trim())||""}async function re(e,t){const{file:n,name:s}=e.file,i=new FormData;i.append("sender",$.userInfo.id),i.append("file",n);const r=await j(i);if(!r)return console.log("上传失败");ae({chatMessageType:t,msg:t===R.FILE?s:r,url:r})}function oe(){if(!(Z.value.length>2e3))return Z.value?void ae({msg:Z.value}):console.log("请输入内容");console.log("请控制在2000字以内")}async function ae(e){const{chatMessageType:t=R.TEXT,msg:n,url:s}=e,i={msg:n,chatMessageType:t};t===R.FILE&&(i.fileUrl=s),[R.TEXT,R.BLEND].includes(t)&&(Y.value.innerHTML="",Z.value=""),$.currentReferenceMsg.id&&(i.referenceContent=S($.currentReferenceMsg),$.currentReferenceMsg.id="");const r=b(new Date,"yyyy-MM-dd HH:mm:ss");$.currentMsg={content:i,sender:$.userInfo.id,id:"",sendTime:r,sending:!0,fail:!1},$.isAppendMsg=!0,te({lastMessageSendTime:r,lastMessage:i,sortTime:r});try{ee.value.send("/app/chat/send",{},JSON.stringify({chatType:"SINGLE",content:i,receiver:$.currentSessionItem.receiver})),$.currentMsg={...$.currentMsg,fail:!1}}catch(e){$.currentMsg={...$.currentMsg,fail:!0}}finally{$.currentMsg={...$.currentMsg,sending:!1}}}return n((()=>$.currentReferenceMsg.id),(e=>{var t;e&&(null==(t=Y.value)||t.focus())})),(e,t)=>s((i(),r("section",{class:"chat-footer",style:o({cursor:a($).id?"default":"not-allowed"})},[a($).currentReferenceMsg.id?(i(),r("div",H,[c("div",K,[c("span",null,l(a($).currentReferenceMsg.senderName)+":",1),c("pre",{innerHTML:a(F)(a($).currentReferenceMsg.content)},null,8,D)]),u(a(y),{component:a(L),onClick:t[0]||(t[0]=()=>a($).currentReferenceMsg.id="")},null,8,["component"])])):d("v-if",!0),c("div",N,[u(a(M),{show:ne.value,"onUpdate:show":t[1]||(t[1]=e=>ne.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:f((()=>[J])),default:f((()=>[c("div",O,[d(' <span>最近使用</span>\r\n\t\t\t\t\t<div class="list-box">\r\n\t\t\t\t\t\t<template v-for="(img, index) in images" :key="index">\r\n\t\t\t\t\t\t\t<i>\r\n\t\t\t\t\t\t\t\t<img :src="img" />\r\n\t\t\t\t\t\t\t</i>\r\n\t\t\t\t\t\t</template>\r\n\t\t\t\t\t</div> '),A,c("div",G,[(i(!0),r(p,null,m(a(I),((e,t)=>(i(),r(p,{key:t},[t>0?(i(),g(a(k),{key:0,"show-arrow":!1,trigger:"hover"},{trigger:f((()=>[c("i",{onClick:()=>function(e){ne.value=!1,ae({chatMessageType:R.EMOJI,msg:e})}(t)},[c("img",{src:e},null,8,X)],8,U)])),default:f((()=>[v(" "+l(a(_)[t-1]||"微笑"),1)])),_:2},1024)):d("v-if",!0)],64)))),128))])])])),_:1},8,["show"]),c("span",{onClick:t[2]||(t[2]=()=>ae({chatMessageType:a(R).EMOJI,msg:0}))},z),u(a(x),{abstract:"",multiple:"",accept:"image/*",onChange:t[3]||(t[3]=e=>re(e,a(R).IMAGE))},{default:f((()=>[u(a(C),{abstract:""},{default:f((({handleClick:e})=>[c("span",{onClick:e},q,8,B)])),_:1})])),_:1}),u(a(x),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:t[4]||(t[4]=e=>re(e,a(R).FILE))},{default:f((()=>[u(a(C),{abstract:""},{default:f((({handleClick:e})=>[c("span",{onClick:e},Q,8,P)])),_:1})])),_:1})]),s(c("div",{ref_key:"inputRef",ref:Y,class:"input-box",contenteditable:"",onKeydown:se,onInput:ie},null,544),[[h,a($).id]]),c("div",V,[W,u(a(T),{type:"primary",round:"",disabled:!Z.value,onClick:oe},{default:f((()=>[v("发送")])),_:1},8,["disabled"])])],4)),[[h,a($).id]])}});export{Y as default};
@@ -175,6 +175,9 @@ declare const _default: import("vue").DefineComponent<{
175
175
  modelValue: unknown[];
176
176
  componentData: Record<string, any>;
177
177
  } & {
178
+ /**
179
+ * 改变弹窗大小
180
+ */
178
181
  itemKey?: string | Function | undefined;
179
182
  }>, {
180
183
  move: Function;
@@ -699,6 +699,9 @@ declare const _default: import("vue").DefineComponent<{
699
699
  handleInitConditions: () => Promise<void>;
700
700
  validate: () => Promise<unknown>;
701
701
  saveAdd: () => void;
702
+ /**
703
+ * 改变展示方式
704
+ */
702
705
  cancelSaveAdd: () => void;
703
706
  checkActionList: () => boolean;
704
707
  NSpin: any;
@@ -16,7 +16,7 @@ export declare const SWITCH: import("vue").DefineComponent<{
16
16
  default: string;
17
17
  };
18
18
  onChange: {};
19
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
19
+ }, () => JSX.Element | JSX.Element[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
20
20
  value: {};
21
21
  openDescription: {
22
22
  type: PropType<Description>;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as o,createVNode as r,createTextVNode as t}from"vue";import{NSwitch as i,NCheckbox as l}from"naive-ui";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"date-fns";import{assignUpdateValue as u,assignValueBindKey as n}from"../../utils/schema.js";import{connect as a,mapProps as p}from"@formily/vue";const s=a(e({name:"FormSwitch",props:{value:{},openDescription:{type:Object},closeDescription:{type:Object},showMode:{type:String,default:"SWITCH"},onChange:{}},emits:["update:value"],setup(e,{emit:u}){const n=o((()=>{var o,r;return null==(r=null==(o=e.openDescription)?void 0:o.value)||r})),a=o((()=>{var o,r;return null!=(r=null==(o=e.closeDescription)?void 0:o.value)&&r})),p=()=>{var o,r;return t(null!=(r=null==(o=e.openDescription)?void 0:o.describe)?r:"")},s=()=>{var o,r;return t(null!=(r=null==(o=e.closeDescription)?void 0:o.describe)?r:"")},c=o({get:()=>e.value===n.value,set:e=>u("update:value",e?n.value:a.value)});return()=>"SWITCH"===e.showMode?r(i,{value:c.value,"onUpdate:value":e=>c.value=e},{checked:p,unchecked:s}):r(l,{checked:c.value,"onUpdate:checked":e=>c.value=e},{default:p})}}),p(u,n));export{s as SWITCH};
1
+ import{defineComponent as e,useAttrs as o,ref as t,computed as i,createVNode as r,mergeProps as l,createTextVNode as u}from"vue";import{NSwitch as n,NModal as a,NCheckbox as s}from"naive-ui";import"../../../../../shared/utils/index.js";import"@formily/core";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"lodash-es";import"date-fns";import{assignUpdateValue as p,assignValueBindKey as v}from"../../utils/schema.js";import{connect as c,mapProps as d}from"@formily/vue";import"../../../index.js";import{useFormField as m}from"../../hooks/useFormField.js";const h=c(e({name:"FormSwitch",props:{value:{},openDescription:{type:Object},closeDescription:{type:Object},showMode:{type:String,default:"SWITCH"},onChange:{}},emits:["update:value"],setup(e,{emit:p}){const v=o(),c=t(!1),{fieldKey:d}=m(),h=i((()=>{var o,t;return null==(t=null==(o=e.openDescription)?void 0:o.value)||t})),f=i((()=>{var o,t;return null!=(t=null==(o=e.closeDescription)?void 0:o.value)&&t})),y=()=>{var o,t;return u(null!=(t=null==(o=e.openDescription)?void 0:o.describe)?t:"")},w=()=>{var o,t;return u(null!=(t=null==(o=e.closeDescription)?void 0:o.describe)?t:"")},j=i({get:()=>e.value===h.value,set(o){if("SWITCH"!==e.showMode||"required"!==d.value||o)return p("update:value",o?h.value:f.value);c.value=!0}});function k(){p("update:value",f.value)}return()=>"SWITCH"===e.showMode?[r(n,l({value:j.value,"onUpdate:value":e=>j.value=e},v),{checked:y,unchecked:w}),r(a,{show:c.value,"onUpdate:show":e=>c.value=e,"display-directive":"show",preset:"dialog",title:"确认",content:"是否确认由必填改为非必填?","positive-text":"确认","negative-text":"取消",onPositiveClick:k},null)]:r(s,{checked:j.value,"onUpdate:checked":e=>j.value=e},{default:y})}}),d(p,v));export{h as SWITCH};
package/es/env.d.ts CHANGED
@@ -1,25 +1,25 @@
1
- /// <reference types="vite/client" />
2
-
3
- interface ImportMetaEnv {
4
- readonly VITE_APP_TYPE: string;
5
- // 更多环境变量...
6
- }
7
-
8
- interface ImportMeta {
9
- readonly env: ImportMetaEnv;
10
- }
11
-
12
- declare module '*.vue' {
13
- // @ts-ignore
14
- import type { App, defineComponent } from 'vue';
15
- // // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
16
- // // const component: DefineComponent<{}, {}, any>
17
- const component: ReturnType<typeof defineComponent> & {
18
- install(app: App): void;
19
- };
20
- // @ts-ignore
21
- export default component;
22
- }
23
-
24
- declare module '*.js';
25
-
1
+ /// <reference types="vite/client" />
2
+
3
+ interface ImportMetaEnv {
4
+ readonly VITE_APP_TYPE: string;
5
+ // 更多环境变量...
6
+ }
7
+
8
+ interface ImportMeta {
9
+ readonly env: ImportMetaEnv;
10
+ }
11
+
12
+ declare module '*.vue' {
13
+ // @ts-ignore
14
+ import type { App, defineComponent } from 'vue';
15
+ // // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
16
+ // // const component: DefineComponent<{}, {}, any>
17
+ const component: ReturnType<typeof defineComponent> & {
18
+ install(app: App): void;
19
+ };
20
+ // @ts-ignore
21
+ export default component;
22
+ }
23
+
24
+ declare module '*.js';
25
+
@@ -1 +1 @@
1
- var e="@cnhis-design-vue/shared",i="3.2.5-beta.0",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.2.5-beta.0",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
1
+ var e="@cnhis-design-vue/shared",i="3.2.5-beta.1",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.2.5-beta.1",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.2.5-beta.0",
3
+ "version": "3.2.5-beta.1",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -71,5 +71,5 @@
71
71
  "iOS 7",
72
72
  "last 3 iOS versions"
73
73
  ],
74
- "gitHead": "97026489a7a23909d42b931926029cfd7f9d6ded"
74
+ "gitHead": "38580b2b76350b0e71b1cc54767248782740f19a"
75
75
  }