chunk-7d5a52f4.96b0a3c5.js 4.8 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7d5a52f4"],{"19cc":function(t,e,o){"use strict";o("7668")},"4d58":function(t,e,o){},7668:function(t,e,o){},9084:function(t,e,o){"use strict";o.r(e);var a=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("Card",[o("Row",[o("Button",{directives:[{name:"opcode",rawName:"v-opcode",value:"admins/notice/protocol/add",expression:"'admins/notice/protocol/add'"},{name:"show",rawName:"v-show",value:t.showButton,expression:"showButton"}],attrs:{type:"primary"},on:{click:function(e){return t.openNoticeModal()}}},[o("Icon",{attrs:{type:"md-add"}}),t._v("新增用户协议\n ")],1)],1),o("Row",{staticClass:"mt10"},[o("Table",{ref:"selection",attrs:{border:"",columns:t.columns,data:t.tableData}})],1),o("div",{staticStyle:{margin:"10px",overflow:"hidden"}},[o("div",{staticStyle:{float:"left"}},[o("Page",{attrs:{total:t.total,current:t.currentPage,"page-size":t.pagenum},on:{"on-change":t.levelchangepage}})],1)])],1),o("Modal",{attrs:{width:"800px"},model:{value:t.showNoticeModal,callback:function(e){t.showNoticeModal=e},expression:"showNoticeModal"}},[o("p",{staticStyle:{"text-align":"center","font-size":"16px"},attrs:{slot:"header"},slot:"header"},[o("span",[t._v("用户协议")])]),o("Form",{ref:"addform",attrs:{"label-position":"right","label-width":80}},[o("FormItem",{attrs:{label:"协议内容:"}},[o("Row",{attrs:{type:"flex",justify:"space-between",align:"middle"}},[o("Col",{attrs:{span:"24"}},[o("editor",{ref:"editor",attrs:{value:t.content},on:{"on-change":t.handleChange}})],1)],1)],1)],1),o("div",{attrs:{slot:"footer"},slot:"footer"},[o("Row",{attrs:{type:"flex",justify:"center"}},[o("Button",{on:{click:function(e){t.showNoticeModal=!1}}},[t._v("取消")]),o("Button",{directives:[{name:"show",rawName:"v-show",value:"addnew"==t.eduModalTitle,expression:"eduModalTitle=='addnew'"}],attrs:{type:"primary",loading:t.btnLoading_pass},on:{click:function(e){return t.saveAdd()}}},[t._v("确定")])],1)],1)],1)],1)},s=[],i=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"editor-wrapper"},[o("div",{attrs:{id:t.editorId}})])},n=[],d=o("1a0b"),r=o.n(d),l=(o("4d58"),o("90de")),c={name:"Editor",props:{value:{type:String,default:""},valueType:{type:String,default:"html",validator:t=>Object(l["f"])(t,["html","text"])},changeInterval:{type:Number,default:200},cache:{type:Boolean,default:!0}},computed:{editorId(){return"editor"+this._uid}},methods:{setHtml(t){this.editor.txt.html(t)}},mounted(){this.editor=new r.a("#"+this.editorId),this.editor.customConfig.onchange=t=>{let e=this.editor.txt.text();this.cache&&(localStorage.editorCache=t),this.$emit("input","html"===this.valueType?t:e),this.$emit("on-change",t,e)},this.editor.customConfig.onchangeTimeout=this.changeInterval,this.editor.create();let t=this.value||localStorage.editorCache;t&&this.editor.txt.html(t)}},h=c,u=o("2877"),p=Object(u["a"])(h,i,n,!1,null,null,null),m=p.exports,g=m,w=o("66df"),f={name:"userAgreement",data(){return{showButton:!0,btnLoading_pass:!1,currentPage:1,total:0,showNoticeModal:!1,eduModalTitle:"addnew",pagenum:10,content:"12312323",columns:[{title:" 排序",key:"id"},{title:"更改时间",key:"updated_at"},{title:"创建",key:"user",render:(t,e)=>t("span",e.row.user.nick_name)},{title:"操作",key:"action",align:"center",render:(t,e)=>t("div",[t("Button",{props:{size:"small",type:"primary"},style:{marginTop:"5px",marginBottom:"5px"},on:{click:()=>{this.eduModalTitle="check",this.showNoticeModal=!0,this.$refs.editor.setHtml(e.row.content)}},directives:[{name:"opcode",value:"admins/notice/protocol"}]},"查看"),t("Button",{props:{size:"small",type:"primary"},style:{marginTop:"5px",marginBottom:"5px",marginLeft:"5px"},on:{click:()=>{this.eduModalTitle="addnew",this.showNoticeModal=!0,this.$refs.editor.setHtml(e.row.content)}},directives:[{name:"opcode",value:"admins/notice/protocol"}]},"编辑")])}],tableData:[]}},created(){this.getList()},components:{Editor:g},methods:{levelchangepage(t){this.currentPage=t,this.getList()},openNoticeModal(){this.eduModalTitle="addnew",this.showNoticeModal=!0,this.content="",this.$refs.editor.setHtml("")},getList(){w["a"].request({method:"POST",url:"/admins/system/protocol",data:{page:this.currentPage}}).then(t=>{"success"===t.data.code?(t.data.data==[]?this.showButton=!0:this.showButton=!1,this.tableData=t.data.data,this.total=t.data.data.total):this.$Message.error(t.data.message,"middle")})},saveAdd(){this.btnLoading_pass=!0,w["a"].request({url:"/admins/system/protocol/add",data:{content:this.content},method:"POST"}).then(t=>{"success"===t.data.code&&(this.showNoticeModal=!1,this.getList()),this.$Message.info(t.data.message),this.btnLoading_pass=!1})},handleChange(t,e){this.content=t,console.log("html",t),console.log("text",e)}}},v=f,y=(o("19cc"),Object(u["a"])(v,a,s,!1,null,null,null));e["default"]=y.exports}}]);