1 line
9.9 KiB
JavaScript
1 line
9.9 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5b7b2d68"],{"12b3":function(e,t){var a={sceneStatus:{0:{name:"停用",color:"#9c1f1f"},1:{name:"启用",color:"#f5a22d"}},backOffLabels:{1:{name:"延迟等级",color:"#d06892"},2:{name:"固定时间",color:"#f5a22d"},3:{name:"CRON表达式",color:"#e1f52d"},4:{name:"随机等待",color:"#a127f3"}},triggerInterval:{1:{name:"CRON表达式",color:"#d06892"},2:{name:"固定时间",color:"#f5a22d"}},notifyScene:{1:{name:"重试数量超过阈值",color:"#d06892"},2:{name:"重试失败数量超过阈值",color:"#f5a22d"},3:{name:"客户端上报失败",color:"#e1f52d"},4:{name:"客户端组件异常",color:"#a127f3"}},routeKey:{4:{name:"轮询",color:"#8f68d2"},1:{name:"一致性Hash",color:"#d06892"},2:{name:"随机",color:"#f5a22d"},3:{name:"LRU",color:"#e1f52d"}},notifyType:{1:{name:"钉钉通知",color:"#64a6ea"},2:{name:"邮箱通知",color:"#1b7ee5"},4:{name:"飞书",color:"#087da1"}},notifyStatus:{0:{name:"停用",color:"#9c1f1f"},1:{name:"启用",color:"#f5a22d"}},idGenMode:{1:{name:"号段模式",color:"#1b7ee5"},2:{name:"雪花算法",color:"#087da1"}},groupStatus:{0:{name:"停用",color:"#9c1f1f"},1:{name:"启用",color:"#f5a22d"}},initScene:{0:{name:"否",color:"#9c1f1f"},1:{name:"是",color:"#f5a22d"}}};e.exports=a},"51b5":function(e,t,a){"use strict";a.r(t);a("b0c0");var n=function(){var e=this,t=e._self._c;return t("div",[t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"table-page-search-wrapper"},[t("a-form",{attrs:{layout:"inline"}},[t("a-row",{attrs:{gutter:48}},[[t("a-col",{attrs:{md:8,sm:24}},[t("a-form-item",{attrs:{label:"组名称"}},[t("a-select",{attrs:{placeholder:"请输入组名称"},model:{value:e.queryParam.groupName,callback:function(t){e.$set(e.queryParam,"groupName",t)},expression:"queryParam.groupName"}},e._l(e.groupNameList,(function(a){return t("a-select-option",{key:a,attrs:{value:a}},[e._v(e._s(a))])})),1)],1)],1),t("a-col",{attrs:{md:8,sm:24}},[t("a-form-item",{attrs:{label:"场景名称"}},[t("a-input",{attrs:{placeholder:"请输入场景名称",allowClear:""},model:{value:e.queryParam.sceneName,callback:function(t){e.$set(e.queryParam,"sceneName",t)},expression:"queryParam.sceneName"}})],1)],1)],t("a-col",{attrs:{md:e.advanced?24:8,sm:24}},[t("span",{staticClass:"table-page-search-submitButtons",style:e.advanced&&{float:"right",overflow:"hidden"}||{}},[t("a-button",{attrs:{type:"primary"},on:{click:function(t){return e.$refs.table.refresh(!0)}}},[e._v("查询")]),t("a-button",{staticStyle:{"margin-left":"8px"},on:{click:function(){return e.queryParam={}}}},[e._v("重置")])],1)])],2)],1)],1),t("div",{staticClass:"table-operator"},[t("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:function(t){return e.handleNew()}}},[e._v("新增")])],1),t("s-table",{ref:"table",attrs:{size:"default",rowKey:function(e){return e.id},columns:e.sceneColumns,data:e.loadData,alert:e.options.alert,rowSelection:e.options.rowSelection,scroll:{x:1500}},scopedSlots:e._u([{key:"serial",fn:function(a,n){return t("span",{},[e._v(" "+e._s(n.id)+" ")])}},{key:"sceneStatus",fn:function(a){return t("span",{},[t("a-tag",{attrs:{color:e.sceneStatus[a].color}},[e._v(" "+e._s(e.sceneStatus[a].name)+" ")])],1)}},{key:"backOff",fn:function(a){return t("span",{},[t("a-tag",{attrs:{color:e.backOffLabels[a].color}},[e._v(" "+e._s(e.backOffLabels[a].name)+" ")])],1)}},{key:"triggerInterval",fn:function(a){return t("span",{},[e._v(" "+e._s(a||"无")+" ")])}},{key:"action",fn:function(a){return t("span",{},[[t("a",{on:{click:function(t){return e.handleEdit(a)}}},[e._v("编辑")])]],2)}}])})],1)],1)},r=[],o=a("6b75");function i(e){if(Array.isArray(e))return Object(o["a"])(e)}a("a4d3"),a("e01a"),a("d3b7"),a("d28b"),a("3ca3"),a("ddb0"),a("a630");function s(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}var c=a("06c5");function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e){return i(e)||s(e)||Object(c["a"])(e)||l()}var u=a("5530"),f=(a("d81d"),a("25f0"),a("7db0"),a("4de4"),a("ac1f"),a("159b"),a("b64b"),a("0fea")),m=a("2af9"),h=a("12b3"),p={name:"SceneList",components:{STable:m["j"]},data:function(){var e=this;return{sceneColumns:[{title:"场景名称",dataIndex:"sceneName",width:"15%"},{title:"场景状态",dataIndex:"sceneStatus",width:"8%",scopedSlots:{customRender:"sceneStatus"}},{title:"退避策略",dataIndex:"backOff",key:"backOff",width:"12%",scopedSlots:{customRender:"backOff"}},{title:"最大重试次数",dataIndex:"maxRetryCount",key:"maxRetryCount",width:"10%",scopedSlots:{customRender:"maxRetryCount"}},{title:"调用链超时时间",dataIndex:"deadlineRequest",key:"deadlineRequest",width:"10%",scopedSlots:{customRender:"deadlineRequest"}},{title:"间隔时间",dataIndex:"triggerInterval",key:"triggerInterval",width:"15%",scopedSlots:{customRender:"triggerInterval"}},{title:"描述",dataIndex:"description",key:"description",width:"18%",scopedSlots:{customRender:"description"}},{title:"操作",key:"action",fixed:"right",width:"180px",scopedSlots:{customRender:"action"}}],data:[],pagination:{},backOffLabels:h.backOffLabels,sceneStatus:h.sceneStatus,triggerInterval:{1:{placeholder:"",tooltip:""},2:{placeholder:"请输入固定间隔时间",tooltip:"请输入固定间隔时间"},3:{placeholder:"请输入CRON表达式",tooltip:"通过CRON表达式计算执行时间"},4:{placeholder:"请输入最大间隔时间",tooltip:"随机生成范围在[0, x]内的延迟时间; 其中x代表最大间隔时间"}},advanced:!1,maxRetryCount:{1:{placeholder:"请输入延迟等级(max:26)",tooltip:"请输入延迟等级(max:26)"},2:{placeholder:"请输入最大重试次数",tooltip:"请输入最大重试次数"},3:{placeholder:"请输入最大重试次数",tooltip:"请输入最大重试次数"},4:{placeholder:"请输入最大重试次数",tooltip:"请输入最大重试次数"}},queryParam:{},loadData:function(t){return Object(f["w"])(Object.assign(t,e.queryParam)).then((function(e){return e}))},selectedRowKeys:[],selectedRows:[],options:{alert:{show:!0,clear:function(){e.selectedRowKeys=[]}},rowSelection:{selectedRowKeys:this.selectedRowKeys,onChange:this.onSelectChange}},optionAlertShow:!1,groupNameList:[]}},created:function(){var e=this;Object(f["j"])().then((function(t){e.groupNameList=t.data}));var t=this.$route.query.groupName;t&&this.fetch({groupName:t,size:6,page:1})},methods:{handleNew:function(){this.$router.push({path:"/retry/scene/config"})},handleEdit:function(e){this.$router.push({path:"/retry/scene/config",query:{id:e.id}})},reset:function(){this.formData=[],this.data=[];var e=this.$route.query.groupName;e&&this.fetch({groupName:e,size:6,page:1})},handleTableChange:function(e,t,a){var n=Object(u["a"])({},this.pagination);n.current=e.current,this.pagination=n,this.fetch(Object(u["a"])({groupName:this.$route.query.groupName,size:e.pageSize,page:e.current,sortField:a.field,sortOrder:a.order},t))},queryChange:function(){this.fetch({groupName:this.$route.query.groupName,size:6,page:1,sceneName:this.queryParam.sceneName})},fetch:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.loading=!0,Object(f["w"])(t).then((function(t){e.data=[],t.data.map((function(t){e.loading=!1;var a=t.id,n=t.sceneName,r=t.sceneStatus,o=t.maxRetryCount,i=t.backOff,s=t.triggerInterval,c=t.description,l=t.deadlineRequest;e.data.push({key:a,sceneName:n,sceneStatus:r.toString(),maxRetryCount:o,backOff:i.toString(),triggerInterval:s,description:c,deadlineRequest:l,editable:!1,isNew:!1})}));var a=Object(u["a"])({},e.pagination);a.pageSize=t.size,a.current=t.page,a.total=t.total,e.pagination=a}))},remove:function(e){var t=this.data.find((function(t){return t.key===e})),a=t.key,n=t.sceneName,r=t.sceneStatus,o=t.maxRetryCount,i=t.backOff,s=t.triggerInterval,c=t.description,l=t.deadlineRequest;this.formData.push({key:a,sceneName:n,sceneStatus:r,maxRetryCount:o,backOff:i,triggerInterval:s,deadlineRequest:l,description:c,isDeleted:1});var d=this.data.filter((function(t){return t.key!==e}));this.data=d},saveRow:function(e){var t=this;this.memberLoading=!0;var a=e.key,n=e.sceneName,r=e.sceneStatus,o=e.maxRetryCount,i=e.backOff,s=e.triggerInterval,c=e.description,l=e.deadlineRequest;if(!n||!r||!o||!i||"1"!==i&&!s)return this.memberLoading=!1,void this.$message.error("请填写完整成员信息。");var d=/^[A-Za-z0-9_]{1,64}$/;if(!d.test(n))return this.memberLoading=!1,void this.$message.error("场景名称: 仅支持长度为:1~64位字符.格式为:数字、字母、下划线。");if(c.length>256)return this.memberLoading=!1,void this.$message.error("描述: 仅支持长度为:1~256位字符");if(("2"===i||"4"===i)&&s<10)return this.memberLoading=!1,void this.$message.error("描述: 间隔时间最小为10秒");var u=this.formData.find((function(e){return a===e.key}));u||this.formData.push({key:a,sceneName:n,sceneStatus:r,maxRetryCount:o,backOff:i,triggerInterval:s,description:c,deadlineRequest:l,isDeleted:0}),new Promise((function(e){setTimeout((function(){e({loop:!1})}),200)})).then((function(){var e=t.data.find((function(e){return e.key===a}));e.editable=!1,e.isNew=!1,t.memberLoading=!1,t.$message.warning("请点击右下角提交按钮以保存所有页面数据")}))},toggle:function(e){var t=this.data.find((function(t){return t.key===e}));t._originalData=Object(u["a"])({},t),t.editable=!t.editable},getRowByKey:function(e,t){var a=this.data;return(t||a).find((function(t){return t.key===e}))},cancel:function(e){var t=this.data.find((function(t){return t.key===e}));Object.keys(t).forEach((function(e){t[e]=t._originalData[e]})),t._originalData=void 0},handleChange:function(e,t,a){if("backOff"===a)switch(e){case"1":this.triggerIntervalDisabled=!0,this.max=26;break;default:this.triggerIntervalDisabled=!1,this.max=99999}var n=d(this.data),r=n.find((function(e){return t===e.key}));r&&(r[a]=e,this.data=n)}}},g=p,b=a("2877"),y=Object(b["a"])(g,n,r,!1,null,"23121938",null);t["default"]=y.exports}}]); |