123456789101112131415161718192021222324252627282930 |
- 'use strict';
- /**
- * 指标模板控制器
- *
- * @author Mai
- * @data 2018/4/19
- * @version
- */
- module.exports = app => {
- class TemplateController extends app.BaseController {
- /**
- * 指标模板页面
- *
- * @param {object} ctx - egg全局context
- * @return {void}
- */
- async index (ctx) {
- const node = await ctx.service.templateNode.getAllDataByCondition({template_id: 1});;
- const treeNode = ctx.helper.convertData(node, true, 'node_id', 'node_pid');
- const renderData = {
- nodes: JSON.stringify(treeNode),
- }
- await this.layout('template/index.ejs', renderData, 'template/modal.ejs');
- }
- }
- return TemplateController;
- }
|