5170.d440b12f.js 12 KB

12
  1. "use strict";(self["webpackChunkbyte_sailing_mobile"]=self["webpackChunkbyte_sailing_mobile"]||[]).push([[5170],{14071:function(e,t,a){a.d(t,{Z:function(){return h}});var l=a(13649),n=(a(64165),a(13813)),o=(a(55449),a(57658),a(73396)),i=a(44870),r=a(87139);const s={class:"common-list"},c={key:0,class:"left-box",style:{"margin-right":"20px"}},u=["onClick"],d=["onClick"];var p={__name:"common-list",props:{data:{type:Array,default:[]},config:{type:Object,default:[]},showMore:{type:Boolean,default:!0},isCheckbox:{type:Boolean,default:!1},optionalKey:{type:String,default:null}},setup(e){const t=(0,o.FN)().proxy;let a=(0,i.iH)([]),p=[];(0,o.YP)((()=>t.data),(e=>{a.value=e.map((e=>(p.length>0&&p.map((t=>{e.id==t.id&&(e.checked=!0)})),e)))}));const f=(0,i.iH)(null),h=()=>{p=[],a.value.map((e=>{e.checked&&(p.push(e),f.value||(f.value=e[t.optionalKey]))})),0==p.length&&(f.value=null),t.$emit("onCheck",p)},m=e=>{t.$emit("onClick",e)};return(t,p)=>{const v=n.XZ,g=l.JO;return(0,o.wg)(),(0,o.iD)("div",s,[(0,o._)("ul",null,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)((0,i.SU)(a),(t=>((0,o.wg)(),(0,o.iD)("li",{key:t.id},[e.isCheckbox?((0,o.wg)(),(0,o.iD)("div",c,[(0,o.Wm)(v,{modelValue:t.checked,"onUpdate:modelValue":e=>t.checked=e,"icon-size":"15px",shape:"square",onChange:h,disabled:!!f.value&&f.value!=t[e.optionalKey]},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(0,o.kq)("",!0),(0,o._)("div",{class:"center-content",style:{"line-height":"24px"},onClick:e=>m(t)},[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(e.config,(e=>((0,o.wg)(),(0,o.iD)("div",{key:e.prop},[(0,o._)("span",null,(0,r.zw)(e.label)+":",1),(0,o.Uk)((0,r.zw)(t[e.prop]),1)])))),128))],8,u),e.showMore?((0,o.wg)(),(0,o.iD)("div",{key:1,class:"more-box",onClick:e=>m(t)},[(0,o.Wm)(g,{name:"arrow"})],8,d)):(0,o.kq)("",!0)])))),128))])])}}};const f=p;var h=f},5170:function(e,t,a){a.r(t),a.d(t,{default:function(){return v}});var l=a(31441),n=(a(84035),a(55943)),o=(a(90563),a(80147)),i=(a(39292),a(39420)),r=(a(12097),a(57658),a(73396)),s=a(87139),c=a(44870),u=a(14071),d=a(22483);const p={class:"list"};var f={__name:"index",setup(e){const t=(0,c.iH)(!1),a=((0,d.yj)(),(0,c.iH)({pageNum:1,keyword:null,definition:"1"})),f=(0,c.iH)(!1),h=(0,r.FN)().proxy,m=(0,c.iH)([]),v=(0,c.iH)([]),g=(0,c.iH)([{label:h.t("productLibrary.productClassification"),prop:"productClassifyName"},{label:h.t("productLibrary.productCode"),prop:"code"},{label:h.t("productLibrary.productName"),prop:"name"}]),b=()=>{a.value.pageNum=1,f.value=!1,T("refresh")},k=()=>{C()},x=()=>h.$router.push("/main/working"),y=()=>{h.$router.push({path:"productLibraryAdd",query:{type:"add"}})};h.uploadDdRightBtn(y,h.t("common.add"));const w=e=>{h.$router.push({path:"productLibraryAdd",query:{id:e.id,type:"edit"}})},W=e=>{let t=[],a=e=>{e.forEach((e=>{t.push(e),e.children&&e.children.length>0&&a(e.children)}))};return a(e),t},C=()=>{v.value&&v.value.length>0?T():h.post("/productClassify/tree",{parentId:"",name:"",definition:"1"}).then((e=>{v.value=W(e.data),T()}))},T=e=>{t.value=!0,h.post("/productInfo/page",a.value).then((l=>{l.data.rows=l.data.rows.map((e=>({...e,productClassifyName:e.classifyNameGroup.join(" / ")}))),m.value="refresh"===e?l.data.rows:m.value.concat(l.data.rows),10*a.value.pageNum>=l.data.total&&(f.value=!0),a.value.pageNum++,t.value=!1})).catch((e=>{t.value=!1}))};return(e,c)=>{const d=i.l2,h=o.ol,v=n.aV,W=l.I8;return(0,r.wg)(),(0,r.iD)(r.HY,null,[(0,r.Wm)(d,{title:e.$t("productLibrary.name"),"left-text":"","left-arrow":"",onClickLeft:x,onClickRight:y},{right:(0,r.w5)((()=>[(0,r.Uk)((0,s.zw)(e.$t("common.add")),1)])),_:1},8,["title"]),(0,r.Wm)(h,{modelValue:a.value.keyword,"onUpdate:modelValue":c[0]||(c[0]=e=>a.value.keyword=e),placeholder:e.$t("common.pleaseEnterKeywords"),onSearch:b},null,8,["modelValue","placeholder"]),(0,r.Wm)(W,{modelValue:t.value,"onUpdate:modelValue":c[2]||(c[2]=e=>t.value=e),onRefresh:b},{default:(0,r.w5)((()=>[(0,r._)("div",p,[(0,r.Wm)(v,{loading:t.value,"onUpdate:loading":c[1]||(c[1]=e=>t.value=e),finished:f.value,"finished-text":e.$t("common.noMore"),onLoad:k,style:{"margin-bottom":"60px"}},{default:(0,r.w5)((()=>[(0,r.Wm)(u.Z,{data:m.value,onOnClick:w,config:g.value},null,8,["data","config"])])),_:1},8,["loading","finished","finished-text"])])])),_:1},8,["modelValue"])],64)}}},h=a(40089);const m=(0,h.Z)(f,[["__scopeId","data-v-e427658a"]]);var v=m},34373:function(e,t,a){a.d(t,{J:function(){return c}});var l=a(73396),n=a(253),o=a(44870),i=a(47936),r=a(10648);const s=(e,t)=>{const a=(0,o.iH)(),s=()=>{a.value=(0,n.EL)(e).height};return(0,l.bv)((()=>{if((0,l.Y3)(s),t)for(let e=1;e<=3;e++)setTimeout(s,100*e)})),(0,r.h)((()=>(0,l.Y3)(s))),(0,l.YP)([i.bn,i.uK],s),a};function c(e,t){const a=s(e,!0);return e=>(0,l.Wm)("div",{class:t("placeholder"),style:{height:a.value?`${a.value}px`:void 0}},[e()])}},92220:function(e,t,a){a.d(t,{a:function(){return n},d:function(){return o}});var l=a(73396);const n=Symbol(),o=()=>(0,l.f3)(n,null)},64165:function(e,t,a){a(31958),a(20368),a(56742)},55943:function(e,t,a){a.d(t,{aV:function(){return b}});var l=a(11404),n=a(73396),o=a(44870),i=a(610),r=a(5323),s=a(47936),c=a(253),u=a(3444),d=a(92220),p=a(12229);const[f,h,m]=(0,i["do"])("list"),v={error:Boolean,offset:(0,r.SI)(300),loading:Boolean,disabled:Boolean,finished:Boolean,errorText:String,direction:(0,r.SQ)("down"),loadingText:String,finishedText:String,immediateCheck:r.J5};var g=(0,n.aZ)({name:f,props:v,emits:["load","update:error","update:loading"],setup(e,{emit:t,slots:a}){const l=(0,o.iH)(e.loading),i=(0,o.iH)(),r=(0,o.iH)(),f=(0,d.d)(),v=(0,c.eo)(i),g=()=>{(0,n.Y3)((()=>{if(l.value||e.finished||e.disabled||e.error||!1===(null==f?void 0:f.value))return;const{direction:a}=e,n=+e.offset,o=(0,c.EL)(v);if(!o.height||(0,s.xj)(i))return;let u=!1;const d=(0,c.EL)(r);u="up"===a?o.top-d.top<=n:d.bottom-o.bottom<=n,u&&(l.value=!0,t("update:loading",!0),t("load"))}))},b=()=>{if(e.finished){const t=a.finished?a.finished():e.finishedText;if(t)return(0,n.Wm)("div",{class:h("finished-text")},[t])}},k=()=>{t("update:error",!1),g()},x=()=>{if(e.error){const t=a.error?a.error():e.errorText;if(t)return(0,n.Wm)("div",{role:"button",class:h("error-text"),tabindex:0,onClick:k},[t])}},y=()=>{if(l.value&&!e.finished&&!e.disabled)return(0,n.Wm)("div",{class:h("loading")},[a.loading?a.loading():(0,n.Wm)(p.gb,{class:h("loading-icon")},{default:()=>[e.loadingText||m("loading")]})])};return(0,n.YP)((()=>[e.loading,e.finished,e.error]),g),f&&(0,n.YP)(f,(e=>{e&&g()})),(0,n.ic)((()=>{l.value=e.loading})),(0,n.bv)((()=>{e.immediateCheck&&g()})),(0,u.F)({check:g}),(0,c.OR)("scroll",g,{target:v,passive:!0}),()=>{var t;const o=null==(t=a.default)?void 0:t.call(a),s=(0,n.Wm)("div",{ref:r,class:h("placeholder")},null);return(0,n.Wm)("div",{ref:i,role:"feed",class:h(),"aria-busy":l.value},["down"===e.direction?o:s,y(),b(),x(),"up"===e.direction?o:s])}}});const b=(0,l.n)(g)},90563:function(e,t,a){a(31958),a(62939)},39420:function(e,t,a){a.d(t,{l2:function(){return v}});var l=a(11404),n=a(73396),o=a(44870),i=a(610),r=a(5323),s=a(96048),c=a(25322),u=a(34373),d=a(13649);const[p,f]=(0,i["do"])("nav-bar"),h={title:String,fixed:Boolean,zIndex:r.Or,border:r.J5,leftText:String,rightText:String,leftArrow:Boolean,placeholder:Boolean,safeAreaInsetTop:Boolean,clickable:r.J5};var m=(0,n.aZ)({name:p,props:h,emits:["clickLeft","clickRight"],setup(e,{emit:t,slots:a}){const l=(0,o.iH)(),i=(0,u.J)(l,f),r=e=>t("clickLeft",e),p=e=>t("clickRight",e),h=()=>a.left?a.left():[e.leftArrow&&(0,n.Wm)(d.JO,{class:f("arrow"),name:"arrow-left"},null),e.leftText&&(0,n.Wm)("span",{class:f("text")},[e.leftText])],m=()=>a.right?a.right():(0,n.Wm)("span",{class:f("text")},[e.rightText]),v=()=>{const{title:t,fixed:o,border:i,zIndex:u}=e,d=(0,s.As)(u),v=e.leftArrow||e.leftText||a.left,g=e.rightText||a.right;return(0,n.Wm)("div",{ref:l,style:d,class:[f({fixed:o}),{[c.xe]:i,"van-safe-area-top":e.safeAreaInsetTop}]},[(0,n.Wm)("div",{class:f("content")},[v&&(0,n.Wm)("div",{class:[f("left"),e.clickable?c.e9:""],onClick:r},[h()]),(0,n.Wm)("div",{class:[f("title"),"van-ellipsis"]},[a.title?a.title():t]),g&&(0,n.Wm)("div",{class:[f("right"),e.clickable?c.e9:""],onClick:p},[m()])])])};return()=>e.fixed&&e.placeholder?i(v):v()}});const v=(0,l.n)(m)},12097:function(e,t,a){a(31958),a(20368),a(56742)},31441:function(e,t,a){a.d(t,{I8:function(){return k}});var l=a(11404),n=(a(57658),a(73396)),o=a(44870),i=a(610),r=a(5323),s=a(47936),c=a(253),u=a(65261),d=a(12229);const[p,f,h]=(0,i["do"])("pull-refresh"),m=50,v=["pulling","loosing","success"],g={disabled:Boolean,modelValue:Boolean,headHeight:(0,r.SI)(m),successText:String,pullingText:String,loosingText:String,loadingText:String,pullDistance:r.Or,successDuration:(0,r.SI)(500),animationDuration:(0,r.SI)(300)};var b=(0,n.aZ)({name:p,props:g,emits:["change","refresh","update:modelValue"],setup(e,{emit:t,slots:a}){let l;const i=(0,o.iH)(),r=(0,o.iH)(),p=(0,c.eo)(i),g=(0,o.qj)({status:"normal",distance:0,duration:0}),b=(0,u.o)(),k=()=>{if(e.headHeight!==m)return{height:`${e.headHeight}px`}},x=()=>"loading"!==g.status&&"success"!==g.status&&!e.disabled,y=t=>{const a=+(e.pullDistance||e.headHeight);return t>a&&(t=t<2*a?a+(t-a)/2:1.5*a+(t-2*a)/4),Math.round(t)},w=(a,l)=>{const n=+(e.pullDistance||e.headHeight);g.distance=a,g.status=l?"loading":0===a?"normal":a<n?"pulling":"loosing",t("change",{status:g.status,distance:a})},W=()=>{const{status:t}=g;return"normal"===t?"":e[`${t}Text`]||h(t)},C=()=>{const{status:e,distance:t}=g;if(a[e])return a[e]({distance:t});const l=[];return v.includes(e)&&l.push((0,n.Wm)("div",{class:f("text")},[W()])),"loading"===e&&l.push((0,n.Wm)(d.gb,{class:f("loading")},{default:W})),l},T=()=>{g.status="success",setTimeout((()=>{w(0)}),+e.successDuration)},H=e=>{l=0===(0,s.cx)(p.value),l&&(g.duration=0,b.start(e))},S=e=>{x()&&H(e)},I=e=>{if(x()){l||H(e);const{deltaY:t}=b;b.move(e),l&&t.value>=0&&b.isVertical()&&((0,s.PF)(e),w(y(t.value)))}},V=()=>{l&&b.deltaY.value&&x()&&(g.duration=+e.animationDuration,"loosing"===g.status?(w(+e.headHeight,!0),t("update:modelValue",!0),(0,n.Y3)((()=>t("refresh")))):w(0))};return(0,n.YP)((()=>e.modelValue),(t=>{g.duration=+e.animationDuration,t?w(+e.headHeight,!0):a.success||e.successText?T():w(0,!1)})),(0,c.OR)("touchmove",I,{target:r}),()=>{var e;const t={transitionDuration:`${g.duration}ms`,transform:g.distance?`translate3d(0,${g.distance}px, 0)`:""};return(0,n.Wm)("div",{ref:i,class:f()},[(0,n.Wm)("div",{ref:r,class:f("track"),style:t,onTouchstartPassive:S,onTouchend:V,onTouchcancel:V},[(0,n.Wm)("div",{class:f("head"),style:k()},[C()]),null==(e=a.default)?void 0:e.call(a)])])}}});const k=(0,l.n)(b)},84035:function(e,t,a){a(31958),a(62939)},80147:function(e,t,a){a.d(t,{ol:function(){return k}});var l=a(11404),n=a(73396),o=a(44870),i=a(610),r=a(12220),s=a(5323),c=a(47936),u=a(36817),d=a(96401),p=a(3444),f=a(43739);const[h,m,v]=(0,i["do"])("search"),g=(0,r.l7)({},u.Mv,{label:String,shape:(0,s.SQ)("square"),leftIcon:(0,s.SQ)("search"),clearable:s.J5,actionText:String,background:String,showAction:Boolean});var b=(0,n.aZ)({name:h,props:g,emits:["blur","focus","clear","search","cancel","clickInput","clickLeftIcon","clickRightIcon","update:modelValue"],setup(e,{emit:t,slots:a,attrs:l}){const i=(0,d.M)(),s=(0,o.iH)(),h=()=>{a.action||(t("update:modelValue",""),t("cancel"))},g=a=>{const l=13;a.keyCode===l&&((0,c.PF)(a),t("search",e.modelValue))},b=()=>e.id||`${i}-input`,k=()=>{if(a.label||e.label)return(0,n.Wm)("label",{class:m("label"),for:b()},[a.label?a.label():e.label])},x=()=>{if(e.showAction){const t=e.actionText||v("cancel");return(0,n.Wm)("div",{class:m("action"),role:"button",tabindex:0,onClick:h},[a.action?a.action():t])}},y=()=>{var e;return null==(e=s.value)?void 0:e.blur()},w=()=>{var e;return null==(e=s.value)?void 0:e.focus()},W=e=>t("blur",e),C=e=>t("focus",e),T=e=>t("clear",e),H=e=>t("clickInput",e),S=e=>t("clickLeftIcon",e),I=e=>t("clickRightIcon",e),V=Object.keys(u.Mv),D=()=>{const o=(0,r.l7)({},l,(0,r.ei)(e,V),{id:b()}),i=e=>t("update:modelValue",e);return(0,n.Wm)(f.gN,(0,n.dG)({ref:s,type:"search",class:m("field"),border:!1,onBlur:W,onFocus:C,onClear:T,onKeypress:g,onClickInput:H,onClickLeftIcon:S,onClickRightIcon:I,"onUpdate:modelValue":i},o),(0,r.ei)(a,["left-icon","right-icon"]))};return(0,p.F)({focus:w,blur:y}),()=>{var t;return(0,n.Wm)("div",{class:m({"show-action":e.showAction}),style:{background:e.background}},[null==(t=a.left)?void 0:t.call(a),(0,n.Wm)("div",{class:m("content",e.shape)},[k(),D()]),x()])}}});const k=(0,l.n)(b)},39292:function(e,t,a){a(31958),a(20368),a(56742),a(3094),a(67984)}}]);
  2. //# sourceMappingURL=5170.d440b12f.js.map