Browse Source

问卷组件添加名称及所属分类

old
jianjun 4 years ago
parent
commit
6dd0ee31bc
  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',
__config__: {
name: 'input',
moduleType: 'input',
label: '单行文本',
labelWidth: null,
showLabel: true,
@ -55,6 +57,8 @@ export const inputComponents = [
{
typeId: 'TEXTAREA',
__config__: {
name: 'textarea',
moduleType: 'input',
label: '多行文本',
labelWidth: null,
showLabel: true,
@ -83,6 +87,8 @@ export const inputComponents = [
{
typeId: 'NUMBER_INPUT',
__config__: {
name: 'number',
moduleType: 'input',
label: '计数器',
showLabel: true,
changeTag: true,
@ -112,6 +118,8 @@ export const selectComponents = [
{
typeId: 'SELECT',
__config__: {
name: 'select',
moduleType: 'choose',
label: '下拉选择',
showLabel: true,
labelWidth: null,
@ -143,6 +151,8 @@ export const selectComponents = [
{
typeId: 'CASCADER',
__config__: {
name: 'cascader',
moduleType: 'choose',
label: '级联选择',
url: 'https://www.fastmock.site/mock/f8d7a54fb1e60561e2f720d5a810009d/fg/cascaderList',
method: 'get',
@ -189,6 +199,8 @@ export const selectComponents = [
{
typeId: 'RADIO',
__config__: {
name: 'radio',
moduleType: 'choose',
label: '单选框组',
labelWidth: null,
showLabel: true,
@ -221,6 +233,8 @@ export const selectComponents = [
{
typeId: 'CHECKBOX',
__config__: {
name: 'checkbox',
moduleType: 'choose',
label: '多选框组',
tag: 'el-checkbox-group',
tagIcon: 'checkbox',
@ -255,6 +269,8 @@ export const selectComponents = [
{
typeId: 'SWITCH',
__config__: {
name: 'switch',
moduleType: 'choose',
label: '开关',
tag: 'el-switch',
tagIcon: 'switch',
@ -281,6 +297,8 @@ export const selectComponents = [
{
typeId: 'SLIDER',
__config__: {
name: 'slider',
moduleType: 'choose',
label: '滑块',
tag: 'el-slider',
tagIcon: 'slider',
@ -305,6 +323,8 @@ export const selectComponents = [
{
typeId: 'TIME',
__config__: {
name: 'time',
moduleType: 'choose',
label: '时间选择',
tag: 'el-time-picker',
tagIcon: 'time',
@ -332,6 +352,8 @@ export const selectComponents = [
{
typeId: 'TIME_RANGE',
__config__: {
name: 'timeRange',
moduleType: 'choose',
label: '时间范围',
tag: 'el-time-picker',
tagIcon: 'time-range',
@ -358,6 +380,8 @@ export const selectComponents = [
{
typeId: 'DATE',
__config__: {
name: 'date',
moduleType: 'choose',
label: '日期选择',
tag: 'el-date-picker',
tagIcon: 'date',
@ -383,6 +407,8 @@ export const selectComponents = [
{
typeId: 'DATE_RANGE',
__config__: {
name: 'dateRange',
moduleType: 'choose',
label: '日期范围',
tag: 'el-date-picker',
tagIcon: 'date-range',
@ -411,6 +437,8 @@ export const selectComponents = [
{
typeId: 'RATE',
__config__: {
name: 'rate',
moduleType: 'choose',
label: '评分',
tag: 'el-rate',
tagIcon: 'rate',
@ -435,6 +463,8 @@ export const selectComponents = [
{
typeId: 'COLOR',
__config__: {
name: 'color',
moduleType: 'choose',
label: '颜色选择',
tag: 'el-color-picker',
tagIcon: 'color',
@ -457,6 +487,8 @@ export const selectComponents = [
{
typeId: 'UPLOAD',
__config__: {
name: 'upload',
moduleType: 'choose',
label: '上传',
tag: 'el-upload',
tagIcon: 'upload',
@ -494,6 +526,8 @@ export const imageComponents = [
{
typeId: 'IMAGE',
__config__: {
name: 'image',
moduleType: 'image',
label: '图片展示',
showLabel: false,
displayType: true,
@ -521,6 +555,8 @@ export const imageComponents = [
{
typeId: 'IMAGE_CAROUSEL',
__config__: {
name: 'imageCarousel',
moduleType: 'image',
label: '图片轮播',
showLabel: false,
displayType: true,
@ -549,6 +585,8 @@ export const imageComponents = [
{
typeId: 'IMAGE_SELECT',
__config__: {
name: 'imageSelect',
moduleType: 'image',
label: '图片选择',
showLabel: true,
labelWidth: null,
@ -579,6 +617,8 @@ export const assistComponents = [
{
typeId: 'DESC_TEXT',
__config__: {
name: 'descText',
moduleType: 'assist',
label: '文字描述',
defaultValue: '描述文字',
displayType: true,
@ -601,6 +641,8 @@ export const assistComponents = [
{
typeId: 'DIVIDER',
__config__: {
name: 'divider',
moduleType: 'assist',
label: '分割线',
defaultValue: '',
displayType: true,
@ -624,6 +666,8 @@ export const assistComponents = [
{
typeId: 'SIGN_PAD',
__config__: {
name: 'signPad',
moduleType: 'assist',
label: '手写签名',
defaultValue: '',
showLabel: true,
@ -646,6 +690,8 @@ export const assistComponents = [
{
typeId: 'PAGINATION',
__config__: {
name: 'page',
moduleType: 'assist',
label: '分页',
defaultValue: '分页',
displayType: true,
@ -676,6 +722,8 @@ export const personalInfoComponents = [
{
typeId: 'INPUT',
__config__: {
name: 'phone',
moduleType: 'concat',
label: '手机号',
labelWidth: null,
showLabel: true,
@ -712,6 +760,8 @@ export const personalInfoComponents = [
{
typeId: 'INPUT',
__config__: {
name: 'email',
moduleType: 'concat',
label: '邮箱',
labelWidth: null,
showLabel: true,
@ -748,6 +798,8 @@ export const personalInfoComponents = [
{
typeId: 'INPUT',
__config__: {
name: 'idCard',
moduleType: 'concat',
label: '身份证',
labelWidth: null,
showLabel: true,
@ -784,6 +836,8 @@ export const personalInfoComponents = [
{
typeId: 'PROVINCE_CITY',
__config__: {
name: 'provinceCity',
moduleType: 'concat',
label: '省市联动',
labelWidth: null,
showLabel: true,
@ -804,6 +858,8 @@ export const personalInfoComponents = [
{
typeId: 'INPUT_MAP',
__config__: {
name: 'location',
moduleType: 'concat',
label: '地理位置',
labelWidth: null,
showLabel: true,

4
src/utils/convert.js

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

Loading…
Cancel
Save