Skip to content
子凡 edited this page Jul 12, 2019 · 2 revisions

DSL

{
    "id": "template",
    "title": "模板管理",
    "components": {
        "2WEKaVNO": {
            "componentName": "Table",
            "props": {
                "bordered": true,
                "dataSource": "$parent.data",
                "loading": "$parent.loading",
                "rowKey": "id"
            },
            "pe": [
                "dataSource",
                "loading"
            ]
        },
        "46Juzcyx": {
            "componentName": "Request",
            "events": {
                "request-start": "form-submit-123"
            },
            "props": {
                "method": "GET",
                "url": "//one.cool-app.cn/config/tangram/template.json"
            }
        },
        "Tp23lPdS": {
            "componentName": "Form",
            "events": {
                "form-submit": "form-submit-123"
            },
            "props": {
                "formItems": [
                    {
                        "key": "id",
                        "label": "模板 ID",
                        "props": {
                            "placeholder": "模板 ID"
                        },
                        "rules": [
                            {
                                "whitespace": true
                            }
                        ],
                        "type": "Input"
                    },
                    {
                        "key": "name",
                        "label": "模板名",
                        "props": {
                            "placeholder": "模板名"
                        },
                        "rules": [
                            {}
                        ],
                        "type": "Input"
                    },
                    {
                        "key": "status",
                        "label": "状态",
                        "props": {
                            "options": [
                                {
                                    "text": "全部",
                                    "value": ""
                                },
                                {
                                    "text": "未发布",
                                    "value": "10"
                                },
                                {
                                    "text": "已发布",
                                    "value": "20"
                                },
                                {
                                    "text": "已下线",
                                    "value": "30"
                                }
                            ],
                            "placeholder": "State",
                            "value": ""
                        },
                        "rules": [
                            {}
                        ],
                        "type": "Select"
                    }
                ],
                "initRun": true,
                "layout": "inline",
                "submit": true,
                "reset": true
            }
        },
        "eWRhpRV": {
            "componentName": "Page",
            "props": {
                "background": "#ffffff"
            }
        },
        "ps63_4_CQ": {
            "componentName": "TableColumn",
            "props": {
                "dataIndex": "id",
                "key": "id",
                "title": "ID",
                "align": "left"
            }
        },
        "zqIaQNZYw": {
            "componentName": "TableColumn",
            "props": {
                "dataIndex": "name",
                "key": "name",
                "title": "模板名",
                "align": "left"
            }
        },
        "znH02vCOs": {
            "componentName": "TableColumn",
            "props": {
                "dataIndex": "status",
                "key": "status",
                "title": "状态",
                "align": "left"
            }
        },
        "BWmsuug26": {
            "componentName": "TableColumn",
            "props": {
                "dataIndex": "timestampC",
                "key": "timestampC",
                "title": "创建时间",
                "align": "left"
            }
        },
        "mxLzbf-tP": {
            "componentName": "TableColumn",
            "props": {
                "dataIndex": "timestampU",
                "key": "timestampU",
                "title": "操作时间",
                "align": "left"
            }
        },
        "aJqm3nRgP": {
            "componentName": "TableColumn",
            "props": {
                "dataIndex": "action",
                "key": "action",
                "title": "操作",
                "align": "left"
            }
        },
        "ZJRbxO4FZ": {
            "componentName": "Tag",
            "props": {
                "closable": false,
                "color": "$parent.text === '已发布' ? 'green' : 'blue'",
                "visible": true
            },
            "pe": [
                "color"
            ]
        },
        "WaDsI9GtV": {
            "componentName": "Text",
            "props": {
                "value": "$parent.text"
            },
            "pe": [
                "value"
            ]
        },
        "LFmBcj_94": {
            "componentName": "If",
            "props": {
                "value": "$parent.record.status === '未完成'"
            },
            "pe": [
                "value"
            ]
        },
        "aZPc6Tqpj": {
            "componentName": "A",
            "props": {
                "href": "javascript:;",
                "target": "_self"
            },
            "actions": {
                "click": "7GnMOp7Q4"
            }
        },
        "hV9FugqJR": {
            "componentName": "Text",
            "props": {
                "value": "查看"
            }
        },
        "LhuAt0a-W": {
            "componentName": "A",
            "props": {
                "href": "javascript:;",
                "target": "_self"
            },
            "actions": {
                "click": "xbSH0fXaI"
            }
        },
        "5JHMo4bY-": {
            "componentName": "Text",
            "props": {
                "value": "发布"
            }
        },
        "pb_Cyv0mE": {
            "componentName": "Divider",
            "props": {
                "dashed": false,
                "orientation": "center",
                "type": "vertical"
            }
        }
    },
    "pageTree": [
        {
            "key": "eWRhpRV",
            "pKey": "",
            "title": "Page"
        },
        {
            "key": "Tp23lPdS",
            "pKey": "eWRhpRV",
            "title": "Form"
        },
        {
            "key": "46Juzcyx",
            "pKey": "eWRhpRV",
            "title": "Request"
        },
        {
            "key": "2WEKaVNO",
            "pKey": "46Juzcyx",
            "title": "Table"
        },
        {
            "key": "ps63_4_CQ",
            "pKey": "2WEKaVNO",
            "title": "TableColumn"
        },
        {
            "key": "zqIaQNZYw",
            "pKey": "2WEKaVNO",
            "title": "TableColumn"
        },
        {
            "key": "znH02vCOs",
            "pKey": "2WEKaVNO",
            "title": "TableColumn"
        },
        {
            "key": "ZJRbxO4FZ",
            "pKey": "znH02vCOs",
            "title": "Tag"
        },
        {
            "key": "WaDsI9GtV",
            "pKey": "ZJRbxO4FZ",
            "title": "Text"
        },
        {
            "key": "BWmsuug26",
            "pKey": "2WEKaVNO",
            "title": "TableColumn"
        },
        {
            "key": "mxLzbf-tP",
            "pKey": "2WEKaVNO",
            "title": "TableColumn"
        },
        {
            "key": "aJqm3nRgP",
            "pKey": "2WEKaVNO",
            "title": "TableColumn"
        },
        {
            "key": "aZPc6Tqpj",
            "pKey": "aJqm3nRgP",
            "title": "A"
        },
        {
            "key": "hV9FugqJR",
            "pKey": "aZPc6Tqpj",
            "title": "Text"
        },
        {
            "key": "LFmBcj_94",
            "pKey": "aJqm3nRgP",
            "title": "If"
        },
        {
            "key": "pb_Cyv0mE",
            "pKey": "LFmBcj_94",
            "title": "Divider"
        },
        {
            "key": "LhuAt0a-W",
            "pKey": "LFmBcj_94",
            "title": "A"
        },
        {
            "key": "5JHMo4bY-",
            "pKey": "LhuAt0a-W",
            "title": "Text"
        }
    ],
    "actions": [
        {
            "key": "7GnMOp7Q4",
            "name": "查看",
            "code": "function main() {\n  console.log('ctx: ', ctx);\n\talert('查看');\n}"
        },
        {
            "key": "xbSH0fXaI",
            "name": "发布",
            "code": "function main() {\n\talert('发布:接口还没有呢');\n}"
        }
    ]
}
Clone this wiki locally