{$layout "layout_popup"}

<h3>可以添加的指标</h3>

<p class="comment" v-if="items.length == 0">暂时还没有可用的指标。</p>
<table class="ui table celled selectable" v-if="items.length > 0">
    <thead>
    <tr>
        <th>指标名称</th>
        <th>统计对象</th>
        <th>统计周期</th>
        <th class="three wide">统计数值</th>
        <th class="two wide">状态</th>
        <th class="two op">操作</th>
    </tr>
    </thead>
    <tr v-for="item in items">
        <td>{{item.name}}
            <div style="margin-top: 0.3em" v-if="item.isPublic || item.code.length > 0">
                <span class="ui label olive tiny basic" v-if="item.isPublic">公用</span>
                <span class="ui label olive tiny basic" v-if="item.code.length > 0">内置</span>
            </div>
        </td>
        <td>
            <div v-if="item.keys != null" v-for="key in item.keys" style="margin-top: 0.2em; margin-bottom: 0.2em"><metric-key-label :v-key="key"></metric-key-label></div>
        </td>
        <td>
            {{item.period}} {{item.periodUnitName}}
        </td>
        <td>
            <span class="ui label small basic">{{item.valueName}}</span>
        </td>
        <td>
            <label-on :v-is-on="item.isOn"></label-on>
        </td>
        <td>
            <a href="" @click.prevent="addItem(item)" v-if="!item.isChecked">添加</a>
            <a href="" @click.prevent="removeItem(item)" v-if="item.isChecked"><span class="grey">已添加</span></a>
        </td>
    </tr>
</table>

<div class="page" v-html="page"></div>