chunk-60a4a222.a8ee674c.js 18 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-60a4a222"],{"055f":function(t,e,i){},"4e40":function(t,e,i){"use strict";i("055f")},a573:function(t,e,i){"use strict";i("ab43")},ab43:function(t,e,i){"use strict";var s=i("23e7"),a=i("d024");s({target:"Iterator",proto:!0,real:!0,forced:i("c430")},{map:a})},b3ad:function(t,e,i){"use strict";i("a573");var s=i("9ab4"),a=i("1b40"),l=i("0a6d"),r=i("c6fe"),n=i("e915"),c=i("b76a"),o=i.n(c);let d=class extends a.e{constructor(){super(...arguments),this.isAdd=!0,this.fileList=[]}get showUpload(){const{fileList:t,limit:e}=this;return e-t.length>0}get meterialLimit(){return this.isAdd?this.limit?this.limit-this.fileList.length:null:1}get tipsText(){switch(this.type){case"image":return"图片";case"video":return"视频"}}get imageUri(){return t=>this.enableDomain?t:this.$getImageUri(t)}valueChange(t){this.fileList=Array.isArray(t)?t:""==t?[]:[t]}showDialog(t=!0,e){var i;this.disabled||(this.isAdd=t,void 0!==e&&(this.currentIndex=e),null===(i=this.$refs.materialDialog)||void 0===i||i.onTrigger())}selectChange(t){this.select=t}handleConfirm(){this.$refs.material.clearSelectList();const t=this.select.map(t=>this.enableDomain?t.uri:t.url);this.isAdd?this.fileList=this.fileList.concat(t):this.fileList.splice(this.currentIndex,1,t.shift()),this.handleChange()}delImage(t){this.fileList.splice(t,1),this.handleChange()}handleChange(){const t=1!=this.limit?this.fileList:this.fileList[0]||"";this.$emit("input",t),this.$emit("change",t),this.fileList=[]}};Object(s.a)([Object(a.c)({default:()=>[]})],d.prototype,"value",void 0),Object(s.a)([Object(a.c)({default:1})],d.prototype,"limit",void 0),Object(s.a)([Object(a.c)({default:"100"})],d.prototype,"size",void 0),Object(s.a)([Object(a.c)({default:!1})],d.prototype,"disabled",void 0),Object(s.a)([Object(a.c)({default:!1})],d.prototype,"dragDisabled",void 0),Object(s.a)([Object(a.c)({default:!1})],d.prototype,"hiddenTrigger",void 0),Object(s.a)([Object(a.c)({default:"image"})],d.prototype,"type",void 0),Object(s.a)([Object(a.c)({default:"transparent"})],d.prototype,"uploadBg",void 0),Object(s.a)([Object(a.c)({default:!0})],d.prototype,"enableDomain",void 0),Object(s.a)([Object(a.c)({default:!0})],d.prototype,"enableDelete",void 0),Object(s.a)([Object(a.f)("value",{immediate:!0})],d.prototype,"valueChange",null),d=Object(s.a)([Object(a.a)({components:{LsDialog:l.a,LsMaterial:r.a,Draggable:o.a,FileItem:n.a}})],d);var p=d,h=(i("4e40"),i("2877")),u=Object(h.a)(p,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("ls-dialog",{ref:"materialDialog",staticClass:"material-select",attrs:{title:"选择"+t.tipsText,width:"1050px",top:"15vh"},on:{confirm:t.handleConfirm}},[t.hiddenTrigger?t._e():i("div",{staticClass:"material-select__trigger clearfix",attrs:{slot:"trigger"},on:{click:function(t){t.stopPropagation()}},slot:"trigger"},[i("draggable",{staticClass:"ls-draggable",attrs:{animation:"300",disabled:t.disabled||t.dragDisabled},on:{update:t.handleChange},model:{value:t.fileList,callback:function(e){t.fileList=e},expression:"fileList"}},t._l(t.fileList,(function(e,s){return i("div",{key:e+s,staticClass:"material-preview ls-del-wrap",class:{"is-disabled":t.disabled,"is-one":1==t.limit},on:{click:function(e){return t.showDialog(!1,s)}}},[t.$scopedSlots.preview?i("div",[t._t("preview",null,{item:t.imageUri(e)})],2):i("file-item",{attrs:{type:t.type,item:{uri:t.imageUri(e)},size:t.size}}),t.enableDelete?i("i",{staticClass:"el-icon-close ls-icon-del",on:{click:function(e){return e.stopPropagation(),t.delImage(s)}}}):t._e()],1)})),0),i("div",{directives:[{name:"show",rawName:"v-show",value:t.showUpload,expression:"showUpload"}],staticClass:"material-upload",class:{"is-disabled":t.disabled,"is-one":1==t.limit},on:{click:function(e){return t.showDialog(!0)}}},[t.$slots.upload?i("div",[t._t("upload")],2):i("div",{staticClass:"upload-btn flex row-center",style:{width:t.size+"px",height:t.size+"px",background:t.uploadBg}},[t._t("default"),t.$slots.default?t._e():i("span",[t._v("添加"+t._s(t.tipsText))])],2)])],1),i("div",{staticClass:"material-wrap"},[i("ls-material",{ref:"material",attrs:{"page-size":15,type:t.type,limit:t.meterialLimit},on:{change:t.selectChange}})],1)])}),[],!1,null,"62c92359",null);e.a=u.exports},c6fe:function(t,e,i){"use strict";i("14d9"),i("0643"),i("2382"),i("fffc"),i("a573");var s=i("9ab4"),a=i("1b40"),l=i("d455"),r=i("3c50"),n=i("0a6d"),c=(i("76d6"),i("d70b")),o=i("e4f6");let d=class extends a.e{constructor(){super(...arguments),this.visible=!1,this.action=`${c.a.baseURL}/adminapi/upload/${this.type}`,this.fileList=[],this.version=c.a.version}handleProgress(t,e,i){this.visible=!0,this.fileList=i}handleSuccess(t,e,i){i.every(t=>"success"==t.status)&&(this.$refs.upload.clearFiles(),this.visible=!1),this.$emit("change"),0==t.code&&t.show&&this.$message.error(t.msg)}handleError(t,e){this.$message.error(e.name+"文件上传失败"),this.$refs.upload.abort(),this.visible=!1,this.$emit("change"),this.$emit("error")}handleExceed(){this.$message.error("超出上传上限,请重新上传")}handleClose(){this.$refs.upload.abort(),this.$refs.upload.clearFiles(),this.visible=!1}};Object(s.a)([Object(a.c)({default:10})],d.prototype,"limit",void 0),Object(s.a)([Object(a.c)({default:!0})],d.prototype,"multiple",void 0),Object(s.a)([Object(a.c)({default:()=>{}})],d.prototype,"data",void 0),Object(s.a)([Object(a.c)({default:"image"})],d.prototype,"type",void 0),Object(s.a)([Object(a.c)({default:!1})],d.prototype,"showProgress",void 0),d=Object(s.a)([Object(a.a)({components:{UploadList:o.a}})],d);var p=d,h=i("2877"),u=Object(h.a)(p,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("el-upload",{ref:"upload",staticClass:"ls-upload",attrs:{action:t.action,multiple:t.multiple,limit:t.limit,"show-file-list":!1,headers:{token:t.$store.getters.token,version:t.version},data:t.data,"on-progress":t.handleProgress,"on-success":t.handleSuccess,"on-exceed":t.handleExceed,"on-error":t.handleError}},[t._t("default")],2),t.showProgress&&t.fileList.length?i("el-dialog",{attrs:{title:"上传进度",visible:t.visible,top:"20vh","close-on-click-modal":!1,width:"500px",modal:!1,"before-close":t.handleClose},on:{"update:visible":function(e){t.visible=e}}},[i("div",{staticClass:"file-list"},[t._l(t.fileList,(function(e,s){return[i("div",{key:s,staticClass:"m-b-20"},[i("div",[t._v(t._s(e.name))]),i("div",{staticClass:"flex-1"},[i("el-progress",{attrs:{percentage:parseInt(e.percentage)}})],1)])]}))],2)]):t._e()],1)}),[],!1,null,"1a92e580",null).exports,g=i("e915"),m=i("db85"),f=i("6ddb");let b=class extends a.e{constructor(){super(...arguments),this.name="",this.moveId=0,this.checkAll=!1,this.isIndeterminate=!1,this.currentId="",this.fileList=[],this.groupeLists=[],this.pager=new f.a({size:this.pageSize}),this.selectList=[]}get typeValue(){switch(this.type){case"image":return 10;case"video":return 20;case"file":return 30}}selectListChange(t){if(this.$emit("change",t),t.length==this.pager.lists.length&&0!==t.length)return this.isIndeterminate=!1,void(this.checkAll=!0);t.length>0?this.isIndeterminate=!0:(this.checkAll=!1,this.isIndeterminate=!1)}get selectStatus(){return t=>this.selectList.find(e=>e.id==t)}async getGroupeList(){const t=await Object(m.f)({type:this.typeValue,page_type:1});this.groupeLists=null==t?void 0:t.lists,this.groupeLists.unshift({name:"全部",id:""},{name:"未分组",id:0})}getList(t){t&&(this.pager.page=t),"pages"==this.mode&&this.clearSelectList(),this.pager.request({callback:m.e,params:{type:this.typeValue,cid:this.currentId,name:this.name}})}addGroupe(t,e){if(!t)return this.$message.error("请输入分组名称");Object(m.a)({type:this.typeValue,pid:0|e,name:t}).then(t=>{this.getData()})}editGroupe(t,e){if(!t)return this.$message.error("请输入分组名称");Object(m.d)({name:t,id:e}).then(t=>{this.getData()})}delGroupe(t){Object(m.c)({id:t}).then(t=>{this.getData()})}async getData(){this.pager.loading=!0,await this.getGroupeList(),this.pager.loading=!1,this.getList()}currentChange({id:t}){this.name="",this.currentId=t,this.getList()}selectFile(t){const e=this.selectList.findIndex(e=>e.id==t.id);if(-1==e)return"popup"==this.mode&&this.selectList.length==this.limit?1==this.limit?(this.selectList=[],void this.selectList.push(t)):void this.$message.warning("已达到选择上限"):void this.selectList.push(t);this.selectList.splice(e,1)}selectAll(t){this.isIndeterminate=!1,t?this.selectList=[...this.pager.lists]:this.clearSelectList()}batchFileDel(t){const e=t||this.selectList.map(t=>t.id);Object(m.b)({ids:e}).then(t=>{this.getList()})}batchFileMove(){const t=this.selectList.map(t=>t.id);Object(m.g)({ids:t,cid:this.moveId}).then(t=>{this.moveId=0,this.getList()})}fileRename(t,e){Object(m.h)({id:e,name:t}).then(()=>{this.getList()})}delImage(t){this.selectList=this.selectList.filter(e=>e.id!=t)}clearSelectList(){this.selectList=[]}created(){this.getData()}};Object(s.a)([Object(a.c)({default:"image"})],b.prototype,"type",void 0),Object(s.a)([Object(a.c)({default:"100"})],b.prototype,"size",void 0),Object(s.a)([Object(a.c)({default:"popup"})],b.prototype,"mode",void 0),Object(s.a)([Object(a.c)({default:20})],b.prototype,"pageSize",void 0),Object(s.a)([Object(a.c)()],b.prototype,"limit",void 0),Object(s.a)([Object(a.f)("selectList")],b.prototype,"selectListChange",null),b=Object(s.a)([Object(a.a)({components:{LsPagination:r.a,PopoverInput:l.a,LsDialog:n.a,LsUpload:u,FileItem:g.a}})],b);var v=b,y=(i("e257"),Object(h.a)(v,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{directives:[{name:"loading",rawName:"v-loading",value:t.pager.loading,expression:"pager.loading"}],staticClass:"material flex col-stretch"},[s("div",{staticClass:"material__left"},[s("el-scrollbar",{staticClass:"ls-scrollbar",staticStyle:{height:"calc(100% - 80px)"}},[s("div",{staticClass:"material-left__content p-t-16"},[s("el-tree",{attrs:{"node-key":"id",data:t.groupeLists,"empty-text":"","highlight-current":!0,"expand-on-click-node":!1,"icon-class":"el-icon-arrow-right","current-node-key":t.currentId},on:{"node-click":t.currentChange},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.data;return[s("div",{staticClass:"flex flex-1"},[s("img",{staticClass:"m-r-10",staticStyle:{width:"20px",height:"16px"},attrs:{src:i("f0b8"),alt:""}}),s("span",{staticClass:"flex-1 line-1 m-r-10",staticStyle:{"max-width":"120px"}},[t._v(t._s(a.name))]),a.id>0?s("el-dropdown",[s("span",{staticClass:"muted m-r-10"},[t._v("···")]),s("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[s("div",[s("popover-input",{attrs:{type:"text",tips:"分类名称"},on:{confirm:function(e){return t.editGroupe(e,a.id)}}},[s("el-dropdown-item",[t._v("命名分组")])],1)],1),s("div",{on:{click:function(e){return t.delGroupe(a.id)}}},[s("el-dropdown-item",[t._v("删除分组")])],1)])],1):t._e()],1)]}}])})],1)]),s("div",{staticClass:"flex row-center p-16"},[s("popover-input",{attrs:{tips:"分类名称",type:"text"},on:{confirm:t.addGroupe}},[s("el-button",{attrs:{size:"small"}},[t._v("添加分组")])],1)],1)],1),s("div",{staticClass:"material__center flex-1 p-16 flex-col"},[s("div",{staticClass:"material-center__btn flex row-between"},[s("div",{staticClass:"flex"},[s("ls-upload",{staticClass:"m-r-10",attrs:{data:{cid:t.currentId},type:t.type,"show-progress":!0},on:{change:function(e){return t.getList(1)}}},[s("el-button",{attrs:{size:"small",type:"primary"}},[t._v("本地上传")])],1),"pages"==t.mode?[s("ls-dialog",{staticClass:"m-r-10 inline",attrs:{content:"确定删除选中的文件?",disabled:!t.selectList.length},on:{confirm:t.batchFileDel}},[s("el-button",{attrs:{slot:"trigger",size:"small",disabled:!t.selectList.length},slot:"trigger"},[t._v("删除")])],1),s("ls-dialog",{staticClass:"m-r-10 inline",attrs:{disabled:!t.selectList.length,title:"移动文件"},on:{confirm:t.batchFileMove}},[s("el-button",{attrs:{slot:"trigger",size:"small",disabled:!t.selectList.length},slot:"trigger"},[t._v("移动")]),s("div",[s("span",{staticClass:"m-r-20"},[t._v("移动文件至")]),s("el-select",{attrs:{placeholder:"请选择"},model:{value:t.moveId,callback:function(e){t.moveId=e},expression:"moveId"}},t._l(t.groupeLists,(function(t){return s("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1)],1)]:t._e()],2),s("el-input",{staticStyle:{width:"280px"},attrs:{size:"small",placeholder:"请输入名字"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.getList(1)}},model:{value:t.name,callback:function(e){t.name=e},expression:"name"}},[s("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:function(e){return t.getList(1)}},slot:"append"})],1)],1),s("div",{staticClass:"material-center__content flex-col flex-1"},[s("ul",{staticClass:"file-list flex flex-wrap m-t-16"},t._l(t.pager.lists,(function(e){return s("li",{key:e.id,staticClass:"file-item-wrap ls-del-wrap",style:{width:t.size+"px"},on:{click:function(i){return t.selectFile(e)}}},[s("file-item",{attrs:{type:t.type,item:e,size:t.size}},[t.selectStatus(e.id)?s("div",{staticClass:"item-selected"},[s("i",{staticClass:"el-icon-check white icon-selected"})]):t._e()]),s("el-tooltip",{attrs:{effect:"dark",content:e.name,placement:"top"}},[s("div",{staticClass:"item-name line-1 xs p-t-10"},[t._v(t._s(e.name))])]),"pages"==t.mode?s("div",{staticClass:"operation-btns",on:{click:function(t){t.stopPropagation()}}},[s("ls-dialog",{staticClass:"m-r-10 inline",attrs:{content:"确定删除该文件?"},on:{confirm:function(i){return t.batchFileDel([e.id])}}},[s("el-button",{attrs:{slot:"trigger",size:"small",type:"text"},slot:"trigger"},[t._v("删除")])],1),s("popover-input",{attrs:{value:e.name,type:"text"},on:{confirm:function(i){return t.fileRename(i,e.id)}}},[s("el-button",{attrs:{size:"small",type:"text"}},[t._v("重命名")])],1),s("a",{staticClass:"m-l-10",attrs:{href:e.uri,target:"_blank"}},[s("el-button",{attrs:{size:"small",type:"text"}},[t._v("查看")])],1)],1):t._e(),t.selectStatus(e.id)||"popup"!=t.mode?t._e():s("i",{staticClass:"el-icon-close ls-icon-del",on:{click:function(i){return i.stopPropagation(),t.batchFileDel([e.id])}}})],1)})),0),t.pager.loading||t.pager.lists.length?t._e():s("div",{staticClass:"flex flex-1 row-center col-center"},[t._v(" 暂无数据~ ")])]),s("div",{staticClass:"material-center__footer flex row-between flex-wrap p-b-16"},["pages"==t.mode?s("div",{staticClass:"btn"},[s("span",{staticClass:"m-r-10"},[s("el-checkbox",{attrs:{disabled:!t.pager.lists.length,indeterminate:t.isIndeterminate},on:{change:t.selectAll},model:{value:t.checkAll,callback:function(e){t.checkAll=e},expression:"checkAll"}},[t._v("当页全选")])],1),s("ls-dialog",{staticClass:"m-r-10 inline",attrs:{content:"确定删除选中的图片?",disabled:!t.selectList.length},on:{confirm:t.batchFileDel}},[s("el-button",{attrs:{slot:"trigger",size:"small",disabled:!t.selectList.length},slot:"trigger"},[t._v("删除")])],1),s("ls-dialog",{staticClass:"m-r-10 inline",attrs:{disabled:!t.selectList.length,title:"移动图片"},on:{confirm:t.batchFileMove}},[s("el-button",{attrs:{slot:"trigger",size:"small",disabled:!t.selectList.length},slot:"trigger"},[t._v("移动")]),s("div",[s("span",{staticClass:"m-r-20"},[t._v("移动图片至")]),s("el-select",{attrs:{placeholder:"请选择"},model:{value:t.moveId,callback:function(e){t.moveId=e},expression:"moveId"}},t._l(t.groupeLists,(function(t){return s("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1)],1)],1):t._e(),s("ls-pagination",{attrs:{layout:"total, prev, pager, next, jumper"},on:{change:function(e){return t.getList()}},model:{value:t.pager,callback:function(e){t.pager=e},expression:"pager"}})],1)]),"popup"==t.mode?s("div",{staticClass:"material__right"},[s("div",{staticClass:"flex row-between"},[s("div",{staticClass:"sm"},[t._v(" 已选择 "+t._s(t.selectList.length)+" "),t.limit?s("span",[t._v("/"+t._s(t.limit))]):t._e()]),s("el-button",{attrs:{type:"text",size:"small"},on:{click:t.clearSelectList}},[t._v("清空")])],1),s("el-scrollbar",{staticClass:"ls-scrollbar",staticStyle:{height:"calc(100% - 32px)"}},[s("ul",{staticClass:"flex-col p-t-10"},t._l(t.selectList,(function(e){return s("li",{key:e.id,staticClass:"m-b-16"},[s("div",{staticClass:"ls-del-wrap"},[s("file-item",{attrs:{type:t.type,item:e}}),s("i",{staticClass:"el-icon-close ls-icon-del",on:{click:function(i){return t.delImage(e.id)}}})],1)])})),0)])],1):t._e()])}),[],!1,null,"1fe45f98",null));e.a=y.exports},d024:function(t,e,i){"use strict";var s=i("c65b"),a=i("59ed"),l=i("825a"),r=i("46c4"),n=i("c5cc"),c=i("9bdd"),o=n((function(){var t=this.iterator,e=l(s(this.next,t));if(!(this.done=!!e.done))return c(t,this.mapper,[e.value,this.counter++],!0)}));t.exports=function(t){return l(this),a(t),new o(r(this),{mapper:t})}},d5ef:function(t,e,i){},e257:function(t,e,i){"use strict";i("d5ef")},e8a1:function(t,e,i){"use strict";i("ef6c")},e915:function(t,e,i){"use strict";var s=i("9ab4"),a=i("1b40");let l=class extends a.e{};Object(s.a)([Object(a.c)({default:()=>{}})],l.prototype,"item",void 0),Object(s.a)([Object(a.c)({default:"100"})],l.prototype,"size",void 0),Object(s.a)([Object(a.c)({default:"image"})],l.prototype,"type",void 0),l=Object(s.a)([Object(a.a)({})],l);var r=l,n=(i("e8a1"),i("2877")),c=Object(n.a)(r,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"file-item",style:{height:t.size+"px",width:t.size+"px"}},["image"==t.type?i("el-image",{staticClass:"image",attrs:{fit:"contain",src:t.item.uri}}):"video"==t.type?i("video",{staticClass:"video",attrs:{src:t.item.uri}}):t._e(),t._t("default")],2)}),[],!1,null,"35f4f9dc",null);e.a=c.exports},ef6c:function(t,e,i){},f0b8:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAgCAMAAABXc8oyAAAAbFBMVEUAAAD/6ZX/4oz/6ZX/6ZX//5n/6ZX/6ZX/6JX/6JP/6JD5xzT4yTb/6Jb6yDP/6Zf5xTP/6pX5xzX/6ZX5xzX/6JX4xjP5yDP5yjr5yDX/55T/6JX6xzP/55f/65n/6ZD/6ZX5xzT/6JH5yDnWZB6zAAAAIHRSTlMA/Qr2+wTmuKhY/vLqr4tbJ+7e29PHuKako6BlMiAZF9FhIv8AAACQSURBVDjL7dNHEsIwEETRlhklZ3KGEdz/joiCBZaxPQfwX7/qXQPtsQzfik19wVDtKvxW1NkA3IekXV9qxMpn2iHrpj/ykZbni25r59+QBSl3/wtVEhE74SLxGSySvAXLWoKFzXCGfahkTskXjcwZWFaSK1h4JiU4lwdclJPuBOBqiSck2RtiuqnMGDNVo4EXR0+KdXBuHAMAAAAASUVORK5CYII="}}]);