1 |
- webpackJsonp([8],{A2bL:function(e,t,n){(e.exports=n("FZ+f")(!1)).push([e.i,"\n.el-row {\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n -webkit-box-align: stretch;\n -ms-flex-align: stretch;\n align-items: stretch;\n}\n.custom-tree-node {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n font-size: 14px;\n padding-right: 8px;\n}\n.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {\n background-color: rgba(64, 158, 255, 0.2);\n}\n.transfer-container {\n position: relative;\n}\n.transfer-container .transfer-title {\n width: 100%;\n height: 40px;\n line-height: 40px;\n text-align: center;\n position: absolute;\n top: 0;\n}\n.transfer-container .el-transfer {\n height: 100%;\n padding-top: 55px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: stretch;\n -ms-flex-align: stretch;\n align-items: stretch;\n}\n.transfer-container .el-transfer-panel {\n position: relative;\n}\n.transfer-container .el-transfer-panel__header {\n position: absolute;\n top: 0;\n width: 100%;\n}\n.transfer-container .el-transfer-panel__body {\n padding-top: 40px;\n height: 100%;\n}\n.transfer-container .el-transfer-panel__list {\n height: auto;\n max-height: 670px;\n}\n.transfer-container .el-transfer-panel .transfer-footer {\n margin-left: 15px;\n padding: 6px 5px;\n}\n.transfer-container .el-transfer__buttons {\n padding: 0 10px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n",""])},ksOi:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("0xDb"),a={name:"RoleControl",methods:{treeFilterMethod:function(e,t){return Object(r.b)(e,t.label)},treeNodeDrop:function(){console.log(arguments)},treeSelected:function(e){console.log(arguments),this.transferTitle=e.label,e.value?this.transferValue=e.value:this.transferValue=[]},treeEdit:function(e){this.$prompt("请输入角色名","编辑",{inputPattern:/.+/,inputValue:e.label}).then(function(t){var n=t.value;e.label=n})},treeAdd:function(e){var t=this;this.$prompt("请输入角色名","新增",{inputPattern:/.+/,inputValue:e.label}).then(function(n){var r=n.value,a={id:t.id++,label:r,children:[]};e.children||t.$set(e,"children",[]),e.children.push(a)})},treeDel:function(e,t){this.$confirm("是否删除","删除",{type:"warning"}).then(function(){var n=e.parent,r=n.data.children||n.data,a=r.findIndex(function(e){return e.id===t.id});r.splice(a,1)})},transferFilterMethod:function(e,t){return Object(r.b)(e,t.pinyin)},transferChange:function(){console.log(this.transferValue)}},watch:{treeFilterText:function(e){this.$refs.tree.filter(e)}},data:function(){return{treeId:100,treeData:[{id:1,label:"一级 1",value:[0],children:[{id:4,label:"二级 1-1",value:[1],children:[{id:9,label:"三级 1-1-1",value:[2]},{id:10,label:"三级 1-1-2",value:[3]}]}]},{id:2,label:"一级 2",children:[{id:5,label:"二级 2-1"},{id:6,label:"二级 2-2"}]},{id:3,label:"一级 3",children:[{id:7,label:"二级 3-1"},{id:8,label:"二级 3-2",children:[{id:11,label:"三级 3-2-1"},{id:12,label:"三级 3-2-2"},{id:13,label:"三级 3-2-3"}]}]}],treeProps:{children:"children",label:"label"},treeFilterText:"",transferValue:[],transferTitle:"",transferData:function(e){var t=[],n=["shanghai","beijing","guangzhou","shenzhen","nanjing","xian","chengdu"];return["上海","北京","广州","深圳","南京","西安","成都"].forEach(function(e,r){t.push({label:e,key:r,pinyin:n[r]})}),t}(),transferTitles:["可选权限","已选权限"]}}},i={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",[n("el-row",{attrs:{type:"flex",gutter:20}},[n("el-col",{staticClass:"m-b",attrs:{xs:24,sm:12,md:12}},[n("el-input",{staticClass:"m-b",attrs:{clearable:"",placeholder:"输入关键字进行过滤"},model:{value:e.treeFilterText,callback:function(t){e.treeFilterText=t},expression:"treeFilterText"}}),e._v(" "),n("el-tree",{ref:"tree",attrs:{"node-key":"id",draggable:"","highlight-current":"","default-expand-all":"","expand-on-click-node":!1,data:e.treeData,props:e.treeProps,"filter-node-method":e.treeFilterMethod},on:{"node-drop":e.treeNodeDrop},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.node,a=t.data;return n("span",{staticClass:"custom-tree-node"},[n("span",[e._v(e._s(r.label))]),e._v(" "),n("span",[n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(t){e.treeSelected(a)}}},[e._v("选中")]),e._v(" "),n("el-button",{staticClass:"text-info",attrs:{type:"text",size:"mini"},on:{click:function(t){e.treeEdit(a)}}},[e._v("编辑")]),e._v(" "),n("el-button",{staticClass:"text-info",attrs:{type:"text",size:"mini"},on:{click:function(t){e.treeAdd(a)}}},[e._v("新增")]),e._v(" "),n("el-button",{staticClass:"text-danger",attrs:{type:"text",size:"mini"},on:{click:function(t){e.treeDel(r,a)}}},[e._v("删除")])],1)])}}])})],1),e._v(" "),n("el-col",{staticClass:"transfer-container m-b",attrs:{xs:24,sm:12,md:12}},[n("div",{staticClass:"transfer-title m-b"},[e._v(e._s(e.transferTitle))]),e._v(" "),n("el-transfer",{attrs:{filterable:"","filter-method":e.transferFilterMethod,titles:e.transferTitles,data:e.transferData,"filter-placeholder":"请输入搜索内容"},on:{change:e.transferChange},model:{value:e.transferValue,callback:function(t){e.transferValue=t},expression:"transferValue"}})],1)],1)],1)},staticRenderFns:[]};var l=n("VU/8")(a,i,!1,function(e){n("vy+k")},null,null);t.default=l.exports},"vy+k":function(e,t,n){var r=n("A2bL");"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n("rjj0")("7d62c839",r,!0)}});
|