import{a0 as z,ax as j,M as $}from"./index.17037962789732.js";import"./index.1703796278973300.js";import"./index.170379627897315.js";import"./index.170379627897317.js";import"./index.1703796278973301.js";import"./index.1703796278973302.js";import"./index.170379627897332.js";import"./index.1703796278973303.js";import"./index.170379627897339.js";import"./index.170379627897316.js";import"./index.170379627897314.js";import"./index.1703796278973304.js";import"./index.1703796278973305.js";import"./index.1703796278973306.js";import{_ as G}from"./index.170379627897313.js";import"./index.170379627897336.js";import{_ as H}from"./index.vue_vue_type_script_setup_true_name_PermissionButton_lang.1703796278973.js";import{e as K}from"./scene.17037962789732.js";import{a as L}from"./configuration.1703796278973.js";import{d as Q,O as U,s as W,k as T,r as f,o as m,x as b,b as n,a as t,u as i,t as S,z as s,A as l,c as A,F as B,B as X}from"./vue.1703796278973.js";import{a as r}from"./comm.1703796278973.js";import Y from"./index.1703796278973239.js";import{a as Z}from"./alarm.1703796278973.js";import{_ as P}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.170379627897335.js";import"./index.vue_vue_type_script_setup_true_lang.17037962789733.js";import"./index.170379627897333.js";import"./index.170379627897320.js";import"./index.170379627897321.js";import"./permission.1703796278973.js";import"./system.1703796278973.js";import"./index.170379627897334.js";import"./default.1703796278973.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";import"./index.170379627897337.js";const ee=["src"],te=["src"],oe={style:{"font-size":"16px","font-weight":"600"}},ne={class:"subTitle"},ie=Q({__name:"index",setup(ae){var y;const u=(y=U().query)==null?void 0:y.id,w=Z(),{configurationData:D}=W(w),M=[{terms:[{column:"id",termType:"alarm-bind-rule",value:u}],type:"and"}],d=T(),a=new Map;a.set("manual",{text:"手动触发",img:r("/scene/scene-hand.png"),icon:r("/scene/trigger-type-icon/manual.png"),tip:"适用于第三方平台向物联网平台下发指令控制设备"}),a.set("timer",{text:"定时触发",img:r("/scene/scene-timer.png"),icon:r("/scene/trigger-type-icon/timing.png"),tip:"适用于定期执行固定任务"}),a.set("device",{text:"设备触发",img:r("/scene/scene-device.png"),icon:r("/scene/trigger-type-icon/device.png"),tip:"适用于设备数据或行为满足触发条件时，执行指定的动作"});const N=(_,I)=>_?[{key:"action",text:"解绑",icon:"DisconnectOutlined",popConfirm:{title:"确定解绑？",onConfirm:async()=>{(await L(u,[_.id])).status===200&&($.success("操作成功"),d.value.reload())}}}]:[],c=T(!1);(()=>{console.log()})();const R=()=>{c.value=!0},q=()=>{c.value=!1},F=()=>{c.value=!1,d.value.reload()};return(_,I)=>{var x;const p=f("AIcon"),g=H,O=z,v=f("Ellipsis"),V=G,E=j,J=f("FullPage");return m(),b(B,null,[n(J,null,{default:t(()=>[n(E,{model:"CARD",request:i(K),defaultParams:{sorts:[{name:"createTime",order:"desc"}],terms:M},ref_key:"actionRef",ref:d},{headerTitle:t(()=>[n(O,null,{default:t(()=>[n(g,{type:"primary",onClick:R,hasPermission:"rule-engine/Alarm/Configuration:add"},{icon:t(()=>[n(p,{type:"PlusOutlined"})]),default:t(()=>[S(" 新增 ")]),_:1})]),_:1})]),card:t(o=>{var C,h;return[n(V,{value:o,actions:N(o,"card"),status:(C=o.state)==null?void 0:C.value,statusText:(h=o.state)==null?void 0:h.text,statusNames:{started:"processing",disable:"error"}},{type:t(()=>{var e,k;return[s("span",null,[s("img",{height:16,src:(e=i(a).get(o.triggerType))==null?void 0:e.icon,style:{"margin-right":"5px"}},null,8,ee),S(l((k=i(a).get(o.triggerType))==null?void 0:k.text),1)])]}),img:t(()=>{var e;return[s("img",{src:(e=i(a).get(o.triggerType))==null?void 0:e.img},null,8,te)]}),content:t(()=>[n(v,{style:{width:"calc(100% - 100px)"}},{default:t(()=>[s("span",oe,l(o.name),1)]),_:2},1024),n(v,{lineClamp:2},{default:t(()=>{var e;return[s("div",ne," 说明："+l((o==null?void 0:o.description)||((e=i(a).get(o.triggerType))==null?void 0:e.tip)),1)]}),_:2},1024)]),actions:t(e=>[n(g,{disabled:e.disabled,popConfirm:e.popConfirm,tooltip:{...e.tooltip},onClick:e.onClick,hasPermission:"rule-engine/Scene:"+e.key},{default:t(()=>[e.key==="delete"?(m(),A(p,{key:0,type:"DeleteOutlined"})):(m(),b(B,{key:1},[n(p,{type:e.icon},null,8,["type"]),s("span",null,l(e==null?void 0:e.text),1)],64))]),_:2},1032,["disabled","popConfirm","tooltip","onClick","hasPermission"])]),_:2},1032,["value","actions","status","statusText"])]}),_:1},8,["request","defaultParams"])]),_:1}),i(c)?(m(),A(Y,{key:0,id:i(u),type:(x=i(D).current)==null?void 0:x.targetType,onCloseSave:q,onSaveScene:F},null,8,["id","type"])):X("",!0)],64)}}});const Xe=P(ie,[["__scopeId","data-v-0bf43101"]]);export{Xe as default};
