| | |
| | | key: 'dataresource', |
| | | label: '数据源', |
| | | initVal: setting.dataresource || '', |
| | | tooltip: '使用系统函数时,需填写数据源。', |
| | | tooltip: '使用系统函数时,需填写数据源。注:数据权限替换符 $@ -> /* 或 \'\'、 @$ -> */ 或 \'\'', |
| | | help: '数据ID:' + MenuID, |
| | | required: false, |
| | | readonly: false, |
| | |
| | | { value: 'false', text: '不执行' } |
| | | ] |
| | | }, |
| | | ] |
| | | } |
| | | |
| | | /** |
| | | * @description 获取树形页面设置表单配置信息 |
| | | * @param {object} setting // 菜单全局设置信息 |
| | | * @param {string} type // 菜单类型 |
| | | */ |
| | | export function getTreeSettingForm (setting, usefulFields = [], MenuID) { |
| | | let str = '^(' + usefulFields.join('|') + ')' |
| | | let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g') |
| | | |
| | | return [ |
| | | { |
| | | type: 'text', |
| | | key: 'tableName', |
| | | label: '表名', |
| | | initVal: setting.tableName || '', |
| | | required: true, |
| | | readonly: false, |
| | | rules: [ |
| | | { |
| | | max: formRule.input.max, |
| | | message: formRule.input.message |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'title', |
| | | label: '标题', |
| | | initVal: setting.title || '', |
| | | required: true, |
| | | readonly: false, |
| | | rules: [ |
| | | { |
| | | max: formRule.input.max, |
| | | message: formRule.input.message |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'interType', |
| | | label: Formdict['header.form.intertype'], |
| | | initVal: setting.interType || 'inner', |
| | | required: false, |
| | | readonly: false, |
| | | options: [ |
| | | { value: 'inner', text: Formdict['header.form.interface.inner'] }, |
| | | { value: 'outer', text: Formdict['header.form.interface.outer'] } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'sysInterface', |
| | | label: Formdict['header.form.sysInterface'], |
| | | initVal: setting.sysInterface || 'false', |
| | | required: false, |
| | | readonly: false, |
| | | options: [ |
| | | { value: 'true', text: Formdict['header.form.true'] }, |
| | | { value: 'false', text: Formdict['header.form.false'] } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'interface', |
| | | label: Formdict['header.form.interface'], |
| | | initVal: setting.sysInterface === 'true' ? (window.GLOB.mainSystemApi || '') : (setting.interface || ''), |
| | | required: true, |
| | | readonly: setting.sysInterface === 'true', |
| | | rules: [ |
| | | { |
| | | max: formRule.input.max, |
| | | message: formRule.input.message |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'outerFunc', |
| | | label: Formdict['header.form.outerFunc'], |
| | | initVal: setting.outerFunc || '', |
| | | required: false, |
| | | readonly: false, |
| | | rules: [ |
| | | { |
| | | pattern: formRule.func.pattern, |
| | | message: formRule.func.message |
| | | }, { |
| | | max: formRule.func.max, |
| | | message: formRule.func.maxMessage |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'innerFunc', |
| | | label: Formdict['header.form.innerFunc'], |
| | | initVal: setting.innerFunc || '', |
| | | tooltip: '开头可用字符:' + usefulFields.join(', '), |
| | | placement: 'bottomLeft', |
| | | required: false, |
| | | readonly: false, |
| | | rules: [ |
| | | { |
| | | pattern: _patten, |
| | | message: formRule.func.innerMessage |
| | | }, { |
| | | max: formRule.func.max, |
| | | message: formRule.func.maxMessage |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'datasource', |
| | | key: 'dataresource', |
| | | label: '数据源', |
| | | initVal: setting.dataresource || '', |
| | | tooltip: '使用系统函数时,需填写数据源。注:数据权限替换符 $@ -> /* 或 \'\'、 @$ -> */ 或 \'\'', |
| | | help: '数据ID:' + MenuID, |
| | | required: false, |
| | | readonly: false, |
| | | rules: [ |
| | | { |
| | | pattern: _patten, |
| | | message: formRule.func.innerMessage |
| | | }, { |
| | | max: formRule.func.max, |
| | | message: formRule.func.maxMessage |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'valueField', |
| | | label: 'Value', |
| | | initVal: setting.valueField || '', |
| | | tooltip: '数据值字段。', |
| | | required: true, |
| | | readonly: false, |
| | | rules: [ |
| | | { |
| | | pattern: formRule.field.pattern, |
| | | message: formRule.field.message |
| | | }, { |
| | | max: formRule.field.max, |
| | | message: formRule.field.maxMessage |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'labelField', |
| | | label: 'Label', |
| | | initVal: setting.labelField || '', |
| | | tooltip: '显示文字字段。', |
| | | required: true, |
| | | readonly: false, |
| | | rules: [ |
| | | { |
| | | pattern: formRule.field.pattern, |
| | | message: formRule.field.message |
| | | }, { |
| | | max: formRule.field.max, |
| | | message: formRule.field.maxMessage |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'parentField', |
| | | label: 'Parent', |
| | | initVal: setting.parentField || '', |
| | | tooltip: '父级字段。', |
| | | required: true, |
| | | readonly: false, |
| | | rules: [ |
| | | { |
| | | pattern: formRule.field.pattern, |
| | | message: formRule.field.message |
| | | }, { |
| | | max: formRule.field.max, |
| | | message: formRule.field.maxMessage |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'order', |
| | | label: '排序', |
| | | initVal: setting.order || '', |
| | | placeholder: 'ID asc, UID desc', |
| | | required: true, |
| | | readonly: false, |
| | | rules: [ |
| | | { |
| | | max: formRule.input.max, |
| | | message: formRule.input.message |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'mark', |
| | | label: '顶级标识', |
| | | initVal: setting.mark || '', |
| | | tooltip: '父级字段值与顶级标识(默认值为空)相同时,视为顶级节点。', |
| | | required: false, |
| | | readonly: false, |
| | | rules: [ |
| | | { |
| | | max: formRule.input.max, |
| | | message: formRule.input.message |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'width', |
| | | min: 2, |
| | | max: 12, |
| | | label: '宽度', |
| | | tooltip: '每行分为24份,树形比例可设置为2-12(最大50%)', |
| | | initVal: setting.width || 5, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'searchable', |
| | | label: '搜索', |
| | | initVal: setting.searchable || 'true', |
| | | required: false, |
| | | readonly: false, |
| | | options: [ |
| | | { value: 'true', text: '显示' }, |
| | | { value: 'false', text: '隐藏' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'default', |
| | | label: '默认sql', |
| | | initVal: setting.default || 'true', |
| | | required: false, |
| | | readonly: false, |
| | | options: [ |
| | | { value: 'true', text: '执行' }, |
| | | { value: 'false', text: '不执行' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'showIcon', |
| | | label: '显示图标', |
| | | initVal: setting.showIcon || 'false', |
| | | required: false, |
| | | readonly: false, |
| | | options: [ |
| | | { value: 'true', text: Formdict['header.form.true'] }, |
| | | { value: 'false', text: Formdict['header.form.false'] } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'showLine', |
| | | label: '显示分割线', |
| | | initVal: setting.showLine || 'false', |
| | | required: false, |
| | | readonly: false, |
| | | options: [ |
| | | { value: 'true', text: Formdict['header.form.true'] }, |
| | | { value: 'false', text: Formdict['header.form.false'] } |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | let refresh = [] |
| | | if (type === 'subtable') { // 子表页面,可设置刷新主表及同级标签 |
| | | refresh.push({ |
| | | value: 'maingrid', |
| | | text: Formdict['header.form.refresh.maingrid'] |
| | | }, { |
| | | value: 'equaltab', |
| | | text: Formdict['header.form.refresh.equaltab'] |
| | | }, { |
| | | value: 'mainline', |
| | | text: Formdict['header.form.refresh.mainline'] |
| | | }) |
| | | } |
| | | |
| | | return [ |
| | | { |
| | | type: 'select', |
| | |
| | | }, { |
| | | value: 'view', |
| | | text: Formdict['header.form.refresh.view'] |
| | | }] |
| | | }, |
| | | ...refresh] |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | }, { |
| | | value: 'view', |
| | | text: Formdict['header.form.refresh.view'] |
| | | }] |
| | | }, |
| | | ...refresh] |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'level', |
| | | label: '显示级别', |
| | | tooltip: '标签显示控制,选择指定级别时显示标签,级别为空时始终显示。', |
| | | initVal: card.level, |
| | | min: 1, |
| | | max: 10, |
| | | required: false, |
| | | forbid: type !== 'TreePage', |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'searchPass', |
| | | label: '主表搜索', |
| | | initVal: card.searchPass || 'false', |
| | | tooltip: '使用主表搜索条件时,主表的搜索条件会传入子表中。', |
| | | required: false, |
| | | forbid: type !== 'main', |
| | | forbid: type !== 'CommonTable', |
| | | options: [{ |
| | | value: 'true', |
| | | text: '使用' |