Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
c138342c
提交
c138342c
authored
12月 21, 2021
作者:
taojinlong
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of github.com:dataease/dataease into dev
上级
d312a362
2e099544
隐藏空白字符变更
内嵌
并排
正在显示
30 个修改的文件
包含
359 行增加
和
134 行删除
+359
-134
EmailTaskHandler.java
...ataease/job/sechedule/strategy/impl/EmailTaskHandler.java
+12
-14
XEmailTaskServer.java
...ain/java/io/dataease/plugins/server/XEmailTaskServer.java
+10
-7
enshrine.js
frontend/src/api/panel/enshrine.js
+6
-6
DateFormat.vue
...nd/src/components/canvas/components/Editor/DateFormat.vue
+2
-1
Preview.vue
frontend/src/components/canvas/components/Editor/Preview.vue
+40
-9
PreviewEject.vue
.../src/components/canvas/components/Editor/PreviewEject.vue
+23
-6
SettingMenu.vue
...d/src/components/canvas/components/Editor/SettingMenu.vue
+1
-1
index.vue
frontend/src/components/canvas/components/Editor/index.vue
+1
-1
UserView.vue
frontend/src/components/canvas/custom-component/UserView.vue
+0
-1
style.js
frontend/src/components/canvas/utils/style.js
+0
-2
DeDate.vue
frontend/src/components/widget/DeWidget/DeDate.vue
+11
-3
DeInputSearch.vue
frontend/src/components/widget/DeWidget/DeInputSearch.vue
+23
-4
DeNumberRange.vue
frontend/src/components/widget/DeWidget/DeNumberRange.vue
+10
-2
DeSelect.vue
frontend/src/components/widget/DeWidget/DeSelect.vue
+10
-2
DeSelectGrid.vue
frontend/src/components/widget/DeWidget/DeSelectGrid.vue
+12
-5
DeShowDate.vue
frontend/src/components/widget/DeWidget/DeShowDate.vue
+4
-4
DeTabs.vue
frontend/src/components/widget/DeWidget/DeTabs.vue
+7
-7
TimeDefault.vue
frontend/src/components/widget/DeWidget/TimeDefault.vue
+1
-1
TimeElec.vue
frontend/src/components/widget/DeWidget/TimeElec.vue
+7
-3
TimeSimple.vue
frontend/src/components/widget/DeWidget/TimeSimple.vue
+5
-3
en.js
frontend/src/lang/en.js
+3
-2
tw.js
frontend/src/lang/tw.js
+4
-3
zh.js
frontend/src/lang/zh.js
+4
-3
permission.js
frontend/src/permission.js
+1
-1
index.js
frontend/src/router/index.js
+5
-1
index.js
frontend/src/store/index.js
+5
-5
map.js
frontend/src/views/chart/chart/map/map.js
+14
-5
index.vue
frontend/src/views/panel/edit/index.vue
+58
-2
PDFPreExport.vue
frontend/src/views/panel/export/PDFPreExport.vue
+41
-17
PanelViewShow.vue
frontend/src/views/panel/list/PanelViewShow.vue
+39
-13
没有找到文件。
backend/src/main/java/io/dataease/job/sechedule/strategy/impl/EmailTaskHandler.java
浏览文件 @
c138342c
package
io
.
dataease
.
job
.
sechedule
.
strategy
.
impl
;
import
io.dataease.auth.entity.SysUserEntity
;
import
io.dataease.auth.entity.TokenInfo
;
import
io.dataease.auth.service.AuthUserService
;
...
...
@@ -26,11 +25,9 @@ import org.springframework.stereotype.Service;
import
javax.annotation.Resource
;
@Service
public
class
EmailTaskHandler
extends
TaskHandler
implements
Job
{
private
static
final
Integer
RUNING
=
0
;
private
static
final
Integer
SUCCESS
=
1
;
private
static
final
Integer
ERROR
=
-
1
;
...
...
@@ -38,7 +35,6 @@ public class EmailTaskHandler extends TaskHandler implements Job {
@Resource
private
AuthUserServiceImpl
authUserServiceImpl
;
@Override
protected
JobDataMap
jobDataMap
(
GlobalTaskEntity
taskEntity
)
{
JobDataMap
jobDataMap
=
new
JobDataMap
();
...
...
@@ -54,7 +50,8 @@ public class EmailTaskHandler extends TaskHandler implements Job {
@Override
public
void
execute
(
JobExecutionContext
context
)
throws
JobExecutionException
{
// 插件没有加载 空转
if
(!
CommonBeanFactory
.
getBean
(
AuthUserService
.
class
).
pluginLoaded
())
return
;
if
(!
CommonBeanFactory
.
getBean
(
AuthUserService
.
class
).
pluginLoaded
())
return
;
JobDataMap
jobDataMap
=
context
.
getJobDetail
().
getJobDataMap
();
GlobalTaskEntity
taskEntity
=
(
GlobalTaskEntity
)
jobDataMap
.
get
(
"taskEntity"
);
...
...
@@ -74,7 +71,6 @@ public class EmailTaskHandler extends TaskHandler implements Job {
}
public
EmailTaskHandler
proxy
()
{
return
CommonBeanFactory
.
getBean
(
EmailTaskHandler
.
class
);
}
...
...
@@ -106,12 +102,13 @@ public class EmailTaskHandler extends TaskHandler implements Job {
emailXpackService
.
saveInstance
(
taskInstance
);
}
@Async
public
void
sendReport
(
GlobalTaskInstance
taskInstance
,
XpackEmailTemplateDTO
emailTemplateDTO
,
SysUserEntity
user
)
{
public
void
sendReport
(
GlobalTaskInstance
taskInstance
,
XpackEmailTemplateDTO
emailTemplateDTO
,
SysUserEntity
user
)
{
EmailXpackService
emailXpackService
=
SpringContextUtil
.
getBean
(
EmailXpackService
.
class
);
try
{
byte
[]
bytes
=
emailXpackService
.
printData
(
panelUrl
(
emailTemplateDTO
.
getPanelId
()),
tokenByUser
(
user
),
buildPixel
(
emailTemplateDTO
));
byte
[]
bytes
=
emailXpackService
.
printData
(
panelUrl
(
emailTemplateDTO
.
getPanelId
()),
tokenByUser
(
user
),
buildPixel
(
emailTemplateDTO
));
// 下面继续执行发送邮件的
String
recipients
=
emailTemplateDTO
.
getRecipients
();
byte
[]
content
=
emailTemplateDTO
.
getContent
();
...
...
@@ -131,12 +128,14 @@ public class EmailTaskHandler extends TaskHandler implements Job {
private
XpackPixelEntity
buildPixel
(
XpackEmailTemplateDTO
emailTemplateDTO
)
{
XpackPixelEntity
pixelEntity
=
new
XpackPixelEntity
();
String
pixelStr
=
emailTemplateDTO
.
getPixel
();
if
(
StringUtils
.
isBlank
(
pixelStr
))
return
null
;
if
(
StringUtils
.
isBlank
(
pixelStr
))
return
null
;
String
[]
arr
=
pixelStr
.
split
(
"\\*"
);
if
(
arr
.
length
!=
2
)
return
null
;
if
(
arr
.
length
!=
2
)
return
null
;
try
{
int
x
=
Integer
.
parseInt
(
arr
[
0
]);
int
y
=
Integer
.
parseInt
(
arr
[
1
]);
int
x
=
Integer
.
parseInt
(
arr
[
0
]
.
trim
()
);
int
y
=
Integer
.
parseInt
(
arr
[
1
]
.
trim
()
);
pixelEntity
.
setX
(
String
.
valueOf
(
x
));
pixelEntity
.
setY
(
String
.
valueOf
(
y
));
return
pixelEntity
;
...
...
@@ -145,7 +144,6 @@ public class EmailTaskHandler extends TaskHandler implements Job {
}
}
private
String
tokenByUser
(
SysUserEntity
user
)
{
TokenInfo
tokenInfo
=
TokenInfo
.
builder
().
userId
(
user
.
getUserId
()).
username
(
user
.
getUsername
()).
build
();
String
token
=
JWTUtils
.
sign
(
tokenInfo
,
user
.
getPassword
());
...
...
backend/src/main/java/io/dataease/plugins/server/XEmailTaskServer.java
浏览文件 @
c138342c
package
io
.
dataease
.
plugins
.
server
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
io.dataease.commons.exception.DEException
;
...
...
@@ -34,7 +33,8 @@ public class XEmailTaskServer {
private
ScheduleService
scheduleService
;
@PostMapping
(
"/queryTasks/{goPage}/{pageSize}"
)
public
Pager
<
List
<
XpackTaskGridDTO
>>
queryTask
(
@PathVariable
int
goPage
,
@PathVariable
int
pageSize
,
@RequestBody
XpackGridRequest
request
)
{
public
Pager
<
List
<
XpackTaskGridDTO
>>
queryTask
(
@PathVariable
int
goPage
,
@PathVariable
int
pageSize
,
@RequestBody
XpackGridRequest
request
)
{
EmailXpackService
emailXpackService
=
SpringContextUtil
.
getBean
(
EmailXpackService
.
class
);
Page
<
Object
>
page
=
PageHelper
.
startPage
(
goPage
,
pageSize
,
true
);
List
<
XpackTaskGridDTO
>
tasks
=
emailXpackService
.
taskGrid
(
request
);
...
...
@@ -115,7 +115,8 @@ public class XEmailTaskServer {
}
@PostMapping
(
"/queryInstancies/{goPage}/{pageSize}"
)
public
Pager
<
List
<
XpackTaskInstanceDTO
>>
instancesGrid
(
@PathVariable
int
goPage
,
@PathVariable
int
pageSize
,
@RequestBody
XpackGridRequest
request
)
{
public
Pager
<
List
<
XpackTaskInstanceDTO
>>
instancesGrid
(
@PathVariable
int
goPage
,
@PathVariable
int
pageSize
,
@RequestBody
XpackGridRequest
request
)
{
EmailXpackService
emailXpackService
=
SpringContextUtil
.
getBean
(
EmailXpackService
.
class
);
Page
<
Object
>
page
=
PageHelper
.
startPage
(
goPage
,
pageSize
,
true
);
List
<
XpackTaskInstanceDTO
>
instances
=
emailXpackService
.
taskInstanceGrid
(
request
);
...
...
@@ -132,13 +133,15 @@ public class XEmailTaskServer {
private
XpackPixelEntity
buildPixel
(
String
pixel
)
{
if
(
StringUtils
.
isBlank
(
pixel
))
return
null
;
if
(
StringUtils
.
isBlank
(
pixel
))
return
null
;
String
[]
arr
=
pixel
.
split
(
"\\*"
);
if
(
arr
.
length
!=
2
)
return
null
;
if
(
arr
.
length
!=
2
)
return
null
;
try
{
XpackPixelEntity
result
=
new
XpackPixelEntity
();
int
x
=
Integer
.
parseInt
(
arr
[
0
]);
int
y
=
Integer
.
parseInt
(
arr
[
1
]);
int
x
=
Integer
.
parseInt
(
arr
[
0
]
.
trim
()
);
int
y
=
Integer
.
parseInt
(
arr
[
1
]
.
trim
()
);
result
.
setX
(
String
.
valueOf
(
x
));
result
.
setY
(
String
.
valueOf
(
y
));
return
result
;
...
...
frontend/src/api/panel/enshrine.js
浏览文件 @
c138342c
import
request
from
'@/utils/request'
export
function
saveEnshrine
(
panelGroupId
)
{
export
function
saveEnshrine
(
panelGroupId
,
loading
=
true
)
{
return
request
({
url
:
'/api/store/'
+
panelGroupId
,
method
:
'post'
,
loading
:
true
loading
:
loading
})
}
export
function
deleteEnshrine
(
id
)
{
export
function
deleteEnshrine
(
id
,
loading
=
true
)
{
return
request
({
url
:
'/api/store/remove/'
+
id
,
method
:
'post'
,
loading
:
true
loading
:
loading
})
}
export
function
enshrineList
(
data
)
{
export
function
enshrineList
(
data
,
loading
=
true
)
{
return
request
({
url
:
'/api/store/list'
,
method
:
'post'
,
loading
:
true
,
loading
:
loading
,
data
})
}
...
...
frontend/src/components/canvas/components/Editor/DateFormat.vue
浏览文件 @
c138342c
...
...
@@ -97,7 +97,8 @@ export default {
timeOptions
:
[
{
value
:
'hh:mm:ss'
,
label
:
'hh:mm:ss'
},
{
value
:
'hh时mm分ss秒'
,
label
:
'hh时mm分ss秒'
}
{
value
:
'hh时mm分ss秒'
,
label
:
'hh时mm分ss秒'
},
{
value
:
''
,
label
:
'无'
}
],
dateOptions
:
[
{
value
:
'yyyy-MM-dd'
,
label
:
'yyyy-MM-dd'
},
...
...
frontend/src/components/canvas/components/Editor/Preview.vue
浏览文件 @
c138342c
<
template
>
<div
class=
"bg"
:style=
"customStyle"
>
<div
id=
"canvasInfoMain"
ref=
"canvasInfoMain"
style=
"width: 100%;height: 100%
"
>
<div
id=
"canvasInfoMain"
ref=
"canvasInfoMain"
:style=
"canvasInfoMainStyle
"
>
<div
id=
"canvasInfoTemp"
ref=
"canvasInfoTemp"
...
...
@@ -73,6 +73,11 @@ export default {
event
:
'change'
},
props
:
{
// 后端截图
backScreenShot
:
{
type
:
Boolean
,
default
:
false
},
screenShot
:
{
type
:
Boolean
,
default
:
false
...
...
@@ -123,12 +128,21 @@ export default {
}
},
created
()
{
const
terminalInfo
=
this
.
$route
.
query
.
terminal
if
(
terminalInfo
)
{
this
.
terminal
=
terminalInfo
}
},
computed
:
{
canvasInfoMainStyle
()
{
if
(
this
.
backScreenShot
)
{
return
{
width
:
'100%'
,
height
:
this
.
mainHeight
}
}
else
{
return
{
width
:
'100%'
,
height
:
'100%'
}
}
},
customStyle
()
{
let
style
=
{
width
:
'100%'
...
...
@@ -146,6 +160,11 @@ export default {
}
}
}
if
(
this
.
backScreenShot
)
{
style
.
height
=
this
.
mainHeight
}
else
{
style
.
padding
=
'5px'
}
return
style
},
screenShotStyle
()
{
...
...
@@ -178,6 +197,7 @@ export default {
}
},
mounted
()
{
this
.
_isMobile
()
const
_this
=
this
const
erd
=
elementResizeDetectorMaker
()
// 监听主div变动事件
...
...
@@ -192,6 +212,7 @@ export default {
_this
.
$nextTick
(()
=>
{
// 将mainHeight 修改为px 临时解决html2canvas 截图不全的问题
_this
.
mainHeight
=
tempCanvas
.
scrollHeight
+
'px!important'
this
.
$emit
(
'mainHeightChange'
,
_this
.
mainHeight
)
})
})
eventBus
.
$on
(
'openChartDetailsDialog'
,
this
.
openChartDetailsDialog
)
...
...
@@ -206,6 +227,12 @@ export default {
clearInterval
(
this
.
timer
)
},
methods
:
{
_isMobile
()
{
console
.
log
(
'navigator.userAgent:'
+
navigator
.
userAgent
)
const
flag
=
navigator
.
userAgent
.
match
(
/
(
phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone
)
/i
)
this
.
terminal
=
flag
?
'mobile'
:
'pc'
// this.terminal = 'mobile'
},
canvasStyleDataInit
()
{
// 数据刷新计时器
this
.
searchCount
=
0
...
...
@@ -228,8 +255,13 @@ export default {
const
canvasHeight
=
document
.
getElementById
(
'canvasInfoMain'
).
offsetHeight
const
canvasWidth
=
document
.
getElementById
(
'canvasInfoMain'
).
offsetWidth
this
.
scaleWidth
=
(
canvasWidth
)
*
100
/
this
.
canvasStyleData
.
width
// 获取宽度比
this
.
scaleHeight
=
canvasHeight
*
100
/
this
.
canvasStyleData
.
height
// 获取高度比
this
.
$store
.
commit
(
'setPreviewCanvasScale'
,
(
this
.
scaleWidth
/
100
),
(
this
.
scaleHeight
/
100
))
// 如果是后端截图方式使用 的高度伸缩比例和宽度比例相同
if
(
this
.
backScreenShot
)
{
this
.
scaleHeight
=
this
.
scaleWidth
}
else
{
this
.
scaleHeight
=
canvasHeight
*
100
/
this
.
canvasStyleData
.
height
// 获取高度比
}
this
.
$store
.
commit
(
'setPreviewCanvasScale'
,
{
scaleWidth
:
(
this
.
scaleWidth
/
100
),
scaleHeight
:
(
this
.
scaleHeight
/
100
)
})
this
.
handleScaleChange
()
},
resetID
(
data
)
{
...
...
@@ -278,7 +310,7 @@ export default {
}
},
handleMouseDown
()
{
this
.
$store
.
commit
(
'setClickComponentStatus'
,
fals
e
)
this
.
$store
.
commit
(
'setClickComponentStatus'
,
fals
)
},
initMobileCanvas
()
{
this
.
$store
.
commit
(
'openMobileLayout'
)
...
...
@@ -289,7 +321,6 @@ export default {
<
style
lang=
"scss"
scoped
>
.bg
{
padding
:
5px
;
min-width
:
200px
;
min-height
:
300px
;
width
:
100%
;
...
...
frontend/src/components/canvas/components/Editor/PreviewEject.vue
浏览文件 @
c138342c
<
template
>
<div
v-loading=
"dataLoading"
class=
"bg"
>
<Preview
v-if=
"!dataLoading"
/>
<div
v-loading=
"dataLoading"
class=
"bg"
:style=
"bgStyle"
>
<Preview
v-if=
"!dataLoading"
:back-screen-shot=
"backScreenShot"
@
mainHeightChange=
"mainHeightChange"
/>
</div>
</
template
>
<
script
>
...
...
@@ -14,16 +14,33 @@ export default {
components
:
{
Preview
},
data
()
{
return
{
dataLoading
:
false
dataLoading
:
false
,
backScreenShot
:
false
,
mainHeight
:
'100vh!important'
}
},
computed
:
{
bgStyle
()
{
if
(
this
.
backScreenShot
)
{
return
{
height
:
this
.
mainHeight
}
}
else
{
return
{
height
:
'100vh!important'
}
}
}
},
mounted
()
{
this
.
restore
()
},
methods
:
{
mainHeightChange
(
mainHeight
)
{
this
.
mainHeight
=
mainHeight
},
restore
()
{
this
.
dataLoading
=
true
this
.
panelId
=
this
.
$route
.
path
.
split
(
'/'
)[
2
]
this
.
panelId
=
this
.
$route
.
params
.
reportId
if
(
this
.
$route
.
params
.
backScreenShot
!==
undefined
)
{
this
.
backScreenShot
=
this
.
$route
.
params
.
backScreenShot
}
// 加载视图数据
findOne
(
this
.
panelId
).
then
(
response
=>
{
this
.
dataLoading
=
false
...
...
@@ -80,8 +97,8 @@ export default {
.bg
{
width
:
100%
;
height
:
100vh
!
important
;
min-width
:
8
00px
;
min-height
:
6
00px
;
min-width
:
2
00px
;
min-height
:
3
00px
;
background-color
:
#f7f8fa
;
}
</
style
>
...
...
frontend/src/components/canvas/components/Editor/SettingMenu.vue
浏览文件 @
c138342c
...
...
@@ -142,7 +142,7 @@ export default {
})
},
addTab
()
{
bus
.
$emit
(
'add-new-tab'
)
bus
.
$emit
(
'add-new-tab'
,
this
.
curComponent
.
id
)
},
// 跳转设置
linkJumpSet
()
{
...
...
frontend/src/components/canvas/components/Editor/index.vue
浏览文件 @
c138342c
...
...
@@ -1195,7 +1195,7 @@ export default {
matrixStyleOriginWidth
:
this
.
matrixStyle
.
originWidth
,
matrixStyleOriginHeight
:
this
.
matrixStyle
.
originHeight
})
this
.
$store
.
commit
(
'setPreviewCanvasScale'
,
this
.
scalePointWidth
,
this
.
scalePointHeight
)
this
.
$store
.
commit
(
'setPreviewCanvasScale'
,
{
scaleWidth
:
this
.
scalePointWidth
,
scaleHeight
:
this
.
scalePointHeight
}
)
}
},
getShapeStyleIntDeDrag
(
style
,
prop
)
{
...
...
frontend/src/components/canvas/custom-component/UserView.vue
浏览文件 @
c138342c
...
...
@@ -299,7 +299,6 @@ export default {
// 监控缩放比例
previewCanvasScale
:
{
handler
(
newVal
,
oldVal
)
{
console
.
log
(
'previewCanvasScale:'
+
JSON
.
stringify
(
this
.
previewCanvasScale
))
this
.
destroyScaleTimeMachine
()
this
.
changeScaleIndex
++
this
.
chartScale
(
this
.
changeScaleIndex
)
...
...
frontend/src/components/canvas/utils/style.js
浏览文件 @
c138342c
...
...
@@ -94,8 +94,6 @@ export const customAttrTrans = {
'barWidth'
,
'lineWidth'
,
'lineSymbolSize'
,
'pieInnerRadius'
,
'pieOuterRadius'
,
'funnelWidth'
,
// 漏斗图 最大宽度
'tableTitleFontSize'
,
'tableItemFontSize'
,
...
...
frontend/src/components/widget/DeWidget/DeDate.vue
浏览文件 @
c138342c
...
...
@@ -51,9 +51,17 @@ export default {
defaultValueStr
()
{
if
(
!
this
.
element
||
!
this
.
element
.
options
||
!
this
.
element
.
options
.
value
)
return
''
return
this
.
element
.
options
.
value
.
toString
()
},
viewIds
()
{
if
(
!
this
.
element
||
!
this
.
element
.
options
||
!
this
.
element
.
options
.
attrs
.
viewIds
)
return
''
return
this
.
element
.
options
.
attrs
.
viewIds
.
toString
()
}
},
watch
:
{
'viewIds'
:
function
(
value
,
old
)
{
if
(
typeof
value
===
'undefined'
||
value
===
old
)
return
this
.
setCondition
()
},
'defaultValueStr'
:
function
(
value
,
old
)
{
if
(
this
.
element
.
serviceName
===
'timeDateWidget'
&&
this
.
element
.
options
.
attrs
.
default
.
isDynamic
)
{
// 如果设置了动态时间 不做任何操作
...
...
@@ -79,7 +87,7 @@ export default {
}
},
created
()
{
if
(
this
.
element
.
serviceName
===
'timeDateWidget'
&&
this
.
element
.
options
.
attrs
.
default
.
isDynamic
)
{
if
(
this
.
element
.
serviceName
===
'timeDateWidget'
&&
this
.
element
.
options
.
attrs
.
default
&&
this
.
element
.
options
.
attrs
.
default
.
isDynamic
)
{
if
(
this
.
element
.
options
.
attrs
.
default
)
{
const
widget
=
ApplicationContext
.
getService
(
this
.
element
.
serviceName
)
this
.
values
=
widget
.
dynamicDateFormNow
(
this
.
element
)
...
...
@@ -146,10 +154,10 @@ export default {
fillValueDerfault
()
{
const
defaultV
=
this
.
element
.
options
.
value
===
null
?
''
:
this
.
element
.
options
.
value
.
toString
()
if
(
this
.
element
.
options
.
attrs
.
type
===
'daterange'
)
{
if
(
defaultV
===
null
||
typeof
defaultV
===
'undefined'
||
defaultV
===
''
)
return
[]
if
(
defaultV
===
null
||
typeof
defaultV
===
'undefined'
||
defaultV
===
''
||
defaultV
===
'[object Object]'
)
return
[]
return
defaultV
.
split
(
','
).
map
(
item
=>
parseFloat
(
item
))
}
else
{
if
(
defaultV
===
null
||
typeof
defaultV
===
'undefined'
||
defaultV
===
''
)
return
null
if
(
defaultV
===
null
||
typeof
defaultV
===
'undefined'
||
defaultV
===
''
||
defaultV
===
'[object Object]'
)
return
null
return
parseFloat
(
defaultV
.
split
(
','
)[
0
])
}
}
...
...
frontend/src/components/widget/DeWidget/DeInputSearch.vue
浏览文件 @
c138342c
...
...
@@ -5,10 +5,10 @@
v-model=
"value"
resize=
"vertical"
:placeholder=
"$t(element.options.attrs.placeholder)"
:size=
"size"
@
input=
"valueChange"
@
keypress
.
enter
.
native=
"search"
@
dblclick=
"setEdit"
:size=
"size"
>
<el-button
slot=
"append"
icon=
"el-icon-search"
@
click=
"search"
/>
...
...
@@ -37,10 +37,24 @@ export default {
canEdit
:
false
}
},
computed
:
{
defaultValueStr
()
{
if
(
!
this
.
element
||
!
this
.
element
.
options
||
!
this
.
element
.
options
.
value
)
return
''
return
this
.
element
.
options
.
value
.
toString
()
},
viewIds
()
{
if
(
!
this
.
element
||
!
this
.
element
.
options
||
!
this
.
element
.
options
.
attrs
.
viewIds
)
return
''
return
this
.
element
.
options
.
attrs
.
viewIds
.
toString
()
}
},
watch
:
{
'element.options.value'
:
function
(
value
,
old
)
{
'viewIds'
:
function
(
value
,
old
)
{
if
(
typeof
value
===
'undefined'
||
value
===
old
)
return
this
.
setCondition
()
},
'defaultValueStr'
:
function
(
value
,
old
)
{
if
(
value
===
old
)
return
this
.
value
=
value
this
.
value
=
this
.
fillValueDerfault
()
this
.
search
()
}
},
...
...
@@ -60,7 +74,7 @@ export default {
setCondition
()
{
const
param
=
{
component
:
this
.
element
,
value
:
!
this
.
value
?
[]
:
[
this
.
value
],
value
:
!
this
.
value
?
[]
:
Array
.
isArray
(
this
.
value
)
?
this
.
value
:
[
this
.
value
],
operator
:
this
.
operator
}
this
.
inDraw
&&
this
.
$store
.
commit
(
'addViewFilter'
,
param
)
...
...
@@ -72,6 +86,11 @@ export default {
if
(
!
this
.
inDraw
)
{
this
.
element
.
options
.
value
=
val
}
},
fillValueDerfault
()
{
const
defaultV
=
this
.
element
.
options
.
value
===
null
?
''
:
this
.
element
.
options
.
value
.
toString
()
if
(
defaultV
===
null
||
typeof
defaultV
===
'undefined'
||
defaultV
===
''
||
defaultV
===
'[object Object]'
)
return
null
return
defaultV
.
split
(
','
)[
0
]
}
}
}
...
...
frontend/src/components/widget/DeWidget/DeNumberRange.vue
浏览文件 @
c138342c
...
...
@@ -3,11 +3,11 @@
<el-form
v-if=
"element.options!== null && element.options.attrs!==null"
ref=
"form"
:model=
"form"
:rules=
"rules"
>
<div
class=
"de-number-range-container"
>
<el-form-item
prop=
"min"
>
<el-input
v-model=
"form.min"
:placeholder=
"$t(element.options.attrs.placeholder_min)"
@
input=
"inputChange"
@
change=
"handleMinChange"
:size=
"size"
/>
<el-input
v-model=
"form.min"
:placeholder=
"$t(element.options.attrs.placeholder_min)"
:size=
"size"
@
input=
"inputChange"
@
change=
"handleMinChange"
/>
</el-form-item>
<span>
{{
$t
(
'denumberrange.split_placeholder'
)
}}
</span>
<el-form-item
prop=
"max"
>
<el-input
v-model=
"form.max"
:placeholder=
"$t(element.options.attrs.placeholder_max)"
@
input=
"inputChange"
@
change=
"handleMaxChange"
:size=
"size"
/>
<el-input
v-model=
"form.max"
:placeholder=
"$t(element.options.attrs.placeholder_max)"
:size=
"size"
@
input=
"inputChange"
@
change=
"handleMaxChange"
/>
</el-form-item>
</div>
</el-form>
...
...
@@ -60,9 +60,17 @@ export default {
return
JSON
.
stringify
([])
}
return
JSON
.
stringify
(
this
.
element
.
options
.
value
)
},
viewIds
()
{
if
(
!
this
.
element
||
!
this
.
element
.
options
||
!
this
.
element
.
options
.
attrs
.
viewIds
)
return
''
return
this
.
element
.
options
.
attrs
.
viewIds
.
toString
()
}
},
watch
:
{
'viewIds'
:
function
(
value
,
old
)
{
if
(
typeof
value
===
'undefined'
||
value
===
old
)
return
this
.
setCondition
()
},
'defaultvalues'
:
function
(
value
,
old
)
{
if
(
value
===
old
)
return
const
values
=
this
.
element
.
options
.
value
...
...
frontend/src/components/widget/DeWidget/DeSelect.vue
浏览文件 @
c138342c
...
...
@@ -62,10 +62,18 @@ export default {
defaultValueStr
()
{
if
(
!
this
.
element
||
!
this
.
element
.
options
||
!
this
.
element
.
options
.
value
)
return
''
return
this
.
element
.
options
.
value
.
toString
()
},
viewIds
()
{
if
(
!
this
.
element
||
!
this
.
element
.
options
||
!
this
.
element
.
options
.
attrs
.
viewIds
)
return
''
return
this
.
element
.
options
.
attrs
.
viewIds
.
toString
()
}
},
watch
:
{
'viewIds'
:
function
(
value
,
old
)
{
if
(
typeof
value
===
'undefined'
||
value
===
old
)
return
this
.
setCondition
()
},
'defaultValueStr'
:
function
(
value
,
old
)
{
if
(
value
===
old
)
return
this
.
value
=
this
.
fillValueDerfault
()
...
...
@@ -153,10 +161,10 @@ export default {
fillValueDerfault
()
{
const
defaultV
=
this
.
element
.
options
.
value
===
null
?
''
:
this
.
element
.
options
.
value
.
toString
()
if
(
this
.
element
.
options
.
attrs
.
multiple
)
{
if
(
defaultV
===
null
||
typeof
defaultV
===
'undefined'
||
defaultV
===
''
)
return
[]
if
(
defaultV
===
null
||
typeof
defaultV
===
'undefined'
||
defaultV
===
''
||
defaultV
===
'[object Object]'
)
return
[]
return
defaultV
.
split
(
','
)
}
else
{
if
(
defaultV
===
null
||
typeof
defaultV
===
'undefined'
||
defaultV
===
''
)
return
null
if
(
defaultV
===
null
||
typeof
defaultV
===
'undefined'
||
defaultV
===
''
||
defaultV
===
'[object Object]'
)
return
null
return
defaultV
.
split
(
','
)[
0
]
}
},
...
...
frontend/src/components/widget/DeWidget/DeSelectGrid.vue
浏览文件 @
c138342c
...
...
@@ -75,10 +75,17 @@ export default {
defaultValueStr
()
{
if
(
!
this
.
element
||
!
this
.
element
.
options
||
!
this
.
element
.
options
.
value
)
return
''
return
this
.
element
.
options
.
value
.
toString
()
},
viewIds
()
{
if
(
!
this
.
element
||
!
this
.
element
.
options
||
!
this
.
element
.
options
.
attrs
.
viewIds
)
return
''
return
this
.
element
.
options
.
attrs
.
viewIds
.
toString
()
}
},
watch
:
{
'viewIds'
:
function
(
value
,
old
)
{
if
(
typeof
value
===
'undefined'
||
value
===
old
)
return
this
.
setCondition
()
},
'defaultValueStr'
:
function
(
value
,
old
)
{
if
(
value
===
old
)
return
this
.
value
=
this
.
fillValueDerfault
()
...
...
@@ -119,7 +126,7 @@ export default {
initLoad
()
{
this
.
value
=
this
.
element
.
options
.
attrs
.
multiple
?
[]
:
null
if
(
this
.
element
.
options
.
attrs
.
fieldId
)
{
multFieldValues
(
this
.
element
.
options
.
attrs
.
fieldId
.
split
()).
then
(
res
=>
{
multFieldValues
(
this
.
element
.
options
.
attrs
.
fieldId
.
split
(
','
)).
then
(
res
=>
{
this
.
datas
=
this
.
optionDatas
(
res
.
data
)
if
(
this
.
element
.
options
.
attrs
.
multiple
)
{
this
.
checkAll
=
this
.
value
.
length
===
this
.
datas
.
length
...
...
@@ -158,12 +165,12 @@ export default {
return
this
.
value
.
split
(
','
)
},
fillValueDerfault
()
{
const
defaultV
=
this
.
element
.
options
.
value
const
defaultV
=
this
.
element
.
options
.
value
===
null
?
''
:
this
.
element
.
options
.
value
.
toString
()
if
(
this
.
element
.
options
.
attrs
.
multiple
)
{
if
(
defaultV
===
null
||
typeof
defaultV
===
'undefined'
||
defaultV
===
''
)
return
[]
if
(
defaultV
===
null
||
typeof
defaultV
===
'undefined'
||
defaultV
===
''
||
defaultV
===
'[object Object]'
)
return
[]
return
defaultV
.
split
(
','
)
}
else
{
if
(
defaultV
===
null
||
typeof
defaultV
===
'undefined'
||
defaultV
===
''
)
return
null
if
(
defaultV
===
null
||
typeof
defaultV
===
'undefined'
||
defaultV
===
''
||
defaultV
===
'[object Object]'
)
return
null
return
defaultV
.
split
(
','
)[
0
]
}
},
...
...
frontend/src/components/widget/DeWidget/DeShowDate.vue
浏览文件 @
c138342c
<
template
>
<div
style=
"height: 100%"
>
<time-default
v-if=
"element.formatInfo.openMode === '0'"
:ref=
"element.id"
:element=
"element"
/>
<time-default
v-if=
"element.formatInfo.openMode === '0'"
:ref=
"element.id"
:element=
"element"
/>
<time-elec
v-if=
"element.formatInfo.openMode === '1'"
:ref=
"element.id"
:element=
"element"
/>
<time-elec
v-if=
"element.formatInfo.openMode === '1'"
:ref=
"element.id"
:element=
"element"
/>
<time-simple
v-if=
"element.formatInfo.openMode === '2'"
:ref=
"element.id"
:element=
"element"
/>
<time-simple
v-if=
"element.formatInfo.openMode === '2'"
:ref=
"element.id"
:element=
"element"
/>
<time-complex
v-if=
"element.formatInfo.openMode === '3'"
:ref=
"element.id"
:element=
"element"
/>
<time-complex
v-if=
"element.formatInfo.openMode === '3'"
:ref=
"element.id"
:element=
"element"
/>
</div>
</
template
>
...
...
frontend/src/components/widget/DeWidget/DeTabs.vue
浏览文件 @
c138342c
...
...
@@ -134,10 +134,14 @@ export default {
tabList
:
[]
}
},
computed
:
{
...
mapState
([
'curComponent'
])
},
watch
:
{
curComponent
:
{
handler
(
newVal
,
oldVla
)
{
console
.
log
(
newVal
)
},
deep
:
true
}
...
...
@@ -147,11 +151,6 @@ export default {
this
.
tabList
=
this
.
element
.
options
&&
this
.
element
.
options
.
tabList
this
.
activeTabName
=
this
.
tabList
[
0
].
name
},
computed
:
{
...
mapState
([
'curComponent'
])
},
methods
:
{
beforeHandleCommond
(
item
,
param
)
{
return
{
...
...
@@ -244,7 +243,8 @@ export default {
this
.
styleChange
()
},
addNewTab
()
{
addNewTab
(
componentId
)
{
if
(
!
componentId
||
componentId
!==
this
.
element
.
id
)
return
const
curName
=
uuid
.
v1
()
const
tab
=
{
title
:
'NewTab'
,
...
...
frontend/src/components/widget/DeWidget/TimeDefault.vue
浏览文件 @
c138342c
...
...
@@ -44,7 +44,7 @@ export default {
},
formatDate
()
{
const
weekArr
=
[
'星期日'
,
'星期一'
,
'星期二'
,
'星期三'
,
'星期四'
,
'星期五'
,
'星期六'
]
let
timeFormat
=
this
.
element
.
formatInfo
.
timeFormat
||
'hh:mm:ss'
let
timeFormat
=
this
.
element
.
formatInfo
.
timeFormat
const
showWeek
=
this
.
element
.
formatInfo
.
showWeek
const
showDate
=
this
.
element
.
formatInfo
.
showDate
const
dateFormat
=
this
.
element
.
formatInfo
.
dateFormat
||
'yyyy-MM-dd'
...
...
frontend/src/components/widget/DeWidget/TimeElec.vue
浏览文件 @
c138342c
<
template
>
<div
id=
"clock"
:style=
"
{'--varBg': varBg}">
<p
class=
"date"
>
{{
date
}}
</p>
<p
class=
"time"
:style=
"
{'fontSize': (parseInt(element.style.fontSize) * 3) + 'px'}">
{{
time
}}
</p>
<p
v-if=
"time"
class=
"time"
:style=
"
{'fontSize': (parseInt(element.style.fontSize) * 3) + 'px'}">
{{
time
}}
</p>
</div>
</
template
>
...
...
@@ -66,7 +66,7 @@ export default {
},
updateTime
()
{
var
cd
=
new
Date
()
const
timeFormat
=
this
.
element
.
formatInfo
.
timeFormat
||
'hh:mm:ss'
const
timeFormat
=
this
.
element
.
formatInfo
.
timeFormat
const
showWeek
=
this
.
element
.
formatInfo
.
showWeek
const
showDate
=
this
.
element
.
formatInfo
.
showDate
const
dateFormat
=
this
.
element
.
formatInfo
.
dateFormat
||
'yyyy-MM-dd'
...
...
@@ -75,8 +75,12 @@ export default {
nowDate
=
cd
.
format
(
dateFormat
)
}
const
nowWeek
=
this
.
week
[
cd
.
getDay
()]
if
(
timeFormat
)
{
this
.
time
=
cd
.
format
(
timeFormat
)
}
else
{
this
.
time
=
null
}
this
.
time
=
cd
.
format
(
timeFormat
)
this
.
date
=
showWeek
?
(
nowDate
+
' '
+
nowWeek
)
:
nowDate
}
}
...
...
frontend/src/components/widget/DeWidget/TimeSimple.vue
浏览文件 @
c138342c
...
...
@@ -65,7 +65,7 @@ export default {
this
.
timer
=
setInterval
(
this
.
canvass
,
500
)
},
canvass
()
{
const
timeFormat
=
this
.
element
.
formatInfo
.
timeFormat
||
'hh:mm:ss'
const
timeFormat
=
this
.
element
.
formatInfo
.
timeFormat
const
dateFormat
=
this
.
element
.
formatInfo
.
dateFormat
||
'yyyy-MM-dd'
const
showWeek
=
this
.
element
.
formatInfo
.
showWeek
const
showDate
=
this
.
element
.
formatInfo
.
showDate
...
...
@@ -110,8 +110,10 @@ export default {
}
else
{
englishWeek
=
'Saturday'
}
const
simpleTime
=
time
.
format
(
timeFormat
)
let
simpleTime
=
''
if
(
timeFormat
)
{
simpleTime
=
time
.
format
(
timeFormat
)
}
let
nowDate
=
''
if
(
showDate
&&
dateFormat
)
{
nowDate
=
time
.
format
(
dateFormat
)
...
...
frontend/src/lang/en.js
浏览文件 @
c138342c
...
...
@@ -998,7 +998,8 @@ export default {
logic_exp
:
'Logic'
,
enum_exp
:
'Enum'
,
pls_slc
:
'Please Select'
,
filter_exp
:
'Filter Value'
filter_exp
:
'Filter Value'
,
filter_type
:
'Filter Type'
},
dataset
:
{
sheet_warn
:
'There are multiple sheet pages, and the first one is extracted by default'
,
...
...
@@ -1720,7 +1721,7 @@ export default {
once_a_week
:
'Once a week'
,
once_a_month
:
'Once a month'
,
complex_repeat
:
'Complex repeat'
,
pixel_tip
:
'Please select'
pixel_tip
:
'Please
code custom pixel(such as 2560 * 1600) or
select'
}
}
frontend/src/lang/tw.js
浏览文件 @
c138342c
...
...
@@ -996,9 +996,10 @@ export default {
and
:
'與'
,
or
:
'或'
,
logic_exp
:
'邏輯條件'
,
enum_exp
:
'
枚舉條件
'
,
enum_exp
:
'
字段枚舉值
'
,
pls_slc
:
'請選擇'
,
filter_exp
:
'過濾條件'
filter_exp
:
'過濾值'
,
filter_type
:
'過濾方式'
},
dataset
:
{
sheet_warn
:
'有多個 Sheet 頁,默認抽取第一個'
,
...
...
@@ -1732,7 +1733,7 @@ export default {
once_a_week
:
'每周一次'
,
once_a_month
:
'每月一次'
,
complex_repeat
:
'複雜重複'
,
pixel_tip
:
'可直接輸入分辨率或者選擇'
pixel_tip
:
'可直接輸入分辨率
(例如:2560 * 1600)
或者選擇'
}
}
frontend/src/lang/zh.js
浏览文件 @
c138342c
...
...
@@ -999,9 +999,10 @@ export default {
and
:
'与'
,
or
:
'或'
,
logic_exp
:
'逻辑条件'
,
enum_exp
:
'
枚举条件
'
,
enum_exp
:
'
字段枚举值
'
,
pls_slc
:
'请选择'
,
filter_exp
:
'过滤条件'
filter_exp
:
'过滤值'
,
filter_type
:
'过滤方式'
},
dataset
:
{
sheet_warn
:
'有多个 Sheet 页,默认抽取第一个'
,
...
...
@@ -1742,7 +1743,7 @@ export default {
once_a_week
:
'每周一次'
,
once_a_month
:
'每月一次'
,
complex_repeat
:
'复杂重复'
,
pixel_tip
:
'可直接输入自定义分辨率或选择'
pixel_tip
:
'可直接输入自定义分辨率
(例如:2560 * 1600)
或选择'
}
}
frontend/src/permission.js
浏览文件 @
c138342c
...
...
@@ -29,7 +29,7 @@ router.beforeEach(async(to, from, next) => {
NProgress
.
done
()
}
else
{
const
hasGetUserInfo
=
store
.
getters
.
name
if
(
hasGetUserInfo
||
to
.
path
.
indexOf
(
'/preview/'
)
>
-
1
||
to
.
path
.
indexOf
(
'/delink'
)
>
-
1
||
to
.
path
.
indexOf
(
'/nolic'
)
>
-
1
)
{
if
(
hasGetUserInfo
||
to
.
path
.
indexOf
(
'/preview
ScreenShot/'
)
>
-
1
||
to
.
path
.
indexOf
(
'/preview
/'
)
>
-
1
||
to
.
path
.
indexOf
(
'/delink'
)
>
-
1
||
to
.
path
.
indexOf
(
'/nolic'
)
>
-
1
)
{
next
()
store
.
dispatch
(
'permission/setCurrentPath'
,
to
.
path
)
}
else
{
...
...
frontend/src/router/index.js
浏览文件 @
c138342c
...
...
@@ -82,7 +82,11 @@ export const constantRoutes = [
component
:
()
=>
import
(
'@/components/canvas/components/Editor/PreviewEject'
),
hidden
:
true
},
{
path
:
'/previewScreenShot/:reportId/:backScreenShot'
,
component
:
()
=>
import
(
'@/components/canvas/components/Editor/PreviewEject'
),
hidden
:
true
},
{
path
:
'/previewFullScreen'
,
component
:
()
=>
import
(
'@/components/canvas/components/Editor/PreviewFullScreen'
),
...
...
frontend/src/store/index.js
浏览文件 @
c138342c
...
...
@@ -140,12 +140,12 @@ const data = {
setCurCanvasScale
(
state
,
curCanvasScale
)
{
state
.
curCanvasScale
=
curCanvasScale
},
setPreviewCanvasScale
(
state
,
scale
Width
,
scaleHeight
)
{
if
(
scaleWidth
)
{
state
.
previewCanvasScale
.
scalePointWidth
=
scaleWidth
setPreviewCanvasScale
(
state
,
scale
)
{
if
(
scale
.
scale
Width
)
{
state
.
previewCanvasScale
.
scalePointWidth
=
scale
.
scale
Width
}
if
(
scaleHeight
)
{
state
.
previewCanvasScale
.
scalePointHeight
=
scaleHeight
if
(
scale
.
scale
Height
)
{
state
.
previewCanvasScale
.
scalePointHeight
=
scale
.
scale
Height
}
},
setShapeStyle
({
curComponent
,
canvasStyleData
,
curCanvasScale
},
{
top
,
left
,
width
,
height
,
rotate
})
{
...
...
frontend/src/views/chart/chart/map/map.js
浏览文件 @
c138342c
...
...
@@ -13,7 +13,13 @@ export function baseMapOption(chart_option, chart) {
if
(
customAttr
.
tooltip
)
{
const
tooltip
=
JSON
.
parse
(
JSON
.
stringify
(
customAttr
.
tooltip
))
const
reg
=
new
RegExp
(
'
\
n'
,
'g'
)
tooltip
.
formatter
=
tooltip
.
formatter
.
replace
(
reg
,
'<br/>'
)
const
text
=
tooltip
.
formatter
.
replace
(
reg
,
'<br/>'
)
tooltip
.
formatter
=
function
(
params
)
{
const
a
=
params
.
seriesName
const
b
=
params
.
name
const
c
=
params
.
value
?
params
.
value
:
''
return
text
.
replaceAll
(
'{a}'
,
a
).
replaceAll
(
'{b}'
,
b
).
replaceAll
(
'{c}'
,
c
)
}
chart_option
.
tooltip
=
tooltip
}
}
...
...
@@ -22,13 +28,16 @@ export function baseMapOption(chart_option, chart) {
chart_option
.
title
.
text
=
chart
.
title
if
(
chart
.
data
.
series
.
length
>
0
)
{
chart_option
.
series
[
0
].
name
=
chart
.
data
.
series
[
0
].
name
// size
if
(
customAttr
.
size
)
{
chart_option
.
series
[
0
].
radius
=
[
customAttr
.
size
.
pieInnerRadius
+
'%'
,
customAttr
.
size
.
pieOuterRadius
+
'%'
]
}
// label
if
(
customAttr
.
label
)
{
const
text
=
customAttr
.
label
.
formatter
chart_option
.
series
[
0
].
label
=
customAttr
.
label
chart_option
.
series
[
0
].
label
.
formatter
=
function
(
params
)
{
const
a
=
params
.
seriesName
const
b
=
params
.
name
const
c
=
params
.
value
?
params
.
value
:
''
return
text
.
replaceAll
(
'{a}'
,
a
).
replaceAll
(
'{b}'
,
b
).
replaceAll
(
'{c}'
,
c
)
}
chart_option
.
series
[
0
].
labelLine
=
customAttr
.
label
.
labelLine
}
// visualMap
...
...
frontend/src/views/panel/edit/index.vue
浏览文件 @
c138342c
...
...
@@ -122,12 +122,24 @@
@
scroll=
"canvasScroll"
>
<el-row
class=
"this_mobile_canvas_top"
/>
<el-row
class=
"this_mobile_canvas_inner_top"
>
{{
panelInfo
.
name
}}
</el-row>
<el-row
id=
"canvasInfoMobile"
class=
"this_mobile_canvas_main"
:style=
"mobileCanvasStyle"
>
<Editor
ref=
"editorMobile"
:matrix-count=
"mobileMatrixCount"
:out-style=
"outStyle"
:scroll-top=
"scrollTop"
/>
<Editor
v-if=
"mobileEditorShow"
ref=
"editorMobile"
:matrix-count=
"mobileMatrixCount"
:out-style=
"outStyle"
:scroll-top=
"scrollTop"
/>
</el-row>
<el-row
class=
"this_mobile_canvas_inner_bottom"
>
<el-col
:span=
"12"
>
<i
v-if=
"!hasStar"
class=
"el-icon-star-off"
size=
"mini"
@
click=
"star"
/>
<i
v-if=
"hasStar"
class=
"el-icon-star-on"
style=
"color: #0a7be0;font-size: 18px"
size=
"mini"
@
click=
"unstar"
/>
</el-col>
<el-col
:span=
"12"
style=
"float: right"
>
<i
class=
"el-icon-refresh-right"
size=
"mini"
@
click=
"mobileRefresh"
/>
</el-col>
</el-row>
<el-row
class=
"this_mobile_canvas_bottom"
/>
</div>
...
...
@@ -233,6 +245,7 @@ import generateID from '@/components/canvas/utils/generateID'
import
TextAttr
from
'@/components/canvas/components/TextAttr'
import
{
queryPanelJumpInfo
}
from
'@/api/panel/linkJump'
import
ComponentWait
from
'@/views/panel/edit/ComponentWait'
import
{
deleteEnshrine
,
saveEnshrine
,
starStatus
}
from
'@/api/panel/enshrine'
export
default
{
name
:
'PanelEdit'
,
...
...
@@ -256,6 +269,8 @@ export default {
},
data
()
{
return
{
mobileEditorShow
:
true
,
hasStar
:
false
,
drawerSize
:
'300px'
,
visible
:
false
,
show
:
false
,
...
...
@@ -453,6 +468,7 @@ export default {
},
methods
:
{
init
(
panelId
)
{
this
.
initHasStar
()
// 如果临时画布有数据 则使用临时画布数据(视图编辑的时候 会保存临时画布数据)
const
componentDataTemp
=
this
.
$store
.
state
.
panel
.
componentDataTemp
const
canvasStyleDataTemp
=
this
.
$store
.
state
.
panel
.
canvasStyleDataTemp
...
...
@@ -512,6 +528,27 @@ export default {
})
}
},
star
()
{
this
.
panelInfo
&&
saveEnshrine
(
this
.
panelInfo
.
id
,
false
).
then
(
res
=>
{
this
.
hasStar
=
true
})
},
unstar
()
{
this
.
panelInfo
&&
deleteEnshrine
(
this
.
panelInfo
.
id
,
false
).
then
(
res
=>
{
this
.
hasStar
=
false
})
},
initHasStar
()
{
starStatus
(
this
.
panelInfo
.
id
,
false
).
then
(
res
=>
{
this
.
hasStar
=
res
.
data
})
},
mobileRefresh
()
{
this
.
mobileEditorShow
=
false
this
.
$nextTick
(()
=>
{
this
.
mobileEditorShow
=
true
})
},
save
()
{
},
...
...
@@ -964,11 +1001,30 @@ export default {
background-size
:
100%
100%
!
important
;
}
.this_mobile_canvas_inner_top
{
vertical-align
:
middle
;
text-align
:
center
;
background-color
:
#f7f8fa
;
height
:
30px
;
line-height
:
30px
;
font-size
:
14px
;
width
:
100%
;
}
.this_mobile_canvas_top
{
height
:
30px
;
width
:
100%
;
}
.this_mobile_canvas_inner_bottom
{
background-color
:
#f7f8fa
;
line-height
:
30px
;
vertical-align
:
middle
;
color
:
gray
;
height
:
30px
;
width
:
100%
;
}
.this_mobile_canvas_bottom
{
height
:
30px
;
width
:
100%
;
...
...
@@ -977,7 +1033,7 @@ export default {
.this_mobile_canvas_main
{
overflow-x
:
hidden
;
overflow-y
:
auto
;
height
:
calc
(
100%
-
6
0px
);;
height
:
calc
(
100%
-
12
0px
);;
background-color
:
#d7d9e3
;
background-size
:
100%
100%
!
important
;
}
...
...
frontend/src/views/panel/export/PDFPreExport.vue
浏览文件 @
c138342c
...
...
@@ -4,11 +4,11 @@
style=
"height: 100%;width: 100%;"
:element-loading-text=
"$t('panel.export_loading')"
element-loading-spinner=
"el-icon-loading"
element-loading-background=
"rgba(0, 0, 0,
0.8
)"
element-loading-background=
"rgba(0, 0, 0,
1
)"
>
<el-row
class=
"export_body_class"
>
<div
id=
"exportPdf"
ref=
"exportPdf"
>
<div
class=
"export_body_inner_class"
v-html=
"templateContentChange"
/>
<div
id=
"exportPdf"
ref=
"exportPdf"
:style=
"mainCanvasStyle"
>
<div
class=
"export_body_inner_class"
:style=
"templateHtmlStyle"
v-html=
"templateContentChange"
/>
</div>
</el-row>
<el-row
class=
"root_class"
>
...
...
@@ -26,6 +26,7 @@ import { pdfTemplateReplaceAll } from '@/utils/StringUtils.js'
export
default
{
name
:
'PDFPreExport'
,
components
:
{
},
props
:
{
// eslint-disable-next-line vue/require-default-prop
panelName
:
{
...
...
@@ -43,6 +44,7 @@ export default {
},
data
()
{
return
{
toExport
:
false
,
exportLoading
:
false
,
activeName
:
''
,
templateContentChange
:
''
,
...
...
@@ -60,7 +62,26 @@ export default {
}
},
computed
:
{
mainCanvasStyle
()
{
if
(
this
.
toExport
)
{
return
{
width
:
'4096px'
}
}
else
{
return
{
width
:
'100%'
}
}
},
templateHtmlStyle
()
{
if
(
this
.
toExport
)
{
return
{
fontSize
:
'48px!important'
}
}
else
{
return
{}
}
}
},
watch
:
{
templateContent
(
newVal
,
oldVla
)
{
...
...
@@ -92,19 +113,22 @@ export default {
const
_this
=
this
_this
.
exportLoading
=
true
setTimeout
(()
=>
{
html2canvas
(
document
.
getElementById
(
'exportPdf'
)).
then
(
function
(
canvas
)
{
_this
.
exportLoading
=
false
const
contentWidth
=
canvas
.
width
const
contentHeight
=
canvas
.
height
const
pageData
=
canvas
.
toDataURL
(
'image/jpeg'
,
1.0
)
const
lp
=
contentWidth
>
contentHeight
?
'l'
:
'p'
const
PDF
=
new
JsPDF
(
lp
,
'pt'
,
[
contentWidth
,
contentHeight
])
PDF
.
addImage
(
pageData
,
'JPEG'
,
0
,
0
,
contentWidth
,
contentHeight
)
PDF
.
save
(
_this
.
panelName
+
'.pdf'
)
_this
.
$emit
(
'closePreExport'
)
}
)
},
50
)
_this
.
toExport
=
true
setTimeout
(()
=>
{
html2canvas
(
document
.
getElementById
(
'exportPdf'
)).
then
(
function
(
canvas
)
{
_this
.
exportLoading
=
false
const
contentWidth
=
canvas
.
width
const
contentHeight
=
canvas
.
height
const
pageData
=
canvas
.
toDataURL
(
'image/jpeg'
,
1.0
)
const
lp
=
contentWidth
>
contentHeight
?
'l'
:
'p'
const
PDF
=
new
JsPDF
(
lp
,
'pt'
,
[
contentWidth
,
contentHeight
])
PDF
.
addImage
(
pageData
,
'JPEG'
,
0
,
0
,
contentWidth
,
contentHeight
)
PDF
.
save
(
_this
.
panelName
+
'.pdf'
)
_this
.
$emit
(
'closePreExport'
)
}
)
},
1500
)
},
500
)
}
}
...
...
frontend/src/views/panel/list/PanelViewShow.vue
浏览文件 @
c138342c
...
...
@@ -4,7 +4,7 @@
style=
"height: 100%;width: 100%;"
:element-loading-text=
"$t('panel.data_loading')"
element-loading-spinner=
"el-icon-loading"
element-loading-background=
"rgba(0, 0, 0,
0.8
)"
element-loading-background=
"rgba(0, 0, 0,
1
)"
>
<el-col
v-if=
"panelInfo.name.length>0"
class=
"panel-design"
>
...
...
@@ -73,9 +73,10 @@
</el-row>
<!-- 仪表板预览区域-->
<el-row
class=
"panel-design-preview"
>
<div
id=
"imageWrapper"
ref=
"imageWrapper"
style=
"width: 100%;height: 100%"
>
<!--
<div
id=
"imageWrapper"
ref=
"imageWrapper"
style=
"width: 4096px;height: 2160px"
>
-->
<div
id=
"imageWrapper"
ref=
"imageWrapper"
:style=
"imageWrapperStyle"
>
<fullscreen
style=
"height: 100%;background: #f7f8fa;overflow-y: auto"
:fullscreen
.
sync=
"fullscreen"
>
<Preview
v-if=
"showMain"
:in-screen=
"!fullscreen"
:show-type=
"'width'"
:screen-shot=
"dataLoading"
/>
<Preview
v-if=
"showMain
Flag
"
:in-screen=
"!fullscreen"
:show-type=
"'width'"
:screen-shot=
"dataLoading"
/>
</fullscreen>
</div>
</el-row>
...
...
@@ -129,6 +130,7 @@ import { starStatus, saveEnshrine, deleteEnshrine } from '@/api/panel/enshrine'
import
bus
from
'@/utils/bus'
import
{
queryAll
}
from
'@/api/panel/pdfTemplate'
import
ShareHead
from
'@/views/panel/GrantAuth/ShareHead'
import
JsPDF
from
'jspdf'
export
default
{
name
:
'PanelViewShow'
,
...
...
@@ -154,10 +156,27 @@ export default {
pdfExportShow
:
false
,
snapshotInfo
:
''
,
showType
:
0
,
dataLoading
:
false
dataLoading
:
false
,
exporting
:
false
}
},
computed
:
{
imageWrapperStyle
()
{
if
(
this
.
exporting
)
{
return
{
width
:
'4096px'
,
height
:
'2160px'
}
}
else
{
return
{
width
:
'100%'
,
height
:
'100%'
}
}
},
showMainFlag
()
{
return
this
.
showMain
},
panelInfo
()
{
return
this
.
$store
.
state
.
panel
.
panelInfo
},
...
...
@@ -252,17 +271,24 @@ export default {
},
downloadAsPDF
()
{
// this.pdfExportShow = true
//
this
.
dataLoading
=
true
setTimeout
(()
=>
{
html2canvas
(
document
.
getElementById
(
'canvasInfoTemp'
)).
then
(
canvas
=>
{
const
snapshot
=
canvas
.
toDataURL
(
'image/jpeg'
,
1
)
// 是图片质量
this
.
dataLoading
=
false
if
(
snapshot
!==
''
)
{
this
.
snapshotInfo
=
snapshot
this
.
pdfExportShow
=
true
}
})
},
50
)
this
.
exporting
=
true
setTimeout
(()
=>
{
html2canvas
(
document
.
getElementById
(
'canvasInfoTemp'
)).
then
(
canvas
=>
{
const
snapshot
=
canvas
.
toDataURL
(
'image/jpeg'
,
1
)
// 是图片质量
this
.
dataLoading
=
false
this
.
exporting
=
false
if
(
snapshot
!==
''
)
{
this
.
snapshotInfo
=
snapshot
this
.
pdfExportShow
=
true
}
})
},
1500
)
},
500
)
},
refreshTemplateInfo
()
{
this
.
templateInfo
=
{}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论