| | |
| | | * @param {object} card // 图表对象 |
| | | */ |
| | | export function getBaseForm (card) { |
| | | let isApp = sessionStorage.getItem('appType') === 'pc' |
| | | let appType = sessionStorage.getItem('appType') |
| | | let isApp = appType === 'pc' || appType === 'mob' |
| | | let menulist = null |
| | | |
| | | if (isApp) { |
| | |
| | | return item |
| | | }) |
| | | } |
| | | } catch { |
| | | } catch (e) { |
| | | menulist = [] |
| | | } |
| | | } else { |
| | |
| | | if (roleList) { |
| | | try { |
| | | roleList = JSON.parse(roleList) |
| | | } catch { |
| | | } catch (e) { |
| | | roleList = [] |
| | | } |
| | | } else { |
| | |
| | | * @param {Array} columns // 显示列 |
| | | */ |
| | | export function getOptionForm (card, columns) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let xfields = columns.filter(item => /^Nvarchar/ig.test(item.datatype)) |
| | | let yfields = columns.filter(item => /^(Int|Decimal)/ig.test(item.datatype)) |
| | | |
| | |
| | | { |
| | | type: 'radio', |
| | | key: 'label', |
| | | label: '标注值', |
| | | label: '标签', |
| | | initVal: card.label || 'false', |
| | | required: false, |
| | | options: [{ |
| | |
| | | text: '内侧' |
| | | }, { |
| | | value: 'outer', |
| | | text: '外侧' |
| | | text: '蜘蛛' |
| | | }, { |
| | | value: 'normal', |
| | | text: '常规' |
| | | }], |
| | | }, { |
| | | type: 'radio', |
| | |
| | | text: '累加' |
| | | }] |
| | | }, { |
| | | type: 'number', |
| | | key: 'splitLine', |
| | | label: '分隔线', |
| | | initVal: card.splitLine || '', |
| | | tooltip: '分隔线的宽度。', |
| | | min: 0, |
| | | max: 20, |
| | | decimal: 0, |
| | | required: false |
| | | }, { |
| | | type: 'color', |
| | | key: 'splitColor', |
| | | label: '分隔色', |
| | | initVal: card.splitColor || '#ffffff', |
| | | tooltip: '分隔线的颜色,存在分隔线时有效。', |
| | | required: false |
| | | }, { |
| | | type: 'color', |
| | | key: 'color', |
| | | label: '色系', |
| | | initVal: card.color || 'rgba(0, 0, 0, 0.85)', |
| | | tooltip: '坐标轴及示例等提示文字使用的颜色。', |
| | | required: false |
| | | }, { |
| | | type: 'select', |
| | | key: 'interaction', |
| | | label: '交互效果', |
| | | initVal: card.interaction || [], |
| | | multi: true, |
| | | required: false, |
| | | forbid: appType === 'mob', |
| | | options: [ |
| | | { value: 'element-active', label: '元素聚焦' }, |
| | | { value: 'element-selected', label: '元素选中(多选)' }, |
| | | { value: 'element-single-selected', label: '元素选中(单选)' }, |
| | | // { value: 'active-region', label: '背景框' }, |
| | | // { value: 'view-zoom', label: '视图缩放' }, |
| | | { value: 'element-highlight', label: '元素高亮' }, |
| | | // { value: 'element-highlight-by-color', label: '同色元素高亮' }, |
| | | // { value: 'element-highlight-by-x', label: '同X轴元素高亮' }, |
| | | { value: 'legend-filter', label: '图例过滤' }, |
| | | { value: 'legend-active', label: '图例聚焦' }, |
| | | { value: 'legend-highlight', label: '图例高亮' }, |
| | | // { value: 'brush', label: '选框过滤' }, |
| | | ] |
| | | } |
| | | ] |
| | | } |