Files
yusheng-admin/dist/static/js/hook-nxxl-JO8.js
2025-10-23 11:07:17 +08:00

2 lines
1.5 KiB
JavaScript

var w=Object.defineProperty,S=Object.defineProperties;var b=Object.getOwnPropertyDescriptors;var m=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var d=(t,e,a)=>e in t?w(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,C=(t,e)=>{for(var a in e||(e={}))I.call(e,a)&&d(t,a,e[a]);if(m)for(var a of m(e))D.call(e,a)&&d(t,a,e[a]);return t},h=(t,e)=>S(t,b(e));var l=(t,e,a)=>new Promise((r,f)=>{var g=o=>{try{c(a.next(o))}catch(u){f(u)}},v=o=>{try{c(a.throw(o))}catch(u){f(u)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(g,v);c((a=a.apply(t,e)).next())});import{n as i,fI as L,aA as k}from"./index-CRmU-Qpi.js";import{j as x,k as E,S as _}from"./system-CqYheEHE.js";function M(){i();const t=i({}),e=i(!0),a=i(0),r=i([]),f=i([]),g=i(!1),v=()=>l(this,null,function*(){e.value=!0;const{data:n,code:s}=yield x({});s&&(r.value=n,a.value=n[0].id,c(a.value)),e.value=!1}),c=n=>l(this,null,function*(){const{data:s,code:y}=yield E({type:n});y&&(f.value=y?s:[],s&&s.length&&s.forEach(p=>{t.value[p.key_title]=p.key_value}))});return{onSearch:v,isShow:g,tableList:r,loading:e,activeId:a,formLabel:f,formData:t,tabClick:n=>{const{name:s}=n.props;c(s)},saveConfig:()=>l(this,null,function*(){L.confirm("该操作将覆盖之前的数据,是否继续?","提示",{type:"warning"}).then(()=>l(this,null,function*(){const{code:n,msg:s}=yield _(h(C({},t.value),{type:a.value}));n?(k("操作成功",{type:"success"}),c(a.value)):k(s,{type:"error"})})).catch(()=>{})})}}export{M as useData};