var v=Object.defineProperty;var c=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var d=(e,a,t)=>a in e?v(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,f=(e,a)=>{for(var t in a||(a={}))w.call(a,t)&&d(e,t,a[t]);if(c)for(var t of c(a))K.call(a,t)&&d(e,t,a[t]);return e};var u=(e,a,t)=>new Promise((s,r)=>{var i=p=>{try{n(t.next(p))}catch(m){r(m)}},l=p=>{try{n(t.throw(p))}catch(m){r(m)}},n=p=>p.done?s(p.value):Promise.resolve(p.value).then(i,l);n((t=t.apply(e,a)).next())});import{cc as b,d as N,a as _,r as y,u as P,B as h,i as o,q as C,ca as L,_ as T,al as V,a0 as B,p as j,k,ag as q,e as x,d7 as S,bf as g,d8 as F,bk as O}from"./index.8bc79152.js";import{g as E,s as I}from"./use-async.65bfa3f1.js";import{B as M}from"./constant.811f1023.js";import{s as U}from"./api.3c23b679.js";import{H as z}from"./HelpCircleOutline.e1257c29.js";import{N as D}from"./FormItemGridItem.7d2fce39.js";import"./searchs.b637f0d6.js";const G=e=>b({url:"/cbs-app/sysParamConfig/queryByParamName?paramName="+e,method:"get",requestType:"form"}),H=e=>b({url:"/cbs-app/sysParamConfig/update",method:"post",data:e}),R=N({name:"project-param-setting",props:{appKey:{type:String,default:"KT"}},setup(e){const a=_({id:null,paramValue:null,group:null}),t=y(),s=y(!1),r=P(),i=()=>e.appKey.toLowerCase()+"_frequency";h(()=>u(this,null,function*(){const{data:n}=yield G(i());n?(a.id=n.id,a.paramValue=n.paramValue,a.group=n.group):r.error("\u52A0\u8F7D\u914D\u7F6E\u53C2\u6570\u5931\u8D25")}));const l=()=>u(this,null,function*(){const n={group:a.group,configs:[f({},a)]};s.value=!0;try{const p=yield H(n);p&&p.code=="200"&&r.success("\u4FDD\u5B58\u6210\u529F")}catch(p){}s.value=!1});return()=>o(q,null,[o(C,{labelPlacement:"left",model:a,requireMarkPlacement:"left",ref:t},{default:()=>[o(L,{cols:1},{default:()=>[o(D,{label:"\u8BC4\u6D4B\u9891\u7387",path:"scope_of_attendance",rule:[{required:!1,message:"\u8BF7\u8F93\u5165\u8BC4\u6D4B\u9891\u7387",trigger:["blur","input"]}]},{default:()=>[o(T,{value:a.paramValue,"onUpdate:value":n=>a.paramValue=n,placeholder:"\u8BF7\u8F93\u5165\u8BC4\u6D4B\u9891\u7387",clearable:!0,style:"width:200px"},null),o(V,{style:"padding-left: 10px"},{default:()=>"\u8BC4\u6D4B\u9891\u7387\u652F\u6301\u8F93\u5165\u591A\u4E2A\uFF0C\u8F93\u5165\u591A\u4E2A\u65F6\u9700\u8981\u9017\u53F7\u9694\u5F00",trigger:()=>o("span",{style:"overflow: hidden;display: inline-block;max-width: 200px;white-space: nowrap;text-overflow: ellipsis;"},[o(B,{size:"20"},{default:()=>[o(z,null,null)]})])})]})]})]}),o(j,{type:"primary",onClick:l,loading:s.value},{default:()=>[k("\u4FDD\u5B58\u8BBE\u7F6E")]})])}});function A(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!O(e)}const ae=N({name:"param-settings",setup(){const e=_({tabName:"KT",appKeyList:[],appNameList:[]}),a=x();E(s=>{s.form.tabName&&(e.tabName=s.form.tabName)});const t=s=>{I(s,"tabName",a)};return h(()=>u(this,null,function*(){{const s=Object.keys(M),{data:r}=yield U({page:1,rows:99,parentId:0});(r.rows||[]).forEach(l=>{s.includes(l.appKey)&&(e.appKeyList.push(l.appKey),e.appNameList.push(l.appName))})}})),()=>{let s;return o("div",{class:"system-menu-container"},[o("div",{class:["section-container"],style:"padding-top: 0"},[o(S,{type:"line",size:"large",value:e.tabName,"onUpdate:value":[r=>e.tabName=r,r=>t(r)]},A(s=e.appKeyList.map((r,i)=>g(F,{name:r,tab:e.appNameList[i]},{default:()=>g(R,{appKey:r})})))?s:{default:()=>[s]})])])}}});export{ae as default};
