| | |
| | | // import zhCN from '@/locales/zh-CN/model.js' |
| | | // import enUS from '@/locales/en-US/model.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | |
| | | // const Formdict = localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | const Formdict = localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | |
| | | /** |
| | | * @description 获取按钮表单配置信息 |
| | | * @param {*} card 编辑按钮 |
| | | * @param {*} setting 组件配置 |
| | | * @param {*} permFuncField 存储过程可用的开始字段 |
| | | * @param {*} type 按钮类型,用于区分可选的打开方式 |
| | | */ |
| | | export function getCardCellForm (card) { |
| | | export function getCardCellForm (card, type) { |
| | | let _options = [ |
| | | { value: 'text', text: '文本'}, |
| | | { value: 'number', text: '数值'}, |
| | | { value: 'picture', text: '图片'}, |
| | | { value: 'icon', text: '图标'}, |
| | | { value: 'link', text: '链接'}, |
| | | { value: 'slider', text: '进度条'}, |
| | | { value: 'splitline', text: '分割线'}, |
| | | { value: 'barcode', text: '条形码'}, |
| | | { value: 'qrcode', text: '二维码'}, |
| | | { value: 'currentDate', text: '当前时间'}, |
| | | ] |
| | | |
| | | if (type === 'table') { |
| | | _options.push({value: 'sequence', text: '序号'}) |
| | | } |
| | | |
| | | let forms = [ |
| | | { |
| | | type: 'select', |
| | |
| | | label: '元素类型', |
| | | initVal: card.eleType, |
| | | required: true, |
| | | options: [ |
| | | { value: 'text', text: '文本'}, |
| | | { value: 'number', text: '数值'}, |
| | | { value: 'picture', text: '图片'}, |
| | | { value: 'icon', text: '图标'}, |
| | | { value: 'link', text: '链接'}, |
| | | { value: 'slider', text: '进度条'}, |
| | | { value: 'splitline', text: '分割线'}, |
| | | ] |
| | | options: _options |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | options: [] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'value', |
| | | min: 0, |
| | | label: '内容', |
| | | initVal: card.value || '', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'file', |
| | | key: 'url', |
| | | label: '图片', |
| | |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'value', |
| | | min: 0, |
| | | label: '内容', |
| | | initVal: card.value || '', |
| | | required: true |
| | | key: 'label', |
| | | label: '显示信息', |
| | | initVal: card.label || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'labelfield', |
| | | label: '提示字段', |
| | | initVal: card.labelfield || '', |
| | | key: 'format', |
| | | label: '格式化', |
| | | initVal: card.format || '', |
| | | tooltip: '注:百分数、千分位对于数值类型有效,YYYY-MM-DD对于时间类型的文本有效。', |
| | | required: false, |
| | | options: [] |
| | | options: [ |
| | | { value: '', text: '无' }, |
| | | { value: 'percent', text: '百分数' }, |
| | | { value: 'thdSeparator', text: '千分位' }, |
| | | { value: 'YYYY-MM-DD', text: 'YYYY-MM-DD' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'dateFormat', |
| | | label: '格式化', |
| | | initVal: card.dateFormat || 'YYYY-MM-DD', |
| | | required: true, |
| | | options: [ |
| | | { value: 'YYYY-MM-DD', text: 'YYYY-MM-DD' }, |
| | | { value: 'YYYY', text: 'YYYY' }, |
| | | { value: 'YYYY-MM', text: 'YYYY-MM' }, |
| | | { 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: 'text', |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'format', |
| | | label: '格式化', |
| | | initVal: card.format || '', |
| | | tooltip: '注:百分数、千分位对于数值类型有效,YYYY-MM-DD对于时间类型的文本有效。', |
| | | required: false, |
| | | options: [ |
| | | { value: '', text: '无' }, |
| | | { value: 'percent', text: '百分数' }, |
| | | { value: 'thdSeparator', text: '千分位' }, |
| | | { value: 'YYYY-MM-DD', text: 'YYYY-MM-DD' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'color', |
| | | key: 'color', |
| | | label: '颜色', |
| | | initVal: card.color, |
| | | initVal: card.color || 'rgba(0, 0, 0, 0.85)', |
| | | required: true |
| | | }, |
| | | { |
| | |
| | | min: 1, |
| | | max: 24, |
| | | precision: 0, |
| | | label: '宽度', |
| | | label: '元素宽度', |
| | | initVal: card.width || 12, |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | required: true |
| | |
| | | label: '高度(行)', |
| | | initVal: card.height || 1, |
| | | required: true, |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'barHeight', |
| | | min: 5, |
| | | max: 50, |
| | | label: '高度', |
| | | initVal: card.barHeight || 25, |
| | | required: true, |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'qrWidth', |
| | | min: 5, |
| | | max: 500, |
| | | label: '宽度', |
| | | initVal: card.qrWidth || 50, |
| | | required: true, |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'interval', |
| | | min: 0.1, |
| | | max: 10, |
| | | precision: 1, |
| | | label: '线条间隔', |
| | | initVal: card.interval || 1, |
| | | required: true, |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'displayValue', |
| | | label: '显示值', |
| | | initVal: card.displayValue || 'false', |
| | | required: false, |
| | | options: [ |
| | | { value: 'true', text: '是' }, |
| | | { value: 'false', text: '否' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'borderWidth', |
| | | min: 0, |
| | | max: 50, |
| | | label: '线宽', |
| | | initVal: card.borderWidth || 1, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'radius', |
| | | label: '圆角', |
| | | initVal: card.radius || 'false', |
| | | key: 'joint', |
| | | label: Formdict['model.form.paramJoint'], |
| | | initVal: card.joint || 'true', |
| | | required: false, |
| | | options: [ |
| | | { value: 'true', text: '有' }, |
| | | { value: 'false', text: '无' } |
| | | ] |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | }] |
| | | }, |
| | | ] |
| | | |