mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-15 04:52:50 +00:00
1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-f49d7e6a"],{2398:function(t,e){t.exports="data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAIzSURBVGiB7dkvbBRBFIDxihMVJ05UVCARFYgKBKKiEoFoQgWyElFRgUA2gQQBogmWpAgcJBgc8kgqEBUVFRUVFScqECcqTvwQu5te2D8zd927WZJ+enffN7Mzb9+bXVm5556ZwfPUDnOBAb7KeJLaZyawjSu3fEztFAV6eKPMNVZT+zWCNfyskIcJNlI71oJNXNbIw8vUjrVgDzcN8gepHWvBYYN4d+Vlm/U4IH+Y2rMS9NVv1oJPqT0ryeWHAfkf6KV2LYF1nAXkf6Of2rVELn8ekB9hPbVriUj5GzxO7VoiX/OnAXnYS+1aQtyGhQ+pXUvI8vz3CPmhjmac4wj5azxI7VoCryPk4WmbQR+18SrxTFb6hjhqw7sIuoWxbM3O/RHJJ2EcIX/axmQVQTf+CTrEYI7nDDTX8wUTbLYpP6oIcm7GL6K4jAOvFi1fcCWyhcN+pPyJFpfOjvBmG2Er8JxNzd1UwRgPW5GfCh4zc2M16Q6rwjVOwX6r8lMSMTl7gt2Ke99Hyp8sRH5K5ChS5GDqnu3Ie5ZzHILPkULvZEXaZeT1hwuXzwfQw7dIqYvI684t8zQtH8SvSLkYGjPYogbRl+Xru5LuVEFcC9jEH6wlG8DUIK4ConUsJufPinC5UcWZLnVYslIhpkQuWP7GDeG2XwjxJbVrLdjVXPzd6GJ/Ow1eNAzgbWq/KHBQIT8yRxeXDOWfEt39/VOH2wr2QpfS5izIir+d1B5z89/O/D134C+N9zTDbeyE4AAAAABJRU5ErkJggg=="},3594:function(t,e,n){"use strict";var r=n("c648");n.n(r).a},c648:function(t,e,n){},e90e:function(t,e,n){"use strict";n.r(e);var r=[function(){var t=this.$createElement;t=this._self._c||t;return t("div",{staticClass:"success"},[t("img",{staticClass:"image",attrs:{src:n("2398"),alt:""}})])}],i=(n("a4d3"),n("e01a"),n("d28b"),n("3ca3"),n("ddb0"),n("b636"),n("944a"),n("0c47"),n("23dc"),n("3410"),n("d9e2"),n("159b"),n("b0c0"),n("131a"),n("fb6a"),n("0122")),o=n("c964"),a=(n("c740"),n("a434"),n("d81d"),n("d3b7"),n("d708")),c=n("90e7"),s=n("a006");function l(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */l=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(e){u=function(t,e,n){return t[e]=n}}function f(t,e,n,i){var o,a,c,s;e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype),i=new A(i||[]);return r(e,"_invoke",{value:(o=t,a=n,c=i,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return E()}for(c.method=t,c.arg=e;;){var n=c.delegate;if(n&&(n=function t(e,n){var r=n.method,i=e.iterator[r];return void 0===i?(n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d):(r=h(i,e.iterator,n.arg),"throw"===r.type?(n.method="throw",n.arg=r.arg,n.delegate=null,d):(i=r.arg,i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,d):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)))}(n,c),n)){if(n===d)continue;return n}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if("suspendedStart"===s)throw s="completed",c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);if(s="executing",n=h(o,a,c),"normal"===n.type){if(s=c.done?"completed":"suspendedYield",n.arg===d)continue;return{value:n.arg,done:c.done}}"throw"===n.type&&(s="completed",c.method="throw",c.arg=n.arg)}})}),e}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var d={};function p(){}function g(){}function m(){}o={};var v=(u(o,a,(function(){return this})),Object.getPrototypeOf),y=(v=v&&v(v(k([]))),v&&v!==e&&n.call(v,a)&&(o=v),m.prototype=p.prototype=Object.create(o));function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var o;r(this,"_invoke",{value:function(r,a){function c(){return new e((function(o,c){!function r(o,a,c,s){var l;o=h(t[o],t,a);if("throw"!==o.type)return(a=(l=o.arg).value)&&"object"==Object(i.a)(a)&&n.call(a,"__await")?e.resolve(a.__await).then((function(t){r("next",t,c,s)}),(function(t){r("throw",t,c,s)})):e.resolve(a).then((function(t){l.value=t,c(l)}),(function(t){return r("throw",t,c,s)}));s(o.arg)}(r,a,o,c)}))}return o=o?o.then(c,c):c()}})}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function k(t){if(t){var e,r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return e=-1,(r=function r(){for(;++e<t.length;)if(n.call(t,e))return r.value=t[e],r.done=!1,r;return r.value=void 0,r.done=!0,r}).next=r}return{next:E}}function E(){return{value:void 0,done:!0}}return r(y,"constructor",{value:g.prototype=m,configurable:!0}),r(m,"constructor",{value:g,configurable:!0}),g.displayName=u(m,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){return t="function"==typeof t&&t.constructor,!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,s,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},w(b.prototype),u(b.prototype,c,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new b(f(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(y),u(y,s,"Generator"),u(y,a,(function(){return this})),u(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},t.values=k,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;0<=i;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(c&&s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}var a=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,x(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},t}var u={name:"app_upload_file",data:function(){return{fileUrl:a.a.apiBaseURL+"/image/scan_upload",imgList:[],allSize:0,token:"",uploading:!0,limit:20,loading:!1,pid:0}},created:function(){this.token=this.$route.query.token,this.pid=this.$route.query.pid,document.title="手机端扫码上传"},methods:{selectImgs:function(){this.loading||this.$refs.upload.$refs["upload-inner"].handleClick()},again:function(){this.uploading=!0,this.imgList=[],this.allSize=0},submitUpload:function(){var t=this;return Object(o.a)(l().mark((function e(){var n,r;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.imgList.length){if(t.loading)return e.abrupt("return");e.next=3}else e.next=15;break;case 3:t.loading=!0,n=0;case 5:if(n<t.imgList.length)return r=t.imgList[n].raw,e.next=9,t.uploadItem(r);e.next=13;break;case 9:n==t.imgList.length-1&&(t.uploading=!1,t.loading=!1);case 10:n++,e.next=5;break;case 13:e.next=16;break;case 15:t.$message.warning("请先选择图片");case 16:case"end":return e.stop()}}),e)})))()},handleRemove:function(t){var e=this,n=this.imgList.findIndex((function(e){return e.url==t.url}));this.imgList.splice(n,1),this.$nextTick((function(t){var n=0;e.imgList.length?(e.imgList.map((function(t){n+=t.raw.size})),e.allSize=n):e.allSize=0}))},uploadItem:function(t){var e=this;return new Promise((function(n,r){var i=new FormData;i.append("file",t),i.append("uploadToken",e.token),i.append("pid",e.pid),Object(c.fb)(i).then((function(t){200==t.status?n():(e.loading=!1,e.$message({message:"上传失败",type:"error",duration:1e3}))})).catch((function(t){e.loading=!1,e.$message.error(t.msg)}))}))},fileError:function(t,e,n){},beforeUpload:function(t){},fileChange:function(t,e){var n=this;return Object(o.a)(l().mark((function r(){var i;return l().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(2097152<=t.size)return r.next=3,n.comImg(t.raw).then((function(r){e.map((function(e){e.uid===t.uid&&(n.allSize+=r.size,e.raw=r)})),n.imgList=e}));r.next=5;break;case 3:r.next=8;break;case 5:n.imgList=e,i=0,n.imgList.length?(n.imgList.map((function(t){i+=t.raw.size})),n.allSize=i):n.allSize=0;case 8:case"end":return r.stop()}}),r)})))()},comImg:function(t){return new Promise((function(e,n){Object(s.a)(t).then((function(t){e(t)}))}))},loadData:function(t,e){getCategoryListApi({pid:t.value}).then(function(){var t=Object(o.a)(l().mark((function t(n){var r;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.data.list,e(r);case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){}))}}},f=(n("3594"),n("2877"));f=Object(f.a)(u,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"main"},[t.uploading?n("div",[n("div",{staticClass:"img-list",class:{"none-card":t.imgList.length}},[n("el-upload",{ref:"upload",attrs:{action:t.fileUrl,"list-type":"picture-card","on-change":t.fileChange,"on-error":t.fileError,"before-upload":t.beforeUpload,"file-list":t.imgList,"auto-upload":!1,multiple:!0,limit:t.limit,accept:"image/*"},scopedSlots:t._u([{key:"file",fn:function(e){var r=e.file;return n("div",{},[n("img",{staticClass:"el-upload-list__item-thumbnail",attrs:{src:r.url,alt:""}}),n("i",{staticClass:"el-icon-error btndel",on:{click:function(e){return t.handleRemove(r)}}})])}}],null,!1,1045589351)},[t.imgList.length?t._e():n("div",{staticClass:"upload-card",attrs:{slot:"default"},slot:"default"},[n("i",{staticClass:"el-icon-plus"}),n("p",{staticClass:"text"},[t._v("点击选择图片")])])])],1),n("div",{staticClass:"footer"},[t.imgList.length?n("div",[t._v("共"+t._s(t.imgList.length)+"/"+t._s(t.limit)+"张,"+t._s((t.allSize/1e6).toFixed(2))+" M")]):n("div"),n("div",{staticClass:"upload-btn"},[t.imgList.length<t.limit?n("div",{staticClass:"btn",on:{click:t.selectImgs}},[t._v("\n "+t._s(t.imgList.length?"继续选择":"选择图片")+"\n ")]):t._e(),n("div",{staticClass:"btn upload",class:{"no-pic":!t.imgList.length},on:{click:t.submitUpload}},[t._v("确认上传")])])])]):n("div",{staticClass:"upload-success"},[t._m(0),n("div",{staticClass:"text"},[t._v("图片上传成功")]),n("div",{staticClass:"again",on:{click:t.again}},[t._v("继续上传")])])])}),r,!1,null,"af5fed6c",null);e.default=f.exports}}]); |