| | |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import { formRule, btnClasses } from '@/utils/option.js' |
| | | |
| | | const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | |
| | | /** |
| | | * @description 获取树形页面设置表单配置信息 |
| | |
| | | export function getTreeSettingForm (setting, usefulFields = [], MenuID) { |
| | | let str = '^(' + usefulFields.join('|') + ')' |
| | | let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g') |
| | | let rules = [{ |
| | | max: formRule.func.max, |
| | | message: formRule.func.maxMessage |
| | | }] |
| | | |
| | | if (usefulFields.length > 0) { |
| | | rules.push({ |
| | | pattern: _patten, |
| | | message: formRule.func.innerMessage |
| | | }) |
| | | } |
| | | |
| | | return [ |
| | | { |
| | |
| | | { |
| | | type: 'radio', |
| | | key: 'interType', |
| | | label: Formdict['header.form.intertype'], |
| | | label: '接口类型', |
| | | initVal: setting.interType || 'inner', |
| | | required: false, |
| | | readonly: false, |
| | | options: [ |
| | | { value: 'inner', text: Formdict['model.interface.inner'] }, |
| | | { value: 'outer', text: Formdict['model.interface.outer'] } |
| | | { value: 'inner', text: '内部' }, |
| | | { value: 'outer', text: '外部' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'sysInterface', |
| | | label: Formdict['header.form.sysInterface'], |
| | | label: '系统接口', |
| | | initVal: setting.sysInterface || 'false', |
| | | tooltip: '单点登录系统', |
| | | required: false, |
| | | readonly: false, |
| | | options: [ |
| | | { value: 'true', text: Formdict['model.true'] }, |
| | | { value: 'false', text: Formdict['model.false'] } |
| | | { value: 'true', text: '是' }, |
| | | { value: 'false', text: '否' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'interface', |
| | | label: Formdict['header.form.interface'], |
| | | label: '接口地址', |
| | | initVal: setting.sysInterface === 'true' ? (window.GLOB.mainSystemApi || '') : (setting.interface || ''), |
| | | required: true, |
| | | readonly: setting.sysInterface === 'true', |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'outerFunc', |
| | | label: Formdict['header.form.outerFunc'], |
| | | label: '外部函数', |
| | | initVal: setting.outerFunc || '', |
| | | required: false, |
| | | readonly: false, |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'innerFunc', |
| | | label: Formdict['header.form.innerFunc'], |
| | | label: '内部函数', |
| | | initVal: setting.innerFunc || '', |
| | | tooltip: '开头可用字符:' + usefulFields.join(', '), |
| | | tooltip: usefulFields.length ? '开头可用字符:' + usefulFields.join(', ') : '', |
| | | placement: 'bottomLeft', |
| | | required: false, |
| | | readonly: false, |
| | | rules: [ |
| | | { |
| | | pattern: _patten, |
| | | message: formRule.func.innerMessage |
| | | }, { |
| | | max: formRule.func.max, |
| | | message: formRule.func.maxMessage |
| | | } |
| | | ] |
| | | rules: rules |
| | | }, |
| | | { |
| | | type: 'datasource', |
| | |
| | | required: false, |
| | | readonly: false, |
| | | options: [ |
| | | { value: 'true', text: Formdict['model.true'] }, |
| | | { value: 'false', text: Formdict['model.false'] } |
| | | { value: 'true', text: '是' }, |
| | | { value: 'false', text: '否' } |
| | | ] |
| | | }, |
| | | { |
| | |
| | | required: false, |
| | | readonly: false, |
| | | options: [ |
| | | { value: 'true', text: Formdict['model.true'] }, |
| | | { value: 'false', text: Formdict['model.false'] } |
| | | { value: 'true', text: '是' }, |
| | | { value: 'false', text: '否' } |
| | | ] |
| | | } |
| | | ] |
| | |
| | | * @param {object} card // 搜索条件对象 |
| | | * @param {Array} linkableFields // 可关联字段 |
| | | */ |
| | | export function getSearchForm (card, linkableFields) { |
| | | export function getSearchForm (card, linkableFields, columns, position) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let appType = sessionStorage.getItem('appType') |
| | | if (roleList) { |
| | |
| | | text: '选项卡' |
| | | }, { |
| | | value: 'date', |
| | | text: Formdict['model.form.dateday'] |
| | | text: '日期(天)' |
| | | }, { |
| | | value: 'datemonth', |
| | | text: Formdict['model.form.datemonth'] |
| | | // }, { |
| | | // value: 'daterange', |
| | | // text: Formdict['model.form.daterange'] |
| | | text: '日期(月)' |
| | | }] |
| | | |
| | | } else { |
| | | typeOptions = [{ |
| | | value: 'text', |
| | | text: Formdict['model.form.text'] |
| | | text: '文本' |
| | | }, { |
| | | value: 'select', |
| | | text: Formdict['model.form.select'] |
| | | text: '下拉选择' |
| | | }, { |
| | | value: 'multiselect', |
| | | text: Formdict['model.form.multiselect'] |
| | | text: '下拉多选' |
| | | }, { |
| | | value: 'link', |
| | | text: Formdict['model.form.link'] |
| | | text: '联动菜单' |
| | | }, { |
| | | value: 'checkcard', |
| | | text: '选项卡' |
| | | }, { |
| | | value: 'date', |
| | | text: Formdict['model.form.dateday'] |
| | | text: '日期(天)' |
| | | }, { |
| | | value: 'dateweek', |
| | | text: Formdict['model.form.dateweek'] |
| | | text: '日期(周)' |
| | | }, { |
| | | value: 'datemonth', |
| | | text: Formdict['model.form.datemonth'] |
| | | text: '日期(月)' |
| | | }, { |
| | | value: 'daterange', |
| | | text: Formdict['model.form.daterange'] |
| | | text: '日期(区间)' |
| | | }, { |
| | | value: 'group', |
| | | text: Formdict['model.form.dategroup'] |
| | | text: '日期(组合)' |
| | | }] |
| | | } |
| | | |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'label', |
| | | label: Formdict['model.name'], |
| | | label: '名称', |
| | | initVal: card.label || '', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'field', |
| | | label: Formdict['model.form.field'], |
| | | label: '字段', |
| | | initVal: card.field || '', |
| | | required: true |
| | | required: true, |
| | | options: columns |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'type', |
| | | label: Formdict['model.form.type'], |
| | | label: '类型', |
| | | initVal: card.type, |
| | | required: true, |
| | | options: typeOptions |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'initval', |
| | | label: Formdict['header.form.initval'], |
| | | label: '初始值', |
| | | tooltip: '类型为下拉菜单时,初始值应为数据的Value值(使用数据源时,应为《值·字段》的值);类型为数值(区间)时,初始值使用逗号拼接,例如 3,10', |
| | | initVal: card.initval, |
| | | required: false |
| | |
| | | required: true, |
| | | options: [{ |
| | | value: '0', |
| | | text: Formdict['header.form.custom'] |
| | | text: '自定义' |
| | | }, { |
| | | value: '1', |
| | | text: Formdict['header.form.datasource'] |
| | | text: '数据源' |
| | | }] |
| | | }, |
| | | // { |
| | |
| | | // initVal: card.setAll || 'true', |
| | | // options: [{ |
| | | // value: 'true', |
| | | // text: Formdict['model.true'] |
| | | // text: '是' |
| | | // }, { |
| | | // value: 'false', |
| | | // text: Formdict['model.false'] |
| | | // text: '否' |
| | | // }] |
| | | // }, |
| | | { |
| | |
| | | }, { |
| | | value: 'picture', |
| | | text: '图片' |
| | | }, { |
| | | value: 'color', |
| | | text: '色块' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | key: 'urlField', |
| | | label: '地址字段', |
| | | initVal: card.urlField || '', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'colorField', |
| | | label: '色值字段', |
| | | initVal: card.colorField || '', |
| | | required: true |
| | | }, |
| | | { |
| | |
| | | { |
| | | type: 'codemirror', |
| | | key: 'dataSource', |
| | | label: Formdict['header.form.datasource'], |
| | | label: '数据源', |
| | | initVal: card.dataSource || '', |
| | | required: true |
| | | }, |
| | |
| | | initVal: card.orderType || 'asc', |
| | | options: [{ |
| | | value: 'asc', |
| | | text: Formdict['header.form.asc'] |
| | | text: '正序' |
| | | }, { |
| | | value: 'desc', |
| | | text: Formdict['header.form.desc'] |
| | | text: '倒序' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'match', |
| | | label: Formdict['header.form.match'], |
| | | label: '匹配模式', |
| | | initVal: card.match || 'like', |
| | | required: true, |
| | | options: [{ |
| | | value: 'like', |
| | | text: 'like' |
| | | }, { |
| | | value: 'equal', |
| | | text: 'equal' |
| | | }, { |
| | | value: 'greater', |
| | | text: '>' |
| | | }, { |
| | | value: 'less', |
| | | text: '<' |
| | | }, { |
| | | value: 'greaterequal', |
| | | text: '>=' |
| | | }] |
| | | options: [] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | key: 'ratio', |
| | | min: 1, |
| | | max: 24, |
| | | label: Formdict['header.form.ratio'], |
| | | label: '比例', |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | initVal: card.ratio || 6, |
| | | forbid: appType === 'mob', |
| | |
| | | { |
| | | type: 'radio', |
| | | key: 'required', |
| | | label: Formdict['model.required'], |
| | | label: '必填', |
| | | initVal: card.required || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'Hide', |
| | | label: Formdict['model.hidden'], |
| | | label: '隐藏', |
| | | initVal: card.Hide || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | // tooltip: '数据查询时,类型字段是否作为参数传递,类型字段对应值为 {"日": "day", "周": "week", "月": "month", "季": "quarter", "年": "year", "自定义": "customized"}。', |
| | | // options: [{ |
| | | // value: 'true', |
| | | // text: Formdict['model.true'] |
| | | // text: '是' |
| | | // }, { |
| | | // value: 'false', |
| | | // text: Formdict['model.false'] |
| | | // text: '否' |
| | | // }] |
| | | // }, |
| | | { |
| | |
| | | key: 'advanced', |
| | | label: '高级搜索', |
| | | initVal: card.advanced || 'false', |
| | | tooltip: '在隐藏搜索按钮时,高级搜索无效。', |
| | | forbid: appType === 'mob', |
| | | tooltip: '在高级搜索以模态框或抽屉展开时,搜索条件在开发界面占比为6,实际效果请在运行时查看。', |
| | | forbid: appType === 'mob' || position === 'header', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'selectStyle', |
| | | label: '选中效果', |
| | | tooltip: '背景及文字变化时会使用系统色。', |
| | | initVal: card.selectStyle || (card.backgroundColor ? 'custom' : 'background'), |
| | | options: [{ |
| | | value: 'background', |
| | | text: '背景变化' |
| | | }, { |
| | | value: 'font', |
| | | text: '文字变化' |
| | | }, { |
| | | value: 'custom', |
| | | text: '自定义' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'color', |
| | | key: 'backgroundColor', |
| | | label: '背景色', |
| | | initVal: card.backgroundColor || '', |
| | | tooltip: '设置背景色后,选中效果由背景颜色控制。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'color', |
| | | key: 'borderColor', |
| | | label: '边框颜色', |
| | | initVal: card.borderColor || '', |
| | | required: false |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | key: 'blacklist', |
| | | label: Formdict['header.form.blacklist'], |
| | | label: '黑名单', |
| | | initVal: card.blacklist || [], |
| | | required: false, |
| | | options: roleList || [], |
| | |
| | | let opentypes = [ |
| | | { |
| | | value: 'pop', |
| | | text: Formdict['model.form.popform'] |
| | | text: '弹窗(表单)' |
| | | }, { |
| | | value: 'prompt', |
| | | text: Formdict['model.form.prompt'] |
| | | text: '提示框' |
| | | }, { |
| | | value: 'exec', |
| | | text: Formdict['model.form.exec'] |
| | | text: '直接执行' |
| | | }, { |
| | | value: 'excelIn', |
| | | text: Formdict['model.form.excelIn'] |
| | | text: '导入Excel' |
| | | }, { |
| | | value: 'excelOut', |
| | | text: Formdict['model.form.excelOut'] |
| | | text: '导出Excel' |
| | | }, { |
| | | value: 'popview', |
| | | text: Formdict['model.form.popview'] |
| | | text: '弹窗(标签)' |
| | | }, { |
| | | value: 'tab', |
| | | text: Formdict['model.form.tab'] |
| | | text: '标签页' |
| | | }, { |
| | | value: 'innerpage', |
| | | text: Formdict['model.form.newpage'] |
| | | text: '新页面' |
| | | }, { |
| | | value: 'funcbutton', |
| | | text: Formdict['model.form.funcbutton'] |
| | | text: '功能按钮' |
| | | } |
| | | ] |
| | | |
| | |
| | | value: 'equaltab', |
| | | text: '刷新同级标签' |
| | | }) |
| | | } else if (card.execSuccess === 'maingrid') { |
| | | card.execSuccess = 'grid' |
| | | } |
| | | |
| | | if (card.OpenType === 'blank') { |
| | |
| | | card.control = 'disabled' |
| | | } |
| | | |
| | | if (card.intertype === 'outer' && !card.procMode && !card.innerFunc) { // 兼容外部函数直传类型 |
| | | card.procMode = 'none' |
| | | } |
| | | |
| | | return [ |
| | | { |
| | | type: 'select', |
| | | key: 'OpenType', |
| | | label: Formdict['header.form.openType'], |
| | | label: '打开方式', |
| | | initVal: card.OpenType, |
| | | required: true, |
| | | options: opentypes |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'label', |
| | | label: '按钮名称', |
| | | initVal: card.label, |
| | | required: true, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | initVal: card.funcType || '', |
| | | required: true, |
| | | options: [{ |
| | | value: 'changeuser', |
| | | text: '切换用户' |
| | | }, { |
| | | value: 'print', |
| | | text: '标签打印' |
| | | }, { |
| | | value: 'refund', |
| | | text: '退款' |
| | | }, { |
| | | value: 'changeuser', |
| | | text: '切换用户' |
| | | }, { |
| | | value: 'closetab', |
| | | text: '标签关闭' |
| | | }, { |
| | | value: 'megvii', |
| | | text: '旷视面板机' |
| | | }, { |
| | | value: 'filezip', |
| | | text: '文件压缩包' |
| | | }] |
| | | }, |
| | | { // 旷视面板机接口 待扩展 |
| | |
| | | { |
| | | type: 'select', |
| | | key: 'execMode', |
| | | label: Formdict['model.form.execMode'], |
| | | label: '执行方式', |
| | | initVal: card.execMode || 'exec', |
| | | required: true, |
| | | options: [{ |
| | | value: 'exec', |
| | | text: Formdict['model.form.exec'] |
| | | text: '直接执行' |
| | | }, { |
| | | value: 'prompt', |
| | | text: Formdict['model.form.prompt'] |
| | | text: '提示框' |
| | | }, { |
| | | value: 'pop', |
| | | text: Formdict['model.form.popform'] |
| | | text: '弹窗(表单)' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'intertype', |
| | | label: Formdict['header.form.intertype'], |
| | | label: '接口类型', |
| | | initVal: card.intertype || 'system', |
| | | required: true, |
| | | options: [] |
| | |
| | | type: 'radio', |
| | | key: 'procMode', |
| | | label: '参数处理', |
| | | initVal: card.procMode || 'system', |
| | | initVal: card.procMode || (card.innerFunc ? 'inner' : 'system'), |
| | | tooltip: '当返回值存在 mk_ex_invoke 且值为 false 时,不会调用外部接口。', |
| | | required: true, |
| | | options: [{ |
| | | value: 'system', |
| | |
| | | }, { |
| | | value: 'inner', |
| | | text: '内部函数' |
| | | }, { |
| | | value: 'none', |
| | | text: '无' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'sqlType', |
| | | label: Formdict['header.form.action.type'], |
| | | label: '操作类型', |
| | | initVal: card.sqlType || '', |
| | | required: true, |
| | | options: [] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'label', |
| | | label: '按钮名称', |
| | | initVal: card.label, |
| | | required: true, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'sql', |
| | | label: Formdict['model.form.tablename'], |
| | | label: '表名', |
| | | initVal: card.sql || config.setting.tableName || '', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'innerFunc', |
| | | label: Formdict['header.form.innerFunc'], |
| | | label: '内部函数', |
| | | initVal: card.innerFunc || '', |
| | | tooltip: `函数名称需以${usefulFields.join(', ')}等字符开始。`, |
| | | tooltip: usefulFields.length ? `函数名称需以${usefulFields.join(', ')}等字符开始。` : '', |
| | | fields: usefulFields, |
| | | required: card.intertype === 'inner', |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'urlkey', |
| | | label: '地址字段', |
| | | initVal: card.urlkey || '', |
| | | tooltip: '图片(文件)链接的字段名。', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | |
| | | { |
| | | type: 'select', |
| | | key: 'pageTemplate', |
| | | label: Formdict['model.form.newpage.type'], |
| | | label: '页面类型', |
| | | initVal: card.pageTemplate || '', |
| | | required: true, |
| | | options: [{ |
| | |
| | | text: '单据打印' |
| | | }, { |
| | | value: 'pay', |
| | | text: Formdict['model.pay'] |
| | | text: '支付' |
| | | }, { |
| | | value: 'custom', |
| | | text: Formdict['header.form.custom'] |
| | | text: '自定义' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'url', |
| | | label: Formdict['model.pageUrl'], |
| | | label: '页面地址', |
| | | initVal: card.url || '', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'sysInterface', |
| | | label: Formdict['header.form.sysInterface'], |
| | | label: '系统接口', |
| | | initVal: card.sysInterface || 'false', |
| | | tooltip: '单点登录系统', |
| | | required: true, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'outerFunc', |
| | | label: Formdict['header.form.outerFunc'], |
| | | label: '外部函数', |
| | | initVal: card.outerFunc || '', |
| | | required: false, |
| | | readonly: false |
| | |
| | | type: 'radio', |
| | | key: 'callbackType', |
| | | label: '回调方式', |
| | | initVal: card.callbackType || 'script', |
| | | initVal: card.callbackType || (card.callbackFunc ? 'func' : 'none'), |
| | | tooltip: '使用后台脚本执行时,需要配合计划任务。', |
| | | required: true, |
| | | options: [{ |
| | |
| | | }, { |
| | | value: 'default', |
| | | text: '后台脚本' |
| | | }, { |
| | | value: 'func', |
| | | text: '回调函数' |
| | | }, { |
| | | value: 'none', |
| | | text: '无' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'callbackFunc', |
| | | label: Formdict['header.form.callbackFunc'], |
| | | label: '回调函数', |
| | | initVal: card.callbackFunc || '', |
| | | required: false, |
| | | required: true, |
| | | readonly: false |
| | | }, |
| | | { |
| | |
| | | required: true, |
| | | options: [{ |
| | | value: 'toolbar', |
| | | text: Formdict['header.form.toolbar'] |
| | | text: '工具栏' |
| | | }, { |
| | | value: 'grid', |
| | | text: Formdict['header.form.grid'] |
| | | text: '表格' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'Ot', |
| | | label: Formdict['header.form.isRequired'], |
| | | label: '行设置', |
| | | initVal: card.Ot || 'requiredSgl', |
| | | required: true, |
| | | options: [] |
| | |
| | | { |
| | | type: 'cascader', |
| | | key: 'linkmenu', |
| | | label: Formdict['model.form.linkmenu'], |
| | | label: '关联菜单', |
| | | initVal: card.linkmenu || [], |
| | | required: true, |
| | | options: menulist |
| | |
| | | { |
| | | type: refresh.length === 0 ? 'radio' : 'select', |
| | | key: 'execSuccess', |
| | | label: Formdict['model.form.afterSuccess'], |
| | | label: '成功后', |
| | | initVal: card.execSuccess || 'grid', |
| | | tooltip: '选择刷新行时,如果选择多条数据会刷新表格。', |
| | | tooltip: '选择刷新行时,如果选择多条数据会刷新表格。如需语音播报请以@speak@开头,播报内容或文件放置于<<>>中。', |
| | | required: true, |
| | | options: [{ |
| | | value: 'never', |
| | |
| | | { |
| | | type: refresh.length === 0 ? 'radio' : 'select', |
| | | key: 'execError', |
| | | label: Formdict['model.form.afterError'], |
| | | label: '失败后', |
| | | initVal: card.execError || 'never', |
| | | tooltip: '选择刷新行时,如果选择多条数据会刷新表格。', |
| | | tooltip: '选择刷新行时,如果选择多条数据会刷新表格。如需语音播报请以@speak@开头,播报内容或文件放置于<<>>中。', |
| | | required: true, |
| | | options: [{ |
| | | value: 'never', |
| | |
| | | { |
| | | type: refresh.length === 0 ? 'radio' : 'select', |
| | | key: 'popClose', |
| | | label: Formdict['header.form.popClose'], |
| | | label: '关闭后', |
| | | initVal: card.popClose || 'never', |
| | | required: true, |
| | | options: [{ |
| | |
| | | { |
| | | type: 'icon', |
| | | key: 'icon', |
| | | label: Formdict['model.icon'], |
| | | label: '图标', |
| | | initVal: card.icon, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'class', |
| | | label: Formdict['model.form.color'], |
| | | label: '颜色', |
| | | initVal: card.class, |
| | | required: false, |
| | | options: btnClasses |
| | |
| | | type: 'text', |
| | | key: 'output', |
| | | label: '返回值', |
| | | tooltip: '执行成功后的返回值。例如:@id', |
| | | tooltip: '执行成功后的返回值。系统函数可指定返回的变量(以@符开头,返回id时可使用@id@);自定义函数可指定返回字段(如id)。', |
| | | initVal: card.output || '', |
| | | required: false |
| | | }, |
| | |
| | | { |
| | | type: 'radio', |
| | | key: 'joint', |
| | | label: Formdict['model.form.paramJoint'], |
| | | label: '拼接参数', |
| | | initVal: card.joint || 'true', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'sheet', |
| | | label: Formdict['model.form.tablename'], |
| | | label: '表名', |
| | | initVal: card.sheet || config.setting.tableName || '', |
| | | required: true |
| | | }, |
| | |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | { |
| | | type: 'radio', |
| | | key: 'placement', |
| | | label: '抽屉方向', |
| | | label: '弹出方向', |
| | | initVal: card.placement || 'right', |
| | | required: false, |
| | | options: [{ |
| | |
| | | key: 'preFunc', |
| | | label: '前置函数', |
| | | initVal: card.preFunc || '', |
| | | tooltip: `函数名称需以${usefulFields.join(', ')}等字符开始;前置函数执行完成后,结果会传入内部函数中,此时内部函数会异步执行;当前置函数返回中ErrCode等于-1时,将不再执行内部函数。`, |
| | | tooltip: usefulFields.length ? `函数名称需以${usefulFields.join(', ')}等字符开始;前置函数执行完成后,结果会传入内部函数中,此时内部函数会异步执行;当前置函数返回中ErrCode等于-1时,将不再执行内部函数。` : '', |
| | | fields: usefulFields, |
| | | required: false, |
| | | readonly: false |
| | |
| | | value: 'true', |
| | | text: '是' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'progress', |
| | | label: '进度提示', |
| | | initVal: card.progress || 'number', |
| | | required: false, |
| | | options: [{ |
| | | value: 'number', |
| | | text: '剩余数' |
| | | }, { |
| | | value: 'progressbar', |
| | | text: '进度条' |
| | | }] |
| | | } |
| | | ] |
| | | } |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'label', |
| | | label: Formdict['model.name'], |
| | | label: '名称', |
| | | initVal: card.label, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'field', |
| | | label: Formdict['model.form.field'], |
| | | label: '字段', |
| | | initVal: card.field, |
| | | required: true, |
| | | readonly: false |
| | |
| | | { |
| | | type: 'select', |
| | | key: 'type', |
| | | label: Formdict['model.form.type'], |
| | | label: '类型', |
| | | initVal: card.type, |
| | | required: true, |
| | | options: [{ |
| | | value: 'text', |
| | | text: Formdict['model.form.text'] |
| | | text: '文本' |
| | | }, { |
| | | value: 'number', |
| | | text: Formdict['model.form.number'] |
| | | text: '数字' |
| | | }, { |
| | | value: 'picture', |
| | | text: Formdict['model.form.picture'] |
| | | text: '图片' |
| | | }, { |
| | | value: 'video', |
| | | text: '视频' |
| | | }, { |
| | | value: 'link', |
| | | text: Formdict['model.form.href'] |
| | | text: '链接' |
| | | }, { |
| | | value: 'textarea', |
| | | text: Formdict['model.form.textarea'] |
| | | text: '多行文本' |
| | | }, { |
| | | value: 'index', |
| | | text: '序号' |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'nameField', |
| | | label: Formdict['model.name'] + Formdict['model.form.field'], |
| | | label: '名称字段', |
| | | initVal: card.nameField, |
| | | required: false, |
| | | readonly: false |
| | |
| | | min: 1, |
| | | max: 1000, |
| | | decimal: 0, |
| | | label: Formdict['model.form.columnWidth'], |
| | | label: '列宽', |
| | | initVal: card.Width, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'joint', |
| | | label: Formdict['model.form.paramJoint'], |
| | | label: '拼接参数', |
| | | initVal: card.joint || 'true', |
| | | required: true, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | | 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'], |
| | | label: '排序', |
| | | initVal: card.IsSort || '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: 'number', |
| | | key: 'startTime', |
| | | precision: 0, |
| | | label: '开始时间', |
| | | initVal: card.startTime || 0, |
| | | tooltip: '视频开始播放的时间,用于调整视频初始化展示的界面。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'aspectRatio', |
| | | label: '长宽比', |
| | | initVal: card.aspectRatio || '16:9', |
| | | required: true, |
| | | options: [ |
| | | { value: '4:3', text: '4:3' }, |
| | | { value: '16:9', text: '16:9' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | min: 0, |
| | | max: 18, |
| | | decimal: 0, |
| | | label: Formdict['header.form.decimal'], |
| | | label: '小数位', |
| | | initVal: card.decimal || 0, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'fieldlength', |
| | | label: Formdict['model.form.field'] + Formdict['model.length'], |
| | | label: '字段长度', |
| | | initVal: card.fieldlength || (card.type === 'text' ? 50 : 512), |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'format', |
| | | label: Formdict['header.form.format'], |
| | | initVal: card.format || '', |
| | | label: '格式化', |
| | | initVal: card.format || 'none', |
| | | options: [{ |
| | | value: '', |
| | | text: Formdict['model.empty'] |
| | | value: 'none', |
| | | text: '无' |
| | | }, { |
| | | value: 'thdSeparator', |
| | | text: '千分位' |
| | |
| | | { |
| | | type: 'select', |
| | | key: 'textFormat', |
| | | label: Formdict['header.form.format'], |
| | | initVal: card.textFormat || '', |
| | | label: '格式化', |
| | | initVal: card.textFormat || 'none', |
| | | options: [{ |
| | | value: '', |
| | | text: Formdict['model.empty'] |
| | | value: 'none', |
| | | 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 || '', |
| | | tooltipClass: 'middle', |
| | | required: false, |
| | |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'maxHeight', |
| | | key: 'span', |
| | | min: 1, |
| | | max: 1000, |
| | | decimal: 0, |
| | | label: '最大高度', |
| | | tooltip: '图片在表格中显示的最大高度', |
| | | tooltipClass: 'middle', |
| | | initVal: card.maxHeight || 128, |
| | | max: 24, |
| | | precision: 0, |
| | | label: '图片宽度', |
| | | initVal: card.span || 24, |
| | | tooltip: '栅格布局,等分为24份。', |
| | | required: true |
| | | }, |
| | | { |
| | | 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', |
| | |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | { |
| | | type: 'cascader', |
| | | key: 'linkmenu', |
| | | label: Formdict['model.menu'], |
| | | label: '菜单', |
| | | initVal: card.linkmenu || [], |
| | | required: true, |
| | | options: menulist |
| | |
| | | { |
| | | type: 'multiselect', |
| | | key: 'blacklist', |
| | | label: Formdict['header.form.blacklist'], |
| | | label: '黑名单', |
| | | initVal: card.blacklist || [], |
| | | required: false, |
| | | options: roleList |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'title', |
| | | label: Formdict['header.form.title'], |
| | | label: '标题', |
| | | initVal: card.title, |
| | | required: false |
| | | }, |
| | |
| | | { |
| | | type: 'radio', |
| | | key: 'Hide', |
| | | label: Formdict['model.hidden'], |
| | | label: '隐藏', |
| | | initVal: card.Hide, |
| | | required: true, |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | { |
| | | type: 'multiselect', |
| | | key: 'blacklist', |
| | | label: Formdict['header.form.blacklist'], |
| | | label: '黑名单', |
| | | initVal: card.blacklist || [], |
| | | required: false, |
| | | options: roleList |
| | |
| | | forbid: !['line', 'bar'].includes(card.chartType), |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | /** |
| | | * @description 获取表单配置信息 |
| | | * @param {*} card // 表单对象 |
| | | * @param {*} inputfields // 可关联表单 |
| | | * @param {*} inputfields // 可写入表单 |
| | | * @param {*} tabfields // 可切换表单 |
| | | * @param {*} linkableFields // 可关联表单 |
| | | * @param {*} linksupFields // 上级表单 |
| | | */ |
| | | export function getModalForm (card, inputfields = [], tabfields = [], linkableFields, linksupFields) { |
| | | export function getModalForm (card, inputfields = [], tabfields = [], linkableFields, linksupFields, columns = []) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | if (roleList) { |
| | |
| | | } else { |
| | | roleList = [] |
| | | } |
| | | |
| | | inputfields = inputfields.map((item, index) => { |
| | | item.label = `${index + 1}、${item.field || ''}(${item.label})` |
| | | return item |
| | | }) |
| | | tabfields = tabfields.map((item, index) => { |
| | | item.label = `${index + 1}、${item.field || ''}(${item.label})` |
| | | return item |
| | | }) |
| | | |
| | | tabfields.unshift({field: '', label: '原表单'}) |
| | | |
| | | linkableFields = linkableFields.map((item, index) => { |
| | | item.label = `${index + 1}、${item.field || ''}(${item.label})` |
| | | return item |
| | | }) |
| | | |
| | | linksupFields = linksupFields.map((item, index) => { |
| | | item.label = `${index + 1}、${item.field || ''}(${item.label})` |
| | | return item |
| | | }) |
| | | |
| | | let _openType = [{ |
| | | value: 'text', |
| | | text: Formdict['model.form.text'] |
| | | text: '文本' |
| | | }, { |
| | | value: 'number', |
| | | text: Formdict['model.form.number'] |
| | | text: '数字' |
| | | }, { |
| | | value: 'select', |
| | | text: Formdict['model.form.select'] |
| | | text: '下拉选择' |
| | | }, { |
| | | value: 'textarea', |
| | | text: '多行文本' |
| | | }, { |
| | | value: 'multiselect', |
| | | text: Formdict['model.form.multiselect'] |
| | | text: '下拉多选' |
| | | }, { |
| | | value: 'link', |
| | | text: Formdict['model.form.link'] |
| | | text: '联动菜单' |
| | | }, { |
| | | value: 'switch', |
| | | text: '开关' |
| | |
| | | text: '选项卡' |
| | | }, { |
| | | value: 'fileupload', |
| | | text: Formdict['header.form.fileupload'] |
| | | text: '文件上传' |
| | | }, { |
| | | value: 'date', |
| | | text: Formdict['model.form.dateday'] |
| | | text: '日期(天)' |
| | | }, { |
| | | value: 'datemonth', |
| | | text: Formdict['model.form.datemonth'] |
| | | text: '日期(月)' |
| | | // }, { |
| | | // value: 'datetime', |
| | | // text: '日期(分/秒)' |
| | | }, { |
| | | value: 'textarea', |
| | | text: Formdict['model.form.textarea'] |
| | | value: 'cascader', |
| | | text: '级联菜单' |
| | | }, { |
| | | value: 'rate', |
| | | text: '评分' |
| | | }, { |
| | | value: 'color', |
| | | text: Formdict['model.form.color'] |
| | | text: '颜色' |
| | | }, { |
| | | value: 'brafteditor', |
| | | text: '富文本' |
| | | }, { |
| | | value: 'funcvar', |
| | | text: Formdict['header.form.funcvar'] |
| | | text: '函数变量' |
| | | }, { |
| | | value: 'hint', |
| | | text: '提示' |
| | |
| | | }, { |
| | | value: 'linkMain', |
| | | text: '关联主表' |
| | | }, { |
| | | value: 'formula', |
| | | text: '公式' |
| | | }] |
| | | |
| | | let _fieldlength = 50 |
| | |
| | | if (appType === 'mob') { |
| | | _openType = [{ |
| | | value: 'text', |
| | | text: Formdict['model.form.text'] |
| | | text: '文本' |
| | | }, { |
| | | value: 'number', |
| | | text: Formdict['model.form.number'] |
| | | text: '数字' |
| | | }, { |
| | | value: 'select', |
| | | text: '选择器' |
| | | }, { |
| | | value: 'link', |
| | | text: Formdict['model.form.link'] |
| | | text: '联动菜单' |
| | | }, { |
| | | value: 'textarea', |
| | | text: '多行文本' |
| | | }, { |
| | | value: 'switch', |
| | | text: '开关' |
| | |
| | | text: '选项卡' |
| | | }, { |
| | | value: 'fileupload', |
| | | text: Formdict['header.form.fileupload'] |
| | | text: '文件上传' |
| | | }, { |
| | | value: 'date', |
| | | text: Formdict['model.form.dateday'] |
| | | text: '日期(天)' |
| | | }, { |
| | | value: 'datemonth', |
| | | text: Formdict['model.form.datemonth'] |
| | | // }, { |
| | | // value: 'datetime', |
| | | // text: '日期(分/秒)' |
| | | text: '日期(月)' |
| | | }, { |
| | | value: 'textarea', |
| | | text: Formdict['model.form.textarea'] |
| | | value: 'cascader', |
| | | text: '级联菜单' |
| | | }, { |
| | | value: 'rate', |
| | | text: '评分' |
| | | }, { |
| | | value: 'funcvar', |
| | | text: Formdict['header.form.funcvar'] |
| | | text: '函数变量' |
| | | }, { |
| | | value: 'hint', |
| | | text: '提示' |
| | |
| | | }, { |
| | | value: 'linkMain', |
| | | text: '关联主表' |
| | | }, { |
| | | value: 'formula', |
| | | text: '公式' |
| | | }] |
| | | } |
| | | |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'label', |
| | | label: Formdict['model.name'], |
| | | label: '名称', |
| | | initVal: card.label, |
| | | required: true, |
| | | readonly: false |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'field', |
| | | label: Formdict['model.form.field'], |
| | | label: '字段', |
| | | initVal: card.field || '', |
| | | required: true, |
| | | readonly: false |
| | | readonly: false, |
| | | options: columns |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'type', |
| | | label: Formdict['model.form.type'], |
| | | label: '类型', |
| | | initVal: card.type, |
| | | required: true, |
| | | options: _openType |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'initval', |
| | | label: Formdict['header.form.initval'], |
| | | label: '初始值', |
| | | initVal: initval, |
| | | required: false |
| | | }, |
| | |
| | | required: true, |
| | | options: [{ |
| | | value: '0', |
| | | text: Formdict['header.form.custom'] |
| | | text: '自定义' |
| | | }, { |
| | | value: '1', |
| | | text: Formdict['header.form.datasource'] |
| | | text: '数据源' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | }, { |
| | | value: 'picture', |
| | | text: '图片' |
| | | }, { |
| | | value: 'color', |
| | | text: '色块' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'colorField', |
| | | label: '色值字段', |
| | | initVal: card.colorField || '', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'ratio', |
| | | key: 'picratio', |
| | | label: '图片比例', |
| | | initVal: card.ratio || '1:1', |
| | | initVal: card.picratio || card.ratio || '1:1', |
| | | required: true, |
| | | options: [{ |
| | | value: '1:1', |
| | |
| | | // initVal: card.setAll || 'false', |
| | | // options: [{ |
| | | // value: 'true', |
| | | // text: Formdict['model.true'] |
| | | // text: '是' |
| | | // }, { |
| | | // value: 'false', |
| | | // text: Formdict['model.false'] |
| | | // text: '否' |
| | | // }] |
| | | // }, |
| | | { |
| | |
| | | { |
| | | type: 'codemirror', |
| | | key: 'dataSource', |
| | | label: Formdict['header.form.datasource'], |
| | | label: '数据源', |
| | | initVal: card.dataSource || '', |
| | | required: true, |
| | | readonly: false |
| | |
| | | readonly: false, |
| | | allowClear: true, |
| | | options: linkableFields |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'topmark', |
| | | label: '顶级标识', |
| | | initVal: card.topmark || '', |
| | | tooltip: '关联字段值与顶级标识相同时,视为顶级节点。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | initVal: card.orderType || 'asc', |
| | | options: [{ |
| | | value: 'asc', |
| | | text: Formdict['header.form.asc'] |
| | | text: '正序' |
| | | }, { |
| | | value: 'desc', |
| | | text: Formdict['header.form.desc'] |
| | | text: '倒序' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | tooltip: '设置禁用字段,且字段值为true时,选项不可选。', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'decimal', |
| | | min: 0, |
| | | max: 18, |
| | | precision: 0, |
| | | label: Formdict['header.form.decimal'], |
| | | initVal: card.decimal || 0, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | }] |
| | | }, |
| | | { |
| | | 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: 'text', |
| | | key: 'separator', |
| | | label: '连接符', |
| | | initVal: card.separator === undefined ? '/' : card.separator, |
| | | tooltip: '表单提交时信息之间的连接符。注:连接符为空时,初始化时填充其他表单无效。', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'declare', |
| | | label: '数据类型', |
| | | initVal: card.declare || 'nvarchar', |
| | | tooltip: '声明变量时的类型。使用 decimal 时,请确认Value为数值,且不可为空。', |
| | | options: [{ |
| | | value: 'nvarchar', |
| | | text: 'nvarchar' |
| | | }, { |
| | | value: 'decimal', |
| | | text: 'decimal' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'decimal', |
| | | min: 0, |
| | | max: 18, |
| | | precision: 0, |
| | | label: '小数位', |
| | | initVal: card.decimal || 0, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'fieldlength', |
| | | min: 1, |
| | | max: 100000, |
| | | precision: 0, |
| | | label: Formdict['model.form.field'] + Formdict['model.length'], |
| | | label: '字段长度', |
| | | // tooltip: '文本、下拉框、日期等字段默认长度为50,多行文本与文件上传字段默认长度为512', |
| | | initVal: card.fieldlength || _fieldlength, |
| | | required: true |
| | |
| | | initVal: card.regular || '', |
| | | options: [{ |
| | | value: '', |
| | | text: Formdict['model.empty'] |
| | | text: '空' |
| | | }, { |
| | | value: 'number', |
| | | text: Formdict['model.form.number'] |
| | | text: '数字' |
| | | }, { |
| | | value: 'letter', |
| | | text: Formdict['header.form.letter'] |
| | | text: '字母' |
| | | }, { |
| | | value: 'letter_number', |
| | | text: '数字或字母' |
| | | }, { |
| | | value: 'letter&number', |
| | | text: '字母+数字' |
| | | text: '数字、字母以及@_.' |
| | | }, { |
| | | value: 'phone', |
| | | text: '手机号' |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'allowHalf', |
| | | label: '半选', |
| | | initVal: card.allowHalf || 'false', |
| | | key: 'hidden', |
| | | label: "隐藏", |
| | | initVal: card.hidden || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: '支持' |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: '不支持' |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | initVal: card.readonly || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'required', |
| | | label: Formdict['model.required'], |
| | | label: "必填", |
| | | initVal: card.required || 'true', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'hidden', |
| | | label: Formdict['model.hidden'], |
| | | initVal: card.hidden || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | type: 'radio', |
| | | key: 'readin', |
| | | label: '自动填充', |
| | | tooltip: '是否将表格选中的数据自动填充到表单(字段相同)', |
| | | tooltip: '将表格选中的数据自动填充到表单中。注:在批量操作时,如想要所选行(当前字段)全部修改请设为否或首行。', |
| | | initVal: card.readin || 'true', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }, { |
| | | value: 'top', |
| | | text: '首行' |
| | |
| | | initVal: card.writein || 'true', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'colorType', |
| | | label: '颜色类型', |
| | | initVal: card.colorType || 'hex', |
| | | options: [{ |
| | | value: 'hex', |
| | | text: '16进制' |
| | | }, { |
| | | value: 'rgba', |
| | | text: 'RGBA' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'allowHalf', |
| | | label: '半选', |
| | | initVal: card.allowHalf || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: '支持' |
| | | }, { |
| | | value: 'false', |
| | | text: '不支持' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'color', |
| | | key: 'color', |
| | | label: '颜色', |
| | | initVal: card.color || '#fadb14', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | initVal: card.hidelabel || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'selectStyle', |
| | | label: '选中效果', |
| | | tooltip: '背景及文字变化时会使用系统色。', |
| | | initVal: card.selectStyle || (card.backgroundColor ? 'custom' : 'background'), |
| | | options: [{ |
| | | value: 'background', |
| | | text: '背景变化' |
| | | }, { |
| | | value: 'font', |
| | | text: '文字变化' |
| | | }, { |
| | | value: 'custom', |
| | | text: '自定义' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'color', |
| | | key: 'backgroundColor', |
| | | label: '背景色', |
| | | initVal: card.backgroundColor || '', |
| | | tooltip: '设置背景色后,选中效果由背景颜色控制。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'color', |
| | | key: 'borderColor', |
| | | label: '边框颜色', |
| | | initVal: card.borderColor || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'declareType', |
| | | label: '数据类型', |
| | | tooltip: '声明变量时的类型,时间格式datetime或文本格式nvarchar(50)。', |
| | | initVal: card.declareType || 'datetime', |
| | | options: [{ |
| | | value: 'datetime', |
| | | text: 'datetime' |
| | | }, { |
| | | value: 'nvarchar(50)', |
| | | text: 'nvarchar(50)' |
| | | }] |
| | | required: true |
| | | }, |
| | | // { |
| | | // type: 'radio', |
| | |
| | | key: 'encryption', |
| | | label: '加密传输', |
| | | initVal: card.type === 'brafteditor' ? (card.encryption || 'true') : (card.encryption || 'false'), |
| | | tooltip: '使用md5加密时,加密前内容会转为小写,加密后的md5值为32位大写。', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '无' |
| | | }, { |
| | | value: 'true', |
| | | text: 'base64加密' |
| | | }, { |
| | | value: 'md5', |
| | | text: 'md5加密' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'inputType', |
| | | label: '加密显示', |
| | | initVal: card.inputType || 'text', |
| | | required: false, |
| | | options: [{ |
| | | value: 'text', |
| | | text: '否' |
| | | }, { |
| | | value: 'password', |
| | | text: '是' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | tooltip: '提交时,是否截取首尾的空白字符。', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | key: 'formula', |
| | | label: '公式', |
| | | initVal: card.formula || '', |
| | | tooltip: '动态替换相应的字段,展示获得的结果。可使用JS的一些语法,如:三元表达式 @field1@ > @field2@ ? 0 : 1;Math对象,取绝对值 Math.abs(@field@)、四舍五入 Math.round(@field@)等', |
| | | rows: 2, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'eval', |
| | | label: '解析', |
| | | initVal: card.eval || 'true', |
| | | tooltip: '当公式内容涉及计算时请选择“是”,当公式内容为字段拼接时请选择“否”。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '是' |
| | | }, { |
| | | value: 'false', |
| | | text: '否' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'postfix', |
| | | label: '后缀', |
| | | initVal: card.postfix || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | tooltip: '文件压缩或base64必须为图片,图片格式为jpg、png、gif 或 jpeg。注:base64只可上传一张图片。', |
| | | options: [{ |
| | | value: 'false', |
| | | text: '无' |
| | | text: '默认' |
| | | }, { |
| | | value: 'true', |
| | | text: '压缩' |
| | | }, { |
| | | value: 'base64', |
| | | text: 'base64' |
| | | }, { |
| | | value: 'oss', |
| | | text: 'oss上传' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | initVal: card.limit || 2, |
| | | tooltip: '压缩起点,小于起点值的文件不进行压缩。', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'miniSet', |
| | | label: '小程序设置', |
| | | initVal: card.miniSet || 'default', |
| | | options: [{ |
| | | value: 'default', |
| | | text: '默认' |
| | | }, { |
| | | value: 'custom', |
| | | text: '自定义' |
| | | }], |
| | | forbid: appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'checkbox', |
| | | key: 'mediaType', |
| | | label: '文件类型', |
| | | initVal: card.mediaType || ['image', 'video'], |
| | | options: [{ |
| | | value: 'image', |
| | | text: '图片' |
| | | }, { |
| | | value: 'video', |
| | | text: '视频' |
| | | }], |
| | | required: true, |
| | | forbid: appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'checkbox', |
| | | key: 'sourceType', |
| | | label: '文件来源', |
| | | initVal: card.sourceType || ['album', 'camera'], |
| | | options: [{ |
| | | value: 'album', |
| | | text: '相册选择' |
| | | }, { |
| | | value: 'camera', |
| | | text: '相机拍摄' |
| | | }], |
| | | required: true, |
| | | forbid: appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'sizeType', |
| | | label: '图片压缩', |
| | | initVal: card.sizeType || 'compressed', |
| | | options: [{ |
| | | value: 'compressed', |
| | | text: '是' |
| | | }, { |
| | | value: 'original', |
| | | text: '否' |
| | | }], |
| | | forbid: appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'maxDuration', |
| | | label: '拍摄时长', |
| | | initVal: card.maxDuration || 10, |
| | | tooltip: '拍摄视频最长拍摄时间,单位秒。时间范围为 3s 至 60s 之间。不限制相册。', |
| | | min: 3, |
| | | max: 60, |
| | | precision: 0, |
| | | required: true, |
| | | forbid: appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'camera', |
| | | label: '摄像头', |
| | | initVal: card.camera || 'back', |
| | | options: [{ |
| | | value: 'back', |
| | | text: '后置' |
| | | }, { |
| | | value: 'front', |
| | | text: '前置' |
| | | }], |
| | | forbid: appType !== 'mob' |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'maxSize', |
| | | min: 0.01, |
| | | max: 1024, |
| | | precision: 2, |
| | | label: '最大值(M)', |
| | | initVal: card.maxSize, |
| | | tooltip: '文件最大值,超出时不允许上传,值为空时不限制。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'lenControl', |
| | | label: '长度控制', |
| | | initVal: card.lenControl || 'limit', |
| | | tooltip: '在设置字段长度后,对长度的控制方式。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'limit', |
| | | text: '限制输入' |
| | | }, { |
| | | value: 'left', |
| | | text: '左截' |
| | | }, { |
| | | value: 'right', |
| | | text: '右截' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | }, { |
| | | value: 6, |
| | | text: 6 |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'lenControl', |
| | | label: '长度控制', |
| | | initVal: card.lenControl || 'limit', |
| | | tooltip: '在设置字段长度后,对长度的控制方式。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'limit', |
| | | text: '限制输入' |
| | | }, { |
| | | value: 'left', |
| | | text: '左截' |
| | | }, { |
| | | value: 'right', |
| | | text: '右截' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'regularExtra', |
| | | label: '正则扩展符', |
| | | initVal: card.regularExtra || '', |
| | | tooltip: '正则验证时允许添加的自定义字符,包括~!@#$%^&*()_+:;{}<>,.-', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'regularText', |
| | | label: '正则提示', |
| | | initVal: card.regularText || '', |
| | | tooltip: '正则验证时的提示信息。', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'tooltip', |
| | | label: '悬浮提示', |
| | | tooltip: '鼠标悬浮于提示文字上方时,显示提示信息。', |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'placeholder', |
| | | label: '提示信息', |
| | | label: '输入提示', |
| | | tooltip: '字段预期值的提示信息。', |
| | | initVal: card.placeholder || '', |
| | | required: false |
| | |
| | | // forbid: appType !== 'mob' |
| | | // }, |
| | | { |
| | | type: 'radio', |
| | | key: 'empty', |
| | | label: '空值隐藏', |
| | | initVal: card.empty || 'show', |
| | | tooltip: '当选项为空时,隐藏该表单。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'show', text: '否'}, |
| | | {value: 'hidden', text: '是'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | key: 'blacklist', |
| | | label: Formdict['header.form.blacklist'], |
| | | label: '黑名单', |
| | | initVal: card.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'label', |
| | | label: Formdict['header.menu.tabName'], |
| | | label: '标签名称', |
| | | initVal: card.label || '', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'linkTab', |
| | | label: Formdict['header.form.linkTab'], |
| | | label: '关联标签', |
| | | initVal: card.linkTab || '', |
| | | required: false, |
| | | options: [] |
| | |
| | | { |
| | | type: 'icon', |
| | | key: 'icon', |
| | | label: Formdict['model.icon'], |
| | | label: '图标', |
| | | initVal: card.icon || '', |
| | | required: false, |
| | | forbid: type === 'CalendarPage' |
| | |
| | | { |
| | | type: 'select', |
| | | key: 'supMenu', |
| | | label: Formdict['header.form.supTab'], |
| | | label: '上级标签', |
| | | initVal: supMenu, |
| | | required: false, |
| | | options: menus, |
| | |
| | | { |
| | | type: 'mutilselect', |
| | | key: 'equalTab', |
| | | label: Formdict['header.form.equalTab'], |
| | | label: '同级标签', |
| | | tooltip: '如果子标签中含有刷新同级标签的按钮,在此处添加需要刷新的标签。', |
| | | initVal: equalTab, |
| | | required: false, |