beehole-store-server
Version:
www.bee-hole.com
3 lines • 16.2 kB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-22cb2c17"],{"1b6c":function(t,e,r){"use strict";r.d(e,"a",(function(){return o})),r.d(e,"b",(function(){return i}));var n=r("5530"),a=r("bf0f");function o(t,e){return function(){return Object(a["b"])(t,Object(n["a"])({},e))}}function i(t,e){return Object(a["b"])(t,Object(n["a"])({},e))}},"1da1":function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));r("d3b7");function n(t,e,r,n,a,o,i){try{var c=t[o](i),s=c.value}catch(u){return void r(u)}c.done?e(s):Promise.resolve(s).then(n,a)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(a,o){var i=t.apply(e,r);function c(t){n(i,a,o,c,s,"next",t)}function s(t){n(i,a,o,c,s,"throw",t)}c(void 0)}))}}},"2c59":function(t,e,r){"use strict";r("a7e2")},"3f42":function(t,e,r){"use strict";r("b0c0");var n=function(){var t=this,e=t._self._c;return e("a-upload",{attrs:{name:"file",multiple:!0,action:t.url,data:t.getData,headers:t.headers,showUploadList:!1,"before-upload":t.beforeUpload,accept:"image/*,video/*"},on:{change:t.handleChange}},[e("a-button",[e("a-icon",{attrs:{type:"upload"}}),t._v(" "+t._s(t.name?t.name:t.$t("compoent.attachlist.btn.uploadImg"))+" ")],1)],1)},a=[],o=r("5530"),i=(r("99af"),r("8ded")),c=r.n(i),s=r("9fb0"),u=r("5880"),l=r("a5e7"),h={name:"attachUpload",props:{params:{value:{}},name:{value:""}},computed:Object(o["a"])({},Object(u["mapGetters"])({shop_id:"shopId"})),data:function(){return{headers:{Authorization:"Bearer "+c.a.get(s["a"])},url:"/admin"+l["a"].attachAdd,fileList:[]}},methods:{getData:function(t){var e={};return this.shop_id&&(e.shop_id=this.shop_id,e.tmp_id=parseInt(Math.floor((Math.random()+Math.floor(9*Math.random()+1))*Math.pow(10,9))),this.params.good_id&&(e.good_id=this.params.good_id)),e},handleChange:function(t){t.file.status,"done"===t.file.status?(t.file.response.data?(this.$set(this,"fileList",[]),this.$emit("uploadBack",t.file.response.data)):this.$message.error("".concat(t.file.name," ").concat(t.file.response.message," ")),this.$message.success("".concat(t.file.name," file uploaded successfully"))):"error"===t.file.status&&this.$message.error("".concat(t.file.name," file upload failed."))},beforeUpload:function(t){var e=t.size/1024/1024<5;return e||this.$message.error("file must smaller than 5MB!"),e}}},d=Object(o["a"])({},h),p=d,f=r("2877"),m=Object(f["a"])(p,n,a,!1,null,null,null);e["a"]=m.exports},"4e58":function(t,e,r){},"50af":function(t,e,r){"use strict";var n=function(){var t=this,e=t._self._c;return t.hiddenIcon?t._e():e("a-tooltip",[e("template",{slot:"title"},[t._v(" "+t._s(t.$t("view.test.form.add.message.aiButton"))+" ")]),e("Icon-robot-one",{class:{disableCursor:t.disabled},attrs:{theme:"outline",size:"24",fill:t.fcolor},on:{click:t.translate}})],2)},a=[],o=r("5530"),i=r("c7eb"),c=r("1da1"),s=r("b775"),u={aiTs:"/ai/trans"};function l(t){return Object(s["b"])({url:u.aiTs,method:"post",data:t})}var h={name:"ts",data:function(){return{tsIn:!1}},props:{value:"",lang:"",type:{default:"txt"},hiddenIcon:{default:!1},disabled:{default:!1}},computed:{fcolor:function(){return this.disabled?"#ccc":"#1890ff"}},methods:{translate:function(){var t=this;return Object(c["a"])(Object(i["a"])().mark((function e(){var r,n;return Object(i["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.disabled){e.next=2;break}return e.abrupt("return",!1);case 2:if(!t.tsIn){e.next=5;break}return t.$message.error(t.$t("view.test.form.add.message.aiUpdate")),e.abrupt("return",!1);case 5:return t.tsIn=!0,t.$emit("update:loadding",t.tsIn),t.$emit("changeStatus",t.tsIn),e.prev=8,e.next=11,l({text:t.value,type:t.type,lang:t.lang});case 11:r=e.sent,n=r.text,t.tsIn=!1,t.$emit("update:value",n),t.$emit("update:loadding",t.tsIn),t.$emit("changeStatus",t.tsIn),e.next=25;break;case 19:e.prev=19,e.t0=e["catch"](8),t.tsIn=!1,t.$emit("update:loadding",t.tsIn),t.$emit("changeStatus",t.tsIn),t.$message.error(t.$t("view.test.form.add.message.aiError"));case 25:case"end":return e.stop()}}),e,null,[[8,19]])})))()}}},d=Object(o["a"])({},h),p=d,f=(r("553c"),r("2877")),m=Object(f["a"])(p,n,a,!1,null,null,null);e["a"]=m.exports},"553c":function(t,e,r){"use strict";r("4e58")},"9b82d":function(t,e,r){"use strict";var n=function(){var t=this,e=t._self._c;return e("div",[t.shopList&&t.shopList.length?e("a-select",{attrs:{placeholder:"请选择","allow-clear":"",getPopupContainer:function(t){return t.parentNode}},on:{change:t.back},model:{value:t.checkedShopId,callback:function(e){t.checkedShopId=e},expression:"checkedShopId"}},t._l(t.shopList,(function(r,n){return e("a-select-option",{key:n,attrs:{value:r.shop_id}},[t._v(t._s(r.title))])})),1):t._e()],1)},a=[],o=r("5530"),i=r("a7b6"),c={name:"ShopSelect",props:{shopId:{default:""}},data:function(){return{shopList:[],checkedShopId:this.shopId}},created:function(){this.initLit()},methods:{initLit:function(){var t=this,e={limit:50,page:1};Object(i["e"])(e).then((function(e){t.shopList=e.list,t.shopId&&""!==t.shopId||(t.checkedShopId=t.shopList[0].shop_id,t.back())}))},back:function(){this.$emit("change",this.checkedShopId)}}},s=Object(o["a"])({},c),u=s,l=r("2877"),h=Object(l["a"])(u,n,a,!1,null,null,null);e["a"]=h.exports},a5e7:function(t,e,r){"use strict";r.d(e,"a",(function(){return o})),r.d(e,"c",(function(){return i})),r.d(e,"b",(function(){return c}));var n=r("b775"),a={attachAdd:"/upload/file",attachList:"/upload/file/list",attachDel:"/upload/file/delete"},o=a;function i(t){return Object(n["b"])({url:a.attachList,method:"post",params:t})}function c(t){return Object(n["b"])({url:a.attachDel,method:"post",params:t})}},a7e2:function(t,e,r){},c7eb:function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));r("a4d3"),r("e01a"),r("d3b7"),r("d28b"),r("3ca3"),r("ddb0"),r("b636"),r("944a"),r("0c47"),r("23dc"),r("3410"),r("159b"),r("b0c0"),r("131a"),r("fb6a");var n=r("53ca");function a(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
a=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.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(E){l=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var a=e&&e.prototype instanceof f?e:f,i=Object.create(a.prototype),c=new I(n||[]);return o(i,"_invoke",{value:x(t,r,c)}),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(E){return{type:"throw",arg:E}}}t.wrap=h;var p={};function f(){}function m(){}function v(){}var y={};l(y,c,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(S([])));b&&b!==e&&r.call(b,c)&&(y=b);var w=v.prototype=f.prototype=Object.create(y);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function a(o,i,c,s){var u=d(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==Object(n["a"])(h)&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){a("next",t,c,s)}),(function(t){a("throw",t,c,s)})):e.resolve(h).then((function(t){l.value=t,c(l)}),(function(t){return a("throw",t,c,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){a(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return $()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=O(i,r);if(c){if(c===p)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 s=d(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===p)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function O(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,O(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var a=d(n,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,p;var o=a.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function k(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 j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function S(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 n=-1,a=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:$}}function $(){return{value:void 0,done:!0}}return m.prototype=v,o(w,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:m,configurable:!0}),m.displayName=l(v,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,l(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},_(L.prototype),l(L.prototype,s,(function(){return this})),t.AsyncIterator=L,t.async=function(e,r,n,a,o){void 0===o&&(o=Promise);var i=new L(h(e,r,n,a),o);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(w),l(w,u,"Generator"),l(w,c,(function(){return this})),l(w,"toString",(function(){return"[object Generator]"})),t.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}},t.values=S,I.prototype={constructor:I,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(j),!t)for(var e in this)"t"===e.charAt(0)&&r.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 n(r,n){return i.type="throw",i.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(c&&s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(i)},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),p},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),j(r),p}},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 a=n.arg;j(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}},fb04:function(t,e,r){"use strict";r("b0c0");var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"attachList"},[t.hiddenBtn?t._e():e("a-button",{style:t.buttonStyle,attrs:{type:"primary"},on:{click:t.openAttachList}},[t._v(" "+t._s(t.$t("compoent.attachlist.select.img.btn"))+" ")]),e("ant-modal",{attrs:{visible:t.open,"modal-title":t.formTitle,"adjust-size":!0,modalHeight:"680",modalWidth:"1120"},on:{cancel:t.cancel,ok:t.backChecked}},[e("div",{attrs:{slot:"content"},slot:"content"},[e("div",{staticClass:"table-page-search-wrapper"},[e("a-card",{staticStyle:{"margin-bottom":"10px",padding:"10px"},attrs:{bordered:!1}},[e("a-form",t._b({attrs:{layout:"inline",rules:[]}},"a-form",t.itemLayout,!1),[e("a-row",{attrs:{gutter:12}},[e("a-col",{attrs:{md:6,lg:6,sm:24}},[e("attach-upload",{attrs:{params:{shop_id:t.queryParam.shop_id,good_id:t.params.good_id}},on:{uploadBack:t.resetQuery}})],1)],1)],1),e("a-row",{staticClass:"ImageList",attrs:{gutter:48}},t._l(t.List,(function(r,n){return e("a-col",{key:n,staticStyle:{"margin-top":"5px"},attrs:{md:4,sm:6},on:{click:function(e){return t.changeChecked(r)}}},[e("div",{staticStyle:{height:"180px"}},[-1!=r.content_type.indexOf("image")?e("img",{class:-1!=t.rowKey.indexOf(r.path)?"checkedImg":"img-item",staticStyle:{width:"100%",height:"120px",display:"block","object-fit":"scale-down"},attrs:{src:r.path}}):t._e(),-1!=r.content_type.indexOf("video")?e("div",[e("video",{class:-1!=t.rowKey.indexOf(r.path)?"checkedImg":"img-item",staticStyle:{width:"100%",height:"120px",display:"block","object-fit":"scale-down"},attrs:{controls:""}},[e("source",{attrs:{src:r.path,type:"video/mp4"}})])]):t._e(),e("div",{staticStyle:{"margin-top":"0.1rem"}},[t._v(" "+t._s(r.name)+" ")])])])})),1),e("a-pagination",{staticStyle:{"margin-top":"2rem"},attrs:{total:t.total},on:{change:t.getList},model:{value:t.queryParam.page,callback:function(e){t.$set(t.queryParam,"page",e)},expression:"queryParam.page"}})],1)],1)])])],1)},a=[],o=r("5530"),i=r("2dd7"),c=r("3f42"),s=r("9b82d"),u=r("1b6c"),l=r("a5e7"),h=r("5880"),d={name:"attachList",components:{AntModal:i["a"],attachUpload:c["a"],ShopSelect:s["a"]},computed:Object(o["a"])({},Object(h["mapGetters"])({shop_id:"shopId"})),props:{shopId:{value:""},type:{default:"radio"},hiddenBtn:!1,value:"",params:{type:Object,default:function(){return{good_id:1}}},buttonStyle:{type:String,default:""}},data:function(){return{open:!1,formTitle:Object(u["b"])("compoent.attachlist.modal.title"),queryParam:{shop_id:0,page:1,limit:12},List:[],total:0,rowKey:[],itemLayout:{labelCol:{span:4},wrapperCol:{span:8}}}},methods:{openAttachList:function(){this.open=!0,this.value&&("radio"===this.type?this.rowKey=[this.value]:this.rowKey=this.value),this.getList()},cancel:function(){this.open=!1},changeShop:function(t){this.queryParam.shop_id=t,this.getList()},resetQuery:function(){this.queryParam.page=1,this.queryParam.limit=12,this.getList()},getList:function(){var t=this;this.shop_id&&(this.queryParam.shop_id=this.shop_id),Object(l["c"])(this.queryParam).then((function(e){t.List=e.list,t.total=e.total_count}))},changeChecked:function(t){"radio"===this.type?this.$set(this.rowKey,0,t.path):this.rowKey.push(t.path)},backChecked:function(){"radio"===this.type?this.$emit("update:value",this.rowKey[0]):this.$emit("update:value",this.rowKey),this.$emit("change",this.rowKey),this.cancel()},handleQuery:function(){this.getList()}}},p=Object(o["a"])({},d),f=p,m=(r("2c59"),r("2877")),v=Object(m["a"])(f,n,a,!1,null,null,null);e["a"]=v.exports}}]);