mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-12-01 06:30:49 +00:00
4 lines
22 KiB
JavaScript
Vendored
4 lines
22 KiB
JavaScript
Vendored
(self["webpackChunkerp"]=self["webpackChunkerp"]||[]).push([[156],{7156:function(t,e,o){"use strict";o.r(e),o.d(e,{default:function(){return p}});var r=function(){var t=this,e=t._self._c;return e("div",[e("el-card",{staticClass:"box-card",staticStyle:{"margin-top":"10px"}},[e("el-form",{ref:"group",attrs:{rules:t.rules,model:t.group,"label-width":"80px"}},[e("el-form-item",{attrs:{label:"活动标题",prop:"title"}},[e("el-input",{staticStyle:{width:"500px"},attrs:{type:"textarea"},model:{value:t.group.title,callback:function(e){t.$set(t.group,"title",e)},expression:"group.title"}})],1),e("el-form-item",{attrs:{label:"团购商品"}},[e("el-button",{on:{click:function(e){return t.importGoods()}}},[t._v("从商品列表导入")]),e("el-input",{staticStyle:{"margin-left":"20px",width:"400px"},attrs:{placeholder:"搜索商品名称、编码"},model:{value:t.groupGoodsSearch.external_sku_id,callback:function(e){t.$set(t.groupGoodsSearch,"external_sku_id",e)},expression:"groupGoodsSearch.external_sku_id"}},[e("el-button",{attrs:{slot:"append"},on:{click:function(e){return t.getGroupGoodsList()}},slot:"append"},[t._v("查询")])],1),e("div",{staticStyle:{display:"flex","align-items":"center"}},[e("span",{staticStyle:{"margin-right":"20px"}},[t._v("商品状态")]),e("el-radio-group",{on:{change:function(e){return t.getGroupGoodsList()}},model:{value:t.groupGoodsSearch.has_stock,callback:function(e){t.$set(t.groupGoodsSearch,"has_stock",e)},expression:"groupGoodsSearch.has_stock"}},[e("el-radio",{attrs:{label:0}},[t._v("全部")]),e("el-radio",{attrs:{label:1}},[t._v("在售中")]),e("el-radio",{attrs:{label:-1}},[t._v("已售罄")])],1)],1),e("div",{staticStyle:{display:"flex","align-items":"center"}},[e("span",{staticStyle:{"margin-right":"20px"}},[t._v("商品分类")]),e("el-radio-group",{attrs:{size:"small"},on:{change:function(e){return t.getGroupGoodsList()}},model:{value:t.groupGoodsSearch.type_id,callback:function(e){t.$set(t.groupGoodsSearch,"type_id",e)},expression:"groupGoodsSearch.type_id"}},[e("el-radio-button",{attrs:{label:"0"}},[t._v("全部")]),t._l(t.types,(function(o){return e("el-radio-button",{key:o.id,attrs:{label:o.id}},[t._v(" "+t._s(o.name))])}))],2)],1),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.groupLoading,expression:"groupLoading"}],ref:"multipleTableGroup",staticStyle:{width:"100%"},attrs:{data:t.groupGoods.data,border:"",height:"800","row-key":t.getRowKeys}},[e("el-table-column",{attrs:{type:"selection","reserve-selection":!0,width:"55"}}),e("el-table-column",{attrs:{prop:"goods_name",label:" 商品名称"}}),e("el-table-column",{attrs:{prop:"external_sku_id",label:"编码"}}),e("el-table-column",{attrs:{prop:"category_name",label:"分类"}}),e("el-table-column",{attrs:{prop:"stock",label:"库存"}}),e("el-table-column",{attrs:{label:"限购数量"},scopedSlots:t._u([{key:"default",fn:function(o){return[e("el-input",{attrs:{placeholder:"限购数量"},on:{change:function(e){return t.handleCellChange(o.row)}},model:{value:o.row.limit_buy,callback:function(e){t.$set(o.row,"limit_buy",e)},expression:"scope.row.limit_buy"}})]}}])}),e("el-table-column",{attrs:{label:"价格"},scopedSlots:t._u([{key:"default",fn:function(o){return[e("el-input",{attrs:{placeholder:"价格"},on:{change:function(e){return t.handleCellChange(o.row)}},model:{value:o.row.price_in_fen,callback:function(e){t.$set(o.row,"price_in_fen",e)},expression:"scope.row.price_in_fen"}})]}}])}),e("el-table-column",{attrs:{prop:"options",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(o){return[e("el-button",{attrs:{type:"text",size:"small"},on:{click:function(e){return t.remove(o.row)}}},[t._v("删除")])]}}])})],1),e("div",{staticStyle:{display:"flex","justify-content":"space-between","align-items":"center","line-height":"32px","margin-top":"20px"}},[e("el-button",{attrs:{type:"danger",size:"small"},on:{click:function(e){return t.batchRemove()}}},[t._v("批量删除")]),e("el-pagination",{attrs:{"current-page":t.groupGoods.meta.current_page,"page-sizes":[20,30,50,100],"page-size":t.groupGoods.meta.per_page,layout:"sizes, prev, pager, next",total:t.groupGoods.meta.total},on:{"size-change":t.handleSizeChangeGroup,"current-change":t.getGroupGoodsList,"update:currentPage":function(e){return t.$set(t.groupGoods.meta,"current_page",e)},"update:current-page":function(e){return t.$set(t.groupGoods.meta,"current_page",e)}}})],1)],1),e("el-form-item",{attrs:{label:"团购时间",prop:"datetimerange"}},[e("el-date-picker",{attrs:{type:"datetimerange","range-separator":"至","start-placeholder":"开始时间","end-placeholder":"结束时间","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:t.group.datetimerange,callback:function(e){t.$set(t.group,"datetimerange",e)},expression:"group.datetimerange"}})],1),e("el-form-item",{staticStyle:{display:"flex","justify-content":"flex-end"}},[e("el-button",{attrs:{type:"success"},on:{click:function(e){return t.onEdit()}}},[t._v("修改团购")])],1)],1)],1),e("el-dialog",{attrs:{title:t.dialogTitle,visible:t.centerDialogVisible,width:"80%","close-on-click-modal":!1},on:{"update:visible":function(e){t.centerDialogVisible=e}}},[e("el-form",{ref:"goodsList",attrs:{model:t.goodsList,"label-width":"80px"}},[e("el-form-item",{attrs:{label:"商品分类",prop:"type_id"}},[e("el-radio-group",{attrs:{size:"small"},on:{change:function(e){return t.goodsSearch()}},model:{value:t.goodsList.type_id,callback:function(e){t.$set(t.goodsList,"type_id",e)},expression:"goodsList.type_id"}},[e("el-radio-button",{attrs:{label:"0"}},[t._v("全部")]),t._l(t.types,(function(o){return e("el-radio-button",{key:o.id,attrs:{label:o.id}},[t._v(" "+t._s(o.name))])}))],2)],1),e("el-form-item",{attrs:{label:"商品品牌",prop:"brand_id"}},[e("el-radio-group",{attrs:{size:"small"},on:{change:function(e){return t.goodsSearch()}},model:{value:t.goodsList.brand_id,callback:function(e){t.$set(t.goodsList,"brand_id",e)},expression:"goodsList.brand_id"}},[e("el-radio-button",{attrs:{label:"0"}},[t._v("全部")]),t._l(t.brands,(function(o){return e("el-radio-button",{key:o.id,attrs:{label:o.id}},[t._v(" "+t._s(o.name))])}))],2)],1),e("el-form-item",{attrs:{label:"搜索",prop:"goods_keyword"}},[e("el-input",{staticStyle:{width:"400px"},attrs:{placeholder:"搜索商品名称、编码"},model:{value:t.goodsList.goods_keyword,callback:function(e){t.$set(t.goodsList,"goods_keyword",e)},expression:"goodsList.goods_keyword"}}),e("el-radio-group",{staticStyle:{margin:"0 30px"},model:{value:t.goodsList.has_stock,callback:function(e){t.$set(t.goodsList,"has_stock",e)},expression:"goodsList.has_stock"}},[e("el-radio",{attrs:{label:1}},[t._v("有库存")]),e("el-radio",{attrs:{label:0}},[t._v("全部")])],1),e("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return t.goodsSearch()}}},[t._v("查询")]),e("el-button",{attrs:{size:"small"},on:{click:function(e){return t.resetForm()}}},[t._v("重置")])],1)],1),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.goodsLoading,expression:"goodsLoading"}],ref:"multipleTable",staticStyle:{width:"100%"},attrs:{data:t.goods.data,border:"",height:"520","row-key":t.getRowKeys},on:{select:t.handleSelect,"select-all":t.selectCurrentGoods}},[e("el-table-column",{attrs:{type:"selection","reserve-selection":!0,width:"55"}}),e("el-table-column",{attrs:{label:"商品信息"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.goods.title+" "+e.row.title)+" ")]}}])}),e("el-table-column",{attrs:{label:"编码"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.goods.goods_code+"_"+e.row.sku_code)+" ")]}}])}),e("el-table-column",{attrs:{label:"品牌"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.goods.brand?e.row.goods.brand.name:"")+" ")]}}])}),e("el-table-column",{attrs:{prop:"goods.type.name",label:"分类"}}),e("el-table-column",{attrs:{prop:"stock",label:"库存"}})],1),e("div",{staticStyle:{display:"flex","flex-direction":"row-reverse","align-items":"center","margin-top":"10px"}},[e("el-pagination",{attrs:{"current-page":t.goods.meta.current_page,"page-sizes":[20,30,50,100],"page-size":t.goods.meta.per_page,layout:"sizes, prev, pager, next",total:t.goods.meta.total},on:{"size-change":t.handleSizeChange,"current-change":t.goodsSearch,"update:currentPage":function(e){return t.$set(t.goods.meta,"current_page",e)},"update:current-page":function(e){return t.$set(t.goods.meta,"current_page",e)}}})],1),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("div",{staticStyle:{display:"flex","justify-content":"space-between","align-items":"center"}},[e("div",[e("el-button",{on:{click:function(e){return t.toggleSelection(1)}}},[t._v("全选")]),e("el-button",{on:{click:function(e){return t.toggleSelection(0)}}},[t._v("取消全选")])],1),e("div",[t._v("已选 "+t._s(t.selectNum)+" 件")]),e("div",[e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.addGoods()}}},[t._v("确 定")]),e("el-button",{on:{click:function(e){t.centerDialogVisible=!1}}},[t._v("取 消")])],1)])])],1)],1)},s=[],n=(o(560),o(8159)),i=o(8231),a=o(6258),l={data(){return{group:{title:"",is_save_preview:1,datetimerange:[],start_time:"",end_time:""},rules:{title:[{required:!0,message:"请输入活动标题",trigger:"blur"}],datetimerange:[{required:!0,message:"请选择团购时间",trigger:"blur"}]},groupGoods:{data:[],meta:{total:0,current_page:1,per_page:20}},groupGoodsSearch:{external_sku_id:"",has_stock:0,page:1,per_page:20,group_id:0,delete_ids:[],new_ids:[],type_id:0},groupLoading:!1,goodsLoading:!0,goods:{data:[],meta:{total:0,current_page:1,per_page:20}},centerDialogVisible:!1,types:[],brands:[],goodsList:{goods_keyword:"",has_stock:1,type_id:0,brand_id:0,delete_ids:[],new_ids:[],has_ids:[]},goodsListPage:{page:1,per_page:20},dialogTitle:"您的商品库中已有 0 件商品",selectNum:0,selectGoods:[],deleteGoods:[],allGoods:[],changeData:[]}},mounted(){this.groupGoodsSearch.group_id=parseInt(this.$route.query.id),this.getGoupInfo(this.$route.query.id),this.getGroupGoodsList(),this.getbrandType(),this.getgoodsType()},methods:{onEdit(){this.group.new_ids=this.goodsList.has_ids;let t=[];this.changeData.forEach(((e,o)=>{e&&t.push(e)})),this.group.change_data=t,this.group.delete_ids=this.groupGoodsSearch.delete_ids,this.$refs.group.validate((t=>{if(!t)return!1;{const t=this.$loading({lock:!0,text:"Loading",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"});(0,n.Tv)(this.groupGoodsSearch.group_id,this.group).then((e=>{t.close(),this.$message(e.data.message),this.$router.push({path:"GROUP_MANAGEMENT"})}))}}))},handleSizeChangeGroup(t){this.groupGoodsSearch.per_page=t,this.getGroupGoodsList()},getGroupGoodsList(t=1){this.groupGoodsSearch.page=t,this.groupGoodsSearch.new_ids=this.goodsList.new_ids,(0,n.sC)(this.groupGoodsSearch).then((t=>{this.groupGoods=t.data,this.groupGoods.data.forEach(((t,e)=>{void 0!==this.changeData[t.id]&&(this.groupGoods.data[e].limit_buy=this.changeData[t.id].limit_buy,this.groupGoods.data[e].price_in_fen=this.changeData[t.id].price_in_fen)})),this.groupGoods.meta.per_page=parseInt(this.groupGoods.meta.per_page)}))},getGoupInfo(t){(0,n.Y6)(t).then((t=>{void 0===t.data.data.id?(this.$message.error("不可编辑!!!"),this.$router.push({path:"GROUP_MANAGEMENT"})):(this.group=t.data.data,this.group.datetimerange=[this.group.start_time,this.group.end_time])}))},getgoodsType(){let t={per_page:9999};(0,i.Ci)(t).then((t=>{this.types=t.data.data}))},getbrandType(){let t={per_page:9999};(0,i.ar)(t).then((t=>{this.brands=t.data.data}))},batchRemove(){this.$refs.multipleTableGroup.selection.forEach((t=>{this.groupGoodsSearch.delete_ids.push(t.id);let e=this.goodsList.has_ids.indexOf(t.id);e>0&&delete this.goodsList.has_ids[e]})),this.$refs.multipleTableGroup.clearSelection(),this.getGroupGoodsList()},remove(t){this.groupGoodsSearch.delete_ids.push(t.id),this.goodsList.has_ids.forEach(((e,o)=>{e==t.id&&delete this.goodsList.has_ids[o]})),this.getGroupGoodsList()},handleCellChange(t){this.changeData[t.id]={id:t.id,limit_buy:t.limit_buy,price_in_fen:t.price_in_fen}},importGoods(){this.dialogTitle="您的商品库中已有 "+this.groupGoods.meta.total+" 件商品",this.goodsSearch(),this.centerDialogVisible=!0},goodsSearch(t=1){this.goodsList.page=t,this.goodsList.per_page=this.goodsListPage.per_page,this.goodsList.group_id=this.groupGoodsSearch.group_id,this.goodsList.delete_ids=this.groupGoodsSearch.delete_ids,this.goodsLoading=!0,(0,a.od)(this.goodsList).then((t=>{this.goods=t.data,this.goods.meta.per_page=parseInt(this.goods.meta.per_page),this.goods.data.forEach(((t,e)=>{void 0!==this.selectGoods[t.id]&&this.$refs.multipleTable.toggleRowSelection(t,!0)})),this.goodsLoading=!1})),1===t&&this.getAllGoods(this.goodsList)},getAllGoods(t){t.page=1,t.per_page=9999,(0,a.od)(t).then((t=>{this.allGoods=t.data.data}))},handleSizeChange(t){this.goodsListPage.per_page=t,this.goodsSearch()},getRowKeys(t){return t.id},toggleSelection(t){t?(this.allGoods.forEach(((t,e)=>{void 0===this.selectGoods[t.id]&&this.selectNum++,this.selectGoods[t.id]=1})),this.goods.data.forEach(((t,e)=>{this.$refs.multipleTable.toggleRowSelection(t,!0)}))):(this.allGoods.forEach(((t,e)=>{void 0!==this.selectGoods[t.id]&&(delete this.selectGoods[t.id],this.selectNum--)})),this.$refs.multipleTable.clearSelection())},handleSelect(t,e){void 0===this.selectGoods[e.id]?(this.selectGoods[e.id]=1,this.selectNum++):(delete this.selectGoods[e.id],this.selectNum--)},resetForm(){this.$refs.goodsList.resetFields(),this.goodsSearch()},addGoods(){this.selectGoods.forEach(((t,e)=>{void 0!==e&&(this.goodsList.new_ids.push(e),this.goodsList.has_ids.push(e))})),this.getGroupGoodsList(),this.$refs.goodsList.resetFields(),this.$refs.multipleTable.clearSelection(),this.selectGoods=[],this.selectNum=0,this.centerDialogVisible=!1},selectCurrentGoods(t){t.length?(t.forEach((t=>{void 0===this.selectGoods[t.id]&&(this.selectGoods[t.id]=1)})),this.selectNum+=t.length):(this.goods.data.forEach((t=>{void 0!==this.selectGoods[t.id]&&delete this.selectGoods[t.id]})),this.selectNum-=this.goods.data.length)}}},u=l,d=o(1001),c=(0,d.Z)(u,r,s,!1,null,null,null),p=c.exports},6258:function(t,e,o){"use strict";o.d(e,{CD:function(){return b},JS:function(){return v},K1:function(){return d},NR:function(){return h},Rq:function(){return n},Vx:function(){return u},cM:function(){return c},e3:function(){return l},gM:function(){return _},lO:function(){return s},no:function(){return f},od:function(){return p},rQ:function(){return i},sx:function(){return m},t5:function(){return a},zl:function(){return g}});var r=o(422);function s(t){return(0,r.Z)({url:"/api/goods_skus",method:"get",params:t})}function n(t){return(0,r.Z)({url:"/api/goods",method:"post",data:t})}function i(t){return(0,r.Z)({url:`/api/goods_skus/${t}`,method:"get"})}function a(t){return(0,r.Z)({url:"/api/goods",method:"get",params:t})}function l(t,e){return(0,r.Z)({url:`/api/goods_skus/${t}`,method:"patch",data:e})}function u(t){return(0,r.Z)({url:"/api/batch/goods_skus",method:"patch",data:t})}function d(t,e){return(0,r.Z)({url:`/api/single/goods_skus/${t}`,method:"patch",data:e})}function c(t,e){return(0,r.Z)({url:"/api/upload",Headers:e,method:"post",data:t})}function p(t){return(0,r.Z)({url:"/api/goodsList",method:"get",params:t})}function g(t){return(0,r.Z)({url:"/api/goods_sku_location",method:"get",params:t})}function h(t){return(0,r.Z)({url:"/api/goodsSkusList",method:"get",params:{title:t}})}function m(){return(0,r.Z)({url:"/api/stock/goods_skus",method:"get"})}function f(t){return(0,r.Z)({url:"/api/goods/filter/"+t,method:"get"})}function _(t){return(0,r.Z)({url:"/api/goods_combination",method:"post",data:t})}function b(t){return(0,r.Z)({url:"/api/goods_combination",method:"get",params:t})}function v(t){return(0,r.Z)({url:"/api/goods_combination/"+t,method:"get"})}},8159:function(t,e,o){"use strict";o.d(e,{Rp:function(){return n},Tv:function(){return a},X8:function(){return s},Y6:function(){return i},ni:function(){return u},sC:function(){return l}});var r=o(422);function s(t){return(0,r.Z)({url:"/api/group",method:"get",params:t})}function n(t){return(0,r.Z)({url:"/api/group",method:"post",data:t})}function i(t){return(0,r.Z)({url:`/api/group/${t}`,method:"get"})}function a(t,e){return(0,r.Z)({url:`/api/group/${t}`,method:"patch",data:e})}function l(t){return(0,r.Z)({url:"/api/groupGoods",method:"get",params:t})}function u(t){return(0,r.Z)({url:"/api/groupGoods",method:"post",params:t})}},8231:function(t,e,o){"use strict";o.d(e,{At:function(){return i},Ci:function(){return s},ER:function(){return n},Mr:function(){return d},ar:function(){return l},e9:function(){return u},yH:function(){return a},yq:function(){return c}});var r=o(422);function s(t){return(0,r.Z)({url:"/api/goods_types",method:"get",params:t})}function n(t){return(0,r.Z)({url:`/api/goods_types/${t}`,method:"delete"})}function i(t){return(0,r.Z)({url:"/api/goods_types/",method:"post",data:t})}function a(t,e){return(0,r.Z)({url:`/api/goods_types/${t}`,method:"patch",data:e})}function l(t){return(0,r.Z)({url:"/api/goods_brands",method:"get",params:t})}function u(t){return(0,r.Z)({url:`/api/goods_brands/${t}`,method:"delete"})}function d(t){return(0,r.Z)({url:"/api/goods_brands",method:"post",data:t})}function c(t,e){return(0,r.Z)({url:`/api/goods_brands/${t}`,method:"patch",data:e})}},6525:function(t,e,o){"use strict";o.d(e,{LP:function(){return s},gy:function(){return n}});const r="admin_token";function s(){return localStorage.getItem("token")}function n(){return localStorage.removeItem(r)}},422:function(t,e,o){"use strict";var r=o(9669),s=o.n(r),n=o(6525),i=o(4865),a=o.n(i),l=o(4720),u=s().create({timeout:36e4});u.interceptors.request.use((t=>(t.headers.Authorization="Bearer "+(0,n.LP)(),a().start(),t)),(t=>Promise.reject(t))),u.interceptors.response.use((t=>{a().done();const e=t.status;if(200===e||201===e)return t}),(t=>(a().done(),400===t.response.status&&(0,l.Message)({message:t.response.data.errorMessage,type:"error"}),500===t.response.status&&(0,l.Message)({message:t.response.data.message,type:"error"}),Promise.reject(t)))),e.Z=u},4865:function(t,e,o){var r,s;
|
|
/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
|
|
* @license MIT */(function(n,i){r=i,s="function"===typeof r?r.call(e,o,e,t):r,void 0===s||(t.exports=s)})(0,(function(){var t={version:"0.2.0"},e=t.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};function o(t,e,o){return t<e?e:t>o?o:t}function r(t){return 100*(-1+t)}function s(t,o,s){var n;return n="translate3d"===e.positionUsing?{transform:"translate3d("+r(t)+"%,0,0)"}:"translate"===e.positionUsing?{transform:"translate("+r(t)+"%,0)"}:{"margin-left":r(t)+"%"},n.transition="all "+o+"ms "+s,n}t.configure=function(t){var o,r;for(o in t)r=t[o],void 0!==r&&t.hasOwnProperty(o)&&(e[o]=r);return this},t.status=null,t.set=function(r){var a=t.isStarted();r=o(r,e.minimum,1),t.status=1===r?null:r;var l=t.render(!a),u=l.querySelector(e.barSelector),d=e.speed,c=e.easing;return l.offsetWidth,n((function(o){""===e.positionUsing&&(e.positionUsing=t.getPositioningCSS()),i(u,s(r,d,c)),1===r?(i(l,{transition:"none",opacity:1}),l.offsetWidth,setTimeout((function(){i(l,{transition:"all "+d+"ms linear",opacity:0}),setTimeout((function(){t.remove(),o()}),d)}),d)):setTimeout(o,d)})),this},t.isStarted=function(){return"number"===typeof t.status},t.start=function(){t.status||t.set(0);var o=function(){setTimeout((function(){t.status&&(t.trickle(),o())}),e.trickleSpeed)};return e.trickle&&o(),this},t.done=function(e){return e||t.status?t.inc(.3+.5*Math.random()).set(1):this},t.inc=function(e){var r=t.status;return r?("number"!==typeof e&&(e=(1-r)*o(Math.random()*r,.1,.95)),r=o(r+e,0,.994),t.set(r)):t.start()},t.trickle=function(){return t.inc(Math.random()*e.trickleRate)},function(){var e=0,o=0;t.promise=function(r){return r&&"resolved"!==r.state()?(0===o&&t.start(),e++,o++,r.always((function(){o--,0===o?(e=0,t.done()):t.set((e-o)/e)})),this):this}}(),t.render=function(o){if(t.isRendered())return document.getElementById("nprogress");l(document.documentElement,"nprogress-busy");var s=document.createElement("div");s.id="nprogress",s.innerHTML=e.template;var n,a=s.querySelector(e.barSelector),u=o?"-100":r(t.status||0),d=document.querySelector(e.parent);return i(a,{transition:"all 0 linear",transform:"translate3d("+u+"%,0,0)"}),e.showSpinner||(n=s.querySelector(e.spinnerSelector),n&&c(n)),d!=document.body&&l(d,"nprogress-custom-parent"),d.appendChild(s),s},t.remove=function(){u(document.documentElement,"nprogress-busy"),u(document.querySelector(e.parent),"nprogress-custom-parent");var t=document.getElementById("nprogress");t&&c(t)},t.isRendered=function(){return!!document.getElementById("nprogress")},t.getPositioningCSS=function(){var t=document.body.style,e="WebkitTransform"in t?"Webkit":"MozTransform"in t?"Moz":"msTransform"in t?"ms":"OTransform"in t?"O":"";return e+"Perspective"in t?"translate3d":e+"Transform"in t?"translate":"margin"};var n=function(){var t=[];function e(){var o=t.shift();o&&o(e)}return function(o){t.push(o),1==t.length&&e()}}(),i=function(){var t=["Webkit","O","Moz","ms"],e={};function o(t){return t.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(t,e){return e.toUpperCase()}))}function r(e){var o=document.body.style;if(e in o)return e;var r,s=t.length,n=e.charAt(0).toUpperCase()+e.slice(1);while(s--)if(r=t[s]+n,r in o)return r;return e}function s(t){return t=o(t),e[t]||(e[t]=r(t))}function n(t,e,o){e=s(e),t.style[e]=o}return function(t,e){var o,r,s=arguments;if(2==s.length)for(o in e)r=e[o],void 0!==r&&e.hasOwnProperty(o)&&n(t,o,r);else n(t,s[1],s[2])}}();function a(t,e){var o="string"==typeof t?t:d(t);return o.indexOf(" "+e+" ")>=0}function l(t,e){var o=d(t),r=o+e;a(o,e)||(t.className=r.substring(1))}function u(t,e){var o,r=d(t);a(t,e)&&(o=r.replace(" "+e+" "," "),t.className=o.substring(1,o.length-1))}function d(t){return(" "+(t.className||"")+" ").replace(/\s+/gi," ")}function c(t){t&&t.parentNode&&t.parentNode.removeChild(t)}return t}))}}]);
|
|
//# sourceMappingURL=156.783ddb27.js.map
|