chunk-782cf150.f0a88d4f.js 13 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-782cf150","chunk-3d79b526"],{"4c78":function(e,t,o){},"6d02":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",{staticClass:"app-container"},[o("el-row",{attrs:{gutter:20}},[o("el-col",{attrs:{span:4,xs:24}},[o("div",{staticClass:"head-container"}),o("div",{staticClass:"head-container",staticStyle:{"max-height":"calc(100vh - 160px)","overflow-y":"auto"}},[o("el-tree",{ref:"tree",attrs:{data:e.deptOptions,props:e.defaultProps,"check-on-click-node":!0,"expand-on-click-node":!1,"show-checkbox":"","node-key":"id","default-expand-all":"","highlight-current":"","check-strictly":!0},on:{"node-click":e.handleNodeClick},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.node;t.data;return o("span",{staticClass:"custom-tree-node"},[o("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:r.label,placement:"top-start","open-delay":500}},[o("span",[e._v(" "+e._s(r.label)+" ")])])],1)}}])})],1)]),o("el-col",{attrs:{span:20,xs:24}},[o("el-row",{staticClass:"mb8",attrs:{gutter:10}},[o("el-col",{attrs:{span:1.5}},[o("el-button",{attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:e.addAdd}},[e._v("新建")])],1)],1),o("el-table",{staticStyle:{width:"100%",height:"calc(100%-80vh)"},attrs:{data:e.tableData}},[o("el-table-column",{attrs:{label:"模版类型","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[o("span",[e._v(e._s(t.row.protocolTypeCn||"-"))])]}}])}),o("el-table-column",{attrs:{label:"模版名称","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[o("span",[e._v(e._s(t.row.protocolTemplateName||"-"))])]}}])}),o("el-table-column",{attrs:{label:"创建人","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[o("span",[e._v(e._s(t.row.createUser||"-"))])]}}])}),o("el-table-column",{attrs:{label:"创建时间","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[o("span",[e._v(e._s(t.row.createDate||"-"))])]}}])}),o("el-table-column",{attrs:{label:"状态","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[o("el-switch",{attrs:{"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},on:{change:function(o){return e.deactivate(t.row)}},model:{value:t.row.status,callback:function(o){e.$set(t.row,"status",o)},expression:"scope.row.status"}})]}}])}),o("el-table-column",{attrs:{label:"操作",align:"center",width:"120",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(o){return e.editTableData(t.row)}}},[e._v(" 编辑 ")]),o("el-button",{staticStyle:{color:"red"},attrs:{type:"text",size:"mini"},on:{click:function(o){return e.delTableData(t.row)}}},[e._v(" 删除 ")])]}}])})],1)],1)],1),o("el-dialog",{attrs:{title:e.title,visible:e.dialogVisible,width:"30%","close-on-press-escape":!1,"close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogVisible=t},close:e.closeDialog}},[o("el-form",{ref:"ruleForm",staticClass:"demo-ruleForm",attrs:{model:e.ruleForm,rules:e.rules,"label-width":"100px"},nativeOn:{submit:function(e){e.preventDefault()}}},[o("el-form-item",{attrs:{label:"模板类型:",prop:"protocolName"}},[o("el-input",{attrs:{placeholder:"请输入模板类型"},model:{value:e.ruleForm.protocolName,callback:function(t){e.$set(e.ruleForm,"protocolName",t)},expression:"ruleForm.protocolName"}})],1)],1),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:e.closeDialog}},[e._v("取 消")]),o("el-button",{attrs:{type:"primary"},on:{click:e.submit}},[e._v("确 定")])],1)],1),o("addProtocolTypeDialog",{ref:"addTemplateDialogRef",attrs:{addProtocolTypeTitle:e.addProtocolTypeTitle,editTable:e.editTable,listInId:e.listInId,treeName:e.treeName}})],1)},a=[],l=o("c7eb"),s=o("1da1"),n=o("943d"),i=o("e91d"),c={name:"EitcErmPcIndex",components:{addProtocolTypeDialog:i["default"]},data:function(){return{tableData:[],deptOptions:[],defaultProps:{children:"childrenList",label:"protocolName"},ruleForm:{protocolName:""},editTable:{},treeName:"",rules:{protocolName:[{required:!0,message:"请输入模板类型",trigger:"blur"}]},lookFlag:!1,listInId:"",dialogVisible:!1,title:"",addProtocolTypeTitle:"",total:0}},mounted:function(){this.initProtocolTypeList()},methods:{editTableData:function(e){this.editTable=e,this.addProtocolTypeTitle="编辑",this.$refs.addTemplateDialogRef.addProtocolTypeDialog=!0},deactivate:function(e){var t=this;return Object(s["a"])(Object(l["a"])().mark((function o(){var r;return Object(l["a"])().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return o.next=2,Object(n["eb"])(e);case 2:if(r=o.sent,200===r.code){o.next=5;break}return o.abrupt("return",t.$message.error(r.msg));case 5:t.$message.success("编辑成功!"),t.initList();case 7:case"end":return o.stop()}}),o)})))()},delTableData:function(e){var t=this;this.$confirm("此操作将永久删除该项, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(s["a"])(Object(l["a"])().mark((function o(){var r;return Object(l["a"])().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return o.next=2,Object(n["db"])(e.id);case 2:if(r=o.sent,200===r.code){o.next=5;break}return o.abrupt("return",t.$message.error(r.msg));case 5:t.initList(),t.$message({type:"success",message:"删除成功!"});case 7:case"end":return o.stop()}}),o)})))).catch((function(){t.$message({type:"info",message:"已取消删除"})}))},initProtocolTypeList:function(){var e=this;return Object(s["a"])(Object(l["a"])().mark((function t(){var o;return Object(l["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(n["gb"])();case 2:if(o=t.sent,200===o.code){t.next=5;break}return t.abrupt("return",e.$message.error(o.msg));case 5:e.deptOptions=o.data,o.data.length&&(e.listInId=e.deptOptions[0].id,e.treeName=e.deptOptions[0].protocolName,e.initList());case 7:case"end":return t.stop()}}),t)})))()},initList:function(){var e=this;return Object(s["a"])(Object(l["a"])().mark((function t(){var o;return Object(l["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(n["cb"])({protocolType:e.listInId});case 2:if(o=t.sent,200===o.code){t.next=5;break}return t.abrupt("return",e.$message.error(o.msg));case 5:e.tableData=o.rows,e.total=o.total;case 7:case"end":return t.stop()}}),t)})))()},closeDialog:function(){var e;this.ruleForm.protocolName="",null===(e=this.$refs.ruleForm)||void 0===e||e.resetFields(),this.dialogVisible=!1,this.initList()},submit:function(){var e=this;this.$refs.ruleForm.validate(function(){var t=Object(s["a"])(Object(l["a"])().mark((function t(o){var r,a;return Object(l["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!o){t.next=19;break}if("新建"!==e.title){t.next=9;break}return t.next=4,Object(n["fb"])({protocolName:e.ruleForm.protocolName});case 4:if(r=t.sent,200===r.code){t.next=7;break}return t.abrupt("return",e.$message.error(r.msg));case 7:t.next=14;break;case 9:return t.next=11,Object(n["ib"])({protocolName:e.ruleForm.protocolName,id:e.listInId});case 11:if(a=t.sent,200===a.code){t.next=14;break}return t.abrupt("return",e.$message.error(a.msg));case 14:e.$message.success("".concat(e.title,"成功!")),e.initProtocolTypeList(),e.closeDialog(),t.next=21;break;case 19:return console.log("error submit!!"),t.abrupt("return",!1);case 21:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},handleNodeClick:function(e,t,o){this.listInId=e.id,this.treeName=e.protocolName,t&&this.$refs.tree.getCheckedNodes().length>1&&this.$refs.tree.setCheckedNodes([e]),this.initList()},addAdd:function(){if(!this.listInId)return this.$message.info("请先选择模版类型!");this.editTable={protocolTemplateName:"",status:1,protocolTemplateContent:""},this.addProtocolTypeTitle="新建",this.$refs.addTemplateDialogRef.addProtocolTypeDialog=!0},add:function(){this.title="新建",this.ruleForm.protocolName="",this.dialogVisible=!0},edit:function(){if(!this.$refs.tree.getCheckedNodes().length)return this.$message.info("请选择需要编辑的选项");this.title="编辑",this.dialogVisible=!0,this.ruleForm.protocolName=this.$refs.tree.getCheckedNodes()[0].protocolName},del:function(){var e=this;if(!this.$refs.tree.getCheckedNodes().length)return this.$message.info("请选择需要删除的选项");this.$confirm("此操作将永久删除该项, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(s["a"])(Object(l["a"])().mark((function t(){var o;return Object(l["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.ids=e.$refs.tree.getCheckedNodes()[0].id,t.next=3,Object(n["hb"])({ids:e.ids});case 3:if(o=t.sent,200===o.code){t.next=6;break}return t.abrupt("return",e.$message.error(o.msg));case 6:e.$message.success("删除成功!"),e.initProtocolTypeList();case 8:case"end":return t.stop()}}),t)})))).catch((function(){}))}}},u=c,d=o("2877"),p=Object(d["a"])(u,r,a,!1,null,null,null);t["default"]=p.exports},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"),s=o("1da1"),n=(o("ac1f"),o("5319"),o("5873")),i=o("943d"),c=o("bc3a"),u=o.n(c),d={name:"AddProtocolTypeDialog",components:{VueEditor:n["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(s["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(i["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(i["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=d,m=(o("b8f5"),o("2877")),f=Object(m["a"])(p,r,a,!1,null,"edd13932",null);t["default"]=f.exports}}]);