@huilian/components-tms 3.5.4 → 3.7.1

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.
Files changed (2) hide show
  1. package/lib/bundle.esm.js +23 -9
  2. package/package.json +1 -1
package/lib/bundle.esm.js CHANGED
@@ -2202,9 +2202,11 @@ getConfig:Function},components:{Dp:__vue_component__$e,Scope:__vue_component__$7
2202
2202
  */function getLabel(searchKey,columnCode,value){const data=load();const bucket=data[columnCode]&&data[columnCode][searchKey]||{};return bucket[value];}var cache={setLabel,getLabel,mergeFromList};//
2203
2203
  var script$5={props:{config:Object,setFormParams:Function,column:Object,ops:Object,// 请求参数
2204
2204
  getConfig:Function},components:{Dp:__vue_component__$e},watch:{ops:function(newVal,old){const key=this.key;const ops=newVal;if(ops[key]){this.value=ops[key].split(',');// 约定 基本上check类型的值都是、分割的字符串
2205
- }else{this.value=[];}}},mounted(){let{key,ruleCorrespond,rule,columnCode}=this.getConfig(this.column);this.key=key;this.columnCode=columnCode;if(rule.limit){this.limit=rule.limit;}this.ruleCorrespond=ruleCorrespond;},data(){return{trans,visible:false,limit:50,asyncList:[],value:[],ruleCorrespond:'',key:'',columnCode:''};},methods:{fnClick(res){this.ruleCorrespond(res);},/**
2205
+ }else{this.value=[];}}},mounted(){let{key,ruleCorrespond,rule,columnCode}=this.getConfig(this.column);this.key=key;this.columnCode=columnCode;if(rule.limit){this.limit=rule.limit;}this.ruleCorrespond=ruleCorrespond;},data(){return{trans,visible:false,limit:50,asyncList:[],value:[],ruleCorrespond:'',key:'',columnCode:'',optionCache:{}};},methods:{/**
2206
+ * 远程检索触发前记录当前选项,用于在列表刷新后仍可获取旧项的 label
2207
+ */fnClick(res){if(Array.isArray(this.asyncList)){this.asyncList.forEach(i=>{const v=i.schemeValue!==undefined?i.schemeValue:i.value;const l=i.schemeLabel!==undefined?i.schemeLabel:i.label;if(v!==undefined&&l!==undefined){this.optionCache[v]=l;}});}this.ruleCorrespond(res);},/**
2206
2208
  * 提交选中值,并缓存 value→label 映射用于后续标签展示
2207
- */submit(){const key=this.key;try{cache.mergeFromList(key,this.columnCode,this.asyncList);if(Array.isArray(this.value)){this.value.forEach(v=>{const find=Array.isArray(this.asyncList)?this.asyncList.find(i=>i.schemeValue===v||i.value===v):null;const l=find?find.schemeLabel||find.label:undefined;if(l!==undefined){cache.setLabel(key,this.columnCode,v,l);}});}}catch(e){}this.setFormParams({[key]:this.value.join(',')});this.visible=false;},reset(){this.value=[];}}};/* script */const __vue_script__$5=script$5;/* template */var __vue_render__$5=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}},[_c("el-select",{staticStyle:{width:"100%","margin-bottom":"10px"},attrs:{filterable:"",clearable:"",remote:"",multiple:"","multiple-limit":_vm.limit,"reserve-keyword":"",placeholder:_vm.trans("请选择"),"remote-method":_vm.fnClick},on:{focus:function($event){return _vm.fnClick("");}},model:{value:_vm.value,callback:function($$v){_vm.value=$$v;},expression:"value"}},_vm._l(_vm.asyncList,function(item){return _c("el-option",{key:""+item.schemeKey,attrs:{label:""+item.schemeLabel,value:item.schemeValue}});}),1),_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__$5=[];__vue_render__$5._withStripped=true;/* style */const __vue_inject_styles__$5=undefined;/* scoped */const __vue_scope_id__$5=undefined;/* module identifier */const __vue_module_identifier__$5=undefined;/* functional template */const __vue_is_functional_template__$5=false;/* style inject */ /* style inject SSR */ /* style inject shadow dom */const __vue_component__$5=/*#__PURE__*/normalizeComponent({render:__vue_render__$5,staticRenderFns:__vue_staticRenderFns__$5},__vue_inject_styles__$5,__vue_script__$5,__vue_scope_id__$5,__vue_is_functional_template__$5,__vue_module_identifier__$5,false,undefined,undefined,undefined);//
2209
+ */submit(){const key=this.key;try{cache.mergeFromList(key,this.columnCode,this.asyncList);if(Array.isArray(this.value)){this.value.forEach(v=>{const find=Array.isArray(this.asyncList)?this.asyncList.find(i=>i.schemeValue===v||i.value===v):null;const l=find?find.schemeLabel||find.label:this.optionCache[v];if(l!==undefined){cache.setLabel(key,this.columnCode,v,l);}});}}catch(e){}this.setFormParams({[key]:this.value.join(',')});this.visible=false;},reset(){this.value=[];}}};/* script */const __vue_script__$5=script$5;/* template */var __vue_render__$5=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}},[_c("el-select",{staticStyle:{width:"100%","margin-bottom":"10px"},attrs:{filterable:"",clearable:"",remote:"",multiple:"","multiple-limit":_vm.limit,"reserve-keyword":"",placeholder:_vm.trans("请选择"),"remote-method":_vm.fnClick},on:{focus:function($event){return _vm.fnClick("");}},model:{value:_vm.value,callback:function($$v){_vm.value=$$v;},expression:"value"}},_vm._l(_vm.asyncList,function(item){return _c("el-option",{key:item.schemeValue||item.value||item.schemeKey,attrs:{label:item.schemeLabel||item.label,value:item.schemeValue||item.value}});}),1),_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__$5=[];__vue_render__$5._withStripped=true;/* style */const __vue_inject_styles__$5=undefined;/* scoped */const __vue_scope_id__$5=undefined;/* module identifier */const __vue_module_identifier__$5=undefined;/* functional template */const __vue_is_functional_template__$5=false;/* style inject */ /* style inject SSR */ /* style inject shadow dom */const __vue_component__$5=/*#__PURE__*/normalizeComponent({render:__vue_render__$5,staticRenderFns:__vue_staticRenderFns__$5},__vue_inject_styles__$5,__vue_script__$5,__vue_scope_id__$5,__vue_is_functional_template__$5,__vue_module_identifier__$5,false,undefined,undefined,undefined);//
2208
2210
  var script$4={name:"cascader",props:{config:Object,setFormParams:Function,column:Object,ops:Object,// 请求参数
2209
2211
  getConfig:Function},components:{Dp:__vue_component__$e},watch:{ops:function(newVal,old){const key=this.key;const ops=newVal;if(ops[key]){this.value=ops[key].split(",");// 约定 基本上check类型的值都是、分割的字符串
2210
2212
  }else{this.value=[];}},visible:{deep:true,handler(value){if(this.ruleFn&&value){let{option}=this.getConfig(this.column);this.list=option;}}}},mounted(){let{key,option,rule}=this.getConfig(this.column);this.option=option;this.key=key;this.componentOriginProps={...this.componentOriginProps,...rule.componentOriginProps};if(rule.configProps){this.configProps={...this.configProps,...rule.configProps};}},data(){return{trans,visible:false,limit:50,option:[],value:"",ruleCorrespond:"",key:"",multiple:false,componentOriginProps:{label:"a",value:"b",multiple:true,expandTrigger:"hover"},configProps:{filterable:true}};},methods:{fnClick(res){this.ruleCorrespond(res);},submit(){const key=this.key;this.setFormParams({[key]:this.value.join(",")});this.visible=false;},reset(){this.value=[];}}};/* script */const __vue_script__$4=script$4;/* template */var __vue_render__$4=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}},[_c("el-cascader",_vm._b({staticStyle:{width:"300px"},attrs:{clearable:"",placeholder:_vm.trans("请选择"),options:_vm.option,props:_vm.componentOriginProps},model:{value:_vm.value,callback:function($$v){_vm.value=$$v;},expression:"value"}},"el-cascader",_vm.configProps,false)),_vm._v(" "),_c("el-button",{staticClass:"popBtn",attrs:{size:"mini"},on:{click:_vm.reset}},[_vm._v(_vm._s(_vm.trans("重置")))]),_vm._v(" "),_c("el-button",{staticClass:"popBtn",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__$4=[];__vue_render__$4._withStripped=true;/* style */const __vue_inject_styles__$4=function(inject){if(!inject)return;inject("data-v-118f5d90_0",{source:".popBtn[data-v-118f5d90] {\n vertical-align: bottom;\n margin-left: 5px;\n}\n\n/*# sourceMappingURL=Cascader.vue.map */",map:{"version":3,"sources":["/Users/chenlei/HLcode/test/components/FormTableScheme/component/ColHeader/Cascader.vue","Cascader.vue"],"names":[],"mappings":"AAqHA;EACA,sBAAA;EACA,gBAAA;ACpHA;;AAEA,uCAAuC","file":"Cascader.vue","sourcesContent":["<template>\n <span>\n <el-popover\n placement=\"bottom\"\n width=\"100%\"\n trigger=\"click\"\n v-model=\"visible\"\n popper-class=\"pointRecord\"\n >\n <div :data-name=\"column.columnPropertyName\">\n <el-cascader\n style=\"width: 300px\"\n v-model=\"value\"\n clearable\n :placeholder=\"trans('请选择')\"\n :options=\"option\"\n :props=\"componentOriginProps\"\n v-bind=\"configProps\"\n >\n </el-cascader>\n <el-button class=\"popBtn\" size=\"mini\" @click=\"reset\">{{\n trans(\"重置\")\n }}</el-button>\n <el-button class=\"popBtn\" type=\"primary\" size=\"mini\" @click=\"submit\">{{\n trans(\"确定\")\n }}</el-button>\n </div>\n <dp :value=\"value\" slot=\"reference\" />\n </el-popover>\n </span>\n</template>\n<script>\nimport Dp from \"./dp.vue\";\nimport trans from \"../../../lang/trans\";\n\nexport default {\n name: \"cascader\",\n props: {\n config: Object,\n setFormParams: Function,\n column: Object,\n ops: Object, // 请求参数\n getConfig: Function,\n },\n components: { Dp },\n watch: {\n ops: function (newVal, old) {\n const key = this.key;\n const ops = newVal;\n if (ops[key]) {\n this.value = ops[key].split(\",\"); // 约定 基本上check类型的值都是、分割的字符串\n } else {\n this.value = [];\n }\n },\n visible: {\n deep: true,\n handler(value) {\n if (this.ruleFn && value) {\n let { option } = this.getConfig(this.column);\n this.list = option;\n }\n },\n },\n },\n mounted() {\n let { key, option, rule } = this.getConfig(this.column);\n this.option = option;\n this.key = key;\n this.componentOriginProps = {\n ...this.componentOriginProps,\n ...rule.componentOriginProps,\n };\n if (rule.configProps) {\n this.configProps = {\n ...this.configProps,\n ...rule.configProps,\n };\n }\n },\n data() {\n return {\n trans,\n visible: false,\n limit: 50,\n option: [],\n value: \"\",\n ruleCorrespond: \"\",\n key: \"\",\n multiple: false,\n componentOriginProps: {\n label: \"a\",\n value: \"b\",\n multiple: true,\n expandTrigger: \"hover\",\n },\n configProps: {\n filterable: true,\n },\n };\n },\n methods: {\n fnClick(res) {\n this.ruleCorrespond(res);\n },\n submit() {\n const key = this.key;\n this.setFormParams({ [key]: this.value.join(\",\") });\n this.visible = false;\n },\n reset() {\n this.value = [];\n },\n },\n};\n</script>\n<style lang=\"scss\" scoped>\n.popBtn {\n vertical-align: bottom;\n margin-left: 5px;\n}\n</style>",".popBtn {\n vertical-align: bottom;\n margin-left: 5px;\n}\n\n/*# sourceMappingURL=Cascader.vue.map */"]},media:undefined});};/* scoped */const __vue_scope_id__$4="data-v-118f5d90";/* module identifier */const __vue_module_identifier__$4=undefined;/* functional template */const __vue_is_functional_template__$4=false;/* style inject SSR */ /* style inject shadow dom */const __vue_component__$4=/*#__PURE__*/normalizeComponent({render:__vue_render__$4,staticRenderFns:__vue_staticRenderFns__$4},__vue_inject_styles__$4,__vue_script__$4,__vue_scope_id__$4,__vue_is_functional_template__$4,__vue_module_identifier__$4,false,createInjector,undefined,undefined);var has$1=Object.prototype.hasOwnProperty;var hexTable=function(){var array=[];for(var i=0;i<256;++i){array.push('%'+((i<16?'0':'')+i.toString(16)).toUpperCase());}return array;}();var compactQueue=function compactQueue(queue){var obj;while(queue.length){var item=queue.pop();obj=item.obj[item.prop];if(Array.isArray(obj)){var compacted=[];for(var j=0;j<obj.length;++j){if(typeof obj[j]!=='undefined'){compacted.push(obj[j]);}}item.obj[item.prop]=compacted;}}return obj;};var arrayToObject=function arrayToObject(source,options){var obj=options&&options.plainObjects?Object.create(null):{};for(var i=0;i<source.length;++i){if(typeof source[i]!=='undefined'){obj[i]=source[i];}}return obj;};var merge=function merge(target,source,options){if(!source){return target;}if(typeof source!=='object'){if(Array.isArray(target)){target.push(source);}else if(target&&typeof target==='object'){if(options&&(options.plainObjects||options.allowPrototypes)||!has$1.call(Object.prototype,source)){target[source]=true;}}else{return[target,source];}return target;}if(!target||typeof target!=='object'){return[target].concat(source);}var mergeTarget=target;if(Array.isArray(target)&&!Array.isArray(source)){mergeTarget=arrayToObject(target,options);}if(Array.isArray(target)&&Array.isArray(source)){source.forEach(function(item,i){if(has$1.call(target,i)){var targetItem=target[i];if(targetItem&&typeof targetItem==='object'&&item&&typeof item==='object'){target[i]=merge(targetItem,item,options);}else{target.push(item);}}else{target[i]=item;}});return target;}return Object.keys(source).reduce(function(acc,key){var value=source[key];if(has$1.call(acc,key)){acc[key]=merge(acc[key],value,options);}else{acc[key]=value;}return acc;},mergeTarget);};var assign=function assignSingleSource(target,source){return Object.keys(source).reduce(function(acc,key){acc[key]=source[key];return acc;},target);};var decode$2=function(str){try{return decodeURIComponent(str.replace(/\+/g,' '));}catch(e){return str;}};var encode=function encode(str){// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
@@ -2274,7 +2276,10 @@ if(findRes&&findRes.isQuery){let config=getOptions(findRes,ruleFn);let{type,colu
2274
2276
  // }
2275
2277
  let value,str;// dateRange 数据比较特殊 searchKey = [xxStart,xxEnd],所以值和str要特殊处理
2276
2278
  if(type==='dateRange'||type==='inputScope'){value=formatTable[type].formToValue(formValues,searchKey);str=formatTable[type].valueToStr(value,config);}else{value=formatTable[type].formToValue(formValues[key]);str=formatTable[type].valueToStr(value,config);}tagNeedCols[columnPropertyName]={name:columnPropertyName,value,str,key:searchKey,type};}}}callbackFn(tagNeedCols);return tagNeedCols;};//
2277
- var script$3={name:"FormTableScheme",components:{SelectCol:__vue_component__$f,Check:__vue_component__$d,Date:__vue_component__$b,Inputsp:__vue_component__$9,Pagination,DateRange:__vue_component__$a,Tips:__vue_component__$8,Radio:__vue_component__$c,InputScope:__vue_component__$6,Selectsp:__vue_component__$5,Cascader:__vue_component__$4},model:{event:"sortChange"},data(){return{trans,dialogFormVisible:false,formatSwitch,list:[],saveMyTemplateColumns:this.requestFn.pageTemplatecs.saveMyTemplateColumns,columns:[],columnsShow:[],checkList:["复选框 A"],tags:[],count:this.countNum,keywords:this.keywords,searchParams:{...this.fetchParam,[this.keywordsKEY]:"",pageSize:20,skipCount:1},listLoading:false,ops:{},multipleSelection:[],tableKey:"first",searchType:"text",selectKey:this.selectKeyList[0]&&this.selectKeyList[0].value||""};},watch:{fetchParam:{deep:true,immediate:true,handler(){this.searchParams={...this.searchParams,...this.fetchParam};}}},props:{bigSearch:{default:false,type:Boolean},fetchParam:{// 上传时附带的参数
2279
+ var script$3={name:"FormTableScheme",components:{SelectCol:__vue_component__$f,Check:__vue_component__$d,Date:__vue_component__$b,Inputsp:__vue_component__$9,Pagination,DateRange:__vue_component__$a,Tips:__vue_component__$8,Radio:__vue_component__$c,InputScope:__vue_component__$6,Selectsp:__vue_component__$5,Cascader:__vue_component__$4},model:{event:"sortChange"},data(){return{trans,dialogFormVisible:false,formatSwitch,list:[],saveMyTemplateColumns:this.requestFn.pageTemplatecs.saveMyTemplateColumns,columns:[],columnsShow:[],checkList:["复选框 A"],tags:[],count:this.countNum,keywords:this.keywords,searchParams:{...this.fetchParam,[this.keywordsKEY]:"",pageSize:20,skipCount:1},listLoading:false,ops:{},multipleSelection:[],tableKey:"first",searchType:"text",selectKey:(()=>{if(!this.selectKeyList||this.selectKeyList.length===0)return"";// 1. 优先使用 fetchParam 中存在的 key
2280
+ if(this.fetchParam){const hit=this.selectKeyList.find(i=>this.fetchParam[i.value]);if(hit)return hit.value;}// 2. 其次尝试使用 keywordsKEY (如果它在列表中)
2281
+ const hasKeyword=this.selectKeyList.find(i=>i.value===this.keywordsKEY);if(hasKeyword)return this.keywordsKEY;// 3. 最后默认使用第一个
2282
+ return this.selectKeyList[0].value;})()};},watch:{fetchParam:{deep:true,immediate:true,handler(){this.searchParams={...this.searchParams,...this.fetchParam};}}},props:{bigSearch:{default:false,type:Boolean},fetchParam:{// 上传时附带的参数
2278
2283
  default:()=>{return{};},type:Object},hasSearch:{default:true,type:Boolean},rowKey:{default:"columnProperty",type:String},selectKeyList:{default:()=>{return[];},type:Array},countNum:{// 总数
2279
2284
  default:0,type:Number},formatData:Function,isAutoScroll:{default:true,type:Boolean},setHeight:{default:"",type:String},getApi:Function,hooks:{default:()=>{},type:Function},columnsApi:Function,requestFn:{default:()=>{return pageTemplatecs$1;},type:Object},templateKey:String,selectcheck:Function,selectType:String,hasSelection:Boolean,hasIndex:{type:Boolean,default:false},selectable:Function,searchPlaceholder:String,actionWidth:{type:String,default:"100"},keywordsKEY:{type:String,default:"keywords"},ruleFn:{type:Object,default:function(){return{};}},colDisplayFn:{type:Function,default:function(col){return col;}},sortableList:{type:Object,default:function(){return{};}},isInitQuest:{type:Boolean,default:true}},setup(){},created(){// document.addEventListener('keyup', this.enter)
2280
2285
  },destroyed(){// document.removeEventListener('keyup', this.enter)
@@ -2282,10 +2287,19 @@ default:0,type:Number},formatData:Function,isAutoScroll:{default:true,type:Boole
2282
2287
  if(this.searchParams[this.keywordsKEY]&&newKey!==this.keywordsKEY){this.searchParams[newKey]=this.searchParams[this.keywordsKEY];this.searchParams[this.keywordsKEY]="";}},getConfig(item){return getOptions(item,this.ruleFn);},getLabel(item,row){let config=getOptions(item,this.ruleFn);return this.formatSwitch(config,row);},changeType(type){if(!this.bigSearch)return;this.searchType=type==1?"textarea":"text";if(type==1){this.$nextTick(()=>{this.$refs.myTextarea.focus();});}},dragHead(newWidth,oldWidth,column,event){const findColumn=this.columnsShow.find(c=>c.columnPropertyName==column.label);let formatWidth=Math.ceil(newWidth);this.requestFn.pageTemplatecs.saveMyTemplateColumnWidth({templateKey:this.templateKey,columnCode:findColumn.columnCode,width:formatWidth}).then(response=>{});},changePG(pages){this.requestFn.pageTemplatecs.selectUserTemplateColumns({templateKey:this.templateKey}).then(response=>{if(response.result==="success"){this.columns=response.data.map(i=>{if(i.queryConfig){i.queryConfig=JSON.parse(i.queryConfig);}return i;});}});this.requestFn.pageTemplatecs.selectMyTableColumns({templateKey:this.templateKey}).then(response=>{if(response.result==="success"){this.columnsShow=response.data.map(i=>{if(i.queryConfig){i.queryConfig=JSON.parse(i.queryConfig);}return i;});this.$nextTick(()=>{if(this.isInitQuest){this.getList();}});}});},setFormParams(obj,type="add"){if(type=="add"){this.searchParams={...this.searchParams,...obj};}else{for(let key in obj){delete this.searchParams[key];}}this.$nextTick(()=>{this.getList({skipCount:1});});},enter(e){if(e.key==="Enter"||e.keyCode===13){console.log("enter");}},getList(params,isClearParams=false){let searchParams;if(isClearParams){searchParams={...params,pageSize:this.searchParams.pageSize,skipCount:1};}else{searchParams={...this.searchParams,...params};}this.searchParams=searchParams;// 处理数据
2283
2288
  let ops={};for(var key in searchParams){if(searchParams[key]!==""&&searchParams[key]!==null&&searchParams[key]!==undefined){ops[key]=searchParams[key];}}// 确保使用正确的关键词字段,并删除其他在selectKeyList中的key值
2284
2289
  if(this.selectKeyList&&this.selectKeyList.length>0){// 获取所有selectKeyList中的key值
2285
- const allSelectKeys=this.selectKeyList.map(item=>item.value);// 如果当前有选中的selectKey,确保使用它
2286
- if(this.selectKey){// 如果默认keywordsKEY有值且不是当前选中的key,将值转移到当前选中的key
2287
- if(ops[this.keywordsKEY]&&this.selectKey!==this.keywordsKEY){ops[this.selectKey]=ops[this.keywordsKEY];delete ops[this.keywordsKEY];}// 删除其他在selectKeyList中的key值(除了当前选中的)
2288
- allSelectKeys.forEach(key=>{if(key!==this.selectKey&&ops[key]){delete ops[key];}});}}else if(this.selectKey&&this.selectKey!==this.keywordsKEY&&ops[this.keywordsKEY]){// 兼容原有逻辑
2290
+ const allSelectKeys=this.selectKeyList.map(item=>item.value);// 1. 如果有 keywordsKEY 的值,优先使用 keywordsKEY,并覆盖到当前 selectKey
2291
+ if(ops[this.keywordsKEY]){// keywordsKEY 的值赋给 selectKey
2292
+ ops[this.selectKey]=ops[this.keywordsKEY];// 清除 keywordsKEY,避免重复
2293
+ if(this.selectKey!==this.keywordsKEY){delete ops[this.keywordsKEY];}}// 2. 检查当前 selectKey 是否有值
2294
+ // 如果没有值,尝试从其他 selectKeyList 中找到第一个有值的 key 切换过去
2295
+ // if (!ops[this.selectKey]) {
2296
+ // const activeKey = allSelectKeys.find((key) => ops[key]);
2297
+ // if (activeKey) {
2298
+ // this.selectKey = activeKey;
2299
+ // }
2300
+ // }
2301
+ // 3. 最终清理:只保留当前 selectKey 的值,清除 selectKeyList 中其他 key 的值
2302
+ allSelectKeys.forEach(key=>{if(key!==this.selectKey&&ops[key]){delete ops[key];}});}else if(this.selectKey&&this.selectKey!==this.keywordsKEY&&ops[this.keywordsKEY]){// 兼容原有逻辑
2289
2303
  ops[this.selectKey]=ops[this.keywordsKEY];delete ops[this.keywordsKEY];}// 根据参数画tag
2290
2304
  formToValue(ops,this.columnsShow,this.colChange,this.ruleFn);const{pageSize,skipCount}=ops;this.listLoading=true;this.hooks(ops);this.getApi({...ops,pageSize:pageSize,skipCount:(skipCount-1)*pageSize,reqTypeSign:"config_table"}).then(response=>{if(response.result==="success"){if(this.formatData){this.list=this.formatData(response.data);}else{this.list=response.data||[];}this.ops=ops;this.count=response.count;}else{this.$message.error(response.msg);}this.$emit("update:countNum",this.count);this.listLoading=false;this.tableKey=Math.random();this.$refs.FormTable.doLayout();},err=>{this.listLoading=false;});},handleSelectionChange(val){let formatVal=val;if(this.selectType==="single"){formatVal=[val.pop()];let other=val;if(other&&other.length>0){other.forEach(row=>{this.$refs.FormTable.toggleRowSelection(row,false);});this.$refs.FormTable.toggleRowSelection(formatVal[0],true);}}this.selectcheck(formatVal);this.multipleSelection=formatVal;this.$emit("selectcheck",formatVal);},getNewCol(show,all){this.columnsShow=show;this.columns=all;this.tableKey=Math.random();// table不刷新 强制key
2291
2305
  },closeTag(tag){const index=this.tags.findIndex(i=>i.name===tag.name);const delItem=this.tags.splice(index,1)[0];const{key,type}=delItem;if(type==="dateRange"||type==="inputScope"){this.setFormParams({[key[0]]:"",[key[1]]:"",[key[2]]:""},"remove");}else{this.setFormParams({[key]:""},"remove");}},handleSelectAll(val){this.$emit("selectAll",Array.from(val));},handleSelect(selection,row){this.$emit("select",{selection,row});},closeAllTag(){const delKeys={};this.tags.forEach(i=>{const{key,type}=i;if(type==="dateRange"||type==="inputScope"){delKeys[key[0]]="";delKeys[key[1]]="";}else{delKeys[key]="";}});this.tags=[];this.setFormParams({...delKeys},"remove");},colChange(objTags){// const selectIndex =this.tags.findIndex(i => i.name === arrow)
@@ -2301,7 +2315,7 @@ formToValue(ops,this.columnsShow,this.colChange,this.ruleFn);const{pageSize,skip
2301
2315
  // } else {
2302
2316
  // this.tags = this.tags.concat([{'name':arrow, value:data.value, str:data.str, key:data.searchKey, type: data.type }])
2303
2317
  // }
2304
- const arr=[];for(let key in objTags){arr.push(objTags[key]);}this.tags=[].concat(arr);},actionModal(){this.dialogFormVisible=true;this.columns;this.columns=this.columns.map(i=>{const isSelect=this.columnsShow.find(j=>j.columnPropertyName===i.columnPropertyName);i.show=!!isSelect;return i;});}}};/* script */const __vue_script__$3=script$3;/* template */var __vue_render__$3=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("div",{staticClass:"container"},[_c("div",{staticClass:"optBox"},[_c("div",{staticClass:"leftBtn"},[_vm._t("leftBtn")],2),_vm._v(" "),_c("div",{staticClass:"rightBtn"},[_vm.hasSearch?_c("el-input",{directives:[{name:"show",rawName:"v-show",value:_vm.searchType=="textarea",expression:"searchType == 'textarea'"}],ref:"myTextarea",class:{"input-with-select":true,textareaSpec:_vm.searchType=="textarea"},attrs:{type:"textarea",placeholder:_vm.searchPlaceholder||_vm.trans("请输入内容"),rows:10},on:{blur:function($event){return _vm.changeType(0);}},nativeOn:{keyup:function($event){if(!$event.type.indexOf("key")&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){return null;}return _vm.getList({skipCount:1});}},model:{value:_vm.searchParams[_vm.getCurrentKeywordsKey()],callback:function($$v){_vm.$set(_vm.searchParams,_vm.getCurrentKeywordsKey(),typeof $$v==="string"?$$v.trim():$$v);},expression:"searchParams[getCurrentKeywordsKey()]"}},[_c("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:function($event){return _vm.getList({skipCount:1});}},slot:"append"})],1):_vm._e(),_vm._v(" "),_vm.hasSearch?_c("el-input",{directives:[{name:"show",rawName:"v-show",value:_vm.searchType=="text",expression:"searchType == 'text'"}],class:{"input-with-select":true,width400:_vm.selectKeyList.length>0},attrs:{placeholder:_vm.searchPlaceholder||_vm.trans("请输入内容")},on:{focus:function($event){return _vm.changeType(1);}},nativeOn:{keyup:function($event){if(!$event.type.indexOf("key")&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){return null;}return _vm.getList({skipCount:1});}},model:{value:_vm.searchParams[_vm.getCurrentKeywordsKey()],callback:function($$v){_vm.$set(_vm.searchParams,_vm.getCurrentKeywordsKey(),typeof $$v==="string"?$$v.trim():$$v);},expression:"searchParams[getCurrentKeywordsKey()]"}},[_vm.selectKeyList.length>0?_c("el-select",{staticStyle:{width:"120px"},attrs:{slot:"prepend",placeholder:"请选择"},on:{change:_vm.handleSelectKeyChange},slot:"prepend",model:{value:_vm.selectKey,callback:function($$v){_vm.selectKey=$$v;},expression:"selectKey"}},_vm._l(_vm.selectKeyList,function(item){return _c("el-option",{key:item.value,attrs:{label:item.label,value:item.value}});}),1):_vm._e(),_vm._v(" "),_c("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:function($event){return _vm.getList({skipCount:1});}},slot:"append"})],1):_vm._e(),_vm._v(" "),_c("el-divider",{attrs:{direction:"vertical"}}),_vm._v(" "),_c("el-button",{attrs:{size:"mini"},on:{click:_vm.actionModal}},[_c("svg",{staticClass:"icon",staticStyle:{color:"#10c2b0",cursor:"pointer"},attrs:{"aria-hidden":"true"}},[_c("use",{attrs:{"xlink:href":"#fontFamily-a-web20_shaixuanpeizhi"}})])])],1)]),_vm._v(" "),_c("div",{staticClass:"tagBox"},_vm._l(_vm.tags,function(tag){return _c("el-tag",{key:tag.name,attrs:{closable:"",type:"info"},on:{close:function($event){return _vm.closeTag(tag);}}},[_c("div",{staticClass:"tagItem"},[_vm._v(_vm._s(tag.name+":"+tag.str))])]);}),1),_vm._v(" "),_vm.tags.length>1?_c("el-button",{staticClass:"clearAll",on:{click:_vm.closeAllTag}},[_vm._v(_vm._s(_vm.trans("取消全部筛选")))]):_vm._e(),_vm._v(" "),_c("el-table",{directives:[{name:"loading",rawName:"v-loading",value:_vm.listLoading,expression:"listLoading"}],key:_vm.tableKey,ref:"FormTable",staticClass:"table",attrs:{data:_vm.list,"row-key":_vm.rowKey,border:"",fit:""},on:{"sort-change":function($event){return _vm.$emit("sortChange",$event);},"selection-change":_vm.handleSelectionChange,"header-dragend":_vm.dragHead,"select-all":_vm.handleSelectAll,select:_vm.handleSelect}},[_vm.hasSelection?_c("el-table-column",{attrs:{type:"selection",width:"50",selectable:_vm.selectable}}):_vm._e(),_vm._v(" "),_vm.hasIndex?_c("el-table-column",{attrs:{label:_vm.trans("序号"),type:"index",width:"50"}}):_vm._e(),_vm._v(" "),_vm._t("additional"),_vm._v(" "),_vm._l(_vm.colDisplayFn(_vm.columnsShow),function(item){return _c("el-table-column",{key:item.columnCode,attrs:{label:item.columnPropertyName,fixed:item.isFixed==1&&"left","min-width":(item.defaultWidth||item.minWidth)+20,"show-overflow-tooltip":"",sortable:_vm.sortableList[item.columnProperty]||false,prop:item.columnProperty,align:"center"},scopedSlots:_vm._u([{key:"header",fn:function(ref){var column=ref.column;return[_c("span",[_vm._v(_vm._s(column.label))]),_vm._v(" "),_vm.$scopedSlots[item.columnProperty+"Header"]?_c("span",[_c("tips",[_vm._t(item.columnProperty+"Header")],2)],1):_vm._e(),_vm._v(" "),item.queryConfig&&item.queryConfig.type&&item.isQuery?_c(item.queryConfig.type,{tag:"component",attrs:{config:item.queryConfig,column:item,setFormParams:_vm.setFormParams,ops:_vm.ops,getConfig:_vm.getConfig,ruleFn:_vm.ruleFn[item.columnProperty]}}):_vm._e()];}},{key:"default",fn:function(ref){var row=ref.row;return[_vm.$scopedSlots[item.columnProperty]?_c("span",[_vm._t(item.columnProperty,null,{props:row,queryConfig:item.queryConfig,options:_vm.getConfig(item),label:_vm.getLabel(item,row)})],2):_c("span",[_vm._v(_vm._s(_vm.getLabel(item,row)))])];}}],null,true)});}),_vm._v(" "),_vm.$scopedSlots.actionBtn?_c("el-table-column",{attrs:{label:_vm.trans("操作"),align:"center",width:_vm.actionWidth,"class-name":"small-padding",fixed:"right"},scopedSlots:_vm._u([{key:"default",fn:function(ref){var row=ref.row;return[_vm._t("actionBtn",null,{props:row})];}}],null,true)}):_vm._e()],2),_vm._v(" "),_c("div",{staticClass:"btmBox"},[_c("div",{staticClass:"btmLeft"},[_vm._t("btmLeft")],2),_vm._v(" "),_c("pagination",{directives:[{name:"show",rawName:"v-show",value:_vm.count>0,expression:"count > 0"}],staticClass:"text-right mt-0 pagi",attrs:{autoScroll:_vm.isAutoScroll,total:_vm.count,page:_vm.searchParams.skipCount,limit:_vm.searchParams.pageSize},on:{"update:page":function($event){return _vm.$set(_vm.searchParams,"skipCount",$event);},"update:limit":function($event){return _vm.$set(_vm.searchParams,"pageSize",$event);},pagination:_vm.getList}})],1),_vm._v(" "),_vm.columns.length>0?_c("select-col",{attrs:{saveMyTemplateColumns:_vm.saveMyTemplateColumns,templateKey:_vm.templateKey,getNewCol:_vm.getNewCol,initialColumns:_vm.columns,columnsShow:_vm.columnsShow,visible:_vm.dialogFormVisible},on:{"update:visible":function($event){_vm.dialogFormVisible=$event;}}}):_vm._e()],1);};var __vue_staticRenderFns__$3=[];__vue_render__$3._withStripped=true;/* style */const __vue_inject_styles__$3=function(inject){if(!inject)return;inject("data-v-2e1086c8_0",{source:"\n.el-table__empty-block {\n background: #fbfbfb;\n}\n",map:{"version":3,"sources":["/Users/chenlei/HLcode/test/components/FormTableScheme/index.vue"],"names":[],"mappings":";AAkqBA;EACA,mBAAA;AACA","file":"index.vue","sourcesContent":["<template>\n <div class=\"container\">\n <div class=\"optBox\">\n <div class=\"leftBtn\">\n <slot name=\"leftBtn\"></slot>\n </div>\n <div class=\"rightBtn\">\n <el-input\n v-if=\"hasSearch\"\n v-show=\"searchType == 'textarea'\"\n type=\"textarea\"\n @keyup.enter.native=\"getList({ skipCount: 1 })\"\n :placeholder=\"searchPlaceholder || trans('请输入内容')\"\n :class=\"{\n 'input-with-select': true,\n textareaSpec: searchType == 'textarea',\n }\"\n v-model.trim=\"searchParams[getCurrentKeywordsKey()]\"\n @blur=\"changeType(0)\"\n :rows=\"10\"\n ref=\"myTextarea\"\n >\n <el-button\n slot=\"append\"\n icon=\"el-icon-search\"\n @click=\"getList({ skipCount: 1 })\"\n ></el-button>\n </el-input>\n <el-input\n v-if=\"hasSearch\"\n v-show=\"searchType == 'text'\"\n @keyup.enter.native=\"getList({ skipCount: 1 })\"\n :placeholder=\"searchPlaceholder || trans('请输入内容')\"\n :class=\"{\n 'input-with-select': true,\n width400: selectKeyList.length > 0,\n }\"\n v-model.trim=\"searchParams[getCurrentKeywordsKey()]\"\n @focus=\"changeType(1)\"\n >\n <el-select\n v-model=\"selectKey\"\n slot=\"prepend\"\n placeholder=\"请选择\"\n v-if=\"selectKeyList.length > 0\"\n style=\"width: 120px\"\n @change=\"handleSelectKeyChange\"\n >\n <el-option\n v-for=\"item in selectKeyList\"\n :key=\"item.value\"\n :label=\"item.label\"\n :value=\"item.value\"\n ></el-option>\n </el-select>\n <el-button\n slot=\"append\"\n icon=\"el-icon-search\"\n @click=\"getList({ skipCount: 1 })\"\n ></el-button>\n </el-input>\n <el-divider direction=\"vertical\"></el-divider>\n <el-button size=\"mini\" @click=\"actionModal\">\n <svg\n class=\"icon\"\n aria-hidden=\"true\"\n style=\"color: #10c2b0; cursor: pointer\"\n >\n <use xlink:href=\"#fontFamily-a-web20_shaixuanpeizhi\"></use>\n </svg>\n </el-button>\n </div>\n </div>\n\n <div class=\"tagBox\">\n <el-tag\n v-for=\"tag in tags\"\n :key=\"tag.name\"\n closable\n @close=\"closeTag(tag)\"\n type=\"info\"\n >\n <div class=\"tagItem\">{{ `${tag.name}:${tag.str}` }}</div>\n </el-tag>\n </div>\n <el-button class=\"clearAll\" v-if=\"tags.length > 1\" @click=\"closeAllTag\">{{\n trans(\"取消全部筛选\")\n }}</el-button>\n <el-table\n ref=\"FormTable\"\n v-loading=\"listLoading\"\n :data=\"list\"\n :row-key=\"rowKey\"\n border\n fit\n @sort-change=\"$emit('sortChange', $event)\"\n @selection-change=\"handleSelectionChange\"\n @header-dragend=\"dragHead\"\n @select-all=\"handleSelectAll\"\n @select=\"handleSelect\"\n class=\"table\"\n :key=\"tableKey\"\n >\n <el-table-column\n v-if=\"hasSelection\"\n type=\"selection\"\n width=\"50\"\n :selectable=\"selectable\"\n >\n </el-table-column>\n <el-table-column\n v-if=\"hasIndex\"\n :label=\"trans('序号')\"\n type=\"index\"\n width=\"50\"\n >\n </el-table-column>\n <slot name=\"additional\"></slot>\n <el-table-column\n v-for=\"item in colDisplayFn(columnsShow)\"\n :key=\"item.columnCode\"\n :label=\"item.columnPropertyName\"\n :fixed=\"item.isFixed == 1 && 'left'\"\n :min-width=\"(item.defaultWidth || item.minWidth) + 20\"\n show-overflow-tooltip\n :sortable=\"sortableList[item.columnProperty] || false\"\n :prop=\"item.columnProperty\"\n align=\"center\"\n >\n <template slot=\"header\" slot-scope=\"{ column }\">\n <span>{{ column.label }}</span>\n <span v-if=\"$scopedSlots[`${item.columnProperty}Header`]\">\n <tips>\n <slot :name=\"`${item.columnProperty}Header`\"></slot>\n </tips>\n </span>\n <component\n v-if=\"item.queryConfig && item.queryConfig.type && item.isQuery\"\n v-bind:is=\"item.queryConfig.type\"\n :config=\"item.queryConfig\"\n :column=\"item\"\n :setFormParams=\"setFormParams\"\n :ops=\"ops\"\n :getConfig=\"getConfig\"\n :ruleFn=\"ruleFn[item.columnProperty]\"\n ></component>\n </template>\n <template slot-scope=\"{ row }\">\n <span v-if=\"$scopedSlots[item.columnProperty]\">\n <slot\n :name=\"item.columnProperty\"\n :props=\"row\"\n :queryConfig=\"item.queryConfig\"\n :options=\"getConfig(item)\"\n :label=\"getLabel(item, row)\"\n ></slot>\n </span>\n <span v-else>{{ getLabel(item, row) }}</span>\n </template>\n </el-table-column>\n <el-table-column\n :label=\"trans('操作')\"\n align=\"center\"\n :width=\"actionWidth\"\n class-name=\"small-padding\"\n v-if=\"$scopedSlots.actionBtn\"\n fixed=\"right\"\n >\n <template slot-scope=\"{ row }\">\n <slot name=\"actionBtn\" :props=\"row\"> </slot>\n </template>\n </el-table-column>\n </el-table>\n <div class=\"btmBox\">\n <div class=\"btmLeft\">\n <slot name=\"btmLeft\"></slot>\n </div>\n <pagination\n v-show=\"count > 0\"\n :autoScroll=\"isAutoScroll\"\n class=\"text-right mt-0 pagi\"\n :total=\"count\"\n :page.sync=\"searchParams.skipCount\"\n :limit.sync=\"searchParams.pageSize\"\n @pagination=\"getList\"\n />\n </div>\n\n <select-col\n v-if=\"columns.length > 0\"\n :saveMyTemplateColumns=\"saveMyTemplateColumns\"\n :templateKey=\"templateKey\"\n :getNewCol=\"getNewCol\"\n :initialColumns=\"columns\"\n :columnsShow=\"columnsShow\"\n :visible.sync=\"dialogFormVisible\"\n ></select-col>\n </div>\n</template>\n<script>\n/**\n * 表格\n * fetchParam {object} 请求参数\n * countNum {number} 数据总数 用法:countNum.sync=\"count\"\n * getApi {function} 请求接口\n * formatData {function} 返回参数格式化\n * sortChange {function} 排序事件函数\n * setHeight {string || number} 表格高度\n * selectcheck {function} 选择监听\n * selectable { function } checkbox 筛选禁用\n */\n\nimport {\n SelectCol,\n Check,\n Date,\n Inputsp,\n DateRange,\n Tips,\n pageTemplatecs,\n Radio,\n InputScope,\n Selectsp,\n Cascader,\n} from \"./component/index\";\nimport Pagination from \"@/components/Pagination\";\nimport formatSwitch from \"./format\";\nimport formToValue from \"./component/ColHeader/dataFormat\";\nimport trans from \"../lang/trans\";\nimport getOptions from \"./component/utils\";\nexport default {\n name: \"FormTableScheme\",\n components: {\n SelectCol,\n Check,\n Date,\n Inputsp,\n Pagination,\n DateRange,\n Tips,\n Radio,\n InputScope,\n Selectsp,\n Cascader,\n },\n model: {\n event: \"sortChange\",\n },\n data() {\n return {\n trans,\n dialogFormVisible: false,\n formatSwitch,\n list: [],\n saveMyTemplateColumns:\n this.requestFn.pageTemplatecs.saveMyTemplateColumns,\n columns: [],\n columnsShow: [],\n checkList: [\"复选框 A\"],\n tags: [],\n count: this.countNum,\n keywords: this.keywords,\n searchParams: {\n ...this.fetchParam,\n [this.keywordsKEY]: \"\",\n pageSize: 20,\n skipCount: 1,\n },\n listLoading: false,\n ops: {},\n multipleSelection: [],\n tableKey: \"first\",\n searchType: \"text\",\n selectKey: (this.selectKeyList[0] && this.selectKeyList[0].value) || \"\",\n };\n },\n watch: {\n fetchParam: {\n deep: true,\n immediate: true,\n handler() {\n this.searchParams = {\n ...this.searchParams,\n ...this.fetchParam,\n };\n },\n },\n },\n props: {\n bigSearch: {\n default: false,\n type: Boolean,\n },\n fetchParam: {\n // 上传时附带的参数\n default: () => {\n return {};\n },\n type: Object,\n },\n hasSearch: {\n default: true,\n type: Boolean,\n },\n rowKey: {\n default: \"columnProperty\",\n type: String,\n },\n selectKeyList: {\n default: () => {\n return [];\n },\n type: Array,\n },\n countNum: {\n // 总数\n default: 0,\n type: Number,\n },\n formatData: Function,\n isAutoScroll: {\n default: true,\n type: Boolean,\n },\n setHeight: {\n default: \"\",\n type: String,\n },\n getApi: Function,\n hooks: {\n default: () => {},\n type: Function,\n },\n columnsApi: Function,\n requestFn: {\n default: () => {\n return pageTemplatecs;\n },\n type: Object,\n },\n templateKey: String,\n selectcheck: Function,\n selectType: String,\n hasSelection: Boolean,\n hasIndex: {\n type: Boolean,\n default: false,\n },\n selectable: Function,\n searchPlaceholder: String,\n actionWidth: {\n type: String,\n default: \"100\",\n },\n keywordsKEY: {\n type: String,\n default: \"keywords\",\n },\n ruleFn: {\n type: Object,\n default: function () {\n return {};\n },\n },\n colDisplayFn: {\n type: Function,\n default: function (col) {\n return col;\n },\n },\n sortableList: {\n type: Object,\n default: function () {\n return {};\n },\n },\n isInitQuest: {\n type: Boolean,\n default: true,\n },\n },\n setup() {},\n created() {\n // document.addEventListener('keyup', this.enter)\n },\n destroyed() {\n // document.removeEventListener('keyup', this.enter)\n },\n mounted() {\n this.changePG();\n },\n activated() {\n this.$refs.FormTable.doLayout();\n },\n methods: {\n getCurrentKeywordsKey() {\n return this.selectKey || this.keywordsKEY;\n },\n handleSelectKeyChange(newKey) {\n // 如果之前有值,需要将值转移到新的字段\n if (this.searchParams[this.keywordsKEY] && newKey !== this.keywordsKEY) {\n this.searchParams[newKey] = this.searchParams[this.keywordsKEY];\n this.searchParams[this.keywordsKEY] = \"\";\n }\n },\n getConfig(item) {\n return getOptions(item, this.ruleFn);\n },\n getLabel(item, row) {\n let config = getOptions(item, this.ruleFn);\n return this.formatSwitch(config, row);\n },\n changeType(type) {\n if (!this.bigSearch) return;\n this.searchType = type == 1 ? \"textarea\" : \"text\";\n if (type == 1) {\n this.$nextTick(() => {\n this.$refs.myTextarea.focus();\n });\n }\n },\n dragHead(newWidth, oldWidth, column, event) {\n const findColumn = this.columnsShow.find(\n (c) => c.columnPropertyName == column.label\n );\n let formatWidth = Math.ceil(newWidth);\n this.requestFn.pageTemplatecs\n .saveMyTemplateColumnWidth({\n templateKey: this.templateKey,\n columnCode: findColumn.columnCode,\n width: formatWidth,\n })\n .then((response) => {});\n },\n changePG(pages) {\n this.requestFn.pageTemplatecs\n .selectUserTemplateColumns({ templateKey: this.templateKey })\n .then((response) => {\n if (response.result === \"success\") {\n this.columns = response.data.map((i) => {\n if (i.queryConfig) {\n i.queryConfig = JSON.parse(i.queryConfig);\n }\n return i;\n });\n }\n });\n this.requestFn.pageTemplatecs\n .selectMyTableColumns({ templateKey: this.templateKey })\n .then((response) => {\n if (response.result === \"success\") {\n this.columnsShow = response.data.map((i) => {\n if (i.queryConfig) {\n i.queryConfig = JSON.parse(i.queryConfig);\n }\n return i;\n });\n this.$nextTick(() => {\n if (this.isInitQuest) {\n this.getList();\n }\n });\n }\n });\n },\n setFormParams(obj, type = \"add\") {\n if (type == \"add\") {\n this.searchParams = {\n ...this.searchParams,\n ...obj,\n };\n } else {\n for (let key in obj) {\n delete this.searchParams[key];\n }\n }\n\n this.$nextTick(() => {\n this.getList({\n skipCount: 1,\n });\n });\n },\n enter(e) {\n if (e.key === \"Enter\" || e.keyCode === 13) {\n console.log(\"enter\");\n }\n },\n getList(params, isClearParams = false) {\n let searchParams;\n if (isClearParams) {\n searchParams = {\n ...params,\n pageSize: this.searchParams.pageSize,\n skipCount: 1,\n };\n } else {\n searchParams = {\n ...this.searchParams,\n ...params,\n };\n }\n\n this.searchParams = searchParams;\n\n // 处理数据\n let ops = {};\n for (var key in searchParams) {\n if (\n searchParams[key] !== \"\" &&\n searchParams[key] !== null &&\n searchParams[key] !== undefined\n ) {\n ops[key] = searchParams[key];\n }\n }\n\n // 确保使用正确的关键词字段,并删除其他在selectKeyList中的key值\n if (this.selectKeyList && this.selectKeyList.length > 0) {\n // 获取所有selectKeyList中的key值\n const allSelectKeys = this.selectKeyList.map((item) => item.value);\n\n // 如果当前有选中的selectKey,确保使用它\n if (this.selectKey) {\n // 如果默认keywordsKEY有值且不是当前选中的key,将值转移到当前选中的key\n if (ops[this.keywordsKEY] && this.selectKey !== this.keywordsKEY) {\n ops[this.selectKey] = ops[this.keywordsKEY];\n delete ops[this.keywordsKEY];\n }\n\n // 删除其他在selectKeyList中的key值(除了当前选中的)\n allSelectKeys.forEach((key) => {\n if (key !== this.selectKey && ops[key]) {\n delete ops[key];\n }\n });\n }\n } else if (\n this.selectKey &&\n this.selectKey !== this.keywordsKEY &&\n ops[this.keywordsKEY]\n ) {\n // 兼容原有逻辑\n ops[this.selectKey] = ops[this.keywordsKEY];\n delete ops[this.keywordsKEY];\n }\n\n // 根据参数画tag\n formToValue(ops, this.columnsShow, this.colChange, this.ruleFn);\n\n const { pageSize, skipCount } = ops;\n\n this.listLoading = true;\n this.hooks(ops);\n this.getApi({\n ...ops,\n pageSize: pageSize,\n skipCount: (skipCount - 1) * pageSize,\n reqTypeSign: \"config_table\",\n }).then(\n (response) => {\n if (response.result === \"success\") {\n if (this.formatData) {\n this.list = this.formatData(response.data);\n } else {\n this.list = response.data || [];\n }\n this.ops = ops;\n this.count = response.count;\n } else {\n this.$message.error(response.msg);\n }\n this.$emit(\"update:countNum\", this.count);\n this.listLoading = false;\n this.tableKey = Math.random();\n this.$refs.FormTable.doLayout();\n },\n (err) => {\n this.listLoading = false;\n }\n );\n },\n handleSelectionChange(val) {\n let formatVal = val;\n if (this.selectType === \"single\") {\n formatVal = [val.pop()];\n let other = val;\n if (other && other.length > 0) {\n other.forEach((row) => {\n this.$refs.FormTable.toggleRowSelection(row, false);\n });\n this.$refs.FormTable.toggleRowSelection(formatVal[0], true);\n }\n }\n this.selectcheck(formatVal);\n this.multipleSelection = formatVal;\n this.$emit(\"selectcheck\", formatVal);\n },\n getNewCol(show, all) {\n this.columnsShow = show;\n this.columns = all;\n this.tableKey = Math.random(); // table不刷新 强制key\n },\n closeTag(tag) {\n const index = this.tags.findIndex((i) => i.name === tag.name);\n const delItem = this.tags.splice(index, 1)[0];\n const { key, type } = delItem;\n if (type === \"dateRange\" || type === \"inputScope\") {\n this.setFormParams(\n { [key[0]]: \"\", [key[1]]: \"\", [key[2]]: \"\" },\n \"remove\"\n );\n } else {\n this.setFormParams({ [key]: \"\" }, \"remove\");\n }\n },\n handleSelectAll(val) {\n this.$emit(\"selectAll\", Array.from(val));\n },\n handleSelect(selection, row) {\n this.$emit(\"select\", { selection, row });\n },\n closeAllTag() {\n const delKeys = {};\n this.tags.forEach((i) => {\n const { key, type } = i;\n if (type === \"dateRange\" || type === \"inputScope\") {\n delKeys[key[0]] = \"\";\n delKeys[key[1]] = \"\";\n } else {\n delKeys[key] = \"\";\n }\n });\n this.tags = [];\n this.setFormParams({ ...delKeys }, \"remove\");\n },\n colChange(objTags) {\n // const selectIndex =this.tags.findIndex(i => i.name === arrow)\n // if(selectIndex >= 0){\n // let select = this.tags[selectIndex]\n // if(data.value.length > 0){\n // select.value = data.value\n // select.str = data.str\n // this.$set(this.tags, selectIndex, select)\n // } else {\n // this.tags.splice(selectIndex,1)\n // }\n\n // } else {\n // this.tags = this.tags.concat([{'name':arrow, value:data.value, str:data.str, key:data.searchKey, type: data.type }])\n // }\n const arr = [];\n for (let key in objTags) {\n arr.push(objTags[key]);\n }\n\n this.tags = [].concat(arr);\n },\n\n actionModal() {\n this.dialogFormVisible = true;\n this.columns;\n this.columns = this.columns.map((i) => {\n const isSelect = this.columnsShow.find(\n (j) => j.columnPropertyName === i.columnPropertyName\n );\n i.show = !!isSelect;\n return i;\n });\n },\n },\n};\n</script>\n<style>\n.el-table__empty-block {\n background: #fbfbfb;\n}\n</style>\n<style lang=\"less\" scoped>\n.container {\n padding: 15px;\n margin: 0px;\n width: 100%;\n background: #fff;\n float: left;\n}\n\n.input-with-select {\n width: 300px;\n}\n.width400 {\n width: 400px;\n}\n.optBox {\n margin-bottom: 10px;\n overflow: hidden;\n}\n\n.leftBtn {\n float: left;\n}\n\n.rightBtn {\n float: right;\n .textareaSpec {\n position: absolute;\n right: 100px;\n z-index: 1000;\n width: 700px;\n height: 400px;\n // transition: all 1s ease-out;\n }\n .border {\n border: 1px solid rgb(220, 223, 230);\n }\n}\n\n.tagBox {\n width: calc(100% - 140px);\n float: left;\n overflow: hidden;\n > .el-tag {\n margin: 4px 10px 0 0;\n max-width: 420px;\n /deep/.el-tag__close {\n vertical-align: super;\n }\n }\n .tagItem {\n max-width: 397px;\n display: inline-block;\n white-space: nowrap; /* 防止文本换行 */\n overflow: hidden; /* 隐藏超出的内容 */\n text-overflow: ellipsis; /* 将超出的内容显示为省略号 */\n }\n}\n\n.clearAll {\n float: right;\n}\n\n.table {\n width: 100%;\n margin-top: 10px;\n float: left;\n // overflow-x: visible;\n // overflow-y: visible;\n // /deep/ .el-table__header-wrapper{\n // position: sticky;\n // top:84px;\n // z-index:5;\n // }\n // /deep/ .el-table__fixed-header-wrapper{\n // z-index:5;\n // }\n}\n\n.pagi {\n float: right;\n}\n\n.pagi.pagination-container {\n padding: 0px;\n padding-top: 20px;\n}\n\n.btmBox {\n width: 100%;\n float: left;\n display: flex;\n justify-content: space-between;\n}\n</style>"]},media:undefined}),inject("data-v-2e1086c8_1",{source:".container[data-v-2e1086c8] {\n padding: 15px;\n margin: 0px;\n width: 100%;\n background: #fff;\n float: left;\n}\n.input-with-select[data-v-2e1086c8] {\n width: 300px;\n}\n.width400[data-v-2e1086c8] {\n width: 400px;\n}\n.optBox[data-v-2e1086c8] {\n margin-bottom: 10px;\n overflow: hidden;\n}\n.leftBtn[data-v-2e1086c8] {\n float: left;\n}\n.rightBtn[data-v-2e1086c8] {\n float: right;\n}\n.rightBtn .textareaSpec[data-v-2e1086c8] {\n position: absolute;\n right: 100px;\n z-index: 1000;\n width: 700px;\n height: 400px;\n}\n.rightBtn .border[data-v-2e1086c8] {\n border: 1px solid #dcdfe6;\n}\n.tagBox[data-v-2e1086c8] {\n width: calc(100% - 140px);\n float: left;\n overflow: hidden;\n}\n.tagBox > .el-tag[data-v-2e1086c8] {\n margin: 4px 10px 0 0;\n max-width: 420px;\n}\n.tagBox > .el-tag[data-v-2e1086c8] .el-tag__close {\n vertical-align: super;\n}\n.tagBox .tagItem[data-v-2e1086c8] {\n max-width: 397px;\n display: inline-block;\n white-space: nowrap;\n /* 防止文本换行 */\n overflow: hidden;\n /* 隐藏超出的内容 */\n text-overflow: ellipsis;\n /* 将超出的内容显示为省略号 */\n}\n.clearAll[data-v-2e1086c8] {\n float: right;\n}\n.table[data-v-2e1086c8] {\n width: 100%;\n margin-top: 10px;\n float: left;\n}\n.pagi[data-v-2e1086c8] {\n float: right;\n}\n.pagi.pagination-container[data-v-2e1086c8] {\n padding: 0px;\n padding-top: 20px;\n}\n.btmBox[data-v-2e1086c8] {\n width: 100%;\n float: left;\n display: flex;\n justify-content: space-between;\n}\n",map:{"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,WAAW;EACX,WAAW;EACX,gBAAgB;EAChB,WAAW;AACb;AACA;EACE,YAAY;AACd;AACA;EACE,YAAY;AACd;AACA;EACE,mBAAmB;EACnB,gBAAgB;AAClB;AACA;EACE,WAAW;AACb;AACA;EACE,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,YAAY;EACZ,aAAa;EACb,YAAY;EACZ,aAAa;AACf;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,yBAAyB;EACzB,WAAW;EACX,gBAAgB;AAClB;AACA;EACE,oBAAoB;EACpB,gBAAgB;AAClB;AACA;EACE,qBAAqB;AACvB;AACA;EACE,gBAAgB;EAChB,qBAAqB;EACrB,mBAAmB;EACnB,WAAW;EACX,gBAAgB;EAChB,YAAY;EACZ,uBAAuB;EACvB,iBAAiB;AACnB;AACA;EACE,YAAY;AACd;AACA;EACE,WAAW;EACX,gBAAgB;EAChB,WAAW;AACb;AACA;EACE,YAAY;AACd;AACA;EACE,YAAY;EACZ,iBAAiB;AACnB;AACA;EACE,WAAW;EACX,WAAW;EACX,aAAa;EACb,8BAA8B;AAChC","file":"index.vue","sourcesContent":[".container {\n padding: 15px;\n margin: 0px;\n width: 100%;\n background: #fff;\n float: left;\n}\n.input-with-select {\n width: 300px;\n}\n.width400 {\n width: 400px;\n}\n.optBox {\n margin-bottom: 10px;\n overflow: hidden;\n}\n.leftBtn {\n float: left;\n}\n.rightBtn {\n float: right;\n}\n.rightBtn .textareaSpec {\n position: absolute;\n right: 100px;\n z-index: 1000;\n width: 700px;\n height: 400px;\n}\n.rightBtn .border {\n border: 1px solid #dcdfe6;\n}\n.tagBox {\n width: calc(100% - 140px);\n float: left;\n overflow: hidden;\n}\n.tagBox > .el-tag {\n margin: 4px 10px 0 0;\n max-width: 420px;\n}\n.tagBox > .el-tag /deep/ .el-tag__close {\n vertical-align: super;\n}\n.tagBox .tagItem {\n max-width: 397px;\n display: inline-block;\n white-space: nowrap;\n /* 防止文本换行 */\n overflow: hidden;\n /* 隐藏超出的内容 */\n text-overflow: ellipsis;\n /* 将超出的内容显示为省略号 */\n}\n.clearAll {\n float: right;\n}\n.table {\n width: 100%;\n margin-top: 10px;\n float: left;\n}\n.pagi {\n float: right;\n}\n.pagi.pagination-container {\n padding: 0px;\n padding-top: 20px;\n}\n.btmBox {\n width: 100%;\n float: left;\n display: flex;\n justify-content: space-between;\n}\n"]},media:undefined});};/* scoped */const __vue_scope_id__$3="data-v-2e1086c8";/* module identifier */const __vue_module_identifier__$3=undefined;/* functional template */const __vue_is_functional_template__$3=false;/* style inject SSR */ /* style inject shadow dom */const __vue_component__$3=/*#__PURE__*/normalizeComponent({render:__vue_render__$3,staticRenderFns:__vue_staticRenderFns__$3},__vue_inject_styles__$3,__vue_script__$3,__vue_scope_id__$3,__vue_is_functional_template__$3,__vue_module_identifier__$3,false,createInjector,undefined,undefined);__vue_component__$3.install=function(Vue){Vue.component(__vue_component__$3.name,__vue_component__$3);};/*!
2318
+ const arr=[];for(let key in objTags){arr.push(objTags[key]);}this.tags=[].concat(arr);},actionModal(){this.dialogFormVisible=true;this.columns;this.columns=this.columns.map(i=>{const isSelect=this.columnsShow.find(j=>j.columnPropertyName===i.columnPropertyName);i.show=!!isSelect;return i;});}}};/* script */const __vue_script__$3=script$3;/* template */var __vue_render__$3=function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c("div",{staticClass:"container"},[_c("div",{staticClass:"optBox"},[_c("div",{staticClass:"leftBtn"},[_vm._t("leftBtn")],2),_vm._v(" "),_c("div",{staticClass:"rightBtn"},[_vm.hasSearch?_c("el-input",{directives:[{name:"show",rawName:"v-show",value:_vm.searchType=="textarea",expression:"searchType == 'textarea'"}],ref:"myTextarea",class:{"input-with-select":true,textareaSpec:_vm.searchType=="textarea"},attrs:{type:"textarea",placeholder:_vm.searchPlaceholder||_vm.trans("请输入内容"),rows:10},on:{blur:function($event){return _vm.changeType(0);}},nativeOn:{keyup:function($event){if(!$event.type.indexOf("key")&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){return null;}return _vm.getList({skipCount:1});}},model:{value:_vm.searchParams[_vm.getCurrentKeywordsKey()],callback:function($$v){_vm.$set(_vm.searchParams,_vm.getCurrentKeywordsKey(),typeof $$v==="string"?$$v.trim():$$v);},expression:"searchParams[getCurrentKeywordsKey()]"}},[_c("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:function($event){return _vm.getList({skipCount:1});}},slot:"append"})],1):_vm._e(),_vm._v(" "),_vm.hasSearch?_c("el-input",{directives:[{name:"show",rawName:"v-show",value:_vm.searchType=="text",expression:"searchType == 'text'"}],class:{"input-with-select":true,width400:_vm.selectKeyList.length>0},attrs:{placeholder:_vm.searchPlaceholder||_vm.trans("请输入内容")},on:{focus:function($event){return _vm.changeType(1);}},nativeOn:{keyup:function($event){if(!$event.type.indexOf("key")&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){return null;}return _vm.getList({skipCount:1});}},model:{value:_vm.searchParams[_vm.getCurrentKeywordsKey()],callback:function($$v){_vm.$set(_vm.searchParams,_vm.getCurrentKeywordsKey(),typeof $$v==="string"?$$v.trim():$$v);},expression:"searchParams[getCurrentKeywordsKey()]"}},[_vm.selectKeyList.length>0?_c("el-select",{staticStyle:{width:"120px"},attrs:{slot:"prepend",placeholder:"请选择"},on:{change:_vm.handleSelectKeyChange},slot:"prepend",model:{value:_vm.selectKey,callback:function($$v){_vm.selectKey=$$v;},expression:"selectKey"}},_vm._l(_vm.selectKeyList,function(item){return _c("el-option",{key:item.value,attrs:{label:item.label,value:item.value}});}),1):_vm._e(),_vm._v(" "),_c("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:function($event){return _vm.getList({skipCount:1});}},slot:"append"})],1):_vm._e(),_vm._v(" "),_c("el-divider",{attrs:{direction:"vertical"}}),_vm._v(" "),_c("el-button",{attrs:{size:"mini"},on:{click:_vm.actionModal}},[_c("svg",{staticClass:"icon",staticStyle:{color:"#10c2b0",cursor:"pointer"},attrs:{"aria-hidden":"true"}},[_c("use",{attrs:{"xlink:href":"#fontFamily-a-web20_shaixuanpeizhi"}})])])],1)]),_vm._v(" "),_c("div",{staticClass:"tagBox"},_vm._l(_vm.tags,function(tag){return _c("el-tag",{key:tag.name,attrs:{closable:"",type:"info"},on:{close:function($event){return _vm.closeTag(tag);}}},[_c("div",{staticClass:"tagItem"},[_vm._v(_vm._s(tag.name+":"+tag.str))])]);}),1),_vm._v(" "),_vm.tags.length>1?_c("el-button",{staticClass:"clearAll",on:{click:_vm.closeAllTag}},[_vm._v(_vm._s(_vm.trans("取消全部筛选")))]):_vm._e(),_vm._v(" "),_c("el-table",{directives:[{name:"loading",rawName:"v-loading",value:_vm.listLoading,expression:"listLoading"}],key:_vm.tableKey,ref:"FormTable",staticClass:"table",attrs:{data:_vm.list,"row-key":_vm.rowKey,border:"",fit:""},on:{"sort-change":function($event){return _vm.$emit("sortChange",$event);},"selection-change":_vm.handleSelectionChange,"header-dragend":_vm.dragHead,"select-all":_vm.handleSelectAll,select:_vm.handleSelect}},[_vm.hasSelection?_c("el-table-column",{attrs:{type:"selection",width:"50",selectable:_vm.selectable}}):_vm._e(),_vm._v(" "),_vm.hasIndex?_c("el-table-column",{attrs:{label:_vm.trans("序号"),type:"index",width:"50"}}):_vm._e(),_vm._v(" "),_vm._t("additional"),_vm._v(" "),_vm._l(_vm.colDisplayFn(_vm.columnsShow),function(item){return _c("el-table-column",{key:item.columnCode,attrs:{label:item.columnPropertyName,fixed:item.isFixed==1&&"left","min-width":(item.defaultWidth||item.minWidth)+20,"show-overflow-tooltip":"",sortable:_vm.sortableList[item.columnProperty]||false,prop:item.columnProperty,align:"center"},scopedSlots:_vm._u([{key:"header",fn:function(ref){var column=ref.column;return[_c("span",[_vm._v(_vm._s(column.label))]),_vm._v(" "),_vm.$scopedSlots[item.columnProperty+"Header"]?_c("span",[_c("tips",[_vm._t(item.columnProperty+"Header")],2)],1):_vm._e(),_vm._v(" "),item.queryConfig&&item.queryConfig.type&&item.isQuery?_c(item.queryConfig.type,{tag:"component",attrs:{config:item.queryConfig,column:item,setFormParams:_vm.setFormParams,ops:_vm.ops,getConfig:_vm.getConfig,ruleFn:_vm.ruleFn[item.columnProperty]}}):_vm._e()];}},{key:"default",fn:function(ref){var row=ref.row;return[_vm.$scopedSlots[item.columnProperty]?_c("span",[_vm._t(item.columnProperty,null,{props:row,queryConfig:item.queryConfig,options:_vm.getConfig(item),label:_vm.getLabel(item,row)})],2):_c("span",[_vm._v(_vm._s(_vm.getLabel(item,row)))])];}}],null,true)});}),_vm._v(" "),_vm.$scopedSlots.actionBtn?_c("el-table-column",{attrs:{label:_vm.trans("操作"),align:"center",width:_vm.actionWidth,"class-name":"small-padding",fixed:"right"},scopedSlots:_vm._u([{key:"default",fn:function(ref){var row=ref.row;return[_vm._t("actionBtn",null,{props:row})];}}],null,true)}):_vm._e()],2),_vm._v(" "),_c("div",{staticClass:"btmBox"},[_c("div",{staticClass:"btmLeft"},[_vm._t("btmLeft")],2),_vm._v(" "),_c("pagination",{directives:[{name:"show",rawName:"v-show",value:_vm.count>0,expression:"count > 0"}],staticClass:"text-right mt-0 pagi",attrs:{autoScroll:_vm.isAutoScroll,total:_vm.count,page:_vm.searchParams.skipCount,limit:_vm.searchParams.pageSize},on:{"update:page":function($event){return _vm.$set(_vm.searchParams,"skipCount",$event);},"update:limit":function($event){return _vm.$set(_vm.searchParams,"pageSize",$event);},pagination:_vm.getList}})],1),_vm._v(" "),_vm.columns.length>0?_c("select-col",{attrs:{saveMyTemplateColumns:_vm.saveMyTemplateColumns,templateKey:_vm.templateKey,getNewCol:_vm.getNewCol,initialColumns:_vm.columns,columnsShow:_vm.columnsShow,visible:_vm.dialogFormVisible},on:{"update:visible":function($event){_vm.dialogFormVisible=$event;}}}):_vm._e()],1);};var __vue_staticRenderFns__$3=[];__vue_render__$3._withStripped=true;/* style */const __vue_inject_styles__$3=function(inject){if(!inject)return;inject("data-v-3dd95654_0",{source:"\n.el-table__empty-block {\n background: #fbfbfb;\n}\n",map:{"version":3,"sources":["/Users/chenlei/HLcode/test/components/FormTableScheme/index.vue"],"names":[],"mappings":";AA0rBA;EACA,mBAAA;AACA","file":"index.vue","sourcesContent":["<template>\n <div class=\"container\">\n <div class=\"optBox\">\n <div class=\"leftBtn\">\n <slot name=\"leftBtn\"></slot>\n </div>\n <div class=\"rightBtn\">\n <el-input\n v-if=\"hasSearch\"\n v-show=\"searchType == 'textarea'\"\n type=\"textarea\"\n @keyup.enter.native=\"getList({ skipCount: 1 })\"\n :placeholder=\"searchPlaceholder || trans('请输入内容')\"\n :class=\"{\n 'input-with-select': true,\n textareaSpec: searchType == 'textarea',\n }\"\n v-model.trim=\"searchParams[getCurrentKeywordsKey()]\"\n @blur=\"changeType(0)\"\n :rows=\"10\"\n ref=\"myTextarea\"\n >\n <el-button\n slot=\"append\"\n icon=\"el-icon-search\"\n @click=\"getList({ skipCount: 1 })\"\n ></el-button>\n </el-input>\n <el-input\n v-if=\"hasSearch\"\n v-show=\"searchType == 'text'\"\n @keyup.enter.native=\"getList({ skipCount: 1 })\"\n :placeholder=\"searchPlaceholder || trans('请输入内容')\"\n :class=\"{\n 'input-with-select': true,\n width400: selectKeyList.length > 0,\n }\"\n v-model.trim=\"searchParams[getCurrentKeywordsKey()]\"\n @focus=\"changeType(1)\"\n >\n <el-select\n v-model=\"selectKey\"\n slot=\"prepend\"\n placeholder=\"请选择\"\n v-if=\"selectKeyList.length > 0\"\n style=\"width: 120px\"\n @change=\"handleSelectKeyChange\"\n >\n <el-option\n v-for=\"item in selectKeyList\"\n :key=\"item.value\"\n :label=\"item.label\"\n :value=\"item.value\"\n ></el-option>\n </el-select>\n <el-button\n slot=\"append\"\n icon=\"el-icon-search\"\n @click=\"getList({ skipCount: 1 })\"\n ></el-button>\n </el-input>\n <el-divider direction=\"vertical\"></el-divider>\n <el-button size=\"mini\" @click=\"actionModal\">\n <svg\n class=\"icon\"\n aria-hidden=\"true\"\n style=\"color: #10c2b0; cursor: pointer\"\n >\n <use xlink:href=\"#fontFamily-a-web20_shaixuanpeizhi\"></use>\n </svg>\n </el-button>\n </div>\n </div>\n\n <div class=\"tagBox\">\n <el-tag\n v-for=\"tag in tags\"\n :key=\"tag.name\"\n closable\n @close=\"closeTag(tag)\"\n type=\"info\"\n >\n <div class=\"tagItem\">{{ `${tag.name}:${tag.str}` }}</div>\n </el-tag>\n </div>\n <el-button class=\"clearAll\" v-if=\"tags.length > 1\" @click=\"closeAllTag\">{{\n trans(\"取消全部筛选\")\n }}</el-button>\n <el-table\n ref=\"FormTable\"\n v-loading=\"listLoading\"\n :data=\"list\"\n :row-key=\"rowKey\"\n border\n fit\n @sort-change=\"$emit('sortChange', $event)\"\n @selection-change=\"handleSelectionChange\"\n @header-dragend=\"dragHead\"\n @select-all=\"handleSelectAll\"\n @select=\"handleSelect\"\n class=\"table\"\n :key=\"tableKey\"\n >\n <el-table-column\n v-if=\"hasSelection\"\n type=\"selection\"\n width=\"50\"\n :selectable=\"selectable\"\n >\n </el-table-column>\n <el-table-column\n v-if=\"hasIndex\"\n :label=\"trans('序号')\"\n type=\"index\"\n width=\"50\"\n >\n </el-table-column>\n <slot name=\"additional\"></slot>\n <el-table-column\n v-for=\"item in colDisplayFn(columnsShow)\"\n :key=\"item.columnCode\"\n :label=\"item.columnPropertyName\"\n :fixed=\"item.isFixed == 1 && 'left'\"\n :min-width=\"(item.defaultWidth || item.minWidth) + 20\"\n show-overflow-tooltip\n :sortable=\"sortableList[item.columnProperty] || false\"\n :prop=\"item.columnProperty\"\n align=\"center\"\n >\n <template slot=\"header\" slot-scope=\"{ column }\">\n <span>{{ column.label }}</span>\n <span v-if=\"$scopedSlots[`${item.columnProperty}Header`]\">\n <tips>\n <slot :name=\"`${item.columnProperty}Header`\"></slot>\n </tips>\n </span>\n <component\n v-if=\"item.queryConfig && item.queryConfig.type && item.isQuery\"\n v-bind:is=\"item.queryConfig.type\"\n :config=\"item.queryConfig\"\n :column=\"item\"\n :setFormParams=\"setFormParams\"\n :ops=\"ops\"\n :getConfig=\"getConfig\"\n :ruleFn=\"ruleFn[item.columnProperty]\"\n ></component>\n </template>\n <template slot-scope=\"{ row }\">\n <span v-if=\"$scopedSlots[item.columnProperty]\">\n <slot\n :name=\"item.columnProperty\"\n :props=\"row\"\n :queryConfig=\"item.queryConfig\"\n :options=\"getConfig(item)\"\n :label=\"getLabel(item, row)\"\n ></slot>\n </span>\n <span v-else>{{ getLabel(item, row) }}</span>\n </template>\n </el-table-column>\n <el-table-column\n :label=\"trans('操作')\"\n align=\"center\"\n :width=\"actionWidth\"\n class-name=\"small-padding\"\n v-if=\"$scopedSlots.actionBtn\"\n fixed=\"right\"\n >\n <template slot-scope=\"{ row }\">\n <slot name=\"actionBtn\" :props=\"row\"> </slot>\n </template>\n </el-table-column>\n </el-table>\n <div class=\"btmBox\">\n <div class=\"btmLeft\">\n <slot name=\"btmLeft\"></slot>\n </div>\n <pagination\n v-show=\"count > 0\"\n :autoScroll=\"isAutoScroll\"\n class=\"text-right mt-0 pagi\"\n :total=\"count\"\n :page.sync=\"searchParams.skipCount\"\n :limit.sync=\"searchParams.pageSize\"\n @pagination=\"getList\"\n />\n </div>\n\n <select-col\n v-if=\"columns.length > 0\"\n :saveMyTemplateColumns=\"saveMyTemplateColumns\"\n :templateKey=\"templateKey\"\n :getNewCol=\"getNewCol\"\n :initialColumns=\"columns\"\n :columnsShow=\"columnsShow\"\n :visible.sync=\"dialogFormVisible\"\n ></select-col>\n </div>\n</template>\n<script>\n/**\n * 表格\n * fetchParam {object} 请求参数\n * countNum {number} 数据总数 用法:countNum.sync=\"count\"\n * getApi {function} 请求接口\n * formatData {function} 返回参数格式化\n * sortChange {function} 排序事件函数\n * setHeight {string || number} 表格高度\n * selectcheck {function} 选择监听\n * selectable { function } checkbox 筛选禁用\n */\n\nimport {\n SelectCol,\n Check,\n Date,\n Inputsp,\n DateRange,\n Tips,\n pageTemplatecs,\n Radio,\n InputScope,\n Selectsp,\n Cascader,\n} from \"./component/index\";\nimport Pagination from \"@/components/Pagination\";\nimport formatSwitch from \"./format\";\nimport formToValue from \"./component/ColHeader/dataFormat\";\nimport trans from \"../lang/trans\";\nimport getOptions from \"./component/utils\";\nexport default {\n name: \"FormTableScheme\",\n components: {\n SelectCol,\n Check,\n Date,\n Inputsp,\n Pagination,\n DateRange,\n Tips,\n Radio,\n InputScope,\n Selectsp,\n Cascader,\n },\n model: {\n event: \"sortChange\",\n },\n data() {\n return {\n trans,\n dialogFormVisible: false,\n formatSwitch,\n list: [],\n saveMyTemplateColumns:\n this.requestFn.pageTemplatecs.saveMyTemplateColumns,\n columns: [],\n columnsShow: [],\n checkList: [\"复选框 A\"],\n tags: [],\n count: this.countNum,\n keywords: this.keywords,\n searchParams: {\n ...this.fetchParam,\n [this.keywordsKEY]: \"\",\n pageSize: 20,\n skipCount: 1,\n },\n listLoading: false,\n ops: {},\n multipleSelection: [],\n tableKey: \"first\",\n searchType: \"text\",\n selectKey: (() => {\n if (!this.selectKeyList || this.selectKeyList.length === 0) return \"\";\n // 1. 优先使用 fetchParam 中存在的 key\n if (this.fetchParam) {\n const hit = this.selectKeyList.find((i) => this.fetchParam[i.value]);\n if (hit) return hit.value;\n }\n // 2. 其次尝试使用 keywordsKEY (如果它在列表中)\n const hasKeyword = this.selectKeyList.find(\n (i) => i.value === this.keywordsKEY\n );\n if (hasKeyword) return this.keywordsKEY;\n // 3. 最后默认使用第一个\n return this.selectKeyList[0].value;\n })(),\n };\n },\n watch: {\n fetchParam: {\n deep: true,\n immediate: true,\n handler() {\n this.searchParams = {\n ...this.searchParams,\n ...this.fetchParam,\n };\n },\n },\n },\n props: {\n bigSearch: {\n default: false,\n type: Boolean,\n },\n fetchParam: {\n // 上传时附带的参数\n default: () => {\n return {};\n },\n type: Object,\n },\n hasSearch: {\n default: true,\n type: Boolean,\n },\n rowKey: {\n default: \"columnProperty\",\n type: String,\n },\n selectKeyList: {\n default: () => {\n return [];\n },\n type: Array,\n },\n countNum: {\n // 总数\n default: 0,\n type: Number,\n },\n formatData: Function,\n isAutoScroll: {\n default: true,\n type: Boolean,\n },\n setHeight: {\n default: \"\",\n type: String,\n },\n getApi: Function,\n hooks: {\n default: () => {},\n type: Function,\n },\n columnsApi: Function,\n requestFn: {\n default: () => {\n return pageTemplatecs;\n },\n type: Object,\n },\n templateKey: String,\n selectcheck: Function,\n selectType: String,\n hasSelection: Boolean,\n hasIndex: {\n type: Boolean,\n default: false,\n },\n selectable: Function,\n searchPlaceholder: String,\n actionWidth: {\n type: String,\n default: \"100\",\n },\n keywordsKEY: {\n type: String,\n default: \"keywords\",\n },\n ruleFn: {\n type: Object,\n default: function () {\n return {};\n },\n },\n colDisplayFn: {\n type: Function,\n default: function (col) {\n return col;\n },\n },\n sortableList: {\n type: Object,\n default: function () {\n return {};\n },\n },\n isInitQuest: {\n type: Boolean,\n default: true,\n },\n },\n setup() {},\n created() {\n // document.addEventListener('keyup', this.enter)\n },\n destroyed() {\n // document.removeEventListener('keyup', this.enter)\n },\n mounted() {\n this.changePG();\n },\n activated() {\n this.$refs.FormTable.doLayout();\n },\n methods: {\n getCurrentKeywordsKey() {\n return this.selectKey || this.keywordsKEY;\n },\n handleSelectKeyChange(newKey) {\n // 如果之前有值,需要将值转移到新的字段\n if (this.searchParams[this.keywordsKEY] && newKey !== this.keywordsKEY) {\n this.searchParams[newKey] = this.searchParams[this.keywordsKEY];\n this.searchParams[this.keywordsKEY] = \"\";\n }\n },\n getConfig(item) {\n return getOptions(item, this.ruleFn);\n },\n getLabel(item, row) {\n let config = getOptions(item, this.ruleFn);\n return this.formatSwitch(config, row);\n },\n changeType(type) {\n if (!this.bigSearch) return;\n this.searchType = type == 1 ? \"textarea\" : \"text\";\n if (type == 1) {\n this.$nextTick(() => {\n this.$refs.myTextarea.focus();\n });\n }\n },\n dragHead(newWidth, oldWidth, column, event) {\n const findColumn = this.columnsShow.find(\n (c) => c.columnPropertyName == column.label\n );\n let formatWidth = Math.ceil(newWidth);\n this.requestFn.pageTemplatecs\n .saveMyTemplateColumnWidth({\n templateKey: this.templateKey,\n columnCode: findColumn.columnCode,\n width: formatWidth,\n })\n .then((response) => {});\n },\n changePG(pages) {\n this.requestFn.pageTemplatecs\n .selectUserTemplateColumns({ templateKey: this.templateKey })\n .then((response) => {\n if (response.result === \"success\") {\n this.columns = response.data.map((i) => {\n if (i.queryConfig) {\n i.queryConfig = JSON.parse(i.queryConfig);\n }\n return i;\n });\n }\n });\n this.requestFn.pageTemplatecs\n .selectMyTableColumns({ templateKey: this.templateKey })\n .then((response) => {\n if (response.result === \"success\") {\n this.columnsShow = response.data.map((i) => {\n if (i.queryConfig) {\n i.queryConfig = JSON.parse(i.queryConfig);\n }\n return i;\n });\n this.$nextTick(() => {\n if (this.isInitQuest) {\n this.getList();\n }\n });\n }\n });\n },\n setFormParams(obj, type = \"add\") {\n if (type == \"add\") {\n this.searchParams = {\n ...this.searchParams,\n ...obj,\n };\n } else {\n for (let key in obj) {\n delete this.searchParams[key];\n }\n }\n\n this.$nextTick(() => {\n this.getList({\n skipCount: 1,\n });\n });\n },\n enter(e) {\n if (e.key === \"Enter\" || e.keyCode === 13) {\n console.log(\"enter\");\n }\n },\n getList(params, isClearParams = false) {\n let searchParams;\n if (isClearParams) {\n searchParams = {\n ...params,\n pageSize: this.searchParams.pageSize,\n skipCount: 1,\n };\n } else {\n searchParams = {\n ...this.searchParams,\n ...params,\n };\n }\n\n this.searchParams = searchParams;\n\n // 处理数据\n let ops = {};\n for (var key in searchParams) {\n if (\n searchParams[key] !== \"\" &&\n searchParams[key] !== null &&\n searchParams[key] !== undefined\n ) {\n ops[key] = searchParams[key];\n }\n }\n\n // 确保使用正确的关键词字段,并删除其他在selectKeyList中的key值\n if (this.selectKeyList && this.selectKeyList.length > 0) {\n // 获取所有selectKeyList中的key值\n const allSelectKeys = this.selectKeyList.map((item) => item.value);\n\n // 1. 如果有 keywordsKEY 的值,优先使用 keywordsKEY,并覆盖到当前 selectKey\n if (ops[this.keywordsKEY]) {\n // 将 keywordsKEY 的值赋给 selectKey\n ops[this.selectKey] = ops[this.keywordsKEY];\n // 清除 keywordsKEY,避免重复\n if (this.selectKey !== this.keywordsKEY) {\n delete ops[this.keywordsKEY];\n }\n }\n\n // 2. 检查当前 selectKey 是否有值\n // 如果没有值,尝试从其他 selectKeyList 中找到第一个有值的 key 切换过去\n // if (!ops[this.selectKey]) {\n // const activeKey = allSelectKeys.find((key) => ops[key]);\n // if (activeKey) {\n // this.selectKey = activeKey;\n // }\n // }\n\n // 3. 最终清理:只保留当前 selectKey 的值,清除 selectKeyList 中其他 key 的值\n allSelectKeys.forEach((key) => {\n if (key !== this.selectKey && ops[key]) {\n delete ops[key];\n }\n });\n } else if (\n this.selectKey &&\n this.selectKey !== this.keywordsKEY &&\n ops[this.keywordsKEY]\n ) {\n // 兼容原有逻辑\n ops[this.selectKey] = ops[this.keywordsKEY];\n delete ops[this.keywordsKEY];\n }\n\n // 根据参数画tag\n formToValue(ops, this.columnsShow, this.colChange, this.ruleFn);\n\n const { pageSize, skipCount } = ops;\n\n this.listLoading = true;\n this.hooks(ops);\n this.getApi({\n ...ops,\n pageSize: pageSize,\n skipCount: (skipCount - 1) * pageSize,\n reqTypeSign: \"config_table\",\n }).then(\n (response) => {\n if (response.result === \"success\") {\n if (this.formatData) {\n this.list = this.formatData(response.data);\n } else {\n this.list = response.data || [];\n }\n this.ops = ops;\n this.count = response.count;\n } else {\n this.$message.error(response.msg);\n }\n this.$emit(\"update:countNum\", this.count);\n this.listLoading = false;\n this.tableKey = Math.random();\n this.$refs.FormTable.doLayout();\n },\n (err) => {\n this.listLoading = false;\n }\n );\n },\n handleSelectionChange(val) {\n let formatVal = val;\n if (this.selectType === \"single\") {\n formatVal = [val.pop()];\n let other = val;\n if (other && other.length > 0) {\n other.forEach((row) => {\n this.$refs.FormTable.toggleRowSelection(row, false);\n });\n this.$refs.FormTable.toggleRowSelection(formatVal[0], true);\n }\n }\n this.selectcheck(formatVal);\n this.multipleSelection = formatVal;\n this.$emit(\"selectcheck\", formatVal);\n },\n getNewCol(show, all) {\n this.columnsShow = show;\n this.columns = all;\n this.tableKey = Math.random(); // table不刷新 强制key\n },\n closeTag(tag) {\n const index = this.tags.findIndex((i) => i.name === tag.name);\n const delItem = this.tags.splice(index, 1)[0];\n const { key, type } = delItem;\n if (type === \"dateRange\" || type === \"inputScope\") {\n this.setFormParams(\n { [key[0]]: \"\", [key[1]]: \"\", [key[2]]: \"\" },\n \"remove\"\n );\n } else {\n this.setFormParams({ [key]: \"\" }, \"remove\");\n }\n },\n handleSelectAll(val) {\n this.$emit(\"selectAll\", Array.from(val));\n },\n handleSelect(selection, row) {\n this.$emit(\"select\", { selection, row });\n },\n closeAllTag() {\n const delKeys = {};\n this.tags.forEach((i) => {\n const { key, type } = i;\n if (type === \"dateRange\" || type === \"inputScope\") {\n delKeys[key[0]] = \"\";\n delKeys[key[1]] = \"\";\n } else {\n delKeys[key] = \"\";\n }\n });\n this.tags = [];\n this.setFormParams({ ...delKeys }, \"remove\");\n },\n colChange(objTags) {\n // const selectIndex =this.tags.findIndex(i => i.name === arrow)\n // if(selectIndex >= 0){\n // let select = this.tags[selectIndex]\n // if(data.value.length > 0){\n // select.value = data.value\n // select.str = data.str\n // this.$set(this.tags, selectIndex, select)\n // } else {\n // this.tags.splice(selectIndex,1)\n // }\n\n // } else {\n // this.tags = this.tags.concat([{'name':arrow, value:data.value, str:data.str, key:data.searchKey, type: data.type }])\n // }\n const arr = [];\n for (let key in objTags) {\n arr.push(objTags[key]);\n }\n\n this.tags = [].concat(arr);\n },\n\n actionModal() {\n this.dialogFormVisible = true;\n this.columns;\n this.columns = this.columns.map((i) => {\n const isSelect = this.columnsShow.find(\n (j) => j.columnPropertyName === i.columnPropertyName\n );\n i.show = !!isSelect;\n return i;\n });\n },\n },\n};\n</script>\n<style>\n.el-table__empty-block {\n background: #fbfbfb;\n}\n</style>\n<style lang=\"less\" scoped>\n.container {\n padding: 15px;\n margin: 0px;\n width: 100%;\n background: #fff;\n float: left;\n}\n\n.input-with-select {\n width: 300px;\n}\n.width400 {\n width: 400px;\n}\n.optBox {\n margin-bottom: 10px;\n overflow: hidden;\n}\n\n.leftBtn {\n float: left;\n}\n\n.rightBtn {\n float: right;\n .textareaSpec {\n position: absolute;\n right: 100px;\n z-index: 1000;\n width: 700px;\n height: 400px;\n // transition: all 1s ease-out;\n }\n .border {\n border: 1px solid rgb(220, 223, 230);\n }\n}\n\n.tagBox {\n width: calc(100% - 140px);\n float: left;\n overflow: hidden;\n > .el-tag {\n margin: 4px 10px 0 0;\n max-width: 420px;\n /deep/.el-tag__close {\n vertical-align: super;\n }\n }\n .tagItem {\n max-width: 397px;\n display: inline-block;\n white-space: nowrap; /* 防止文本换行 */\n overflow: hidden; /* 隐藏超出的内容 */\n text-overflow: ellipsis; /* 将超出的内容显示为省略号 */\n }\n}\n\n.clearAll {\n float: right;\n}\n\n.table {\n width: 100%;\n margin-top: 10px;\n float: left;\n // overflow-x: visible;\n // overflow-y: visible;\n // /deep/ .el-table__header-wrapper{\n // position: sticky;\n // top:84px;\n // z-index:5;\n // }\n // /deep/ .el-table__fixed-header-wrapper{\n // z-index:5;\n // }\n}\n\n.pagi {\n float: right;\n}\n\n.pagi.pagination-container {\n padding: 0px;\n padding-top: 20px;\n}\n\n.btmBox {\n width: 100%;\n float: left;\n display: flex;\n justify-content: space-between;\n}\n</style>"]},media:undefined}),inject("data-v-3dd95654_1",{source:".container[data-v-3dd95654] {\n padding: 15px;\n margin: 0px;\n width: 100%;\n background: #fff;\n float: left;\n}\n.input-with-select[data-v-3dd95654] {\n width: 300px;\n}\n.width400[data-v-3dd95654] {\n width: 400px;\n}\n.optBox[data-v-3dd95654] {\n margin-bottom: 10px;\n overflow: hidden;\n}\n.leftBtn[data-v-3dd95654] {\n float: left;\n}\n.rightBtn[data-v-3dd95654] {\n float: right;\n}\n.rightBtn .textareaSpec[data-v-3dd95654] {\n position: absolute;\n right: 100px;\n z-index: 1000;\n width: 700px;\n height: 400px;\n}\n.rightBtn .border[data-v-3dd95654] {\n border: 1px solid #dcdfe6;\n}\n.tagBox[data-v-3dd95654] {\n width: calc(100% - 140px);\n float: left;\n overflow: hidden;\n}\n.tagBox > .el-tag[data-v-3dd95654] {\n margin: 4px 10px 0 0;\n max-width: 420px;\n}\n.tagBox > .el-tag[data-v-3dd95654] .el-tag__close {\n vertical-align: super;\n}\n.tagBox .tagItem[data-v-3dd95654] {\n max-width: 397px;\n display: inline-block;\n white-space: nowrap;\n /* 防止文本换行 */\n overflow: hidden;\n /* 隐藏超出的内容 */\n text-overflow: ellipsis;\n /* 将超出的内容显示为省略号 */\n}\n.clearAll[data-v-3dd95654] {\n float: right;\n}\n.table[data-v-3dd95654] {\n width: 100%;\n margin-top: 10px;\n float: left;\n}\n.pagi[data-v-3dd95654] {\n float: right;\n}\n.pagi.pagination-container[data-v-3dd95654] {\n padding: 0px;\n padding-top: 20px;\n}\n.btmBox[data-v-3dd95654] {\n width: 100%;\n float: left;\n display: flex;\n justify-content: space-between;\n}\n",map:{"version":3,"sources":["index.vue"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,WAAW;EACX,WAAW;EACX,gBAAgB;EAChB,WAAW;AACb;AACA;EACE,YAAY;AACd;AACA;EACE,YAAY;AACd;AACA;EACE,mBAAmB;EACnB,gBAAgB;AAClB;AACA;EACE,WAAW;AACb;AACA;EACE,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,YAAY;EACZ,aAAa;EACb,YAAY;EACZ,aAAa;AACf;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,yBAAyB;EACzB,WAAW;EACX,gBAAgB;AAClB;AACA;EACE,oBAAoB;EACpB,gBAAgB;AAClB;AACA;EACE,qBAAqB;AACvB;AACA;EACE,gBAAgB;EAChB,qBAAqB;EACrB,mBAAmB;EACnB,WAAW;EACX,gBAAgB;EAChB,YAAY;EACZ,uBAAuB;EACvB,iBAAiB;AACnB;AACA;EACE,YAAY;AACd;AACA;EACE,WAAW;EACX,gBAAgB;EAChB,WAAW;AACb;AACA;EACE,YAAY;AACd;AACA;EACE,YAAY;EACZ,iBAAiB;AACnB;AACA;EACE,WAAW;EACX,WAAW;EACX,aAAa;EACb,8BAA8B;AAChC","file":"index.vue","sourcesContent":[".container {\n padding: 15px;\n margin: 0px;\n width: 100%;\n background: #fff;\n float: left;\n}\n.input-with-select {\n width: 300px;\n}\n.width400 {\n width: 400px;\n}\n.optBox {\n margin-bottom: 10px;\n overflow: hidden;\n}\n.leftBtn {\n float: left;\n}\n.rightBtn {\n float: right;\n}\n.rightBtn .textareaSpec {\n position: absolute;\n right: 100px;\n z-index: 1000;\n width: 700px;\n height: 400px;\n}\n.rightBtn .border {\n border: 1px solid #dcdfe6;\n}\n.tagBox {\n width: calc(100% - 140px);\n float: left;\n overflow: hidden;\n}\n.tagBox > .el-tag {\n margin: 4px 10px 0 0;\n max-width: 420px;\n}\n.tagBox > .el-tag /deep/ .el-tag__close {\n vertical-align: super;\n}\n.tagBox .tagItem {\n max-width: 397px;\n display: inline-block;\n white-space: nowrap;\n /* 防止文本换行 */\n overflow: hidden;\n /* 隐藏超出的内容 */\n text-overflow: ellipsis;\n /* 将超出的内容显示为省略号 */\n}\n.clearAll {\n float: right;\n}\n.table {\n width: 100%;\n margin-top: 10px;\n float: left;\n}\n.pagi {\n float: right;\n}\n.pagi.pagination-container {\n padding: 0px;\n padding-top: 20px;\n}\n.btmBox {\n width: 100%;\n float: left;\n display: flex;\n justify-content: space-between;\n}\n"]},media:undefined});};/* scoped */const __vue_scope_id__$3="data-v-3dd95654";/* module identifier */const __vue_module_identifier__$3=undefined;/* functional template */const __vue_is_functional_template__$3=false;/* style inject SSR */ /* style inject shadow dom */const __vue_component__$3=/*#__PURE__*/normalizeComponent({render:__vue_render__$3,staticRenderFns:__vue_staticRenderFns__$3},__vue_inject_styles__$3,__vue_script__$3,__vue_scope_id__$3,__vue_is_functional_template__$3,__vue_module_identifier__$3,false,createInjector,undefined,undefined);__vue_component__$3.install=function(Vue){Vue.component(__vue_component__$3.name,__vue_component__$3);};/*!
2305
2319
  * html2canvas 1.4.1 <https://html2canvas.hertzen.com>
2306
2320
  * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
2307
2321
  * Released under MIT License
@@ -2708,4 +2722,4 @@ for(let key in this.formData){if(this.formData[key]!==""){formData.append(key,th
2708
2722
  // fileType: failFileType,
2709
2723
  // };
2710
2724
  const searchParams=new URLSearchParams();searchParams.append("fileCode",fileCode);searchParams.append("fileType",failFileType);for(let key in this.errorParams){if(this.errorParams[key]||this.errorParams[key]==0){searchParams.append(key,this.errorParams[key]);}}// 加密
2711
- let headers={"Content-Type":"application/x-www-form-urlencoded"};const urlApi="/gateway/huilianApi/errorcs/exportErrorFile";if(window.HLEncryption){headers=window.HLEncryption.setRequestHeaders({url:urlApi,headers:headers});}const response=await fetch(urlApi,{method:"post",headers:headers,body:searchParams.toString()});if(!response.ok){throw new Error(`下载请求失败: ${response.statusText}`);}const blob=await response.blob();const name=response.headers.get("content-disposition").split("filename=")[1];const url=window.URL.createObjectURL(blob);const a=document.createElement("a");a.href=url;a.download=decodeURIComponent(name);document.body.appendChild(a);a.click();document.body.removeChild(a);window.URL.revokeObjectURL(url);}else{this.$message({message:"无文件可下载",type:"warning"});}}}};/* 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("span",{staticClass:"StandardImportComponents",staticStyle:{display:"inline-block"}},[_c("el-button",{attrs:{type:_vm.btnType},on:{click:_vm.openDialog}},[_vm._v(_vm._s(_vm.btnText))]),_vm._v(" "),_c("el-dialog",{attrs:{title:_vm.dialogTitle,visible:_vm.dialogVisible,width:"600px","close-on-click-modal":false,"close-on-press-escape":false,"before-close":_vm.handleClose,"append-to-body":""},on:{"update:visible":function($event){_vm.dialogVisible=$event;}}},[_c("div",[_vm._t("content-header")],2),_vm._v(" "),_c("div",{staticStyle:{position:"relative"}},[_c("el-upload",{ref:"importFile",attrs:{action:_vm.importApi,"file-list":_vm.fileList,accept:"."+_vm.fileType,"before-upload":_vm.beforeUploadForm,data:_vm.formData,limit:1,"on-change":_vm.handleChange,"on-remove":_vm.handleRemove,"on-success":_vm.handleSuccess,"on-error":_vm.handleError,"auto-upload":false,"http-request":_vm.customHttpRequest}},[_c("el-button",{attrs:{slot:"trigger",size:"small",type:"primary"},slot:"trigger"},[_vm._v("选取文件")]),_vm._v(" "),_c("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[_vm._v("\n "+_vm._s(_vm.fileTypeComputer)+"\n ")])],1),_vm._v(" "),_c("div",{staticStyle:{position:"absolute",top:"0",left:"100px"}},[_c("el-button",{attrs:{type:"text"},on:{click:_vm.getTemp}},[_vm._v(" 模板下载 ")])],1),_vm._v(" "),_c("div",{directives:[{name:"show",rawName:"v-show",value:_vm.detailData.successCount||_vm.detailData.failCount,expression:"detailData.successCount || detailData.failCount"}],staticClass:"mt-10",staticStyle:{"font-size":"12px","font-weight":"400",color:"#999999"}},[_vm._v("\n 导入结果(仅展示最后一次上传结果):\n "),_c("span",{staticStyle:{color:"#333333"}},[_vm._v("\n 成功"+_vm._s(_vm.detailData.successCount||0)+"条,失败"+_vm._s(_vm.detailData.failCount||0)+"条\n ")]),_vm._v("\n  \n "),_c("a",{directives:[{name:"show",rawName:"v-show",value:_vm.failFileType&&_vm.detailData.failCount,expression:"failFileType && detailData.failCount"}],staticStyle:{color:"#599ebf"},attrs:{href:"javascript:void(0)"},on:{click:function($event){return _vm.downloadFile(_vm.fileCode,_vm.failFileType);}}},[_vm._v("\n 下载失败信息\n ")])])],1),_vm._v(" "),_c("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[_c("el-button",{on:{click:_vm.handleClose}},[_vm._v(" 取 消 ")]),_vm._v(" "),_c("el-button",{attrs:{type:"primary",loading:_vm.isSubmitLoading},on:{click:_vm.query}},[_vm._v("\n 确 定\n ")])],1)])],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.5.4";const components=[__vue_component__$j,__vue_component__$i,__vue_component__$h,__vue_component__$g,__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__$1 as ExportList,__vue_component__$3 as FormTableScheme,__vue_component__$i as HelloVue,__vue_component__$2 as HtmlToImg,__vue_component__$j as MyButton,__vue_component__$g as ShowFile,__vue_component__ as StandardImport,__vue_component__$h as UploadFile,index as default,install};
2725
+ let headers={"Content-Type":"application/x-www-form-urlencoded"};const urlApi="/gateway/huilianApi/errorcs/exportErrorFile";if(window.HLEncryption){headers=window.HLEncryption.setRequestHeaders({url:urlApi,headers:headers});}const response=await fetch(urlApi,{method:"post",headers:headers,body:searchParams.toString()});if(!response.ok){throw new Error(`下载请求失败: ${response.statusText}`);}const blob=await response.blob();const name=response.headers.get("content-disposition").split("filename=")[1];const url=window.URL.createObjectURL(blob);const a=document.createElement("a");a.href=url;a.download=decodeURIComponent(name);document.body.appendChild(a);a.click();document.body.removeChild(a);window.URL.revokeObjectURL(url);}else{this.$message({message:"无文件可下载",type:"warning"});}}}};/* 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("span",{staticClass:"StandardImportComponents",staticStyle:{display:"inline-block"}},[_c("el-button",{attrs:{type:_vm.btnType},on:{click:_vm.openDialog}},[_vm._v(_vm._s(_vm.btnText))]),_vm._v(" "),_c("el-dialog",{attrs:{title:_vm.dialogTitle,visible:_vm.dialogVisible,width:"600px","close-on-click-modal":false,"close-on-press-escape":false,"before-close":_vm.handleClose,"append-to-body":""},on:{"update:visible":function($event){_vm.dialogVisible=$event;}}},[_c("div",[_vm._t("content-header")],2),_vm._v(" "),_c("div",{staticStyle:{position:"relative"}},[_c("el-upload",{ref:"importFile",attrs:{action:_vm.importApi,"file-list":_vm.fileList,accept:"."+_vm.fileType,"before-upload":_vm.beforeUploadForm,data:_vm.formData,limit:1,"on-change":_vm.handleChange,"on-remove":_vm.handleRemove,"on-success":_vm.handleSuccess,"on-error":_vm.handleError,"auto-upload":false,"http-request":_vm.customHttpRequest}},[_c("el-button",{attrs:{slot:"trigger",size:"small",type:"primary"},slot:"trigger"},[_vm._v("选取文件")]),_vm._v(" "),_c("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[_vm._v("\n "+_vm._s(_vm.fileTypeComputer)+"\n ")])],1),_vm._v(" "),_c("div",{staticStyle:{position:"absolute",top:"0",left:"100px"}},[_c("el-button",{attrs:{type:"text"},on:{click:_vm.getTemp}},[_vm._v(" 模板下载 ")])],1),_vm._v(" "),_c("div",{directives:[{name:"show",rawName:"v-show",value:_vm.detailData.successCount||_vm.detailData.failCount,expression:"detailData.successCount || detailData.failCount"}],staticClass:"mt-10",staticStyle:{"font-size":"12px","font-weight":"400",color:"#999999"}},[_vm._v("\n 导入结果(仅展示最后一次上传结果):\n "),_c("span",{staticStyle:{color:"#333333"}},[_vm._v("\n 成功"+_vm._s(_vm.detailData.successCount||0)+"条,失败"+_vm._s(_vm.detailData.failCount||0)+"条\n ")]),_vm._v("\n  \n "),_c("a",{directives:[{name:"show",rawName:"v-show",value:_vm.failFileType&&_vm.detailData.failCount,expression:"failFileType && detailData.failCount"}],staticStyle:{color:"#599ebf"},attrs:{href:"javascript:void(0)"},on:{click:function($event){return _vm.downloadFile(_vm.fileCode,_vm.failFileType);}}},[_vm._v("\n 下载失败信息\n ")])])],1),_vm._v(" "),_c("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[_c("el-button",{on:{click:_vm.handleClose}},[_vm._v(" 取 消 ")]),_vm._v(" "),_c("el-button",{attrs:{type:"primary",loading:_vm.isSubmitLoading},on:{click:_vm.query}},[_vm._v("\n 确 定\n ")])],1)])],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.1";const components=[__vue_component__$j,__vue_component__$i,__vue_component__$h,__vue_component__$g,__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__$1 as ExportList,__vue_component__$3 as FormTableScheme,__vue_component__$i as HelloVue,__vue_component__$2 as HtmlToImg,__vue_component__$j as MyButton,__vue_component__$g as ShowFile,__vue_component__ as StandardImport,__vue_component__$h 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.5.4",
3
+ "version": "3.7.1",
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",