| | |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | |
| | | const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | |
| | | /** |
| | | * @description 获取显示列表单配置信息 |
| | | * @param {object} card // 搜索条件对象 |
| | | */ |
| | | export function getColumnForm (card, fields = []) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | export function getColumnForm (card, fields = [], columns = [], wrap) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | if (roleList) { |
| | | try { |
| | |
| | | roleList = [] |
| | | } |
| | | |
| | | let menulist = [] |
| | | |
| | | if (appType === 'pc') { |
| | | menulist = sessionStorage.getItem('appMenus') |
| | | } else if (!appType) { |
| | | menulist = sessionStorage.getItem('fstMenuList') |
| | | } |
| | | |
| | | if (menulist) { |
| | | try { |
| | | menulist = JSON.parse(menulist) |
| | | } catch (e) { |
| | | menulist = [] |
| | | } |
| | | } else { |
| | | menulist = [] |
| | | if (['picture', 'link'].includes(card.type)) { |
| | | card.type = 'text' |
| | | } |
| | | |
| | | let options = [{ |
| | | value: 'text', |
| | | text: Formdict['model.form.text'] |
| | | text: '文本' |
| | | }, { |
| | | value: 'number', |
| | | text: Formdict['model.form.number'] |
| | | }, { |
| | | value: 'picture', |
| | | text: Formdict['model.form.picture'] |
| | | }, { |
| | | value: 'link', |
| | | text: Formdict['model.form.href'] |
| | | }, { |
| | | value: 'textarea', |
| | | text: Formdict['model.form.textarea'] |
| | | text: '数字' |
| | | }, { |
| | | value: 'custom', |
| | | text: '自定义列' |
| | | }, { |
| | | value: 'formula', |
| | | text: '公式' |
| | | }, { |
| | | value: 'textarea', |
| | | text: '多行文本' |
| | | }, { |
| | | value: 'colspan', |
| | | text: '合并列' |
| | | }, { |
| | | value: 'extend', |
| | | text: '扩展列' |
| | | }, { |
| | | value: 'index', |
| | | text: '序号' |
| | | }] |
| | | |
| | | if (!card.isSub) { |
| | | options.push({ |
| | | value: 'action', |
| | | text: '操作' |
| | | let editCols = [ |
| | | // { |
| | | // field: '$sub', |
| | | // label: '提交' |
| | | // }, |
| | | { |
| | | field: '$noAct', |
| | | label: '无动作' |
| | | }, |
| | | { |
| | | field: '$next', |
| | | label: '下一行' |
| | | } |
| | | ] |
| | | |
| | | if (card.enter === '$sub') { |
| | | card.enter = '$noAct' |
| | | } |
| | | if (wrap.commit === 'change') { |
| | | editCols[0].label = '失去焦点' |
| | | } |
| | | |
| | | let cols = [] |
| | | let getcols = (columns, suplabel = '') => { |
| | | columns.forEach(col => { |
| | | if (col.editable === 'true' && col.uuid !== card.uuid) { |
| | | cols.push({ |
| | | field: col.uuid, |
| | | label: suplabel + col.label |
| | | }) |
| | | } else if (col.type === 'colspan') { |
| | | getcols(col.subcols, col.label + '-') |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (!card.linkurl && (!card.linkmenu || card.linkmenu.length === 0)) { |
| | | card.perspective = '' |
| | | getcols(columns) |
| | | |
| | | editCols.push(...cols) |
| | | |
| | | cols.forEach(col => { |
| | | editCols.push({ |
| | | field: '$next_' + col.field, |
| | | label: col.label + '(下一行)' |
| | | }) |
| | | }) |
| | | |
| | | editCols.push({ |
| | | field: '$next_' + card.uuid, |
| | | label: card.label + '(下一行)' |
| | | }) |
| | | |
| | | if (wrap.commit === 'change') { |
| | | editCols.push({ |
| | | field: '$noActX', |
| | | label: '无动作', |
| | | disabled: card.editType !== 'select' |
| | | }) |
| | | } else if (card.enter === '$noActX') { |
| | | card.enter = '$noAct' |
| | | } |
| | | |
| | | return [ |
| | |
| | | { |
| | | type: 'select', |
| | | key: 'type', |
| | | label: Formdict['model.form.type'], |
| | | label: '类型', |
| | | initVal: card.type, |
| | | required: true, |
| | | options: options |
| | |
| | | { |
| | | type: 'select', |
| | | key: 'field', |
| | | label: Formdict['model.form.field'], |
| | | label: '字段', |
| | | initVal: card.field, |
| | | required: true, |
| | | options: fields |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'nameField', |
| | | label: Formdict['model.name'] + Formdict['model.form.field'], |
| | | initVal: card.nameField || '', |
| | | required: false, |
| | | options: [{uuid: 'empty', field: '', label: '空'}, ...fields] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'Width', |
| | | min: 20, |
| | | max: 1000, |
| | | decimal: 0, |
| | | label: Formdict['model.form.columnWidth'], |
| | | precision: 0, |
| | | label: '列宽', |
| | | initVal: card.Width || 120, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'joint', |
| | | label: Formdict['model.form.paramJoint'], |
| | | initVal: card.joint || 'true', |
| | | required: true, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'Hide', |
| | | label: Formdict['model.hidden'], |
| | | label: '隐藏', |
| | | initVal: card.Hide || 'false', |
| | | required: true, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'IsSort', |
| | | label: Formdict['model.sort'], |
| | | initVal: card.IsSort || 'true', |
| | | label: '排序', |
| | | initVal: card.IsSort || (card.isSub || card.type === 'custom' ? 'false' : 'true'), |
| | | required: true, |
| | | forbidden: card.isSub, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'sortField', |
| | | label: '排序字段', |
| | | initVal: card.sortField || '', |
| | | required: true, |
| | | options: fields |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'eval', |
| | | label: '解析方式', |
| | | initVal: card.eval || 'false', |
| | | tooltip: '当公式内容涉及计算时请选择“计算”,当公式内容为字段拼接时请选择“字段替换”,使用函数时入参为data(数组)。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'false', |
| | | text: '字段替换' |
| | | }, { |
| | | value: 'true', |
| | | text: '计算' |
| | | }, { |
| | | value: 'func', |
| | | text: '函数' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'Align', |
| | | label: Formdict['model.form.align'], |
| | | label: '对齐方式', |
| | | initVal: card.Align || 'left', |
| | | required: true, |
| | | options: [{ |
| | | value: 'left', |
| | | text: Formdict['model.form.alignLeft'] |
| | | text: '左对齐' |
| | | }, { |
| | | value: 'center', |
| | | text: Formdict['model.form.alignCenter'] |
| | | text: '居中' |
| | | }, { |
| | | value: 'right', |
| | | text: Formdict['model.form.alignRight'] |
| | | text: '右对齐' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'rowspan', |
| | | label: '行合并', |
| | | initVal: card.rowspan || 'false', |
| | | tooltip: '相邻行信息相同时,单元格合并。', |
| | | required: false, |
| | | key: 'colUnit', |
| | | label: '单位', |
| | | initVal: card.colUnit || 'day', |
| | | required: true, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | value: 'day', |
| | | text: '天' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | value: 'hour', |
| | | text: '小时' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'shift', |
| | | label: '偏移量', |
| | | initVal: card.shift || 0, |
| | | min: -1000, |
| | | max: 1000, |
| | | decimal: 0, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'quota', |
| | | label: '指标数', |
| | | initVal: card.quota || 7, |
| | | min: 1, |
| | | max: 1000, |
| | | decimal: 0, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'dayFormat', |
| | | label: '格式化', |
| | | initVal: card.dayFormat || 'M/DD', |
| | | required: true, |
| | | options: [{ |
| | | value: 'M/DD', |
| | | label: 'M/DD(4/29)' |
| | | }, { |
| | | value: 'M-DD', |
| | | label: 'M-DD(4-29)' |
| | | }, { |
| | | value: 'M月DD日', |
| | | label: 'M月DD日(4月29日)' |
| | | }, { |
| | | value: 'M/DD week', |
| | | label: 'M/DD week(4/29 星期一)' |
| | | }, { |
| | | value: 'M-DD week', |
| | | label: 'M-DD week(4-29 星期一)' |
| | | }, { |
| | | value: 'M月DD日 week', |
| | | label: 'M月DD日 week(4月29日 星期一)' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'hourFormat', |
| | | label: '格式化', |
| | | initVal: card.hourFormat || 'H:00', |
| | | required: true, |
| | | options: [{ |
| | | value: 'H:00', |
| | | label: 'H:00(15:00)' |
| | | }, { |
| | | value: 'H point', |
| | | label: 'H(15点)' |
| | | }, { |
| | | value: 'h:00', |
| | | label: 'h:00(3:00 pm)' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'supField', |
| | | label: '上级字段', |
| | | initVal: card.supField || '', |
| | | tooltip: '来源于上级组件的字段集(上级组件为空时从url参数中选取),该字段值(用逗号分隔)可控制扩展列的列名。', |
| | | required: false, |
| | | rules: [{ |
| | | pattern: /^[0-9a-zA-Z_]*$/ig, |
| | | message: '字段名只允许包含数字、字母以及_' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'sum', |
| | | label: '显示合计', |
| | | initVal: card.sum || 'false', |
| | | tooltip: '合计信息只在使用系统数据源时有效。', |
| | | key: 'editable', |
| | | label: '可编辑', |
| | | initVal: card.editable || 'false', |
| | | required: true, |
| | | options: [{ |
| | | value: 'false', |
| | | text: '否' |
| | | }, { |
| | | value: 'true', |
| | | text: '是' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'editType', |
| | | label: '编辑类型', |
| | | initVal: card.editType || 'text', |
| | | required: true, |
| | | options: [{ |
| | | value: 'text', |
| | | text: '文本' |
| | | }, { |
| | | value: 'select', |
| | | text: '下拉' |
| | | }, { |
| | | value: 'switch', |
| | | text: '开关' |
| | | }, { |
| | | value: 'date', |
| | | text: '日期(天)' |
| | | }, { |
| | | value: 'popSelect', |
| | | text: '选择器' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'precision', |
| | | label: '精确度', |
| | | initVal: card.precision || 'day', |
| | | options: [{ |
| | | value: 'day', |
| | | text: '天' |
| | | }, { |
| | | value: 'hour', |
| | | text: '小时' |
| | | }, { |
| | | value: 'minute', |
| | | text: '分钟' |
| | | }, { |
| | | value: 'second', |
| | | text: '秒' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'declareType', |
| | | label: '数据类型', |
| | | tooltip: '声明变量时的类型,时间格式datetime或文本格式nvarchar(50)。', |
| | | initVal: card.declareType || 'datetime', |
| | | options: [{ |
| | | value: 'datetime', |
| | | text: 'datetime' |
| | | }, { |
| | | value: 'nvarchar(50)', |
| | | text: 'nvarchar(50)' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'required', |
| | | label: '必填', |
| | | initVal: card.required || 'false', |
| | | required: false, |
| | | options: [{ |
| | | value: 'false', |
| | | text: '否' |
| | | }, { |
| | | value: 'true', |
| | | text: '是' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'initval', |
| | | label: '默认值', |
| | | initVal: card.initval, |
| | | tooltip: '使用$copy时,表示新增时复制上一行信息。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'openVal', |
| | | label: '开启值', |
| | | initVal: card.openVal || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'closeVal', |
| | | label: '关闭值', |
| | | initVal: card.closeVal || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'openText', |
| | | label: '开启提示', |
| | | initVal: card.openText || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'closeText', |
| | | label: '关闭提示', |
| | | initVal: card.closeText || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'resourceType', |
| | | label: '选项来源', |
| | | initVal: card.resourceType || '0', |
| | | required: true, |
| | | options: [{ |
| | | value: '0', |
| | | text: '自定义' |
| | | }, { |
| | | value: '1', |
| | | text: '数据源' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'options', |
| | | key: 'options', |
| | | label: '选项', |
| | | initVal: card.options || [], |
| | | required: true, |
| | | }, |
| | | { |
| | | type: 'codemirror', |
| | | key: 'dataSource', |
| | | label: '数据源', |
| | | initVal: card.dataSource || '', |
| | | placeholder: '系统变量:mk_departmentcode、mk_organization、mk_user_type。公共值@BID@。', |
| | | required: true, |
| | | }, |
| | | { |
| | | type: 'fields', |
| | | key: 'columns', |
| | | label: '字段集', |
| | | initVal: card.columns || [], |
| | | required: true, |
| | | readonly: false, |
| | | columns: [ |
| | | { |
| | | title: '名称', |
| | | dataIndex: 'label', |
| | | inputType: 'input', |
| | | editable: true, |
| | | initval: 'label', |
| | | width: '20%' |
| | | }, |
| | | { |
| | | title: '字段', |
| | | dataIndex: 'field', |
| | | inputType: 'input', |
| | | editable: true, |
| | | unique: true, |
| | | strict: true, |
| | | copy: true, |
| | | initval: 'field', |
| | | rules: [{ |
| | | pattern: /^[\u4E00-\u9FA50-9a-zA-Z_-]*$/ig, |
| | | message: '请使用数字、字母、汉字以及_-' |
| | | }], |
| | | width: '20%' |
| | | }, |
| | | { |
| | | title: '隐藏', |
| | | dataIndex: 'Hide', |
| | | inputType: 'radio', |
| | | editable: true, |
| | | width: '20%', |
| | | initval: 'false', |
| | | options: [ |
| | | {value: 'true', text: '是'}, |
| | | {value: 'false', text: '否'}, |
| | | ], |
| | | render: (text, record) => { |
| | | if (text === 'true') { |
| | | return '是' |
| | | } else { |
| | | return '否' |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: '排序', |
| | | dataIndex: 'IsSort', |
| | | inputType: 'radio', |
| | | editable: true, |
| | | width: '20%', |
| | | initval: 'false', |
| | | options: [ |
| | | {value: 'true', text: '是'}, |
| | | {value: 'false', text: '否'}, |
| | | ], |
| | | render: (text, record) => { |
| | | if (text === 'true') { |
| | | return '是' |
| | | } else { |
| | | return '否' |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: '列宽', |
| | | dataIndex: 'Width', |
| | | inputType: 'number', |
| | | editable: true, |
| | | width: '20%', |
| | | initval: 120 |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'primaryKey', |
| | | label: '主键', |
| | | initVal: card.primaryKey || '', |
| | | required: true, |
| | | readonly: false, |
| | | options: 'columns' |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'order', |
| | | label: '默认排序', |
| | | initVal: card.order || '', |
| | | placeholder: 'ID asc', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'showField', |
| | | label: '显示字段', |
| | | initVal: card.showField || '', |
| | | tooltip: '用于控制单元格中的显示内容。', |
| | | required: false, |
| | | options: 'columns' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'controlField', |
| | | label: '禁用字段', |
| | | initVal: card.controlField || '', |
| | | tooltip: '用于控制行数据是否可选择。字段值为true时,选项不可选。', |
| | | required: false, |
| | | allowClear: true, |
| | | joint: true, |
| | | options: 'columns' |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'searchKey', |
| | | label: '搜索字段', |
| | | initVal: card.searchKey || '', |
| | | tooltip: '多个值请用逗号分隔。', |
| | | required: false, |
| | | rules: [{ |
| | | pattern: /^[0-9a-zA-Z,_-]*$/ig, |
| | | message: '字段名只允许包含数字、字母以及_-', |
| | | }] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'popWidth', |
| | | label: '弹窗宽度', |
| | | initVal: card.popWidth || 60, |
| | | tooltip: '小于100时为百分率,大于100时为绝对值。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'laypage', |
| | | label: '分页', |
| | | initVal: card.laypage || 'true', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'onload', |
| | | label: '初始化', |
| | | initVal: card.onload || 'true', |
| | | tooltip: '当没有设置搜索字段时,初始化加载数据。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '加载' |
| | | }, { |
| | | value: 'false', |
| | | text: '不加载' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'cache', |
| | | label: '选项查询', |
| | | initVal: card.cache || 'true', |
| | | tooltip: '数据查询是否使用缓存。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '缓存' |
| | | }, { |
| | | value: 'false', |
| | | text: '实时' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'valueField', |
| | | label: '值·字段', |
| | | initVal: card.valueField || '', |
| | | required: true, |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'valueText', |
| | | label: '文本·字段', |
| | | initVal: card.valueText || '', |
| | | required: true, |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'orderBy', |
| | | label: '排序·字段', |
| | | initVal: card.orderBy || '', |
| | | required: false, |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'orderType', |
| | | label: '排序方式', |
| | | initVal: card.orderType || 'asc', |
| | | options: [{ |
| | | value: 'asc', |
| | | text: '正序' |
| | | }, { |
| | | value: 'desc', |
| | | text: '倒序' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'disableField', |
| | | label: '禁用·字段', |
| | | initVal: card.disableField || '', |
| | | tooltip: '设置禁用字段,且字段值为true时,选项不可选。', |
| | | required: false, |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'dropdown', |
| | | label: '下拉宽度', |
| | | initVal: card.dropdown || 'flex', |
| | | required: false, |
| | | options: [{ |
| | | value: 'flex', |
| | | text: '自适应' |
| | | }, { |
| | | value: 'fixed', |
| | | text: '定宽' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'database', |
| | | label: '数据库', |
| | | initVal: card.database || 'local', |
| | | options: [{ |
| | | value: 'local', |
| | | text: '本地' |
| | | }, { |
| | | value: 'sso', |
| | | text: '单点' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'enter', |
| | | label: '回车切换', |
| | | initVal: card.enter || '$noAct', |
| | | tooltip: '包括文本或数值回车事件、下拉菜单、选择器、时间变化事件、开关切换事件。', |
| | | options: editCols |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'ctrlField', |
| | | label: '禁止编辑', |
| | | initVal: card.ctrlField || '', |
| | | tooltip: '控制单元格是否可以编辑。', |
| | | allowClear: true, |
| | | required: false, |
| | | options: fields |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'ctrlValue', |
| | | label: '禁止值', |
| | | initVal: card.ctrlValue || '', |
| | | tooltip: '多个值用逗号分隔。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'clearField', |
| | | label: '清空字段', |
| | | initVal: card.clearField || '', |
| | | tooltip: '当前字段编辑时需要清空的字段。', |
| | | allowClear: true, |
| | | required: false, |
| | | options: fields |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'decimal', |
| | | min: 0, |
| | | max: 18, |
| | | decimal: 0, |
| | | label: Formdict['header.form.decimal'], |
| | | initVal: card.decimal || 0, |
| | | required: true |
| | | precision: 0, |
| | | label: '小数位', |
| | | initVal: card.decimal, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'min', |
| | | label: '最小值', |
| | | initVal: card.min, |
| | | unlimit: true, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'max', |
| | | label: '最大值', |
| | | initVal: card.max, |
| | | unlimit: true, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'format', |
| | | label: Formdict['header.form.format'], |
| | | label: '格式化', |
| | | initVal: card.format || 'none', |
| | | options: [{ |
| | | value: 'none', |
| | | text: Formdict['model.empty'] |
| | | text: '无' |
| | | }, { |
| | | value: 'thdSeparator', |
| | | text: Formdict['header.form.thdSeparator'] |
| | | text: '千分位' |
| | | }, { |
| | | value: 'percent', |
| | | text: '百分比' |
| | | }, { |
| | | value: 'abs', |
| | | text: '绝对值' |
| | | }], |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'textFormat', |
| | | label: Formdict['header.form.format'], |
| | | label: '格式化', |
| | | initVal: card.textFormat || 'none', |
| | | options: [{ |
| | | value: 'none', |
| | | text: Formdict['model.empty'] |
| | | text: '无' |
| | | }, { |
| | | value: 'encryption', |
| | | text: '加密' |
| | | }, { |
| | | value: 'YYYY-MM-DD', |
| | | text: 'YYYY-MM-DD' |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'prefix', |
| | | label: Formdict['header.form.prefix'], |
| | | label: '前缀', |
| | | initVal: card.prefix || '', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'postfix', |
| | | label: Formdict['header.form.postfix'], |
| | | label: '后缀', |
| | | initVal: card.postfix || '', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'lenWidRadio', |
| | | label: '长宽比', |
| | | initVal: card.lenWidRadio || '1:1', |
| | | required: true, |
| | | options: [ |
| | | { value: '1:1', text: '1:1' }, |
| | | { value: '4:3', text: '4:3' }, |
| | | { value: '3:2', text: '3:2' }, |
| | | { value: '16:9', text: '16:9' }, |
| | | { value: '2:1', text: '2:1' }, |
| | | { value: '3:1', text: '3:1' }, |
| | | { value: '4:1', text: '4:1' }, |
| | | { value: '5:1', text: '5:1' }, |
| | | { value: '6:1', text: '6:1' }, |
| | | { value: '7:1', text: '7:1' }, |
| | | { value: '8:1', text: '8:1' }, |
| | | { value: '9:1', text: '9:1' }, |
| | | { value: '10:1', text: '10:1' }, |
| | | { value: '3:4', text: '3:4' }, |
| | | { value: '2:3', text: '2:3' }, |
| | | { value: '9:16', text: '9:16' }, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'picSort', |
| | | label: '图片排列', |
| | | initVal: card.picSort || '1', |
| | | tooltip: '同一单元格内,含有多张图片时的列数。', |
| | | required: false, |
| | | options: [{ |
| | | value: '1', |
| | | text: '1' |
| | | }, { |
| | | value: '2', |
| | | text: '2' |
| | | }, { |
| | | value: '3', |
| | | text: '3' |
| | | }, { |
| | | value: '4', |
| | | text: '4' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'scale', |
| | | label: Formdict['header.form.clickscale'], |
| | | initVal: card.scale || 'false', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'perspective', |
| | | label: '字段透视', |
| | | initVal: card.perspective || '', |
| | | options: [{ |
| | | value: '', |
| | | text: '无' |
| | | }, { |
| | | value: 'linkmenu', |
| | | text: '菜单' |
| | | }, { |
| | | value: 'linkurl', |
| | | text: '链接' |
| | | }], |
| | | forbidden: appType === 'mob' |
| | | }, |
| | | { |
| | | type: appType === 'pc' ? 'select' : 'cascader', |
| | | key: 'linkmenu', |
| | | label: Formdict['model.menu'], |
| | | initVal: card.linkmenu || (appType === 'pc' ? '' : []), |
| | | required: true, |
| | | options: menulist, |
| | | forbidden: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | key: 'linkurl', |
| | | label: '链接地址', |
| | | initVal: card.linkurl || '', |
| | | required: true, |
| | | forbidden: appType === 'mob' |
| | | key: 'formula', |
| | | label: '公式', |
| | | initVal: card.formula || '', |
| | | tooltip: '执行时会使用查询到的数据替换相应的字段,展示获得的结果,在不使用解析时换行符或空格会替换为页面元素。可使用JS的一些语法,如:三元表达式 @field1@ > @field2@ ? 0 : 1;Math对象,取绝对值 Math.abs(@field@)、四舍五入 Math.round(@field@)等', |
| | | placeholder: '例如:@price@ * @number@', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | key: 'linkfields', |
| | | label: '关联字段', |
| | | initVal: card.linkfields || [], |
| | | required: false, |
| | | options: fields, |
| | | forbidden: appType === 'mob' |
| | | key: 'linkSubField', |
| | | label: '填充表单', |
| | | tooltip: '在切换选项时会把信息自动填入关联的字段中。', |
| | | initVal: card.linkSubField || [], |
| | | options: fields |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'open', |
| | | label: '打开方式', |
| | | initVal: card.open || 'blank', |
| | | key: 'noValue', |
| | | label: '空值', |
| | | initVal: card.noValue || 'show', |
| | | tooltip: '数值为 0 或时间小于 1949-10-02 时,是否显示', |
| | | required: false, |
| | | forbid: appType !== 'pc', |
| | | options: [ |
| | | { value: 'blank', text: '新窗口' }, |
| | | { value: 'self', text: '当前窗口' } |
| | | ] |
| | | options: [{ |
| | | value: 'show', |
| | | text: '显示' |
| | | }, { |
| | | value: 'hide', |
| | | text: '隐藏' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | key: 'blacklist', |
| | | label: Formdict['header.form.blacklist'], |
| | | label: '黑名单', |
| | | initVal: card.blacklist || [], |
| | | required: false, |
| | | options: roleList |