2 lines
3.3 KiB
JavaScript
2 lines
3.3 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-186c26fc"],{"1fe6":function(t,o,e){},"20ee":function(t,o,e){"use strict";e("1fe6")},"48b3":function(t,o,e){"use strict";e.r(o);var r=function(){var t=this,o=t._self._c;return o("el-row",{staticClass:"register-protocol-container"},[o("el-col",{attrs:{span:24}},[o("el-card",{staticClass:"box-card"},[o("div",{staticClass:"clearfix flex justify-between",attrs:{slot:"header"},slot:"header"},[o("span",[t._v("注册协议")])]),o("el-form",{attrs:{"label-position":"right","label-width":"120px"}},[o("el-form-item",{attrs:{label:t.$t("registerProtocol.userProtocol")}},[o("div",{staticClass:"editor-container"},[o("quill-editor",{attrs:{options:t.editorOption},on:{change:function(o){return t.onEditorChange(o,"userProtocol")}},model:{value:t.registerProtocolInfo.userProtocol,callback:function(o){t.$set(t.registerProtocolInfo,"userProtocol",o)},expression:"registerProtocolInfo.userProtocol"}})],1)]),o("el-form-item",{attrs:{label:t.$t("registerProtocol.merchantProtocol")}},[o("div",{staticClass:"editor-container"},[o("quill-editor",{attrs:{options:t.editorOption},on:{change:function(o){return t.onEditorChange(o,"merchantProtocol")}},model:{value:t.registerProtocolInfo.merchantProtocol,callback:function(o){t.$set(t.registerProtocolInfo,"merchantProtocol",o)},expression:"registerProtocolInfo.merchantProtocol"}})],1)]),o("el-form-item",[o("el-button",{staticClass:"float-right",attrs:{type:"primary"},on:{click:t.updateRegisterProtocol}},[t._v(" "+t._s(t.$t("common.modify"))+" ")])],1)],1)],1)],1)],1)},s=[],c=e("b775");function i(t){return new Promise((o,e)=>{Object(c["a"])({url:"/system.listRegisterProtocol",method:"get",params:t}).then(t=>{const e=t.data;o(e)}).catch(t=>{e(t)})})}function a(t){return new Promise((o,e)=>{Object(c["a"])({url:"/system.updateRegisterProtocol",method:"post",data:t,headers:{"Content-Type":"application/json"}}).then(t=>{const e=t.data;o(e)}).catch(t=>{e(t)})})}var n={name:"RegisterProtocol",components:{},data(){return{registerProtocolInfo:{userProtocol:"",merchantProtocol:"",protolcolId:""},editorOption:{modules:{toolbar:[["bold","italic","underline","strike"],["blockquote","code-block"],[{header:1},{header:2}],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["clean"],["link","image","video"]]},placeholder:this.$t("registerProtocol.required"),theme:"snow"}}},created(){this.getRegisterProtocols()},methods:{onEditorChange({html:t},o){this.registerProtocolInfo[o]=t},async getRegisterProtocols(){try{const t=await i({page:1,row:1});t.data&&t.data.length>0&&(this.registerProtocolInfo={...t.data[0]})}catch(t){console.error("获取注册协议失败:",t)}},async updateRegisterProtocol(){try{const t=await a(this.registerProtocolInfo);0===t.code?(this.$message.success(this.$t("common.modifySuccess")),this.getRegisterProtocols()):this.$message.error(t.msg)}catch(t){console.error("更新注册协议失败:",t),this.$message.error(this.$t("common.modifyFailed"))}}}},l=n,d=(e("20ee"),e("2877")),u=Object(d["a"])(l,r,s,!1,null,"206de0ac",null);o["default"]=u.exports}}]);
|
|
//# sourceMappingURL=chunk-186c26fc.275b6062.js.map
|