Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
6931c086
提交
6931c086
authored
4月 04, 2023
作者:
钟是志
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
ef3b2f6d
652e416d
显示空白字符变更
内嵌
并排
正在显示
39 个修改的文件
包含
526 行增加
和
99 行删除
+526
-99
index.js
FormInsertDiy/AffairPage/ApplyPage/index.js
+2
-9
List.js
FormInsertDiy/AffairPage/AuditPage/List.js
+0
-1
index.js
FormInsertDiy/AffairPage/AuditPage/index.js
+0
-4
QueryItem.js
FormInsertDiy/Export/QueryItem.js
+0
-1
ActiveMenuComponent.js
FormInsertDiy/ExportComponent/ActiveMenuComponent.js
+0
-1
CheckRecord.js
FormInsertDiy/ExportComponent/CheckRecord.js
+0
-2
CheckRecordMerge.js
FormInsertDiy/ExportComponent/CheckRecordMerge.js
+0
-2
SassOnestopComponent.js
FormInsertDiy/ExportComponent/SassOnestopComponent.js
+89
-0
Authorized.js
one_stop_public/2023yunshangguizhou/Authorized.js
+34
-0
DiyIframeModal.js
one_stop_public/2023yunshangguizhou/DiyIframeModal.js
+80
-0
SplitBase16Index.js
one_stop_public/Base16/SplitBase16Index.js
+0
-4
DetailSplit.js
one_stop_public/DetailForAudit/DetailSplit.js
+56
-14
IframeForDetail.js
one_stop_public/DetailForAudit/IframeForDetail.js
+1
-0
Content.js
...lic/DetailForAudit/components/FlowExamineModal/Content.js
+9
-19
Image.js
...ublic/DetailForAudit/components/FlowExamineModal/Image.js
+0
-1
index.js
...ublic/DetailForAudit/components/FlowExamineModal/index.js
+1
-3
FlowDetailPanel.js
.../ggEditor/components/EditorDetailPanel/FlowDetailPanel.js
+0
-1
splitDetailSplit.js
one_stop_public/DetailForAudit/splitDetailSplit.js
+0
-1
ZdyTable.jsx
one_stop_public/Table/ZdyTable.jsx
+2
-0
giveSmartFormGlobalProps.js
one_stop_public/Table/giveSmartFormGlobalProps.js
+11
-0
ChildForm.jsx
one_stop_public/libs/ChildForm.jsx
+0
-3
LocationCom.js
one_stop_public/libs/LocationCom.js
+0
-1
MobileDate.jsx
one_stop_public/libs/MobileDate.jsx
+0
-3
PictureSignature.js
one_stop_public/libs/PictureSignature/PictureSignature.js
+0
-6
TableSelectZhanWei.js
one_stop_public/libs/Split/TableSelectZhanWei.js
+0
-2
index.jsx
one_stop_public/location/index.jsx
+0
-1
RangePickerDiy.js
one_stop_public/tableCompon/Split_Index/RangePickerDiy.js
+0
-4
queryConfig.js
one_stop_public/utils/queryConfig.js
+0
-1
SplitBasicLayout.js
zyd_private/BasicLayout/SplitBasicLayout.js
+15
-1
sortMenusByPriority.js
zyd_private/BasicLayout/sortMenusByPriority.js
+0
-2
ReactComponent.js
zyd_public/WangEditor/WangEditor5/ReactComponent.js
+0
-4
RefactoringOld.js
zyd_public/components/DraggableSetting/RefactoringOld.js
+0
-2
index3.0.js
zyd_public/components/DraggableSetting/index3.0.js
+0
-3
EditDrawer.js
zyd_public/components/lowCodeEdit/EditDrawer.js
+2
-1
request.js
zyd_public/request/request.js
+6
-1
fetchData.ts
zyd_public/requestJson/fetchData.ts
+30
-0
requestJson.js
zyd_public/requestJson/requestJson.js
+178
-0
getSchoolType.js
zyd_public/utils/getSchoolType.js
+3
-0
setTokenAndInitSystem.js
zyd_public/utils/setTokenAndInitSystem.js
+7
-1
没有找到文件。
FormInsertDiy/AffairPage/ApplyPage/index.js
浏览文件 @
6931c086
...
...
@@ -20,7 +20,6 @@ import ButtonDiy from '@/baseComponent/ButtonDiy';
import
Shell
from
'@/baseComponent/Shell'
;
import
{
deepCopy
,
getIsBei_Dian
}
from
'@/webPublic/zyd_public/utils/utils'
;
import
ApplyForZyd
from
'@/webPublic/one_stop_public/ForZydApply/index'
;
import
{
uaaRequest
}
from
'@/webPublic/one_stop_public/utils/request'
;
import
rebackButton
from
'@/webPublic/FormInsertDiy/AffairPage/ApplyPage/ReBackButton'
;
export
default
function
index
(
props
)
{
...
...
@@ -49,7 +48,7 @@ class AffairPage extends React.Component {
constructor
(
props
)
{
super
(
props
);
let
pathname
=
this
.
props
.
location
.
pathname
;
const
{
dataBaseId
,
workId
}
=
this
.
props
;
const
{
workId
}
=
this
.
props
;
this
.
state
=
{
showIframe
:
false
,
columns
:
[],
...
...
@@ -66,7 +65,6 @@ class AffairPage extends React.Component {
getServiceDetail
=
(
serviceId
)
=>
{
service
.
getServiceDetail
(
serviceId
).
then
((
res
)
=>
{
console
.
log
(
res
);
this
.
setState
({
serviceInfo
:
res
,
});
...
...
@@ -258,7 +256,6 @@ class AffairPage extends React.Component {
this
.
returnList
(
true
);
}
if
(
event
&&
event
.
data
&&
event
.
data
.
indexOf
&&
event
.
data
.
indexOf
(
'iframeHeight'
)
>
-
1
)
{
console
.
log
(
event
.
data
);
let
height
=
Number
(
event
.
data
.
split
(
'-'
)[
1
]);
const
iframe
=
document
.
getElementById
(
'applyIframeId'
);
if
(
iframe
)
{
...
...
@@ -278,13 +275,11 @@ class AffairPage extends React.Component {
componentDidUpdate
(
prevProps
,
prevState
)
{
if
(
prevProps
.
workId
!==
this
.
props
.
workId
)
{
// console.log('123123', prevProps, this.props);
this
.
initData
();
}
}
returnList
=
(
needSearchList
=
false
)
=>
{
console
.
log
(
needSearchList
);
const
{
workId
}
=
this
.
state
;
this
.
setState
(
{
...
...
@@ -317,9 +312,7 @@ class AffairPage extends React.Component {
if
(
!
workId
||
!
allConfigSetInfo
)
{
return
null
;
}
// console.log(allConfigSetInfo.isCloseStart);
// const url = config.onestopPC.split('/#/');
// let iframeUrl = iframeUrlDiy || `${url[0]}/#/IFrameForApply?id=${workId}&token=${getToken()}`;
let
buttons
=
this
.
handleButtonSet
({});
let
listConfig
=
pageSetting
.
listConfig
;
if
(
!
buttons
.
length
)
{
...
...
FormInsertDiy/AffairPage/AuditPage/List.js
浏览文件 @
6931c086
...
...
@@ -294,7 +294,6 @@ export default class List extends Component {
}
}
}
// console.log(columns);
const
tableProps
=
{
rowKey
:
pageSearch
.
tableRowKey
||
'id'
,
...
...
FormInsertDiy/AffairPage/AuditPage/index.js
浏览文件 @
6931c086
...
...
@@ -41,7 +41,6 @@ class Index extends React.Component {
getFormDetail
=
(
workId
)
=>
{
const
{
dataBaseId
}
=
this
.
state
;
service
.
getFormDetail
(
workId
).
then
((
response
)
=>
{
console
.
log
(
response
);
if
(
typeof
response
.
unifiedServicePatternModel
===
'undefined'
)
{
return
false
;
}
...
...
@@ -110,7 +109,6 @@ class Index extends React.Component {
if
(
!
response
||
!
Array
.
isArray
(
response
))
{
response
=
[];
}
// console.log('columns', response);
for
(
let
item
of
response
)
{
if
(
item
.
dataIndex
===
'taskName'
&&
!
item
.
width
)
{
item
.
width
=
150
;
// 29213 资助事务管理/国家三金/国家奖学金审核(高职),界面排版(100661,bdk@2022*$)
...
...
@@ -206,7 +204,6 @@ class Index extends React.Component {
});
}
}
// console.log(JSON.stringify(d));
}
return
(
<
AuditPage
...
...
@@ -229,6 +226,5 @@ class Index extends React.Component {
export
default
function
Pr
(
props
)
{
const
{
routerConfig
}
=
useContext
(
CreateC
);
// console.log(routerConfig);
return
<
Index
{...
props
}
routerConfig
=
{
routerConfig
}
/>
;
}
FormInsertDiy/Export/QueryItem.js
浏览文件 @
6931c086
...
...
@@ -57,7 +57,6 @@ export default class QueryItem extends React.Component {
this
.
triggerChange
({
string
:
e
.
target
.
value
});
};
changeDate
=
(
date
)
=>
{
console
.
log
(
date
);
if
(
!
(
'value'
in
this
.
props
))
{
this
.
setState
({
string
:
date
.
format
(
'YYYY-MM-DD HH:mm:ss'
)
});
}
...
...
FormInsertDiy/ExportComponent/ActiveMenuComponent.js
浏览文件 @
6931c086
...
...
@@ -82,7 +82,6 @@ function ActiveMenuComponent({ routerConfig, ...otherProps }) {
Res
=
<
ApplyMerge
{...
otherProps
}
routerConfig
=
{
routerConfig
}
/>
;
break
;
case
'Audit'
:
// 审批类
console
.
log
(
routerConfig
);
Res
=
<
Audit
workId
=
{
appId
}
{...
otherProps
}
routerConfig
=
{
routerConfig
}
/>
;
break
;
case
'BatchAudit'
:
// 批量审批
...
...
FormInsertDiy/ExportComponent/CheckRecord.js
浏览文件 @
6931c086
...
...
@@ -9,7 +9,6 @@ import { getOneStopConfig } from '@/webPublic/zyd_public/utils/utils';
// 考核汇总页面
function
OtherCheckRecord
({
workId
,
...
otherProps
})
{
// console.log(workId, otherProps);
const
pathname
=
otherProps
?.
location
?.
pathname
;
const
[
data
,
setData
]
=
useState
();
const
id
=
workId
||
getOneStopConfig
(
pathname
);
...
...
@@ -20,7 +19,6 @@ function OtherCheckRecord({ workId, ...otherProps }) {
});
},
[
id
]);
// console.log(data);
if
(
!
data
)
{
return
null
;
...
...
FormInsertDiy/ExportComponent/CheckRecordMerge.js
浏览文件 @
6931c086
...
...
@@ -11,7 +11,6 @@ export default function CheckRecordMerge(props) {
console
.
log
(
'settingJson 不是一个数组 无法渲染!'
);
return
null
;
}
console
.
log
(
settingJson
);
const
[
activeKey
,
setActiveKey
]
=
useState
(
settingJson
[
0
].
appId
);
const
changeActiveKey
=
(
a
)
=>
{
setActiveKey
(
a
);
...
...
@@ -22,7 +21,6 @@ export default function CheckRecordMerge(props) {
if
(
!
activeKey
)
{
return
null
;
}
console
.
log
(
settingJson
);
return
(
<
Tabs
activeKey
=
{
activeKey
}
hideAdd
=
{
true
}
...
...
FormInsertDiy/ExportComponent/SassOnestopComponent.js
0 → 100644
浏览文件 @
6931c086
// /**
// * 钟是志
// * 2022年9月15日
// * onestopApp1.0
// * */
import
React
from
'react'
;
import
CheckRecord
from
'@/webPublic/FormInsertDiy/ExportComponent/CheckRecord'
;
// 查询类
import
Apply
from
'@/webPublic/FormInsertDiy/AffairPage/ApplyPage'
;
// 申请
import
BatchAudit
from
'@/webPublic/FormInsertDiy/AffairPage/AuditPage/BatchAudit'
;
// 批量审批
import
Audit
from
'@/webPublic/FormInsertDiy/AffairPage/AuditPage/index.js'
;
// 审批
import
Detail
from
'@/webPublic/FormInsertDiy/AffairPage/Detail'
;
//详情
import
{
connect
}
from
'dva'
;
import
router
from
'umi/router'
;
import
ApplyMerge
from
'./ApplyMerge'
;
// merge
import
AuditMerge
from
'./AuditMerge'
;
import
CheckRecordMerge
from
'./CheckRecordMerge'
;
import
CreateC
from
'./ContextCreate'
;
function
SassOnestopComponent
(
props
){
const
params
=
props
.
match
?.
params
;
if
(
!
params
||
!
params
.
appId
){
return
'参数错误, 暂无此功能'
;
}
let
Res
=
<
div
>
暂无此功能
<
/div>
;
const
routerConfig
=
{};
const
{
type
,
appId
}
=
params
;
switch
(
type
)
{
case
'CheckRecord'
:
// 查询类应用
Res
=
<>
<
CheckRecord
workId
=
{
appId
}
/
>
<
/>
;
break
;
case
'CheckRecordMerge'
:
// 查询类应用聚合
Res
=
<
CheckRecordMerge
/>
;
break
;
case
'Apply'
:
// 申请类
const
otherProps
=
{};
if
(
appId
===
'1549319936277479424'
)
{
// 29573 当前位置: 违纪管理/违纪上报(辅导员),100086 下面这个模块做个超链接 搞到这儿来
otherProps
.
otherButtons
=
[
{
type
:
'weijiJiangjiLiebiao'
,
name
:
'申诉降级上报'
,
component
:
'Normal'
,
handleClick
:
()
=>
{
router
.
push
({
pathname
:
'/xg/onestop/CheckRecord/1556895593807216640'
,
});
},
},
];
}
Res
=
<
Apply
workId
=
{
appId
}
{...
props
}
{...
otherProps
}
/>
;
break
;
case
'ApplyMerage'
:
// 申请页面聚合 多个流程的申请页面放在一起
Res
=
<
ApplyMerge
{...
props
}
/>
;
break
;
case
'Audit'
:
// 审批类
Res
=
<
Audit
workId
=
{
appId
}
{...
props
}
/>
;
break
;
case
'BatchAudit'
:
// 批量审批
Res
=
<
BatchAudit
workId
=
{
appId
}
{...
props
}
/>
;
break
;
case
'AuditMerage'
:
// 审核页面聚合 多个流程的审核页面放在一起
Res
=
<
AuditMerge
{...
props
}
/>
;
break
;
case
'Detail'
:
// 详情
Res
=
<
Detail
{...
props
}
/>
;
break
;
default
:
break
;
}
return
(
<
CreateC
.
Provider
value
=
{{
routerConfig
,
locationState
:
props
.
location
?.
state
,
}}
>
{
Res
}
<
/CreateC.Provider
>
);
}
export
default
connect
(({})
=>
{
return
{};
})(
SassOnestopComponent
);
one_stop_public/2023yunshangguizhou/Authorized.js
0 → 100644
浏览文件 @
6931c086
import
React
,
{
useMemo
}
from
'react'
;
import
{
isJSON
}
from
'@/webPublic/one_stop_public/copy'
;
export
default
function
Authorized
(
props
)
{
const
{
authority
,
children
}
=
props
;
const
check
=
useMemo
(()
=>
{
let
parentIframeRouteInfo
=
localStorage
.
getItem
(
'parentRouteInfo'
);
// 获取父节点路由信息
parentIframeRouteInfo
=
isJSON
(
parentIframeRouteInfo
)
?
JSON
.
parse
(
parentIframeRouteInfo
)
:
null
;
let
allAuth
=
localStorage
.
getItem
(
'antd-pro-authority'
);
allAuth
=
isJSON
(
allAuth
)
?
JSON
.
parse
(
allAuth
)
:
null
;
if
(
!
parentIframeRouteInfo
||
!
allAuth
){
return
false
;
}
const
{
path
}
=
parentIframeRouteInfo
;
const
checkPath
=
path
+
authority
;
console
.
log
(
'检查权限:'
,
checkPath
);
let
findX
=
allAuth
.
find
((
g
)
=>
g
===
checkPath
);
return
!!
findX
;
},
[
authority
]);
if
(
!
check
)
{
return
null
;
}
return
children
;
}
one_stop_public/2023yunshangguizhou/DiyIframeModal.js
0 → 100644
浏览文件 @
6931c086
import
React
from
'react'
;
import
{
Modal
}
from
'antd'
;
import
{
isJSON
}
from
'@/webPublic/one_stop_public/copy'
;
const
formatProps
=
(
ModalFuncProps
)
=>
{
ModalFuncProps
.
getContainer
=
ModalFuncProps
.
getContainer
||
false
;
return
ModalFuncProps
;
};
window
.
addEventListener
(
'message'
,
(
event
)
=>
{
if
(
event
.
data
&&
event
.
data
.
indexOf
)
{
if
(
event
.
data
.
indexOf
(
'iframeGetScrollHeight'
)
>
-
1
)
{
const
height
=
event
.
data
.
split
(
'-'
)[
1
];
// console.log('父页面向子iframe页面发送滚动高度: ', event.data);
let
dom
=
document
.
getElementsByClassName
(
'ant-modal-wrap'
);
if
(
dom
&&
dom
.
length
)
{
dom
[
0
].
style
.
top
=
height
+
'px'
;
}
}
if
(
event
.
data
.
indexOf
(
'parentRouteInfo'
)
>
-
1
)
{
const
info
=
event
.
data
.
split
(
'-'
)[
1
];
// console.log('父页面告知子页面路由信息: ', info);
if
(
info
&&
isJSON
(
info
))
{
localStorage
.
setItem
(
'parentRouteInfo'
,
info
);
}
}
if
(
event
.
data
.
indexOf
(
'setAuthorityLocalStorage'
)
>
-
1
)
{
const
info
=
event
.
data
.
split
(
'-'
);
// console.log('父页面告知子页面localStorage信息: antd-pro-authority');
if
(
info
&&
info
.
length
>
1
)
{
localStorage
.
setItem
(
'antd-pro-authority'
,
info
[
1
]);
}
}
}
});
const
sendMessageAndGetHeight
=
()
=>
{
// 获取当前屏幕滚动的高度 并将Modal 弹窗的高度绝对定位到屏幕以内
window
.
top
.
postMessage
(
'iframeGetScrollHeight'
,
'*'
);
};
const
DiyIframeModal
=
(
props
)
=>
{
return
<
Modal
{...
props
}
/>
;
};
const
ModalFuncs
=
function
(
ModalFuncProps
,
type
=
'info'
)
{
sendMessageAndGetHeight
();
return
Modal
[
type
](
formatProps
(
ModalFuncProps
));
};
DiyIframeModal
.
info
=
function
(
ModalFuncProps
)
{
return
ModalFuncs
(
ModalFuncProps
,
'info'
);
};
DiyIframeModal
.
success
=
function
(
ModalFuncProps
)
{
return
ModalFuncs
(
ModalFuncProps
,
'success'
);
};
DiyIframeModal
.
error
=
function
(
ModalFuncProps
)
{
return
ModalFuncs
(
ModalFuncProps
,
'error'
);
};
DiyIframeModal
.
warning
=
function
(
ModalFuncProps
)
{
return
ModalFuncs
(
ModalFuncProps
,
'warning'
);
};
DiyIframeModal
.
confirm
=
function
(
ModalFuncProps
)
{
return
ModalFuncs
(
ModalFuncProps
,
'confirm'
);
};
DiyIframeModal
.
warn
=
function
(
ModalFuncProps
)
{
return
ModalFuncs
(
ModalFuncProps
,
'warn'
);
};
DiyIframeModal
.
destroyAll
=
function
()
{
return
Modal
.
destroyAll
();
};
export
default
DiyIframeModal
;
one_stop_public/Base16/SplitBase16Index.js
浏览文件 @
6931c086
...
...
@@ -35,7 +35,6 @@ function giveKey(key, datas) {
}
export
async
function
countAllValues
(
datas
,
item
)
{
// console.log(datas);
if
(
item
.
setNull
)
{
datas
.
allValues
=
JSON
.
stringify
({});
}
else
{
...
...
@@ -67,8 +66,6 @@ export async function countAllValues(datas, item) {
export
async
function
giveBase16EncodeAsync
(
datas
,
url
)
{
if
(
url
&&
typeof
url
===
'string'
)
{
// console.log(url);
// console.log(encryptApiList);
for
(
const
item
of
encryptApiList
)
{
if
(
item
.
api
&&
url
.
indexOf
(
item
.
api
)
>
-
1
&&
item
.
key
)
{
for
(
let
g
of
item
.
key
)
{
...
...
@@ -87,7 +84,6 @@ export async function giveBase16EncodeAsync(datas, url) {
datas
=
await
countAllValues
(
datas
,
item
);
// 循环中 不要写await
datas
=
giveKey
(
'allValues'
,
datas
);
}
else
{
// console.log(g, datas);
datas
=
giveKey
(
g
,
datas
);
}
}
...
...
one_stop_public/DetailForAudit/DetailSplit.js
浏览文件 @
6931c086
...
...
@@ -47,7 +47,7 @@ import {
queryApiActionPath
,
queryFileUrl
,
}
from
'@/webPublic/one_stop_public/utils/queryConfig'
;
import
{
isJSON
}
from
'@/webPublic/zyd_public/utils/utils'
;
import
{
getIsGui_Jian
,
isJSON
}
from
'@/webPublic/zyd_public/utils/utils'
;
import
HistoryFormList
from
'@/webPublic/one_stop_public/DetailForAudit/HistoryFormList'
;
@
connect
()
...
...
@@ -137,6 +137,33 @@ class DetailSplit extends Component {
this
.
flowExamineModal
.
showModal
(...
ags
);
};
getTaskInfos
=
(
res
)
=>
{
const
queryId
=
this
.
props
.
history
.
location
.
query
&&
this
.
props
.
history
.
location
.
query
.
id
;
const
id
=
this
.
props
.
history
.
location
.
state
&&
this
.
props
.
history
.
location
.
state
.
id
;
const
code
=
this
.
props
.
history
.
location
.
state
&&
this
.
props
.
history
.
location
.
state
.
code
;
if
(
queryApiVersion
()
===
'2.0'
){
return
new
Promise
((
resolve
)
=>
{
resolve
(
res
);
});
}
return
permRequest
(
'/UnifiedAppFormApi/getTaskInfos'
,
{
// 获取每一步的审核人.
id
:
queryId
?
queryId
:
id
,
// 审批表Id
code
:
code
||
null
,
// 表单值
});
};
goPrintDiy
=
()
=>
{
router
.
push
({
pathname
:
'/xg/grade/help/PKSRD/DiyPrint'
,
state
:
{
},
query
:
{
code
:
this
.
state
.
code
,
},
});
};
componentDidMount
()
{
this
.
getInit
();
...
...
@@ -178,11 +205,8 @@ class DetailSplit extends Component {
});
}
if
(
val
)
{
permRequest
(
'/UnifiedAppFormApi/getTaskInfos'
,
{
// 获取每一步的审核人.
id
:
queryId
?
queryId
:
id
,
// 审批表Id
code
:
code
||
null
,
// 表单值
}).
then
((
res
)
=>
{
console
.
log
(
val
);
this
.
getTaskInfos
(
val
).
then
((
res
)
=>
{
val
.
taskInfo
=
res
.
taskInfo
;
this
.
setState
(
{
...
...
@@ -389,7 +413,9 @@ class DetailSplit extends Component {
const
code
=
e
.
currentTarget
.
dataset
.
codeId
;
let
url
=
window
.
location
.
href
.
split
(
'#'
)[
0
];
if
(
code
)
{
window
.
open
(
url
+
'#'
+
this
.
props
.
history
.
location
.
pathname
+
'?code='
+
code
+
'&showAll=false'
);
window
.
open
(
url
+
'#'
+
this
.
props
.
history
.
location
.
pathname
+
'?code='
+
code
+
'&showAll=false'
,
);
}
};
...
...
@@ -429,7 +455,7 @@ class DetailSplit extends Component {
const
{
showPrint
}
=
this
.
props
;
const
isCloseFlowPath
=
sessionStorage
.
getItem
(
'isCloseFlowPath'
)
?
JSON
.
parse
(
sessionStorage
.
getItem
(
'isCloseFlowPath'
))
:
fals
e
;
:
tru
e
;
const
isTrunTo
=
sessionStorage
.
getItem
(
'isTrunTo'
)
?
JSON
.
parse
(
sessionStorage
.
getItem
(
'isTrunTo'
))
:
false
;
...
...
@@ -466,11 +492,13 @@ class DetailSplit extends Component {
}}
>
{
isCloseFlowPath
?
null
:
(
// 关闭流程紧急度显示
<
span
style
=
{{
style
=
{
{
// position: 'absolute',
// left: 0,
// top: '30%',
}}
>
}
}
>
{
isSecond
?
(
<>
<
span
style
=
{{
marginRight
:
12
}}
>
...
...
@@ -503,7 +531,9 @@ class DetailSplit extends Component {
)}
{
data
.
appName
?
data
.
appName
:
'当前表单'
}
{(
isEnd
||
isAllPrint
)
&&
showPrint
!==
false
?
(
{(
isEnd
||
isAllPrint
)
&&
showPrint
!==
false
&&
appId
!==
'1328230407929331712'
&&
(
<>
<
Popconfirm
onConfirm
=
{()
=>
{
...
...
@@ -548,7 +578,8 @@ class DetailSplit extends Component {
}
okText
=
"确定"
cancelText
=
"取消"
>
{(
data
.
isPrint
==
null
||
data
.
isPrint
||
isAllPrint
)
&&
showPrint
!==
false
?
(
{(
data
.
isPrint
==
null
||
data
.
isPrint
||
isAllPrint
)
&&
showPrint
!==
false
?
(
<
Button
style
=
{{
position
:
'absolute'
,
...
...
@@ -563,8 +594,19 @@ class DetailSplit extends Component {
)}
<
/Popconfirm
>
<
/
>
)
:
(
''
)}
{
appId
===
'1328230407929331712'
&&
getIsGui_Jian
()
&&
(
<
Button
onClick
=
{
this
.
goPrintDiy
}
style
=
{{
position
:
'absolute'
,
right
:
200
,
top
:
'30%'
,
}}
type
=
"primary"
>
打印预览
<
/Button
>
)}
<
/div
>
<
/div
>
...
...
one_stop_public/DetailForAudit/IframeForDetail.js
浏览文件 @
6931c086
...
...
@@ -41,6 +41,7 @@ export default class GetDetail extends Component {
height
:
'100%'
,
width
:
'calc(100vw - 300px)'
,
padding
:
0
,
margin
:
'0 auto'
,
},
}
=
this
.
props
;
let
{
location
}
=
this
.
props
.
history
;
...
...
one_stop_public/DetailForAudit/components/FlowExamineModal/Content.js
浏览文件 @
6931c086
...
...
@@ -4,12 +4,10 @@ import classNames from 'classnames/bind';
import
PortalFlowExamineModalImage
from
'./Image'
;
import
{
connect
}
from
'dva'
;
import
{
queryApiActionPath
}
from
'@/webPublic/one_stop_public/utils/queryConfig'
;
import
{
getToken
}
from
'@/webPublic/one_stop_public/utils/token'
;
const
names
=
classNames
.
bind
(
require
(
'./style.less'
));
const
Body
=
({
className
,
...
props
})
=>
<
div
className
=
{
names
(
'body'
,
className
)}
{...
props
}
/>
;
const
Body
=
({
className
,
...
props
})
=>
<
div
className
=
{
names
(
'body'
,
className
)}
{...
props
}
/>
;
@
connect
()
export
default
class
PortalFlowExamineModalContent
extends
React
.
Component
{
...
...
@@ -22,11 +20,11 @@ export default class PortalFlowExamineModalContent extends React.Component {
}
render
()
{
let
{
id
,
affairId
,
code
,
}
=
this
.
props
;
let
{
id
,
affairId
,
code
}
=
this
.
props
;
let
url
=
`
${
queryApiActionPath
()}
/UnifiedAppFormApi/getProcessImg?appId=
${
id
}
&token=
${
getToken
()}
`
;
if
(
affairId
){
url
=
url
+
`&id=
${
affairId
}
`
;
}
return
(
<
Row
className
=
{
names
(
'warp'
)}
>
<
Col
span
=
{
24
}
>
...
...
@@ -35,21 +33,13 @@ export default class PortalFlowExamineModalContent extends React.Component {
<
PortalFlowExamineModalImage
appid
=
{
id
}
code
=
{
code
}
src
=
{
!!
affairId
?
`
${
queryApiActionPath
()}
/UnifiedAppFormApi/getProcessImg?appId=
${
id
}
&id=
${
affairId
}
`
:
`
${
queryApiActionPath
()}
/UnifiedAppFormApi/getProcessImg?appId=
${
id
}
`
}
src
=
{
url
}
/
>
)
:
(
<
PortalFlowExamineModalImage
appid
=
{
id
}
code
=
{
code
}
src
=
{
!!
affairId
?
`
${
queryApiActionPath
()}
/UnifiedAppFormApi/getProcessImg?appId=
${
id
}
&id=
${
affairId
}
`
:
`
${
queryApiActionPath
()}
/UnifiedAppFormApi/getProcessImg?appId=
${
id
}
`
}
src
=
{
url
}
/
>
)}
<
/Body
>
...
...
one_stop_public/DetailForAudit/components/FlowExamineModal/Image.js
浏览文件 @
6931c086
...
...
@@ -32,7 +32,6 @@ export default class PortalFlowExamineModalImage extends React.Component {
sliderChange
=
num
=>
{
if
(
sliNum
===
0
)
{
width
=
document
.
querySelector
(
'.img'
).
width
;
// console.log(document.querySelector('.img').width)
}
sliNum
++
;
if
(
num
==
0
&&
sliNum
!=
0
)
{
...
...
one_stop_public/DetailForAudit/components/FlowExamineModal/index.js
浏览文件 @
6931c086
...
...
@@ -20,7 +20,6 @@ export default class PortalFlowExamineModal extends React.Component {
const
{
visible
}
=
this
.
state
;
const
{
isShow
,
id
,
affairId
}
=
this
.
props
;
const
code
=
this
.
props
?.
code
?
this
.
props
?.
code
:
''
;
// console.log(this.props)
return
(
<
Modal
title
=
"事务流程"
...
...
@@ -29,8 +28,7 @@ export default class PortalFlowExamineModal extends React.Component {
footer
=
{
null
}
width
=
{
1300
}
wrapClassName
=
{
names
(
'modal-warp'
)}
destroyOnClose
>
destroyOnClose
>
<
PortalFlowExamineModalContent
affairId
=
{
affairId
}
id
=
{
id
}
code
=
{
code
}
isShow
=
{
isShow
}
/
>
<
/Modal
>
);
...
...
one_stop_public/DetailForAudit/components/ggEditor/components/EditorDetailPanel/FlowDetailPanel.js
浏览文件 @
6931c086
...
...
@@ -5,7 +5,6 @@ import DetailForm from './DetailForm';
import
styles
from
'./index.less'
;
const
FlowDetailPanel
=
({
getDrag
,
getDragEnd
,
getprocess
,
data
,
getEvent
,
isDelete
})
=>
{
// console.log(getEvent)
return
(
<
DetailPanel
className
=
{
styles
.
detailPanel
}
>
<
NodePanel
>
...
...
one_stop_public/DetailForAudit/splitDetailSplit.js
浏览文件 @
6931c086
...
...
@@ -77,7 +77,6 @@ const submitValues = ({
},
()
=>
{
preHandle
(
values
);
// 引入 import {preHandle} from '@/webPublic/one_stop_public/utils/myutils.js'
// console.log(JSON.stringify(values));
// return ;
let
payload
=
{
...
...
one_stop_public/Table/ZdyTable.jsx
浏览文件 @
6931c086
...
...
@@ -86,6 +86,8 @@ export default class ZdyTable extends Component {
}
const
val
=
postData
;
// console.log(val);
// debugger;
try
{
/**
* 数据源不同进行以下区别处理
...
...
one_stop_public/Table/giveSmartFormGlobalProps.js
浏览文件 @
6931c086
...
...
@@ -22,6 +22,13 @@ import {
}
from
'./globalFunction'
;
import
{
getTransformApi
}
from
'@/webPublic/one_stop_public/2022beidianke/localstorageTransform'
;
export
function
getSystemCode
(){
const
systemCode
=
localStorage
.
getItem
(
'antd-pro-type'
)
||
''
;
const
exp
=
new
RegExp
(
'/*'
,
'mg'
);
return
systemCode
.
replace
(
exp
,
''
);
}
export
function
giveSmartFormGlobalProps
({
fromStart
=
false
,
// 是否是 发起申请
hasSingle
=
false
,
...
...
@@ -32,6 +39,8 @@ export function giveSmartFormGlobalProps({
nextUsers
=
{},
//
calculateFlowData
=
[],
// 移动端使用 用于分块块 禅道 23933 移动端全表单后审核步骤的显示问题优化
})
{
window
.
smartFormGlobalProps
=
{
fromStart
,
hasSingle
,
...
...
@@ -109,6 +118,8 @@ export function giveSmartFormGlobalProps({
Tag
,
Badge
,
},
routePath
:
window
.
location
.
href
.
split
(
'#'
)[
1
],
systemCode
:
getSystemCode
(),
};
return
true
;
}
one_stop_public/libs/ChildForm.jsx
浏览文件 @
6931c086
...
...
@@ -137,7 +137,6 @@ export default class ChildForm extends React.Component {
if
(
!
objs
)
{
return
null
;
}
// console.log(this.props.form.getFieldsValue());
if
(
isMobile
)
{
return
(
// 2022年11月24日 姚新国说的 把干掉两翼留白 解决北电科工作情况考核 移动端样式的问题
...
...
@@ -239,8 +238,6 @@ export default class ChildForm extends React.Component {
if
(
r
==
''
)
{
return
''
;
}
// console.log('子表单', r);
// console.log(form.getFieldsValue());
return
(
<
Col
span=
{
span
}
key=
{
r
}
>
<
ZdyTable
...
...
one_stop_public/libs/LocationCom.js
浏览文件 @
6931c086
...
...
@@ -31,7 +31,6 @@ export default class LocationCom extends React.Component {
}
}
changePos
=
(
obj
)
=>
{
console
.
log
(
obj
);
if
(
!
(
'value'
in
this
.
props
))
{
this
.
setState
({
...
obj
});
}
...
...
one_stop_public/libs/MobileDate.jsx
浏览文件 @
6931c086
...
...
@@ -21,10 +21,8 @@ export default class MobileDate extends Component {
}
triggerChange
=
changedValue
=>
{
console
.
log
(
changedValue
);
// Should provide an event to pass value to Form.
const
onChange
=
this
.
props
.
onChange
;
// console.log(changedValue);
if
(
onChange
)
{
onChange
([...
changedValue
]);
}
...
...
@@ -111,7 +109,6 @@ export default class MobileDate extends Component {
const
endTime
=
dates
.
length
>
1
?
dates
[
1
]
&&
dates
[
1
].
valueOf
()
:
null
;
const
MustSpan
=
this
.
MustSpan
();
// console.log(startTime, endTime);
return
(
<
div
>
...
...
one_stop_public/libs/PictureSignature/PictureSignature.js
浏览文件 @
6931c086
...
...
@@ -63,7 +63,6 @@ const getContent = (signConfig = [], ratioX) => {
g
.
w
=
Math
.
ceil
(
g
.
w
*
ratioX
);
g
.
h
=
Math
.
ceil
(
g
.
h
*
ratioX
);
}
// console.log(g);
return
g
;
}),
});
...
...
@@ -110,7 +109,6 @@ export default function PictureSignature({
}
setShowModal
(
!
showModal
);
};
// console.log(json);
...
...
@@ -160,7 +158,6 @@ export default function PictureSignature({
const
handleClickButton
=
clickType
=>
{
switch
(
clickType
)
{
case
'startEdit'
:
// 开始签章
// console.log(imageInfo);
if
(
signConfig
&&
signConfig
.
length
<
originSignConfig
.
length
)
{
setOtherProps
({
...
otherProps
,
...
...
@@ -238,7 +235,6 @@ export default function PictureSignature({
}
else
{
return
originButtons
.
map
(
g
=>
{
// if (g.clickType === 'startEdit') {
// console.log(signConfig);
// return <Popconfirm
// title={<div>
// <p>选择签章组件</p>
...
...
@@ -280,7 +276,6 @@ export default function PictureSignature({
if
(
!
fileInfo
)
{
return
null
;
}
// console.log(imageInfo, fileInfo);
console
.
log
(
'签章组件'
);
return
(
<
div
className
=
{
styles
.
outSideDiv
}
>
...
...
@@ -398,7 +393,6 @@ export function SignArray(props) {
onChange(value);
}
};
// console.log(value, '222222222222222')
return (
<div>
{files.map((g, index) => {
...
...
one_stop_public/libs/Split/TableSelectZhanWei.js
浏览文件 @
6931c086
...
...
@@ -100,7 +100,6 @@ export default function TableSelectZhanWei(props) {
typeList
=
[],
selectedStyle
=
{},
}
=
otherProps
;
// console.log(otherProps, dataSource.list);
if
(
!
dataSource
||
!
dataSource
.
list
||
!
dataSource
.
list
.
length
)
{
return
<
div
className
=
{
styles
.
noData
}
>
{
noDataSentence
}
<
/div>
;
}
...
...
@@ -110,7 +109,6 @@ export default function TableSelectZhanWei(props) {
callback
(
selectData
);
};
// console.log(selects);
return
<
div
className
=
{
styles
.
zhanWei
}
>
...
...
one_stop_public/location/index.jsx
浏览文件 @
6931c086
...
...
@@ -71,7 +71,6 @@ export default class location extends Component {
};
// 点击确定提交定位
confirm
=
e
=>
{
console
.
log
(
e
);
if
(
this
.
state
.
btn
)
{
if
(
this
.
props
.
get
===
'web'
)
{
openToast
(
'error'
,
'错误'
,
'正在定位,请稍后重试'
);
...
...
one_stop_public/tableCompon/Split_Index/RangePickerDiy.js
浏览文件 @
6931c086
...
...
@@ -51,7 +51,6 @@ export default function RangePickerDiy(props) {
const
[
bindValue
,
setBindValue
]
=
useState
([]);
useEffect
(()
=>
{
// console.log('RangePickerDiy组件Value', value);
if
(
!
value
||
!
Array
.
isArray
(
value
)
||
value
.
length
!==
2
)
{
setBindValue
([]);
...
...
@@ -60,8 +59,6 @@ export default function RangePickerDiy(props) {
if
(
typeof
value
[
i
]
===
'number'
&&
value
[
i
]
>
10000
)
{
bindValue
[
i
]
=
moment
(
value
[
i
]);
}
else
if
(
!
moment
.
isMoment
(
value
[
i
]))
{
// bindValue[i] = undefined;
// console.log('RangePickerDiy组件没有获取到正确的值', value);
}
else
{
bindValue
[
i
]
=
value
[
i
];
}
...
...
@@ -71,7 +68,6 @@ export default function RangePickerDiy(props) {
},
[
value
]);
function
handleChange
(
v
){
// console.log(v);
onChange
(
v
);
}
...
...
one_stop_public/utils/queryConfig.js
浏览文件 @
6931c086
...
...
@@ -42,7 +42,6 @@ if (!globalThis.CONFIG) {
const
queryConfig
=
(
key
)
=>
{
const
dynamicConfig
=
typeof
globalThis
!==
'undefined'
?
globalThis
.
CONFIG
:
window
.
CONFIG
;
// console.log(dynamicConfig);
if
(
typeof
key
===
'undefined'
)
return
dynamicConfig
;
return
dynamicConfig
[
key
];
};
...
...
zyd_private/BasicLayout/SplitBasicLayout.js
浏览文件 @
6931c086
...
...
@@ -30,6 +30,20 @@ const query = {
}
};
const
getYunShangGuiZhouSyStemConfig
=
()
=>
{
const
localStorageData
=
localStorage
.
getItem
(
'antd-pro-systemConfig'
);
if
(
localStorageData
&&
isJSON
(
localStorageData
)){
let
d
=
JSON
.
parse
(
localStorageData
);
return
{
sysCode
:
d
.
code
,
logo
:
''
,
name
:
d
.
name
,
siteId
:
'5'
,
siteUrl
:
''
,
};
}
};
const
getSystemConfig
=
()
=>
{
const
urlParams
=
new
URL
(
window
.
location
.
href
);
const
systemList
=
[
"/xg/"
,
"/yx/"
,
"/jy/"
,
"/lx/"
,
"/sg/"
,
"/xl/"
,
"/zs/"
,
"/uaa/"
,
"/tw/"
,
"/ytw/"
,
"/wzb/"
,
"/szcp/"
];
...
...
@@ -138,7 +152,7 @@ const insertActiveMenus = (routes = [], insertRoutes = []) => {
}
return
routes
;
};
export
{
antIcon
,
query
,
getSystemConfig
,
formatter
,
getMenuData
,
insertActiveMenus
};
export
{
antIcon
,
query
,
getSystemConfig
,
formatter
,
getMenuData
,
insertActiveMenus
,
getYunShangGuiZhouSyStemConfig
};
export
const
getDiyChineseMenus
=
()
=>
{
const
menuChineseConfig
=
getSysConfig
().
menuChineseConfig
;
...
...
zyd_private/BasicLayout/sortMenusByPriority.js
浏览文件 @
6931c086
export
function
sortMenusByPriority
(
menus
=
[])
{
// console.log(menus);
menus
.
sort
((
a
,
b
)
=>
{
if
(
a
.
oldBrotherPath
===
b
.
oldBrotherPath
)
{
return
b
.
priority
-
a
.
priority
;
}
});
// console.log(menus);
//
return
menus
;
}
...
...
zyd_public/WangEditor/WangEditor5/ReactComponent.js
浏览文件 @
6931c086
...
...
@@ -22,7 +22,6 @@ export default function PrepareShow(props) {
// 异步加载这个js。 因为js 过大影响性能
loadCss
().
then
((
cssRes
)
=>
{
// 异步加载这个 wangEditor5 的css 文件
console
.
log
(
'123'
);
WangEditor5
.
current
=
res
;
WangEditor5
.
current
.
Boot
.
registerMenu
(
myMenuConf
);
setShow
(
true
);
...
...
@@ -30,7 +29,6 @@ export default function PrepareShow(props) {
});
// setShow(true);
},
[]);
// console.log(show, WangEditor5);
if
(
show
)
{
return
<
WangEditorReactComponent
{...
props
}
WangEditor5
=
{
WangEditor5
.
current
}
/>
;
}
else
{
...
...
@@ -67,9 +65,7 @@ function WangEditorReactComponent(props) {
},
onChange
:
(
editor
)
=>
{
// console.log('content', editor.children);
onChange
(
editor
.
getHtml
());
// console.log('html', editor.getHtml());
},
};
const
toolbarConfig
=
{
...
...
zyd_public/components/DraggableSetting/RefactoringOld.js
浏览文件 @
6931c086
...
...
@@ -106,8 +106,6 @@ export default function NewDraggableSetting(props) {
const
styleLeft
=
parseInt
(
objX
,
10
)
+
parseInt
(
x
,
10
)
-
parseInt
(
mouseX
,
10
);
// 计算偏移量
const
styleTop
=
parseInt
(
objY
,
10
)
+
parseInt
(
y
,
10
)
-
parseInt
(
mouseY
,
10
);
// 计算偏移量
const
dropZone
=
document
.
getElementById
(
'dropZone'
);
// console.log('styleLeft', styleLeft, 'dropW', dropZone.width);
// console.log('styleTop', styleTop, dropZone.height);
if
(
// 阻止拖拽到图片外部
styleLeft
>
dropZone
.
width
-
50
||
...
...
zyd_public/components/DraggableSetting/index3.0.js
浏览文件 @
6931c086
...
...
@@ -76,7 +76,6 @@ export default class FormatSetting extends Component {
message
.
warn
(
'拖拽到了图片区域外部!'
);
return
false
;
}
else
{
console
.
log
(
leftNew
,
topNew
);
}
if
(
event
.
target
.
id
===
'dropZone'
)
{
...
...
@@ -105,8 +104,6 @@ export default class FormatSetting extends Component {
render
()
{
const
{
bgImage
,
formatSettingObject
,
saveConfig
,
pageConfiguration
}
=
this
.
props
;
console
.
log
(
formatSettingObject
);
console
.
log
(
pageConfiguration
,
'pageConfiguration'
);
let
bgImageStyle
=
{};
if
(
pageConfiguration
&&
pageConfiguration
.
width
){
bgImageStyle
.
width
=
pageConfiguration
.
width
+
'cm'
;
...
...
zyd_public/components/lowCodeEdit/EditDrawer.js
浏览文件 @
6931c086
...
...
@@ -11,7 +11,8 @@ const { TextArea } = Input;
function
EditDrawer
(
props
)
{
const
{
dispatch
,
templateData
,
TEMPLATE
}
=
props
;
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
showEdit
,
setShowEdit
]
=
useState
(
process
.
env
.
NODE_ENV
===
'development'
);
// const [showEdit, setShowEdit] = useState(process.env.NODE_ENV === 'development');
const
[
showEdit
,
setShowEdit
]
=
useState
(
false
);
const
saveTimeOut
=
useRef
();
const
[
lowCodeEdit
,
setLowCodeEdit
]
=
useState
({});
...
...
zyd_public/request/request.js
浏览文件 @
6931c086
...
...
@@ -125,7 +125,12 @@ export default function request(
options
=
{},
)
{
url
=
urlTransform
(
url
);
// 北电科接口越权修改
if
(
url
&&
url
.
indexOf
(
'/CmsApi/'
)
>
-
1
&&
queryIsSafe
()
&&
url
.
indexOf
(
'/CmsApi/getExportInfo'
)
<=
-
1
)
{
if
(
url
&&
url
.
indexOf
(
'/CmsApi/'
)
>
-
1
&&
queryIsSafe
()
&&
url
.
indexOf
(
'/CmsApi/getExportInfo'
)
<=
-
1
&&
url
.
indexOf
(
'/CmsApi/getStatistics'
)
<=
-
1
)
{
url
=
url
.
replace
(
config
.
httpServer
,
''
);
return
uaaRequest
(
url
,
options
.
body
);
}
...
...
zyd_public/requestJson/fetchData.ts
0 → 100644
浏览文件 @
6931c086
/**
* 2020年7月14日 10:38:36
* 用于校验短时间内的重复提交
* */
const
key
=
'fetch-url-data'
;
// 保存上一次请求的 url 和 time, body
const
key2
=
'fetch-url-response'
;
export
function
setFetchUrl
(
data
:
string
):
void
{
localStorage
.
setItem
(
key
,
data
);
}
export
function
getFetchUrl
():
string
{
const
res
=
localStorage
.
getItem
(
key
);
if
(
!
res
)
{
return
''
;
}
else
{
return
res
;
}
}
export
function
saveResponse
(
data
:
string
)
{
localStorage
.
setItem
(
key2
,
data
);
// 保存上一次请求返回的data
}
export
function
getLastResponse
()
{
const
res
=
localStorage
.
getItem
(
key2
);
// 获取上一次请求返回的data 应该是一个json
if
(
!
res
)
{
return
''
;
}
else
{
return
res
;
}
}
zyd_public/requestJson/requestJson.js
0 → 100644
浏览文件 @
6931c086
require
(
'es6-promise'
).
polyfill
();
require
(
'isomorphic-fetch'
);
import
{
getToken
,
setToken
}
from
'@/webPublic/one_stop_public/utils/token'
;
import
{
controlNotification
,
isJSON
}
from
'@/webPublic/zyd_public/utils/utils'
;
import
{
setFetchUrl
,
getFetchUrl
}
from
'./fetchData'
;
const
codeMessage
=
{
200
:
'服务器成功返回请求的数据。'
,
201
:
'新建或修改数据成功。'
,
202
:
'一个请求已经进入后台排队(异步任务)。'
,
204
:
'删除数据成功。'
,
400
:
'发出的请求有错误,服务器没有进行新建或修改数据的操作。'
,
401
:
'登录已过期,请重新登录'
,
403
:
'用户得到授权,但是访问是被禁止的。'
,
404
:
'发出的请求针对的是不存在的记录,服务器没有进行操作。'
,
406
:
'请求的格式不可得。'
,
410
:
'请求的资源被永久删除,且不会再得到的。'
,
422
:
'当创建一个对象时,发生一个验证错误。'
,
500
:
'服务器发生错误,请检查服务器。'
,
502
:
'网关错误。'
,
503
:
'服务不可用,服务器暂时过载或维护。'
,
504
:
'网关超时。'
,
};
const
checkStatus
=
(
response
)
=>
{
const
status
=
Number
(
response
.
status
);
if
(
status
===
200
)
{
return
response
;
}
const
errortext
=
codeMessage
[
status
]
||
response
.
message
;
const
token
=
getToken
();
if
(
token
&&
token
!==
'null'
)
{
controlNotification
({
message
:
`
${
status
===
401
?
'登录过期'
:
'请求错误'
}
`
,
description
:
errortext
,
});
}
if
(
status
===
401
)
{
setToken
(
''
);
return
{
status
:
401
,
message
:
'登录过期'
,
// token不对
};
}
const
error
=
new
Error
(
errortext
);
error
.
name
=
status
+
''
;
console
.
error
(
response
.
message
);
throw
error
;
};
async
function
queryLocalStorage
()
{
return
false
;
}
function
setFetchInfo
(
url
,
options
)
{
let
session
=
getFetchUrl
();
if
(
isJSON
(
session
))
{
let
newSession
=
JSON
.
parse
(
session
);
if
(
newSession
.
url
===
url
&&
new
Date
().
valueOf
()
-
newSession
.
time
<
500
)
{
if
(
options
.
body
&&
JSON
.
stringify
(
options
.
body
)
===
newSession
.
body
)
{
console
.
log
(
'频繁调用接口: '
,
url
,
newSession
.
body
);
return
''
;
}
}
}
return
JSON
.
stringify
({
url
,
time
:
new
Date
().
valueOf
(),
body
:
options
.
body
?
JSON
.
stringify
(
options
.
body
)
:
''
,
});
}
export
default
function
requestJson
(
url
,
options
)
{
let
sessionFetch
=
setFetchInfo
(
url
,
options
);
if
(
!
sessionFetch
)
{
return
queryLocalStorage
();
}
else
{
setFetchUrl
(
sessionFetch
);
}
let
defaultToken
=
getToken
();
const
token
=
defaultToken
!==
null
&&
defaultToken
!==
'null'
?
defaultToken
:
''
;
if
(
options
.
time
)
{
const
time
=
new
Date
().
getTime
();
if
(
url
.
indexOf
(
'?'
)
===
-
1
)
{
url
=
url
+
'?time='
+
time
;
}
else
{
url
=
url
+
'&time='
+
time
;
}
}
const
defaultOptions
=
{
credentials
:
'omit'
,
mode
:
'cors'
,
};
let
newOptions
=
{
...
defaultOptions
,
...
options
};
if
(
token
)
{
url
=
url
.
indexOf
(
'?'
)
>
-
1
?
`
${
url
}
&token=
${
token
}
`
:
`
${
url
}
?token=
${
token
}
`
;
}
newOptions
=
{
method
:
'POST'
,
// 暂时支持post 请求
headers
:
{
Accept
:
'application/json;charset=UTF-8'
,
'Content-Type'
:
'application/json'
,
...
newOptions
.
headers
,
},
...
newOptions
,
body
:
JSON
.
stringify
(
newOptions
.
body
),
};
if
(
options
.
method
&&
options
.
method
.
toUpperCase
()
===
'GET'
)
{
newOptions
.
body
=
undefined
;
}
return
fetch
(
url
,
newOptions
)
.
then
((
res
)
=>
{
return
checkStatus
(
res
);
})
.
then
((
response
)
=>
{
return
response
.
json
();
})
.
then
((
response
)
=>
{
if
(
response
.
state
===
401
)
{
return
{
status
:
401
,
message
:
'token无效,认证失败!'
,
// 可能是跨域 可能是token过期
};
}
if
(
response
.
status
===
401
)
{
return
response
;
}
if
(
typeof
response
.
code
===
'undefined'
||
response
.
code
===
'invalid_token'
)
{
return
response
;
}
if
(
response
.
code
===
'0'
&&
typeof
response
.
data
!==
'undefined'
)
{
return
response
.
data
;
// 真正需要的数据
}
else
{
if
(
response
.
message
)
{
controlNotification
({
message
:
response
.
message
,
});
const
error
=
new
Error
(
response
.
message
);
error
.
name
=
response
.
code
;
console
.
error
(
response
.
message
);
throw
error
;
}
else
{
controlNotification
({
message
:
'数据错误'
,
});
const
error
=
new
Error
(
response
.
code
);
error
.
name
=
response
.
code
;
console
.
error
(
response
.
code
);
throw
error
;
}
}
})
.
catch
((
e
)
=>
{
const
status
=
e
.
name
;
if
(
status
===
401
)
{
return
false
;
}
if
(
!
window
.
navigator
.
onLine
)
{
return
controlNotification
({
message
:
'网络故障'
,
description
:
`无法连接到网络,请稍后再试`
,
});
}
controlNotification
({
message
:
'网络故障'
,
description
:
`无法连接到服务器,请稍后再试`
,
});
return
;
});
}
zyd_public/utils/getSchoolType.js
浏览文件 @
6931c086
...
...
@@ -22,3 +22,6 @@ export function getIsGong_Mao() { // 判断当前环境是不是成都工贸
return
window
.
specialImportantSystemConfig
?.
schoolName
&&
window
.
specialImportantSystemConfig
?.
schoolName
.
indexOf
(
'成都工贸'
)
>
-
1
;
}
export
function
getIsYsgz
()
{
// 判断当前环境是不是云上贵州
return
window
.
specialImportantSystemConfig
?.
schoolName
&&
window
.
specialImportantSystemConfig
?.
schoolName
.
indexOf
(
'知用科技有限公司'
)
>
-
1
;
}
zyd_public/utils/setTokenAndInitSystem.js
浏览文件 @
6931c086
...
...
@@ -9,6 +9,7 @@ import {
getSysConfig
as
getSysConfigLocalStorage
,
}
from
'@/webPublic/zyd_private/utils/basiclayout'
;
import
{
getOneStopConfig
}
from
'@/webPublic/zyd_public/utils/utils'
;
import
{
getIsYsgz
}
from
'@/webPublic/zyd_public/utils/getSchoolType'
;
function
formatUploadFile
(
fileList
)
{
if
(
!
fileList
||
!
Array
.
isArray
(
fileList
))
return
[];
...
...
@@ -60,7 +61,12 @@ export const valueTypes = {
};
export
function
getSysConfig
()
{
return
getInfo
({
pageSize
:
10000
},
'/WebConfigApi/getPage?oauthPub=true'
)
let
url
=
'/WebConfigApi/getPage?oauthPub=true'
;
if
(
getIsYsgz
()){
url
=
'/WebConfigApi/getPage'
;
}
return
getInfo
({
pageSize
:
10000
},
url
)
.
then
((
res
)
=>
{
if
(
res
&&
res
.
rows
&&
res
.
rows
.
length
)
{
const
formattered
=
res
.
rows
.
reduce
((
acc
,
cur
)
=>
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论