Commit a872396b authored by 田翔's avatar 田翔

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

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