(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4475a3eb"],{"555b":function(t,e,n){"use strict";n("74d4")},"74d4":function(t,e,n){},"7f4c":function(t,e,n){"use strict";n.r(e);var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"panel",staticClass:"from-panel"},[n("div",{staticClass:"from-title"},[n("el-button",{staticStyle:{"margin-right":"15px"},attrs:{icon:"el-icon-back",type:"info",size:"mini",circle:"",plain:""},on:{click:function(e){return t.$router.push("/workSpace")}}}),n("span",[t._v("流程面板")]),n("div",[n("el-button",{attrs:{type:"primary",icon:"el-icon-plus",size:"mini"},on:{click:t.newProcess}},[t._v("新建表单")]),n("el-button",{attrs:{icon:"el-icon-plus",size:"mini"},on:{click:t.addGroup}},[t._v("新建分组")])],1)],1),n("draggable",{attrs:{list:t.groups,group:"group",handle:".el-icon-rank",filter:".undrag",options:{animation:300,sort:!0,scroll:!0,chosenClass:"choose"}},on:{start:function(e){t.groupsSort=!0},end:t.groupSort}},t._l(t.groups,(function(e,o){return n("div",{directives:[{name:"show",rawName:"v-show",value:e.id>1||e.children.length>0,expression:"group.id > 1 || group.children.length > 0 "}],key:o,class:{"form-group":!0,undrag:0===e.id||void 0===e.id}},[n("div",{staticClass:"form-group-title"},[n("span",[t._v(t._s(e.label))]),n("span",[t._v("("+t._s(e.children.length)+")")]),n("i",{staticClass:"el-icon-rank",attrs:{title:"长按拖动可对分组排序"}}),0!==e.id&&void 0!==e.id?n("div",[n("el-dropdown",[n("el-button",{attrs:{type:"text",icon:"el-icon-setting"}},[t._v("编辑分组")]),n("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[n("el-dropdown-item",{attrs:{icon:"el-icon-edit-outline"},nativeOn:{click:function(n){return t.editGroup(e)}}},[t._v("修改名称")]),n("el-dropdown-item",{attrs:{icon:"el-icon-delete"},nativeOn:{click:function(n){return t.delGroup(e)}}},[t._v("删除分组")])],1)],1)],1):t._e()]),n("draggable",{directives:[{name:"show",rawName:"v-show",value:!t.groupsSort,expression:"!groupsSort"}],staticStyle:{width:"100%","min-height":"25px"},attrs:{list:e.children,group:"from",filter:".undrag",options:{animation:300,delay:200,chosenClass:"choose",scroll:!0,sort:!0}},on:{end:t.groupSort}},t._l(e.children,(function(o,i){return n("div",{key:i,class:{"form-group-item":!0,undrag:o.isstop},attrs:{title:"长按0.5S后可拖拽表单进行排序"}},[n("div",[n("i",{class:o.icon,style:"background: "+o.background}),n("span",[t._v(t._s(o.label))]),n("br")]),n("div",{staticClass:"desp"},[t._v(t._s(o.remark)+" ")]),n("div",[n("span",{staticClass:"tag"},[t._v("最后更新时间:"+t._s(o.updated))]),o.isstop?n("el-tag",{attrs:{type:"danger"}},[t._v("停用")]):n("el-tag",{attrs:{type:"success"}},[t._v("启用")])],1),n("div",[n("el-button",{attrs:{type:"text",icon:"el-icon-edit-outline",size:"mini"},on:{click:function(n){return t.editFrom(o,e)}}},[t._v("编辑")]),n("el-button",{attrs:{type:"text",icon:o.isstop?"el-icon-check":"el-icon-close",size:"mini"},on:{click:function(e){return t.stopFrom(o)}}},[t._v(" "+t._s(o.isstop?"启用":"停用")+" ")]),o.isstop?n("el-button",{attrs:{type:"text",icon:"el-icon-delete",size:"mini"},on:{click:function(e){return t.moveFrom(o)}}},[t._v("删除 ")]):n("el-popover",{staticStyle:{"margin-left":"10px"},attrs:{placement:"left",trigger:"click",width:"400"},on:{show:function(e){t.moveSelect}}},[n("el-radio-group",{attrs:{size:"mini"},model:{value:t.moveSelect,callback:function(e){t.moveSelect=e},expression:"moveSelect"}},t._l(t.groups,(function(o){return n("el-radio",{directives:[{name:"show",rawName:"v-show",value:o.id>1,expression:"g.id > 1"}],key:o.id,staticStyle:{margin:"10px"},attrs:{label:o.id,border:"",disabled:o.id===e.id}},[t._v(t._s(o.name))])})),1),n("div",{staticStyle:{"text-align":"right",margin:"0"}},[n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.moveFrom(o)}}},[t._v("提交")])],1),n("el-button",{attrs:{slot:"reference",type:"text",icon:"el-icon-s-promotion",size:"mini"},slot:"reference"},[t._v("移动")])],1)],1)])})),0),void 0===e.children||0===e.children.length?n("div",{staticStyle:{"text-align":"center"}},[n("el-button",{staticStyle:{"padding-top":"0"},attrs:{type:"text",icon:"el-icon-plus"},on:{click:function(n){return t.newProcess(e.id)}}},[t._v("创建新表单")])],1):t._e()],1)})),0)],1)},i=[],r=(n("b0c0"),n("b76a")),s=n.n(r),c=n("4e02"),a={name:"FormsPanel",components:{draggable:s.a},data:function(){return{moveSelect:"",visible:!1,groupsSort:!1,groups:[]}},mounted:function(){this.getGroups()},methods:{getGroups:function(){var t=this;Object(c["b"])().then((function(e){t.groups=e.data})).catch((function(e){return t.$message.error("获取分组异常")}))},newProcess:function(t){this.$store.commit("setTemplate",this.getTemplateData()),this.$store.commit("setIsEdit",!1),this.$router.push("/admin/design?groupId="+t)},groupSort:function(){this.groupsSort=!1},addGroup:function(){var t=this;this.$prompt("请输入要添加的组名","新的分组名",{confirmButtonText:"提交",cancelButtonText:"取消",inputPattern:/^[\u4E00-\u9FA5A-Za-z0-9\\-]{1,30}$/,inputErrorMessage:"分组名不能为空且长度小于30",inputPlaceholder:"请输入分组名"}).then((function(e){var n=e.value;Object(c["e"])({name:n},"post").then((function(e){t.$message.success(e.data),t.getGroups()})).catch((function(e){return t.$message.error(e.response.data)}))}))},delGroup:function(t){var e=this;this.$confirm("删除分组并会删除表单,确定要删除分组 "+t.label+"?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(c["e"])({id:t.id},"delete").then((function(t){e.getGroups()})).catch((function(t){return e.$message.error(t.response.data)}))}))},editGroup:function(t){var e=this;this.$prompt("请输入新的组名","修改分组名",{confirmButtonText:"提交",cancelButtonText:"取消",inputPattern:/^[\u4E00-\u9FA5A-Za-z0-9\\-]{1,30}$/,inputErrorMessage:"分组名不能为空且长度小于30",inputPlaceholder:"请输入分组名",inputValue:t.name}).then((function(n){var o=n.value;Object(c["e"])({id:t.id,name:o},"put").then((function(t){e.getGroups()})).catch((function(t){return e.$message.error(t.response.data)}))}))},updateForm:function(t,e){var n=this;Object(c["c"])({formId:t.id,type:e}).then((function(t){n.$message.success(t.data),n.getGroups()})).catch((function(t){return n.$message.error(t.response.data)}))},getTemplateData:function(t,e){return t},editFrom:function(t,e){var n=this;Object(c["a"])({formId:t.id}).then((function(o){var i=o.data;n.$store.commit("setIsEdit",!0),n.$store.commit("setTemplate",n.getTemplateData(i,e)),n.$router.push("/admin/design?code="+t.id)})).catch((function(t){n.$message.error(t.response.data)}))},stopFrom:function(t){var e=this,n=t.isstop?" 启用后将会进入 “其他” 分组,是否继续?":" 停用后将会被转移到 “已停用” 分组,您可以再次启用或者删除它,是否继续?";this.$confirm(t.label+n,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.isstop=t.isstop?0:1,Object(c["c"])({formId:t.id,isstop:t.isstop}).then((function(t){e.getGroups()})).catch((function(t){return e.$message.error(t.response.data)}))}))},moveFrom:function(t){var e=this;if(t.isstop)this.$confirm("您确定要删除表单 "+t.label+" 吗,删除后无法恢复,是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e.updateForm(t,"delete")}));else{if(null===this.moveSelect||""===this.moveSelect)return void this.$message.error("请选择分组");Object(c["c"])({formId:t.id,type:"move",groupId:this.moveSelect}).then((function(t){e.$message.success(t.data),e.getGroups(),e.moveSelect=null})).catch((function(t){return e.$message.error(t.response.data)}))}}}},u=a,l=(n("555b"),n("2877")),d=Object(l["a"])(u,o,i,!1,null,"6e3dc7c3",null);e["default"]=d.exports}}]); //# sourceMappingURL=chunk-4475a3eb.172b585e.js.map