From fe21d23b147ed5cec22b4f76a88840b05495d4ad Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 18 六月 2022 22:33:59 +0800 Subject: [PATCH] 2022-06-18 --- src/templates/zshare/formconfig.jsx | 221 ++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 170 insertions(+), 51 deletions(-) diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index 65e24c3..8574f2e 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -286,7 +286,7 @@ * @param {object} card // 鎼滅储鏉′欢瀵硅薄 * @param {Array} linkableFields // 鍙叧鑱斿瓧娈� */ -export function getSearchForm (card, linkableFields) { +export function getSearchForm (card, linkableFields, columns) { let roleList = sessionStorage.getItem('sysRoles') let appType = sessionStorage.getItem('appType') if (roleList) { @@ -302,6 +302,14 @@ let typeOptions = [] if (appType === 'mob') { + // let adapters = sessionStorage.getItem('adapter') + // if (adapters) { + // adapters = adapters.split(',') + // } else { + // adapters = [] + // } + // (adapters.includes('wxmini') ? '(灏忕▼搴忔殏涓嶆敮鎸�)' : '') + typeOptions = [{ value: 'range', text: '鏁板�硷紙鍖洪棿锛�' @@ -318,6 +326,7 @@ // value: 'daterange', // text: Formdict['model.form.daterange'] }] + } else { typeOptions = [{ value: 'text', @@ -387,7 +396,8 @@ key: 'field', label: Formdict['model.form.field'], initVal: card.field || '', - required: true + required: true, + options: columns }, { type: 'select', @@ -650,6 +660,18 @@ required: false }, { + type: 'number', + key: 'labelwidth', + min: 1, + max: 100, + precision: 1, + label: '鍚嶇О瀹藉害', + initVal: card.labelwidth || 33.3, + tooltip: '鍚嶇О鍗犳嵁鎼滅储鏉′欢瀹藉害鐨勭櫨鍒嗘瘮銆傛敞锛氬瓨鍦ㄥ鍒楁悳绱㈡椂锛屽綋鍓嶆悳绱㈠鏋滄兂瑕佸崰鎹暣琛屽彲鍙傜収浠ヤ笅姣斾緥锛屼袱鍒楋紙16.5锛夈�佷笁鍒楋紙10.8锛夈�佸洓鍒楋紙8锛�', + required: true, + forbid: appType === 'mob' + }, + { type: 'radio', key: 'precision', label: '绮剧‘搴�', @@ -825,7 +847,8 @@ label: Formdict['header.form.blacklist'], initVal: card.blacklist || [], required: false, - options: roleList || [] + options: roleList || [], + forbid: appType === 'mob' } ] } @@ -932,7 +955,20 @@ }, { value: 'closetab', text: '鏍囩鍏抽棴' + }, { + value: 'megvii', + text: '鏃疯闈㈡澘鏈�' }] + }, + { // 鏃疯闈㈡澘鏈烘帴鍙� 寰呮墿灞� + type: 'radio', + key: 'subFunc', + label: '鎺ュ彛鍚嶇О', + initVal: card.subFunc || 'addUser', + required: true, + options: [ + { value: 'addUser', text: '娣诲姞鐢ㄦ埛' }, + ] }, { type: 'select', @@ -1204,11 +1240,11 @@ value: 'never', text: '涓嶅埛鏂�' }, { - value: 'grid', - text: '鍒锋柊琛ㄦ牸' - }, { value: 'line', text: '鍒锋柊琛�' + }, { + value: 'grid', + text: '鍒锋柊琛ㄦ牸' }, ...refresh] }, @@ -1223,11 +1259,11 @@ value: 'never', text: '涓嶅埛鏂�' }, { - value: 'grid', - text: '鍒锋柊琛ㄦ牸' - }, { value: 'line', text: '鍒锋柊琛�' + }, { + value: 'grid', + text: '鍒锋柊琛ㄦ牸' }, ...refresh] }, @@ -1288,7 +1324,7 @@ type: 'text', key: 'output', label: '杩斿洖鍊�', - tooltip: '鎵ц鎴愬姛鍚庣殑杩斿洖鍊笺��', + tooltip: '鎵ц鎴愬姛鍚庣殑杩斿洖鍊笺�傜郴缁熷嚱鏁板彲鎸囧畾杩斿洖鐨勫彉閲忥紙浠绗﹀紑澶达紝濡侤id锛夛紱鑷畾涔夊嚱鏁板彲鎸囧畾杩斿洖瀛楁锛堝id锛夈��', initVal: card.output || '', required: false }, @@ -1371,7 +1407,7 @@ precision: 0, label: '姣斾緥', initVal: card.ratio || 85, - tooltip: '灏忎簬100涓哄搴︼紙鎴栭珮搴︼級鐧惧垎姣旓紝澶т簬100涓哄儚绱犲�笺��', + tooltip: '妯℃�佹鎴栨娊灞夌殑瀹藉害锛屽皬浜�100涓虹獥鍙e搴︼紙鎴栭珮搴︼級鐧惧垎姣旓紝澶т簬100涓哄儚绱犲�笺��', required: true }, { @@ -1452,6 +1488,42 @@ initVal: card.controlVal || '', required: false }, + { + type: 'text', + key: 'reason', + label: '绂佺敤鍘熷洜', + initVal: card.reason || '', + required: false + }, + { + type: 'radio', + key: 'hidden', + label: '闅愯棌', + initVal: card.hidden || 'false', + tooltip: '闅愯棌鍚庢寜閽湪椤甸潰涓笉鏄剧ず锛屼笖涓嶅弬涓庢潈闄愬垎閰嶃��', + required: false, + options: [{ + value: 'false', + text: '鍚�' + }, { + value: 'true', + text: '鏄�' + }] + }, + { + type: 'radio', + key: 'progress', + label: '杩涘害鎻愮ず', + initVal: card.progress || 'number', + required: false, + options: [{ + value: 'number', + text: '鍓╀綑鏁�' + }, { + value: 'progressbar', + text: '杩涘害鏉�' + }] + } ] } @@ -2288,9 +2360,9 @@ }, { value: 'datemonth', text: Formdict['model.form.datemonth'] - }, { - value: 'datetime', - text: '鏃ユ湡锛堝垎/绉掞級' + // }, { + // value: 'datetime', + // text: '鏃ユ湡锛堝垎/绉掞級' }, { value: 'textarea', text: Formdict['model.form.textarea'] @@ -2353,9 +2425,9 @@ }, { value: 'datemonth', text: Formdict['model.form.datemonth'] - }, { - value: 'datetime', - text: '鏃ユ湡锛堝垎/绉掞級' + // }, { + // value: 'datetime', + // text: '鏃ユ湡锛堝垎/绉掞級' }, { value: 'textarea', text: Formdict['model.form.textarea'] @@ -2381,6 +2453,9 @@ _fieldlength = 512 } else if (['textarea', 'brafteditor'].includes(card.type)) { _fieldlength = 8000 + } else if (card.type === 'datetime') { + card.type = 'date' + card.precision = 'second' } let options = card.options || [] @@ -2779,6 +2854,25 @@ }] }, { + type: 'radio', + key: 'precision', + label: '绮剧‘搴�', + initVal: card.precision || 'day', + options: [{ + value: 'day', + text: '澶�' + }, { + value: 'hour', + text: '灏忔椂' + }, { + value: 'minute', + text: '鍒嗛挓' + }, { + value: 'second', + text: '绉�' + }] + }, + { type: 'number', key: 'fieldlength', min: 1, @@ -2787,7 +2881,7 @@ label: Formdict['model.form.field'] + Formdict['model.length'], // tooltip: '鏂囨湰銆佷笅鎷夋銆佹棩鏈熺瓑瀛楁榛樿闀垮害涓�50锛屽琛屾枃鏈笌鏂囦欢涓婁紶瀛楁榛樿闀垮害涓�512', initVal: card.fieldlength || _fieldlength, - required: false + required: true }, { type: 'number', @@ -2807,19 +2901,22 @@ initVal: card.regular || '', options: [{ value: '', - text: Formdict['model.empty'] + text: '绌�' }, { value: 'number', - text: Formdict['model.form.number'] + text: '鏁板瓧' }, { value: 'letter', - text: Formdict['header.form.letter'] + text: '瀛楁瘝' }, { value: 'letter&number', - text: '瀛楁瘝+鏁板瓧' + text: '鏁板瓧銆佸瓧姣嶄互鍙奯' }, { value: 'phone', text: '鎵嬫満鍙�' + }, { + value: 'email', + text: '閭' }] }, { @@ -3155,15 +3252,18 @@ { type: 'radio', key: 'compress', - label: '鍘嬬缉', + label: '鏂囦欢澶勭悊', initVal: card.compress || 'false', - tooltip: '鏂囦欢鍘嬬缉蹇呴』涓哄浘鐗囷紝鍥剧墖鏍煎紡涓簀pg銆乸ng銆乬if 鎴� jpeg', + tooltip: '鏂囦欢鍘嬬缉鎴朾ase64蹇呴』涓哄浘鐗囷紝鍥剧墖鏍煎紡涓簀pg銆乸ng銆乬if 鎴� jpeg銆傛敞锛歜ase64鍙彲涓婁紶涓�寮犲浘鐗囥��', options: [{ - value: 'true', - text: Formdict['model.true'] - }, { value: 'false', - text: Formdict['model.false'] + text: '鏃�' + }, { + value: 'true', + text: '鍘嬬缉' + }, { + value: 'base64', + text: 'base64' }] }, { @@ -3209,6 +3309,24 @@ }, { value: 6, text: 6 + }] + }, + { + type: 'radio', + key: 'lenControl', + label: '闀垮害鎺у埗', + initVal: card.lenControl || 'limit', + tooltip: '鍦ㄨ缃瓧娈甸暱搴﹀悗锛屽闀垮害鐨勬帶鍒舵柟寮忋��', + required: false, + options: [{ + value: 'limit', + text: '闄愬埗杈撳叆' + }, { + value: 'left', + text: '宸︽埅' + }, { + value: 'right', + text: '鍙虫埅' }] }, { @@ -3357,35 +3475,36 @@ initVal: card.linkSubField || [], options: inputfields }, - { - type: 'number', - key: 'marginTop', - label: '涓婅竟璺濓紙px锛�', - initVal: card.marginTop || 0, - min: -100, - max: 1000, - precision: 0, - required: false, - forbid: appType !== 'mob' - }, - { - type: 'number', - key: 'marginBottom', - label: '涓嬭竟璺濓紙px锛�', - initVal: card.marginBottom || 0, - min: -100, - max: 1000, - precision: 0, - required: false, - forbid: appType !== 'mob' - }, + // { + // type: 'number', + // key: 'marginTop', + // label: '涓婅竟璺濓紙px锛�', + // initVal: card.marginTop || 0, + // min: -100, + // max: 1000, + // precision: 0, + // required: false, + // forbid: appType !== 'mob' + // }, + // { + // type: 'number', + // key: 'marginBottom', + // label: '涓嬭竟璺濓紙px锛�', + // initVal: card.marginBottom || 0, + // min: -100, + // max: 1000, + // precision: 0, + // required: false, + // forbid: appType !== 'mob' + // }, { type: 'multiselect', key: 'blacklist', label: Formdict['header.form.blacklist'], initVal: card.blacklist || [], required: false, - options: roleList + options: roleList, + forbid: appType === 'mob' } ] } -- Gitblit v1.8.0