chunk-302101da.dcbc6145.js 7.4 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-302101da"],{"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 c})),a.d(e,"g",(function(){return u})),a.d(e,"c",(function(){return l})),a.d(e,"i",(function(){return s})),a.d(e,"b",(function(){return d})),a.d(e,"k",(function(){return f})),a.d(e,"f",(function(){return m})),a.d(e,"d",(function(){return h}));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 c(t){return Object(n["a"])({url:"/document/create",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/document/info",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/document/delete",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/document/category/search",method:"post",data:t})}function d(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 h(t){return Object(n["a"])({url:"/document/category/delete",method:"post",data:t})}},"4328d":function(t,e,a){},"66d8":function(t,e,a){"use strict";a("bb02")},"7d91":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"project-search"},[a("dataSearch",{on:{bindSetQuery:t.setQuery}}),a("dataList",{attrs:{queryForm:t.queryForm,allowEdit:t.checkAuth("/document/update"),allowDelete:t.checkAuth("/document/delete")}})],1)},r=[],o=a("5530"),i=a("2f62"),c=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.title,callback:function(e){t.$set(t.queryForm,"title",e)},expression:"queryForm.title"}})],1),a("el-form-item",{attrs:{label:"所属分类:"}},[a("el-select",{staticClass:"m-2",attrs:{clearable:"",placeholder:"请选择分类",size:"large"},model:{value:t.queryForm.category_id,callback:function(e){t.$set(t.queryForm,"category_id",e)},expression:"queryForm.category_id"}},t._l(t.categoryList,(function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],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)],1)],1)],1)},u=[],l=a("424e"),s={props:{queryForm:{type:Object,default:function(){return{page:1,pageSize:10,title:"",category_id:"",status:""}}}},data:function(){return{statusOptions:[{value:"",label:"请选择状态"},{value:5,label:"启用"},{value:6,label:"停用"}],dialogVisible:!1,categoryList:[]}},created:function(){this.initCategoryList()},methods:{initCategoryList:function(){var t=this;Object(l["i"])({page:1,pageSize:999,status:5}).then((function(e){200==e.status&&(t.categoryList=e.data.dataList)}))},onCreate:function(t){this.dialogVisible=!0},onSubmit:function(){this.$emit("bindSetQuery",this.$props.queryForm)}}},d=s,f=(a("ced1"),a("2877")),m=Object(f["a"])(d,c,u,!1,null,null,null),h=m.exports,p=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:"title",label:"文档名称",align:"left","min-width":"180"}}),a("el-table-column",{attrs:{prop:"category.name",label:"所属分类",align:"center",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",width:t.editWidth()},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"btns"},[t.allowEdit?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):t._e(),t.allowDelete?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):t._e()],1)]}}])})],1),a("div",{staticClass:"page-info"},[a("el-pagination",{attrs:{currentPage:t.queryForm.page,"page-size":t.queryForm.pageSize,total:t.recordCount,"page-count":t.pageTotal,background:"",layout:"prev, pager, next"},on:{"current-change":t.ChangePage}})],1)],1)},b=[],g=(a("ac1f"),a("841c"),{props:{queryForm:{type:Object,default:function(){return{page:1,pageSize:10,title:"",category_id:"",status:""}}},allowEdit:{type:Boolean,default:!1},allowDelete:{type:Boolean,default:!1}},watch:{queryForm:{handler:function(t){this.search()},deep:!0}},data:function(){return{dialogVisible:!1,currentDataId:0,recordCount:0,pageTotal:1,dataList:[],currentData:{}}},mounted:function(){this.search()},methods:{editWidth:function(){return this.allowDelete&&this.allowEdit?200:this.allowDelete||this.allowEdit?120:100},onFocusVal:function(t){var e=this;e.currentDataId=t.target.dataset.id},onChangeVal:function(t){var e=this;e.currentDataId},btnDelete:function(t){var e=this,a={id:t};e.$confirm("您是否确认删除该记录?","提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then((function(t){Object(l["c"])(a).then((function(t){e.search()}))})).catch((function(){}))},searchData:function(){var t=this;t.dialogVisible=!1,t.search()},btnEdit:function(t){var e=document.createElement("a");e.href="/document/create?articleId="+t,e.target="_blank",e.click()},handleClose:function(){var t=this;t.currentData={},t.dialogVisible=!1},search:function(){var t=this;Object(l["h"])(t.queryForm).then((function(e){e&&(t.dataList=e.data.dataList,t.recordCount=e.data.totalRecord,t.pageTotal=e.data.pageTotal)}))},ChangePage:function(t){var e=this;e.queryForm.page=t,e.search()}}}),y=g,v=(a("f13c"),Object(f["a"])(y,p,b,!1,null,null,null)),w=v.exports,_={components:{dataSearch:h,dataList:w},computed:Object(o["a"])({},Object(i["b"])(["roleInfo","authList"])),data:function(){return{queryForm:{page:1,pageSize:10,title:"",category_id:"",status:""}}},methods:{checkAuth:function(t){return this.roleInfo.is_admin,!0},setQuery:function(t){this.queryForm=t}}},j=_,F=(a("66d8"),Object(f["a"])(j,n,r,!1,null,null,null));e["default"]=F.exports},ac70:function(t,e,a){},bb02:function(t,e,a){},ced1:function(t,e,a){"use strict";a("ac70")},f13c:function(t,e,a){"use strict";a("4328d")}}]);