1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-48683ed6"],{"1c4c":function(t,e,a){"use strict";a.d(e,"i",(function(){return r})),a.d(e,"b",(function(){return o})),a.d(e,"k",(function(){return i})),a.d(e,"d",(function(){return u})),a.d(e,"g",(function(){return c})),a.d(e,"h",(function(){return d})),a.d(e,"a",(function(){return l})),a.d(e,"j",(function(){return s})),a.d(e,"f",(function(){return f})),a.d(e,"c",(function(){return m})),a.d(e,"e",(function(){return p}));var n=a("b775");function r(t){return Object(n["a"])({url:"source/data/categories/",method:"post",data:t})}function o(t){return Object(n["a"])({url:"source/data/categories/create/",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/source/data/category/update",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/source/data/category/delete",method:"post",data:t})}function c(t){return Object(n["a"])({url:"/source/data/category/info",method:"post",data:t})}function d(t){return Object(n["a"])({url:"/source/data/search",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/source/data/create",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/source/data/update",method:"post",data:t})}function f(t){return Object(n["a"])({url:"/source/data/info",method:"post",data:t})}function m(t){return Object(n["a"])({url:"/source/data/delete",method:"post",data:t})}function p(t){return Object(n["a"])({url:"/source/data/find",method:"post",data:t})}},2155:function(t,e,a){"use strict";a.d(e,"c",(function(){return w})),a.d(e,"b",(function(){return _})),a.d(e,"a",(function(){return g}));var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"data-search"},[a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:t.queryForm}},[a("el-form-item",{attrs:{label:"角色名称:"}},[a("el-input",{attrs:{placeholder:"角色名称"},model:{value:t.queryForm.name,callback:function(e){t.$set(t.queryForm,"name",e)},expression:"queryForm.name"}})],1),a("el-form-item",{attrs:{label:"角色状态:"}},[a("el-select",{staticClass:"m-2",attrs:{placeholder:"请选择角色状态",size:"large"},model:{value:t.queryForm.status,callback:function(e){t.$set(t.queryForm,"status",e)},expression:"queryForm.status"}},t._l(t.statusOptions,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:t.onSubmit}},[a("svg-icon",{attrs:{"icon-class":"search"}}),t._v(" 搜索")],1),a("el-button",{attrs:{type:"success"},on:{click:t.onCreate}},[a("svg-icon",{attrs:{"icon-class":"edit"}}),t._v(" 创建角色")],1)],1)],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:t.dialogVisible,"append-to-body":"",width:"80%","custom-class":"prod-verify",title:"创建角色"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("dataInfo",{on:{onClose:t.onClose}})],1)],1)},r=[],o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"data-info"},[a("el-card",[a("el-form",{attrs:{model:t.dataForm,"label-width":"140px"}},[a("el-form-item",{attrs:{label:"角色名称:"}},[a("el-input",{model:{value:t.dataForm.name,callback:function(e){t.$set(t.dataForm,"name",e)},expression:"dataForm.name"}})],1),a("el-form-item",{attrs:{label:"是否为管理员:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择是否为管理员",size:"large"},model:{value:t.dataForm.is_admin,callback:function(e){t.$set(t.dataForm,"is_admin",e)},expression:"dataForm.is_admin"}},t._l(t.adminOptions,(function(t){return a("el-option",{key:t.status,attrs:{label:t.name,value:t.status}})})),1)],1),a("el-form-item",{attrs:{label:"权限配置:"}},[a("div",{staticStyle:{width:"100%",height:"150px",overflow:"hidden",border:"1px solid #CCC","overflow-y":"auto",padding:"10px"}},[a("el-tree",{ref:"nodeTree",staticStyle:{"max-width":"600px"},attrs:{props:t.defaultProps,data:t.treeData,"default-expand-all":"","node-key":"value","show-checkbox":""}})],1)]),a("el-form-item",{attrs:{label:"模板分类授权:"}},[a("div",{staticStyle:{width:"100%",height:"150px",overflow:"hidden",border:"1px solid #CCC","overflow-y":"auto",padding:"10px"}},[a("el-tree",{ref:"templateCate",staticStyle:{"max-width":"600px"},attrs:{props:t.defaultProps,data:t.templateCate,"default-expand-all":"","node-key":"value","show-checkbox":""}})],1)]),a("el-form-item",{attrs:{label:"文档分类授权:"}},[a("div",{staticStyle:{width:"100%",height:"150px",overflow:"hidden",border:"1px solid #CCC","overflow-y":"auto",padding:"10px"}},[a("el-tree",{ref:"docCate",staticStyle:{"max-width":"600px"},attrs:{props:t.defaultProps,data:t.documentCate,"default-expand-all":"","node-key":"value","show-checkbox":""}})],1)]),a("el-form-item",{attrs:{label:"原始数据分类授权:"}},[a("div",{staticStyle:{width:"100%",height:"150px",overflow:"hidden",border:"1px solid #CCC","overflow-y":"auto",padding:"10px"}},[a("el-tree",{ref:"sourceDataTree",staticStyle:{"max-width":"600px"},attrs:{props:t.defaultProps,data:t.sourceDataCate,"default-expand-all":"","node-key":"value","show-checkbox":""}})],1)]),a("el-form-item",{attrs:{label:"角色状态:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择状态",size:"large"},model:{value:t.dataForm.status,callback:function(e){t.$set(t.dataForm,"status",e)},expression:"dataForm.status"}},t._l(t.statusOptions,(function(t){return a("el-option",{key:t.status,attrs:{label:t.name,value:t.status}})})),1)],1),a("el-form-item",{attrs:{label:"介绍:"}},[a("el-input",{attrs:{type:"textarea"},model:{value:t.dataForm.intro,callback:function(e){t.$set(t.dataForm,"intro",e)},expression:"dataForm.intro"}})],1)],1)],1),a("div",{staticStyle:{"text-align":"right","margin-top":"20px"}},[a("el-button",{attrs:{type:"warning"},on:{click:t.btnSave}},[t._v("确认保存")])],1)],1)},i=[],u=a("5530"),c=(a("4de4"),a("d81d"),a("b0c0"),a("e9c4"),a("a9e3"),a("b64b"),a("d3b7"),a("4c53"),a("610d")),d=a("424e"),l=a("1c4c"),s=a("cb62"),f=a("c621"),m={emits:["onClose"],props:{id:{type:Number,default:0}},watch:{id:{handler:function(t){var e=this;null==t||t<=0||e.getInfo(t)},immediate:!0,deep:!0}},data:function(){return{activeName:"base",defaultProps:{children:"children",label:"label"},treeData:[],dataForm:{id:"",name:"",is_admin:"",intro:"",status:5},statusOptions:[{status:5,name:"启用"},{status:6,name:"禁用"}],adminOptions:[{status:1,name:"是"},{status:2,name:"否"}],pickedItem:[],templateCate:[],documentCate:[],sourceDataCate:[]}},mounted:function(){this.initNodeList(),this.initTemplateCate(),this.initDocCategory(),this.initSourceDataCate()},methods:{initSourceDataCate:function(){var t=this;Object(l["i"])({page:1,pageSize:9999,status:5}).then((function(e){200==e.status&&(t.sourceDataCate=e.data.dataList.map((function(t){var e={id:t.id,label:t.name,name:t.name,children:[{action:"view",cateId:t.id,value:"view-source-data"+t.id,type:"sourceCate",isMain:!0,name:"查看",label:"查看"},{action:"create",cateId:t.id,value:"create-source-data"+t.id,type:"sourceCate",isMain:!0,name:"创建",label:"创建"},{action:"edit",cateId:t.id,value:"edit-source-data"+t.id,type:"sourceCate",isMain:!0,name:"编辑",label:"编辑"},{action:"delete",cateId:t.id,value:"delete-source-data"+t.id,type:"sourceCate",isMain:!0,name:"删除",label:"删除"}]};return e})))}))},initDocCategory:function(){var t=this;Object(d["i"])({page:1,pageSize:9999,status:5}).then((function(e){200==e.status&&(t.documentCate=e.data.dataList.map((function(t){var e={id:t.id,label:t.name,name:t.name,children:[{action:"view",cateId:t.id,type:"docCate",value:"view-doc-cate-"+t.id,isMain:!0,name:"查看",label:"查看"},{action:"create",cateId:t.id,type:"docCate",value:"create-doc-cate-"+t.id,isMain:!0,name:"创建",label:"创建"},{action:"edit",cateId:t.id,type:"docCateg",value:"edit-doc-cate-"+t.id,isMain:!0,name:"编辑",label:"编辑"},{action:"delete",cateId:t.id,type:"docCateg",value:"delete-doc-cate-"+t.id,isMain:!0,name:"删除",label:"删除"}]};return e})))}))},initTemplateCate:function(){var t=this;Object(f["e"])({}).then((function(e){200==e.status&&(t.templateCate=e.data.map((function(t){var a={id:t.id,label:t.name,name:t.name,children:t.children.map((function(a){return{id:a.id,name:a.name,label:a.name,children:[{action:"view",cateId:a.id,pCateId:t.id,isMain:!0,value:"view-template-cate-"+e.id,type:"templateCategory",name:"捍看",label:"查看"},{action:"create",cateId:a.id,pCateId:t.id,isMain:!0,value:"create-template-cate-"+e.id,type:"templateCategory",name:"创建",label:"创建"},{action:"edit",cateId:a.id,pCateId:t.id,isMain:!0,value:"edit-template-cate-"+e.id,type:"templateCategory",name:"编辑",label:"编辑"},{action:"delete",cateId:a.id,pCateId:t.id,isMain:!0,value:"delete-template-cate-"+e.id,type:"templateCategory",name:"删除",label:"删除"}]}}))};return a})))}))},initNodeList:function(){var t=this;Object(s["d"])({page:1,pageSize:999,status:5}).then((function(e){if(200==e.status){var a=[{value:1,label:"项目管理",children:[],sub:!1},{value:2,label:"客户管理",children:[],sub:!1},{value:3,label:"产品管理",children:[],sub:!1},{value:4,label:"文档管理",children:[],sub:!1},{value:5,label:"系统设置",children:[],sub:!1}],n=e.data.dataList.filter((function(t){return 99!=t.type&&999!=t.type})),r=e.data.dataList.filter((function(t){return 999==t.type})),o=[];a.map((function(t){t.children=n.filter((function(e){return e.type==t.value})).map((function(t){var e={value:t.id,label:t.name,sub:!0,children:r.filter((function(e){return e.parent_id==t.id})).map((function(t){var e={value:t.id,label:t.name,sub:!0};return e}))};return e})),t.children.length>0&&o.push(t)})),t.treeData=o}else t.treeData=[]}))},btnSave:function(t){var e=this,a=e.$refs.nodeTree.getCheckedNodes(),n=e.$refs.templateCate.getCheckedNodes(),r=e.$refs.docCate.getCheckedNodes(),o=e.$refs.sourceDataTree.getCheckedNodes();n=n.filter((function(t){return t.isMain}));var i=a.filter((function(t){return 1==t.sub}));e.dataForm.authList=JSON.stringify(i),e.dataForm.template_cate_auth=JSON.stringify(n),e.dataForm.doc_cate_auth=JSON.stringify(r),e.dataForm.source_cate_auth=JSON.stringify(o);var d=Object(u["a"])({},e.dataForm);d.attrs=JSON.stringify(d.attrs),e.dataForm.id>0?Object(c["e"])(d).then((function(t){200==t.status&&(e.$alert("更新角色信息成功"),e.$emit("onClose"))})):Object(c["a"])(d).then((function(t){200==t.status&&(e.$alert("创建角色信息成功"),e.$emit("onClose"))}))},getInfo:function(t){var e=this,a={id:t};Object(c["c"])(a).then((function(t){if(t&&200==t.status){e.dataForm=t.data,t.data.linkData.length>0?e.$refs.nodeTree.setCheckedNodes(t.data.linkData):e.$refs.nodeTree.setCheckedNodes([]);var a=JSON.parse(t.data.template_cate_auth);a.length>0?e.$refs.templateCate.setCheckedNodes(a):e.$refs.templateCate.setCheckedNodes([]);var n=JSON.parse(t.data.source_cate_auth);n.length>0?e.$refs.sourceDataTree.setCheckedNodes(n):e.$refs.sourceDataTree.setCheckedNodes([]);var r=JSON.parse(t.data.doc_cate_auth);r.length>0?e.$refs.docCate.setCheckedNodes(r):e.$refs.docCate.setCheckedNodes([])}}))},onChangeStatus:function(t){this.dataForm.status=t}}},p=m,h=(a("5cb5"),a("2877")),b=Object(h["a"])(p,o,i,!1,null,null,null),g=b.exports,v=a("a888"),y={components:{dataInfo:g},directives:{elDragDialog:v["a"]},props:{queryForm:{type:Object,default:function(){return{page:1,pageSize:10,name:"",status:""}}}},data:function(){return{statusOptions:[{value:4,label:"启用"},{value:5,label:"禁用"}],dialogVisible:!1}},created:function(){},methods:{onCreate:function(t){this.$router.push({path:"/system/role/create"})},onClose:function(t){this.dialogVisible=!1,this.onSubmit()},onSubmit:function(){this.$emit("bindSetQuery",this.$props.queryForm)}}},C=y,O=(a("3745"),Object(h["a"])(C,n,r,!1,null,null,null)),w=O.exports,x=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"data-list"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.dataList,"header-row-class-name":"headerBg","empty-text":"没有角色信息"}},[a("el-table-column",{attrs:{prop:"id",label:"ID",align:"center",width:"80"}}),a("el-table-column",{attrs:{prop:"name",label:"角色名称",align:"left",width:"180"}}),a("el-table-column",{attrs:{prop:"intro",label:"角色介绍",align:"center","min-width":"150"}}),a("el-table-column",{attrs:{prop:"createTime",label:"创建时间",align:"center",width:"150"}}),a("el-table-column",{attrs:{prop:"status",label:"角色状态",align:"center",width:"150"},scopedSlots:t._u([{key:"default",fn:function(e){return[5==e.row.status?a("div",[t._v("启用")]):t._e(),6==e.row.status?a("div",[t._v("禁用")]):t._e()]}}])}),a("el-table-column",{attrs:{label:"操作",align:"center",fixed:"right",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"btns"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(a){return t.btnEdit(e.row.id)}}},[a("svg-icon",{attrs:{"icon-class":"edit"}}),t._v("编辑")],1),a("el-button",{attrs:{type:"danger",size:"small"},on:{click:function(a){return t.btnDelete(e.row.id)}}},[a("svg-icon",{attrs:{"icon-class":"delete"}}),t._v("删除")],1)],1)]}}])})],1),a("div",{staticClass:"page-info"},[a("el-pagination",{attrs:{"page-size":t.queryForm.pageSize,total:t.recordCount,"page-count":t.pageTotal,background:"",layout:"prev, pager, next"},on:{"current-change":t.ChangePage},model:{value:t.queryForm.page,callback:function(e){t.$set(t.queryForm,"page",e)},expression:"queryForm.page"}})],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:t.dialogVisible,"append-to-body":"",width:"80%","custom-class":"prod-verify",title:"创建项目信息"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("dataInfo",{attrs:{id:t.dataId},on:{onClose:t.onClose}})],1)],1)},j=[],k=(a("ac1f"),a("841c"),{components:{dataInfo:g},directives:{elDragDialog:v["a"]},props:{queryForm:{type:Object,default:function(){return{page:1,pageSize:10,name:"",status:""}}}},watch:{queryForm:{handler:function(t){this.search()},deep:!0}},data:function(){return{dialogVisible:!1,dataId:0,recordCount:0,pageTotal:1,dataList:[],currentData:{}}},mounted:function(){this.search()},methods:{btnDelete:function(t){var e=this,a={id:t};e.$confirm("您是否确认删除该记录?","提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then((function(t){Object(c["b"])(a).then((function(t){e.search()}))})).catch((function(){}))},onChangeVal:function(t){var e=this;e.currentDataId},onClose:function(){var t=this;t.dialogVisible=!1,t.search()},btnEdit:function(t){this.$router.push({path:"/system/role/edit",query:{id:t}})},handleClose:function(){var t=this;t.dataId=0,t.dialogVisible=!1},search:function(){var t=this;Object(c["d"])(t.queryForm).then((function(e){e&&(t.dataList=e.data.dataList,t.recordCount=e.data.totalRecord,t.pageTotal=e.data.totalPage)}))},ChangePage:function(t){var e=this;e.queryForm.page=t,e.search()}}}),S=k,F=(a("957f"),Object(h["a"])(S,x,j,!1,null,null,null)),_=F.exports},"326c":function(t,e,a){},3745:function(t,e,a){"use strict";a("b1f7")},"424e":function(t,e,a){"use strict";a.d(e,"h",(function(){return r})),a.d(e,"e",(function(){return o})),a.d(e,"j",(function(){return i})),a.d(e,"a",(function(){return u})),a.d(e,"g",(function(){return c})),a.d(e,"c",(function(){return d})),a.d(e,"i",(function(){return l})),a.d(e,"b",(function(){return s})),a.d(e,"k",(function(){return f})),a.d(e,"f",(function(){return m})),a.d(e,"d",(function(){return p}));var n=a("b775");function r(t){return Object(n["a"])({url:"/document/search",method:"post",data:t})}function o(t){return Object(n["a"])({url:"/document/export",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/document/update",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/document/create",method:"post",data:t})}function c(t){return Object(n["a"])({url:"/document/info",method:"post",data:t})}function d(t){return Object(n["a"])({url:"/document/delete",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/document/category/search",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/document/category/create",method:"post",data:t})}function f(t){return Object(n["a"])({url:"/document/category/update",method:"post",data:t})}function m(t){return Object(n["a"])({url:"/document/category/info",method:"post",data:t})}function p(t){return Object(n["a"])({url:"/document/category/delete",method:"post",data:t})}},"4c53":function(t,e,a){"use strict";var n=a("23e7"),r=a("857a"),o=a("af03");n({target:"String",proto:!0,forced:o("sub")},{sub:function(){return r(this,"sub","","")}})},"5cb5":function(t,e,a){"use strict";a("326c")},"610d":function(t,e,a){"use strict";a.d(e,"d",(function(){return r})),a.d(e,"a",(function(){return o})),a.d(e,"e",(function(){return i})),a.d(e,"c",(function(){return u})),a.d(e,"b",(function(){return c}));var n=a("b775");function r(t){return Object(n["a"])({url:"/admin/role/search",method:"post",data:t})}function o(t){return Object(n["a"])({url:"/admin/role/create",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/admin/role/update",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/admin/role/info",method:"post",data:t})}function c(t){return Object(n["a"])({url:"/admin/role/delete",method:"post",data:t})}},"857a":function(t,e,a){var n=a("1d80"),r=/"/g;t.exports=function(t,e,a,o){var i=String(n(t)),u="<"+e;return""!==a&&(u+=" "+a+'="'+String(o).replace(r,""")+'"'),u+">"+i+"</"+e+">"}},"957f":function(t,e,a){"use strict";a("b639e")},a888:function(t,e,a){"use strict";a("99af"),a("caad"),a("ac1f"),a("2532"),a("5319");var n={bind:function(t,e,a){var n=t.querySelector(".el-dialog__header"),r=t.querySelector(".el-dialog");n.style.cssText+=";cursor:move;",r.style.cssText+=";top:0px;";var o=function(){return window.document.currentStyle?function(t,e){return t.currentStyle[e]}:function(t,e){return getComputedStyle(t,!1)[e]}}();n.onmousedown=function(t){var e=t.clientX-n.offsetLeft,i=t.clientY-n.offsetTop,u=r.offsetWidth,c=r.offsetHeight,d=document.body.clientWidth,l=document.body.clientHeight,s=r.offsetLeft,f=d-r.offsetLeft-u,m=r.offsetTop,p=l-r.offsetTop-c,h=o(r,"left"),b=o(r,"top");h.includes("%")?(h=+document.body.clientWidth*(+h.replace(/\%/g,"")/100),b=+document.body.clientHeight*(+b.replace(/\%/g,"")/100)):(h=+h.replace(/\px/g,""),b=+b.replace(/\px/g,"")),document.onmousemove=function(t){var n=t.clientX-e,o=t.clientY-i;-n>s?n=-s:n>f&&(n=f),-o>m?o=-m:o>p&&(o=p),r.style.cssText+=";left:".concat(n+h,"px;top:").concat(o+b,"px;"),a.child.$emit("dragDialog")},document.onmouseup=function(t){document.onmousemove=null,document.onmouseup=null}}}},r=function(t){t.directive("el-drag-dialog",n)};window.Vue&&(window["el-drag-dialog"]=n,Vue.use(r)),n.install=r;e["a"]=n},af03:function(t,e,a){var n=a("d039");t.exports=function(t){return n((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}))}},b1f7:function(t,e,a){},b639e:function(t,e,a){},c621:function(t,e,a){"use strict";a.d(e,"i",(function(){return r})),a.d(e,"e",(function(){return o})),a.d(e,"b",(function(){return i})),a.d(e,"k",(function(){return u})),a.d(e,"f",(function(){return c})),a.d(e,"d",(function(){return d})),a.d(e,"h",(function(){return l})),a.d(e,"g",(function(){return s})),a.d(e,"c",(function(){return f})),a.d(e,"a",(function(){return m})),a.d(e,"j",(function(){return p}));var n=a("b775");function r(t){return Object(n["a"])({url:"/template/category/search",method:"post",data:t})}function o(t){return Object(n["a"])({url:"/template/category/all",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/template/category/create",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/template/category/update",method:"post",data:t})}function c(t){return Object(n["a"])({url:"/template/category/info",method:"post",data:t})}function d(t){return Object(n["a"])({url:"/template/category/delete",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/template/search",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/template/info",method:"post",data:t})}function f(t){return Object(n["a"])({url:"/template/delete",method:"post",data:t})}function m(t){return Object(n["a"])({url:"/template/create",method:"post",data:t})}function p(t){return Object(n["a"])({url:"/template/update",method:"post",data:t})}}}]);
|