mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-09-14 12:24:20 +08:00
7 lines
2.4 KiB
JavaScript
7 lines
2.4 KiB
JavaScript
var p=(y,d,a)=>new Promise((i,n)=>{var s=o=>{try{c(a.next(o))}catch(e){n(e)}},f=o=>{try{c(a.throw(o))}catch(e){n(e)}},c=o=>o.done?i(o.value):Promise.resolve(o.value).then(s,f);c((a=a.apply(y,d)).next())});import{_ as w,d as x,r as b,x as E,P as F,o as _,c as m,f as r,h as g,F as k,e as L,t as h,g as B,w as D,Q as G,s as T,i as v,T as S}from"./index.js";const I=r("div",{class:"label-name"},[r("span",null,"\u9009\u62E9\u8F6F\u4EF6\u6E90 ")],-1),C={class:"label-value"},V={class:"label-flex"},N=["value"],M={class:"label-btns"},P=["disabled"],j={key:0,class:"label-msg"},q=x({__name:"index",setup(y){return p(this,null,function*(){let d,a;const i=b(!1),n=b(""),s=E({softsourceListIfo:[],softSource:{},currSoftSource:{}}),f=()=>p(this,null,function*(){var o,e,u;try{const t=yield v.Guide.SoftSourceList.GET();if((o=t==null?void 0:t.data)!=null&&o.result){const l=(e=t==null?void 0:t.data)==null?void 0:e.result;s.softsourceListIfo=l.softSourceList||[]}}catch(t){console.log(t)}try{const t=yield v.Guide.GetSoftSource.GET();if((u=t==null?void 0:t.data)!=null&&u.result){const l=t.data.result;s.softSource=l.softSource,s.currSoftSource=l.softSource}}catch(t){console.log(t)}});[d,a]=F(()=>f()),yield d,a();const c=()=>p(this,null,function*(){const o=S.Loading("\u6B63\u5728\u5207\u6362\u4E2D...");i.value=!0;try{const e=yield v.Guide.SoftSource.POST({softSourceIdentity:s.softSource.identity});if(e!=null&&e.data){const{result:u,error:t,success:l}=e.data;t&&S.Warning(t),(e.data.success||0)==0&&(S.Success("\u5207\u6362\u6210\u529F"),yield f())}}catch(e){S.Error(`${e}`)}finally{i.value=!1,o.Close()}});return(o,e)=>(_(),m("form",{class:"form-container",onSubmit:B(c,["prevent"])},[I,r("div",C,[g(` <select v-model="opkg.softSource.identity">
|
|
<option value="">\u8BF7\u9009\u62E9\u8F6F\u4EF6\u6E90</option>
|
|
<option v-for="item in opkg.softsourceListIfo" :value="item.identity">
|
|
{{ item.name }}
|
|
</option>
|
|
</select> `),(_(!0),m(k,null,L(s.softsourceListIfo,u=>(_(),m("label",V,[D(r("input",{type:"radio",value:u.identity,"onUpdate:modelValue":e[0]||(e[0]=t=>s.softSource.identity=t)},null,8,N),[[G,s.softSource.identity,void 0,{trim:!0}]]),T(" "+h(u.name),1)]))),256))]),r("div",M,[r("button",{class:"sumbit",disabled:i.value},"\u4FDD\u5B58",8,P)]),n.value?(_(),m("div",j,[r("span",null,h(n.value),1)])):g("v-if",!0)],32))})}});var Q=w(q,[]);export{Q as default};
|