Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
2db1ce5d
提交
2db1ce5d
authored
6月 28, 2022
作者:
钟是志
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
837d902b
f75455c4
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
249 行增加
和
77 行删除
+249
-77
index.jsx
one_stop_public/filePreview/index.jsx
+4
-3
UploadComDiyForQnZy.js
one_stop_public/libs/UploadComDiyForQnZy.js
+2
-0
token.js
one_stop_public/utils/token.js
+1
-0
index3.0.js
zyd_public/components/DraggableSetting/index3.0.js
+165
-0
request.js
zyd_public/request/request.js
+2
-2
setTokenAndInitSystem.js
zyd_public/utils/setTokenAndInitSystem.js
+75
-72
没有找到文件。
one_stop_public/filePreview/index.jsx
浏览文件 @
2db1ce5d
...
@@ -5,7 +5,8 @@ import React, {Component} from 'react';
...
@@ -5,7 +5,8 @@ import React, {Component} from 'react';
import
{
checkIsImage
}
from
'@/webPublic/one_stop_public/libs/UploadCom'
;
import
{
checkIsImage
}
from
'@/webPublic/one_stop_public/libs/UploadCom'
;
import
{
getModal
,
getPopconfirm
,
isFromIframe
}
from
'@/webPublic/one_stop_public/utils/utils'
;
import
{
getModal
,
getPopconfirm
,
isFromIframe
}
from
'@/webPublic/one_stop_public/utils/utils'
;
const
FileViewer
=
CLIENT_TYPE
===
'mobile'
?
null
:
require
(
'react-file-viewer'
);
// const FileViewer = CLIENT_TYPE === 'mobile' ? null : require('react-file-viewer');
const
FileViewer
=
null
;
const
Modal
=
getModal
();
const
Modal
=
getModal
();
const
Popconfirm
=
getPopconfirm
();
const
Popconfirm
=
getPopconfirm
();
...
@@ -130,12 +131,12 @@ export default class index extends Component {
...
@@ -130,12 +131,12 @@ export default class index extends Component {
<
a
onClick=
{
this
.
download
}
>
<
a
onClick=
{
this
.
download
}
>
下载文件
下载文件
</
a
>
</
a
>
{
FileViewer
&&
(
{
/*
{FileViewer && (
<FileViewer
<FileViewer
fileType={type}
fileType={type}
filePath={path}
filePath={path}
/>
/>
)
}
)}
*/
}
</
div
>
</
div
>
)
}
)
}
</
Modal
>
</
Modal
>
...
...
one_stop_public/libs/UploadComDiyForQnZy.js
浏览文件 @
2db1ce5d
...
@@ -6,6 +6,7 @@ import styles from "./style.less";
...
@@ -6,6 +6,7 @@ import styles from "./style.less";
import
{
checkIsImage
}
from
"./UploadCom"
;
import
{
checkIsImage
}
from
"./UploadCom"
;
import
Viewer
from
"react-viewer"
;
import
Viewer
from
"react-viewer"
;
import
{
getToken
}
from
'@/webPublic/one_stop_public/utils/token'
;
import
{
getToken
}
from
'@/webPublic/one_stop_public/utils/token'
;
import
{
getHeaders
}
from
'@/webPublic/zyd_public/utils/utils'
;
// 为黔南职院单独写的 上传组件 用于 bug 20576 个人就业信息/求职创业补贴申报,201801010006 119242 上传图片加限制,跟签约派遣上传图片加限制一样
// 为黔南职院单独写的 上传组件 用于 bug 20576 个人就业信息/求职创业补贴申报,201801010006 119242 上传图片加限制,跟签约派遣上传图片加限制一样
...
@@ -101,6 +102,7 @@ export default class UploadComDiyForQnZy extends React.Component {
...
@@ -101,6 +102,7 @@ export default class UploadComDiyForQnZy extends React.Component {
name
:
"file"
,
name
:
"file"
,
multiple
:
isMultiple
,
multiple
:
isMultiple
,
accept
:
accept
,
accept
:
accept
,
...
getHeaders
(),
action
:
config
.
uploadUrl
,
action
:
config
.
uploadUrl
,
showUploadList
:
false
,
showUploadList
:
false
,
onChange
:
this
.
changeUrl
,
onChange
:
this
.
changeUrl
,
...
...
one_stop_public/utils/token.js
浏览文件 @
2db1ce5d
...
@@ -8,6 +8,7 @@ import { delCookie, setCookie } from '@/webPublic/one_stop_public/utils/cookie';
...
@@ -8,6 +8,7 @@ import { delCookie, setCookie } from '@/webPublic/one_stop_public/utils/cookie';
export
function
setToken
(
value
,
time
)
{
export
function
setToken
(
value
,
time
)
{
if
(
getToken
()
!==
value
)
{
if
(
getToken
()
!==
value
)
{
setCookie
(
'token'
,
value
);
setCookie
(
'token'
,
value
);
sessionStorage
.
removeItem
(
'cacheMobile'
);
localStorage
.
setItem
(
'antd-pro-token-onestop'
,
value
);
localStorage
.
setItem
(
'antd-pro-token-onestop'
,
value
);
localStorage
.
setItem
(
'antd-pro-token'
,
value
);
localStorage
.
setItem
(
'antd-pro-token'
,
value
);
localStorage
.
setItem
(
'wisdom-school-token'
,
value
);
localStorage
.
setItem
(
'wisdom-school-token'
,
value
);
...
...
zyd_public/components/DraggableSetting/index3.0.js
0 → 100644
浏览文件 @
2db1ce5d
/**
*
* 一站式请勿使用此组件
* 2020年5月9日 拖拽组件
* 钟是志
* 黔南的 录取通知书打印 位置设置
* */
import
React
,
{
Fragment
,
Component
}
from
'react'
;
import
styles
from
'./index.less'
;
import
{
message
}
from
'antd'
;
import
ButtonDiy
from
'@/baseComponent/ButtonDiy'
;
import
Shell
from
'@/baseComponent/Shell'
;
import
{
ModalConfirm
}
from
'@/baseComponent/Modal'
;
let
startX
=
0
;
let
startY
=
0
;
export
default
class
FormatSetting
extends
Component
{
constructor
()
{
super
();
document
.
onmousedown
=
function
(
evt
)
{
startX
=
evt
.
offsetX
;
startY
=
evt
.
offsetY
;
};
}
dragEventList
=
()
=>
{
const
{
updateFormatSettingObject
}
=
this
.
props
;
let
draggedRef
=
null
;
document
.
addEventListener
(
'dragstart'
,
function
(
event
)
{
// 保存拖动元素的引用(ref.)
draggedRef
=
event
.
target
;
// 使其半透明
event
.
target
.
style
.
opacity
=
0.5
;
},
false
,
);
document
.
addEventListener
(
'dragend'
,
function
(
event
)
{
// 重置透明度
event
.
target
.
style
.
opacity
=
''
;
},
false
,
);
/* 放下目标节点时触发事件 */
document
.
addEventListener
(
'dragover'
,
function
(
event
)
{
// 阻止默认动作
event
.
preventDefault
();
},
false
,
);
document
.
addEventListener
(
'drop'
,
function
(
event
)
{
// 阻止默认动作(如打开一些元素的链接)
event
.
preventDefault
();
// 将拖动的元素到所选择的放置目标节点中
let
infoClientRect
=
document
.
getElementById
(
'dropZone'
).
getBoundingClientRect
();
let
leftNew
=
Math
.
ceil
(
event
.
clientX
-
infoClientRect
.
left
)
-
startX
;
let
topNew
=
Math
.
ceil
(
event
.
clientY
-
infoClientRect
.
top
)
-
startY
;
if
(
leftNew
<
0
||
leftNew
>
infoClientRect
.
width
||
topNew
<
0
||
topNew
>
infoClientRect
.
height
)
{
message
.
warn
(
'拖拽到了图片区域外部!'
);
return
false
;
}
else
{
console
.
log
(
leftNew
,
topNew
);
}
if
(
event
.
target
.
id
===
'dropZone'
)
{
// const left = event.offsetX;
// const top = event.offsetY;
updateFormatSettingObject
(
draggedRef
.
id
,
leftNew
,
topNew
);
draggedRef
.
style
.
left
=
leftNew
;
// `${left}px`;
draggedRef
.
style
.
top
=
topNew
;
// `${top}px`;
}
},
false
,
);
};
componentDidMount
()
{
this
.
dragEventList
();
}
initConfig
=
()
=>
{
ModalConfirm
(
'您确定初始化打印录取通知书格式吗?'
,
{
onOk
:
()
=>
{
this
.
props
.
initConfig
();
},
});
};
render
()
{
const
{
bgImage
,
formatSettingObject
,
saveConfig
}
=
this
.
props
;
return
(
<
Fragment
>
<
Shell
styleShell
=
{{
marginTop
:
'0'
,
marginBottom
:
'20px'
,
}}
>
<
div
style
=
{{
height
:
'54px'
,
padding
:
'12px 0 12px 12px'
,
}}
>
<
ButtonDiy
name
=
"保存"
className
=
"primary"
handleClick
=
{
saveConfig
}
/
>
<
ButtonDiy
name
=
{
'初始化格式'
}
handleClick
=
{
this
.
initConfig
}
/
>
<
/div
>
<
/Shell
>
<
div
className
=
{
styles
.
outSideDiv
}
>
<
div
>
<
img
src
=
{
bgImage
}
id
=
{
'dropZone'
}
draggable
=
{
false
}
className
=
{
styles
.
bgimage
}
alt
=
{
'背景图'
}
/
>
{
formatSettingObject
.
map
((
x
,
index
)
=>
{
return
(
<
div
draggable
=
{
true
}
className
=
{
styles
.
inSideItem
}
key
=
{
index
}
id
=
{
x
.
name
}
style
=
{
x
.
style
}
>
{
x
.
name
}
<
/div
>
);
})}
<
/div
>
<
/div
>
<
/Fragment
>
);
}
}
/***
* formatSettingObject: {
* content_set: {
* font: "宋体"
isNeedConfig: true
key: "JjqCiRYamxs"
name: "content_set"
size: "12"
style: {top: 300, left: 50}
title: "--详细内容--"
* }
* }
*
* */
zyd_public/request/request.js
浏览文件 @
2db1ce5d
...
@@ -148,8 +148,8 @@ export default function request(
...
@@ -148,8 +148,8 @@ export default function request(
}
}
const
defaultOptions
=
{
const
defaultOptions
=
{
// credentials: 'omit',
// credentials: 'omit',
// 确保浏览器不在请求中包含凭据
credentials
:
'include'
,
credentials
:
'include'
,
// 为了让浏览器发送包含凭据的请求(即使是跨域源)
mode
:
'cors'
,
mode
:
'cors'
,
};
};
let
newOptions
=
{
...
defaultOptions
,
...
options
};
let
newOptions
=
{
...
defaultOptions
,
...
options
};
...
...
zyd_public/utils/setTokenAndInitSystem.js
浏览文件 @
2db1ce5d
...
@@ -5,88 +5,91 @@ import { getInfo } from '@/highOrderComponent/Service';
...
@@ -5,88 +5,91 @@ import { getInfo } from '@/highOrderComponent/Service';
import
{
Divider
}
from
'antd'
;
import
{
Divider
}
from
'antd'
;
import
config
from
'@/config/config'
;
import
config
from
'@/config/config'
;
import
{
import
{
setSysConfig
,
setSysConfig
,
getSysConfig
as
getSysConfigLocalStorage
,
getSysConfig
as
getSysConfigLocalStorage
,
}
from
'@/webPublic/zyd_private/utils/basiclayout'
;
}
from
'@/webPublic/zyd_private/utils/basiclayout'
;
import
{
getOneStopConfig
}
from
'@/webPublic/zyd_public/utils/utils'
;
import
{
getOneStopConfig
}
from
'@/webPublic/zyd_public/utils/utils'
;
function
formatUploadFile
(
fileList
)
{
function
formatUploadFile
(
fileList
)
{
if
(
!
fileList
||
!
Array
.
isArray
(
fileList
))
return
[];
if
(
!
fileList
||
!
Array
.
isArray
(
fileList
))
return
[];
return
JSON
.
stringify
(
return
JSON
.
stringify
(
fileList
.
map
((
i
)
=>
({
fileList
.
map
((
i
)
=>
({
uid
:
i
.
uid
,
uid
:
i
.
uid
,
name
:
i
.
name
,
name
:
i
.
name
,
status
:
i
.
status
,
status
:
i
.
status
,
url
:
i
.
filePath
||
i
.
response
.
filePath
,
url
:
i
.
filePath
||
i
.
response
.
filePath
,
})),
})),
);
);
}
}
export
const
valueTypes
=
{
export
const
valueTypes
=
{
0
:
{
0
:
{
name
:
'文本'
,
name
:
'文本'
,
inputComponent
:
'input'
,
inputComponent
:
'input'
,
},
},
1
:
{
1
:
{
name
:
'文件'
,
name
:
'文件'
,
inputComponent
:
'upload'
,
inputComponent
:
'upload'
,
formatToServer
:
formatUploadFile
,
// 新增或保存时候转换格式
formatToServer
:
formatUploadFile
,
// 新增或保存时候转换格式
formatToEdit
:
(
str
)
=>
{
formatToEdit
:
(
str
)
=>
{
const
fileArr
=
JSON
.
parse
(
str
);
const
fileArr
=
JSON
.
parse
(
str
);
if
(
!
Array
.
isArray
(
fileArr
))
return
[];
if
(
!
Array
.
isArray
(
fileArr
))
return
[];
return
fileArr
;
return
fileArr
;
},
// 编辑时,转换成可以在表单回显的格式
},
// 编辑时,转换成可以在表单回显的格式
render
:
(
val
)
=>
{
render
:
(
val
)
=>
{
// 在列表上的显示方式
// 在列表上的显示方式
return
JSON
.
parse
(
val
).
map
((
item
,
i
)
=>
(
return
JSON
.
parse
(
val
)
<>
.
map
((
item
,
i
)
=>
(
{
i
>
0
&&
<
Divider
type
=
"vertical"
/>
}
<>
<
a
{
i
>
0
&&
<
Divider
type
=
"vertical"
/>
}
target
=
"_blank"
<
a
rel
=
"noopener noreferrer"
target
=
"_blank"
key
=
{
item
.
uid
}
rel
=
"noopener noreferrer"
href
=
{
item
.
url
&&
(
item
.
url
.
startsWith
(
'http'
)
?
item
.
url
:
config
.
dfs
+
item
.
url
)}
>
key
=
{
item
.
uid
}
{
item
.
name
}
href
=
{
item
.
url
&&
(
item
.
url
.
startsWith
(
'http'
)
?
item
.
url
:
config
.
dfs
+
item
.
url
)}
>
<
/a
>
{
item
.
name
}
<
/
>
<
/a
>
));
<
/
>
},
));
},
},
2
:
{
},
name
:
'富文本'
,
2
:
{
inputComponent
:
'input'
,
name
:
'富文本'
,
},
inputComponent
:
'input'
,
},
};
};
export
function
getSysConfig
()
{
export
function
getSysConfig
()
{
return
getInfo
({
pageSize
:
10000
},
'/WebConfigApi/getPage?oauthPub=true'
).
then
((
res
)
=>
{
return
getInfo
({
pageSize
:
10000
},
'/WebConfigApi/getPage?oauthPub=true'
)
if
(
res
&&
res
.
rows
&&
res
.
rows
.
length
)
{
.
then
((
res
)
=>
{
const
formattered
=
res
.
rows
.
reduce
((
acc
,
cur
)
=>
{
if
(
res
&&
res
.
rows
&&
res
.
rows
.
length
)
{
console
.
log
(
valueTypes
,
cur
.
valueType
);
const
formattered
=
res
.
rows
.
reduce
((
acc
,
cur
)
=>
{
let
index
=
cur
.
valueType
||
'0'
;
console
.
log
(
valueTypes
,
cur
.
valueType
);
const
{
formatToEdit
}
=
valueTypes
[
index
];
let
index
=
cur
.
valueType
||
'0'
;
let
{
value
}
=
cur
;
const
{
formatToEdit
}
=
valueTypes
[
index
];
if
(
formatToEdit
&&
typeof
formatToEdit
===
'function'
)
{
let
{
value
}
=
cur
;
value
=
formatToEdit
(
value
);
if
(
formatToEdit
&&
typeof
formatToEdit
===
'function'
)
{
}
value
=
formatToEdit
(
value
);
return
{
}
...
acc
,
return
{
[
cur
.
dictCode
]:
value
,
...
acc
,
};
[
cur
.
dictCode
]:
value
,
},
{});
};
setSysConfig
(
formattered
);
},
{});
return
formattered
;
setSysConfig
(
formattered
);
}
return
formattered
;
});
}
});
}
}
export
default
async
function
setTokenAndInitSystem
()
{
let
token
=
getUrlInfo
().
token
;
if
(
token
&&
token
.
length
>
10
&&
getToken
()
!==
token
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
(
Promise
.
all
([
setToken
(
token
),
getSysConfig
(),
getOneStopConfig
()]));
});
}
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
(
true
);
});
export
default
function
setTokenAndInitSystem
()
{
let
token
=
getUrlInfo
().
token
;
if
(
token
&&
token
.
length
>
10
&&
getToken
()
!==
token
)
{
setToken
(
token
);
}
if
(
!
getSysConfigLocalStorage
())
{
getSysConfig
();
}
getOneStopConfig
();
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论