2024-10-25 10:36:48 +08:00
|
|
|
import{a as be,N as _e,b as ve}from"./search-form.vue_vue_type_script_setup_true_lang-D7hHwQXT.js";import{_ as he}from"./delete-alert-C8iwsugF.js";import{d as ae,Z as ee,r as F,a0 as te,a4 as G,z as Se,A as Te,a as Ne,$ as a,i as we,ap as ke,p as Ce,q as De,o as N,c as R,w as n,f as t,g as I,t as U,h as e,aR as Ie,ai as W,b as le,a1 as re,aJ as se,a3 as ie,ab as fe,E as Ue,aa as de,H as Le,aI as Re,D as $e,I as Ve,B as Q,aS as ue,aT as Oe,aU as xe,ac as O,aV as me,aL as Be,aW as ce,aX as ye,Y as H,L as je,ag as Me,ah as q,aY as Ae,aj as Fe,F as Ge,ak as ze}from"./index--PhRNylI.js";import{f as Pe,a as Ee,b as qe,c as He,d as pe,e as We}from"./notify-HtwYpkB2.js";import{_ as Je,u as Ke,a as Ye}from"./table-DvozQPKE.js";import{f as Xe,_ as Ze}from"./select-scene.vue_vue_type_script_setup_true_lang-D5b2c2NA.js";import{f as Qe}from"./workflow-CnYlkeoT.js";import{h as et}from"./job-Tsw2tz69.js";import{_ as ge}from"./select-group.vue_vue_type_script_setup_true_lang-CNpCk88a.js";import{_ as tt,d as at,c as nt,a as ot,b as lt}from"./Grid-C8sbif0M.js";import{_ as st,a as it}from"./DescriptionsItem-BzmwSMF7.js";import{_ as rt}from"./status-switch.vue_vue_type_script_setup_true_lang-DMX4IkJr.js";import{u as ut}from"./auth-CqD89xZX.js";import"./group-Rd_jp_gh.js";const pt=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:$}){const f=F([]),_=F([]),y=F([]),k=F([]),h=w,T=$,S=te(w,"visible"),g=te(w,"retrySceneDisable"),i=F(G(ue)),{formRef:c,validate:x,restoreValidation:V}=Se(),{defaultRequiredRule:C}=Te(),ne=Ne(()=>({add:a("page.notifyConfig.addNotifyConfig"),edit:a("page.notifyConfig.editNotifyConfig")})[h.operateType]);we(()=>{ke(()=>{oe()})});async function oe(){const p=await Pe();f.value=p.data}const o=Ce(J());function J(){return{groupName:null,businessId:"",recipientIds:[],systemTaskType:null,notifyStatus:1,notifyScene:null,notifyThreshold:16,rateLimiterStatus:0,rateLimiterThreshold:100,description:""}}const B={groupName:C,businessId:C,systemTaskType:C,notifyStatus:C,notifyScene:C,recipientIds:C,rateLimiterStatus:C,notifyThreshold:C};function K(){if(h.operateType==="add"){Object.assign(o,J()),g.value=!0;return}h.operateType==="edit"&&h.rowData&&(Object.assign(o,h.rowData),z(o.systemTaskType),r(o.notifyScene))}function Y(){S.value=!1}async function X(){var p;if(await x(),h.operateType==="add"){const{groupName:s,businessId:d,recipientIds:b,systemTaskType:m,notifyStatus:L,notifyScene:D,notifyThreshold:v,rateLimiterStatus:j,rateLimiterThreshold:M,description:P}=o,{error:E}=await Ee({groupName:s,businessId:d,recipientIds:b,systemTaskType:m,notifyStatus:L,notifyScene:D,notifyThreshold:v,rateLimiterStatus:j,rateLimiterThreshold:M,description:P});if(E)return}if(h.operateType==="edit"){const{id:s,groupName:d,businessId:b,recipientIds:m,notifyStatus:L,systemTaskType:D,notifyScene:v,notifyThreshold:j,rateLimiterStatus:M,rateLimiterThreshold:P,description:E}=o,{error:Z}=await qe({id:s,groupName:d,businessId:b,recipientIds:m,systemTaskType:D,notifyStatus:L,notifyScene:v,notifyThreshold:j,rateLimiterStatus:M,rateLimiterThreshold:P,description:E});if(Z)return}(p=window.$message)==null||p.success(a("common.updateSuccess")),Y(),T("submitted")}async function z(p){var s,d,b,m,L;if(p===1){const D=await Xe({groupName:o.groupName});_.value=D.data,i.value=G(ue)}else if(p===3){const D=await et({groupName:o.groupName});y.value=(s=D.data)==null?void 0:s.map(v=>(v.id=String(v.id),v)),i.value=G(Oe)}else if(p===4){const D=await Qe({groupName:o.groupName});k.value=(d=D.data)==null?void 0:d.map(v=>(v.id=String(v.id),v)),i.value=G(xe)}p!==((b=h.rowData)==null?void 0:b.systemTaskType)?(o.businessId=null,o.notifyScene=null):(o.businessId=(m=h.rowData)==null?void 0:m.businessId,o.notifyScene=(L=h.rowData)==null?void 0:L.notifyScene)}async function r(p){g.value=!(p===5||p===6)}fu
|