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
12 KiB
1 lines
12 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-commons"],{"095c":function(e,t,i){"use strict";var n=function(){var e=this,t=e._self._c;return t("div",["url"==this.type?t("el-upload",{ref:"upload",staticStyle:{display:"none"},attrs:{action:e.uploadUrl,"before-upload":e.handleBeforeUpload,"on-success":e.handleUploadSuccess,"on-error":e.handleUploadError,name:"file","show-file-list":!1,headers:e.accessToken}}):e._e(),t("div",{ref:"editor",staticClass:"editor",style:e.styles})],1)},l=[],a=i("9339"),s=i.n(a),o=(i("a753"),i("8096"),i("14e1"),i("5f87")),r=i("a8f4"),u={name:"Editor",props:{value:{type:String,default:""},height:{type:Number,default:null},minHeight:{type:Number,default:null},readOnly:{type:Boolean,default:!1},fileSize:{type:Number,default:5},type:{type:String,default:"url"}},data:function(){return{uploadUrl:r["a"],headers:{Authorization:"Bearer "+Object(o["b"])()},accessToken:null,Quill:null,currentValue:"",options:{theme:"snow",bounds:document.body,debug:"warn",modules:{toolbar:[["bold","italic","underline","strike"],["blockquote","code-block"],[{list:"ordered"},{list:"bullet"}],[{indent:"-1"},{indent:"+1"}],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{align:[]}],["clean"],["link","image","video"]]},placeholder:"请输入内容",readOnly:this.readOnly}}},computed:{styles:function(){var e={};return this.minHeight&&(e.minHeight="".concat(this.minHeight,"px")),this.height&&(e.height="".concat(this.height,"px")),e}},watch:{value:{handler:function(e){e!==this.currentValue&&(this.currentValue=null===e?"":e,this.Quill&&this.Quill.pasteHTML(this.currentValue))},immediate:!0}},created:function(){this.accessToken={token:Object(o["a"])()}},mounted:function(){this.init()},beforeDestroy:function(){this.Quill=null},methods:{init:function(){var e=this,t=this.$refs.editor;if(this.Quill=new s.a(t,this.options),"url"==this.type){var i=this.Quill.getModule("toolbar");i.addHandler("image",(function(t){e.uploadType="image",t?e.$refs.upload.$children[0].$refs.input.click():e.quill.format("image",!1)}))}this.Quill.pasteHTML(this.currentValue),this.Quill.on("text-change",(function(t,i,n){var l=e.$refs.editor.children[0].innerHTML,a=e.Quill.getText(),s=e.Quill;e.currentValue=l,e.$emit("input",l),e.$emit("on-change",{html:l,text:a,quill:s})})),this.Quill.on("text-change",(function(t,i,n){e.$emit("on-text-change",t,i,n)})),this.Quill.on("selection-change",(function(t,i,n){e.$emit("on-selection-change",t,i,n)})),this.Quill.on("editor-change",(function(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),l=1;l<i;l++)n[l-1]=arguments[l];e.$emit.apply(e,["on-editor-change",t].concat(n))}))},handleBeforeUpload:function(e){if(this.fileSize){var t=e.size/1024/1024<this.fileSize;if(!t)return this.$message.error("上传文件大小不能超过 ".concat(this.fileSize," MB!")),!1}return!0},handleUploadSuccess:function(e,t){var i=this.Quill;if("200"==e.code){var n=i.getSelection().index;i.insertEmbed(n,"image",e.data.fullUrl),i.setSelection(n+1)}else this.$message.error("图片插入失败")},handleUploadError:function(){this.$message.error("图片插入失败")}}},c=u,d=(i("6327"),i("2877")),h=Object(d["a"])(c,n,l,!1,null,null,null);t["a"]=h.exports},"0f39":function(e,t,i){"use strict";var n=function(){var e=this,t=e._self._c;return t("div",[t("el-upload",{attrs:{action:e.uploadAction,headers:e.accessToken,data:e.dataObj,"list-type":"picture",multiple:!1,"show-file-list":e.showFileList,"file-list":e.fileList,"before-upload":e.beforeUpload,"on-remove":e.handleRemove,"on-success":e.handleUploadSuccess,"on-preview":e.handlePreview}},[t("el-button",{attrs:{size:"small",type:"primary"}},[e._v("点击上传")]),t("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v("只能上传jpg/png文件,且不超过10MB")])],1),t("el-dialog",{attrs:{visible:e.dialogVisible},on:{"update:visible":function(t){e.dialogVisible=t}}},[t("img",{attrs:{width:"100%",src:e.fileList[0].url,alt:""}})])],1)},l=[],a=(i("6e0d"),i("5f87")),s={name:"SingleUpload",props:{value:String},data:function(){return{uploadAction:"/lpkapi/mall/file/upload",accessToken:null,dataObj:{policy:"",signature:"",key:"",ossaccessKeyId:"",dir:"",host:""},dialogVisible:!1}},computed:{imageUrl:function(){return this.value},imageName:function(){return null!=this.value&&""!==this.value?this.value.substr(this.value.lastIndexOf("/")+1):null},fileList:function(){return[{name:this.imageName,url:this.imageUrl}]},showFileList:{get:function(){return null!==this.value&&""!==this.value&&void 0!==this.value},set:function(e){}}},created:function(){this.accessToken={token:Object(a["a"])()}},methods:{emitInput:function(e){this.$emit("input",e)},handleRemove:function(e,t){this.emitInput("")},handlePreview:function(e){this.dialogVisible=!0},beforeUpload:function(e){},handleUploadSuccess:function(e,t){this.showFileList=!0,this.fileList.pop(),this.fileList.push({name:t.name,url:e.data.fullUrl}),this.emitInput(this.fileList[0].url)}}},o=s,r=i("2877"),u=Object(r["a"])(o,n,l,!1,null,null,null);t["a"]=u.exports},"1f31":function(e,t,i){},6327:function(e,t,i){"use strict";i("a0fb")},6648:function(e,t,i){"use strict";var n=function(){var e=this,t=e._self._c;return t("div",[t("el-upload",{directives:[{name:"loading",rawName:"v-loading",value:e.loadding,expression:"loadding"}],ref:"imgUpload",staticClass:"avatar-uploader",attrs:{limit:e.limit,headers:e.accessToken,action:e.uploadFile,accept:e.accept,"list-type":"picture-card","file-list":e.files,"on-remove":e.removeImage,"on-preview":e.handlePictureCardPreview,"on-progress":e.uploadProgrees,"on-error":e.uploadError,"on-success":e.uploadImgSuccess_FuJian}},[t("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]),t("el-dialog",{attrs:{visible:e.dialogVisible,title:"查看图片"},on:{"update:visible":function(t){e.dialogVisible=t}}},[t("img",{attrs:{width:"100%",src:e.dialogImageUrl,alt:""}})])],1)},l=[],a=i("a8f4"),s=i("5f87"),o={model:{prop:"name",event:"change"},props:{placeholder:{type:String,default:""},bucket:{type:String,default:"abc"},width:{type:String,default:"270px"},limit:{type:Number,default:""},accept:{type:String,default:".jpg,.jpeg,.png,.JPG,.JPEG,"},name:{type:Array,required:!0},uploadData:{type:Object,default:{}}},data:function(){return{dialogImageUrl:"",dialogVisible:!1,accessToken:null,uploadFile:a["a"],fileList_FuJian:[],enclosure:"",file_add:"",file_catch:"",files:[],files_list:[],filedUrl:"",isview:!1,nameArr:"",loadding:!1}},watch:{name:{deep:!0,immediate:!0,handler:function(e,t){this.files=e}}},mounted:function(){var e=this;this.$nextTick((function(){e.Init()}))},created:function(){this.uploadFile=a["a"],this.accessToken={token:Object(s["a"])()}},methods:{showImg:function(e){this.files=e},view:function(){},Init:function(){if(void 0!==this.name){this.files=[];for(var e=0;e<this.name.length;e++)this.files.push({name:this.name[e],url:this.name[e]})}},handlePictureCardPreview:function(e){this.dialogVisible=!0,this.dialogImageUrl=e.url},uploadImgSuccess_FuJian:function(e,t,i){console.log("您选择的file:",t),"200"===t.response.code&&(this.loadding=!1,this.filedUrl=this.fileUrl+t.response.data,this.files.push({name:t.response.data.sourceFileName,url:t.response.data.fullUrl,size:t.response.data.size}),this.$emit("change",this.files),this.$emit("eett",this.files))},removeImage:function(e,t){this.files.splice(this.files.indexOf(e),1);var i=[];this.files.forEach((function(e){i.push(e.url)})),this.$emit("fileChange",this.files),this.$emit("change",this.files)},handleRemove:function(e,t){console.log("file:"+JSON.stringify(e)),console.log("fileList:"+JSON.stringify(t)),this.enclosure="",this.getNewFileId(t),this.getCatchFileId(e),this.getFileId(),this.$emit("change",this.enclosure)},getNewFileId:function(e){this.file_add="";for(var t=0;t<e.length;t++)e[t].response&&"200"===e[t].response.code&&(this.file_add=this.file_add+e[t].response.data+",");""!==this.file_add&&(this.file_add=this.file_add.substring(0,this.file_add.length-1))},getCatchFileId:function(e){for(var t=this,i=0;i<this.files_list.length;i++)if(""!==this.file_catch&&this.files_list[i].name===e.name){var n=this.file_catch.split(","),l=[];n.forEach((function(e){e!==t.files_list[i].id&&l.push(e)})),this.file_catch=l.join(",")}},getFileId:function(){""!==this.file_catch?""!==this.file_add?this.enclosure=this.file_catch+","+this.file_add:this.enclosure=this.file_catch:this.enclosure=this.file_add},uploadError:function(){this.loadding=!1},uploadProgrees:function(e,t,i){Number(e.percent)>0&&(this.loadding=!0)}}},r=o,u=i("2877"),c=Object(u["a"])(r,n,l,!1,null,"e2bf95b0",null);t["a"]=c.exports},7042:function(e,t,i){"use strict";var n=function(){var e=this,t=e._self._c;return t("div",{staticClass:"pagination-container e-pagination",class:{hidden:e.hidden}},[t("el-pagination",e._b({attrs:{background:e.background,"current-page":e.current,"page-size":e.Size,layout:e.layout,"page-sizes":e.pageSizes,total:e.total},on:{"update:currentPage":function(t){e.current=t},"update:current-page":function(t){e.current=t},"update:pageSize":function(t){e.Size=t},"update:page-size":function(t){e.Size=t},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}},"el-pagination",e.$attrs,!1))],1)},l=[],a={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,15,20,30,50]}},layout:{type:String,default:"sizes"},background:{type:Boolean,default:!0},autoScroll:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1}},computed:{current:{get:function(){return this.page},set:function(e){this.$emit("update:page",e)}},Size:{get:function(){return this.limit},set:function(e){this.$emit("update:limit",e)}}},methods:{handleSizeChange:function(e){this.$emit("pagination",{pageNum:this.curren,pageSize:e})},handleCurrentChange:function(e){this.$emit("pagination",{pageNum:e,pageSize:this.Size})}}},s=a,o=(i("922f"),i("2877")),r=Object(o["a"])(s,n,l,!1,null,null,null);t["a"]=r.exports},"77b3":function(e,t,i){"use strict";var n=function(){var e=this,t=e._self._c;return t("div",{staticClass:"tab-header webtop"},[t("div",[e._v(e._s(e.viewTitle))]),t("div",e._l(e.btnList,(function(i){return t("el-button",{key:i.btnKey,attrs:{type:i.type,size:i.size,disabled:e.btndisabled},on:{click:function(t){return e.btnHandle(i.btnKey)}}},[i.icon?t("svg-icon",{attrs:{iconClass:i.icon}}):e._e(),e._v(e._s(i.btnLabel)+" ")],1)})),1)])},l=[],a={name:"ButtonBar",props:{viewTitle:String,btndisabled:{type:Boolean,default:!1}},data:function(){return{currentPath:this.$route.path,userSid:this.$store.getters.userInfo?this.$store.getters.userInfo.userSid:"",btnList:[{type:"primary",size:"small",icon:"plus",btnKey:"toAdd",btnLabel:"新增"},{type:"primary",size:"small",icon:"edit",btnKey:"toEdit",btnLabel:"编辑"},{type:"primary",size:"small",icon:"submit",btnKey:"doSubmit",btnLabel:"提交"},{type:"danger",size:"small",icon:"del",btnKey:"doDel",btnLabel:"删除"},{type:"success",size:"small",icon:"Import",btnKey:"doImport",btnLabel:"导入"},{type:"success",size:"small",icon:"export",btnKey:"build",btnLabel:"导出"},{type:"info",size:"small",icon:"cross",btnKey:"doClose",btnLabel:"关闭"}]}},created:function(){this.initPermission()},methods:{initPermission:function(){console.log("*******************当前路径 "+this.currentPath),console.log("*******************当前用户 "+this.userSid);this.currentPath,this.userSid},btnHandle:function(e){this.$emit("btnhandle",e)},setButtonList:function(e){this.btnList=e}}},s=a,o=(i("c640"),i("2877")),r=Object(o["a"])(s,n,l,!1,null,"c4aa0380",null);t["a"]=r.exports},"922f":function(e,t,i){"use strict";i("1f31")},a0fb:function(e,t,i){},a442:function(e,t,i){},c640:function(e,t,i){"use strict";i("a442")}}]);
|