search-legacy.9ecb3216.js 14 KB

1
  1. !function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){return r};var r={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(I){l=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),c=new P(n||[]);return i(a,"_invoke",{value:O(t,r,c)}),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(I){return{type:"throw",arg:I}}}r.wrap=p;var h={};function f(){}function v(){}function m(){}var g={};l(g,c,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(k([])));b&&b!==n&&o.call(b,c)&&(g=b);var x=m.prototype=f.prototype=Object.create(g);function w(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(e,r){function n(i,a,c,u){var s=d(e[i],e,a);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==t(p)&&o.call(p,"__await")?r.resolve(p.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):r.resolve(p).then((function(t){l.value=t,c(l)}),(function(t){return n("throw",t,c,u)}))}u(s.arg)}var a;i(this,"_invoke",{value:function(t,e){function o(){return new r((function(r,o){n(t,e,r,o)}))}return a=a?a.then(o,o):o()}})}function O(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=j(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=d(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function j(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,j(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=d(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}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 E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function k(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:S}}function S(){return{value:void 0,done:!0}}return v.prototype=m,i(x,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:v,configurable:!0}),v.displayName=l(m,s,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,l(t,s,"GeneratorFunction")),t.prototype=Object.create(x),t},r.awrap=function(t){return{__await:t}},w(_.prototype),l(_.prototype,u,(function(){return this})),r.AsyncIterator=_,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new _(p(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(x),l(x,s,"Generator"),l(x,c,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=k,P.prototype={constructor:P,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(E),!t)for(var e in this)"t"===e.charAt(0)&&o.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(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):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),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:k(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},r}function r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function n(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(e,r,n){return(r=function(e){var r=function(e,r){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"===t(r)?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function i(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(s){return void r(s)}c.done?e(u):Promise.resolve(u).then(n,o)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))}}System.register(["./index-legacy.88892f9c.js"],(function(t,r){"use strict";var o,i,c=document.createElement("style");return c.textContent=".upload-oem-search[data-v-0c101811]{position:relative;width:1040px;padding:60px 40px 40px 85px;background:var(--color-white);box-shadow:0 0 20px rgba(0,0,0,.16);border-radius:34px;margin:150px auto 85px}.upload-oem-search .back[data-v-0c101811]{position:absolute;top:40px;left:40px;cursor:pointer}.upload-oem-search .back img[data-v-0c101811]{width:46px;height:46px;box-shadow:0 0 6px rgba(0,0,0,.16);border-radius:50%}.upload-oem-search .center[data-v-0c101811]{text-align:center}.upload-oem-search .center b[data-v-0c101811]{color:#474645;font-size:24px;line-height:35px}.upload-oem-search .center-groups[data-v-0c101811]{margin-top:62px}.center-groups .groups-item[data-v-0c101811]{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:40px}.center-groups .groups-item[data-v-0c101811]:last-child{margin-bottom:0}.upload-oem-search .button[data-v-0c101811]{text-align:right}.upload-oem-search .button .el-button[data-v-0c101811]{width:68px;height:40px;border-radius:20px}.level1-list[data-v-0c101811],.level2-list[data-v-0c101811]{display:flex;flex-wrap:wrap}.level1-list[data-v-0c101811]{flex-direction:column}.level1-item[data-v-0c101811]{display:flex;align-items:flex-start}.level1-item .right-left[data-v-0c101811]{color:var(--color-gray);font-size:14px;line-height:14px;font-weight:700;width:120px;margin-right:45px}.level1-item .right-right[data-v-0c101811]{width:520px}.level2-list .level2-item[data-v-0c101811]{color:var(--color-black);width:80px;font-weight:400;margin:0 30px 8px 0;text-align:left;cursor:pointer}.level2-list .level2-item.selected[data-v-0c101811]{color:var(--color-blue)}.level2-list .level2-item[data-v-0c101811]:nth-child(5){margin-right:0}\n",document.head.appendChild(c),{setters:[function(t){o=t.n,i=t._}],execute:function(){var r={name:"upload-oem-search",data:function(){return{loading:!0,categories:[],level1Id:"",level2Id:"",level3Id:""}},mounted:function(){var t=this;this.getData(this.id).then(function(){var r=a(e().mark((function r(o){return e().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Promise.all(o.map(function(){var r=a(e().mark((function r(o){var i;return e().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.getData(o.id);case 2:return i=r.sent,r.next=5,Promise.all(i.map(function(){var r=a(e().mark((function r(o){var i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getData(o.id);case 2:return i=e.sent,e.abrupt("return",n(n({},o),{},{children:i}));case 4:case"end":return e.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}()));case 5:return i=r.sent,r.abrupt("return",n(n({},o),{},{children:i}));case 7:case"end":return r.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}()));case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}()).then((function(e){t.categories=e,t.loading=!1}))},methods:{toSuccess:function(){this.$router.push({path:"/upload/success"})},uploadFile:function(){var t=this,e=this.$t("common.failure"),r=JSON.parse(sessionStorage.getItem("conf_upload"));this.$axios.post("/api/product/add_product",n(n({},r),{},{type:[this.pid,this.id,this.level1Id,this.level2Id,this.level3Id]})).then((function(r){var n=r.data,o=n.code,i=n.msg,a=void 0===i?e:i;0==o?t.toSuccess():t.$message.error(a||e)}))},changeSubcategory:function(t,e,r){this.level1Id=t,this.level2Id=e,this.level3Id=r},getData:function(t){var e=this.$t("common.failure");return this.$axios.get("/api/upload_type_list",{params:{pid:t}}).then((function(t){var r=t.data,n=r.code,o=r.msg,i=void 0===o?e:o,a=r.data,c=void 0===a?[]:a;return 0==n?Promise.resolve(c):Promise.reject(new Error(i||e))})).catch((function(){return Promise.reject(new Error(msg||e))}))}},computed:{id:function(){var t=this.$route.query.id;return parseInt(t)},pid:function(){var t=this.$route.query.pid;return parseInt(t)},disabled:function(){return!this.level3Id},nameKey:function(){return this.$store.state.nameKey}}};t("default",o(r,(function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"upload-oem-search"},[e("div",{staticClass:"back"},[e("router-link",{attrs:{to:"/upload/oem"}},[e("img",{attrs:{src:i,alt:"back"}})])],1),e("div",{staticClass:"center"},[e("b",{domProps:{innerHTML:t._s(t.$t("upload.index.product"))}})]),e("div",{staticClass:"center-groups"},t._l(t.categories,(function(r){return e("div",{key:r.id,staticClass:"groups-item"},[e("div",{staticClass:"groups-item-left"},[e("b",[t._v(t._s(r[t.nameKey]))])]),e("div",{staticClass:"groups-item-right"},[e("ul",{staticClass:"level1-list"},t._l(r.children,(function(n){return e("li",{key:n.id,staticClass:"level1-item"},[e("div",{staticClass:"right-left"},[t._v(" "+t._s(n[t.nameKey])+" ")]),e("div",{staticClass:"right-right"},[e("ul",{staticClass:"level2-list"},t._l(n.children,(function(o){return e("li",{key:o.id,class:["level2-item",t.level3Id===o.id?"selected":""],on:{click:function(e){return t.changeSubcategory(r.id,n.id,o.id)}}},[t._v(" "+t._s(o[t.nameKey])+" ")])})),0)])])})),0)])])})),0),e("div",{staticClass:"button"},[e("el-button",{attrs:{type:"primary",disabled:t.disabled,round:""},on:{click:t.uploadFile}},[t._v(t._s(t.$t("common.save")))])],1)])}),[],!1,null,"0c101811",null,null).exports)}}}))}();