@sinoform/app-setting

appSetting 为默认全局配置,其中包括表单配置、流程按钮配置、打印输出配置、仪表盘图表配置以及业务逻辑扩展配置。

Usage no npm install needed!

<script type="module">
  import sinoformAppSetting from 'https://cdn.skypack.dev/@sinoform/app-setting';
</script>

README

app-setting

appSetting 为默认全局配置,其中包括表单配置、流程按钮配置、打印输出配置、仪表盘图表配置以及业务逻辑扩展配置。

模块结构:

packages
|__ app-setting
    |__ src
        |__ print-out-config
        |__ form-config
        |__ flow-config
        |__ dashboard-config
        |__ detail-page-extend-config
        |__ index.tsx

对外导出的 appSetting 数据结构如下:

interface AppSetting {
  /**
   * 表单配置
   */
  formConfig: FormConfig;
  /**
   * 流程配置
   */
  flowConfig: FlowConfig;
  /**
   * 打印输出配置
   */
  printOutConfig: PrintOutSetting;
  /**
   * 图表配置
   */
  dashboardConfig: DashboardConfig;
}

使用方式:

import appSetting from '@sinoform/app-setting';

const { formConfig } = appSetting;

formConfig.addField({...}); // 新增字段配置
formConfig.field('input'); // 获取指定type的字段配置
formConfig.formConfigPanel = React.lazy(()=>import('@sinoform/form-config-panel'));  // 指定表单属性设置面板

使用规则:

form-designer模块外,其他模块使用 appSetting 时,均需要从@sinoform/app-setting中直接引入。

form-designer模块中如果需要使用 conifg 配置,方式如下:

const { formConfig } = useFormDesignerFormConfig();

formConfig.field('input'); // 获取表单字段配置