2 lines
17 KiB
JavaScript
2 lines
17 KiB
JavaScript
|
|
import{a as be,b as _e,u as ve,c as he,N as Se,d as Te}from"./search-form.vue_vue_type_script_setup_true_lang-xYfW9G7N.js";import{d as ae,Q as ee,z as A,R as te,X as P,m as Ne,n as we,a as ke,$ as a,i as Ce,an as De,r as Ie,S as Ue,o as N,c as $,w as n,f as t,g as I,t as U,h as e,aU as Re,af as H,b as le,U as se,V as re,aN as ie,a8 as fe,v as $e,a6 as de,a1 as Le,x as Ve,a2 as Oe,aM as xe,s as Be,y as Me,B as Z,aV as ue,aW as je,aX as Fe,a9 as O,aY as me,aP as Ge,aZ as ce,a_ as ye,P as q,C as Ae,ad as Pe,ae as W,a$ as ze,av as Ee,O as We,ag as qe}from"./index-D3rICic-.js";import{f as He,a as Ke,b as Xe,c as Je,d as pe,e as Qe}from"./notify-BmtrPduQ.js";import{f as Ye,_ as Ze}from"./select-scene.vue_vue_type_script_setup_true_lang-DxzzLcAX.js";import{f as et}from"./workflow-DX1Amij-.js";import{i as tt}from"./job-8-wbHxv4.js";import{_ as ge}from"./select-group.vue_vue_type_script_setup_true_lang-Bk3YnuuX.js";import{a as at,b as nt,_ as ot}from"./Grid-CRDcRyPk.js";import{_ as lt,a as st}from"./DescriptionsItem-LhWljJnV.js";import{_ as it}from"./status-switch.vue_vue_type_script_setup_true_lang-DuU56cot.js";import{u as rt}from"./auth-C5d9H5Pz.js";import"./group-frwXGSCG.js";const ut=ae({name:"NotifyConfigOperateDrawer",__name:"notify-config-operate-drawer",props:ee({operateType:{},rowData:{}},{visible:{type:Boolean,default:!1},visibleModifiers:{},retrySceneDisable:{type:Boolean,default:!0},retrySceneDisableModifiers:{}}),emits:ee(["update:value","submitted"],["update:visible","update:retrySceneDisable"]),setup(w,{emit:x}){const f=A([]),g=A([]),y=A([]),k=A([]),_=w,S=x,v=te(w,"visible"),c=te(w,"retrySceneDisable"),i=A(P(ue)),{formRef:d,validate:B,restoreValidation:L}=Ne(),{defaultRequiredRule:C}=we(),ne=ke(()=>({add:a("page.notifyConfig.addNotifyConfig"),edit:a("page.notifyConfig.editNotifyConfig")})[_.operateType]);Ce(()=>{De(()=>{oe()})});async function oe(){const m=await He();f.value=m.data}const o=Ie(K());function K(){return{groupName:null,businessId:"",recipientIds:[],systemTaskType:null,notifyStatus:1,notifyScene:null,notifyThreshold:16,rateLimiterStatus:0,rateLimiterThreshold:100,description:""}}const M={groupName:C,businessId:C,systemTaskType:C,notifyStatus:C,notifyScene:C,recipientIds:C,rateLimiterStatus:C,notifyThreshold:C};function X(){if(_.operateType==="add"){Object.assign(o,K()),c.value=!0;return}_.operateType==="edit"&&_.rowData&&(Object.assign(o,_.rowData),r(o.systemTaskType),l(o.notifyScene))}function J(){v.value=!1}async function Q(){var m;if(await B(),_.operateType==="add"){const{groupName:s,businessId:u,recipientIds:T,systemTaskType:V,notifyStatus:R,notifyScene:D,notifyThreshold:b,rateLimiterStatus:j,rateLimiterThreshold:F,description:z}=o,{error:E}=await Ke({groupName:s,businessId:u,recipientIds:T,systemTaskType:V,notifyStatus:R,notifyScene:D,notifyThreshold:b,rateLimiterStatus:j,rateLimiterThreshold:F,description:z});if(E)return}if(_.operateType==="edit"){const{id:s,groupName:u,businessId:T,recipientIds:V,notifyStatus:R,systemTaskType:D,notifyScene:b,notifyThreshold:j,rateLimiterStatus:F,rateLimiterThreshold:z,description:E}=o,{error:Y}=await Xe({id:s,groupName:u,businessId:T,recipientIds:V,systemTaskType:D,notifyStatus:R,notifyScene:b,notifyThreshold:j,rateLimiterStatus:F,rateLimiterThreshold:z,description:E});if(Y)return}(m=window.$message)==null||m.success(a("common.updateSuccess")),J(),S("submitted")}async function r(m){var s,u,T,V,R;if(m===1){const D=await Ye({groupName:o.groupName});g.value=D.data,i.value=P(ue)}else if(m===3){const D=await tt({groupName:o.groupName});y.value=(s=D.data)==null?void 0:s.map(b=>(b.id=String(b.id),b)),i.value=P(je)}else if(m===4){const D=await et({groupName:o.groupName});k.value=(u=D.data)==null?void 0:u.map(b=>(b.id=String(b.id),b)),i.value=P(Fe)}m!==((T=_.rowData)==null?void 0:T.systemTaskType)?(o.businessId=null,o.notifyScene=null):(o.businessId=(V=_.rowData)==null?void 0:V.businessId,o.notifyScene=(R=_.rowData)==null?void 0:R.notifyScene)}async function l(m){c.value=!(m===5||m===6)}function h(m){X(),o.groupName=m,r(1),l(1)}return Ue(v,()=>{v.value&&(X(),L())}),(m,s)
|