LJWWDMSelect-legacy.8df26109.js 12 KB

1
  1. !function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}System.register(["./index-legacy.a130dba2.js","./LJWWData-legacy.844c3ebc.js"],(function(t,l){"use strict";var n,o,d,i,a,r,w,c,m=document.createElement("style");return m.textContent='@charset "UTF-8";.lj-ww-d-m-tree{width:100%;position:relative;box-sizing:border-box;transition:border-color .2s cubic-bezier(.645,.045,.355,1);border-radius:4px;border:1px solid #dcdfe6}.lj-ww-d-m-tree.lj-ww-d-m-tree-down:after{content:"";position:fixed;z-index:1;left:0;top:0;width:100vw;height:100vh;background-color:rgba(0,0,0,0)}.lj-ww-d-m-tree.lj-ww-d-m-tree-down .lj-ww-d-m-down-main{z-index:2;height:400px;border:1px solid #e4e7ed}.lj-ww-d-m-tree:hover{border-color:#409eff;cursor:pointer}.lj-ww-d-m-tree:hover .lj-ww-d-m-icon i{color:#409eff}.lj-ww-d-m-tree .lj-ww-d-m-content{position:relative;z-index:10}.lj-ww-d-m-tree .lj-ww-d-m-content{display:grid;grid-template-columns:1fr 24px;align-items:center}.lj-ww-d-m-tree .lj-ww-d-m-content .lj-ww-d-m-input-placeholder{height:calc(var(--lj-ww-d-m-content-height) - 2px);line-height:calc(var(--lj-ww-d-m-content-height) - 2px);padding:0 .4em;user-select:none;color:#c2c7ce}.lj-ww-d-m-tree .lj-ww-d-m-content .lj-ww-d-m-input{height:calc(var(--lj-ww-d-m-content-height) - 2px);padding:0 .4em;display:flex;justify-content:flex-start;align-items:center;flex-wrap:nowrap;gap:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lj-ww-d-m-tree .lj-ww-d-m-content .lj-ww-d-m-input .lj-d-m-item{background-color:#f3f7ff;color:#182b4e;padding:.2em .3em;border-radius:2px;transition:all .1s linear;display:flex;justify-content:flex-start;align-items:center;flex-wrap:nowrap;gap:4px}.lj-ww-d-m-tree .lj-ww-d-m-content .lj-ww-d-m-input .lj-d-m-item:hover{background-color:#edf1f9;color:#182b4e}.lj-ww-d-m-tree .lj-ww-d-m-content .lj-ww-d-m-input .lj-d-m-item:has(.lj-d-m-delete-icon:hover){background-color:red;color:#fff}.lj-ww-d-m-tree .lj-ww-d-m-content .lj-ww-d-m-input .lj-d-m-item .lj-d-m-label{user-select:none}.lj-ww-d-m-tree .lj-ww-d-m-content .lj-ww-d-m-icon{display:flex;align-content:center}.lj-ww-d-m-tree .lj-ww-d-m-down-main{position:absolute;z-index:-2000;width:100%;height:0;overflow:hidden;top:calc(100% + 10px);left:0;transition:height .15s;transform-origin:center top;border-radius:4px;background-color:#fff;box-shadow:0 2px 12px rgba(0,0,0,.1)}.lj-ww-d-m-tree .lj-ww-d-m-down-main:after{content:"";position:absolute;top:-14px;left:20px;border:7px solid transparent;border-bottom-color:#dcdfe6}.lj-ww-d-m-tree .lj-ww-d-m-down-main .lj-ww-d-m-down-title,.lj-ww-d-m-tree .lj-ww-d-m-down-main .lj-ww-d-m-down-filter,.lj-ww-d-m-tree .lj-ww-d-m-down-main .lj-ww-d-m-down-tree,.lj-ww-d-m-tree .lj-ww-d-m-down-main .lj-ww-d-m-down-footer{padding-left:10px;padding-right:10px}.lj-ww-d-m-tree .lj-ww-d-m-down-main .lj-ww-d-m-down-title{height:44px;line-height:44px;border-bottom:1px solid #e4e7ed;color:#333;font-size:16px;font-weight:700;user-select:none}.lj-ww-d-m-tree .lj-ww-d-m-down-main .lj-ww-d-m-down-filter{height:44px;display:flex;align-items:center}.lj-ww-d-m-tree .lj-ww-d-m-down-main .lj-ww-d-m-down-tree{height:268px;overflow-y:auto}.lj-ww-d-m-tree .lj-ww-d-m-down-main .lj-ww-d-m-down-footer{height:44px;display:flex;justify-content:space-between;align-items:center;border-top:1px solid #e4e7ed;user-select:none}.lj-ww-d-m-tree .lj-ww-d-m-down-main .lj-ww-d-m-down-footer .statistics{color:#2c3d5d;font-size:16px}.lj-ww-d-m-tree .lj-ww-d-m-down-main .lj-ww-d-m-down-footer .statistics .statistics-value{color:#0052cc}.lj-ww-d-m-tree .lj-ww-d-m-down-main .el-tree-node__expand-icon{display:none!important}.lj-ww-d-m-tree .lj-ww-d-m-down-main .lj-ww-d-m-custom-tree-node{width:100%;display:grid;grid-template-columns:1fr 60px;align-content:center;user-select:none;align-items:center;height:0}.lj-ww-d-m-tree .lj-ww-d-m-down-main .lj-ww-d-m-custom-tree-node .next-level-btn{color:#ccc;user-select:none;display:none}.lj-ww-d-m-tree .lj-ww-d-m-down-main .lj-ww-d-m-custom-tree-node .next-level-btn.show{display:block}.lj-ww-d-m-tree .lj-ww-d-m-down-main .lj-ww-d-m-custom-tree-node .next-level-btn .icon-xiaji{font-size:14px}.lj-ww-d-m-tree .lj-ww-d-m-down-main .lj-ww-d-m-custom-tree-node .next-level-btn .next-level-label{margin-left:.2em}.lj-ww-d-m-tree.lj-ww-d-m-tree-dialog{background-color:red;border:none;width:0;height:0;overflow:hidden}.lj-ww-d-m-tree.lj-ww-d-m-tree-dialog.lj-ww-d-m-tree-dialog-is-dialog-show{position:fixed;z-index:2000;top:0;left:0;background-color:rgba(0,0,0,.1);width:100vw;height:100vh;display:flex;justify-content:center;align-items:center}.lj-ww-d-m-tree.lj-ww-d-m-tree-dialog.lj-ww-d-m-tree-dialog-is-dialog-show .lj-ww-d-m-down-main{position:static;z-index:2;height:var(--lj-ww-d-m-dialog-height)}.lj-ww-d-m-tree.lj-ww-d-m-tree-dialog .lj-ww-d-m-content{display:none}.lj-ww-d-m-tree.lj-ww-d-m-tree-dialog .lj-ww-d-m-down-main{z-index:-2000;width:var(--lj-ww-d-m-dialog-width);background-color:#fff}.lj-ww-d-m-tree.lj-ww-d-m-tree-dialog .lj-ww-d-m-down-main .lj-ww-d-m-down-title{height:44px;line-height:44px}.lj-ww-d-m-tree.lj-ww-d-m-tree-dialog .lj-ww-d-m-down-main .lj-ww-d-m-down-filter{height:44px;display:flex;align-items:center}.lj-ww-d-m-tree.lj-ww-d-m-tree-dialog .lj-ww-d-m-down-main .lj-ww-d-m-down-tree{height:calc(var(--lj-ww-d-m-dialog-height) - 44px - 44px - 44px);overflow-y:auto}.lj-ww-d-m-tree.lj-ww-d-m-tree-dialog .lj-ww-d-m-down-main .lj-ww-d-m-down-footer{height:44px}\n',document.head.appendChild(m),{setters:[function(e){n=e.n,o=e.r,d=e.b,i=e.w,a=e.t,r=e.o,w=e.$},function(e){c=e.L}],execute:function(){var l={__name:"LJWWDMSelect",props:{visible:{type:Boolean,default:!1},value:{type:Array,default:function(){return[]}},valueType:{type:String,default:"string"},treeProps:{type:Object,default:function(){return{children:"children",label:"name",value:"mark"}}},defaultCheckedKeys:{type:Array,default:function(){return[]}},placeholder:{type:String,default:"请选择"},height:{type:String,default:"36px"},dialog:{type:Boolean,default:!1},dialogWidth:{type:String,default:"600px"},dialogHeight:{type:String,default:"500px"}},emits:["input","dept","member"],setup:function(t,l){var n=l.expose,m=l.emit,s=t,u=o([]),p=o(""),f=o(!1),h=o(),j=o([]),g=o([]),v=o(!1),y=o(!1),x=o({true:"el-icon-arrow-up",false:"el-icon-arrow-down"}),b=o(!1);function k(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!e||e.indexOf("-")<0?e:e.split("-")[1]}var C=d((function(){return u.value.filter((function(e){return 1===e.type})).map((function(e){return k(e.mark)}))})),_=d((function(){return u.value.filter((function(e){return 2===e.type})).map((function(e){return k(e.mark)}))}));i((function(){return u.value}),(function(){var e,t;f.value=u.value.length===g.value.length,"string"===s.valueType?(e=C.value.join(","),t=_.value.join(",")):"array"===s.valueType&&(e=C.value,t=_.value),a((function(){m("input",u.value),m("dept",e),m("member",t)}))})),i((function(){return p.value}),(function(e){h.value.filter(e)})),i((function(){return s.defaultCheckedKeys}),(function(){a((function(){T()}))}),{deep:!0}),i((function(){return s.visible}),(function(e){e&&z()}));function D(t){var l=t.data;l&&"object"===e(l)&&!Array.isArray(l)&&t.checked&&(console.log("modelInputValue.value:",u.value),h.value.setChecked(l.mark,!1,!1)),t.parent?D(t.parent):a((function(){b.value=!1,S()}))}function W(e){var t=h.value.getNode(e.mark);t&&t.parent&&D(t.parent)}function S(){a((function(){var e=h.value.getCheckedNodes();u.value=e.map((function(e){return{mark:e.mark,name:e.name,type:e.type}}))}))}var T=function(e,t){if(!b.value){if(!t&&e&&2===e.type)return b.value=!0,void W(e);e&&1===e.type&&e.children&&e.children.length&&e.children.filter((function(e){return 2===e.type})).map((function(e){h.value.setChecked(e.mark,t,!1)})),S()}};function z(){u.value=[],h.value.setCheckedKeys([])}function I(){w.getters.company?HTTP.post("get_company_dept",{company_id:w.getters.company}).then((function(e){if(0!==e.code)return j.value=[];j.value=e.data;!function e(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],l=0;l<t.length;l++)g.value.push(t[l].mark),t[l].children&&e(t[l].children)}(j.value),a((function(){s.defaultCheckedKeys.length&&T()}))})).catch((function(e){console.log("error:",e)})):console.log("LJWWDMSelect getCompanyDept not company")}function L(){y.value=!0,console.log("打开dialog")}return n({show:L}),r((function(){I()})),{__sfc:!0,emits:m,props:s,modelInputValue:u,filterText:p,allChecked:f,downTreeRef:h,treeData:j,treeDataKeys:g,isDown:v,isDialogShow:y,lJWWDMIcons:x,cancel_personnel_ing:b,formatId:k,deptIds:C,memberIds:_,filterNode:function(e,t){return!e||-1!==t.name.indexOf(e)},getWWDataNodeKeyType:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.indexOf("user")>-1?2:e.indexOf("dept")>-1?1:""},handleClick:function(){if(y.value)return y.value=!1;v.value=!v.value},handleDeleteModelValue:function(e,t){u.value.splice(t,1),h.value.setChecked(e.mark,!1,!1)},removeDeptParent:D,getUpperLevelDeptParent:W,updateModelInputValue:S,handleCheckChange:T,handleAllChecked:function(e){e?(h.value.setCheckedKeys(g.value),a((function(){T()}))):z()},handleAllClear:z,getCompanyDept:I,show:L,LJWWData:c}}},m=function(){var e=this,t=e._self._c,l=e._self._setupProxy;return t("div",{staticClass:"lj-ww-d-m-tree",class:{"lj-ww-d-m-tree-down":l.isDown,"lj-ww-d-m-tree-dialog":e.dialog,"lj-ww-d-m-tree-dialog-is-dialog-show":l.isDialogShow},style:{"--lj-ww-d-m-content-height":e.height,"--lj-ww-d-m-dialog-width":e.dialogWidth,"--lj-ww-d-m-dialog-height":e.dialogHeight},on:{click:function(e){return e.stopPropagation(),l.handleClick.apply(null,arguments)}}},[t("div",{staticClass:"lj-ww-d-m-content"},[l.modelInputValue.length?t("div",{staticClass:"lj-ww-d-m-input"},e._l(l.modelInputValue,(function(e,n){return t("div",{key:n,staticClass:"lj-d-m-item"},[t("div",{staticClass:"lj-d-m-label"},[t(l.LJWWData,{attrs:{type:l.getWWDataNodeKeyType(e.mark),openid:e.name}})],1),t("i",{staticClass:"lj-d-m-delete-icon el-icon-close",on:{click:function(t){return t.stopPropagation(),l.handleDeleteModelValue(e,n)}}})])})),0):e._e(),l.modelInputValue.length?e._e():t("div",{staticClass:"lj-ww-d-m-input-placeholder"},[e._v(" "+e._s(e.placeholder)+" ")]),t("div",{staticClass:"lj-ww-d-m-icon"},[t("i",{class:l.lJWWDMIcons[l.isDown]})])]),t("div",{staticClass:"lj-ww-d-m-down-main",on:{click:function(e){return e.stopPropagation(),function(){}.apply(null,arguments)}}},[t("div",{staticClass:"lj-ww-d-m-down-title"},[e._v("部门/员工")]),t("div",{staticClass:"lj-ww-d-m-down-filter"},[t("el-input",{attrs:{placeholder:"请输入内容"},model:{value:l.filterText,callback:function(e){l.filterText=e},expression:"filterText"}})],1),t("div",{staticClass:"lj-ww-d-m-down-tree"},[t("el-checkbox",{on:{change:l.handleAllChecked},model:{value:l.allChecked,callback:function(e){l.allChecked=e},expression:"allChecked"}},[e._v(" 全部 ")]),t("el-tree",{ref:"downTreeRef",attrs:{"show-checkbox":"","check-strictly":"","node-key":"mark",data:l.treeData,"default-checked-keys":e.defaultCheckedKeys,props:e.treeProps,"filter-node-method":l.filterNode},on:{"check-change":l.handleCheckChange},scopedSlots:e._u([{key:"default",fn:function(n){var o=n.data;return t("div",{staticClass:"lj-ww-d-m-custom-tree-node"},[t(l.LJWWData,{attrs:{type:o.type,openid:o.name}}),t("div",{staticClass:"next-level-btn",class:{show:1===o.type&&o.children.length}},[t("i",{staticClass:"iconfont icon-xiaji"}),t("span",{staticClass:"next-level-label"},[e._v("下级")])])],1)}}])})],1),t("div",{staticClass:"lj-ww-d-m-down-footer"},[t("div",{staticClass:"statistics"},[e._v(" 已选择 "),t("span",{staticClass:"statistics-value"},[e._v(e._s(l.modelInputValue.length))]),e._v(" 项 ")]),t("el-button",{attrs:{type:"text"},on:{click:function(e){return e.stopPropagation(),l.handleAllClear.apply(null,arguments)}}},[e._v("清空")])],1)])])},s=[];m._withStripped=!0;var u=n(l,m,s,!1,null,null,null,null);u.options.__file="E:/十二科技/项目/九号同事/salary-management-web/src/components/LJWWDMSelect/LJWWDMSelect.vue";t("L",u.exports)}}}))}();