main
kgdxpr 2 years ago
parent af6b0a9f73
commit 58365a1026

@ -3778,6 +3778,22 @@ layui.config({ base: './ayq/modules/' }).define(["layer", 'flow', "laytpl", "ele
_html += ' </div>';
_html += '</div>';
break;
case 'fieldType':
_html += '<div class="layui-form-item" >';
_html += ' <label class="layui-form-label">{0}</label>'.format(staticField.lang[key]);
_html += ' <div class="layui-input-block">';
_html += '<select name="{0}" lay-verify="required">'.format(key);
for (var i = 0; i < staticField.fieldTypes.length; i++) {
if (staticField.fieldTypes[i].value === json.fieldType) {
_html += '<option value="{0}" selected="">{1}</option>'.format(staticField.fieldTypes[i].value, staticField.fieldTypes[i].text);
} else {
_html += '<option value="{0}">{1}</option>'.format(staticField.fieldTypes[i].value, staticField.fieldTypes[i].text);
}
}
_html += '</select>'
_html += ' </div>';
_html += '</div>';
break;
case 'autoplay':
case 'iconPickerSearch':
case 'iconPickerPage':
@ -4218,6 +4234,17 @@ layui.config({ base: './ayq/modules/' }).define(["layer", 'flow', "laytpl", "ele
that.components[_json.tag].update(_json, that);
}
break;
case 'fieldType':
if (_json.tag === 'input') {
var _html = '<div id="{0}" class="layui-input icon-date widget-date" style="line-height: 40px;"></div>'.format('dateDefaultValue' + _json.tag + _json.id);
$('#dateDefaultValue' + _json.id + ' .layui-input-block').empty();
$('#dateDefaultValue' + _json.id + ' .layui-input-block').append(_html);
_json.fieldType = data.value;
that.components[_json.tag].update(_json, that);
}
break;
case 'anim':
case 'arrow':
case 'buttonType':
@ -4675,6 +4702,7 @@ layui.config({ base: './ayq/modules/' }).define(["layer", 'flow', "laytpl", "ele
$("#formSave").on('click', function () {
if (options.data.length > 0) {
console.log(JSON.stringify(options.data));
window.localStorage.setItem('form_json', JSON.stringify(options.data));
layer.open({
type: 2,

@ -12,16 +12,17 @@ layui.define(['layer'], function (exports) {
defaultValue: null,
labelWidth: 110,
width: "100%",
fieldType: "1",
clearable: true,
maxlength: null,
showWordLimit: false,
readonly: false,
disabled: false,
// readonly: false,
// disabled: false,
required: true,
hideLabel: false,
dimension: false,
expression: "",
document: '',
// hideLabel: false,
// dimension: false,
expression: ""
// document: '',
},
select: {
id: '-1',

@ -94,33 +94,17 @@ layui.define(['layer'], function (exports) {
spacing: "间距",
whiteSpace: "组件高度",
textField: "HTML",
dimension:"是否为维度"
dimension: "是否为维度",
fieldType: "字段类型"
},
templateFormList: [
{text: '默认模板',imageUrl: "./ayq/images/11.PNG",
value:[
{
"id": "input_1",
"index": 0,
"label": "单行文本",
"tag": "input",
"tagIcon": "input",
"placeholder": "请输入",
"defaultValue": null,
"labelWidth": 110,
"width": "100%",
"clearable": true,
"maxlength": null,
"showWordLimit": false,
"readonly": false,
"disabled": false,
"required": true,
"expression": "",
"document": ""
}
]
}
],
fieldTypes: [{ text: '文本', value: "1" }
, { text: '数值', value: '2' }
, { text: '小数', value: '3' }
, { text: '日期', value: '4' }
],
expressions: [{ text: '默认', value: "" }
, { text: '数字', value: 'number' }

Loading…
Cancel
Save