From cc1a76df575c18f0d0ee96e8658461efdce3a918 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 17 一月 2023 18:01:01 +0800 Subject: [PATCH] 2023-01-17 --- src/menu/components/chart/antv-G6/chartcompile/formconfig.jsx | 144 +++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 130 insertions(+), 14 deletions(-) diff --git a/src/menu/components/chart/antv-G6/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-G6/chartcompile/formconfig.jsx index cca1379..9eed12a 100644 --- a/src/menu/components/chart/antv-G6/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-G6/chartcompile/formconfig.jsx @@ -2,7 +2,7 @@ * @description 鑾峰彇鍥捐〃瑙嗗浘閰嶇疆琛ㄥ崟 * @param {object} card // 鍥捐〃瀵硅薄 */ -export function getBaseForm (card) { +export function getBaseForm (card, columns) { let appType = sessionStorage.getItem('appType') let roleList = sessionStorage.getItem('sysRoles') if (roleList) { @@ -13,6 +13,32 @@ } } else { roleList = [] + } + + let menulist = [] + + if (appType === 'pc') { + menulist = sessionStorage.getItem('appMenus') + if (menulist) { + try { + menulist = JSON.parse(menulist) + } catch (e) { + menulist = [] + } + } else { + menulist = [] + } + } else if (appType === '') { + menulist = sessionStorage.getItem('fstMenuList') + if (menulist) { + try { + menulist = JSON.parse(menulist) + } catch (e) { + menulist = [] + } + } else { + menulist = [] + } } return [ @@ -61,17 +87,107 @@ {value: 'true', label: '鍚敤'}, {value: 'false', label: '绂佺敤'}, ], - forbid: !appType + forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' }, { - type: 'select', + type: 'multiselect', field: 'blacklist', label: '榛戝悕鍗�', initval: card.blacklist || [], - multi: true, required: false, options: roleList, forbid: !!appType + }, + { + type: 'radio', + field: 'click', + label: '鐐瑰嚮浜嬩欢', + initval: card.click || '', + tooltip: '鐐瑰嚮鑺傜偣鏃惰Е鍙戠殑浜嬩欢銆�', + required: false, + options: [ + {value: '', label: '鏁版嵁鍒囨崲'}, + {value: 'menu', label: '鑿滃崟'}, + {value: 'menus', label: '鑿滃崟缁�'} + ], + controlFields: [ + {field: 'menu', values: ['menu']}, + {field: 'menus', values: ['menus']}, + {field: 'menuType', values: ['menus']}, + {field: 'open', values: ['menu', 'menus']}, + {field: 'joint', values: ['menu', 'menus']}, + ] + }, + { + type: appType === '' ? 'cascader' : 'select', + field: 'menu', + label: '鍏宠仈鑿滃崟', + initval: card.menu || (appType === '' ? [] : ''), + required: true, + extendName: 'MenuNo', + options: menulist + }, + { + type: 'select', + field: 'menuType', + label: '鑿滃崟绫诲瀷', + initval: card.menuType || '', + required: true, + options: columns + }, + { + type: 'radio', + field: 'open', + label: '鎵撳紑鏂瑰紡', + initval: card.open || 'blank', + required: false, + options: [ + {value: 'blank', label: '鏂扮獥鍙�'}, + {value: 'self', label: '褰撳墠绐楀彛'}, + ], + forbid: appType !== 'pc' + }, + { + type: 'radio', + field: 'joint', + label: '鍙傛暟鎷兼帴', + initval: card.joint || 'true', + required: false, + options: [ + {value: 'true', label: '鏄�'}, + {value: 'false', label: '鍚�'}, + ], + }, + { + type: 'table', + field: 'menus', + label: '鑿滃崟缁�', + initval: card.menus || [], + required: true, + span: 24, + actions: appType === 'pc' ? ['view'] : [], + columns: [ + { + title: '鏍囪瘑', + dataIndex: 'sign', + inputType: 'input', + editable: true, + unique: true, + required: false, + width: '35%' + }, + { + title: '鑿滃崟', + dataIndex: 'menu', + inputType: !appType ? 'cascader' : 'select', + editable: true, + required: true, + extends: !appType ? 'Menu' : [{key: 'label', value: 'label'}], + width: '35%', + render: (text, record) => record.label, + options: menulist + } + ] } ] } @@ -102,7 +218,7 @@ controlFields: [ {field: 'dirField', values: ['mindmap']}, {field: 'nodeColor', values: ['mindmap']}, - {field: 'collapsed', values: ['indentTree']}, + // {field: 'collapsed', values: ['indentTree', 'kapmap']}, ] }, { @@ -117,7 +233,7 @@ label: '鍥哄畾鍊�' }, { value: 'supvalue', - label: '涓婄骇' + label: '涓婄骇缁勪欢' }, { value: 'line', label: '琛�' @@ -130,16 +246,16 @@ }, { type: 'text', - field: 'rootLabel', - label: '鏍硅妭鐐规枃鏈�', - initval: card.rootLabel || '', + field: 'rootValue', + label: '鏍硅妭鐐瑰��', + initval: card.rootValue || '', required: true }, { type: 'text', - field: 'rootValue', - label: '鏍硅妭鐐瑰��', - initval: card.rootValue || '', + field: 'rootLabel', + label: '鏍硅妭鐐规枃鏈�', + initval: card.rootLabel || '', required: true }, { @@ -200,7 +316,7 @@ label: '鑺傜偣棰滆壊', initval: card.nodeColor || '#1890ff', tooltip: '鍙充晶鑺傜偣鐨勬爣璁伴鑹层��', - isHex: true, + colorType: 'hex', required: false }, { @@ -209,7 +325,7 @@ label: '宸﹁妭鐐归鑹�', initval: card.leftColor || '#26C281', tooltip: '宸︿晶鑺傜偣鐨勬爣璁伴鑹层��', - isHex: true, + colorType: 'hex', required: false }, { -- Gitblit v1.8.0