cnhis-design-vue 3.1.52-beta.21 → 3.1.52-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/utils/print.d.ts +3 -3
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +2 -0
- package/es/components/classification/index.d.ts +0 -2
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +0 -2
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +0 -2
- package/es/components/classification/src/index.vue.d.ts +0 -2
- package/es/components/iho-table/index.d.ts +2 -0
- package/es/components/iho-table/src/IhoTable.vue.d.ts +2 -0
- package/es/components/iho-table/src/hooks/tapHooks/useConfigHooks.d.ts +3 -1
- package/es/components/iho-table/src/plugins/forceArrowKeyPlugin.d.ts +1 -0
- package/es/components/iho-table/src/plugins/forceArrowKeyPlugin.js +1 -0
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +3 -0
- package/es/components/quick-search/src/index.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +0 -2
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +0 -1
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +0 -1
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue2.js +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +0 -2
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +0 -2
- package/es/components/table-filter/src/components/render-widget/components/DateInner.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue2.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
|
@@ -40,13 +40,13 @@ export declare class Print {
|
|
|
40
40
|
pageCount: any;
|
|
41
41
|
formatId: string;
|
|
42
42
|
};
|
|
43
|
-
_handleEventDirect({ templateId, formatId, params, cmdid, print, printdlgshow, nobillnode, btnprint, messageTimeout }: AnyObject): Promise<any>;
|
|
43
|
+
_handleEventDirect({ templateId, formatId, params, cmdid, print, signature, printdlgshow, nobillnode, btnprint, messageTimeout }: AnyObject): Promise<any>;
|
|
44
44
|
_handleEventEditFormat({ templateId, formatId, params, token, messageTimeout }: AnyObject): Promise<any>;
|
|
45
45
|
_queryProxyOrigin(): Promise<void>;
|
|
46
46
|
_queryPrintFile(formatId: string, params?: string): Promise<any>;
|
|
47
47
|
_browserPrint(result: AnyObject, mode: string): Promise<string | void>;
|
|
48
|
-
preview({ templateId, formatId, params, btnprint, messageTimeout }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<any>;
|
|
49
|
-
printDirect({ templateId, formatId, params, print, printdlgshow, nobillnode, isDownloadFile, messageTimeout }: AnyObject, successCallbackFn: Func, errorCallbackFn: Func, mode?: string): Promise<any>;
|
|
48
|
+
preview({ templateId, formatId, params, signature, btnprint, messageTimeout }: AnyObject, successCallbackFn?: Func, errorCallbackFn?: Func): Promise<any>;
|
|
49
|
+
printDirect({ templateId, formatId, params, print, signature, printdlgshow, nobillnode, isDownloadFile, messageTimeout }: AnyObject, successCallbackFn: Func, errorCallbackFn: Func, mode?: string): Promise<any>;
|
|
50
50
|
private _downloadPDF;
|
|
51
51
|
/**
|
|
52
52
|
* 下载pdf
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"axios";import{isArray as e}from"lodash-es";import{IdentityVerificationDialog as i,PreviewDialog as s}from"./dialog.js";import{getFileUrl as n,useBrowserPrint as r,isIReport as a}from"./browserPrint.js";import{getCurrentInstance as o}from"vue";import{uuidGenerator as l}from"../../../../shared/utils/index.js";import{format as d}from"date-fns";const h=t.create({timeout:1e3,withCredentials:!1}),m=`${window.location.protocol}//${window.location.host}`,c=`${m}/fdp-api/print/assembly/printIReport`,u=`${m}/bi-api/reprot/print/open/client/getRemote`,p=`${m}/printService/file`;let w=null;class f{constructor(){var t,e,n;if(this.webview=null,this.dialog=new i,this.dialogPreview=new s,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.isRemote=!1,this.CMonitor=null,this.messageHandlerQueue=[],w)return w;w=this;const r=window;this.CMonitor=r.$CMonitor;try{this.webview=r.top?null==(t=r.top.chrome)?void 0:t.webview:null==(e=r.chrome)?void 0:e.webview}catch(t){console.log(t),this.webview=null==(n=r.chrome)?void 0:n.webview}if(this.webview){this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler);try{this.webview.postMessage({exec:"config",data:""})}catch(t){const e="当前浏览器版本不支持获取配置接口";this._handleMonitorNotify(e),console.log("非封装浏览器或者"+e)}}}messageHandler(t){var e;if(console.log("打印事件message",t),!t)return this._handleMonitorNotify("接收到空的浏览器事件,"+t),console.log("当前回执",t,"接收到空的浏览器事件");let i;try{i=JSON.parse(t.data||"{}")}catch(e){console.log("解析e.data失败,"+e),this._handleMonitorNotify("解析e.data失败,"+t)}if(["print","pdf"].includes(null==i?void 0:i.cmd)){console.log("打印命令执行了",i);const e=this.messageHandlerQueue.shift();if(!e)return console.log("当前回执",t,"没有可用的handler");const{resolve:s,reject:n}=e;try{s(i.res||"")}catch(t){n(t)}}else"config"===(null==i?void 0:i.exec)&&(this.downloadPath=(null==(e=i.res)?void 0:e.downloadpath)||"")}async postMessage(t,e=0){if(!this.webview)return Promise.reject();const i=l();return e&&e>0?this.messageCollectAndNotifyFail(i,t,e):this.messageCollect(i,t)}messageCollect(t,e){return new Promise(((i,s)=>{this.messageHandlerQueue.push({resolve:i,reject:s,id:t}),this.webview.postMessage(e)}))}messageCollectAndNotifyFail(t,e,i){return Promise.race([new Promise(((i,s)=>{this.messageHandlerQueue.push({resolve:i,reject:s,id:t}),this.webview.postMessage(e)})),new Promise(((e,s)=>{setTimeout((()=>{const e=this.messageHandlerQueue.findIndex((e=>e.id===t));e>-1&&this.messageHandlerQueue.splice(e,1),s({type:"timeout"})}),i)}))])}destroy(){}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{h({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_queryServicesPrint(e){return this.webview?this.postMessage({exec:"print",data:{inputData:e}},null==e?void 0:e.messageTimeout):t({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(e)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:s(i)}):h({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[s]}).then((({data:t})=>t));function s(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleMonitorNotify(t){var e,i;null==(i=null==(e=this.CMonitor)?void 0:e.notify)||i.call(e,{name:"custom_info",message:t,businessName:"打印sdk"})}_handleResult(t,e){if(!t){const t="打印命令返回空数据";return this._handleMonitorNotify(""),null==e||e({type:"printError",message:t,result:!1,errinfo:t}),!1}if("success"!==t.result){const i=t.message||t.Message;this._handleMonitorNotify(i);const s={type:"printError",message:i,result:t.result,errinfo:t.errinfo};return null==e||e(s),!1}return t}_handleResultTest(t,e){return!!t||(console.log("notInstalledApp"),null==e||e({type:"notInstalledApp",message:"请打开打印服务器插件"}),!1)}async _handleEventQueryPrintData(t,e,i,s,n){const r={templateId:t,formatId:e,params:i,cmdid:"7",messageTimeout:s},a=await this._queryServicesPrint(r);return this._handleQueryPrintDataResult(a,e,n)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),null==i||i({type:"queryPrintDataFailure",message:e})}catch(t){console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,params:i,cmdid:s,print:n,printdlgshow:r="0",nobillnode:a="1",btnprint:o="1",messageTimeout:l=0}){const h={templateId:t,formatId:e,params:i,cmdid:s,nobillnode:a,printdlgshow:r,btnprint:o,messageTimeout:l};if(n){try{n=JSON.parse(n)}catch(t){}h.print=n}else if(this.isRemote){const t=d(new Date,"yyyyMMddHHmmss");h.print={print:"1",type:"1",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${t}\\${t}`}}return await this._queryServicesPrint(h)}async _handleEventEditFormat({templateId:t,formatId:e="",params:i="",token:s,messageTimeout:n=0}){const r={};let a={};try{a=Object.assign({},r,JSON.parse(i))}catch(t){a=r}const o={templateId:t,formatId:e,cmdid:"9",token:s,params:JSON.stringify(a),messageTimeout:n};return await this._queryServicesPrint(o)}async _queryProxyOrigin(){if(this.isRemote)return;const{data:t}=await h({method:"get",url:u})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=m+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await h({method:"post",url:c,responseType:"blob",params:{formatId:t.split("_")[1],params:e}})||{};return i}async _browserPrint(t,e){if(this.isRemote){const{filedir:i}=t,s=JSON.parse(i)[0].replace(/\\/g,"/").split("/"),a=s[s.length-2],o=s[s.length-1],l=await n(`${p}/${a}/${o}`),d=r(null,e,l);if("preview"===e)return d}}async preview({templateId:t,formatId:e,params:i="",btnprint:s,messageTimeout:n=0},l,d){if(a(e)){const t=await this._queryPrintFile(e,i);if(!t)return null==d?void 0:d("获取文件失败!");const s=r(t,"preview");return this.instance||(this.instance=o()),this.showPreview(this.instance,s),void(null==l||l({file:t}))}await this._queryProxyOrigin();const h=await this._testConnection();if(!this._handleResultTest(h,d))return!1;try{const r=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:this.isRemote?"7":"8",btnprint:s,messageTimeout:n}),a=this._handleResult(r,d);if(!a)return!1;if(this.isRemote){const t=await this._browserPrint(a,"preview");this.instance||(this.instance=o()),this.showPreview(this.instance,t)}null==l||l(a)}catch(t){const e="预览失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==d||d(i),this._handleMonitorNotify(i)}}async printDirect({templateId:t,formatId:e,params:i="",print:s,printdlgshow:n,nobillnode:o,isDownloadFile:l=!0,messageTimeout:d=0},h,m,c="printDirect"){if(a(e)){const t=await this._queryPrintFile(e,i);return t?(r(t,c),void(null==h||h({file:t}))):null==m?void 0:m("获取文件失败!")}await this._queryProxyOrigin();const u=await this._testConnection();if(!this._handleResultTest(u,m))return!1;try{const r=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:"7",print:s,printdlgshow:n,nobillnode:o,messageTimeout:d}),a=this._handleResult(r,m);if(!a)return!1;l&&["downloadPDF"].includes(c)&&await this._browserPrint(a,c),null==h||h(a)}catch(t){const e="printDirect"===c?"打印失败":"下载失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==m||m(i),this._handleMonitorNotify(i)}}_downloadPDF(t){return this.webview?this.postMessage({exec:"pdf",data:{file:t}}):h.get(this.printOrigin+"/download",{params:{inputData:t}}).then((({data:t})=>t))}downloadPDF(t,i,s){if(this.webview&&this.downloadPath&&(Reflect.has(t,"print")||Reflect.set(t,"print",{print:"1",type:"1"}),!t.print.filename)){const e=d(new Date,"yyyy-MM-dd"),i=l(),s=d(new Date,"yyyyMMddHHmmss")+i;t.print.filename=`${this.downloadPath}/${e}/${s}/${s}`.replace(/\\/g,"/")}this.printDirect(t,(async n=>{if(n||s(null),a(t.formatId))return i(n);const r=this,o=await async function(t){const i=[],s=JSON.parse(t);if(!e(s))return await r._downloadPDF("");if(1===s.length)return await r._downloadPDF(s[0]||"");for(let t=0,e=s.length;t<e;t++)i.push(await r._downloadPDF(s[t]||""));return i}(n.filedir);i(o,n)}),(t=>s(t)),"downloadPDF")}async print({templateId:t,formatId:e,params:i="",messageTimeout:s=0},n,r){const a=await this._testConnection();if(!this._handleResultTest(a,r))return!1;const o=await this.queryPrintData({templateId:t,formatId:e,params:i,messageTimeout:s},void 0,r);if(!o)return!1;const l=this.printFileData({formatId:e,file:o.file,printerName:o.printerName},void 0,r);if(!l)return!1;n&&n(l)}async queryPrintData({templateId:t,formatId:e,params:i="",messageTimeout:s=0},n,r){const a=await this._testConnection();if(!this._handleResultTest(a,r))return!1;const o=await this._handleEventQueryPrintData(t,e,i,s,r);return!!o&&(n&&n(o),o)}async printFileData({formatId:t,file:e,printerName:i="Default"},s,n){const r=await this._testConnection();if(!this._handleResultTest(r,n))return!1;const a=await this._callPrintWithFile({formatId:t,printname:i,file:e}),o=this._handleResult(a,n);return!!o&&(s&&s(o),o)}async editPrintFormat({templateId:t,formatId:e,params:i,token:s,messageTimeout:n=0},r,a){const o=await this._testConnection();if(!this._handleResultTest(o,a))return!1;const l=await this._handleEventEditFormat({templateId:t,formatId:e,params:i,token:s,messageTimeout:n}),d=this._handleResult(l,a);if(!d)return!1;r&&r(d)}async addPrintFormat({templateId:t,params:e,token:i},s,n){const r=await this._testConnection();if(!this._handleResultTest(r,n))return!1;const a=await this._handleEventEditFormat({templateId:t,params:e,token:i}),o=this._handleResult(a,n);if(!o)return!1;s&&s(o)}}export{f as Print};
|
|
1
|
+
import t from"axios";import{isArray as e}from"lodash-es";import{IdentityVerificationDialog as i,PreviewDialog as s}from"./dialog.js";import{getFileUrl as n,useBrowserPrint as r,isIReport as a}from"./browserPrint.js";import{getCurrentInstance as o}from"vue";import{uuidGenerator as l}from"../../../../shared/utils/index.js";import{format as d}from"date-fns";const h=t.create({timeout:1e3,withCredentials:!1}),m=`${window.location.protocol}//${window.location.host}`,u=`${m}/fdp-api/print/assembly/printIReport`,c=`${m}/bi-api/reprot/print/open/client/getRemote`,p=`${m}/printService/file`;let w=null;class f{constructor(){var t,e,n;if(this.webview=null,this.dialog=new i,this.dialogPreview=new s,this.instance=null,this.downloadPath="",this.printOrigin="http://127.0.0.1:11111",this.isRemote=!1,this.CMonitor=null,this.messageHandlerQueue=[],w)return w;w=this;const r=window;this.CMonitor=r.$CMonitor;try{this.webview=r.top?null==(t=r.top.chrome)?void 0:t.webview:null==(e=r.chrome)?void 0:e.webview}catch(t){console.log(t),this.webview=null==(n=r.chrome)?void 0:n.webview}if(this.webview){this.currentMessageHandler=this.messageHandler.bind(this),this.webview.addEventListener("message",this.currentMessageHandler);try{this.webview.postMessage({exec:"config",data:""})}catch(t){const e="当前浏览器版本不支持获取配置接口";this._handleMonitorNotify(e),console.log("非封装浏览器或者"+e)}}}messageHandler(t){var e;if(console.log("打印事件message",t),!t)return this._handleMonitorNotify("接收到空的浏览器事件,"+t),console.log("当前回执",t,"接收到空的浏览器事件");let i;try{i=JSON.parse(t.data||"{}")}catch(e){console.log("解析e.data失败,"+e),this._handleMonitorNotify("解析e.data失败,"+t)}if(["print","pdf"].includes(null==i?void 0:i.cmd)){console.log("打印命令执行了",i);const e=this.messageHandlerQueue.shift();if(!e)return console.log("当前回执",t,"没有可用的handler");const{resolve:s,reject:n}=e;try{s(i.res||"")}catch(t){n(t)}}else"config"===(null==i?void 0:i.exec)&&(this.downloadPath=(null==(e=i.res)?void 0:e.downloadpath)||"")}async postMessage(t,e=0){if(!this.webview)return Promise.reject();const i=l();return e&&e>0?this.messageCollectAndNotifyFail(i,t,e):this.messageCollect(i,t)}messageCollect(t,e){return new Promise(((i,s)=>{this.messageHandlerQueue.push({resolve:i,reject:s,id:t}),this.webview.postMessage(e)}))}messageCollectAndNotifyFail(t,e,i){return Promise.race([new Promise(((i,s)=>{this.messageHandlerQueue.push({resolve:i,reject:s,id:t}),this.webview.postMessage(e)})),new Promise(((e,s)=>{setTimeout((()=>{const e=this.messageHandlerQueue.findIndex((e=>e.id===t));e>-1&&this.messageHandlerQueue.splice(e,1),s({type:"timeout"})}),i)}))])}destroy(){}show(...t){return this.dialog.show(...t)}showPreview(...t){return this.dialogPreview.show(...t)}_testConnection(){return this.webview?Promise.resolve(!0):new Promise((t=>{h({url:`${this.printOrigin}/test`,method:"get",withCredentials:!1,params:{inputdata:{result:"success"}}}).then((({data:e})=>{"success"===e.result?t(!0):t(!1)})).catch((e=>{t(!1)}))}))}_queryServicesPrint(e){return this.webview?this.postMessage({exec:"print",data:{inputData:e}},null==e?void 0:e.messageTimeout):t({url:this.printOrigin+"/services/print",method:"get",params:{inputData:JSON.stringify(e)}}).then((({data:t})=>t))}_callPrintWithFile(t){const e={cmdid:"7",flag:"1"},i={inputData:JSON.stringify(Object.assign({},e,t))};return this.webview?this.postMessage({exec:"print",data:s(i)}):h({url:this.printOrigin+"/PrintLocal",method:"post",data:i,transformRequest:[s]}).then((({data:t})=>t));function s(t){let e="";for(const i in t)e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i])+"&";return e=e.slice(0,-1),e}}_handleMonitorNotify(t){var e,i;null==(i=null==(e=this.CMonitor)?void 0:e.notify)||i.call(e,{name:"custom_info",message:t,businessName:"打印sdk"})}_handleResult(t,e){if(!t){const t="打印命令返回空数据";return this._handleMonitorNotify(""),null==e||e({type:"printError",message:t,result:!1,errinfo:t}),!1}if("success"!==t.result){const i=t.message||t.Message;this._handleMonitorNotify(i);const s={type:"printError",message:i,result:t.result,errinfo:t.errinfo};return null==e||e(s),!1}return t}_handleResultTest(t,e){return!!t||(console.log("notInstalledApp"),null==e||e({type:"notInstalledApp",message:"请打开打印服务器插件"}),!1)}async _handleEventQueryPrintData(t,e,i,s,n){const r={templateId:t,formatId:e,params:i,cmdid:"7",messageTimeout:s},a=await this._queryServicesPrint(r);return this._handleQueryPrintDataResult(a,e,n)}_handleQueryPrintDataResult(t,e,i){if(!(null==t?void 0:t.file)){try{const e=t.message||t.Message;console.log(e),null==i||i({type:"queryPrintDataFailure",message:e})}catch(t){console.log(t)}return!1}return{file:t.file,printerName:t.defprinter,pageCount:t.pagecount,formatId:e}}async _handleEventDirect({templateId:t,formatId:e,params:i,cmdid:s,print:n,signature:r,printdlgshow:a="0",nobillnode:o="1",btnprint:l="1",messageTimeout:h=0}){const m={templateId:t,formatId:e,params:i,cmdid:s,nobillnode:o,printdlgshow:a,btnprint:l,messageTimeout:h,...r?{signature:r}:{}};if(n){try{n=JSON.parse(n)}catch(t){}m.print=n}else if(this.isRemote){const t=d(new Date,"yyyyMMddHHmmss");m.print={print:"1",type:"1",zip:"0",filename:`F:\\WorkSpace\\crmweb\\web\\${t}\\${t}`}}return await this._queryServicesPrint(m)}async _handleEventEditFormat({templateId:t,formatId:e="",params:i="",token:s,messageTimeout:n=0}){const r={};let a={};try{a=Object.assign({},r,JSON.parse(i))}catch(t){a=r}const o={templateId:t,formatId:e,cmdid:"9",token:s,params:JSON.stringify(a),messageTimeout:n};return await this._queryServicesPrint(o)}async _queryProxyOrigin(){if(this.isRemote)return;const{data:t}=await h({method:"get",url:c})||{},{map:e={}}=t;e.isRemote&&(this.printOrigin=m+"/printService",this.isRemote=!0)}async _queryPrintFile(t,e=""){const{data:i}=await h({method:"post",url:u,responseType:"blob",params:{formatId:t.split("_")[1],params:e}})||{};return i}async _browserPrint(t,e){if(this.isRemote){const{filedir:i}=t,s=JSON.parse(i)[0].replace(/\\/g,"/").split("/"),a=s[s.length-2],o=s[s.length-1],l=await n(`${p}/${a}/${o}`),d=r(null,e,l);if("preview"===e)return d}}async preview({templateId:t,formatId:e,params:i="",signature:s,btnprint:n,messageTimeout:l=0},d,h){if(a(e)){const t=await this._queryPrintFile(e,i);if(!t)return null==h?void 0:h("获取文件失败!");const s=r(t,"preview");return this.instance||(this.instance=o()),this.showPreview(this.instance,s),void(null==d||d({file:t}))}await this._queryProxyOrigin();const m=await this._testConnection();if(!this._handleResultTest(m,h))return!1;try{const r=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:this.isRemote?"7":"8",signature:s,btnprint:n,messageTimeout:l}),a=this._handleResult(r,h);if(!a)return!1;if(this.isRemote){const t=await this._browserPrint(a,"preview");this.instance||(this.instance=o()),this.showPreview(this.instance,t)}null==d||d(a)}catch(t){const e="预览失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==h||h(i),this._handleMonitorNotify(i)}}async printDirect({templateId:t,formatId:e,params:i="",print:s,signature:n,printdlgshow:o,nobillnode:l,isDownloadFile:d=!0,messageTimeout:h=0},m,u,c="printDirect"){if(a(e)){const t=await this._queryPrintFile(e,i);return t?(r(t,c),void(null==m||m({file:t}))):null==u?void 0:u("获取文件失败!")}await this._queryProxyOrigin();const p=await this._testConnection();if(!this._handleResultTest(p,u))return!1;try{const r=await this._handleEventDirect({templateId:t,formatId:e,params:i,cmdid:"7",print:s,signature:n,printdlgshow:o,nobillnode:l,messageTimeout:h}),a=this._handleResult(r,u);if(!a)return!1;d&&["downloadPDF"].includes(c)&&await this._browserPrint(a,c),null==m||m(a)}catch(t){const e="printDirect"===c?"打印失败":"下载失败",i="timeout"===(null==t?void 0:t.type)?{...t,message:e}:{message:e};null==u||u(i),this._handleMonitorNotify(i)}}_downloadPDF(t){return this.webview?this.postMessage({exec:"pdf",data:{file:t}}):h.get(this.printOrigin+"/download",{params:{inputData:t}}).then((({data:t})=>t))}downloadPDF(t,i,s){if(this.webview&&this.downloadPath&&(Reflect.has(t,"print")||Reflect.set(t,"print",{print:"1",type:"1"}),!t.print.filename)){const e=d(new Date,"yyyy-MM-dd"),i=l(),s=d(new Date,"yyyyMMddHHmmss")+i;t.print.filename=`${this.downloadPath}/${e}/${s}/${s}`.replace(/\\/g,"/")}this.printDirect(t,(async n=>{if(n||s(null),a(t.formatId))return i(n);const r=this,o=await async function(t){const i=[],s=JSON.parse(t);if(!e(s))return await r._downloadPDF("");if(1===s.length)return await r._downloadPDF(s[0]||"");for(let t=0,e=s.length;t<e;t++)i.push(await r._downloadPDF(s[t]||""));return i}(n.filedir);i(o,n)}),(t=>s(t)),"downloadPDF")}async print({templateId:t,formatId:e,params:i="",messageTimeout:s=0},n,r){const a=await this._testConnection();if(!this._handleResultTest(a,r))return!1;const o=await this.queryPrintData({templateId:t,formatId:e,params:i,messageTimeout:s},void 0,r);if(!o)return!1;const l=this.printFileData({formatId:e,file:o.file,printerName:o.printerName},void 0,r);if(!l)return!1;n&&n(l)}async queryPrintData({templateId:t,formatId:e,params:i="",messageTimeout:s=0},n,r){const a=await this._testConnection();if(!this._handleResultTest(a,r))return!1;const o=await this._handleEventQueryPrintData(t,e,i,s,r);return!!o&&(n&&n(o),o)}async printFileData({formatId:t,file:e,printerName:i="Default"},s,n){const r=await this._testConnection();if(!this._handleResultTest(r,n))return!1;const a=await this._callPrintWithFile({formatId:t,printname:i,file:e}),o=this._handleResult(a,n);return!!o&&(s&&s(o),o)}async editPrintFormat({templateId:t,formatId:e,params:i,token:s,messageTimeout:n=0},r,a){const o=await this._testConnection();if(!this._handleResultTest(o,a))return!1;const l=await this._handleEventEditFormat({templateId:t,formatId:e,params:i,token:s,messageTimeout:n}),d=this._handleResult(l,a);if(!d)return!1;r&&r(d)}async addPrintFormat({templateId:t,params:e,token:i},s,n){const r=await this._testConnection();if(!this._handleResultTest(r,n))return!1;const a=await this._handleEventEditFormat({templateId:t,params:e,token:i}),o=this._handleResult(a,n);if(!o)return!1;s&&s(o)}}export{f as Print};
|
|
@@ -2776,6 +2776,7 @@ export declare const CallbackMaps: Map<string, {
|
|
|
2776
2776
|
$table: import("vxe-table").VxeTableConstructor & import("vxe-table").VxeTablePrivateMethods;
|
|
2777
2777
|
$grid: import("vxe-table").VxeGridConstructor | null | undefined;
|
|
2778
2778
|
}) => boolean) | undefined;
|
|
2779
|
+
forceArrowKey?: boolean | undefined;
|
|
2779
2780
|
} | undefined;
|
|
2780
2781
|
clipConfig?: {
|
|
2781
2782
|
isCopy?: boolean | undefined;
|
|
@@ -5277,6 +5278,7 @@ export declare const CallbackMaps: Map<string, {
|
|
|
5277
5278
|
$table: import("vxe-table").VxeTableConstructor & import("vxe-table").VxeTablePrivateMethods;
|
|
5278
5279
|
$grid: import("vxe-table").VxeGridConstructor | null | undefined;
|
|
5279
5280
|
}) => boolean) | undefined;
|
|
5281
|
+
forceArrowKey?: boolean | undefined;
|
|
5280
5282
|
} | undefined;
|
|
5281
5283
|
clipConfig?: {
|
|
5282
5284
|
isCopy?: boolean | undefined;
|
|
@@ -789,7 +789,6 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
789
789
|
label: string;
|
|
790
790
|
value: string;
|
|
791
791
|
}[]>;
|
|
792
|
-
initMounted: () => void;
|
|
793
792
|
isDateDisabled: (ts: number) => boolean;
|
|
794
793
|
timeDisabled: (ts: number) => {
|
|
795
794
|
isHourDisabled(hour: number): boolean | undefined;
|
|
@@ -1408,7 +1407,6 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1408
1407
|
value: string;
|
|
1409
1408
|
}[]>;
|
|
1410
1409
|
presetValCp: import("vue").WritableComputedRef<string>;
|
|
1411
|
-
initMounted: () => void;
|
|
1412
1410
|
handleChange: (val: any, type: "end" | "start") => void;
|
|
1413
1411
|
isStartDateDisabled: (ts: number) => boolean;
|
|
1414
1412
|
timeStartDisabled: (ts: number) => {
|
|
@@ -266,7 +266,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
266
266
|
label: string;
|
|
267
267
|
value: string;
|
|
268
268
|
}[]>;
|
|
269
|
-
initMounted: () => void;
|
|
270
269
|
isDateDisabled: (ts: number) => boolean;
|
|
271
270
|
timeDisabled: (ts: number) => {
|
|
272
271
|
isHourDisabled(hour: number): boolean | undefined;
|
|
@@ -885,7 +884,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
885
884
|
value: string;
|
|
886
885
|
}[]>;
|
|
887
886
|
presetValCp: import("vue").WritableComputedRef<string>;
|
|
888
|
-
initMounted: () => void;
|
|
889
887
|
handleChange: (val: any, type: "end" | "start") => void;
|
|
890
888
|
isStartDateDisabled: (ts: number) => boolean;
|
|
891
889
|
timeStartDisabled: (ts: number) => {
|
|
@@ -576,7 +576,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
576
576
|
label: string;
|
|
577
577
|
value: string;
|
|
578
578
|
}[]>;
|
|
579
|
-
initMounted: () => void;
|
|
580
579
|
isDateDisabled: (ts: number) => boolean;
|
|
581
580
|
timeDisabled: (ts: number) => {
|
|
582
581
|
isHourDisabled(hour: number): boolean | undefined;
|
|
@@ -1195,7 +1194,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1195
1194
|
value: string;
|
|
1196
1195
|
}[]>;
|
|
1197
1196
|
presetValCp: import("vue").WritableComputedRef<string>;
|
|
1198
|
-
initMounted: () => void;
|
|
1199
1197
|
handleChange: (val: any, type: "end" | "start") => void;
|
|
1200
1198
|
isStartDateDisabled: (ts: number) => boolean;
|
|
1201
1199
|
timeStartDisabled: (ts: number) => {
|
|
@@ -790,7 +790,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
790
790
|
label: string;
|
|
791
791
|
value: string;
|
|
792
792
|
}[]>;
|
|
793
|
-
initMounted: () => void;
|
|
794
793
|
isDateDisabled: (ts: number) => boolean;
|
|
795
794
|
timeDisabled: (ts: number) => {
|
|
796
795
|
isHourDisabled(hour: number): boolean | undefined;
|
|
@@ -1409,7 +1408,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1409
1408
|
value: string;
|
|
1410
1409
|
}[]>;
|
|
1411
1410
|
presetValCp: import("vue").WritableComputedRef<string>;
|
|
1412
|
-
initMounted: () => void;
|
|
1413
1411
|
handleChange: (val: any, type: "end" | "start") => void;
|
|
1414
1412
|
isStartDateDisabled: (ts: number) => boolean;
|
|
1415
1413
|
timeStartDisabled: (ts: number) => {
|
|
@@ -1880,6 +1880,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1880
1880
|
$table: import("vxe-table").VxeTableConstructor & import("vxe-table").VxeTablePrivateMethods;
|
|
1881
1881
|
$grid: import("vxe-table").VxeGridConstructor | null | undefined;
|
|
1882
1882
|
}) => boolean) | undefined;
|
|
1883
|
+
forceArrowKey?: boolean | undefined;
|
|
1883
1884
|
} | undefined;
|
|
1884
1885
|
clipConfig?: {
|
|
1885
1886
|
isCopy?: boolean | undefined;
|
|
@@ -4381,6 +4382,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
4381
4382
|
$table: import("vxe-table").VxeTableConstructor & import("vxe-table").VxeTablePrivateMethods;
|
|
4382
4383
|
$grid: import("vxe-table").VxeGridConstructor | null | undefined;
|
|
4383
4384
|
}) => boolean) | undefined;
|
|
4385
|
+
forceArrowKey?: boolean | undefined;
|
|
4384
4386
|
} | undefined;
|
|
4385
4387
|
clipConfig?: {
|
|
4386
4388
|
isCopy?: boolean | undefined;
|
|
@@ -1880,6 +1880,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1880
1880
|
$table: import("vxe-table").VxeTableConstructor & import("vxe-table").VxeTablePrivateMethods;
|
|
1881
1881
|
$grid: import("vxe-table").VxeGridConstructor | null | undefined;
|
|
1882
1882
|
}) => boolean) | undefined;
|
|
1883
|
+
forceArrowKey?: boolean | undefined;
|
|
1883
1884
|
} | undefined;
|
|
1884
1885
|
clipConfig?: {
|
|
1885
1886
|
isCopy?: boolean | undefined;
|
|
@@ -4381,6 +4382,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
4381
4382
|
$table: import("vxe-table").VxeTableConstructor & import("vxe-table").VxeTablePrivateMethods;
|
|
4382
4383
|
$grid: import("vxe-table").VxeGridConstructor | null | undefined;
|
|
4383
4384
|
}) => boolean) | undefined;
|
|
4385
|
+
forceArrowKey?: boolean | undefined;
|
|
4384
4386
|
} | undefined;
|
|
4385
4387
|
clipConfig?: {
|
|
4386
4388
|
isCopy?: boolean | undefined;
|
|
@@ -27,7 +27,9 @@ declare class ConfigHooks extends AbstractConfigHooks {
|
|
|
27
27
|
readonly treeConfig: SyncWaterfallHook<[import("vxe-table").VxeTablePropTypes.TreeConfig | undefined, IhoTableConfig, IhoTableHandlerContext<true>], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
28
28
|
readonly mouseConfig: SyncWaterfallHook<[import("vxe-table").VxeTablePropTypes.MouseConfig | undefined, IhoTableConfig, IhoTableHandlerContext<true>], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
29
29
|
readonly menuConfig: SyncWaterfallHook<[import("vxe-table").VxeTablePropTypes.MenuConfig | undefined, IhoTableConfig, IhoTableHandlerContext<true>], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
30
|
-
readonly keyboardConfig: SyncWaterfallHook<[import("vxe-table").VxeTablePropTypes.KeyboardConfig
|
|
30
|
+
readonly keyboardConfig: SyncWaterfallHook<[(import("vxe-table").VxeTablePropTypes.KeyboardConfig & Partial<import("vxe-table").VxeTablePropTypes.KeyboardConfig & {
|
|
31
|
+
forceArrowKey: boolean;
|
|
32
|
+
}>) | undefined, IhoTableConfig, IhoTableHandlerContext<true>], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
31
33
|
readonly scrollY: SyncWaterfallHook<[import("vxe-table").VxeTablePropTypes.ScrollY | undefined, IhoTableConfig, IhoTableHandlerContext<true>], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
32
34
|
readonly scrollX: SyncWaterfallHook<[import("vxe-table").VxeTablePropTypes.ScrollX | undefined, IhoTableConfig, IhoTableHandlerContext<true>], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
33
35
|
readonly editRules: SyncWaterfallHook<[import("vxe-table").VxeTablePropTypes.EditRules | undefined, IhoTableConfig, IhoTableHandlerContext<true>], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function forceArrowKeyPlugin(): import("../../../../../es/components/iho-table").TablePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../index.js";import{EDITABLE_WIDGET_TYPE as e}from"../constants/index.js";import{promiseTimeout as r}from"@vueuse/shared";import{identity as o}from"lodash-es";import{defineTablePlugin as t}from"../hooks/useTablePlugin.js";function n(){const n="forceArrowKeyPlugin",i=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"];function s({keyboardConfig:e={}}){return e.isArrow&&e.forceArrowKey}return t({name:n,apply(t){t.eventHooks.onKeydown.tap(n,(async({$event:e,$table:o},t)=>{const n=e;if(!s(t)||!i.includes(n.key))return;const d=o.getEditRecord()||{};if(d.row&&d.column){e.preventDefault();const r="ArrowLeft"===n.key,t="ArrowUp"===n.key,i="ArrowRight"===n.key,s="ArrowDown"===n.key;o.moveSelected(d,r,t,i,s,n)}await r(0);const{row:p,column:l}=o.getSelectedCell()||{};p&&l&&await o.setEditCell(p,l)}));const d={[e.NUMBER]:e=>{var r;return e.editRender.props={...e.editRender.props,componentProps:{keyboard:{ArrowUp:!1,ArrowDown:!1},...null==(r=e.editRender.props)?void 0:r.componentProps}},e}};t.fieldHooks.field.tap(n,((e,r,t)=>{var n;if(!s(t))return e;return(d[null==(n=e.editRender)?void 0:n.name]||o)(e)}))}})}export{n as forceArrowKeyPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin/index.js";import*as i from"./copyPastePlugin.js";import*as n from"./defaultConfigPlugin/index.js";import*as s from"./defaultValuePlugin.js";import*as t from"./filterDaterangeRenderPlugin/index.js";import*as d from"./filterRenderPlugin/index.js";import*as l from"./filterVisibleEventPlugin.js";import*as g from"./
|
|
1
|
+
import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin/index.js";import*as i from"./copyPastePlugin.js";import*as n from"./defaultConfigPlugin/index.js";import*as s from"./defaultValuePlugin.js";import*as t from"./filterDaterangeRenderPlugin/index.js";import*as d from"./filterRenderPlugin/index.js";import*as l from"./filterVisibleEventPlugin.js";import*as g from"./forceArrowKeyPlugin.js";import*as u from"./headerPlugin.js";import*as o from"./highLightSetPlugin.js";import*as a from"./keyboardEventPlugin/index.js";import*as P from"./lowCodeFieldAdaptorPlugin/index.js";import*as m from"./maxCheckSizePlugin.js";import*as x from"./operationalFormPlugin/index.js";import*as f from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as p from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as j from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as R from"./rendererPlugins/editableWidgets/radioRendererPlugin.js";import*as b from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as w from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as c from"./rendererPlugins/editableWidgets/timeRendererPlugin/index.js";import*as h from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as W from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as v from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as k from"./rendererPlugins/widgets/htmlRendererPlugin.js";import*as C from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as S from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as y from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as E from"./rowClickPlugin/index.js";import*as A from"./rowDragPlugin/index.js";import*as D from"./rowGroupSettingPlugin/index.js";import*as F from"./varialbleHeightPlugin/index.js";import*as V from"./virtualTreePlugin/index.js";import{separateMetaModule as q}from"../../../../shared/utils/index.js";var z=q(Object.assign({"./anchorPlugin/index.tsx":e,"./bindEventSettingPlugin/index.ts":r,"./copyPastePlugin.ts":i,"./defaultConfigPlugin/index.ts":n,"./defaultValuePlugin.ts":s,"./filterDaterangeRenderPlugin/index.tsx":t,"./filterRenderPlugin/index.tsx":d,"./filterVisibleEventPlugin.ts":l,"./forceArrowKeyPlugin.ts":g,"./headerPlugin.tsx":u,"./highLightSetPlugin.tsx":o,"./keyboardEventPlugin/index.ts":a,"./lowCodeFieldAdaptorPlugin/index.tsx":P,"./maxCheckSizePlugin.ts":m,"./operationalFormPlugin/index.ts":x,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":f,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":p,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":j,"./rendererPlugins/editableWidgets/radioRendererPlugin.tsx":R,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":b,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":w,"./rendererPlugins/editableWidgets/timeRendererPlugin/index.tsx":c,"./rendererPlugins/widgets/checkRendererPlugin.tsx":h,"./rendererPlugins/widgets/colorRendererPlugin.tsx":W,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":v,"./rendererPlugins/widgets/htmlRendererPlugin.tsx":k,"./rendererPlugins/widgets/labelRendererPlugin.tsx":C,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":S,"./rendererPlugins/widgets/seqRendererPlugin.tsx":y,"./rowClickPlugin/index.ts":E,"./rowDragPlugin/index.ts":A,"./rowGroupSettingPlugin/index.ts":D,"./varialbleHeightPlugin/index.tsx":F,"./virtualTreePlugin/index.ts":V}));export{z as default};
|
|
@@ -39,6 +39,9 @@ export declare type IhoTableConfig = VxeTableProps & Partial<{
|
|
|
39
39
|
disableHeader: boolean;
|
|
40
40
|
useNCheckbox: boolean;
|
|
41
41
|
}>;
|
|
42
|
+
keyboardConfig: Partial<VxeTableProps['keyboardConfig'] & {
|
|
43
|
+
forceArrowKey: boolean;
|
|
44
|
+
}>;
|
|
42
45
|
radioConfig: Partial<VxeTableProps['radioConfig'] & {
|
|
43
46
|
slots: VxeColumnPropTypes.Slots;
|
|
44
47
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as l,provide as t,computed as a,watch as i,onMounted as n,openBlock as o,createElementBlock as r,createElementVNode as s,Fragment as u,renderList as c,unref as d,normalizeClass as f,createCommentVNode as v,createVNode as m,withCtx as p,createTextVNode as h,toDisplayString as g,createBlock as k,withDirectives as b,vShow as y,isRef as C}from"vue";import{useMessage as S,NPopover as x,NModal as A,NCard as _,NIcon as F,NButton as q,NForm as w,NFormItem as j,NInput as E}from"naive-ui";import{CloseOutline as U,AddOutline as I}from"@vicons/ionicons5";import L from"../../table-filter/src/hooks/useMixins.js";import N from"../../table-filter/src/hooks/useRenderWidget.js";import O from"../../table-filter/src/hooks/useAdvanced.js";import P from"../../table-filter/src/components/render-widget/index.vue.js";import"moment/locale/zh-cn";import{cloneDeep as R}from"lodash-es";import{InjectionFilterApiConfig as V,InjectionFilterSearchConfig as z}from"../../table-filter/src/constants/index.js";const D={class:"quick-search-block quick-search-table"},T={class:"quick-row"},B={class:"quick-item-title"},Q={class:"quick-item-col"},M={class:"svg-wrap"},W={class:"flex_right"},G={class:"class-filter-content"},J={class:"quickSearch-content"},H=s("span",{class:"label"},"父类名称:",-1),K=["onDblclick","onClick"],X={key:0,class:"s-content"};var Y=e({__name:"index",props:{searchFieldList:{type:Array,default:()=>[]},quickSearchConfig:{type:Array,default:()=>[]},tableId:{type:String,default:""},filterApiConfig:{type:Object}},emits:["getFilterParam","onFilterSearch","clearQuickSearchConfig"],setup(e,{expose:Y,emit:Z}){const $=e,ee={classname:{required:!0,message:"请输入分类名称",trigger:["input","blur"]}},le=S(),{handleGetConfigApi:te,outQuickSearchFn:ae}=L(),{getRenderSearchConObj:ie,resetRenderWidgetValue:ne,isRender:oe}=N(),{transformData:re,getCacheDef:se,transformParams:ue}=O(),ce=l(null),de=l({classname:""});let fe=l(!1),ve=l([]),me=l([]),pe=l(!1),he=l("");const ge=l([]);t(V,$.filterApiConfig),t(z,ve);let ke=a((()=>!!me.value.length&&me.value.some((e=>e.isAdd)))),be=a((()=>(e,l="name")=>e.alias||e[l]));function ye(){return function(e){if(!Array.isArray(e))return[];let l=[];for(let t=0;t<e.length;t++){let a=e[t];const i=ie(a);!l.find((e=>e.field_key===i.field_key))&&i&&l.push(i)}return l.filter((e=>e.value))}(ve.value)||[]}function Ce(){var e;null==(e=ce.value)||e.validate((e=>{var l;if(e)return;let t=ye();t.length||(t=[]);let a=null==(l=me.value.filter((e=>e.selected))[0])?void 0:l.value;!async function(e){var l;try{if(!await te(e,"requestSaveTableCondiTion",{},$.filterApiConfig))return;fe.value=!1,null==(l=ce.value)||l.restoreValidation(),de.value.classname="",me.value=[],Fe()}catch(e){console.log(e)}}({tableId:$.tableId||"",setting:JSON.stringify({displayCategory:a,name:de.value.classname,conObj:t}),conditionList:"[]"})}))}function Se(e){var l;const t=null==(l=null==e?void 0:e.target)?void 0:l.nextElementSibling;setTimeout((()=>{t&&t.focus()})),pe.value=!0}function xe(){pe.value=!1,he.value&&(me.value.forEach((e=>e.selected=!1)),me.value.push({disabled:!0,value:he.value,selected:!0,isAdd:!0}),he.value="")}function Ae(e){!function(e){me.value.splice(e,1)}(e)}function _e(){fe.value=!1}function Fe(){qe(ve.value),Z("clearQuickSearchConfig")}function qe(e){Array.isArray(e)&&(e.forEach((e=>{ne(e)})),ae.handlerInitSearchItem(ve.value))}return i((()=>$.searchFieldList),(e=>{e&&e.length>0&&function(){let e=R(re($.searchFieldList,{_filterApiConfig:$.filterApiConfig})).filter((e=>1==e.isShowSearch&&1!=e.filterExplicit))||[];ve.value=e||[],ae.handlerInitSearchItem(ve.value)}()}),{immediate:!0,deep:!0}),i((()=>ve),(()=>{const e=ye()||[],l=ue(e);Z("getFilterParam",e,l),ge.value.forEach((e=>e(l)))}),{deep:!0}),n((()=>{const e=$.quickSearchConfig;if(e&&e.length>0)return l=e,void ve.value.forEach((e=>{var t,a;if(oe(e)){const i=l.find((l=>l.field_key===e.columnName));i&&(null==(t=i.value)?void 0:t.length)>0&&(e.value=se(e,i.value),e.unit=null!=(a=i.unit)?a:"")}}));var l;qe(ve.value)})),Y({openSaveToCalss:function(){let e=ye();e&&(e.length>0?fe.value=!0:le.warning("请设置搜索条件"))},clearData:Fe,onFilterSearch:function(){let e=ye()||[];const l=ue(e);return Z("onFilterSearch",e,l,!1),ve.value},getFilterParams:function(){const e=ye()||[];return ue(e)},setFilterParams:function(e){const l=e?Object.keys(e):[];l.length>0&&ve.value.forEach((t=>{var a;if(oe(t)&&l.includes(t.columnName)){const l=e[t.columnName];t.value=Array.isArray(l)&&!1===(null==(a=t.widgetCfg)?void 0:a.multiple)?l[0]:l}}))},getOriginalConfig:function(){return $.searchFieldList},onFilterChange:function(e){ge.value.push(e)}}),(e,l)=>(o(),r("div",null,[s("div",D,[(o(!0),r(u,null,c(d(ve),(e=>(o(),r("div",{class:f(["quick-item",{"quick-block":e._isBlock}]),key:e.sid||e.columnName},[s("div",T,[v(" title "),s("div",B,[m(d(x),{trigger:"hover"},{trigger:p((()=>[h(g(d(be)(e,"title")),1)])),default:p((()=>[s("span",null,g(d(be)(e,"title")),1)])),_:2},1024)]),v(" content "),s("div",Q,[v(" 直接渲染组件 "),e.isRender?(o(),k(P,{key:0,cfg:e,modelValue:e.value,"onUpdate:modelValue":l=>e.value=l,unit:e.unit,"onUpdate:unit":l=>e.unit=l},null,8,["cfg","modelValue","onUpdate:modelValue","unit","onUpdate:unit"])):v("v-if",!0)])])],2)))),128))]),v(" 保存到分类的弹窗 "),m(d(A),{show:d(fe),maskClosable:!1,"positive-text":"确认","negative-text":"取消",onPositiveClick:Ce,onNegativeClick:_e,class:"classification-modal-block"},{default:p((()=>[m(d(_),{title:"设置筛选分类",style:{width:"520px"},bordered:!1,size:"huge",role:"dialog","aria-modal":"true"},{"header-extra":p((()=>[s("div",M,[m(d(F),{component:d(U),size:"24",onClick:_e},null,8,["component"])])])),footer:p((()=>[s("div",W,[m(d(q),{onClick:_e},{default:p((()=>[h("取消")])),_:1}),m(d(q),{type:"info",onClick:Ce},{default:p((()=>[h("确认")])),_:1})])])),default:p((()=>[s("div",G,[m(d(w),{ref_key:"formRef",ref:ce,"label-placement":"left",rules:ee,model:de.value},{default:p((()=>[m(d(j),{label:"筛选集名称",path:"classname"},{default:p((()=>[m(d(E),{value:de.value.classname,"onUpdate:value":l[0]||(l[0]=e=>de.value.classname=e),placeholder:"请输入分类名称",clearable:""},null,8,["value"])])),_:1})])),_:1},8,["model"]),s("div",J,[H,(o(!0),r(u,null,c(d(me),((e,l)=>(o(),r("div",{class:f(["edit-tag",{"edit-tag-select":e.selected&&e.disabled}]),key:l,onDblclick:l=>function(e,l){l.disabled=!1,setTimeout((()=>{var l;null==(l=e.target)||l.focus()}),0)}(l,e),onClick:t=>function(e,l){e.disabled&&(me.value.forEach(((e,t)=>{t!==l&&(e.selected=!1)})),e.selected=!e.selected)}(e,l)},[e.disabled?(o(),r("div",X,[s("span",null,g(e.value),1)])):(o(),k(d(E),{key:1,style:{width:"100px"},value:e.value,"onUpdate:value":l=>e.value=l,disabled:e.disabled,onBlur:()=>e.disabled=!0,maxLength:10},null,8,["value","onUpdate:value","disabled","onBlur"])),m(d(F),{component:d(U),class:"anticon-close",size:"20",onClick:e=>Ae(l)},null,8,["component","onClick"])],42,K)))),128)),d(ke)?v("v-if",!0):(o(),r(u,{key:0},[b(m(d(q),{dashed:"",icon:"plus",class:"ant-btn",onClick:Se},{default:p((()=>[m(d(F),{component:d(I),size:"20"},null,8,["component"]),h("添加分类 ")])),_:1},512),[[y,!d(pe)]]),b(m(d(E),{style:{width:"100px"},class:"edit-tag",value:d(he),"onUpdate:value":l[1]||(l[1]=e=>C(he)?he.value=e:he=e),valueModifiers:{trim:!0},onBlur:xe,maxLength:10},null,8,["value"]),[[y,d(pe)]])],64))])])])),_:1})])),_:1},8,["show"])]))}});export{Y as default};
|
|
1
|
+
import{defineComponent as e,ref as l,provide as t,computed as a,watch as i,onMounted as n,openBlock as o,createElementBlock as r,createElementVNode as s,Fragment as u,renderList as c,unref as d,normalizeClass as f,createCommentVNode as v,createVNode as m,withCtx as p,createTextVNode as h,toDisplayString as g,createBlock as k,withDirectives as b,vShow as y,isRef as C}from"vue";import{useMessage as S,NPopover as x,NModal as A,NCard as _,NIcon as F,NButton as q,NForm as w,NFormItem as j,NInput as E}from"naive-ui";import{CloseOutline as U,AddOutline as I}from"@vicons/ionicons5";import L from"../../table-filter/src/hooks/useMixins.js";import N from"../../table-filter/src/hooks/useRenderWidget.js";import O from"../../table-filter/src/hooks/useAdvanced.js";import P from"../../table-filter/src/components/render-widget/index.vue.js";import"moment/locale/zh-cn";import{cloneDeep as R}from"lodash-es";import{InjectionFilterApiConfig as V,InjectionFilterSearchConfig as z}from"../../table-filter/src/constants/index.js";const D={class:"quick-search-block quick-search-table"},T={class:"quick-row"},B={class:"quick-item-title"},Q={class:"quick-item-col"},M={class:"svg-wrap"},W={class:"flex_right"},G={class:"class-filter-content"},J={class:"quickSearch-content"},H=s("span",{class:"label"},"父类名称:",-1),K=["onDblclick","onClick"],X={key:0,class:"s-content"};var Y=e({__name:"index",props:{searchFieldList:{type:Array,default:()=>[]},quickSearchConfig:{type:Array,default:()=>[]},tableId:{type:String,default:""},filterApiConfig:{type:Object}},emits:["getFilterParam","onFilterSearch","clearQuickSearchConfig"],setup(e,{expose:Y,emit:Z}){const $=e,ee={classname:{required:!0,message:"请输入分类名称",trigger:["input","blur"]}},le=S(),{handleGetConfigApi:te,outQuickSearchFn:ae}=L(),{getRenderSearchConObj:ie,resetRenderWidgetValue:ne,isRender:oe}=N(),{transformData:re,getCacheDef:se,transformParams:ue}=O(),ce=l(null),de=l({classname:""});let fe=l(!1),ve=l([]),me=l([]),pe=l(!1),he=l("");const ge=l([]);t(V,$.filterApiConfig),t(z,ve);let ke=a((()=>!!me.value.length&&me.value.some((e=>e.isAdd)))),be=a((()=>(e,l="name")=>e.alias||e[l]));function ye(){return function(e){if(!Array.isArray(e))return[];let l=[];for(let t=0;t<e.length;t++){let a=e[t];const i=ie(a);!l.find((e=>e.field_key===i.field_key))&&i&&l.push(i)}return l.filter((e=>e.value))}(ve.value)||[]}function Ce(){var e;null==(e=ce.value)||e.validate((e=>{var l;if(e)return;let t=ye();t.length||(t=[]);let a=null==(l=me.value.filter((e=>e.selected))[0])?void 0:l.value;!async function(e){var l;try{if(!await te(e,"requestSaveTableCondiTion",{},$.filterApiConfig))return;fe.value=!1,null==(l=ce.value)||l.restoreValidation(),de.value.classname="",me.value=[],Fe()}catch(e){console.log(e)}}({tableId:$.tableId||"",setting:JSON.stringify({displayCategory:a,name:de.value.classname,conObj:t.map((e=>(e.unit&&(e.value=[]),e)))}),conditionList:"[]"})}))}function Se(e){var l;const t=null==(l=null==e?void 0:e.target)?void 0:l.nextElementSibling;setTimeout((()=>{t&&t.focus()})),pe.value=!0}function xe(){pe.value=!1,he.value&&(me.value.forEach((e=>e.selected=!1)),me.value.push({disabled:!0,value:he.value,selected:!0,isAdd:!0}),he.value="")}function Ae(e){!function(e){me.value.splice(e,1)}(e)}function _e(){fe.value=!1}function Fe(){qe(ve.value),Z("clearQuickSearchConfig")}function qe(e){Array.isArray(e)&&(e.forEach((e=>{ne(e)})),ae.handlerInitSearchItem(ve.value))}return i((()=>$.searchFieldList),(e=>{e&&e.length>0&&function(){let e=R(re($.searchFieldList,{_filterApiConfig:$.filterApiConfig})).filter((e=>1==e.isShowSearch&&1!=e.filterExplicit))||[];ve.value=e||[],ae.handlerInitSearchItem(ve.value)}()}),{immediate:!0,deep:!0}),i((()=>ve),(()=>{const e=ye()||[],l=ue(e);Z("getFilterParam",e,l),ge.value.forEach((e=>e(l)))}),{deep:!0}),n((()=>{const e=$.quickSearchConfig;if(e&&e.length>0)return l=e,void ve.value.forEach((e=>{var t,a;if(oe(e)){const i=l.find((l=>l.field_key===e.columnName));i&&(null==(t=i.value)?void 0:t.length)>0&&(e.value=se(e,i.value),e.unit=null!=(a=i.unit)?a:"")}}));var l;qe(ve.value)})),Y({openSaveToCalss:function(){let e=ye();e&&(e.length>0?fe.value=!0:le.warning("请设置搜索条件"))},clearData:Fe,onFilterSearch:function(){let e=ye()||[];const l=ue(e);return Z("onFilterSearch",e,l,!1),ve.value},getFilterParams:function(){const e=ye()||[];return ue(e)},setFilterParams:function(e){const l=e?Object.keys(e):[];l.length>0&&ve.value.forEach((t=>{var a;if(oe(t)&&l.includes(t.columnName)){const l=e[t.columnName];t.value=Array.isArray(l)&&!1===(null==(a=t.widgetCfg)?void 0:a.multiple)?l[0]:l}}))},getOriginalConfig:function(){return $.searchFieldList},onFilterChange:function(e){ge.value.push(e)}}),(e,l)=>(o(),r("div",null,[s("div",D,[(o(!0),r(u,null,c(d(ve),(e=>(o(),r("div",{class:f(["quick-item",{"quick-block":e._isBlock}]),key:e.sid||e.columnName},[s("div",T,[v(" title "),s("div",B,[m(d(x),{trigger:"hover"},{trigger:p((()=>[h(g(d(be)(e,"title")),1)])),default:p((()=>[s("span",null,g(d(be)(e,"title")),1)])),_:2},1024)]),v(" content "),s("div",Q,[v(" 直接渲染组件 "),e.isRender?(o(),k(P,{key:0,cfg:e,modelValue:e.value,"onUpdate:modelValue":l=>e.value=l,unit:e.unit,"onUpdate:unit":l=>e.unit=l},null,8,["cfg","modelValue","onUpdate:modelValue","unit","onUpdate:unit"])):v("v-if",!0)])])],2)))),128))]),v(" 保存到分类的弹窗 "),m(d(A),{show:d(fe),maskClosable:!1,"positive-text":"确认","negative-text":"取消",onPositiveClick:Ce,onNegativeClick:_e,class:"classification-modal-block"},{default:p((()=>[m(d(_),{title:"设置筛选分类",style:{width:"520px"},bordered:!1,size:"huge",role:"dialog","aria-modal":"true"},{"header-extra":p((()=>[s("div",M,[m(d(F),{component:d(U),size:"24",onClick:_e},null,8,["component"])])])),footer:p((()=>[s("div",W,[m(d(q),{onClick:_e},{default:p((()=>[h("取消")])),_:1}),m(d(q),{type:"info",onClick:Ce},{default:p((()=>[h("确认")])),_:1})])])),default:p((()=>[s("div",G,[m(d(w),{ref_key:"formRef",ref:ce,"label-placement":"left",rules:ee,model:de.value},{default:p((()=>[m(d(j),{label:"筛选集名称",path:"classname"},{default:p((()=>[m(d(E),{value:de.value.classname,"onUpdate:value":l[0]||(l[0]=e=>de.value.classname=e),placeholder:"请输入分类名称",clearable:""},null,8,["value"])])),_:1})])),_:1},8,["model"]),s("div",J,[H,(o(!0),r(u,null,c(d(me),((e,l)=>(o(),r("div",{class:f(["edit-tag",{"edit-tag-select":e.selected&&e.disabled}]),key:l,onDblclick:l=>function(e,l){l.disabled=!1,setTimeout((()=>{var l;null==(l=e.target)||l.focus()}),0)}(l,e),onClick:t=>function(e,l){e.disabled&&(me.value.forEach(((e,t)=>{t!==l&&(e.selected=!1)})),e.selected=!e.selected)}(e,l)},[e.disabled?(o(),r("div",X,[s("span",null,g(e.value),1)])):(o(),k(d(E),{key:1,style:{width:"100px"},value:e.value,"onUpdate:value":l=>e.value=l,disabled:e.disabled,onBlur:()=>e.disabled=!0,maxLength:10},null,8,["value","onUpdate:value","disabled","onBlur"])),m(d(F),{component:d(U),class:"anticon-close",size:"20",onClick:e=>Ae(l)},null,8,["component","onClick"])],42,K)))),128)),d(ke)?v("v-if",!0):(o(),r(u,{key:0},[b(m(d(q),{dashed:"",icon:"plus",class:"ant-btn",onClick:Se},{default:p((()=>[m(d(F),{component:d(I),size:"20"},null,8,["component"]),h("添加分类 ")])),_:1},512),[[y,!d(pe)]]),b(m(d(E),{style:{width:"100px"},class:"edit-tag",value:d(he),"onUpdate:value":l[1]||(l[1]=e=>C(he)?he.value=e:he=e),valueModifiers:{trim:!0},onBlur:xe,maxLength:10},null,8,["value"]),[[y,d(pe)]])],64))])])])),_:1})])),_:1},8,["show"])]))}});export{Y as default};
|
|
@@ -89,7 +89,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
89
89
|
label: string;
|
|
90
90
|
value: string;
|
|
91
91
|
}[]>;
|
|
92
|
-
initMounted: () => void;
|
|
93
92
|
isDateDisabled: (ts: number) => boolean;
|
|
94
93
|
timeDisabled: (ts: number) => {
|
|
95
94
|
isHourDisabled(hour: number): boolean | undefined;
|
|
@@ -708,7 +707,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
708
707
|
value: string;
|
|
709
708
|
}[]>;
|
|
710
709
|
presetValCp: import("vue").WritableComputedRef<string>;
|
|
711
|
-
initMounted: () => void;
|
|
712
710
|
handleChange: (val: any, type: "end" | "start") => void;
|
|
713
711
|
isStartDateDisabled: (ts: number) => boolean;
|
|
714
712
|
timeStartDisabled: (ts: number) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,computed as t,
|
|
1
|
+
import{defineComponent as e,computed as t,openBlock as a,createElementBlock as l,createVNode as r,unref as u,isRef as o,createBlock as s,createCommentVNode as p}from"vue";import d from"../../../../../date-picker/index.js";import{NSelect as n}from"naive-ui";import{WidgetTypeEnums as i,WidgetOptionEnums as m,WidgetValEnums as v}from"../../../types/enums.js";import{WidgetDateOptionEnums as f}from"../../render-widget/helpers/enums.js";import{widgetDateValOptions as y}from"../../render-widget/helpers/dateExtraMap.js";import{setDateDisabled as c,setTimeDisabled as b}from"../../render-widget/helpers/dateDisabled.js";const g={style:{display:"flex"}};var w=e({__name:"Date",props:{componentCfg:{type:Object},paramCfg:{type:Object,default:null},modelValue:{type:[String,Number,Array],default:null},presetVal:{type:String,default:null}},emits:["update:modelValue","update:presetVal"],setup(e,{emit:w}){const C=e,M=t({set(e){w("update:modelValue",e)},get:()=>C.modelValue}),V=t({set(e){w("update:presetVal",e)},get:()=>C.presetVal}),j=t((()=>T.value.toLowerCase()||i.DATE.toLowerCase())),D=t((()=>{let e="";switch(T.value){case i.DATE:e="yyyy-MM-dd";break;case i.DATE_TIME:e="yyyy-MM-dd HH:mm:ss"}return e})),T=t((()=>C.paramCfg._rawData.type)),h=t((()=>{var e,t;return null==(t=null==(e=C.paramCfg)?void 0:e._rawData)?void 0:t.optionType})),_=t((()=>{var e;const t=h.value||m.ALL;if(T.value&&t){const a=`${T.value}_${t}`,l=f[a];let r=(null!=(e=y[l])?e:[]).map((e=>({label:e.title,value:e.con})));return r.unshift({label:"自定义输入",value:v.CUSTOM}),r}return[]}));function x(e){return c(e,h.value)}function A(e){return b(e,h.value)}return(e,t)=>(a(),l("div",g,[r(u(n),{style:{width:"120px"},class:"form-item",to:"body",value:u(V),"onUpdate:value":t[0]||(t[0]=e=>o(V)?V.value=e:null),options:u(_)},null,8,["value","options"]),u(V)===u(v).CUSTOM?(a(),s(u(d),{key:0,class:"form-item",type:u(j),clearable:"",to:"body","is-date-disabled":x,"is-time-disabled":A,valueFormat:u(D),"formatted-value":u(M),"onUpdate:formatted-value":t[1]||(t[1]=e=>o(M)?M.value=e:null)},null,8,["type","valueFormat","formatted-value"])):p("v-if",!0)]))}});export{w as default};
|
package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts
CHANGED
|
@@ -50,7 +50,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
50
50
|
value: string;
|
|
51
51
|
}[]>;
|
|
52
52
|
presetValCp: import("vue").WritableComputedRef<string>;
|
|
53
|
-
initMounted: () => void;
|
|
54
53
|
handleChange: (val: any, type: 'start' | 'end') => void;
|
|
55
54
|
isStartDateDisabled: (ts: number) => boolean;
|
|
56
55
|
timeStartDisabled: (ts: number) => {
|
package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as a,computed as l,watch as t,
|
|
1
|
+
import{defineComponent as e,ref as a,computed as l,watch as t,openBlock as u,createElementBlock as r,createVNode as i,unref as d,isRef as o,withCtx as s,toDisplayString as v,createCommentVNode as n}from"vue";import{NSelect as m,NPopover as p}from"naive-ui";import f from"../../../../../date-picker/index.js";import c from"moment";import{isString as y}from"lodash-es";import{WidgetOptionEnums as b,WidgetTypeEnums as g,WidgetValEnums as T}from"../../../types/enums.js";import{WidgetDateOptionEnums as h}from"../../render-widget/helpers/enums.js";import{widgetDateValOptions as D}from"../../render-widget/helpers/dateExtraMap.js";import{dateDisabledCollect as M,isStartDateRangeDisabled as E,isTimeStartRangeDisabled as _,isEndDateRangeDisabled as w,isTimeEndRangeDisabled as A}from"../../render-widget/helpers/dateDisabled.js";const V={style:{display:"flex"}},Y={key:0,style:{display:"flex"}},k={key:0},x={key:0};var C=e({__name:"DateRange",props:{paramCfg:{type:Object,default:null},modelValue:{type:[String,Number,Array],default:null},presetVal:{type:String,default:null}},emits:["update:modelValue","update:presetVal"],setup(e,{emit:C}){const U=e,j=a(),F=a(),O=l((()=>{let e="";switch(H.value){case g.DATE:e="yyyy-MM-dd";break;case g.DATE_TIME:e="yyyy-MM-dd HH:mm:ss"}return e})),S=l((()=>{let e="";switch(H.value){case g.DATE:e="YYYY-MM-DD";break;case g.DATE_TIME:e="YYYY-MM-DD HH:mm:ss"}return e})),H=l((()=>U.paramCfg._rawData.type)),I=l((()=>{var e,a;return null==(a=null==(e=U.paramCfg)?void 0:e._rawData)?void 0:a.optionType})),L=l((()=>I.value===b.PAST_TIME)),$=l((()=>I.value===b.FUTURE_TIME)),R=l((()=>H.value===g.DATE?"初始日期":"初始时间")),N=l((()=>H.value===g.DATE?"截止日期":"截止时间")),G=l((()=>$.value?M.curTime:"00:00:00")),P=l((()=>L.value?M.curTime:"23:59:59")),q=l((()=>j.value?c(j.value).format(S.value):null)),z=l((()=>F.value?c(F.value).format(S.value):null)),B=l((()=>H.value.toLowerCase()||g.DATE.toLowerCase())),J=l((()=>{var e;const a=I.value||b.ALL;if(H.value&&a){const l=`${H.value}_${a}_RANGE`,t=h[l];let u=(null!=(e=D[t])?e:[]).map((e=>({label:e.title,value:e.con})));return u.unshift({label:"自定义输入",value:T.CUSTOM}),u}return[]})),K=l({set(e){C("update:presetVal",e)},get:()=>U.presetVal});function Q(e,a){var l,t;switch(a){case"start":j.value=e;break;case"end":F.value=e}const u=q.value||z.value?`${null!=(l=q.value)?l:""} ~ ${null!=(t=z.value)?t:""}`:"";C("update:modelValue",u)}function W(e){return E(e,I.value,F.value)}function X(e){return _(e,I.value,F.value)}function Z(e){return w(e,I.value,j.value)}function ee(e){return A(e,I.value,j.value)}return t((()=>U.modelValue),(e=>{if(e&&y(e)&&e.includes("~")){const[a,l]=e.split("~");return a.trim()&&(j.value=c(a.trim()).valueOf()),void(l.trim()&&(F.value=c(l.trim()).valueOf()))}j.value=F.value=null}),{immediate:!0}),(e,a)=>(u(),r("div",V,[i(d(m),{style:{width:"120px"},class:"form-item",to:"body",value:d(K),"onUpdate:value":a[0]||(a[0]=e=>o(K)?K.value=e:null),options:d(J)},null,8,["value","options"]),d(K)===d(T).CUSTOM?(u(),r("div",Y,[i(d(p),{trigger:"hover",disabled:!d(q)},{trigger:s((()=>[i(d(f),{type:d(B),"default-time":d(G),clearable:"",to:"body",valueFormat:d(O),placeholder:d(R),value:j.value,"is-date-disabled":W,"is-time-disabled":X,"onUpdate:value":a[1]||(a[1]=e=>Q(e,"start"))},null,8,["type","default-time","valueFormat","placeholder","value"])])),default:s((()=>[d(q)?(u(),r("span",k,v(d(q)),1)):n("v-if",!0)])),_:1},8,["disabled"]),i(d(p),{trigger:"hover",disabled:!d(z)},{trigger:s((()=>[i(d(f),{style:{"margin-left":"5px"},type:d(B),"default-time":d(P),clearable:"",to:"body",valueFormat:d(O),placeholder:d(N),value:F.value,"is-date-disabled":Z,"is-time-disabled":ee,"onUpdate:value":a[2]||(a[2]=e=>Q(e,"end"))},null,8,["type","default-time","valueFormat","placeholder","value"])])),default:s((()=>[d(z)?(u(),r("span",x,v(d(z)),1)):n("v-if",!0)])),_:1},8,["disabled"])])):n("v-if",!0)]))}});export{C as default};
|
|
@@ -46,7 +46,6 @@ declare const Date: import("vue").DefineComponent<{
|
|
|
46
46
|
label: string;
|
|
47
47
|
value: string;
|
|
48
48
|
}[]>;
|
|
49
|
-
initMounted: () => void;
|
|
50
49
|
isDateDisabled: (ts: number) => boolean;
|
|
51
50
|
timeDisabled: (ts: number) => {
|
|
52
51
|
isHourDisabled(hour: number): boolean | undefined;
|
|
@@ -665,7 +664,6 @@ declare const DateRange: import("vue").DefineComponent<{
|
|
|
665
664
|
value: string;
|
|
666
665
|
}[]>;
|
|
667
666
|
presetValCp: import("vue").WritableComputedRef<string>;
|
|
668
|
-
initMounted: () => void;
|
|
669
667
|
handleChange: (val: any, type: "end" | "start") => void;
|
|
670
668
|
isStartDateDisabled: (ts: number) => boolean;
|
|
671
669
|
timeStartDisabled: (ts: number) => {
|
|
@@ -209,7 +209,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
209
209
|
label: string;
|
|
210
210
|
value: string;
|
|
211
211
|
}[]>;
|
|
212
|
-
initMounted: () => void;
|
|
213
212
|
isDateDisabled: (ts: number) => boolean;
|
|
214
213
|
timeDisabled: (ts: number) => {
|
|
215
214
|
isHourDisabled(hour: number): boolean | undefined;
|
|
@@ -828,7 +827,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
828
827
|
value: string;
|
|
829
828
|
}[]>;
|
|
830
829
|
presetValCp: import("vue").WritableComputedRef<string>;
|
|
831
|
-
initMounted: () => void;
|
|
832
830
|
handleChange: (val: any, type: "end" | "start") => void;
|
|
833
831
|
isStartDateDisabled: (ts: number) => boolean;
|
|
834
832
|
timeStartDisabled: (ts: number) => {
|
package/es/components/table-filter/src/components/render-widget/components/DateInner.vue2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as t,computed as a,watch as l,openBlock as u,createElementBlock as
|
|
1
|
+
import{defineComponent as e,ref as t,computed as a,watch as l,openBlock as u,createElementBlock as n,unref as r,createBlock as o,createCommentVNode as i,normalizeClass as d,withCtx as p,createTextVNode as m,toDisplayString as v}from"vue";import{NButton as c}from"naive-ui";import s from"../../../../../date-picker/index.js";import f from"moment";import{isString as y}from"lodash-es";import{WidgetOptionEnums as g}from"../../../types/enums.js";import{dateDisabledCollect as b,setDateDisabled as h,setTimeDisabled as k}from"../helpers/dateDisabled.js";import C from"./DateQuickBtn/index.vue.js";const Y={class:"render-widget-date-range"};var D=e({__name:"DateInner",props:{componentCfg:{type:Object},type:{type:String,default:"date"},clearable:{type:Boolean,default:!1},valueFormat:{type:String,default:"yyyy-MM-dd"},placeholder:{type:String,default:"请输入"},value:{type:String,default:""},unit:{type:String,default:""}},emits:["update:value","update:unit"],setup(e,{emit:D}){const M=e,S=t(),F=t(!1),j=a((()=>{let e="";switch(M.type){case"date":e="YYYY-MM-DD";break;case"datetime":e="YYYY-MM-DD HH:mm:ss"}return e})),T=a((()=>{let e="";switch(M.type){case"date":e="选择日期";break;case"datetime":e="选择时间"}return e})),w=a((()=>M.unit)),_=a((()=>{var e;return null==(e=M.componentCfg)?void 0:e.widgetCfg.optionSetting})),x=a((()=>_.value!==g.SELECT_TIME)),B=a((()=>b.curTime));function E(){x.value&&(F.value=!F.value)}function V(e){D("update:value",e)}function H(e){D("update:unit",e)}function I(e){S.value=e;const t=e?f(e).format(j.value):e;D("update:value",t),D("update:unit","")}function O(e){return h(e,_.value)}function Q(e){return k(e,_.value)}return l((()=>M.value),(e=>{if(e&&y(e))return w.value||(F.value=!0),void(S.value=f(e).valueOf());S.value=null}),{immediate:!0}),x.value||(F.value=!0),(t,a)=>(u(),n("div",Y,[r(x)&&!F.value?(u(),o(C,{key:0,componentCfg:e.componentCfg,type:e.type,dateFormat:r(j),radioValue:r(w),onClickQuickBtn:V,onChangeRadioValue:H},null,8,["componentCfg","type","dateFormat","radioValue"])):i("v-if",!0),r(x)?(u(),o(r(c),{key:1,secondary:"",class:d(F.value?"select-date-right":"select-date-left"),onClick:E},{default:p((()=>[m(v(r(T)),1)])),_:1},8,["class"])):i("v-if",!0),!r(x)||F.value?(u(),o(r(s),{key:2,to:"body",type:e.type,clearable:e.clearable,valueFormat:e.valueFormat,placeholder:e.placeholder,value:S.value,defaultTime:r(B),"is-date-disabled":O,"is-time-disabled":Q,"onUpdate:value":I},null,8,["type","clearable","valueFormat","placeholder","value","defaultTime"])):i("v-if",!0)]))}});export{D as default};
|
package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as a,computed as t,watch as l,openBlock as u,createElementBlock as r,unref as n,createBlock as i,createCommentVNode as d,normalizeClass as o,withCtx as v,createTextVNode as c,toDisplayString as m,createVNode as s,createElementVNode as p}from"vue";import{NButton as f}from"naive-ui";import y from"../../../../../date-picker/index.js";import g from"moment";import{isString as b}from"lodash-es";import{WidgetOptionEnums as h}from"../../../types/enums.js";import{dateDisabledCollect as k,isStartDateRangeDisabled as C,isTimeStartRangeDisabled as F,isEndDateRangeDisabled as M,isTimeEndRangeDisabled as S}from"../helpers/dateDisabled.js";import T from"./DateQuickBtn/index.vue.js";const Y={class:"render-widget-date-range"},D={key:2,class:"date-detail-range"},E=p("span",{class:"divider"},null,-1);var _=e({__name:"DateRangeInner",props:{componentCfg:{type:Object},type:{type:String,default:"date"},clearable:{type:Boolean,default:!1},valueFormat:{type:String,default:"yyyy-MM-dd"},startPlaceholder:{type:String,default:"起始"},endPlaceholder:{type:String,default:"截止"},value:{type:String,default:""},unit:{type:String,default:""}},emits:["update:value","update:unit"],setup(e,{emit:p}){const _=e,j=a(!1),w=a(),P=a(),I=t((()=>_.unit)),U=t((()=>{var e;return null==(e=_.componentCfg)?void 0:e.widgetCfg.optionSetting})),x=t((()=>U.value!==h.SELECT_TIME)),B=t((()=>U.value===h.PAST_TIME)),O=t((()=>U.value===h.FUTURE_TIME)),R=t((()=>{let e="";switch(_.type){case"date":e="YYYY-MM-DD";break;case"datetime":e="YYYY-MM-DD HH:mm:ss"}return e})),V=t((()=>{let e="";switch(_.type){case"date":e="选择日期";break;case"datetime":e="选择时间"}return e})),H=t((()=>O.value?k.curTime:"00:00:00")),Q=t((()=>B.value?k.curTime:"23:59:59"));function $(e){p("update:value",e)}function A(e){p("update:unit",e)}function L(){x.value&&(j.value=!j.value)}function q(e,a){switch(a){case"start":w.value=e;break;case"end":P.value=e}const t=w.value?g(w.value).format(R.value):null,l=P.value?g(P.value).format(R.value):null;p("update:value",t||l?`${null!=t?t:""} ~ ${null!=l?l:""}`:"")}function z(e){return C(e,U.value,P.value)}function G(e){return F(e,U.value,P.value)}function J(e){return M(e,U.value,w.value)}function K(e){return S(e,U.value,w.value)}return l((()=>_.value),(e=>{if(e&&b(e)&&e.includes("~")){I.value||(j.value=!0);const[a,t]=e.split("~");return a.trim()&&(w.value=g(a.trim()).valueOf()),void(t.trim()&&(P.value=g(t.trim()).valueOf()))}w.value=P.value=null,p("update:unit","")}),{immediate:!0}),x.value||(j.value=!0),(a,t)=>(u(),r("div",Y,[n(x)&&!j.value?(u(),i(T,{key:0,componentCfg:e.componentCfg,type:e.type,dateFormat:n(R),radioValue:n(I),onClickQuickBtn:$,onChangeRadioValue:A},null,8,["componentCfg","type","dateFormat","radioValue"])):d("v-if",!0),n(x)?(u(),i(n(f),{key:1,secondary:"",class:o(j.value?"select-date-right":"select-date-left"),onClick:L},{default:v((()=>[c(m(n(V)),1)])),_:1},8,["class"])):d("v-if",!0),d(' default-time="23:59:59" '),!n(x)||j.value?(u(),r("div",D,[s(n(y),{type:e.type,to:"body","default-time":n(H),clearable:e.clearable,valueFormat:e.valueFormat,placeholder:e.startPlaceholder,value:w.value,"is-date-disabled":z,"is-time-disabled":G,"onUpdate:value":t[0]||(t[0]=e=>q(e,"start"))},null,8,["type","default-time","clearable","valueFormat","placeholder","value"]),E,s(n(y),{type:e.type,to:"body","default-time":n(Q),clearable:e.clearable,valueFormat:e.valueFormat,placeholder:e.endPlaceholder,value:P.value,"is-date-disabled":J,"is-time-disabled":K,"onUpdate:value":t[1]||(t[1]=e=>q(e,"end"))},null,8,["type","default-time","clearable","valueFormat","placeholder","value"])])):d("v-if",!0)]))}});export{_ as default};
|
|
1
|
+
import{defineComponent as e,ref as a,computed as t,watch as l,openBlock as u,createElementBlock as r,unref as n,createBlock as i,createCommentVNode as d,normalizeClass as o,withCtx as v,createTextVNode as c,toDisplayString as m,createVNode as s,createElementVNode as p}from"vue";import{NButton as f}from"naive-ui";import y from"../../../../../date-picker/index.js";import g from"moment";import{isString as b}from"lodash-es";import{WidgetOptionEnums as h}from"../../../types/enums.js";import{dateDisabledCollect as k,isStartDateRangeDisabled as C,isTimeStartRangeDisabled as F,isEndDateRangeDisabled as M,isTimeEndRangeDisabled as S}from"../helpers/dateDisabled.js";import T from"./DateQuickBtn/index.vue.js";const Y={class:"render-widget-date-range"},D={key:2,class:"date-detail-range"},E=p("span",{class:"divider"},null,-1);var _=e({__name:"DateRangeInner",props:{componentCfg:{type:Object},type:{type:String,default:"date"},clearable:{type:Boolean,default:!1},valueFormat:{type:String,default:"yyyy-MM-dd"},startPlaceholder:{type:String,default:"起始"},endPlaceholder:{type:String,default:"截止"},value:{type:String,default:""},unit:{type:String,default:""}},emits:["update:value","update:unit"],setup(e,{emit:p}){const _=e,j=a(!1),w=a(),P=a(),I=t((()=>_.unit)),U=t((()=>{var e;return null==(e=_.componentCfg)?void 0:e.widgetCfg.optionSetting})),x=t((()=>U.value!==h.SELECT_TIME)),B=t((()=>U.value===h.PAST_TIME)),O=t((()=>U.value===h.FUTURE_TIME)),R=t((()=>{let e="";switch(_.type){case"date":e="YYYY-MM-DD";break;case"datetime":e="YYYY-MM-DD HH:mm:ss"}return e})),V=t((()=>{let e="";switch(_.type){case"date":e="选择日期";break;case"datetime":e="选择时间"}return e})),H=t((()=>O.value?k.curTime:"00:00:00")),Q=t((()=>B.value?k.curTime:"23:59:59"));function $(e){p("update:value",e)}function A(e){p("update:unit",e)}function L(){x.value&&(j.value=!j.value)}function q(e,a){switch(a){case"start":w.value=e;break;case"end":P.value=e}const t=w.value?g(w.value).format(R.value):null,l=P.value?g(P.value).format(R.value):null;p("update:value",t||l?`${null!=t?t:""} ~ ${null!=l?l:""}`:""),p("update:unit","")}function z(e){return C(e,U.value,P.value)}function G(e){return F(e,U.value,P.value)}function J(e){return M(e,U.value,w.value)}function K(e){return S(e,U.value,w.value)}return l((()=>_.value),(e=>{if(e&&b(e)&&e.includes("~")){I.value||(j.value=!0);const[a,t]=e.split("~");return a.trim()&&(w.value=g(a.trim()).valueOf()),void(t.trim()&&(P.value=g(t.trim()).valueOf()))}w.value=P.value=null,p("update:unit","")}),{immediate:!0}),x.value||(j.value=!0),(a,t)=>(u(),r("div",Y,[n(x)&&!j.value?(u(),i(T,{key:0,componentCfg:e.componentCfg,type:e.type,dateFormat:n(R),radioValue:n(I),onClickQuickBtn:$,onChangeRadioValue:A},null,8,["componentCfg","type","dateFormat","radioValue"])):d("v-if",!0),n(x)?(u(),i(n(f),{key:1,secondary:"",class:o(j.value?"select-date-right":"select-date-left"),onClick:L},{default:v((()=>[c(m(n(V)),1)])),_:1},8,["class"])):d("v-if",!0),d(' default-time="23:59:59" '),!n(x)||j.value?(u(),r("div",D,[s(n(y),{type:e.type,to:"body","default-time":n(H),clearable:e.clearable,valueFormat:e.valueFormat,placeholder:e.startPlaceholder,value:w.value,"is-date-disabled":z,"is-time-disabled":G,"onUpdate:value":t[0]||(t[0]=e=>q(e,"start"))},null,8,["type","default-time","clearable","valueFormat","placeholder","value"]),E,s(n(y),{type:e.type,to:"body","default-time":n(Q),clearable:e.clearable,valueFormat:e.valueFormat,placeholder:e.endPlaceholder,value:P.value,"is-date-disabled":J,"is-time-disabled":K,"onUpdate:value":t[1]||(t[1]=e=>q(e,"end"))},null,8,["type","default-time","clearable","valueFormat","placeholder","value"])])):d("v-if",!0)]))}});export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.1.52-beta.
|
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.1.52-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.52-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.52-beta.
|
|
3
|
+
"version": "3.1.52-beta.23",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"iOS 7",
|
|
64
64
|
"last 3 iOS versions"
|
|
65
65
|
],
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "a8f7d7cdca3113620c2a7b0dbaf062673dfc51cc"
|
|
67
67
|
}
|