| | |
| | | */ |
| | | export function getSearchForm (card, linkableFields) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let appType = sessionStorage.getItem('appType') |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | |
| | | |
| | | let typeOptions = [] |
| | | |
| | | if (sessionStorage.getItem('appType') === 'mob') { |
| | | if (appType === 'mob') { |
| | | typeOptions = [{ |
| | | value: 'text', |
| | | text: Formdict['model.form.text'] |
| | | value: 'range', |
| | | text: '数值(区间)' |
| | | }, { |
| | | value: 'checkcard', |
| | | text: '选项卡' |
| | |
| | | }, { |
| | | value: 'datemonth', |
| | | text: Formdict['model.form.datemonth'] |
| | | }, { |
| | | value: 'daterange', |
| | | text: Formdict['model.form.daterange'] |
| | | }] |
| | | if (!['text', 'checkcard', 'date', 'datemonth'].includes(card.type)) { |
| | | card.type = 'text' |
| | | } |
| | | } else { |
| | | typeOptions = [{ |
| | | value: 'text', |
| | |
| | | value: 'group', |
| | | text: Formdict['model.form.dategroup'] |
| | | }] |
| | | } |
| | | |
| | | if (card.focus) { |
| | | if (['text', 'multiselect'].includes(card.type)) { |
| | | card.match = 'like' |
| | | } else if (['select', 'link', 'checkcard'].includes(card.type)) { |
| | | card.match = '=' |
| | | } else if (card.type === 'date') { |
| | | card.match = '>=' |
| | | } else if (['datemonth', 'dateweek', 'daterange', 'range'].includes(card.type)) { |
| | | card.match = 'between' |
| | | } |
| | | } |
| | | |
| | | return [ |
| | |
| | | type: 'text', |
| | | key: 'initval', |
| | | label: Formdict['header.form.initval'], |
| | | tooltip: '类型为下拉菜单时,初始值应为数据的Value值(使用数据源时,应为《值·字段》的值)', |
| | | tooltip: '类型为下拉菜单时,初始值应为数据的Value值(使用数据源时,应为《值·字段》的值);类型为数值(区间)时,初始值使用逗号拼接,例如 3,10', |
| | | initVal: card.initval, |
| | | required: false |
| | | }, |
| | |
| | | min: 1, |
| | | max: 24, |
| | | precision: 0, |
| | | label: '卡片宽度', |
| | | label: '元素宽度', |
| | | initVal: card.width || 4, |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | required: true |
| | |
| | | max: 24, |
| | | label: Formdict['header.form.ratio'], |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | initVal: card.ratio, |
| | | initVal: card.ratio || 6, |
| | | forbid: appType === 'mob', |
| | | required: false |
| | | }, |
| | | { |
| | |
| | | // }] |
| | | // }, |
| | | { |
| | | type: 'number', |
| | | key: 'maxValue', |
| | | label: '最大值', |
| | | initVal: card.maxValue, |
| | | forbid: appType !== 'mob', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'minValue', |
| | | label: '最小值', |
| | | initVal: card.minValue, |
| | | forbid: appType !== 'mob', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'step', |
| | | label: '步长', |
| | | initVal: card.step, |
| | | tooltip: '步长取值必须大于 0,并且可被 (max - min) 整除', |
| | | forbid: appType !== 'mob', |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'labelShow', |
| | | label: '显示名称', |
| | |
| | | key: 'advanced', |
| | | label: '高级搜索', |
| | | initVal: card.advanced || 'false', |
| | | forbid: sessionStorage.getItem('appType') === 'mob', |
| | | forbid: appType === 'mob', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | |
| | | label: '输入样式', |
| | | initVal: card.inputType || 'input', |
| | | required: false, |
| | | forbid: sessionStorage.getItem('appType') === null, |
| | | forbid: appType === null, |
| | | options: [{ |
| | | value: 'input', |
| | | text: '输入框' |
| | |
| | | min: 1, |
| | | max: 24, |
| | | precision: 0, |
| | | label: '卡片宽度', |
| | | label: '元素宽度', |
| | | initVal: card.width || 4, |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | required: true |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'arrange', |
| | | label: '元素排列', |
| | | initVal: card.arrange || 'adaptive', |
| | | forbid: appType !== 'mob', |
| | | options: [{ |
| | | value: 'line', |
| | | text: '整行' |
| | | }, { |
| | | value: 'adaptive', |
| | | text: '自适应' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'color', |
| | | key: 'backgroundColor', |
| | | label: '背景色', |