From 5e1ff4dc1c6d384af39cac1d3fbe6bf4b58566f2 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 19 十月 2023 17:59:22 +0800 Subject: [PATCH] 2023-10-19 --- src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx | 174 ++++++++++++++++++++++++++++----------------------------- 1 files changed, 86 insertions(+), 88 deletions(-) diff --git a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx index a4d00e0..0254d8b 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx @@ -14,7 +14,6 @@ roleList = [] } - // if (['picture', 'link', 'colspan'].includes(card.type)) { if (['picture', 'link'].includes(card.type)) { card.type = 'text' } @@ -26,31 +25,21 @@ value: 'number', text: '鏁板瓧' }, { - value: 'textarea', - text: '澶氳鏂囨湰' - }, { value: 'custom', text: '鑷畾涔夊垪' - }, { - value: 'colspan', - text: '鍚堝苟鍒�' - // }, { - // value: 'action', - // text: '鎿嶄綔' }, { value: 'formula', text: '鍏紡' }, { + value: 'textarea', + text: '澶氳鏂囨湰' + }, { + value: 'colspan', + text: '鍚堝苟鍒�' + }, { value: 'index', text: '搴忓彿' }] - - if (!card.isSub) { - options.push({ - value: 'action', - text: '鎿嶄綔' - }) - } let editCols = [ { @@ -66,22 +55,30 @@ label: '鏃犲姩浣�' } ] - columns.forEach(col => { - if (col.editable === 'true' && col.uuid !== card.uuid) { - editCols.push({ - field: col.uuid, - label: col.label - }) - } else if (col.type === 'colspan') { - col.subcols.forEach(subcol => { - if (subcol.editable === 'true' && subcol.uuid !== card.uuid) { - editCols.push({ - field: subcol.uuid, - label: col.label + '-' + subcol.label - }) - } - }) - } + + let cols = [] + let getcols = (columns, suplabel = '') => { + columns.forEach(col => { + if (col.editable === 'true' && col.uuid !== card.uuid) { + cols.push({ + field: col.uuid, + label: suplabel + col.label + }) + } else if (col.type === 'colspan') { + getcols(col.subcols, col.label + '-') + } + }) + } + + getcols(columns) + + editCols.push(...cols) + + cols.forEach(col => { + editCols.push({ + field: '$next_' + col.field, + label: col.label + '锛堜笅涓�琛岋級' + }) }) return [ @@ -148,6 +145,24 @@ }, { type: 'radio', + key: 'eval', + label: '瑙f瀽鏂瑰紡', + initVal: card.eval || 'false', + tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滆绠椻�濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃瓧娈垫浛鎹⑩�濓紝浣跨敤鍑芥暟鏃跺叆鍙備负data锛堟暟缁勶級銆�', + required: false, + options: [{ + value: 'false', + text: '瀛楁鏇挎崲' + }, { + value: 'true', + text: '璁$畻' + }, { + value: 'func', + text: '鍑芥暟' + }] + }, + { + type: 'radio', key: 'Align', label: '瀵归綈鏂瑰紡', initVal: card.Align || 'left', @@ -163,21 +178,6 @@ text: '鍙冲榻�' }] }, - // { - // type: 'radio', - // key: 'sum', - // label: '鏄剧ず鍚堣', - // initVal: card.sum || 'false', - // tooltip: '鍚堣淇℃伅鍙湪浣跨敤绯荤粺鏁版嵁婧愭椂鏈夋晥銆�', - // required: false, - // options: [{ - // value: 'true', - // text: '鏄�' - // }, { - // value: 'false', - // text: '鍚�' - // }] - // }, { type: 'radio', key: 'editable', @@ -207,6 +207,42 @@ }, { value: 'switch', text: '寮�鍏�' + }, { + value: 'date', + text: '鏃ユ湡锛堝ぉ锛�' + }] + }, + { + type: 'radio', + key: 'precision', + label: '绮剧‘搴�', + initVal: card.precision || 'day', + options: [{ + value: 'day', + text: '澶�' + }, { + value: 'hour', + text: '灏忔椂' + }, { + value: 'minute', + text: '鍒嗛挓' + }, { + value: 'second', + text: '绉�' + }] + }, + { + type: 'radio', + key: 'declareType', + label: '鏁版嵁绫诲瀷', + tooltip: '澹版槑鍙橀噺鏃剁殑绫诲瀷锛屾椂闂存牸寮廳atetime鎴栨枃鏈牸寮弉varchar(50)銆�', + initVal: card.declareType || 'datetime', + options: [{ + value: 'datetime', + text: 'datetime' + }, { + value: 'nvarchar(50)', + text: 'nvarchar(50)' }] }, { @@ -260,16 +296,6 @@ }] }, { - type: 'select', - key: 'editField', - label: '缂栬緫瀛楁', - initVal: card.editField || '', - tooltip: '褰撳�间笌鎻愮ず鏂囧瓧涓嶅悓鏃讹紝鍙澶栨坊鍔犵紪杈戝瓧娈碉紝浣滀负瀹為檯鍊肩殑褰曞叆瀛楁銆�', - allowClear: true, - required: false, - options: fields - }, - { type: 'options', key: 'options', label: '閫夐」', @@ -281,6 +307,7 @@ key: 'dataSource', label: '鏁版嵁婧�', initVal: card.dataSource || '', + placeholder: '绯荤粺鍙橀噺锛歮k_departmentcode銆乵k_organization銆乵k_user_type銆傚叕鍏卞�粿BID@銆�', required: true, }, { @@ -392,23 +419,6 @@ tooltip: '澶氫釜鍊肩敤閫楀彿鍒嗛殧銆�', required: false }, - // { - // type: 'radio', - // key: 'footEnter', - // label: '鏈鍥炶溅', - // initVal: card.footEnter || 'false', - // tooltip: '鏂板鍔熻兘浠呭湪琛ㄦ牸鍙柊澧炴椂鏈夋晥銆�', - // options: [{ - // value: 'sub', - // text: '鎻愪氦' - // }, { - // value: 'add', - // text: '鏂板' - // }, { - // value: 'false', - // text: '鏃犲姩浣�' - // }] - // }, { type: 'number', key: 'decimal', @@ -416,7 +426,7 @@ max: 18, precision: 0, label: '灏忔暟浣�', - initVal: card.decimal || 0, + initVal: card.decimal, required: false }, { @@ -488,18 +498,6 @@ label: '鍚庣紑', initVal: card.postfix || '', required: false, - }, - { - type: 'radio', - key: 'eval', - label: '瑙f瀽', - initVal: card.eval || 'false', - tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滄槸鈥濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃惁鈥濄��', - required: false, - options: [ - { value: 'true', text: '鏄�' }, - { value: 'false', text: '鍚�' } - ] }, { type: 'textarea', -- Gitblit v1.8.0