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
8.0 KiB
1 lines
8.0 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4484abae","chunk-2d213e1a"],{af21:function(e,t,a){"use strict";a.r(t);var l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{title:e.isUpdate?"修改图片":"添加图片",visible:e.visible,width:"600px","destroy-on-close":!0,"lock-scroll":!1,"custom-class":"ele-dialog-form"},on:{"update:visible":e.updateVisible}},[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"82px"}},[a("el-row",{attrs:{gutter:15}},[a("el-col",[a("el-form-item",{attrs:{label:"标题:",prop:"title"}},[a("el-input",{attrs:{placeholder:"请输入标题",clearable:""},model:{value:e.form.title,callback:function(t){e.$set(e.form,"title",t)},expression:"form.title"}})],1),a("el-form-item",{attrs:{label:"分类:"}},[a("el-select",{staticClass:"ele-fluid",attrs:{placeholder:"请选择图片分类"},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},e._l(e.tagLists,(function(t){return a("el-option",{key:t.title,attrs:{label:t.name,value:t.title}},[a("span",{staticStyle:{"padding-left":"8px"}},[e._v(e._s(t.name))])])})),1)],1),a("el-form-item",{attrs:{label:"上传图片"}},[a("el-row",[a("el-col",[a("el-input",{attrs:{placeholder:"请上传图片",clearable:""},model:{value:e.form.url,callback:function(t){e.$set(e.form,"url",t)},expression:"form.url"}}),a("el-upload",{staticClass:"upload-demo",attrs:{"show-file-list":!1,action:this.uploadImage+"?upload_type=img","on-success":e.afterUploadImage}},[e.form.url?a("img",{staticClass:"avatar",attrs:{src:e.form.url,width:"150",height:"150"}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1)],1)],1),a("el-form-item",{attrs:{label:"描述:"}},[a("el-input",{attrs:{placeholder:"请输入描述",clearable:""},model:{value:e.form.description,callback:function(t){e.$set(e.form,"description",t)},expression:"form.description"}})],1)],1)],1)],1),a("div",{attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){return e.updateVisible(!1)}}},[e._v("取消 ")]),a("el-button",{attrs:{type:"primary",loading:e.loading},on:{click:e.save}},[e._v("保存 ")])],1)],1)},s=[],o=a("d2b8"),i={name:"ImagesEdit",props:{visible:Boolean,data:Object},data:function(){return{form:Object.assign({},this.data),rules:{title:[{required:!0,message:"请输入标题",trigger:"blur"}]},loading:!1,isUpdate:!1,tagLists:[],uploadImage:o["a"].uploadImageUrl}},watch:{data:function(){this.data?(this.form=Object.assign({},this.data),this.isUpdate=!0):(this.form={},this.isUpdate=!1)}},mounted:function(){this.getTagLists()},methods:{afterUploadImage:function(e){0!=e.code||""==e.url?this.$message.error(e.msg):this.$set(this.form,"url",e.url)},save:function(){var e=this;this.$refs["form"].validate((function(t){if(!t)return!1;e.loading=!0,e.$http.post("/ImageStorage/"+(e.isUpdate?"edit":"add"),e.form).then((function(t){e.loading=!1,0===t.data.code?(e.$message({type:"success",message:t.data.msg}),e.isUpdate||(e.form={}),e.updateVisible(!1),e.$emit("done")):e.$message.error(t.data.msg)})).catch((function(t){e.loading=!1,e.$message.error(t.message)}))}))},updateVisible:function(e){this.$emit("update:visible",e)},getTagLists:function(){var e=this;this.$http.get("/uploadLog/getTagLists").then((function(t){0===t.data.code&&(e.tagLists=t.data.data)}))}}},r=i,n=a("2877"),c=Object(n["a"])(r,l,s,!1,null,"222b6b12",null);t["default"]=c.exports},ef69:function(e,t,a){"use strict";a.r(t);var l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"ele-body"},[a("el-card",{attrs:{shadow:"never"}},[a("el-form",{staticClass:"ele-form-search",attrs:{model:e.where,"label-width":"77px"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.reload(t)},submit:function(e){e.preventDefault()}}},[a("el-row",{attrs:{gutter:15}},[a("el-col",{attrs:{md:5,sm:12}},[a("el-form-item",{attrs:{label:"标题:"}},[a("el-input",{attrs:{placeholder:"请输入标题",clearable:""},model:{value:e.where.title,callback:function(t){e.$set(e.where,"title",t)},expression:"where.title"}})],1)],1),a("el-col",{attrs:{md:4,sm:12}},[a("el-form-item",{attrs:{label:"分类:"}},[a("el-select",{staticClass:"ele-fluid",attrs:{placeholder:"请选择",clearable:""},model:{value:e.where.type,callback:function(t){e.$set(e.where,"type",t)},expression:"where.type"}},e._l(e.tagLists,(function(e){return a("el-option",{key:e.title,attrs:{label:e.name,value:e.title}})})),1)],1)],1),a("el-col",{attrs:{md:6,sm:12}},[a("div",{staticClass:"ele-form-actions"},[a("el-button",{staticClass:"ele-btn-icon",attrs:{type:"primary",icon:"el-icon-search"},on:{click:e.reload}},[e._v("查询 ")]),a("el-button",{on:{click:e.reset}},[e._v("重置")])],1)])],1)],1),a("ele-pro-table",{ref:"table",attrs:{datasource:e.url,columns:e.columns,where:e.where,selection:e.selection},on:{"update:selection":function(t){e.selection=t}},scopedSlots:e._u([{key:"image",fn:function(e){var t=e.row;return[a("div",{staticClass:"ele-cell"},[a("a",{attrs:{href:t.url,target:"_blank"}},[a("el-avatar",{attrs:{shape:"square",size:100,src:t.url}})],1)])]}},{key:"action",fn:function(t){var l=t.row;return[a("el-link",{attrs:{icon:"el-icon-edit",type:"primary",underline:!1},on:{click:function(t){return e.openEdit(l)}}},[e._v("修改 ")]),a("el-popconfirm",{staticClass:"ele-action",attrs:{title:"确定要删除图片吗?"},on:{confirm:function(t){return e.remove(l)}}},[a("el-link",{attrs:{slot:"reference",icon:"el-icon-delete",type:"danger",underline:!1},slot:"reference"},[e._v("删除 ")])],1)]}}])},[a("template",{slot:"toolbar"},[a("el-button",{staticClass:"ele-btn-icon",attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:function(t){return e.openEdit(null)}}},[e._v("添加 ")]),a("el-button",{staticClass:"ele-btn-icon",attrs:{type:"danger",icon:"el-icon-delete",size:"small"},on:{click:e.removeBatch}},[e._v("删除 ")])],1)],2)],1),a("images-edit",{attrs:{visible:e.showEdit,data:e.current},on:{"update:visible":function(t){e.showEdit=t},done:e.reload}})],1)},s=[],o=(a("d81d"),a("af21")),i={name:"ImagesStorage",components:{ImagesEdit:o["default"]},data:function(){return{url:"/ImageStorage/index",columns:[{columnKey:"selection",type:"selection",width:45,align:"center",fixed:"left"},{columnKey:"id",type:"index",width:45,align:"center",fixed:"left",showOverflowTooltip:!0},{prop:"title",label:"标题",sortable:!1,showOverflowTooltip:!0,minWidth:80},{prop:"url",label:"图片",sortable:!1,showOverflowTooltip:!0,minWidth:100,slot:"image"},{prop:"type_str",label:"分类",sortable:!1,showOverflowTooltip:!0,minWidth:60},{columnKey:"action",label:"操作",width:220,align:"center",resizable:!1,slot:"action"}],where:{},selection:[],current:null,showEdit:!1,showImport:!1,tagLists:[]}},mounted:function(){this.getTagLists()},methods:{getTagLists:function(){var e=this;this.$http.get("/uploadLog/getTagLists").then((function(t){0===t.data.code&&(e.tagLists=t.data.data)}))},reload:function(){this.$refs.table.reload({page:1})},reset:function(){var e=this;this.where={},this.$nextTick((function(){e.reload()}))},openEdit:function(e){this.current=e,this.showEdit=!0},remove:function(e){var t=this,a=this.$loading({lock:!0}),l=new FormData;l.append("id",e.id),this.$http.post("/ImageStorage/delete/",l).then((function(e){a.close(),0===e.data.code?(t.$message({type:"success",message:e.data.msg}),t.reload()):t.$message.error(e.data.msg)})).catch((function(e){a.close(),t.$message.error(e.message)}))},removeBatch:function(){var e=this;this.selection.length?this.$confirm("确定要删除选中的图片吗?","提示",{type:"warning"}).then((function(){var t=e.$loading({lock:!0}),a=new FormData;a.append("id",e.selection.map((function(e){return e.id}))),e.$http.post("/ImageStorage/delete/",a).then((function(a){t.close(),0===a.data.code?(e.$message({type:"success",message:a.data.msg}),e.reload()):e.$message.error(a.data.msg)})).catch((function(a){t.close(),e.$message.error(a.message)}))})).catch((function(){})):this.$message.error("请至少选择一条数据")}}},r=i,n=a("2877"),c=Object(n["a"])(r,l,s,!1,null,"0617324b",null);t["default"]=c.exports}}]);
|