import{aM as v,aH as D,r as I,Y as O,a6 as A,a2 as J,l as U,F as P,K as T,W as V}from"./index.17037962789732.js";import"./index.170379627897337.js";import"./index.170379627897315.js";import{_ as z}from"./index.vue_vue_type_script_setup_true_name_PermissionButton_lang.1703796278973.js";import"./index.170379627897318.js";import"./index.170379627897319.js";import"./index.1703796278973302.js";import"./index.170379627897325.js";import"./index.1703796278973311.js";import{s as E}from"./collector.1703796278973.js";import{r as F}from"./data.1703796278973.js";import{d as L,k as g,r as R,o as H,c as K,a as e,b as t,t as u,u as s,z as x,A as Q}from"./vue.1703796278973.js";import{_ as S}from"./_plugin-vue_export-helper.1703796278973.js";import"./index.17037962789733.js";import"./dayjs.min.1703796278973.js";import"./isArray.1703796278973.js";import"./editor.api.1703796278973.js";import"./preload-helper.1703796278973.js";import"./monaco.contribution.1703796278973.js";import"./index.170379627897320.js";import"./index.170379627897321.js";import"./permission.1703796278973.js";import"./system.1703796278973.js";import"./comm.1703796278973.js";import"./index.170379627897332.js";import"./index.170379627897333.js";import"./index.170379627897334.js";import"./default.1703796278973.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";const W={class:"sizeText"},Y=L({__name:"index",props:{data:{type:Array,default:()=>[]}},emits:["change"],setup(b,{emit:_}){const k=b,d=g(!1),M=g(),n=g({accessModes:[],interval:void 0,features:[]}),C=async()=>{const r=v.cloneDeep(n.value),{accessModes:o,features:m,interval:l}=r;if(o.length!==0||m.length!==0||Number(l)===0||!!l){const p=v.cloneDeep(k.data);p.forEach(a=>{o.length!==0?a.accessModes=r.accessModes:v.isObject(a.accessModes)&&(a.accessModes=a.accessModes.map(f=>f.value)),m.length!==0&&(a.features=r.features),(l||Number(l)===0)&&(a.interval=r.interval,a.configuration={...a.configuration,interval:r.interval})}),d.value=!0;const c=await E(p).catch(()=>{});_("change",(c==null?void 0:c.status)===200),d.value=!1}else _("change",!0)},h=()=>{_("change",!1)};return(r,o)=>{const m=D,l=I,y=R("AIcon"),p=O,c=A,a=J,f=U,j=P,B=T,N=z,w=V;return H(),K(w,{title:"批量编辑",visible:!0,width:"700px",onCancel:h},{footer:e(()=>[t(B,{key:"back",onClick:h},{default:e(()=>[u("取消")]),_:1}),t(N,{key:"submit",type:"primary",loading:s(d),onClick:C,style:{"margin-left":"8px"},hasPermission:"DataCollect/Collector:update"},{default:e(()=>[u(" 确认 ")]),_:1},8,["loading"])]),default:e(()=>[x("div",W," 将批量修改 "+Q(b.data.length)+" 条数据的访问类型、采集频率、只推送变化的数据 ",1),t(j,{class:"form",layout:"vertical",model:s(n),name:"basic",autocomplete:"off",ref_key:"formRef",ref:M},{default:e(()=>[t(l,{label:"访问类型",name:"accessModes"},{default:e(()=>[t(m,{multiple:"",showImage:!1,value:s(n).accessModes,"onUpdate:value":o[0]||(o[0]=i=>s(n).accessModes=i),options:[{label:"读",value:"read"},{label:"写",value:"write"},{label:"订阅",value:"subscribe"}]},null,8,["value"])]),_:1}),t(l,{name:["interval"],rules:[{pattern:s(F),message:"请输入0或者正整数"}]},{label:e(()=>[x("span",null,[u(" 采集频率 "),t(p,{title:"采集频率为0时不执行轮询任务"},{default:e(()=>[t(y,{type:"QuestionCircleOutlined",style:{"margin-left":"2px"}})]),_:1})])]),default:e(()=>[t(c,{style:{width:"100%"},placeholder:"请输入采集频率",value:s(n).interval,"onUpdate:value":o[1]||(o[1]=i=>s(n).interval=i),"addon-after":"ms",max:9999999999999998},null,8,["value"])]),_:1},8,["rules"]),t(l,{name:["features"]},{default:e(()=>[t(f,{value:s(n).features,"onUpdate:value":o[2]||(o[2]=i=>s(n).features=i)},{default:e(()=>[t(a,{value:"changedOnly",name:"type"},{default:e(()=>[u("只推送变化的数据")]),_:1})]),_:1},8,["value"])]),_:1})]),_:1},8,["model"])]),_:1})}}});const je=S(Y,[["__scopeId","data-v-9102c0cb"]]);export{je as default};
