123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- <style type="text/css">
- .alert_level_error{
- color:red;
- }
- .alert_level_waring{
- color:#b5b51f;
- }
- .alert_level_hint{
- color:#558655;
- }
- </style>
- <script type="text/javascript" src="/static/js/layui_crud.js"></script>
- <div class="children-content" id="rule_check_cnf">
- <blockquote class="layui-elem-quote" style="padding:1rem;line-height:2.5rem;">
- 校验规则配置 / SCD校验规则
- </blockquote>
- <div style="position:relative;width:100%;">
- <script type="text/html" id="table_tools_bar_syntax">
- <div class="layui-btn-container">
- <button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="add">添加新规则</button>
- </div>
- </script>
- <div id="table_search_panel_syntax" class="layui-panel" style="height:5.4rem;line-height:5.4rem;">
- <form id="frm_syntax" class="layui-form layui-form-pane" action="">
- <span style="float:left;margin:0 0.5rem 0 2rem;">启用状态:</span>
- <div class="layui-input-block" style="float:left;margin:1rem 1rem 0 1rem;width:15rem;">
- <select id="enable">
- <option value="">全部</option>
- <option value="1">启用</option>
- <option value="0">禁用</option>
- </select>
- </div>
- <span style="float:left;margin:0 0.5rem 0 2rem;">校验类型:</span>
- <div class="layui-input-block" style="float:left;margin:1rem 1rem 0 1rem;width:15rem;">
- <select id="check_type"></select>
- </div>
- <span style="float:left;margin:0 0.5rem 0 2rem;">校验对象名称:</span>
- <div class="layui-input-block" style="float:left;float:left;margin:1rem 1rem 0 1rem;width:15rem;">
- <input type="text" id="object_name" autocomplete="off" class="layui-input">
- </div>
- <span style="float:left;margin:0 0.5rem 0 2rem;">校验等级:</span>
- <div class="layui-input-block" style="float:left;margin:1rem 1rem 0 1rem;width:15rem;">
- <select id="alert_level">
- <option value="">全部</option>
- <option value="error">错误</option>
- <option value="waring">警告</option>
- <option value="hint">提醒</option>
- </select>
- </div>
- <button id="btnSearch" type="button" class="layui-btn layui-btn-normal" style="margin-left:4rem;height:3.2rem;line-height:3.2rem;" onclick="ruleCrud_syntax.Query();">查询</button>
- <button id="btnSearch" type="button" class="layui-btn layui-btn-normal" style="margin-left:4rem;height:3.2rem;line-height:3.2rem;background-color: #b39393;" onclick="ruleCrud_syntax.Reset();">重置</button>
- </form>
- </div>
- </div>
- <table id="table_datalist_control_syntax" lay-filter="table_row_operator_syntax">
- </table>
- </div>
- <!--语法规则-->
- <script type="text/html" id="table_row_operator_syntax">
- <i class="layui-icon layui-icon-edit" style="cursor:pointer;" lay-event="edit"></i>
- <i class="layui-icon layui-icon-delete" style="margin-left:10px;cursor:pointer;" lay-event="delete"></i>
- </script>
- <!--逻辑规则-->
- <script type="text/html" id="table_row_operator_logic">
- <i class="layui-icon layui-icon-edit" style="cursor:pointer;" lay-event="edit"></i>
- <i class="layui-icon layui-icon-delete" style="margin-left:10px;cursor:pointer;" lay-event="delete"></i>
- </script>
- <script type="text/javascript">
- //规则类型码定义
- var check_type_list=[];
- //来源标准码定义
- var apply_standard_list=[];
- $.getJSON(Global.AccessUrl+"/api/getGlobalCode",{"pcode": "checkrule_type"},function(r){
- if(r.code!=0){
- layer.msg("获取校验类型失败!",{icon:Global.ICON_ERROR});
- return;
- }
- check_type_list=r.data;
- var opts=template('select_option_tpl',{"data":[{"id":"","name":"全部"}].concat(r.data)});
- $("#check_type").html(opts);
- layui.form.render("select");
- });
- /*
- $.getJSON(Global.AccessUrl+"/api/getGlobalCode",{"pcode": "checkrule_apply_stan"},function(r){
- if(r.code!=0){
- layer.msg("获取校验规则来源标准定义失败!",{icon:Global.ICON_ERROR});
- return;
- }
- apply_standard_list=r.data;
- });
- */
- var alert_level_map={"error":"错误","waring":"警告","hint":"提醒"};
- //语法规则管理对象
- var ruleCrud_syntax=new CurdObj();
- ruleCrud_syntax.Init({
- "module_name":"rule_check_cnf",
- "list_table_id":"table_ruleCrud_syntax",
- "window_size": ['70rem', '65rem'],
- "window_title": ['语义规则', ''],
- "nameColKey":"object_name",
- "height": ($(".main-body").height()-$("#table_datalist_control_syntax").offset().top ),
- //默认的数据table ID
- "table_datalist_control": "table_datalist_control_syntax",
- //默认的数据table工具栏ID
- "table_tools_bar": "table_tools_bar_syntax",
- //默认的数据table查询条件元素ID
- "table_search_panel": "table_search_panel_syntax",
- //默认的数据table操作模板ID
- "table_row_operator": "table_row_operator_syntax",
- "apiUrl": {
- "save_url": "/api/scd/rule/save?rule_type=syntax",
- "read_url": "/api/scd/rule/list?rule_type=syntax",
- "delete_url": "/api/scd/rule/remove?rule_type=syntax",
- "list_url": "/api/scd/rule/list?rule_type=syntax"
- },
- "data":{"ruleType":"syntax"},
- "columns":[
- [
- {
- field: 'check_type_name',
- title: "校验类型",
- width: 160,
- fixed:"left"
- },{
- field: 'check_name',
- title: "规则名称",
- width: 160,
- fixed:"left",
- templet:function(data){
- return "<span title='"+(data.check_name||'')+"'>"+(data.check_name||'未定义')+"</span>";
- }
- },{
- field: 'object_name',
- title: "校验对象名称",
- width: 200
- }, {
- field: 'enable',
- title: "启用状态",
- width: 90,
- templet:function(data){
- return data.enable==1?"启用中":"<b style='color:red'>已禁用</b>";
- }
- }, {
- field: 'alert_level',
- title: "校验等级",
- width: 90,
- templet:function(data){
- return "<span class='alert_level_"+data.alert_level+"'>"+alert_level_map[data.alert_level]+"</span>";
- }
- }, {
- field: 'func_name',
- title: "应用标准及条款",
- width: 180,
- templet:function(data){
- return data.apply_standard+" "+data.apply_standard_no;
- }
- },{
- field: 'check_desc',
- title: "规则说明",
- width: 460
- }, {
- fixed: 'right',
- title: "操作",
- width: 120,
- align: 'center',
- toolbar: '#table_row_operator_syntax'
- }
- ]
- ]
- });
- $(document).ready(function () {
- layui.form.render("select");
- $('#text_startdate,#text_enddate').val(Global.GetCurrentDate());
- layui.use(['form', 'layedit', 'laydate'], function () {
- var laydate = layui.laydate;
- laydate.render({
- elem: '#text_startdate,#text_enddate'
- });
- });
- ruleCrud_syntax.GetList({});
- });
- </script>
|