| | |
| | | * @param {*} card |
| | | * @param {*} type |
| | | */ |
| | | export function getCardCellForm (card, type, subtype, cardCell) { |
| | | export function getCardCellForm (card, type, subtype, cardCell, anchors) { |
| | | let _options = [ |
| | | { value: 'text', text: '文本'}, |
| | | { value: 'number', text: '数值'}, |
| | |
| | | } |
| | | } |
| | | |
| | | let dataTypes = [ |
| | | { value: 'dynamic', text: '动态' }, |
| | | { value: 'static', text: '静态' } |
| | | ] |
| | | let tooltip = '' |
| | | if (cardCell.$cardType === 'extendCard') { |
| | | // card.datatype = 'static' |
| | | // dataTypes = [ |
| | | // { value: 'static', text: '静态' } |
| | | // ] |
| | | tooltip = '在扩展卡片中,动态数据显示值为获取到的第一行数据。' |
| | | } |
| | | |
| | |
| | | initVal: card.datatype || 'static', |
| | | tooltip, |
| | | required: true, |
| | | options: dataTypes |
| | | options: [ |
| | | { value: 'dynamic', text: '动态' }, |
| | | { value: 'static', text: '静态' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | min: 0, |
| | | label: '内容', |
| | | initVal: card.value || '', |
| | | tooltip: '文本类型,会替换内容中的@username@、@fullName@、@login_city@。', |
| | | tooltip: '文本类型,会替换内容中的@username@、@fullName@、@mk_city@、@appname@、@bid@。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'file', |
| | | key: 'url', |
| | | label: '图片/文件', |
| | | tooltip: '使用静态图片时,@icon@代表头像。', |
| | | initVal: card.url || '', |
| | | maxfile: 1, |
| | | required: true |
| | |
| | | ] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'startTime', |
| | | precision: 0, |
| | | label: '开始时间', |
| | | initVal: card.startTime || 0, |
| | | tooltip: '视频开始播放的时间,用于调整视频初始化展示的界面。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'posterType', |
| | | label: '预览图', |
| | | initVal: card.posterType || '', |
| | | required: false, |
| | | options: [ |
| | | { value: '', text: '无' }, |
| | | { value: 'dynamic', text: '动态' }, |
| | | { value: 'static', text: '静态' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'file', |
| | | key: 'posterUrl', |
| | | label: '预览地址', |
| | | initVal: card.posterUrl || '', |
| | | maxfile: 1, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'posterField', |
| | | label: '预览地址', |
| | | initVal: card.posterField || '', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'decimal', |
| | | min: 0, |
| | | max: 18, |
| | | decimal: 0, |
| | | label: '小数位', |
| | | initVal: card.decimal === undefined ? '' : card.decimal, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'format', |
| | | label: '格式化', |
| | |
| | | { value: 'percent', text: '百分数' }, |
| | | { value: 'thdSeparator', text: '千分位' }, |
| | | { value: 'abs', text: '绝对值' }, |
| | | { value: 'encryption', text: '加密'}, |
| | | { value: 'YYYY-MM-DD', text: 'YYYY-MM-DD' }, |
| | | { value: 'YYYY-MM-DD HH:mm', text: 'YYYY-MM-DD HH:mm' }, |
| | | { value: 'YYYY-MM-DD HH:mm:ss', text: 'YYYY-MM-DD HH:mm:ss' }, |
| | | { value: 'MM月DD日', text: 'MM月DD日' }, |
| | | { value: 'YYYY年MM月DD日', text: 'YYYY年MM月DD日' }, |
| | | { value: 'HH:mm', text: '时分(例:16:57)' }, |
| | |
| | | { value: 'YYYY-MM-DD HH:mm', text: 'YYYY-MM-DD HH:mm' }, |
| | | { value: 'YYYY-MM-DD HH:mm:ss', text: 'YYYY-MM-DD HH:mm:ss' }, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'decimal', |
| | | min: 0, |
| | | max: 18, |
| | | decimal: 0, |
| | | label: '小数位', |
| | | initVal: card.decimal === undefined ? '' : card.decimal, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | min: 1, |
| | | max: 10, |
| | | label: '高度(行)', |
| | | initVal: card.height, |
| | | tooltip: '内容显示行数,值为空时高度自适应,注:自适应高度仅在设置卡片高度后有效。', |
| | | initVal: card.height !== undefined ? card.height : 1, |
| | | tooltip: '内容显示行数,值为空时高度自适应。', |
| | | required: false |
| | | }, |
| | | { |
| | |
| | | required: false, |
| | | allowClear: true, |
| | | options: [] |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | key: 'anchors', |
| | | label: '跳转锚点', |
| | | initVal: card.anchors || [], |
| | | tooltip: sessionStorage.getItem('appType') === 'mob' ? '注:小程序中无效' : '', |
| | | required: false, |
| | | options: anchors |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | min: 0, |
| | | max: 50, |
| | | label: '线宽', |
| | | initVal: card.borderWidth || 1, |
| | | initVal: card.borderWidth === undefined ? 1 : card.borderWidth, |
| | | tooltip: '线宽为0时,为方便在开发时选中默认高度为10px,请注意调整内外边距。', |
| | | required: true |
| | | }, |
| | | { |
| | |
| | | label: '最大宽度', |
| | | initVal: card.maxWidth || '', |
| | | tooltip: '图片宽度的最大值。', |
| | | help: '注:此值存在时,左右外边距为0居中显示。', |
| | | required: false, |
| | | }, |
| | | { |
| | |
| | | initVal: card.link || '', |
| | | tooltip: '动态地址为绑定字段值。', |
| | | required: false, |
| | | // forbid: isApp, |
| | | options: [ |
| | | { value: '', text: '无' }, |
| | | { value: 'dynamic', text: '动态' }, |
| | |
| | | label: '链接类型', |
| | | initVal: card.linkType || 'other', |
| | | required: false, |
| | | // forbid: isApp, |
| | | options: [ |
| | | { value: 'tel', text: '电话' }, |
| | | { value: 'email', text: '邮箱' }, |
| | |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'copyable', |
| | | label: '可复制', |
| | | initVal: card.copyable || 'false', |
| | | tooltip: '元素是否可复制,复制内容不包括前缀与后缀。', |
| | | required: false, |
| | | options: [ |
| | | { value: 'true', text: '是' }, |
| | | { value: 'false', text: '否' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'fixSize', |
| | | min: 10, |
| | | max: 100, |
| | | max: 300, |
| | | label: '字体大小', |
| | | initVal: card.fixSize || 14, |
| | | tooltip: '前缀、后缀的字体大小。', |