1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6d1abe9e"],{"09f4":function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),Math.easeInOutQuad=function(e,t,r,a){return e/=a/2,e<1?r/2*e*e+t:(e--,-r/2*(e*(e-2)-1)+t)};var a=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function n(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function s(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function i(e,t,r){var i=s(),o=e-i,c=20,l=0;t="undefined"===typeof t?500:t;var u=function e(){l+=c;var s=Math.easeInOutQuad(l,i,o,t);n(s),l<t?a(e):r&&"function"===typeof r&&r()};u()}},"50b2":function(e,t,r){},"91e6":function(e,t,r){"use strict";r("e8ce")},"9dc3":function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"d",(function(){return s})),r.d(t,"b",(function(){return i})),r.d(t,"c",(function(){return o}));var a=r("829b"),n=function(e){return Object(a["a"])({url:"/api-web/platformProduct/add",method:"post",data:e})},s=function(e){return Object(a["a"])({url:"/api-web/platformProduct/update",method:"post",data:e})},i=function(e){return Object(a["a"])({url:"/api-web/platformProduct/delete/"+e.id,method:"get"})},o=function(e){return Object(a["a"])({url:"/api-web/platformProduct/queryPage",method:"get",params:e})}},bc69:function(e,t,r){"use strict";r.r(t);var a=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)},n=[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("h2",[r("div",{staticClass:"squrt"}),e._v("\n 产品管理\n ")])}],s=(r("386d"),r("c7eb")),i=(r("96cf"),r("1da1")),o=r("5530"),c=r("333d"),l=r("9dc3"),u=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 a=t.node;t.data;return r("div",{},[e._v("\n "+e._s(a.label)+"\n ")])}}])})],1)],1)],1)},d=[],p=(r("6762"),r("2fdb"),r("ac6a"),r("2909")),h=(r("c5f6"),r("28a5"),r("7f7f"),r("1a62")),m={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,3306,3307,3309,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"])(Object(s["a"])().mark((function e(t){var r,a,n,o=this;return Object(s["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:r=this.$refs.tree.getCheckedKeys(),a=this.$refs.tree.getHalfCheckedKeys(),n=[].concat(Object(p["a"])(r),Object(p["a"])(a)),this.$refs.productForm.validate(function(){var e=Object(i["a"])(Object(s["a"])().mark((function e(r){return Object(s["a"])().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(l["d"])({name:o.productForm.name,remark:o.productForm.remark,menuId:n.join(","),id:o.productForm.id});case 5:e.sent,o.$message.success("修改成功"),o.$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(l["a"])({name:o.productForm.name,remark:o.productForm.remark,menuId:n.join(",")});case 18:e.sent,o.$message.success("新建成功"),o.$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"])(Object(s["a"])().mark((function e(){var t,r,a,n,i,o;return Object(s["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(h["c"])({hid:0});case 2:t=e.sent,r=[],200==t.code&&(a=t.data||[],n=[],a.forEach((function(e){n.push(e)})),this.silderList=n,r=this.setTableData(n),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,o=this.getParent(this.menuId,r),i.menuIds=o,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 a=this.allChildIds,n=e.length;n>0;n--)a.includes(e[n-1])||r.splice(n-1,1);return r},getAllChildIds:function(e){var t=this,r=this.allChildIds;e.forEach((function(e,a){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 a=[];return r.forEach((function(e){e&&a.push(e)})),a},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)}}},f=m,b=(r("de16"),r("2877")),v=Object(b["a"])(f,u,d,!1,null,"37d13535",null),g=v.exports,k={search:null},y={components:{pagination:c["a"],operationModel:g},data:function(){return{tableList:[],pageType:"create",pageInfo:{limit:10,page:1,total:0,page_size:[10,20,40,50]},searchForm:Object(o["a"])({},k),isAdd:!0,courseVisible:!1,activeRow:null}},mounted:function(){this.$store.dispatch("setBranchs"),this.getList()},methods:{getList:function(){var e=Object(i["a"])(Object(s["a"])().mark((function e(){var t;return Object(s["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(l["c"])(Object(o["a"])(Object(o["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(o["a"])({},k),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"])(Object(s["a"])().mark((function e(t){var r=this;return Object(s["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.$confirm("是否删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(i["a"])(Object(s["a"])().mark((function e(){return Object(s["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(l["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}()}},w=y,I=(r("91e6"),Object(b["a"])(w,a,n,!1,null,"084298e0",null));t["default"]=I.exports},de16:function(e,t,r){"use strict";r("50b2")},e8ce:function(e,t,r){}}]);
|