From 063b983daaf51a7f1e8677bde1e9c0e618866c91 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 21 二月 2020 10:30:19 +0800 Subject: [PATCH] 2020-02-21 --- src/templates/tableshare/formconfig.js | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 163 insertions(+), 9 deletions(-) diff --git a/src/templates/tableshare/formconfig.js b/src/templates/tableshare/formconfig.js index 38c3fc0..2413581 100644 --- a/src/templates/tableshare/formconfig.js +++ b/src/templates/tableshare/formconfig.js @@ -190,6 +190,19 @@ value: 'button', text: Formdict['header.form.button'] }] + }, + { + type: 'radio', + key: 'database', + label: Formdict['header.form.database'], + initVal: card.database || 'local', + options: [{ + value: 'local', + text: Formdict['header.form.database.local'] + }, { + value: 'sso', + text: Formdict['header.form.database.sso'] + }] } ] } @@ -380,6 +393,34 @@ }, { type: 'select', + key: 'afterExecSuccess', + label: Formdict['header.form.afterExecSuccess'], + initVal: card.afterExecSuccess || 'close', + required: true, + options: [{ + value: 'close', + text: Formdict['header.close'] + }, { + value: 'notclose', + text: Formdict['header.notclose'] + }] + }, + { + type: 'select', + key: 'afterExecError', + label: Formdict['header.form.afterExecError'], + initVal: card.afterExecError || 'notclose', + required: true, + options: [{ + value: 'close', + text: Formdict['header.close'] + }, { + value: 'notclose', + text: Formdict['header.notclose'] + }] + }, + { + type: 'select', key: 'execSuccess', label: Formdict['header.form.execSuccess'], initVal: card.execSuccess || 'never', @@ -447,10 +488,17 @@ }, { type: 'text', + key: 'sheet', + label: Formdict['header.form.tablename'], + initVal: card.sheet || config.setting.tableName || '', + required: true + }, + { + type: 'text', key: 'sql', - label: Formdict['header.form.datasource'], + label: Formdict['header.form.tablename'], initVal: card.sql || config.setting.tableName || '', - tooltip: Formdict['header.form.actionhelp.datasource'], + tooltip: Formdict['header.form.actionhelp.tablename'], required: false }, { @@ -461,6 +509,20 @@ tooltip: Formdict['header.form.actionhelp.sqlType'], required: false, options: [] + }, + { + type: 'radio', + key: 'pagination', + label: Formdict['header.form.pagination'], + initVal: card.pagination || 'false', + required: false, + options: [{ + value: 'true', + text: Formdict['header.form.true'] + }, { + value: 'false', + text: Formdict['header.form.false'] + }] } ] } @@ -568,8 +630,8 @@ max: 18, decimal: 0, label: Formdict['header.form.decimal'], - initVal: card.decimal, - required: false + initVal: card.decimal || 0, + required: true }, { type: 'select', @@ -664,6 +726,13 @@ text: '缁胯壊锛堣儗鏅級' }], required: false + }, + { + type: 'number', + key: 'fieldlength', + label: Formdict['header.form.field.length'], + initVal: card.fieldlength || (card.type === 'text' ? 50 : 512), + required: false } ] } @@ -673,7 +742,21 @@ * @param {*} card * @param {*} inputfields */ -export function getModalForm (card, inputfields) { +export function getModalForm (card, inputfields, subtable = false) { + let _openType = [] + let _fieldlength = 50 + + if (subtable) { + _openType.push({ + value: 'linkMain', + text: Formdict['header.form.linkMain'] + }) + } + + if (card.type === 'textarea' || card.type === 'fileupload') { + _fieldlength = 512 + } + return [ { type: 'text', @@ -687,7 +770,7 @@ type: 'text', key: 'field', label: Formdict['header.form.field'], - initVal: card.field, + initVal: card.field || '', required: true, readonly: false }, @@ -727,13 +810,17 @@ }, { value: 'textarea', text: Formdict['header.form.textarea'] - }] + }, { + value: 'funcvar', + text: Formdict['header.form.funcvar'] + }, + ..._openType] }, { type: 'text', key: 'initval', label: Formdict['header.form.initval'], - initVal: card.initval, + initVal: card.initval || '', required: false }, { @@ -829,7 +916,7 @@ key: 'decimal', label: Formdict['header.form.decimal'], initVal: card.decimal || 0, - required: false + required: true }, { type: 'number', @@ -844,6 +931,25 @@ label: '鏈�澶у��', initVal: card.max || '', required: false + }, + { + type: 'select', + key: 'regular', + label: Formdict['header.form.regular'], + initVal: card.regular || '', + options: [{ + value: '', + text: Formdict['header.form.empty'] + }, { + value: 'number', + text: Formdict['header.form.number'] + }, { + value: 'letter', + text: Formdict['header.form.letter'] + }, { + value: 'letter&number', + text: Formdict['header.form.letter&number'] + }] }, { type: 'radio', @@ -872,6 +978,54 @@ }] }, { + type: 'radio', + key: 'hidden', + label: Formdict['header.form.field.ishidden'], + initVal: card.hidden || 'false', + options: [{ + value: 'true', + text: Formdict['header.form.true'] + }, { + value: 'false', + text: Formdict['header.form.false'] + }] + }, + { + type: 'radio', + key: 'database', + label: Formdict['header.form.database'], + initVal: card.database || 'local', + options: [{ + value: 'local', + text: Formdict['header.form.database.local'] + }, { + value: 'sso', + text: Formdict['header.form.database.sso'] + }] + }, + { + type: 'number', + key: 'fieldlength', + label: Formdict['header.form.field.length'], + tooltip: '鏂囨湰銆佷笅鎷夋銆佹棩鏈熺瓑瀛楁榛樿闀垮害涓�50锛屽琛屾枃鏈笌鏂囦欢涓婁紶瀛楁榛樿闀垮害涓�512', + initVal: card.fieldlength || _fieldlength, + required: false + }, + { + type: 'radio', + key: 'readin', + label: Formdict['header.form.readin'], + tooltip: Formdict['header.form.readin.tooltip'], + initVal: card.readin || 'true', + options: [{ + value: 'true', + text: Formdict['header.form.true'] + }, { + value: 'false', + text: Formdict['header.form.false'] + }] + }, + { type: 'multiselect', key: 'linkSubField', label: Formdict['header.form.linkForm'], -- Gitblit v1.8.0