(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-78752aa6","chunk-1dd4951f"],{"06de":function(t){t.exports=JSON.parse('[{"type":"p","title":"","native":true,"children":["问卷标题"],"style":{"color":"#000","fontSize":"20px","display":"block","textAlign":"center"},"_fc_drag_tag":"p","hidden":false,"display":true,"class":"title"},{"type":"p","title":"","native":true,"children":["问卷描述问卷描述问卷描述问卷描述问卷描述问卷描述"],"style":{"color":"#000","fontSize":"14px","lineHeight":"28px","display":"block","textAlign":"center"},"_fc_drag_tag":"p","hidden":false,"display":true,"class":"title"}]')},"371d":function(t,e,a){"use strict";a.r(e);a("b0c0"),a("ac1f"),a("841c");var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"main-box",attrs:{id:"advert"}},[e("TableSearch",{attrs:{model:t.params},scopedSlots:t._u([{key:"btn",fn:function(){return[e("el-button",{attrs:{type:"primary",icon:"el-icon-plus"},on:{click:t.goAdd}},[t._v(" "+t._s(t.$t("添加"))+" ")])]},proxy:!0}])},[[e("el-form-item",{attrs:{label:t.$t("表单名称"),prop:"name"}},[e("el-input",{model:{value:t.params.name,callback:function(e){t.$set(t.params,"name",e)},expression:"params.name"}})],1),e("el-form-item",[e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.search()}}},[t._v(" "+t._s(t.$t("搜索"))+" ")]),e("el-button",{on:{click:function(e){return t.reset()}}},[t._v(t._s(t.$t("重置")))])],1)]],2),e("BaseTable",{ref:"baseTable",attrs:{request:t.request,params:t.params},on:{"update:params":function(e){t.params=e}}},[e("el-table-column",{attrs:{label:"ID",prop:"id"}}),e("el-table-column",{attrs:{label:t.$t("表单标识"),prop:"code","show-overflow-tooltip":""}}),e("el-table-column",{attrs:{label:t.$t("表单名称"),prop:"name","show-overflow-tooltip":""}}),e("el-table-column",{attrs:{label:t.$t("表单类型"),prop:"type"},scopedSlots:t._u([{key:"default",fn:function(a){return[2==a.row.type?e("div",[t._v(t._s(t.$t("问卷")))]):t._e(),1==a.row.type?e("div",[t._v(t._s(t.$t("表单")))]):t._e()]}}])}),e("el-table-column",{attrs:{label:t.$t("是否发布"),prop:"status"},scopedSlots:t._u([{key:"default",fn:function(a){return[2==a.row.status?e("div",[e("span",{staticClass:"success_status"}),t._v(" "+t._s(t.$t("已发布"))+" ")]):t._e(),1==a.row.status?e("div",[e("span",{staticClass:"error_status"}),t._v(" "+t._s(t.$t("未发布"))+" ")]):t._e()]}}])}),e("el-table-column",{attrs:{label:t.$t("操作"),width:"150px",fixed:"right",align:"right"},scopedSlots:t._u([{key:"default",fn:function(a){return[1==a.row.status?e("EditBtn",{on:{click:function(e){return t.editor(a.row)}}}):t._e(),1==a.row.status?e("DelBtn",{attrs:{"confirm-content":t.$t("您确定要删除该表单")},on:{success:function(e){return t.del(a.row)}}}):t._e(),2==a.row.status?e("CheckBtn",{on:{click:function(e){return t.detail(a.row)}}}):t._e(),e("BaseDropdown",{on:{command:function(e){return t.handlerCommand(e,a.row)}}},[e("el-dropdown-item",{attrs:{command:"design"}},[t._v(" "+t._s(t.$t("设计"))+" ")]),e("el-dropdown-item",{attrs:{command:"deploy"}},[t._v(" "+t._s(t.$t("发布"))+" ")]),e("el-dropdown-item",{attrs:{command:"undeploy"}},[t._v(" "+t._s(t.$t("卸载"))+" ")]),e("el-dropdown-item",{attrs:{command:"share"}},[t._v(" "+t._s(t.$t("分享"))+" ")])],1)]}}])})],1),e("BaseDialog",{attrs:{"dialog-show":t.shareShow,title:t.$t("分享问卷"),width:"40"},on:{"update:dialogShow":function(e){t.shareShow=e},"update:dialog-show":function(e){t.shareShow=e}}},[e("share",{attrs:{code:t.code},on:{success:t.shareSuccess}})],1),e("AddForm",{attrs:{"dialog-show":t.dialogShow,data:t.formData},on:{"update:dialogShow":function(e){t.dialogShow=e},"update:dialog-show":function(e){t.dialogShow=e},success:t.handleSuccess}})],1)},s=[],o=a("c14f"),r=a("1da1"),i=(a("14d9"),a("c7ea")),c=(a("f3b1"),function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"clearfix"},[e("el-input",{attrs:{readonly:!0,placeholder:t.$t("请输入需要分享的链接地址")},model:{value:t.url,callback:function(e){t.url=e},expression:"url"}})],1),e("el-row",[e("el-button",{attrs:{type:"primary"},on:{click:t.copyValue}},[t._v(t._s(t.$t("复制")))]),e("el-button",{attrs:{plain:""},on:{click:t.openPage}},[t._v(t._s(t.$t("打开")))]),e("el-button",{attrs:{type:"primary"},on:{click:t.openPoster}},[t._v(" "+t._s(t.$t("制作二维码海报"))+" ")])],1)],1)}),u=[],l=(a("d3b7"),{props:["code"],data:function(){return{url:"",imgUrl:this.$store.getters.updateURL}},mounted:function(){if(!this.imgUrl){var t=window.location.protocol,e=window.location.host;this.imgUrl=t+"//"+e+"/"}this.url=this.imgUrl+"c/"+this.code},created:function(){},methods:{openPoster:function(){this.copyValue(),this.$router.push({path:"/poster/index"})},openPage:function(){window.open(this.url)},copyValue:function(){var t=this;return Object(r["a"])(Object(o["a"])().m((function e(){var a,n;return Object(o["a"])().w((function(e){while(1)switch(e.n){case 0:if(a=t.url,!navigator.clipboard||!window.isSecureContext){e.n=1;break}return t.$message.success(t.$t("复制成功")),e.a(2,navigator.clipboard.writeText(a));case 1:return n=document.createElement("textarea"),n.value=a,document.body.appendChild(n),n.focus(),n.select(),t.$message.success(t.$t("复制成功")),e.a(2,new Promise((function(t,e){document.execCommand("copy")?t():e(),n.remove()})));case 2:return e.a(2)}}),e)})))()}}}),d=l,f=(a("e891"),a("2877")),m=Object(f["a"])(d,c,u,!1,null,null,null),h=m.exports,p=function(){var t=this,e=t._self._c;return e("BaseDialog",t._g(t._b({attrs:{title:t.formData.id?t.$t("编辑表单"):t.$t("添加表单"),"dialog-show":t.dialog,width:"50",footer:""},on:{"update:dialogShow":function(e){t.dialog=e},"update:dialog-show":function(e){t.dialog=e},submit:t.onSubmit,close:t.close}},"BaseDialog",t.$attrs,!1),t.$listeners),[e("el-form",{ref:"form",attrs:{model:t.formData,"label-position":"top",rules:t.rules}},[e("el-form-item",{attrs:{label:t.$t("表单类型"),prop:"type"}},[e("el-radio-group",{model:{value:t.formData.type,callback:function(e){t.$set(t.formData,"type",e)},expression:"formData.type"}},[e("el-radio",{attrs:{label:1}},[t._v(t._s(t.$t("表单")))]),e("el-radio",{attrs:{label:2}},[t._v(t._s(t.$t("问卷")))])],1)],1),e("el-form-item",{attrs:{label:t.$t("表单名称"),prop:"name"}},[e("el-input",{attrs:{placeholder:t.$t("请输入表单名称")},model:{value:t.formData.name,callback:function(e){t.$set(t.formData,"name",e)},expression:"formData.name"}})],1),e("el-form-item",{attrs:{label:t.$t("表单描述")}},[e("el-input",{attrs:{type:"textarea",rows:4,placeholder:t.$t("请输入表单描述")},model:{value:t.formData.desc,callback:function(e){t.$set(t.formData,"desc",e)},expression:"formData.desc"}})],1)],1)],1)},g=[],b={props:["data","dialogShow"],data:function(){return{dialog:!1,formData:{id:"",name:"",desc:"",type:1},rules:{name:[{required:!0,message:this.$t("请输入表单名称"),trigger:"blur"}],type:[{required:!0,message:this.$t("请选择表单类型"),trigger:"change"}]}}},watch:{data:{handler:function(t){this.formData=t},deep:!0},dialogShow:{handler:function(t){this.dialog=t}}},methods:{close:function(){this.$emit("update:dialogShow",!1)},onSubmit:function(){var t=this;this.$refs.form.validate(function(){var e=Object(r["a"])(Object(o["a"])().m((function e(a){var n;return Object(o["a"])().w((function(e){while(1)switch(e.n){case 0:if(!a){e.n=5;break}if(n="",!t.formData.id){e.n=2;break}return e.n=1,i["a"].edit(t.formData);case 1:n=e.v,e.n=4;break;case 2:return e.n=3,i["a"].add(t.formData);case 3:n=e.v;case 4:0===n.code&&(t.$message.success(n.msg),t.$emit("success"));case 5:return e.a(2)}}),e)})));return function(t){return e.apply(this,arguments)}}())}}},w=b,v=Object(f["a"])(w,p,g,!1,null,null,null),$=v.exports,_={components:{AddForm:$,share:h},data:function(){return{request:i["a"].list,code:"",title:this.$t("添加表单"),shareShow:!1,dialogShow:!1,designShow:!1,params:{name:""},formData:{},design_content:{},id:0,loading:!0,orderData:[]}},methods:{handlerCommand:function(t,e){switch(t){case"design":this.design(e);break;case"deploy":this.deploy(e);break;case"undeploy":this.undeploy(e);break;case"share":this.share(e);break}},search:function(t){this.$refs.baseTable.getList()},reset:function(){this.params.name="",this.$refs.baseTable.resetTable()},goAdd:function(){this.formData={type:1},this.title=this.$t("添加表单"),this.dialogShow=!0},editor:function(t){this.formData=t,this.title=this.$t("编辑表单"),this.dialogShow=!0},getList:function(t){this.$refs.baseTable.getList(t)},design:function(t){this.id=t.id,this.$router.push({path:"/form/design",query:{id:t.id}})},deploy:function(t){var e=this;return Object(r["a"])(Object(o["a"])().m((function a(){var n;return Object(o["a"])().w((function(a){while(1)switch(a.n){case 0:return a.n=1,i["a"].deploy({id:t.id});case 1:n=a.v,0==n.code&&(e.getList(),e.$message.success(n.msg));case 2:return a.a(2)}}),a)})))()},undeploy:function(t){var e=this;this.$confirm(this.$t("卸载表单提示"),this.$t("提示"),{confirmButtonText:this.$t("确定"),cancelButtonText:this.$t("取消"),type:"warning"}).then(Object(r["a"])(Object(o["a"])().m((function a(){var n;return Object(o["a"])().w((function(a){while(1)switch(a.n){case 0:return a.n=1,i["a"].undeploy({id:t.id});case 1:n=a.v,0==n.code&&(e.getList(),e.$message.success(n.msg));case 2:return a.a(2)}}),a)})))).catch((function(){}))},del:function(t){var e=this;this.$confirm(this.$t("您确定要删除该表单"),this.$t("提示"),{confirmButtonText:this.$t("确定"),cancelButtonText:this.$t("取消"),type:"warning"}).then(Object(r["a"])(Object(o["a"])().m((function a(){var n;return Object(o["a"])().w((function(a){while(1)switch(a.n){case 0:return a.n=1,i["a"].del({id:t.id});case 1:n=a.v,0==n.code&&(e.getList("search"),e.$message.success(n.msg));case 2:return a.a(2)}}),a)})))).catch((function(){}))},handleSuccess:function(){this.getList(),this.dialogShow=!1},designSuccess:function(){this.designShow=!1,this.getList()},shareSuccess:function(){this.shareShow=!1},share:function(t){this.code=t.code,this.shareShow=!0},detail:function(t){this.id=t.id,this.$router.push({path:"/form/detail",query:{id:t.id}})}}},y=_,S=(a("f79b"),a("f81f"),Object(f["a"])(y,n,s,!1,null,"552ca9c0",null));e["default"]=S.exports},"39da":function(t){t.exports=JSON.parse('{"form":{"labelPosition":"top","size":"mini","labelWidth":"125px","hideRequiredAsterisk":false,"showMessage":true,"inlineMessage":false},"submitBtn":true,"resetBtn":false}')},8508:function(t,e,a){"use strict";a("d2d4")},"8b7a":function(t,e,a){},c7ea:function(t,e,a){"use strict";var n=a("365c");function s(t){var e="/form/index";return n["a"].get(e,t)}function o(t){var e="/form/add";return n["a"].post(e,t)}function r(t){var e="/form/info";return n["a"].get(e,t)}function i(t){var e="/form/edit";return n["a"].post(e,t)}function c(t){var e="/form/del";return n["a"].get(e,t)}function u(t){var e="/form/deploy";return n["a"].get(e,t)}function l(t){var e="/form/undeploy";return n["a"].get(e,t)}function d(t){var e="/form/detail";return n["a"].get(e,t)}function f(t){var e="/form/quesDetail";return n["a"].get(e,t)}function m(t){var e="/form/exportForm";return n["a"].post(e,t)}e["a"]={list:s,formInfo:r,add:o,edit:i,del:c,deploy:u,undeploy:l,detail:d,quesDetail:f,exportForm:m}},d2d4:function(t,e,a){},e891:function(t,e,a){"use strict";a("f1e3")},f1e3:function(t,e,a){},f3b1:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"box"},[e("huocms-fc-designer",{ref:"designer",on:{saveForm:t.saveForm}})],1)},s=[],o=a("c14f"),r=a("1da1"),i=(a("b0c0"),a("e9c4"),a("c7ea")),c=a("06de"),u=a("39da"),l={name:"Design",props:["ids"],data:function(){return{id:0,formdata:{},defaultRule:"",defaultOption:""}},created:function(){this.id=this.$route.query.id},mounted:function(){this.getInfo(),this.defaultRule=JSON.stringify(c),this.defaultOption=JSON.stringify(u)},methods:{getInfo:function(){var t=this;return Object(r["a"])(Object(o["a"])().m((function e(){var a;return Object(o["a"])().w((function(e){while(1)switch(e.n){case 0:return e.n=1,i["a"].formInfo({id:t.id});case 1:a=e.v,0==a.code?(t.formdata=a.data,t.formdata.design_content?t.$refs.designer.setRule(t.formdata.design_content):2==t.formdata.type&&(t.$refs.designer.setRule(t.defaultRule),t.$refs.designer.setOption(t.defaultOption)),t.formdata.design_option&&t.$refs.designer.setOption(t.formdata.design_option)):t.$emit("success");case 2:return e.a(2)}}),e)})))()},saveForm:function(){var t=this;return Object(r["a"])(Object(o["a"])().m((function e(){var a,n,s;return Object(o["a"])().w((function(e){while(1)switch(e.n){case 0:if(a=t.$refs.designer.getRule(),n=t.$refs.designer.getOption(),0!=a.length){e.n=1;break}return t.$message.error("表单内容不能为空!"),e.a(2,!1);case 1:return e.n=2,i["a"].edit({id:t.formdata.id,name:t.formdata.name,design_content:JSON.stringify(a),design_option:JSON.stringify(n)});case 2:s=e.v,0==s.code&&(t.$emit("success"),t.$message.success(s.msg));case 3:return e.a(2)}}),e)})))()}}},d=l,f=(a("8508"),a("2877")),m=Object(f["a"])(d,n,s,!1,null,"6fc0403c",null);e["default"]=m.exports},f79b:function(t,e,a){"use strict";a("8b7a")},f81f:function(t,e,a){"use strict";a("fc27")},fc27:function(t,e,a){}}]);