Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
ca6a992d
提交
ca6a992d
authored
5月 11, 2021
作者:
钟是志
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
18689 就业-协议书违约管理-协议书违约查询-院系,自定义统计-聚合条件问题
删减部分代码. Array.splice 第二个参数的bug
上级
bf922ed1
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
42 行增加
和
106 行删除
+42
-106
config.js
one_stop_public/App/StatisticsInfo/config.js
+14
-0
index.js
one_stop_public/App/StatisticsInfo/index.js
+28
-106
没有找到文件。
one_stop_public/App/StatisticsInfo/config.js
0 → 100644
浏览文件 @
ca6a992d
const
nameSpan
=
{
small
:
9
,
big
:
7
,
};
const
nameSpan2
=
{
small
:
0
,
big
:
0
,
};
const
nameSpan3
=
{
small
:
3
,
big
:
2
,
};
export
{
nameSpan
,
nameSpan3
,
nameSpan2
};
one_stop_public/App/StatisticsInfo.js
→
one_stop_public/App/StatisticsInfo
/index
.js
浏览文件 @
ca6a992d
import
React
from
'react'
;
import
ReactDOM
from
'react-dom'
;
import
{
Select
,
Button
,
Modal
,
Input
,
Table
,
Row
,
Col
,
Tag
,
Form
,
message
,
notification
}
from
'antd'
;
import
{
Select
,
Modal
,
Table
,
Row
,
Col
,
Tag
,
Form
,
message
,
notification
}
from
'antd'
;
import
{
connect
}
from
'dva'
;
import
{
getToken
}
from
'../utils/token'
import
{
getToken
}
from
'../
../
utils/token'
import
config
from
'@/webPublic/one_stop_public/config'
;
import
QueryItem
from
'./QueryItem'
;
import
OrderItem
from
'./OrderItem'
;
import
styles
from
'./Ability.css'
;
import
FormdataWrapper
from
'../utils/object-to-formdata-custom'
;
import
ButtonDiy
from
'./ButtonDiy/ButtonDiy'
;
import
QueryItem
from
'../QueryItem'
;
import
styles
from
'../Ability.css'
;
import
FormdataWrapper
from
'../../utils/object-to-formdata-custom'
;
import
ButtonDiy
from
'../ButtonDiy/ButtonDiy'
;
import
{
nameSpan
,
nameSpan3
,
nameSpan2
}
from
'./config'
;
const
Option
=
Select
.
Option
;
const
nameSpan
=
{
small
:
9
,
big
:
7
,
};
const
nameSpan2
=
{
small
:
0
,
big
:
0
,
};
const
nameSpan3
=
{
small
:
3
,
big
:
2
,
};
var
keyX
=
1
;
function
swapArray
(
arr
,
index1
,
index2
)
{
arr
[
index1
]
=
arr
.
splice
(
index2
,
1
,
arr
[
index1
])[
0
];
return
arr
;
}
const
FormItem
=
Form
.
Item
;
@
connect
(({
cms
,
loading
})
=>
({
...
...
@@ -49,7 +28,6 @@ export default class StatisticsInfo extends React.Component {
currentQueryKey
:
null
,
currentGroupKey
:
null
,
orderVisiable
:
false
,
groupVisiable
:
false
,
currentOrderKey
:
null
,
querys
:
[],
orders
:
[],
...
...
@@ -79,28 +57,26 @@ export default class StatisticsInfo extends React.Component {
};
deleteQuery
=
(
i
)
=>
{
const
querys
=
this
.
state
.
querys
;
querys
.
splice
(
i
);
querys
.
splice
(
i
,
1
);
this
.
setState
({
querys
});
};
deleteOrder
=
(
i
)
=>
{
const
orders
=
this
.
state
.
orders
;
orders
.
splice
(
i
);
orders
.
splice
(
i
,
1
);
this
.
setState
({
orders
});
};
deleteGroup
=
(
i
)
=>
{
const
groups
=
this
.
state
.
groups
;
groups
.
splice
(
i
);
groups
.
splice
(
i
,
1
);
this
.
setState
(
{
groups
groups
:
[...
groups
],
},
()
=>
{
this
.
finish
();
});
};
open
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'DataObj/getExportInfo'
,
payload
:
{
...
...
@@ -164,12 +140,6 @@ export default class StatisticsInfo extends React.Component {
this
.
setState
({
targetKeys
});
};
addOrder
=
()
=>
{
this
.
setState
({
orderVisiable
:
true
});
};
okOrder
=
()
=>
{
const
orders
=
this
.
state
.
orders
;
orders
.
push
(
this
.
state
.
infos
[
this
.
state
.
currentOrderKey
]);
...
...
@@ -192,11 +162,7 @@ export default class StatisticsInfo extends React.Component {
});
};
addGroup
=
()
=>
{
this
.
setState
({
groupVisiable
:
true
});
};
addQuery
=
()
=>
{
this
.
setState
({
queryVisiable
:
true
});
...
...
@@ -217,11 +183,11 @@ export default class StatisticsInfo extends React.Component {
const
{
x
,
y
,
z
,
infos
,
XxX
,
currentKey
,
groups
}
=
this
.
state
;
if
(
x
==
null
)
{
message
.
error
(
'请选择第一统计项'
);
message
.
warning
(
'请选择第一统计项'
);
return
;
}
if
(
y
==
null
)
{
message
.
error
(
'请选择行数据'
);
message
.
warning
(
'请选择行数据'
);
return
;
}
this
.
props
.
form
.
validateFields
((
err
,
fieldsValue
)
=>
{
...
...
@@ -230,9 +196,7 @@ export default class StatisticsInfo extends React.Component {
const
ggs
=
[];
for
(
var
key
in
fieldsValue
)
{
var
xx
=
key
.
indexOf
(
"__"
)
let
kk
=
key
.
substr
(
xx
+
2
);
qqs
.
push
({
notes
:
this
.
state
.
infos
[
kk
].
notes
,
hql
:
this
.
state
.
infos
[
kk
].
hql
,
...
...
@@ -240,12 +204,10 @@ export default class StatisticsInfo extends React.Component {
x
:
fieldsValue
[
key
].
stringX
,
v
:
fieldsValue
[
key
].
string
,
});
}
if
(
groups
.
length
===
0
)
{
message
.
error
(
'请至少选择一个聚合条件'
);
message
.
warning
(
'请至少选择一个聚合条件'
);
return
;
}
...
...
@@ -254,7 +216,6 @@ export default class StatisticsInfo extends React.Component {
}
const
tx
=
infos
[
x
]
const
ty
=
infos
[
y
]
var
ttx
;
var
tty
;
var
ttz
;
...
...
@@ -295,7 +256,6 @@ export default class StatisticsInfo extends React.Component {
y
:
tty
,
z
:
ttz
,
objId
,
xXx
:
XxX
,
hql
:
currentKey
&&
infos
[
currentKey
]
?
infos
[
currentKey
].
hql
:
null
,
querys
:
JSON
.
stringify
(
qqs
),
...
...
@@ -304,17 +264,13 @@ export default class StatisticsInfo extends React.Component {
callback
:
(
data
)
=>
{
this
.
setState
({
dataSource
:
data
.
dataSource
,
columns
:
data
.
columns
});
},
});
});
};
downloadFile
(
url
,
params
)
{
this
.
setState
({
exportLoading
:
true
});
fetch
(
url
,
{
method
:
'POST'
,
body
:
FormdataWrapper
(
params
)
...
...
@@ -356,11 +312,11 @@ export default class StatisticsInfo extends React.Component {
const
{
x
,
y
,
z
,
infos
,
XxX
,
currentKey
,
groups
}
=
this
.
state
;
if
(
x
==
null
)
{
message
.
error
(
'请选择第一统计项'
);
message
.
warning
(
'请选择第一统计项'
);
return
;
}
if
(
y
==
null
)
{
message
.
error
(
'请选择行数据'
);
message
.
warning
(
'请选择行数据'
);
return
;
}
this
.
props
.
form
.
validateFields
((
err
,
fieldsValue
)
=>
{
...
...
@@ -384,7 +340,7 @@ export default class StatisticsInfo extends React.Component {
}
if
(
groups
.
length
===
0
)
{
message
.
error
(
'请至少选择一个聚合条件'
);
message
.
warning
(
'请至少选择一个聚合条件'
);
return
;
}
...
...
@@ -503,13 +459,11 @@ export default class StatisticsInfo extends React.Component {
};
componentDidMount
()
{
//
this.open();
this
.
open
();
}
pageConfig
=
(
item
=
0
)
=>
{
const
{
visiable
,
queryVisiable
,
querys
,
groups
,
currentKey
,
...
...
@@ -517,17 +471,13 @@ export default class StatisticsInfo extends React.Component {
infos
,
mockData
,
mockXZData
,
columns
,
dataSource
,
qs
,
os
,
gs
,
x
,
y
,
z
,
currentQueryKey
,
currentGroupKey
,
groupVisiable
,
}
=
this
.
state
;
let
xxxs
=
[];
if
(
currentKey
!=
null
)
{
...
...
@@ -557,7 +507,6 @@ export default class StatisticsInfo extends React.Component {
}
let
optionGs
=
[];
for
(
let
item
of
gs
)
{
let
add
=
true
;
for
(
let
i
=
0
;
i
<
groups
.
length
;
i
++
)
{
...
...
@@ -780,8 +729,8 @@ export default class StatisticsInfo extends React.Component {
const
{
form
,
loading
}
=
this
.
props
;
const
{
visiable
,
querys
,
groups
,
currentKey
,
XxX
,
exportLoading
,
infos
,
mockData
,
columns
,
dataSource
,
qs
,
os
,
gs
,
x
,
y
,
z
,
currentQueryKey
,
currentGroupKey
,
groupVisiable
,
visiable
,
querys
,
groups
,
exportLoading
,
infos
,
columns
,
dataSource
,
x
,
y
,
z
,
}
=
this
.
state
;
const
loadingxxx
=
loading
||
exportLoading
;
let
columnsTemp
=
columns
;
...
...
@@ -801,19 +750,7 @@ export default class StatisticsInfo extends React.Component {
columnsTemp
[
0
].
width
=
200
;
}
}
let
xxxs
=
[];
if
(
currentKey
!=
null
)
{
if
(
infos
[
currentKey
].
type
===
'java.lang.Integer'
||
infos
[
currentKey
].
type
===
'java.lang.Double'
||
infos
[
currentKey
].
type
===
'java.lang.Long'
)
{
xxxs
=
[{
label
:
'数量'
,
value
:
'count'
},
{
label
:
'最大值'
,
value
:
'max'
},
{
label
:
'最小值'
,
value
:
'min'
,
},
{
label
:
'平均值'
,
value
:
'avg'
},
{
label
:
'求和'
,
value
:
'sum'
}];
}
else
{
xxxs
=
[{
label
:
'数量'
,
value
:
'count'
}];
}
}
return
(
<
span
>
{
/* 暂时屏蔽 */
}
...
...
@@ -835,11 +772,11 @@ export default class StatisticsInfo extends React.Component {
onCancel
=
{
this
.
onCancle
}
>
{
this
.
selectDom
(
0
)}
{
this
.
selectDom
(
1
)}
{
this
.
selectDom
(
2
)}
{
this
.
selectDom
(
3
)}
{
this
.
selectDom
(
4
)}
{
this
.
selectDom
(
0
)}
{
/*第一统计项*/
}
{
this
.
selectDom
(
1
)}
{
/*第二统计项*/
}
{
this
.
selectDom
(
2
)}
{
/*行数据*/
}
{
this
.
selectDom
(
3
)}
{
/*统计指标*/
}
{
this
.
selectDom
(
4
)}
{
/*查询条件*/
}
<
div
style
=
{{
textAlign
:
'left'
,
paddingLeft
:
'25px'
,
...
...
@@ -873,7 +810,7 @@ export default class StatisticsInfo extends React.Component {
deleteQuery
=
{
this
.
deleteQuery
.
bind
(
this
,
i
)}
/>
)
}
<
/FormItem>
)
}
<
/div
>
{
this
.
selectDom
(
5
)}
{
this
.
selectDom
(
5
)}
{
/*聚合条件*/
}
<
Row
style
=
{{
textAlign
:
'left'
,
paddingLeft
:
'80px'
,
...
...
@@ -882,7 +819,7 @@ export default class StatisticsInfo extends React.Component {
{
groups
.
map
((
r
,
i
)
=>
<
Tag
closable
=
{
true
}
key
=
{
i
+
r
.
field
}
onC
hang
e
=
{
this
.
deleteGroup
.
bind
(
this
,
i
)}
>
onC
los
e
=
{
this
.
deleteGroup
.
bind
(
this
,
i
)}
>
{
'按'
+
r
.
name
+
'聚合'
}
<
/Tag>
,
)}
...
...
@@ -895,15 +832,6 @@ export default class StatisticsInfo extends React.Component {
<
ButtonDiy
handleClick
=
{
this
.
export
}
name
=
{
'导出'
}
loading
=
{
loadingxxx
}
/
>
{
/* <Button type="primary"
onClick={this.finish}>
查询
</Button>
<Button type="primary"
onClick={this.finish}>
导出
</Button>
结果:*/
}
<
/Col
>
<
Col
span
=
{
24
}
style
=
{{
...
...
@@ -918,12 +846,6 @@ export default class StatisticsInfo extends React.Component {
columns
=
{
columnsTemp
}
scroll
=
{{
x
:
'max-content'
}}
pagination
=
{
false
}
/
>
{
/*{columns.length > 0 ?*/
}
{
/*<Table size="small"*/
}
{
/*bordered*/
}
{
/*dataSource={dataSource}*/
}
{
/*columns={columnsTemp}*/
}
{
/*pagination={false} /> : ''}*/
}
<
/Col
>
<
/Row
>
<
/Modal
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论