@huilian/components-tms 3.0.7 → 3.1.0

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/lib/bundle.esm.js CHANGED
@@ -2121,7 +2121,7 @@ var script$8={props:{column:Object,setFormParams:Function,getConfig:Function,con
2121
2121
  var script$7={props:{column:Object,setFormParams:Function,config:Object,ops:Object,// 请求参数,
2122
2122
  getConfig:Function},components:{Dp:__vue_component__$b},watch:{ops:function(newVal){const ops=newVal;const{key}=this.getConfig(this.column);const v1=ops[key[0]],v2=ops[key[1]],v3=ops[key[2]];if(v1&&v2){this.value=[moment(v1),moment(v2)];if(key[2]){console.log(key[2]);console.log(v3);console.log(key[3]);if(v3==key[3]){this.isHaveValue=true;}else{this.isHaveValue=false;}}else{this.isHaveValue=true;}}else{this.value=[];this.isHaveValue=false;}}},data(){return{trans,visible:false,pickerOptions:{shortcuts:[{text:trans('最近一周'),onClick(picker){const end=new Date();const start=new Date();start.setTime(start.getTime()-3600*1000*24*7);picker.$emit('pick',[start,end]);}},{text:trans('最近一个月'),onClick(picker){const end=new Date();const start=new Date();start.setTime(start.getTime()-3600*1000*24*30);picker.$emit('pick',[start,end]);}},{text:trans('最近三个月'),onClick(picker){const end=new Date();const start=new Date();start.setTime(start.getTime()-3600*1000*24*90);picker.$emit('pick',[start,end]);}}]},value:[],isHaveValue:false};},methods:{updateVisible(){this.visible=!this.visible;},submit(){const{key,rule}=this.getConfig(this.column);const{format,isAuto0059=false}=rule;let f1=format,f2=format;if(isAuto0059){f1='YYYY-MM-DD 00:00:00';f2='YYYY-MM-DD 23:59:59';}if(this.value.length>1){const v1=moment(this.value[0]).format(f1);const v2=moment(this.value[1]).format(f2);console.log(key);if(key[2]&&key[3]){const v3=key[3];this.setFormParams({[key[0]]:v1,[key[1]]:v2,[key[2]]:v3});}else{this.setFormParams({[key[0]]:v1,[key[1]]:v2});}}this.visible=false;},reset(){this.value=[];}}};/* script */const __vue_script__$7=script$7;/* template */var __vue_render__$7=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("span",[_c("el-popover",{attrs:{placement:"bottom",width:"425",trigger:"manual","popper-class":"pointRecord"},model:{value:_vm.visible,callback:function($$v){_vm.visible=$$v;},expression:"visible"}},[_c("div",{attrs:{"data-name":_vm.column.columnPropertyName}},[_c("el-date-picker",{staticStyle:{"margin-bottom":"10px"},attrs:{type:"datetimerange",align:"right","unlink-panels":"","range-separator":_vm.trans("至"),"start-placeholder":_vm.trans("开始日期"),"end-placeholder":_vm.trans("结束日期"),"picker-options":_vm.pickerOptions},model:{value:_vm.value,callback:function($$v){_vm.value=$$v;},expression:"value"}}),_vm._v(" "),_c("el-button",{attrs:{size:"mini"},on:{click:_vm.reset}},[_vm._v(_vm._s(_vm.trans("重置")))]),_vm._v(" "),_c("el-button",{attrs:{type:"success",size:"mini"},on:{click:_vm.submit}},[_vm._v(_vm._s(_vm.trans("确定")))])],1),_vm._v(" "),_c("dp",{attrs:{slot:"reference",value:_vm.isHaveValue,visible:_vm.visible},on:{"update-visible":_vm.updateVisible},slot:"reference"})],1)],1);};var __vue_staticRenderFns__$7=[];__vue_render__$7._withStripped=true;/* style */const __vue_inject_styles__$7=undefined;/* scoped */const __vue_scope_id__$7=undefined;/* module identifier */const __vue_module_identifier__$7=undefined;/* functional template */const __vue_is_functional_template__$7=false;/* style inject */ /* style inject SSR */ /* style inject shadow dom */const __vue_component__$7=/*#__PURE__*/normalizeComponent({render:__vue_render__$7,staticRenderFns:__vue_staticRenderFns__$7},__vue_inject_styles__$7,__vue_script__$7,__vue_scope_id__$7,__vue_is_functional_template__$7,__vue_module_identifier__$7,false,undefined,undefined,undefined);//
2123
2123
  var script$6={props:{setFormParams:Function,column:Object,ops:Object,// 请求参数
2124
- getConfig:Function},components:{Dp:__vue_component__$b},watch:{ops:function(newVal,old){const{key}=this.getConfig(this.column);const ops=newVal;this.value=ops[key]||'';}},data(){return{trans,visible:false,value:'',ruleCorrespond:''};},mounted(){const{ruleCorrespond}=this.getConfig(this.column);this.ruleCorrespond=ruleCorrespond;},methods:{querySearch(queryString,cb){return this.ruleCorrespond(queryString,cb);},submit(){const{key}=this.getConfig(this.column);this.setFormParams({[key]:this.value});this.visible=false;},reset(){this.value='';}}};/* script */const __vue_script__$6=script$6;/* template */var __vue_render__$6=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("span",[_c("el-popover",{attrs:{placement:"bottom",width:"100%",trigger:"click","popper-class":"pointRecord"},model:{value:_vm.visible,callback:function($$v){_vm.visible=$$v;},expression:"visible"}},[_c("div",{attrs:{"data-name":_vm.column.columnPropertyName}},[!_vm.ruleCorrespond?_c("el-input",{staticStyle:{"margin-bottom":"10px"},model:{value:_vm.value,callback:function($$v){_vm.value=$$v;},expression:"value"}}):_c("el-autocomplete",{attrs:{"fetch-suggestions":_vm.ruleCorrespond,placeholder:"请输入内容"},model:{value:_vm.value,callback:function($$v){_vm.value=$$v;},expression:"value"}}),_vm._v(" "),_c("el-button",{attrs:{size:"mini"},on:{click:_vm.reset}},[_vm._v(_vm._s(_vm.trans("重置")))]),_vm._v(" "),_c("el-button",{attrs:{type:"success",size:"mini"},on:{click:_vm.submit}},[_vm._v(_vm._s(_vm.trans("确定")))])],1),_vm._v(" "),_c("dp",{attrs:{slot:"reference",value:_vm.value},slot:"reference"})],1)],1);};var __vue_staticRenderFns__$6=[];__vue_render__$6._withStripped=true;/* style */const __vue_inject_styles__$6=undefined;/* scoped */const __vue_scope_id__$6=undefined;/* module identifier */const __vue_module_identifier__$6=undefined;/* functional template */const __vue_is_functional_template__$6=false;/* style inject */ /* style inject SSR */ /* style inject shadow dom */const __vue_component__$6=/*#__PURE__*/normalizeComponent({render:__vue_render__$6,staticRenderFns:__vue_staticRenderFns__$6},__vue_inject_styles__$6,__vue_script__$6,__vue_scope_id__$6,__vue_is_functional_template__$6,__vue_module_identifier__$6,false,undefined,undefined,undefined);//
2124
+ getConfig:Function},components:{Dp:__vue_component__$b},watch:{ops:function(newVal,old){const{key}=this.getConfig(this.column);const ops=newVal;this.value=ops[key]||'';}},data(){return{trans,visible:false,value:'',ruleCorrespond:'',isHaveFn:false};},mounted(){const{ruleCorrespond,userFn}=this.getConfig(this.column);this.isHaveFn=!!userFn;this.ruleCorrespond=ruleCorrespond;},methods:{querySearch(queryString,cb){return this.ruleCorrespond(queryString,cb);},submit(){const{key}=this.getConfig(this.column);this.setFormParams({[key]:this.value});this.visible=false;},reset(){this.value='';}}};/* script */const __vue_script__$6=script$6;/* template */var __vue_render__$6=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("span",[_c("el-popover",{attrs:{placement:"bottom",width:"100%",trigger:"click","popper-class":"pointRecord"},model:{value:_vm.visible,callback:function($$v){_vm.visible=$$v;},expression:"visible"}},[_c("div",{attrs:{"data-name":_vm.column.columnPropertyName}},[_vm._v("\n "+_vm._s(_vm.isHaveFn)+"\n "),!_vm.isHaveFn?_c("el-input",{staticStyle:{"margin-bottom":"10px"},model:{value:_vm.value,callback:function($$v){_vm.value=$$v;},expression:"value"}}):_c("el-autocomplete",{attrs:{"fetch-suggestions":_vm.querySearch,placeholder:"请输入内容"},model:{value:_vm.value,callback:function($$v){_vm.value=$$v;},expression:"value"}}),_vm._v(" "),_c("el-button",{attrs:{size:"mini"},on:{click:_vm.reset}},[_vm._v(_vm._s(_vm.trans("重置")))]),_vm._v(" "),_c("el-button",{attrs:{type:"success",size:"mini"},on:{click:_vm.submit}},[_vm._v(_vm._s(_vm.trans("确定")))])],1),_vm._v(" "),_c("dp",{attrs:{slot:"reference",value:_vm.value},slot:"reference"})],1)],1);};var __vue_staticRenderFns__$6=[];__vue_render__$6._withStripped=true;/* style */const __vue_inject_styles__$6=undefined;/* scoped */const __vue_scope_id__$6=undefined;/* module identifier */const __vue_module_identifier__$6=undefined;/* functional template */const __vue_is_functional_template__$6=false;/* style inject */ /* style inject SSR */ /* style inject shadow dom */const __vue_component__$6=/*#__PURE__*/normalizeComponent({render:__vue_render__$6,staticRenderFns:__vue_staticRenderFns__$6},__vue_inject_styles__$6,__vue_script__$6,__vue_scope_id__$6,__vue_is_functional_template__$6,__vue_module_identifier__$6,false,undefined,undefined,undefined);//
2125
2125
  //
2126
2126
  //
2127
2127
  //
@@ -2187,7 +2187,7 @@ let lan={'zh':'zh_CN','en':'en_US','cht':'zh_HK'};let language=window.localStora
2187
2187
  if(tableConfig&&initType=='api'&&initData&&tableConfig[initData]){// 走字典配置逻辑
2188
2188
  option=[];let arr=Object.keys(tableConfig[initData]);option=arr.map(i=>{return{label:tableConfig[initData][i],value:i};});}else{option=configPaperFn(item)||[];// 走老配置,文本栏里写死的数据
2189
2189
  }if(!['selectsp','inputsp'].includes(type)){// selectsp inputsp 特殊处理
2190
- option=ruleCorrespond(option);}return{option,key,columnProperty,columnPropertyName,type,rule,ruleCorrespond};};const formatTable={'check':{valueToStr:(val,{option})=>{const str=val.map(i=>{const s=option.find(r=>r.value===i);if(s&&s.label){return s.label;}return val;});return str;},formToValue:val=>{return val.split(',');}},'radio':{valueToStr:(val,{option})=>{const str=option.find(r=>r.value===val);if(str&&str.label){return str.label;}return val;},formToValue:val=>{return val;}},'inputsp':{valueToStr:val=>{return val;},formToValue:val=>{return val;}},'selectsp':{valueToStr:val=>{return val;},formToValue:val=>{return val.split(',');}},'date':{valueToStr:(val,{rule})=>{const{format}=rule;return`${moment(val).format(format)}`;},formToValue:val=>{return moment(val);}},'dateRange':{valueToStr:(val,{rule})=>{const{format,isAuto0059=false}=rule;let f1=format,f2=format;if(isAuto0059){f1='YYYY-MM-DD 00:00:00';f2='YYYY-MM-DD 23:59:59';}let v1=val[0]?moment(val[0]).format(f1):'';let v2=val[1]?moment(val[1]).format(f2):'';const str=`${v1}${trans('至')}${v2}`;return str;},formToValue:(val,keys)=>{return[val[keys[0]],val[keys[1]]];}},'inputScope':{valueToStr:val=>{const v1=val[0];const v2=val[1];const str=`${v1}${trans('至')}${v2}`;return str;},formToValue:(val,keys)=>{return[val[keys[0]],val[keys[1]]];}}};const formToValue=(formValues,columnsShow,callbackFn,ruleFn)=>{const tagNeedCols={};for(let key in formValues){// 过滤不相关key
2190
+ option=ruleCorrespond(option);}return{option,key,columnProperty,columnPropertyName,type,rule,ruleCorrespond,userFn:ruleFn[columnProperty]};};const formatTable={'check':{valueToStr:(val,{option})=>{const str=val.map(i=>{const s=option.find(r=>r.value===i);if(s&&s.label){return s.label;}return val;});return str;},formToValue:val=>{return val.split(',');}},'radio':{valueToStr:(val,{option})=>{const str=option.find(r=>r.value===val);if(str&&str.label){return str.label;}return val;},formToValue:val=>{return val;}},'inputsp':{valueToStr:val=>{return val;},formToValue:val=>{return val;}},'selectsp':{valueToStr:val=>{return val;},formToValue:val=>{return val.split(',');}},'date':{valueToStr:(val,{rule})=>{const{format}=rule;return`${moment(val).format(format)}`;},formToValue:val=>{return moment(val);}},'dateRange':{valueToStr:(val,{rule})=>{const{format,isAuto0059=false}=rule;let f1=format,f2=format;if(isAuto0059){f1='YYYY-MM-DD 00:00:00';f2='YYYY-MM-DD 23:59:59';}let v1=val[0]?moment(val[0]).format(f1):'';let v2=val[1]?moment(val[1]).format(f2):'';const str=`${v1}${trans('至')}${v2}`;return str;},formToValue:(val,keys)=>{return[val[keys[0]],val[keys[1]]];}},'inputScope':{valueToStr:val=>{const v1=val[0];const v2=val[1];const str=`${v1}${trans('至')}${v2}`;return str;},formToValue:(val,keys)=>{return[val[keys[0]],val[keys[1]]];}}};const formToValue=(formValues,columnsShow,callbackFn,ruleFn)=>{const tagNeedCols={};for(let key in formValues){// 过滤不相关key
2191
2191
  const filterKey=['pageSize','skipCount','keywords'];if(!filterKey.includes(key)){// 找到在columns里对照searchKey的rule,方便form转换value
2192
2192
  let searchKey='';const haveSearchCol=columnsShow.filter(i=>i.queryConfig);const findRes=haveSearchCol.find(i=>{let ruleType='';const{columnProperty,queryConfig:{type,rule}}=i;searchKey=columnProperty;ruleType=Object.prototype.toString.call(rule);if(ruleType!=='[object Array]'){searchKey=rule.searchKey||columnProperty;}// dateRange 数据比较特殊 searchKey = [xxStart,xxEnd]
2193
2193
  if(type==='dateRange'||type==='date'||type==='inputScope'){return searchKey.includes(key);}return searchKey===key;});// 找到对应请求key 进行画tag处理
@@ -2564,4 +2564,4 @@ var myUrl=URL.createObjectURL(myBlob);// 创建a标签,下载图片
2564
2564
  this.downImg(myUrl);},//base64 转 blob
2565
2565
  dataURLtoBlob(dataurl){var arr=dataurl.split(',');var mime=arr[0].match(/:(.*?);/)[1];var bstr=atob(arr[1]),n=bstr.length,u8arr=new Uint8Array(n);while(n--){u8arr[n]=bstr.charCodeAt(n);}return new Blob([u8arr],{type:mime});},//下载图片 filename是图片名称
2566
2566
  downImg(url){// 创建a标签 并设置其相关属性,最后触发其点击事件
2567
- let a=document.createElement("a");let clickEvent=document.createEvent("MouseEvents");a.setAttribute("href",url);a.setAttribute("download",this.fileName);a.setAttribute("target",'_blank');clickEvent.initEvent('click',true,true);a.dispatchEvent(clickEvent);}}};/* script */const __vue_script__=script;/* template */var __vue_render__=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("div",{staticClass:"HtmlToImg"},[_c("div",{staticStyle:{position:"absolute",top:"-3000px"}},[_vm._t("default")],2)]);};var __vue_staticRenderFns__=[];__vue_render__._withStripped=true;/* style */const __vue_inject_styles__=undefined;/* scoped */const __vue_scope_id__=undefined;/* module identifier */const __vue_module_identifier__=undefined;/* functional template */const __vue_is_functional_template__=false;/* style inject */ /* style inject SSR */ /* style inject shadow dom */const __vue_component__=/*#__PURE__*/normalizeComponent({render:__vue_render__,staticRenderFns:__vue_staticRenderFns__},__vue_inject_styles__,__vue_script__,__vue_scope_id__,__vue_is_functional_template__,__vue_module_identifier__,false,undefined,undefined,undefined);__vue_component__.install=function(Vue){Vue.component(__vue_component__.name,__vue_component__);};var version="3.0.7";const components=[__vue_component__$g,__vue_component__$f,__vue_component__$e,__vue_component__$d,__vue_component__$1,__vue_component__];const install=function(Vue){components.forEach(component=>{Vue.component(component.name,component);});};if(typeof window!=="undefined"&&window.Vue){install(window.Vue);}var index={version,install};export{__vue_component__$1 as FormTableScheme,__vue_component__$f as HelloVue,__vue_component__ as HtmlToImg,__vue_component__$g as MyButton,__vue_component__$d as ShowFile,__vue_component__$e as UploadFile,index as default,install};
2567
+ let a=document.createElement("a");let clickEvent=document.createEvent("MouseEvents");a.setAttribute("href",url);a.setAttribute("download",this.fileName);a.setAttribute("target",'_blank');clickEvent.initEvent('click',true,true);a.dispatchEvent(clickEvent);}}};/* script */const __vue_script__=script;/* template */var __vue_render__=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("div",{staticClass:"HtmlToImg"},[_c("div",{staticStyle:{position:"absolute",top:"-3000px"}},[_vm._t("default")],2)]);};var __vue_staticRenderFns__=[];__vue_render__._withStripped=true;/* style */const __vue_inject_styles__=undefined;/* scoped */const __vue_scope_id__=undefined;/* module identifier */const __vue_module_identifier__=undefined;/* functional template */const __vue_is_functional_template__=false;/* style inject */ /* style inject SSR */ /* style inject shadow dom */const __vue_component__=/*#__PURE__*/normalizeComponent({render:__vue_render__,staticRenderFns:__vue_staticRenderFns__},__vue_inject_styles__,__vue_script__,__vue_scope_id__,__vue_is_functional_template__,__vue_module_identifier__,false,undefined,undefined,undefined);__vue_component__.install=function(Vue){Vue.component(__vue_component__.name,__vue_component__);};var version="3.1.0";const components=[__vue_component__$g,__vue_component__$f,__vue_component__$e,__vue_component__$d,__vue_component__$1,__vue_component__];const install=function(Vue){components.forEach(component=>{Vue.component(component.name,component);});};if(typeof window!=="undefined"&&window.Vue){install(window.Vue);}var index={version,install};export{__vue_component__$1 as FormTableScheme,__vue_component__$f as HelloVue,__vue_component__ as HtmlToImg,__vue_component__$g as MyButton,__vue_component__$d as ShowFile,__vue_component__$e as UploadFile,index as default,install};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huilian/components-tms",
3
- "version": "3.0.7",
3
+ "version": "3.1.0",
4
4
  "scripts": {
5
5
  "dev": "npx rollup -wc rollup.config.dev.js",
6
6
  "build": "npx rollup -c rollup.config.js && npm run build:types",