baidu / amis

前端低代码框架,通过 JSON 配置就能生成各种页面。
https://baidu.github.io/amis/
Apache License 2.0
17.4k stars 2.52k forks source link

如何在表格中打开详情,播放此行的视频 #11229

Open Sun-Fish300 opened 1 day ago

Sun-Fish300 commented 1 day ago

实现场景:

在crud中,点击行菜单详情,弹出弹窗后,播放此行的url地址放到video的src中

存在的问题:

不知道如何实现video中的src动态变为行内的url

当前方案:

{ "type: 'page'," + "body: {" + "type: 'crud'," +

                    "api: " +
                    "{method: 'get'," +
                    "url: '/api/sp/farms/shrimp_net_task'," +
                    "headers: " +
                    "{authorization: 'aa'}" +
                    "}," +

                    "tableLayout: 'fixed'," +
                    "itemActions: [{" +
                    "label: '详情'," +
                    "type: 'button'," +
                    "actionType: 'dialog'," +
                    "dialog: {" +
                    "title: '详情'," +
                    "type: 'form'," +
                    "body: [" +

                    "{label: 'id'," +
                    "name: 'id'," +
                    "type: 'static'}," +

                    "{name: 'show_video_url'," +
                    "label: '视频url'," +
                    "type: 'static'}," +

                    "{type: 'video'," +
                    "src: 'https://amis.bj.bcebos.com/amis/2019-12/1577157317579/trailer_hd.mp4'," +
                    "poster: 'https://internal-amis-res.cdn.bcebos.com/images/2019-12/1577157239810/da6376bf988c.png'}," +

                    "{name: 'model_version'," +
                    "label: '模型'," +
                    "type: 'static'}]," +
                    "}," +
                    "}]," +

                    "columns: [" +
                    "{name: 'id'," +
                    "label: 'ID'}," +

                    "{name: 'show_video_url'," +
                    "label: '视频url'," +
                    "width: 150}," +

                    "{name: 'model_version'," +
                    "label: '模型'}" +
                    "]," +
                    "}," +
                    "}
github-actions[bot] commented 1 day ago

👍 Thanks for this! 🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.