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 | 1034 ++++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 656 insertions(+), 378 deletions(-) diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index fbc0a97..8574f2e 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -1,6 +1,6 @@ import zhCN from '@/locales/zh-CN/model.js' import enUS from '@/locales/en-US/model.js' -import { formRule } from '@/utils/option.js' +import { formRule, btnClasses } from '@/utils/option.js' const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS @@ -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: '鏁板�硷紙鍖洪棿锛�' @@ -314,10 +322,11 @@ }, { value: 'datemonth', text: Formdict['model.form.datemonth'] - }, { - value: 'daterange', - text: Formdict['model.form.daterange'] + // }, { + // value: 'daterange', + // text: Formdict['model.form.daterange'] }] + } else { typeOptions = [{ value: 'text', @@ -364,23 +373,31 @@ } } + let options = card.options || [] + if (['select', 'link'].includes(card.type) && card.setAll === 'true') { // 鍏煎 + options.unshift({ + key: 'empty', + Value: '', + Text: '鍏ㄩ儴', + ParentID: '' + }) + } + return [ { type: 'text', key: 'label', label: Formdict['model.name'], initVal: card.label || '', - required: true, - readonly: false + required: true }, { type: 'text', key: 'field', label: Formdict['model.form.field'], initVal: card.field || '', - tooltipClass: 'middle', required: true, - readonly: false + options: columns }, { type: 'select', @@ -395,8 +412,7 @@ key: 'datefield', label: '鏃堕棿瀛楁', initVal: card.datefield || '', - required: true, - readonly: false + required: true }, { type: 'text', @@ -409,7 +425,7 @@ { type: 'radio', key: 'resourceType', - label: Formdict['header.form.resourceType'], + label: '閫夐」鏉ユ簮', initVal: card.resourceType || '0', required: true, options: [{ @@ -420,19 +436,19 @@ text: Formdict['header.form.datasource'] }] }, - { - type: 'radio', - key: 'setAll', - label: Formdict['header.form.setAll'], - initVal: card.setAll || 'true', - options: [{ - value: 'true', - text: Formdict['model.true'] - }, { - value: 'false', - text: Formdict['model.false'] - }] - }, + // { + // type: 'radio', + // key: 'setAll', + // label: '璁剧疆鍏ㄩ儴', + // initVal: card.setAll || 'true', + // options: [{ + // value: 'true', + // text: Formdict['model.true'] + // }, { + // value: 'false', + // text: Formdict['model.false'] + // }] + // }, { type: 'radio', key: 'display', @@ -461,18 +477,16 @@ { type: 'text', key: 'cardValField', - label: Formdict['header.form.valueField'], + label: '鍊悸峰瓧娈�', initVal: card.cardValField || 'Value', - required: true, - readonly: false + required: true }, { type: 'text', key: 'urlField', label: '鍦板潃瀛楁', initVal: card.urlField || '', - required: true, - readonly: false + required: true }, { type: 'radio', @@ -499,24 +513,21 @@ key: 'fields', label: '瀛楁闆�', initVal: card.fields || [], - required: true, - readonly: false + required: true }, { - type: 'textarea', + type: 'codemirror', key: 'dataSource', label: Formdict['header.form.datasource'], initVal: card.dataSource || '', - required: true, - readonly: false + required: true }, { type: 'options', key: 'options', label: '閫夐」', - initVal: card.options || [], - required: true, - readonly: false + initVal: options, + required: true }, { type: 'checkbox', @@ -524,7 +535,6 @@ label: '閫夐」', initVal: card.items || ['day', 'week', 'month', 'quarter', 'year', 'customized'], required: true, - readonly: false, options: [{ value: 'day', label: '鏃�' @@ -546,42 +556,53 @@ }] }, { + type: 'radio', + key: 'multiple', + label: '閫夋嫨褰㈠紡', + initVal: card.multiple || 'false', + required: true, + options: [{ + value: 'false', + text: '鍗曢��' + }, { + value: 'true', + text: '澶氶��' + }] + }, + { type: 'select', key: 'linkField', - label: Formdict['header.form.linkField'], + label: '鍏宠仈瀛楁', initVal: card.linkField || '', required: true, - readonly: false, + allowClear: true, options: linkableFields }, { type: 'text', key: 'valueField', - label: Formdict['header.form.valueField'], + label: '鍊悸峰瓧娈�', initVal: card.valueField || '', - required: true, - readonly: false + required: true }, { type: 'text', key: 'valueText', - label: Formdict['header.form.valueText'], + label: '鏂囨湰路瀛楁', initVal: card.valueText || '', - required: true, - readonly: false + required: true }, { type: 'text', key: 'orderBy', - label: Formdict['header.form.orderBy'], + label: '鎺掑簭路瀛楁', initVal: card.orderBy || '', - required: false, - readonly: false + required: false }, { type: 'select', key: 'orderType', - label: Formdict['header.form.orderType'], + label: '鎺掑簭鏂瑰紡', initVal: card.orderType || 'asc', options: [{ value: 'asc', @@ -617,14 +638,14 @@ { type: 'radio', key: 'database', - label: Formdict['header.form.database'], + label: '鏁版嵁搴�', initVal: card.database || 'local', options: [{ value: 'local', - text: Formdict['header.form.database.local'] + text: '鏈湴' }, { value: 'sso', - text: Formdict['header.form.database.sso'] + text: '绯荤粺' }] }, { @@ -639,17 +660,34 @@ required: false }, { - type: 'radio', - key: 'multiple', - label: '鍙閫�', - initVal: card.multiple || '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: '绮剧‘搴�', + initVal: card.precision || 'day', options: [{ - value: 'true', - text: '鏄�' + value: 'day', + text: '澶�' }, { - value: 'false', - text: '鍚�' + value: 'hour', + text: '灏忔椂' + }, { + value: 'minute', + text: '鍒嗛挓' + }, { + value: 'second', + text: '绉�' }] }, { @@ -676,6 +714,20 @@ }, { value: 'false', text: Formdict['model.false'] + }] + }, + { + type: 'radio', + key: 'query', + label: '鍙備笌鏌ヨ', + initVal: card.query || 'true', + tooltip: '鏄惁浣滀负 where 鏉′欢锛屽弬涓庢暟鎹煡璇€��', + options: [{ + value: 'true', + text: '鏄�' + }, { + value: 'false', + text: '鍚�' }] }, // { @@ -720,14 +772,14 @@ { type: 'radio', key: 'labelShow', - label: '鏄剧ず鍚嶇О', + label: '鍚嶇О', initVal: card.labelShow || 'true', options: [{ value: 'true', - text: Formdict['model.true'] + text: '鏄剧ず' }, { value: 'false', - text: Formdict['model.false'] + text: '闅愯棌' }] }, { @@ -735,6 +787,7 @@ key: 'advanced', label: '楂樼骇鎼滅储', initVal: card.advanced || 'false', + tooltip: '鍦ㄩ殣钘忔悳绱㈡寜閽椂锛岄珮绾ф悳绱㈡棤鏁堛��', forbid: appType === 'mob', options: [{ value: 'true', @@ -794,7 +847,8 @@ label: Formdict['header.form.blacklist'], initVal: card.blacklist || [], required: false, - options: roleList || [] + options: roleList || [], + forbid: appType === 'mob' } ] } @@ -806,7 +860,7 @@ * @param {*} usefulFields 瀛樺偍杩囩▼鍙敤鐨勫紑濮嬪瓧娈� * @param {*} type 鎸夐挳绫诲瀷锛岀敤浜庡尯鍒嗗彲閫夌殑鎵撳紑鏂瑰紡 */ -export function getActionForm (card, config, usefulFields, type, menulist = [], printTemps = []) { +export function getActionForm (card, config, usefulFields, type, menulist = [], printTemps = [], tabs = []) { let columns = (config.columns || []).filter(col => col.field) let opentypes = [ @@ -840,23 +894,19 @@ } ] - // 鏍囩绫诲瀷锛屼富琛ㄦ墠浼氬瓨鍦ㄨ〃鍗曟爣绛鹃〉 - let tabTems = [{ - value: 'FormTab', - text: '琛ㄥ崟鏍囩椤�' - }] - if (type === 'subtable') { - tabTems = [] - } - if (card.execSuccess === 'view' || card.execSuccess === 'refresh') { // refresh涓鸿〃鍗曟爣绛鹃〉 card.execSuccess = 'grid' } - if (card.execError === 'view' || card.execSuccess === 'refresh') { + if (card.execError === 'view' || card.execError === 'refresh') { card.execError = 'grid' } if (card.popClose === 'view') { card.popClose = 'grid' + } + + if (card.OpenType === 'outerpage') { + card.pageTemplate = 'custom' + card.OpenType = 'innerpage' } let refresh = [] @@ -867,15 +917,18 @@ } refresh.push({ value: 'maingrid', - text: Formdict['header.form.refresh.maingrid'] + text: '鍒锋柊涓昏〃锛堣锛�' }, { value: 'equaltab', - text: Formdict['header.form.refresh.equaltab'] + text: '鍒锋柊鍚岀骇鏍囩' }) } if (card.OpenType === 'blank') { card.OpenType = 'tab' + } + if (!card.control && card.controlField) { + card.control = 'disabled' } return [ @@ -890,19 +943,32 @@ { type: 'select', key: 'funcType', - label: Formdict['header.form.funcType'], + label: '鍔熻兘绫诲瀷', initVal: card.funcType || '', required: true, options: [{ value: 'changeuser', - text: Formdict['header.form.func.changeuser'] + text: '鍒囨崲鐢ㄦ埛' }, { value: 'print', text: '鏍囩鎵撳嵃' }, { value: 'closetab', text: '鏍囩鍏抽棴' + }, { + value: 'megvii', + text: '鏃疯闈㈡澘鏈�' }] + }, + { // 鏃疯闈㈡澘鏈烘帴鍙� 寰呮墿灞� + type: 'radio', + key: 'subFunc', + label: '鎺ュ彛鍚嶇О', + initVal: card.subFunc || 'addUser', + required: true, + options: [ + { value: 'addUser', text: '娣诲姞鐢ㄦ埛' }, + ] }, { type: 'select', @@ -973,7 +1039,6 @@ initVal: card.innerFunc || '', tooltip: `鍑芥暟鍚嶇О闇�浠�${usefulFields.join(', ')}绛夊瓧绗﹀紑濮嬨�俙, fields: usefulFields, - tooltipClass: 'middle', required: card.intertype === 'inner', readonly: false }, @@ -983,7 +1048,13 @@ label: '鍏宠仈鏍囩', initVal: card.linkTab || '', required: false, - options: [] + options: [ + { + value: '', + text: '鏂板缓' + }, + ...tabs + ] }, { type: 'select', @@ -1123,7 +1194,7 @@ { type: 'radio', key: 'position', - label: Formdict['header.form.position'], + label: '鏄剧ず浣嶇疆', initVal: card.position || 'toolbar', required: true, options: [{ @@ -1143,20 +1214,6 @@ options: [] }, { - type: 'select', - key: 'tabTemplate', - label: '鏍囩绫诲瀷', - initVal: card.tabTemplate || '', - required: true, - options: [ - { - value: 'ThdMenu', - text: Formdict['model.menu.level3'] - }, - ...tabTems - ] - }, - { type: 'cascader', key: 'linkmenu', label: Formdict['model.form.linkmenu'], @@ -1173,45 +1230,21 @@ options: menulist }, { - type: 'radio', - key: 'afterExecSuccess', - label: Formdict['header.form.afterExecSuccess'], - initVal: card.afterExecSuccess || 'close', - required: true, - options: [{ - value: 'close', - text: Formdict['model.close'] - }, { - value: 'notclose', - text: Formdict['model.notclose'] - }] - }, - { - type: 'radio', - key: 'afterExecError', - label: Formdict['header.form.afterExecError'], - initVal: card.afterExecError || 'notclose', - required: true, - options: [{ - value: 'close', - text: Formdict['model.close'] - }, { - value: 'notclose', - text: Formdict['model.notclose'] - }] - }, - { type: refresh.length === 0 ? 'radio' : 'select', key: 'execSuccess', label: Formdict['model.form.afterSuccess'], - initVal: card.execSuccess || 'never', + initVal: card.execSuccess || 'grid', + tooltip: '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍笺��', required: true, options: [{ value: 'never', - text: Formdict['header.form.refresh.never'] + text: '涓嶅埛鏂�' + }, { + value: 'line', + text: '鍒锋柊琛�' }, { value: 'grid', - text: Formdict['header.form.refresh.grid'] + text: '鍒锋柊琛ㄦ牸' }, ...refresh] }, @@ -1220,13 +1253,17 @@ key: 'execError', label: Formdict['model.form.afterError'], initVal: card.execError || 'never', + tooltip: '閫夋嫨鍒锋柊琛屾椂锛屽鏋滈�夋嫨澶氭潯鏁版嵁浼氬埛鏂拌〃鏍笺��', required: true, options: [{ value: 'never', - text: Formdict['header.form.refresh.never'] + text: '涓嶅埛鏂�' + }, { + value: 'line', + text: '鍒锋柊琛�' }, { value: 'grid', - text: Formdict['header.form.refresh.grid'] + text: '鍒锋柊琛ㄦ牸' }, ...refresh] }, @@ -1238,10 +1275,10 @@ required: true, options: [{ value: 'never', - text: Formdict['header.form.refresh.never'] + text: '涓嶅埛鏂�' }, { value: 'grid', - text: Formdict['header.form.refresh.grid'] + text: '鍒锋柊琛ㄦ牸' }, ...refresh] }, @@ -1260,12 +1297,11 @@ }] }, { - type: 'select', + type: 'icon', key: 'icon', label: Formdict['model.icon'], initVal: card.icon, - required: false, - options: [] + required: false }, { type: 'select', @@ -1273,7 +1309,7 @@ label: Formdict['model.form.color'], initVal: card.class, required: false, - options: [] + options: btnClasses }, { type: 'cascader', @@ -1288,8 +1324,16 @@ type: 'text', key: 'output', label: '杩斿洖鍊�', - tooltip: '鎵ц鎴愬姛鍚庣殑杩斿洖鍊笺��', + tooltip: '鎵ц鎴愬姛鍚庣殑杩斿洖鍊笺�傜郴缁熷嚱鏁板彲鎸囧畾杩斿洖鐨勫彉閲忥紙浠绗﹀紑澶达紝濡侤id锛夛紱鑷畾涔夊嚱鏁板彲鎸囧畾杩斿洖瀛楁锛堝id锛夈��', initVal: card.output || '', + required: false + }, + { + type: 'text', + key: 'tipTitle', + label: '纭鎻愮ず', + initVal: card.tipTitle || '', + tooltip: '娉細寮圭獥锛堣〃鍗曪級鍦ㄦ樉绀轰负鏄惁妗嗘椂鏈夋晥銆�', required: false }, { @@ -1316,7 +1360,7 @@ { type: 'radio', key: 'pagination', - label: Formdict['header.form.pagination'], + label: '鍒嗛〉', initVal: card.pagination || 'false', required: false, options: [{ @@ -1342,23 +1386,6 @@ }] }, { - type: 'select', - key: 'controlField', - label: '鎺у埗瀛楁', - tooltip: '绂佺敤鎺у埗瀛楁锛屽彲鏍规嵁鏁版嵁鎺у埗鎸夐挳鏄惁绂佺敤銆�', - initVal: card.controlField || '', - required: false, - options: [{label: '鏃�', field: ''}, ...columns] - }, - { - type: 'text', - key: 'controlVal', - label: '鎺у埗鍊�', - tooltip: '褰撻�夋嫨鎺у埗瀛楁锛屼笖瀛楁鍊间笌鎺у埗鍊肩浉绛夋椂锛屾寜閽細绂佺敤锛屽涓�肩敤閫楀彿鍒嗛殧銆�', - initVal: card.controlVal || '', - required: false - }, - { type: 'radio', key: 'display', label: '鏄剧ず鏂瑰紡', @@ -1376,11 +1403,11 @@ type: 'number', key: 'ratio', min: 1, - max: 24, + max: 3000, precision: 0, label: '姣斾緥', initVal: card.ratio || 85, - tooltip: '灏忎簬100涓哄搴︼紙鎴栭珮搴︼級鐧惧垎姣旓紝澶т簬100涓哄儚绱犲�笺��', + tooltip: '妯℃�佹鎴栨娊灞夌殑瀹藉害锛屽皬浜�100涓虹獥鍙e搴︼紙鎴栭珮搴︼級鐧惧垎姣旓紝澶т簬100涓哄儚绱犲�笺��', required: true }, { @@ -1388,7 +1415,6 @@ key: 'placement', label: '鎶藉眽鏂瑰悜', initVal: card.placement || 'right', - tooltip: '浣跨敤鎶藉眽鏃舵湁鏁堛��', required: false, options: [{ value: 'right', @@ -1405,16 +1431,99 @@ }] }, { + type: 'radio', + key: 'clickouter', + label: '鐐瑰嚮钂欏眰', + initVal: card.clickouter || 'unclose', + required: false, + options: [{ + value: 'unclose', + text: '涓嶅叧闂�' + }, { + value: 'close', + text: '鍏抽棴' + }] + }, + { type: 'text', key: 'preFunc', label: '鍓嶇疆鍑芥暟', initVal: card.preFunc || '', tooltip: `鍑芥暟鍚嶇О闇�浠�${usefulFields.join(', ')}绛夊瓧绗﹀紑濮嬶紱鍓嶇疆鍑芥暟鎵ц瀹屾垚鍚庯紝缁撴灉浼氫紶鍏ュ唴閮ㄥ嚱鏁颁腑锛屾鏃跺唴閮ㄥ嚱鏁颁細寮傛鎵ц锛涘綋鍓嶇疆鍑芥暟杩斿洖涓璄rrCode绛変簬-1鏃讹紝灏嗕笉鍐嶆墽琛屽唴閮ㄥ嚱鏁般�俙, fields: usefulFields, - tooltipClass: 'middle', required: false, readonly: false }, + { + type: 'radio', + key: 'control', + label: '鎸夐挳鎺у埗', + initVal: card.control || '', + required: false, + options: [{ + value: '', + text: '鏃�' + }, { + value: 'disabled', + text: '绂佺敤' + }, { + value: 'hidden', + text: '闅愯棌' + }] + }, + { + type: 'select', + key: 'controlField', + label: '鎺у埗瀛楁', + tooltip: '鎺у埗瀛楁锛屽彲鏍规嵁鏁版嵁鎺у埗鎸夐挳鐨勯殣钘忔垨绂佺敤銆�', + initVal: card.controlField || '', + required: true, + options: columns + }, + { + type: 'text', + key: 'controlVal', + label: '鎺у埗鍊�', + tooltip: '褰撻�夋嫨鎺у埗瀛楁锛屼笖瀛楁鍊间笌鎺у埗鍊肩浉绛夋椂锛屾寜閽細闅愯棌鎴栫鐢紝澶氫釜鍊肩敤閫楀彿鍒嗛殧銆�', + 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: '杩涘害鏉�' + }] + } ] } @@ -1615,7 +1724,7 @@ text: Formdict['model.empty'] }, { value: 'thdSeparator', - text: Formdict['header.form.thdSeparator'] + text: '鍗冨垎浣�' }, { value: 'percent', text: '鐧惧垎姣�' @@ -1674,8 +1783,8 @@ { type: 'radio', key: 'scale', - label: Formdict['header.form.clickscale'], - initVal: card.scale || 'false', + label: '鐐瑰嚮缂╂斁', + initVal: card.scale || 'true', required: false, options: [{ value: 'true', @@ -1955,8 +2064,8 @@ readonly: !(setting.laypage === 'false'), forbid: !['line', 'bar'].includes(card.chartType), options: [ - { value: 'query', text: Formdict['header.form.query'] }, - { value: 'statistics', text: Formdict['header.form.statistics'] } + { value: 'query', text: '鏌ヨ' }, + { value: 'statistics', text: '缁熻' } ] }, { @@ -2194,9 +2303,8 @@ * @param {*} tabfields // 鍙垏鎹㈣〃鍗� * @param {*} linkableFields // 鍙叧鑱旇〃鍗� * @param {*} linksupFields // 涓婄骇琛ㄥ崟 - * @param {*} subtable // 鏄惁涓哄瓙琛ㄨ〃鍗� */ -export function getModalForm (card, inputfields = [], tabfields = [], linkableFields, linksupFields, subtable = false) { +export function getModalForm (card, inputfields = [], tabfields = [], linkableFields, linksupFields) { let appType = sessionStorage.getItem('appType') let roleList = sessionStorage.getItem('sysRoles') if (roleList) { @@ -2252,12 +2360,15 @@ }, { value: 'datemonth', text: Formdict['model.form.datemonth'] - }, { - value: 'datetime', - text: Formdict['model.form.datetime'] + // }, { + // value: 'datetime', + // text: '鏃ユ湡锛堝垎/绉掞級' }, { value: 'textarea', text: Formdict['model.form.textarea'] + }, { + value: 'rate', + text: '璇勫垎' }, { value: 'color', text: Formdict['model.form.color'] @@ -2275,7 +2386,7 @@ text: '鍒嗛殧绾�' }, { value: 'linkMain', - text: Formdict['header.form.linkMain'] + text: '鍏宠仈涓昏〃' }] let _fieldlength = 50 @@ -2314,12 +2425,15 @@ }, { value: 'datemonth', text: Formdict['model.form.datemonth'] - }, { - value: 'datetime', - text: Formdict['model.form.datetime'] + // }, { + // value: 'datetime', + // text: '鏃ユ湡锛堝垎/绉掞級' }, { value: 'textarea', text: Formdict['model.form.textarea'] + }, { + value: 'rate', + text: '璇勫垎' }, { value: 'funcvar', text: Formdict['header.form.funcvar'] @@ -2329,6 +2443,9 @@ }, { value: 'split', text: '鍒嗛殧绾�' + }, { + value: 'linkMain', + text: '鍏宠仈涓昏〃' }] } @@ -2336,6 +2453,30 @@ _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 || [] + if (['select', 'radio', 'link'].includes(card.type) && card.setAll === 'true') { // 鍏煎 + options.unshift({ + key: 'empty', + Value: '', + Text: card.emptyText || '绌�', + ParentID: '' + }) + } + + let initval = card.initval || '' + if (card.type === 'switch') { + initval = card.initval === true + } else if (card.type === 'number') { + initval = card.initval || 0 + } + + if (appType === 'mob' && ![24, 12, 8, 6].includes(card.span)) { + card.span = 24 } return [ @@ -2367,8 +2508,7 @@ type: 'text', key: 'initval', label: Formdict['header.form.initval'], - tooltip: '涓嬫媺澶氶�変笌澶氶�夋锛屾坊鍔犲涓垵濮嬪�艰浣跨敤鈥�,鈥濆彿鍒嗛殧銆傛敞锛氫笅鎷夐�夋嫨銆佽仈鍔ㄨ彍鍗曟垨鍗曢�夋涓�$first琛ㄧず閫夋嫨绗竴椤�', - initVal: card.initval || '', + initVal: initval, required: false }, { @@ -2398,21 +2538,19 @@ key: 'openText', label: '寮�鍚彁绀�', initVal: card.openText || '', - required: false, - forbid: appType === 'mob' + required: false }, { type: 'text', key: 'closeText', label: '鍏抽棴鎻愮ず', initVal: card.closeText || '', - required: false, - forbid: appType === 'mob' + required: false }, { type: 'radio', key: 'resourceType', - label: Formdict['header.form.resourceType'], + label: '閫夐」鏉ユ簮', initVal: card.resourceType || '0', required: true, options: [{ @@ -2451,7 +2589,7 @@ { type: 'text', key: 'cardValField', - label: Formdict['header.form.valueField'], + label: '鍊悸峰瓧娈�', initVal: card.cardValField || 'Value', required: true, readonly: false @@ -2484,19 +2622,19 @@ text: '16:9' }] }, - { - type: 'radio', - key: 'setAll', - label: '璁剧疆绌哄��', - initVal: card.setAll || 'false', - options: [{ - value: 'true', - text: Formdict['model.true'] - }, { - value: 'false', - text: Formdict['model.false'] - }] - }, + // { + // type: 'radio', + // key: 'setAll', + // label: '璁剧疆绌哄��', + // initVal: card.setAll || 'false', + // options: [{ + // value: 'true', + // text: Formdict['model.true'] + // }, { + // value: 'false', + // text: Formdict['model.false'] + // }] + // }, { type: 'fields', key: 'fields', @@ -2509,7 +2647,7 @@ type: 'options', key: 'options', label: '閫夐」', - initVal: card.options || [], + initVal: options, required: true, readonly: false }, @@ -2522,18 +2660,33 @@ readonly: false }, { + type: 'radio', + key: 'multiple', + label: '閫夋嫨褰㈠紡', + initVal: card.multiple || 'false', + required: true, + options: [{ + value: 'false', + text: '鍗曢��' + }, { + value: 'true', + text: '澶氶��' + }] + }, + { type: 'select', key: 'linkField', - label: Formdict['header.form.linkField'], + label: '鍏宠仈瀛楁', initVal: card.linkField || '', required: true, readonly: false, + allowClear: true, options: linkableFields }, { type: 'text', key: 'valueField', - label: Formdict['header.form.valueField'], + label: '鍊悸峰瓧娈�', initVal: card.valueField || '', required: true, readonly: false @@ -2541,7 +2694,7 @@ { type: 'text', key: 'valueText', - label: Formdict['header.form.valueText'], + label: '鏂囨湰路瀛楁', initVal: card.valueText || '', required: true, readonly: false @@ -2549,7 +2702,7 @@ { type: 'text', key: 'orderBy', - label: Formdict['header.form.orderBy'], + label: '鎺掑簭路瀛楁', initVal: card.orderBy || '', required: false, readonly: false @@ -2557,7 +2710,7 @@ { type: 'select', key: 'orderType', - label: Formdict['header.form.orderType'], + label: '鎺掑簭鏂瑰紡', initVal: card.orderType || 'asc', options: [{ value: 'asc', @@ -2575,20 +2728,6 @@ tooltip: '璁剧疆绂佺敤瀛楁锛屼笖瀛楁鍊间负true鏃讹紝閫夐」涓嶅彲閫夈��', required: false, readonly: false - }, - { - type: 'radio', - key: 'multiple', - label: '鍙閫�', - initVal: card.multiple || 'false', - required: true, - options: [{ - value: 'true', - text: '鏄�' - }, { - value: 'false', - text: '鍚�' - }] }, { type: 'number', @@ -2626,6 +2765,24 @@ }, { value: '0', text: '褰撳ぉ' + }, { + value: '1', + text: '鍚庝竴澶�' + }, { + value: '2', + text: '鍚庝袱澶�' + }, { + value: '3', + text: '鍚庝笁澶�' + }, { + value: '7', + text: '鍚庝竷澶�' + }, { + value: '30', + text: '鍚�30澶�' + }, { + value: '90', + text: '鍚�90澶�' }, { value: '-1', text: '鍓嶄竴澶�' @@ -2676,18 +2833,55 @@ }, { value: '90', text: '鍚�90澶�' + }, { + value: '-1', + text: '鍓嶄竴澶�' + }, { + value: '-2', + text: '鍓嶄袱澶�' + }, { + value: '-3', + text: '鍓嶄笁澶�' + }, { + value: '-7', + text: '鍓嶄竷澶�' + }, { + value: '-30', + text: '鍓�30澶�' + }, { + value: '-90', + text: '鍓�90澶�' + }] + }, + { + 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, - max: 1000000, + max: 100000, precision: 0, label: Formdict['model.form.field'] + Formdict['model.length'], - tooltip: '鏂囨湰銆佷笅鎷夋銆佹棩鏈熺瓑瀛楁榛樿闀垮害涓�50锛屽琛屾枃鏈笌鏂囦欢涓婁紶瀛楁榛樿闀垮害涓�512', + // tooltip: '鏂囨湰銆佷笅鎷夋銆佹棩鏈熺瓑瀛楁榛樿闀垮害涓�50锛屽琛屾枃鏈笌鏂囦欢涓婁紶瀛楁榛樿闀垮害涓�512', initVal: card.fieldlength || _fieldlength, - required: false + required: true }, { type: 'number', @@ -2695,7 +2889,7 @@ min: 1, max: 100, precision: 0, - label: appType === 'mob' ? '琛屾暟' : Formdict['header.form.maxRows'], + label: appType === 'mob' ? '琛屾暟' : '鏈�澶ц鏁�', tooltip: appType === 'mob' ? '琛屾暟涓虹┖鏃讹紝楂樺害鑷�傚簲' : '', initVal: card.maxRows || (appType === 'mob' ? '' : 6), required: false @@ -2703,40 +2897,46 @@ { type: 'select', key: 'regular', - label: Formdict['header.form.regular'], + label: '姝e垯鏍¢獙', 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: Formdict['header.form.letter&number'] + text: '鏁板瓧銆佸瓧姣嶄互鍙奯' }, { value: 'phone', text: '鎵嬫満鍙�' + }, { + value: 'email', + text: '閭' }] }, { type: 'select', key: 'fileType', label: '鏄剧ず鏂瑰紡', - initVal: card.fileType || (appType === 'mob' ? 'picture-card' : 'text'), + initVal: card.fileType || 'text', options: [{ value: 'text', text: '鏂囦欢' - }, { + }, + { value: 'picture', text: '鍥炬枃淇℃伅' - }, { + }, + { value: 'picture-card', text: '鍥剧墖鍗�' - }] + }], + forbid: appType === 'mob' }, { type: 'number', @@ -2751,8 +2951,21 @@ }, { type: 'radio', + key: 'allowHalf', + label: '鍗婇��', + initVal: card.allowHalf || 'false', + options: [{ + value: 'true', + text: '鏀寔' + }, { + value: 'false', + text: '涓嶆敮鎸�' + }] + }, + { + type: 'radio', key: 'readonly', - label: Formdict['header.form.readonly'], + label: '鍙', initVal: card.readonly || 'false', options: [{ value: 'true', @@ -2791,14 +3004,14 @@ { type: 'radio', key: 'database', - label: Formdict['header.form.database'], + label: '鏁版嵁搴�', initVal: card.database || 'local', options: [{ value: 'local', - text: Formdict['header.form.database.local'] + text: '鏈湴' }, { value: 'sso', - text: Formdict['header.form.database.sso'] + text: '绯荤粺' }] }, { @@ -2835,7 +3048,7 @@ { type: 'radio', key: 'readin', - label: Formdict['header.form.readin'], + label: '鑷姩濉厖', tooltip: '鏄惁灏嗚〃鏍奸�変腑鐨勬暟鎹嚜鍔ㄥ~鍏呭埌琛ㄥ崟锛堝瓧娈电浉鍚岋級', initVal: card.readin || 'true', options: [{ @@ -2862,6 +3075,24 @@ value: 'false', text: Formdict['model.false'] }] + }, + { + type: 'number', + min: 1, + max: 100, + precision: 0, + key: 'rateCount', + label: '鎬绘暟', + initVal: card.rateCount || 5, + tooltip: '榛樿鍊间负5銆�', + required: false + }, + { + type: 'icon', + key: 'character', + label: '鑷畾涔夊浘鏍�', + initVal: card.character || '', + required: false }, { type: 'radio', @@ -2933,98 +3164,20 @@ text: 'nvarchar(50)' }] }, - { - type: 'radio', - key: 'mode', - label: '妯″紡', - initVal: card.mode || 'picker', - options: [{ - value: 'picker', - text: '閫夋嫨鍣�' - }, { - value: 'calendar', - text: '鏃ュ巻' - }], - forbid: appType !== 'mob' - }, - { - type: 'number', - key: 'span', - min: 1, - max: 24, - precision: 0, - label: '琛ㄥ崟瀹藉害', - initVal: card.span || (['textarea', 'hint', 'checkcard', 'brafteditor'].includes(card.type) ? 24 : 12), - tooltip: '鏍呮牸甯冨眬鏁磋24绛夊垎銆�', - required: true, - forbid: appType === 'mob' - }, - { - type: 'number', - key: 'labelwidth', - min: 1, - max: 100, - precision: 1, - label: '鍚嶇О瀹藉害', - initVal: card.labelwidth || 33.3, - tooltip: '鍚嶇О鍗犳嵁琛ㄥ崟瀹藉害鐨勭櫨鍒嗘瘮銆傛敞锛氬瓨鍦ㄥ鍒楄〃鍗曟椂锛屽綋鍓嶈〃鍗曞鏋滄兂瑕佸崰鎹暣琛屽彲鍙傜収浠ヤ笅姣斾緥锛屼袱鍒楋紙16.2锛夈�佷笁鍒楋紙10.5锛夈�佸洓鍒楋紙7.7锛�', - required: true, - forbid: appType === 'mob' - }, - { - type: 'radio', - key: 'compress', - label: '鍘嬬缉', - initVal: card.compress || 'false', - tooltip: '鏂囦欢鍘嬬缉蹇呴』涓哄浘鐗囷紝鍥剧墖鏍煎紡涓簀pg銆乸ng銆乬if 鎴� jpeg', - options: [{ - value: 'true', - text: Formdict['model.true'] - }, { - value: 'false', - text: Formdict['model.false'] - }] - }, - { - type: 'number', - key: 'limit', - min: 0.01, - max: 1000, - precision: 2, - label: '璧风偣锛圡锛�', - initVal: card.limit || 2, - tooltip: '鍘嬬缉璧风偣锛屽皬浜庤捣鐐瑰�肩殑鏂囦欢涓嶈繘琛屽帇缂┿��', - required: true - }, - { - type: 'textarea', - key: 'rduri', - label: '杞瓨鎺ュ彛', - rows: 1, - initVal: card.rduri || '', - tooltip: '鍥剧墖杞瓨鍦ㄥ悓涓�鍗曠偣鏈嶅姟鍣ㄤ笅鐨勫叾浠栦笟鍔$郴缁熴��', - required: false, - readonly: false - }, - { - type: 'textarea', - key: 'proRduri', - label: '姝e紡鎺ュ彛', - rows: 1, - initVal: card.proRduri || '', - tooltip: '姝e紡绯荤粺杞瓨鎺ュ彛锛屽浘鐗囪浆瀛樺湪鍚屼竴鍗曠偣鏈嶅姟鍣ㄤ笅鐨勫叾浠栦笟鍔$郴缁熴��', - required: false, - readonly: false - }, - { - type: 'text', - key: 'suffix', - label: '鍚庣紑鍚�', - tooltip: '鍙互涓婁紶鏂囦欢鐨勫悗缂�鍚嶏紝澶氫釜绫诲瀷鐢ㄩ�楀彿鍒嗛殧锛岀┖鍊兼椂涓嶆牎楠屻��', - initVal: card.suffix || '', - required: false, - readonly: false - }, + // { + // type: 'radio', + // key: 'mode', + // label: '妯″紡', + // initVal: card.mode || 'picker', + // options: [{ + // value: 'picker', + // text: '閫夋嫨鍣�' + // }, { + // value: 'calendar', + // text: '鏃ュ巻' + // }], + // forbid: appType !== 'mob' + // }, { type: 'radio', key: 'encryption', @@ -3042,7 +3195,7 @@ type: 'radio', key: 'interception', label: '鎴彇绌烘牸', - initVal: card.interception || 'false', + initVal: card.interception || 'true', tooltip: '鎻愪氦鏃讹紝鏄惁鎴彇棣栧熬鐨勭┖鐧藉瓧绗︺��', options: [{ value: 'true', @@ -3097,22 +3250,146 @@ forbid: appType !== 'mob' }, { + type: 'radio', + key: 'compress', + label: '鏂囦欢澶勭悊', + initVal: card.compress || 'false', + tooltip: '鏂囦欢鍘嬬缉鎴朾ase64蹇呴』涓哄浘鐗囷紝鍥剧墖鏍煎紡涓簀pg銆乸ng銆乬if 鎴� jpeg銆傛敞锛歜ase64鍙彲涓婁紶涓�寮犲浘鐗囥��', + options: [{ + value: 'false', + text: '鏃�' + }, { + value: 'true', + text: '鍘嬬缉' + }, { + value: 'base64', + text: 'base64' + }] + }, + { + type: 'number', + key: 'limit', + min: 0.01, + max: 1000, + precision: 2, + label: '璧风偣锛圡锛�', + initVal: card.limit || 2, + tooltip: '鍘嬬缉璧风偣锛屽皬浜庤捣鐐瑰�肩殑鏂囦欢涓嶈繘琛屽帇缂┿��', + required: true + }, + { + type: 'number', + key: 'span', + min: 1, + max: 24, + precision: 0, + label: '琛ㄥ崟瀹藉害', + initVal: card.span || (['textarea', 'hint', 'checkcard', 'brafteditor'].includes(card.type) ? 24 : 12), + tooltip: '鏍呮牸甯冨眬鏁磋24绛夊垎銆�', + required: true, + forbid: appType === 'mob' + }, + { + type: 'radio', + key: 'span', + label: '琛ㄥ崟瀹藉害', + initVal: card.span || 24, + tooltip: '鏍呮牸甯冨眬鏁磋24绛夊垎銆�', + required: true, + forbid: appType !== 'mob', + options: [{ + value: 24, + text: 24 + }, { + value: 12, + text: 12 + }, { + value: 8, + text: 8 + }, { + 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: '鍙虫埅' + }] + }, + { + type: 'number', + key: 'labelwidth', + min: 1, + max: 100, + precision: 1, + label: '鍚嶇О瀹藉害', + initVal: card.labelwidth || 33.3, + tooltip: '鍚嶇О鍗犳嵁琛ㄥ崟瀹藉害鐨勭櫨鍒嗘瘮銆傛敞锛氬瓨鍦ㄥ鍒楄〃鍗曟椂锛屽綋鍓嶈〃鍗曞鏋滄兂瑕佸崰鎹暣琛屽彲鍙傜収浠ヤ笅姣斾緥锛屼袱鍒楋紙16.2锛夈�佷笁鍒楋紙10.5锛夈�佸洓鍒楋紙7.7锛�', + required: true, + forbid: appType === 'mob' + }, + { + type: 'textarea', + key: 'rduri', + label: '杞瓨鎺ュ彛', + rows: 1, + initVal: card.rduri || '', + tooltip: '鍥剧墖杞瓨鍦ㄥ悓涓�鍗曠偣鏈嶅姟鍣ㄤ笅鐨勫叾浠栦笟鍔$郴缁熴��', + required: false, + readonly: false + }, + { + type: 'textarea', + key: 'proRduri', + label: '姝e紡鎺ュ彛', + rows: 1, + initVal: card.proRduri || '', + tooltip: '姝e紡绯荤粺杞瓨鎺ュ彛锛屽浘鐗囪浆瀛樺湪鍚屼竴鍗曠偣鏈嶅姟鍣ㄤ笅鐨勫叾浠栦笟鍔$郴缁熴��', + required: false, + readonly: false + }, + { + type: 'text', + key: 'suffix', + label: '鍚庣紑鍚�', + tooltip: '鍙互涓婁紶鏂囦欢鐨勫悗缂�鍚嶏紝澶氫釜绫诲瀷鐢ㄩ�楀彿鍒嗛殧锛岀┖鍊兼椂涓嶆牎楠屻��', + initVal: card.suffix || '', + required: false, + readonly: false + }, + + { type: 'select', key: 'supField', label: '涓婄骇琛ㄥ崟', - tooltip: '涓婄骇琛ㄥ崟涓轰笅鎷夐�夋嫨銆佽仈鍔ㄨ彍鍗曘�佸崟閫夋鍙婂閫夋锛屾坊鍔犲悗璇ヨ〃鍗曟樉绀哄強闅愯棌灏嗗彈涓婄骇琛ㄥ崟鎺у埗锛屾敞锛氬彈鎺у叧绯诲湪璇ヨ〃鍗曢殣钘忔椂澶辨晥銆�', + tooltip: '璇ヨ〃鍗曟樉绀烘垨闅愯棌鍙椾笂绾ц〃鍗曟帶鍒躲��', initVal: card.supField || '', required: false, readonly: false, + allowClear: true, options: linksupFields }, { type: 'text', key: 'supvalue', + max: 512, label: '鏄剧ず鍊�', tooltip: '璇峰~鍐欐樉绀哄�硷紝鍙湁涓婄骇琛ㄥ崟鍊间笌鏄剧ず鍊肩浉鍚屾椂锛岃琛ㄥ崟鎵嶄細鏄剧ず锛屾敞锛�1銆佸涓�肩敤閫楀彿鍒嗛殧锛�2銆佷笂绾ц〃鍗曞垵濮嬪�间负$first鏃舵殏鏈鐞嗐��', initVal: card.supvalue || '', - required: true, + required: false, readonly: false }, { @@ -3134,6 +3411,22 @@ forbid: appType === 'mob' }, { + type: 'radio', + key: 'enterReplace', + label: '鍥炶溅绗︽浛鎹�', + tooltip: '鍥炶溅绗︿細鏇挎崲涓鸿嫳鏂囬�楀彿銆�', + initVal: card.enterReplace || 'false', + required: false, + forbid: appType !== 'mob', + options: [{ + value: 'false', + text: '鍚�' + }, { + value: 'true', + text: '鏄�' + }] + }, + { type: 'text', key: 'placeholder', label: '鎻愮ず淇℃伅', @@ -3141,14 +3434,14 @@ initVal: card.placeholder || '', required: false }, - { - type: 'text', - key: 'emptyText', - label: '绌哄�兼枃鏈�', - tooltip: '绌哄�肩殑鎻愮ず鏂囨湰锛岄�夋嫨璁剧疆绌哄�兼椂鏈夋晥锛岄粯璁ゅ�间负銆婄┖銆嬨��', - initVal: card.emptyText || '', - required: false - }, + // { + // type: 'text', + // key: 'emptyText', + // label: '绌哄�兼枃鏈�', + // tooltip: '绌哄�肩殑鎻愮ず鏂囨湰锛岄�夋嫨璁剧疆绌哄�兼椂鏈夋晥锛岄粯璁ゅ�间负銆婄┖銆嬨��', + // initVal: card.emptyText || '', + // required: false + // }, { type: 'radio', key: 'enter', @@ -3177,40 +3470,41 @@ { type: 'multiselect', key: 'linkSubField', - label: Formdict['model.form.linkform'], - tooltip: '鍦ㄥ垏鎹㈤�夐」鏃朵細鎶婁俊鎭嚜鍔ㄥ~鍏ュ叧鑱旂殑琛ㄥ崟锛堟枃鏈垨鏁板瓧琛ㄥ崟锛変腑銆傛敞锛氫娇鐢ㄩ�夐」鍗′笖璁句负鍙閫夋椂鏃犳晥銆�', + label: '濉厖琛ㄥ崟', + tooltip: '鍦ㄥ垏鎹㈤�夐」鏃朵細鎶婁俊鎭嚜鍔ㄥ~鍏ュ叧鑱旂殑琛ㄥ崟锛堟枃鏈垨鏁板瓧琛ㄥ崟锛変腑銆�', initVal: card.linkSubField || [], options: inputfields }, - { - type: 'number', - key: 'marginTop', - label: '涓婅竟璺濓紙px锛�', - initVal: card.marginTop || 0, - min: 0, - max: 1000, - precision: 0, - required: false, - forbid: appType !== 'mob' - }, - { - type: 'number', - key: 'marginBottom', - label: '涓嬭竟璺濓紙px锛�', - initVal: card.marginBottom || 0, - min: 0, - 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' } ] } @@ -3242,27 +3536,11 @@ options: [] }, { - type: 'select', + type: 'icon', key: 'icon', label: Formdict['model.icon'], initVal: card.icon || '', required: false, - options: [{ - value: '', - text: Formdict['model.empty'] - }, { - value: 'table', - text: 'table' - }, { - value: 'bar-chart', - text: 'bar-chart' - }, { - value: 'pie-chart', - text: 'pie-chart' - }, { - value: 'line-chart', - text: 'line-chart' - }], forbid: type === 'CalendarPage' }, { -- Gitblit v1.8.0