Commit 8146c7dd authored by 田翔's avatar 田翔

fix: 描述控件修复

parent 58c37e5e
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "6.0.0", "version": "6.0.1",
"description": "6.0.0 图片显示问题", "description": "6.0.1 描述控件修复",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -30,7 +30,6 @@ import html2canvas from 'html2canvas'; ...@@ -30,7 +30,6 @@ import html2canvas from 'html2canvas';
import jsPDF from 'jspdf'; import jsPDF from 'jspdf';
import { saveAs } from 'file-saver'; import { saveAs } from 'file-saver';
import FormRender from '../FormRender'; import FormRender from '../FormRender';
import { set } from 'lodash';
const initConfig = { const initConfig = {
accountFieids: [], accountFieids: [],
...@@ -381,7 +380,9 @@ const Account = (props, ref) => { ...@@ -381,7 +380,9 @@ const Account = (props, ref) => {
} else { } else {
getConfig({ accountName }); getConfig({ accountName });
} }
getTree(); if (superAccount) {
getTree()
}
}, []); }, []);
const items = ( const items = (
......
...@@ -43,7 +43,7 @@ const layoutWidgets = [ ...@@ -43,7 +43,7 @@ const layoutWidgets = [
name: '描述控件', name: '描述控件',
icon: <IconPack.SearchLocation />, icon: <IconPack.SearchLocation />,
schema: { schema: {
title: '描述控件', title: '',
type: 'html', type: 'html',
widget: 'TextHTML', widget: 'TextHTML',
placeholder: '', placeholder: '',
......
...@@ -51,7 +51,8 @@ const FormDesigner = (props, ref) => { ...@@ -51,7 +51,8 @@ const FormDesigner = (props, ref) => {
let ungroupedChild = {} let ungroupedChild = {}
if (isObject(properties)) { if (isObject(properties)) {
for (let v in properties) { for (let v in properties) {
if (properties[v].type === 'object') { //分组或者描述控件
if (properties[v].type === 'object' || properties[v].type === 'html') {
parent[v] = properties[v] parent[v] = properties[v]
if (v !== '(未分组)') { if (v !== '(未分组)') {
paths.push(v) paths.push(v)
...@@ -260,7 +261,10 @@ const FormDesigner = (props, ref) => { ...@@ -260,7 +261,10 @@ const FormDesigner = (props, ref) => {
if (isObject(child)) { if (isObject(child)) {
let childObj = {} let childObj = {}
for (let s in child) { for (let s in child) {
if (child[s].type !== 'object') { if (child[s].type === 'html') {
outError = true
}
if (child[s].type !== 'object' && child[s].type !== 'html') {
array.push({ ...child[s], fieldName: s }) array.push({ ...child[s], fieldName: s })
childObj[s] = child[s] childObj[s] = child[s]
} else { } else {
...@@ -276,6 +280,8 @@ const FormDesigner = (props, ref) => { ...@@ -276,6 +280,8 @@ const FormDesigner = (props, ref) => {
} }
parentObj[v].properties = childObj parentObj[v].properties = childObj
} }
} else if (parent[v].type === 'html') {
parentObj[v] = parent[v]
} else { } else {
outError = true outError = true
let nanoid = getNanoid() let nanoid = getNanoid()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment