| | |
| | | let typeOptions = [] |
| | | |
| | | if (appType === 'mob') { |
| | | // let adapters = sessionStorage.getItem('adapter') |
| | | // if (adapters) { |
| | | // adapters = adapters.split(',') |
| | | // } else { |
| | | // adapters = [] |
| | | // } |
| | | // (adapters.includes('wxmini') ? '(小程序暂不支持)' : '') |
| | | |
| | | typeOptions = [{ |
| | | value: 'range', |
| | | text: '数值(区间)' |
| | |
| | | // value: 'daterange', |
| | | // text: Formdict['model.form.daterange'] |
| | | }] |
| | | |
| | | } else { |
| | | typeOptions = [{ |
| | | value: 'text', |
| | |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | type: 'codemirror', |
| | | key: 'dataSource', |
| | | label: Formdict['header.form.datasource'], |
| | | initVal: card.dataSource || '', |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'labelwidth', |
| | | min: 1, |
| | | max: 100, |
| | | precision: 1, |
| | | label: '名称宽度', |
| | | initVal: card.labelwidth || 33.3, |
| | | tooltip: '名称占据搜索条件宽度的百分比。注:存在多列搜索时,当前搜索如果想要占据整行可参照以下比例,两列(16.5)、三列(10.8)、四列(8)', |
| | | required: true, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | 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: 'required', |
| | | label: Formdict['model.required'], |
| | |
| | | key: 'advanced', |
| | | label: '高级搜索', |
| | | initVal: card.advanced || 'false', |
| | | tooltip: '在隐藏搜索按钮时,高级搜索无效。', |
| | | forbid: appType === 'mob', |
| | | options: [{ |
| | | value: 'true', |
| | |
| | | type: refresh.length === 0 ? 'radio' : 'select', |
| | | key: 'execSuccess', |
| | | label: Formdict['model.form.afterSuccess'], |
| | | initVal: card.execSuccess || 'never', |
| | | initVal: card.execSuccess || 'grid', |
| | | tooltip: '选择刷新行时,如果选择多条数据会刷新表格。', |
| | | required: true, |
| | | options: [{ |
| | | value: 'never', |
| | | text: '不刷新' |
| | | }, { |
| | | value: 'grid', |
| | | text: '刷新表格' |
| | | }, { |
| | | value: 'line', |
| | | text: '刷新行' |
| | | }, { |
| | | value: 'grid', |
| | | text: '刷新表格' |
| | | }, |
| | | ...refresh] |
| | | }, |
| | |
| | | value: 'never', |
| | | text: '不刷新' |
| | | }, { |
| | | value: 'grid', |
| | | text: '刷新表格' |
| | | }, { |
| | | value: 'line', |
| | | text: '刷新行' |
| | | }, { |
| | | value: 'grid', |
| | | text: '刷新表格' |
| | | }, |
| | | ...refresh] |
| | | }, |
| | |
| | | type: 'text', |
| | | key: 'output', |
| | | label: '返回值', |
| | | tooltip: '执行成功后的返回值。', |
| | | tooltip: '执行成功后的返回值。例如:@id', |
| | | initVal: card.output || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'tipTitle', |
| | | label: '确认提示', |
| | | initVal: card.tipTitle || '', |
| | | tooltip: '注:弹窗(表单)在显示为是否框时有效。', |
| | | required: false |
| | | }, |
| | | { |
| | |
| | | label: '控制值', |
| | | tooltip: '当选择控制字段,且字段值与控制值相等时,按钮会隐藏或禁用,多个值用逗号分隔。', |
| | | initVal: card.controlVal || '', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'reason', |
| | | label: '禁用原因', |
| | | initVal: card.reason || '', |
| | | required: false |
| | | }, |
| | | ] |
| | |
| | | }, { |
| | | value: 'datemonth', |
| | | text: Formdict['model.form.datemonth'] |
| | | }, { |
| | | value: 'datetime', |
| | | text: Formdict['model.form.datetime'] |
| | | // }, { |
| | | // value: 'datetime', |
| | | // text: '日期(分/秒)' |
| | | }, { |
| | | value: 'textarea', |
| | | text: Formdict['model.form.textarea'] |
| | |
| | | }, { |
| | | value: 'datemonth', |
| | | text: Formdict['model.form.datemonth'] |
| | | }, { |
| | | value: 'datetime', |
| | | text: Formdict['model.form.datetime'] |
| | | // }, { |
| | | // value: 'datetime', |
| | | // text: '日期(分/秒)' |
| | | }, { |
| | | value: 'textarea', |
| | | text: Formdict['model.form.textarea'] |
| | |
| | | }, { |
| | | value: 'split', |
| | | text: '分隔线' |
| | | }, { |
| | | value: 'linkMain', |
| | | text: '关联主表' |
| | | }] |
| | | } |
| | | |
| | |
| | | _fieldlength = 512 |
| | | } else if (['textarea', 'brafteditor'].includes(card.type)) { |
| | | _fieldlength = 8000 |
| | | } else if (card.type === 'datetime') { |
| | | card.type = 'date' |
| | | card.precision = 'second' |
| | | } |
| | | |
| | | let options = card.options || [] |
| | |
| | | initval = card.initval === true |
| | | } else if (card.type === 'number') { |
| | | initval = card.initval || 0 |
| | | } |
| | | |
| | | if (appType === 'mob' && ![24, 12, 8, 6].includes(card.span)) { |
| | | card.span = 24 |
| | | } |
| | | |
| | | return [ |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'precision', |
| | | label: '精确度', |
| | | initVal: card.precision || 'day', |
| | | options: [{ |
| | | value: 'day', |
| | | text: '天' |
| | | }, { |
| | | value: 'hour', |
| | | text: '小时' |
| | | }, { |
| | | value: 'minute', |
| | | text: '分钟' |
| | | }, { |
| | | value: 'second', |
| | | text: '秒' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'fieldlength', |
| | | min: 1, |
| | |
| | | label: Formdict['model.form.field'] + Formdict['model.length'], |
| | | // tooltip: '文本、下拉框、日期等字段默认长度为50,多行文本与文件上传字段默认长度为512', |
| | | initVal: card.fieldlength || _fieldlength, |
| | | required: false |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | type: 'radio', |
| | | key: 'interception', |
| | | label: '截取空格', |
| | | initVal: card.interception || 'false', |
| | | initVal: card.interception || 'true', |
| | | tooltip: '提交时,是否截取首尾的空白字符。', |
| | | options: [{ |
| | | value: 'true', |
| | |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'span', |
| | | label: '表单宽度', |
| | | initVal: card.span || 24, |
| | | tooltip: '栅格布局整行24等分。', |
| | | required: true, |
| | | forbid: appType !== 'mob', |
| | | options: [{ |
| | | value: 24, |
| | | text: 24 |
| | | }, { |
| | | value: 12, |
| | | text: 12 |
| | | }, { |
| | | value: 8, |
| | | text: 8 |
| | | }, { |
| | | 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: 'number', |
| | | key: 'labelwidth', |
| | | min: 1, |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'supvalue', |
| | | max: 512, |
| | | label: '显示值', |
| | | tooltip: '请填写显示值,只有上级表单值与显示值相同时,该表单才会显示,注:1、多个值用逗号分隔;2、上级表单初始值为$first时暂未处理。', |
| | | initVal: card.supvalue || '', |
| | |
| | | initVal: card.extra || '', |
| | | required: false, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'enterReplace', |
| | | label: '回车符替换', |
| | | tooltip: '回车符会替换为英文逗号。', |
| | | initVal: card.enterReplace || 'false', |
| | | required: false, |
| | | forbid: appType !== 'mob', |
| | | options: [{ |
| | | value: 'false', |
| | | text: '否' |
| | | }, { |
| | | value: 'true', |
| | | text: '是' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | key: 'marginTop', |
| | | label: '上边距(px)', |
| | | initVal: card.marginTop || 0, |
| | | min: 0, |
| | | min: -100, |
| | | max: 1000, |
| | | precision: 0, |
| | | required: false, |
| | |
| | | key: 'marginBottom', |
| | | label: '下边距(px)', |
| | | initVal: card.marginBottom || 0, |
| | | min: 0, |
| | | min: -100, |
| | | max: 1000, |
| | | precision: 0, |
| | | required: false, |