1.chunk.js
12.7 KB
webpackJsonp([1],{47:function(t,e,n){"use strict";function r(t){s||n(75)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(56),a=n(80),s=!1,o=n(14),c=r,u=o(i.a,a.a,!1,c,null,null);u.options.__file="src/views/similar/fast.vue",e.default=u.exports},48:function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=n(4),a=(n.n(i),function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}()),s=i.create({baseURL:"/api/"});s.interceptors.response.use(function(t){return 200!==t.data.code?Promise.reject(new Error("服务器出错")):t},function(t){return Promise.reject(t)});var o=function(){function t(){r(this,t),this.request=s}return a(t,[{key:"list",value:function(t){return this.request.post("/label/list",t).then(function(t){return t.data.data})}},{key:"confirm",value:function(t){return this.request.post("/label/confirm",t).then(function(t){return t.data.data})}},{key:"cancel",value:function(t){return this.request.post("/label/cancel",t).then(function(t){return t.data.data})}},{key:"confirmAll",value:function(t){return this.request.post("/label/all",t).then(function(t){return t.data.data})}},{key:"getSortList",value:function(){return this.request.post("/label/sortlist",{}).then(function(t){return t.data.data})}}]),t}();e.a=o},56:function(t,e,n){"use strict";var r=n(48);e.a={name:"Fast",created:function(){this.api=new r.a,this.start()},mounted:function(){document.addEventListener("keydown",this.keydown)},destroyed:function(){document.removeEventListener("keydown",this.keydown)},computed:{current:function(){if(this.pageDatas.length>=this.currentIndex)return this.pageDatas[this.currentIndex]},total:function(){return this.startOp.end-this.startOp.start+1},progress:function(){return parseInt((this.currentPage+1)/(this.startOp.end-this.startOp.start+1)*1e4,10)/100}},data:function(){return{startModel:!0,startOp:{start:0,end:0},currentPage:0,currentIndex:0,markIndex:0,pageDatas:[],postingText:"等待编辑"}},watch:{markIndex:function(t){var e=this.$el.querySelector(".img-item:nth-child("+(t+1)+")");if(e){var n=e.getBoundingClientRect(),r=n.top,i=r-200;this.$el.querySelector(".images").scrollTo(0,this.$el.querySelector(".images").scrollTop+i)}}},methods:{keydown:function(t){"ArrowUp"===t.code?t.shiftKey?this.allSelected():this.selected():"ArrowDown"===t.code?t.shiftKey?this.allUnSelected():this.cancel():"ArrowLeft"===t.code?t.shiftKey?this.prevPage():this.prevItem():"ArrowRight"===t.code&&(t.shiftKey?this.nextPage():this.nextItem())},start:function(){var t=this;this.startOp.start=parseInt(this.startOp.start,0),this.startOp.end=parseInt(this.startOp.end,0),this.startOp.start>0&&this.startOp.end>0&&this.startOp.end>this.startOp.start&&(this.startModel=!1,this.loadNextPage(this.currentPage).then(function(e){t.pageDatas=e}))},loadNextPage:function(t){var e=this;return this.api.list({rows:0,size:10,page:this.startOp.start+t}).then(function(t){return e.loadImages(t.boList),t.boList})},splitUrl:function(t){return t=t.replace("{mode}",0),t=t.replace("{width}",300),t=t.replace("{height}",300)},prevPage:function(){this.post(this.current),this.$el.querySelector(".images").scrollTo(0,0),this.currentIndex>0&&(this.currentIndex%10==0&&this.currentPage--,this.currentIndex--,this.markIndex=0)},nextPage:function(){var t=this;return this.post(this.current),this.$el.querySelector(".images").scrollTo(0,0),this.currentIndex>=10*this.total-1?void this.$Message.success("任务完成"):this.currentIndex<10*this.total-1&&(this.currentIndex++,this.markIndex=0,this.pageDatas.length-(this.currentIndex+1)<=5)?this.loadNextPage(this.currentPage+1).then(function(e){t.pageDatas=t.pageDatas.concat(e)}):void(this.currentIndex>0&&this.currentIndex%10==0&&this.currentPage<this.total&&this.currentPage++)},loadImages:function(t){var e=this;t.forEach(function(t){if(t.product.url){var n=t.product.url.replace("/w/78/h/78","/w/300/h300");(new Image).src=n}t.imageList.forEach(function(t){var n=e.splitUrl(t.url);(new Image).src=n})})},prevItem:function(){this.current&&(this.markIndex>0?this.markIndex--:this.prevPage())},nextItem:function(){this.current&&(this.markIndex<this.current.imageList.length-1?this.markIndex++:this.nextPage())},selected:function(t){this.current.imageList[t||this.markIndex].isMark=!0,this.current.imageList[t||this.markIndex]._change=!0,this.postingText="编辑中。。。",this.nextItem()},cancel:function(t){this.current.imageList[t||this.markIndex].isMark=!1,this.current.imageList[t||this.markIndex]._change=!0,this.postingText="编辑中。。。",this.nextItem()},clickImage:function(t){var e=this.current.imageList[t];e.isMark=!e.isMark,e._change=!0},allSelected:function(){this.current.imageList.forEach(function(t){t.isMark=!0,t._change=!0})},allUnSelected:function(){this.current.imageList.forEach(function(t){t.isMark=!1,t._change=!0})},post:function(t){var e=this,n={imageId:[],isMark:1,productId:t.product.productId},r={imageId:[],isMark:0,productId:t.product.productId};t.imageList.filter(function(t){return t._change}).forEach(function(t){t.isMark?n.imageId.push(t.imageId):r.imageId.push(t.imageId)});var i=[];n.imageId.length&&i.push(this.api.confirm(n)),r.imageId.length&&i.push(this.api.cancel(r)),i.length&&(this.postingText="正在提交。。。。",Promise.all(i).then(function(){e.postingText="提交OK"}))}}}},75:function(t,e,n){var r=n(76);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);n(78)("467afa1c",r,!1,{})},76:function(t,e,n){e=t.exports=n(77)(!1),e.push([t.i,"\n.fast-page {\n padding: 20px;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n.fast-page-box {\n height: 100%;\n display: flex;\n overflow: hidden;\n}\n.fast-page-box .example {\n width: 300px;\n height: 300px;\n margin-top: 5px;\n margin-right: 10px;\n}\n.fast-page-box .example img {\n width: 300px;\n height: 300px;\n}\n.fast-page-box .example .posting {\n margin-top: 20px;\n color: green;\n}\n.fast-page-box .images {\n flex: 1;\n height: 100%;\n overflow-y: auto;\n}\n.fast-page-box .images ul {\n list-style-type: none;\n}\n.fast-page-box .images .img-item {\n width: 212px;\n height: 220px;\n margin: 5px;\n float: left;\n border: solid 4px #fff;\n}\n.fast-page-box .images .img-item.marking {\n border: solid 4px #000;\n}\n.fast-page-box .images .img-item img {\n border-bottom: solid 8px red;\n}\n.fast-page-box .images .img-item.marked img {\n border-bottom: solid 8px limegreen;\n}\n.fast-page-box .images .img-item .img-box {\n border: solid 2px #fff;\n overflow: hidden;\n width: 204px;\n height: 212px;\n}\n.fast-page-box .images .img-item img {\n width: 200px;\n height: 208px;\n}\n",""])},77:function(t,e){function n(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){var a=r(i);return[n].concat(i.sources.map(function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"})).concat([a]).join("\n")}return[n].join("\n")}function r(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var r=n(e,t);return e[2]?"@media "+e[2]+"{"+r+"}":r}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},i=0;i<this.length;i++){var a=this[i][0];"number"==typeof a&&(r[a]=!0)}for(i=0;i<t.length;i++){var s=t[i];"number"==typeof s[0]&&r[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),e.push(s))}},e}},78:function(t,e,n){function r(t){for(var e=0;e<t.length;e++){var n=t[e],r=l[n.id];if(r){r.refs++;for(var i=0;i<r.parts.length;i++)r.parts[i](n.parts[i]);for(;i<n.parts.length;i++)r.parts.push(a(n.parts[i]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{for(var s=[],i=0;i<n.parts.length;i++)s.push(a(n.parts[i]));l[n.id]={id:n.id,refs:1,parts:s}}}}function i(){var t=document.createElement("style");return t.type="text/css",p.appendChild(t),t}function a(t){var e,n,r=document.querySelector("style["+v+'~="'+t.id+'"]');if(r){if(f)return g;r.parentNode.removeChild(r)}if(x){var a=h++;r=d||(d=i()),e=s.bind(null,r,a,!1),n=s.bind(null,r,a,!0)}else r=i(),e=o.bind(null,r),n=function(){r.parentNode.removeChild(r)};return e(t),function(r){if(r){if(r.css===t.css&&r.media===t.media&&r.sourceMap===t.sourceMap)return;e(t=r)}else n()}}function s(t,e,n,r){var i=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=b(e,i);else{var a=document.createTextNode(i),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(a,s[e]):t.appendChild(a)}}function o(t,e){var n=e.css,r=e.media,i=e.sourceMap;if(r&&t.setAttribute("media",r),m.ssrId&&t.setAttribute(v,e.id),i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}var c="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!c)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var u=n(79),l={},p=c&&(document.head||document.getElementsByTagName("head")[0]),d=null,h=0,f=!1,g=function(){},m=null,v="data-vue-ssr-id",x="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());t.exports=function(t,e,n,i){f=n,m=i||{};var a=u(t,e);return r(a),function(e){for(var n=[],i=0;i<a.length;i++){var s=a[i],o=l[s.id];o.refs--,n.push(o)}e?(a=u(t,e),r(a)):a=[];for(var i=0;i<n.length;i++){var o=n[i];if(0===o.refs){for(var c=0;c<o.parts.length;c++)o.parts[c]();delete l[o.id]}}}};var b=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}()},79:function(t,e){t.exports=function(t,e){for(var n=[],r={},i=0;i<e.length;i++){var a=e[i],s=a[0],o=a[1],c=a[2],u=a[3],l={id:t+":"+i,css:o,media:c,sourceMap:u};r[s]?r[s].parts.push(l):n.push(r[s]={id:s,parts:[l]})}return n}},80:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"fast-page"},[t.current?n("div",{staticClass:"fast-page-box"},[n("div",{staticClass:"example"},[n("img",{attrs:{src:t.current.product.url&&t.current.product.url.replace("/w/78/h/78","/w/300/h300"),alt:""}}),t._v(" "),n("div",{staticClass:"info"},[t._v("\n 从"+t._s(t.startOp.start)+"到"+t._s(t.startOp.end)+",共"+t._s(t.total)+"的第"+t._s(t.currentPage+1)+"页\n "),n("Progress",{attrs:{percent:t.progress}})],1),t._v(" "),t._m(0),t._v(" "),n("div",{staticClass:"posting"},[t._v("\n 提交状态:"+t._s(t.postingText)+"\n ")])]),t._v(" "),n("div",{staticClass:"images"},[n("ul",t._l(t.current.imageList,function(e,r){return n("li",{key:e.id,staticClass:"img-item",class:{marking:r===t.markIndex,marked:e.isMark}},[n("div",{staticClass:"img-box",on:{click:function(e){t.clickImage(r)}}},[n("img",{attrs:{src:t.splitUrl(e.url),alt:""}})])])}))])]):t._e(),t._v(" "),n("Modal",{attrs:{title:"开始任务",width:400},model:{value:t.startModel,callback:function(e){t.startModel=e},expression:"startModel"}},[n("Form",{ref:"formDatabase",attrs:{"label-position":"right","label-width":90}},[n("FormItem",{attrs:{label:"开始页码",prop:"db_user"}},[n("Input",{attrs:{type:"text",placeholder:"用户名"},model:{value:t.startOp.start,callback:function(e){t.$set(t.startOp,"start",e)},expression:"startOp.start"}})],1),t._v(" "),n("FormItem",{attrs:{label:"结束页码",prop:"db_password"}},[n("Input",{attrs:{type:"text",placeholder:"密码"},model:{value:t.startOp.end,callback:function(e){t.$set(t.startOp,"end",e)},expression:"startOp.end"}})],1)],1),t._v(" "),n("div",{attrs:{slot:"footer"},slot:"footer"},[n("Button",{attrs:{type:"text",size:"large"},nativeOn:{click:function(e){return t.cancel(e)}}},[t._v("取消")]),t._v(" "),n("Button",{attrs:{type:"primary",size:"large"},nativeOn:{click:function(e){return t.start(e)}}},[t._v("开始")])],1)],1)],1)},i=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"help"},[n("p",[t._v("说明:")]),t._v(" "),n("p",{staticStyle:{color:"red"}},[t._v("Up/Down:勾选/取消(同时右移一个)")]),t._v(" "),n("p",[t._v("Left:左移;Right:右移")]),t._v(" "),n("p",[t._v("Shift + Left:向左一个")]),t._v(" "),n("p",[t._v("Shift + Right:向右一个")]),t._v(" "),n("p",[t._v("Shift + Up:全部勾选")]),t._v(" "),n("p",[t._v("Shift + Down:全部取消勾选")])])}];r._withStripped=!0;var a={render:r,staticRenderFns:i};e.a=a}});