@huilian/components-tms 3.7.11 → 3.7.12
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 +4 -3
- package/package.json +1 -1
package/lib/bundle.esm.js
CHANGED
|
@@ -2170,7 +2170,8 @@ var script$c={props:{column:Object,setFormParams:Function,getConfig:Function,con
|
|
|
2170
2170
|
var script$b={props:{column:Object,setFormParams:Function,config:Object,ops:Object,// 请求参数,
|
|
2171
2171
|
getConfig:Function},components:{Dp:__vue_component__$f},watch:{ops:function(newVal){const ops=newVal;const{key}=this.getConfig(this.column);// 处理 key 只有一个值的情况
|
|
2172
2172
|
if(key.length===1){const v=ops[key[0]];this.value=v?v:[];this.isHaveValue=!!v;return;}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,pickerType:'datetimerange',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);// 当 key 只有一个值时,直接使用 searchkey 赋值,不使用 format
|
|
2173
|
-
if(key.length===1){
|
|
2173
|
+
if(key.length===1){// 如果是数组,用逗号拼接并格式化
|
|
2174
|
+
if(Array.isArray(this.value)&&this.value.length>0){const{format}=rule;const formattedValues=this.value.map(v=>moment(v).format(format));this.setFormParams({[key[0]]:formattedValues.join(',')});}else{this.setFormParams({[key[0]]:moment(this.value).format(format)});}this.visible=false;return;}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=[];}},mounted(){/**
|
|
2174
2175
|
* 初始化选择器类型,默认 'datetimerange',可通过 rule.type 覆盖
|
|
2175
2176
|
*/const{rule}=this.getConfig(this.column);this.pickerType=rule&&rule.type?rule.type:'datetimerange';}};/* script */const __vue_script__$b=script$b;/* template */var __vue_render__$b=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",width:"100%"},attrs:{type:_vm.pickerType,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__$b=[];__vue_render__$b._withStripped=true;/* style */const __vue_inject_styles__$b=undefined;/* scoped */const __vue_scope_id__$b=undefined;/* module identifier */const __vue_module_identifier__$b=undefined;/* functional template */const __vue_is_functional_template__$b=false;/* style inject */ /* style inject SSR */ /* style inject shadow dom */const __vue_component__$b=/*#__PURE__*/normalizeComponent({render:__vue_render__$b,staticRenderFns:__vue_staticRenderFns__$b},__vue_inject_styles__$b,__vue_script__$b,__vue_scope_id__$b,__vue_is_functional_template__$b,__vue_module_identifier__$b,false,undefined,undefined,undefined);//
|
|
2176
2177
|
var script$a={props:{setFormParams:Function,column:Object,ops:Object,// 请求参数
|
|
@@ -2266,7 +2267,7 @@ option=ruleCorrespond(option);}return{option,key,columnProperty,columnPropertyNa
|
|
|
2266
2267
|
* 若当前选项列表不可用,回退使用 sessionStorage 缓存(按 columnCode/searchKey 存储)
|
|
2267
2268
|
*/valueToStr:(val,{option=[],key,columnCode})=>{const mapLabel=v=>{// 优先使用当前 option 列表
|
|
2268
2269
|
let find=option.find(r=>r.value===v||r.schemeValue===v);if(find){return find.label!==undefined?find.label:find.schemeLabel;}const label=cache.getLabel(key,columnCode,v);if(label!==undefined){return label;}// 最后保底返回原值
|
|
2269
|
-
return v;};if(Array.isArray(val)){return val.map(v=>mapLabel(v));}return mapLabel(val);},formToValue:val=>{return val.split(',');}},'cascader':{valueToStr:(val,{option,rule})=>{let{componentOriginProps}=rule;let{label,value}=componentOriginProps;let str=findNamesByCodes(val,option,label,value).join(',');return str;},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
|
|
2270
|
+
return v;};if(Array.isArray(val)){return val.map(v=>mapLabel(v));}return mapLabel(val);},formToValue:val=>{return val.split(',');}},'cascader':{valueToStr:(val,{option,rule})=>{let{componentOriginProps}=rule;let{label,value}=componentOriginProps;let str=findNamesByCodes(val,option,label,value).join(',');return str;},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,key})=>{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(key.length===1){return`${val}`;}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
|
|
2270
2271
|
const filterKey=['pageSize','skipCount','keywords'];if(!filterKey.includes(key)){// 找到在columns里对照searchKey的rule,方便form转换value
|
|
2271
2272
|
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]
|
|
2272
2273
|
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处理
|
|
@@ -2768,4 +2769,4 @@ for(let i=0;i<rows;i++){for(let j=0;j<cols;j++){watermarks.push({svg:`
|
|
|
2768
2769
|
<text transform="translate(10,200) rotate(-45)" font-weight="bold" fill="#f5f5f5" style="font-size: 16px;opacity:0.7;">${text}</text>
|
|
2769
2770
|
</svg>
|
|
2770
2771
|
`,// absolutePosition: { x: 0, y: -100 }
|
|
2771
|
-
absolutePosition:{x:j*(pageWidth/(cols-0.5)),y:i*(pageHeight/(rows-0.5))-100}});}}return watermarks;}}};/* 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",{attrs:{id:"DataToPdfBox"}},[_c("el-dialog",{attrs:{title:_vm.dialogParams.title,visible:_vm.visible,width:_vm.dialogParams.width,"close-on-click-modal":false,"before-close":_vm.cancel},on:{"update:visible":function($event){_vm.visible=$event;}}},[_vm._t("html"),_vm._v(" "),_c("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[_c("el-button",{attrs:{loading:_vm.isSubmitLoading},on:{click:_vm.submit}},[_vm._v(_vm._s(_vm.dialogParams.buttonText))])],1)],2)],1);};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.7.
|
|
2772
|
+
absolutePosition:{x:j*(pageWidth/(cols-0.5)),y:i*(pageHeight/(rows-0.5))-100}});}}return watermarks;}}};/* 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",{attrs:{id:"DataToPdfBox"}},[_c("el-dialog",{attrs:{title:_vm.dialogParams.title,visible:_vm.visible,width:_vm.dialogParams.width,"close-on-click-modal":false,"before-close":_vm.cancel},on:{"update:visible":function($event){_vm.visible=$event;}}},[_vm._t("html"),_vm._v(" "),_c("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[_c("el-button",{attrs:{loading:_vm.isSubmitLoading},on:{click:_vm.submit}},[_vm._v(_vm._s(_vm.dialogParams.buttonText))])],1)],2)],1);};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.7.12";const components=[__vue_component__$k,__vue_component__$j,__vue_component__$i,__vue_component__$h,__vue_component__$4,__vue_component__$3,__vue_component__$2,__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__ as DataToPdf,__vue_component__$2 as ExportList,__vue_component__$4 as FormTableScheme,__vue_component__$j as HelloVue,__vue_component__$3 as HtmlToImg,__vue_component__$k as MyButton,__vue_component__$h as ShowFile,__vue_component__$1 as StandardImport,__vue_component__$i as UploadFile,index as default,install};
|