1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <div class="panel-sidebar">
- <div class="panel-title">
- <div class="title-bar">
- <h2 class="">项目节 <a href="#upload" data-toggle="modal" data-target="#upload" class="pull-right mr-3" title="导入项目节"><i class="fa fa-upload"></i></a></h2>
- </div>
- </div>
- <div class="scrollbar-auto">
- <div class="nav-box">
- <ul id="templateNode" class="ztree"></ul>
- </div>
- </div>
- </div>
- <div class="panel-content">
- <div class="panel-title">
- <div class="title-main">
- <h2>
- <%= selectNode.code %> <%= selectNode.name %>
- <a href="#add-index" data-toggle="modal" data-target="#add-index" class="btn btn-primary btn-sm pull-right">添加指标</a>
- </h2>
- </div>
- </div>
- <div class="content-wrap">
- <div class="c-body">
- <div class="sjs-height-1">
- <table class="table table-bordered">
- <tr>
- <th>指标编号</th>
- <th>指标名称</th>
- <th colspan="2">指标单位</th>
- <th>计算规则</th>
- <th>设置规则</th>
- </tr>
- <% for (const index of selectIndex) { %>
- <tr>
- <td><%= index.code %></td>
- <td><%= index.name %></td>
- <td><%= index.unit1 %></td>
- <td><%= index.unit2 %></td>
- <td><%= index.rule %></td>
- <td><%= index.rule %><a href="#set-count" data-toggle="modal" data-target="#set-count"><i class="fa fa-cog"></i></a></td>
- </tr>
- <% } %>
- </table>
- </div>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- const treeSetting = {
- treeId: 'template',
- view: {showIcon: false},
- data: {
- key: {
- name: 'text',
- }
- }
- };
- const selectNode = '<%- selectNode.node_id %>';
- const treeNode = '<%- nodes %>';
- $(document).ready(function(){
- const loadText = function (arr) {
- for (const a of arr) {
- a.text = a.code + ' ' + a.name;
- if (a.children && a.children.length > 0) {
- loadText(a.children);
- }
- }
- }
- const treeNodeData = treeNode !== '' ? JSON.parse(treeNode) : [];
- loadText(treeNodeData);
- const treeObj = $.fn.zTree.init($("#templateNode"), treeSetting, treeNodeData);
- const node = treeObj.getNodeByParam('node_id', selectNode);
- treeObj.selectNode(node);
- });
- </script>
|