From f267d04e0561a0a20d1f2a9f558a273558ece90d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 24 五月 2021 17:50:19 +0800 Subject: [PATCH] 2021-05-24 --- src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx | 91 +++++++++++++++++++++++++++++++++++++++------ 1 files changed, 78 insertions(+), 13 deletions(-) diff --git a/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx index bb35a59..d745175 100644 --- a/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx @@ -1,7 +1,7 @@ import zhCN from '@/locales/zh-CN/model.js' import enUS from '@/locales/en-US/model.js' -const Formdict = localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS +const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS /** * @description 鑾峰彇鏄剧ず鍒楄〃鍗曢厤缃俊鎭� @@ -9,6 +9,7 @@ * @param {Array} menulist // 鑿滃崟鍒楄〃-鐢ㄤ簬瀛楁閫忚 */ export function getColumnForm (card, menulist = [], fields = []) { + let appType = sessionStorage.getItem('appType') let roleList = sessionStorage.getItem('sysRoles') if (roleList) { try { @@ -38,16 +39,23 @@ }, { value: 'custom', text: '鑷畾涔夊垪' + }, { + value: 'colspan', + text: '鍚堝苟鍒�' + }, { + value: 'index', + text: '搴忓彿' }] if (!card.isSub) { options.push({ - value: 'colspan', - text: '鍚堝苟鍒�' - }, { value: 'action', text: '鎿嶄綔' }) + } + + if (!card.linkurl && (!card.linkmenu || card.linkmenu.length === 0)) { + card.perspective = '' } return [ @@ -73,6 +81,14 @@ initVal: card.field, required: true, options: fields + }, + { + type: 'select', + key: 'nameField', + label: Formdict['model.name'] + Formdict['model.form.field'], + initVal: card.nameField || '', + required: false, + options: [{uuid: 'empty', field: '', label: '绌�'}, ...fields] }, { type: 'number', @@ -118,6 +134,7 @@ label: Formdict['model.sort'], initVal: card.IsSort || 'true', required: true, + forbidden: card.isSub, options: [{ value: 'true', text: Formdict['model.true'] @@ -235,17 +252,50 @@ readonly: false }, { - type: 'select', + type: 'radio', key: 'lenWidRadio', label: '闀垮姣�', initVal: card.lenWidRadio || '1:1', required: true, options: [ { value: '1:1', text: '1:1' }, - { value: '3:2', text: '3:2' }, { value: '4:3', text: '4:3' }, - { value: '16:9', text: '16:9' } + { value: '3:2', text: '3:2' }, + { value: '16:9', text: '16:9' }, + { value: '2:1', text: '2:1' }, + { value: '3:1', text: '3:1' }, + { value: '4:1', text: '4:1' }, + { value: '5:1', text: '5:1' }, + { value: '6:1', text: '6:1' }, + { value: '7:1', text: '7:1' }, + { value: '8:1', text: '8:1' }, + { value: '9:1', text: '9:1' }, + { value: '10:1', text: '10:1' }, + { value: '3:4', text: '3:4' }, + { value: '2:3', text: '2:3' }, + { value: '9:16', text: '9:16' }, ] + }, + { + type: 'radio', + key: 'picSort', + label: '鍥剧墖鎺掑垪', + initVal: card.picSort || '1', + tooltip: '鍚屼竴鍗曞厓鏍煎唴锛屽惈鏈夊寮犲浘鐗囨椂鐨勫垪鏁般��', + required: false, + options: [{ + value: '1', + text: '1' + }, { + value: '2', + text: '2' + }, { + value: '3', + text: '3' + }, { + value: '4', + text: '4' + }] }, { type: 'radio', @@ -265,29 +315,44 @@ type: 'radio', key: 'perspective', label: '瀛楁閫忚', - initVal: card.perspective || 'linkmenu', + initVal: card.perspective || '', options: [{ + value: '', + text: '鏃�' + }, { value: 'linkmenu', text: '鑿滃崟' }, { value: 'linkurl', text: '閾炬帴' - }] + }], + forbidden: appType === 'mob' }, { type: 'cascader', key: 'linkmenu', label: Formdict['model.menu'], initVal: card.linkmenu || [], - required: false, - options: menulist + required: true, + options: menulist, + forbidden: appType === 'mob' }, { - type: 'text', + type: 'textarea', key: 'linkurl', label: '閾炬帴鍦板潃', initVal: card.linkurl || '', - required: false + required: true, + forbidden: appType === 'mob' + }, + { + type: 'multiselect', + key: 'linkfields', + label: '鍏宠仈瀛楁', + initVal: card.linkfields || [], + required: false, + options: fields, + forbidden: appType === 'mob' }, { type: 'multiselect', -- Gitblit v1.8.0