From d6dfba48678e1107a9e7c6524e1dfa2d3fdff03c Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 08 十月 2021 19:29:21 +0800 Subject: [PATCH] 2021-10-08 --- src/menu/components/card/cardcomponent/options.jsx | 34 ++++++++++++++++------------------ 1 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/menu/components/card/cardcomponent/options.jsx b/src/menu/components/card/cardcomponent/options.jsx index 01ee4a9..c59147a 100644 --- a/src/menu/components/card/cardcomponent/options.jsx +++ b/src/menu/components/card/cardcomponent/options.jsx @@ -1,7 +1,7 @@ /** * @description Setting琛ㄥ崟閰嶇疆淇℃伅 */ -export default function (setting, hasPrimaryKey) { +export default function (setting, hasPrimaryKey, buttons = []) { let appType = sessionStorage.getItem('appType') let menulist = [] @@ -12,7 +12,7 @@ if (appmenulist) { try { appmenulist = JSON.parse(appmenulist) - } catch { + } catch (e) { appmenulist = [] } } else { @@ -23,7 +23,7 @@ if (menulist) { try { menulist = JSON.parse(menulist) - } catch { + } catch (e) { menulist = [] } } else { @@ -82,7 +82,7 @@ field: 'primaryId', label: '涓婚敭鍊�', initval: setting.primaryId || '', - tooltip: '鍗$墖鐐瑰嚮鏃讹紝鍚戝叾浠栫粍浠朵紶閫掔殑ID鍊笺��', + tooltip: '璁剧疆涓�涓睘鎬у崱闈欐�両D锛屽悜鍏朵粬缁勪欢浼犻�掔殑鎸囧畾闈欐�両D鍊�', required: false, forbid: !hasPrimaryKey }, @@ -101,29 +101,19 @@ ], controlFields: [ {field: 'menu', values: ['menu']}, - {field: 'appmenu', values: ['menu']}, {field: 'linkurl', values: ['link']}, {field: 'open', values: ['menu', 'link']}, {field: 'joint', values: ['menu', 'link']}, + {field: 'linkbtn', values: ['button']}, ] }, { - type: 'cascader', + type: appType ? 'select' : 'cascader', field: 'menu', - label: '鑿滃崟', - initval: setting.menu || [], - required: true, - options: menulist, - forbid: !!appType - }, - { - type: 'select', - field: 'appmenu', label: '鍏宠仈鑿滃崟', - initval: setting.menu || '', + initval: setting.menu || (appType ? '' : []), required: true, - options: appmenulist, - forbid: !appType + options: appType ? appmenulist : menulist, }, { type: 'textarea', @@ -157,6 +147,14 @@ {value: 'false', label: '鍚�'}, ], }, + { + type: 'select', + field: 'linkbtn', + label: '鍏宠仈鎸夐挳', + initval: setting.linkbtn || '', + required: true, + options: buttons + } ] return cardSettingForm -- Gitblit v1.8.0