1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-13c1a4c6"],{"09f4":function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),Math.easeInOutQuad=function(e,t,r,n){return e/=n/2,e<1?r/2*e*e+t:(e--,-r/2*(e*(e-2)-1)+t)};var n=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function a(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function i(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function s(e,t,r){var s=i(),o=e-s,c=20,l=0;t="undefined"===typeof t?500:t;var u=function e(){l+=c;var i=Math.easeInOutQuad(l,s,o,t);a(i),l<t?n(e):r&&"function"===typeof r&&r()};u()}},"1a8d":function(e,t,r){"use strict";r("cce1")},"91e61":function(e,t,r){"use strict";r("e8ce")},"9dc3":function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"d",(function(){return i})),r.d(t,"b",(function(){return s})),r.d(t,"c",(function(){return o}));var n=r("829b"),a=function(e){return Object(n["a"])({url:"/api-web/platformProduct/add",method:"post",data:e})},i=function(e){return Object(n["a"])({url:"/api-web/platformProduct/update",method:"post",data:e})},s=function(e){return Object(n["a"])({url:"/api-web/platformProduct/delete/"+e.id,method:"get"})},o=function(e){return Object(n["a"])({url:"/api-web/platformProduct/queryPage",method:"get",params:e})}},bc69:function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"m-container"},[e._m(0),e._v(" "),r("div",{staticClass:"m-core"},[r("save-form",{ref:"searchForm",staticClass:"searchForm",attrs:{inline:!0,saveKey:"platformProductManager",model:e.searchForm},on:{submit:e.search,reset:e.reset,"update:model":function(t){e.searchForm=t}}},[r("el-form-item",{attrs:{rules:[]}},[r("el-input",{attrs:{placeholder:"产品名称"},model:{value:e.searchForm.search,callback:function(t){e.$set(e.searchForm,"search",t)},expression:"searchForm.search"}})],1),e._v(" "),r("el-form-item",[r("el-button",{attrs:{"native-type":"submit",type:"danger"}},[e._v("搜索")]),e._v(" "),r("el-button",{attrs:{"native-type":"reset",type:"primary"}},[e._v("重置")])],1)],1),e._v(" "),r("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"platformProduct/add",expression:"'platformProduct/add'"}],staticStyle:{"margin-bottom":"20px"},attrs:{type:"primary",icon:"el-icon-plus"},on:{click:function(t){return e.openProduct("create")}}},[e._v("添加")]),e._v(" "),r("div",{staticClass:"tableWrap"},[r("el-table",{attrs:{data:e.tableList,"header-cell-style":{background:"#EDEEF0",color:"#444"}}},[r("el-table-column",{attrs:{align:"center",label:"产品编号",prop:"id"}}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"name",label:"产品名称"}}),e._v(" "),r("el-table-column",{attrs:{align:"center",label:"产品描述",prop:"remark"},scopedSlots:e._u([{key:"default",fn:function(e){return[r("tooltip",{attrs:{content:e.row.remark}})]}}])}),e._v(" "),r("el-table-column",{attrs:{align:"center",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"platformProduct/update",expression:"'platformProduct/update'"}],attrs:{type:"text"},on:{click:function(r){return e.resetProduct(t.row)}}},[e._v("修改")]),e._v(" "),r("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"platformProduct/delete",expression:"'platformProduct/delete'"}],attrs:{type:"text"},on:{click:function(r){return e.delProduct(t.row)}}},[e._v("删除")])]}}])})],1),e._v(" "),r("pagination",{attrs:{saveKey:"platformProductManager",sync:"",total:e.pageInfo.total,page:e.pageInfo.page,limit:e.pageInfo.limit,"page-sizes":e.pageInfo.page_size},on:{"update:total":function(t){return e.$set(e.pageInfo,"total",t)},"update:page":function(t){return e.$set(e.pageInfo,"page",t)},"update:limit":function(t){return e.$set(e.pageInfo,"limit",t)},pagination:e.getList}})],1)],1),e._v(" "),r("el-dialog",{staticClass:"courseMask",attrs:{title:e.isAdd?"新增产品":"修改产品",width:"500px",visible:e.courseVisible},on:{"update:visible":function(t){e.courseVisible=t}}},[e.courseVisible?r("operationModel",{ref:"operationModel",attrs:{activeRow:e.activeRow,pageType:e.pageType},on:{close:e.close}}):e._e(),e._v(" "),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.courseVisible=!1}}},[e._v("取 消")]),e._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:e.submitInfo}},[e._v("确 定")])],1)],1)],1)},a=[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("h2",[r("div",{staticClass:"squrt"}),e._v("\n 产品管理\n ")])}],i=(r("386d"),r("96cf"),r("1da1")),s=r("5530"),o=r("333d"),c=r("9dc3"),l=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("el-form",{ref:"productForm",attrs:{model:e.productForm}},[r("el-alert",{staticStyle:{"margin-bottom":"20px"},attrs:{title:"产品信息",type:"info",closable:!1}}),e._v(" "),r("el-form-item",{attrs:{label:"产品名称",prop:"name","label-width":e.formLabelWidth,rules:[{required:!0,message:"产品名称",trigger:"blur"}]}},[r("el-input",{attrs:{clearable:"",placeholder:"请输入产品名称"},model:{value:e.productForm.name,callback:function(t){e.$set(e.productForm,"name",t)},expression:"productForm.name"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"产品描述",prop:"remark","label-width":e.formLabelWidth}},[r("el-input",{attrs:{clearable:"",type:"textarea",placeholder:"请输入产品描述"},model:{value:e.productForm.remark,callback:function(t){e.$set(e.productForm,"remark",t)},expression:"productForm.remark"}})],1),e._v(" "),r("el-alert",{staticStyle:{"margin-bottom":"20px"},attrs:{title:"产品权限",type:"info",closable:!1}}),e._v(" "),r("el-form-item",{staticStyle:{"margin-bottom":"0"},attrs:{label:"搜索"}},[r("el-input",{staticStyle:{width:"210px"},attrs:{clearable:""},model:{value:e.seachRoleValue,callback:function(t){e.seachRoleValue="string"===typeof t?t.trim():t},expression:"seachRoleValue"}}),e._v(" "),r("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"danger"},on:{click:e.seachRoles}},[e._v("搜索")])],1),e._v(" "),r("el-form-item",{staticStyle:{"max-height":"300px",overflow:"hidden","overflow-y":"auto"}},[r("el-checkbox",{attrs:{indeterminate:e.isIndeterminate},on:{change:e.onCheckAll},model:{value:e.checkAll,callback:function(t){e.checkAll="string"===typeof t?t.trim():t},expression:"checkAll"}},[e._v("全选")]),e._v(" "),r("el-tree",{ref:"tree",attrs:{data:e.data,"show-checkbox":"","node-key":"id","filter-node-method":e.filterNode,accordion:"","highlight-current":"","default-checked-keys":e.result.menuIds,props:e.defaultProps},on:{check:e.onTreeCheck},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.node;t.data;return r("div",{},[e._v("\n "+e._s(n.label)+"\n ")])}}])})],1)],1)],1)},u=[],d=(r("6762"),r("2fdb"),r("ac6a"),r("2909")),p=(r("c5f6"),r("28a5"),r("7f7f"),r("1a62")),h={props:["activeRow","pageType"],data:function(){return{productForm:{name:"",remark:"",id:null},menuId:[],formLabelWidth:"80px",isIndeterminate:!1,data:[],defaultProps:{children:"children",label:"label"},result:{roleName:null,roleDesc:null},checkAll:!1,splice:[],silderList:[],allChildIds:[],slideCount:0,seachRoleValue:"",filterIds:[4794,4743,3266,3268,3306,3307,3309,3784,4627]}},mounted:function(){var e=this.activeRow;e&&(this.productForm={name:e.name,remark:e.remark,id:e.id},this.menuId=e.menuId?e.menuId.split(",").map((function(e){return Number(e)})):[]),"create"==this.pageType&&this.$refs.tree.setCheckedKeys([4229]),this.lookSilder()},methods:{submitInfo:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(t){var r,n,a,s=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:r=this.$refs.tree.getCheckedKeys(),n=this.$refs.tree.getHalfCheckedKeys(),a=[].concat(Object(d["a"])(r),Object(d["a"])(n)),this.$refs.productForm.validate(function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(r){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!r){e.next=25;break}if("update"!=t){e.next=14;break}return e.prev=2,e.next=5,Object(c["d"])({name:s.productForm.name,remark:s.productForm.remark,menuId:a.join(","),id:s.productForm.id});case 5:e.sent,s.$message.success("修改成功"),s.$emit("close"),e.next=12;break;case 10:e.prev=10,e.t0=e["catch"](2);case 12:e.next=25;break;case 14:if("create"!=t){e.next=25;break}return e.prev=15,e.next=18,Object(c["a"])({name:s.productForm.name,remark:s.productForm.remark,menuId:a.join(",")});case 18:e.sent,s.$message.success("新建成功"),s.$emit("close"),e.next=25;break;case 23:e.prev=23,e.t1=e["catch"](15);case 25:case"end":return e.stop()}}),e,null,[[2,10],[15,23]])})));return function(t){return e.apply(this,arguments)}}());case 4:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}(),lookSilder:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(){var t,r,n,a,i,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(p["c"])({hid:0});case 2:t=e.sent,r=[],200==t.code&&(n=t.data||[],a=[],n.forEach((function(e){a.push(e)})),this.silderList=a,r=this.setTableData(a),console.log(r),this.data=r),"update"==this.pageType?(i={},this.checkAll=this.menuId.length>=this.slideCount,this.isIndeterminate=this.menuId.length>0&&this.menuId.length<this.slideCount,s=this.getParent(this.menuId,r),i.menuIds=s,this.result=i):this.onReSet();case 6:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),onTreeCheck:function(){var e=this.$refs.tree.getCheckedKeys();this.checkAll=e.length>=this.slideCount,this.isIndeterminate=e.length>0&&e.length<this.slideCount},onCheckAll:function(e){e?(this.isIndeterminate=!1,this.$refs.tree.setCheckedNodes(this.data)):this.$refs.tree.setCheckedNodes([])},getParent:function(e,t){var r=JSON.parse(JSON.stringify(e));this.getAllChildIds(t);for(var n=this.allChildIds,a=e.length;a>0;a--)n.includes(e[a-1])||r.splice(a-1,1);return r},getAllChildIds:function(e){var t=this,r=this.allChildIds;e.forEach((function(e,n){e.children&&e.children.length>0?t.getAllChildIds(e.children):r.push(e.id)}))},setTableData:function(e){var t=this,r=[];r=e.map((function(e){if(!t.filterIds.includes(e.id)){var r={};return r={id:e.id,name:e.name,label:e.name,type:e.type,path:e.path,permission:e.permission,icon:e.icon,parentId:e.parentId},t.slideCount++,e.sysMenus&&e.sysMenus.length>0&&(r.children=t.setTableData(e.sysMenus)),r}return null}));var n=[];return r.forEach((function(e){e&&n.push(e)})),n},onReSet:function(){this.$refs.tree.setCheckedNodes([]),this.result={roleName:null,roleDesc:null},this.isIndeterminate=!1,this.checkAll=!1},onCancel:function(){this.$store.dispatch("delVisitedViews",this.$route),this.$router.push({path:"/parameter/adminManager",query:{page:this.$route.query.page}})},seachRoles:function(){this.$refs.tree.filter(this.seachRoleValue)},filterNode:function(e,t){return!e||-1!==t.label.indexOf(e)},onReSetRole:function(){this.seachRoleValue="",this.data=this.setTableData(this.silderList)}}},m=h,f=(r("1a8d"),r("2877")),b=Object(f["a"])(m,l,u,!1,null,"8874d846",null),v=b.exports,g={search:null},k={components:{pagination:o["a"],operationModel:v},data:function(){return{tableList:[],pageType:"create",pageInfo:{limit:10,page:1,total:0,page_size:[10,20,40,50]},searchForm:Object(s["a"])({},g),isAdd:!0,courseVisible:!1,activeRow:null}},mounted:function(){this.$store.dispatch("setBranchs"),this.getList()},methods:{getList:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(c["c"])(Object(s["a"])(Object(s["a"])({},this.searchForm),{},{page:this.pageInfo.page,rows:this.pageInfo.limit}));case 3:t=e.sent,this.pageInfo.total=t.data.total,this.tableList=t.data.rows,e.next=10;break;case 8:e.prev=8,e.t0=e["catch"](0);case 10:case"end":return e.stop()}}),e,this,[[0,8]])})));function t(){return e.apply(this,arguments)}return t}(),search:function(){this.pageInfo.page=1,this.$refs.searchForm.save(this.searchForm),this.$refs.searchForm.save(this.pageInfo,"page"),this.getList()},reset:function(){this.searchForm=Object(s["a"])({},g),this.search()},resetProduct:function(e){this.isAdd=!1,this.activeRow=e,this.pageType="update",this.courseVisible=!0},submitInfo:function(){var e=this.isAdd?"create":"update";this.$refs.operationModel.submitInfo(e)},close:function(){this.courseVisible=!1,this.getList()},openProduct:function(){this.isAdd=!0,this.activeRow=null,this.pageType="create",this.courseVisible=!0},delProduct:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(t){var r=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.$confirm("是否删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(i["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(c["b"])({id:t.id});case 3:e.sent,r.$message.success("删除成功"),r.getList(),e.next=10;break;case 8:e.prev=8,e.t0=e["catch"](0);case 10:case"end":return e.stop()}}),e,null,[[0,8]])}))));case 1:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()}},y=k,w=(r("91e61"),Object(f["a"])(y,n,a,!1,null,"084298e0",null));t["default"]=w.exports},cce1:function(e,t,r){},e8ce:function(e,t,r){}}]);
|