Portal/potal_admin/up-portal-admin-1.0.1/js/chunk-3edac6d2.559c68e6.js

1 line
3.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3edac6d2","chunk-2d0b362e","chunk-2d215cc3"],{"27c6":function(t,e,n){"use strict";n.r(e);n("8e6e"),n("ac6a"),n("456d"),n("7f7f");var i=n("ade3"),c=n("d5ae"),a=n("2f62");function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){Object(i["a"])(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e["default"]={data:function(){return{config:{}}},methods:s(s({},Object(a["c"])(["SET_APP_SETTING"])),{},{saveConfig:function(){var t=this;this.appSetting[this.$options.name]=this.config,console.log(this.appSetting),Object(c["save"])(this.appSetting).then((function(e){0===e.data.code&&(t.SET_APP_SETTING(t.appSetting),t.$message.success("配置保存成功"))}))}}),computed:s({},Object(a["d"])(["appSetting"])),created:function(){this.config=this.appSetting[this.$options.name]}}},"2f0a":function(t,e,n){},c077:function(t,e,n){"use strict";n.r(e);var i=n("a78e"),c=n.n(i);e["default"]={data:function(){return{FILE_SERVER_URL:"http://121.48.165.167/portal/file/upload"}},computed:{authorization:function(){return{Authorization:"Bearer "+c.a.get("access_token")||!1}}}}},e2ca:function(t,e,n){"use strict";n("2f0a")},f47e:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"carousel"},[n("div",{staticStyle:{width:"100%"}},[n("span",[t._v("\n Tips: 轮播组件中的图片顺序与列表中图片顺序相同,建议上传图片比例为 5 :\n 2图片上传数量上限为 10 张\n ")]),n("div",{staticClass:"upload"},[n("el-upload",{attrs:{"list-type":"picture-card",limit:10,"file-list":Array.from(t.config),action:t.FILE_SERVER_URL,headers:t.authorization,"auto-upload":!0,"on-success":t.handleSuccess,"on-exceed":t.handleExceed},scopedSlots:t._u([{key:"file",fn:function(e){var i=e.file;return n("div",{},[n("el-image",{attrs:{id:i.name,fit:"contain",src:i.url,"preview-src-list":[i.url]}}),n("div",{staticClass:"el-upload-list__item-actions"},[n("span",{on:{click:function(e){return t.handlePreview(i)}}},[n("i",{staticClass:"el-icon-zoom-in"})]),n("span",{on:{click:function(e){return t.handleRemove(i)}}},[n("i",{staticClass:"el-icon-delete"})])])],1)}}])},[n("i",{staticClass:"el-icon-plus",attrs:{slot:"default"},slot:"default"})])],1),n("el-button",{attrs:{type:"primary"},on:{click:t.saveConfig}},[t._v("保存配置")])],1)])},c=[],a=(n("7f7f"),n("27c6")),o=n("c077"),s={name:"Carousel",mixins:[a["default"],o["default"]],methods:{handleSuccess:function(t){console.log(t),0===t.code?(this.config.push({id:t.data.id,name:t.data.name,url:t.data.url}),console.log(this.config)):this.$message.error("图片上传失败")},handleExceed:function(){this.$message.warning("图片上传数量已达上限")},handlePreview:function(t){document.getElementById(t.name).click()},handleRemove:function(t){this.config=this.config.filter((function(e){return e!==t}))}}},r=s,u=(n("e2ca"),n("2877")),l=Object(u["a"])(r,i,c,!1,null,"08d88aec",null);e["default"]=l.exports}}]);