| | |
| | | * @param {object} card // 搜索条件对象 |
| | | */ |
| | | export function getColumnForm (card, fields = []) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | if (roleList) { |
| | | try { |
| | |
| | | roleList = [] |
| | | } |
| | | |
| | | let menulist = [] |
| | | |
| | | if (appType === 'pc') { |
| | | menulist = sessionStorage.getItem('appMenus') |
| | | } else if (!appType) { |
| | | menulist = sessionStorage.getItem('fstMenuList') |
| | | } |
| | | let menulist = sessionStorage.getItem('fstMenuList') |
| | | |
| | | if (menulist) { |
| | | try { |
| | |
| | | }) |
| | | } |
| | | |
| | | if (!card.linkurl && (!card.linkmenu || card.linkmenu.length === 0)) { |
| | | card.perspective = '' |
| | | } |
| | | |
| | | return [ |
| | | { |
| | | type: 'text', |
| | |
| | | options: options |
| | | }, |
| | | { |
| | | type: 'select', |
| | | type: card.isSub ? 'select' : 'text', |
| | | key: 'field', |
| | | label: '字段', |
| | | initVal: card.field, |
| | | required: true, |
| | | options: fields |
| | | options: card.isSub ? fields : [] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | type: 'text', |
| | | key: 'nameField', |
| | | label: '名称字段', |
| | | initVal: card.nameField || '', |
| | | required: false, |
| | | options: [{uuid: 'empty', field: '', label: '空'}, ...fields] |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | value: 'linkurl', |
| | | text: '链接' |
| | | }], |
| | | forbidden: appType === 'mob' |
| | | }, |
| | | { |
| | | type: appType === 'pc' ? 'select' : 'cascader', |
| | | type: 'cascader', |
| | | key: 'linkmenu', |
| | | label: '菜单', |
| | | initVal: card.linkmenu || (appType === 'pc' ? '' : []), |
| | | initVal: card.linkmenu || [], |
| | | required: true, |
| | | options: menulist, |
| | | forbidden: appType === 'mob' |
| | | options: menulist |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | key: 'linkurl', |
| | | label: '链接地址', |
| | | initVal: card.linkurl || '', |
| | | required: true, |
| | | forbidden: appType === 'mob' |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | initVal: card.linkfields || [], |
| | | required: false, |
| | | options: fields, |
| | | forbidden: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'open', |
| | | label: '打开方式', |
| | | initVal: card.open || 'blank', |
| | | required: false, |
| | | forbid: appType !== 'pc', |
| | | options: [ |
| | | { value: 'blank', text: '新窗口' }, |
| | | { value: 'self', text: '当前窗口' } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | label: '黑名单', |
| | | initVal: card.blacklist || [], |
| | | required: false, |
| | | options: roleList, |
| | | forbidden: appType === 'mob' |
| | | options: roleList |
| | | } |
| | | ] |
| | | } |