diff --git a/WebRoot/view/tb/form/ayq/modules/formDesigner.js b/WebRoot/view/tb/form/ayq/modules/formDesigner.js index ca336426..b1df3f97 100644 --- a/WebRoot/view/tb/form/ayq/modules/formDesigner.js +++ b/WebRoot/view/tb/form/ayq/modules/formDesigner.js @@ -3778,6 +3778,22 @@ layui.config({ base: './ayq/modules/' }).define(["layer", 'flow', "laytpl", "ele _html += ' '; _html += ''; break; + case 'fieldType': + _html += '
'; + _html += ' '.format(staticField.lang[key]); + _html += '
'; + _html += '' + _html += '
'; + _html += '
'; + 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 = '
'.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, diff --git a/WebRoot/view/tb/form/ayq/modules/formField.js b/WebRoot/view/tb/form/ayq/modules/formField.js index b4086994..ea8c3dca 100644 --- a/WebRoot/view/tb/form/ayq/modules/formField.js +++ b/WebRoot/view/tb/form/ayq/modules/formField.js @@ -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', diff --git a/WebRoot/view/tb/form/ayq/modules/staticField.js b/WebRoot/view/tb/form/ayq/modules/staticField.js index 601feea9..e931a8b3 100644 --- a/WebRoot/view/tb/form/ayq/modules/staticField.js +++ b/WebRoot/view/tb/form/ayq/modules/staticField.js @@ -1,7 +1,7 @@ layui.define(['layer'], function (exports) { var staticField = { - lang : { + lang: { id: "标识", label: "标题", index: "序号", @@ -12,7 +12,7 @@ layui.define(['layer'], function (exports) { span: '网格宽度', placeholder: "placeholder", defaultValue: "默认值", - dateDefaultValue:'默认时间', + dateDefaultValue: '默认时间', labelWidth: "文本宽度", clearable: "是否清楚", prepend: "前缀", @@ -65,116 +65,100 @@ layui.define(['layer'], function (exports) { autoplay: "自动切换", anim: "切换方式", arrow: "切换箭头", - tab:"tab选项卡", - tabHeaders:"tab标题", - isInput:"显示输入框", - dateRange:"日期范围", - dateRangeDefaultValue:"默认范围", - menu:"头部菜单", - numberInput:"排序文本框", - iconPicker:"图标选择器", - iconPickerSearch:"是否搜索", - iconPickerPage:"是否分页", - iconPickerLimit:"显示数量", - iconPickerCellWidth:"图标宽度", - cron:"Cron表达式", - cronUrl:"运行路径", - labelGeneration:"标签组件", - isEnter:"是否回车", - buttonIcon:"按钮图标", - buttonType:"按钮类型", - buttonSize:"组件尺寸", - bottom:"按钮组件", - buttonVlaue:"按钮文字", - sign:"sign签名组件", - hideLabel:"隐藏标签", - colorSelection:"颜色选择", - blockquote:"便签信息", - line:"分割线", - spacing:"间距", - whiteSpace:"组件高度", - textField:"HTML", - dimension:"是否为维度" + tab: "tab选项卡", + tabHeaders: "tab标题", + isInput: "显示输入框", + dateRange: "日期范围", + dateRangeDefaultValue: "默认范围", + menu: "头部菜单", + numberInput: "排序文本框", + iconPicker: "图标选择器", + iconPickerSearch: "是否搜索", + iconPickerPage: "是否分页", + iconPickerLimit: "显示数量", + iconPickerCellWidth: "图标宽度", + cron: "Cron表达式", + cronUrl: "运行路径", + labelGeneration: "标签组件", + isEnter: "是否回车", + buttonIcon: "按钮图标", + buttonType: "按钮类型", + buttonSize: "组件尺寸", + bottom: "按钮组件", + buttonVlaue: "按钮文字", + sign: "sign签名组件", + hideLabel: "隐藏标签", + colorSelection: "颜色选择", + blockquote: "便签信息", + line: "分割线", + spacing: "间距", + whiteSpace: "组件高度", + textField: "HTML", + 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": "" - } - ] - } + templateFormList: [ + + ], + fieldTypes: [{ text: '文本', value: "1" } + , { text: '数值', value: '2' } + , { text: '小数', value: '3' } + , { text: '日期', value: '4' } ], - expressions : [{text: '默认', value: ""} - , {text: '数字', value: 'number'} - , {text: '邮箱', value: 'email'} - , {text: '手机', value: 'phone'} - , {text: '身份证', value: 'identity'} - , {text: '日期', value: 'date'} - , {text: '网址', value: 'url'} - , {text: '密码', value: 'pass'} - ], anims : [{text: '左右切换', value: 'default'} - , {text: '上下切换', value: 'updown'} - , {text: '渐隐渐显切换', value: 'fade'} - ], arrows : [{text: '悬停显示', value: 'hover'} - , {text: '始终显示', value: 'always'} - , {text: '始终不显示', value: 'none'}] - , dateTypes : [{text: '年选择器', value: 'year'} - , {text: '年月选择器', value: 'month'} - , {text: '时间选择器', value: 'time'} - , {text: '日期选择器', value: 'date'} - , {text: '日期时间选择器', value: 'datetime'}] - , buttonTypes : [{text: '原始', value: 'layui-btn-primary'} - , {text: '默认', value: ""} - , {text: '百搭', value: 'layui-btn-normal'} - , {text: '暖色', value: 'layui-btn-warm'} - , {text: '警告', value: ' layui-btn-danger'}] - , buttonSizes : [{text: '大型', value: 'layui-btn-lg'} - , {text: '默认', value: ""} - , {text: '小型', value: 'layui-btn-sm'} - , {text: '迷你', value: 'layui-btn-xs'}] - , dateFormats : ["yyyy年MM月", "yyyy-MM-dd", "dd/MM/yyyy", "yyyyMMdd", "yyyy-MM-dd HH:mm:ss", "yyyy年MM月dd日 HH时mm分ss秒"] - , iceEditMenus : [ - {value:'backColor',text:'字体背景颜色'},{value:'fontSize',text:'字体大小'},{value:'foreColor',text:'字体颜色'},{value:'bold',text:'粗体'}, - {value:'italic',text:'斜体'},{value:'underline',text:'下划线'},{value:'strikeThrough',text:'删除线'},{value:'justifyLeft',text:'左对齐'}, - {value:'justifyCenter',text:'居中对齐'},{value:'justifyRight',text:'右对齐'},{value:'indent',text:'增加缩进'},{value:'outdent',text:'减少缩进'}, - {value:'insertOrderedList',text:'有序列表'},{value:'insertUnorderedList',text:'无序列表'},{value:'superscript',text:'上标'},{value:'subscript',text:'下标'}, - {value:'createLink',text:'创建连接'},{value:'unlink',text:'取消连接'},{value:'hr',text:'水平线'},{value:'face',text:'表情'},{value:'table',text:'表格'}, - {value:'files',text:'附件'},{value:'music',text:'音乐'},{value:'video',text:'视频'},{value:'insertImage',text:'图片'}, - {value:'removeFormat',text:'格式化样式'},{value:'code',text:'源码'},{value:'line',text:'菜单分割线'} + expressions: [{ text: '默认', value: "" } + , { text: '数字', value: 'number' } + , { text: '邮箱', value: 'email' } + , { text: '手机', value: 'phone' } + , { text: '身份证', value: 'identity' } + , { text: '日期', value: 'date' } + , { text: '网址', value: 'url' } + , { text: '密码', value: 'pass' } + ], anims: [{ text: '左右切换', value: 'default' } + , { text: '上下切换', value: 'updown' } + , { text: '渐隐渐显切换', value: 'fade' } + ], arrows: [{ text: '悬停显示', value: 'hover' } + , { text: '始终显示', value: 'always' } + , { text: '始终不显示', value: 'none' }] + , dateTypes: [{ text: '年选择器', value: 'year' } + , { text: '年月选择器', value: 'month' } + , { text: '时间选择器', value: 'time' } + , { text: '日期选择器', value: 'date' } + , { text: '日期时间选择器', value: 'datetime' }] + , buttonTypes: [{ text: '原始', value: 'layui-btn-primary' } + , { text: '默认', value: "" } + , { text: '百搭', value: 'layui-btn-normal' } + , { text: '暖色', value: 'layui-btn-warm' } + , { text: '警告', value: ' layui-btn-danger' }] + , buttonSizes: [{ text: '大型', value: 'layui-btn-lg' } + , { text: '默认', value: "" } + , { text: '小型', value: 'layui-btn-sm' } + , { text: '迷你', value: 'layui-btn-xs' }] + , dateFormats: ["yyyy年MM月", "yyyy-MM-dd", "dd/MM/yyyy", "yyyyMMdd", "yyyy-MM-dd HH:mm:ss", "yyyy年MM月dd日 HH时mm分ss秒"] + , iceEditMenus: [ + { value: 'backColor', text: '字体背景颜色' }, { value: 'fontSize', text: '字体大小' }, { value: 'foreColor', text: '字体颜色' }, { value: 'bold', text: '粗体' }, + { value: 'italic', text: '斜体' }, { value: 'underline', text: '下划线' }, { value: 'strikeThrough', text: '删除线' }, { value: 'justifyLeft', text: '左对齐' }, + { value: 'justifyCenter', text: '居中对齐' }, { value: 'justifyRight', text: '右对齐' }, { value: 'indent', text: '增加缩进' }, { value: 'outdent', text: '减少缩进' }, + { value: 'insertOrderedList', text: '有序列表' }, { value: 'insertUnorderedList', text: '无序列表' }, { value: 'superscript', text: '上标' }, { value: 'subscript', text: '下标' }, + { value: 'createLink', text: '创建连接' }, { value: 'unlink', text: '取消连接' }, { value: 'hr', text: '水平线' }, { value: 'face', text: '表情' }, { value: 'table', text: '表格' }, + { value: 'files', text: '附件' }, { value: 'music', text: '音乐' }, { value: 'video', text: '视频' }, { value: 'insertImage', text: '图片' }, + { value: 'removeFormat', text: '格式化样式' }, { value: 'code', text: '源码' }, { value: 'line', text: '菜单分割线' } ], - formDesignerHtml : '
\n' + - '
\n'+ - '
创建任务
\n'+ - '
\n'+ - '\n'+ - '\n'+ - '
\n'+ - '
\n'+ + formDesignerHtml: '
\n' + + '
\n' + + '
创建任务
\n' + + '
\n' + + '\n' + + '\n' + + '
\n' + + '
\n' + '
\n' + '
\n' + ' \n' + '
\n' + '
    \n' + '
  • 组件
  • \n' + - + '
\n' + '
\n' + '
\n' + @@ -238,17 +222,17 @@ layui.define(['layer'], function (exports) { '
\n' + '
\n' + '
', - formDefaultButton:'
\n' + + formDefaultButton: '
\n' + '
\n' + ' \n' + ' \n' + '
\n' + '
', - importHtml:'