diff --git a/.env.development b/.env.development index a2d3c44..3e8fff9 100644 --- a/.env.development +++ b/.env.development @@ -3,7 +3,7 @@ ENV = 'development' VUE_APP_PROJECT_NAME = 'cereshop-admin-web' # 请求服务配置 -VUE_APP_DEV_REQUEST_DOMAIN_PREFIX = 'http://192.168.10.130:8764' +VUE_APP_DEV_REQUEST_DOMAIN_PREFIX = 'http://192.168.10.236:8764' #VUE_APP_DEV_REQUEST_DOMAIN_PREFIX = 'http://8764.graf0b20.7xedcknz.ca6242.grapps.cn' #VUE_APP_DEV_REQUEST_DOMAIN_PREFIX = 'http://platform.test.api.lotus-wallet.com/' # 是否启用验证码 diff --git a/admin-web/index.html b/admin-web/index.html index d452efa..63285c6 100644 --- a/admin-web/index.html +++ b/admin-web/index.html @@ -1 +1 @@ -回乡POS平台端
\ No newline at end of file +回乡POS平台端
\ No newline at end of file diff --git a/admin-web/static/css/chunk-commons.60773cc4.css b/admin-web/static/css/chunk-commons.60773cc4.css new file mode 100644 index 0000000..cfae55a --- /dev/null +++ b/admin-web/static/css/chunk-commons.60773cc4.css @@ -0,0 +1 @@ +.editor-slide-upload[data-v-ea4df53e]{margin-bottom:20px}.editor-slide-upload[data-v-ea4df53e] .el-upload--picture-card{width:100%}.tinymce-container[data-v-47eaa0ca]{position:relative;line-height:normal}.tinymce-container[data-v-47eaa0ca] .mce-fullscreen{z-index:10000}.tinymce-textarea[data-v-47eaa0ca]{visibility:hidden;z-index:-1}.editor-custom-btn-container[data-v-47eaa0ca]{position:absolute;right:4px;top:4px}.fullscreen .editor-custom-btn-container[data-v-47eaa0ca]{z-index:10000;position:fixed}.editor-upload-btn[data-v-47eaa0ca]{display:inline-block}.pagination-container[data-v-6bb784f3]{background:#fff;padding:32px 16px 16px 0;margin-top:0}.hidebtn .el-upload,.pagination-container.hidden[data-v-6bb784f3]{display:none} \ No newline at end of file diff --git a/admin-web/static/css/chunk-commons.6b11ddb8.css b/admin-web/static/css/chunk-commons.6b11ddb8.css deleted file mode 100644 index 0790cf3..0000000 --- a/admin-web/static/css/chunk-commons.6b11ddb8.css +++ /dev/null @@ -1 +0,0 @@ -.editor-slide-upload[data-v-62a51960]{margin-bottom:20px}.editor-slide-upload[data-v-62a51960] .el-upload--picture-card{width:100%}.tinymce-container[data-v-138b9c4a]{position:relative;line-height:normal}.tinymce-container[data-v-138b9c4a] .mce-fullscreen{z-index:10000}.tinymce-textarea[data-v-138b9c4a]{visibility:hidden;z-index:-1}.editor-custom-btn-container[data-v-138b9c4a]{position:absolute;right:4px;top:4px}.fullscreen .editor-custom-btn-container[data-v-138b9c4a]{z-index:10000;position:fixed}.editor-upload-btn[data-v-138b9c4a]{display:inline-block}.pagination-container[data-v-6bb784f3]{background:#fff;padding:32px 16px 16px 0;margin-top:0}.hidebtn .el-upload,.pagination-container.hidden[data-v-6bb784f3]{display:none} \ No newline at end of file diff --git a/admin-web/static/js/chunk-commons.0d0017da.js b/admin-web/static/js/chunk-commons.0d0017da.js deleted file mode 100644 index cb4450e..0000000 --- a/admin-web/static/js/chunk-commons.0d0017da.js +++ /dev/null @@ -1 +0,0 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-commons"],{"0ce0":function(e,t,i){"use strict";var n=i("decd"),a=i.n(n);a.a},1762:function(e,t,i){},"256d":function(e,t,i){"use strict";var n=i("97b9"),a=i.n(n);a.a},"277f":function(e,t,i){"use strict";var n=i("1762"),a=i.n(n);a.a},"32e7":function(e,t,i){"use strict";var n=i("57e6"),a=i.n(n);a.a},"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("a9e3"),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("32e7"),i("2877")),c=Object(l["a"])(s,n,a,!1,null,"6bb784f3",null);t["a"]=c.exports},"57e6":function(e,t,i){},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("a9e3"),i("5530")),o=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("99af"),i("4de4"),i("4160"),i("c975"),i("d81d"),i("a434"),i("b0c0"),i("b680"),i("d3b7"),i("3ca3"),i("159b"),i("ddb0"),i("2b3d"),i("96cf"),i("1da1")),d=i("5657"),u=i("c2cf"),h=i("fa7d"),p=i("27ae"),f={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 "+d["a"].get("TOKEN",""),tenant:d["a"].get("TENANT","")||"",Authorization:"Basic ".concat(p["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+"上传失败,原因:
"+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,u["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,u["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,u["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")}))}}},m=f,g=(i("256d"),i("2877")),b=Object(g["a"])(m,s,l,!1,null,null,null),v=b.exports,y={name:"CommonImport",directives:{elDragDialog:o["a"],fileUpload:v},components:{fileUpload:v},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=y,S=Object(g["a"])(w,n,a,!1,null,"3b4ddc6f",null);t["a"]=S.exports},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("4160"),i("a9e3"),i("b680"),i("159b"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"upload-container"},[n("el-button",{style:{background:e.color,borderColor:e.color},attrs:{icon:"el-icon-upload",size:"mini",type:"primary"},on:{click:e.uploadClick}},[e._v(" 上传 ")]),n("el-dialog",{attrs:{visible:e.dialogVisible,"append-to-body":!0},on:{"update:visible":function(t){e.dialogVisible=t}}},[n("el-upload",{staticClass:"editor-slide-upload",attrs:{multiple:!0,headers:e.headers,"file-list":e.fileList,"show-file-list":!0,"on-remove":e.handleRemove,"on-success":e.handleSuccess,data:e.dataObj,action:e.action,"list-type":"picture-card"}},[n("el-button",{attrs:{size:"small",type:"primary"}},[e._v(" 上传图片 ")])],1),n("el-upload",{staticClass:"avatar-uploader el-upload--text",attrs:{action:e.action,data:e.dataObj,headers:e.headers,"show-file-list":!1,"on-success":e.handleVideoSuccess,"before-upload":e.beforeUploadVideo,"on-progress":e.uploadVideoProcess}},[""!=e.videoUrl&&0==e.videoFlag?n("video",{staticClass:"video-js",attrs:{controls:"",autoplay:"muted",preload:"auto",poster:i("3d86")}},[e._v(" > "),n("source",{attrs:{src:e.videoUrl,type:"video/mp4"}})]):""==e.videoUrl&&0==e.videoFlag?n("i",{staticClass:"el-icon-plus avatar-uploader-icon"},[e._v("上传视频")]):e._e(),1==e.videoFlag?n("el-progress",{staticStyle:{"margin-top":"30px"},attrs:{type:"circle",percentage:e.videoUploadPercent}}):e._e()],1),n("P",{staticClass:"text"},[e._v("请保证视频格式正确,且不超过10M")]),n("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v(" 取消 ")]),n("el-button",{attrs:{type:"primary"},on:{click:e.handleSubmit}},[e._v(" 确认 ")])],1)],1)}),o=[],s=(i("a623"),i("c975"),i("b64b"),i("d3b7"),i("3ca3"),i("ddb0"),i("2b3d"),i("5657")),l={name:"EditorSlideUpload",props:{color:{type:String,default:"#1890ff"}},data:function(){return{dialogVisible:!1,listObj:{},fileList:[],action:"".concat("https://pos.admin.api.lotus-wallet.com","/file/upload"),list:[],headers:{Authorization:""},dataObj:{folderId:1},videoUrl:"",videoUploadPercent:0,videoFlag:!1}},created:function(){this.headers.token="Bearer "+s["a"].get("TOKEN",""),this.headers.tenant="MDAwMA=="},methods:{uploadClick:function(){this.dialogVisible=!0,this.videoUrl=""},handleVideoSuccess:function(e,t){0==e.code?(this.videoUrl=e.data.url,this.videoFlag=!1):this.$message.error("视频上传失败,请重新上传!")},beforeUploadVideo:function(e){if(-1==["video/mp4","video/ogg","video/flv","video/avi","video/wmv","video/rmvb"].indexOf(e.type))return this.$message.error("请上传正确的视频格式"),!1},uploadVideoProcess:function(e,t,i){this.videoFlag=!0,this.videoUploadPercent=Number(t.percentage.toFixed(0))},checkAllSuccess:function(){var e=this;return Object.keys(this.listObj).every((function(t){return e.listObj[t].hasSuccess}))},handleSubmit:function(){var e=this.list;this.$emit("successCBK",e,this.videoUrl),this.listObj={},this.fileList=[],this.list=[],this.dialogVisible=!1},handleSuccess:function(e,t){"IMAGE"==e.data.dataType&&this.list.push(e.data.url),"VIDEO"==e.data.dataType&&(this.videoUrl=e.data.url);for(var i=t.uid,n=Object.keys(this.listObj),a=0,r=n.length;a0?this.toolbar:g,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,t){var i=this;e.forEach((function(e){window.tinymce.get(i.tinymceId).insertContent(''))})),window.tinymce.get(i.tinymceId).insertContent(''))}}},O=z,k=(i("277f"),Object(d["a"])(O,n,a,!1,null,"138b9c4a",null));t["a"]=k.exports},"97b9":function(e,t,i){},decd:function(e,t,i){}}]); \ No newline at end of file diff --git a/admin-web/static/js/chunk-commons.370c6686.js b/admin-web/static/js/chunk-commons.370c6686.js new file mode 100644 index 0000000..67a77b4 --- /dev/null +++ b/admin-web/static/js/chunk-commons.370c6686.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-commons"],{"256d":function(e,t,i){"use strict";var n=i("97b9"),a=i.n(n);a.a},"32e7":function(e,t,i){"use strict";var n=i("57e6"),a=i.n(n);a.a},"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=[],o=(i("a9e3"),i("09f4")),r={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(o["a"])(0,800)},handleCurrentChange:function(e){this.$emit("pagination",{page:e,limit:this.pageSize}),this.autoScroll&&Object(o["a"])(0,800)}}},s=r,l=(i("32e7"),i("2877")),c=Object(l["a"])(s,n,a,!1,null,"6bb784f3",null);t["a"]=c.exports},"57e6":function(e,t,i){},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=[],o=(i("a9e3"),i("5530")),r=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("99af"),i("4de4"),i("4160"),i("c975"),i("d81d"),i("a434"),i("b0c0"),i("b680"),i("d3b7"),i("3ca3"),i("159b"),i("ddb0"),i("2b3d"),i("96cf"),i("1da1")),d=i("5657"),u=i("c2cf"),h=i("fa7d"),f=i("27ae"),p={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 "+d["a"].get("TOKEN",""),tenant:d["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,o=e.isDetail,r=this;r.fileOtherData.bizId=i,r.fileOtherData.id=t||"",r.fileOtherData.bizType=n,r.fileOtherData.isSingle=a||!1,r.fileList.length=0,r.removeFileAry=[],r.addFileAry=[],r.$emit("fileLengthVaild",0),o&&r.getAttachment(),r.successNum=0,r.errorNum=0,r.uploadTotalNum=0,r.$refs[r.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+"上传失败,原因:
"+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,u["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,u["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,o,r;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return a=i,n.next=3,u["a"].getAttachment({bizIds:e,bizTypes:t});case 3:o=n.sent,200===o.status&&0===o.data.code&&o.data.data.length>0&&(r=o.data.data[0].list,r.map((function(e){e.name=e.submittedFileName})),a.fileList=r);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")}))}}},m=p,g=(i("256d"),i("2877")),b=Object(g["a"])(m,s,l,!1,null,null,null),v=b.exports,y={name:"CommonImport",directives:{elDragDialog:r["a"],fileUpload:v},components:{fileUpload:v},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(o["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=y,S=Object(g["a"])(w,n,a,!1,null,"3b4ddc6f",null);t["a"]=S.exports},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=[],o=(i("4160"),i("a9e3"),i("b680"),i("159b"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"upload-container"},[n("el-button",{style:{background:e.color,borderColor:e.color},attrs:{icon:"el-icon-upload",size:"mini",type:"primary"},on:{click:e.uploadClick}},[e._v(" 上传 ")]),n("el-dialog",{attrs:{visible:e.dialogVisible,"append-to-body":!0},on:{"update:visible":function(t){e.dialogVisible=t}}},[n("el-upload",{staticClass:"editor-slide-upload",attrs:{multiple:!0,headers:e.headers,"file-list":e.fileList,"show-file-list":!0,"on-remove":e.handleRemove,"on-success":e.handleSuccess,data:e.dataObj,action:e.action,"list-type":"picture-card"}},[n("el-button",{attrs:{size:"small",type:"primary"}},[e._v(" 上传图片 ")])],1),n("el-upload",{staticClass:"avatar-uploader el-upload--text",attrs:{action:e.action,data:e.dataObj,headers:e.headers,"show-file-list":!1,"on-success":e.handleVideoSuccess,"before-upload":e.beforeUploadVideo,"on-progress":e.uploadVideoProcess}},[""!=e.videoUrl&&0==e.videoFlag?n("video",{staticClass:"video-js",attrs:{controls:"",autoplay:"muted",preload:"auto",poster:i("3d86")}},[e._v(" > "),n("source",{attrs:{src:e.videoUrl,type:"video/mp4"}})]):""==e.videoUrl&&0==e.videoFlag?n("i",{staticClass:"el-icon-plus avatar-uploader-icon"},[e._v("上传视频")]):e._e(),1==e.videoFlag?n("el-progress",{staticStyle:{"margin-top":"30px"},attrs:{type:"circle",percentage:e.videoUploadPercent}}):e._e()],1),n("P",{staticClass:"text"},[e._v("请保证视频格式正确,且不超过10M")]),n("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v(" 取消 ")]),n("el-button",{attrs:{type:"primary"},on:{click:e.handleSubmit}},[e._v(" 确认 ")])],1)],1)}),r=[],s=(i("a623"),i("c975"),i("b64b"),i("d3b7"),i("3ca3"),i("ddb0"),i("2b3d"),i("5657")),l={name:"EditorSlideUpload",props:{color:{type:String,default:"#1890ff"}},data:function(){return{dialogVisible:!1,listObj:{},fileList:[],action:"".concat("https://pos.admin.api.lotus-wallet.com","/file/upload"),list:[],headers:{Authorization:""},dataObj:{folderId:1},videoUrl:"",videoUploadPercent:0,videoFlag:!1}},created:function(){this.headers.token="Bearer "+s["a"].get("TOKEN",""),this.headers.tenant="MDAwMA=="},methods:{uploadClick:function(){this.dialogVisible=!0,this.videoUrl=""},handleVideoSuccess:function(e,t){0==e.code?(this.videoUrl=e.data.url,this.videoFlag=!1):this.$message.error("视频上传失败,请重新上传!")},beforeUploadVideo:function(e){if(-1==["video/mp4","video/ogg","video/flv","video/avi","video/wmv","video/rmvb"].indexOf(e.type))return this.$message.error("请上传正确的视频格式"),!1},uploadVideoProcess:function(e,t,i){this.videoFlag=!0,this.videoUploadPercent=Number(t.percentage.toFixed(0))},checkAllSuccess:function(){var e=this;return Object.keys(this.listObj).every((function(t){return e.listObj[t].hasSuccess}))},handleSubmit:function(){var e=this.list;this.$emit("successCBK",e,this.videoUrl),this.listObj={},this.fileList=[],this.list=[],this.dialogVisible=!1},handleSuccess:function(e,t){console.log(e,"response"),"IMAGE"==e.data.dataType.code&&this.list.push(e.data.url),"VIDEO"==e.data.dataType.code&&(this.videoUrl=e.data.url);for(var i=t.uid,n=Object.keys(this.listObj),a=0,o=n.length;a0?this.toolbar:g,menubar:this.menubar,plugins:p,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,t){var i=this;console.log(e,"arr"),console.log(t,"videoUrl"),e.length&&e.forEach((function(e){window.tinymce.get(i.tinymceId).insertContent(''))})),t&&window.tinymce.get(i.tinymceId).insertContent(''))}}},O=z,k=(i("baaf"),Object(d["a"])(O,n,a,!1,null,"47eaa0ca",null));t["a"]=k.exports},"904a":function(e,t,i){},"97b9":function(e,t,i){},baaf:function(e,t,i){"use strict";var n=i("f104"),a=i.n(n);a.a},e2ac:function(e,t,i){"use strict";var n=i("904a"),a=i.n(n);a.a},f104:function(e,t,i){}}]); \ No newline at end of file diff --git a/src/components/Tinymce/components/EditorImage.vue b/src/components/Tinymce/components/EditorImage.vue index 2123d50..9bfa70f 100644 --- a/src/components/Tinymce/components/EditorImage.vue +++ b/src/components/Tinymce/components/EditorImage.vue @@ -158,10 +158,11 @@ export default { this.dialogVisible = false }, handleSuccess(response, file) { - if (response.data.dataType == 'IMAGE') { + console.log(response,'response') + if (response.data.dataType.code == 'IMAGE') { this.list.push(response.data.url) } - if (response.data.dataType == 'VIDEO') { + if (response.data.dataType.code == 'VIDEO') { this.videoUrl = response.data.url } const uid = file.uid diff --git a/src/components/Tinymce/index.vue b/src/components/Tinymce/index.vue index b461d1e..434f58d 100644 --- a/src/components/Tinymce/index.vue +++ b/src/components/Tinymce/index.vue @@ -209,18 +209,24 @@ export default { }, imageSuccessCBK(arr,videoUrl) { const _this = this - arr.forEach(v => { - window.tinymce.get(_this.tinymceId).insertContent(``) - }) - window.tinymce.get(_this.tinymceId).insertContent(``) + console.log(arr,'arr') + console.log(videoUrl,'videoUrl') + if(arr.length) { + arr.forEach(v => { + window.tinymce.get(_this.tinymceId).insertContent(``) + }) + } + if(videoUrl) { + window.tinymce.get(_this.tinymceId).insertContent(``) + } + } } }