| | |
| | | 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 // 搜索条件对象 |
| | |
| | | roleList = [] |
| | | } |
| | | |
| | | if (['picture', 'link', 'colspan'].includes(card.type)) { |
| | | // if (['picture', 'link', 'colspan'].includes(card.type)) { |
| | | 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'] |
| | | text: '数字' |
| | | }, { |
| | | value: 'textarea', |
| | | text: Formdict['model.form.textarea'] |
| | | text: '多行文本' |
| | | }, { |
| | | value: 'custom', |
| | | text: '自定义列' |
| | | }, { |
| | | value: 'action', |
| | | text: '操作' |
| | | value: 'colspan', |
| | | text: '合并列' |
| | | // }, { |
| | | // value: 'action', |
| | | // text: '操作' |
| | | }, { |
| | | value: 'formula', |
| | | text: '公式' |
| | |
| | | value: 'index', |
| | | text: '序号' |
| | | }] |
| | | |
| | | if (!card.isSub) { |
| | | options.push({ |
| | | value: 'action', |
| | | text: '操作' |
| | | }) |
| | | } |
| | | |
| | | let editCols = [ |
| | | { |
| | |
| | | field: col.uuid, |
| | | label: col.label |
| | | }) |
| | | } else if (col.type === 'colspan') { |
| | | col.subcols.forEach(subcol => { |
| | | if (subcol.editable === 'true' && subcol.uuid !== card.uuid) { |
| | | editCols.push({ |
| | | field: subcol.uuid, |
| | | label: col.label + '-' + subcol.label |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | |
| | |
| | | { |
| | | 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 |
| | |
| | | min: 20, |
| | | max: 1000, |
| | | precision: 0, |
| | | label: Formdict['model.form.columnWidth'], |
| | | label: '列宽', |
| | | initVal: card.Width || 120, |
| | | required: true |
| | | }, |
| | | { |
| | | 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 || 'false', |
| | | label: '排序', |
| | | initVal: card.IsSort || (card.isSub ? 'false' : 'true'), |
| | | required: true, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | 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: 'sum', |
| | | label: '显示合计', |
| | | initVal: card.sum || 'false', |
| | | tooltip: '合计信息只在使用系统数据源时有效。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | }] |
| | | }, |
| | | // { |
| | | // type: 'radio', |
| | | // key: 'sum', |
| | | // label: '显示合计', |
| | | // initVal: card.sum || 'false', |
| | | // tooltip: '合计信息只在使用系统数据源时有效。', |
| | | // required: false, |
| | | // options: [{ |
| | | // value: 'true', |
| | | // text: '是' |
| | | // }, { |
| | | // value: 'false', |
| | | // text: '否' |
| | | // }] |
| | | // }, |
| | | { |
| | | type: 'radio', |
| | | key: 'editable', |
| | |
| | | initVal: card.orderType || 'asc', |
| | | options: [{ |
| | | value: 'asc', |
| | | text: Formdict['header.form.asc'] |
| | | text: '正序' |
| | | }, { |
| | | value: 'desc', |
| | | text: Formdict['header.form.desc'] |
| | | text: '倒序' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | 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: 'radio', |
| | | // key: 'footEnter', |
| | |
| | | min: 0, |
| | | max: 18, |
| | | precision: 0, |
| | | label: Formdict['header.form.decimal'], |
| | | label: '小数位', |
| | | initVal: card.decimal || 0, |
| | | required: true |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | { |
| | | 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: '千分位' |
| | |
| | | { |
| | | 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, |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'postfix', |
| | | label: Formdict['header.form.postfix'], |
| | | label: '后缀', |
| | | initVal: card.postfix || '', |
| | | required: false, |
| | | }, |
| | |
| | | type: 'radio', |
| | | key: 'eval', |
| | | label: '解析', |
| | | initVal: card.eval || 'true', |
| | | initVal: card.eval || 'false', |
| | | tooltip: '当公式内容涉及计算时请选择“是”,当公式内容为字段拼接时请选择“否”。', |
| | | required: false, |
| | | options: [ |
| | |
| | | options: fields |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'noValue', |
| | | label: '空值', |
| | | initVal: card.noValue || 'show', |
| | | tooltip: '当值为0时是否显示', |
| | | required: false, |
| | | options: [{ |
| | | value: 'show', |
| | | text: '显示' |
| | | }, { |
| | | value: 'hide', |
| | | text: '隐藏' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | key: 'blacklist', |
| | | label: Formdict['header.form.blacklist'], |
| | | label: '黑名单', |
| | | initVal: card.blacklist || [], |
| | | required: false, |
| | | options: roleList |