cnhis-design-vue 3.1.54-beta.21 → 3.1.54-beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/button-print/src/ButtonPrint.vue.d.ts +1 -3
- package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
- package/es/components/chat-sdk/src/chatSDK.d.ts +12 -0
- package/es/components/chat-sdk/src/chatSDK.js +1 -1
- package/es/components/classification/src/index.vue.d.ts +1 -3
- package/es/shared/package.json.js +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as t,reactive as e,computed as n,onMounted as i,watch as r,openBlock as a,createElementBlock as s,Fragment as o,createVNode as l,unref as p,withCtx as d,renderSlot as m,withModifiers as u,createTextVNode as c,toDisplayString as f,mergeProps as g}from"vue";import{isObject as v}from"@vue/shared";import{useMessage as y,NDropdown as b,NButton as I,NIcon as
|
|
1
|
+
import{defineComponent as t,reactive as e,computed as n,onMounted as i,watch as r,openBlock as a,createElementBlock as s,Fragment as o,createVNode as l,unref as p,withCtx as d,renderSlot as m,withModifiers as u,createTextVNode as c,toDisplayString as f,mergeProps as g}from"vue";import{isObject as v}from"@vue/shared";import{useMessage as y,NDropdown as b,NButton as I,NIcon as P}from"naive-ui";import{ChevronDown as h}from"@vicons/ionicons5";import{Print as w}from"./utils/print.js";import{isIReport as F}from"./utils/browserPrint.js";import k from"./components/IdentityVerification.vue.js";import{format as T}from"date-fns";import{savePrivateFormatApi as x,getPrivateFormatApi as S}from"./api.js";var L=t({__name:"ButtonPrint",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:"打印",type:String},printText:{default:"直接打印",type:String},previewText:{default:"打印预览",type:String},pdfLoadText:{default:"下载pdf",type:String},formatEditText:{default:"格式编辑",type:String},prevFn:{default:()=>Promise.resolve(),type:Function},queryPrintFormatByNumber:{default:()=>Promise.resolve({}),type:Function},queryTemplateParams:{default:()=>Promise.resolve({}),type:Function},strategy:{default:"MULTI",type:String},clickPrevFn:{default:()=>Promise.resolve(!0),type:Function},noDataMsg:{default:"请选中需要打印的数据",type:String},token:{type:String},printdlgshow:{default:"0",type:String},btnprint:{type:String,default:"1"},directPrint:{type:Boolean,default:!1},externalOptionConfig:{type:Object,default:()=>({})},signature:{type:String},showLoading:{type:Boolean,default:!0}},emits:["success","error","clickoutside"],setup(t,{expose:L,emit:D}){var O;const j=t,E=y();let M;const N={},V=e({spinning:!1,visible:!1,formatList:[],templateParams:{},printParams:[],currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null}),C=e([{label:j.printText,key:"printText"},{label:j.previewText,key:"previewText"},{label:j.pdfLoadText,key:"downloadPdf"},{label:j.formatEditText,key:"formatEditText"},...(null==(O=j.externalOptionConfig)?void 0:O.options)||[]]),Y=n((()=>{if(!V.currentFormatId)return{};let t=V.currentFormatId;return V.formatList.find((e=>e.id===t))})),B=n((()=>{var t;return(null==(t=Y.value)?void 0:t.name)||"格式选择"})),J=n((()=>{let t=V.formatList.find((t=>t.id===V.currentFormatId));return null==t?void 0:t.templateId})),U=async t=>{if(j.directPrint){if(V.spinning)return;return"button"===t?void await rt():et()}return et()},A=t=>l("span",{class:{active:t.key===V.currentFormatId}},[t.label]),q=(t,e)=>{V.spinning=!1;let n={type:e,formatId:V.currentFormatId,templateId:J.value};D("success",t,n)},R=t=>{V.spinning=!1,D("error",t),v(t)&&"notInstalledApp"===t.type&&E.error(t.message)},_=t=>{D("error",{message:"前置条件执行错误",type:t,preExecution:!0})},z=(t=0)=>{var e;const n=(null==(e=j.printParams)?void 0:e.length)?j.printParams[t]:V.printParams[t];return JSON.stringify({...n||{},...j.token?{token:j.token}:{}})},H=()=>{var t,e;let n={},i={};if(null==(t=V.templateParams.customizeDataset)?void 0:t.length){const t=(null==(e=Object.keys(V.printParams[0].datasetData||{}))?void 0:e[0])||"",n=JSON.stringify(V.printParams.map((e=>JSON.parse(e.datasetData[t]))));i={datasetData:{}},i.datasetData[t]=n}else Object.keys(V.printParams[0]).forEach((t=>{i[t]=[],V.printParams.forEach((e=>{i[t].push(e[t])})),i[t]=i[t].join(",")}));return n=Object.assign({},JSON.parse(z(0)),i),JSON.stringify(n)},$=()=>{let t=V.printParams.length;const e=async e=>{try{--t<=0&&q(e,"print")}catch(t){console.log("error",t)}};j.showLoading&&V.spinning||(V.spinning=!0,j.prevFn("print").then((()=>{const t={formatId:V.currentFormatId,templateId:J.value,printdlgshow:j.printdlgshow,signature:j.signature};if("MULTI"===j.strategy)for(let n=0;n<V.printParams.length;n++)n>0&&(t.printdlgshow="0"),M.printDirect({...t,params:z(n)},e,R);else M.printDirect({...t,params:H()},(t=>{q(t,"print")}),R)})).catch((()=>{_("print"),V.spinning=!1})).finally((()=>{V.visible=!1})))},G=async(t,e)=>{var n,i;switch(t){case"printText":$();break;case"previewText":(async()=>{j.showLoading&&V.spinning||(V.spinning=!0,j.prevFn("preview").then((()=>{const t="MULTI"===j.strategy?z():H(),e={formatId:V.currentFormatId,templateId:J.value,params:t,btnprint:j.btnprint,signature:j.signature};M.preview(e,(t=>{q(t,"preview")}),R)})).catch((()=>{_("preview"),V.spinning=!1})).finally((()=>{V.visible=!1})))})();break;case"formatEditText":j.showLoading&&V.spinning||(V.spinning=!0,j.prevFn("edit").then((()=>{V.identityVerification.visible=!0})).catch((()=>{_("edit")})).finally((()=>{V.visible=!1,V.spinning=!1})));break;case"downloadPdf":(async()=>{j.showLoading&&V.spinning||(V.spinning=!0,j.prevFn("download").then((()=>{const t="MULTI"===j.strategy?z():H(),e={formatId:V.currentFormatId,templateId:J.value,print:{print:"1",type:"1"},params:t,signature:j.signature};M.downloadPDF(e,(t=>q(t,"preview")),R)})).catch((()=>{_("download"),V.spinning=!1})).finally((()=>{V.visible=!1})))})();break;default:{V.visible=!1;const r=V.formatList.find((e=>e.id===t))||{};if(Object.keys(r).length>0){V.currentFormatId=t;const[e]=C;e.label=(null==r?void 0:r.name)||e.label,await x({formatForms:[{...r}],name:N.name||r.templateName,number:N.number||r.number,templateId:N.templateId||r.templateId,...N.id?{id:N.id}:{}},{token:j.token})}else null==(i=null==(n=j.externalOptionConfig)?void 0:n.onSelect)||i.call(n,t,e);break}}},K=()=>{V.visible=!1,D("clickoutside")},Q=()=>(V.isInited=!1,V.spinning=!1,setTimeout((()=>{V.visible=!1}),0),!1),W=(t,e,n)=>{const i={};return e.forEach((e=>{let r=((t,e)=>{const n={DATE:"YYYY-MM-DD",DATETIME:"YYYY-MM-DD HH:mm:ss"};let i=e;return Object.keys(n).includes(t.type)&&e&&(i=T(e,n[t.type])),(null==t?void 0:t.defaultValue)||i})(e,t[e[n]]);t[e[n]]&&r&&(i[e[n]]=r)})),i},X=({customizeDataset:t=[],param:e=[]},n=[])=>n.map((n=>{let i={};return t.forEach((t=>{const e=t.dataSetting[0].selectFieldList;i.datasetData={[t.name]:JSON.stringify(W(n,e,"fieldName"))}})),i=Object.assign({},i,W(n,e,"key")),i})),Z=async t=>{var e;if(V.formatList=t?(t=>{let e=[];return t&&t.forEach((t=>{if(!t.format)return!1;e.push(...t.format.map((e=>Object.assign({},e,{templateName:t.name}))))})),e})(t.obj):[],V.currentFormatId=await(async(t,e)=>{var n;if(!(null==t?void 0:t.length))return"";const{data:i}=await S({templateId:t[0].templateId},{token:j.token});if("SUCCESS"===i.result){const{formatForms:e=[]}=i.map||{};Object.assign(N,i.map||{});const r=null==(n=null==e?void 0:e[0])?void 0:n.id;if(r&&t.map((t=>t.id)).includes(r))return r}const r=t.find((t=>1==t[e]));return(null==r?void 0:r.id)||t[0].id})(V.formatList,"defaultFlag"),!V.currentFormatId)return E.error("获取打印格式失败,请联系管理员!"),Q();(()=>{const t=V.formatList.map((t=>({label:t.name,key:t.id})));C.unshift({label:B.value,key:"format",children:t})})();let n=null==(e=await j.queryTemplateParams())?void 0:e.obj;if(!n||!J.value)return E.error("获取打印模板失败,请联系管理员!"),Q();V.templateParams=n,V.printParams=X(V.templateParams,j.params)},tt=async()=>{if(V.isInited)return!0;V.isInited=!0,V.spinning=!0,(()=>{if(M)return!1;M=new w})();const t=await j.queryPrintFormatByNumber();return await Z(t),V.spinning=!1,!0},et=async(t=!0)=>{var e,n;if(await j.clickPrevFn())if((null==(e=j.params)?void 0:e.length)&&(null==(n=j.printParams)?void 0:n.length)){if(!V.visible){if(!await tt())return!1}t&&(V.visible=!V.visible)}else E.warning(j.noDataMsg)},nt=()=>{V.watchPrintParamsReformatFn&&V.watchPrintParamsReformatFn(),V.isInited?V.printParams=X(V.templateParams,j.params):V.watchPrintParamsReformatFn=()=>r((()=>V.isInited),(t=>{if(!t)return!1;nt()}))},it=t=>{if(V.identityVerification.visible=!1,F(V.currentFormatId))return q(null,"edit");const e={formatId:V.currentFormatId,templateId:J.value,params:z(),token:t};M.editPrintFormat(e,(t=>{q(t,"edit")}),R)};async function rt(){await et(!1),$()}return i((()=>{V.isInited=!1})),r((()=>j.params),(t=>{if(!(null==t?void 0:t.length))return!1;nt()}),{deep:!0}),L({directPrint:rt}),(e,n)=>(a(),s(o,null,[l(p(b),{class:"c-dropdown",placement:"bottom-start",trigger:"click",show:V.visible,onClickoutside:K,options:C,onSelect:G,"render-label":A},{default:d((()=>[m(e.$slots,"button",{handleClickPrintBtn:et,printSpinning:V.spinning,printbtnText:t.btnText,printVisible:V.visible},(()=>[l(p(I),{class:"dropdown-button",loading:t.showLoading&&V.spinning,onClick:n[1]||(n[1]=u((()=>U("button")),["stop"]))},{default:d((()=>[c(f(t.btnText)+" ",1),l(p(P),{component:p(h),style:{"margin-left":"5px"},onClick:n[0]||(n[0]=u((()=>U("icon")),["stop"]))},null,8,["component"])])),_:1},8,["loading"])]))])),_:3},8,["show","options"]),l(k,g(e.$attrs,{modelValue:V.identityVerification.visible,"onUpdate:modelValue":n[2]||(n[2]=t=>V.identityVerification.visible=t),formatId:V.currentFormatId,templateId:p(J),onSuccess:it}),null,16,["modelValue","formatId","templateId"])],64))}});export{L as default};
|
|
@@ -1,4 +1,16 @@
|
|
|
1
|
+
import 'recorder-core/src/engine/mp3';
|
|
2
|
+
import 'recorder-core/src/engine/mp3-engine';
|
|
3
|
+
import { AnyObject } from '../../../../es/shared/types';
|
|
1
4
|
export default class ChatSDK {
|
|
5
|
+
private recorder;
|
|
6
|
+
private recorderStatus;
|
|
7
|
+
constructor(option?: AnyObject);
|
|
8
|
+
recorderOpen(): Promise<unknown>;
|
|
9
|
+
recorderStart(): Promise<{
|
|
10
|
+
result: string;
|
|
11
|
+
}>;
|
|
12
|
+
recorderStop(isRecognition?: boolean): Promise<AnyObject>;
|
|
13
|
+
destroy(): void;
|
|
2
14
|
static audioRecognition(params: FormData): Promise<import("axios").AxiosResponse<any, any>>;
|
|
3
15
|
static audioRevise(params: {
|
|
4
16
|
file_id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from"axios";import e from"recorder-core";import"recorder-core/src/engine/mp3";import"recorder-core/src/engine/mp3-engine";import{uuidGenerator as t}from"../../../shared/utils/index.js";class s{constructor(r){this.recorder=null,this.recorderStatus=!1,this.recorder=e({type:"mp3",sampleRate:16e3,bitRate:16,...r})}async recorderOpen(){const r={};return new Promise(((e,t)=>{this.recorder.open((()=>{this.recorderStatus=!0,r.result="success",e(r)}),((e,s)=>{this.recorderStatus=!1,Object.assign(r,{result:"fail",msg:e,isUserNotAllow:s}),t(r)}))}))}async recorderStart(){return this.recorderStatus?(this.recorder.start(),Promise.resolve({result:"success"})):Promise.reject({result:"fail",msg:"请先打开麦克风"})}async recorderStop(r=!0){return new Promise(((e,o)=>{this.recorder.stop((async(i,a)=>{const c=new File([i],`${t()}.mp3`,{type:i.type});try{let t;if(r){const r=new FormData;r.append("audio",c);const{data:e}=await s.audioRecognition(r);t=e}e({result:"success",file:c,duration:a,...t?{data:t}:{}})}catch(r){o({result:"fail",msg:r})}}),(r=>{o({result:"fail",msg:r})}))}))}destroy(){var r;null==(r=this.recorder)||r.close(),this.recorder=null}static async audioRecognition(e){return await r.post("/audio/recognition",e,{headers:{"Content-Type":"multipart/form-data"}})}static async audioRevise(e){return await r.post("/audio/revise",e)}}export{s as default};
|
|
@@ -1783,9 +1783,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1783
1783
|
handleDisplayCategoryRemove: (index: number, item: import("../../../../es/components/table-filter/src/types").ICategoryItemType) => void;
|
|
1784
1784
|
handleDisplayCategoryAdd: (cb?: any) => void;
|
|
1785
1785
|
handlerBlur: () => void;
|
|
1786
|
-
initDisplayCategories: (rawDataDisplayCategories: any, displayCategory: any) => void;
|
|
1787
|
-
* 改变展示方式
|
|
1788
|
-
*/
|
|
1786
|
+
initDisplayCategories: (rawDataDisplayCategories: any, displayCategory: any) => void;
|
|
1789
1787
|
FilterConditionsState: any;
|
|
1790
1788
|
paramOptions: import("vue").ComputedRef<any>;
|
|
1791
1789
|
addFilterCondition: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.1.54-beta.
|
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.1.54-beta.23",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.1.54-beta.23",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.1.54-beta.
|
|
3
|
+
"version": "3.1.54-beta.23",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"min-dom": "^3.2.1",
|
|
43
43
|
"moment": "^2.29.1",
|
|
44
44
|
"naive-ui": "^2.30.0",
|
|
45
|
+
"recorder-core": "^1.2.23070100",
|
|
45
46
|
"sockjs-client": "^1.6.1",
|
|
46
47
|
"sortablejs": "^1.15.0",
|
|
47
48
|
"spark-md5": "^3.0.2",
|
|
@@ -63,5 +64,5 @@
|
|
|
63
64
|
"iOS 7",
|
|
64
65
|
"last 3 iOS versions"
|
|
65
66
|
],
|
|
66
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "617cc5093668565ad65edcab2834639d0f32d711"
|
|
67
68
|
}
|