| | |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | |
| | | /** |
| | | * @description 获取元素配置信息 |
| | | * @param {*} card |
| | | * @param {*} type |
| | | */ |
| | | export function getCardCellForm (card, type, subtype, cardCell, anchors) { |
| | | export function getCardCellForm (card, cards, cardCell) { |
| | | let _options = [ |
| | | { value: 'text', text: '文本'}, |
| | | { value: 'number', text: '数值'}, |
| | |
| | | { value: 'formula', text: '公式'}, |
| | | ] |
| | | |
| | | if (type === 'table' || (type === 'card' && subtype === 'datacard')) { |
| | | let anchors = [] |
| | | if (window.GLOB.customMenu.Template === 'BaseTable') { |
| | | anchors = null |
| | | } else { |
| | | anchors = MenuUtils.getAnchors(window.GLOB.customMenu.components, cards.uuid) || [] |
| | | } |
| | | |
| | | if (cards.type === 'table' || (cards.type === 'card' && cards.subtype === 'datacard')) { |
| | | _options.push({value: 'sequence', text: '序号'}) |
| | | } else if (card.eleType === 'sequence') { // 拖拽添加类型转换 |
| | | card.eleType = 'text' |
| | | } |
| | | |
| | | let appMenus = [] |
| | | const isApp = sessionStorage.getItem('appType') === 'pc' |
| | | |
| | | if (isApp) { |
| | | appMenus = sessionStorage.getItem('appMenus') |
| | | if (appMenus) { |
| | | try { |
| | | appMenus = JSON.parse(appMenus) |
| | | } catch (e) { |
| | | appMenus = [] |
| | | if (card.eleType === 'icon' && card.datatype === 'dynamic' && !card.field) { // 拖拽添加类型转换 |
| | | card.datatype = 'static' |
| | | } |
| | | } else { |
| | | appMenus = [] |
| | | } |
| | | } |
| | | let appType = sessionStorage.getItem('appType') |
| | | |
| | | let tooltip = '' |
| | | if (cardCell.$cardType === 'extendCard') { |
| | |
| | | initVal: card.eleType, |
| | | required: true, |
| | | options: _options |
| | | }, |
| | | { |
| | | type: 'icon', |
| | | key: 'icon', |
| | | label: '图标', |
| | | initVal: card.icon, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | initVal: card.field || '', |
| | | required: true, |
| | | options: [] |
| | | }, |
| | | { |
| | | type: 'icon', |
| | | key: 'icon', |
| | | label: '图标', |
| | | initVal: card.icon, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | key: 'tooltip', |
| | | label: '提示信息', |
| | | initVal: card.tooltip || '', |
| | | tooltip: '鼠标悬浮时显示。', |
| | | tooltip: '鼠标悬浮时显示。注:如使用动态信息,请在此处填写相应的字段名。', |
| | | forbid: appType === 'mob', |
| | | required: false |
| | | }, |
| | | { |
| | |
| | | initVal: card.anchors || [], |
| | | tooltip: sessionStorage.getItem('appType') === 'mob' ? '注:小程序中无效' : '', |
| | | required: false, |
| | | options: anchors |
| | | options: anchors, |
| | | forbid: !anchors |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'linkmenu', |
| | | label: '关联菜单', |
| | | initVal: card.linkmenu || '', |
| | | required: true, |
| | | forbid: !isApp, |
| | | options: appMenus |
| | | }, |
| | | // { |
| | | // type: 'radio', |
| | | // key: 'open', |
| | | // label: '打开方式', |
| | | // initVal: card.open || 'blank', |
| | | // required: false, |
| | | // forbid: !isApp, |
| | | // options: [ |
| | | // { value: 'blank', text: '新页面' }, |
| | | // { value: 'self', text: '当前页面' } |
| | | // ] |
| | | // }, |
| | | { |
| | | type: 'select', |
| | | key: 'linkurl', |
| | | label: '链接地址', |
| | | initVal: card.linkurl || '', |
| | |
| | | key: 'noValue', |
| | | label: '空值', |
| | | initVal: card.noValue || 'show', |
| | | tooltip: '当元素内容为空时,是否显示当前元素。', |
| | | tooltip: '当元素内容为空时,是否显示当前元素。注:数值类型元素包括数字0(非文本)。', |
| | | required: false, |
| | | options: [ |
| | | { value: 'show', text: '显示' }, |