UNPKG

@jdlinker/linker

Version:

jdLinker 系统模块

248 lines (246 loc) 5.1 kB
import { BasicColumn, FormSchema, render } from '@jdlinker/ui'; //列表数据 export const columns: BasicColumn[] = [ { title: '名称', align: 'center', dataIndex: 'name', }, { title: '流应用名', align: 'center', dataIndex: 'app', }, { title: '流ID', align: 'center', dataIndex: 'stream', }, { title: '流地址', align: 'center', dataIndex: 'url', }, { title: '流媒体', align: 'center', dataIndex: 'mediaServerId', }, { title: '类型', align: 'center', dataIndex: 'type', }, { title: '国标编码', align: 'center', dataIndex: 'gbId', }, { title: '状态', align: 'center', dataIndex: 'status', customRender: ({ text }) => { let str = '在线'; let color = 'grey'; if (text) { str = '在线'; color = 'blue'; } else { str = '离线'; color = 'grey'; } return render.renderTag(str, color); }, }, { title: '启用', align: 'center', dataIndex: 'enable', customRender: ({ text }) => { let str = '已启用'; let color = 'grey'; if (text) { str = '已启用'; color = 'blue'; } else { str = '未启用'; color = 'grey'; } return render.renderTag(str, color); }, }, { title: '创建时间', align: 'center', dataIndex: 'createTime', }, { title: '转HLS', align: 'center', dataIndex: 'enable_hls', customRender: ({ text }) => { let str = '已启用'; let color = 'grey'; if (text) { str = '已启用'; color = 'blue'; } else { str = '未启用'; color = 'grey'; } return render.renderTag(str, color); }, }, { title: 'MP4录制', align: 'center', dataIndex: 'enable_mp4', customRender: ({ text }) => { let str = '已启用'; let color = 'grey'; if (text) { str = '已启用'; color = 'blue'; } else { str = '未启用'; color = 'grey'; } return render.renderTag(str, color); }, }, { title: '无人观看自动删除', align: 'center', dataIndex: 'enable_remove_none_reader', customRender: ({ text }) => { let str = '已启用'; let color = 'grey'; if (text) { str = '已启用'; color = 'blue'; } else { str = '未启用'; color = 'grey'; } return render.renderTag(str, color); }, }, ]; //查询数据 export const searchFormSchema: FormSchema[] = [ { label: '名称', field: 'name', component: 'Input', }, { label: '流应用名', field: 'app', component: 'Input', }, ]; //表单数据 export const formSchema: FormSchema[] = [ { label: '类型', field: 'type', component: 'JDictSelectTag', componentProps: { dictCode: 'streamProxy_type', }, dynamicRules: () => { return [{ required: true, message: '请选择类型!' }]; }, }, { label: '名称', field: 'name', component: 'Input', dynamicRules: () => { return [{ required: true, message: '请输入名称!' }]; }, }, { label: '流应用名称', field: 'app', component: 'Input', dynamicRules: () => { return [{ required: true, message: '请输入流名称!' }]; }, }, { label: '流ID', field: 'stream', component: 'Input', dynamicRules: () => { return [{ required: true, message: '请输入流ID!' }]; }, }, { label: '拉流地址', field: 'url', component: 'Input', ifShow: ({ values }) => values.type == 'default', dynamicRules: () => { return [{ required: true, message: '请输入拉流地址!' }]; }, }, { label: '拉流地址', field: 'src_url', component: 'Input', ifShow: ({ values }) => values.type == 'ffmpeg', dynamicRules: () => { return [{ required: true, message: '请输入拉流地址!' }]; }, }, { label: '超时时间:毫秒', field: 'firmware', component: 'Input', ifShow: ({ values }) => values.type == 'ffmpeg', dynamicRules: () => { return [{ required: true, message: '请输入超时时间!' }]; }, }, { label: '节点选择', field: 'mediaServerId', component: 'Input', }, { label: 'FFmpeg命令模板', field: 'ffmpeg_cmd_key', component: 'Input', ifShow: ({ values }) => values.type == 'ffmpeg', }, { label: '国标编码', field: 'gbId', component: 'Input', }, { label: '拉流方式', field: 'rtp_type', component: 'Input', ifShow: ({ values }) => values.type == 'default', }, { label: '国标平台', field: 'platformGbId', component: 'Input', }, { label: '其他选项', field: 'enable', component: 'Input', }, // TODO 主键隐藏字段,目前写死为ID { label: '', field: 'id', component: 'Input', show: false, }, ];