PageSourceSearch

https://www.veryreport.com/_nuxt/BJzYBTff.js

js veryreport.com collected 2026-10-05 22:12:50 UTC 25,162 bytes, 2 lines download raw bytes

1import{d as te,a as ne,c as se,o as le,e as a,f as t,j as l,F as m,r as B,t as u,k as C,l as i,v as p,z as j,m as re,q as x,s as z,b as d,n as R,i as g}from"./CMvZ-tef.js";const oe={class:"space-y-5 max-w-6xl"},ae={class:"flex flex-wrap items-center justify-between gap-3"},ue={class:"flex flex-wrap gap-2"},ie=["disabled"],de={class:"flex flex-wrap gap-2 text-sm"},pe=["onClick"],me={key:0,class:"text-xs text-blue-600"},ye={key:1,class:"text-sm text-amber-700 bg-amber-50 border border-amber-100 rounded-lg px-3 py-2"},ce={key:2,class:"text-sm text-gray-400"},xe={key:3,class:"text-sm text-rose-600"},be={key:4,class:"bg-white rounded-xl border border-gray-100 shadow-sm overflow-x-auto"},ge={class:"w-full text-sm min-w-[960px]"},fe={class:"divide-y divide-gray-100"},ve={class:"px-3 py-3"},ke={class:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-700"},Ce={class:"px-3 py-3"},Te={class:"font-mono text-[11px] text-gray-400"},Pe={class:"px-3 py-3 text-gray-600"},Ie={class:"px-3 py-3 text-gray-600"},Ue={class:"px-3 py-3 text-gray-600 text-xs"},Re={class:"px-3 py-3 text-gray-600 text-xs"},Ae={class:"px-3 py-3 text-gray-600 text-xs"},Se={key:1},Ne={class:"px-3 py-3"},Ee={class:"px-3 py-3 text-right whitespace-nowrap"},Ve=["onClick"],Me=["disabled","onClick"],Ke={key:0},Oe={class:"flex items-center justify-between"},De={class:"flex gap-2"},Le=["onClick"],_e={class:"grid grid-cols-2 gap-3 text-sm"},Be={class:"col-span-2"},$e={class:"col-span-2"},Ge={class:"col-span-2"},we={class:"col-span-2"},he={class:"flex gap-2 items-center"},je={class:"flex gap-2 items-center"},ze={class:"col-span-2 text-xs text-gray-500"},Fe={class:"col-span-2"},qe={class:"col-span-2 text-xs text-gray-500"},He={class:"col-span-2"},Ye={class:"flex justify-end gap-2 pt-2"},We=["disabled"],Je={class:"text-xs text-gray-500 flex flex-wrap gap-2 items-center"},Qe={class:"px-2 py-0.5 rounded bg-gray-100 text-gray-700"},Xe={class:"font-mono"},Ze={class:"grid grid-cols-2 gap-3 text-sm"},et={class:"col-span-2"},tt={class:"col-span-2"},nt={class:"col-span-2"},st={class:"col-span-2"},lt={class:"flex gap-2 items-center"},rt={class:"flex gap-2 items-center"},ot={class:"col-span-2 text-xs text-gray-500"},at={class:"col-span-2"},ut={class:"col-span-2 text-xs text-gray-500"},it={class:"col-span-2"},dt={class:"flex justify-end gap-2 pt-2"},pt=["disabled"],ct=te({__name:"skus",setup(mt){ne({title:"定价 SKU - 管理后台"});const T=x([]),A=x(!0),S=x(""),N=x(""),y=x(""),E=x("ALL"),k=x(!1),V=x(!1),D=x(!1),b=x(null),M=x(!1),K=x(null),L=x(!1),_=x(!1),r=z({skuKind:"TRIAL",code:"",name:"",status:"ACTIVE",description:"",sortOrder:100,trialDays:30,concurrency:5,tokenGrant:1e5,tokenPerConcurrency:2e4,minConcurrency:1,maxConcurrency:100,minMonths:1,maxMonths:36,listPrice:330,discountRate:1}),o=z({name:"",status:"ACTIVE",trialDays:30,concurrency:5,tokenGrant:1e5,tokenPerConcurrency:2e4,minConcurrency:1,maxConcurrency:100,minMonths:1,maxMonths:36,listPrice:0,discountRate:1,priceYearly:0,priceMonthly:0,priceOneTime:0,description:""}),$=se(()=>E.value==="ALL"?T.value:T.value.filter(s=>(s.sku_kind||c(s))===E.value));function c(s){return s.sku_kind?s.sku_kind:s.type==="TRIAL"||s.code?.includes("trial")?"TRIAL":s.type==="ADDON"||s.code?.includes("token")?"TOKEN_PACK":"SUBSCRIPTION"}function O(s){return s==="TRIAL"?"试用":s==="TOKEN_PACK"?"Token 包":s==="SUBSCRIPTION"?"订阅":s||"-"}function F(s){return s==="ACTIVE"?"启用":s==="INACTIVE"?"停用":s==="DEPRECATED"?"已下架":s||"-"}function q(s){L.value=s.target===s.currentTarget}function H(s){L.value&&s.target===s.currentTarget&&(k.value=!1),L.value=!1}function Y(s){_.value=s.target===s.currentTarget}function W(s){_.value&&s.target===s.currentTarget&&I(),_.value=!1}async function P(){A.value=!0,S.value="",N.value="";try{const s=await $fetch("/api/admin/ops/skus",{credentials:"include"});T.value=s?.data?.list||[];const e=T.value.filter(v=>(v.sku_kind||c(v))==="TRIAL"&&String(v.status||"").toUpperCase()==="ACTIVE"),n=T.value.filter(v=>(v.sku_kind||c(v))==="SUBSCRIPTION"&&String(v.status||"").toUpperCase()==="ACTIVE"),f=[];e.length>1?f.push(`存在 ${e.length} 个启用中的试用 SKU,请只保留一个 ACTIVE(首次激活按 kind 取这一个,不依赖固定编码)`):e.length===0&&f.push("尚未启用试用 SKU:请添加并启用一个试用,否则私有化首次手机号激活会失败"),n.length>1&&f.push(`存在 ${n.length} 个启用中的订阅 SKU,请只保留一个 ACTIVE(买家下单页只取这一个)`),f.length&&(N.value=f.join(";"))}catch(s){S.value=s?.data?.message||"加载失败"}finally{A.value=!1}}le(P);
1function G(s="TRIAL"){r.skuKind=s,r.code="",r.name=s==="TRIAL"?"私有化试用":s==="TOKEN_PACK"?"Token 包":"私有化订阅",r.status="ACTIVE",r.description=s==="TOKEN_PACK"?"Token 包购买后永久有效,用尽为止;能否使用系统由有效订阅决定":s==="SUBSCRIPTION"?"订阅按 元/并发/月 计价;下单选并发与月数":"",r.sortOrder=s==="TRIAL"?5:s==="TOKEN_PACK"?40:20,r.trialDays=30,r.concurrency=5,r.tokenGrant=1e5,r.tokenPerConcurrency=2e4,r.minConcurrency=1,r.maxConcurrency=100,r.minMonths=1,r.maxMonths=36,r.listPrice=s==="TOKEN_PACK"?99:s==="TRIAL"?0:330,r.discountRate=1,k.value=!0,y.value=""}async function J(){V.value=!0,y.value="";try{const s={skuKind:r.skuKind,code:r.code.trim()||void 0,name:r.name.trim(),status:r.status,description:r.description||void 0,sortOrder:r.sortOrder,discountRate:Number(r.discountRate)||1};r.skuKind==="TRIAL"?(s.trialDays=Number(r.trialDays),s.concurrency=Number(r.concurrency),s.tokenGrant=Number(r.tokenGrant),s.listPrice=0):r.skuKind==="SUBSCRIPTION"?(s.listPrice=Number(r.listPrice),s.tokenPerConcurrency=Number(r.tokenPerConcurrency),s.minConcurrency=Number(r.minConcurrency)||1,s.maxConcurrency=Number(r.maxConcurrency)||100,s.minMonths=Number(r.minMonths)||1,s.maxMonths=Number(r.maxMonths)||36):(s.tokenGrant=Number(r.tokenGrant),s.listPrice=Number(r.listPrice));const e=await $fetch("/api/admin/ops/skus",{method:"POST",credentials:"include",body:s});if(e?.code&&e.code!==0){y.value=e.message||"创建失败";return}y.value=`已创建 ${e?.data?.code||""}`,k.value=!1,await P()}catch(s){y.value=s?.data?.message||s?.message||"创建失败"}finally{V.value=!1}}function Q(s){b.value=s,o.name=s.name||"",o.status=s.status||"ACTIVE",o.trialDays=s.trial_days??null,o.concurrency=s.concurrency??s.user_limit??null,o.tokenGrant=s.token_grant??s.monthly_ai_quota??null,o.tokenPerConcurrency=s.token_per_concurrency??null,o.minConcurrency=s.min_concurrency??1,o.maxConcurrency=s.max_concurrency??100,o.minMonths=s.min_months??1,o.maxMonths=s.max_months??36,o.listPrice=s.list_price??null,o.discountRate=s.discount_rate??1,o.priceYearly=s.price_yearly??null,o.priceMonthly=s.price_monthly??null,o.priceOneTime=s.price_one_time??null,o.description=s.description||"",y.value="",D.value=!0}function I(){D.value=!1,b.value=null}function w(){const s=Number(o.listPrice)||0,e=Number(o.discountRate)||1,n=Math.round(s*e*100)/100;return b.value&&c(b.value)==="SUBSCRIPTION"?`${n}(1并发·1月);例 2×2月 = ¥${Math.round(n*4*100)/100}`:String(n)}async function X(){const s=b.value;if(s){M.value=!0,y.value="";try{const e={name:o.name.trim(),status:o.status,description:o.description,listPrice:o.listPrice,discountRate:o.discountRate};c(s)==="TRIAL"?(e.trialDays=o.trialDays,e.concurrency=o.concurrency,e.tokenGrant=o.tokenGrant):c(s)==="SUBSCRIPTION"?(e.tokenPerConcurrency=o.tokenPerConcurrency,e.minConcurrency=o.minConcurrency,e.maxConcurrency=o.maxConcurrency,e.minMonths=o.minMonths,e.maxMonths=o.maxMonths):(e.tokenGrant=o.tokenGrant,e.priceOneTime=o.priceOneTime);const n=await $fetch(`/api/admin/ops/skus/${s.id}`,{method:"PUT",credentials:"include",body:e});if(n?.code&&n.code!==0){y.value=n.message||"保存失败";return}y.value=`已更新 ${s.code||s.id}`,I(),await P()}catch(e){y.value=e?.data?.message||"保存失败"}finally{M.value=!1}}}async function Z(s){if(confirm(`确认删除「${s.name||s.code||s.id}」?
2若已被订单/订阅引用,将改为下架而非物理删除。`)){K.value=s.id,y.value="";try{const e=await $fetch(`/api/admin/ops/skus/${s.id}`,{method:"DELETE",credentials:"include"});if(e?.code&&e.code!==0){y.value=e.message||"删除失败";return}const n=e?.data||e;n?.softDeprecated?y.value=n.message||`已下架 ${s.code||s.name||s.id}(存在历史引用)`:y.value=`已删除 ${s.code||s.name||s.id}`,b.value?.id===s.id&&I(),await P()}catch(e){y.value=e?.data?.message||e?.message||"删除失败"}finally{K.value=null}}}function U(s){return s==null||s===""?"-":"¥"+Number(s).toLocaleString("zh-CN")}function ee(s){if(s==null)return"-";const e=Number(s);return e>=1?"无":(e*10).toFixed(1).replace(/\.0$/,"")+" 折"}function h(){const s=Number(r.listPrice)||0,e=Number(r.discountRate)||1,n=Math.round(s*e*100)/100;return r.skuKind==="SUBSCRIPTION"?`${n}(1并发·1月);例 2×2月 = ¥${Math.round(n*4*100)/100}`:String(n)}return(s,e)=>(d(),a("div",oe,[t("div",ae,[e[37]||(e[37]=t("div",null,[t("h2",{class:"text-base font-semibold text-gray-900"},"定价 SKU"),t("p",{class:"text-xs text-gray-400 mt-0.5"}," 试用 / 订阅(元·并发·月)/ Token 包(永久)。试用与订阅各自同时只能有一个 ACTIVE(按 kind 取用,无需固定编码);Token 包可多个。 ")],-1)),t("div",ue,[t("button",{class:"px-3 py-1.5 rounded-lg bg-blue-600 text-white text-sm font-medium hover:bg-blue-700",onClick:e[0]||(e[0]=n=>G("TRIAL"))}," + 添加 SKU "),t("button",{class:"px-3 py-1.5 rounded-lg border border-gray-200 text-sm text-gray-600 hover:bg-gray-50",disabled:l(A),onClick:P}," 刷新 ",8,ie)])]),t("div",de,[(d(),a(m,null,B(["ALL","TRIAL","SUBSCRIPTION","TOKEN_PACK"],n=>t("button",{key:n,class:R(["px-3 py-1 rounded-full border text-xs",l(E)===n?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-200 text-gray-500"]),onClick:f=>E.value=n},u(n==="ALL"?"全部":O(n)),11,pe)),64))]),l(y)?(d(),a("p",me,u(l(y)),1)):C("",!0),l(N)?(d(),a("div",ye,u(l(N)),1)):C("",!0),l(A)?(d(),a("div",ce,"加载中...")):l(S)?(d(),a("div",xe,u(l(S)),1)):(d(),a("div",be,[t("table",ge,[e[39]||(e[39]=t("thead",{class:"bg-gray-50 text-xs text-gray-500 uppercase"},[t("tr",null,[t("th",{class:"text-left font-medium px-3 py-3"},"类型"),t("th",{class:"text-left font-medium px-3 py-3"},"编码 / 名称"),t("th",{class:"text-left font-medium px-3 py-3"},"期限 / 范围"),t("th",{class:"text-left font-medium px-3 py-3"},"并发"),t("th",{class:"text-left font-medium px-3 py-3"},"Token"),t("th",{class:"text-left font-medium px-3 py-3"},"单价 / 折扣"),t("th",{class:"text-left font-medium px-3 py-3"},"参考价"),t("th",{class:"text-left font-medium px-3 py-3"},"状态"),t("th",{class:"text-right font-medium px-3 py-3"},"操作")])],-1)),t("tbody",fe,[(d(!0),a(m,null,B(l($),n=>(d(),a("tr",{key:n.id,class:R(["align-top",n.status==="DEPRECATED"?"bg-gray-50/80 text-gray-400":""])},[t("td",ve,[t("span",ke,u(O(c(n))),1)]),t("td",Ce,[t("div",Te,u(n.code),1),t("div",{class:R(n.status==="DEPRECATED"?"text-gray-400":"text-gray-900")},u(n.name),3)]),t("td",Pe,[c(n)==="TRIAL"?(d(),a(m,{key:0},[g(u(n.trial_days??"-")+" 天",1)],64)):c(n)==="SUBSCRIPTION"?(d(),a(m,{key:1},[g(u(n.min_months??1)+"–"+u(n.max_months??36)+" 月 ",1)],64)):(d(),a(m,{key:2},[g("永久")],64))]),t("td",Ie,[c(n)==="SUBSCRIPTION"?(d(),a(m,{key:0}
2,[g(u(n.min_concurrency??1)+"–"+u(n.max_concurrency??100),1)],64)):(d(),a(m,{key:1},[g(u(n.concurrency??n.user_limit??"-"),1)],64))]),t("td",Ue,[c(n)==="SUBSCRIPTION"?(d(),a(m,{key:0},[g(u(n.token_per_concurrency??"-")+" / 并发 ",1)],64)):(d(),a(m,{key:1},[g(u(n.token_grant??n.monthly_ai_quota??"-"),1)],64))]),t("td",Re,[t("div",null,[c(n)==="SUBSCRIPTION"?(d(),a(m,{key:0},[g(u(U(n.list_price))+"/并发/月",1)],64)):(d(),a(m,{key:1},[g(u(U(n.list_price??n.price_one_time)),1)],64))]),t("div",null,u(ee(n.discount_rate)),1)]),t("td",Ae,[c(n)==="SUBSCRIPTION"?(d(),a(m,{key:0},[t("div",null,"1×1月 "+u(U(n.price_monthly)),1),t("div",null,"1×12月 "+u(U(n.price_yearly)),1)],64)):c(n)==="TOKEN_PACK"?(d(),a("div",Se,"一次 "+u(U(n.price_one_time)),1)):(d(),a(m,{key:2},[g("-")],64))]),t("td",Ne,[t("span",{class:R(n.status==="ACTIVE"?"text-emerald-600":n.status==="DEPRECATED"?"text-gray-400":"text-gray-500")},u(F(n.status)),3)]),t("td",Ee,[n.status!=="DEPRECATED"?(d(),a("button",{key:0,class:"text-xs text-blue-600 hover:underline mr-2",onClick:f=>Q(n)},"编辑",8,Ve)):C("",!0),t("button",{class:"text-xs text-rose-500 hover:underline disabled:opacity-50",disabled:l(K)===n.id,onClick:f=>Z(n)},u(l(K)===n.id?"…":"删除"),9,Me)])],2))),128)),l($).length?C("",!0):(d(),a("tr",Ke,[...e[38]||(e[38]=[t("td",{colspan:"9",class:"px-4 py-10 text-center text-sm text-gray-400"},"暂无套餐,点击「添加 SKU」",-1)])]))])])])),l(k)?(d(),a("div",{key:5,class:"fixed inset-0 z-40 flex items-center justify-center bg-black/30 p-4",onMousedown:q,onMouseup:H},[t("div",{class:"bg-white rounded-xl shadow-xl w-full max-w-lg max-h-[90vh] overflow-y-auto p-5 space-y-4",onMousedown:e[19]||(e[19]=j(()=>{},["stop"]))},[t("div",Oe,[e[40]||(e[40]=t("h3",{class:"text-sm font-semibold text-gray-900"},"添加定价 SKU",-1)),t("button",{class:"text-gray-400 text-sm",onClick:e[1]||(e[1]=n=>k.value=!1)},"关闭")]),t("div",null,[e[41]||(e[41]=t("label",{class:"block text-xs text-gray-500 mb-1"},"类型",-1)),t("div",De,[(d(),a(m,null,B(["TRIAL","SUBSCRIPTION","TOKEN_PACK"],n=>t("button",{key:n,type:"button",class:R(["flex-1 px-2 py-2 rounded-lg border text-xs",l(r).skuKind===n?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-200"]),onClick:f=>G(n)},u(O(n)),11,Le)),64))])]),t("div",_e,[t("div",Be,[e[42]||(e[42]=t("label",{class:"block text-xs text-gray-500 mb-1"},"名称",-1)),i(t("input",{"onUpdate:modelValue":e[2]||(e[2]=n=>l(r).name=n),class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(r).name]])]),t("div",$e,[e[43]||(e[43]=t("label",{class:"block text-xs text-gray-500 mb-1"},"编码(可空自动生成)",-1)),i(t("input",{"onUpdate:modelValue":e[3]||(e[3]=n=>l(r).code=n),class:"w-full rounded-lg border border-gray-200 px-3 py-2 font-mono text-xs",placeholder:"selfhosted-..."},null,512),[[p,l(r).code]])]),l(r).skuKind==="TRIAL"?(d(),a(m,{key:0},[t("div",null,[e[44]||(e[44]=t("label",{class:"block text-xs text-gray-500 mb-1"},"试用天数",-1)),i(t("input",{"onUpdate:modelValue":e[4]||(e[4]=n=>l(r).trialDays=n),type:"number",min:"1",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(r).trialDays,void 0,{number:!0}]])]),t("div",null,[e[45]||(e[45]=t("label",{class:"block text-xs text-gray-500 mb-1"},"并发",-1)),i(t("input",{"onUpdate:modelValue":e[5]||(e[5]=n=>l(r).concurrency=n),type:"number",min:"1",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(r).concurrency,void 0,{number:!0}]])]),t("div",Ge,[e[46]||(e[46]=t("label",{class:"block text-xs text-gray-500 mb-1"},"Token",-1)),i(t("input",{"onUpdate:modelValue":e[6]||(e[6]=n=>l(r).tokenGrant=n),type:"number",min:"0",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(r).tokenGrant,void 0,{number:!0}]])])],64)):l(r).skuKind==="SUBSCRIPTION"?(d(),a(m,{key:1},[t("div",we,[e[47]||(e[47]=t("label",{class:"block text-xs text-gray-500 mb-1"},"单价(元 / 并发 / 月)",-1)),i(t("input",{"onUpdate:modelValue":e[7]||(e[7]=n=>l(r).listPrice=n),type:"number",min:"0.01",step:"0.01",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(r).listPrice,void 0,{number:!0}]])]),t("div",null,[e[48]||(e[48]=t("label",{class:"block text-xs text-gray-500 mb-1"},"折扣率(1=无折)",-1)),i(t("input",{"onUpdate:modelValue":e[8]||(e[8]=n=>l(r).discountRate=n),type:"number",step:"0.01",min:"0.01",max:"1",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(r).discountRate,void 0,{number:!0}]])]),t("div",null,[e[49]||(e[49]=t("label",{class:"block text-xs text-gray-500 mb-1"},"每并发 Token",-1)),i(t("input",{"onUpdate:modelValue":e[9]||(e[9]=n=>l(r).tokenPerConcurrency=n),type:"number",min:"0",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(r).tokenPerConcurrency,void 0,{number:!0}]])]),t("div",null,[e[51]||(e[51]=t("label",{class:"block text-xs text-gray-500 mb-1"},"并发范围",-1)),t("div",he,[i(t("input",{"onUpdate:modelValue":e[10]||(e[10]=n=>l(r).minConcurrency=n),type:"number",min:"1",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(r).minConcurrency,void 0,{number:!0}]]),e[50]||(e[50]=t("span",{class:"text-gray-400"},"~",-1)),i(t("input",{"onUpdate:modelValue":e[11]||(e[11]=n=>l(r).maxConcurrency=n),type:"number",min:"1",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(r).maxConcurrency,void 0,{number:!0}]])])]),t("div",null,[e[53]||(e[53]=t("label",{class:"block text-xs text-gray-500 mb-1"},"月数范围",-1)),t("div",je,[i(t("input",{"onUpdate:modelValue":e[12]||(e[12]=n=>l(r).minMonths=n),type:"number",min:"1",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(r).minMonths,void 0,{number:!0}]]),e[52]||(e[52]=t("span",{class:"text-gray-400"},"~",-1)),i(t("input",{"onUpdate:modelValue":e[13]||(e[13]=n=>l(r).maxMonths=n),type:"number",min:"1",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(r).maxMonths,void 0,{number:!0}]])])]),t("p",ze,"预览:¥"+u(h())+"(按并发×月)",1)],64)):(d(),a(m,{key:2},[t("div",Fe,[e[54]||(e[54]=t("label",{class:"block text-xs text-gray-500 mb-1"},"Token 数量",-1)),i(t("input",{"onUpdate:modelValue":e[14]||(e[14]=n=>l(r).tokenGrant=n),type:"number",min:"1",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(r).tokenGrant,void 0,{number:!0}]])]),t("div",null,[e[55]||(e[55]=t("label",{class:"block text-xs text-gray-500 mb-1"},"标价",-1)),i(t("input",{"onUpdate:modelValue":e[15]||(e[15]=n=>l(r).listPrice=n),type:"number",min:"0",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(r).listPrice,void 0,{number:!0}]])]),t("div",null,[e[56]||(e[56]=t("label",{class:"block text-xs text-gray-500 mb-1"},"折扣率",-1)),i(t("input",{"onUpdate:modelValue":e[16]||(e[16]=n=>l(r).discountRate=n),type:"number",step:"0.01",min:"0.01",max:"1",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(r).discountRate,void 0,{number:!0}]])]),t("p",qe," 购买后永久有效 · 成交价 ¥"+u(h()),1)],64)),t("div",He,[e[57]||(e[57]=t("label",{class:"block text-xs text-gray-500 mb-1"},"说明",-1)),i(t("textarea",{"onUpdate:modelValue":e[17]||(e[17]=n=>l(r).description=n),rows:"2",class:"w-full rounded-lg border border-gray-200 px-3 py-2 text-sm"},null,512),[[p,l(r).description]])])]),t("div",Ye,[t("button",{class:"px-3 py-2 text-sm text-gray-500",onClick:e[18]||(e[18]=n=>k.value=!1)},"取消"),t("button",{class:"px-4 py-2 rounded-lg bg-blue-600 text-white text-sm font-medium disabled:opacity-50",disabled:l(V),onClick:J},u(l(V)?"创建中…":"创建"),9,We)])],32)],32)):C("",!0),l(D)&&l(b)?(d(),a("div",{key:6,class:"fixed inset-0 z-40 flex items-center justify-center bg-black/30 p-4",onMousedown:Y,onMouseup:W},[t("div",{class:"bg-white rounded-xl shadow-xl w-full max-w-lg max-h-[90vh] overflow-y-auto p-5 space-y-4",onMousedown:e[36]||(e[36]=j(()=>{},["stop"]))},[t("div",{class:"flex items-center justify-between"},[e[58]||(e[58]=t("h3",{class:"text-sm font-semibold text-gray-900"},"编辑定价 SKU",-1)),t("button",{class:"text-gray-400 text-sm",onClick:I},"关闭")]),t("div",Je,[t("span",Qe,u(O(c(l(b)))),1),t("span",Xe,u(l(b).code),1)]),t("div",Ze,[t("div",et,[e[59]||(e[59]=t("label",{class:"block text-xs text-gray-500 mb-1"},"名称",-1)),i(t("input",{"onUpdate:modelValue":e[20]||(e[20]=n=>l(o).name=n),class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(o).name]])]),t("div",tt,[e[61]||(e[61]=t("label",{class:"block text-xs text-gray-500 mb-1"},"状态",-1)),i(t("select",{"onUpdate:modelValue":e[21]||(e[21]=n=>l(o).status=n),class:"w-full rounded-lg border border-gray-200 px-3 py-2"},[...e[60]||(e[60]=[t("option",{value:"ACTIVE"},"启用",-1),t("option",{value:"INACTIVE"},"停用",-1),t("option",{value:"DEPRECATED"},"已下架",-1)])],512),[[re,l(o).status]])]),c(l(b))==="TRIAL"?(d(),a(m,{key:0},[t("div",null,[e[62]||(e[62]=t("label",{class:"block text-xs text-gray-500 mb-1"},"试用天数",-1)),i(t("input",{"onUpdate:modelValue":e[22]||(e[22]=n=>l(o).trialDays=n),type:"number",min:"1",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(o).trialDays,void 0,{number:!0}]])]),t("div",null,[e[63]||(e[63]=t("label",{class:"block text-xs text-gray-500 mb-1"},"并发",-1)),i(t("input",{"onUpdate:modelValue":e[23]||(e[23]=n=>l(o).concurrency=n),type:"number",min:"1",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(o).concurrency,void 0,{number:!0}]])]),t("div",nt,[e[64]||(e[64]=t("label",{class:"block text-xs text-gray-500 mb-1"},"Token",-1)),i(t("input",{"onUpdate:modelValue":e[24]||(e[24]=n=>l(o).tokenGrant=n),type:"number",min:"0",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(o).tokenGrant,void 0,{number:!0}]])])],64)):c(l(b))==="SUBSCRIPTION"?(d(),a(m,{key:1},[t("div",st,[e[65]||(e[65]=t("label",{class:"block text-xs text-gray-500 mb-1"},"单价(元 / 并发 / 月)",-1)),i(t("input",{"onUpdate:modelValue":e[25]||(e[25]=n=>l(o).listPrice=n),type:"number",min:"0.01",step:"0.01",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(o).listPrice,void 0,{number:!0}]])]),t("div",null,[e[66]||(e[66]=t("label",{class:"block text-xs text-gray-500 mb-1"},"折扣率(1=无折)",-1)),i(t("input",{"onUpdate:modelValue":e[26]||(e[26]=n=>l(o).discountRate=n),type:"number",step:"0.01",min:"0.01",max:"1",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(o).discountRate,void 0,{number:!0}]])]),t("div",null,[e[67]||(e[67]=t("label",{class:"block text-xs text-gray-500 mb-1"},"每并发 Token",-1)),i(t("input",{"onUpdate:modelValue":e[27]||(e[27]=n=>l(o).tokenPerConcurrency=n),type:"number",min:"0",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(o).tokenPerConcurrency,void 0,{number:!0}]])]),t("div",null,[e[69]||(e[69]=t("label",{class:"block text-xs text-gray-500 mb-1"},"并发范围",-1)),t("div",lt,[i(t("input",{"onUpdate:modelValue":e[28]||(e[28]=n=>l(o).minConcurrency=n),type:"number",min:"1",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(o).minConcurrency,void 0,{number:!0}]]),e[68]||(e[68]=t("span",{class:"text-gray-400"},"~",-1)),i(t("input",{"onUpdate:modelValue":e[29]||(e[29]=n=>l(o).maxConcurrency=n),type:"number",min:"1",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(o).maxConcurrency,void 0,{number:!0}]])])]),t("div",null,[e[71]||(e[71]=t("label",{class:"block text-xs text-gray-500 mb-1"},"月数范围",-1)),t("div",rt,[i(t("input",{"onUpdate:modelValue":e[30]||(e[30]=n=>l(o).minMonths=n),type:"number",min:"1",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(o).minMonths,void 0,{number:!0}]]),e[70]||(e[70]=t("span",{class:"text-gray-400"},"~",-1)),i(t("input",{"onUpdate:modelValue":e[31]||(e[31]=n=>l(o).maxMonths=n),type:"number",min:"1",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(o).maxMonths,void 0,{number:!0}]])])]),t("p",ot,"预览:¥"+u(w())+"(按并发×月)",1)],64)):(d(),a(m,{key:2},[t("div",at,[e[72]||(e[72]=t("label",{class:"block text-xs text-gray-500 mb-1"},"Token 数量",-1)),i(t("input",{"onUpdate:modelValue":e[32]||(e[32]=n=>l(o).tokenGrant=n),type:"number",min:"1",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(o).tokenGrant,void 0,{number:!0}]])]),t("div",null,[e[73]||(e[73]=t("label",{class:"block text-xs text-gray-500 mb-1"},"标价",-1)),i(t("input",{"onUpdate:modelValue":e[33]||(e[33]=n=>l(o).listPrice=n),type:"number",min:"0",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(o).listPrice,void 0,{number:!0}]])]),t("div",null,[e[74]||(e[74]=t("label",{class:"block text-xs text-gray-500 mb-1"},"折扣率",-1)),i(t("input",{"onUpdate:modelValue":e[34]||(e[34]=n=>l(o).discountRate=n),type:"number",step:"0.01",min:"0.01",max:"1",class:"w-full rounded-lg border border-gray-200 px-3 py-2"},null,512),[[p,l(o).discountRate,void 0,{number:!0}]])]),t("p",ut," 购买后永久有效 · 成交价 ¥"+u(w()),1)],64)),t("div",it,[e[75]||(e[75]=t("label",{class:"block text-xs text-gray-500 mb-1"},"说明",-1)),i(t("textarea",{"onUpdate:modelValue":e[35]||(e[35]=n=>l(o).description=n),rows:"2",class:"w-full rounded-lg border border-gray-200 px-3 py-2 text-sm"},null,512),[[p,l(o).description]])])]),t("div",dt,[t("button",{class:"px-3 py-2 text-sm text-gray-500",onClick:I},"取消"),t("button",{class:"px-4 py-2 rounded-lg bg-blue-600 text-white text-sm font-medium disabled:opacity-50",disabled:l(M),onClick:X},u(l(M)?"保存中…":"保存"),9,pt)])],32)],32)):C("",!0)]))}});
2export{ct as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.