chunk-0ec56e2a.0f2d613f.js 14 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0ec56e2a"],{"0177":function(t,e,a){"use strict";a("704f")},1400: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}})],1)},r=[],i=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:"50%","custom-class":"prod-verify",title:"创建分类"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("dataInfo",{on:{onClose:t.onClose}})],1)],1)},o=[],s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"data-info"},[a("el-card",[a("el-form",{ref:"dataFormRef",attrs:{model:t.dataForm,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"父级分类:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择你级分类",size:"large",clearable:""},model:{value:t.dataForm.parent_id,callback:function(e){t.$set(t.dataForm,"parent_id",e)},expression:"dataForm.parent_id"}},t._l(t.parentList,(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-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.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.value,attrs:{label:t.label,value:t.value}})})),1)],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)},l=[],u=(a("a9e3"),a("c621")),c={emits:["onClose","onSearch"],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",currentCategory:[],dataForm:{id:0,name:"",parent_id:0,intro:"",status:5},parentList:[],statusOptions:[{value:"",label:"请选择状态"},{value:5,label:"启用"},{value:6,label:"停用"}]}},mounted:function(){this.initParentCategory()},methods:{resetForm:function(){this.dataForm={},this.$refs.dataFormRef.resetFields()},initParentCategory:function(){var t=this;Object(u["j"])({page:1,pageSize:999,parent_id:0,status:5}).then((function(e){200==e.status&&t.parentList.push({id:0,name:"父级分类"})}))},btnSave:function(t){var e=this;e.dataForm.id>0?Object(u["m"])(e.dataForm).then((function(t){200==t.status&&(e.$alert("模板类别信息更新成功"),e.$emit("onSearch"),e.$emit("onClose"))})):Object(u["b"])(e.dataForm).then((function(t){200==t.status&&(e.$alert("模板类别信息创建成功"),e.$emit("onSearch"),e.$emit("onClose"))}))},getInfo:function(t){var e=this,a={id:t};Object(u["f"])(a).then((function(t){t&&200==t.status&&(t.data.parent_id=Number(t.data.parent_id),e.dataForm=t.data)}))},onChangeStatus:function(t){this.dataForm.status=t},onChangeCategory:function(t){var e=this;e.dataForm.categoryId=t}}},d=c,m=(a("7ff9"),a("2877")),f=Object(m["a"])(d,s,l,!1,null,null,null),p=f.exports,h=a("a888"),b={components:{dataInfo:p},directives:{elDragDialog:h["a"]},props:{queryForm:{type:Object,default:function(){return{page:1,pageSize:10,name:"",parent_id:0,status:""}}}},data:function(){return{statusOptions:[{value:"",label:"请选择状态"},{value:5,label:"启用"},{value:6,label:"停用"}],dialogVisible:!1}},created:function(){},methods:{onCreate:function(t){this.dialogVisible=!0},onClose:function(t){this.dialogVisible=!1,this.onSubmit()},onSubmit:function(){this.queryForm.isUpdate=!this.queryForm.isUpdate,this.$emit("bindSetQuery",this.queryForm)}}},g=b,v=(a("bb90"),Object(m["a"])(g,i,o,!1,null,null,null)),y=v.exports,F=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.tableLoading,expression:"tableLoading"}],staticClass:"data-list",attrs:{"element-loading-text":"加载中...","element-loading-spinner":"el-icon-loading"}},[a("el-table",{ref:"dataTable",staticStyle:{width:"100%"},attrs:{data:t.dataList,stripe:"",lazy:"",load:t.loadData,"row-key":"id","tree-props":{children:"child",hasChildren:"hasChildren"},"show-overflow-tooltip":"","header-row-class-name":"headerBg","empty-text":"没有分类信息"}},[a("el-table-column",{attrs:{prop:"id",label:"ID",width:"180"}}),a("el-table-column",{attrs:{prop:"name",label:"分类名称",align:"left","min-width":"180"}}),a("el-table-column",{attrs:{prop:"createTime",label:"创建时间",align:"center"}}),a("el-table-column",{attrs:{prop:"status",label:"分类状态",align:"center"},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:"操作",fixed:"right",align:"center",width:"300"},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.Subclass(e.row)}}},[a("svg-icon",{attrs:{"icon-class":"edit"}}),t._v("创建子类")],1),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(a){return t.btnEdit(e.row)}}},[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:{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),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:t.SubclassVisible,"append-to-body":"",width:"50%","custom-class":"prod-verify",title:"创建子类"},on:{"update:visible":function(e){t.SubclassVisible=e},closed:t.handleSubClosed}},[a("el-card",[a("el-form",{ref:"dataFormRef",attrs:{model:t.dataForm,"label-width":"120px"}},[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.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.value,attrs:{label:t.label,value:t.value}})})),1)],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),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:t.dialogVisible,"append-to-body":"",width:"50%","custom-class":"prod-verify",title:"编辑分类"},on:{"update:visible":function(e){t.dialogVisible=e},closed:t.handleDialogClosed}},[a("dataInfo",{ref:"currentInfoRef",attrs:{id:t.currentDataId},on:{onClose:t.onClose,onSearch:t.search}})],1)],1)},C=[],_=(a("7db0"),a("d81d"),a("b0c0"),a("d3b7"),a("ac1f"),a("6062"),a("3ca3"),a("841c"),a("ddb0"),{components:{dataInfo:p},directives:{elDragDialog:h["a"]},props:{queryForm:{type:Object,default:function(){return{page:1,pageSize:10,name:"",parent_id:0,sign:""}}}},watch:{queryForm:{handler:function(t){this.search()},immediate:!0,deep:!0}},data:function(){return{dialogVisible:!1,currentDataId:0,recordCount:0,pageTotal:1,dataList:[],currentData:{},activeName:"base",currentCategory:[],tableLoading:!1,dataForm:{id:0,name:"",parent_id:0,intro:"",status:5},parentList:[],statusOptions:[{value:"",label:"请选择状态"},{value:5,label:"启用"},{value:6,label:"停用"}],SubclassVisible:!1,expandedRows:new Set}},mounted:function(){this.search(),this.initParentCategory()},methods:{initParentCategory:function(){var t=this;Object(u["j"])({page:1,pageSize:999,parent_id:0,status:5}).then((function(e){200==e.status&&t.parentList.push({id:0,name:"父级分类"})}))},btnSave:function(t){var e=this;e.dataForm.id>0?Object(u["m"])(e.dataForm).then((function(t){200==t.status&&(e.$message.success("模板类别信息更新成功"),e.SubclassVisible=!1,e.search(),e.refreshAndExpandParent())})):Object(u["b"])(e.dataForm).then((function(t){200==t.status&&(e.$message.success("模板类别信息创建成功"),e.SubclassVisible=!1,e.search(),e.refreshAndExpandParent())}))},refreshAndExpandParent:function(){var t=this,e=this.dataForm.parent_id;this.expandedRows.add(e),this.search(),this.$nextTick((function(){var a=t.$refs.dataTable;if(a){var n=t.dataList.find((function(t){return t.id===e}));n&&a.toggleRowExpansion(n,!0)}}))},getInfo:function(t){var e=this,a={id:t};Object(u["f"])(a).then((function(t){t&&200==t.status&&(t.data.parent_id=Number(t.data.parent_id),e.dataForm=t.data)}))},onChangeStatus:function(t){this.dataForm.status=t},onChangeCategory:function(t){var e=this;e.dataForm.categoryId=t},Subclass:function(t){this.dataForm.parent_id=t.id,this.SubclassVisible=!0},handleSubClosed:function(){this.dataForm={name:"",intro:"",status:5}},handleDialogClosed:function(){this.$refs.dataInfoRef&&this.$refs.dataInfoRef.resetForm()},btnView:function(t){var e=this;e.queryForm.parent_id=t,e.search()},loadData:function(t,e,a){var n=this;setTimeout((function(){Object(u["j"])({parent_id:t.id}).then((function(e){0==e.data.length&&n.$message.warning("暂无数据!"),e.data.map((function(t){t.child_count>0?t.hasChildren=!0:t.hasChildren=!1})),a(e.data),n.expandedRows.add(t.id)}))}),0)},btnDelete:function(t){var e=this,a={id:t};e.queryForm.name="",e.$confirm("您是否确认删除该记录?","提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then((function(t){Object(u["d"])(a).then((function(t){e.search()}))})).catch((function(){}))},searchData:function(){var t=this;t.dialogVisible=!1,t.search()},btnEdit:function(t){var e=this;e.currentDataId=t.id,e.dialogVisible=!0},onClose:function(){var t=this;t.currentDataId=0,t.dialogVisible=!1,t.search()},search:function(){var t=this;t.dataList=[],t.tableLoading=!0,Object(u["j"])(t.queryForm).then((function(e){if(e){e.data.dataList.map((function(t){t.child_count>0?t.hasChildren=!0:t.hasChildren=!1}));t.dataList=e.data.dataList,t.recordCount=e.data.totalRecord,t.pageTotal=e.data.totalPage,t.$forceUpdate(),t.$nextTick((function(){console.log("View updated"),t.tableLoading=!1}))}else t.tableLoading=!1})).catch((function(){t.tableLoading=!1}))},ChangePage:function(t){var e=this;e.queryForm.page=t,e.search()}}}),w=_,S=(a("a116"),Object(m["a"])(w,F,C,!1,null,null,null)),j=S.exports,O={components:{dataSearch:y,dataList:j},data:function(){return{queryForm:{page:1,pageSize:10,parent_id:0,name:"",status:""}}},methods:{setQuery:function(t){this.queryForm=t}}},x=O,$=(a("0177"),Object(m["a"])(x,n,r,!1,null,null,null));e["default"]=$.exports},"22e3":function(t,e,a){},"4f2f":function(t,e,a){},"704f":function(t,e,a){},"7ff9":function(t,e,a){"use strict";a("ca10")},a116:function(t,e,a){"use strict";a("22e3")},bb90:function(t,e,a){"use strict";a("4f2f")},c621:function(t,e,a){"use strict";a.d(e,"j",(function(){return r})),a.d(e,"b",(function(){return i})),a.d(e,"m",(function(){return o})),a.d(e,"f",(function(){return s})),a.d(e,"d",(function(){return l})),a.d(e,"h",(function(){return u})),a.d(e,"i",(function(){return c})),a.d(e,"g",(function(){return d})),a.d(e,"c",(function(){return m})),a.d(e,"a",(function(){return f})),a.d(e,"l",(function(){return p})),a.d(e,"e",(function(){return h})),a.d(e,"k",(function(){return b}));var n=a("b775");function r(t){return Object(n["a"])({url:"/template/category/search",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/template/category/create",method:"post",data:t})}function o(t){return Object(n["a"])({url:"/template/category/update",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/template/category/info",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/template/category/delete",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/template/pageTemplate",method:"post",data:t})}function c(t){return Object(n["a"])({url:"/template/search",method:"post",data:t})}function d(t){return Object(n["a"])({url:"/template/info",method:"post",data:t})}function m(t){return Object(n["a"])({url:"/template/delete",method:"post",data:t})}function f(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})}function h(t){return Object(n["a"])({url:"/template/category/allList",method:"post",data:t})}function b(t){return Object(n["a"])({url:"/template/category/treeCategory",method:"post",data:t})}},ca10:function(t,e,a){}}]);