Browse Source

Merge branch 'dev_ljj' of http://git.elinkit.com.cn:7070/r/tduck-front into dev_ljj

old
jiangyy 4 years ago
parent
commit
b1c4210b99
  1. 56
      src/components/generator/config.js
  2. 4
      src/utils/convert.js

56
src/components/generator/config.js

@ -22,6 +22,8 @@ export const inputComponents = [
// 组件的自定义配置 // 组件的自定义配置
typeId: 'INPUT', typeId: 'INPUT',
__config__: { __config__: {
name: 'input',
moduleType: 'input',
label: '单行文本', label: '单行文本',
labelWidth: null, labelWidth: null,
showLabel: true, showLabel: true,
@ -55,6 +57,8 @@ export const inputComponents = [
{ {
typeId: 'TEXTAREA', typeId: 'TEXTAREA',
__config__: { __config__: {
name: 'textarea',
moduleType: 'input',
label: '多行文本', label: '多行文本',
labelWidth: null, labelWidth: null,
showLabel: true, showLabel: true,
@ -83,6 +87,8 @@ export const inputComponents = [
{ {
typeId: 'NUMBER_INPUT', typeId: 'NUMBER_INPUT',
__config__: { __config__: {
name: 'number',
moduleType: 'input',
label: '计数器', label: '计数器',
showLabel: true, showLabel: true,
changeTag: true, changeTag: true,
@ -112,6 +118,8 @@ export const selectComponents = [
{ {
typeId: 'SELECT', typeId: 'SELECT',
__config__: { __config__: {
name: 'select',
moduleType: 'choose',
label: '下拉选择', label: '下拉选择',
showLabel: true, showLabel: true,
labelWidth: null, labelWidth: null,
@ -143,6 +151,8 @@ export const selectComponents = [
{ {
typeId: 'CASCADER', typeId: 'CASCADER',
__config__: { __config__: {
name: 'cascader',
moduleType: 'choose',
label: '级联选择', label: '级联选择',
url: 'https://www.fastmock.site/mock/f8d7a54fb1e60561e2f720d5a810009d/fg/cascaderList', url: 'https://www.fastmock.site/mock/f8d7a54fb1e60561e2f720d5a810009d/fg/cascaderList',
method: 'get', method: 'get',
@ -189,6 +199,8 @@ export const selectComponents = [
{ {
typeId: 'RADIO', typeId: 'RADIO',
__config__: { __config__: {
name: 'radio',
moduleType: 'choose',
label: '单选框组', label: '单选框组',
labelWidth: null, labelWidth: null,
showLabel: true, showLabel: true,
@ -221,6 +233,8 @@ export const selectComponents = [
{ {
typeId: 'CHECKBOX', typeId: 'CHECKBOX',
__config__: { __config__: {
name: 'checkbox',
moduleType: 'choose',
label: '多选框组', label: '多选框组',
tag: 'el-checkbox-group', tag: 'el-checkbox-group',
tagIcon: 'checkbox', tagIcon: 'checkbox',
@ -255,6 +269,8 @@ export const selectComponents = [
{ {
typeId: 'SWITCH', typeId: 'SWITCH',
__config__: { __config__: {
name: 'switch',
moduleType: 'choose',
label: '开关', label: '开关',
tag: 'el-switch', tag: 'el-switch',
tagIcon: 'switch', tagIcon: 'switch',
@ -284,6 +300,8 @@ export const selectComponents = [
{ {
typeId: 'SLIDER', typeId: 'SLIDER',
__config__: { __config__: {
name: 'slider',
moduleType: 'choose',
label: '滑块', label: '滑块',
tag: 'el-slider', tag: 'el-slider',
tagIcon: 'slider', tagIcon: 'slider',
@ -308,6 +326,8 @@ export const selectComponents = [
{ {
typeId: 'TIME', typeId: 'TIME',
__config__: { __config__: {
name: 'time',
moduleType: 'choose',
label: '时间选择', label: '时间选择',
tag: 'el-time-picker', tag: 'el-time-picker',
tagIcon: 'time', tagIcon: 'time',
@ -335,6 +355,8 @@ export const selectComponents = [
{ {
typeId: 'TIME_RANGE', typeId: 'TIME_RANGE',
__config__: { __config__: {
name: 'timeRange',
moduleType: 'choose',
label: '时间范围', label: '时间范围',
tag: 'el-time-picker', tag: 'el-time-picker',
tagIcon: 'time-range', tagIcon: 'time-range',
@ -361,6 +383,8 @@ export const selectComponents = [
{ {
typeId: 'DATE', typeId: 'DATE',
__config__: { __config__: {
name: 'date',
moduleType: 'choose',
label: '日期选择', label: '日期选择',
tag: 'el-date-picker', tag: 'el-date-picker',
tagIcon: 'date', tagIcon: 'date',
@ -386,6 +410,8 @@ export const selectComponents = [
{ {
typeId: 'DATE_RANGE', typeId: 'DATE_RANGE',
__config__: { __config__: {
name: 'dateRange',
moduleType: 'choose',
label: '日期范围', label: '日期范围',
tag: 'el-date-picker', tag: 'el-date-picker',
tagIcon: 'date-range', tagIcon: 'date-range',
@ -414,6 +440,8 @@ export const selectComponents = [
{ {
typeId: 'RATE', typeId: 'RATE',
__config__: { __config__: {
name: 'rate',
moduleType: 'choose',
label: '评分', label: '评分',
tag: 'el-rate', tag: 'el-rate',
tagIcon: 'rate', tagIcon: 'rate',
@ -439,6 +467,8 @@ export const selectComponents = [
{ {
typeId: 'COLOR', typeId: 'COLOR',
__config__: { __config__: {
name: 'color',
moduleType: 'choose',
label: '颜色选择', label: '颜色选择',
tag: 'el-color-picker', tag: 'el-color-picker',
tagIcon: 'color', tagIcon: 'color',
@ -461,6 +491,8 @@ export const selectComponents = [
{ {
typeId: 'UPLOAD', typeId: 'UPLOAD',
__config__: { __config__: {
name: 'upload',
moduleType: 'choose',
label: '上传', label: '上传',
tag: 'el-upload', tag: 'el-upload',
tagIcon: 'upload', tagIcon: 'upload',
@ -498,6 +530,8 @@ export const imageComponents = [
{ {
typeId: 'IMAGE', typeId: 'IMAGE',
__config__: { __config__: {
name: 'image',
moduleType: 'image',
label: '图片展示', label: '图片展示',
showLabel: false, showLabel: false,
displayType: true, displayType: true,
@ -525,6 +559,8 @@ export const imageComponents = [
{ {
typeId: 'IMAGE_CAROUSEL', typeId: 'IMAGE_CAROUSEL',
__config__: { __config__: {
name: 'imageCarousel',
moduleType: 'image',
label: '图片轮播', label: '图片轮播',
showLabel: false, showLabel: false,
displayType: true, displayType: true,
@ -553,6 +589,8 @@ export const imageComponents = [
{ {
typeId: 'IMAGE_SELECT', typeId: 'IMAGE_SELECT',
__config__: { __config__: {
name: 'imageSelect',
moduleType: 'image',
label: '图片选择', label: '图片选择',
showLabel: true, showLabel: true,
labelWidth: null, labelWidth: null,
@ -583,6 +621,8 @@ export const assistComponents = [
{ {
typeId: 'DESC_TEXT', typeId: 'DESC_TEXT',
__config__: { __config__: {
name: 'descText',
moduleType: 'assist',
label: '文字描述', label: '文字描述',
defaultValue: '描述文字', defaultValue: '描述文字',
displayType: true, displayType: true,
@ -605,6 +645,8 @@ export const assistComponents = [
{ {
typeId: 'DIVIDER', typeId: 'DIVIDER',
__config__: { __config__: {
name: 'divider',
moduleType: 'assist',
label: '分割线', label: '分割线',
defaultValue: '', defaultValue: '',
displayType: true, displayType: true,
@ -628,6 +670,8 @@ export const assistComponents = [
{ {
typeId: 'SIGN_PAD', typeId: 'SIGN_PAD',
__config__: { __config__: {
name: 'signPad',
moduleType: 'assist',
label: '手写签名', label: '手写签名',
defaultValue: '', defaultValue: '',
showLabel: true, showLabel: true,
@ -650,6 +694,8 @@ export const assistComponents = [
{ {
typeId: 'PAGINATION', typeId: 'PAGINATION',
__config__: { __config__: {
name: 'page',
moduleType: 'assist',
label: '分页', label: '分页',
defaultValue: '分页', defaultValue: '分页',
displayType: true, displayType: true,
@ -680,6 +726,8 @@ export const personalInfoComponents = [
{ {
typeId: 'INPUT', typeId: 'INPUT',
__config__: { __config__: {
name: 'phone',
moduleType: 'concat',
label: '手机号', label: '手机号',
labelWidth: null, labelWidth: null,
showLabel: true, showLabel: true,
@ -716,6 +764,8 @@ export const personalInfoComponents = [
{ {
typeId: 'INPUT', typeId: 'INPUT',
__config__: { __config__: {
name: 'email',
moduleType: 'concat',
label: '邮箱', label: '邮箱',
labelWidth: null, labelWidth: null,
showLabel: true, showLabel: true,
@ -752,6 +802,8 @@ export const personalInfoComponents = [
{ {
typeId: 'INPUT', typeId: 'INPUT',
__config__: { __config__: {
name: 'idCard',
moduleType: 'concat',
label: '身份证', label: '身份证',
labelWidth: null, labelWidth: null,
showLabel: true, showLabel: true,
@ -788,6 +840,8 @@ export const personalInfoComponents = [
{ {
typeId: 'PROVINCE_CITY', typeId: 'PROVINCE_CITY',
__config__: { __config__: {
name: 'provinceCity',
moduleType: 'concat',
label: '省市联动', label: '省市联动',
labelWidth: null, labelWidth: null,
showLabel: true, showLabel: true,
@ -808,6 +862,8 @@ export const personalInfoComponents = [
{ {
typeId: 'INPUT_MAP', typeId: 'INPUT_MAP',
__config__: { __config__: {
name: 'location',
moduleType: 'concat',
label: '地理位置', label: '地理位置',
labelWidth: null, labelWidth: null,
showLabel: true, showLabel: true,

4
src/utils/convert.js

@ -17,6 +17,8 @@ import {
*/ */
export function formItemConvertData(item, projectKey) { export function formItemConvertData(item, projectKey) {
let data = { let data = {
'itemKey': item.__config__.name,
'moduleType': item.__config__.moduleType,
'type': item.typeId, 'type': item.typeId,
'formItemId': item.__config__.formId, 'formItemId': item.__config__.formId,
'label': item.__config__.label, 'label': item.__config__.label,
@ -72,6 +74,8 @@ export function dbDataConvertForItemJson(data) {
jsonItem.sort = data.sort jsonItem.sort = data.sort
jsonItem.typeId = data.type jsonItem.typeId = data.type
jsonItem.displayType = data.displayType jsonItem.displayType = data.displayType
jsonItem.__config__.name = data.itemKey
jsonItem.__config__.moduleType = data.moduleType
jsonItem.__config__.span = data.span jsonItem.__config__.span = data.span
jsonItem.__config__.formId = data.formItemId jsonItem.__config__.formId = data.formItemId
jsonItem.__config__.label = data.label jsonItem.__config__.label = data.label

Loading…
Cancel
Save