Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
5236b5ba
提交
5236b5ba
authored
12月 23, 2021
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 图片支持超链接设置
上级
4ea876fb
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
47 行增加
和
52 行删除
+47
-52
index.vue
frontend/src/components/canvas/components/Editor/index.vue
+1
-0
TextAttr.vue
frontend/src/components/canvas/components/TextAttr.vue
+2
-1
Picture.vue
frontend/src/components/canvas/custom-component/Picture.vue
+16
-4
component-list.js
.../src/components/canvas/custom-component/component-list.js
+1
-0
utils.js
frontend/src/components/canvas/utils/utils.js
+19
-0
index.vue
frontend/src/views/panel/edit/index.vue
+6
-38
PanelList.vue
frontend/src/views/panel/list/PanelList.vue
+2
-9
没有找到文件。
frontend/src/components/canvas/components/Editor/index.vue
浏览文件 @
5236b5ba
...
...
@@ -105,6 +105,7 @@
:element=
"item"
:out-style=
"getShapeStyleInt(item.style)"
:active=
"item === curComponent"
:edit-mode=
"'edit'"
:h=
"getShapeStyleIntDeDrag(item.style,'height')"
/>
</de-drag>
...
...
frontend/src/components/canvas/components/TextAttr.vue
浏览文件 @
5236b5ba
...
...
@@ -224,7 +224,8 @@ export default {
'borderWidth'
,
'borderRadius'
,
'opacity'
,
'borderColor'
'borderColor'
,
'hyperlinks'
],
// 过滤组件显示的属性
'custom'
:
[
...
...
frontend/src/components/canvas/custom-component/Picture.vue
浏览文件 @
5236b5ba
<
template
>
<div
style=
"overflow: hidden;width: 100%;height: 100%;"
>
<img
:src=
"propValue"
>
<img
v-if=
"!showLink"
:src=
"element.propValue"
>
<a
v-if=
"showLink"
:title=
"element.hyperlinks.content "
:target=
"element.hyperlinks.openMode "
:href=
"element.hyperlinks.content "
>
<img
:src=
"element.propValue"
>
</a>
</div>
</
template
>
<
script
>
export
default
{
props
:
{
// eslint-disable-next-line vue/require-default-prop
propValue
:
{
type
:
String
,
element
:
{
type
:
Object
,
require
:
true
},
editMode
:
{
type
:
String
,
require
:
false
,
default
:
'preview'
}
},
computed
:
{
showLink
()
{
return
this
.
editMode
===
'preview'
&&
this
.
element
&&
this
.
element
.
hyperlinks
&&
this
.
element
.
hyperlinks
.
enable
}
}
}
...
...
frontend/src/components/canvas/custom-component/component-list.js
浏览文件 @
5236b5ba
...
...
@@ -332,6 +332,7 @@ const list = [
icon
:
'iconfont icon-picture'
,
defaultClass
:
'text-filter'
,
mobileStyle
:
BASE_MOBILE_STYLE
,
hyperlinks
:
HYPERLINKS
,
style
:
{
width
:
400
,
height
:
200
,
...
...
frontend/src/components/canvas/utils/utils.js
浏览文件 @
5236b5ba
import
{
BASE_MOBILE_STYLE
,
HYPERLINKS
}
from
'@/components/canvas/custom-component/component-list'
export
function
deepCopy
(
target
)
{
if
(
typeof
target
===
'object'
)
{
const
result
=
Array
.
isArray
(
target
)
?
[]
:
{}
...
...
@@ -55,3 +57,20 @@ export function mobile2MainCanvas(mainSource, mobileSource) {
mainSource
.
mobileStyle
.
sizex
=
mobileSource
.
sizex
mainSource
.
mobileStyle
.
sizey
=
mobileSource
.
sizey
}
export
function
panelInit
(
componentDatas
)
{
componentDatas
.
forEach
(
item
=>
{
item
.
filters
=
(
item
.
filters
||
[])
item
.
linkageFilters
=
(
item
.
linkageFilters
||
[])
item
.
auxiliaryMatrix
=
(
item
.
auxiliaryMatrix
||
false
)
item
.
x
=
(
item
.
x
||
1
)
item
.
y
=
(
item
.
y
||
1
)
item
.
sizex
=
(
item
.
sizex
||
5
)
item
.
sizey
=
(
item
.
sizey
||
5
)
item
.
mobileSelected
=
(
item
.
mobileSelected
||
false
)
item
.
mobileStyle
=
(
item
.
mobileStyle
||
deepCopy
(
BASE_MOBILE_STYLE
))
if
(
item
.
type
===
'picture-add'
)
{
item
.
hyperlinks
=
(
item
.
hyperlinks
||
HYPERLINKS
)
}
})
}
frontend/src/views/panel/edit/index.vue
浏览文件 @
5236b5ba
...
...
@@ -220,8 +220,8 @@ import ViewSelect from '../ViewSelect'
import
SubjectSetting
from
'../SubjectSetting'
import
bus
from
'@/utils/bus'
import
Editor
from
'@/components/canvas/components/Editor/index'
import
{
deepCopy
}
from
'@/components/canvas/utils/utils'
import
componentList
,
{
BASE_MOBILE_STYLE
}
from
'@/components/canvas/custom-component/component-list'
// 左侧列表数据
import
{
deepCopy
,
panelInit
}
from
'@/components/canvas/utils/utils'
import
componentList
,
{
BASE_MOBILE_STYLE
,
HYPERLINKS
}
from
'@/components/canvas/custom-component/component-list'
// 左侧列表数据
import
{
mapState
}
from
'vuex'
import
{
uuid
}
from
'vue-uuid'
import
Toolbar
from
'@/components/canvas/components/Toolbar'
...
...
@@ -474,15 +474,7 @@ export default {
const
canvasStyleDataTemp
=
this
.
$store
.
state
.
panel
.
canvasStyleDataTemp
if
(
componentDataTemp
&&
canvasStyleDataTemp
)
{
const
componentDatas
=
JSON
.
parse
(
componentDataTemp
)
componentDatas
.
forEach
(
item
=>
{
item
.
filters
=
(
item
.
filters
||
[])
item
.
linkageFilters
=
(
item
.
linkageFilters
||
[])
item
.
auxiliaryMatrix
=
(
item
.
auxiliaryMatrix
||
false
)
item
.
x
=
(
item
.
x
||
1
)
item
.
y
=
(
item
.
y
||
1
)
item
.
sizex
=
(
item
.
sizex
||
5
)
item
.
sizey
=
(
item
.
sizey
||
5
)
})
panelInit
(
componentDatas
)
this
.
$store
.
commit
(
'setComponentData'
,
this
.
resetID
(
componentDatas
))
const
temp
=
JSON
.
parse
(
canvasStyleDataTemp
)
temp
.
refreshTime
=
(
temp
.
refreshTime
||
5
)
...
...
@@ -496,25 +488,12 @@ export default {
}
else
if
(
panelId
)
{
findOne
(
panelId
).
then
(
response
=>
{
const
componentDatas
=
JSON
.
parse
(
response
.
data
.
panelData
)
const
mobileComponentData
=
response
.
data
.
panelDataMobile
?
JSON
.
parse
(
response
.
data
.
panelDataMobile
)
:
[]
componentDatas
.
forEach
(
item
=>
{
item
.
filters
=
(
item
.
filters
||
[])
item
.
linkageFilters
=
(
item
.
linkageFilters
||
[])
item
.
auxiliaryMatrix
=
(
item
.
auxiliaryMatrix
||
false
)
item
.
x
=
(
item
.
x
||
1
)
item
.
y
=
(
item
.
y
||
1
)
item
.
sizex
=
(
item
.
sizex
||
5
)
item
.
sizey
=
(
item
.
sizey
||
5
)
item
.
mobileSelected
=
(
item
.
mobileSelected
||
false
)
item
.
mobileStyle
=
(
item
.
mobileStyle
||
deepCopy
(
BASE_MOBILE_STYLE
))
})
panelInit
(
componentDatas
)
this
.
$store
.
commit
(
'setComponentData'
,
this
.
resetID
(
componentDatas
))
this
.
$store
.
commit
(
'setMobileComponentData'
,
this
.
resetID
(
mobileComponentData
))
const
panelStyle
=
JSON
.
parse
(
response
.
data
.
panelStyle
)
panelStyle
.
refreshTime
=
(
panelStyle
.
refreshTime
||
5
)
panelStyle
.
refreshViewLoading
=
(
panelStyle
.
refreshViewLoading
||
false
)
panelStyle
.
refreshUnit
=
(
panelStyle
.
refreshUnit
||
'minute'
)
this
.
$store
.
commit
(
'setCanvasStyle'
,
panelStyle
)
this
.
$store
.
commit
(
'recordSnapshot'
,
'init'
)
// 记录快照
// 刷新联动信息
...
...
@@ -784,31 +763,20 @@ export default {
type
:
'picture-add'
,
label
:
'图片'
,
icon
:
''
,
hyperlinks
:
HYPERLINKS
,
propValue
:
fileResult
,
style
:
{
...
commonStyle
}
}
component
.
auxiliaryMatrix
=
_this
.
canvasStyleData
.
auxiliaryMatrix
if
(
_this
.
canvasStyleData
.
auxiliaryMatrix
)
{
component
.
x
=
_this
.
dropComponentInfo
.
x
component
.
y
=
_this
.
dropComponentInfo
.
y
component
.
sizex
=
_this
.
dropComponentInfo
.
sizex
component
.
sizey
=
_this
.
dropComponentInfo
.
sizey
component
.
style
.
left
=
(
_this
.
dropComponentInfo
.
x
-
1
)
*
_this
.
curCanvasScale
.
matrixStyleOriginWidth
component
.
style
.
top
=
(
_this
.
dropComponentInfo
.
y
-
1
)
*
_this
.
curCanvasScale
.
matrixStyleOriginHeight
component
.
style
.
width
=
_this
.
dropComponentInfo
.
sizex
*
_this
.
curCanvasScale
.
matrixStyleOriginWidth
component
.
style
.
height
=
_this
.
dropComponentInfo
.
sizey
*
_this
.
curCanvasScale
.
matrixStyleOriginHeight
}
else
{
component
.
auxiliaryMatrix
=
false
component
.
style
.
top
=
_this
.
dropComponentInfo
.
shadowStyle
.
y
component
.
style
.
left
=
_this
.
dropComponentInfo
.
shadowStyle
.
x
component
.
style
.
width
=
_this
.
dropComponentInfo
.
shadowStyle
.
width
component
.
style
.
height
=
_this
.
dropComponentInfo
.
shadowStyle
.
height
}
this
.
$store
.
commit
(
'addComponent'
,
{
component
:
component
})
this
.
$store
.
commit
(
'recordSnapshot'
,
'handleFileChange'
)
}
...
...
frontend/src/views/panel/list/PanelList.vue
浏览文件 @
5236b5ba
...
...
@@ -235,6 +235,7 @@ import {
}
from
'@/views/panel/panel'
import
TreeSelector
from
'@/components/TreeSelector'
import
{
queryAuthModel
}
from
'@/api/authModel/authModel'
import
{
panelInit
}
from
'@/components/canvas/utils/utils'
export
default
{
name
:
'PanelList'
,
...
...
@@ -647,15 +648,7 @@ export default {
// 加载视图数据
findOne
(
data
.
id
).
then
(
response
=>
{
const
componentDatas
=
JSON
.
parse
(
response
.
data
.
panelData
)
componentDatas
.
forEach
(
item
=>
{
item
.
filters
=
(
item
.
filters
||
[])
item
.
linkageFilters
=
(
item
.
linkageFilters
||
[])
item
.
auxiliaryMatrix
=
(
item
.
auxiliaryMatrix
||
false
)
item
.
x
=
(
item
.
x
||
1
)
item
.
y
=
(
item
.
y
||
1
)
item
.
sizex
=
(
item
.
sizex
||
5
)
item
.
sizey
=
(
item
.
sizey
||
5
)
})
panelInit
(
componentDatas
)
this
.
$store
.
commit
(
'setComponentData'
,
this
.
resetID
(
componentDatas
))
const
temp
=
JSON
.
parse
(
response
.
data
.
panelStyle
)
temp
.
refreshTime
=
(
temp
.
refreshTime
||
5
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论