| | |
| | | |
| | | /** |
| | | * @description 获取搜索条件表单配置信息 |
| | | * @param {object} card // 搜索条件对象 |
| | | * @param {Array} roleList // 角色列表 |
| | | * @param {object} card // 搜索条件对象 |
| | | * @param {Array} roleList // 角色列表 |
| | | * @param {Array} linkableFields // 可关联字段 |
| | | */ |
| | | export function getSearchForm (card, roleList) { |
| | | export function getSearchForm (card, roleList, linkableFields) { |
| | | return [ |
| | | { |
| | | type: 'text', |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | type: 'select', |
| | | key: 'linkField', |
| | | label: Formdict['header.form.linkField'], |
| | | initVal: card.linkField || '', |
| | | required: true, |
| | | readonly: false |
| | | readonly: false, |
| | | options: linkableFields |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | options: [{ |
| | | value: 'dropdown', |
| | | text: Formdict['header.form.dropdown'] |
| | | }, { |
| | | value: 'button', |
| | | text: Formdict['header.form.button'] |
| | | // }, { |
| | | // value: 'button', |
| | | // text: Formdict['header.form.button'] |
| | | }] |
| | | }, |
| | | { |
| | |
| | | }, { |
| | | value: 'sso', |
| | | text: Formdict['header.form.database.sso'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'required', |
| | | label: Formdict['model.required'], |
| | | initVal: card.required || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | }] |
| | | }, |
| | | { |
| | |
| | | options: [] |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | key: 'blacklist', |
| | | label: Formdict['header.form.blacklist'], |
| | | initVal: card.blacklist || [], |
| | | required: false, |
| | | options: roleList || [] |
| | | type: 'radio', |
| | | key: 'required', |
| | | label: Formdict['model.required'], |
| | | initVal: card.required || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'Hide', |
| | | label: Formdict['model.hidden'], |
| | | initVal: card.Hide || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['model.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | key: 'blacklist', |
| | | label: Formdict['header.form.blacklist'], |
| | | initVal: card.blacklist || [], |
| | | required: false, |
| | | options: roleList || [] |
| | | } |
| | | ] |
| | | } |