Commit a872396b authored by 田翔's avatar 田翔

fix: 未分组生成分组逻辑优化,计算规则函数调整

parent 0bf4468b
{
"name": "panda-xform",
"version": "2.1.9",
"description": "2.1.9: 支持树形",
"version": "2.2.0",
"description": "2.2.0: 未分组生成分组逻辑优化,计算规则函数调整",
"keywords": [
"panda-xform"
],
......
......@@ -35,19 +35,22 @@ const FormDesigner = (props, ref) => {
let properties = json?.properties
let parent = {}
let paths = []
let title = '(未分组)'
let ungroupedChild = {}
if (isObject(properties)) {
for (let v in properties) {
if (properties[v].type === 'object') {
parent[v] = properties[v]
if (v !== '未分组') {
if (v !== '(未分组)') {
paths.push(v)
} else {
title = properties[v].title
}
let child = properties[v]?.properties
if (isObject(child)) {
for (let s in child) {
child[s].tableNameParent = tableName
if (v === '未分组') {
if (v === '(未分组)') {
ungroupedChild[s] = child[s]
}
}
......@@ -61,8 +64,8 @@ const FormDesigner = (props, ref) => {
}
}
if (JSON.stringify(ungroupedChild) !== '{}') {
parent['未分组'] = {
title: "(未分组)",
parent['(未分组)'] = {
title: title,
type: "object",
collapsed: false,
groupBase: {},
......@@ -70,7 +73,7 @@ const FormDesigner = (props, ref) => {
...ungroupedChild
}
}
paths.push('未分组')
paths.push('(未分组)')
}
return {
...json,
......
......@@ -8,14 +8,13 @@ import Drag from '../../../../components/Drag'
const { TextArea } = Input
const fnList = [
{ label: '最大值', value: '$math.max()' },
{ label: '最小值', value: '$math.min()' },
{ label: '求和', value: '$math.sum()' },
{ label: '平均值', value: '$math.avg()' },
{ label: '时间差(小时)', value: '$math.datediffhour()' },
{ label: '时间差(天)', value: '$math.datediffday()' },
{ label: '向下取整', value: '$math.ceiling()' },
{ label: '向上取整', value: '$math.floor()' },
{ label: '最大值', value: '$sql.max()' },
{ label: '最小值', value: '$sql.min()' },
{ label: '求和', value: '$sql.sum()' },
{ label: '平均值', value: '$sql.avg()' },
{ label: '时间差', value: '$sql.datediff()' },
{ label: '向下取整', value: '$sql.ceiling()' },
{ label: '向上取整', value: '$sql.floor()' },
]
const CalculateRule = (props) => {
......
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