@huilian/components-tms 3.1.7 → 3.1.8

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
@@ -2119,7 +2119,7 @@ getConfig:Function,ruleFn:Function},components:{Dp:__vue_component__$b},watch:{o
2119
2119
  var script$8={props:{column:Object,setFormParams:Function,getConfig:Function,config:{type:Object,default:()=>{return{rule:{type:'date'}};}},ops:Object// 请求参数
2120
2120
  },components:{Dp:__vue_component__$b},watch:{ops:function(newVal){const{key}=this.getConfig(this.column);const ops=newVal;if(ops[key]){this.value=moment(ops[key]);}else{this.value='';}}},data(){return{trans,visible:false,value:''};},methods:{submit(){const{rule,key}=this.getConfig(this.column);const{format}=rule;if(this.value){const str=`${moment(this.value).format(format)}`;this.setFormParams({[key]:str});this.visible=false;}},reset(){this.value='';}}};/* script */const __vue_script__$8=script$8;/* template */var __vue_render__$8=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("span",[_c("el-popover",{attrs:{placement:"bottom",width:"400",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}},[_c("el-date-picker",{staticStyle:{"margin-bottom":"10px"},attrs:{type:_vm.config.rule.type,align:"right","unlink-panels":"","range-separator":_vm.trans("至"),"start-placeholder":_vm.trans("开始日期"),"end-placeholder":_vm.trans("结束日期")},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:"primary",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__$8=[];__vue_render__$8._withStripped=true;/* style */const __vue_inject_styles__$8=undefined;/* scoped */const __vue_scope_id__$8=undefined;/* module identifier */const __vue_module_identifier__$8=undefined;/* functional template */const __vue_is_functional_template__$8=false;/* style inject */ /* style inject SSR */ /* style inject shadow dom */const __vue_component__$8=/*#__PURE__*/normalizeComponent({render:__vue_render__$8,staticRenderFns:__vue_staticRenderFns__$8},__vue_inject_styles__$8,__vue_script__$8,__vue_scope_id__$8,__vue_is_functional_template__$8,__vue_module_identifier__$8,false,undefined,undefined,undefined);//
2121
2121
  var script$7={props:{column:Object,setFormParams:Function,config:Object,ops:Object,// 请求参数,
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:"primary",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);//
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]){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:"primary",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
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.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:"primary",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
  //
@@ -2192,7 +2192,7 @@ option=[];let arr=Object.keys(tableConfig[initData]);option=arr.map(i=>{return{l
2192
2192
  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
2193
2193
  const filterKey=['pageSize','skipCount','keywords'];if(!filterKey.includes(key)){// 找到在columns里对照searchKey的rule,方便form转换value
2194
2194
  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;}if(type==='date'||type==='inputScope'){return searchKey.includes(key);}// dateRange 数据比较特殊 searchKey = [xxStart,xxEnd]
2195
- if(type==='dateRange'&&searchKey.length>2){let findIndex=searchKey.findIndex(i=>i.includes(formValues[key]));if(findIndex==3){return true;}}else if(type==='dateRange'){return searchKey.includes(key);}return searchKey===key;});// 找到对应请求key 进行画tag处理
2195
+ let searchKeyType=Object.prototype.toString.call(searchKey)=='[object Array]';if(type==='dateRange'&&searchKey.length>2&&searchKeyType){let findIndex=searchKey.findIndex(i=>i.includes(formValues[key]));if(findIndex==3){return true;}}else if(type==='dateRange'){return searchKey.includes(key);}return searchKey===key;});// 找到对应请求key 进行画tag处理
2196
2196
  if(findRes&&findRes.isQuery){let config=getOptions(findRes,ruleFn);let{type,columnPropertyName}=config;// let { columnPropertyName, columnProperty, queryConfig: { type, rule } } = findRes;
2197
2197
  // let ruleType = Object.prototype.toString.call(rule)
2198
2198
  // let newRule = ruleType !== '[object Array]' ? rule.option : rule
@@ -2566,4 +2566,4 @@ var myUrl=URL.createObjectURL(myBlob);// 创建a标签,下载图片
2566
2566
  this.downImg(myUrl);},//base64 转 blob
2567
2567
  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是图片名称
2568
2568
  downImg(url){// 创建a标签 并设置其相关属性,最后触发其点击事件
2569
- 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.6";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};
2569
+ 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.8";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.1.7",
3
+ "version": "3.1.8",
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",