package com.jay.monitor.data.server.avue.template;

import com.jay.monitor.data.server.avue.enums.StatusEnum;
import com.jay.monitor.data.server.controllers.AlertRuleController;
import com.jay.monitor.data.server.enums.MatchRuleEnums;
import com.ruoyi.client.annotation.*;
import com.ruoyi.client.annotation.column.*;

import java.util.Date;

/**
 * 模拟增删改查表单列表构建数据
 *
 * @author liukaixiong
 * @Email liukx@elab-plus.com
 * @date 2021/8/17 - 13:02
 */
@AVueRouteKey(groupKey = "alert-rule")
@AVueTableOption(title = "告警规则管理", dialogDrag = true, pageRoot = "pageModel", pageData = "resultSet")
@AVueFromOption(successField = "success", successKeyword = "true", messageField = "message")
@AVueConfig(list = AlertRuleController.LIST_URL, update = AlertRuleController.UPDATE_URL, save = AlertRuleController.ADD_URL, del = AlertRuleController.DEL_URL)
@AVueEventButtons(tableTopLeftButtons = {
    @AVueClickButton(methodName = "hrefClick", btnName = "使用介绍", type = "success", icon = "el-icon-setting", attrExt = {
        @AVueAttr(name = "url", value = "https://www.yuque.com/docs/share/573f3b55-2814-4e41-b6c9-8eeb7812d76c")})})
public class AlertRuleAVueModel {

    @AVueInput(prop = "id", label = "主键", addDisplay = false, editDisplay = false)
    private String id;
    /**
     * 规则名称
     */
    @AVueInput(prop = "ruleName", label = "规则名称", search = true, required = true)
    private String ruleName;
    /**
     * 项目名称 , ALL 应用所有项目
     */
    @AVueInput(prop = "project", label = "项目名称", search = true, required = true)
    private String project;
    /**
     * 规则描述
     */
    @AVueInput(prop = "title", label = "告警标题", search = true, required = true)
    private String title;
    /**
     * 规则类型， 该类型会基于字段值去做计算
     */
    @AVueSelect(prop = "ruleType", label = "规则类型", dicData = "MatchRuleEnums", search = true, required = true, hide = true)
    private MatchRuleEnums ruleType;
    /**
     * 字段名称
     */
    @AVueInput(prop = "fieldName", label = "字段名称", hide = true)
    private String fieldName;
    /**
     * 字段值
     */
    @AVueTextarea(prop = "fieldValue", label = "字段值", required = true, hide = true)
    private String fieldValue;

    @AVueDynamic(prop = "alertPlatformList", label = "告警组", required = true, hide = true)
    private AlertPlaformNodelModel alertPlatformList;

    /**
     * 状态
     */
    @AVueSelect(prop = "status", label = "状态", dicData = "StatusEnum", addDisplay = true)
    private Integer status = (Integer)StatusEnum.valid.getCode();

    @AVueInput(prop = "creator", label = "创建人", addDisplay = false, editDisabled = true)
    private String creator;
    @AVueDatetime(prop = "createDate", label = "创建时间", format = "yyyy-MM-dd HH:mm:ss", addDisplay = false, editDisabled = true)
    private Date createDate;
    @AVueInput(prop = "updator", label = "修改人", addDisplay = false, editDisabled = true)
    private String updator;
    @AVueDatetime(prop = "updated", label = "修改时间", format = "yyyy-MM-dd HH:mm:ss", addDisplay = false, editDisabled = true)
    private Date updated;
}
