Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
5fbdea9d
提交
5fbdea9d
authored
10月 28, 2022
作者:
钟是志
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
30429 系统通用功能--数据下钻/打印弹窗--均打开新页面,不要弹窗,太小了
上级
6354e6e4
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
141 行增加
和
120 行删除
+141
-120
encryptApiList.js
one_stop_public/Base16/encryptApiList.js
+3
-0
globalFunction.js
one_stop_public/Table/globalFunction.js
+104
-118
index.js
one_stop_public/libs/formList/index.js
+1
-0
FormModal.jsx
one_stop_public/tableCompon/FormModal.jsx
+16
-1
style.less
one_stop_public/tableCompon/style.less
+17
-1
没有找到文件。
one_stop_public/Base16/encryptApiList.js
浏览文件 @
5fbdea9d
...
...
@@ -147,6 +147,9 @@ const resBinaryApiList = [
{
api
:
'UnifiedAppApi/getDetail'
,
},
{
api
:
'DataColumnApi/getHeaderList'
,
},
{
api
:
'UnifiedServiceApi/getDetail'
,
},
...
...
one_stop_public/Table/globalFunction.js
浏览文件 @
5fbdea9d
...
...
@@ -24,24 +24,19 @@ const apiUrl = queryOauthActionPath();
* 返回值
* rowSpanData 列合并数据,colSpanData行合并数据
* */
export
function
getSpanJson
({
mergeKey
,
data
,
eliminateRow
=
[],
eliminateCol
=
[]
})
{
export
function
getSpanJson
({
mergeKey
,
data
,
eliminateRow
=
[],
eliminateCol
=
[]
})
{
const
dataList
=
deepCopy
(
data
);
let
rowSpanData
,
colSpanData
=
null
;
let
rowSpanData
,
colSpanData
=
null
;
try
{
rowSpanData
=
getRowSpanJson
(
mergeKey
,
dataList
,
eliminateRow
);
}
catch
(
err
)
{
console
.
table
(
"rowSpanData"
,
err
);
console
.
table
(
'rowSpanData'
,
err
);
}
try
{
colSpanData
=
getColSpanJson
(
mergeKey
,
dataList
,
eliminateCol
);
}
catch
(
err
)
{
console
.
table
(
"colSpanData"
,
err
);
console
.
table
(
'colSpanData'
,
err
);
}
return
{
rowSpanData
,
...
...
@@ -191,7 +186,7 @@ export function getColumns(columns) {
}
return
res
;
}
catch
(
e
)
{
console
.
table
(
"getColumnsData"
,
e
);
console
.
table
(
'getColumnsData'
,
e
);
return
false
;
}
}
...
...
@@ -216,7 +211,6 @@ export function getColumns(columns) {
return
maxLevel
;
}
//递归当前数据宽度
function
getColumnsWidth
(
data
=
[],
sum
=
0
)
{
for
(
let
item
of
data
)
{
...
...
@@ -229,18 +223,12 @@ export function getColumns(columns) {
return
sum
;
}
let
columnsHandle
=
getColumnsData
(
columns
)
.
filter
((
v
,
i
)
=>
{
let
columnsHandle
=
getColumnsData
(
columns
).
filter
((
v
,
i
)
=>
{
return
(
v
.
level
<
columnsHeight
&&
v
.
isLast
)
||
v
.
width
>
1
;
});
let
columnsMerges
=
[];
columnsHandle
.
forEach
((
v
,
i
)
=>
{
let
{
isLast
,
width
,
col
,
level
}
=
v
;
let
{
isLast
,
width
,
col
,
level
}
=
v
;
let
nowCol
=
col
-
1
;
let
nowLevel
=
level
-
1
;
if
(
isLast
&&
width
===
1
)
{
...
...
@@ -276,15 +264,11 @@ export function getColumnsSqlKeyRealize({
styles
,
fileName
=
'导出文件'
,
ext
=
'xlsx'
,
allValues
=
JSON
.
stringify
({})
allValues
=
JSON
.
stringify
({}),
})
{
columns
=
deepCopy
(
columns
);
let
{
columnsList
,
columnsMerges
,
columnsKey
}
=
getColumns
(
columns
);
let
{
columnsList
,
columnsMerges
,
columnsKey
}
=
getColumns
(
columns
);
let
content
=
{
sheets
:
[
...
...
@@ -328,7 +312,7 @@ export function getColumnsSqlKeyRealize({
{
content
:
JSON
.
stringify
(
content
),
title
:
fileName
,
allValues
:
allValues
allValues
:
allValues
,
},
`
${
apiUrl
+
'/DataObjApi/exportCustom'
}
`
,
);
...
...
@@ -343,7 +327,7 @@ export function getColumnsSqlKeyRealize({
ext
,
);
}
catch
(
err
)
{
console
.
table
(
"getColumnsSqlKeyRealize"
,
err
);
console
.
table
(
'getColumnsSqlKeyRealize'
,
err
);
}
}
...
...
@@ -407,9 +391,8 @@ export function getColumnsDataRealize({
ext
,
);
}
catch
(
err
)
{
console
.
table
(
"getColumnsDataRealize"
,
err
);
console
.
table
(
'getColumnsDataRealize'
,
err
);
}
}
/**
...
...
@@ -440,20 +423,12 @@ export function getColumnsData({
})
{
columns
=
deepCopy
(
columns
);
data
=
deepCopy
(
data
);
let
{
columnsList
,
columnsMerges
,
columnsKey
,
columnsHeight
}
=
getColumns
(
columns
);
let
{
colSpanData
,
rowSpanData
}
=
getSpanJson
({
let
{
columnsList
,
columnsMerges
,
columnsKey
,
columnsHeight
}
=
getColumns
(
columns
);
let
{
colSpanData
,
rowSpanData
}
=
getSpanJson
({
mergeKey
,
data
,
eliminateRow
,
eliminateCol
eliminateCol
,
});
// 处理数据
let
bodyData
=
[];
...
...
@@ -492,7 +467,7 @@ export function getColumnsData({
});
});
}
catch
(
err
)
{
console
.
table
(
"getColumnsDataRealize"
,
err
);
console
.
table
(
'getColumnsDataRealize'
,
err
);
}
let
content
=
{
sheets
:
[
...
...
@@ -529,58 +504,65 @@ export function getColumnsData({
if
(
styles
)
{
content
.
styles
=
styles
;
}
return
content
return
content
;
}
// ant列表组件合并表格 render属性,合并纵向、横向。
export
function
renderContentAll
(
value
,
row
,
index
,
key
,
spanData
,
cloumnNames
=
[])
{
let
colSpan
,
rowSpan
=
null
;
try
{
colSpan
=
spanData
.
colSpanData
[
key
][
index
];
// 横向合并
rowSpan
=
spanData
.
rowSpanData
[
key
][
index
];
// 纵向合并
colSpan
=
spanData
.
colSpanData
[
key
][
index
];
// 横向合并
rowSpan
=
spanData
.
rowSpanData
[
key
][
index
];
// 纵向合并
}
catch
(
err
)
{
console
.
table
(
"renderContentAll"
,
err
);
console
.
table
(
'renderContentAll'
,
err
);
}
const
obj
=
{
children
:
value
,
props
:
{
rowSpan
:
rowSpan
,
colSpan
:
colSpan
}
colSpan
:
colSpan
,
},
};
return
obj
;
}
// ant列表组件合并表格 render属性,合并纵向。 meanwhileKey :key 是本身字段key,value 是同步的字段key
export
function
renderContentRow
(
value
,
row
,
index
,
key
,
spanData
,
cloumnNames
=
[],
meanwhileKey
=
{})
{
export
function
renderContentRow
(
value
,
row
,
index
,
key
,
spanData
,
cloumnNames
=
[],
meanwhileKey
=
{},
)
{
let
colSpan
,
rowSpan
=
null
;
try
{
if
(
cloumnNames
.
indexOf
(
key
)
!==
-
1
)
{
rowSpan
=
spanData
.
rowSpanData
[
key
][
index
];
// 纵向合并
rowSpan
=
spanData
.
rowSpanData
[
key
][
index
];
// 纵向合并
}
else
{
if
(
key
in
meanwhileKey
&&
meanwhileKey
[
key
])
{
let
meanwhileKeyValue
=
meanwhileKey
[
key
];
rowSpan
=
spanData
.
rowSpanData
[
meanwhileKeyValue
][
index
];
// 同步字段 的纵向合并
rowSpan
=
spanData
.
rowSpanData
[
meanwhileKeyValue
][
index
];
// 同步字段 的纵向合并
}
else
{
rowSpan
=
1
;
}
}
}
catch
(
err
)
{
console
.
table
(
"renderContentRow"
,
err
);
console
.
table
(
'renderContentRow'
,
err
);
}
const
obj
=
{
children
:
value
,
props
:
{
rowSpan
:
rowSpan
,
colSpan
:
1
}
colSpan
:
1
,
},
};
return
obj
;
}
/**
* 表头和数据导出(合并表格)
* templatePath : word文档模板地址
...
...
@@ -625,10 +607,8 @@ export function getWord({
}
catch
(
err
)
{
console
.
table
(
err
);
}
}
/**
* 表头和数据导出(合并表格)
* templatePath : word文档模板地址
...
...
@@ -673,10 +653,8 @@ export function getFileAndShow({
}
catch
(
err
)
{
console
.
table
(
err
);
}
}
/**
* 表头和数据导出(合并表格)
* templatePath : word文档模板地址
...
...
@@ -697,7 +675,7 @@ export function getListWord({
listConfig
=
{},
ext
=
'zip'
,
sonExt
=
'pdf'
,
filesKey
=
[]
filesKey
=
[],
})
{
try
{
let
content
=
[];
...
...
@@ -707,10 +685,8 @@ export function getListWord({
for
(
var
ki
in
filesKey
)
{
let
files_
=
v
[
filesKey
[
ki
]];
try
{
files
=
[...
files
,
...
JSON
.
parse
(
files_
).
files
]
}
catch
(
e
)
{
}
files
=
[...
files
,
...
JSON
.
parse
(
files_
).
files
];
}
catch
(
e
)
{}
delete
paramsObj
[
filesKey
[
ki
]];
}
content
.
push
({
...
...
@@ -719,10 +695,10 @@ export function getListWord({
...
listConfig
,
},
allValues
:
{
...
getObjectsKey
(
allValuesKey
,
paramsObj
)
...
getObjectsKey
(
allValuesKey
,
paramsObj
),
},
title
:
(
paramsObj
[
sonTitleKey
]
||
"未设置名称"
)
+
`.
${
sonExt
}
`
,
files
:
JSON
.
stringify
(
files
)
title
:
(
paramsObj
[
sonTitleKey
]
||
'未设置名称'
)
+
`.
${
sonExt
}
`
,
files
:
JSON
.
stringify
(
files
),
});
});
let
getFileData
=
giveFilePostDataInfoForTrue
(
...
...
@@ -747,31 +723,25 @@ export function getListWord({
}
catch
(
err
)
{
console
.
table
(
err
);
}
function
getObjectsKey
(
listKey
=
[],
params
=
{})
{
return
(
listKey
.
filter
((
key
)
=>
Object
.
keys
(
params
).
indexOf
(
key
))
.
reduce
(
return
listKey
.
filter
((
key
)
=>
Object
.
keys
(
params
).
indexOf
(
key
)).
reduce
(
(
acc
,
key
)
=>
({
...
acc
,
[
key
]:
params
[
key
]
===
null
?
''
:
params
[
key
],
}),
{},
)
)
);
}
}
function
setObjectKey
(
data
)
{
return
(
Object
.
keys
(
data
)
.
reduce
(
return
Object
.
keys
(
data
).
reduce
(
(
acc
,
key
)
=>
({
...
acc
,
[
'${'
+
key
+
'}'
]:
data
[
key
]
===
null
?
''
:
data
[
key
],
}),
{},
)
);
}
...
...
@@ -779,17 +749,21 @@ function setObjectKey(data) {
* 修改对象key
* 支持对象、数组对象
* @param {*} obj 数组对象或者对象
* @param {*} setKey {
"被修改的key":"修改后的key"
}
* @param {*} setKey {
'被修改的key":"修改后的key'
}
* @returns
*/
export
function
upObjKey
(
obj
,
setKey
=
{},
defaultValue
=
""
)
{
export
function
upObjKey
(
obj
,
setKey
=
{},
defaultValue
=
''
)
{
try
{
obj
=
deepCopy
(
obj
);
setKey
=
deepCopy
(
setKey
);
let
objType
=
Object
.
prototype
.
toString
.
call
(
obj
);
if
(
obj
&&
(
objType
.
indexOf
(
"Array"
)
>
-
1
||
objType
.
indexOf
(
"Object"
)
>
-
1
)
&&
Object
.
keys
(
setKey
).
length
>
0
)
{
if
(
obj
&&
(
objType
.
indexOf
(
'Array'
)
>
-
1
||
objType
.
indexOf
(
'Object'
)
>
-
1
)
&&
Object
.
keys
(
setKey
).
length
>
0
)
{
let
nowObj
=
null
;
if
(
objType
===
"[object Object]"
&&
!
Array
.
isArray
(
obj
)
&&
Object
.
keys
(
obj
).
length
>
0
)
{
if
(
objType
===
'[object Object]'
&&
!
Array
.
isArray
(
obj
)
&&
Object
.
keys
(
obj
).
length
>
0
)
{
nowObj
=
deepCopy
(
obj
);
for
(
var
e
in
setKey
)
{
let
upKey
=
setKey
[
e
];
...
...
@@ -797,15 +771,20 @@ export function upObjKey(obj, setKey = {}, defaultValue = "") {
nowObj
=
{
...
nowObj
,
...
getSetKeyJson
({
obj
,
e
,
newKey
,
type
,
timeFormat
,
defaultValue
})
obj
,
e
,
newKey
,
type
,
timeFormat
,
defaultValue
,
}),
};
if
(
e
!=
newKey
)
{
delete
nowObj
[
e
];
}
}
}
if
(
objType
===
"[object Array]"
&&
Array
.
isArray
(
obj
)
&&
obj
.
length
>
0
)
{
if
(
objType
===
'[object Array]'
&&
Array
.
isArray
(
obj
)
&&
obj
.
length
>
0
)
{
nowObj
=
new
Array
();
obj
.
forEach
((
v
,
i
,
arr
)
=>
{
let
newJson
=
deepCopy
(
v
);
...
...
@@ -815,22 +794,27 @@ export function upObjKey(obj, setKey = {}, defaultValue = "") {
newJson
=
{
...
newJson
,
...
getSetKeyJson
({
obj
:
v
,
e
,
newKey
,
type
,
timeFormat
,
defaultValue
})
obj
:
v
,
e
,
newKey
,
type
,
timeFormat
,
defaultValue
,
}),
};
if
(
e
!=
newKey
)
{
delete
newJson
[
e
];
}
}
nowObj
.
push
(
newJson
);
})
});
}
return
nowObj
;
}
else
{
return
null
;
}
}
catch
(
error
)
{
console
.
log
(
"upObjKey"
,
error
);
console
.
log
(
'upObjKey'
,
error
);
return
undefined
;
}
}
...
...
@@ -839,36 +823,35 @@ function getSetKeyValue(value) {
let
valeuType
=
Object
.
prototype
.
toString
.
call
(
value
);
let
newName
=
null
;
let
extendJson
=
{
"type"
:
"string"
type
:
'string'
,
};
if
(
valeuType
===
"[object String]"
)
{
if
(
valeuType
===
'[object String]'
)
{
newName
=
value
;
}
if
(
valeuType
===
"[object Object]"
)
{
newName
=
value
[
"new"
];
delete
value
[
"new"
];
if
(
valeuType
===
'[object Object]'
)
{
newName
=
value
[
'new'
];
delete
value
[
'new'
];
extendJson
=
{
...
extendJson
,
...
value
...
value
,
};
}
return
{
newKey
:
newName
,
...
extendJson
}
...
extendJson
,
};
}
function
getSetKeyJson
({
obj
,
e
,
newKey
,
type
,
timeFormat
=
"YYYY-MM-DD HH:mm:ss"
,
defaultValue
})
{
function
getSetKeyJson
({
obj
,
e
,
newKey
,
type
,
timeFormat
=
'YYYY-MM-DD HH:mm:ss'
,
defaultValue
})
{
obj
=
deepCopy
(
obj
);
let
value
=
obj
[
e
];
let
newKeyObj
=
{};
// delete obj[e];
switch
(
type
)
{
case
"time"
:
debugger
newKeyObj
[
newKey
]
=
(
timeFormat
&&
value
?
moment
(
value
).
format
(
timeFormat
)
:
value
)
||
defaultValue
;
case
'time'
:
debugger
;
newKeyObj
[
newKey
]
=
(
timeFormat
&&
value
?
moment
(
value
).
format
(
timeFormat
)
:
value
)
||
defaultValue
;
break
;
default
:
newKeyObj
[
newKey
]
=
value
||
defaultValue
;
...
...
@@ -876,7 +859,6 @@ function getSetKeyJson({
return
newKeyObj
;
}
// 下载附件FormdataWrapper
function
isObject
(
value
)
{
return
value
===
Object
(
value
);
...
...
@@ -896,13 +878,12 @@ function makeArrayKey(key) {
function
FormdataWrapper
(
obj
,
fd
,
pre
)
{
fd
=
fd
||
new
FormData
();
Object
.
keys
(
obj
)
.
forEach
(
function
(
prop
)
{
Object
.
keys
(
obj
).
forEach
(
function
(
prop
)
{
var
key
=
pre
?
pre
+
'['
+
prop
+
']'
:
prop
;
if
(
isObject
(
obj
[
prop
])
&&
!
isArray
(
obj
[
prop
])
&&
!
isFile
(
obj
[
prop
]))
{
FormdataWrapper
(
obj
[
prop
],
fd
,
key
);
}
else
if
(
isArray
(
obj
[
prop
]))
{
obj
[
prop
].
forEach
(
function
(
value
)
{
obj
[
prop
].
forEach
(
function
(
value
)
{
var
arrayKey
=
makeArrayKey
(
key
);
if
(
isObject
(
value
)
&&
!
isFile
(
value
))
{
FormdataWrapper
(
value
,
fd
,
arrayKey
);
...
...
@@ -960,7 +941,6 @@ export async function downloadFile(url, params, fileName = '导出文件', ext =
});
}
export
async
function
downloadFileAndShowModal
(
url
,
params
,
fileName
=
'导出文件'
,
ext
=
'xlsx'
)
{
// console.log("downloadFile",url);
const
{
transformApi
,
headersApi
}
=
await
getTransformApi
(
url
);
...
...
@@ -991,20 +971,26 @@ export async function downloadFileAndShowModal(url, params, fileName = '导出
https://view.officeapps.live.com/op/view.aspx?src=
https%3A%2F%2Fwww.longchang.gov.cn%2Flcs%2Fgsgg%2F202207%2F3ae45ccac65d40d885f40ec385ae287a%2Ffiles%2F%25E9%259A%2586%25E6%2598%258C%25E5%25B8%2582%25E7%25AC%25AC%25E5%2585%25AB%25E4%25B8%25AD%25E5%25AD%25A6%25E5%258E%2595%25E6%2589%2580%25E6%2594%25B9%25E9%2580%25A0%25E9%25A1%25B9%25E7%259B%25AE%25E5%2585%25AC%25E5%2591%258A.doc&wdOrigin=BROWSELINK
* */
window
.
open
(
url
);
return
;
Modal
.
info
({
title
:
filename
,
width
:
1000
,
content
:
<
div
>
<
embed
width
=
'100%'
height
=
'568px'
name
=
'plugin'
id
=
'pdfView'
content
:
(
<
div
>
<
embed
width
=
"100%"
height
=
"568px"
name
=
"plugin"
id
=
"pdfView"
src
=
{
url
}
type
=
'application/pdf'
internalinstanceid
=
'3'
title
=
{
filename
}
/
>
<
/div>
,
type
=
"application/pdf"
internalinstanceid
=
"3"
title
=
{
filename
}
/
>
<
/div
>
),
okText
:
'确定'
,
onCancel
:
()
=>
{
window
.
URL
.
revokeObjectURL
(
url
);
...
...
one_stop_public/libs/formList/index.js
浏览文件 @
5fbdea9d
...
...
@@ -1456,6 +1456,7 @@ class FormList extends React.Component {
onSelectRow
=
{
this
.
handleSelectRows
}
onChange
=
{
this
.
handleStandardTableChange
}
loading
=
{
loading
}
getCheckboxProps
=
{
this
.
props
.
getCheckboxProps
||
undefined
}
/
>
)}
<
/div
>
...
...
one_stop_public/tableCompon/FormModal.jsx
浏览文件 @
5fbdea9d
import
React
,
{
}
from
'react'
;
import
React
from
'react'
;
import
{
Button
}
from
'antd'
;
import
{
getModal
}
from
'@/webPublic/one_stop_public/utils/utils'
;
import
styles
from
'./style.less'
const
Modal
=
getModal
();
export
default
class
FormModal
extends
React
.
Component
{
render
()
{
const
showFullScreen
=
()
=>
{
let
dom
=
document
.
getElementById
(
'smartFormModal'
);
dom
.
requestFullscreen
();
console
.
log
(
dom
);
};
return
(
<
Modal
bodyStyle=
{
{
...
...
@@ -19,7 +27,14 @@ export default class FormModal extends React.Component {
visible=
{
this
.
props
.
visible
}
footer=
{
null
}
onCancel=
{
this
.
props
.
handleCancel
}
>
{
this
.
props
.
showFullScreen
&&
(
<
Button
type=
{
'primary'
}
onClick=
{
showFullScreen
}
>
全屏查看
</
Button
>
)
}
<
div
id=
{
'smartFormModal'
}
className=
{
styles
.
fullScreen
}
>
{
this
.
props
.
children
}
</
div
>
</
Modal
>
);
}
...
...
one_stop_public/tableCompon/style.less
浏览文件 @
5fbdea9d
.fullScreen {
&:-webkit-full-screen {
width: 100%;
height: 100%;
padding: 100px;
background-color: #fff;
}
//&:div[data-page-formkey]{
// overflow: hidden;
//}
}
:global {
// table{
// border-collapse:collapse;
// }
#web_table .ant-form-item {
margin-bottom: 2.5px;
margin-top: 2.5px;
...
...
@@ -290,7 +305,8 @@
min-height: 50px;
}
}
.bigTitle{
.bigTitle {
text-align: center;
font-size: 18px;
margin-bottom: 20px;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论