general-basic-form 1.1.2 → 1.1.3

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/dist/index.js CHANGED
@@ -241,7 +241,7 @@ const $ = {
241
241
  formData: {
242
242
  handler(t, e) {
243
243
  JSON.stringify(t) !== JSON.stringify(e) && (this.queryParams = {
244
- ...this.noUrlParameters ? {} : this.queryParams,
244
+ ...this.queryParams,
245
245
  ...t
246
246
  });
247
247
  },
@@ -412,7 +412,7 @@ var C = function() {
412
412
  e.$set(e.queryParams, r.prop, n);
413
413
  }, expression: "queryParams[item.prop]" } }, "el-checkbox-group", e.getCheckboxGroupSetting(r), !1), e.getCheckboxGroupEvents(r)), e._l(r.option || [], function(n) {
414
414
  return a("el-checkbox", e._b({ key: n.key || n.value || n.label }, "el-checkbox", n, !1));
415
- }), 1) : e._e()], 1);
415
+ }), 1) : e._e(), /^form-item-slot$/i.test(r.type) ? e._t(r.name) : e._e()], 2);
416
416
  }), e._t("default"), e.formOnly ? e._e() : a("el-form-item", [a("el-button", { attrs: { type: "primary", icon: "el-icon-search", size: e.size, loading: e.formLoading }, on: { click: e.handleQuery } }, [e._v("查询")]), a("el-button", { attrs: { icon: "el-icon-refresh", size: e.size }, on: { click: e.resetQuery } }, [e._v("重置")])], 1), e._t("behind-the-button")], 2);
417
417
  }, F = [], q = /* @__PURE__ */ u(
418
418
  $,
@@ -420,7 +420,7 @@ var C = function() {
420
420
  F,
421
421
  !1,
422
422
  null,
423
- "7443e052",
423
+ "a632e129",
424
424
  null,
425
425
  null
426
426
  );
@@ -727,7 +727,7 @@ var J = function() {
727
727
  return a("el-tabs", e._b({ on: { "tab-click": e.handleClick }, model: { value: e.activeName, callback: function(r) {
728
728
  e.activeName = r;
729
729
  }, expression: "activeName" } }, "el-tabs", e.$attrs, !1), [e._l(e.tabPanes, function(r) {
730
- return a("el-tab-pane", e._b({ key: r.name }, "el-tab-pane", r, !1), [e._v(" " + e._s(r.context && r.context()) + " ")]);
730
+ return a("el-tab-pane", e._b({ key: r.name }, "el-tab-pane", r, !1), [e._v(" " + e._s(r.render && r.render(r)) + " ")]);
731
731
  }), e._t("default")], 2);
732
732
  }, H = [], M = /* @__PURE__ */ u(
733
733
  Q,
@@ -735,7 +735,7 @@ var J = function() {
735
735
  H,
736
736
  !1,
737
737
  null,
738
- "39f45842",
738
+ "91cf6f01",
739
739
  null,
740
740
  null
741
741
  );
@@ -1 +1 @@
1
- (function(i,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],f):(i=typeof globalThis<"u"?globalThis:i||self,f(i.Index={},i.Vue))})(this,function(i,f){"use strict";const ae="";function c(t,e,a,r,n,o,p,ee){var s=typeof t=="function"?t.options:t;e&&(s.render=e,s.staticRenderFns=a,s._compiled=!0),r&&(s.functional=!0),o&&(s._scopeId="data-v-"+o);var u;if(p?(u=function(l){l=l||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!l&&typeof __VUE_SSR_CONTEXT__<"u"&&(l=__VUE_SSR_CONTEXT__),n&&n.call(this,l),l&&l._registeredComponents&&l._registeredComponents.add(p)},s._ssrRegister=u):n&&(u=ee?function(){n.call(this,(s.functional?this.parent:this).$root.$options.shadowRoot)}:n),u)if(s.functional){s._injectStyles=u;var te=s.render;s.render=function(re,y){return u.call(y),te(re,y)}}else{var h=s.beforeCreate;s.beforeCreate=h?[].concat(h,u):[u]}return{exports:t,options:s}}const _={props:{verificationSetting:{type:Object,default:()=>{}},getSmscode:{type:Function,default:()=>{}}},data(){return{defaultText:this.verificationSetting.defaultText||"获取验证码",buttonText:this.verificationSetting.defaultText||"获取验证码",restTime:this.verificationSetting.restTime||60,timer:null}},computed:{buttonType(){return this.buttonText===this.defaultText}},destroyed(){this.reset()},methods:{reset(){this.timer&&(clearInterval(this.timer),this.timer=null,this.buttonText=this.defaultText)},async buttonClick(){if(this.buttonText===this.defaultText)if(this.buttonText=this.restTime,this.timer=setInterval(()=>{if(Number(this.buttonText)<=0||!this.buttonText){this.reset();return}else this.buttonText=Number(this.buttonText)-1},1e3),this.getSmscode)await this.getSmscode()===!1&&this.reset();else return}}};var m=function(){var e=this,a=e._self._c;return a("el-button",{on:{click:e.buttonClick}},[e._v(e._s(e.buttonType?e.defaultText:e.buttonText+"s"))])},g=[],b=c(_,m,g,!1,null,null,null,null);const v=b.exports,k=(t={})=>{for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const a=t[e];Object.prototype.toString.call(a)==="[object Object]"&&(t[e]=JSON.stringify(a))}return t},x=(t={})=>{for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const a=t[e];try{/[{]+/g.test(a)&&/[}]+/g.test(a)&&(t[e]=JSON.parse(a))}catch{}}return t},S={paramsToQuery:k,queryToData:x},d=S,ne="",T={name:"GeneralBasicForm",components:{InputArchive:t=>{const{templateEle:e}=t;return e()},VerificationButton:v},props:{showSearch:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},formOnly:{type:Boolean,default:!1},getList:{type:Function,default:()=>{}},afterReset:{type:Function,default:()=>{}},formItem:{type:Array,default:()=>[]},size:{type:String,default:""},labelWidth:{type:String,default:"90px"},noUrlParameters:{type:Boolean,default:()=>!1},formData:{type:Object,default:()=>{}},noInputBlank:{type:Boolean,default:()=>!1},currentPageKey:{type:String,default:"page"},pageSizeKey:{type:String,default:"limit"},defCurrentPage:{type:Number,default:1},defPageSize:{type:Number,default:10}},data(){var t;return{queryParams:{...this.noUrlParameters?{}:d.queryToData((t=this.$route)==null?void 0:t.query)},formLoading:this.loading||!1,selectSetting:{placeholder:"请选择",filterable:!0,clearable:!0,style:"width: 200px"},inputSetting:{placeholder:"请输入",style:"width: 200px",clearable:!0},datePackerSetting:{style:"width: 227px","start-placeholder":"开始日期","end-placeholder":"结束日期",type:"daterange"},attrs:{inline:!0,"label-position":"left"}}},watch:{formData:{handler(t,e){JSON.stringify(t)!==JSON.stringify(e)&&(this.queryParams={...this.noUrlParameters?{}:this.queryParams,...t})},immediate:!0},queryParams:{handler(t){this.$emit("update:formData",t)},deep:!0},$attrs:{handler(t){this.attrs={...this.attrs,...t}},immediate:!0,deep:!0},loading(t){this.formLoading!==t&&(this.formLoading=t)},formLoading(t){this.loading!==t&&this.$emit("update:loading",t)}},methods:{handleQuery(){var a;const t={[this.currentPageKey]:this.defCurrentPage,[this.pageSizeKey]:this.defPageSize},e=d.paramsToQuery({...(a=this.$route)==null?void 0:a.query,...this.queryParams,...t});this.noUrlParameters||this.$router.push({query:{...e}}),this.getList({...e})},async resetQuery(){var e;this.$refs.queryFormRef.resetFields();const t={[this.currentPageKey]:this.defCurrentPage};this.noUrlParameters||await this.$router.push({query:{...t}}),this.queryParams={...this.noUrlParameters?{}:d.queryToData((e=this.$route)==null?void 0:e.query)},this.afterReset(),this.handleQuery()},currentInputComponent(){return"input-archive"},getItemRules(t){const{type:e,rules:a=[]}=t,r=[...a];return this.noInputBlank&&e==="input"&&r.push({pattern:this.trimRegex,message:"请输入(不能仅输入空格)",trigger:"blur"}),r},getInputSetting(t){const{inputSetting:e,setting:a}=t;return{...this.inputSetting,...e,...a}},defaultFunction(){},getInputEvents(t){return{blur:t.blur||this.defaultFunction,focus:t.focus||this.defaultFunction,change:t.change||this.defaultFunction,input:t.input||this.defaultFunction,clear:t.clear||this.defaultFunction}},getSelectSetting(t){const{selectSetting:e,setting:a}=t;return{...this.selectSetting,...e,...a}},getSelectEvents(t){return{change:t.change||this.defaultFunction,"visible-change":t["visible-change"]||this.defaultFunction,"remove-tag":t["remove-tag"]||this.defaultFunction,"expand-change":t["expand-change"]||this.defaultFunction,clear:t.clear||this.defaultFunction,blur:t.blur||this.defaultFunction,focus:t.focus||this.defaultFunction}},getDatePackerSetting(t){const{datePackerSetting:e,setting:a}=t;return{...this.datePackerSetting,...e,...a}},getDatePackerEvents(t){return{change:t.change||this.defaultFunction,blur:t.blur||this.defaultFunction,focus:t.focus||this.defaultFunction}},getCheckboxGroupSetting(t){const{checkboxGroupSetting:e,setting:a}=t;return{...e,...a}},getCheckboxGroupEvents(t){return{change:t.change||this.defaultFunction}}}};var P=function(){var e=this,a=e._self._c;return a("el-form",e._b({directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],ref:"queryFormRef",attrs:{model:e.queryParams,"label-width":e.labelWidth}},"el-form",e.attrs,!1),[e._l(e.formItem,function(r){return a("el-form-item",e._b({key:r.prop,attrs:{rules:e.getItemRules(r)}},"el-form-item",r,!1),[r.type==="input"?a("el-input",e._g(e._b({attrs:{size:e.size},nativeOn:{keydown:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.getList.apply(null,arguments)}},scopedSlots:e._u([e._l(r.template,function(n,o){return{key:o,fn:function(){return[n?a(e.currentInputComponent(),{key:o,tag:"component",attrs:{templateEle:n}}):e._e()]},proxy:!0}})],null,!0),model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-input",e.getInputSetting(r),!1),e.getInputEvents(r))):r.type==="input-mobile-verification"?a("el-input",e._g(e._b({attrs:{size:e.size},nativeOn:{keydown:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.getList.apply(null,arguments)}},scopedSlots:e._u([e._l(r.template,function(n,o){return{key:o,fn:function(){return[n?a(e.currentInputComponent(),{key:o,tag:"component",attrs:{templateEle:n}}):e._e()]},proxy:!0}})],null,!0),model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-input",e.getInputSetting(r),!1),e.getInputEvents(r)),[a("template",{slot:"append"},[a("verification-button",{attrs:{verificationSetting:r.verificationSetting,getSmscode:r.getSmscode}})],1)],2):r.type==="select"?a("el-select",e._g(e._b({attrs:{filterable:"",size:e.size},model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-select",e.getSelectSetting(r),!1),e.getSelectEvents(r)),e._l(r.option||[],function(n){return a("el-option",{key:n.key||n.value,attrs:{label:n.label,value:n.value}})}),1):r.type==="cascader"?a("el-cascader",e._g(e._b({attrs:{filterable:"",size:e.size,options:r.options||[]},model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-cascader",e.getSelectSetting(r),!1),e.getSelectEvents(r))):r.type==="date-picker"?a("el-date-picker",e._g(e._b({attrs:{size:e.size},model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-date-picker",e.getDatePackerSetting(r),!1),e.getDatePackerEvents(r))):e._e(),r.type==="input-number"?a("el-input-number",e._g(e._b({attrs:{size:e.size},model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-input-number",e.getInputSetting(r),!1),e.getInputEvents(r))):r.type==="checkbox"?a("el-checkbox-group",e._g(e._b({attrs:{size:e.size},model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-checkbox-group",e.getCheckboxGroupSetting(r),!1),e.getCheckboxGroupEvents(r)),e._l(r.option||[],function(n){return a("el-checkbox",e._b({key:n.key||n.value||n.label},"el-checkbox",n,!1))}),1):e._e()],1)}),e._t("default"),e.formOnly?e._e():a("el-form-item",[a("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:e.size,loading:e.formLoading},on:{click:e.handleQuery}},[e._v("查询")]),a("el-button",{attrs:{icon:"el-icon-refresh",size:e.size},on:{click:e.resetQuery}},[e._v("重置")])],1),e._t("behind-the-button")],2)},$=[],C=c(T,P,$,!1,null,"7443e052",null,null);const F=C.exports,se="",q={components:{},props:{query:{type:Object,default:()=>({prefCode:sessionStorage.getItem("prefCode")})},routePath:{type:String,default:()=>"/search/searchDetail"},inputstyle:{type:Object,default:()=>({width:"1280px"})},openHref:{type:Boolean,default:()=>!1},size:{type:String,default:()=>"medium"}},data(){var t,e;return{keyWord:((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.keyWord)||"",attrs:{}}},watch:{$attrs:{handler(t){this.attrs={...this.attrs,...t}},immediate:!0,deep:!0}},methods:{search(){const t={path:this.routePath,query:{...this.query,keyWord:this.keyWord}};if(this.openHref){const e=this.$router.resolve(t);window.open(e.href,"_blank")}else this.$router.push(t)}}};var N=function(){var e=this,a=e._self._c;return a("div",{staticClass:"search-box"},[a("el-input",e._b({style:{...e.inputstyle},attrs:{size:e.size},nativeOn:{keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.search.apply(null,arguments)}},model:{value:e.keyWord,callback:function(r){e.keyWord=r},expression:"keyWord"}},"el-input",e.attrs,!1),[a("svg",{staticClass:"el-input__icon",attrs:{slot:"prefix",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},slot:"prefix"},[a("path",{attrs:{d:"M9.51033 10.2186C8.69189 10.8814 7.64943 11.2784 6.51424 11.2784C3.88302 11.2784 1.75 9.14541 1.75 6.51421C1.75 3.88301 3.88302 1.75 6.51424 1.75C9.14545 1.75 11.2785 3.88301 11.2785 6.51421C11.2785 7.64942 10.8814 8.69189 10.2186 9.51034L13.75 13.0417L13.0417 13.75L9.51033 10.2186ZM10.2768 6.51421C10.2768 4.43623 8.59224 2.75168 6.51424 2.75168C4.43623 2.75168 2.75168 4.43623 2.75168 6.51421C2.75168 8.59219 4.43623 10.2767 6.51424 10.2767C8.59224 10.2767 10.2768 8.59219 10.2768 6.51421Z",fill:"#959A9F"}})])])],1)},w=[],O=c(q,N,w,!1,null,"ef706e31",null,null);const D=O.exports,z={name:"Descriptions",components:{DescriptionsColumn:{functional:!0,props:{column:{default:{render:()=>{}},type:Object},formData:{default:{},type:Object}},render(t,e){const{props:a}=e,{column:r,formData:n}=a;return r.render(n)}}},data(){return{attrs:{border:!0,class:"v-descriptions"}}},props:{formItem:{type:Array,default:()=>[]},formData:{type:Object,default:()=>{}}},watch:{$attrs:{handler(t){this.attrs={...this.attrs,...t}},immediate:!0,deep:!0}}};var I=function(){var e=this,a=e._self._c;return a("el-descriptions",e._b({},"el-descriptions",e.attrs,!1),e._l(e.formItem,function(r,n){return a("el-descriptions-item",e._b({key:r.prop,attrs:{label:r.label}},"el-descriptions-item",r.descriptionsItemProps,!1),[r.render?a("DescriptionsColumn",{attrs:{column:r,formData:e.formData}}):a("span",[e._v(e._s(e.formData[r.prop]))])],1)}),1)},B=[],K=c(z,I,B,!1,null,null,null,null);const L=K.exports,oe="",R={props:{nodeKey:{type:String,default:"id"},filterable:{type:Boolean,default:!1},dataSource:{type:Array,default:()=>[]},checkedKeys:{type:Array,default:()=>[]}},watch:{sourceFilterText(t){this.$refs.sourceTree.filter(t)},selectedFilterText(t){this.$refs.selectTree.filter(t)},checkedKeys(t){this.$refs.sourceTree.setCheckedKeys(t),f.nextTick(()=>{this.getSelectedData(),this.$refs.selectTree.setCheckedKeys(t)})}},data(){return{defaultTreeAttributes:{"default-expand-all":!0,"show-checkbox":!0},selectedList:[],sourceFilterText:"",selectedFilterText:""}},methods:{sourceFilterNode(t,e){return t?e.label.indexOf(t)!==-1:!0},getSelectedData(){let t=!0,e;const a=this.$refs.sourceTree.getCheckedNodes(t,e);this.selectedList=a},removeSelectedData(){let t,e;const a=this.$refs.selectTree.getCheckedNodes(t,e),r={};a.forEach(n=>{r[n[this.nodeKey]]=n}),this.selectedList=this.selectedList.filter(n=>!r[n[this.nodeKey]])}}};var E=function(){var e=this,a=e._self._c;return a("div",{staticClass:"tree-box"},[a("div",{staticClass:"left-box"},[e.filterable?a("el-input",{attrs:{placeholder:"输入关键字进行过滤"},model:{value:e.sourceFilterText,callback:function(r){e.sourceFilterText=r},expression:"sourceFilterText"}}):e._e(),a("el-tree",e._b({ref:"sourceTree",attrs:{data:e.dataSource,"filter-node-method":e.sourceFilterNode,nodeKey:e.nodeKey}},"el-tree",{...e.defaultTreeAttributes},!1))],1),a("div",{staticClass:"mid-box"},[a("el-button",{attrs:{icon:"el-icon-arrow-right",circle:""},on:{click:e.getSelectedData}}),a("el-button",{attrs:{icon:"el-icon-arrow-left",circle:""},on:{click:e.removeSelectedData}})],1),a("div",{staticClass:"right-box"},[e.filterable?a("el-input",{attrs:{placeholder:"输入关键字进行过滤"},model:{value:e.selectedFilterText,callback:function(r){e.selectedFilterText=r},expression:"selectedFilterText"}}):e._e(),a("el-tree",e._b({ref:"selectTree",attrs:{data:e.selectedList,"filter-node-method":e.sourceFilterNode,nodeKey:e.nodeKey}},"el-tree",{...e.defaultTreeAttributes},!1))],1)])},A=[],V=c(R,E,A,!1,null,"49dbad2a",null,null);const j=V.exports,le="",U={name:"VTabs",data(){return{activeName:this.activeNameInit()}},props:{tabPanes:{type:Array,default:()=>[]},noUrlParameters:{type:Boolean,default:()=>!1},activeNameKey:{type:String,default:"activeName"},defActiveName:{type:String},getList:{type:Function,default:()=>{}}},watch:{defActiveName:{handler(t,e){JSON.stringify(t)!==JSON.stringify(e)&&(this.activeName=t)},immediate:!0},activeName:{handler(t){this.$emit(`update:${this.activeNameKey}`,t)}}},methods:{handleClick(t,e){var r;const a=d.paramsToQuery({...(r=this.$route)==null?void 0:r.query,[this.activeNameKey]:this.activeName});this.noUrlParameters||this.$router.push({query:{...a}}),this.getList({...a})},activeNameInit(){var a,r,n;let t="";(a=this.tabPanes[0])!=null&&a.name&&(t=(r=this.tabPanes[0])==null?void 0:r.name);const e=d.queryToData(Number((n=this.$route)==null?void 0:n.query[this.activeNameKey]));return!this.noUrlParameters&&e&&(t=e),this.defActiveName&&(t=this.defActiveName),`${t}`}}};var G=function(){var e=this,a=e._self._c;return a("el-tabs",e._b({on:{"tab-click":e.handleClick},model:{value:e.activeName,callback:function(r){e.activeName=r},expression:"activeName"}},"el-tabs",e.$attrs,!1),[e._l(e.tabPanes,function(r){return a("el-tab-pane",e._b({key:r.name},"el-tab-pane",r,!1),[e._v(" "+e._s(r.context&&r.context())+" ")])}),e._t("default")],2)},W=[],Q=c(U,G,W,!1,null,"39f45842",null,null);const J=Q.exports,H=F,M=D,X=L,Z=j,Y=J;i.VDescriptions=X,i.VGeneralBasicForm=H,i.VSearchBox=M,i.VTabs=Y,i.VTreeTransfer=Z,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
1
+ (function(i,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],f):(i=typeof globalThis<"u"?globalThis:i||self,f(i.Index={},i.Vue))})(this,function(i,f){"use strict";const ae="";function c(t,e,a,r,n,o,p,ee){var s=typeof t=="function"?t.options:t;e&&(s.render=e,s.staticRenderFns=a,s._compiled=!0),r&&(s.functional=!0),o&&(s._scopeId="data-v-"+o);var u;if(p?(u=function(l){l=l||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!l&&typeof __VUE_SSR_CONTEXT__<"u"&&(l=__VUE_SSR_CONTEXT__),n&&n.call(this,l),l&&l._registeredComponents&&l._registeredComponents.add(p)},s._ssrRegister=u):n&&(u=ee?function(){n.call(this,(s.functional?this.parent:this).$root.$options.shadowRoot)}:n),u)if(s.functional){s._injectStyles=u;var te=s.render;s.render=function(re,y){return u.call(y),te(re,y)}}else{var h=s.beforeCreate;s.beforeCreate=h?[].concat(h,u):[u]}return{exports:t,options:s}}const _={props:{verificationSetting:{type:Object,default:()=>{}},getSmscode:{type:Function,default:()=>{}}},data(){return{defaultText:this.verificationSetting.defaultText||"获取验证码",buttonText:this.verificationSetting.defaultText||"获取验证码",restTime:this.verificationSetting.restTime||60,timer:null}},computed:{buttonType(){return this.buttonText===this.defaultText}},destroyed(){this.reset()},methods:{reset(){this.timer&&(clearInterval(this.timer),this.timer=null,this.buttonText=this.defaultText)},async buttonClick(){if(this.buttonText===this.defaultText)if(this.buttonText=this.restTime,this.timer=setInterval(()=>{if(Number(this.buttonText)<=0||!this.buttonText){this.reset();return}else this.buttonText=Number(this.buttonText)-1},1e3),this.getSmscode)await this.getSmscode()===!1&&this.reset();else return}}};var m=function(){var e=this,a=e._self._c;return a("el-button",{on:{click:e.buttonClick}},[e._v(e._s(e.buttonType?e.defaultText:e.buttonText+"s"))])},g=[],b=c(_,m,g,!1,null,null,null,null);const v=b.exports,k=(t={})=>{for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const a=t[e];Object.prototype.toString.call(a)==="[object Object]"&&(t[e]=JSON.stringify(a))}return t},x=(t={})=>{for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const a=t[e];try{/[{]+/g.test(a)&&/[}]+/g.test(a)&&(t[e]=JSON.parse(a))}catch{}}return t},S={paramsToQuery:k,queryToData:x},d=S,ne="",T={name:"GeneralBasicForm",components:{InputArchive:t=>{const{templateEle:e}=t;return e()},VerificationButton:v},props:{showSearch:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},formOnly:{type:Boolean,default:!1},getList:{type:Function,default:()=>{}},afterReset:{type:Function,default:()=>{}},formItem:{type:Array,default:()=>[]},size:{type:String,default:""},labelWidth:{type:String,default:"90px"},noUrlParameters:{type:Boolean,default:()=>!1},formData:{type:Object,default:()=>{}},noInputBlank:{type:Boolean,default:()=>!1},currentPageKey:{type:String,default:"page"},pageSizeKey:{type:String,default:"limit"},defCurrentPage:{type:Number,default:1},defPageSize:{type:Number,default:10}},data(){var t;return{queryParams:{...this.noUrlParameters?{}:d.queryToData((t=this.$route)==null?void 0:t.query)},formLoading:this.loading||!1,selectSetting:{placeholder:"请选择",filterable:!0,clearable:!0,style:"width: 200px"},inputSetting:{placeholder:"请输入",style:"width: 200px",clearable:!0},datePackerSetting:{style:"width: 227px","start-placeholder":"开始日期","end-placeholder":"结束日期",type:"daterange"},attrs:{inline:!0,"label-position":"left"}}},watch:{formData:{handler(t,e){JSON.stringify(t)!==JSON.stringify(e)&&(this.queryParams={...this.queryParams,...t})},immediate:!0},queryParams:{handler(t){this.$emit("update:formData",t)},deep:!0},$attrs:{handler(t){this.attrs={...this.attrs,...t}},immediate:!0,deep:!0},loading(t){this.formLoading!==t&&(this.formLoading=t)},formLoading(t){this.loading!==t&&this.$emit("update:loading",t)}},methods:{handleQuery(){var a;const t={[this.currentPageKey]:this.defCurrentPage,[this.pageSizeKey]:this.defPageSize},e=d.paramsToQuery({...(a=this.$route)==null?void 0:a.query,...this.queryParams,...t});this.noUrlParameters||this.$router.push({query:{...e}}),this.getList({...e})},async resetQuery(){var e;this.$refs.queryFormRef.resetFields();const t={[this.currentPageKey]:this.defCurrentPage};this.noUrlParameters||await this.$router.push({query:{...t}}),this.queryParams={...this.noUrlParameters?{}:d.queryToData((e=this.$route)==null?void 0:e.query)},this.afterReset(),this.handleQuery()},currentInputComponent(){return"input-archive"},getItemRules(t){const{type:e,rules:a=[]}=t,r=[...a];return this.noInputBlank&&e==="input"&&r.push({pattern:this.trimRegex,message:"请输入(不能仅输入空格)",trigger:"blur"}),r},getInputSetting(t){const{inputSetting:e,setting:a}=t;return{...this.inputSetting,...e,...a}},defaultFunction(){},getInputEvents(t){return{blur:t.blur||this.defaultFunction,focus:t.focus||this.defaultFunction,change:t.change||this.defaultFunction,input:t.input||this.defaultFunction,clear:t.clear||this.defaultFunction}},getSelectSetting(t){const{selectSetting:e,setting:a}=t;return{...this.selectSetting,...e,...a}},getSelectEvents(t){return{change:t.change||this.defaultFunction,"visible-change":t["visible-change"]||this.defaultFunction,"remove-tag":t["remove-tag"]||this.defaultFunction,"expand-change":t["expand-change"]||this.defaultFunction,clear:t.clear||this.defaultFunction,blur:t.blur||this.defaultFunction,focus:t.focus||this.defaultFunction}},getDatePackerSetting(t){const{datePackerSetting:e,setting:a}=t;return{...this.datePackerSetting,...e,...a}},getDatePackerEvents(t){return{change:t.change||this.defaultFunction,blur:t.blur||this.defaultFunction,focus:t.focus||this.defaultFunction}},getCheckboxGroupSetting(t){const{checkboxGroupSetting:e,setting:a}=t;return{...e,...a}},getCheckboxGroupEvents(t){return{change:t.change||this.defaultFunction}}}};var P=function(){var e=this,a=e._self._c;return a("el-form",e._b({directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],ref:"queryFormRef",attrs:{model:e.queryParams,"label-width":e.labelWidth}},"el-form",e.attrs,!1),[e._l(e.formItem,function(r){return a("el-form-item",e._b({key:r.prop,attrs:{rules:e.getItemRules(r)}},"el-form-item",r,!1),[r.type==="input"?a("el-input",e._g(e._b({attrs:{size:e.size},nativeOn:{keydown:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.getList.apply(null,arguments)}},scopedSlots:e._u([e._l(r.template,function(n,o){return{key:o,fn:function(){return[n?a(e.currentInputComponent(),{key:o,tag:"component",attrs:{templateEle:n}}):e._e()]},proxy:!0}})],null,!0),model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-input",e.getInputSetting(r),!1),e.getInputEvents(r))):r.type==="input-mobile-verification"?a("el-input",e._g(e._b({attrs:{size:e.size},nativeOn:{keydown:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.getList.apply(null,arguments)}},scopedSlots:e._u([e._l(r.template,function(n,o){return{key:o,fn:function(){return[n?a(e.currentInputComponent(),{key:o,tag:"component",attrs:{templateEle:n}}):e._e()]},proxy:!0}})],null,!0),model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-input",e.getInputSetting(r),!1),e.getInputEvents(r)),[a("template",{slot:"append"},[a("verification-button",{attrs:{verificationSetting:r.verificationSetting,getSmscode:r.getSmscode}})],1)],2):r.type==="select"?a("el-select",e._g(e._b({attrs:{filterable:"",size:e.size},model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-select",e.getSelectSetting(r),!1),e.getSelectEvents(r)),e._l(r.option||[],function(n){return a("el-option",{key:n.key||n.value,attrs:{label:n.label,value:n.value}})}),1):r.type==="cascader"?a("el-cascader",e._g(e._b({attrs:{filterable:"",size:e.size,options:r.options||[]},model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-cascader",e.getSelectSetting(r),!1),e.getSelectEvents(r))):r.type==="date-picker"?a("el-date-picker",e._g(e._b({attrs:{size:e.size},model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-date-picker",e.getDatePackerSetting(r),!1),e.getDatePackerEvents(r))):e._e(),r.type==="input-number"?a("el-input-number",e._g(e._b({attrs:{size:e.size},model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-input-number",e.getInputSetting(r),!1),e.getInputEvents(r))):r.type==="checkbox"?a("el-checkbox-group",e._g(e._b({attrs:{size:e.size},model:{value:e.queryParams[r.prop],callback:function(n){e.$set(e.queryParams,r.prop,n)},expression:"queryParams[item.prop]"}},"el-checkbox-group",e.getCheckboxGroupSetting(r),!1),e.getCheckboxGroupEvents(r)),e._l(r.option||[],function(n){return a("el-checkbox",e._b({key:n.key||n.value||n.label},"el-checkbox",n,!1))}),1):e._e(),/^form-item-slot$/i.test(r.type)?e._t(r.name):e._e()],2)}),e._t("default"),e.formOnly?e._e():a("el-form-item",[a("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:e.size,loading:e.formLoading},on:{click:e.handleQuery}},[e._v("查询")]),a("el-button",{attrs:{icon:"el-icon-refresh",size:e.size},on:{click:e.resetQuery}},[e._v("重置")])],1),e._t("behind-the-button")],2)},$=[],C=c(T,P,$,!1,null,"a632e129",null,null);const F=C.exports,se="",q={components:{},props:{query:{type:Object,default:()=>({prefCode:sessionStorage.getItem("prefCode")})},routePath:{type:String,default:()=>"/search/searchDetail"},inputstyle:{type:Object,default:()=>({width:"1280px"})},openHref:{type:Boolean,default:()=>!1},size:{type:String,default:()=>"medium"}},data(){var t,e;return{keyWord:((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.keyWord)||"",attrs:{}}},watch:{$attrs:{handler(t){this.attrs={...this.attrs,...t}},immediate:!0,deep:!0}},methods:{search(){const t={path:this.routePath,query:{...this.query,keyWord:this.keyWord}};if(this.openHref){const e=this.$router.resolve(t);window.open(e.href,"_blank")}else this.$router.push(t)}}};var N=function(){var e=this,a=e._self._c;return a("div",{staticClass:"search-box"},[a("el-input",e._b({style:{...e.inputstyle},attrs:{size:e.size},nativeOn:{keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.search.apply(null,arguments)}},model:{value:e.keyWord,callback:function(r){e.keyWord=r},expression:"keyWord"}},"el-input",e.attrs,!1),[a("svg",{staticClass:"el-input__icon",attrs:{slot:"prefix",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},slot:"prefix"},[a("path",{attrs:{d:"M9.51033 10.2186C8.69189 10.8814 7.64943 11.2784 6.51424 11.2784C3.88302 11.2784 1.75 9.14541 1.75 6.51421C1.75 3.88301 3.88302 1.75 6.51424 1.75C9.14545 1.75 11.2785 3.88301 11.2785 6.51421C11.2785 7.64942 10.8814 8.69189 10.2186 9.51034L13.75 13.0417L13.0417 13.75L9.51033 10.2186ZM10.2768 6.51421C10.2768 4.43623 8.59224 2.75168 6.51424 2.75168C4.43623 2.75168 2.75168 4.43623 2.75168 6.51421C2.75168 8.59219 4.43623 10.2767 6.51424 10.2767C8.59224 10.2767 10.2768 8.59219 10.2768 6.51421Z",fill:"#959A9F"}})])])],1)},w=[],O=c(q,N,w,!1,null,"ef706e31",null,null);const D=O.exports,z={name:"Descriptions",components:{DescriptionsColumn:{functional:!0,props:{column:{default:{render:()=>{}},type:Object},formData:{default:{},type:Object}},render(t,e){const{props:a}=e,{column:r,formData:n}=a;return r.render(n)}}},data(){return{attrs:{border:!0,class:"v-descriptions"}}},props:{formItem:{type:Array,default:()=>[]},formData:{type:Object,default:()=>{}}},watch:{$attrs:{handler(t){this.attrs={...this.attrs,...t}},immediate:!0,deep:!0}}};var I=function(){var e=this,a=e._self._c;return a("el-descriptions",e._b({},"el-descriptions",e.attrs,!1),e._l(e.formItem,function(r,n){return a("el-descriptions-item",e._b({key:r.prop,attrs:{label:r.label}},"el-descriptions-item",r.descriptionsItemProps,!1),[r.render?a("DescriptionsColumn",{attrs:{column:r,formData:e.formData}}):a("span",[e._v(e._s(e.formData[r.prop]))])],1)}),1)},B=[],K=c(z,I,B,!1,null,null,null,null);const L=K.exports,oe="",R={props:{nodeKey:{type:String,default:"id"},filterable:{type:Boolean,default:!1},dataSource:{type:Array,default:()=>[]},checkedKeys:{type:Array,default:()=>[]}},watch:{sourceFilterText(t){this.$refs.sourceTree.filter(t)},selectedFilterText(t){this.$refs.selectTree.filter(t)},checkedKeys(t){this.$refs.sourceTree.setCheckedKeys(t),f.nextTick(()=>{this.getSelectedData(),this.$refs.selectTree.setCheckedKeys(t)})}},data(){return{defaultTreeAttributes:{"default-expand-all":!0,"show-checkbox":!0},selectedList:[],sourceFilterText:"",selectedFilterText:""}},methods:{sourceFilterNode(t,e){return t?e.label.indexOf(t)!==-1:!0},getSelectedData(){let t=!0,e;const a=this.$refs.sourceTree.getCheckedNodes(t,e);this.selectedList=a},removeSelectedData(){let t,e;const a=this.$refs.selectTree.getCheckedNodes(t,e),r={};a.forEach(n=>{r[n[this.nodeKey]]=n}),this.selectedList=this.selectedList.filter(n=>!r[n[this.nodeKey]])}}};var E=function(){var e=this,a=e._self._c;return a("div",{staticClass:"tree-box"},[a("div",{staticClass:"left-box"},[e.filterable?a("el-input",{attrs:{placeholder:"输入关键字进行过滤"},model:{value:e.sourceFilterText,callback:function(r){e.sourceFilterText=r},expression:"sourceFilterText"}}):e._e(),a("el-tree",e._b({ref:"sourceTree",attrs:{data:e.dataSource,"filter-node-method":e.sourceFilterNode,nodeKey:e.nodeKey}},"el-tree",{...e.defaultTreeAttributes},!1))],1),a("div",{staticClass:"mid-box"},[a("el-button",{attrs:{icon:"el-icon-arrow-right",circle:""},on:{click:e.getSelectedData}}),a("el-button",{attrs:{icon:"el-icon-arrow-left",circle:""},on:{click:e.removeSelectedData}})],1),a("div",{staticClass:"right-box"},[e.filterable?a("el-input",{attrs:{placeholder:"输入关键字进行过滤"},model:{value:e.selectedFilterText,callback:function(r){e.selectedFilterText=r},expression:"selectedFilterText"}}):e._e(),a("el-tree",e._b({ref:"selectTree",attrs:{data:e.selectedList,"filter-node-method":e.sourceFilterNode,nodeKey:e.nodeKey}},"el-tree",{...e.defaultTreeAttributes},!1))],1)])},A=[],V=c(R,E,A,!1,null,"49dbad2a",null,null);const j=V.exports,le="",U={name:"VTabs",data(){return{activeName:this.activeNameInit()}},props:{tabPanes:{type:Array,default:()=>[]},noUrlParameters:{type:Boolean,default:()=>!1},activeNameKey:{type:String,default:"activeName"},defActiveName:{type:String},getList:{type:Function,default:()=>{}}},watch:{defActiveName:{handler(t,e){JSON.stringify(t)!==JSON.stringify(e)&&(this.activeName=t)},immediate:!0},activeName:{handler(t){this.$emit(`update:${this.activeNameKey}`,t)}}},methods:{handleClick(t,e){var r;const a=d.paramsToQuery({...(r=this.$route)==null?void 0:r.query,[this.activeNameKey]:this.activeName});this.noUrlParameters||this.$router.push({query:{...a}}),this.getList({...a})},activeNameInit(){var a,r,n;let t="";(a=this.tabPanes[0])!=null&&a.name&&(t=(r=this.tabPanes[0])==null?void 0:r.name);const e=d.queryToData(Number((n=this.$route)==null?void 0:n.query[this.activeNameKey]));return!this.noUrlParameters&&e&&(t=e),this.defActiveName&&(t=this.defActiveName),`${t}`}}};var G=function(){var e=this,a=e._self._c;return a("el-tabs",e._b({on:{"tab-click":e.handleClick},model:{value:e.activeName,callback:function(r){e.activeName=r},expression:"activeName"}},"el-tabs",e.$attrs,!1),[e._l(e.tabPanes,function(r){return a("el-tab-pane",e._b({key:r.name},"el-tab-pane",r,!1),[e._v(" "+e._s(r.render&&r.render(r))+" ")])}),e._t("default")],2)},W=[],Q=c(U,G,W,!1,null,"91cf6f01",null,null);const J=Q.exports,H=F,M=D,X=L,Z=j,Y=J;i.VDescriptions=X,i.VGeneralBasicForm=H,i.VSearchBox=M,i.VTabs=Y,i.VTreeTransfer=Z,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "general-basic-form",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "type": "module",