diff --git a/nezha-fronted/src/assets/css/components/common/popBox/selectDashboard.scss b/nezha-fronted/src/assets/css/components/common/popBox/selectDashboard.scss index 6728eb71c..fec23f1a0 100644 --- a/nezha-fronted/src/assets/css/components/common/popBox/selectDashboard.scss +++ b/nezha-fronted/src/assets/css/components/common/popBox/selectDashboard.scss @@ -122,25 +122,39 @@ } } .dashboard-select-tail{ + width: 162px; + background: #FF9219; + margin: 0 auto; border: none; display: flex; justify-content: center; + border-radius: 2px; + cursor: pointer; .dashboard-select-add{ - width: 88%; + flex: 1; height: 30px; - background: #FF9219; - border-radius: 2px; + font-size: 14px; color: #fff; display: flex; - font-size: 14px; justify-content: center; align-items: center; - cursor: pointer; i{ color: #fff; padding-left: 0; } } + .dashboard-addBy-template{ + width: 30px; + height: 30px; + font-size: 14px; + color: #fff; + display: flex; + justify-content: center; + align-items: center; + border-left: 1px solid #fff; + box-sizing: border-box; + position: relative; + } } } .pop-item-wider{ @@ -166,3 +180,12 @@ background: none; } } + +.dashboard-addBy-template-menu{ + width: 162px; + // padding: 8px 0; + box-sizing: border-box; + .el-dropdown-menu__item{ + line-height: 32px; + } +} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/popBox/selectDashboard.vue b/nezha-fronted/src/components/common/popBox/selectDashboard.vue index b8b44d056..ccffd7a93 100644 --- a/nezha-fronted/src/components/common/popBox/selectDashboard.vue +++ b/nezha-fronted/src/components/common/popBox/selectDashboard.vue @@ -9,9 +9,7 @@
- -   {{$t('overall.addDashboard')}} - +
@@ -165,14 +163,11 @@ export default { // 其他tab的数据(我的收藏、我的创建、最近浏览数据) otherData: [], // 收藏列表 - starredList: [] + starredList: [], + visible: false } }, methods: { - // 新增仪表盘 - toAdd () { - this.$parent.toAdd() - }, // 左侧tab点击 tabChange (value) { if (this.currentTab !== value) { diff --git a/nezha-fronted/src/components/common/rightBox/dashboardTempBox.vue b/nezha-fronted/src/components/common/rightBox/dashboardTempBox.vue new file mode 100644 index 000000000..c4e4ed1c8 --- /dev/null +++ b/nezha-fronted/src/components/common/rightBox/dashboardTempBox.vue @@ -0,0 +1,317 @@ + + + diff --git a/nezha-fronted/src/components/common/rightBox/panelBox.vue b/nezha-fronted/src/components/common/rightBox/panelBox.vue index fd054c50e..fdc5d08cf 100644 --- a/nezha-fronted/src/components/common/rightBox/panelBox.vue +++ b/nezha-fronted/src/components/common/rightBox/panelBox.vue @@ -21,8 +21,8 @@ - - + + {{item.name}} @@ -389,6 +389,9 @@ export default { name: [ { required: true, message: this.$t('validate.required'), trigger: 'blur' } ], + varType: [ + { required: true, message: this.$t('validate.required'), trigger: 'change' } + ], 'param.report.range.unit': [ { required: true, message: this.$t('validate.required'), trigger: 'change' } ], diff --git a/nezha-fronted/src/components/page/config/template/dashboardTemp.vue b/nezha-fronted/src/components/page/config/template/dashboardTemp.vue index e631fcba0..5d430320a 100644 --- a/nezha-fronted/src/components/page/config/template/dashboardTemp.vue +++ b/nezha-fronted/src/components/page/config/template/dashboardTemp.vue @@ -74,7 +74,7 @@ - +
diff --git a/nezha-fronted/src/components/page/dashboard/panel.vue b/nezha-fronted/src/components/page/dashboard/panel.vue index 02cd7b241..bd11f42b9 100644 --- a/nezha-fronted/src/components/page/dashboard/panel.vue +++ b/nezha-fronted/src/components/page/dashboard/panel.vue @@ -29,6 +29,23 @@ + + @@ -140,9 +157,13 @@ - + - + + + + + @@ -165,6 +186,7 @@ import htmlToPdfMixin from '@/components/common/mixin/htmlToPdfMixin' import exportHtmlMixin from '@/components/common/mixin/exportHtml' import panelVariables from '@/components/common/panel/panelVariables' import snapshotProgress from '@/components/common/snapshotProgress/snapshotProgress.vue' +import dashboardTempBox from '@/components/common/rightBox/dashboardTempBox' // import FileSaver from 'file-saver' // import chartData from './testData' export default { @@ -184,6 +206,7 @@ export default { rightBox: { // 面板弹出框相关 chart: { show: false }, chartTemp: { show: false }, + dashboardTemp: { show: false }, panel: { show: false }, loading: false }, @@ -324,7 +347,8 @@ export default { chartTempBox, chartRightBox, panelVariables, // 处理panel变量的组件 - snapshotProgress // 快照进度 + snapshotProgress, // 快照进度 + dashboardTempBox // dashboard模板 }, computed: { chartRightBoxShow () { @@ -338,6 +362,18 @@ export default { } }, methods: { + closeDashboardTempBox (refresh) { + this.rightBox.dashboardTemp.show = false + if (refresh) { + this.getTableData() + } + }, + // 通过dashboard模板创建 + addByTemplate () { + this.rightBox.dashboardTemp.show = true + // 关闭selectDashboard弹框 + this.$refs.selectDashboard && this.$refs.selectDashboard.esc() + }, // 新增收藏 addStarred (data) { this.$refs.selectDashboard.addStarred(data)