From 95afd40fc2741ac0ce59c2091f6cfce1f98877d4 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 24 六月 2021 09:15:45 +0800 Subject: [PATCH] 2021-06-24 --- src/templates/zshare/formconfig.jsx | 181 ++++++++++++++++++++++++++++++++++++++------- 1 files changed, 152 insertions(+), 29 deletions(-) diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index 1dd0495..c5e049c 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -298,6 +298,59 @@ roleList = [] } + let typeOptions = [] + + if (sessionStorage.getItem('appType') === 'mob') { + typeOptions = [{ + value: 'text', + text: Formdict['model.form.text'] + }, { + value: 'checkcard', + text: '閫夐」鍗�' + }, { + value: 'date', + text: Formdict['model.form.dateday'] + }, { + value: 'datemonth', + text: Formdict['model.form.datemonth'] + }] + if (!['text', 'checkcard', 'date', 'datemonth'].includes(card.type)) { + card.type = 'text' + } + } else { + typeOptions = [{ + value: 'text', + text: Formdict['model.form.text'] + }, { + value: 'select', + text: Formdict['model.form.select'] + }, { + value: 'multiselect', + text: Formdict['model.form.multiselect'] + }, { + value: 'link', + text: Formdict['model.form.link'] + }, { + value: 'checkcard', + text: '閫夐」鍗�' + }, { + value: 'date', + text: Formdict['model.form.dateday'] + }, { + value: 'dateweek', + text: Formdict['model.form.dateweek'] + }, { + value: 'datemonth', + text: Formdict['model.form.datemonth'] + }, { + value: 'daterange', + text: Formdict['model.form.daterange'] + }, { + value: 'group', + text: Formdict['model.form.dategroup'] + }] + } + return [ { type: 'text', @@ -322,34 +375,7 @@ label: Formdict['model.form.type'], initVal: card.type, required: true, - options: [{ - value: 'text', - text: Formdict['model.form.text'] - }, { - value: 'select', - text: Formdict['model.form.select'] - }, { - value: 'multiselect', - text: Formdict['model.form.multiselect'] - }, { - value: 'link', - text: Formdict['model.form.link'] - }, { - value: 'date', - text: Formdict['model.form.dateday'] - }, { - value: 'dateweek', - text: Formdict['model.form.dateweek'] - }, { - value: 'datemonth', - text: Formdict['model.form.datemonth'] - }, { - value: 'daterange', - text: Formdict['model.form.daterange'] - }, { - value: 'group', - text: Formdict['model.form.dategroup'] - }] + options: typeOptions }, { type: 'text', @@ -395,6 +421,75 @@ }] }, { + type: 'radio', + key: 'display', + label: '鏄剧ず', + initVal: card.display || 'text', + required: true, + options: [{ + value: 'text', + text: '鏂囨湰' + }, { + value: 'picture', + text: '鍥剧墖' + }] + }, + { + type: 'number', + key: 'width', + min: 1, + max: 24, + precision: 0, + label: '鍗$墖瀹藉害', + initVal: card.width || 4, + tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��', + required: true + }, + { + type: 'text', + key: 'cardValField', + label: Formdict['header.form.valueField'], + initVal: card.cardValField || 'Value', + required: true, + readonly: false + }, + { + type: 'text', + key: 'urlField', + label: '鍦板潃瀛楁', + initVal: card.urlField || '', + required: true, + readonly: false + }, + { + type: 'radio', + key: 'picratio', + label: '鍥剧墖姣斾緥', + initVal: card.picratio || '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' + }] + }, + { + type: 'fields', + key: 'fields', + label: '瀛楁闆�', + initVal: card.fields || [], + required: true, + readonly: false + }, + { type: 'textarea', key: 'dataSource', label: Formdict['header.form.datasource'], @@ -405,7 +500,7 @@ { type: 'options', key: 'options', - label: '', + label: '閫夐」', initVal: card.options || [], required: true, readonly: false @@ -531,6 +626,20 @@ }, { type: 'radio', + key: 'multiple', + label: '鍙閫�', + initVal: card.multiple || 'false', + required: true, + options: [{ + value: 'true', + text: '鏄�' + }, { + value: 'false', + text: '鍚�' + }] + }, + { + type: 'radio', key: 'required', label: Formdict['model.required'], initVal: card.required || 'false', @@ -596,6 +705,20 @@ }] }, { + type: 'color', + key: 'backgroundColor', + label: '鑳屾櫙鑹�', + initVal: card.backgroundColor || '', + required: false + }, + { + type: 'color', + key: 'borderColor', + label: '杈规棰滆壊', + initVal: card.borderColor || '', + required: false + }, + { type: 'multiselect', key: 'blacklist', label: Formdict['header.form.blacklist'], -- Gitblit v1.8.0