广州市综治平台后端
xusd
2025-06-07 36306491396230522fa20585c2621a7fc899849a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<div class="subheader editor-toolbar" id="editor-header">
    <div class="fixed-container">
        <div class="btn-group">
            <div class="btn-toolbar pull-left" ng-controller="DecisionTableToolbarController" ng-cloak>
                <button id="{{item.id}}"dec
                        title="{{item.title | translate}}"
                        ng-repeat="item in items"
                        ng-switch on="item.type"
                        class="btn btn-inverse" ng-class="{'separator': item.type == 'separator'}"
                        ng-disabled="item.type == 'separator' || item.enabled == false || (readOnly && item.disableOnReadonly)"
                        ng-click="toolbarButtonClicked($index)">
                    <i ng-switch-when="button" ng-class="item.cssClass" class="toolbar-button" data-toggle="tooltip"
                       title="{{item.title | translate}}"></i>
                    <div ng-switch-when="separator" ng-class="item.cssClass"></div>
                </button>
            </div>
        </div>
        <div class="btn-group pull-right" ng-show="!secondaryItems.length">
            <div class="btn-toolbar pull-right" ng-controller="DecisionTableToolbarController">
                <button title="{{item.title | translate}}" ng-repeat="item in secondaryItems" ng-switch on="item.type"
                        class="btn btn-inverse" ng-class="{'separator': item.type == 'separator'}"
                        ng-disabled="item.type == 'separator' || (readOnly && item.disableOnReadonly)"
                        ng-click="toolbarSecondaryButtonClicked($index)" id="{{item.id}}">
                    <i ng-switch-when="button" ng-class="item.cssClass" class="toolbar-button" data-toggle="tooltip"
                       title="{{item.title | translate}}"></i>
                    <div ng-switch-when="separator" ng-class="item.cssClass"></div>
                </button>
            </div>
        </div>
    </div>
</div>
 
<div class="container-fluid content decision-table" auto-height offset="40">
 
    <br/>
 
    <div class="row">
        <div class="col-xs-12 text-right">
            <div class="dropdown">
                <button class="btn btn-default dropdown-toggle" type="button" id="actionsMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                    {{"DECISION-TABLE-EDITOR.BUTTON-ACTIONS-LABEL" | translate}}
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="actionsMenu">
                    <li><a href ng-click="addRule()">{{"DECISION-TABLE-EDITOR.BUTTON-ADD-RULE-LABEL" | translate}}</a></li>
                    <li ng-if="model.selectedRow !== undefined && model.rulesData.length >= 2 && model.selectedRow >= 1"><a href ng-click="moveRuleUpwards()">{{"DECISION-TABLE-EDITOR.BUTTON-MOVE-RULE-UPWARDS-LABEL" | translate}}</a></li>
                    <li ng-if="model.selectedRow !== undefined && model.selectedRow !== model.rulesData.length - 1"><a href ng-click="moveRuleDownwards()">{{"DECISION-TABLE-EDITOR.BUTTON-MOVE-RULE-DOWNWARDS-LABEL" | translate}}</a></li>
                    <li class="danger" ng-if="model.selectedRow !== undefined &&  model.rulesData.length > 1"><a href ng-click="removeRule()">{{"DECISION-TABLE-EDITOR.BUTTON-REMOVE-RULE-LABEL" | translate}}</a></li>
                </ul>
            </div>
        </div>
    </div>
 
    <div class="decision-table-grid-wrapper" id="decisionTableGrid">
        <div class="decision-name-container">
            <div class="decision-name">
                {{currentDecisionTable.name}}
            </div>
        </div>
        <hot-table hot-auto-destroy
                hot-id="decision-table-editor"
                settings="model.hotSettings"
                columns="model.columnDefs"
                row-headers="true"
                datarows="model.rulesData"
                auto-row-size="'true'"
                on-after-get-col-header=doAfterGetColHeader
                on-modify-col-width=doAfterModifyColWidth
                on-after-render=doAfterRender
                on-after-on-cell-mouse-down=doAfterOnCellMouseDown
                on-after-scroll-horizontally=doAfterScroll
                on-after-scroll-vertically=doAfterScroll
                current-row-class-name="'currentRow'"
                on-after-validate=doAfterValidate
                height="500">
        </hot-table>
    </div>
</div>
 
<script>
    function triggerExpressionEditor(expressionType, expressionPos, newExpression) {
        if (expressionType === 'input') {
            extScope.openInputExpressionEditor(expressionPos, newExpression);
        } else {
            extScope.openOutputExpressionEditor(expressionPos, newExpression);
        }
    }
 
    function triggerRemoveExpression(expressionType, expressionPos) {
        if (expressionType === 'input') {
            extScope.removeInputExpression(expressionPos);
        } else {
            extScope.removeOutputExpression(expressionPos);
        }
    }
 
    function triggerHitPolicyEditor() {
        extScope.openHitPolicyEditor();
    }
</script>