| | |
| | | * @param {object} card // 搜索条件对象 |
| | | * @param {Array} linkableFields // 可关联字段 |
| | | */ |
| | | export function getSearchForm (card, linkableFields, columns) { |
| | | export function getSearchForm (card, linkableFields, columns, position) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let appType = sessionStorage.getItem('appType') |
| | | if (roleList) { |
| | |
| | | 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'] |
| | |
| | | value: 'equaltab', |
| | | text: '刷新同级标签' |
| | | }) |
| | | } else if (card.execSuccess === 'maingrid') { |
| | | card.execSuccess = 'grid' |
| | | } |
| | | |
| | | if (card.OpenType === 'blank') { |
| | |
| | | } |
| | | if (!card.control && card.controlField) { |
| | | card.control = 'disabled' |
| | | } |
| | | |
| | | if (card.intertype === 'outer' && !card.procMode && !card.innerFunc) { // 兼容外部函数直传类型 |
| | | card.procMode = 'none' |
| | | } |
| | | |
| | | return [ |
| | |
| | | options: opentypes |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'label', |
| | | label: '按钮名称', |
| | | initVal: card.label, |
| | | required: true, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'funcType', |
| | | label: '功能类型', |
| | | initVal: card.funcType || '', |
| | | required: true, |
| | | options: [{ |
| | | value: 'changeuser', |
| | | text: '切换用户' |
| | | }, { |
| | | value: 'print', |
| | | text: '标签打印' |
| | | }, { |
| | | value: 'refund', |
| | | text: '退款' |
| | | }, { |
| | | value: 'changeuser', |
| | | text: '切换用户' |
| | | }, { |
| | | value: 'closetab', |
| | | text: '标签关闭' |
| | |
| | | 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: '无' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | initVal: card.sqlType || '', |
| | | required: true, |
| | | options: [] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'label', |
| | | label: '按钮名称', |
| | | initVal: card.label, |
| | | required: true, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | 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: '无' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | key: 'callbackFunc', |
| | | label: Formdict['header.form.callbackFunc'], |
| | | initVal: card.callbackFunc || '', |
| | | required: false, |
| | | required: true, |
| | | readonly: false |
| | | }, |
| | | { |
| | |
| | | value: 'picture', |
| | | text: Formdict['model.form.picture'] |
| | | }, { |
| | | value: 'video', |
| | | text: '视频' |
| | | }, { |
| | | value: 'link', |
| | | text: Formdict['model.form.href'] |
| | | }, { |
| | |
| | | }] |
| | | }, |
| | | { |
| | | 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', |
| | | key: 'rowspan', |
| | | label: '行合并', |
| | |
| | | type: 'select', |
| | | key: 'format', |
| | | label: Formdict['header.form.format'], |
| | | initVal: card.format || '', |
| | | 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 || '', |
| | | 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: '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', |
| | |
| | | value: 'select', |
| | | text: Formdict['model.form.select'] |
| | | }, { |
| | | value: 'textarea', |
| | | text: '多行文本' |
| | | }, { |
| | | value: 'multiselect', |
| | | text: Formdict['model.form.multiselect'] |
| | | }, { |
| | |
| | | // }, { |
| | | // value: 'datetime', |
| | | // text: '日期(分/秒)' |
| | | }, { |
| | | value: 'textarea', |
| | | text: Formdict['model.form.textarea'] |
| | | }, { |
| | | value: 'cascader', |
| | | text: '级联菜单' |
| | |
| | | type: 'text', |
| | | key: 'separator', |
| | | label: '连接符', |
| | | initVal: card.separator || card.separator === undefined ? '/' : '', |
| | | initVal: card.separator === undefined ? '/' : card.separator, |
| | | tooltip: '表单提交时信息之间的连接符。注:连接符为空时,初始化时填充其他表单无效。', |
| | | required: false, |
| | | readonly: false |
| | |
| | | value: '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: Formdict['model.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: '不支持' |
| | | text: Formdict['model.false'] |
| | | }] |
| | | }, |
| | | { |
| | |
| | | { |
| | | type: 'radio', |
| | | key: 'required', |
| | | label: Formdict['model.required'], |
| | | label: "必填", |
| | | initVal: card.required || 'true', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | }, { |
| | | 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'] |
| | |
| | | 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: '首行' |
| | |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | }] |
| | | }, |
| | | { |
| | | 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', |
| | |
| | | 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加密' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | 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', |
| | |
| | | label: '填充表单', |
| | | tooltip: '在切换选项时会把信息自动填入关联的表单(文本或数字表单)中。', |
| | | initVal: card.linkSubField || [], |
| | | options: inputfields |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'fillField', |
| | | label: '填充表单', |
| | | tooltip: '在切换选项时会把级联菜单的文本自动填入关联的表单中。', |
| | | initVal: card.fillField || '', |
| | | options: inputfields |
| | | }, |
| | | // { |