epmp-cli
Version:
A simple init for epm scaffolding projects.
56 lines (51 loc) • 1.33 kB
JavaScript
/**
* @file 文件用法定位:该js文件用于获取页面模板数据,并做主流程的处理
* 1、此文件不真正处理 modifierMeta、renderItem ,只做相关操作的函数调用。真正修改在modifierMeta文件夹下,以组件编码命名的js文件内处理
* 2、其他。
*/
import EpmpUtils from 'EpmpUtils';
import { APP_CODE, LIST } from '../../constant';
import modifySystemTableMeta from './modifierMeta/systemTable';
const { page_code } = LIST;
const { getTemplate } = EpmpUtils;
/**
* @method 初始化页面表格数据
* @param {object} props
*/
export default async function initTemplate(props) {
let { template, button, cube } = await getTemplate.call(this, {
appcode: APP_CODE,
pagecode: page_code,
});
if (template) {
//模板
setTemplate.call(this, template); // 设置模板
}
if (button) {
//按钮
setButton.call(this, button); // 设置按钮
}
if (cube) {
this.cube = cube;
}
}
/**
* @method 设置模板meta
* @param {*} meta
*/
function setTemplate(meta) {
let { props } = this;
modifySystemTableMeta.call(this, meta);
props.meta.setMeta(meta);
}
/**
* @method 配置按钮
* @param {*} button
*/
function setButton(button = []) {
let { props } = this;
props.button.setButtons(button);
props.button.setButtonVisible({
Save: false,
});
}