Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
c9986ce1
提交
c9986ce1
authored
3月 14, 2022
作者:
钟是志
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
cdc66be8
8dbb169b
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
49 行增加
和
17 行删除
+49
-17
index.jsx
one_stop_public/filePreview/index.jsx
+2
-2
PictureSignature.js
one_stop_public/libs/PictureSignature/PictureSignature.js
+0
-0
ShowItem.js
one_stop_public/libs/PictureSignature/ShowItem.js
+19
-8
TreeList.js
one_stop_public/libs/formList/TreeList.js
+3
-3
index.js
one_stop_public/libs/formList/index.js
+3
-2
index.jsx
one_stop_public/location/index.jsx
+5
-1
utils.js
one_stop_public/utils/utils.js
+17
-1
没有找到文件。
one_stop_public/filePreview/index.jsx
浏览文件 @
c9986ce1
...
@@ -2,12 +2,12 @@
...
@@ -2,12 +2,12 @@
* web端文件预览功能
* web端文件预览功能
*/
*/
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
Popconfirm
}
from
'antd'
;
import
{
checkIsImage
}
from
'@/webPublic/one_stop_public/libs/UploadCom'
;
import
{
checkIsImage
}
from
'@/webPublic/one_stop_public/libs/UploadCom'
;
import
{
getModal
}
from
'@/webPublic/one_stop_public/utils/utils'
;
import
{
getModal
,
getPopconfirm
}
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
Modal
=
getModal
();
const
Modal
=
getModal
();
const
Popconfirm
=
getPopconfirm
();
export
default
class
index
extends
Component
{
export
default
class
index
extends
Component
{
...
...
one_stop_public/libs/PictureSignature/PictureSignature.js
浏览文件 @
c9986ce1
差异被折叠。
点击展开。
one_stop_public/libs/PictureSignature/ShowItem.js
浏览文件 @
c9986ce1
...
@@ -6,6 +6,8 @@ const oneSetItemP = {
...
@@ -6,6 +6,8 @@ const oneSetItemP = {
marginBottom
:
0
,
marginBottom
:
0
,
userSelect
:
'none'
,
userSelect
:
'none'
,
};
};
let
startX
=
0
;
let
startY
=
0
;
const
ShowItem
=
({
basicUrl
,
type
,
x
,
y
,
...
otherInfo
})
=>
{
const
ShowItem
=
({
basicUrl
,
type
,
x
,
y
,
...
otherInfo
})
=>
{
switch
(
type
)
{
switch
(
type
)
{
...
@@ -49,16 +51,22 @@ const ShowItem = ({ basicUrl, type, x, y, ...otherInfo }) => {
...
@@ -49,16 +51,22 @@ const ShowItem = ({ basicUrl, type, x, y, ...otherInfo }) => {
export
const
dragEventList
=
(
setOtherProps
,
otherProps
)
=>
{
export
const
dragEventList
=
(
setOtherProps
,
otherProps
)
=>
{
let
draggedRef
=
null
;
let
draggedRef
=
null
;
document
.
addEventListener
(
let
documentThis
=
window
?.
parent
?.
iframeParentComponent
?.
Modal
?
window
?.
parent
?.
document
:
document
;
documentThis
.
onmousedown
=
function
(
evt
){
startX
=
evt
.
offsetX
;
startY
=
evt
.
offsetY
;
}
documentThis
.
addEventListener
(
'dragstart'
,
'dragstart'
,
function
(
event
)
{
function
(
event
)
{
// 保存拖动元素的引用(ref.)
// 保存拖动元素的引用(ref.)
draggedRef
=
event
.
target
;
draggedRef
=
event
.
target
;
event
.
target
.
style
.
opacity
=
0.
5
;
event
.
target
.
style
.
opacity
=
0.
2
;
},
},
false
,
false
,
);
);
document
.
addEventListener
(
document
This
.
addEventListener
(
'dragend'
,
'dragend'
,
(
event
)
=>
{
(
event
)
=>
{
// 重置透明度
// 重置透明度
...
@@ -68,7 +76,7 @@ export const dragEventList = (setOtherProps, otherProps) => {
...
@@ -68,7 +76,7 @@ export const dragEventList = (setOtherProps, otherProps) => {
);
);
/* 放下目标节点时触发事件 */
/* 放下目标节点时触发事件 */
document
.
addEventListener
(
document
This
.
addEventListener
(
'dragover'
,
'dragover'
,
(
event
)
=>
{
(
event
)
=>
{
// 阻止默认动作
// 阻止默认动作
...
@@ -76,15 +84,18 @@ export const dragEventList = (setOtherProps, otherProps) => {
...
@@ -76,15 +84,18 @@ export const dragEventList = (setOtherProps, otherProps) => {
},
},
false
,
false
,
);
);
document
.
addEventListener
(
document
This
.
addEventListener
(
'drop'
,
'drop'
,
(
event
)
=>
{
(
event
)
=>
{
// 阻止默认动作(如打开一些元素的链接)
// 阻止默认动作(如打开一些元素的链接)
event
.
preventDefault
();
event
.
preventDefault
();
// 将拖动的元素到所选择的放置目标节点中
// 将拖动的元素到所选择的放置目标节点中
let
infoClientRect
=
document
.
getElementById
(
'dropZone'
).
getBoundingClientRect
();
let
infoClientRect
=
documentThis
.
getElementById
(
'dropZone'
).
getBoundingClientRect
();
let
leftNew
=
Math
.
ceil
(
event
.
clientX
-
infoClientRect
.
left
);
// console.log(startX, typeof startX, startY);
let
topNew
=
Math
.
ceil
(
event
.
clientY
-
infoClientRect
.
top
);
// return ;
let
leftNew
=
Math
.
ceil
(
event
.
clientX
-
infoClientRect
.
left
)
-
startX
;
let
topNew
=
Math
.
ceil
(
event
.
clientY
-
infoClientRect
.
top
)
-
startY
;
// console.log(leftNew, topNew);
if
(
leftNew
<
0
||
leftNew
>
infoClientRect
.
width
||
topNew
<
0
||
topNew
>
infoClientRect
.
height
){
if
(
leftNew
<
0
||
leftNew
>
infoClientRect
.
width
||
topNew
<
0
||
topNew
>
infoClientRect
.
height
){
console
.
log
(
'拖拽到了图片区域外部,不能进行拖拽'
);
console
.
log
(
'拖拽到了图片区域外部,不能进行拖拽'
);
return
false
;
return
false
;
...
...
one_stop_public/libs/formList/TreeList.js
浏览文件 @
c9986ce1
...
@@ -4,17 +4,14 @@ import {
...
@@ -4,17 +4,14 @@ import {
Card
,
Card
,
DatePicker
,
DatePicker
,
Divider
,
Divider
,
Table
,
Form
,
Form
,
Row
,
Row
,
Col
,
Col
,
Input
,
Input
,
InputNumber
,
InputNumber
,
message
,
message
,
Modal
,
Select
,
Select
,
Tree
,
Tree
,
Popconfirm
,
Tooltip
,
Tooltip
,
Spin
,
Spin
,
}
from
'antd'
;
}
from
'antd'
;
...
@@ -35,7 +32,10 @@ import { isEmpty } from 'lodash';
...
@@ -35,7 +32,10 @@ import { isEmpty } from 'lodash';
import
FilePreview
from
'@/webPublic/one_stop_public/filePreview'
;
import
FilePreview
from
'@/webPublic/one_stop_public/filePreview'
;
import
{
queryApiActionPath
}
from
'@/webPublic/one_stop_public/utils/queryConfig'
;
import
{
queryApiActionPath
}
from
'@/webPublic/one_stop_public/utils/queryConfig'
;
import
UploadCom
from
'@/webPublic/one_stop_public/libs/UploadCom'
;
import
UploadCom
from
'@/webPublic/one_stop_public/libs/UploadCom'
;
import
{
getModal
,
getPopconfirm
}
from
'@/webPublic/one_stop_public/utils/utils'
;
const
Popconfirm
=
getPopconfirm
();
const
Modal
=
getModal
();
const
FormItem
=
Form
.
Item
;
const
FormItem
=
Form
.
Item
;
let
AllWidth
=
0
;
// 表格总长度
let
AllWidth
=
0
;
// 表格总长度
const
{
RangePicker
}
=
DatePicker
;
const
{
RangePicker
}
=
DatePicker
;
...
...
one_stop_public/libs/formList/index.js
浏览文件 @
c9986ce1
...
@@ -9,9 +9,7 @@ import {
...
@@ -9,9 +9,7 @@ import {
Col
,
Col
,
Input
,
Input
,
message
,
message
,
Modal
,
Select
,
Select
,
Popconfirm
,
Tooltip
,
Tooltip
,
Spin
,
Spin
,
Popover
,
Popover
,
...
@@ -37,8 +35,11 @@ import { queryApiActionPath } from '@/webPublic/one_stop_public/utils/queryConfi
...
@@ -37,8 +35,11 @@ import { queryApiActionPath } from '@/webPublic/one_stop_public/utils/queryConfi
import
UploadCom
from
'@/webPublic/one_stop_public/libs/UploadCom'
;
import
UploadCom
from
'@/webPublic/one_stop_public/libs/UploadCom'
;
import
ButtonDiy
from
'../../App/ButtonDiy/ButtonDiy'
;
import
ButtonDiy
from
'../../App/ButtonDiy/ButtonDiy'
;
import
{
cloneDeep
}
from
'../../copy/index'
;
import
{
cloneDeep
}
from
'../../copy/index'
;
import
{
getPopconfirm
,
getModal
}
from
'@/webPublic/one_stop_public/utils/utils'
;
const
FormItem
=
Form
.
Item
;
const
FormItem
=
Form
.
Item
;
const
Popconfirm
=
getPopconfirm
();
const
Modal
=
getModal
();
let
AllWidth
=
0
;
// 表格总长度
let
AllWidth
=
0
;
// 表格总长度
const
{
RangePicker
}
=
DatePicker
;
const
{
RangePicker
}
=
DatePicker
;
...
...
one_stop_public/location/index.jsx
浏览文件 @
c9986ce1
...
@@ -4,10 +4,14 @@
...
@@ -4,10 +4,14 @@
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
styles
from
'./styles.less'
;
import
styles
from
'./styles.less'
;
import
Location
from
'./components'
;
import
Location
from
'./components'
;
import
{
Button
,
Popconfirm
}
from
'antd'
;
import
{
Button
}
from
'antd'
;
import
{
isEmpty
}
from
'lodash'
;
import
{
isEmpty
}
from
'lodash'
;
import
{
openToast
}
from
'./Notification'
;
import
{
openToast
}
from
'./Notification'
;
import
{
successToast
,
failToast
}
from
'./Toast'
;
import
{
successToast
,
failToast
}
from
'./Toast'
;
import
{
getPopconfirm
}
from
'@/webPublic/one_stop_public/utils/utils'
;
const
Popconfirm
=
getPopconfirm
();
export
default
class
location
extends
Component
{
export
default
class
location
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
...
...
one_stop_public/utils/utils.js
浏览文件 @
c9986ce1
/* eslint no-useless-escape:0 import/prefer-default-export:0 */
/* eslint no-useless-escape:0 import/prefer-default-export:0 */
import
{
Modal
}
from
'antd'
;
import
{
Modal
,
Popconfirm
}
from
'antd'
;
const
reg
=
/
(((
^https
?
:
(?:\/\/)?)(?:[
-;:&=
\+\$
,
\w]
+@
)?[
A-Za-z0-9.-
]
+
(?:
:
\d
+
)?
|
(?:
www.|
[
-;:&=
\+\$
,
\w]
+@
)[
A-Za-z0-9.-
]
+
)((?:\/[\+
~%
\/
.
\w
-_
]
*
)?\??(?:[
-
\+
=&;%@.
\w
_
]
*
)
#
?(?:[\w]
*
))?)
$/
;
const
reg
=
/
(((
^https
?
:
(?:\/\/)?)(?:[
-;:&=
\+\$
,
\w]
+@
)?[
A-Za-z0-9.-
]
+
(?:
:
\d
+
)?
|
(?:
www.|
[
-;:&=
\+\$
,
\w]
+@
)[
A-Za-z0-9.-
]
+
)((?:\/[\+
~%
\/
.
\w
-_
]
*
)?\??(?:[
-
\+
=&;%@.
\w
_
]
*
)
#
?(?:[\w]
*
))?)
$/
;
...
@@ -41,3 +41,19 @@ export const getModal = () => {
...
@@ -41,3 +41,19 @@ export const getModal = () => {
return
Modal
;
return
Modal
;
}
}
};
};
export
const
getPopconfirm
=
()
=>
{
if
(
window
?.
parent
?.
iframeParentComponent
?.
Popconfirm
)
{
return
window
?.
parent
?.
iframeParentComponent
?.
Popconfirm
;
}
else
{
return
Popconfirm
;
}
};
export
const
getMessage
=
()
=>
{
if
(
window
?.
parent
?.
iframeParentComponent
?.
Popconfirm
)
{
return
window
?.
parent
?.
iframeParentComponent
?.
message
;
}
else
{
return
message
;
}
};
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论