You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
18 KiB
1 lines
18 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-commons"],{"0b15":function(e,t,i){"use strict";i("ca5d")},"256d":function(e,t,i){"use strict";i("ee29")},"333d":function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"pagination-container",class:{hidden:e.hidden},staticStyle:{display:"block"}},[i("el-pagination",e._b({staticStyle:{display:"block"},attrs:{background:e.background,"current-page":e.currentPage,"page-size":e.pageSize,layout:e.layout,"page-sizes":e.pageSizes,total:e.total},on:{"update:currentPage":function(t){e.currentPage=t},"update:current-page":function(t){e.currentPage=t},"update:pageSize":function(t){e.pageSize=t},"update:page-size":function(t){e.pageSize=t},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}},"el-pagination",e.$attrs,!1))],1)},a=[],r=(i("6043"),i("09f4")),o={name:"Pagination",props:{total:{required:!0,type:Number},page:{type:Number,default:1},limit:{type:Number,default:20},pageSizes:{type:Array,default:function(){return[5,10,20,30,50]}},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"},background:{type:Boolean,default:!0},autoScroll:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1}},computed:{currentPage:{get:function(){return this.page},set:function(e){this.$emit("update:page",e)}},pageSize:{get:function(){return this.limit},set:function(e){this.$emit("update:limit",e)}}},methods:{handleSizeChange:function(e){this.$emit("pagination",{page:this.currentPage,limit:e}),this.autoScroll&&Object(r["a"])(0,800)},handleCurrentChange:function(e){this.$emit("pagination",{page:e,limit:this.pageSize}),this.autoScroll&&Object(r["a"])(0,800)}}},s=o,l=(i("c602"),i("4ac2")),c=Object(l["a"])(s,n,a,!1,null,"f9900da8",null);t["a"]=c.exports},6188:function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{"close-on-click-modal":!1,title:e.title,type:e.type,visible:e.isVisible,width:e.width,top:"50px"},on:{"update:visible":function(t){e.isVisible=t},dragDialog:e.handleDrag}},[i("el-form",{ref:"form",attrs:{model:e.model,rules:e.rules,"label-position":"right","label-width":"100px"}},[i("el-form-item",{attrs:{label:"文件",prop:"fileLength"}},[i("fileUpload",{ref:"fileRef",attrs:{"accept-size":e.acceptSize,"auto-upload":!1,limit:1,accept:e.accept,action:e.action},on:{fileLengthVaild:e.fileLengthVaild,setId:e.setIdAndSubmit}},[i("el-button",{attrs:{slot:"trigger",size:"small",type:"primary"},slot:"trigger"},[e._v("选取文件")]),i("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v("文件不超过100MB")])],1)],1)],1),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{plain:"",type:"warning"},on:{click:function(t){e.isVisible=!1}}},[e._v(e._s(e.$t("common.cancel")))]),i("el-button",{attrs:{disabled:e.disabled,plain:"",type:"primary"},on:{click:e.submitForm}},[e._v(e._s(e.$t("common.confirm")))])],1)],1)},a=[],r=i("1c03"),o=(i("6043"),i("a888")),s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("el-upload",{ref:e.uploadRef,staticClass:"upload-demo",class:!1===e.isUpload?"hidebtn":"",attrs:{accept:e.accept,action:e.action,"auto-upload":e.autoUpload,"before-remove":e.beforeRemove,data:e.fileOtherData,"file-list":e.fileList,headers:e.headers,limit:e.limit,multiple:e.multiple,"on-change":e.handleChange,"on-error":e.handleError,"on-exceed":e.handleExceed,"on-preview":e.handlePreview,"on-remove":e.handleRemove}},[e.isUpload?i("el-button",{attrs:{size:"small",type:"primary"}},[e._v("点击上传")]):e._e()],1)],1)},l=[],c=i("99a5"),u=(i("6a61"),i("9f5c"),i("82cb"),i("7952"),i("0f01"),i("a63e"),i("4a7c"),i("8783"),i("2f8c"),i("2b31"),i("801a"),i("a022"),i("5657")),d=i("c2cf"),h=i("fa7d"),f=i("2da9"),m={name:"FileUpload",props:{uploadRef:{type:String,default:"file1"},multiple:{type:Boolean,default:!0},autoUpload:{type:Boolean,default:!0},isUpload:{type:Boolean,default:!0},limit:{type:Number,default:null},accept:{type:String,default:""},action:{type:String,default:"".concat("https://pos.admin.api.lotus-wallet.com","/attachment/upload")},acceptSize:{type:Number,default:null},fileOtherData:{type:Object,default:function(){return{id:null,bizId:"",bizType:"",isSingle:!1}}}},data:function(){return{fileList:[],removeFileAry:[],addFileAry:[],successNum:0,errorNum:0,uploadTotalNum:0,isUploadError:!1}},computed:{headers:function(){return{token:"Bearer "+u["a"].get("TOKEN",""),tenant:u["a"].get("TENANT","")||"",Authorization:"Basic ".concat(f["Base64"].encode("".concat("ceres_admin_web",":").concat("ceres_admin_web")))}}},methods:{init:function(e){var t=e.id,i=e.bizId,n=e.bizType,a=e.isSingle,r=e.isDetail,o=this;o.fileOtherData.bizId=i,o.fileOtherData.id=t||"",o.fileOtherData.bizType=n,o.fileOtherData.isSingle=a||!1,o.fileList.length=0,o.removeFileAry=[],o.addFileAry=[],o.$emit("fileLengthVaild",0),r&&o.getAttachment(),o.successNum=0,o.errorNum=0,o.uploadTotalNum=0,o.$refs[o.uploadRef].clearFiles()},handleChange:function(e,t){var i=this;if(e.response)i.uploadTotalNum+=1,e.response.isSuccess?(i.fileOtherData.bizId=e.response.data.bizId,i.successNum+=1):(setTimeout((function(){i.$message({message:e.name+"上传失败,原因:<br/>"+e.response.msg,type:"error",dangerouslyUseHTMLString:!0,showClose:!0,duration:1e4,onClose:function(e){Object(h["b"])(e["message"]),i.$message({message:"复制错误消息成功",type:"success"})}})}),0),i.isUploadError=!1,i.errorNum+=1),i.$emit("setId",i.uploadTotalNum===t.length&&i.errorNum<=0,e.response);else{if(i.acceptSize){var n=e.size>i.acceptSize;n?(setTimeout((function(){i.$message.error("只能上传"+i.renderSize(i.acceptSize)+"的文件!已为您过滤文件:"+e.name)}),10),t.forEach((function(i,n){i.uid===e.uid&&t.splice(n,1)}))):(i.isUploadError||i.addFileAry.push(e.name),i.isUploadError=!1)}else i.isUploadError||i.addFileAry.push(e.name),i.isUploadError=!1;i.$emit("fileLengthVaild",i.fileList.length+i.addFileAry.length)}i.$store.state.hasLoading=!1},handleError:function(){var e=this;e.$message.error("附件上传失败,请重试"),e.isUploadError=!0,e.$store.state.hasLoading=!1},renderSize:function(e){if(null==e||""==e)return"0 B";var t=new Array("B","KB","MB","GB","TB","PB","EB","ZB","YB"),i=0,n=parseFloat(e);i=Math.floor(Math.log(n)/Math.log(1024));var a=n/Math.pow(1024,i);return a=a.toFixed(2),t[i]?a+t[i]:"文件太大"},handlePreview:function(e){e.bizId&&this.downLoadFile(e)},beforeRemove:function(e){return this.$confirm("确定移除"+e.name,"删除确认")},handleExceed:function(){var e=this;e.$message("当前最多允许上传"+e.limit+"个文件")},handleRemove:function(e){var t=this;e.bizId?(t.removeFileAry.push(e.id),t.fileList.map((function(i,n){if(i.name===e.name)return t.fileList.splice(n,1),!1}))):t.addFileAry.map((function(i,n){if(i===e.name)return t.addFileAry.splice(n,1),!1})),t.$emit("fileLengthVaild",t.fileList.length+t.addFileAry.length)},deleteAttachment:function(){var e=this;return Object(c["a"])(regeneratorRuntime.mark((function t(){var i,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return i=e,t.next=3,d["a"].deleteAttachment({ids:i.removeFileAry});case 3:n=t.sent,200===n.status&&(0!==n.data.code?i.$message(n.data.msg):i.removeFileAry=[]);case 5:case"end":return t.stop()}}),t)})))()},getAttachment:function(){var e=this;return Object(c["a"])(regeneratorRuntime.mark((function t(){var i,n,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return i=e,t.next=3,d["a"].getAttachment({bizIds:i.fileOtherData.bizId,bizTypes:i.fileOtherData.bizType});case 3:n=t.sent,200===n.status&&0===n.data.code&&n.data.data.length>0&&(a=n.data.data[0].list,a.map((function(e){e.name=e.submittedFileName})),i.fileList=a,i.$emit("fileLengthVaild",i.fileList.length));case 5:case"end":return t.stop()}}),t)})))()},getAttachmentByArr:function(e,t){var i=this;return Object(c["a"])(regeneratorRuntime.mark((function n(){var a,r,o;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return a=i,n.next=3,d["a"].getAttachment({bizIds:e,bizTypes:t});case 3:r=n.sent,200===r.status&&0===r.data.code&&r.data.data.length>0&&(o=r.data.data[0].list,o.map((function(e){e.name=e.submittedFileName})),a.fileList=o);case 5:case"end":return n.stop()}}),n)})))()},handleBack:function(){var e=this;return{addLength:e.addFileAry.length,removeLength:e.removeFileAry.length}},submitFile:function(e,t,i,n){var a=this;if(a.fileOtherData.id=e,t&&(a.fileOtherData.bizId=t,a.isUpload=!0),n&&(a.fileOtherData.tagId=n),a.fileOtherData.bizType=i,a.limitType(a.$refs[a.uploadRef].uploadFiles).length)return a.$message.error("只能上传jpg/png/mp4格式的文件");a.$refs[a.uploadRef].submit(),a.addFileAry=[]},downLoadFile:function(e){return Object(c["a"])(regeneratorRuntime.mark((function t(){var i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:i=document.createElement("a"),i.href=e.url,i.download=e.name,i.click(),window.URL.revokeObjectURL(i.href);case 5:case"end":return t.stop()}}),t)})))()},limitType:function(e){return e.filter((function(e){var t=e.raw.type;return-1===t.indexOf("image")&&-1===t.indexOf("video")}))}}},p=m,g=(i("256d"),i("4ac2")),b=Object(g["a"])(p,s,l,!1,null,null,null),y=b.exports,v={name:"CommonImport",directives:{elDragDialog:o["a"],fileUpload:y},components:{fileUpload:y},props:{action:{type:String,required:!0},acceptSize:{type:Number,default:52428800},accept:{type:String,default:".xls,.xlsx"},dialogVisible:{type:Boolean,default:!1},type:{type:String,default:"add"}},data:function(){var e=this;return{model:this.initImport(),screenWidth:0,width:this.initWidth(),fileLength:0,disabled:!1,rules:{fileLength:{required:!0,trigger:"change",validator:function(t,i,n){var a=e;0===a.fileLength?n(new Error("请上传文件")):a.fileLength>1?n(new Error("一次性只能上传1个文件")):n()}}}}},computed:{isVisible:{get:function(){return this.dialogVisible},set:function(){this.close(),this.reset()}},title:function(){return this.$t("common.upload")}},watch:{},mounted:function(){var e=this;window.onresize=function(){return function(){e.width=e.initWidth()}()}},methods:{initImport:function(){return{id:"",bizId:"",bizType:"",file:null,isSingle:!1}},handleDrag:function(){},fileLengthVaild:function(e){var t=this;t.fileLength=e||0},initWidth:function(){return this.screenWidth=document.body.clientWidth,this.screenWidth<991?"90%":this.screenWidth<1400?"45%":"800px"},setModel:function(e){var t=this;e&&(t.model=Object(r["a"])({},e))},close:function(){this.$emit("close")},reset:function(){this.$refs.form.clearValidate(),this.$refs.form.resetFields(),this.disabled=!1,this.model=this.initImport(),this.$refs.fileRef.init({id:""})},submitForm:function(){var e=this;this.$refs.form.validate((function(t){if(!t)return!1;e.editSubmit()}))},editSubmit:function(){var e=this;e.disabled=!0,e.$refs.fileRef.submitFile(this.model.id,this.model.bizId,this.model.bizType)},setIdAndSubmit:function(e,t){var i=this;e?(i.disabled=!1,i.isVisible=!1,i.$message({message:i.$t("tips.createSuccess"),type:"success"}),i.$emit("success")):t&&-9===t["code"]&&t["data"]}}},w=v,S=Object(g["a"])(w,n,a,!1,null,"33f3c7a0",null);t["a"]=S.exports},"7ca3":function(e,t,i){"use strict";i("d4a2")},8256:function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"tinymce-container",class:{fullscreen:e.fullscreen},style:{width:e.containerWidth}},[i("textarea",{staticClass:"tinymce-textarea",attrs:{id:e.tinymceId}}),i("div",{staticClass:"editor-custom-btn-container"},[i("editorImage",{staticClass:"editor-upload-btn",attrs:{color:"#1890ff"},on:{successCBK:e.imageSuccessCBK}})],1)])},a=[],r=(i("a63e"),i("6043"),i("7952"),function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"upload-container"},[i("el-button",{style:{background:e.color,borderColor:e.color},attrs:{icon:"el-icon-upload",size:"mini",type:"primary"},on:{click:function(t){e.dialogVisible=!0}}},[e._v(" 上传 ")]),i("el-dialog",{attrs:{visible:e.dialogVisible},on:{"update:visible":function(t){e.dialogVisible=t}}},[i("el-upload",{staticClass:"editor-slide-upload",attrs:{multiple:!0,"file-list":e.fileList,"show-file-list":!0,"on-remove":e.handleRemove,"on-success":e.handleSuccess,"before-upload":e.beforeUpload,action:"https://httpbin.org/post","list-type":"picture-card"}},[i("el-button",{attrs:{size:"small",type:"primary"}},[e._v(" 点击上传 ")])],1),i("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v(" 取消 ")]),i("el-button",{attrs:{type:"primary"},on:{click:e.handleSubmit}},[e._v(" 确认 ")])],1)],1)}),o=[],s=(i("aec7"),i("4a7c"),i("8783"),i("2f8c"),i("2b31"),i("801a"),{name:"EditorSlideUpload",props:{color:{type:String,default:"#1890ff"}},data:function(){return{dialogVisible:!1,listObj:{},fileList:[]}},methods:{checkAllSuccess:function(){var e=this;return Object.keys(this.listObj).every((function(t){return e.listObj[t].hasSuccess}))},handleSubmit:function(){var e=this,t=Object.keys(this.listObj).map((function(t){return e.listObj[t]}));this.checkAllSuccess()?(this.$emit("successCBK",t),this.listObj={},this.fileList=[],this.dialogVisible=!1):this.$message("Please wait for all images to be uploaded successfully. If there is a network problem, please refresh the page and upload again!")},handleSuccess:function(e,t){for(var i=t.uid,n=Object.keys(this.listObj),a=0,r=n.length;a<r;a++)if(this.listObj[n[a]].uid===i)return this.listObj[n[a]].url=e.files.file,void(this.listObj[n[a]].hasSuccess=!0)},handleRemove:function(e){for(var t=e.uid,i=Object.keys(this.listObj),n=0,a=i.length;n<a;n++)if(this.listObj[i[n]].uid===t)return void delete this.listObj[i[n]]},beforeUpload:function(e){var t=this,i=window.URL||window.webkitURL,n=e.uid;return this.listObj[n]={},new Promise((function(a,r){var o=new Image;o.src=i.createObjectURL(e),o.onload=function(){t.listObj[n]={hasSuccess:!1,uid:e.uid,width:this.width,height:this.height}},a(!0)}))}}}),l=s,c=(i("0b15"),i("4ac2")),u=Object(c["a"])(l,r,o,!1,null,"996e75e8",null),d=u.exports,h=["advlist anchor autolink autosave code codesample colorpicker colorpicker contextmenu directionality emoticons fullscreen hr image imagetools insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textcolor textpattern visualblocks visualchars wordcount"],f=h,m=["searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample","hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen"],p=m,g=i("6283"),b=[];function y(){return window.tinymce}var v=function(e,t){var i=document.getElementById(e),n=t||function(){};if(!i){var a=document.createElement("script");a.src=e,a.id=e,document.body.appendChild(a),b.push(n);var r="onload"in a?o:s;r(a)}function o(t){t.onload=function(){this.onerror=this.onload=null;var e,i=Object(g["a"])(b);try{for(i.s();!(e=i.n()).done;){var n=e.value;n(null,t)}}catch(a){i.e(a)}finally{i.f()}b=null},t.onerror=function(){this.onerror=this.onload=null,n(new Error("Failed to load "+e),t)}}function s(e){e.onreadystatechange=function(){if("complete"===this.readyState||"loaded"===this.readyState){this.onreadystatechange=null;var t,i=Object(g["a"])(b);try{for(i.s();!(t=i.n()).done;){var n=t.value;n(null,e)}}catch(a){i.e(a)}finally{i.f()}b=null}}}i&&n&&(y()?n(null,i):b.push(n))},w=v,S="https://cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.3/tinymce.min.js",z={name:"Tinymce",components:{editorImage:d},props:{id:{type:String,default:function(){return"vue-tinymce-"+ +new Date+(1e3*Math.random()).toFixed(0)}},value:{type:String,default:""},toolbar:{type:Array,required:!1,default:function(){return[]}},menubar:{type:String,default:"file edit insert view format table"},height:{type:[Number,String],required:!1,default:360},width:{type:[Number,String],required:!1,default:"auto"}},data:function(){return{hasChange:!1,hasInit:!1,tinymceId:this.id,fullscreen:!1,languageTypeList:{en:"en",zh:"zh_CN",es:"es_MX",ja:"ja"}}},computed:{language:function(){return this.languageTypeList.zh},containerWidth:function(){var e=this.width;return/^[\d]+(\.[\d]+)?$/.test(e)?"".concat(e,"px"):e}},watch:{value:function(e){var t=this;!this.hasChange&&this.hasInit&&this.$nextTick((function(){return window.tinymce.get(t.tinymceId).setContent(e||"")}))},language:function(){var e=this;this.destroyTinymce(),this.$nextTick((function(){return e.initTinymce()}))}},mounted:function(){this.init()},activated:function(){window.tinymce&&this.initTinymce()},deactivated:function(){this.destroyTinymce()},destroyed:function(){this.destroyTinymce()},methods:{init:function(){var e=this;w(S,(function(t){t?e.$message.error(t.message):e.initTinymce()}))},initTinymce:function(){var e=this,t=this;window.tinymce.init({language:this.language,selector:"#".concat(this.tinymceId),height:this.height,body_class:"panel-body ",object_resizing:!1,toolbar:this.toolbar.length>0?this.toolbar:p,menubar:this.menubar,plugins:f,end_container_on_empty_block:!0,powerpaste_word_import:"clean",code_dialog_height:450,code_dialog_width:1e3,advlist_bullet_styles:"square",advlist_number_styles:"default",imagetools_cors_hosts:["www.tinymce.com","codepen.io"],default_link_target:"_blank",link_title:!1,nonbreaking_force_tab:!0,init_instance_callback:function(i){t.value&&i.setContent(t.value),t.hasInit=!0,i.on("NodeChange Change KeyUp SetContent",(function(){e.hasChange=!0,e.$emit("input",i.getContent())}))},setup:function(e){e.on("FullscreenStateChanged",(function(e){t.fullscreen=e.state}))}})},destroyTinymce:function(){var e=window.tinymce.get(this.tinymceId);this.fullscreen&&e.execCommand("mceFullScreen"),e&&e.destroy()},setContent:function(e){window.tinymce.get(this.tinymceId).setContent(e)},getContent:function(){window.tinymce.get(this.tinymceId).getContent()},imageSuccessCBK:function(e){var t=this;e.forEach((function(e){window.tinymce.get(t.tinymceId).insertContent('<img class="wscnph" src="'.concat(e.url,'" >'))}))}}},_=z,O=(i("7ca3"),Object(c["a"])(_,n,a,!1,null,"7b750b2c",null));t["a"]=O.exports},"90f3":function(e,t,i){},c602:function(e,t,i){"use strict";i("90f3")},ca5d:function(e,t,i){},d4a2:function(e,t,i){},ee29:function(e,t,i){}}]); |