2025-12-23 14:05:04 +08:00
var g = ( C , M , r ) => new Promise ( ( U , p ) => { var E = S => { try { T ( r . next ( S ) ) } catch ( O ) { p ( O ) } } , c = S => { try { T ( r . throw ( S ) ) } catch ( O ) { p ( O ) } } , T = S => S . done ? U ( S . value ) : Promise . resolve ( S . value ) . then ( E , c ) ; T ( ( r = r . apply ( C , M ) ) . next ( ) ) } ) ; import { bD as H , bi as Z , an as I , aL as w , ay as L , ac as $ } from "./bootstrap-DsjPfOC_.js" ; import { m as ee , b9 as B , aa as v , w as Y , v as te , n as F , cd as se , ad as A , b2 as m , ae as n , j as _ , u as l , aR as h , bJ as f , bp as u , I as ae , bb as ne , ai as R , ab as re , ac as k } from "../jse/index-index-CO0ZsLf2.js" ; import { J as s , y as a , z as d , b as o , A as N } from "./constants-B5TthjFC.js" ; const le = { class : "w-full space-y-3" } , oe = { class : "relative" } , ce = { class : "absolute right-2 top-2" } , ie = { class : "json-params-detail-content" } , ue = { class : "mb-4 flex items-center gap-2" } , Ee = { class : "text-base font-bold text-primary" } , de = { class : "space-y-4" } , pe = { key : 0 } , Te = { class : "mb-2 flex items-center gap-2" } , _e = { class : "text-base font-bold text-primary" } , Se = { class : "ml-6 space-y-2" } , me = { class : "flex-1" } , fe = { class : "text-base font-bold text-primary" } , Re = { class : "text-xs text-secondary" } , ve = { class : "flex items-center gap-2" } , Ae = { class : "text-xs text-secondary" } , Oe = { class : "ml-6 mt-3" } , ye = { class : "mb-1 text-xs text-secondary" } , xe = { class : "border-l-3px overflow-x-auto rounded-lg border-primary bg-card p-3 text-sm text-primary" } , Pe = { key : 1 } , Ce = { class : "py-4 text-center" } , Ie = { class : "text-sm text-secondary" } , Ne = { class : "flex items-center justify-between" } , Me = { class : "flex items-center gap-2" } , ge = { key : 0 , class : "flex items-center gap-2" } , Le = { class : "text-xs text-secondary" } , he = ee ( { name : "JsonParamsInput" , _ _name : "json-params-input" , props : { modelValue : { } , config : { } , type : { default : a . SERVICE } , placeholder : { default : s . PLACEHOLDER } } , emits : [ "update:modelValue" ] , setup ( C , { emit : M } ) { const r = C , p = se ( r , "modelValue" , M , { defaultValue : "" } ) , E = B ( "" ) , c = B ( "" ) , T = v ( ( ) => { var e , t , i , y , x , P , J ; switch ( r . type ) { case a . CUSTOM : return ( ( t = ( e = r . config ) == null ? void 0 : e . custom ) == null ? void 0 : t . params ) || [ ] ; case a . EVENT : return ( ( y = ( i = r . config ) == null ? void 0 : i . event ) == null ? void 0 : y . outputParams ) || [ ] ; case a . PROPERTY : return ( ( x = r . config ) == null ? void 0 : x . properties ) || [ ] ; case a . SERVICE : return ( ( J = ( P = r . config ) == null ? void 0 : P . service ) == null ? void 0 : J . inputParams ) || [ ] ; default : return [ ] } } ) , S = v ( ( ) => { var e , t , i , y , x , P ; switch ( r . type ) { case a . CUSTOM : return s . TITLES . CUSTOM ( ( t = ( e = r . config ) == null ? void 0 : e . custom ) == null ? void 0 : t . name ) ; case a . EVENT : return s . TITLES . EVENT ( ( y = ( i = r . config ) == null ? void 0 : i . event ) == null ? void 0 : y . name ) ; case a . PROPERTY : return s . TITLES . PROPERTY ; case a . SERVICE : return s . TITLES . SERVICE ( ( P = ( x = r . config ) == null ? void 0 : x . service ) == null ? void 0 : P . name ) ; default : return s . TITLES . DEFAULT } } ) , O = v ( ( ) => { switch ( r . type ) { case a . CUSTOM : return d . TITLE _ICONS . CUSTOM ; case a . EVENT : return d . TITLE _ICONS . EVENT ; case a . PROPERTY : return d . TITLE _ICONS . PROPERTY ; case a . SERVICE : return d . TITLE _ICONS . SERVICE ; default : return d . TITLE _ICONS . DEFAULT } } ) , j = v ( ( ) => { switch ( r . type ) { case a . CUSTOM : return d . PARAMS _ICONS . CUSTOM ; case a . EVENT : return d . PARAMS _ICONS . EVENT ; case a . PROPERTY : return d . PARAMS _ICONS . PROPERTY ; case a . SERVICE : return d . PARAMS _ICONS . SERVICE ; default : return d . PARAMS _ICONS . DEFAULT } } ) , z = v ( ( ) => { switch ( r . type ) { case a . CUSTOM : return s . PARAMS _LABELS . CUSTOM ; case a . EVENT : return s . PARAMS _LABELS . EVENT ; case a . PROPERTY : return s . PARAMS _LABELS . PROPERTY ; case a . SERVICE : return s . PARAMS _LABELS . SERVICE ; default : return s . PARAMS _LABELS . DEFAULT } } ) , G = v ( ( ) => { switch ( r . type ) { case a . CUSTOM : return s . EMPTY _MESSAGES . CUSTOM ; case a . EVENT : return s . EMPTY _MESSAGES . EVENT ; case a . PROPERTY : return s . EMPTY _MESSAGES . PROPERTY ; case a . SERVICE : return s . EMPTY _MESSAGES . SERVICE ; default : return s . EMPTY _MESSAGES . DEFAULT } } ) ; function V ( ) { try { if ( c . value = "" , E . value . trim ( ) ) { const e = JSON . parse ( E . value ) ; if ( p . value = E . value , typeof e != "object" || e === null ) { c . value = s . PARAMS _MUST _BE _OBJECT ; return } for ( const t of T . value ) if ( t . required && ( ! e [ t . identifier ] || e [ t . identifier ] === "" ) ) { c . value = s . PARAM _REQUIRED _ERROR ( t . name ) ; return } } else p . value = "" ; c . value = "" } catch ( e ) { c . value = s . JSON _FORMAT _ERROR ( e instanceof Error ? e . message : s . UNKNOWN _ERROR ) } } function X ( ) { E . value = b ( ) , V ( ) } function Q ( ) { E . value = "" , p . value = "" , c . value = "" } function q ( e ) { return { [ o . INT ] : "整数" , [ o . FLOAT ] : " 浮点 <EFBFBD> <EFBFBD>
2025-12-23 13:56:38 +08:00
` ,-1))])])])):(m(),A("div",Pe,[n("div",Ce,[n("p",Ie,u(G.value),1)])]))])])]),_:1})])]),n("div",Ne,[n("div",Me,[_(l(I),{icon:c.value?l(d).STATUS_ICONS.ERROR:l(d).STATUS_ICONS.SUCCESS,class:h([c.value?"text-danger":"text-success","text-sm"])},null,8,["icon","class"]),n("span",{class:h([c.value?"text-danger":"text-success","text-xs"])},u(c.value||l(s).JSON_FORMAT_CORRECT),3)]),T.value.length>0?(m(),A("div",ge,[n("span",Le,u(l(s).QUICK_FILL_LABEL),1),_(l(L),{size:"small",type:"primary",plain:"",onClick:X},{default:f(()=>[R(u(l(s).EXAMPLE_DATA_BUTTON),1)]),_:1}),_(l(L),{size:"small",danger:"",type:"primary",onClick:Q},{default:f(()=>[R(u(l(s).CLEAR_BUTTON),1)]),_:1})])):k("",!0)])]))}}),Je= $ (he,[["__scopeId","data-v-163e387c"]]);export{Je as default};