| | |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | import MenuUtils, { getInterfaces } from '@/utils/utils-custom.js' |
| | | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | |
| | | let ispop = sessionStorage.getItem('editMenuType') === 'popview' |
| | | let menu = window.GLOB.customMenu |
| | | let laypage = setting && setting.laypage !== 'false' |
| | | |
| | | let interfaces = [] |
| | | if (subtype === 'propcard' && menu.interfaces) { |
| | | menu.interfaces.forEach(item => { |
| | | if (item.status === 'true') { |
| | | interfaces.push({ |
| | | value: item.uuid, |
| | | label: item.name |
| | | }) |
| | | } |
| | | }) |
| | | if (subtype === 'propcard') { |
| | | interfaces = getInterfaces() |
| | | } |
| | | let modules = [] |
| | | if (subtype === 'propcard' || subtype === 'datacard') { |
| | |
| | | field: 'datatype', |
| | | label: '数据来源', |
| | | initval: wrap.datatype || 'dynamic', |
| | | tooltip: '选择静态值,无需配置数据源。', |
| | | tooltip: '选择静态时,无需配置数据源,可展示上级组件或url参数字段。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'dynamic', label: '动态', priKeyType: 'static'}, |
| | |
| | | options: interfaces, |
| | | reset_source: true, |
| | | forbid: subtype !== 'propcard', |
| | | callback: (map, record) => { |
| | | callback: (record) => { |
| | | if (!record.publicId) return |
| | | |
| | | let interfaces = window.GLOB.customMenu.interfaces || [] |
| | | |
| | | let d = interfaces.filter(m => m.uuid === record.publicId && m.status === 'true')[0] |
| | | let d = interfaces.filter(m => m.value === record.publicId)[0] |
| | | |
| | | if (!d || !d.columns) return |
| | | let columns = JSON.parse(JSON.stringify(d.columns)) |
| | | |
| | | let _broadcast = map.get('broadcast') |
| | | |
| | | if (_broadcast && !_broadcast.forbid) { |
| | | _broadcast.options = columns |
| | | _broadcast.oriOptions = columns |
| | | map.set('broadcast', _broadcast) |
| | | } |
| | | |
| | | let _jumpField = map.get('jumpField') |
| | | |
| | | if (_jumpField && !_jumpField.forbid) { |
| | | _jumpField.options = columns |
| | | _jumpField.oriOptions = columns |
| | | map.set('jumpField', _jumpField) |
| | | } |
| | | |
| | | let _link = map.get('link') |
| | | |
| | | if (_link && !_link.forbid) { |
| | | _link.options = columns |
| | | _link.oriOptions = columns |
| | | map.set('link', _link) |
| | | return { |
| | | broadcast: d.columns, |
| | | jumpField: d.columns, |
| | | link: d.columns |
| | | } |
| | | } |
| | | }, |
| | |
| | | controlFields: subtype !== 'propcard' ? [ |
| | | {field: 'printHeight', values: ['flex']}, |
| | | {field: 'cardFloat', values: ['grid']}, |
| | | {field: 'zHeight', values: ['grid']}, |
| | | ] : [{field: 'cardFloat', values: ['grid']}], |
| | | forbid: subtype === 'tablecard' |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'zHeight', |
| | | label: '最大高度', |
| | | initval: wrap.zHeight || '', |
| | | tooltip: '卡片内容区的最大高度(不包含标题、翻页等元素),添加高度后组件中第一个属性卡将固定于头部。注:小于等于100时为高度的百分比。', |
| | | min: 10, |
| | | max: 3000, |
| | | precision: 0, |
| | | required: false, |
| | | forbid: subtype !== 'datacard' || appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | required: false, |
| | | linkField: 'datatype', |
| | | options: [ |
| | | {ParentID: 'static', value: 'static', label: '静态值'}, |
| | | {ParentID: 'dynamic', value: 'static', label: '静态值'}, |
| | | {ParentID: '', value: 'static', label: '静态值'}, |
| | | {ParentID: 'dynamic', value: 'dynamic', label: '动态值'}, |
| | | {ParentID: 'dynamic', value: 'joint', label: '拼接值'}, |
| | | {ParentID: 'public', value: 'static', label: '静态值'}, |
| | | {ParentID: 'public', value: 'dynamic', label: '动态值'}, |
| | | {ParentID: 'public', value: 'joint', label: '拼接值'}, |
| | | ], |
| | |
| | | label: '语音播报', |
| | | initval: wrap.broadcast || '', |
| | | tooltip: '语音播报在移动端有效。注:在H5中请使用音频链接,添加定时器时,可循环播报', |
| | | timestamp: new Date().getTime(), |
| | | required: false, |
| | | options: columns, |
| | | forbid: !columns || appType !== 'mob' || subtype !== 'propcard' |
| | |
| | | label: '控制字段', |
| | | initval: wrap.jumpField || '', |
| | | tooltip: '当字段值为true时触发跳转。', |
| | | timestamp: new Date().getTime(), |
| | | required: true, |
| | | options: columns, |
| | | forbid: subtype !== 'propcard' || appType !== 'mob' |
| | |
| | | label: '链接字段', |
| | | initval: wrap.link || '', |
| | | tooltip: '跳转链接为查询数据的返回值。', |
| | | timestamp: new Date().getTime(), |
| | | required: true, |
| | | options: columns, |
| | | forbid: subtype !== 'propcard' || appType !== 'mob' |