chunk-3d79b526.3e778a6d.js 4.1 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3d79b526"],{"4c78":function(e,t,o){},b8f5:function(e,t,o){"use strict";o("4c78")},e91d:function(e,t,o){"use strict";o.r(t);var r=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[e.addProtocolTypeDialog?o("el-dialog",{attrs:{title:e.addProtocolTypeTitle,visible:e.addProtocolTypeDialog,width:"1000px","close-on-press-escape":!1,"close-on-click-modal":!1},on:{"update:visible":function(t){e.addProtocolTypeDialog=t},close:e.cancel}},[o("el-form",{ref:"ruleForm",staticStyle:{"margin-bottom":"15px"},attrs:{model:e.ruleForm,rules:e.rules,inline:""}},[o("el-form-item",{attrs:{label:"模版类型:"}},[e._v(" "+e._s(e.treeName)+" ")]),o("el-form-item",{staticStyle:{"margin-left":"30px"},attrs:{label:"模版名称:",prop:"protocolTemplateName"}},[o("el-input",{model:{value:e.ruleForm.protocolTemplateName,callback:function(t){e.$set(e.ruleForm,"protocolTemplateName",t)},expression:"ruleForm.protocolTemplateName"}})],1),o("el-form-item",{staticStyle:{"margin-left":"30px"},attrs:{label:"状态:",prop:"status"}},[o("el-switch",{attrs:{"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},model:{value:e.ruleForm.status,callback:function(t){e.$set(e.ruleForm,"status",t)},expression:"ruleForm.status"}})],1)],1),o("div",{staticStyle:{"max-height":"65vh",overflow:"auto"}},[o("vue-editor",{style:e.editorStyle,attrs:{id:"editor",useCustomImageHandler:""},on:{"image-added":e.handleImageAdded},model:{value:e.ruleForm.protocolTemplateContent,callback:function(t){e.$set(e.ruleForm,"protocolTemplateContent",t)},expression:"ruleForm.protocolTemplateContent"}})],1),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:e.cancel}},[e._v("取 消")]),o("el-button",{attrs:{type:"primary"},on:{click:e.submit}},[e._v("确 定")])],1)],1):e._e()],1)},a=[],l=o("c7eb"),n=o("1da1"),s=(o("ac1f"),o("5319"),o("5873")),c=o("943d"),i=o("bc3a"),u=o.n(i),m={name:"AddProtocolTypeDialog",components:{VueEditor:s["a"]},props:{listInId:{type:String,default:""},treeName:{type:String,default:""},editTable:{type:Object,default:{}},addProtocolTypeTitle:{type:String,default:""}},computed:{editorStyle:function(){var e={};for(var t in this.editorClass){var o=t.replace(/([A-Z])/g,(function(e){return"-".concat(e.toLowerCase())}));e[o]=this.editorClass[t]}return e}},watch:{editTable:function(e){this.ruleForm=e}},data:function(){return{addProtocolTypeDialog:!1,diagnosisTypeTemplateList:[],ruleForm:{protocolTemplateName:"",status:1,protocolTemplateContent:""},rules:{protocolTemplateName:[{required:!0,message:"请输入模版名称",trigger:"blur"}]}}},mounted:function(){var e=this;this.$nextTick((function(){console.log(e.ruleForm,"this.ruleForm"),e.ruleForm=e.editTable}))},methods:{cancel:function(){this.addProtocolTypeDialog=!1},submit:function(){var e=this;return Object(n["a"])(Object(l["a"])().mark((function t(){var o,r;return Object(l["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if("新建"!==e.addProtocolTypeTitle){t.next=11;break}return e.ruleForm.protocolType=e.listInId,t.next=4,Object(c["bb"])(e.ruleForm);case 4:if(o=t.sent,200===o.code){t.next=7;break}return t.abrupt("return",e.$message.error(o.msg));case 7:e.ruleForm={protocolTemplateName:"",status:1,protocolTemplateContent:""},e.$message.success("新建成功!"),t.next=19;break;case 11:return e.ruleForm.protocolType=e.listInId,t.next=14,Object(c["eb"])(e.ruleForm);case 14:if(r=t.sent,200===r.code){t.next=17;break}return t.abrupt("return",e.$message.error(r.msg));case 17:e.ruleForm={protocolTemplateName:"",status:1,protocolTemplateContent:""},e.$message.success("编辑成功!");case 19:e.$parent.initList(),e.addProtocolTypeDialog=!1;case 21:case"end":return t.stop()}}),t)})))()},handleImageAdded:function(e,t,o,r){var a=new FormData;a.append("image",e),u()({url:"https://fakeapi.yoursite.com/images",method:"POST",data:a}).then((function(e){var a=e.data.url;t.insertEmbed(o,"image",a),r()})).catch((function(e){console.log(e)}))}}},p=m,d=(o("b8f5"),o("2877")),f=Object(d["a"])(p,r,a,!1,null,"edd13932",null);t["default"]=f.exports}}]);