Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
c7cf7505
提交
c7cf7505
authored
5月 21, 2021
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 移动导入模板位置
上级
20c0b4b6
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
303 行增加
和
76 行删除
+303
-76
PanelTemplateController.java
...io/dataease/controller/panel/PanelTemplateController.java
+3
-1
V3__init_data.sql
backend/src/main/resources/db/migration/V3__init_data.sql
+1
-0
messages_en_US.properties
backend/src/main/resources/i18n/messages_en_US.properties
+2
-0
messages_zh_CN.properties
backend/src/main/resources/i18n/messages_zh_CN.properties
+2
-0
messages_zh_TW.properties
backend/src/main/resources/i18n/messages_zh_TW.properties
+38
-36
template.js
frontend/src/api/system/template.js
+38
-0
en.js
frontend/src/lang/en.js
+1
-0
tw.js
frontend/src/lang/tw.js
+1
-0
zh.js
frontend/src/lang/zh.js
+1
-0
TemplateAllList.vue
frontend/src/views/panel/list/EditPanel/TemplateAllList.vue
+6
-11
index.vue
frontend/src/views/panel/list/EditPanel/index.vue
+3
-3
PanelList.vue
frontend/src/views/panel/list/PanelList.vue
+2
-2
TemplateImport.vue
...end/src/views/panel/template/component/TemplateImport.vue
+136
-0
TemplateItem.vue
frontend/src/views/panel/template/component/TemplateItem.vue
+6
-2
TemplateList.vue
frontend/src/views/panel/template/component/TemplateList.vue
+14
-8
index.vue
frontend/src/views/panel/template/index.vue
+49
-13
没有找到文件。
backend/src/main/java/io/dataease/controller/panel/PanelTemplateController.java
浏览文件 @
c7cf7505
package
io
.
dataease
.
controller
.
panel
;
import
io.dataease.base.domain.PanelTemplateWithBLOBs
;
import
io.dataease.controller.handler.annotation.I18n
;
import
io.dataease.controller.request.panel.PanelTemplateRequest
;
import
io.dataease.dto.panel.PanelTemplateDTO
;
import
io.dataease.service.panel.PanelTemplateService
;
...
...
@@ -22,6 +23,7 @@ public class PanelTemplateController {
private
PanelTemplateService
panelTemplateService
;
@PostMapping
(
"/templateList"
)
@I18n
public
List
<
PanelTemplateDTO
>
templateList
(
@RequestBody
PanelTemplateRequest
request
)
{
return
panelTemplateService
.
templateList
(
request
);
}
...
...
@@ -31,7 +33,7 @@ public class PanelTemplateController {
return
panelTemplateService
.
save
(
request
);
}
@
Post
Mapping
(
"/delete/{id}"
)
@
Delete
Mapping
(
"/delete/{id}"
)
public
void
delete
(
@PathVariable
String
id
)
{
panelTemplateService
.
delete
(
id
);
}
...
...
backend/src/main/resources/db/migration/V3__init_data.sql
浏览文件 @
c7cf7505
...
...
@@ -160,6 +160,7 @@ COMMIT;
INSERT
INTO
`panel_template`
(
`id`
,
`name`
,
`pid`
,
`level`
,
`node_type`
,
`create_by`
,
`create_time`
,
`snapshot`
,
`template_type`
,
`template_style`
,
`template_data`
,
`dynamic_data`
)
VALUES
(
'self'
,
'用户模板'
,
''
,
-
1
,
'folder'
,
NULL
,
NULL
,
''
,
'self'
,
''
,
''
,
NULL
);
INSERT
INTO
`panel_template`
(
`id`
,
`name`
,
`pid`
,
`level`
,
`node_type`
,
`create_by`
,
`create_time`
,
`snapshot`
,
`template_type`
,
`template_style`
,
`template_data`
,
`dynamic_data`
)
VALUES
(
'system'
,
'系统模板'
,
''
,
-
1
,
'folder'
,
NULL
,
NULL
,
NULL
,
'system'
,
NULL
,
NULL
,
NULL
);
-- ----------------------------
backend/src/main/resources/i18n/messages_en_US.properties
浏览文件 @
c7cf7505
...
...
@@ -226,3 +226,5 @@ i18n_auth_view=View
i18n_auth_use
=
Use
i18n_auth_export
=
Export
i18n_auth_manage
=
Manage
i18n_template_system
=
System Template
i18n_template_self
=
Self Template
backend/src/main/resources/i18n/messages_zh_CN.properties
浏览文件 @
c7cf7505
...
...
@@ -227,3 +227,5 @@ i18n_auth_view=查看
i18n_auth_use
=
使用
i18n_auth_export
=
导出
i18n_auth_manage
=
管理
i18n_template_system
=
系统模板
i18n_template_self
=
用户模板
backend/src/main/resources/i18n/messages_zh_TW.properties
浏览文件 @
c7cf7505
...
...
@@ -159,7 +159,7 @@ quota_duration_excess_organization=壓測時長超過組織限額
license_valid_license_error
=
授權驗證失敗
license_valid_license_code
=
授權碼已經存在
import_xmind_count_error
=
思維導圖導入用例數量不能超過 500 條
import_xmind_not_found
=
未找到
测试
用例
import_xmind_not_found
=
未找到
測試
用例
test_review_task_notice
=
測試評審任務通知
test_track.length_less_than
=
標題過長,字數必須小於
...
...
@@ -186,44 +186,46 @@ automation_exec_info=沒有測試步驟,無法執行
authsource_name_already_exists
=
認證源名稱已經存在
authsource_name_is_null
=
認證源名稱不能為空
authsource_configuration_is_null
=
認證源配置不能為空
个
人信息=個人信息
仪表盘
=儀表盤
修改密
码
=修改密碼
创建用户
=創建用戶
创建组织
=創建組織
创建菜单
=創建菜單
创
建角色=創建角色
创建连
接=創建鏈接
删除用户
=刪除用戶
删除组织
=刪除組織
删除菜单
=刪除菜單
删
除角色=刪除角色
删除连接=删
除鏈接
参数
管理=參數管理
数据
源=數據源
数据源表单
=數據源表單
数据
集=數據集
权
限管理=權限管理
校
验连
接=校驗鏈接
個
人信息=個人信息
儀表盤
=儀表盤
修改密
碼
=修改密碼
創建用戶
=創建用戶
創建組織
=創建組織
創建菜單
=創建菜單
創
建角色=創建角色
創建連
接=創建鏈接
刪除用戶
=刪除用戶
刪除組織
=刪除組織
刪除菜單
=刪除菜單
刪
除角色=刪除角色
刪除連接=刪
除鏈接
參數
管理=參數管理
數據
源=數據源
數據源表單
=數據源表單
數據
集=數據集
權
限管理=權限管理
校
驗連
接=校驗鏈接
模板管理=模板管理
用
户
管理=用戶管理
用
户表单
=用戶表單
系
统
管理=系統管理
组织
管理=組織管理
组织表单
=組織表單
编辑用户
=編輯用戶
编辑组织
=編輯組織
编辑菜单
=編輯菜單
编辑
角色=編輯角色
编辑连
接=編輯鏈接
菜
单
管理=菜單管理
菜
单表单
=表單管理
视图
=視圖
用
戶
管理=用戶管理
用
戶表單
=用戶表單
系
統
管理=系統管理
組織
管理=組織管理
組織表單
=組織表單
編輯用戶
=編輯用戶
編輯組織
=編輯組織
編輯菜單
=編輯菜單
編輯
角色=編輯角色
編輯連
接=編輯鏈接
菜
單
管理=菜單管理
菜
單表單
=表單管理
視圖
=視圖
角色管理=角色管理
角色表
单
=角色表單
重置密
码
=重置密碼
关于
=關於
角色表
單
=角色表單
重置密
碼
=重置密碼
關於
=關於
i18n_auth_view
=
查看
i18n_auth_use
=
使用
i18n_auth_export
=
導出
i18n_auth_manage
=
管理
i18n_template_system
=
系統模板
i18n_template_self
=
用戶模板
frontend/src/api/system/template.js
0 → 100644
浏览文件 @
c7cf7505
import
request
from
'@/utils/request'
export
function
save
(
data
)
{
return
request
({
url
:
'/template/save'
,
data
:
data
,
method
:
'post'
})
}
export
function
templateDelete
(
id
)
{
return
request
({
url
:
'/template/delete/'
+
id
,
method
:
'delete'
})
}
export
function
showTemplateList
(
data
)
{
return
request
({
url
:
'/template/templateList'
,
data
:
data
,
method
:
'post'
})
}
export
function
findOne
(
id
)
{
return
request
({
url
:
'/template/findOne/'
+
id
,
method
:
'get'
})
}
export
function
find
(
data
)
{
return
request
({
url
:
'/template/find'
,
data
:
data
,
method
:
'post'
})
}
frontend/src/lang/en.js
浏览文件 @
c7cf7505
...
...
@@ -828,6 +828,7 @@ export default {
delete
:
'Delete'
,
move_to
:
'Move'
,
rename
:
'Rename'
,
import
:
'Import'
,
tips
:
'Tips'
,
confirm_delete
:
'Confirm Delete'
,
delete_success
:
'Delete Success'
,
...
...
frontend/src/lang/tw.js
浏览文件 @
c7cf7505
...
...
@@ -828,6 +828,7 @@ export default {
delete
:
'刪除'
,
move_to
:
'移動到'
,
rename
:
'重命名'
,
import
:
'导入模板'
,
tips
:
'提示'
,
confirm_delete
:
'確認刪除'
,
delete_success
:
'刪除成功'
,
...
...
frontend/src/lang/zh.js
浏览文件 @
c7cf7505
...
...
@@ -830,6 +830,7 @@ export default {
delete
:
'删除'
,
move_to
:
'移动到'
,
rename
:
'重命名'
,
import
:
'导入模板'
,
tips
:
'提示'
,
confirm_delete
:
'确认删除'
,
delete_success
:
'删除成功'
,
...
...
frontend/src/views/panel/list/EditPanel/TemplateAllList.vue
浏览文件 @
c7cf7505
...
...
@@ -22,22 +22,17 @@
@
node-click=
"nodeClick"
>
<span
slot-scope=
"
{ node, data }" class="custom-tree-node">
<span>
<span
style=
"display: flex; flex: 1 1 0%; width: 0px;"
>
<span
v-if=
"data.nodeType==='template'"
>
<el-button
icon=
"el-icon-picture-outline"
type=
"text"
/>
<svg-icon
icon-class=
"panel"
class=
"ds-icon-scene"
/>
</span>
<span
v-if=
"data.nodeType==='folder'"
>
<el-button
icon=
"el-icon-folder"
type=
"text"
/>
<i
class=
"el-icon-folder"
/>
</span>
<span
style=
"margin-left: 6px"
>
{{
data
.
name
}}
</span>
<span
style=
"margin-left: 6px
;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
"
>
{{
data
.
name
}}
</span>
</span>
</span></el-tree>
</span>
</el-tree>
</el-row>
</el-row>
</el-col>
...
...
frontend/src/views/panel/list/EditPanel/index.vue
浏览文件 @
c7cf7505
...
...
@@ -3,7 +3,7 @@
<el-row
v-if=
"editPanel.optType==='new' && editPanel.panelInfo.nodeType==='panel'"
>
<el-col
:span=
"18"
style=
"height: 40px"
>
<el-radio
v-model=
"inputType"
label=
"self"
>
{{
$t
(
'panel.custom'
)
}}
</el-radio>
<
el-radio
v-model=
"inputType"
label=
"import"
>
{{
$t
(
'panel.import_template'
)
}}
</el-radio
>
<
!--
<el-radio
v-model=
"inputType"
label=
"import"
>
{{
$t
(
'panel.import_template'
)
}}
</el-radio>
--
>
<el-radio
v-model=
"inputType"
label=
"copy"
>
{{
$t
(
'panel.copy_template'
)
}}
</el-radio>
</el-col>
<el-col
v-if=
"inputType==='import'"
:span=
"6"
>
...
...
@@ -18,7 +18,7 @@
</el-col>
</el-row>
<el-row
v-if=
"inputType==='copy'"
class=
"preview"
>
<el-col
:span=
"8"
style=
"overflow: auto"
>
<el-col
:span=
"8"
style=
"overflow
-y
: auto"
>
<template-all-list
:template-list=
"templateList"
@
showCurrentTemplateInfo=
"showCurrentTemplateInfo"
/>
</el-col>
<el-col
:span=
"16"
:style=
"classBackground"
class=
"preview-show"
/>
...
...
@@ -157,7 +157,7 @@ export default {
margin-top
:
5px
;
border
:
1px
solid
#E6E6E6
;
height
:
300px
!important
;
overflow
:
auto
;
overflow
:
hidden
;
background-size
:
100%
100%
!important
;
}
.preview-show
{
...
...
frontend/src/views/panel/list/PanelList.vue
浏览文件 @
c7cf7505
...
...
@@ -48,7 +48,7 @@
<svg-icon
icon-class=
"panel"
class=
"ds-icon-scene"
/>
</span>
<span
v-if=
"data.nodeType === 'folder'"
>
<
svg-icon
icon-class=
"folder"
class=
"ds-icon-scene
"
/>
<
i
class=
"el-icon-folder
"
/>
</span>
<span
style=
"margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"
>
{{
data
.
name
}}
</span>
</span>
...
...
@@ -64,7 +64,7 @@
</span>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
:command=
"beforeClickEdit('folder','new',data,node)"
>
<
svg-icon
icon-class=
"folder"
class=
"ds-icon-scene
"
/>
&
nbsp
<span>
{{
$t
(
'panel.groupAdd'
)
}}
</span>
<
i
class=
"el-icon-folder
"
/>
&
nbsp
<span>
{{
$t
(
'panel.groupAdd'
)
}}
</span>
</el-dropdown-item>
<el-dropdown-item
:command=
"beforeClickEdit('panel','new',data,node)"
>
<svg-icon
icon-class=
"panel"
class=
"ds-icon-scene"
/>
&
nbsp
<span>
{{
$t
(
'panel.panelAdd'
)
}}
</span>
...
...
frontend/src/views/panel/template/component/TemplateImport.vue
0 → 100644
浏览文件 @
c7cf7505
<
template
>
<el-row>
<el-row
style=
"margin-top: 5px"
>
<el-col
:span=
"4"
>
{{
$t
(
'commons.name'
)
}}
</el-col>
<el-col
:span=
"16"
>
<el-input
v-model=
"templateInfo.name"
clearable
size=
"mini"
/>
</el-col>
<el-col
:span=
"4"
>
<el-button
style=
"margin-left: 10px"
class=
"el-icon-upload"
size=
"small"
type=
"primary"
@
click=
"goFile"
>
{{
$t
(
'panel.upload_template'
)
}}
</el-button>
<input
id=
"input"
ref=
"files"
type=
"file"
accept=
".DE"
hidden
@
change=
"handleFileChange"
>
</el-col>
</el-row>
<el-row
class=
"preview"
:style=
"classBackground"
/>
<el-row
class=
"root-class"
>
<el-button
size=
"mini"
@
click=
"cancel()"
>
{{
$t
(
'commons.cancel'
)
}}
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"save()"
>
{{
$t
(
'commons.confirm'
)
}}
</el-button>
</el-row>
</el-row>
</
template
>
<
script
>
import
{
save
}
from
'@/api/system/template'
export
default
{
props
:
{
pid
:
{
type
:
String
,
required
:
true
}
},
data
()
{
return
{
tableRadio
:
null
,
keyWordSearch
:
''
,
columnLabel
:
this
.
$t
(
'panel.belong_to_category'
),
templateList
:
[],
importTemplateInfo
:
{
snapshot
:
''
},
templateInfo
:
{
level
:
'1'
,
pid
:
this
.
pid
,
name
:
''
,
templateStyle
:
''
,
templateData
:
''
,
snapshot
:
''
}
}
},
computed
:
{
classBackground
()
{
if
(
this
.
importTemplateInfo
.
snapshot
)
{
return
{
background
:
`url(
${
this
.
importTemplateInfo
.
snapshot
}
) no-repeat`
}
}
else
{
return
{}
}
}
},
methods
:
{
handleExceed
(
file
)
{
},
cancel
()
{
this
.
$emit
(
'closeEditTemplateDialog'
)
},
save
()
{
if
(
!
this
.
templateInfo
.
name
)
{
this
.
$warning
(
this
.
$t
(
'chart.name_can_not_empty'
))
return
false
}
save
(
this
.
templateInfo
).
then
(
response
=>
{
this
.
$message
({
message
:
this
.
$t
(
'commons.save_success'
),
type
:
'success'
,
showClose
:
true
})
debugger
this
.
$emit
(
'closeEditTemplateDialog'
)
})
},
handleFileChange
(
e
)
{
const
file
=
e
.
target
.
files
[
0
]
const
reader
=
new
FileReader
()
reader
.
onload
=
(
res
)
=>
{
const
result
=
res
.
target
.
result
this
.
importTemplateInfo
=
JSON
.
parse
(
result
)
this
.
templateInfo
.
name
=
this
.
importTemplateInfo
.
name
this
.
templateInfo
.
templateStyle
=
this
.
importTemplateInfo
.
panelStyle
this
.
templateInfo
.
templateData
=
this
.
importTemplateInfo
.
panelData
this
.
templateInfo
.
snapshot
=
this
.
importTemplateInfo
.
snapshot
}
reader
.
readAsText
(
file
)
},
goFile
()
{
this
.
$refs
.
files
.
click
()
}
}
}
</
script
>
<
style
scoped
>
.my_table
>>>
.el-table__row
>
td
{
/* 去除表格线 */
border
:
none
;
padding
:
0
0
;
}
.my_table
>>>
.el-table
th
.is-leaf
{
/* 去除上边框 */
border
:
none
;
}
.my_table
>>>
.el-table
::before
{
/* 去除下边框 */
height
:
0
;
}
.root-class
{
margin
:
15px
0px
5px
;
text-align
:
center
;
}
.preview
{
margin-top
:
5px
;
border
:
1px
solid
#E6E6E6
;
height
:
300px
!important
;
overflow
:
auto
;
background-size
:
100%
100%
!important
;
}
.preview-show
{
border-left
:
1px
solid
#E6E6E6
;
height
:
300px
;
background-size
:
100%
100%
!important
;
}
</
style
>
frontend/src/views/panel/template/component/TemplateItem.vue
浏览文件 @
c7cf7505
...
...
@@ -4,7 +4,9 @@
<i
class=
"el-icon-error"
@
click
.
stop=
"templateDelete"
/>
<i
class=
"el-icon-edit"
@
click
.
stop=
"templateEdit"
/>
</div>
<span
class=
"demonstration"
>
{{
template
.
name
}}
</span>
<el-tooltip
class=
"item"
effect=
"light"
:content=
"template.name"
placement=
"bottom"
>
<span
class=
"demonstration"
>
{{
template
.
name
}}
</span>
</el-tooltip>
</div>
</
template
>
...
...
@@ -34,7 +36,7 @@ export default {
},
methods
:
{
templateDelete
()
{
this
.
$alert
(
this
.
$t
(
'panel.confirm_delete'
)
+
this
.
$t
(
'panel.template'
)
+
': '
+
this
.
template
.
name
+
'?'
,
''
,
{
this
.
$alert
(
this
.
$t
(
'panel.confirm_delete'
)
+
this
.
$t
(
'panel.template'
)
+
': '
+
this
.
template
.
name
+
'?'
,
''
,
{
confirmButtonText
:
this
.
$t
(
'panel.confirm'
),
callback
:
(
action
)
=>
{
if
(
action
===
'confirm'
)
{
...
...
@@ -63,6 +65,8 @@ export default {
.demonstration
{
display
:
block
;
font-size
:
14px
;
color
:
gray
;
text-align
:
center
;
margin
:
10px
auto
;
width
:
150px
;
...
...
frontend/src/views/panel/template/component/TemplateList.vue
浏览文件 @
c7cf7505
...
...
@@ -27,14 +27,11 @@
@
node-click=
"nodeClick"
>
<span
slot-scope=
"
{ node, data }" class="custom-tree-node">
<span>
<span
style=
"display: flex; flex: 1 1 0%; width: 0px;"
>
<span>
<el-button
icon=
"el-icon-folder"
type=
"text"
/>
<i
class=
"el-icon-folder"
/>
</span>
<span
style=
"margin-left: 6px"
>
{{
data
.
name
}}
</span>
<span
style=
"margin-left: 6px
;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
"
>
{{
data
.
name
}}
</span>
</span>
<span>
<span
@
click
.
stop
>
...
...
@@ -47,8 +44,11 @@
/>
</span>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
icon=
"el-icon-upload2"
:command=
"beforeClickMore('import',data,node)"
>
{{
$t
(
'panel.import'
)
}}
</el-dropdown-item>
<el-dropdown-item
icon=
"el-icon-edit"
:command=
"beforeClickMore('edit',data,node)"
>
{{
$t
(
'panel.rename'
)
}}
{{
$t
(
'panel.rename'
)
}}
</el-dropdown-item>
<el-dropdown-item
icon=
"el-icon-delete"
:command=
"beforeClickMore('delete',data,node)"
>
{{
$t
(
'panel.delete'
)
}}
...
...
@@ -108,6 +108,9 @@ export default {
case
'delete'
:
this
.
templateDelete
(
param
.
data
)
break
case
'import'
:
this
.
templateImport
(
param
.
data
)
break
}
},
beforeClickMore
(
type
,
data
,
node
)
{
...
...
@@ -129,7 +132,7 @@ export default {
this
.
$emit
(
'showTemplateEditDialog'
,
'new'
)
},
templateDelete
(
template
)
{
this
.
$alert
(
this
.
$t
(
'panel.confirm_delete'
)
+
this
.
$t
(
'panel.category'
)
+
': '
+
template
.
name
+
'?'
,
''
,
{
this
.
$alert
(
this
.
$t
(
'panel.confirm_delete'
)
+
this
.
$t
(
'panel.category'
)
+
': '
+
template
.
name
+
'?'
,
''
,
{
confirmButtonText
:
this
.
$t
(
'panel.confirm_delete'
),
callback
:
(
action
)
=>
{
if
(
action
===
'confirm'
)
{
...
...
@@ -140,6 +143,9 @@ export default {
},
templateEdit
(
template
)
{
this
.
$emit
(
'templateEdit'
,
template
)
},
templateImport
(
template
)
{
this
.
$emit
(
'templateImport'
,
template
.
id
)
}
}
}
...
...
frontend/src/views/panel/template/index.vue
浏览文件 @
c7cf7505
...
...
@@ -4,16 +4,28 @@
<el-tabs
v-model=
"currentTemplateType"
@
tab-click=
"handleClick"
>
<el-tab-pane
name=
"system"
>
<span
slot=
"label"
><i
class=
"el-icon-document"
/>
{{
$t
(
'panel.sys_template'
)
}}
</span>
<template-list
v-if=
"currentTemplateType==='system'"
:template-type=
"currentTemplateType"
:template-list=
"templateList"
@
templateDelete=
"templateDelete"
@
templateEdit=
"templateEdit"
@
showCurrentTemplate=
"showCurrentTemplate"
@
showTemplateEditDialog=
"showTemplateEditDialog"
/>
<template-list
v-if=
"currentTemplateType==='system'"
:template-type=
"currentTemplateType"
:template-list=
"templateList"
@
templateDelete=
"templateDelete"
@
templateEdit=
"templateEdit"
@
showCurrentTemplate=
"showCurrentTemplate"
@
templateImport=
"templateImport"
/>
</el-tab-pane>
<el-tab-pane
name=
"self"
>
<span
slot=
"label"
><i
class=
"el-icon-star-off"
/>
{{
$t
(
'panel.user_template'
)
}}
</span>
<!--v-if 重新渲染 强制刷新首行高亮属性-->
<template-list
v-if=
"currentTemplateType==='self'"
:template-type=
"currentTemplateType"
:template-list=
"templateList"
@
templateDelete=
"templateDelete"
@
templateEdit=
"templateEdit"
@
showCurrentTemplate=
"showCurrentTemplate"
@
showTemplateEditDialog=
"showTemplateEditDialog"
/>
<template-list
v-if=
"currentTemplateType==='self'"
:template-type=
"currentTemplateType"
:template-list=
"templateList"
@
templateDelete=
"templateDelete"
@
templateEdit=
"templateEdit"
@
showCurrentTemplate=
"showCurrentTemplate"
@
templateImport=
"templateImport"
/>
</el-tab-pane>
</el-tabs>
</de-aside-container>
...
...
@@ -38,6 +50,15 @@
</el-button>
</div>
</el-dialog>
<!--导入templatedialog-->
<el-dialog
:title=
"templateDialog.title"
:visible
.
sync=
"templateDialog.visible"
:show-close=
"true"
width=
"600px"
>
<template-import
v-if=
"templateDialog.visible"
:pid=
"templateDialog.pid"
@
closeEditTemplateDialog=
"closeEditTemplateDialog"
/>
</el-dialog>
</de-container>
</
template
>
...
...
@@ -47,11 +68,12 @@ import DeContainer from '@/components/dataease/DeContainer'
import
DeAsideContainer
from
'@/components/dataease/DeAsideContainer'
import
TemplateList
from
'./component/TemplateList'
import
TemplateItem
from
'./component/TemplateItem'
import
{
get
,
post
}
from
'@/api/panel/panel'
import
TemplateImport
from
'./component/TemplateImport'
import
{
save
,
templateDelete
,
showTemplateList
}
from
'@/api/system/template'
export
default
{
name
:
'PanelMain'
,
components
:
{
DeMainContainer
,
DeContainer
,
DeAsideContainer
,
TemplateList
,
TemplateItem
},
components
:
{
DeMainContainer
,
DeContainer
,
DeAsideContainer
,
TemplateList
,
TemplateItem
,
TemplateImport
},
data
()
{
return
{
showShare
:
false
,
...
...
@@ -66,7 +88,12 @@ export default {
templateEditForm
:
{},
editTemplate
:
false
,
dialogTitle
:
''
,
templateList
:
[]
templateList
:
[],
templateDialog
:
{
title
:
this
.
$t
(
'panel.import_template'
),
visible
:
false
,
pid
:
''
}
}
},
mounted
()
{
...
...
@@ -79,14 +106,14 @@ export default {
showCurrentTemplate
(
pid
)
{
this
.
currentTemplateId
=
pid
if
(
this
.
currentTemplateId
)
{
post
(
'/template/templateList'
,
{
pid
:
this
.
currentTemplateId
}).
then
(
response
=>
{
showTemplateList
(
{
pid
:
this
.
currentTemplateId
}).
then
(
response
=>
{
this
.
currentTemplateShowList
=
response
.
data
})
}
},
templateDelete
(
id
)
{
if
(
id
)
{
post
(
'/template/delete/'
+
id
,
null
).
then
(
response
=>
{
templateDelete
(
id
).
then
(
response
=>
{
this
.
$message
({
message
:
this
.
$t
(
'commons.delete_success'
),
type
:
'success'
,
...
...
@@ -110,7 +137,7 @@ export default {
this
.
showTemplateEditDialog
(
'edit'
,
templateInfo
)
},
saveTemplateEdit
(
templateEditForm
)
{
post
(
'/template/save'
,
templateEditForm
).
then
(
response
=>
{
save
(
templateEditForm
).
then
(
response
=>
{
this
.
$message
({
message
:
this
.
$t
(
'commons.save_success'
),
type
:
'success'
,
...
...
@@ -128,7 +155,7 @@ export default {
templateType
:
this
.
currentTemplateType
,
level
:
'0'
}
post
(
'/template/templateList'
,
request
).
then
(
res
=>
{
showTemplateList
(
request
).
then
(
res
=>
{
this
.
templateList
=
res
.
data
this
.
showFirst
()
})
...
...
@@ -153,6 +180,15 @@ export default {
}
else
{
this
.
currentTemplateShowList
=
[]
}
},
closeEditTemplateDialog
()
{
debugger
this
.
templateDialog
.
visible
=
false
this
.
showCurrentTemplate
(
this
.
templateDialog
.
pid
)
},
templateImport
(
pid
)
{
this
.
templateDialog
.
visible
=
true
this
.
templateDialog
.
pid
=
pid
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论