lihai-oa/public/static/assets/gougu/module/formSelects.js

1 line
34 KiB
JavaScript
Raw Normal View History

2023-10-24 15:17:16 +08:00
"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function _defineProperty(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}(function(e,t,n){if((typeof exports==="undefined"?"undefined":_typeof(exports))==="object"){module.exports=n()}else if(typeof define==="function"&&define.amd){define(n)}else if(t.layui&&e.define){e.define(["jquery"],function(e){e("formSelects",n())})}else{t.formSelects=n()}})(typeof layui=="undefined"?null:layui,window,function(){var t="4.0.0.0910",v="xm-select",m="xm-select-parent",y="xm-select-input",g="xm-select--suffix",w="xm-select-this",x="xm-select-label",k="xm-select-search",b="xm-select-search-type",C="xm-select-show-count",S="xm-select-create",d="xm-select-create-long",T="xm-select-max",L="xm-select-skin",j="xm-select-direction",A="xm-select-height",E="xm-dis-disabled",N="xm-select-dis",p="xm-select-temp",D="xm-select-radio",H="xm-select-linkage",F="xm-select-dl",h="xm-select-hide",_="xm-hide-input",O="xm-select-sj",e="xm-icon-close",I="xm-select-title",P="xm-form-select",f="xm-form-selected",V="xm-select-none",U="xm-select-empty",M="xm-input",W="xm-dl-input",J="xm-select-tips",s="xm-iconfont",B="XM_PID_VALUE",R="xm-cz",l="xm-cz-group",n="请选择",q={},z={on:{},endOn:{},filter:{},maxTips:{},opened:{},closed:{}},X={type:"get",header:{},first:true,data:{},searchUrl:"",searchName:"keyword",searchVal:null,keyName:"name",keyVal:"value",keySel:"selected",keyDis:"disabled",keyChildren:"children",dataType:"",delay:500,beforeSuccess:null,success:null,error:null,beforeSearch:null,response:{statusCode:0,statusName:"code",msgName:"msg",dataName:"data"},tree:{nextClick:function e(t,n,i){i([])},folderChoose:true,lazy:true}},i=[{icon:"xm-iconfont icon-quanxuan",name:"全选",click:function e(t,n){n.selectAll(t,true,true)}},{icon:"xm-iconfont icon-qingkong",name:"清空",click:function e(t,n){n.removeAll(t,true,true)}},{icon:"xm-iconfont icon-fanxuan",name:"反选",click:function e(t,n){n.reverse(t,true,true)}},{icon:"xm-iconfont icon-pifu",name:"换肤",click:function e(t,n){n.skin(t)}}],Q=window.$||window.layui&&window.layui.jquery,c=Q(window),Y={},a={},r={},$=function e(t){var l=this;this.config={name:null,max:null,maxTips:function e(t,n,i,a){var r=Q('[xid="'+l.config.name+'"]').prev().find("."+v);if(r.parents(".layui-form-item[pane]").length){r=r.parents(".layui-form-item[pane]")}r.attr("style","border-color: red !important");setTimeout(function(){r.removeAttr("style")},300)},init:null,on:null,opened:null,closed:null,filter:function e(t,n,i,a){return i.name.indexOf(n)==-1},clearid:-1,direction:"auto",height:null,isEmpty:false,btns:[i[0],i[1],i[2]],searchType:0,create:function e(t,n){return Date.now()},template:function e(t,n){return n.name},showCount:0,isCreate:false,placeholder:n,clearInput:false};this.select=null;this.values=[];Q.extend(this.config,t,{searchUrl:t.isSearch?t.searchUrl:null,placeholder:t.optionsFirst?t.optionsFirst.value?n:t.optionsFirst.innerHTML||n:n,btns:t.radio?[i[1]]:[i[0],i[1],i[2]]},r[t.name]||a);if(isNaN(this.config.showCount)||this.config.showCount<=0){this.config.showCount=19921012}};var o=function e(){this.appender();this.on();this.onreset()};o.prototype.appender=function(){if(!Array.prototype.map){Array.prototype.map=function(e,t){var n,i,a,r=Object(this),l=r.length>>>0;if(t){n=t}i=new Array(l);a=0;while(a<l){var o,s;if(a in r){o=r[a];s=e.call(n,o,a,r);i[a]=s}a++}return i}}if(!Array.prototype.forEach){Array.prototype.forEach=function e(t,n){var i,a;if(this==null){throw new TypeError("this is null or not defined")}var r=Object(this);var l=r.length>>>0;if(typeof t!=="function"){throw new TypeError(t+" is not a function")}if(arguments.length>1){i=n}a=0;while(a<l){var o;if(a in r){o=r[a];t.call(i,o,a,r)}a++}}}if(!Array.prototype.filter){Array.prototype.filter=function(e){if(this===void 0||this===null){throw new TypeError}va